playbook_ui 14.18.0.pre.alpha.play2149overlaykitdynamicbug7619 → 14.18.0.pre.alpha.revert4567revert4553PLAY2056ATcolbordercolors7469
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/docs/_advanced_table_beta.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_react.jsx → _advanced_table_selectable_rows_no_subrows.jsx} +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +11 -228
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -1
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +0 -12
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +2 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +1 -22
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +1 -11
- data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +1 -11
- data/app/pb_kits/playbook/pb_draggable/index.js +2 -4
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +5 -33
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -5
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +16 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +2 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +64 -17
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_autocomplete_with_subcomponents.jsx → _dropdown_with_autocomplete_and_custom_display.jsx} +25 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_hook.jsx +79 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +4 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +0 -4
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -45
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +0 -10
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +0 -3
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +2 -12
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +1 -3
- data/app/pb_kits/playbook/pb_dropdown/index.js +0 -57
- data/app/pb_kits/playbook/pb_dropdown/keyboard_accessibility.js +0 -26
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +2 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +4 -4
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +18 -22
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +1 -2
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +1 -1
- data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +4 -5
- data/app/pb_kits/playbook/pb_select/_select.scss +0 -10
- data/app/pb_kits/playbook/pb_select/docs/_select_error.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +7 -7
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +5 -5
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb +1 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.html.erb +1 -5
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.html.erb +1 -8
- data/dist/chunks/{_typeahead-Bc1SPP0-.js → _typeahead-D8CsVBZO.js} +2 -2
- data/dist/chunks/_weekday_stacked-D3oLTSkH.js +45 -0
- 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 +13 -25
- data/app/pb_kits/playbook/pb_advanced_table/flat_advanced_table.js +0 -106
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line_rails.md +0 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_rails.md +0 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.jsx +0 -59
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.html.erb +0 -28
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.html.erb +0 -58
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_with_subcomponents.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_external_control.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.jsx +0 -61
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search.md +0 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.html.erb +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_search_rails.md +0 -2
- data/dist/chunks/_weekday_stacked-DDrCiip0.js +0 -45
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_rails.html.erb → _advanced_table_selectable_rows.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows_rails.html.erb → _advanced_table_selectable_rows_no_subrows.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_line_react.md → _draggable_drop_zones_line.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_event_listeners_rails.md → _draggable_event_listeners.md} +0 -0
@@ -11,8 +11,6 @@ const CUSTOM_DISPLAY_SELECTOR = "[data-dropdown-custom-trigger]";
|
|
11
11
|
const DROPDOWN_TRIGGER_DISPLAY = "#dropdown_trigger_display";
|
12
12
|
const DROPDOWN_PLACEHOLDER = "[data-dropdown-placeholder]";
|
13
13
|
const DROPDOWN_INPUT = "#dropdown-selected-option";
|
14
|
-
const SEARCH_INPUT_SELECTOR = "[data-dropdown-autocomplete]";
|
15
|
-
const SEARCH_BAR_SELECTOR = "[data-dropdown-search]";
|
16
14
|
|
17
15
|
export default class PbDropdown extends PbEnhancedElement {
|
18
16
|
static get selector() {
|
@@ -27,11 +25,9 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
27
25
|
this.keyboardHandler = new PbDropdownKeyboard(this);
|
28
26
|
this.setDefaultValue();
|
29
27
|
this.bindEventListeners();
|
30
|
-
this.bindSearchInput();
|
31
28
|
this.updateArrowDisplay(false);
|
32
29
|
this.handleFormValidation();
|
33
30
|
this.handleFormReset();
|
34
|
-
this.bindSearchBar();
|
35
31
|
}
|
36
32
|
|
37
33
|
bindEventListeners() {
|
@@ -49,53 +45,6 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
49
45
|
);
|
50
46
|
}
|
51
47
|
|
52
|
-
bindSearchBar() {
|
53
|
-
this.searchBar = this.element.querySelector(SEARCH_BAR_SELECTOR);
|
54
|
-
if (!this.searchBar) return;
|
55
|
-
|
56
|
-
this.searchBar.addEventListener("input", (e) =>
|
57
|
-
this.handleSearch(e.target.value)
|
58
|
-
);
|
59
|
-
}
|
60
|
-
|
61
|
-
bindSearchInput() {
|
62
|
-
this.searchInput = this.element.querySelector(SEARCH_INPUT_SELECTOR);
|
63
|
-
if (!this.searchInput) return;
|
64
|
-
|
65
|
-
// Focus the input when anyone clicks the wrapper
|
66
|
-
this.element
|
67
|
-
.querySelector(TRIGGER_SELECTOR)
|
68
|
-
?.addEventListener("click", () => this.searchInput.focus());
|
69
|
-
|
70
|
-
// Live filter
|
71
|
-
this.searchInput.addEventListener("input", (e) =>
|
72
|
-
this.handleSearch(e.target.value)
|
73
|
-
);
|
74
|
-
}
|
75
|
-
|
76
|
-
handleSearch(term = "") {
|
77
|
-
const lcTerm = term.toLowerCase();
|
78
|
-
this.element.querySelectorAll(OPTION_SELECTOR).forEach((opt) => {
|
79
|
-
const label = JSON.parse(opt.dataset.dropdownOptionLabel).label
|
80
|
-
.toString()
|
81
|
-
.toLowerCase();
|
82
|
-
|
83
|
-
// hide or show option
|
84
|
-
const match = label.includes(lcTerm);
|
85
|
-
opt.style.display = match ? "" : "none";
|
86
|
-
});
|
87
|
-
|
88
|
-
if (this.target.classList.contains("open")) {
|
89
|
-
const el = this.target;
|
90
|
-
el.style.height = "auto";
|
91
|
-
requestAnimationFrame(() => {
|
92
|
-
const newHeight = el.scrollHeight + "px";
|
93
|
-
el.offsetHeight; // force reflow
|
94
|
-
el.style.height = newHeight;
|
95
|
-
});
|
96
|
-
}
|
97
|
-
}
|
98
|
-
|
99
48
|
handleOptionClick(event) {
|
100
49
|
const option = event.target.closest(OPTION_SELECTOR);
|
101
50
|
const hiddenInput = this.element.querySelector(DROPDOWN_INPUT);
|
@@ -110,7 +59,6 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
110
59
|
}
|
111
60
|
|
112
61
|
handleDocumentClick(event) {
|
113
|
-
if (event.target.closest(SEARCH_BAR_SELECTOR)) return;
|
114
62
|
if (this.isClickOutside(event) && this.target.classList.contains("open")) {
|
115
63
|
this.hideElement(this.target);
|
116
64
|
this.updateArrowDisplay(false);
|
@@ -151,11 +99,6 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
151
99
|
}
|
152
100
|
}
|
153
101
|
|
154
|
-
const autocompleteInput = this.element.querySelector(SEARCH_INPUT_SELECTOR);
|
155
|
-
if (autocompleteInput){
|
156
|
-
autocompleteInput.value = JSON.parse(value).label;
|
157
|
-
}
|
158
|
-
|
159
102
|
const customTrigger = this.element.querySelector(CUSTOM_DISPLAY_SELECTOR);
|
160
103
|
if (customTrigger) {
|
161
104
|
if (this.target.classList.contains("open")) {
|
@@ -1,6 +1,4 @@
|
|
1
1
|
const OPTION_SELECTOR = "[data-dropdown-option-label]";
|
2
|
-
const SEARCH_INPUT_SELECTOR = "[data-dropdown-autocomplete]";
|
3
|
-
|
4
2
|
export class PbDropdownKeyboard {
|
5
3
|
constructor(dropdown) {
|
6
4
|
this.dropdown = dropdown;
|
@@ -9,9 +7,6 @@ export class PbDropdownKeyboard {
|
|
9
7
|
this.dropdownElement.querySelectorAll(OPTION_SELECTOR)
|
10
8
|
);
|
11
9
|
this.focusedOptionIndex = -1;
|
12
|
-
this.searchInput = this.dropdownElement.querySelector(
|
13
|
-
SEARCH_INPUT_SELECTOR
|
14
|
-
);
|
15
10
|
this.init();
|
16
11
|
}
|
17
12
|
|
@@ -20,18 +15,6 @@ export class PbDropdownKeyboard {
|
|
20
15
|
"keydown",
|
21
16
|
this.handleKeyDown.bind(this)
|
22
17
|
);
|
23
|
-
if (this.searchInput) {
|
24
|
-
this.searchInput.addEventListener("input", () =>
|
25
|
-
this.openDropdownIfClosed()
|
26
|
-
);
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
openDropdownIfClosed() {
|
31
|
-
if (!this.dropdown.target.classList.contains("open")) {
|
32
|
-
this.dropdown.showElement(this.dropdown.target);
|
33
|
-
this.dropdown.updateArrowDisplay(true);
|
34
|
-
}
|
35
18
|
}
|
36
19
|
|
37
20
|
handleKeyDown(event) {
|
@@ -67,15 +50,6 @@ export class PbDropdownKeyboard {
|
|
67
50
|
this.dropdown.updateArrowDisplay(false);
|
68
51
|
this.resetFocus();
|
69
52
|
break;
|
70
|
-
case "Backspace":
|
71
|
-
if (this.searchInput) {
|
72
|
-
setTimeout(() => {
|
73
|
-
if (this.searchInput.value.trim() === "") {
|
74
|
-
this.dropdown.resetDropdownValue();
|
75
|
-
}
|
76
|
-
}, 0);
|
77
|
-
}
|
78
|
-
break;
|
79
53
|
default:
|
80
54
|
break;
|
81
55
|
}
|
@@ -46,6 +46,7 @@ const DropdownContainer = (props: DropdownContainerProps) => {
|
|
46
46
|
inputRef,
|
47
47
|
isDropDownClosed,
|
48
48
|
setFocusedOptionIndex,
|
49
|
+
triggerRef
|
49
50
|
} = useContext(DropdownContext);
|
50
51
|
|
51
52
|
const ariaProps = buildAriaProps(aria);
|
@@ -66,7 +67,7 @@ const DropdownContainer = (props: DropdownContainerProps) => {
|
|
66
67
|
id={id}
|
67
68
|
onMouseEnter={() => setFocusedOptionIndex(-1)}
|
68
69
|
ref={dropdownContainerRef}
|
69
|
-
style={{ position: "absolute"}}
|
70
|
+
style={triggerRef ? {} : { position: "absolute"}}
|
70
71
|
>
|
71
72
|
{searchbar && (
|
72
73
|
<TextInput dark={dark}
|
@@ -53,6 +53,7 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
|
|
53
53
|
selected,
|
54
54
|
setIsInputFocused,
|
55
55
|
toggleDropdown,
|
56
|
+
triggerRef,
|
56
57
|
} = useContext(DropdownContext);
|
57
58
|
|
58
59
|
const handleKeyDown = useHandleOnKeyDown();
|
@@ -98,6 +99,7 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
|
|
98
99
|
id={id}
|
99
100
|
>
|
100
101
|
{
|
102
|
+
!triggerRef && (
|
101
103
|
children ? (
|
102
104
|
<div
|
103
105
|
onClick={() => toggleDropdown()}
|
@@ -145,10 +147,7 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
|
|
145
147
|
<input
|
146
148
|
className="dropdown_input"
|
147
149
|
onChange={handleChange}
|
148
|
-
onClick={(
|
149
|
-
e.stopPropagation();// keep the wrapper’s handler from firing
|
150
|
-
toggleDropdown();
|
151
|
-
}}
|
150
|
+
onClick={() => toggleDropdown()}
|
152
151
|
onFocus={() => setIsInputFocused(true)}
|
153
152
|
onKeyDown={handleKeyDown}
|
154
153
|
placeholder={
|
@@ -182,6 +181,7 @@ const DropdownTrigger = (props: DropdownTriggerProps) => {
|
|
182
181
|
</Flex>
|
183
182
|
</>
|
184
183
|
)
|
184
|
+
)
|
185
185
|
}
|
186
186
|
</div>
|
187
187
|
);
|
@@ -23,39 +23,35 @@
|
|
23
23
|
@mixin error-state-right-side-select-kit {
|
24
24
|
&:has(.pb_text_input_kit:not(.error)):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper.error),
|
25
25
|
&:has(.pb_text_input_kit.error):has(.pb_text_input_kit_label):has(.pb_select_kit_wrapper) {
|
26
|
-
|
27
|
-
align-items: flex-start;
|
26
|
+
align-items: flex-start;
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
.pb_select_kit_wrapper {
|
29
|
+
padding-top: $space_md;
|
30
|
+
margin-top: 2px;
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
}
|
32
|
+
.pb_select_kit_caret {
|
33
|
+
padding-top: $space_md;
|
36
34
|
}
|
35
|
+
}
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
.pb_select_kit_wrapper.error {
|
38
|
+
padding-top: $space_md;
|
39
|
+
margin-top: 2px;
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
}
|
41
|
+
.pb_select_kit_caret {
|
42
|
+
padding-top: $space_xl;
|
45
43
|
}
|
46
44
|
}
|
47
45
|
}
|
48
46
|
}
|
49
47
|
|
50
48
|
@mixin error-state-left-side-select-kit {
|
51
|
-
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.pb_text_input_kit.error) {
|
52
|
-
|
53
|
-
align-items: flex-start;
|
49
|
+
&:has(.pb_select_kit_label):has(.pb_select_kit_wrapper):has(.pb_phone_number_input):has(.pb_text_input_kit.error) {
|
50
|
+
align-items: flex-start;
|
54
51
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
}
|
52
|
+
.pb_text_input_kit.error {
|
53
|
+
padding-top: $space_md;
|
54
|
+
margin-top: 2px;
|
59
55
|
}
|
60
56
|
}
|
61
|
-
}
|
57
|
+
}
|
@@ -78,8 +78,7 @@ $overlay_colors: (
|
|
78
78
|
&.overlay-hide-scrollbar {
|
79
79
|
& [class*="overflow_x_auto"],
|
80
80
|
& [class*="overflow_y_auto"],
|
81
|
-
& [class*="overflow_auto"]
|
82
|
-
.overlay_token_container {
|
81
|
+
& [class*="overflow_auto"] {
|
83
82
|
&::-webkit-scrollbar {
|
84
83
|
display: none !important;
|
85
84
|
}
|
@@ -30,7 +30,7 @@ const OverlayToken = (props: OverlayChildrenProps) => {
|
|
30
30
|
if (container) {
|
31
31
|
const { scrollLeft, scrollWidth, clientWidth } = container;
|
32
32
|
const atStart = scrollLeft === 0;
|
33
|
-
const atEnd = scrollLeft + clientWidth >= scrollWidth - 1;
|
33
|
+
const atEnd = scrollLeft + clientWidth >= scrollWidth - 1;
|
34
34
|
|
35
35
|
setIsAtStart(atStart);
|
36
36
|
setIsAtEnd(atEnd);
|
@@ -64,17 +64,16 @@ const OverlayToken = (props: OverlayChildrenProps) => {
|
|
64
64
|
return (
|
65
65
|
<>
|
66
66
|
<div className={dynamic ? isAtStart ? '' : previousOverlayClassName : previousOverlayClassName} />
|
67
|
-
{dynamic ?
|
67
|
+
{dynamic ?
|
68
68
|
<div
|
69
|
-
className="overlay_token_container"
|
70
69
|
ref={scrollContainerRef}
|
71
70
|
style={{
|
72
|
-
overflowX: 'auto',
|
71
|
+
overflowX: 'auto',
|
73
72
|
}}
|
74
73
|
>
|
75
74
|
{children}
|
76
75
|
</div>
|
77
|
-
:
|
76
|
+
:
|
78
77
|
children
|
79
78
|
}
|
80
79
|
{hasSubsequentOverlay &&
|
@@ -143,16 +143,6 @@
|
|
143
143
|
select {
|
144
144
|
font-size: 12px;
|
145
145
|
}
|
146
|
-
.pb_select_kit_wrapper.error {
|
147
|
-
.pb_select_kit_caret {
|
148
|
-
top: 13.7px;
|
149
|
-
}
|
150
|
-
}
|
151
|
-
}
|
152
|
-
.pb_select_kit_wrapper.error {
|
153
|
-
.pb_select_kit_caret {
|
154
|
-
top: 16.2px;
|
155
|
-
}
|
156
146
|
}
|
157
147
|
}
|
158
148
|
}
|
@@ -8,7 +8,7 @@ const TableWithCollapsibleWithCustomClick = (props) => {
|
|
8
8
|
|
9
9
|
const Content = () => {
|
10
10
|
return (
|
11
|
-
<Card
|
11
|
+
<Card
|
12
12
|
borderNone
|
13
13
|
borderRadius="none"
|
14
14
|
padding="md"
|
@@ -37,7 +37,7 @@ return (
|
|
37
37
|
|
38
38
|
</Table.Head>
|
39
39
|
<Table.Body>
|
40
|
-
<Table.Row collapsible
|
40
|
+
<Table.Row collapsible
|
41
41
|
collapsibleContent={<Content/>}
|
42
42
|
toggleCellId="cell-1"
|
43
43
|
{...props}
|
@@ -47,7 +47,7 @@ return (
|
|
47
47
|
<Table.Cell>{'Value 3'}</Table.Cell>
|
48
48
|
<Table.Cell>{'Value 4'}</Table.Cell>
|
49
49
|
<Table.Cell>{'Value 5'}</Table.Cell>
|
50
|
-
<Table.Cell cursor="pointer"
|
50
|
+
<Table.Cell cursor="pointer"
|
51
51
|
id="cell-1"
|
52
52
|
textAlign="right"
|
53
53
|
>
|
@@ -59,7 +59,7 @@ return (
|
|
59
59
|
</Table.Cell>
|
60
60
|
|
61
61
|
</Table.Row>
|
62
|
-
<Table.Row collapsible
|
62
|
+
<Table.Row collapsible
|
63
63
|
collapsibleContent={<Content/>}
|
64
64
|
toggleCellId="cell-2"
|
65
65
|
{...props}
|
@@ -69,7 +69,7 @@ return (
|
|
69
69
|
<Table.Cell>{'Value 3'}</Table.Cell>
|
70
70
|
<Table.Cell>{'Value 4'}</Table.Cell>
|
71
71
|
<Table.Cell>{'Value 5'}</Table.Cell>
|
72
|
-
<Table.Cell cursor="pointer"
|
72
|
+
<Table.Cell cursor="pointer"
|
73
73
|
id="cell-2"
|
74
74
|
textAlign="right"
|
75
75
|
>
|
@@ -81,7 +81,7 @@ return (
|
|
81
81
|
</Table.Cell>
|
82
82
|
|
83
83
|
</Table.Row>
|
84
|
-
<Table.Row collapsible
|
84
|
+
<Table.Row collapsible
|
85
85
|
collapsibleContent={<Content/>}
|
86
86
|
toggleCellId="cell-3"
|
87
87
|
{...props}
|
@@ -91,7 +91,7 @@ return (
|
|
91
91
|
<Table.Cell>{'Value 3'}</Table.Cell>
|
92
92
|
<Table.Cell>{'Value 4'}</Table.Cell>
|
93
93
|
<Table.Cell>{'Value 5'}</Table.Cell>
|
94
|
-
<Table.Cell cursor="pointer"
|
94
|
+
<Table.Cell cursor="pointer"
|
95
95
|
id="cell-3"
|
96
96
|
textAlign="right"
|
97
97
|
>
|
@@ -55,7 +55,7 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
55
55
|
const htmlProps = buildHtmlProps(htmlOptions);
|
56
56
|
const sideHighlightClass =
|
57
57
|
sideHighlightColor != "" ? `side_highlight_${sideHighlightColor}` : null;
|
58
|
-
|
58
|
+
|
59
59
|
const [isCollapsed, setIsCollapsed] = useCollapsible(true);
|
60
60
|
|
61
61
|
const collapsibleRow = collapsible && isCollapsed === true ? "collapsible_table_row" : null;
|
@@ -83,14 +83,14 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
83
83
|
target instanceof SVGElement &&
|
84
84
|
(target.matches("svg.pb_custom_icon") || target.closest("svg.pb_custom_icon"));
|
85
85
|
|
86
|
-
if (clickedCell ||
|
86
|
+
if (clickedCell || isIconClick) {
|
87
87
|
setIsCollapsed(!isCollapsed);
|
88
88
|
}
|
89
89
|
} else {
|
90
90
|
setIsCollapsed(!isCollapsed);
|
91
91
|
}
|
92
92
|
};
|
93
|
-
|
93
|
+
|
94
94
|
return (
|
95
95
|
<>
|
96
96
|
{collapsible ? (
|
@@ -116,7 +116,7 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
116
116
|
tag="td"
|
117
117
|
>
|
118
118
|
<tr/>
|
119
|
-
<Collapsible.Content
|
119
|
+
<Collapsible.Content
|
120
120
|
className={collapsibleSideHighlight ? `table_collapsible_side_highlight` : ''}
|
121
121
|
dark={dark}
|
122
122
|
margin="none"
|
@@ -149,7 +149,7 @@ const TableRow = (props: TableRowPropTypes): React.ReactElement => {
|
|
149
149
|
tag="td"
|
150
150
|
>
|
151
151
|
<tr/>
|
152
|
-
<Collapsible.Content
|
152
|
+
<Collapsible.Content
|
153
153
|
className={collapsibleSideHighlight ? `table_collapsible_side_highlight` : ''}
|
154
154
|
dark={dark}
|
155
155
|
margin="none"
|
@@ -8,14 +8,7 @@
|
|
8
8
|
|
9
9
|
%>
|
10
10
|
|
11
|
-
<%= pb_rails("typeahead", props: {
|
12
|
-
id: "typeahead-error-example",
|
13
|
-
options: options,
|
14
|
-
error: "Please make a valid selection",
|
15
|
-
label: "Products",
|
16
|
-
name: :foo,
|
17
|
-
is_multi: false
|
18
|
-
}) %>
|
11
|
+
<%= pb_rails("typeahead", props: { id: "typeahead-error-example", options: options, error: "Please make a valid selection", label: "Products", name: :foo, is_multi: false }) %>
|
19
12
|
|
20
13
|
<!-- This section is an example of the available JavaScript event hooks -->
|
21
14
|
<%= javascript_tag defer: "defer" do %>
|