playbook_ui 14.17.0.pre.alpha.play1964tablekitheadertextstylefix7164 → 14.17.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/Utilities/types.ts +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -70
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +2 -83
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +7 -20
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +7 -14
- data/app/pb_kits/playbook/pb_contact/contact.test.js +7 -7
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +34 -34
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +0 -16
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +11 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.jsx +7 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +24 -28
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.test.js +1 -1
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +17 -58
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +8 -8
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +4 -3
- data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +3 -2
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +0 -22
- data/app/pb_kits/playbook/pb_icon/icon.test.js +9 -9
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.test.js +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_icon_value/icon_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_label_value/label_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.scss +0 -58
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +7 -20
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_layout/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_layout/layout.test.js +0 -4
- data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +1 -1
- data/app/pb_kits/playbook/pb_link/link.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -2
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +3 -5
- data/app/pb_kits/playbook/pb_stat_change/stat_change.test.js +4 -8
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +7 -19
- data/app/pb_kits/playbook/pb_table/styles/_striped.scss +3 -3
- data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +282 -0
- data/app/pb_kits/playbook/pb_tooltip/index.js +56 -183
- data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +5 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -4
- data/app/pb_kits/playbook/pb_typeahead/index.ts +2 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +5 -2
- data/app/pb_kits/playbook/pb_user/user.html.erb +6 -1
- data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +6 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
- data/app/pb_kits/playbook/utilities/object.test.js +1 -149
- data/app/pb_kits/playbook/utilities/object.ts +42 -124
- data/dist/chunks/{_typeahead-7W5Ha5Td.js → _typeahead-N-EFroAX.js} +3 -3
- data/dist/chunks/_weekday_stacked-Db780bKR.js +45 -0
- data/dist/chunks/lib-Co5y3V4K.js +29 -0
- data/dist/chunks/{pb_form_validation-BvNy9Bd6.js → pb_form_validation-DMajaRt3.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/kit_base.rb +4 -4
- data/lib/playbook/version.rb +2 -2
- metadata +7 -13
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +0 -90
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +0 -3
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +0 -190
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +0 -5
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +0 -90
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +0 -57
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.md +0 -1
- data/dist/chunks/_weekday_stacked-DSKatW3m.js +0 -45
- data/dist/chunks/lib-BGzBzFZX.js +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e37db60608f1b104859bdd43009d249f35cf52ce9862fef12f5603bd593dfdf5
|
4
|
+
data.tar.gz: 0b170a0e146516a999b2c1f21a9bd660053d8008b4d67b0b5d7b82937872c5ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4745ed4144e005405ad52a728be1460533e39d87af9f0041a99dd54262134c4352c68c7494809b2a45e09607ff44aaa4e6b0eab31426d72cba00a9c3c030ee70
|
7
|
+
data.tar.gz: 643386db98ae4be5d998889628ddc3d5f9a6db95efae72eece4d22a9174e4d42fbc5444ee18748e67dd787ee864cd66ca07b58d76d676c9e3802473d016cd130
|
@@ -7,7 +7,6 @@
|
|
7
7
|
@import "./scss_partials/chrome_styles";
|
8
8
|
@import "../tokens/screen_sizes";
|
9
9
|
@import "../tokens/shadows";
|
10
|
-
@import "../tokens/positioning";
|
11
10
|
|
12
11
|
.pb_advanced_table {
|
13
12
|
$border-color: 1px solid $border_light;
|
@@ -230,53 +229,6 @@
|
|
230
229
|
max-height: 1920px;
|
231
230
|
overflow-y: auto;
|
232
231
|
}
|
233
|
-
|
234
|
-
// Fullscreen
|
235
|
-
&.advanced-table-allow-fullscreen {
|
236
|
-
transition: all 0.3s ease;
|
237
|
-
}
|
238
|
-
|
239
|
-
&.advanced-table-fullscreen {
|
240
|
-
background-color: $bg_light;
|
241
|
-
box-sizing: border-box;
|
242
|
-
height: 100vh;
|
243
|
-
left: 0;
|
244
|
-
overflow: auto;
|
245
|
-
position: fixed;
|
246
|
-
top: 0;
|
247
|
-
width: 100%;
|
248
|
-
z-index: $z_10;
|
249
|
-
|
250
|
-
.pb_table {
|
251
|
-
th, td, div, button {
|
252
|
-
font-size: calc(100%);
|
253
|
-
}
|
254
|
-
box-sizing: border-box;
|
255
|
-
margin: $space_lg;
|
256
|
-
max-width: calc(100% - 64px);
|
257
|
-
width: calc(100% - 64px);
|
258
|
-
}
|
259
|
-
|
260
|
-
.pb_table.sticky-header {
|
261
|
-
thead,
|
262
|
-
.pb_advanced_table_header {
|
263
|
-
position: sticky !important;
|
264
|
-
top: 44px !important;
|
265
|
-
z-index: $z_10;
|
266
|
-
}
|
267
|
-
}
|
268
|
-
}
|
269
|
-
|
270
|
-
.advanced-table-fullscreen-header {
|
271
|
-
background-color: $white;
|
272
|
-
height: 44px;
|
273
|
-
padding: 13px 20px;
|
274
|
-
position: sticky;
|
275
|
-
top: 0;
|
276
|
-
width: 100%;
|
277
|
-
z-index: $z_10;
|
278
|
-
}
|
279
|
-
|
280
232
|
// Icons
|
281
233
|
.button-icon {
|
282
234
|
display: flex;
|
@@ -325,16 +277,6 @@
|
|
325
277
|
}
|
326
278
|
}
|
327
279
|
|
328
|
-
.fullscreen-icon {
|
329
|
-
@extend .button-icon;
|
330
|
-
@extend %primary-color-pseudo;
|
331
|
-
padding: 2px 0;
|
332
|
-
|
333
|
-
&:focus-visible {
|
334
|
-
border-radius: $border_rad_lighter;
|
335
|
-
}
|
336
|
-
}
|
337
|
-
|
338
280
|
// Vertical separator
|
339
281
|
.table-header-cells:first-child,
|
340
282
|
.table-header-cells-custom:first-child,
|
@@ -524,18 +466,6 @@
|
|
524
466
|
box-shadow: 1px 0px 0px 0px $border_dark !important;
|
525
467
|
}
|
526
468
|
|
527
|
-
// Fullscreen
|
528
|
-
&.advanced-table-fullscreen {
|
529
|
-
background: $bg_dark;
|
530
|
-
}
|
531
|
-
|
532
|
-
.advanced-table-fullscreen-header {
|
533
|
-
background-color: $bg_dark_card;
|
534
|
-
position: sticky;
|
535
|
-
top: 0;
|
536
|
-
z-index: $z_10;
|
537
|
-
}
|
538
|
-
|
539
469
|
// Dark Mode Responsive Styles
|
540
470
|
@media only screen and (max-width: $screen-xl-min) {
|
541
471
|
&[class*="advanced-table-responsive-scroll"] {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useRef, useEffect
|
1
|
+
import React, { useRef, useEffect } from "react";
|
2
2
|
import classnames from "classnames";
|
3
3
|
|
4
4
|
import { GenericObject } from "../types";
|
@@ -19,15 +19,6 @@ import TableActionBar from "./Components/TableActionBar";
|
|
19
19
|
import { useTableState } from "./Hooks/useTableState";
|
20
20
|
import { useTableActions } from "./Hooks/useTableActions";
|
21
21
|
|
22
|
-
import Card from "../pb_card/_card"
|
23
|
-
import Flex from "../pb_flex/_flex"
|
24
|
-
import Icon from "../pb_icon/_icon"
|
25
|
-
|
26
|
-
type FullscreenControls = {
|
27
|
-
toggleFullscreen: () => void;
|
28
|
-
isFullscreen: boolean;
|
29
|
-
};
|
30
|
-
|
31
22
|
type AdvancedTableProps = {
|
32
23
|
aria?: { [key: string]: string }
|
33
24
|
actions?: React.ReactNode[] | React.ReactNode
|
@@ -58,8 +49,6 @@ type AdvancedTableProps = {
|
|
58
49
|
toggleExpansionIcon?: string | string[]
|
59
50
|
onRowSelectionChange?: (arg: RowSelectionState) => void
|
60
51
|
virtualizedRows?: boolean
|
61
|
-
allowFullScreen?: boolean
|
62
|
-
fullScreenControl?: (controls: FullscreenControls) => void
|
63
52
|
} & GlobalProps;
|
64
53
|
|
65
54
|
const AdvancedTable = (props: AdvancedTableProps) => {
|
@@ -93,8 +82,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
93
82
|
toggleExpansionIcon = "arrows-from-line",
|
94
83
|
onRowSelectionChange,
|
95
84
|
virtualizedRows = false,
|
96
|
-
allowFullScreen = false,
|
97
|
-
fullScreenControl,
|
98
85
|
} = props;
|
99
86
|
|
100
87
|
// Component refs
|
@@ -159,68 +146,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
159
146
|
);
|
160
147
|
}, [fetchMoreOnBottomReached, fetchNextPage, isFetching, totalFetched, fullData.length]);
|
161
148
|
|
162
|
-
// Fullscreen
|
163
|
-
const [isFullscreen, setIsFullscreen] = useState(false)
|
164
|
-
|
165
|
-
const toggleFullscreen = useCallback(() => {
|
166
|
-
setIsFullscreen(prevState => !prevState)
|
167
|
-
}, [])
|
168
|
-
|
169
|
-
useEffect(() => {
|
170
|
-
if (allowFullScreen && fullScreenControl) {
|
171
|
-
fullScreenControl({
|
172
|
-
toggleFullscreen,
|
173
|
-
isFullscreen
|
174
|
-
})
|
175
|
-
}
|
176
|
-
}, [allowFullScreen, fullScreenControl, toggleFullscreen, isFullscreen])
|
177
|
-
|
178
|
-
const renderFullscreenHeader = () => {
|
179
|
-
if (!isFullscreen) return null
|
180
|
-
|
181
|
-
const defaultMinimizeIcon = (
|
182
|
-
<button
|
183
|
-
className="gray-icon fullscreen-icon"
|
184
|
-
onClick={toggleFullscreen}
|
185
|
-
>
|
186
|
-
<Icon
|
187
|
-
cursor="pointer"
|
188
|
-
fixedWidth
|
189
|
-
icon="arrow-down-left-and-arrow-up-right-to-center"
|
190
|
-
{...props}
|
191
|
-
/>
|
192
|
-
</button>
|
193
|
-
)
|
194
|
-
|
195
|
-
return (
|
196
|
-
<Card
|
197
|
-
borderNone
|
198
|
-
borderRadius="none"
|
199
|
-
className="advanced-table-fullscreen-header"
|
200
|
-
{...props}
|
201
|
-
>
|
202
|
-
<Flex justify="end">
|
203
|
-
{defaultMinimizeIcon}
|
204
|
-
</Flex>
|
205
|
-
</Card>
|
206
|
-
)
|
207
|
-
}
|
208
|
-
|
209
|
-
useEffect(() => {
|
210
|
-
if (!allowFullScreen) return
|
211
|
-
|
212
|
-
const handleKeyDown = (event: KeyboardEvent) => {
|
213
|
-
if (event.key === 'Escape' && isFullscreen) {
|
214
|
-
event.preventDefault()
|
215
|
-
toggleFullscreen()
|
216
|
-
}
|
217
|
-
}
|
218
|
-
document.addEventListener('keydown', handleKeyDown)
|
219
|
-
return () => {
|
220
|
-
document.removeEventListener('keydown', handleKeyDown)
|
221
|
-
}
|
222
|
-
}, [allowFullScreen, toggleFullscreen, isFullscreen])
|
223
|
-
|
224
149
|
// Build CSS classes and props
|
225
150
|
const ariaProps = buildAriaProps(aria);
|
226
151
|
const dataProps = buildDataProps(data);
|
@@ -229,10 +154,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
229
154
|
buildCss("pb_advanced_table"),
|
230
155
|
`advanced-table-responsive-${responsive}`,
|
231
156
|
maxHeight ? `advanced-table-max-height-${maxHeight}` : '',
|
232
|
-
{
|
233
|
-
'advanced-table-fullscreen': isFullscreen,
|
234
|
-
'advanced-table-allow-fullscreen': allowFullScreen
|
235
|
-
},
|
236
157
|
globalProps(props),
|
237
158
|
className
|
238
159
|
);
|
@@ -273,7 +194,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
273
194
|
ref={tableWrapperRef}
|
274
195
|
style={tableWrapperStyle as React.CSSProperties}
|
275
196
|
>
|
276
|
-
{renderFullscreenHeader()}
|
277
197
|
<AdvancedTableProvider
|
278
198
|
columnDefinitions={columnDefinitions}
|
279
199
|
enableToggleExpansion={enableToggleExpansion}
|
@@ -284,7 +204,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
284
204
|
hasAnySubRows={hasAnySubRows}
|
285
205
|
inlineRowLoading={inlineRowLoading}
|
286
206
|
isActionBarVisible={isActionBarVisible}
|
287
|
-
isFullscreen={isFullscreen}
|
288
207
|
loading={loading}
|
289
208
|
responsive={responsive}
|
290
209
|
selectableRows={selectableRows}
|
@@ -327,7 +246,7 @@ const AdvancedTable = (props: AdvancedTableProps) => {
|
|
327
246
|
</AdvancedTableProvider>
|
328
247
|
|
329
248
|
</div>
|
330
|
-
|
249
|
+
{/* Bottom Pagination */}
|
331
250
|
{pagination && (
|
332
251
|
<TablePagination
|
333
252
|
onChange={onPageChange}
|
@@ -149,7 +149,7 @@ return (
|
|
149
149
|
data={{testid: testId}}
|
150
150
|
sortControl={sortControl}
|
151
151
|
tableData={MOCK_DATA}
|
152
|
-
|
152
|
+
>
|
153
153
|
<AdvancedTable.Header enableSorting />
|
154
154
|
<AdvancedTable.Body />
|
155
155
|
</AdvancedTable>
|
@@ -338,8 +338,8 @@ test("enableExpansionIcon changes icon", () => {
|
|
338
338
|
|
339
339
|
const kit = screen.getByTestId(testId)
|
340
340
|
const tableHead = kit.querySelector('table')
|
341
|
-
const toggleIcon
|
342
|
-
expect(toggleIcon).
|
341
|
+
const toggleIcon= tableHead.querySelector(".pb_icon_kit")
|
342
|
+
expect(toggleIcon).toHaveClass("fa-chevron-up")
|
343
343
|
})
|
344
344
|
|
345
345
|
test("sortIcon changes icon", () => {
|
@@ -360,8 +360,8 @@ test("sortIcon changes icon", () => {
|
|
360
360
|
|
361
361
|
const kit = screen.getByTestId(testId)
|
362
362
|
const sortIcon = kit.querySelector('.sort-button-icon')
|
363
|
-
const icon
|
364
|
-
expect(icon).
|
363
|
+
const icon= sortIcon.querySelector(".pb_icon_kit")
|
364
|
+
expect(icon).toHaveClass("fa-chevron-down")
|
365
365
|
})
|
366
366
|
|
367
367
|
test("Sort icon renders with enableSorting + sortControl works as expected", () => {
|
@@ -452,7 +452,7 @@ test("inlineRowLoading prop renders inline loading if true", () => {
|
|
452
452
|
const rowButton = kit.querySelector(".gray-icon.expand-toggle-icon")
|
453
453
|
expect(rowButton).toBeInTheDocument()
|
454
454
|
rowButton.click()
|
455
|
-
const inlineLoading = kit.querySelector(".
|
455
|
+
const inlineLoading = kit.querySelector(".fa-spinner")
|
456
456
|
expect(inlineLoading).toBeInTheDocument()
|
457
457
|
})
|
458
458
|
|
@@ -498,17 +498,4 @@ test("customRenderer prop functions as expected", () => {
|
|
498
498
|
const kit = screen.getByTestId(testId)
|
499
499
|
const pill = kit.querySelector(".pb_pill_kit_success_lowercase")
|
500
500
|
expect(pill).toBeInTheDocument()
|
501
|
-
})
|
502
|
-
|
503
|
-
test("allowFullScreen prop adds fullscreen class", () => {
|
504
|
-
render(
|
505
|
-
<AdvancedTable
|
506
|
-
allowFullScreen
|
507
|
-
columnDefinitions={columnDefinitions}
|
508
|
-
tableData={MOCK_DATA}
|
509
|
-
/>
|
510
|
-
)
|
511
|
-
|
512
|
-
const tableContainer = screen.getByRole("table").closest("div")
|
513
|
-
expect(tableContainer).toHaveClass("advanced-table-allow-fullscreen")
|
514
|
-
})
|
501
|
+
})
|
@@ -39,5 +39,4 @@ examples:
|
|
39
39
|
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
40
40
|
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
41
41
|
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
42
|
-
- advanced_table_inline_editing: Inline Cell Editing
|
43
|
-
- advanced_table_fullscreen: Fullscreen
|
42
|
+
- advanced_table_inline_editing: Inline Cell Editing
|
@@ -21,5 +21,4 @@ export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_
|
|
21
21
|
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
22
22
|
export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
|
23
23
|
export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
|
24
|
-
export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
|
25
|
-
export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
|
24
|
+
export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
|
@@ -27,20 +27,13 @@ exports[`html structure is correct 1`] = `
|
|
27
27
|
class="icon_wrapper"
|
28
28
|
style="vertical-align: middle; color: rgb(193, 205, 214);"
|
29
29
|
>
|
30
|
-
<
|
31
|
-
class="
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
xmlns="http://www.w3.org/2000/svg"
|
38
|
-
>
|
39
|
-
<path
|
40
|
-
d="M14.203 19.297l-9-9c-.469-.422-.469-1.125 0-1.594.422-.422 1.125-.422 1.594 0L15 16.953l8.203-8.203c.422-.469 1.125-.469 1.594 0a1.103 1.103 0 010 1.547l-9.047 9a1.027 1.027 0 01-1.547 0z"
|
41
|
-
fill="#242B42"
|
42
|
-
/>
|
43
|
-
</svg>
|
30
|
+
<i
|
31
|
+
class="pb_icon_kit far fa-lg fa-fw fa-lg fa-chevron-down"
|
32
|
+
/>
|
33
|
+
<span
|
34
|
+
aria-label="chevron-down icon"
|
35
|
+
hidden=""
|
36
|
+
/>
|
44
37
|
</div>
|
45
38
|
</div>
|
46
39
|
</div>
|
@@ -75,15 +75,15 @@ test('returns correct icon', () => {
|
|
75
75
|
</>
|
76
76
|
)
|
77
77
|
|
78
|
-
expect(screen.getByTestId('test-cell').querySelector('.
|
79
|
-
expect(screen.getByTestId('test-home').querySelector('.
|
78
|
+
expect(screen.getByTestId('test-cell').querySelector('.pb_icon_kit')).toHaveClass('fa-mobile')
|
79
|
+
expect(screen.getByTestId('test-home').querySelector('.pb_icon_kit')).toHaveClass('fa-phone')
|
80
80
|
expect(screen.getByTestId('test-work').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-office')
|
81
|
-
expect(screen.getByTestId('test-work-cell').querySelector('.
|
82
|
-
expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).
|
83
|
-
expect(screen.getByTestId('test-wrong-phone').querySelector('.
|
84
|
-
expect(screen.getByTestId('test-wrong-type').querySelector('.
|
81
|
+
expect(screen.getByTestId('test-work-cell').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-laptop')
|
82
|
+
expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).toHaveClass('envelope')
|
83
|
+
expect(screen.getByTestId('test-wrong-phone').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-slash')
|
84
|
+
expect(screen.getByTestId('test-wrong-type').querySelector('.pb_icon_kit')).toHaveClass('fa-phone')
|
85
85
|
expect(screen.getByTestId('test-extension').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-plus')
|
86
|
-
expect(screen.getByTestId('test-empty').querySelector('.
|
86
|
+
expect(screen.getByTestId('test-empty').querySelector('.pb_icon_kit')).toHaveClass('fa-phone')
|
87
87
|
})
|
88
88
|
|
89
89
|
test("not compliant values return null in phone related contact types", () => {
|
@@ -106,41 +106,41 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
106
106
|
const inputAriaProps = buildAriaProps(inputAria)
|
107
107
|
const inputDataProps = buildDataProps(inputData)
|
108
108
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
109
|
+
useEffect(() => {
|
110
|
+
datePickerHelper({
|
111
|
+
allowInput,
|
112
|
+
customQuickPickDates,
|
113
|
+
defaultDate,
|
114
|
+
disableDate,
|
115
|
+
disableRange,
|
116
|
+
disableWeekdays,
|
117
|
+
enableTime,
|
118
|
+
format,
|
119
|
+
hideIcon,
|
120
|
+
inLine,
|
121
|
+
maxDate,
|
122
|
+
minDate,
|
123
|
+
mode,
|
124
|
+
onChange,
|
125
|
+
onClose,
|
126
|
+
pickerId,
|
127
|
+
plugins,
|
128
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
129
|
+
// @ts-ignore
|
130
|
+
position,
|
131
|
+
positionElement,
|
132
|
+
selectionType,
|
133
|
+
showTimezone,
|
134
|
+
staticPosition,
|
135
|
+
thisRangesEndToday,
|
136
|
+
yearRange,
|
137
|
+
required: false,
|
138
|
+
}, scrollContainer)
|
139
|
+
}, initializeOnce ? [] : undefined)
|
140
140
|
const filteredProps = {...props}
|
141
141
|
if (filteredProps.marginBottom === undefined) {
|
142
142
|
filteredProps.marginBottom = "sm"
|
143
|
-
}
|
143
|
+
}
|
144
144
|
delete filteredProps?.position
|
145
145
|
|
146
146
|
const classes = classnames(
|
@@ -221,7 +221,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
221
221
|
{hideIcon && inLine ?
|
222
222
|
<div>
|
223
223
|
<div
|
224
|
-
className={
|
224
|
+
className={iconWrapperClass()}
|
225
225
|
id={`${pickerId}-icon-plus`}
|
226
226
|
>
|
227
227
|
<Icon
|
@@ -230,7 +230,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
230
230
|
/>
|
231
231
|
</div>
|
232
232
|
<div
|
233
|
-
className={
|
233
|
+
className={iconWrapperClass()}
|
234
234
|
id={`${pickerId}-angle-down`}
|
235
235
|
>
|
236
236
|
<Icon
|
@@ -44,7 +44,7 @@
|
|
44
44
|
<% if object.hide_icon && object.inline %>
|
45
45
|
<!-- Plus Icon -->
|
46
46
|
<div
|
47
|
-
class="<%= object.icon_wrapper_class %>
|
47
|
+
class="<%= object.icon_wrapper_class %>"
|
48
48
|
id="<%= object.picker_id %>-icon-plus"
|
49
49
|
>
|
50
50
|
<%= pb_rails("icon", props: {
|
@@ -55,7 +55,7 @@
|
|
55
55
|
|
56
56
|
<!-- Angle Down Icon -->
|
57
57
|
<div
|
58
|
-
class="<%= object.icon_wrapper_class %>
|
58
|
+
class="<%= object.icon_wrapper_class %>"
|
59
59
|
id="<%= object.picker_id %>-angle-down"
|
60
60
|
>
|
61
61
|
<%= pb_rails("icon", props: {
|
@@ -174,21 +174,6 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
174
174
|
yearInput.value = fp.currentYear?.toString()
|
175
175
|
}
|
176
176
|
|
177
|
-
const handleDatePickerChange = (fp: Instance, selectedDates: Date[]) => {
|
178
|
-
const inputEl = fp.input
|
179
|
-
|
180
|
-
if (inputEl) {
|
181
|
-
const inlineDatePickerElem = inputEl.closest('.inline-date-picker')
|
182
|
-
if (inlineDatePickerElem) {
|
183
|
-
if (selectedDates && selectedDates.length > 0) {
|
184
|
-
inlineDatePickerElem.classList.add('show-angle-down-icon')
|
185
|
-
} else {
|
186
|
-
inlineDatePickerElem.classList.remove('show-angle-down-icon')
|
187
|
-
}
|
188
|
-
}
|
189
|
-
}
|
190
|
-
}
|
191
|
-
|
192
177
|
// ===========================================================
|
193
178
|
// | Flatpickr initializer w/ config |
|
194
179
|
// ===========================================================
|
@@ -219,7 +204,6 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
219
204
|
onClose(selectedDates, dateStr)
|
220
205
|
}],
|
221
206
|
onChange: [(selectedDates, dateStr, fp) => {
|
222
|
-
handleDatePickerChange(fp, selectedDates)
|
223
207
|
yearChangeHook(fp)
|
224
208
|
onChange(dateStr, selectedDates)
|
225
209
|
}],
|
@@ -4,3 +4,14 @@
|
|
4
4
|
inline: true,
|
5
5
|
picker_id: "date-picker-inline"
|
6
6
|
}) %>
|
7
|
+
|
8
|
+
<%= javascript_tag do %>
|
9
|
+
window.addEventListener("DOMContentLoaded", (event) => {
|
10
|
+
const fpInline = document.querySelector("#date-picker-inline")._flatpickr
|
11
|
+
<!-- Display the angle-down icon when a date has been selected -->
|
12
|
+
const showAngleDownHandler = () => {
|
13
|
+
document.querySelector('.inline-date-picker').classList.add('show-angle-down-icon')
|
14
|
+
}
|
15
|
+
fpInline.config.onChange.push(showAngleDownHandler)
|
16
|
+
})
|
17
|
+
<% end %>
|
@@ -3,12 +3,19 @@ import React from 'react'
|
|
3
3
|
import DatePicker from '../_date_picker'
|
4
4
|
|
5
5
|
const DatePickerInline = (props) => {
|
6
|
+
const showAngleDownHandler = (dateSelected) => {
|
7
|
+
if (dateSelected) {
|
8
|
+
document.querySelector('.inline-date-picker').classList.add('show-angle-down-icon')
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
6
12
|
return (
|
7
13
|
<div>
|
8
14
|
<DatePicker
|
9
15
|
className="inline-date-picker"
|
10
16
|
hideIcon
|
11
17
|
inLine
|
18
|
+
onChange={showAngleDownHandler}
|
12
19
|
pickerId="date-picker-inline"
|
13
20
|
{...props}
|
14
21
|
/>
|