playbook_ui_docs 14.14.0.pre.alpha.PBNTR890typeahead6394 → 14.14.0.pre.alpha.pbntr500currencykithandlingofnullvalues6275

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.html.erb +1 -3
  3. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -20
  4. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -5
  5. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
  6. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +0 -4
  7. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -1
  8. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -2
  9. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  10. data/dist/playbook-doc.js +1 -1
  11. metadata +2 -23
  12. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_rails.md +0 -1
  13. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_react.md +0 -1
  14. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  15. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  16. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
  17. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  18. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  19. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  20. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  21. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx +0 -17
  22. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx +0 -61
  23. data/app/pb_kits/playbook/pb_icon_button/docs/index.js +0 -2
  24. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +0 -11
  25. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +0 -1
  26. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +0 -39
  27. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +0 -3
  28. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +0 -26
  29. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +0 -45
  30. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +0 -5
  31. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +0 -33
  32. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +0 -3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.14.0.pre.alpha.PBNTR890typeahead6394
4
+ version: 14.14.0.pre.alpha.pbntr500currencykithandlingofnullvalues6275
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-03-01 00:00:00.000000000 Z
12
+ date: 2025-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: playbook_ui
@@ -457,8 +457,6 @@ files:
457
457
  - app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol.jsx
458
458
  - app/pb_kits/playbook/pb_currency/docs/_currency_null_display.html.erb
459
459
  - app/pb_kits/playbook/pb_currency/docs/_currency_null_display.jsx
460
- - app/pb_kits/playbook/pb_currency/docs/_currency_null_display_rails.md
461
- - app/pb_kits/playbook/pb_currency/docs/_currency_null_display_react.md
462
460
  - app/pb_kits/playbook/pb_currency/docs/_currency_props_swift.md
463
461
  - app/pb_kits/playbook/pb_currency/docs/_currency_size.html.erb
464
462
  - app/pb_kits/playbook/pb_currency/docs/_currency_size.jsx
@@ -720,21 +718,14 @@ files:
720
718
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md
721
719
  - app/pb_kits/playbook/pb_draggable/docs/example.yml
722
720
  - app/pb_kits/playbook/pb_draggable/docs/index.js
723
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb
724
721
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx
725
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb
726
722
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx
727
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb
728
723
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx
729
724
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb
730
725
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx
731
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb
732
726
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx
733
727
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md
734
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb
735
728
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx
736
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md
737
- - app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb
738
729
  - app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx
739
730
  - app/pb_kits/playbook/pb_drawer/docs/example.yml
740
731
  - app/pb_kits/playbook/pb_drawer/docs/index.js
@@ -1041,11 +1032,8 @@ files:
1041
1032
  - app/pb_kits/playbook/pb_icon/docs/example.yml
1042
1033
  - app/pb_kits/playbook/pb_icon/docs/index.js
1043
1034
  - app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb
1044
- - app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx
1045
1035
  - app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.html.erb
1046
- - app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx
1047
1036
  - app/pb_kits/playbook/pb_icon_button/docs/example.yml
1048
- - app/pb_kits/playbook/pb_icon_button/docs/index.js
1049
1037
  - app/pb_kits/playbook/pb_icon_circle/docs/_description.md
1050
1038
  - app/pb_kits/playbook/pb_icon_circle/docs/_footer.md
1051
1039
  - app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.html.erb
@@ -1388,9 +1376,7 @@ files:
1388
1376
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.html.erb
1389
1377
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.jsx
1390
1378
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_toggle.md
1391
- - app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb
1392
1379
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx
1393
- - app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md
1394
1380
  - app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md
1395
1381
  - app/pb_kits/playbook/pb_overlay/docs/example.yml
1396
1382
  - app/pb_kits/playbook/pb_overlay/docs/index.js
@@ -2071,12 +2057,9 @@ files:
2071
2057
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default_react.md
2072
2058
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay.jsx
2073
2059
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay.md
2074
- - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb
2075
- - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md
2076
2060
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon.erb
2077
2061
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon.jsx
2078
2062
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon.md
2079
- - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb
2080
2063
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.jsx
2081
2064
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.md
2082
2065
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_margin.jsx
@@ -2115,10 +2098,6 @@ files:
2115
2098
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx
2116
2099
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb
2117
2100
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx
2118
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb
2119
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md
2120
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb
2121
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md
2122
2101
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb
2123
2102
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx
2124
2103
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.md
@@ -1 +0,0 @@
1
- To customize how the `amount` field appears when it is empty, use the `null_display` prop and set it to the desired value you want to display.
@@ -1 +0,0 @@
1
- To customize how the `amount` field appears when it is empty, use the `nullDisplay` prop and set it to the desired value you want to display.
@@ -1,8 +0,0 @@
1
- <%= pb_rails("button", props: { text: "Push Drawer", margin_right: "sm", data: {"open-drawer": "drawer-3"} }) %>
2
-
3
- <%= pb_rails("drawer", props: {
4
- id:"drawer-3",
5
- behavior: "push"
6
- }) do %>
7
- Test me (Push Behavior)
8
- <% end %>
@@ -1,33 +0,0 @@
1
- <%= pb_rails("flex") do %>
2
- <%= pb_rails("button", props: { text: "Drawer with border right", margin_right: "sm", data: {"open-drawer": "drawer-12"} }) %>
3
-
4
- <%= pb_rails("drawer", props: {
5
- id:"drawer-12",
6
- overlay: false,
7
- border: "right"
8
- }) do %>
9
- Test me (Border Right)
10
- <% end %>
11
-
12
-
13
- <%= pb_rails("button", props: { text: "Drawer with border left", margin_right: "sm", data: {"open-drawer": "drawer-13"} }) %>
14
-
15
- <%= pb_rails("drawer", props: {
16
- id:"drawer-13",
17
- overlay: false,
18
- border: "left"
19
- }) do %>
20
- Test me (Border Left)
21
- <% end %>
22
-
23
- <%= pb_rails("button", props: { text: "Drawer with border full", data: {"open-drawer": "drawer-14"} }) %>
24
-
25
- <%= pb_rails("drawer", props: {
26
- id:"drawer-14",
27
- overlay: false,
28
- border: "full"
29
- }) do %>
30
- Test me (Border Full)
31
- <% end %>
32
- <% end %>
33
-
@@ -1,24 +0,0 @@
1
- <%= pb_rails("button", props: { padding: "xs", margin_right: "sm", data: {"open-drawer": "drawer-4"} }) do %>
2
- <%= pb_rails("icon", props: { icon: "bars", size: "2x" }) %>
3
- <% end %>
4
-
5
- <%= pb_rails("drawer", props: {
6
- id:"drawer-4",
7
- within_element: true,
8
- placement: "bottom",
9
- breakpoint: "md",
10
- size: "full"
11
- }) do %>
12
- <%= pb_rails("nav", props: { display: {xl: "none", lg: "none", md: "none", sm: "block" } }) do %>
13
- <%= pb_rails("nav/item", props: { text: "Photos", link: "#" }) %>
14
- <%= pb_rails("nav/item", props: { text: "Music", link: "#" }) %>
15
- <%= pb_rails("nav/item", props: { text: "Video", link: "#", active: true }) %>
16
- <%= pb_rails("nav/item", props: { text: "Files", link: "#" }) %>
17
- <% end %>
18
- <%= pb_rails("nav", props: { display: {md: "block", sm: "none", xs: "none" }, orientation: "horizontal" }) do %>
19
- <%= pb_rails("nav/item", props: { text: "About", link: "#" }) %>
20
- <%= pb_rails("nav/item", props: { text: "Case Studies", link: "#", active: true }) %>
21
- <%= pb_rails("nav/item", props: { text: "Service ", link: "#" }) %>
22
- <%= pb_rails("nav/item", props: { text: "Contacts", link: "#" }) %>
23
- <% end %>
24
- <% end %>
@@ -1,21 +0,0 @@
1
- <%= pb_rails("flex") do %>
2
- <%= pb_rails("button", props: { text: "No Overlay Drawer", margin_right: "sm", data: {"open-drawer": "drawer-10"} }) %>
3
-
4
- <%= pb_rails("drawer", props: {
5
- id:"drawer-10",
6
- overlay: false
7
- }) do %>
8
- Test me (No Overlay)
9
- <% end %>
10
-
11
-
12
- <%= pb_rails("button", props: { text: "Overlay Drawer", data: {"open-drawer": "drawer-11"} }) %>
13
-
14
- <%= pb_rails("drawer", props: {
15
- id:"drawer-11",
16
- placement: "right"
17
- }) do %>
18
- Test me (Has Overlay)
19
- <% end %>
20
- <% end %>
21
-
@@ -1 +0,0 @@
1
- Click the button to close the drawer when there is no overlay.
@@ -1,49 +0,0 @@
1
- <%= pb_rails("flex") do %>
2
- <%= pb_rails("button", props: { text: "XS Drawer", margin_right: "sm", data: {"open-drawer": "drawer-5"} }) %>
3
-
4
- <%= pb_rails("drawer", props: {
5
- id:"drawer-5",
6
- size: "xs"
7
- }) do %>
8
- XS
9
- <% end %>
10
-
11
- <%= pb_rails("button", props: { text: "SM Drawer", margin_right: "sm", data: {"open-drawer": "drawer-6"} }) %>
12
-
13
- <%= pb_rails("drawer", props: {
14
- id:"drawer-6",
15
- size: "sm",
16
- placement: "right"
17
- }) do %>
18
- This is a small drawer
19
- <% end %>
20
-
21
- <%= pb_rails("button", props: { text: "MD Drawer", margin_right: "sm", data: {"open-drawer": "drawer-7"} }) %>
22
-
23
- <%= pb_rails("drawer", props: {
24
- id:"drawer-7",
25
- size: "md"
26
- }) do %>
27
- This is a medium drawer
28
- <% end %>
29
-
30
- <%= pb_rails("button", props: { text: "LG Drawer", margin_right: "sm", data: {"open-drawer": "drawer-8"} }) %>
31
-
32
- <%= pb_rails("drawer", props: {
33
- id:"drawer-8",
34
- size: "lg",
35
- placement: "right"
36
- }) do %>
37
- This is a large drawer
38
- <% end %>
39
-
40
- <%= pb_rails("button", props: { text: "XL Drawer", margin_right: "sm", data: {"open-drawer": "drawer-9"} }) %>
41
-
42
- <%= pb_rails("drawer", props: {
43
- id:"drawer-9",
44
- size: "xl"
45
- }) do %>
46
- This is an extra large drawer
47
- <% end %>
48
- <% end %>
49
-
@@ -1,17 +0,0 @@
1
- import React from 'react'
2
- import { IconButton } from 'playbook-ui'
3
-
4
- const IconButtonDefault = (props) => (
5
- <div>
6
- <IconButton
7
- {...props}
8
- />
9
- <IconButton
10
- {...props}
11
- marginTop="md"
12
- variant="link"
13
- />
14
- </div>
15
- )
16
-
17
- export default IconButtonDefault
@@ -1,61 +0,0 @@
1
- import React from 'react'
2
- import { IconButton, Flex } from 'playbook-ui'
3
-
4
- const IconButtonSizes = (props) => (
5
- <div>
6
- <Flex align="center">
7
- <IconButton
8
- {...props}
9
- size="lg"
10
- />
11
- <span>Large</span>
12
- </Flex>
13
- <Flex align="center">
14
- <IconButton
15
- {...props}
16
- size="sm"
17
- />
18
- <span>Small</span>
19
- </Flex>
20
- <Flex align="center">
21
- <IconButton
22
- {...props}
23
- size="xs"
24
- />
25
- <span>XSmall</span>
26
- </Flex>
27
- <Flex
28
- align="center"
29
- marginTop="md"
30
- >
31
- <IconButton
32
- {...props}
33
- size="1x"
34
- />
35
- <span>1x</span>
36
- </Flex>
37
- <Flex align="center">
38
- <IconButton
39
- {...props}
40
- size="2x"
41
- />
42
- <span>2x</span>
43
- </Flex>
44
- <Flex align="center">
45
- <IconButton
46
- {...props}
47
- size="3x"
48
- />
49
- <span>3x</span>
50
- </Flex>
51
- <Flex align="center">
52
- <IconButton
53
- {...props}
54
- size="4x"
55
- />
56
- <span>4x</span>
57
- </Flex>
58
- </div>
59
- )
60
-
61
- export default IconButtonSizes
@@ -1,2 +0,0 @@
1
- export { default as IconButtonDefault } from './_icon_button_default.jsx'
2
- export { default as IconButtonSizes } from './_icon_button_sizes.jsx'
@@ -1,11 +0,0 @@
1
- <%= pb_rails("overlay", props: { layout: { "x": "xl" }, color: "card_light", dynamic: true }) do %>
2
- <%= pb_rails("flex", props: { column_gap: "lg", orientation: "row", overflow_x: "auto" }) do %>
3
- <% 15.times do %>
4
- <%= pb_rails("flex/flex_item") do %>
5
- <%= pb_rails("card") do %>
6
- Card content
7
- <% end %>
8
- <% end %>
9
- <% end %>
10
- <% end %>
11
- <% end %>
@@ -1 +0,0 @@
1
- Pass the `dynamic` prop to make the overlay render while the scrollbar isn't at either end on the scrollbar.
@@ -1,39 +0,0 @@
1
- <%= pb_rails("flex", props: { orientation: "row", gap: "md" }) do %>
2
- <%= pb_rails("flex/flex_item", props: {margin_top: "md"}) do %>
3
- <%= pb_rails("button", props: {classname: "tooltip-delay", text: "1s delay"}) %>
4
- <% end %>
5
-
6
- <%= pb_rails("flex/flex_item", props: {margin_top: "md"}) do %>
7
- <%= pb_rails("button", props: {classname: "tooltip-open-delay", text: "Open only"}) %>
8
- <% end %>
9
-
10
- <%= pb_rails("flex/flex_item", props: {margin_top: "md"}) do %>
11
- <%= pb_rails("button", props: {classname: "tooltip-close-delay", text: "Close only"}) %>
12
- <% end %>
13
-
14
- <%= pb_rails("tooltip", props: {
15
- trigger_element_selector: ".tooltip-delay",
16
- tooltip_id: "delay-tooltip",
17
- position: 'top',
18
- delay_open: 1000,
19
- delay_close: 1000
20
- }) do %>
21
- 1s open/close delay
22
- <% end %>
23
- <%= pb_rails("tooltip", props: {
24
- trigger_element_selector: ".tooltip-open-delay",
25
- tooltip_id: "open-tooltip",
26
- position: 'top',
27
- delay_open: 1000
28
- }) do %>
29
- 1s open delay
30
- <% end %>
31
- <%= pb_rails("tooltip", props: {
32
- trigger_element_selector: ".tooltip-close-delay",
33
- tooltip_id: "close-tooltip",
34
- position: 'top',
35
- delay_close: 1000
36
- }) do %>
37
- 1s close delay
38
- <% end %>
39
- <% end %>
@@ -1,3 +0,0 @@
1
- Waits for the specified time when the event listener runs before triggering the tooltip.
2
-
3
- The `delay_open` and `delay_close` accept numbers in milliseconds. 1 second is 1000 milliseconds.
@@ -1,26 +0,0 @@
1
- <%= pb_rails("flex", props: { gap: "md", wrap: true }) do %>
2
- <%= pb_rails("flex/flex_item") do %>
3
- <%= pb_rails("button", props: { text: "With Interaction", id: "tooltip-interaction"}) %>
4
-
5
- <%= pb_rails("tooltip", props: {
6
- trigger_element_selector: "#tooltip-interaction",
7
- tooltip_id: "tooltip-with-interaction",
8
- position: 'top',
9
- interaction: true
10
- }) do %>
11
- You can copy me
12
- <% end %>
13
- <% end %>
14
-
15
- <%= pb_rails("flex/flex_item") do %>
16
- <%= pb_rails("button", props: { text: "No Interaction", id: "tooltip-no-interaction"}) %>
17
-
18
- <%= pb_rails("tooltip", props: {
19
- trigger_element_selector: "#tooltip-no-interaction",
20
- tooltip_id: "tooltip-without-interaction",
21
- position: 'top',
22
- }) do %>
23
- I'm just a regular tooltip
24
- <% end %>
25
- <% end %>
26
- <% end %>
@@ -1,45 +0,0 @@
1
- <%= pb_rails("select", props: {
2
- id:"color_context_2",
3
- label: "Choose a Color",
4
- name: "color_name",
5
- options: [
6
- { value: "red", value_text: "Red" },
7
- { value: "blue", value_text: "Blue" },
8
- { value: "green", value_text: "Green" }
9
- ],
10
- }) %>
11
-
12
- <%= pb_rails("typeahead", props: {
13
- label: "Pick a Shade",
14
- is_multi: false,
15
- search_context_selector: "color_context_2",
16
- options_by_context: {
17
- "red": [
18
- { label: "Scarlet", value: "scarlet" },
19
- { label: "Mahogany", value: "mahogany" },
20
- { label: "Crimson", value: "crimson" }
21
- ],
22
- "blue": [
23
- { label: "Sky Blue", value: "sky" },
24
- { label: "Cerulean", value: "cerulean" },
25
- { label: "Navy", value: "navy" }
26
- ],
27
- "green": [
28
- { label: "Emerald", value: "emerald" },
29
- { label: "Mint", value: "mint" },
30
- { label: "Olive", value: "olive" }
31
- ]
32
- },
33
- id: "typeahead-dynamic-options",
34
- }) %>
35
-
36
-
37
- <%= javascript_tag defer: "defer" do %>
38
- document.addEventListener("pb-typeahead-kit-typeahead-dynamic-options-result-option-select", function(event) {
39
- console.log('Single Option selected')
40
- console.dir(event.detail)
41
- })
42
- document.addEventListener("pb-typeahead-kit-typeahead-dynamic-options-result-clear", function() {
43
- console.log('All options cleared')
44
- })
45
- <% end %>
@@ -1,5 +0,0 @@
1
- You can also set up a typeahead to render options dynamically based on input from a select. To achieve this:
2
- - The typeahead must have a unique `id`
3
- - Use the `search_context_selector` prop on the typeahead. The value here must match the id of the select so the Typeahead knows where to read the current "context" from.
4
- - Use `options_by_context` to pass in a hash whose keys match the possible values of your “context” select. Each key maps to an array of { label, value } objects. The typeahead automatically displays only the subset of options matching the current context.
5
- - Additionally, the optional `clear_on_context_change` prop controls whether the typeahead clears or not when a change happens in the linked select. This prop is set to true by default so that whenever a selection is made in the select, the Typeahead automatically clears its current input/selection.
@@ -1,33 +0,0 @@
1
- <%= pb_rails("select", props: {
2
- id:"color_context",
3
- label: "Choose a Color",
4
- name: "color_name_2",
5
- options: [
6
- { value: "red", value_text: "Red" },
7
- { value: "blue", value_text: "Blue" },
8
- { value: "green", value_text: "Green" }
9
- ],
10
- }) %>
11
-
12
- <%= pb_rails("typeahead", props: {
13
- label: "Pick a Shade",
14
- search_context_selector: "color_context",
15
- options_by_context: {
16
- "red": [
17
- { label: "Scarlet", value: "scarlet" },
18
- { label: "Mahogany", value: "mahogany" },
19
- { label: "Crimson", value: "crimson" }
20
- ],
21
- "blue": [
22
- { label: "Sky Blue", value: "sky" },
23
- { label: "Cerulean", value: "cerulean" },
24
- { label: "Navy", value: "navy" }
25
- ],
26
- "green": [
27
- { label: "Emerald", value: "emerald" },
28
- { label: "Mint", value: "mint" },
29
- { label: "Olive", value: "olive" }
30
- ]
31
- },
32
- search_term_minimum_length: 0,
33
- }) %>
@@ -1,3 +0,0 @@
1
- The dynamic rendering of options for the typeahead can also be achieved with a pure Rails implementation (not react rendered). For this implementation, use all the props as above with the following additions:
2
-
3
- - `search_term_minimum_length`: this sets the minimum input in the typeahead needed to display the dropdown. This is set to 3 by default. Set it to 0 for the dropdown to always display when the typeahead is interacted with.