hakumi_components 0.1.16.pre → 0.1.17.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +169 -23
- data/app/assets/javascripts/hakumi_components.js +12 -12
- data/app/assets/stylesheets/hakumi_components.css +1 -1
- data/app/components/hakumi/alert/component.html.erb +12 -8
- data/app/components/hakumi/alert/component.rb +18 -62
- data/app/components/hakumi/base_component.rb +13 -0
- data/app/components/hakumi/card/component.html.erb +14 -22
- data/app/components/hakumi/card/component.rb +38 -31
- data/app/components/hakumi/checkbox/component.html.erb +39 -21
- data/app/components/hakumi/checkbox/component.rb +12 -2
- data/app/components/hakumi/collapse/component.html.erb +2 -2
- data/app/components/hakumi/collapse/component.rb +1 -1
- data/app/components/hakumi/collapse/panel/component.rb +9 -0
- data/app/components/hakumi/color_picker/component.rb +0 -4
- data/app/components/hakumi/drawer/component.html.erb +7 -7
- data/app/components/hakumi/drawer/component.rb +12 -19
- data/app/components/hakumi/input/component.rb +0 -2
- data/app/components/hakumi/input/text_area/component.rb +0 -2
- data/app/components/hakumi/input_number/component.rb +3 -4
- data/app/components/hakumi/mentions/component.rb +0 -1
- data/app/components/hakumi/modal/component.html.erb +40 -0
- data/app/components/hakumi/modal/component.rb +24 -102
- data/app/components/hakumi/modal/confirm/component.html.erb +23 -0
- data/app/components/hakumi/modal/confirm/component.rb +23 -41
- data/app/components/hakumi/modal/error/component.rb +12 -11
- data/app/components/hakumi/modal/info/component.rb +12 -11
- data/app/components/hakumi/modal/success/component.rb +12 -11
- data/app/components/hakumi/modal/warning/component.rb +15 -10
- data/app/components/hakumi/popconfirm/component.html.erb +25 -25
- data/app/components/hakumi/popconfirm/component.rb +11 -27
- data/app/components/hakumi/rate/component.rb +0 -1
- data/app/components/hakumi/segmented/component.rb +0 -4
- data/app/components/hakumi/slider/component.rb +2 -6
- data/app/components/hakumi/statistic/component.rb +0 -4
- data/app/components/hakumi/switch/component.html.erb +4 -0
- data/app/components/hakumi/switch/component.rb +1 -2
- data/app/components/hakumi/table/component.rb +3 -229
- data/app/components/hakumi/table/concerns/columns.rb +1 -1
- data/app/components/hakumi/table/concerns/editable.rb +121 -0
- data/app/components/hakumi/table/concerns/ellipsis.rb +63 -0
- data/app/components/hakumi/table/concerns/fixed_columns.rb +87 -0
- data/app/components/hakumi/transfer/component.rb +0 -4
- data/app/controllers/{hakumi_components → hakumi}/components_controller.rb +2 -2
- data/app/form_builders/hakumi/form_builder.rb +217 -175
- data/app/helpers/hakumi/form_helper.rb +39 -0
- data/app/javascript/hakumi_components/controllers/base/registry_controller.js +83 -3
- data/app/javascript/hakumi_components/controllers/hakumi/affix_controller.js +0 -23
- data/app/javascript/hakumi_components/controllers/hakumi/alert_controller.js +2 -1
- data/app/javascript/hakumi_components/controllers/hakumi/button_controller.js +0 -7
- data/app/javascript/hakumi_components/controllers/hakumi/calendar_controller.js +0 -2
- data/app/javascript/hakumi_components/controllers/hakumi/color_picker_controller.js +1 -6
- data/app/javascript/hakumi_components/controllers/hakumi/date_picker_controller.js +28 -34
- data/app/javascript/hakumi_components/controllers/hakumi/drawer_controller.js +2 -1
- data/app/javascript/hakumi_components/controllers/hakumi/form_item_controller.js +9 -63
- data/app/javascript/hakumi_components/controllers/hakumi/mentions_controller.js +4 -11
- data/app/javascript/hakumi_components/controllers/hakumi/message_controller.js +1 -1
- data/app/javascript/hakumi_components/controllers/hakumi/modal_controller.js +4 -20
- data/app/javascript/hakumi_components/controllers/hakumi/notification_controller.js +1 -1
- data/app/javascript/hakumi_components/controllers/hakumi/popconfirm_controller.js +33 -27
- data/app/javascript/hakumi_components/controllers/hakumi/popover_controller.js +2 -23
- data/app/javascript/hakumi_components/controllers/hakumi/qr_code_controller.js +0 -20
- data/app/javascript/hakumi_components/controllers/hakumi/segmented_controller.js +0 -2
- data/app/javascript/hakumi_components/controllers/hakumi/spin_controller.js +1 -19
- data/app/javascript/hakumi_components/controllers/hakumi/statistic_controller.js +0 -2
- data/app/javascript/hakumi_components/controllers/hakumi/table_controller.js +48 -74
- data/app/javascript/hakumi_components/controllers/hakumi/tag_controller.js +15 -14
- data/app/javascript/hakumi_components/controllers/hakumi/tag_group_controller.js +14 -13
- data/app/javascript/hakumi_components/controllers/hakumi/theme_controller.js +24 -1
- data/app/javascript/hakumi_components/controllers/hakumi/time_picker_controller.js +3 -7
- data/app/javascript/hakumi_components/controllers/hakumi/timeline_controller.js +0 -16
- data/app/javascript/hakumi_components/controllers/hakumi/transfer_controller.js +2 -2
- data/app/javascript/hakumi_components/controllers/hakumi/tree_controller.js +0 -2
- data/app/javascript/hakumi_components/controllers/hakumi/tree_select_controller.js +3 -3
- data/app/javascript/hakumi_components/controllers/hakumi/upload_controller.js +12 -26
- data/app/javascript/hakumi_components/core/persistence.js +3 -3
- data/app/javascript/hakumi_components/core/render_component.js +3 -1
- data/app/javascript/lib/validation_manager.js +101 -0
- data/app/javascript/stylesheets/_theme-tokens.scss +2 -1
- data/app/javascript/stylesheets/components/_modal.scss +13 -0
- data/app/services/{hakumi_components → hakumi}/component_handler.rb +1 -1
- data/app/services/hakumi/icon/loader.rb +2 -2
- data/app/services/hakumi/illustrations/loader.rb +3 -3
- data/app/views/hakumi/_drawer.html.erb +21 -0
- data/app/views/hakumi/_modal.html.erb +18 -0
- data/lib/hakumi_components/documentation.rb +127 -0
- data/lib/hakumi_components/engine.rb +13 -4
- data/lib/hakumi_components/rails/attribute_introspection.rb +1 -1
- data/lib/hakumi_components/rails/validation_introspection.rb +5 -5
- data/lib/hakumi_components/rails/validation_mapper.rb +484 -0
- data/lib/hakumi_components/rails.rb +2 -1
- data/lib/hakumi_components/version.rb +2 -2
- data/lib/hakumi_components.rb +3 -1
- data/lib/tasks/coverage.rake +37 -0
- data/sig/hakumi/base_component.rbs +5 -0
- data/sig/hakumi/checkbox/component.rbs +10 -0
- data/sig/hakumi/color_picker/component.rbs +0 -1
- data/sig/hakumi/form_builder.rbs +9 -1
- data/sig/{hakumi_components → hakumi}/rails/attribute_introspection.rbs +1 -1
- data/sig/{hakumi_components → hakumi}/rails/validation_introspection.rbs +1 -1
- data/sig/hakumi/rails/validation_mapper.rbs +53 -0
- data/sig/{hakumi_components → hakumi}/rails.rbs +1 -1
- data/sig/hakumi/segmented/component.rbs +0 -1
- data/sig/hakumi/slider/component.rbs +0 -1
- data/sig/hakumi/statistic/component.rbs +0 -2
- data/sig/hakumi/table/component.rbs +3 -4
- data/sig/hakumi/table/concerns/columns.rbs +2 -1
- data/sig/hakumi/table/concerns/editable.rbs +40 -0
- data/sig/hakumi/table/concerns/ellipsis.rbs +27 -0
- data/sig/hakumi/table/concerns/fixed_columns.rbs +33 -0
- data/sig/hakumi/transfer/component.rbs +0 -1
- data/sig/{hakumi_components.rbs → hakumi.rbs} +20 -3
- data/sig/rails/active_model/validations/comparison_validator.rbs +6 -0
- metadata +44 -29
- data/app/views/hakumi_components/_drawer.html.erb +0 -3
- data/app/views/hakumi_components/_modal.html.erb +0 -3
- /data/app/views/{hakumi_components → hakumi}/_admin_panel.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_affix.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_alert.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_confirm.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_message.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_notification.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_popconfirm.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_popover.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_qr_code.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_result.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_segmented.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_skeleton.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_spin.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_statistic.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_table.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_tag.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_timeline.html.erb +0 -0
- /data/app/views/{hakumi_components → hakumi}/_tree.html.erb +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Hakumi
|
|
4
|
+
module Rails
|
|
5
|
+
class ValidationMapper
|
|
6
|
+
type validator = _Validator
|
|
7
|
+
type model_object = _ModelObject
|
|
8
|
+
|
|
9
|
+
interface _Validator
|
|
10
|
+
def options: () -> Hash[Symbol, untyped]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
interface _ModelObject
|
|
14
|
+
def errors: () -> _Errors
|
|
15
|
+
def class: () -> Class
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
interface _Errors
|
|
19
|
+
def generate_message: (Symbol attribute, Symbol type, Hash[Symbol, untyped] options) -> String
|
|
20
|
+
def full_message: (Symbol attribute, String message) -> String
|
|
21
|
+
def respond_to?: (Symbol method) -> bool
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Public methods
|
|
25
|
+
def self.to_frontend_rules: (untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
26
|
+
def self.merge_rules: (Array[Hash[Symbol, untyped]]? manual_rules, Array[Hash[Symbol, untyped]] auto_rules) -> Array[Hash[Symbol, untyped]]
|
|
27
|
+
|
|
28
|
+
# Private methods
|
|
29
|
+
def self.extract_rule_type: (Hash[Symbol, untyped] rule) -> Symbol?
|
|
30
|
+
def self.map_validator: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]?
|
|
31
|
+
def self.map_presence: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
32
|
+
def self.map_length: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
33
|
+
def self.map_numericality: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
34
|
+
def self.map_format: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
35
|
+
def self.map_confirmation: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
36
|
+
def self.map_comparison: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
37
|
+
def self.map_inclusion: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
38
|
+
def self.map_exclusion: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
39
|
+
def self.map_acceptance: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
40
|
+
def self.map_absence: (validator validator, untyped object, Symbol attribute) -> Array[Hash[Symbol, untyped]]
|
|
41
|
+
def self.email_regex?: (String regex_source) -> bool
|
|
42
|
+
def self.url_regex?: (String regex_source) -> bool
|
|
43
|
+
def self.humanize: (Symbol attribute) -> String
|
|
44
|
+
def self.validation_message: (untyped object, Symbol attribute, Symbol type, Hash[Symbol, untyped] options, Hash[Symbol, untyped] validator_options) -> String
|
|
45
|
+
def self.anonymous_class?: (untyped object) -> bool
|
|
46
|
+
def self.build_comparison_target: (untyped target, untyped object) -> Hash[Symbol, untyped]?
|
|
47
|
+
def self.comparison_message_options: (untyped target, untyped object, Hash[Symbol, untyped] comparison) -> Hash[Symbol, untyped]
|
|
48
|
+
def self.resolve_comparison_value: (untyped target, untyped object) -> untyped
|
|
49
|
+
def self.fallback_message: (Symbol attribute, Symbol type, Hash[Symbol, untyped] options, Hash[Symbol, untyped] validator_options) -> String
|
|
50
|
+
def self.fallback_message_text: (Symbol type, Hash[Symbol, untyped] options) -> String
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -66,7 +66,6 @@ module Hakumi
|
|
|
66
66
|
def data_attributes: () -> hakumi_html_options
|
|
67
67
|
def normalize_value: ((String | Integer | Symbol)? value, (String | Integer | Symbol)? default_value) -> (String | nil)
|
|
68
68
|
def normalize_size: ((String | Symbol)? size) -> (Symbol | nil)
|
|
69
|
-
def cast_boolean: (untyped value) -> bool
|
|
70
69
|
def normalize_string: (untyped value) -> (String | nil)
|
|
71
70
|
end
|
|
72
71
|
end
|
|
@@ -80,7 +80,6 @@ module Hakumi
|
|
|
80
80
|
def handle_bounds_value: ((numeric_or_string | Array[numeric_or_string])? value) -> String?
|
|
81
81
|
def normalize_marks: (marks_input? marks) -> Array[Hash[Symbol, numeric_or_string]]
|
|
82
82
|
def position_percent: (numeric_or_string value) -> Numeric
|
|
83
|
-
def cast_boolean: (untyped value) -> bool
|
|
84
83
|
end
|
|
85
84
|
end
|
|
86
85
|
end
|
|
@@ -85,8 +85,6 @@ module Hakumi
|
|
|
85
85
|
|
|
86
86
|
def format_duration: ((Integer | Float) milliseconds, String format) -> String
|
|
87
87
|
|
|
88
|
-
def cast_boolean: (untyped value) -> bool
|
|
89
|
-
|
|
90
88
|
def normalize_precision: (untyped value) -> Integer?
|
|
91
89
|
|
|
92
90
|
def normalize_duration: (untyped value) -> Numeric
|
|
@@ -4,6 +4,9 @@ module Hakumi
|
|
|
4
4
|
module Table
|
|
5
5
|
class Component < Hakumi::BaseComponent
|
|
6
6
|
include Concerns::Columns
|
|
7
|
+
include Concerns::Editable
|
|
8
|
+
include Concerns::FixedColumns
|
|
9
|
+
include Concerns::Ellipsis
|
|
7
10
|
|
|
8
11
|
# Type aliases for Table component
|
|
9
12
|
type table_size = :default | :middle | :small
|
|
@@ -115,9 +118,6 @@ module Hakumi
|
|
|
115
118
|
SORT_DIRECTIONS: Array[sort_direction]
|
|
116
119
|
FIXED_SIDES: Array[fixed_side]
|
|
117
120
|
RESPONSIVE_BREAKPOINTS: Array[responsive_breakpoint]
|
|
118
|
-
EDITABLE_MODES: Array[editable_mode]
|
|
119
|
-
EDITABLE_TRIGGERS: Array[editable_trigger]
|
|
120
|
-
EDITABLE_INPUT_TYPES: Array[editable_input_type]
|
|
121
121
|
ROW_BUTTON_ACTIONS: Array[row_button_action]
|
|
122
122
|
|
|
123
123
|
SELECTION_COLUMN: Symbol
|
|
@@ -244,7 +244,6 @@ module Hakumi
|
|
|
244
244
|
def normalize_expandable!: () -> void
|
|
245
245
|
def validate_props!: () -> void
|
|
246
246
|
def normalize_scroll: (untyped value) -> (Hash[Symbol, String?] | nil)
|
|
247
|
-
def cast_boolean: (untyped value) -> bool
|
|
248
247
|
def fixed_offsets: () -> Hash[Symbol, Hash[Symbol, untyped]]
|
|
249
248
|
def apply_fixed_column_attributes!: (Hash[Symbol, untyped] attrs, column_hash column, header: bool) -> void
|
|
250
249
|
def apply_editable_attributes!: (Hash[Symbol, untyped] attrs, column_hash column) -> void
|
|
@@ -75,9 +75,10 @@ module Hakumi
|
|
|
75
75
|
# Recursively build header rows
|
|
76
76
|
def build_rows_recursive: (Array[column_hash] columns, Integer level, Array[Array[column_hash]] rows, Integer max_depth) -> void
|
|
77
77
|
|
|
78
|
-
# Methods expected from Table::Component
|
|
78
|
+
# Methods expected from Table::Component (via BaseComponent)
|
|
79
79
|
def columns_data: () -> Array[column_like]
|
|
80
80
|
def compute_fixed_offsets: (Array[column_hash] columns) -> void
|
|
81
|
+
def generate_id: (String prefix, ?length: Integer) -> String
|
|
81
82
|
# normalize_ellipsis_option: can be bool, hash, or string
|
|
82
83
|
def normalize_ellipsis_option: ((bool | Hash[Symbol, untyped] | String)? option) -> (Hash[Symbol, untyped] | nil)
|
|
83
84
|
# normalize_responsive_breakpoints: can be array or single value
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Hakumi
|
|
4
|
+
module Table
|
|
5
|
+
module Concerns
|
|
6
|
+
# Editable cell and row functionality for Table component
|
|
7
|
+
module Editable
|
|
8
|
+
EDITABLE_MODES: Array[Symbol]
|
|
9
|
+
EDITABLE_TRIGGERS: Array[Symbol]
|
|
10
|
+
EDITABLE_INPUT_TYPES: Array[Symbol]
|
|
11
|
+
|
|
12
|
+
# Returns JSON configuration for the table-level editable settings
|
|
13
|
+
def editable_config_json: () -> String?
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
# Normalizes the table-level editable configuration
|
|
18
|
+
def normalize_editable: (untyped value) -> untyped
|
|
19
|
+
|
|
20
|
+
# Normalizes column-level editable configuration
|
|
21
|
+
def normalize_column_editable: (untyped value) -> untyped
|
|
22
|
+
|
|
23
|
+
# Normalizes should_cell_update hook name
|
|
24
|
+
def normalize_should_cell_update: (untyped value) -> untyped
|
|
25
|
+
|
|
26
|
+
# Applies editable attributes to cell
|
|
27
|
+
def apply_editable_attributes!: (Hash[Symbol, untyped] attrs, Hash[Symbol, untyped] column) -> void
|
|
28
|
+
|
|
29
|
+
# Applies should_cell_update attributes to cell
|
|
30
|
+
def apply_should_cell_update_attributes!: (Hash[Symbol, untyped] attrs, Hash[Symbol, untyped] column) -> void
|
|
31
|
+
|
|
32
|
+
# Returns the editable payload for a specific cell/column
|
|
33
|
+
def cell_editable_payload: (Hash[Symbol, untyped] column) -> untyped
|
|
34
|
+
|
|
35
|
+
# Instance variable from Table::Component
|
|
36
|
+
@editable: untyped
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Hakumi
|
|
4
|
+
module Table
|
|
5
|
+
module Concerns
|
|
6
|
+
# Text ellipsis and tooltip handling for Table cells
|
|
7
|
+
module Ellipsis
|
|
8
|
+
private
|
|
9
|
+
|
|
10
|
+
# Get ellipsis config from column
|
|
11
|
+
def ellipsis_config: (Hash[Symbol, untyped] column) -> untyped
|
|
12
|
+
|
|
13
|
+
# Normalize ellipsis option
|
|
14
|
+
def normalize_ellipsis_option: (untyped option) -> untyped
|
|
15
|
+
|
|
16
|
+
# Normalize ellipsis tooltip option
|
|
17
|
+
def normalize_ellipsis_tooltip_option: (untyped option) -> untyped
|
|
18
|
+
|
|
19
|
+
# Get ellipsis title for cell
|
|
20
|
+
def ellipsis_title: (untyped config, untyped raw_value, untyped content_fragment) -> untyped
|
|
21
|
+
|
|
22
|
+
# Get ellipsis tooltip component for cell
|
|
23
|
+
def ellipsis_tooltip_component: (untyped config, untyped raw_value, untyped row, Integer row_index) -> untyped
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Hakumi
|
|
4
|
+
module Table
|
|
5
|
+
module Concerns
|
|
6
|
+
# Fixed (sticky) column positioning for Table component
|
|
7
|
+
module FixedColumns
|
|
8
|
+
# Check if table has any fixed columns
|
|
9
|
+
def fixed_columns?: () -> bool
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
# Get or initialize fixed offsets hash
|
|
14
|
+
def fixed_offsets: () -> Hash[untyped, untyped]
|
|
15
|
+
|
|
16
|
+
# Applies fixed column positioning attributes to cell
|
|
17
|
+
def apply_fixed_column_attributes!: (Hash[Symbol, untyped] attrs, Hash[Symbol, untyped] column, ?header: bool) -> void
|
|
18
|
+
|
|
19
|
+
# Compute fixed column offsets from left and right
|
|
20
|
+
def compute_fixed_offsets: (Array[Hash[Symbol, untyped]] leaf_columns) -> void
|
|
21
|
+
|
|
22
|
+
# Get width for fixed column (must be defined)
|
|
23
|
+
def fixed_column_width!: (Hash[Symbol, untyped] column) -> untyped
|
|
24
|
+
|
|
25
|
+
# Convert width value to numeric
|
|
26
|
+
def numeric_width: (untyped value) -> untyped
|
|
27
|
+
|
|
28
|
+
# Instance variable for fixed offsets
|
|
29
|
+
@fixed_offsets: Hash[untyped, untyped]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -68,7 +68,6 @@ module Hakumi
|
|
|
68
68
|
def normalize_data_source: (Array[untyped] data_source) -> Array[Hash[Symbol, untyped]]
|
|
69
69
|
def normalize_titles: ((Array[String] | String)? titles) -> Array[Array[String] | String]
|
|
70
70
|
def normalize_operations: (Hash[Symbol, Symbol]? operations) -> Hash[Symbol, Symbol]
|
|
71
|
-
def cast_boolean: (untyped value) -> bool
|
|
72
71
|
def normalize_string: (untyped value) -> String?
|
|
73
72
|
def validate_props!: () -> void
|
|
74
73
|
end
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Main module for Hakumi Components
|
|
4
|
-
module
|
|
4
|
+
module Hakumi
|
|
5
5
|
VERSION: String
|
|
6
6
|
|
|
7
|
+
# Documentation module for accessing component docs and examples
|
|
8
|
+
module Documentation
|
|
9
|
+
def self.components_root: () -> Pathname
|
|
10
|
+
def self.components: () -> Array[String]
|
|
11
|
+
def self.metadata: (String component_name) -> Hash[String, untyped]?
|
|
12
|
+
def self.examples: (String component_name) -> Array[Hash[String, untyped]]
|
|
13
|
+
def self.example: (String component_name, String example_name) -> String?
|
|
14
|
+
def self.example_path_for: (String component_name, String example_name) -> Pathname?
|
|
15
|
+
def self.api: (String component_name) -> Array[Hash[String, untyped]]
|
|
16
|
+
def self.all: () -> Hash[String, untyped]
|
|
17
|
+
def self.to_json: (*untyped _args) -> String
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def self.meta_path_for: (String component_name) -> Pathname
|
|
22
|
+
end
|
|
23
|
+
|
|
7
24
|
# Engine configuration
|
|
8
25
|
class Engine < ::Rails::Engine
|
|
9
26
|
def self.root: () -> Pathname
|
|
10
27
|
end
|
|
11
28
|
|
|
12
|
-
def self.configure: () { (
|
|
13
|
-
def self.configuration: () ->
|
|
29
|
+
def self.configure: () { (Hakumi::Configuration) -> void } -> void
|
|
30
|
+
def self.configuration: () -> Hakumi::Configuration
|
|
14
31
|
|
|
15
32
|
# Error classes
|
|
16
33
|
class Error < StandardError
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hakumi_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.17.pre
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kb714
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -67,7 +67,8 @@ dependencies:
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '4.0'
|
|
69
69
|
description: Reusable Hakumi Components inspired by Ant Design.
|
|
70
|
-
email:
|
|
70
|
+
email:
|
|
71
|
+
- hello@hakumi.dev
|
|
71
72
|
executables: []
|
|
72
73
|
extensions: []
|
|
73
74
|
extra_rdoc_files: []
|
|
@@ -1014,7 +1015,9 @@ files:
|
|
|
1014
1015
|
- app/components/hakumi/menu/sub_menu/component.rb
|
|
1015
1016
|
- app/components/hakumi/message/component.html.erb
|
|
1016
1017
|
- app/components/hakumi/message/component.rb
|
|
1018
|
+
- app/components/hakumi/modal/component.html.erb
|
|
1017
1019
|
- app/components/hakumi/modal/component.rb
|
|
1020
|
+
- app/components/hakumi/modal/confirm/component.html.erb
|
|
1018
1021
|
- app/components/hakumi/modal/confirm/component.rb
|
|
1019
1022
|
- app/components/hakumi/modal/error/component.rb
|
|
1020
1023
|
- app/components/hakumi/modal/info/component.rb
|
|
@@ -1080,6 +1083,9 @@ files:
|
|
|
1080
1083
|
- app/components/hakumi/table/component.html.erb
|
|
1081
1084
|
- app/components/hakumi/table/component.rb
|
|
1082
1085
|
- app/components/hakumi/table/concerns/columns.rb
|
|
1086
|
+
- app/components/hakumi/table/concerns/editable.rb
|
|
1087
|
+
- app/components/hakumi/table/concerns/ellipsis.rb
|
|
1088
|
+
- app/components/hakumi/table/concerns/fixed_columns.rb
|
|
1083
1089
|
- app/components/hakumi/tabs/component.html.erb
|
|
1084
1090
|
- app/components/hakumi/tabs/component.rb
|
|
1085
1091
|
- app/components/hakumi/tabs/item/component.rb
|
|
@@ -1108,8 +1114,9 @@ files:
|
|
|
1108
1114
|
- app/components/hakumi/typography/title/component.rb
|
|
1109
1115
|
- app/components/hakumi/upload/component.html.erb
|
|
1110
1116
|
- app/components/hakumi/upload/component.rb
|
|
1111
|
-
- app/controllers/
|
|
1117
|
+
- app/controllers/hakumi/components_controller.rb
|
|
1112
1118
|
- app/form_builders/hakumi/form_builder.rb
|
|
1119
|
+
- app/helpers/hakumi/form_helper.rb
|
|
1113
1120
|
- app/javascript/hakumi_components/_controllers_manifest.js
|
|
1114
1121
|
- app/javascript/hakumi_components/boot.js
|
|
1115
1122
|
- app/javascript/hakumi_components/controllers/base/registry_controller.js
|
|
@@ -1255,40 +1262,44 @@ files:
|
|
|
1255
1262
|
- app/javascript/stylesheets/components/_tree_select.scss
|
|
1256
1263
|
- app/javascript/stylesheets/components/_typography.scss
|
|
1257
1264
|
- app/javascript/stylesheets/components/_upload.scss
|
|
1265
|
+
- app/services/hakumi/component_handler.rb
|
|
1258
1266
|
- app/services/hakumi/icon/loader.rb
|
|
1259
1267
|
- app/services/hakumi/illustrations/loader.rb
|
|
1260
|
-
- app/
|
|
1268
|
+
- app/views/hakumi/_admin_panel.html.erb
|
|
1269
|
+
- app/views/hakumi/_affix.html.erb
|
|
1270
|
+
- app/views/hakumi/_alert.html.erb
|
|
1271
|
+
- app/views/hakumi/_confirm.html.erb
|
|
1272
|
+
- app/views/hakumi/_drawer.html.erb
|
|
1273
|
+
- app/views/hakumi/_message.html.erb
|
|
1274
|
+
- app/views/hakumi/_modal.html.erb
|
|
1275
|
+
- app/views/hakumi/_notification.html.erb
|
|
1276
|
+
- app/views/hakumi/_popconfirm.html.erb
|
|
1277
|
+
- app/views/hakumi/_popover.html.erb
|
|
1278
|
+
- app/views/hakumi/_qr_code.html.erb
|
|
1279
|
+
- app/views/hakumi/_result.html.erb
|
|
1280
|
+
- app/views/hakumi/_segmented.html.erb
|
|
1281
|
+
- app/views/hakumi/_skeleton.html.erb
|
|
1282
|
+
- app/views/hakumi/_spin.html.erb
|
|
1283
|
+
- app/views/hakumi/_statistic.html.erb
|
|
1284
|
+
- app/views/hakumi/_table.html.erb
|
|
1285
|
+
- app/views/hakumi/_tag.html.erb
|
|
1286
|
+
- app/views/hakumi/_timeline.html.erb
|
|
1287
|
+
- app/views/hakumi/_tree.html.erb
|
|
1261
1288
|
- app/views/hakumi/time_picker/_columns.html.erb
|
|
1262
|
-
- app/views/hakumi_components/_admin_panel.html.erb
|
|
1263
|
-
- app/views/hakumi_components/_affix.html.erb
|
|
1264
|
-
- app/views/hakumi_components/_alert.html.erb
|
|
1265
|
-
- app/views/hakumi_components/_confirm.html.erb
|
|
1266
|
-
- app/views/hakumi_components/_drawer.html.erb
|
|
1267
|
-
- app/views/hakumi_components/_message.html.erb
|
|
1268
|
-
- app/views/hakumi_components/_modal.html.erb
|
|
1269
|
-
- app/views/hakumi_components/_notification.html.erb
|
|
1270
|
-
- app/views/hakumi_components/_popconfirm.html.erb
|
|
1271
|
-
- app/views/hakumi_components/_popover.html.erb
|
|
1272
|
-
- app/views/hakumi_components/_qr_code.html.erb
|
|
1273
|
-
- app/views/hakumi_components/_result.html.erb
|
|
1274
|
-
- app/views/hakumi_components/_segmented.html.erb
|
|
1275
|
-
- app/views/hakumi_components/_skeleton.html.erb
|
|
1276
|
-
- app/views/hakumi_components/_spin.html.erb
|
|
1277
|
-
- app/views/hakumi_components/_statistic.html.erb
|
|
1278
|
-
- app/views/hakumi_components/_table.html.erb
|
|
1279
|
-
- app/views/hakumi_components/_tag.html.erb
|
|
1280
|
-
- app/views/hakumi_components/_timeline.html.erb
|
|
1281
|
-
- app/views/hakumi_components/_tree.html.erb
|
|
1282
1289
|
- lib/generators/hakumi/install_generator.rb
|
|
1283
1290
|
- lib/hakumi_components.rb
|
|
1291
|
+
- lib/hakumi_components/documentation.rb
|
|
1284
1292
|
- lib/hakumi_components/engine.rb
|
|
1285
1293
|
- lib/hakumi_components/rails.rb
|
|
1286
1294
|
- lib/hakumi_components/rails/attribute_introspection.rb
|
|
1287
1295
|
- lib/hakumi_components/rails/validation_introspection.rb
|
|
1296
|
+
- lib/hakumi_components/rails/validation_mapper.rb
|
|
1288
1297
|
- lib/hakumi_components/version.rb
|
|
1298
|
+
- lib/tasks/coverage.rake
|
|
1289
1299
|
- sig/action_view/tag_builder.rbs
|
|
1290
1300
|
- sig/active_support/concern_patch.rbs
|
|
1291
1301
|
- sig/generators/hakumi/install_generator.rbs
|
|
1302
|
+
- sig/hakumi.rbs
|
|
1292
1303
|
- sig/hakumi/admin_panel/component.rbs
|
|
1293
1304
|
- sig/hakumi/affix/component.rbs
|
|
1294
1305
|
- sig/hakumi/alert/component.rbs
|
|
@@ -1367,6 +1378,10 @@ files:
|
|
|
1367
1378
|
- sig/hakumi/qr_code/component.rbs
|
|
1368
1379
|
- sig/hakumi/radio/component.rbs
|
|
1369
1380
|
- sig/hakumi/radio/group/component.rbs
|
|
1381
|
+
- sig/hakumi/rails.rbs
|
|
1382
|
+
- sig/hakumi/rails/attribute_introspection.rbs
|
|
1383
|
+
- sig/hakumi/rails/validation_introspection.rbs
|
|
1384
|
+
- sig/hakumi/rails/validation_mapper.rbs
|
|
1370
1385
|
- sig/hakumi/rate/component.rbs
|
|
1371
1386
|
- sig/hakumi/result/component.rbs
|
|
1372
1387
|
- sig/hakumi/segmented/component.rbs
|
|
@@ -1391,6 +1406,9 @@ files:
|
|
|
1391
1406
|
- sig/hakumi/table/column_group/component.rbs
|
|
1392
1407
|
- sig/hakumi/table/component.rbs
|
|
1393
1408
|
- sig/hakumi/table/concerns/columns.rbs
|
|
1409
|
+
- sig/hakumi/table/concerns/editable.rbs
|
|
1410
|
+
- sig/hakumi/table/concerns/ellipsis.rbs
|
|
1411
|
+
- sig/hakumi/table/concerns/fixed_columns.rbs
|
|
1394
1412
|
- sig/hakumi/tabs/component.rbs
|
|
1395
1413
|
- sig/hakumi/tabs/item/component.rbs
|
|
1396
1414
|
- sig/hakumi/tag/component.rbs
|
|
@@ -1409,11 +1427,8 @@ files:
|
|
|
1409
1427
|
- sig/hakumi/typography/text/component.rbs
|
|
1410
1428
|
- sig/hakumi/typography/title/component.rbs
|
|
1411
1429
|
- sig/hakumi/upload/component.rbs
|
|
1412
|
-
- sig/hakumi_components.rbs
|
|
1413
|
-
- sig/hakumi_components/rails.rbs
|
|
1414
|
-
- sig/hakumi_components/rails/attribute_introspection.rbs
|
|
1415
|
-
- sig/hakumi_components/rails/validation_introspection.rbs
|
|
1416
1430
|
- sig/rails.rbs
|
|
1431
|
+
- sig/rails/active_model/validations/comparison_validator.rbs
|
|
1417
1432
|
- sig/view_component/base.rbs
|
|
1418
1433
|
homepage: https://github.com/hakumi-dev/hakumi-components
|
|
1419
1434
|
licenses:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|