playbook_ui 13.16.0.pre.alpha.PLAY12002127 → 13.16.0.pre.alpha.fonttest1972
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +12 -14
- data/app/pb_kits/playbook/index.js +1 -2
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -2
- data/app/pb_kits/playbook/pb_layout/layout.test.js +4 -8
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +6 -6
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +4 -4
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Carousel/index.tsx +3 -3
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +22 -30
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -5
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +4 -4
- data/app/pb_kits/playbook/pb_list/_list.tsx +15 -15
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +9 -9
- data/app/pb_kits/playbook/pb_map/_map.tsx +8 -8
- data/app/pb_kits/playbook/pb_map/_map_controls.tsx +7 -15
- data/app/pb_kits/playbook/pb_map/_map_custom_button.tsx +2 -4
- data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +6 -6
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +42 -46
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +20 -20
- data/app/pb_kits/playbook/pb_nav/_item.tsx +47 -56
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +15 -15
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +7 -5
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +14 -12
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_popover/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +29 -29
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -4
- data/app/pb_kits/playbook/playbook-doc.js +0 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
- data/dist/menu.yml +1 -4
- data/dist/playbook-rails.js +6 -14
- data/lib/playbook/version.rb +1 -1
- metadata +2 -46
- data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +0 -30
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +0 -62
- data/app/pb_kits/playbook/pb_advanced_table/Components/LoadingCell.tsx +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +0 -30
- data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +0 -61
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +0 -127
- data/app/pb_kits/playbook/pb_advanced_table/Components/ToggleIconButton.tsx +0 -28
- data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/README.md +0 -288
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +0 -95
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +0 -51
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/BrowserCheck.tsx +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +0 -63
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/IconHelpers.tsx +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -98
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -246
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -56
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.jsx +0 -52
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.jsx +0 -49
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_default.md +0 -18
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.jsx +0 -59
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expanded_control.md +0 -18
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.jsx +0 -60
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.jsx +0 -52
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.jsx +0 -63
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.jsx +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.jsx +0 -61
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_options.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data.js +0 -278
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -12
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -9
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/_loading.scss +0 -72
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/_pseudo_states.scss +0 -12
- data/app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.html.erb +0 -30
- data/app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx +0 -57
@@ -86,50 +86,6 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
86
86
|
item: []
|
87
87
|
})
|
88
88
|
|
89
|
-
const modifyRecursive = (tree: { [key: string]: any }[], check: boolean) => {
|
90
|
-
if (!Array.isArray(tree)) {
|
91
|
-
return
|
92
|
-
}
|
93
|
-
return tree.map((item: { [key: string]: any }) => {
|
94
|
-
item.checked = check
|
95
|
-
item.children = modifyRecursive(item.children, check)
|
96
|
-
return item
|
97
|
-
})
|
98
|
-
}
|
99
|
-
|
100
|
-
// Function to map over data and add parent_id + depth property to each item
|
101
|
-
const addCheckedAndParentProperty = (
|
102
|
-
treeData: { [key: string]: any }[],
|
103
|
-
selectedIds: string[],
|
104
|
-
parent_id: string = null,
|
105
|
-
depth = 0,
|
106
|
-
) => {
|
107
|
-
if (!Array.isArray(treeData)) {
|
108
|
-
return
|
109
|
-
}
|
110
|
-
return treeData.map((item: { [key: string]: any } | any) => {
|
111
|
-
const newItem = {
|
112
|
-
...item,
|
113
|
-
checked: Boolean(selectedIds && selectedIds.length && selectedIds.includes(item.id)),
|
114
|
-
parent_id,
|
115
|
-
depth,
|
116
|
-
}
|
117
|
-
if (newItem.children && newItem.children.length > 0) {
|
118
|
-
const children =
|
119
|
-
item.checked && !returnAllSelected
|
120
|
-
? modifyRecursive(item.children, true)
|
121
|
-
: item.children
|
122
|
-
newItem.children = addCheckedAndParentProperty(
|
123
|
-
children,
|
124
|
-
selectedIds,
|
125
|
-
newItem.id,
|
126
|
-
depth + 1
|
127
|
-
)
|
128
|
-
}
|
129
|
-
return newItem
|
130
|
-
})
|
131
|
-
}
|
132
|
-
|
133
89
|
useEffect(() => {
|
134
90
|
const formattedData = addCheckedAndParentProperty(
|
135
91
|
treeData,
|
@@ -183,7 +139,16 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
183
139
|
}
|
184
140
|
}, [])
|
185
141
|
|
186
|
-
|
142
|
+
const modifyRecursive = (tree: { [key: string]: any }[], check: boolean) => {
|
143
|
+
if (!Array.isArray(tree)) {
|
144
|
+
return
|
145
|
+
}
|
146
|
+
return tree.map((item: { [key: string]: any }) => {
|
147
|
+
item.checked = check
|
148
|
+
item.children = modifyRecursive(item.children, check)
|
149
|
+
return item
|
150
|
+
})
|
151
|
+
}
|
187
152
|
|
188
153
|
// Iterate over tree, find item and set checked or unchecked
|
189
154
|
const modifyValue = (
|
@@ -241,7 +206,38 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
|
|
241
206
|
return tree
|
242
207
|
}
|
243
208
|
|
244
|
-
|
209
|
+
// Function to map over data and add parent_id + depth property to each item
|
210
|
+
const addCheckedAndParentProperty = (
|
211
|
+
treeData: { [key: string]: any }[],
|
212
|
+
selectedIds: string[],
|
213
|
+
parent_id: string = null,
|
214
|
+
depth = 0,
|
215
|
+
) => {
|
216
|
+
if (!Array.isArray(treeData)) {
|
217
|
+
return
|
218
|
+
}
|
219
|
+
return treeData.map((item: { [key: string]: any } | any) => {
|
220
|
+
const newItem = {
|
221
|
+
...item,
|
222
|
+
checked: Boolean(selectedIds && selectedIds.length && selectedIds.includes(item.id)),
|
223
|
+
parent_id,
|
224
|
+
depth,
|
225
|
+
}
|
226
|
+
if (newItem.children && newItem.children.length > 0) {
|
227
|
+
const children =
|
228
|
+
item.checked && !returnAllSelected
|
229
|
+
? modifyRecursive(item.children, true)
|
230
|
+
: item.children
|
231
|
+
newItem.children = addCheckedAndParentProperty(
|
232
|
+
children,
|
233
|
+
selectedIds,
|
234
|
+
newItem.id,
|
235
|
+
depth + 1
|
236
|
+
)
|
237
|
+
}
|
238
|
+
return newItem
|
239
|
+
})
|
240
|
+
}
|
245
241
|
|
246
242
|
// Click event for x on form pill
|
247
243
|
const handlePillClose = (event: any, clickedItem: { [key: string]: any }) => {
|
@@ -44,11 +44,11 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
|
44
44
|
return users.slice(0, 1).map((userObject, index) => {
|
45
45
|
return (
|
46
46
|
<Avatar
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
{...userObject}
|
48
|
+
className="pb_multiple_users_stacked_item"
|
49
|
+
dark={dark}
|
50
|
+
key={index}
|
51
|
+
size="xs"
|
52
52
|
/>
|
53
53
|
)
|
54
54
|
})
|
@@ -59,11 +59,11 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
|
59
59
|
return users.slice(1, 2).map((userObject, index) => {
|
60
60
|
return (
|
61
61
|
<Avatar
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
{...userObject}
|
63
|
+
className="pb_multiple_users_stacked_item second_item"
|
64
|
+
dark={dark}
|
65
|
+
key={index}
|
66
|
+
size="xs"
|
67
67
|
/>
|
68
68
|
)
|
69
69
|
})
|
@@ -74,11 +74,11 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
|
74
74
|
if (moreThanTwo === true) {
|
75
75
|
return (
|
76
76
|
<Badge
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
className="pb_multiple_users_stacked_item second_item"
|
78
|
+
dark={dark}
|
79
|
+
rounded
|
80
|
+
text={`+${users.length - displayCount()}`}
|
81
|
+
variant="primary"
|
82
82
|
/>
|
83
83
|
)
|
84
84
|
}
|
@@ -86,11 +86,11 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
|
|
86
86
|
|
87
87
|
return (
|
88
88
|
<div
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
89
|
+
{...ariaProps}
|
90
|
+
{...dataProps}
|
91
|
+
{...htmlProps}
|
92
|
+
className={classes}
|
93
|
+
id={id}
|
94
94
|
>
|
95
95
|
{firstUser()}
|
96
96
|
{secondUser()}
|
@@ -18,7 +18,7 @@ type NavItemProps = {
|
|
18
18
|
children?: React.ReactNode[] | React.ReactNode;
|
19
19
|
className?: string;
|
20
20
|
collapsible?: boolean;
|
21
|
-
data?:
|
21
|
+
data?: object;
|
22
22
|
dark?: boolean;
|
23
23
|
fontSize?: "normal" | "small";
|
24
24
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
@@ -76,7 +76,7 @@ const NavItem = (props: NavItemProps) => {
|
|
76
76
|
id,
|
77
77
|
imageUrl,
|
78
78
|
link,
|
79
|
-
onClick,
|
79
|
+
onClick = () => {},
|
80
80
|
target = "_self",
|
81
81
|
text = "",
|
82
82
|
collapsibleTrail,
|
@@ -205,49 +205,46 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
205
205
|
{collapsible ? (
|
206
206
|
<>
|
207
207
|
<Collapsible
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
208
|
+
className={collapsibleClasses}
|
209
|
+
icon={iconRight && iconRight}
|
210
|
+
iconSize="xs"
|
211
|
+
id={id}
|
212
|
+
collapsed={collapsed}
|
213
|
+
onIconClick={onIconRightClick}
|
214
|
+
onClick={onClick}
|
215
215
|
>
|
216
216
|
<Collapsible.Main
|
217
|
-
|
218
|
-
|
219
|
-
>
|
217
|
+
className={globalProps({ ...finalItemSpacing })}
|
218
|
+
dark={dark}>
|
220
219
|
<Tag
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
220
|
+
{...ariaProps}
|
221
|
+
{...dataProps}
|
222
|
+
{...htmlProps}
|
223
|
+
className={classes}
|
224
|
+
id={id}
|
225
|
+
href={link}
|
226
|
+
target={target}
|
228
227
|
>
|
229
228
|
{imageUrl && (
|
230
229
|
<div
|
231
|
-
|
232
|
-
|
233
|
-
|
230
|
+
className="pb_nav_list_item_icon_section_collapsible"
|
231
|
+
key={imageUrl}
|
232
|
+
onClick={(e) => handleIconClick(e)}
|
234
233
|
>
|
235
|
-
<Image className="pb_nav_img_wrapper"
|
236
|
-
url={imageUrl}
|
237
|
-
/>
|
234
|
+
<Image className="pb_nav_img_wrapper" url={imageUrl} />
|
238
235
|
</div>
|
239
236
|
)}
|
240
237
|
|
241
238
|
{iconLeft && (
|
242
239
|
<div
|
243
|
-
|
244
|
-
|
245
|
-
|
240
|
+
className="pb_nav_list_item_icon_section_collapsible"
|
241
|
+
key={iconLeft}
|
242
|
+
onClick={(e) => handleIconClick(e)}
|
246
243
|
>
|
247
244
|
<Icon
|
248
|
-
|
249
|
-
|
250
|
-
|
245
|
+
className="pb_nav_list_item_icon_left_collapsible"
|
246
|
+
fixedWidth
|
247
|
+
icon={iconLeft}
|
251
248
|
/>
|
252
249
|
</div>
|
253
250
|
)}
|
@@ -261,33 +258,27 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
261
258
|
</>
|
262
259
|
) : (
|
263
260
|
<Tag
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
261
|
+
{...ariaProps}
|
262
|
+
{...dataProps}
|
263
|
+
{...htmlProps}
|
264
|
+
className={classes}
|
265
|
+
id={id}
|
266
|
+
href={link}
|
267
|
+
onClick={onClick}
|
268
|
+
target={target}
|
272
269
|
>
|
273
270
|
{imageUrl && (
|
274
|
-
<div className="pb_nav_list_item_icon_section"
|
275
|
-
|
276
|
-
>
|
277
|
-
<Image className="pb_nav_img_wrapper"
|
278
|
-
url={imageUrl}
|
279
|
-
/>
|
271
|
+
<div className="pb_nav_list_item_icon_section" key={imageUrl}>
|
272
|
+
<Image className="pb_nav_img_wrapper" url={imageUrl} />
|
280
273
|
</div>
|
281
274
|
)}
|
282
275
|
|
283
276
|
{iconLeft && (
|
284
|
-
<div className="pb_nav_list_item_icon_section"
|
285
|
-
key={iconLeft}
|
286
|
-
>
|
277
|
+
<div className="pb_nav_list_item_icon_section" key={iconLeft}>
|
287
278
|
<Icon
|
288
|
-
|
289
|
-
|
290
|
-
|
279
|
+
className="pb_nav_list_item_icon_left"
|
280
|
+
fixedWidth
|
281
|
+
icon={iconLeft}
|
291
282
|
/>
|
292
283
|
</div>
|
293
284
|
)}
|
@@ -296,13 +287,13 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
296
287
|
|
297
288
|
{iconRight && (
|
298
289
|
<div
|
299
|
-
|
300
|
-
|
290
|
+
className="pb_nav_list_item_icon_section"
|
291
|
+
key={iconRight as string}
|
301
292
|
>
|
302
293
|
<Icon
|
303
|
-
|
304
|
-
|
305
|
-
|
294
|
+
className="pb_nav_list_item_icon_right"
|
295
|
+
fixedWidth
|
296
|
+
icon={iconRight as string}
|
306
297
|
/>
|
307
298
|
</div>
|
308
299
|
)}
|
@@ -12,12 +12,12 @@ type NavProps = {
|
|
12
12
|
borderless?: boolean,
|
13
13
|
children?: React.ReactNode[] | React.ReactNode,
|
14
14
|
className?: string | string[],
|
15
|
-
data?:
|
15
|
+
data?: object,
|
16
16
|
dark?: boolean,
|
17
17
|
highlight?: boolean,
|
18
18
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
19
|
id?: string,
|
20
|
-
onClick?:
|
20
|
+
onClick?: React.MouseEventHandler<HTMLElement>,
|
21
21
|
orientation?: "vertical" | "horizontal",
|
22
22
|
link?: string,
|
23
23
|
title?: string,
|
@@ -25,7 +25,7 @@ type NavProps = {
|
|
25
25
|
itemSpacing?: SpacingObject
|
26
26
|
} & GlobalProps
|
27
27
|
|
28
|
-
const Nav = (props: NavProps)
|
28
|
+
const Nav = (props: NavProps) => {
|
29
29
|
const {
|
30
30
|
aria = {},
|
31
31
|
borderless = false,
|
@@ -37,7 +37,7 @@ const Nav = (props: NavProps): React.ReactElement => {
|
|
37
37
|
htmlOptions = {},
|
38
38
|
id,
|
39
39
|
link = '#',
|
40
|
-
onClick,
|
40
|
+
onClick = () => { },
|
41
41
|
orientation = 'vertical',
|
42
42
|
title = '',
|
43
43
|
variant = 'normal',
|
@@ -71,23 +71,23 @@ const childrenWithProps = React.Children.map(children, (child) => {
|
|
71
71
|
|
72
72
|
return (
|
73
73
|
<nav
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
{...ariaProps}
|
75
|
+
{...dataProps}
|
76
|
+
{...htmlProps}
|
77
|
+
className={cardCss}
|
78
|
+
id={id}
|
79
79
|
>
|
80
80
|
{title &&
|
81
81
|
<div className="pb_nav_list_title">
|
82
82
|
<a
|
83
|
-
|
84
|
-
|
85
|
-
|
83
|
+
className="pb_nav_list_item_link_text"
|
84
|
+
href={link}
|
85
|
+
onClick={onClick}
|
86
86
|
>
|
87
87
|
<Caption
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
dark={dark}
|
89
|
+
size="md"
|
90
|
+
text={`${title}`}
|
91
91
|
/>
|
92
92
|
</a>
|
93
93
|
</div>
|
data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
<%= pb_rails("button", props: {html_type: "submit", text: "Save Phone Number"}) %>
|
4
4
|
</form>
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
document.
|
9
|
-
|
6
|
+
<% content_for(:pb_js) do %>
|
7
|
+
<%= javascript_tag do %>
|
8
|
+
document.addEventListener('DOMContentLoaded', function () {
|
9
|
+
document.querySelector('#example-form-validation').addEventListener('submit', function (e) {
|
10
|
+
if (e.target.querySelectorAll('[error]:not([error=""])').length > 0) e.preventDefault();
|
11
|
+
})
|
10
12
|
})
|
11
|
-
|
13
|
+
<% end %>
|
12
14
|
<% end %>
|
@@ -171,27 +171,29 @@ const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
|
171
171
|
|
172
172
|
document.body.addEventListener(
|
173
173
|
"click",
|
174
|
-
(
|
175
|
-
const target = e.target as HTMLElement
|
176
|
-
|
174
|
+
({ target }) => {
|
177
175
|
const targetIsPopover =
|
178
|
-
target.closest("#" + targetId) !==
|
176
|
+
(target as HTMLElement).closest("#" + targetId) !==
|
177
|
+
null;
|
179
178
|
const targetIsReference =
|
180
|
-
target.closest("#reference-" + targetId) !==
|
181
|
-
|
182
|
-
const shouldClose = () => {
|
183
|
-
setTimeout(() => shouldClosePopover(true), 0);
|
184
|
-
}
|
179
|
+
(target as HTMLElement).closest("#reference-" + targetId) !==
|
180
|
+
null;
|
185
181
|
|
186
182
|
switch (closeOnClick) {
|
187
183
|
case "outside":
|
188
|
-
if (!targetIsPopover && !targetIsReference)
|
184
|
+
if (!targetIsPopover && !targetIsReference) {
|
185
|
+
shouldClosePopover(true);
|
186
|
+
}
|
189
187
|
break;
|
190
188
|
case "inside":
|
191
|
-
if (targetIsPopover)
|
189
|
+
if (targetIsPopover) {
|
190
|
+
shouldClosePopover(true);
|
191
|
+
}
|
192
192
|
break;
|
193
193
|
case "any":
|
194
|
-
if (targetIsPopover || !targetIsPopover && !targetIsReference)
|
194
|
+
if (targetIsPopover || !targetIsPopover && !targetIsReference) {
|
195
|
+
shouldClosePopover(true);
|
196
|
+
}
|
195
197
|
break;
|
196
198
|
}
|
197
199
|
},
|
@@ -5,7 +5,6 @@ examples:
|
|
5
5
|
- popover_close: Close Options
|
6
6
|
- popover_z_index: Set Z-Index
|
7
7
|
- popover_scroll_height: Scroll and Height Settings
|
8
|
-
- popover_actionable_content: With Actionable Content
|
9
8
|
|
10
9
|
react:
|
11
10
|
- popover_default: Default
|
@@ -13,4 +12,4 @@ examples:
|
|
13
12
|
- popover_close: Close Options
|
14
13
|
- popover_z_index: Set Z-Index
|
15
14
|
- popover_scroll_height: Scroll and Height Settings
|
16
|
-
|
15
|
+
|
@@ -3,4 +3,3 @@ export { default as PopoverList } from './_popover_list.jsx'
|
|
3
3
|
export { default as PopoverClose } from './_popover_close.jsx'
|
4
4
|
export { default as PopoverZIndex } from './_popover_z_index.jsx'
|
5
5
|
export { default as PopoverScrollHeight } from './_popover_scroll_height.jsx'
|
6
|
-
export { default as PopoverActionableContent } from './_popover_actionable_content.jsx'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useEffect } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
|
4
|
-
import { globalProps
|
4
|
+
import { globalProps } from '../utilities/globalProps'
|
5
5
|
import PbTable from '.'
|
6
6
|
|
7
7
|
type TableProps = {
|
@@ -9,19 +9,19 @@ type TableProps = {
|
|
9
9
|
children: React.ReactNode[] | React.ReactNode,
|
10
10
|
className: string,
|
11
11
|
collapse?: "sm" | "md" | "lg",
|
12
|
-
container
|
12
|
+
container: boolean,
|
13
13
|
dark?: boolean,
|
14
14
|
data?: { [key: string]: string },
|
15
15
|
dataTable: boolean,
|
16
|
-
disableHover
|
16
|
+
disableHover: boolean,
|
17
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
18
18
|
id?: string,
|
19
|
-
responsive
|
20
|
-
singleLine
|
21
|
-
size
|
19
|
+
responsive: "collapse" | "scroll" | "none",
|
20
|
+
singleLine: boolean,
|
21
|
+
size: "sm" | "md" | "lg",
|
22
22
|
sticky?: boolean,
|
23
23
|
verticalBorder?: boolean,
|
24
|
-
}
|
24
|
+
}
|
25
25
|
|
26
26
|
const Table = (props: TableProps) => {
|
27
27
|
const {
|
@@ -56,29 +56,29 @@ const Table = (props: TableProps) => {
|
|
56
56
|
|
57
57
|
return (
|
58
58
|
<table
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
59
|
+
{...ariaProps}
|
60
|
+
{...dataProps}
|
61
|
+
{...htmlProps}
|
62
|
+
className={classnames(
|
63
|
+
'pb_table',
|
64
|
+
`table-${size}`,
|
65
|
+
`table-responsive-${responsive}`,
|
66
|
+
{
|
67
|
+
'table-card': container,
|
68
|
+
'table-dark': dark,
|
69
|
+
'data_table': dataTable,
|
70
|
+
'single-line': singleLine,
|
71
|
+
'no-hover': disableHover,
|
72
|
+
'sticky-header': sticky,
|
73
|
+
},
|
74
|
+
globalProps(props),
|
75
|
+
tableCollapseCss,
|
76
|
+
verticalBorderCss,
|
77
|
+
className
|
78
|
+
)}
|
79
|
+
id={id}
|
80
80
|
>
|
81
|
-
|
81
|
+
{children}
|
82
82
|
</table>
|
83
83
|
)
|
84
84
|
}
|
@@ -73,10 +73,8 @@ const TypeaheadWithHighlight = (props) => {
|
|
73
73
|
Option: (highlightProps: OptionProps) => (
|
74
74
|
<components.Option {...highlightProps}/>
|
75
75
|
),
|
76
|
-
SingleValue: ({
|
77
|
-
<
|
78
|
-
<span>{props.data.name}</span>
|
79
|
-
</components.SingleValue>
|
76
|
+
SingleValue: ({ data }: any) => (
|
77
|
+
<span>{data.name}</span>
|
80
78
|
)
|
81
79
|
}
|
82
80
|
|
@@ -4,7 +4,6 @@ import WebpackerReact from 'webpacker-react'
|
|
4
4
|
|
5
5
|
// KIT EXAMPLES
|
6
6
|
import 'pb_form/pb_form_validation'
|
7
|
-
import * as AdvancedTable from 'pb_advanced_table/docs'
|
8
7
|
import * as Avatar from 'pb_avatar/docs'
|
9
8
|
import * as AvatarActionButton from 'pb_avatar_action_button/docs'
|
10
9
|
import * as Background from 'pb_background/docs'
|
@@ -106,7 +105,6 @@ import * as Walkthrough from 'pb_walkthrough/docs'
|
|
106
105
|
import * as WeekdayStacked from 'pb_weekday_stacked/docs'
|
107
106
|
|
108
107
|
WebpackerReact.registerComponents({
|
109
|
-
...AdvancedTable,
|
110
108
|
...Avatar,
|
111
109
|
...AvatarActionButton,
|
112
110
|
...Background,
|
data/dist/menu.yml
CHANGED
@@ -43,9 +43,6 @@ kits:
|
|
43
43
|
- name: "table"
|
44
44
|
platforms: *web
|
45
45
|
description: Tables display a collection of structured data and typically have the ability to sort, filter, and paginate data.
|
46
|
-
- name: "advanced_table"
|
47
|
-
platforms: *react_only
|
48
|
-
description: The Advanced Table can be used to display complex, nested data in a way that allows for expansion and/or sorting.
|
49
46
|
- name: "list"
|
50
47
|
platforms: *web
|
51
48
|
description: Lists display a vertical set of related content.
|
@@ -357,4 +354,4 @@ kits:
|
|
357
354
|
description: Multiple users stacked is used in tight spaces, where we need to indicate that multiple users are associated to a specific action or item.
|
358
355
|
- name: "user"
|
359
356
|
platforms: *web
|
360
|
-
description: This kit was created for having a systematic way of displaying users with avatar, titles, name and territory. This is a versatile kit with features than can be added to display more info.
|
357
|
+
description: This kit was created for having a systematic way of displaying users with avatar, titles, name and territory. This is a versatile kit with features than can be added to display more info.
|