playbook_ui_docs 14.14.0.pre.alpha.play1853typeaheadreacthookform6373 → 14.14.0.pre.alpha.play1853typeaheadreacthookform6480

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +8 -0
  3. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +33 -0
  4. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
  5. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +20 -1
  6. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +24 -0
  7. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +21 -0
  8. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +1 -0
  9. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +49 -0
  10. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +5 -0
  11. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
  12. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +11 -0
  13. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +37 -0
  14. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +1 -0
  15. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +1 -0
  16. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +11 -0
  17. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +1 -0
  18. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +3 -0
  19. data/app/pb_kits/playbook/pb_overlay/docs/index.js +1 -0
  20. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +39 -0
  21. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +3 -0
  22. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +26 -0
  23. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +2 -0
  24. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +45 -0
  25. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +5 -0
  26. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +33 -0
  27. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +3 -0
  28. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +1 -1
  29. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +1 -1
  30. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +1 -1
  31. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  32. data/dist/playbook-doc.js +1 -1
  33. metadata +22 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69e167614dc6979147993f0aca179416464a0dcf5041e49f1fb1bba2d850c608
4
- data.tar.gz: 5efe6838dc0280186e139e6063666bbe932377f8a4eba745174328a5fd413220
3
+ metadata.gz: c942e1b9d08c93696d7902328d2a05261b809a3cb41f9154cee8650638d93e99
4
+ data.tar.gz: 2e95c9e8f281018fd6c069b3fb9763540e3eeeeabe710e71aed61fc0c9ce7ba2
5
5
  SHA512:
6
- metadata.gz: 75dcba3659690199acce6ef5089146adbac805c32a4740f71450fbe859d551bb3c68a42e6a53855e5c5316b7211e31ff1167c686dab773f35e0ac7b3adcb8b9c
7
- data.tar.gz: 111c76c52106f396099e90219702955c9046fe4fc17b43b84a7785feaa859e6607a85978d05ca6982900c3fec5be0ca25e6a4a2cded8d43595f6b1325489be1e
6
+ metadata.gz: 47d076e0a2e6b031f8782fc04365f14f211db7b05be1a513bd04d196a6c00c5f53c7806396e4bf2b50ec4b17371a88abbb8c2cbb42d0726a3cc54af01c36d737
7
+ data.tar.gz: 9b2c7f57605b805a3a78286241a2ea51be15f3f62fe9112c1991257a52c9ad158f9c4ad9ba0a2ee0ca9edd8a7df43bc835a5444767e201421b2062b297ebc932
@@ -0,0 +1,8 @@
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 %>
@@ -0,0 +1,33 @@
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 +1,20 @@
1
- <%= pb_rails("drawer") %>
1
+ <%= pb_rails("flex") do %>
2
+ <%= pb_rails("button", props: { text: "Left Drawer", margin_right: "sm", data: {"open-drawer": "drawer-1"} }) %>
3
+
4
+ <%= pb_rails("drawer", props: {
5
+ id:"drawer-1",
6
+ }) do %>
7
+ Test me (Left Drawer)
8
+ <% end %>
9
+
10
+
11
+ <%= pb_rails("button", props: { text: "Right Drawer", data: {"open-drawer": "drawer-2"} }) %>
12
+
13
+ <%= pb_rails("drawer", props: {
14
+ id:"drawer-2",
15
+ placement: "right"
16
+ }) do %>
17
+ Test me (Right Drawer)
18
+ <% end %>
19
+ <% end %>
20
+
@@ -0,0 +1,24 @@
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 %>
@@ -0,0 +1,21 @@
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
+
@@ -0,0 +1 @@
1
+ Click the button to close the drawer when there is no overlay.
@@ -0,0 +1,49 @@
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
+
@@ -2,6 +2,11 @@ examples:
2
2
 
3
3
  rails:
4
4
  - drawer_default: Default
5
+ - drawer_behavior: Push Behavior
6
+ - drawer_menu: Within Element
7
+ - drawer_sizes: Sizes
8
+ - drawer_overlay: Overlay
9
+ - drawer_borders: Borders
5
10
 
6
11
 
7
12
  react:
@@ -32,7 +32,7 @@
32
32
  <%= form.url_field :example_url_field_validation, props: { label: true, required: true } %>
33
33
  <%= form.text_area :example_text_area_validation, props: { label: true, required: true } %>
34
34
  <%= form.dropdown_field :example_dropdown_validation, props: { label: true, options: example_dropdown_options, required: true } %>
35
- <%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
35
+ <%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true, validation_message: "Please, select an option." } %>
36
36
  <%= form.collection_select :example_collection_select_validation, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
37
37
  <%= form.check_box :example_checkbox, props: { text: "Example Checkbox", label: true, required: true } %>
38
38
  <%= form.date_picker :example_date_picker_2, props: { label: true, required: true } %>
@@ -0,0 +1,11 @@
1
+ <%= pb_rails("overlay", props: { layout: { "x": "xl" }, color: "card_light", scroll_bar_none: 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 %>
@@ -0,0 +1,37 @@
1
+ import React from 'react'
2
+ import {
3
+ Overlay,
4
+ Card,
5
+ Flex,
6
+ FlexItem,
7
+ } from 'playbook-ui'
8
+
9
+ const InlineCardsExample = () => {
10
+ return (
11
+ <Flex
12
+ columnGap="lg"
13
+ orientation="row"
14
+ overflowX="auto"
15
+ >
16
+ {Array.from({ length: 15 }, (_, index) => (
17
+ <FlexItem key={index}>
18
+ <Card>{"Card Content"}</Card>
19
+ </FlexItem>
20
+ ))}
21
+ </Flex>
22
+ )
23
+ }
24
+
25
+ const OverlayHideScrollBar = () => (
26
+ <>
27
+ <Overlay
28
+ color="card_light"
29
+ layout={{"x": "xl"}}
30
+ scrollBarNone
31
+ >
32
+ <InlineCardsExample />
33
+ </Overlay>
34
+ </>
35
+ )
36
+
37
+ export default OverlayHideScrollBar
@@ -0,0 +1 @@
1
+ Pass the `scroll_bar_none` prop to hide the scrollbar from view. This is particularly helpful for small containers where the scrollbar may occupy too much space.
@@ -0,0 +1 @@
1
+ Pass the `scrollBarNone` prop to hide the scrollbar from view. This is particularly helpful for small containers where the scrollbar may occupy too much space.
@@ -0,0 +1,11 @@
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 %>
@@ -0,0 +1 @@
1
+ Pass the `dynamic` prop to make the overlay render while the scrollbar isn't at either end on the scrollbar.
@@ -4,8 +4,11 @@ examples:
4
4
  - overlay_multi_directional: Multi-directional
5
5
  - overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
6
6
  - overlay_toggle: Toggle
7
+ - overlay_hide_scroll_bar: Hide Scroll Bar
7
8
 
8
9
  rails:
9
10
  - overlay_default: Default
10
11
  - overlay_multi_directional: Multi-directional
12
+ - overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
11
13
  - overlay_toggle: Toggle
14
+ - overlay_hide_scroll_bar: Hide Scroll Bar
@@ -2,3 +2,4 @@ export { default as OverlayDefault } from './_overlay_default.jsx'
2
2
  export { default as OverlayMultiDirectional } from './_overlay_multi_directional.jsx'
3
3
  export { default as OverlayToggle } from './_overlay_toggle.jsx'
4
4
  export { default as OverlayVerticalDynamicMultiDirectional } from './_overlay_vertical_dynamic_multi_directional.jsx'
5
+ export { default as OverlayHideScrollBar } from './_overlay_hide_scroll_bar.jsx'
@@ -0,0 +1,39 @@
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 %>
@@ -0,0 +1,3 @@
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.
@@ -0,0 +1,26 @@
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 %>
@@ -2,8 +2,10 @@ examples:
2
2
 
3
3
  rails:
4
4
  - tooltip_default: Default
5
+ - tooltip_interaction: Content Interaction
5
6
  - tooltip_selectors: Using Common Selectors
6
7
  - tooltip_with_icon_circle: Icon Circle Tooltip
8
+ - tooltip_delay_rails: Delay
7
9
  - tooltip_show_tooltip: Show Tooltip
8
10
 
9
11
  react:
@@ -0,0 +1,45 @@
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 %>
@@ -0,0 +1,5 @@
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.
@@ -0,0 +1,33 @@
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
+ }) %>
@@ -0,0 +1,3 @@
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.
@@ -12,7 +12,7 @@ const languages = [
12
12
  { label: 'Rust', value: '2010', category: 'Systems Programming' },
13
13
  { label: 'Swift', value: '2014', category: 'Mobile Development' },
14
14
  { label: 'Kotlin', value: '2011', category: 'Mobile Development' },
15
- { label: 'Ruby', value: '1995', category: 'Web Development' },
15
+ { label: 'Ruby', value: '1995', category: 'General Purpose' },
16
16
  { label: 'PHP', value: '1995', category: 'Web Development' },
17
17
  ]
18
18
 
@@ -49,7 +49,7 @@ const TypeaheadWithPillsAsyncCustomOptions = (props) => {
49
49
  * @summary - for doc example purposes only
50
50
  */
51
51
  const handleOnMultiValueClick = (value) => {
52
- alert(`You removed the user: "${value.label}"`)
52
+ alert(`You added the user: "${value.label}"`)
53
53
  }
54
54
 
55
55
  return (
@@ -56,7 +56,7 @@ const TypeaheadWithPillsAsyncUsers = (props) => {
56
56
  * @summary - for doc example purposes only
57
57
  */
58
58
  const handleOnMultiValueClick = (value) => {
59
- alert(`You removed the user: "${value.label}"`)
59
+ alert(`You added the user: "${value.label}"`)
60
60
  }
61
61
 
62
62
  return (
@@ -12,6 +12,8 @@ examples:
12
12
  - typeahead_margin_bottom: Margin Bottom
13
13
  - typeahead_with_pills_color: With Pills (Custom Color)
14
14
  - typeahead_truncated_text: Truncated Text
15
+ - typeahead_dynamic_options: Dynamic Options
16
+ - typeahead_dynamic_options_pure_rails: Dynamic Options (Pure Rails)
15
17
 
16
18
  react:
17
19
  - typeahead_default: Default