Class: Ruflet::UI::Controls::RufletComponents::PageControl

Inherits:
Control
  • Object
show all
Defined in:
lib/ruflet_ui/ruflet/ui/controls/shared/page_control.rb

Constant Summary collapse

TYPE =
"page".freeze
WIRE =
"Page".freeze
KEYWORDS =
[:adaptive, :badge, :client_ip, :client_user_agent, :col, :dark_theme, :data, :debug, :disabled, :enable_screenshots, :expand, :expand_loose, :fonts, :height, :key, :locale_configuration, :media, :multi_view, :multi_views, :opacity, :platform, :platform_brightness, :pwa, :pyodide, :route, :rtl, :sess, :show_semantics_debugger, :test, :theme, :theme_mode, :title, :tooltip, :views, :visible, :wasm, :web, :width, :window, :on_app_lifecycle_state_change, :on_close, :on_connect, :on_disconnect, :on_error, :on_keyboard_event, :on_locale_change, :on_login, :on_logout, :on_media_change, :on_multi_view_add, :on_multi_view_remove, :on_platform_brightness_change, :on_resize, :on_route_change, :on_view_pop].freeze

Constants inherited from Control

Control::HOST_EXPANDED_TYPES, Control::SCHEMA_METADATA_CACHE

Instance Attribute Summary

Attributes inherited from Control

#children, #id, #props, #runtime_page, #type, #wire_id

Instance Method Summary collapse

Methods inherited from Control

#attach_handler, #emit, generate_id, #has_handler?, #merge_props, #on, #to_patch

Constructor Details

#initialize(id: nil, **props) ⇒ PageControl

Returns a new instance of PageControl.



13
14
15
16
17
18
19
20
# File 'lib/ruflet_ui/ruflet/ui/controls/shared/page_control.rb', line 13

def initialize(id: nil, **props)
  compact = {}
  props.each do |key, value|
    raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
    compact[key] = value unless value.nil?
  end
  super(type: TYPE, id: id, **compact)
end