@digital-ai/dot-components 2.7.3 → 2.8.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.
- package/CHANGE_LOG.md +39 -11
- package/index.esm.js +244 -131
- package/index.umd.js +446 -296
- package/lib/Typography.stories.d.ts +1 -1
- package/lib/components/AccessibilityProps.d.ts +1 -0
- package/lib/components/CommonProps.d.ts +3 -0
- package/lib/components/app-switcher/AppSwitcher.styles.d.ts +1 -1
- package/lib/components/app-toolbar/AppToolbar.styles.d.ts +1 -1
- package/lib/components/auto-complete/AutoComplete.d.ts +7 -3
- package/lib/components/auto-complete/AutoComplete.stories.d.ts +3 -1
- package/lib/components/auto-complete/AutoComplete.stories.styles.d.ts +2 -0
- package/lib/components/auto-complete/Autocomplete.stories.data.d.ts +1 -5
- package/lib/components/auto-complete/index.d.ts +1 -1
- package/lib/components/avatar/Avatar.d.ts +1 -1
- package/lib/components/avatar/Avatar.stories.d.ts +1 -1
- package/lib/components/button/IconButton.d.ts +1 -1
- package/lib/components/button/IconButton.stories.d.ts +1 -1
- package/lib/components/date-picker/DatePicker.d.ts +6 -3
- package/lib/components/date-picker/DatePicker.stories.d.ts +1 -5
- package/lib/components/date-picker/index.d.ts +2 -0
- package/lib/components/date-picker/utils/helpers.d.ts +5 -0
- package/lib/components/date-picker/utils/models.d.ts +5 -0
- package/lib/components/drawer/Drawer.d.ts +3 -1
- package/lib/components/drawer/Drawer.stories.d.ts +1 -1
- package/lib/components/drawer/DrawerBody.d.ts +1 -1
- package/lib/components/drawer/DrawerFooter.d.ts +1 -1
- package/lib/components/file-upload/FileUpload.d.ts +1 -1
- package/lib/components/file-upload/FileUpload.stories.d.ts +1 -1
- package/lib/components/icon/Icon.d.ts +1 -1
- package/lib/components/icon/Icon.stories.d.ts +1 -1
- package/lib/components/index.d.ts +2 -2
- package/lib/components/inline-edit/InlineEdit.d.ts +1 -1
- package/lib/components/inline-edit/InlineEdit.stories.d.ts +1 -1
- package/lib/components/link/Link.d.ts +1 -1
- package/lib/components/link/Link.stories.d.ts +1 -1
- package/lib/components/list/List.d.ts +2 -2
- package/lib/components/list/List.stories.d.ts +1 -1
- package/lib/components/list/NestedList.styles.d.ts +1 -1
- package/lib/components/menu/Menu.d.ts +1 -1
- package/lib/components/menu/Menu.stories.d.ts +1 -1
- package/lib/components/radio/RadioGroup.d.ts +1 -1
- package/lib/components/radio/RadioGroup.stories.d.ts +1 -1
- package/lib/components/search-input/SearchInput.d.ts +1 -1
- package/lib/components/split-button/SplitButton.styles.d.ts +1 -1
- package/lib/components/stepper/Stepper.styles.d.ts +1 -1
- package/lib/components/table/Table.styles.d.ts +1 -1
- package/lib/components/table/TableActions.styles.d.ts +1 -1
- package/lib/components/time-picker/TimePicker.d.ts +12 -5
- package/lib/components/time-picker/TimePicker.stories.d.ts +3 -2
- package/lib/components/time-picker/TimePicker.stories.styles.d.ts +2 -0
- package/lib/components/time-picker/utils/helpers.d.ts +2 -0
- package/lib/components/tooltip/Tooltip.d.ts +1 -1
- package/lib/components/tooltip/Tooltip.stories.d.ts +1 -1
- package/lib/components/typography/Typography.d.ts +3 -1
- package/lib/components/typography/Typography.stories.d.ts +1 -1
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -150,14 +150,16 @@
|
|
|
150
150
|
|
|
151
151
|
var DotTooltip = function DotTooltip(_a) {
|
|
152
152
|
var ariaLabel = _a.ariaLabel,
|
|
153
|
+
_b = _a.ariaRole,
|
|
154
|
+
ariaRole = _b === void 0 ? 'tooltip' : _b,
|
|
153
155
|
children = _a.children,
|
|
154
156
|
className = _a.className,
|
|
155
157
|
dataTestId = _a["data-testid"],
|
|
156
158
|
leaveDelay = _a.leaveDelay,
|
|
157
159
|
onClose = _a.onClose,
|
|
158
160
|
open = _a.open,
|
|
159
|
-
|
|
160
|
-
placement =
|
|
161
|
+
_c = _a.placement,
|
|
162
|
+
placement = _c === void 0 ? 'bottom' : _c,
|
|
161
163
|
title = _a.title;
|
|
162
164
|
var rootClasses = useStylesWithRootClass('dot-tooltip', className);
|
|
163
165
|
return title ? jsxRuntime.jsx(material.Tooltip, __assign({
|
|
@@ -168,6 +170,7 @@
|
|
|
168
170
|
onClose: onClose,
|
|
169
171
|
open: open,
|
|
170
172
|
placement: placement,
|
|
173
|
+
role: ariaRole,
|
|
171
174
|
title: title
|
|
172
175
|
}, {
|
|
173
176
|
children: jsxRuntime.jsx("span", {
|
|
@@ -187,10 +190,12 @@
|
|
|
187
190
|
|
|
188
191
|
var DotIcon = function DotIcon(_a) {
|
|
189
192
|
var ariaLabel = _a.ariaLabel,
|
|
193
|
+
_b = _a.ariaRole,
|
|
194
|
+
ariaRole = _b === void 0 ? 'img' : _b,
|
|
190
195
|
className = _a.className,
|
|
191
196
|
dataTestId = _a["data-testid"],
|
|
192
|
-
|
|
193
|
-
fontSize =
|
|
197
|
+
_c = _a.fontSize,
|
|
198
|
+
fontSize = _c === void 0 ? 'medium' : _c,
|
|
194
199
|
iconId = _a.iconId,
|
|
195
200
|
tooltip = _a.tooltip;
|
|
196
201
|
var rootClasses = useStylesWithRootClass(rootClassName$15, className);
|
|
@@ -204,11 +209,13 @@
|
|
|
204
209
|
root: rootClasses
|
|
205
210
|
},
|
|
206
211
|
"data-testid": dataTestId,
|
|
207
|
-
fontSize: fontSize
|
|
212
|
+
fontSize: fontSize,
|
|
213
|
+
role: ariaRole
|
|
208
214
|
}, {
|
|
209
215
|
children: jsxRuntime.jsx("i", {
|
|
210
216
|
className: "icon-" + iconId + " dot-i",
|
|
211
|
-
"data-testid": dataTestId && dataTestId + "-i"
|
|
217
|
+
"data-testid": dataTestId && dataTestId + "-i",
|
|
218
|
+
role: ariaRole
|
|
212
219
|
}, void 0)
|
|
213
220
|
}), void 0)
|
|
214
221
|
}), void 0);
|
|
@@ -216,6 +223,8 @@
|
|
|
216
223
|
|
|
217
224
|
var DotTypography = function DotTypography(_a) {
|
|
218
225
|
var ariaLabel = _a.ariaLabel,
|
|
226
|
+
ariaLevel = _a.ariaLevel,
|
|
227
|
+
ariaRole = _a.ariaRole,
|
|
219
228
|
className = _a.className,
|
|
220
229
|
dataTestId = _a["data-testid"],
|
|
221
230
|
children = _a.children,
|
|
@@ -224,14 +233,21 @@
|
|
|
224
233
|
noWrap = _a.noWrap,
|
|
225
234
|
variant = _a.variant;
|
|
226
235
|
var rootClasses = useStylesWithRootClass('dot-typography', className);
|
|
236
|
+
React.useEffect(function () {
|
|
237
|
+
if (ariaRole === 'heading' && !ariaLevel) {
|
|
238
|
+
console.warn('please include ariaLevel when using ariaRole="heading"');
|
|
239
|
+
}
|
|
240
|
+
}, []);
|
|
227
241
|
return jsxRuntime.jsx(material.Typography, __assign({
|
|
228
242
|
"aria-label": ariaLabel,
|
|
243
|
+
"aria-level": ariaLevel,
|
|
229
244
|
classes: {
|
|
230
245
|
root: rootClasses
|
|
231
246
|
},
|
|
232
247
|
component: component,
|
|
233
248
|
"data-testid": dataTestId,
|
|
234
249
|
noWrap: noWrap,
|
|
250
|
+
role: ariaRole,
|
|
235
251
|
style: {
|
|
236
252
|
marginBottom: noMarginBottom ? 0 : undefined
|
|
237
253
|
},
|
|
@@ -1872,25 +1888,27 @@
|
|
|
1872
1888
|
var DotAvatar = function DotAvatar(_a) {
|
|
1873
1889
|
var alt = _a.alt,
|
|
1874
1890
|
ariaLabel = _a.ariaLabel,
|
|
1891
|
+
_b = _a.ariaRole,
|
|
1892
|
+
ariaRole = _b === void 0 ? 'img' : _b,
|
|
1875
1893
|
className = _a.className,
|
|
1876
|
-
|
|
1877
|
-
component =
|
|
1894
|
+
_c = _a.component,
|
|
1895
|
+
component = _c === void 0 ? 'div' : _c,
|
|
1878
1896
|
color = _a.color,
|
|
1879
1897
|
dataTestId = _a["data-testid"],
|
|
1880
1898
|
iconId = _a.iconId,
|
|
1881
1899
|
imageSrc = _a.imageSrc,
|
|
1882
1900
|
onClick = _a.onClick,
|
|
1883
|
-
|
|
1884
|
-
size =
|
|
1885
|
-
|
|
1886
|
-
tabIndex =
|
|
1887
|
-
|
|
1888
|
-
text =
|
|
1889
|
-
|
|
1890
|
-
type =
|
|
1901
|
+
_d = _a.size,
|
|
1902
|
+
size = _d === void 0 ? 'medium' : _d,
|
|
1903
|
+
_e = _a.tabIndex,
|
|
1904
|
+
tabIndex = _e === void 0 ? 0 : _e,
|
|
1905
|
+
_f = _a.text,
|
|
1906
|
+
text = _f === void 0 ? alt : _f,
|
|
1907
|
+
_g = _a.type,
|
|
1908
|
+
type = _g === void 0 ? 'image' : _g,
|
|
1891
1909
|
tooltip = _a.tooltip,
|
|
1892
|
-
|
|
1893
|
-
variant =
|
|
1910
|
+
_h = _a.variant,
|
|
1911
|
+
variant = _h === void 0 ? 'circular' : _h,
|
|
1894
1912
|
style = _a.style;
|
|
1895
1913
|
var rootClasses = useStylesWithRootClass(rootClassName$10, className);
|
|
1896
1914
|
var getAvatarColor = function getAvatarColor() {
|
|
@@ -1915,6 +1933,7 @@
|
|
|
1915
1933
|
onClick: function (event) {
|
|
1916
1934
|
return onClick ? onClick(event) : null;
|
|
1917
1935
|
},
|
|
1936
|
+
role: onClick ? 'button' : ariaRole,
|
|
1918
1937
|
src: type === 'image' ? imageSrc : null,
|
|
1919
1938
|
style: style,
|
|
1920
1939
|
tabIndex: tooltip ? tabIndex : undefined,
|
|
@@ -1924,9 +1943,9 @@
|
|
|
1924
1943
|
"data-testid": dataTestId,
|
|
1925
1944
|
iconId: iconId,
|
|
1926
1945
|
imageSrc: imageSrc,
|
|
1946
|
+
size: size,
|
|
1927
1947
|
text: text,
|
|
1928
|
-
type: type
|
|
1929
|
-
size: size
|
|
1948
|
+
type: type
|
|
1930
1949
|
}, void 0)
|
|
1931
1950
|
}), void 0)
|
|
1932
1951
|
}), void 0);
|
|
@@ -1945,29 +1964,31 @@
|
|
|
1945
1964
|
/** This component wraps the Button component from @material-ui. */
|
|
1946
1965
|
var DotButton = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
1947
1966
|
var ariaLabel = _a.ariaLabel,
|
|
1948
|
-
_b = _a.
|
|
1949
|
-
|
|
1967
|
+
_b = _a.ariaRole,
|
|
1968
|
+
ariaRole = _b === void 0 ? 'button' : _b,
|
|
1969
|
+
_c = _a.autoFocus,
|
|
1970
|
+
autoFocus = _c === void 0 ? false : _c,
|
|
1950
1971
|
children = _a.children,
|
|
1951
1972
|
className = _a.className,
|
|
1952
1973
|
dataTestId = _a["data-testid"],
|
|
1953
|
-
|
|
1954
|
-
disabled =
|
|
1955
|
-
|
|
1956
|
-
disableRipple =
|
|
1974
|
+
_d = _a.disabled,
|
|
1975
|
+
disabled = _d === void 0 ? false : _d,
|
|
1976
|
+
_e = _a.disableRipple,
|
|
1977
|
+
disableRipple = _e === void 0 ? false : _e,
|
|
1957
1978
|
endIcon = _a.endIcon,
|
|
1958
|
-
|
|
1959
|
-
fullWidth =
|
|
1960
|
-
|
|
1961
|
-
isSubmit =
|
|
1979
|
+
_f = _a.fullWidth,
|
|
1980
|
+
fullWidth = _f === void 0 ? false : _f,
|
|
1981
|
+
_g = _a.isSubmit,
|
|
1982
|
+
isSubmit = _g === void 0 ? false : _g,
|
|
1962
1983
|
onClick = _a.onClick,
|
|
1963
1984
|
onKeyDown = _a.onKeyDown,
|
|
1964
|
-
|
|
1965
|
-
size =
|
|
1985
|
+
_h = _a.size,
|
|
1986
|
+
size = _h === void 0 ? 'medium' : _h,
|
|
1966
1987
|
startIcon = _a.startIcon,
|
|
1967
1988
|
tabIndex = _a.tabIndex,
|
|
1968
1989
|
tooltip = _a.tooltip,
|
|
1969
|
-
|
|
1970
|
-
type =
|
|
1990
|
+
_j = _a.type,
|
|
1991
|
+
type = _j === void 0 ? 'primary' : _j;
|
|
1971
1992
|
var rootClasses = useStylesWithRootClass(rootClassName$$, className);
|
|
1972
1993
|
var color;
|
|
1973
1994
|
var variant;
|
|
@@ -2009,6 +2030,7 @@
|
|
|
2009
2030
|
},
|
|
2010
2031
|
onKeyDown: onKeyDown,
|
|
2011
2032
|
ref: ref,
|
|
2033
|
+
role: ariaRole,
|
|
2012
2034
|
size: size,
|
|
2013
2035
|
startIcon: startIcon,
|
|
2014
2036
|
tabIndex: tabIndex,
|
|
@@ -2031,19 +2053,21 @@
|
|
|
2031
2053
|
|
|
2032
2054
|
var DotLink = function DotLink(_a) {
|
|
2033
2055
|
var ariaLabel = _a.ariaLabel,
|
|
2056
|
+
_b = _a.ariaRole,
|
|
2057
|
+
ariaRole = _b === void 0 ? 'link' : _b,
|
|
2034
2058
|
children = _a.children,
|
|
2035
2059
|
className = _a.className,
|
|
2036
|
-
|
|
2037
|
-
color =
|
|
2060
|
+
_c = _a.color,
|
|
2061
|
+
color = _c === void 0 ? 'primary' : _c,
|
|
2038
2062
|
dataTestId = _a["data-testid"],
|
|
2039
2063
|
href = _a.href,
|
|
2040
2064
|
onClick = _a.onClick,
|
|
2041
2065
|
onMouseEnter = _a.onMouseEnter,
|
|
2042
2066
|
onPointerDown = _a.onPointerDown,
|
|
2043
|
-
|
|
2044
|
-
rel =
|
|
2045
|
-
|
|
2046
|
-
tabIndex =
|
|
2067
|
+
_d = _a.rel,
|
|
2068
|
+
rel = _d === void 0 ? 'noreferrer' : _d,
|
|
2069
|
+
_e = _a.tabIndex,
|
|
2070
|
+
tabIndex = _e === void 0 ? 0 : _e,
|
|
2047
2071
|
target = _a.target,
|
|
2048
2072
|
tooltip = _a.tooltip,
|
|
2049
2073
|
underline = _a.underline;
|
|
@@ -2070,6 +2094,7 @@
|
|
|
2070
2094
|
onMouseEnter: onMouseEnter,
|
|
2071
2095
|
onPointerDown: onPointerDown,
|
|
2072
2096
|
rel: rel,
|
|
2097
|
+
role: ariaRole,
|
|
2073
2098
|
tabIndex: tabIndex,
|
|
2074
2099
|
target: target,
|
|
2075
2100
|
underline: underline
|
|
@@ -2390,25 +2415,27 @@
|
|
|
2390
2415
|
var DotMenu = function DotMenu(_a) {
|
|
2391
2416
|
var anchorEl = _a.anchorEl,
|
|
2392
2417
|
ariaLabel = _a.ariaLabel,
|
|
2418
|
+
_b = _a.ariaRole,
|
|
2419
|
+
ariaRole = _b === void 0 ? 'menu' : _b,
|
|
2393
2420
|
className = _a.className,
|
|
2394
2421
|
dataTestId = _a["data-testid"],
|
|
2395
|
-
|
|
2396
|
-
dense =
|
|
2422
|
+
_c = _a.dense,
|
|
2423
|
+
dense = _c === void 0 ? true : _c,
|
|
2397
2424
|
disablePortal = _a.disablePortal,
|
|
2398
2425
|
id = _a.id,
|
|
2399
|
-
|
|
2400
|
-
loading =
|
|
2401
|
-
|
|
2402
|
-
maxVisibleItems =
|
|
2426
|
+
_d = _a.loading,
|
|
2427
|
+
loading = _d === void 0 ? false : _d,
|
|
2428
|
+
_e = _a.maxVisibleItems,
|
|
2429
|
+
maxVisibleItems = _e === void 0 ? DEFAULT_MAX_VISIBLE_ITEMS : _e,
|
|
2403
2430
|
menuItemHeight = _a.menuItemHeight,
|
|
2404
|
-
|
|
2405
|
-
menuItems =
|
|
2406
|
-
|
|
2407
|
-
menuPlacement =
|
|
2431
|
+
_f = _a.menuItems,
|
|
2432
|
+
menuItems = _f === void 0 ? [] : _f,
|
|
2433
|
+
_g = _a.menuPlacement,
|
|
2434
|
+
menuPlacement = _g === void 0 ? 'bottom' : _g,
|
|
2408
2435
|
onLeave = _a.onLeave,
|
|
2409
2436
|
onSelect = _a.onSelect,
|
|
2410
|
-
|
|
2411
|
-
open =
|
|
2437
|
+
_h = _a.open,
|
|
2438
|
+
open = _h === void 0 ? false : _h,
|
|
2412
2439
|
selectedKey = _a.selectedKey;
|
|
2413
2440
|
var rootClasses = useStylesWithRootClass(rootClassName$W, className, loading ? 'loading' : '');
|
|
2414
2441
|
var isSubmenu = checkIfSubmenu(anchorEl);
|
|
@@ -2493,6 +2520,7 @@
|
|
|
2493
2520
|
selectedKey: selectedKey
|
|
2494
2521
|
}, void 0);
|
|
2495
2522
|
},
|
|
2523
|
+
ariaRole: ariaRole,
|
|
2496
2524
|
selectedKey: selectedKey
|
|
2497
2525
|
}, void 0)
|
|
2498
2526
|
}), void 0)
|
|
@@ -2549,21 +2577,23 @@
|
|
|
2549
2577
|
|
|
2550
2578
|
var DotIconButton = function DotIconButton(_a) {
|
|
2551
2579
|
var ariaLabel = _a.ariaLabel,
|
|
2580
|
+
_b = _a.ariaRole,
|
|
2581
|
+
ariaRole = _b === void 0 ? 'button' : _b,
|
|
2552
2582
|
className = _a.className,
|
|
2553
|
-
|
|
2554
|
-
color =
|
|
2583
|
+
_c = _a.color,
|
|
2584
|
+
color = _c === void 0 ? 'inherit' : _c,
|
|
2555
2585
|
dataTestId = _a["data-testid"],
|
|
2556
|
-
|
|
2557
|
-
disabled =
|
|
2558
|
-
|
|
2559
|
-
disableRipple =
|
|
2586
|
+
_d = _a.disabled,
|
|
2587
|
+
disabled = _d === void 0 ? false : _d,
|
|
2588
|
+
_e = _a.disableRipple,
|
|
2589
|
+
disableRipple = _e === void 0 ? false : _e,
|
|
2560
2590
|
iconId = _a.iconId,
|
|
2561
|
-
|
|
2562
|
-
iconSize =
|
|
2591
|
+
_f = _a.iconSize,
|
|
2592
|
+
iconSize = _f === void 0 ? 'small' : _f,
|
|
2563
2593
|
onClick = _a.onClick,
|
|
2564
2594
|
tooltip = _a.tooltip,
|
|
2565
|
-
|
|
2566
|
-
size =
|
|
2595
|
+
_g = _a.size,
|
|
2596
|
+
size = _g === void 0 ? 'medium' : _g;
|
|
2567
2597
|
var rippleClassName = disableRipple ? 'ripple-disabled' : '';
|
|
2568
2598
|
var rootClasses = useStylesWithRootClass(rootClassName$S, rippleClassName, className);
|
|
2569
2599
|
return jsxRuntime.jsx(DotTooltip, __assign({
|
|
@@ -2582,6 +2612,7 @@
|
|
|
2582
2612
|
onClick: function (event) {
|
|
2583
2613
|
return onClick && onClick(event);
|
|
2584
2614
|
},
|
|
2615
|
+
role: ariaRole,
|
|
2585
2616
|
size: size
|
|
2586
2617
|
}, {
|
|
2587
2618
|
children: jsxRuntime.jsx(DotIcon, {
|
|
@@ -2603,8 +2634,10 @@
|
|
|
2603
2634
|
var rootClasses = useStylesWithRootClass(rootClassName$T, className);
|
|
2604
2635
|
return jsxRuntime.jsxs(StyleDrawerHeader, __assign({
|
|
2605
2636
|
"aria-label": ariaLabel,
|
|
2637
|
+
"aria-level": 2,
|
|
2606
2638
|
className: rootClasses,
|
|
2607
|
-
"data-testid": dataTestId
|
|
2639
|
+
"data-testid": dataTestId,
|
|
2640
|
+
role: "heading"
|
|
2608
2641
|
}, {
|
|
2609
2642
|
children: [children, variant !== 'permanent' && jsxRuntime.jsx(DotIconButton, {
|
|
2610
2643
|
className: "close-button",
|
|
@@ -2625,6 +2658,8 @@
|
|
|
2625
2658
|
|
|
2626
2659
|
var DotDrawerBody = function DotDrawerBody(_a) {
|
|
2627
2660
|
var ariaLabel = _a.ariaLabel,
|
|
2661
|
+
_b = _a.ariaRole,
|
|
2662
|
+
ariaRole = _b === void 0 ? 'region' : _b,
|
|
2628
2663
|
children = _a.children,
|
|
2629
2664
|
className = _a.className,
|
|
2630
2665
|
dataTestId = _a["data-testid"],
|
|
@@ -2635,7 +2670,8 @@
|
|
|
2635
2670
|
return jsxRuntime.jsxs(StyleDrawerBody, __assign({
|
|
2636
2671
|
"aria-label": ariaLabel,
|
|
2637
2672
|
className: rootClasses,
|
|
2638
|
-
"data-testid": dataTestId
|
|
2673
|
+
"data-testid": dataTestId,
|
|
2674
|
+
role: ariaRole
|
|
2639
2675
|
}, {
|
|
2640
2676
|
children: [children, !headerExists && variant !== 'permanent' && jsxRuntime.jsx(DotIconButton, {
|
|
2641
2677
|
className: "dot-drawer-close-button",
|
|
@@ -2657,6 +2693,8 @@
|
|
|
2657
2693
|
|
|
2658
2694
|
var DotDrawerFooter = function DotDrawerFooter(_a) {
|
|
2659
2695
|
var ariaLabel = _a.ariaLabel,
|
|
2696
|
+
_b = _a.ariaRole,
|
|
2697
|
+
ariaRole = _b === void 0 ? 'region' : _b,
|
|
2660
2698
|
children = _a.children,
|
|
2661
2699
|
className = _a.className,
|
|
2662
2700
|
dataTestId = _a["data-testid"];
|
|
@@ -2664,7 +2702,8 @@
|
|
|
2664
2702
|
return jsxRuntime.jsx(StyleDrawerFooter, __assign({
|
|
2665
2703
|
"aria-label": ariaLabel,
|
|
2666
2704
|
className: rootClasses,
|
|
2667
|
-
"data-testid": dataTestId
|
|
2705
|
+
"data-testid": dataTestId,
|
|
2706
|
+
role: ariaRole
|
|
2668
2707
|
}, {
|
|
2669
2708
|
children: children
|
|
2670
2709
|
}), void 0);
|
|
@@ -2674,6 +2713,8 @@
|
|
|
2674
2713
|
var _b = _a.anchor,
|
|
2675
2714
|
anchor = _b === void 0 ? 'right' : _b,
|
|
2676
2715
|
ariaLabel = _a.ariaLabel,
|
|
2716
|
+
_c = _a.ariaRole,
|
|
2717
|
+
ariaRole = _c === void 0 ? 'presentation' : _c,
|
|
2677
2718
|
className = _a.className,
|
|
2678
2719
|
children = _a.children,
|
|
2679
2720
|
dataTestId = _a["data-testid"],
|
|
@@ -2685,10 +2726,10 @@
|
|
|
2685
2726
|
onClose = _a.onClose,
|
|
2686
2727
|
open = _a.open,
|
|
2687
2728
|
PaperProps = _a.PaperProps,
|
|
2688
|
-
|
|
2689
|
-
variant =
|
|
2690
|
-
|
|
2691
|
-
width =
|
|
2729
|
+
_d = _a.variant,
|
|
2730
|
+
variant = _d === void 0 ? 'temporary' : _d,
|
|
2731
|
+
_e = _a.width,
|
|
2732
|
+
width = _e === void 0 ? '256px' : _e;
|
|
2692
2733
|
React.useEffect(function () {
|
|
2693
2734
|
if (children !== undefined && drawerBodyProps !== undefined) {
|
|
2694
2735
|
console.warn('Please use `children` or `drawerBodyProps`. If both are used, `children` is ignored.');
|
|
@@ -2704,7 +2745,9 @@
|
|
|
2704
2745
|
var bodyTestId = drawerBodyProps ? drawerBodyProps["data-testid"] : 'drawer-body';
|
|
2705
2746
|
return jsxRuntime.jsxs(StyledDrawer, __assign({
|
|
2706
2747
|
ModalProps: ModalProps,
|
|
2707
|
-
PaperProps: PaperProps,
|
|
2748
|
+
PaperProps: __assign(__assign({}, PaperProps), {
|
|
2749
|
+
role: ariaRole
|
|
2750
|
+
}),
|
|
2708
2751
|
anchor: anchor,
|
|
2709
2752
|
"aria-label": ariaLabel,
|
|
2710
2753
|
classes: {
|
|
@@ -2715,6 +2758,7 @@
|
|
|
2715
2758
|
height: height,
|
|
2716
2759
|
onClose: handleClose,
|
|
2717
2760
|
open: open,
|
|
2761
|
+
role: ariaRole,
|
|
2718
2762
|
variant: variant,
|
|
2719
2763
|
width: width
|
|
2720
2764
|
}, {
|
|
@@ -2774,31 +2818,33 @@
|
|
|
2774
2818
|
};
|
|
2775
2819
|
var DotList = function DotList(_a) {
|
|
2776
2820
|
var ariaLabel = _a.ariaLabel,
|
|
2821
|
+
_b = _a.ariaRole,
|
|
2822
|
+
ariaRole = _b === void 0 ? 'list' : _b,
|
|
2777
2823
|
children = _a.children,
|
|
2778
2824
|
className = _a.className,
|
|
2779
|
-
|
|
2780
|
-
component =
|
|
2825
|
+
_c = _a.component,
|
|
2826
|
+
component = _c === void 0 ? 'ul' : _c,
|
|
2781
2827
|
dataTestId = _a["data-testid"],
|
|
2782
|
-
|
|
2783
|
-
dense =
|
|
2784
|
-
|
|
2785
|
-
disablePadding =
|
|
2786
|
-
|
|
2787
|
-
items =
|
|
2788
|
-
|
|
2789
|
-
menuPlacement =
|
|
2790
|
-
|
|
2791
|
-
nestedDrawerLeftSpacing =
|
|
2792
|
-
|
|
2793
|
-
nestedListType =
|
|
2794
|
-
|
|
2795
|
-
width =
|
|
2828
|
+
_d = _a.dense,
|
|
2829
|
+
dense = _d === void 0 ? false : _d,
|
|
2830
|
+
_e = _a.disablePadding,
|
|
2831
|
+
disablePadding = _e === void 0 ? false : _e,
|
|
2832
|
+
_f = _a.items,
|
|
2833
|
+
items = _f === void 0 ? [] : _f,
|
|
2834
|
+
_g = _a.menuPlacement,
|
|
2835
|
+
menuPlacement = _g === void 0 ? 'right-start' : _g,
|
|
2836
|
+
_h = _a.nestedDrawerLeftSpacing,
|
|
2837
|
+
nestedDrawerLeftSpacing = _h === void 0 ? 240 : _h,
|
|
2838
|
+
_j = _a.nestedListType,
|
|
2839
|
+
nestedListType = _j === void 0 ? 'expandable' : _j,
|
|
2840
|
+
_k = _a.width,
|
|
2841
|
+
width = _k === void 0 ? 240 : _k;
|
|
2796
2842
|
var rootClasses = useStylesWithRootClass(rootClassName$Z, className);
|
|
2797
2843
|
var listWidth = typeof width === 'number' ? width + "px" : width;
|
|
2798
2844
|
var listRef = React.useRef();
|
|
2799
|
-
var
|
|
2800
|
-
listItemIndex =
|
|
2801
|
-
setListItemIndex =
|
|
2845
|
+
var _l = React.useState(null),
|
|
2846
|
+
listItemIndex = _l[0],
|
|
2847
|
+
setListItemIndex = _l[1];
|
|
2802
2848
|
var updateSelectedListItem = function updateSelectedListItem(currentIndex) {
|
|
2803
2849
|
currentIndex === listItemIndex ? setListItemIndex(null) : setListItemIndex(currentIndex);
|
|
2804
2850
|
};
|
|
@@ -2812,6 +2858,7 @@
|
|
|
2812
2858
|
dense: dense,
|
|
2813
2859
|
disablePadding: disablePadding,
|
|
2814
2860
|
ref: listRef,
|
|
2861
|
+
role: ariaRole,
|
|
2815
2862
|
style: {
|
|
2816
2863
|
width: listWidth
|
|
2817
2864
|
}
|
|
@@ -2868,19 +2915,21 @@
|
|
|
2868
2915
|
};
|
|
2869
2916
|
var DotListItem = function DotListItem(_a) {
|
|
2870
2917
|
var ariaLabel = _a.ariaLabel,
|
|
2918
|
+
_b = _a.ariaRole,
|
|
2919
|
+
ariaRole = _b === void 0 ? 'listitem' : _b,
|
|
2871
2920
|
className = _a.className,
|
|
2872
|
-
|
|
2873
|
-
component =
|
|
2921
|
+
_c = _a.component,
|
|
2922
|
+
component = _c === void 0 ? 'li' : _c,
|
|
2874
2923
|
dataTestId = _a["data-testid"],
|
|
2875
|
-
|
|
2876
|
-
divider =
|
|
2924
|
+
_d = _a.divider,
|
|
2925
|
+
divider = _d === void 0 ? false : _d,
|
|
2877
2926
|
endIcon = _a.endIcon,
|
|
2878
2927
|
href = _a.href,
|
|
2879
2928
|
isOpened = _a.isOpened,
|
|
2880
2929
|
onClick = _a.onClick,
|
|
2881
2930
|
onMenuLeave = _a.onMenuLeave,
|
|
2882
|
-
|
|
2883
|
-
items =
|
|
2931
|
+
_e = _a.items,
|
|
2932
|
+
items = _e === void 0 ? [] : _e,
|
|
2884
2933
|
menuPlacement = _a.menuPlacement,
|
|
2885
2934
|
nestedDrawerLeftSpacing = _a.nestedDrawerLeftSpacing,
|
|
2886
2935
|
nestedListType = _a.nestedListType,
|
|
@@ -2891,13 +2940,13 @@
|
|
|
2891
2940
|
target = _a.target,
|
|
2892
2941
|
text = _a.text,
|
|
2893
2942
|
tooltip = _a.tooltip,
|
|
2894
|
-
|
|
2895
|
-
tooltipPlacement =
|
|
2943
|
+
_f = _a.tooltipPlacement,
|
|
2944
|
+
tooltipPlacement = _f === void 0 ? DEFAULT_TOOLTIP_PLACEMENT : _f;
|
|
2896
2945
|
var hasChildren = items.length > 0;
|
|
2897
2946
|
var isFlyout = nestedListType === 'menu' && hasChildren;
|
|
2898
|
-
var
|
|
2899
|
-
anchorEl =
|
|
2900
|
-
setAnchorEl =
|
|
2947
|
+
var _g = React.useState(null),
|
|
2948
|
+
anchorEl = _g[0],
|
|
2949
|
+
setAnchorEl = _g[1];
|
|
2901
2950
|
var showEndIcon = endIcon || hasChildren;
|
|
2902
2951
|
var rootClasses = useStylesWithRootClass(listItemRootClass, className, isOpened ? 'open' : '');
|
|
2903
2952
|
var toggleOpen = function toggleOpen(event) {
|
|
@@ -2945,6 +2994,7 @@
|
|
|
2945
2994
|
divider: divider,
|
|
2946
2995
|
href: onClick ? null : href,
|
|
2947
2996
|
onClick: onClick || !href ? handleClick : null,
|
|
2997
|
+
role: onClick ? 'button' : ariaRole,
|
|
2948
2998
|
selected: isFlyout ? isOpened : selected,
|
|
2949
2999
|
target: target
|
|
2950
3000
|
}, {
|
|
@@ -3313,22 +3363,24 @@
|
|
|
3313
3363
|
|
|
3314
3364
|
function SearchInput(_a) {
|
|
3315
3365
|
var dataTestId = _a["data-testid"],
|
|
3316
|
-
_b = _a.
|
|
3317
|
-
|
|
3366
|
+
_b = _a.ariaRole,
|
|
3367
|
+
ariaRole = _b === void 0 ? 'searchbox' : _b,
|
|
3368
|
+
_c = _a.autoFocus,
|
|
3369
|
+
autoFocus = _c === void 0 ? true : _c,
|
|
3318
3370
|
className = _a.className,
|
|
3319
|
-
|
|
3320
|
-
disabled =
|
|
3371
|
+
_d = _a.disabled,
|
|
3372
|
+
disabled = _d === void 0 ? false : _d,
|
|
3321
3373
|
onChange = _a.onChange,
|
|
3322
3374
|
onClear = _a.onClear,
|
|
3323
|
-
|
|
3324
|
-
placeholder =
|
|
3325
|
-
|
|
3326
|
-
tooltip =
|
|
3375
|
+
_e = _a.placeholder,
|
|
3376
|
+
placeholder = _e === void 0 ? 'Search' : _e,
|
|
3377
|
+
_f = _a.tooltip,
|
|
3378
|
+
tooltip = _f === void 0 ? null : _f,
|
|
3327
3379
|
value = _a.value;
|
|
3328
3380
|
var rootClasses = useStylesWithRootClass(rootClassName$P, className);
|
|
3329
|
-
var
|
|
3330
|
-
searchText =
|
|
3331
|
-
setSearchText =
|
|
3381
|
+
var _g = React.useState(value),
|
|
3382
|
+
searchText = _g[0],
|
|
3383
|
+
setSearchText = _g[1];
|
|
3332
3384
|
var previousSearchText = '';
|
|
3333
3385
|
var handleChange = React.useCallback(function (event) {
|
|
3334
3386
|
previousSearchText = event.target.value;
|
|
@@ -3362,6 +3414,7 @@
|
|
|
3362
3414
|
title: tooltip
|
|
3363
3415
|
}, {
|
|
3364
3416
|
children: jsxRuntime.jsx(DotInputText, {
|
|
3417
|
+
ariaRole: ariaRole,
|
|
3365
3418
|
"data-testid": dataTestId,
|
|
3366
3419
|
autoFocus: autoFocus,
|
|
3367
3420
|
className: "search-text",
|
|
@@ -3882,7 +3935,8 @@
|
|
|
3882
3935
|
if (selectedAppType && appTypeMap && appTypeLabels) {
|
|
3883
3936
|
var labelConfig = appTypeLabels.get(selectedAppType);
|
|
3884
3937
|
return jsxRuntime.jsxs("div", __assign({
|
|
3885
|
-
className: "content"
|
|
3938
|
+
className: "content",
|
|
3939
|
+
role: "contentinfo"
|
|
3886
3940
|
}, {
|
|
3887
3941
|
children: [jsxRuntime.jsx("span", {
|
|
3888
3942
|
children: jsxRuntime.jsx(DotButton, __assign({
|
|
@@ -3898,7 +3952,9 @@
|
|
|
3898
3952
|
}, void 0)
|
|
3899
3953
|
}), void 0)
|
|
3900
3954
|
}, void 0), jsxRuntime.jsx("div", __assign({
|
|
3901
|
-
|
|
3955
|
+
"aria-level": 2,
|
|
3956
|
+
className: "product-heading",
|
|
3957
|
+
role: "heading"
|
|
3902
3958
|
}, {
|
|
3903
3959
|
children: createAppTypeLabel(selectedAppType, labelConfig.logo, labelConfig.singleTypeApps)
|
|
3904
3960
|
}), void 0), ((_a = appTypeMap === null || appTypeMap === void 0 ? void 0 : appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.length) >= searchInstancesThreshold && jsxRuntime.jsx("div", __assign({
|
|
@@ -3911,14 +3967,16 @@
|
|
|
3911
3967
|
value: searchText
|
|
3912
3968
|
}, void 0)
|
|
3913
3969
|
}), void 0), jsxRuntime.jsx("div", __assign({
|
|
3914
|
-
className: "product-applications"
|
|
3970
|
+
className: "product-applications",
|
|
3971
|
+
role: "list"
|
|
3915
3972
|
}, {
|
|
3916
3973
|
children: filteredAppInstances()
|
|
3917
3974
|
}), void 0)]
|
|
3918
3975
|
}), void 0);
|
|
3919
3976
|
} else {
|
|
3920
3977
|
return jsxRuntime.jsxs("div", __assign({
|
|
3921
|
-
className: "content"
|
|
3978
|
+
className: "content",
|
|
3979
|
+
role: "contentinfo"
|
|
3922
3980
|
}, {
|
|
3923
3981
|
children: [jsxRuntime.jsx(DotList, {
|
|
3924
3982
|
items: appTypeMenuItems === null || appTypeMenuItems === void 0 ? void 0 : appTypeMenuItems.map(function (item) {
|
|
@@ -3934,7 +3992,9 @@
|
|
|
3934
3992
|
var header = {
|
|
3935
3993
|
className: 'app-switcher-header',
|
|
3936
3994
|
children: jsxRuntime.jsxs("div", __assign({
|
|
3995
|
+
"aria-level": 1,
|
|
3937
3996
|
className: "app-switcher-header-title",
|
|
3997
|
+
role: "heading",
|
|
3938
3998
|
style: {
|
|
3939
3999
|
marginTop: yOffset + 'px',
|
|
3940
4000
|
width: '80%'
|
|
@@ -3946,6 +4006,8 @@
|
|
|
3946
4006
|
type: "image",
|
|
3947
4007
|
variant: "circular"
|
|
3948
4008
|
}, void 0), jsxRuntime.jsx(DotTypography, __assign({
|
|
4009
|
+
ariaRole: "heading",
|
|
4010
|
+
ariaLevel: 1,
|
|
3949
4011
|
className: "app-switcher-label"
|
|
3950
4012
|
}, {
|
|
3951
4013
|
children: "App switcher"
|
|
@@ -4744,10 +4806,12 @@
|
|
|
4744
4806
|
endAdornmentTooltip = _a.endAdornmentTooltip,
|
|
4745
4807
|
_e = _a.error,
|
|
4746
4808
|
error = _e === void 0 ? false : _e,
|
|
4809
|
+
filterOptions = _a.filterOptions,
|
|
4747
4810
|
_f = _a.filterSelectedOptions,
|
|
4748
4811
|
filterSelectedOptions = _f === void 0 ? true : _f,
|
|
4749
4812
|
_g = _a.freesolo,
|
|
4750
4813
|
freesolo = _g === void 0 ? true : _g,
|
|
4814
|
+
checkIfOptionDisabled = _a.checkIfOptionDisabled,
|
|
4751
4815
|
_h = _a.group,
|
|
4752
4816
|
group = _h === void 0 ? false : _h,
|
|
4753
4817
|
helperText = _a.helperText,
|
|
@@ -4980,11 +5044,13 @@
|
|
|
4980
5044
|
"data-testid": dataTestId,
|
|
4981
5045
|
defaultValue: defaultValue,
|
|
4982
5046
|
disabled: disabled,
|
|
5047
|
+
filterOptions: filterOptions,
|
|
4983
5048
|
filterSelectedOptions: filterSelectedOptions,
|
|
4984
5049
|
freeSolo: freesolo,
|
|
4985
5050
|
getOptionLabel: function (option) {
|
|
4986
5051
|
return parseAutoCompleteValue(option);
|
|
4987
5052
|
},
|
|
5053
|
+
getOptionDisabled: checkIfOptionDisabled,
|
|
4988
5054
|
groupBy: group ? function (option) {
|
|
4989
5055
|
return option.group;
|
|
4990
5056
|
} : undefined,
|
|
@@ -5444,7 +5510,9 @@
|
|
|
5444
5510
|
itemsAfterCollapse: itemsAfterCollapse,
|
|
5445
5511
|
maxItems: getMaxItems(adjustMaxItems, maxVisibleItems, maxItems),
|
|
5446
5512
|
ref: breadcrumbRef,
|
|
5513
|
+
role: "navigation",
|
|
5447
5514
|
separator: jsxRuntime.jsx(DotIcon, {
|
|
5515
|
+
ariaRole: "presentation",
|
|
5448
5516
|
className: "separator",
|
|
5449
5517
|
iconId: "chevron-right"
|
|
5450
5518
|
}, void 0)
|
|
@@ -6797,6 +6865,7 @@
|
|
|
6797
6865
|
return jsxRuntime.jsx(StyledFormControlLabel, {
|
|
6798
6866
|
className: rootClasses,
|
|
6799
6867
|
control: radioControl,
|
|
6868
|
+
"aria-label": value,
|
|
6800
6869
|
label: label || radioControl,
|
|
6801
6870
|
labelPlacement: labelPlacement,
|
|
6802
6871
|
value: value
|
|
@@ -6805,6 +6874,8 @@
|
|
|
6805
6874
|
|
|
6806
6875
|
var DotRadioGroup = function DotRadioGroup(_a) {
|
|
6807
6876
|
var ariaLabel = _a.ariaLabel,
|
|
6877
|
+
_b = _a.ariaRole,
|
|
6878
|
+
ariaRole = _b === void 0 ? 'radiogroup' : _b,
|
|
6808
6879
|
className = _a.className,
|
|
6809
6880
|
dataTestId = _a["data-testid"],
|
|
6810
6881
|
defaultValue = _a.defaultValue,
|
|
@@ -6814,22 +6885,22 @@
|
|
|
6814
6885
|
helperText = _a.helperText,
|
|
6815
6886
|
groupLabel = _a.groupLabel,
|
|
6816
6887
|
name = _a.name,
|
|
6817
|
-
|
|
6818
|
-
labelPlacement =
|
|
6888
|
+
_c = _a.labelPlacement,
|
|
6889
|
+
labelPlacement = _c === void 0 ? 'end' : _c,
|
|
6819
6890
|
onChange = _a.onChange,
|
|
6820
6891
|
value = _a.value,
|
|
6821
6892
|
options = _a.options,
|
|
6822
6893
|
startIcon = _a.startIcon,
|
|
6823
6894
|
required = _a.required,
|
|
6824
6895
|
row = _a.row,
|
|
6825
|
-
|
|
6826
|
-
size =
|
|
6896
|
+
_d = _a.size,
|
|
6897
|
+
size = _d === void 0 ? 'medium' : _d;
|
|
6827
6898
|
var placement = "" + placementClassName + labelPlacement;
|
|
6828
6899
|
var rootClasses = useStylesWithRootClass(rootClassName$A, className, placement);
|
|
6829
6900
|
var radioValue = value || defaultValue;
|
|
6830
|
-
var
|
|
6831
|
-
selectedValue =
|
|
6832
|
-
setSelectedValue =
|
|
6901
|
+
var _e = React.useState(radioValue),
|
|
6902
|
+
selectedValue = _e[0],
|
|
6903
|
+
setSelectedValue = _e[1];
|
|
6833
6904
|
/* This will ensure that value can be updated from the outside */
|
|
6834
6905
|
React.useEffect(function () {
|
|
6835
6906
|
setSelectedValue(radioValue);
|
|
@@ -6885,6 +6956,7 @@
|
|
|
6885
6956
|
defaultValue: defaultValue,
|
|
6886
6957
|
name: name,
|
|
6887
6958
|
onChange: handleChange,
|
|
6959
|
+
role: ariaRole,
|
|
6888
6960
|
row: row,
|
|
6889
6961
|
value: selectedValue
|
|
6890
6962
|
}, {
|
|
@@ -7598,39 +7670,41 @@
|
|
|
7598
7670
|
*/
|
|
7599
7671
|
var DotInlineEdit = function DotInlineEdit(_a) {
|
|
7600
7672
|
var ariaLabel = _a.ariaLabel,
|
|
7673
|
+
_b = _a.ariaRole,
|
|
7674
|
+
ariaRole = _b === void 0 ? 'combobox' : _b,
|
|
7601
7675
|
bindings = _a.bindings,
|
|
7602
7676
|
charactersLimit = _a.charactersLimit,
|
|
7603
7677
|
className = _a.className,
|
|
7604
7678
|
dataTestId = _a["data-testid"],
|
|
7605
|
-
|
|
7606
|
-
fullWidth =
|
|
7679
|
+
_c = _a.fullWidth,
|
|
7680
|
+
fullWidth = _c === void 0 ? true : _c,
|
|
7607
7681
|
hideActionButtons = _a.hideActionButtons,
|
|
7608
7682
|
name = _a.name,
|
|
7609
7683
|
onChange = _a.onChange,
|
|
7610
7684
|
onEditStateChange = _a.onEditStateChange,
|
|
7611
7685
|
readOnly = _a.readOnly,
|
|
7612
7686
|
selectTextOnEdit = _a.selectTextOnEdit,
|
|
7613
|
-
|
|
7614
|
-
startEditable =
|
|
7615
|
-
|
|
7616
|
-
tabIndex =
|
|
7687
|
+
_d = _a.startEditable,
|
|
7688
|
+
startEditable = _d === void 0 ? false : _d,
|
|
7689
|
+
_e = _a.tabIndex,
|
|
7690
|
+
tabIndex = _e === void 0 ? 0 : _e,
|
|
7617
7691
|
tooltip = _a.tooltip,
|
|
7618
|
-
|
|
7619
|
-
typography =
|
|
7620
|
-
|
|
7621
|
-
value =
|
|
7622
|
-
var _g = React.useState(false),
|
|
7623
|
-
editing = _g[0],
|
|
7624
|
-
setEditing = _g[1];
|
|
7692
|
+
_f = _a.typography,
|
|
7693
|
+
typography = _f === void 0 ? 'body1' : _f,
|
|
7694
|
+
_g = _a.value,
|
|
7695
|
+
value = _g === void 0 ? '' : _g;
|
|
7625
7696
|
var _h = React.useState(false),
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
var _j = React.useState(
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
var _k = React.useState(
|
|
7632
|
-
|
|
7633
|
-
|
|
7697
|
+
editing = _h[0],
|
|
7698
|
+
setEditing = _h[1];
|
|
7699
|
+
var _j = React.useState(false),
|
|
7700
|
+
showTooltip = _j[0],
|
|
7701
|
+
setShowTooltip = _j[1];
|
|
7702
|
+
var _k = React.useState(''),
|
|
7703
|
+
originalValue = _k[0],
|
|
7704
|
+
setOriginalValue = _k[1];
|
|
7705
|
+
var _l = React.useState(value),
|
|
7706
|
+
inputValue = _l[0],
|
|
7707
|
+
setInputValue = _l[1];
|
|
7634
7708
|
var inputRef = React.useRef();
|
|
7635
7709
|
var inlineEditRef = React.useRef();
|
|
7636
7710
|
React.useEffect(function () {
|
|
@@ -7787,7 +7861,8 @@
|
|
|
7787
7861
|
children: viewModeChildren
|
|
7788
7862
|
}), void 0) : jsxRuntime.jsx("div", __assign({
|
|
7789
7863
|
className: viewModeClasses,
|
|
7790
|
-
"data-testid": dataTestId && dataTestId + "-view-mode-wrapper"
|
|
7864
|
+
"data-testid": dataTestId && dataTestId + "-view-mode-wrapper",
|
|
7865
|
+
role: "presentation"
|
|
7791
7866
|
}, {
|
|
7792
7867
|
children: viewModeChildren
|
|
7793
7868
|
}), void 0);
|
|
@@ -7871,6 +7946,7 @@
|
|
|
7871
7946
|
return handleKeyPress(event);
|
|
7872
7947
|
} : undefined,
|
|
7873
7948
|
ref: inlineEditRef,
|
|
7949
|
+
role: ariaRole,
|
|
7874
7950
|
tabIndex: !readOnly ? tabIndex : undefined,
|
|
7875
7951
|
typography: typography
|
|
7876
7952
|
}, {
|
|
@@ -7967,16 +8043,19 @@
|
|
|
7967
8043
|
componentId: "l7oxi2-0"
|
|
7968
8044
|
})(templateObject_2$m || (templateObject_2$m = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
7969
8045
|
var theme = _a.theme;
|
|
7970
|
-
return styled.css(templateObject_1$n || (templateObject_1$n = __makeTemplateObject(["\n &.", " {\n background-color: ", ";\n color: ", ";\n
|
|
8046
|
+
return styled.css(templateObject_1$n || (templateObject_1$n = __makeTemplateObject(["\n &.", " {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n\n &.MuiChip-outlined {\n &.error {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.success {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.warning {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.in-progress {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n }\n\n &.MuiChip-filled {\n &.error {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.success {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.warning {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.in-progress {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n }\n }\n "], ["\n &.", " {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n\n &.MuiChip-outlined {\n &.error {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.success {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.warning {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.in-progress {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n }\n\n &.MuiChip-filled {\n &.error {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.success {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.warning {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n\n &.in-progress {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n .dot-icon {\n color: ", ";\n }\n }\n }\n }\n "])), rootClassName$n, function (_a) {
|
|
7971
8047
|
var backgroundcolor = _a.backgroundcolor;
|
|
7972
8048
|
return backgroundcolor || theme.palette.grey[200];
|
|
8049
|
+
}, function (_a) {
|
|
8050
|
+
var bordercolor = _a.bordercolor;
|
|
8051
|
+
return bordercolor ? bordercolor : theme.palette.layer.n700;
|
|
7973
8052
|
}, function (_a) {
|
|
7974
8053
|
var labelcolor = _a.labelcolor;
|
|
7975
8054
|
return labelcolor ? labelcolor : theme.palette.layer.n700;
|
|
7976
8055
|
}, function (_a) {
|
|
7977
|
-
var
|
|
7978
|
-
return
|
|
7979
|
-
}, theme.palette.error[100], theme.palette.error.main, theme.palette.
|
|
8056
|
+
var labelcolor = _a.labelcolor;
|
|
8057
|
+
return labelcolor ? labelcolor : theme.palette.layer.n700;
|
|
8058
|
+
}, theme.palette.error[100], theme.palette.error.main, theme.palette.layer.n700, theme.palette.error.main, theme.palette.success[100], theme.palette.success.main, theme.palette.layer.n700, theme.palette.success.main, theme.palette.warning[100], theme.palette.warning.main, theme.palette.layer.n700, theme.palette.warning.main, theme.palette.primary[100], theme.palette.primary.main, theme.palette.layer.n700, theme.palette.primary.main, theme.palette.error.main, theme.palette.error.main, theme.palette.layer.n0, theme.palette.layer.n0, theme.palette.success.main, theme.palette.success.main, theme.palette.layer.n0, theme.palette.layer.n0, theme.palette.warning.main, theme.palette.warning.main, theme.palette.layer.n700, theme.palette.layer.n700, theme.palette.primary.main, theme.palette.primary.main, theme.palette.layer.n0, theme.palette.layer.n0);
|
|
7980
8059
|
});
|
|
7981
8060
|
var templateObject_1$n, templateObject_2$m;
|
|
7982
8061
|
|
|
@@ -9985,8 +10064,10 @@
|
|
|
9985
10064
|
var DotFileUpload = function DotFileUpload(_a) {
|
|
9986
10065
|
var accept = _a.accept,
|
|
9987
10066
|
ariaLabel = _a.ariaLabel,
|
|
9988
|
-
_b = _a.
|
|
9989
|
-
|
|
10067
|
+
_b = _a.ariaRole,
|
|
10068
|
+
ariaRole = _b === void 0 ? 'region' : _b,
|
|
10069
|
+
_c = _a.buttonOnly,
|
|
10070
|
+
buttonOnly = _c === void 0 ? false : _c,
|
|
9990
10071
|
className = _a.className,
|
|
9991
10072
|
dataTestId = _a["data-testid"],
|
|
9992
10073
|
disabled = _a.disabled,
|
|
@@ -9996,12 +10077,12 @@
|
|
|
9996
10077
|
onChange = _a.onChange,
|
|
9997
10078
|
onDragEnter = _a.onDragEnter,
|
|
9998
10079
|
onFileClick = _a.onFileClick;
|
|
9999
|
-
var
|
|
10000
|
-
uploadedFiles =
|
|
10001
|
-
setUploadedFiles =
|
|
10002
|
-
var
|
|
10003
|
-
hasMaxFilesError =
|
|
10004
|
-
setHasMaxFilesError =
|
|
10080
|
+
var _d = React.useState([]),
|
|
10081
|
+
uploadedFiles = _d[0],
|
|
10082
|
+
setUploadedFiles = _d[1];
|
|
10083
|
+
var _e = React.useState(false),
|
|
10084
|
+
hasMaxFilesError = _e[0],
|
|
10085
|
+
setHasMaxFilesError = _e[1];
|
|
10005
10086
|
var isUploadDisabled = disabled || maxFiles && uploadedFiles.length >= maxFiles;
|
|
10006
10087
|
var rootClasses = useStylesWithRootClass(rootClassName$6, className, !buttonOnly ? dropZoneClassName : '', isUploadDisabled ? 'disabled' : '');
|
|
10007
10088
|
var maxFilesClasses = useStylesWithRootClass('dot-max-files-message', hasMaxFilesError ? 'dot-max-files-reached' : '');
|
|
@@ -10026,7 +10107,7 @@
|
|
|
10026
10107
|
var onDrop = React.useCallback(function (acceptedFiles, fileRejections) {
|
|
10027
10108
|
hideFilesList ? setNewlyUploadedFiles(acceptedFiles, fileRejections) : parseFiles(acceptedFiles, fileRejections);
|
|
10028
10109
|
}, [hideFilesList, setNewlyUploadedFiles, parseFiles]);
|
|
10029
|
-
var
|
|
10110
|
+
var _f = reactDropzone.useDropzone({
|
|
10030
10111
|
accept: accept,
|
|
10031
10112
|
disabled: isUploadDisabled,
|
|
10032
10113
|
maxSize: maxSize * 1000000,
|
|
@@ -10035,10 +10116,10 @@
|
|
|
10035
10116
|
onDragEnter: onDragEnter,
|
|
10036
10117
|
onDrop: onDrop
|
|
10037
10118
|
}),
|
|
10038
|
-
getRootProps =
|
|
10039
|
-
getInputProps =
|
|
10040
|
-
isDragActive =
|
|
10041
|
-
open =
|
|
10119
|
+
getRootProps = _f.getRootProps,
|
|
10120
|
+
getInputProps = _f.getInputProps,
|
|
10121
|
+
isDragActive = _f.isDragActive,
|
|
10122
|
+
open = _f.open;
|
|
10042
10123
|
var deleteFile = function deleteFile(fileIndexToBeRemoved) {
|
|
10043
10124
|
uploadedFiles.splice(fileIndexToBeRemoved, 1);
|
|
10044
10125
|
setUploadedFiles(__spreadArray([], uploadedFiles));
|
|
@@ -10051,7 +10132,8 @@
|
|
|
10051
10132
|
uploadedFiles: uploadedFiles
|
|
10052
10133
|
});
|
|
10053
10134
|
return jsxRuntime.jsxs(StyledFileUploadContainer, __assign({
|
|
10054
|
-
className: containerClassName$2
|
|
10135
|
+
className: containerClassName$2,
|
|
10136
|
+
role: ariaRole
|
|
10055
10137
|
}, {
|
|
10056
10138
|
children: [jsxRuntime.jsxs(StyledFileUpload, __assign({}, getRootProps(), {
|
|
10057
10139
|
"aria-label": ariaLabel,
|
|
@@ -10298,6 +10380,28 @@
|
|
|
10298
10380
|
}, void 0);
|
|
10299
10381
|
};
|
|
10300
10382
|
|
|
10383
|
+
exports.DatePickerKeydownContext = void 0;
|
|
10384
|
+
(function (DatePickerKeydownContext) {
|
|
10385
|
+
DatePickerKeydownContext[DatePickerKeydownContext["Input"] = 0] = "Input";
|
|
10386
|
+
DatePickerKeydownContext[DatePickerKeydownContext["PickerButton"] = 1] = "PickerButton";
|
|
10387
|
+
DatePickerKeydownContext[DatePickerKeydownContext["Popper"] = 2] = "Popper";
|
|
10388
|
+
})(exports.DatePickerKeydownContext || (exports.DatePickerKeydownContext = {}));
|
|
10389
|
+
|
|
10390
|
+
/** This returns a `boolean` indicating whether the Day.js object contains a valid date or not. */
|
|
10391
|
+
var checkIfValidDate = function checkIfValidDate(date, format) {
|
|
10392
|
+
return dayjs__default["default"](date, format, true).isValid();
|
|
10393
|
+
};
|
|
10394
|
+
var getContextEnumBasedOnTarget = function getContextEnumBasedOnTarget(event, inputElement, contextEnum) {
|
|
10395
|
+
var targetElement = event.target;
|
|
10396
|
+
var isWithinInput = inputElement === null || inputElement === void 0 ? void 0 : inputElement.contains(targetElement);
|
|
10397
|
+
var currentContextEnum = contextEnum;
|
|
10398
|
+
// Key was captured within text field but not on the input itself
|
|
10399
|
+
if (contextEnum === exports.DatePickerKeydownContext.Input && !isWithinInput) {
|
|
10400
|
+
currentContextEnum = exports.DatePickerKeydownContext.PickerButton;
|
|
10401
|
+
}
|
|
10402
|
+
return currentContextEnum;
|
|
10403
|
+
};
|
|
10404
|
+
|
|
10301
10405
|
var rootClassName$1 = 'dot-date-picker';
|
|
10302
10406
|
var containerClassName$1 = 'dot-date-picker-container';
|
|
10303
10407
|
var rectanglePickersDayClassName = 'dot-rectangle-pickers-day';
|
|
@@ -10327,6 +10431,7 @@
|
|
|
10327
10431
|
disableRipple: true
|
|
10328
10432
|
}), void 0);
|
|
10329
10433
|
};
|
|
10434
|
+
var DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
|
|
10330
10435
|
var DotDatePicker = function DotDatePicker(_a) {
|
|
10331
10436
|
var ariaLabel = _a.ariaLabel,
|
|
10332
10437
|
_b = _a.autoFocus,
|
|
@@ -10362,6 +10467,7 @@
|
|
|
10362
10467
|
onChange = _a.onChange,
|
|
10363
10468
|
onClose = _a.onClose,
|
|
10364
10469
|
onError = _a.onError,
|
|
10470
|
+
onKeyDown = _a.onKeyDown,
|
|
10365
10471
|
onOpen = _a.onOpen,
|
|
10366
10472
|
open = _a.open,
|
|
10367
10473
|
persistentLabel = _a.persistentLabel,
|
|
@@ -10371,7 +10477,7 @@
|
|
|
10371
10477
|
required = _h === void 0 ? false : _h,
|
|
10372
10478
|
showDaysOutsideCurrentMonth = _a.showDaysOutsideCurrentMonth,
|
|
10373
10479
|
value = _a.value;
|
|
10374
|
-
var
|
|
10480
|
+
var displayFormat = format || DEFAULT_DATE_FORMAT;
|
|
10375
10481
|
var hasValueWithoutChangeHandler = value !== undefined && onChange === undefined;
|
|
10376
10482
|
var hasBothValueAndDefaultValue = value !== undefined && defaultValue !== undefined;
|
|
10377
10483
|
var isInputReadOnly = readOnly || hasValueWithoutChangeHandler || hasBothValueAndDefaultValue;
|
|
@@ -10405,14 +10511,14 @@
|
|
|
10405
10511
|
}, [locale]);
|
|
10406
10512
|
var handleChange = function handleChange(changedValue, context) {
|
|
10407
10513
|
if (!onChange || changedValue && !changedValue.isValid()) return;
|
|
10408
|
-
onChange(changedValue ? changedValue.format(
|
|
10514
|
+
onChange(changedValue ? changedValue.format(DEFAULT_DATE_FORMAT) : null, context);
|
|
10409
10515
|
};
|
|
10410
10516
|
var handleAccept = function handleAccept(changedValue) {
|
|
10411
10517
|
if (!onAccept) return;
|
|
10412
|
-
onAccept(changedValue ? changedValue.format(
|
|
10518
|
+
onAccept(changedValue ? changedValue.format(DEFAULT_DATE_FORMAT) : null);
|
|
10413
10519
|
};
|
|
10414
10520
|
var handleError = function handleError(validationError, currentValue) {
|
|
10415
|
-
return onError === null || onError === void 0 ? void 0 : onError(validationError, dayjs__default["default"](currentValue).format(
|
|
10521
|
+
return onError === null || onError === void 0 ? void 0 : onError(validationError, dayjs__default["default"](currentValue).format(DEFAULT_DATE_FORMAT));
|
|
10416
10522
|
};
|
|
10417
10523
|
var handleOpen = function handleOpen() {
|
|
10418
10524
|
if (focusInputOnPopperOpened && inputRef.current) {
|
|
@@ -10429,6 +10535,12 @@
|
|
|
10429
10535
|
}
|
|
10430
10536
|
return actionBar;
|
|
10431
10537
|
};
|
|
10538
|
+
var handleKeyDown = function handleKeyDown(contextEnum) {
|
|
10539
|
+
return function (event) {
|
|
10540
|
+
var currentContextEnum = getContextEnumBasedOnTarget(event, inputRef === null || inputRef === void 0 ? void 0 : inputRef.current, contextEnum);
|
|
10541
|
+
onKeyDown(event, currentContextEnum);
|
|
10542
|
+
};
|
|
10543
|
+
};
|
|
10432
10544
|
return jsxRuntime.jsx(StyledDatePickerContainer, __assign({
|
|
10433
10545
|
className: containerClasses,
|
|
10434
10546
|
"data-testid": dataTestId
|
|
@@ -10448,16 +10560,16 @@
|
|
|
10448
10560
|
autoFocus: autoFocus,
|
|
10449
10561
|
closeOnSelect: closeOnSelect,
|
|
10450
10562
|
className: rootClasses,
|
|
10451
|
-
defaultValue: defaultValue && dayjs__default["default"](defaultValue,
|
|
10563
|
+
defaultValue: defaultValue && dayjs__default["default"](defaultValue, DEFAULT_DATE_FORMAT),
|
|
10452
10564
|
disableOpenPicker: disableOpenPicker || isInputReadOnly || disabled,
|
|
10453
10565
|
disablePast: disablePast,
|
|
10454
10566
|
disabled: disabled,
|
|
10455
10567
|
displayWeekNumber: displayWeekNumber,
|
|
10456
10568
|
fixedWeekNumber: fixedWeekNumber,
|
|
10457
|
-
format:
|
|
10569
|
+
format: displayFormat,
|
|
10458
10570
|
label: persistentLabel ? null : label,
|
|
10459
|
-
maxDate: maxDate && dayjs__default["default"](maxDate,
|
|
10460
|
-
minDate: minDate && dayjs__default["default"](minDate,
|
|
10571
|
+
maxDate: maxDate && dayjs__default["default"](maxDate, DEFAULT_DATE_FORMAT),
|
|
10572
|
+
minDate: minDate && dayjs__default["default"](minDate, DEFAULT_DATE_FORMAT),
|
|
10461
10573
|
onAccept: handleAccept,
|
|
10462
10574
|
onChange: handleChange,
|
|
10463
10575
|
onClose: onClose,
|
|
@@ -10496,6 +10608,7 @@
|
|
|
10496
10608
|
'data-testid': 'dot-date-picker-input',
|
|
10497
10609
|
onBlur: onBlur
|
|
10498
10610
|
},
|
|
10611
|
+
onKeyDown: onKeyDown && handleKeyDown(exports.DatePickerKeydownContext.Input),
|
|
10499
10612
|
inputRef: inputRef,
|
|
10500
10613
|
fullWidth: fullWidth,
|
|
10501
10614
|
name: inputName
|
|
@@ -10507,10 +10620,11 @@
|
|
|
10507
10620
|
disableEnforceFocus: true
|
|
10508
10621
|
},
|
|
10509
10622
|
popper: {
|
|
10510
|
-
disablePortal: disablePortal
|
|
10623
|
+
disablePortal: disablePortal,
|
|
10624
|
+
onKeyDown: onKeyDown && handleKeyDown(exports.DatePickerKeydownContext.Popper)
|
|
10511
10625
|
}
|
|
10512
10626
|
},
|
|
10513
|
-
value: value && dayjs__default["default"](value,
|
|
10627
|
+
value: value && dayjs__default["default"](value, DEFAULT_DATE_FORMAT)
|
|
10514
10628
|
}, void 0)]
|
|
10515
10629
|
}), void 0)
|
|
10516
10630
|
}), void 0);
|
|
@@ -10597,6 +10711,12 @@
|
|
|
10597
10711
|
var getTimePickerButtonType = function getTimePickerButtonType(selectedDaytime) {
|
|
10598
10712
|
return selectedDaytime && selectedDaytime === exports.Daytime.PM ? 'primary' : 'text';
|
|
10599
10713
|
};
|
|
10714
|
+
var checkIfOpenPropDefined = function checkIfOpenPropDefined(open) {
|
|
10715
|
+
return open !== null && open !== undefined;
|
|
10716
|
+
};
|
|
10717
|
+
var getDaytimeButtonType = function getDaytimeButtonType(daytimeSelected) {
|
|
10718
|
+
return daytimeSelected && daytimeSelected === exports.Daytime.AM ? 'primary' : 'text';
|
|
10719
|
+
};
|
|
10600
10720
|
|
|
10601
10721
|
var rootClassName = 'dot-time-picker';
|
|
10602
10722
|
var containerClassName = 'dot-time-picker-container';
|
|
@@ -10621,12 +10741,12 @@
|
|
|
10621
10741
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
10622
10742
|
|
|
10623
10743
|
dayjs__default["default"].extend(utc__default["default"]);
|
|
10624
|
-
var DEFAULT_PICKER_TIME_FORMAT = '
|
|
10625
|
-
var DEFAULT_TIME_FORMAT = '
|
|
10744
|
+
var DEFAULT_PICKER_TIME_FORMAT = 'HH:mm';
|
|
10745
|
+
var DEFAULT_TIME_FORMAT = 'HH:mm';
|
|
10626
10746
|
var DEFAULT_TIME = '01:00';
|
|
10627
10747
|
var DotTimePicker = function DotTimePicker(_a) {
|
|
10628
10748
|
var _b = _a.ampm,
|
|
10629
|
-
ampm = _b === void 0 ?
|
|
10749
|
+
ampm = _b === void 0 ? false : _b,
|
|
10630
10750
|
ariaLabel = _a.ariaLabel,
|
|
10631
10751
|
_c = _a.autoFocus,
|
|
10632
10752
|
autoFocus = _c === void 0 ? false : _c,
|
|
@@ -10635,11 +10755,13 @@
|
|
|
10635
10755
|
defaultValue = _a.defaultValue,
|
|
10636
10756
|
_d = _a.disableOpenPicker,
|
|
10637
10757
|
disableOpenPicker = _d === void 0 ? false : _d,
|
|
10758
|
+
_e = _a.disableClickAwayListener,
|
|
10759
|
+
disableClickAwayListener = _e === void 0 ? false : _e,
|
|
10638
10760
|
disabled = _a.disabled,
|
|
10639
10761
|
error = _a.error,
|
|
10640
10762
|
format = _a.format,
|
|
10641
|
-
|
|
10642
|
-
fullWidth =
|
|
10763
|
+
_f = _a.fullWidth,
|
|
10764
|
+
fullWidth = _f === void 0 ? false : _f,
|
|
10643
10765
|
helperText = _a.helperText,
|
|
10644
10766
|
hideActionButtons = _a.hideActionButtons,
|
|
10645
10767
|
inputId = _a.inputId,
|
|
@@ -10647,32 +10769,34 @@
|
|
|
10647
10769
|
label = _a.label,
|
|
10648
10770
|
onAccept = _a.onAccept,
|
|
10649
10771
|
onBlur = _a.onBlur,
|
|
10772
|
+
onCancel = _a.onCancel,
|
|
10650
10773
|
onChange = _a.onChange,
|
|
10651
10774
|
onClose = _a.onClose,
|
|
10775
|
+
onKeyDown = _a.onKeyDown,
|
|
10652
10776
|
onOpen = _a.onOpen,
|
|
10653
10777
|
open = _a.open,
|
|
10654
10778
|
persistentLabel = _a.persistentLabel,
|
|
10655
|
-
|
|
10656
|
-
readOnly =
|
|
10657
|
-
|
|
10658
|
-
required =
|
|
10779
|
+
_g = _a.readOnly,
|
|
10780
|
+
readOnly = _g === void 0 ? false : _g,
|
|
10781
|
+
_h = _a.required,
|
|
10782
|
+
required = _h === void 0 ? false : _h,
|
|
10659
10783
|
value = _a.value;
|
|
10660
|
-
var
|
|
10784
|
+
var displayFormat = format || DEFAULT_TIME_FORMAT;
|
|
10661
10785
|
var hasValueWithoutChangeHandler = value !== undefined && onChange === undefined;
|
|
10662
10786
|
var hasBothValueAndDefaultValue = value !== undefined && defaultValue !== undefined;
|
|
10663
10787
|
var isComponentReadOnly = readOnly || hasValueWithoutChangeHandler || hasBothValueAndDefaultValue;
|
|
10664
10788
|
var rootClasses = useStylesWithRootClass(rootClassName, className, isComponentReadOnly ? 'read-only' : '');
|
|
10665
10789
|
var containerClasses = useStylesWithRootClass(containerClassName, fullWidth ? 'full-width' : '', className);
|
|
10666
10790
|
var inputRef = React.useRef(null);
|
|
10667
|
-
var
|
|
10668
|
-
isPickerOpened =
|
|
10669
|
-
setIsPickerOpened =
|
|
10670
|
-
var
|
|
10671
|
-
time =
|
|
10672
|
-
setTime =
|
|
10673
|
-
var
|
|
10674
|
-
pickerTime =
|
|
10675
|
-
setPickerTime =
|
|
10791
|
+
var _j = React.useState(false),
|
|
10792
|
+
isPickerOpened = _j[0],
|
|
10793
|
+
setIsPickerOpened = _j[1];
|
|
10794
|
+
var _k = React.useState(null),
|
|
10795
|
+
time = _k[0],
|
|
10796
|
+
setTime = _k[1];
|
|
10797
|
+
var _l = React.useState(),
|
|
10798
|
+
pickerTime = _l[0],
|
|
10799
|
+
setPickerTime = _l[1];
|
|
10676
10800
|
var hoursRef = React.useRef(null);
|
|
10677
10801
|
var minutesRef = React.useRef(null);
|
|
10678
10802
|
var daytimeRef = React.useRef(null);
|
|
@@ -10680,7 +10804,7 @@
|
|
|
10680
10804
|
var minutes = getMinutesForTimePicker();
|
|
10681
10805
|
var daytimeSelected = getSelectedDaytime(pickerTime);
|
|
10682
10806
|
var selectedPickerHour = pickerTime && calculateHourBasedOnTimeFormat(pickerTime, ampm);
|
|
10683
|
-
var isOpenPropDefined = open
|
|
10807
|
+
var isOpenPropDefined = checkIfOpenPropDefined(open);
|
|
10684
10808
|
var isControlledComponent = onChange && value !== undefined;
|
|
10685
10809
|
React.useEffect(function () {
|
|
10686
10810
|
if (hasValueWithoutChangeHandler) {
|
|
@@ -10693,9 +10817,9 @@
|
|
|
10693
10817
|
React.useEffect(function () {
|
|
10694
10818
|
var timeValue = null;
|
|
10695
10819
|
if (defaultValue) {
|
|
10696
|
-
timeValue = getDayjsUtcDate(defaultValue,
|
|
10820
|
+
timeValue = getDayjsUtcDate(defaultValue, DEFAULT_TIME_FORMAT);
|
|
10697
10821
|
} else if (value) {
|
|
10698
|
-
timeValue = getDayjsUtcDate(value,
|
|
10822
|
+
timeValue = getDayjsUtcDate(value, DEFAULT_TIME_FORMAT);
|
|
10699
10823
|
}
|
|
10700
10824
|
setTime(timeValue);
|
|
10701
10825
|
setPickerTime(timeValue);
|
|
@@ -10721,7 +10845,7 @@
|
|
|
10721
10845
|
var currentTimeValue = currentValue ? currentValue : null;
|
|
10722
10846
|
setPickerTime(currentValue ? currentValue : null);
|
|
10723
10847
|
!isControlledComponent && setTime(currentTimeValue);
|
|
10724
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(currentValue ? currentValue.format(
|
|
10848
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(currentValue ? currentValue.format(DEFAULT_TIME_FORMAT) : null, context);
|
|
10725
10849
|
};
|
|
10726
10850
|
var handleClose = function handleClose() {
|
|
10727
10851
|
!isOpenPropDefined && setIsPickerOpened(false);
|
|
@@ -10746,6 +10870,7 @@
|
|
|
10746
10870
|
};
|
|
10747
10871
|
var handleCancel = function handleCancel() {
|
|
10748
10872
|
setPickerTime(time);
|
|
10873
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
10749
10874
|
handleClose();
|
|
10750
10875
|
};
|
|
10751
10876
|
var handleSet = function handleSet() {
|
|
@@ -10754,12 +10879,18 @@
|
|
|
10754
10879
|
return;
|
|
10755
10880
|
}
|
|
10756
10881
|
setTime(pickerTime);
|
|
10757
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(pickerTime.format(
|
|
10882
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(pickerTime.format(DEFAULT_TIME_FORMAT), {
|
|
10758
10883
|
validationError: null
|
|
10759
10884
|
});
|
|
10760
|
-
onAccept === null || onAccept === void 0 ? void 0 : onAccept(pickerTime.format(
|
|
10885
|
+
onAccept === null || onAccept === void 0 ? void 0 : onAccept(pickerTime.format(DEFAULT_TIME_FORMAT));
|
|
10761
10886
|
handleClose();
|
|
10762
10887
|
};
|
|
10888
|
+
var handleKeyDown = function handleKeyDown(contextEnum) {
|
|
10889
|
+
return function (event) {
|
|
10890
|
+
var currentContextEnum = getContextEnumBasedOnTarget(event, inputRef === null || inputRef === void 0 ? void 0 : inputRef.current, contextEnum);
|
|
10891
|
+
onKeyDown(event, currentContextEnum);
|
|
10892
|
+
};
|
|
10893
|
+
};
|
|
10763
10894
|
var scrollToSelectedTime = function scrollToSelectedTime() {
|
|
10764
10895
|
if (!(hoursRef === null || hoursRef === void 0 ? void 0 : hoursRef.current) || !(minutesRef === null || minutesRef === void 0 ? void 0 : minutesRef.current)) return;
|
|
10765
10896
|
var selectedHour = calculateHourBasedOnTimeFormat(time, ampm);
|
|
@@ -10794,6 +10925,118 @@
|
|
|
10794
10925
|
if (event.key !== 'Escape' || !isPickerOpened) return;
|
|
10795
10926
|
handleCancel();
|
|
10796
10927
|
};
|
|
10928
|
+
var wrapWithClickAwayListener = function wrapWithClickAwayListener(children) {
|
|
10929
|
+
return jsxRuntime.jsx(material.ClickAwayListener, __assign({
|
|
10930
|
+
onClickAway: handleSet
|
|
10931
|
+
}, {
|
|
10932
|
+
children: children
|
|
10933
|
+
}), void 0);
|
|
10934
|
+
};
|
|
10935
|
+
var renderTimePickerHours = function renderTimePickerHours() {
|
|
10936
|
+
return hours.map(function (hour, index) {
|
|
10937
|
+
var isSelected = pickerTime ? selectedPickerHour === hour : false;
|
|
10938
|
+
return jsxRuntime.jsx(DotButton, __assign({
|
|
10939
|
+
className: "dot-picker-button",
|
|
10940
|
+
"data-testid": dataTestId && dataTestId + "-hour-button-" + hour,
|
|
10941
|
+
onClick: function () {
|
|
10942
|
+
return handleHourClick(hour);
|
|
10943
|
+
},
|
|
10944
|
+
onKeyDown: handleTimeKeydown(hoursRef, index),
|
|
10945
|
+
tabIndex: getPopperButtonTabIndex(index, isSelected, selectedPickerHour),
|
|
10946
|
+
type: isSelected ? 'primary' : 'text'
|
|
10947
|
+
}, {
|
|
10948
|
+
children: hour.toString().padStart(2, '0')
|
|
10949
|
+
}), hour);
|
|
10950
|
+
});
|
|
10951
|
+
};
|
|
10952
|
+
var renderTimePickerMinutes = function renderTimePickerMinutes() {
|
|
10953
|
+
return minutes.map(function (minute, index) {
|
|
10954
|
+
var isSelected = pickerTime ? pickerTime.minute() === minute : false;
|
|
10955
|
+
return jsxRuntime.jsx(DotButton, __assign({
|
|
10956
|
+
className: "dot-picker-button",
|
|
10957
|
+
"data-testid": dataTestId && dataTestId + "-minute-button-" + minute,
|
|
10958
|
+
type: isSelected ? 'primary' : 'text',
|
|
10959
|
+
onClick: function () {
|
|
10960
|
+
return handleMinuteClick(minute);
|
|
10961
|
+
},
|
|
10962
|
+
onKeyDown: handleTimeKeydown(minutesRef, index),
|
|
10963
|
+
tabIndex: getPopperButtonTabIndex(index, isSelected, pickerTime === null || pickerTime === void 0 ? void 0 : pickerTime.minute())
|
|
10964
|
+
}, {
|
|
10965
|
+
children: minute.toString().padStart(2, '0')
|
|
10966
|
+
}), minute);
|
|
10967
|
+
});
|
|
10968
|
+
};
|
|
10969
|
+
var renderTimePickerActionButtons = function renderTimePickerActionButtons() {
|
|
10970
|
+
return jsxRuntime.jsxs("div", __assign({
|
|
10971
|
+
className: "dot-time-picker-action-buttons"
|
|
10972
|
+
}, {
|
|
10973
|
+
children: [jsxRuntime.jsx(DotButton, __assign({
|
|
10974
|
+
"data-testid": dataTestId && dataTestId + "-cancel",
|
|
10975
|
+
onClick: handleCancel,
|
|
10976
|
+
size: "small",
|
|
10977
|
+
type: "text"
|
|
10978
|
+
}, {
|
|
10979
|
+
children: "Cancel"
|
|
10980
|
+
}), void 0), jsxRuntime.jsx(DotButton, __assign({
|
|
10981
|
+
"data-testid": dataTestId && dataTestId + "-set",
|
|
10982
|
+
onClick: handleSet,
|
|
10983
|
+
size: "small",
|
|
10984
|
+
type: "text"
|
|
10985
|
+
}, {
|
|
10986
|
+
children: "Set"
|
|
10987
|
+
}), void 0)]
|
|
10988
|
+
}), void 0);
|
|
10989
|
+
};
|
|
10990
|
+
var renderDaytime = function renderDaytime() {
|
|
10991
|
+
return jsxRuntime.jsxs("div", __assign({
|
|
10992
|
+
className: "dot-time-picker-daytime",
|
|
10993
|
+
ref: daytimeRef
|
|
10994
|
+
}, {
|
|
10995
|
+
children: [jsxRuntime.jsx(DotButton, __assign({
|
|
10996
|
+
className: "dot-picker-button",
|
|
10997
|
+
"data-testid": dataTestId && dataTestId + "-am-button",
|
|
10998
|
+
onClick: function () {
|
|
10999
|
+
return handleDaytimeSelection(exports.Daytime.AM);
|
|
11000
|
+
},
|
|
11001
|
+
onKeyDown: handleTimeKeydown(daytimeRef, 0),
|
|
11002
|
+
tabIndex: getDaytimeButtonTabIndex(exports.Daytime.AM, daytimeSelected),
|
|
11003
|
+
type: getDaytimeButtonType(daytimeSelected)
|
|
11004
|
+
}, {
|
|
11005
|
+
children: exports.Daytime.AM
|
|
11006
|
+
}), exports.Daytime.AM), jsxRuntime.jsx(DotButton, __assign({
|
|
11007
|
+
className: "dot-picker-button",
|
|
11008
|
+
"data-testid": dataTestId && dataTestId + "-pm-button",
|
|
11009
|
+
onClick: function () {
|
|
11010
|
+
return handleDaytimeSelection(exports.Daytime.PM);
|
|
11011
|
+
},
|
|
11012
|
+
onKeyDown: handleTimeKeydown(daytimeRef, 1),
|
|
11013
|
+
tabIndex: getDaytimeButtonTabIndex(exports.Daytime.PM, daytimeSelected),
|
|
11014
|
+
type: getTimePickerButtonType(daytimeSelected)
|
|
11015
|
+
}, {
|
|
11016
|
+
children: exports.Daytime.PM
|
|
11017
|
+
}), exports.Daytime.PM)]
|
|
11018
|
+
}), void 0);
|
|
11019
|
+
};
|
|
11020
|
+
var paperComponent = jsxRuntime.jsxs(material.Paper, __assign({
|
|
11021
|
+
className: "dot-time-picker-paper",
|
|
11022
|
+
elevation: 8
|
|
11023
|
+
}, {
|
|
11024
|
+
children: [jsxRuntime.jsxs("div", __assign({
|
|
11025
|
+
className: "dot-time-picker-selection"
|
|
11026
|
+
}, {
|
|
11027
|
+
children: [jsxRuntime.jsx("div", __assign({
|
|
11028
|
+
className: "dot-time-picker-hours",
|
|
11029
|
+
ref: hoursRef
|
|
11030
|
+
}, {
|
|
11031
|
+
children: renderTimePickerHours()
|
|
11032
|
+
}), void 0), jsxRuntime.jsx("div", __assign({
|
|
11033
|
+
className: "dot-time-picker-minutes",
|
|
11034
|
+
ref: minutesRef
|
|
11035
|
+
}, {
|
|
11036
|
+
children: renderTimePickerMinutes()
|
|
11037
|
+
}), void 0), ampm && renderDaytime()]
|
|
11038
|
+
}), void 0), !hideActionButtons && renderTimePickerActionButtons()]
|
|
11039
|
+
}), void 0);
|
|
10797
11040
|
return jsxRuntime.jsxs(StyledTimePickerContainer, __assign({
|
|
10798
11041
|
className: containerClasses,
|
|
10799
11042
|
"data-testid": dataTestId,
|
|
@@ -10815,7 +11058,7 @@
|
|
|
10815
11058
|
autoFocus: autoFocus,
|
|
10816
11059
|
className: rootClasses,
|
|
10817
11060
|
disabled: disabled,
|
|
10818
|
-
format:
|
|
11061
|
+
format: displayFormat,
|
|
10819
11062
|
inputRef: inputRef,
|
|
10820
11063
|
label: persistentLabel ? null : label,
|
|
10821
11064
|
onChange: handleInputChange,
|
|
@@ -10847,7 +11090,8 @@
|
|
|
10847
11090
|
onBlur: onBlur
|
|
10848
11091
|
},
|
|
10849
11092
|
fullWidth: fullWidth,
|
|
10850
|
-
name: inputName
|
|
11093
|
+
name: inputName,
|
|
11094
|
+
onKeyDown: onKeyDown && handleKeyDown(exports.DatePickerKeydownContext.Input)
|
|
10851
11095
|
},
|
|
10852
11096
|
field: {
|
|
10853
11097
|
readOnly: isComponentReadOnly
|
|
@@ -10861,105 +11105,10 @@
|
|
|
10861
11105
|
"data-testid": dataTestId && dataTestId + "-popper",
|
|
10862
11106
|
disablePortal: true,
|
|
10863
11107
|
open: isPickerOpened,
|
|
11108
|
+
onKeyDown: onKeyDown && handleKeyDown(exports.DatePickerKeydownContext.Popper),
|
|
10864
11109
|
placement: "bottom-start"
|
|
10865
11110
|
}, {
|
|
10866
|
-
children:
|
|
10867
|
-
onClickAway: handleSet
|
|
10868
|
-
}, {
|
|
10869
|
-
children: jsxRuntime.jsxs(material.Paper, __assign({
|
|
10870
|
-
className: "dot-time-picker-paper",
|
|
10871
|
-
elevation: 8
|
|
10872
|
-
}, {
|
|
10873
|
-
children: [jsxRuntime.jsxs("div", __assign({
|
|
10874
|
-
className: "dot-time-picker-selection"
|
|
10875
|
-
}, {
|
|
10876
|
-
children: [jsxRuntime.jsx("div", __assign({
|
|
10877
|
-
className: "dot-time-picker-hours",
|
|
10878
|
-
ref: hoursRef
|
|
10879
|
-
}, {
|
|
10880
|
-
children: hours.map(function (hour, index) {
|
|
10881
|
-
var isSelected = pickerTime ? selectedPickerHour === hour : false;
|
|
10882
|
-
return jsxRuntime.jsx(DotButton, __assign({
|
|
10883
|
-
className: "dot-picker-button",
|
|
10884
|
-
"data-testid": dataTestId && dataTestId + "-hour-button-" + hour,
|
|
10885
|
-
onClick: function () {
|
|
10886
|
-
return handleHourClick(hour);
|
|
10887
|
-
},
|
|
10888
|
-
onKeyDown: handleTimeKeydown(hoursRef, index),
|
|
10889
|
-
tabIndex: getPopperButtonTabIndex(index, isSelected, selectedPickerHour),
|
|
10890
|
-
type: isSelected ? 'primary' : 'text'
|
|
10891
|
-
}, {
|
|
10892
|
-
children: hour.toString().padStart(2, '0')
|
|
10893
|
-
}), hour);
|
|
10894
|
-
})
|
|
10895
|
-
}), void 0), jsxRuntime.jsx("div", __assign({
|
|
10896
|
-
className: "dot-time-picker-minutes",
|
|
10897
|
-
ref: minutesRef
|
|
10898
|
-
}, {
|
|
10899
|
-
children: minutes.map(function (minute, index) {
|
|
10900
|
-
var isSelected = pickerTime ? pickerTime.minute() === minute : false;
|
|
10901
|
-
return jsxRuntime.jsx(DotButton, __assign({
|
|
10902
|
-
className: "dot-picker-button",
|
|
10903
|
-
"data-testid": dataTestId && dataTestId + "-minute-button-" + minute,
|
|
10904
|
-
type: isSelected ? 'primary' : 'text',
|
|
10905
|
-
onClick: function () {
|
|
10906
|
-
return handleMinuteClick(minute);
|
|
10907
|
-
},
|
|
10908
|
-
onKeyDown: handleTimeKeydown(minutesRef, index),
|
|
10909
|
-
tabIndex: getPopperButtonTabIndex(index, isSelected, pickerTime === null || pickerTime === void 0 ? void 0 : pickerTime.minute())
|
|
10910
|
-
}, {
|
|
10911
|
-
children: minute.toString().padStart(2, '0')
|
|
10912
|
-
}), minute);
|
|
10913
|
-
})
|
|
10914
|
-
}), void 0), ampm && jsxRuntime.jsxs("div", __assign({
|
|
10915
|
-
className: "dot-time-picker-daytime",
|
|
10916
|
-
ref: daytimeRef
|
|
10917
|
-
}, {
|
|
10918
|
-
children: [jsxRuntime.jsx(DotButton, __assign({
|
|
10919
|
-
className: "dot-picker-button",
|
|
10920
|
-
"data-testid": dataTestId && dataTestId + "-am-button",
|
|
10921
|
-
onClick: function () {
|
|
10922
|
-
return handleDaytimeSelection(exports.Daytime.AM);
|
|
10923
|
-
},
|
|
10924
|
-
onKeyDown: handleTimeKeydown(daytimeRef, 0),
|
|
10925
|
-
tabIndex: getDaytimeButtonTabIndex(exports.Daytime.AM, daytimeSelected),
|
|
10926
|
-
type: daytimeSelected && daytimeSelected === exports.Daytime.AM ? 'primary' : 'text'
|
|
10927
|
-
}, {
|
|
10928
|
-
children: exports.Daytime.AM
|
|
10929
|
-
}), exports.Daytime.AM), jsxRuntime.jsx(DotButton, __assign({
|
|
10930
|
-
className: "dot-picker-button",
|
|
10931
|
-
"data-testid": dataTestId && dataTestId + "-pm-button",
|
|
10932
|
-
onClick: function () {
|
|
10933
|
-
return handleDaytimeSelection(exports.Daytime.PM);
|
|
10934
|
-
},
|
|
10935
|
-
onKeyDown: handleTimeKeydown(daytimeRef, 1),
|
|
10936
|
-
tabIndex: getDaytimeButtonTabIndex(exports.Daytime.PM, daytimeSelected),
|
|
10937
|
-
type: getTimePickerButtonType(daytimeSelected)
|
|
10938
|
-
}, {
|
|
10939
|
-
children: exports.Daytime.PM
|
|
10940
|
-
}), exports.Daytime.PM)]
|
|
10941
|
-
}), void 0)]
|
|
10942
|
-
}), void 0), !hideActionButtons && jsxRuntime.jsxs("div", __assign({
|
|
10943
|
-
className: "dot-time-picker-action-buttons"
|
|
10944
|
-
}, {
|
|
10945
|
-
children: [jsxRuntime.jsx(DotButton, __assign({
|
|
10946
|
-
"data-testid": dataTestId && dataTestId + "-cancel",
|
|
10947
|
-
onClick: handleCancel,
|
|
10948
|
-
size: "small",
|
|
10949
|
-
type: "text"
|
|
10950
|
-
}, {
|
|
10951
|
-
children: "Cancel"
|
|
10952
|
-
}), void 0), jsxRuntime.jsx(DotButton, __assign({
|
|
10953
|
-
"data-testid": dataTestId && dataTestId + "-set",
|
|
10954
|
-
onClick: handleSet,
|
|
10955
|
-
size: "small",
|
|
10956
|
-
type: "text"
|
|
10957
|
-
}, {
|
|
10958
|
-
children: "Set"
|
|
10959
|
-
}), void 0)]
|
|
10960
|
-
}), void 0)]
|
|
10961
|
-
}), void 0)
|
|
10962
|
-
}), void 0)
|
|
11111
|
+
children: disableClickAwayListener ? paperComponent : wrapWithClickAwayListener(paperComponent)
|
|
10963
11112
|
}), void 0)]
|
|
10964
11113
|
}), void 0);
|
|
10965
11114
|
};
|
|
@@ -11052,6 +11201,7 @@
|
|
|
11052
11201
|
exports.DotTruncateWithTooltip = DotTruncateWithTooltip;
|
|
11053
11202
|
exports.DotTypography = DotTypography;
|
|
11054
11203
|
exports.avatarColors = avatarColors;
|
|
11204
|
+
exports.checkIfValidDate = checkIfValidDate;
|
|
11055
11205
|
exports.lightColors = lightThemeColors;
|
|
11056
11206
|
exports.mockScrollIntoView = mockScrollIntoView;
|
|
11057
11207
|
exports.parseAutoCompleteValue = parseAutoCompleteValue;
|