playbook_ui 15.7.0.pre.alpha.PLAY2675dropdownquickpickcustomquickpickdates13330 → 15.7.0.pre.alpha.PLAY2678emojimask13284
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_dropdown/_dropdown.tsx +1 -13
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +1 -6
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +0 -121
- data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +9 -85
- data/app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb +2 -83
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +41 -3
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.html.erb +7 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.jsx +24 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_mask.md +2 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_text_input/index.js +49 -8
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +5 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +53 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +38 -2
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.html.erb +5 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.jsx +24 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.md +1 -0
- data/app/pb_kits/playbook/pb_textarea/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_textarea/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_textarea/index.ts +62 -5
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +1 -0
- data/app/pb_kits/playbook/pb_textarea/textarea.rb +8 -0
- data/app/pb_kits/playbook/pb_textarea/textarea.test.js +57 -2
- data/app/pb_kits/playbook/utilities/emojiMask.ts +42 -0
- data/dist/chunks/{_typeahead-Ckz1ce-2.js → _typeahead-CSCNg6cp.js} +2 -2
- data/dist/chunks/{lib-DxDBrGZX.js → lib-DxCgrqqG.js} +1 -1
- data/dist/chunks/vendor.js +3 -3
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/forms/builder/form_field_builder.rb +2 -0
- data/lib/playbook/version.rb +1 -1
- metadata +11 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom.jsx +0 -56
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom.md +0 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom_rails.html.erb +0 -64
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom_rails.md +0 -10
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<%= pb_rails("dropdown", props: {
|
|
2
|
-
custom_quick_pick_dates: {
|
|
3
|
-
dates: [
|
|
4
|
-
# Allow Playbook to handle the logic...
|
|
5
|
-
{
|
|
6
|
-
label: "Last 15 months",
|
|
7
|
-
value: {
|
|
8
|
-
time_period: "months",
|
|
9
|
-
amount: 15
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
# Or, be explicit with an exact date range for more control...
|
|
13
|
-
{
|
|
14
|
-
label: "First Week of June 2022",
|
|
15
|
-
value: ["06/01/2022", "06/07/2022"]
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
id: "date-range-quickpick-custom",
|
|
20
|
-
label: "Date Range",
|
|
21
|
-
margin_bottom: "sm",
|
|
22
|
-
variant: "quickpick"
|
|
23
|
-
}) %>
|
|
24
|
-
|
|
25
|
-
<%= pb_rails("dropdown", props: {
|
|
26
|
-
custom_quick_pick_dates: {
|
|
27
|
-
override: false,
|
|
28
|
-
dates: [
|
|
29
|
-
{
|
|
30
|
-
label: "Last 15 months",
|
|
31
|
-
value: {
|
|
32
|
-
time_period: "months",
|
|
33
|
-
amount: 15
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
label: "First Week of June 2022",
|
|
38
|
-
value: ["06/01/2022", "06/07/2022"]
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
id: "date-range-quickpick-custom-append-to-defaults",
|
|
43
|
-
label: "Date Range - Append to Defaults",
|
|
44
|
-
variant: "quickpick"
|
|
45
|
-
}) %>
|
|
46
|
-
|
|
47
|
-
<script>
|
|
48
|
-
const dropdown1 = document.getElementById("date-range-quickpick-custom");
|
|
49
|
-
if (dropdown1) {
|
|
50
|
-
dropdown1.addEventListener("pb:dropdown:selected", (e) => {
|
|
51
|
-
const option = e.detail;
|
|
52
|
-
console.log("Selected option:", option);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const dropdown2 = document.getElementById("date-range-quickpick-custom-append-to-defaults");
|
|
57
|
-
if (dropdown2) {
|
|
58
|
-
dropdown2.addEventListener("pb:dropdown:selected", (e) => {
|
|
59
|
-
const option = e.detail;
|
|
60
|
-
console.log("Selected option:", option);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
</script>
|
|
64
|
-
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
The `custom_quick_pick_dates` prop allows for defining custom quick pick date options for the dropdown. The prop accepts an object with two properties: `dates` and `override`.
|
|
2
|
-
|
|
3
|
-
**The `dates` property** accepts an array of objects. Each object has `label` and `value` properties. The `label` is what will be displayed in the dropdown menu. The `value` property defines the date range that will be selected, and can be:
|
|
4
|
-
- An array of two date strings representing a specific range (e.g., `["06/01/2022", "06/07/2022"]`)
|
|
5
|
-
- An object with `time_period` and `amount` properties for dynamic date calculations:
|
|
6
|
-
- The `time_period` property accepts `"days"`, `"weeks"`, `"months"`, `"quarters"`, or `"years"`, representing past time periods calculated from today.
|
|
7
|
-
- The `amount` property accepts any number.
|
|
8
|
-
|
|
9
|
-
**The `override` property** is a boolean that controls whether custom dates replace or append to the default quick pick options. Default is `true` (replaces defaults). Set to `false` to append your custom dates to the default quick pick options.
|
|
10
|
-
|