playbook_ui 14.14.0.pre.alpha.PBNTR892dialogenhancedelement6476 → 14.14.0.pre.alpha.PBNTR894allowingcurrencyzero6405
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_dialog/dialog.html.erb +6 -5
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +0 -2
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +0 -13
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +1 -7
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_overlay/overlay.rb +1 -7
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +0 -12
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +2 -3
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -34
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/index.ts +8 -61
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -13
- data/dist/chunks/{_typeahead-NXKDTf__.js → _typeahead-DXmDhfga.js} +2 -2
- data/dist/chunks/{_weekday_stacked-DtCYkCXM.js → _weekday_stacked-Cb1DOlft.js} +2 -2
- data/dist/chunks/{lib-Dmay5Z6U.js → lib-Fr78pbpF.js} +1 -1
- data/dist/chunks/{pb_form_validation-DdP7BnVX.js → pb_form_validation-CN51bfsD.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +6 -15
- data/app/pb_kits/playbook/pb_dialog/index.js +0 -75
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +0 -11
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +0 -37
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +0 -45
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +0 -5
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +0 -33
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +0 -3
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 14.14.0.pre.alpha.
|
4
|
+
version: 14.14.0.pre.alpha.PBNTR894allowingcurrencyzero6405
|
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-
|
12
|
+
date: 2025-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -1143,7 +1143,6 @@ files:
|
|
1143
1143
|
- app/pb_kits/playbook/pb_dialog/docs/_dialog_status_swift.md
|
1144
1144
|
- app/pb_kits/playbook/pb_dialog/docs/example.yml
|
1145
1145
|
- app/pb_kits/playbook/pb_dialog/docs/index.js
|
1146
|
-
- app/pb_kits/playbook/pb_dialog/index.js
|
1147
1146
|
- app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.scss
|
1148
1147
|
- app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx
|
1149
1148
|
- app/pb_kits/playbook/pb_distribution_bar/distribution_bar.html.erb
|
@@ -2128,10 +2127,6 @@ files:
|
|
2128
2127
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_default.html.erb
|
2129
2128
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx
|
2130
2129
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md
|
2131
|
-
- app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb
|
2132
|
-
- app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx
|
2133
|
-
- app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md
|
2134
|
-
- app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md
|
2135
2130
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.html.erb
|
2136
2131
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx
|
2137
2132
|
- app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md
|
@@ -3166,10 +3161,6 @@ files:
|
|
3166
3161
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx
|
3167
3162
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb
|
3168
3163
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx
|
3169
|
-
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb
|
3170
|
-
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md
|
3171
|
-
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb
|
3172
|
-
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md
|
3173
3164
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb
|
3174
3165
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx
|
3175
3166
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.md
|
@@ -3376,11 +3367,11 @@ files:
|
|
3376
3367
|
- app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
|
3377
3368
|
- app/pb_kits/playbook/utilities/text.ts
|
3378
3369
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
3379
|
-
- dist/chunks/_typeahead-
|
3380
|
-
- dist/chunks/_weekday_stacked-
|
3370
|
+
- dist/chunks/_typeahead-DXmDhfga.js
|
3371
|
+
- dist/chunks/_weekday_stacked-Cb1DOlft.js
|
3381
3372
|
- dist/chunks/lazysizes-B7xYodB-.js
|
3382
|
-
- dist/chunks/lib-
|
3383
|
-
- dist/chunks/pb_form_validation-
|
3373
|
+
- dist/chunks/lib-Fr78pbpF.js
|
3374
|
+
- dist/chunks/pb_form_validation-CN51bfsD.js
|
3384
3375
|
- dist/chunks/vendor.js
|
3385
3376
|
- dist/menu.yml
|
3386
3377
|
- dist/playbook-doc.js
|
@@ -1,75 +0,0 @@
|
|
1
|
-
import PbEnhancedElement from "../pb_enhanced_element";
|
2
|
-
|
3
|
-
const DIALOG_WRAPPER_SELECTOR = "[data-pb-dialog-wrapper]";
|
4
|
-
|
5
|
-
export default class PbDialog extends PbEnhancedElement {
|
6
|
-
static get selector() {
|
7
|
-
return DIALOG_WRAPPER_SELECTOR;
|
8
|
-
}
|
9
|
-
|
10
|
-
connect() {
|
11
|
-
window.addEventListener("DOMContentLoaded", () => this.setupDialog())
|
12
|
-
window.addEventListener("turbo:frame-load", () => this.setupDialog())
|
13
|
-
}
|
14
|
-
|
15
|
-
setupDialog() {
|
16
|
-
const openTrigger = document.querySelectorAll("[data-open-dialog]");
|
17
|
-
const closeTrigger = document.querySelectorAll("[data-close-dialog]");
|
18
|
-
const dialogs = document.querySelectorAll(".pb_dialog_rails")
|
19
|
-
|
20
|
-
const loadingButton = document.querySelector('[data-disable-with="Loading"]');
|
21
|
-
if (loadingButton) {
|
22
|
-
loadingButton.addEventListener("click", function () {
|
23
|
-
const okayLoadingButton = document.querySelector('[data-disable-with="Loading"]');
|
24
|
-
const cancelButton = document.querySelector('[data-disable-cancel-with="Loading"]');
|
25
|
-
let currentClass = okayLoadingButton.className;
|
26
|
-
let cancelClass = cancelButton ? cancelButton.className : "";
|
27
|
-
|
28
|
-
let newClass = currentClass.replace("_enabled", "_disabled_loading");
|
29
|
-
let newCancelClass = cancelClass.replace("_enabled", "_disabled");
|
30
|
-
|
31
|
-
// Disable the buttons
|
32
|
-
okayLoadingButton.disabled = true;
|
33
|
-
if (cancelButton) cancelButton.disabled = true;
|
34
|
-
|
35
|
-
okayLoadingButton.className = newClass;
|
36
|
-
if (cancelButton) cancelButton.className = newCancelClass;
|
37
|
-
});
|
38
|
-
}
|
39
|
-
|
40
|
-
openTrigger.forEach((open) => {
|
41
|
-
open.addEventListener("click", () => {
|
42
|
-
var openTriggerData = open.dataset.openDialog;
|
43
|
-
var targetDialog = document.getElementById(openTriggerData)
|
44
|
-
if (targetDialog.open) return;
|
45
|
-
targetDialog.showModal();
|
46
|
-
});
|
47
|
-
});
|
48
|
-
|
49
|
-
closeTrigger.forEach((close) => {
|
50
|
-
close.addEventListener("click", () => {
|
51
|
-
var closeTriggerData = close.dataset.closeDialog;
|
52
|
-
document.getElementById(closeTriggerData).close();
|
53
|
-
});
|
54
|
-
});
|
55
|
-
|
56
|
-
// Close dialog box on outside click
|
57
|
-
dialogs.forEach((dialogElement) => {
|
58
|
-
dialogElement.addEventListener("mousedown", (event) => {
|
59
|
-
const dialogParentDataset = dialogElement.parentElement.dataset
|
60
|
-
if (dialogParentDataset.overlayClick === "overlay_close") return
|
61
|
-
|
62
|
-
const dialogModal = event.target.getBoundingClientRect()
|
63
|
-
const clickedOutsideDialogModal = event.clientX < dialogModal.left ||
|
64
|
-
event.clientX > dialogModal.right ||
|
65
|
-
event.clientY < dialogModal.top ||
|
66
|
-
event.clientY > dialogModal.bottom
|
67
|
-
|
68
|
-
if (clickedOutsideDialogModal) {
|
69
|
-
dialogElement.close()
|
70
|
-
event.stopPropagation()
|
71
|
-
}
|
72
|
-
})
|
73
|
-
})
|
74
|
-
}
|
75
|
-
}
|
@@ -1,11 +0,0 @@
|
|
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 %>
|
@@ -1,37 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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.
|
@@ -1 +0,0 @@
|
|
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.
|
@@ -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.
|