playbook_ui_docs 16.5.0 → 16.6.0.pre.alpha.RTEPOC15805
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/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +8970 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +403 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_grouped_simple.json +41 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_grouped_triple.json +56 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_standard.json +31 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_standard_sort.json +37 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_styling.json +44 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_column_definitions_with_ids.json +38 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_inline_loading.json +199 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_playground.json +136 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_playground.overrides.json +94 -0
- data/app/pb_kits/playbook/pb_background/docs/_playground.json +107 -0
- data/app/pb_kits/playbook/pb_background/docs/_playground.overrides.json +72 -0
- data/app/pb_kits/playbook/pb_badge/docs/_playground.json +112 -0
- data/app/pb_kits/playbook/pb_badge/docs/_playground.overrides.json +63 -0
- data/app/pb_kits/playbook/pb_body/docs/_playground.json +78 -0
- data/app/pb_kits/playbook/pb_body/docs/_playground.overrides.json +47 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_playground.json +54 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_playground.overrides.json +44 -0
- data/app/pb_kits/playbook/pb_button/docs/{_button_loading.html.erb → _button_loading_rails.html.erb} +5 -5
- data/app/pb_kits/playbook/pb_button/docs/_button_loading_rails.md +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_playground.json +164 -0
- data/app/pb_kits/playbook/pb_button/docs/_playground.overrides.json +45 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_playground.json +81 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_playground.overrides.json +54 -0
- data/app/pb_kits/playbook/pb_caption/docs/_playground.json +64 -0
- data/app/pb_kits/playbook/pb_caption/docs/_playground.overrides.json +39 -0
- data/app/pb_kits/playbook/pb_card/docs/_playground.json +157 -0
- data/app/pb_kits/playbook/pb_card/docs/_playground.overrides.json +119 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_playground.json +80 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/_playground.overrides.json +58 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_playground.json +113 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_playground.overrides.json +62 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_playground.json +91 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_playground.overrides.json +65 -0
- data/app/pb_kits/playbook/pb_contact/docs/_playground.json +69 -0
- data/app/pb_kits/playbook/pb_contact/docs/_playground.overrides.json +60 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_playground.json +120 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_playground.overrides.json +96 -0
- data/app/pb_kits/playbook/pb_currency/docs/_playground.json +117 -0
- data/app/pb_kits/playbook/pb_currency/docs/_playground.overrides.json +98 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_playground.json +87 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_playground.overrides.json +19 -0
- data/app/pb_kits/playbook/pb_date/docs/_playground.json +73 -0
- data/app/pb_kits/playbook/pb_date/docs/_playground.overrides.json +54 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.jsx +62 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_playground.json +178 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_playground.overrides.json +156 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_playground.json +31 -0
- data/app/pb_kits/playbook/pb_date_range_stacked/docs/_playground.json +23 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_playground.json +68 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_playground.overrides.json +51 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_playground.json +76 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_playground.overrides.json +58 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_playground.json +57 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_playground.overrides.json +46 -0
- data/app/pb_kits/playbook/pb_date_year_stacked/docs/_playground.json +45 -0
- data/app/pb_kits/playbook/pb_date_year_stacked/docs/_playground.overrides.json +36 -0
- data/app/pb_kits/playbook/pb_detail/docs/_playground.json +75 -0
- data/app/pb_kits/playbook/pb_detail/docs/_playground.overrides.json +44 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_playground.json +121 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_playground.overrides.json +95 -0
- data/app/pb_kits/playbook/pb_distribution_bar/docs/_playground.json +25 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_playground.json +54 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_playground.overrides.json +34 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.json +236 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.overrides.json +137 -0
- data/app/pb_kits/playbook/pb_empty_state/docs/_playground.json +34 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_playground.json +34 -0
- data/app/pb_kits/playbook/pb_filter/docs/_playground.json +13 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_playground.json +37 -0
- data/app/pb_kits/playbook/pb_flex/docs/_playground.json +133 -0
- data/app/pb_kits/playbook/pb_flex/docs/_playground.overrides.json +105 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +5 -5
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validation_msg.html.erb +90 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validation_msg.md +13 -0
- data/app/pb_kits/playbook/pb_form/docs/_playground.json +13 -0
- data/app/pb_kits/playbook/pb_form/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_form_group/docs/_playground.json +23 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_playground.json +36 -0
- data/app/pb_kits/playbook/pb_hashtag/docs/_playground.json +30 -0
- data/app/pb_kits/playbook/pb_highlight/docs/_playground.json +22 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_playground.json +38 -0
- data/app/pb_kits/playbook/pb_icon/docs/_playground.json +115 -0
- data/app/pb_kits/playbook/pb_icon/docs/_playground.overrides.json +60 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/_playground.json +33 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/_playground.json +27 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.json +89 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.overrides.json +29 -0
- data/app/pb_kits/playbook/pb_icon_value/docs/_playground.json +60 -0
- data/app/pb_kits/playbook/pb_icon_value/docs/_playground.overrides.json +19 -0
- data/app/pb_kits/playbook/pb_image/docs/_playground.json +101 -0
- data/app/pb_kits/playbook/pb_image/docs/_playground.overrides.json +89 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/_playground.json +25 -0
- data/app/pb_kits/playbook/pb_label_value/docs/_playground.json +126 -0
- data/app/pb_kits/playbook/pb_label_value/docs/_playground.overrides.json +52 -0
- data/app/pb_kits/playbook/pb_layout/docs/_playground.json +40 -0
- data/app/pb_kits/playbook/pb_legend/docs/_playground.json +26 -0
- data/app/pb_kits/playbook/pb_link/docs/_playground.json +130 -0
- data/app/pb_kits/playbook/pb_link/docs/_playground.overrides.json +81 -0
- data/app/pb_kits/playbook/pb_list/docs/_playground.json +45 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.json +66 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.overrides.json +25 -0
- data/app/pb_kits/playbook/pb_map/docs/_map_default.md +2 -2
- data/app/pb_kits/playbook/pb_map/docs/_map_with_plugin.jsx +6 -0
- data/app/pb_kits/playbook/pb_map/docs/_playground.json +25 -0
- data/app/pb_kits/playbook/pb_message/docs/_playground.json +39 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.json +162 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.overrides.json +126 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.json +182 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.overrides.json +167 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.json +145 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.overrides.json +131 -0
- data/app/pb_kits/playbook/pb_nav/docs/_playground.json +65 -0
- data/app/pb_kits/playbook/pb_nav/docs/_playground.overrides.json +45 -0
- data/app/pb_kits/playbook/pb_online_status/docs/_playground.json +71 -0
- data/app/pb_kits/playbook/pb_online_status/docs/_playground.overrides.json +40 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_playground.json +38 -0
- data/app/pb_kits/playbook/pb_pagination/docs/_playground.json +69 -0
- data/app/pb_kits/playbook/pb_pagination/docs/_playground.overrides.json +61 -0
- data/app/pb_kits/playbook/pb_passphrase/docs/_playground.json +34 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.json +21 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.json +21 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.json +21 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.json +21 -0
- data/app/pb_kits/playbook/pb_person/docs/_playground.json +42 -0
- data/app/pb_kits/playbook/pb_person/docs/_playground.overrides.json +28 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/_playground.json +98 -0
- data/app/pb_kits/playbook/pb_person_contact/docs/_playground.overrides.json +92 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.json +52 -0
- data/app/pb_kits/playbook/pb_pill/docs/_playground.json +106 -0
- data/app/pb_kits/playbook/pb_pill/docs/_playground.overrides.json +56 -0
- data/app/pb_kits/playbook/pb_popover/docs/_playground.json +104 -0
- data/app/pb_kits/playbook/pb_popover/docs/_playground.overrides.json +67 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.json +90 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.overrides.json +51 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.json +87 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.overrides.json +28 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/_playground.json +31 -0
- data/app/pb_kits/playbook/pb_radio/docs/_playground.json +83 -0
- data/app/pb_kits/playbook/pb_radio/docs/_playground.overrides.json +59 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +41 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.md +12 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_simple.html.erb +9 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_simple.md +8 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_playground.json +128 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_playground.overrides.json +109 -0
- data/app/pb_kits/playbook/pb_select/docs/_playground.json +149 -0
- data/app/pb_kits/playbook/pb_select/docs/_playground.overrides.json +80 -0
- data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.json +145 -0
- data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.overrides.json +115 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.json +38 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_playground.json +113 -0
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_playground.overrides.json +92 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/_playground.json +53 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/_playground.overrides.json +34 -0
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.json +30 -0
- data/app/pb_kits/playbook/pb_source/docs/_playground.json +27 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_playground.json +128 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_playground.overrides.json +87 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/_playground.json +71 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/_playground.overrides.json +29 -0
- data/app/pb_kits/playbook/pb_stat_value/docs/_playground.json +56 -0
- data/app/pb_kits/playbook/pb_stat_value/docs/_playground.overrides.json +23 -0
- data/app/pb_kits/playbook/pb_table/docs/_playground.json +57 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_playground.json +90 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_playground.overrides.json +62 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_playground.json +89 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_playground.overrides.json +62 -0
- data/app/pb_kits/playbook/pb_time/docs/_playground.json +74 -0
- data/app/pb_kits/playbook/pb_time/docs/_playground.overrides.json +54 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/_playground.json +119 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/_playground.overrides.json +96 -0
- data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.json +32 -0
- data/app/pb_kits/playbook/pb_time_stacked/docs/_playground.json +54 -0
- data/app/pb_kits/playbook/pb_time_stacked/docs/_playground.overrides.json +43 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_playground.json +27 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_playground.json +104 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_playground.overrides.json +84 -0
- data/app/pb_kits/playbook/pb_title/docs/_playground.json +80 -0
- data/app/pb_kits/playbook/pb_title/docs/_playground.overrides.json +44 -0
- data/app/pb_kits/playbook/pb_title_count/docs/_playground.json +66 -0
- data/app/pb_kits/playbook/pb_title_count/docs/_playground.overrides.json +20 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/_playground.json +60 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/_playground.overrides.json +19 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_playground.json +68 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_playground.overrides.json +53 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_playground.json +91 -0
- data/app/pb_kits/playbook/pb_tooltip/docs/_playground.overrides.json +53 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_playground.json +205 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_playground.overrides.json +115 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.html.erb +29 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.md +1 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_user/docs/_playground.json +110 -0
- data/app/pb_kits/playbook/pb_user/docs/_playground.overrides.json +89 -0
- data/app/pb_kits/playbook/pb_user_badge/docs/_playground.json +61 -0
- data/app/pb_kits/playbook/pb_user_badge/docs/_playground.overrides.json +36 -0
- data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.json +64 -0
- data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.overrides.json +51 -0
- metadata +199 -3
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"groups": [
|
|
3
|
+
{
|
|
4
|
+
"name": "Content",
|
|
5
|
+
"props": [
|
|
6
|
+
"label",
|
|
7
|
+
"placeholder",
|
|
8
|
+
"options",
|
|
9
|
+
"blankSelection",
|
|
10
|
+
"error"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Appearance",
|
|
15
|
+
"props": [
|
|
16
|
+
"variant",
|
|
17
|
+
"separators",
|
|
18
|
+
"constrainHeight",
|
|
19
|
+
"clearable",
|
|
20
|
+
"requiredIndicator"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "State & behavior",
|
|
25
|
+
"props": [
|
|
26
|
+
"isClosed",
|
|
27
|
+
"multiSelect",
|
|
28
|
+
"autocomplete",
|
|
29
|
+
"closeOnClick",
|
|
30
|
+
"onSelect"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "Quick pick",
|
|
35
|
+
"props": [
|
|
36
|
+
"customQuickPickDates",
|
|
37
|
+
"rangeEndsToday",
|
|
38
|
+
"controlsStartId",
|
|
39
|
+
"controlsEndId"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Values & forms",
|
|
44
|
+
"props": ["defaultValue", "formPillProps"]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"presets": [
|
|
48
|
+
{
|
|
49
|
+
"name": "Default trigger",
|
|
50
|
+
"props": {
|
|
51
|
+
"variant": "default",
|
|
52
|
+
"placeholder": "Select a country",
|
|
53
|
+
"options": [
|
|
54
|
+
{ "label": "United States", "value": "unitedStates", "id": "us" },
|
|
55
|
+
{ "label": "Canada", "value": "canada", "id": "ca" },
|
|
56
|
+
{ "label": "Mexico", "value": "mexico", "id": "mx" }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "Subtle trigger",
|
|
62
|
+
"props": {
|
|
63
|
+
"variant": "subtle",
|
|
64
|
+
"placeholder": "Choose an option",
|
|
65
|
+
"options": [
|
|
66
|
+
{ "label": "Alpha", "value": "alpha", "id": "a" },
|
|
67
|
+
{ "label": "Beta", "value": "beta", "id": "b" },
|
|
68
|
+
{ "label": "Gamma", "value": "gamma", "id": "g" }
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "Quick pick",
|
|
74
|
+
"props": {
|
|
75
|
+
"variant": "quickpick",
|
|
76
|
+
"label": "Date range"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "Multi-select",
|
|
81
|
+
"props": {
|
|
82
|
+
"variant": "default",
|
|
83
|
+
"multiSelect": true,
|
|
84
|
+
"placeholder": "Select regions",
|
|
85
|
+
"options": [
|
|
86
|
+
{ "label": "North", "value": "north", "id": "n" },
|
|
87
|
+
{ "label": "South", "value": "south", "id": "s" },
|
|
88
|
+
{ "label": "East", "value": "east", "id": "e" },
|
|
89
|
+
{ "label": "West", "value": "west", "id": "w" }
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "With error",
|
|
95
|
+
"props": {
|
|
96
|
+
"variant": "default",
|
|
97
|
+
"placeholder": "Required field",
|
|
98
|
+
"error": "Please make a selection.",
|
|
99
|
+
"options": [
|
|
100
|
+
{ "label": "Option A", "value": "a", "id": "a" },
|
|
101
|
+
{ "label": "Option B", "value": "b", "id": "b" }
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "Search (autocomplete)",
|
|
107
|
+
"props": {
|
|
108
|
+
"variant": "default",
|
|
109
|
+
"autocomplete": true,
|
|
110
|
+
"placeholder": "Search…",
|
|
111
|
+
"options": [
|
|
112
|
+
{ "label": "Apple", "value": "apple", "id": "1" },
|
|
113
|
+
{ "label": "Apricot", "value": "apricot", "id": "2" },
|
|
114
|
+
{ "label": "Banana", "value": "banana", "id": "3" }
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"conditionals": {
|
|
120
|
+
"rangeEndsToday": { "requires": { "variant": "quickpick" } },
|
|
121
|
+
"controlsStartId": { "requires": { "variant": "quickpick" } },
|
|
122
|
+
"controlsEndId": { "requires": { "variant": "quickpick" } },
|
|
123
|
+
"customQuickPickDates": { "requires": { "variant": "quickpick" } }
|
|
124
|
+
},
|
|
125
|
+
"hints": {
|
|
126
|
+
"quickpick_scope": {
|
|
127
|
+
"when": { "variant": "quickpick" },
|
|
128
|
+
"message": "Quick pick uses preset date-range options. Use custom quick pick dates or range controls to tailor the menu.",
|
|
129
|
+
"type": "info"
|
|
130
|
+
},
|
|
131
|
+
"multi_options": {
|
|
132
|
+
"when": { "multiSelect": true },
|
|
133
|
+
"message": "Multi-select shows selected values as pills when applicable; use clearable to allow resetting.",
|
|
134
|
+
"type": "info"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"template": "<EmptyState{{props}} />",
|
|
3
|
+
"propTargets": {},
|
|
4
|
+
"defaults": {
|
|
5
|
+
"alignment": "center",
|
|
6
|
+
"orientation": "vertical",
|
|
7
|
+
"size": "md"
|
|
8
|
+
},
|
|
9
|
+
"groups": [
|
|
10
|
+
{
|
|
11
|
+
"name": "Props",
|
|
12
|
+
"props": [
|
|
13
|
+
"alignment",
|
|
14
|
+
"description",
|
|
15
|
+
"header",
|
|
16
|
+
"image",
|
|
17
|
+
"linkButton",
|
|
18
|
+
"onLinkButtonClick",
|
|
19
|
+
"onPrimaryButtonClick",
|
|
20
|
+
"orientation",
|
|
21
|
+
"primaryButton",
|
|
22
|
+
"size"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"presets": [
|
|
27
|
+
{
|
|
28
|
+
"name": "Default",
|
|
29
|
+
"props": {}
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"conditionals": {},
|
|
33
|
+
"hints": {}
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"template": "<FileUpload{{props}} />",
|
|
3
|
+
"propTargets": {},
|
|
4
|
+
"defaults": {
|
|
5
|
+
"accept": ""
|
|
6
|
+
},
|
|
7
|
+
"groups": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Props",
|
|
10
|
+
"props": [
|
|
11
|
+
"accept",
|
|
12
|
+
"customMessage",
|
|
13
|
+
"dark",
|
|
14
|
+
"acceptedFilesDescription",
|
|
15
|
+
"maxSize",
|
|
16
|
+
"onFilesAccepted",
|
|
17
|
+
"onFilesRejected",
|
|
18
|
+
"error",
|
|
19
|
+
"getRootProps",
|
|
20
|
+
"getInputProps",
|
|
21
|
+
"isDragActive",
|
|
22
|
+
"fileRejections"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"presets": [
|
|
27
|
+
{
|
|
28
|
+
"name": "Default",
|
|
29
|
+
"props": {}
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"conditionals": {},
|
|
33
|
+
"hints": {}
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"template": "<FixedConfirmationToast{{props}} />",
|
|
3
|
+
"propTargets": {},
|
|
4
|
+
"defaults": {
|
|
5
|
+
"closeable": false,
|
|
6
|
+
"multiLine": false,
|
|
7
|
+
"navMarginTop": false,
|
|
8
|
+
"status": "neutral"
|
|
9
|
+
},
|
|
10
|
+
"groups": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Props",
|
|
13
|
+
"props": [
|
|
14
|
+
"autoClose",
|
|
15
|
+
"closeable",
|
|
16
|
+
"horizontal",
|
|
17
|
+
"icon",
|
|
18
|
+
"multiLine",
|
|
19
|
+
"navMarginTop",
|
|
20
|
+
"onClose",
|
|
21
|
+
"open",
|
|
22
|
+
"status",
|
|
23
|
+
"text",
|
|
24
|
+
"vertical",
|
|
25
|
+
"zIndex"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"presets": [
|
|
30
|
+
{
|
|
31
|
+
"name": "Default",
|
|
32
|
+
"props": {}
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"conditionals": {},
|
|
36
|
+
"hints": {}
|
|
37
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
{
|
|
2
|
+
"template": "<Flex{{props}}>{{children}}</Flex>",
|
|
3
|
+
"propTargets": {},
|
|
4
|
+
"defaults": {
|
|
5
|
+
"horizontal": "left",
|
|
6
|
+
"justify": "none",
|
|
7
|
+
"inline": false,
|
|
8
|
+
"orientation": "row",
|
|
9
|
+
"spacing": "none",
|
|
10
|
+
"reverse": false,
|
|
11
|
+
"vertical": "top",
|
|
12
|
+
"align": "none",
|
|
13
|
+
"wrap": false,
|
|
14
|
+
"alignSelf": "none"
|
|
15
|
+
},
|
|
16
|
+
"children": {
|
|
17
|
+
"editable": true,
|
|
18
|
+
"default": "<Caption text=\"A\" /><Caption text=\"B\" /><Caption text=\"C\" />"
|
|
19
|
+
},
|
|
20
|
+
"groups": [
|
|
21
|
+
{
|
|
22
|
+
"name": "Direction & flow",
|
|
23
|
+
"props": [
|
|
24
|
+
"orientation",
|
|
25
|
+
"reverse",
|
|
26
|
+
"wrap",
|
|
27
|
+
"inline"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "Primary axis",
|
|
32
|
+
"props": [
|
|
33
|
+
"horizontal",
|
|
34
|
+
"justify",
|
|
35
|
+
"spacing"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Cross axis",
|
|
40
|
+
"props": [
|
|
41
|
+
"vertical",
|
|
42
|
+
"align",
|
|
43
|
+
"alignSelf"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"presets": [
|
|
48
|
+
{
|
|
49
|
+
"name": "Row (start)",
|
|
50
|
+
"props": {
|
|
51
|
+
"orientation": "row",
|
|
52
|
+
"justify": "none",
|
|
53
|
+
"horizontal": "left",
|
|
54
|
+
"vertical": "top"
|
|
55
|
+
},
|
|
56
|
+
"children": "<Caption text=\"A\" /><Caption text=\"B\" /><Caption text=\"C\" />"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Column",
|
|
60
|
+
"props": {
|
|
61
|
+
"orientation": "column",
|
|
62
|
+
"justify": "none",
|
|
63
|
+
"horizontal": "left",
|
|
64
|
+
"vertical": "top"
|
|
65
|
+
},
|
|
66
|
+
"children": "<Caption text=\"One\" /><Caption text=\"Two\" /><Caption text=\"Three\" />"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "Centered",
|
|
70
|
+
"props": {
|
|
71
|
+
"orientation": "row",
|
|
72
|
+
"justify": "center",
|
|
73
|
+
"vertical": "center"
|
|
74
|
+
},
|
|
75
|
+
"children": "<Caption text=\"Centered\" />"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "Space between",
|
|
79
|
+
"props": {
|
|
80
|
+
"orientation": "row",
|
|
81
|
+
"justify": "between",
|
|
82
|
+
"vertical": "center"
|
|
83
|
+
},
|
|
84
|
+
"children": "<Caption text=\"Left\" /><Caption text=\"Right\" />"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "Space around",
|
|
88
|
+
"props": {
|
|
89
|
+
"orientation": "row",
|
|
90
|
+
"justify": "around",
|
|
91
|
+
"vertical": "center"
|
|
92
|
+
},
|
|
93
|
+
"children": "<Caption text=\"A\" /><Caption text=\"B\" /><Caption text=\"C\" />"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "End aligned",
|
|
97
|
+
"props": {
|
|
98
|
+
"orientation": "row",
|
|
99
|
+
"justify": "end",
|
|
100
|
+
"vertical": "center"
|
|
101
|
+
},
|
|
102
|
+
"children": "<Caption text=\"Trailing\" />"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "Wrap",
|
|
106
|
+
"props": {
|
|
107
|
+
"orientation": "row",
|
|
108
|
+
"wrap": true,
|
|
109
|
+
"justify": "start"
|
|
110
|
+
},
|
|
111
|
+
"children": "<Caption text=\"Item 1\" /><Caption text=\"Item 2\" /><Caption text=\"Item 3\" /><Caption text=\"Item 4\" />"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "Inline flex",
|
|
115
|
+
"props": {
|
|
116
|
+
"inline": true,
|
|
117
|
+
"orientation": "row",
|
|
118
|
+
"vertical": "center"
|
|
119
|
+
},
|
|
120
|
+
"children": "<Caption text=\"Inline\" /> <Caption text=\"chips\" />"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "Column (center items)",
|
|
124
|
+
"props": {
|
|
125
|
+
"orientation": "column",
|
|
126
|
+
"align": "center"
|
|
127
|
+
},
|
|
128
|
+
"children": "<Caption text=\"Stacked\" /><Caption text=\"centered\" />"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"conditionals": {},
|
|
132
|
+
"hints": {}
|
|
133
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"children": {
|
|
3
|
+
"default": "<Caption text=\"A\" /><Caption text=\"B\" /><Caption text=\"C\" />"
|
|
4
|
+
},
|
|
5
|
+
"groups": [
|
|
6
|
+
{
|
|
7
|
+
"name": "Direction & flow",
|
|
8
|
+
"props": ["orientation", "reverse", "wrap", "inline"]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "Primary axis",
|
|
12
|
+
"props": ["horizontal", "justify", "spacing"]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "Cross axis",
|
|
16
|
+
"props": ["vertical", "align", "alignSelf"]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"presets": [
|
|
20
|
+
{
|
|
21
|
+
"name": "Row (start)",
|
|
22
|
+
"props": {
|
|
23
|
+
"orientation": "row",
|
|
24
|
+
"justify": "none",
|
|
25
|
+
"horizontal": "left",
|
|
26
|
+
"vertical": "top"
|
|
27
|
+
},
|
|
28
|
+
"children": "<Caption text=\"A\" /><Caption text=\"B\" /><Caption text=\"C\" />"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "Column",
|
|
32
|
+
"props": {
|
|
33
|
+
"orientation": "column",
|
|
34
|
+
"justify": "none",
|
|
35
|
+
"horizontal": "left",
|
|
36
|
+
"vertical": "top"
|
|
37
|
+
},
|
|
38
|
+
"children": "<Caption text=\"One\" /><Caption text=\"Two\" /><Caption text=\"Three\" />"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "Centered",
|
|
42
|
+
"props": {
|
|
43
|
+
"orientation": "row",
|
|
44
|
+
"justify": "center",
|
|
45
|
+
"vertical": "center"
|
|
46
|
+
},
|
|
47
|
+
"children": "<Caption text=\"Centered\" />"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "Space between",
|
|
51
|
+
"props": {
|
|
52
|
+
"orientation": "row",
|
|
53
|
+
"justify": "between",
|
|
54
|
+
"vertical": "center"
|
|
55
|
+
},
|
|
56
|
+
"children": "<Caption text=\"Left\" /><Caption text=\"Right\" />"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Space around",
|
|
60
|
+
"props": {
|
|
61
|
+
"orientation": "row",
|
|
62
|
+
"justify": "around",
|
|
63
|
+
"vertical": "center"
|
|
64
|
+
},
|
|
65
|
+
"children": "<Caption text=\"A\" /><Caption text=\"B\" /><Caption text=\"C\" />"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "End aligned",
|
|
69
|
+
"props": {
|
|
70
|
+
"orientation": "row",
|
|
71
|
+
"justify": "end",
|
|
72
|
+
"vertical": "center"
|
|
73
|
+
},
|
|
74
|
+
"children": "<Caption text=\"Trailing\" />"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "Wrap",
|
|
78
|
+
"props": {
|
|
79
|
+
"orientation": "row",
|
|
80
|
+
"wrap": true,
|
|
81
|
+
"justify": "start"
|
|
82
|
+
},
|
|
83
|
+
"children": "<Caption text=\"Item 1\" /><Caption text=\"Item 2\" /><Caption text=\"Item 3\" /><Caption text=\"Item 4\" />"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "Inline flex",
|
|
87
|
+
"props": {
|
|
88
|
+
"inline": true,
|
|
89
|
+
"orientation": "row",
|
|
90
|
+
"vertical": "center"
|
|
91
|
+
},
|
|
92
|
+
"children": "<Caption text=\"Inline\" /> <Caption text=\"chips\" />"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "Column (center items)",
|
|
96
|
+
"props": {
|
|
97
|
+
"orientation": "column",
|
|
98
|
+
"align": "center"
|
|
99
|
+
},
|
|
100
|
+
"children": "<Caption text=\"Stacked\" /><Caption text=\"centered\" />"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"conditionals": {},
|
|
104
|
+
"hints": {}
|
|
105
|
+
}
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
}] %>
|
|
98
98
|
|
|
99
99
|
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
|
100
|
-
<%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true
|
|
101
|
-
<%= form.typeahead :example_typeahead_validation_react, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead (React Rendered)", placeholder: "Search for a user", required: true
|
|
100
|
+
<%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true } %>
|
|
101
|
+
<%= form.typeahead :example_typeahead_validation_react, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead (React Rendered)", placeholder: "Search for a user", required: true } %>
|
|
102
102
|
<%= form.typeahead :example_typeahead_validation_react_2, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead 2 (React Rendered)", placeholder: "Search for a user", required: true } %>
|
|
103
103
|
<%= form.text_field :example_text_field_validation, props: { label: true, required: true } %>
|
|
104
104
|
<%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field", hidden_inputs: true, required: true } %>
|
|
@@ -110,14 +110,14 @@
|
|
|
110
110
|
<%= form.text_area :example_text_area_validation, props: { label: true, required: true } %>
|
|
111
111
|
<%= form.dropdown_field :example_dropdown_validation, props: { label: true, options: example_dropdown_options, required: true } %>
|
|
112
112
|
<%= form.dropdown_field :example_dropdown_validation_multi, props: { label: true, options: example_dropdown_options, multi_select: true, required: true } %>
|
|
113
|
-
<%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true
|
|
113
|
+
<%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
|
|
114
114
|
<%= form.collection_select :example_collection_select_validation, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
|
|
115
115
|
<%= form.check_box :example_checkbox_validation, props: { text: "Example Checkbox Validation", label: true, required: true }, checked_value: "1", unchecked_value: "0" %>
|
|
116
|
-
<%= form.date_picker :example_date_picker_2, props: { label: true, required: true,
|
|
116
|
+
<%= form.date_picker :example_date_picker_2, props: { label: true, required: true, allow_input: true } %>
|
|
117
117
|
<%= form.star_rating_field :example_star_rating_validation, props: { variant: "interactive", label: true, required: true } %>
|
|
118
118
|
<%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true, blank_selection: "Select a Time Zone...", required: true } %>
|
|
119
119
|
<%= form.multi_level_select :example_multi_level_select, props: { id: "multi-level-select-form", tree_data: treeData, margin_bottom: "sm", required: true, label: "Example Multi Level Select field" } %>
|
|
120
|
-
<%= form.time_picker :example_time_picker_validation, props: { label: true, required: true
|
|
120
|
+
<%= form.time_picker :example_time_picker_validation, props: { label: true, required: true } %>
|
|
121
121
|
|
|
122
122
|
<%= form.actions do |action| %>
|
|
123
123
|
<%= action.submit %>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<%
|
|
2
|
+
example_collection = [
|
|
3
|
+
OpenStruct.new(name: "Alabama", value: 1),
|
|
4
|
+
OpenStruct.new(name: "Alaska", value: 2),
|
|
5
|
+
OpenStruct.new(name: "Arizona", value: 3),
|
|
6
|
+
OpenStruct.new(name: "Arkansas", value: 4),
|
|
7
|
+
OpenStruct.new(name: "California", value: 5),
|
|
8
|
+
OpenStruct.new(name: "Colorado", value: 6),
|
|
9
|
+
OpenStruct.new(name: "Connecticut", value: 7),
|
|
10
|
+
OpenStruct.new(name: "Delaware", value: 8),
|
|
11
|
+
OpenStruct.new(name: "Florida", value: 9),
|
|
12
|
+
OpenStruct.new(name: "Georgia", value: 10),
|
|
13
|
+
]
|
|
14
|
+
%>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<%
|
|
18
|
+
example_typeahead_options = [
|
|
19
|
+
{ label: 'Orange', value: '#FFA500' },
|
|
20
|
+
{ label: 'Red', value: '#FF0000' },
|
|
21
|
+
{ label: 'Green', value: '#00FF00' },
|
|
22
|
+
{ label: 'Blue', value: '#0000FF' },
|
|
23
|
+
]
|
|
24
|
+
%>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
|
28
|
+
<%= form.text_field :example_text_field_validation_msg, props: { label: "Text Field With Validation Message", required: true, validation: { message: "I am a custom validation message for text field." } } %>
|
|
29
|
+
<%= form.typeahead :example_typeahead_validation_msg, props: { data: { typeahead_example_msg: true, user: {} }, label: "Typeahead With Validation Message", placeholder: "Search for a user", required: true, validation: { message: "I am a custom validation message for typeahead." } } %>
|
|
30
|
+
<%= form.typeahead :example_typeahead_validation_react_msg, props: { options: example_typeahead_options, pills: true, label: "Typeahead With Validation Message (React Rendered)", placeholder: "Search for a color", required: true, validation: { message: "I am a custom validation message for React typeahead." } } %>
|
|
31
|
+
<%= form.select :example_select_validation_msg, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true, validation_message: "I am a custom validation message for select." } %>
|
|
32
|
+
<%= form.collection_select :example_collection_select_validation_msg, example_collection, :value, :name, props: { label: "Collection Select With Validation Message", blank_selection: "Select a State...", required: true, validation_message: "I am a custom validation message for collection select." } %>
|
|
33
|
+
<%= form.date_picker :example_date_picker_validation_msg, props: { label: "Date Picker With Validation Message", required: true, validation_message: "I am a custom validation message for date picker.", allow_input: true } %>
|
|
34
|
+
<%= form.time_picker :example_time_picker_validation_msg, props: { label: "Time Picker With Validation Message", required: true, validation_message: "I am a custom validation message for time picker." } %>
|
|
35
|
+
|
|
36
|
+
<%= form.actions do |action| %>
|
|
37
|
+
<%= action.submit %>
|
|
38
|
+
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
|
|
39
|
+
<% end %>
|
|
40
|
+
<% end %>
|
|
41
|
+
|
|
42
|
+
<!-- form.typeahead user results example template -->
|
|
43
|
+
<template data-typeahead-example-result-option>
|
|
44
|
+
<%= pb_rails("user", props: {
|
|
45
|
+
name: tag(:slot, name: "name"),
|
|
46
|
+
orientation: "horizontal",
|
|
47
|
+
align: "left",
|
|
48
|
+
avatar_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=",
|
|
49
|
+
avatar: true
|
|
50
|
+
}) %>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<!-- form.typeahead JS example implementation -->
|
|
54
|
+
<%= javascript_tag defer: "defer" do %>
|
|
55
|
+
document.addEventListener("pb-typeahead-kit-search", function(event) {
|
|
56
|
+
if (!event.target.dataset || !event.target.dataset.typeaheadExampleMsg) return
|
|
57
|
+
|
|
58
|
+
fetch(`https://api.github.com/search/users?q=${encodeURIComponent(event.detail.searchingFor)}`)
|
|
59
|
+
.then(response => response.json())
|
|
60
|
+
.then((result) => {
|
|
61
|
+
const resultOptionTemplate = document.querySelector("[data-typeahead-example-result-option]")
|
|
62
|
+
|
|
63
|
+
event.detail.setResults((result.items || []).map((user) => {
|
|
64
|
+
const wrapper = resultOptionTemplate.content.cloneNode(true)
|
|
65
|
+
wrapper.children[0].dataset.user = JSON.stringify(user)
|
|
66
|
+
wrapper.querySelector('slot[name="name"]').replaceWith(user.login)
|
|
67
|
+
wrapper.querySelector('img').dataset.src = user.avatar_url
|
|
68
|
+
return wrapper
|
|
69
|
+
}))
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
document.addEventListener("pb-typeahead-kit-result-option-selected", function(event) {
|
|
75
|
+
if (!event.target.dataset.typeaheadExampleMsg) return
|
|
76
|
+
|
|
77
|
+
const selectedUserJSON = event.detail.selected.firstElementChild.dataset.user
|
|
78
|
+
const selectedUserData = JSON.parse(selectedUserJSON)
|
|
79
|
+
|
|
80
|
+
// set the input field's value
|
|
81
|
+
event.target.querySelector('input[name=example_typeahead_validation_msg]').value = selectedUserData.login
|
|
82
|
+
|
|
83
|
+
// log the selected option's dataset
|
|
84
|
+
console.log('The selected user data:')
|
|
85
|
+
console.dir(selectedUserData)
|
|
86
|
+
|
|
87
|
+
// do even more with the data later - TBD
|
|
88
|
+
event.target.dataset.user = selectedUserJSON
|
|
89
|
+
})
|
|
90
|
+
<% end %>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Custom validation messages allow you to override the browser's default validation text with your own messaging. This provides a better user experience by giving specific, actionable feedback.
|
|
2
|
+
|
|
3
|
+
**Text-based inputs** (TextInput, Typeahead) use the `validation` prop with a `message` key:
|
|
4
|
+
```ruby
|
|
5
|
+
validation: { message: "Please enter a valid email address." }
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
**Selection-based inputs** (Select, DatePicker, TimePicker) use the `validation_message` prop:
|
|
9
|
+
```ruby
|
|
10
|
+
validation_message: "Please select an option."
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
When a required field is left empty or fails validation, your custom message will display instead of the generic browser default.
|
|
@@ -3,5 +3,6 @@ examples:
|
|
|
3
3
|
rails:
|
|
4
4
|
- form_form_with: Default
|
|
5
5
|
- form_form_with_validate: Default + Validation
|
|
6
|
+
- form_form_with_validation_msg: Validation + Custom Validation Message
|
|
6
7
|
- form_form_with_loading: Default + Loading
|
|
7
8
|
- form_with_required_indicator: With Optional Required Indicator
|