playbook_ui 14.21.0.pre.alpha.renovatenpmtrixvulnerability8103 → 14.21.0.pre.rc.0
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/Components/CustomCell.tsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +49 -116
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +2 -58
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +4 -16
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +3 -7
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -40
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +3 -13
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -7
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -61
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/index.js +0 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +11 -4
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +6 -10
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +48 -2
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +58 -17
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +3 -12
- 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.test.jsx +2 -108
- data/app/pb_kits/playbook/pb_dropdown/index.js +0 -24
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +10 -14
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +15 -26
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +0 -4
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_only_countries.jsx +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -4
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_popover/index.ts +4 -9
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +51 -3
- data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +1 -1
- data/dist/chunks/{_typeahead-CoOpeYom.js → _typeahead-BmOWdDtp.js} +2 -2
- data/dist/chunks/_weekday_stacked-CvcuQyr9.js +45 -0
- data/dist/chunks/{lib-D7Va7yqa.js → lib-D5R1BjUn.js} +1 -1
- data/dist/chunks/{pb_form_validation-DSkdRDMf.js → pb_form_validation-BZ2AVAi_.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +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 +2 -2
- metadata +6 -19
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_scrollbar_none.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_scrollbar_none.jsx +0 -53
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +0 -1
- data/app/pb_kits/playbook/pb_checkbox/index.js +0 -56
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_date_display.html.erb +0 -13
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.jsx +0 -42
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.md +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.html.erb +0 -4
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.jsx +0 -15
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.md +0 -1
- data/dist/chunks/_weekday_stacked-B_jpa2Rz.js +0 -45
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.21.0.pre.
|
4
|
+
version: 14.21.0.pre.rc.0
|
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-
|
12
|
+
date: 2025-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -335,19 +335,14 @@ files:
|
|
335
335
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.jsx
|
336
336
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading_rails.md
|
337
337
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading_react.md
|
338
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.html.erb
|
339
338
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx
|
340
339
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx
|
341
340
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md
|
342
341
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx
|
343
342
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md
|
344
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx
|
345
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md
|
346
343
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb
|
347
344
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.jsx
|
348
345
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.md
|
349
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_scrollbar_none.html.erb
|
350
|
-
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_scrollbar_none.jsx
|
351
346
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx
|
352
347
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md
|
353
348
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx
|
@@ -728,7 +723,6 @@ files:
|
|
728
723
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_error_swift.md
|
729
724
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb
|
730
725
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.jsx
|
731
|
-
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md
|
732
726
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_swift.md
|
733
727
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_options.html.erb
|
734
728
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_props_swift.md
|
@@ -737,7 +731,6 @@ files:
|
|
737
731
|
- app/pb_kits/playbook/pb_checkbox/docs/_description.md
|
738
732
|
- app/pb_kits/playbook/pb_checkbox/docs/example.yml
|
739
733
|
- app/pb_kits/playbook/pb_checkbox/docs/index.js
|
740
|
-
- app/pb_kits/playbook/pb_checkbox/index.js
|
741
734
|
- app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts
|
742
735
|
- app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss
|
743
736
|
- app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx
|
@@ -1015,7 +1008,6 @@ files:
|
|
1015
1008
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.html.erb
|
1016
1009
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.jsx
|
1017
1010
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.md
|
1018
|
-
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_date_display.html.erb
|
1019
1011
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.html.erb
|
1020
1012
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.jsx
|
1021
1013
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.md
|
@@ -1332,8 +1324,6 @@ files:
|
|
1332
1324
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx
|
1333
1325
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx
|
1334
1326
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.md
|
1335
|
-
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.jsx
|
1336
|
-
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.md
|
1337
1327
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx
|
1338
1328
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md
|
1339
1329
|
- app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb
|
@@ -2421,9 +2411,6 @@ files:
|
|
2421
2411
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_default.html.erb
|
2422
2412
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_default.jsx
|
2423
2413
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_default.md
|
2424
|
-
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.html.erb
|
2425
|
-
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.jsx
|
2426
|
-
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.md
|
2427
2414
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb
|
2428
2415
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx
|
2429
2416
|
- app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md
|
@@ -3608,11 +3595,11 @@ files:
|
|
3608
3595
|
- app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
|
3609
3596
|
- app/pb_kits/playbook/utilities/text.ts
|
3610
3597
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
3611
|
-
- dist/chunks/_typeahead-
|
3612
|
-
- dist/chunks/_weekday_stacked-
|
3598
|
+
- dist/chunks/_typeahead-BmOWdDtp.js
|
3599
|
+
- dist/chunks/_weekday_stacked-CvcuQyr9.js
|
3613
3600
|
- dist/chunks/lazysizes-B7xYodB-.js
|
3614
|
-
- dist/chunks/lib-
|
3615
|
-
- dist/chunks/pb_form_validation-
|
3601
|
+
- dist/chunks/lib-D5R1BjUn.js
|
3602
|
+
- dist/chunks/pb_form_validation-BZ2AVAi_.js
|
3616
3603
|
- dist/chunks/vendor.js
|
3617
3604
|
- dist/menu.yml
|
3618
3605
|
- dist/playbook-doc.js
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<% column_definitions = [
|
2
|
-
{
|
3
|
-
accessor: "year",
|
4
|
-
label: "Year",
|
5
|
-
cellAccessors: ["quarter", "month", "day"],
|
6
|
-
},
|
7
|
-
{
|
8
|
-
accessor: "newEnrollments",
|
9
|
-
label: "New Enrollments",
|
10
|
-
},
|
11
|
-
{
|
12
|
-
accessor: "scheduledMeetings",
|
13
|
-
label: "Scheduled Meetings",
|
14
|
-
},
|
15
|
-
{
|
16
|
-
accessor: "attendanceRate",
|
17
|
-
label: "Attendance Rate",
|
18
|
-
},
|
19
|
-
{
|
20
|
-
accessor: "completedClasses",
|
21
|
-
label: "Completed Classes",
|
22
|
-
},
|
23
|
-
{
|
24
|
-
accessor: "classCompletionRate",
|
25
|
-
label: "Class Completion Rate",
|
26
|
-
},
|
27
|
-
{
|
28
|
-
accessor: "graduatedStudents",
|
29
|
-
label: "Graduated Students",
|
30
|
-
}
|
31
|
-
] %>
|
32
|
-
|
33
|
-
<%= pb_rails("advanced_table", props: { id: "table-no-children", enable_toggle_expansion: "none", table_data: @table_data_no_subrows, column_definitions: column_definitions }) %>
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import React, { useState } from "react"
|
2
|
-
import AdvancedTable from '../_advanced_table'
|
3
|
-
import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
|
4
|
-
|
5
|
-
const AdvancedTableRowPinning = (props) => {
|
6
|
-
const columnDefinitions = [
|
7
|
-
{
|
8
|
-
accessor: "year",
|
9
|
-
label: "Year",
|
10
|
-
cellAccessors: ["quarter", "month", "day"],
|
11
|
-
},
|
12
|
-
{
|
13
|
-
accessor: "newEnrollments",
|
14
|
-
label: "New Enrollments",
|
15
|
-
},
|
16
|
-
{
|
17
|
-
accessor: "scheduledMeetings",
|
18
|
-
label: "Scheduled Meetings",
|
19
|
-
},
|
20
|
-
{
|
21
|
-
accessor: "attendanceRate",
|
22
|
-
label: "Attendance Rate",
|
23
|
-
},
|
24
|
-
{
|
25
|
-
accessor: "completedClasses",
|
26
|
-
label: "Completed Classes",
|
27
|
-
},
|
28
|
-
{
|
29
|
-
accessor: "classCompletionRate",
|
30
|
-
label: "Class Completion Rate",
|
31
|
-
},
|
32
|
-
{
|
33
|
-
accessor: "graduatedStudents",
|
34
|
-
label: "Graduated Students",
|
35
|
-
},
|
36
|
-
]
|
37
|
-
|
38
|
-
const [pinnedRows, setPinnedRows] = useState({top: ["8", "9", "10", "11", "12", "13", "14"]})
|
39
|
-
|
40
|
-
return (
|
41
|
-
<div>
|
42
|
-
<AdvancedTable
|
43
|
-
columnDefinitions={columnDefinitions}
|
44
|
-
maxHeight="xs"
|
45
|
-
pinnedRows={{value: pinnedRows, onChange: setPinnedRows}}
|
46
|
-
tableData={MOCK_DATA}
|
47
|
-
tableProps={{sticky: true}}
|
48
|
-
{...props}
|
49
|
-
>
|
50
|
-
<AdvancedTable.Header enableSorting />
|
51
|
-
<AdvancedTable.Body />
|
52
|
-
</AdvancedTable>
|
53
|
-
</div>
|
54
|
-
)
|
55
|
-
}
|
56
|
-
|
57
|
-
export default AdvancedTableRowPinning
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Use the `pinnedRows` prop to pin specific rows to the top of an Advanced Table. Pinned rows will remain at the top when scrolling through table data and reorganizing via sorting.
|
2
|
-
|
3
|
-
**NOTE:** This prop is in Beta. Current Requirements for V1:
|
4
|
-
- Sticky header required: Pinned rows must be used with `sticky: true` via `tableProps` (works with both responsive and non-responsive tables)
|
5
|
-
- Row ids required: Pass an array of row ids to the `top` property. For expandable rows, both parent and all its child row ids must be included individually
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<% column_definitions = [
|
2
|
-
{
|
3
|
-
accessor: "year",
|
4
|
-
label: "Year",
|
5
|
-
cellAccessors: ["quarter", "month", "day"],
|
6
|
-
},
|
7
|
-
{
|
8
|
-
accessor: "newEnrollments",
|
9
|
-
label: "New Enrollments",
|
10
|
-
},
|
11
|
-
{
|
12
|
-
accessor: "scheduledMeetings",
|
13
|
-
label: "Scheduled Meetings",
|
14
|
-
},
|
15
|
-
{
|
16
|
-
accessor: "attendanceRate",
|
17
|
-
label: "Attendance Rate",
|
18
|
-
},
|
19
|
-
{
|
20
|
-
accessor: "completedClasses",
|
21
|
-
label: "Completed Classes",
|
22
|
-
},
|
23
|
-
{
|
24
|
-
accessor: "classCompletionRate",
|
25
|
-
label: "Class Completion Rate",
|
26
|
-
},
|
27
|
-
{
|
28
|
-
accessor: "graduatedStudents",
|
29
|
-
label: "Graduated Students",
|
30
|
-
}
|
31
|
-
] %>
|
32
|
-
|
33
|
-
<%= pb_rails("advanced_table", props: { id: "beta_table", table_data: @table_data, column_definitions: column_definitions, max_height: "xs", scroll_bar_none: true }) %>
|
@@ -1,53 +0,0 @@
|
|
1
|
-
import React from "react"
|
2
|
-
import AdvancedTable from '../../pb_advanced_table/_advanced_table'
|
3
|
-
import MOCK_DATA from "./advanced_table_mock_data.json"
|
4
|
-
|
5
|
-
const AdvancedTableScrollbarNone = (props) => {
|
6
|
-
const columnDefinitions = [
|
7
|
-
{
|
8
|
-
accessor: "year",
|
9
|
-
label: "Year",
|
10
|
-
cellAccessors: ["quarter", "month", "day"],
|
11
|
-
},
|
12
|
-
{
|
13
|
-
accessor: "newEnrollments",
|
14
|
-
label: "New Enrollments",
|
15
|
-
},
|
16
|
-
{
|
17
|
-
accessor: "scheduledMeetings",
|
18
|
-
label: "Scheduled Meetings",
|
19
|
-
},
|
20
|
-
{
|
21
|
-
accessor: "attendanceRate",
|
22
|
-
label: "Attendance Rate",
|
23
|
-
},
|
24
|
-
{
|
25
|
-
accessor: "completedClasses",
|
26
|
-
label: "Completed Classes",
|
27
|
-
},
|
28
|
-
{
|
29
|
-
accessor: "classCompletionRate",
|
30
|
-
label: "Class Completion Rate",
|
31
|
-
},
|
32
|
-
{
|
33
|
-
accessor: "graduatedStudents",
|
34
|
-
label: "Graduated Students",
|
35
|
-
},
|
36
|
-
]
|
37
|
-
|
38
|
-
return (
|
39
|
-
<div>
|
40
|
-
<AdvancedTable
|
41
|
-
columnDefinitions={columnDefinitions}
|
42
|
-
maxHeight="xs"
|
43
|
-
overflow="auto"
|
44
|
-
responsive="scroll"
|
45
|
-
scrollBarNone
|
46
|
-
tableData={MOCK_DATA}
|
47
|
-
{...props}
|
48
|
-
/>
|
49
|
-
</div>
|
50
|
-
)
|
51
|
-
}
|
52
|
-
|
53
|
-
export default AdvancedTableScrollbarNone
|
@@ -1 +0,0 @@
|
|
1
|
-
If you want to use indeterminate, "check/uncheck all" checkboxes, add `indeterminate_main: true` and an `id` to the main checkbox. Then, add an `indeterminate_parent` prop with the main checkbox's `id` to the children checkboxes.
|
@@ -1,56 +0,0 @@
|
|
1
|
-
import PbEnhancedElement from "../pb_enhanced_element"
|
2
|
-
|
3
|
-
const INDETERMINATE_MAIN_CHECKBOX_SELECTOR = "[data-pb-checkbox-indeterminate-main='true']"
|
4
|
-
|
5
|
-
export default class PbCheckbox extends PbEnhancedElement {
|
6
|
-
static get selector() {
|
7
|
-
return INDETERMINATE_MAIN_CHECKBOX_SELECTOR
|
8
|
-
}
|
9
|
-
|
10
|
-
connect() {
|
11
|
-
const mainCheckboxWrapper = this.element;
|
12
|
-
const mainCheckbox = mainCheckboxWrapper.querySelector('input')
|
13
|
-
const childCheckboxes = document.querySelectorAll(`[data-pb-checkbox-indeterminate-parent="${this.element.id}"] input[type="checkbox"]`);
|
14
|
-
|
15
|
-
const updateMainCheckbox = () => {
|
16
|
-
// Count the number of checked child checkboxes
|
17
|
-
const checkedCount = Array.from(childCheckboxes).filter(cb => cb.checked).length;
|
18
|
-
// Determine if the main checkbox should be in an indeterminate state
|
19
|
-
const indeterminate = checkedCount > 0 && checkedCount < childCheckboxes.length;
|
20
|
-
|
21
|
-
// Set the main checkbox states
|
22
|
-
mainCheckbox.indeterminate = indeterminate;
|
23
|
-
mainCheckbox.checked = checkedCount > 0;
|
24
|
-
|
25
|
-
// Determine the main checkbox label based on the number of checked checkboxes
|
26
|
-
const text = checkedCount === 0 ? 'Check All' : 'Uncheck All';
|
27
|
-
|
28
|
-
// Determine the icon class to add and remove based on the number of checked checkboxes
|
29
|
-
const iconClassToAdd = checkedCount === 0 ? 'pb_checkbox_checkmark' : 'pb_checkbox_indeterminate';
|
30
|
-
const iconClassToRemove = checkedCount === 0 ? 'pb_checkbox_indeterminate' : 'pb_checkbox_checkmark';
|
31
|
-
|
32
|
-
// Update main checkbox label
|
33
|
-
mainCheckboxWrapper.getElementsByClassName('pb_body_kit')[0].textContent = text;
|
34
|
-
|
35
|
-
// Add and remove the icon class to the main checkbox wrapper
|
36
|
-
mainCheckboxWrapper.querySelector('[data-pb-checkbox-icon-span]').classList.add(iconClassToAdd);
|
37
|
-
mainCheckboxWrapper.querySelector('[data-pb-checkbox-icon-span]').classList.remove(iconClassToRemove);
|
38
|
-
|
39
|
-
// Toggle the visibility of the checkbox icon based on the indeterminate state
|
40
|
-
mainCheckboxWrapper.getElementsByClassName("indeterminate_icon")[0].classList.toggle('hidden', !indeterminate);
|
41
|
-
mainCheckboxWrapper.getElementsByClassName("check_icon")[0].classList.toggle('hidden', indeterminate);
|
42
|
-
};
|
43
|
-
|
44
|
-
// Set indeterminate icon on main checkbox if initial children checkboxes are checked
|
45
|
-
updateMainCheckbox();
|
46
|
-
|
47
|
-
this.element.querySelector('input').addEventListener('change', function() {
|
48
|
-
childCheckboxes.forEach(cb => cb.checked = this.checked);
|
49
|
-
updateMainCheckbox();
|
50
|
-
});
|
51
|
-
|
52
|
-
childCheckboxes.forEach(cb => {
|
53
|
-
cb.addEventListener('change', updateMainCheckbox);
|
54
|
-
});
|
55
|
-
}
|
56
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<%= pb_rails("date_picker", props: {
|
2
|
-
allow_input: true,
|
3
|
-
date_display: false,
|
4
|
-
end_date_id: "quick-pick-end-date",
|
5
|
-
end_date_name: "quick-pick-end-date",
|
6
|
-
mode: "range",
|
7
|
-
picker_id: "date-picker-quick-pick-date-display",
|
8
|
-
placeholder: "mm/dd/yyyy to mm/dd/yyyy",
|
9
|
-
selection_type: "quickpick",
|
10
|
-
start_date_id: "quick-pick-start-date",
|
11
|
-
start_date_name: "quick-pick-start-date"
|
12
|
-
}) %>
|
13
|
-
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Dropdown from '../../pb_dropdown/_dropdown'
|
3
|
-
|
4
|
-
const DropdownCloseOnSelect = (props) => {
|
5
|
-
|
6
|
-
const options = [
|
7
|
-
{
|
8
|
-
label: "United States",
|
9
|
-
value: "United States",
|
10
|
-
},
|
11
|
-
{
|
12
|
-
label: "Canada",
|
13
|
-
value: "Canada",
|
14
|
-
},
|
15
|
-
{
|
16
|
-
label: "Pakistan",
|
17
|
-
value: "Pakistan",
|
18
|
-
}
|
19
|
-
];
|
20
|
-
|
21
|
-
|
22
|
-
return (
|
23
|
-
<div>
|
24
|
-
<Dropdown
|
25
|
-
closeOnSelection={false}
|
26
|
-
label="Default"
|
27
|
-
options={options}
|
28
|
-
{...props}
|
29
|
-
/>
|
30
|
-
<br />
|
31
|
-
<Dropdown
|
32
|
-
closeOnSelection={false}
|
33
|
-
label="Multi Select"
|
34
|
-
multiSelect
|
35
|
-
options={options}
|
36
|
-
{...props}
|
37
|
-
/>
|
38
|
-
</div>
|
39
|
-
)
|
40
|
-
}
|
41
|
-
|
42
|
-
export default DropdownCloseOnSelect
|
@@ -1 +0,0 @@
|
|
1
|
-
By default, the dropdown menu will close when a selection is made. You can prevent this behavior by using the `closeOnSelection` prop, which will leave the menu open after a selection is made when set to 'false'.
|
data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.jsx
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import PhoneNumberInput from '../../pb_phone_number_input/_phone_number_input'
|
3
|
-
|
4
|
-
const PhoneNumberInputExcludeCountries = (props) => (
|
5
|
-
<>
|
6
|
-
<PhoneNumberInput
|
7
|
-
excludeCountries={['us', 'br']}
|
8
|
-
id='exclude'
|
9
|
-
initialCountry='gb'
|
10
|
-
{...props}
|
11
|
-
/>
|
12
|
-
</>
|
13
|
-
)
|
14
|
-
|
15
|
-
export default PhoneNumberInputExcludeCountries
|
data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_exclude_countries.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Excluding countries removes the selected countries from the dropdown.
|