@lumx/react 3.18.1 → 3.18.2-alpha.1
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/_internal/index.js +236 -0
- package/_internal/index.js.map +1 -0
- package/index.d.ts +13 -8
- package/index.js +219 -226
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/autocomplete/Autocomplete.tsx +5 -4
- package/src/components/autocomplete/AutocompleteMultiple.tsx +5 -3
- package/src/components/button/Button.stories.tsx +1 -0
- package/src/components/button/Button.test.tsx +41 -2
- package/src/components/button/ButtonRoot.tsx +10 -11
- package/src/components/checkbox/Checkbox.stories.tsx +13 -2
- package/src/components/checkbox/Checkbox.test.tsx +29 -0
- package/src/components/checkbox/Checkbox.tsx +8 -7
- package/src/components/chip/Chip.stories.tsx +17 -0
- package/src/components/chip/Chip.test.tsx +44 -0
- package/src/components/chip/Chip.tsx +10 -9
- package/src/components/date-picker/DatePickerField.stories.tsx +18 -0
- package/src/components/date-picker/DatePickerField.tsx +4 -4
- package/src/components/link/Link.stories.tsx +4 -1
- package/src/components/link/Link.test.tsx +45 -6
- package/src/components/link/Link.tsx +7 -6
- package/src/components/list/ListItem.stories.tsx +14 -48
- package/src/components/list/ListItem.test.tsx +78 -7
- package/src/components/list/ListItem.tsx +11 -9
- package/src/components/progress-tracker/ProgressTrackerStep.tsx +7 -7
- package/src/components/radio-button/RadioButton.stories.tsx +32 -0
- package/src/components/radio-button/RadioButton.test.tsx +30 -0
- package/src/components/radio-button/RadioButton.tsx +8 -7
- package/src/components/slider/Slider.tsx +6 -7
- package/src/components/switch/Switch.stories.tsx +11 -1
- package/src/components/switch/Switch.test.tsx +30 -0
- package/src/components/switch/Switch.tsx +8 -7
- package/src/components/table/TableRow.tsx +8 -6
- package/src/components/tabs/Tab.tsx +12 -9
- package/src/components/text-field/TextField.stories.tsx +22 -0
- package/src/components/text-field/TextField.test.tsx +56 -0
- package/src/components/text-field/TextField.tsx +12 -10
- package/src/utils/disabled/DisabledStateContext.tsx +29 -0
- package/src/utils/disabled/DisabledStateProvider.stories.tsx +88 -0
- package/src/utils/disabled/index.ts +2 -0
- package/src/utils/disabled/useDisableStateProps.tsx +37 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/type/HasAriaDisabled.ts +6 -0
- package/utils/index.d.ts +20 -1
- package/utils/index.js +1 -134
- package/utils/index.js.map +1 -1
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as _objectSpread2, a as _objectWithoutProperties, b as _extends, u as useDisabledStateContext, P as Portal, C as ClickAwayProvider } from './_internal/index.js';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import React__default, { useState, useEffect, useMemo, useRef, useCallback, Children, isValidElement, cloneElement, useLayoutEffect, createContext, useContext, useReducer } from 'react';
|
|
3
4
|
import isBoolean from 'lodash/isBoolean';
|
|
@@ -11,7 +12,6 @@ import concat from 'lodash/concat';
|
|
|
11
12
|
import dropRight from 'lodash/dropRight';
|
|
12
13
|
import partition from 'lodash/partition';
|
|
13
14
|
import reduce from 'lodash/reduce';
|
|
14
|
-
import { Portal, ClickAwayProvider } from './utils/index.js';
|
|
15
15
|
import memoize from 'lodash/memoize';
|
|
16
16
|
import isFunction from 'lodash/isFunction';
|
|
17
17
|
import castArray from 'lodash/castArray';
|
|
@@ -25,79 +25,6 @@ import take from 'lodash/take';
|
|
|
25
25
|
import isObject from 'lodash/isObject';
|
|
26
26
|
import set from 'lodash/set';
|
|
27
27
|
|
|
28
|
-
function _defineProperty(e, r, t) {
|
|
29
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
30
|
-
value: t,
|
|
31
|
-
enumerable: !0,
|
|
32
|
-
configurable: !0,
|
|
33
|
-
writable: !0
|
|
34
|
-
}) : e[r] = t, e;
|
|
35
|
-
}
|
|
36
|
-
function _extends() {
|
|
37
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
38
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
39
|
-
var t = arguments[e];
|
|
40
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
41
|
-
}
|
|
42
|
-
return n;
|
|
43
|
-
}, _extends.apply(null, arguments);
|
|
44
|
-
}
|
|
45
|
-
function ownKeys(e, r) {
|
|
46
|
-
var t = Object.keys(e);
|
|
47
|
-
if (Object.getOwnPropertySymbols) {
|
|
48
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
49
|
-
r && (o = o.filter(function (r) {
|
|
50
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
51
|
-
})), t.push.apply(t, o);
|
|
52
|
-
}
|
|
53
|
-
return t;
|
|
54
|
-
}
|
|
55
|
-
function _objectSpread2(e) {
|
|
56
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
57
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
58
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
59
|
-
_defineProperty(e, r, t[r]);
|
|
60
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
61
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return e;
|
|
65
|
-
}
|
|
66
|
-
function _objectWithoutProperties(e, t) {
|
|
67
|
-
if (null == e) return {};
|
|
68
|
-
var o,
|
|
69
|
-
r,
|
|
70
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
71
|
-
if (Object.getOwnPropertySymbols) {
|
|
72
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
73
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
74
|
-
}
|
|
75
|
-
return i;
|
|
76
|
-
}
|
|
77
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
78
|
-
if (null == r) return {};
|
|
79
|
-
var t = {};
|
|
80
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
81
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
82
|
-
t[n] = r[n];
|
|
83
|
-
}
|
|
84
|
-
return t;
|
|
85
|
-
}
|
|
86
|
-
function _toPrimitive(t, r) {
|
|
87
|
-
if ("object" != typeof t || !t) return t;
|
|
88
|
-
var e = t[Symbol.toPrimitive];
|
|
89
|
-
if (void 0 !== e) {
|
|
90
|
-
var i = e.call(t, r || "default");
|
|
91
|
-
if ("object" != typeof i) return i;
|
|
92
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
93
|
-
}
|
|
94
|
-
return ("string" === r ? String : Number)(t);
|
|
95
|
-
}
|
|
96
|
-
function _toPropertyKey(t) {
|
|
97
|
-
var i = _toPrimitive(t, "string");
|
|
98
|
-
return "symbol" == typeof i ? i : i + "";
|
|
99
|
-
}
|
|
100
|
-
|
|
101
28
|
/**
|
|
102
29
|
* See SCSS variable $lumx-color-palette
|
|
103
30
|
*/
|
|
@@ -360,7 +287,7 @@ const mdiRadioboxBlank = 'M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0
|
|
|
360
287
|
|
|
361
288
|
const mdiRadioboxMarked = 'M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 5a5 5 0 0 0-5 5 5 5 0 0 0 5 5 5 5 0 0 0 5-5 5 5 0 0 0-5-5';
|
|
362
289
|
|
|
363
|
-
const _excluded$
|
|
290
|
+
const _excluded$1u = ["prefix"];
|
|
364
291
|
|
|
365
292
|
/**
|
|
366
293
|
* Enhance isEmpty method to also works with numbers.
|
|
@@ -417,7 +344,7 @@ function handleBasicClasses(_ref) {
|
|
|
417
344
|
let {
|
|
418
345
|
prefix
|
|
419
346
|
} = _ref,
|
|
420
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
347
|
+
props = _objectWithoutProperties(_ref, _excluded$1u);
|
|
421
348
|
const otherClasses = {};
|
|
422
349
|
if (!isEmpty(props)) {
|
|
423
350
|
Object.keys(props).forEach(prop => {
|
|
@@ -651,7 +578,7 @@ function useId() {
|
|
|
651
578
|
*/
|
|
652
579
|
const forwardRef = React__default.forwardRef;
|
|
653
580
|
|
|
654
|
-
const _excluded$
|
|
581
|
+
const _excluded$1t = ["id", "title", "className", "cancelProps", "confirmProps", "kind", "size", "dialogProps", "children"],
|
|
655
582
|
_excluded2$3 = ["label", "onClick"],
|
|
656
583
|
_excluded3 = ["label", "onClick"];
|
|
657
584
|
/**
|
|
@@ -715,7 +642,7 @@ const AlertDialog = forwardRef((props, ref) => {
|
|
|
715
642
|
dialogProps,
|
|
716
643
|
children
|
|
717
644
|
} = props,
|
|
718
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
645
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$1t);
|
|
719
646
|
const cancelButtonRef = React__default.useRef(null);
|
|
720
647
|
const confirmationButtonRef = React__default.useRef(null);
|
|
721
648
|
const {
|
|
@@ -842,7 +769,40 @@ function useTheme() {
|
|
|
842
769
|
return React__default.useContext(ThemeContext);
|
|
843
770
|
}
|
|
844
771
|
|
|
845
|
-
const _excluded$
|
|
772
|
+
const _excluded$1s = ["disabled", "isDisabled", "aria-disabled", "onClick", "onChange"];
|
|
773
|
+
/**
|
|
774
|
+
* Resolve disabled state from props.
|
|
775
|
+
* (handles `disabled`, `isDisabled` and `aria-disabled`)
|
|
776
|
+
*
|
|
777
|
+
* @params component props
|
|
778
|
+
*/
|
|
779
|
+
function useDisableStateProps(props) {
|
|
780
|
+
const {
|
|
781
|
+
disabled,
|
|
782
|
+
isDisabled = disabled,
|
|
783
|
+
'aria-disabled': ariaDisabled,
|
|
784
|
+
onClick,
|
|
785
|
+
onChange
|
|
786
|
+
} = props,
|
|
787
|
+
otherProps = _objectWithoutProperties(props, _excluded$1s);
|
|
788
|
+
const disabledStateContext = useDisabledStateContext();
|
|
789
|
+
const disabledStateProps = {
|
|
790
|
+
disabled: (disabledStateContext === null || disabledStateContext === void 0 ? void 0 : disabledStateContext.state) === 'disabled' || isDisabled,
|
|
791
|
+
'aria-disabled': ariaDisabled === true || ariaDisabled === 'true'
|
|
792
|
+
};
|
|
793
|
+
const isAnyDisabled = disabledStateProps['aria-disabled'] || disabledStateProps.disabled;
|
|
794
|
+
if (!isAnyDisabled) {
|
|
795
|
+
otherProps.onClick = onClick;
|
|
796
|
+
otherProps.onChange = onChange;
|
|
797
|
+
}
|
|
798
|
+
return {
|
|
799
|
+
disabledStateProps,
|
|
800
|
+
otherProps: otherProps,
|
|
801
|
+
isAnyDisabled
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
const _excluded$1r = ["anchorToInput", "children", "chips", "className", "closeOnClick", "closeOnClickAway", "closeOnEscape", "error", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClose", "onFocus", "onInfiniteScroll", "placeholder", "placement", "shouldFocusOnClose", "theme", "value", "textFieldProps", "focusAnchorOnClose"];
|
|
846
806
|
|
|
847
807
|
/**
|
|
848
808
|
* Defines the props of the component.
|
|
@@ -878,6 +838,10 @@ const DEFAULT_PROPS$12 = {
|
|
|
878
838
|
*/
|
|
879
839
|
const Autocomplete = forwardRef((props, ref) => {
|
|
880
840
|
const defaultTheme = useTheme();
|
|
841
|
+
const {
|
|
842
|
+
disabledStateProps,
|
|
843
|
+
otherProps
|
|
844
|
+
} = useDisableStateProps(props);
|
|
881
845
|
const {
|
|
882
846
|
anchorToInput = DEFAULT_PROPS$12.anchorToInput,
|
|
883
847
|
children,
|
|
@@ -886,7 +850,6 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
886
850
|
closeOnClick = DEFAULT_PROPS$12.closeOnClick,
|
|
887
851
|
closeOnClickAway = DEFAULT_PROPS$12.closeOnClickAway,
|
|
888
852
|
closeOnEscape = DEFAULT_PROPS$12.closeOnEscape,
|
|
889
|
-
disabled,
|
|
890
853
|
error,
|
|
891
854
|
fitToAnchorWidth,
|
|
892
855
|
hasError,
|
|
@@ -894,7 +857,6 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
894
857
|
icon,
|
|
895
858
|
inputRef,
|
|
896
859
|
clearButtonProps,
|
|
897
|
-
isDisabled = disabled,
|
|
898
860
|
isRequired,
|
|
899
861
|
isOpen,
|
|
900
862
|
isValid,
|
|
@@ -913,8 +875,8 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
913
875
|
value,
|
|
914
876
|
textFieldProps = {},
|
|
915
877
|
focusAnchorOnClose
|
|
916
|
-
} =
|
|
917
|
-
forwardedProps = _objectWithoutProperties(
|
|
878
|
+
} = otherProps,
|
|
879
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$1r);
|
|
918
880
|
const inputAnchorRef = useRef(null);
|
|
919
881
|
const textFieldRef = useRef(null);
|
|
920
882
|
useFocus(inputAnchorRef.current, !isOpen && shouldFocusOnClose);
|
|
@@ -929,8 +891,8 @@ const Autocomplete = forwardRef((props, ref) => {
|
|
|
929
891
|
helper: helper,
|
|
930
892
|
icon: icon,
|
|
931
893
|
inputRef: mergeRefs(inputAnchorRef, inputRef),
|
|
932
|
-
clearButtonProps: clearButtonProps
|
|
933
|
-
|
|
894
|
+
clearButtonProps: clearButtonProps
|
|
895
|
+
}, disabledStateProps, {
|
|
934
896
|
isRequired: isRequired,
|
|
935
897
|
isValid: isValid,
|
|
936
898
|
label: label,
|
|
@@ -962,7 +924,7 @@ Autocomplete.displayName = COMPONENT_NAME$1m;
|
|
|
962
924
|
Autocomplete.className = CLASSNAME$1j;
|
|
963
925
|
Autocomplete.defaultProps = DEFAULT_PROPS$12;
|
|
964
926
|
|
|
965
|
-
const _excluded$1q = ["anchorToInput", "children", "chipsAlignment", "className", "closeOnClickAway", "closeOnEscape", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "
|
|
927
|
+
const _excluded$1q = ["anchorToInput", "children", "chipsAlignment", "className", "closeOnClickAway", "closeOnEscape", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClear", "onClose", "onFocus", "onInfiniteScroll", "onKeyDown", "placeholder", "placement", "selectedChipRender", "shouldFocusOnClose", "theme", "type", "value", "values"];
|
|
966
928
|
|
|
967
929
|
/**
|
|
968
930
|
* Defines the props of the component.
|
|
@@ -1010,6 +972,10 @@ const DEFAULT_PROPS$11 = {
|
|
|
1010
972
|
*/
|
|
1011
973
|
const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
1012
974
|
const defaultTheme = useTheme();
|
|
975
|
+
const {
|
|
976
|
+
disabledStateProps,
|
|
977
|
+
otherProps
|
|
978
|
+
} = useDisableStateProps(props);
|
|
1013
979
|
const {
|
|
1014
980
|
anchorToInput,
|
|
1015
981
|
children,
|
|
@@ -1025,7 +991,6 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
1025
991
|
icon,
|
|
1026
992
|
inputRef,
|
|
1027
993
|
clearButtonProps,
|
|
1028
|
-
isDisabled,
|
|
1029
994
|
isRequired,
|
|
1030
995
|
isOpen,
|
|
1031
996
|
isValid,
|
|
@@ -1047,8 +1012,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
1047
1012
|
type,
|
|
1048
1013
|
value,
|
|
1049
1014
|
values = DEFAULT_PROPS$11.values
|
|
1050
|
-
} =
|
|
1051
|
-
forwardedProps = _objectWithoutProperties(
|
|
1015
|
+
} = otherProps,
|
|
1016
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$1q);
|
|
1052
1017
|
return /*#__PURE__*/React__default.createElement(Autocomplete, _extends({
|
|
1053
1018
|
ref: ref
|
|
1054
1019
|
}, forwardedProps, {
|
|
@@ -1065,8 +1030,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
|
|
|
1065
1030
|
helper: helper,
|
|
1066
1031
|
icon: icon,
|
|
1067
1032
|
inputRef: inputRef,
|
|
1068
|
-
chips: values && values.map((chip, index) => selectedChipRender === null || selectedChipRender === void 0 ? void 0 : selectedChipRender(chip, index, onClear))
|
|
1069
|
-
|
|
1033
|
+
chips: values && values.map((chip, index) => selectedChipRender === null || selectedChipRender === void 0 ? void 0 : selectedChipRender(chip, index, onClear))
|
|
1034
|
+
}, disabledStateProps, {
|
|
1070
1035
|
isRequired: isRequired,
|
|
1071
1036
|
clearButtonProps: clearButtonProps,
|
|
1072
1037
|
isValid: isValid,
|
|
@@ -1307,7 +1272,7 @@ const renderLink = (_ref, ...children) => {
|
|
|
1307
1272
|
return /*#__PURE__*/React__default.createElement(linkAs || 'a', forwardedProps, ...children);
|
|
1308
1273
|
};
|
|
1309
1274
|
|
|
1310
|
-
const _excluded$1l = ["aria-label", "children", "className", "color", "
|
|
1275
|
+
const _excluded$1l = ["aria-label", "children", "className", "color", "emphasis", "hasBackground", "href", "isSelected", "isActive", "isFocused", "isHovered", "linkAs", "name", "size", "target", "theme", "variant", "type", "fullWidth"];
|
|
1311
1276
|
|
|
1312
1277
|
/**
|
|
1313
1278
|
* Button size definition.
|
|
@@ -1356,17 +1321,19 @@ const renderButtonWrapper = props => {
|
|
|
1356
1321
|
* @return React element.
|
|
1357
1322
|
*/
|
|
1358
1323
|
const ButtonRoot = forwardRef((props, ref) => {
|
|
1324
|
+
const {
|
|
1325
|
+
isAnyDisabled,
|
|
1326
|
+
disabledStateProps,
|
|
1327
|
+
otherProps
|
|
1328
|
+
} = useDisableStateProps(props);
|
|
1359
1329
|
const {
|
|
1360
1330
|
'aria-label': ariaLabel,
|
|
1361
1331
|
children,
|
|
1362
1332
|
className,
|
|
1363
1333
|
color,
|
|
1364
|
-
disabled,
|
|
1365
1334
|
emphasis,
|
|
1366
1335
|
hasBackground,
|
|
1367
1336
|
href,
|
|
1368
|
-
isDisabled = disabled,
|
|
1369
|
-
'aria-disabled': ariaDisabled = isDisabled,
|
|
1370
1337
|
isSelected,
|
|
1371
1338
|
isActive,
|
|
1372
1339
|
isFocused,
|
|
@@ -1379,8 +1346,8 @@ const ButtonRoot = forwardRef((props, ref) => {
|
|
|
1379
1346
|
variant,
|
|
1380
1347
|
type = 'button',
|
|
1381
1348
|
fullWidth
|
|
1382
|
-
} =
|
|
1383
|
-
forwardedProps = _objectWithoutProperties(
|
|
1349
|
+
} = otherProps,
|
|
1350
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$1l);
|
|
1384
1351
|
const adaptedColor = color || emphasis !== Emphasis.high && theme === Theme.dark && ColorPalette.light || emphasis === Emphasis.high && ColorPalette.primary || ColorPalette.dark;
|
|
1385
1352
|
if (hasBackground) {
|
|
1386
1353
|
return renderButtonWrapper(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -1393,7 +1360,7 @@ const ButtonRoot = forwardRef((props, ref) => {
|
|
|
1393
1360
|
color: adaptedColor,
|
|
1394
1361
|
emphasis,
|
|
1395
1362
|
isSelected,
|
|
1396
|
-
isDisabled,
|
|
1363
|
+
isDisabled: isAnyDisabled,
|
|
1397
1364
|
isActive,
|
|
1398
1365
|
isFocused,
|
|
1399
1366
|
isHovered,
|
|
@@ -1410,7 +1377,7 @@ const ButtonRoot = forwardRef((props, ref) => {
|
|
|
1410
1377
|
*
|
|
1411
1378
|
* However, in any case, if the component is disabled, we returned a <button> since disabled is not compatible with <a>.
|
|
1412
1379
|
*/
|
|
1413
|
-
if ((linkAs || !isEmpty(props.href)) && !
|
|
1380
|
+
if ((linkAs || !isEmpty(props.href)) && !isAnyDisabled) {
|
|
1414
1381
|
return renderLink(_objectSpread2(_objectSpread2({
|
|
1415
1382
|
linkAs
|
|
1416
1383
|
}, forwardedProps), {}, {
|
|
@@ -1421,11 +1388,7 @@ const ButtonRoot = forwardRef((props, ref) => {
|
|
|
1421
1388
|
ref: ref
|
|
1422
1389
|
}), children);
|
|
1423
1390
|
}
|
|
1424
|
-
return /*#__PURE__*/React__default.createElement("button", _extends({}, forwardedProps,
|
|
1425
|
-
onClick: undefined
|
|
1426
|
-
} : undefined, {
|
|
1427
|
-
disabled: isDisabled,
|
|
1428
|
-
"aria-disabled": ariaDisabled,
|
|
1391
|
+
return /*#__PURE__*/React__default.createElement("button", _extends({}, forwardedProps, disabledStateProps, {
|
|
1429
1392
|
"aria-label": ariaLabel,
|
|
1430
1393
|
ref: ref,
|
|
1431
1394
|
className: buttonClassName,
|
|
@@ -1633,8 +1596,7 @@ ButtonGroup.displayName = COMPONENT_NAME$1e;
|
|
|
1633
1596
|
ButtonGroup.className = CLASSNAME$1c;
|
|
1634
1597
|
ButtonGroup.defaultProps = DEFAULT_PROPS$Y;
|
|
1635
1598
|
|
|
1636
|
-
const _excluded$1h = ["checked", "className", "
|
|
1637
|
-
|
|
1599
|
+
const _excluded$1h = ["checked", "className", "helper", "id", "inputRef", "isChecked", "label", "name", "onChange", "theme", "value", "inputProps"];
|
|
1638
1600
|
/**
|
|
1639
1601
|
* Intermediate state of checkbox.
|
|
1640
1602
|
*/
|
|
@@ -1667,24 +1629,27 @@ const DEFAULT_PROPS$X = {};
|
|
|
1667
1629
|
* @return React element.
|
|
1668
1630
|
*/
|
|
1669
1631
|
const Checkbox = forwardRef((props, ref) => {
|
|
1632
|
+
const {
|
|
1633
|
+
isAnyDisabled,
|
|
1634
|
+
disabledStateProps,
|
|
1635
|
+
otherProps
|
|
1636
|
+
} = useDisableStateProps(props);
|
|
1670
1637
|
const defaultTheme = useTheme() || Theme.light;
|
|
1671
1638
|
const {
|
|
1672
1639
|
checked,
|
|
1673
1640
|
className,
|
|
1674
|
-
disabled,
|
|
1675
1641
|
helper,
|
|
1676
1642
|
id,
|
|
1677
1643
|
inputRef,
|
|
1678
1644
|
isChecked = checked,
|
|
1679
|
-
isDisabled = disabled,
|
|
1680
1645
|
label,
|
|
1681
1646
|
name,
|
|
1682
1647
|
onChange,
|
|
1683
1648
|
theme = defaultTheme,
|
|
1684
1649
|
value,
|
|
1685
1650
|
inputProps = {}
|
|
1686
|
-
} =
|
|
1687
|
-
forwardedProps = _objectWithoutProperties(
|
|
1651
|
+
} = otherProps,
|
|
1652
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$1h);
|
|
1688
1653
|
const localInputRef = React__default.useRef(null);
|
|
1689
1654
|
const generatedInputId = useId();
|
|
1690
1655
|
const inputId = id || generatedInputId;
|
|
@@ -1704,7 +1669,7 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
1704
1669
|
className: classNames(className, handleBasicClasses({
|
|
1705
1670
|
// Whether state is intermediate class name will "-checked"
|
|
1706
1671
|
isChecked: intermediateState ? true : isChecked,
|
|
1707
|
-
isDisabled,
|
|
1672
|
+
isDisabled: isAnyDisabled,
|
|
1708
1673
|
isUnchecked: !isChecked,
|
|
1709
1674
|
prefix: CLASSNAME$1b,
|
|
1710
1675
|
theme
|
|
@@ -1715,15 +1680,15 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
1715
1680
|
ref: useMergeRefs(inputRef, localInputRef),
|
|
1716
1681
|
type: "checkbox",
|
|
1717
1682
|
id: inputId,
|
|
1718
|
-
className: `${CLASSNAME$1b}__input-native
|
|
1719
|
-
|
|
1720
|
-
tabIndex: isDisabled ? -1 : 0,
|
|
1683
|
+
className: `${CLASSNAME$1b}__input-native`
|
|
1684
|
+
}, disabledStateProps, {
|
|
1721
1685
|
name: name,
|
|
1722
1686
|
value: value,
|
|
1723
1687
|
checked: isChecked,
|
|
1724
1688
|
onChange: handleChange,
|
|
1725
1689
|
"aria-describedby": helper ? `${inputId}-helper` : undefined,
|
|
1726
|
-
"aria-checked": intermediateState ? 'mixed' : Boolean(isChecked)
|
|
1690
|
+
"aria-checked": intermediateState ? 'mixed' : Boolean(isChecked),
|
|
1691
|
+
readOnly: inputProps.readOnly || disabledStateProps['aria-disabled']
|
|
1727
1692
|
}, inputProps)), /*#__PURE__*/React__default.createElement("div", {
|
|
1728
1693
|
className: `${CLASSNAME$1b}__input-placeholder`
|
|
1729
1694
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -1764,7 +1729,7 @@ function useStopPropagation(handler) {
|
|
|
1764
1729
|
}, [handler]);
|
|
1765
1730
|
}
|
|
1766
1731
|
|
|
1767
|
-
const _excluded$1g = ["after", "before", "children", "className", "color", "
|
|
1732
|
+
const _excluded$1g = ["after", "before", "children", "className", "color", "isClickable", "isHighlighted", "isSelected", "onAfterClick", "onBeforeClick", "onClick", "size", "theme", "href", "onKeyDown"];
|
|
1768
1733
|
|
|
1769
1734
|
/**
|
|
1770
1735
|
* Chip sizes.
|
|
@@ -1800,15 +1765,18 @@ const DEFAULT_PROPS$W = {
|
|
|
1800
1765
|
*/
|
|
1801
1766
|
const Chip = forwardRef((props, ref) => {
|
|
1802
1767
|
const defaultTheme = useTheme() || Theme.light;
|
|
1768
|
+
const {
|
|
1769
|
+
isAnyDisabled,
|
|
1770
|
+
disabledStateProps,
|
|
1771
|
+
otherProps
|
|
1772
|
+
} = useDisableStateProps(props);
|
|
1803
1773
|
const {
|
|
1804
1774
|
after,
|
|
1805
1775
|
before,
|
|
1806
1776
|
children,
|
|
1807
1777
|
className,
|
|
1808
1778
|
color,
|
|
1809
|
-
disabled,
|
|
1810
1779
|
isClickable: propIsClickable,
|
|
1811
|
-
isDisabled = disabled,
|
|
1812
1780
|
isHighlighted,
|
|
1813
1781
|
isSelected,
|
|
1814
1782
|
onAfterClick,
|
|
@@ -1818,11 +1786,11 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1818
1786
|
theme = defaultTheme,
|
|
1819
1787
|
href,
|
|
1820
1788
|
onKeyDown
|
|
1821
|
-
} =
|
|
1822
|
-
forwardedProps = _objectWithoutProperties(
|
|
1789
|
+
} = otherProps,
|
|
1790
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$1g);
|
|
1823
1791
|
const hasAfterClick = isFunction(onAfterClick);
|
|
1824
1792
|
const hasBeforeClick = isFunction(onBeforeClick);
|
|
1825
|
-
const hasOnClick = isFunction(onClick);
|
|
1793
|
+
const hasOnClick = isFunction(props.onClick);
|
|
1826
1794
|
const isButton = hasOnClick && !href;
|
|
1827
1795
|
const isClickable = Boolean(hasOnClick) || Boolean(href) || propIsClickable;
|
|
1828
1796
|
|
|
@@ -1841,14 +1809,14 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1841
1809
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
1842
1810
|
React__default.createElement("a", _extends({
|
|
1843
1811
|
role: isButton ? 'button' : undefined,
|
|
1844
|
-
tabIndex: isClickable ? 0 : undefined
|
|
1812
|
+
tabIndex: isClickable && !disabledStateProps.disabled ? 0 : undefined
|
|
1845
1813
|
}, forwardedProps, {
|
|
1846
|
-
href: href,
|
|
1814
|
+
href: !disabledStateProps.disabled ? href : undefined,
|
|
1847
1815
|
ref: ref,
|
|
1848
1816
|
className: classNames(className, handleBasicClasses({
|
|
1849
1817
|
clickable: isClickable,
|
|
1850
1818
|
color: chipColor,
|
|
1851
|
-
isDisabled,
|
|
1819
|
+
isDisabled: isAnyDisabled,
|
|
1852
1820
|
hasAfter: Boolean(after),
|
|
1853
1821
|
hasBefore: Boolean(before),
|
|
1854
1822
|
highlighted: Boolean(isHighlighted),
|
|
@@ -1857,7 +1825,7 @@ const Chip = forwardRef((props, ref) => {
|
|
|
1857
1825
|
size,
|
|
1858
1826
|
unselected: Boolean(!isSelected)
|
|
1859
1827
|
})),
|
|
1860
|
-
"aria-disabled": isClickable &&
|
|
1828
|
+
"aria-disabled": isClickable && isAnyDisabled || undefined,
|
|
1861
1829
|
onClick: hasOnClick ? onClick : undefined,
|
|
1862
1830
|
onKeyDown: handleKeyDown
|
|
1863
1831
|
}), before &&
|
|
@@ -2582,7 +2550,7 @@ const useBooleanState = defaultValue => {
|
|
|
2582
2550
|
return [booleanValue, setToFalse, setToTrue, toggleBoolean];
|
|
2583
2551
|
};
|
|
2584
2552
|
|
|
2585
|
-
const _excluded$1c = ["defaultMonth", "
|
|
2553
|
+
const _excluded$1c = ["defaultMonth", "locale", "maxDate", "minDate", "name", "nextButtonProps", "onChange", "previousButtonProps", "value"];
|
|
2586
2554
|
|
|
2587
2555
|
/**
|
|
2588
2556
|
* Defines the props of the component.
|
|
@@ -2601,10 +2569,12 @@ const COMPONENT_NAME$17 = 'DatePickerField';
|
|
|
2601
2569
|
* @return React element.
|
|
2602
2570
|
*/
|
|
2603
2571
|
const DatePickerField = forwardRef((props, ref) => {
|
|
2572
|
+
const {
|
|
2573
|
+
disabledStateProps,
|
|
2574
|
+
otherProps
|
|
2575
|
+
} = useDisableStateProps(props);
|
|
2604
2576
|
const {
|
|
2605
2577
|
defaultMonth,
|
|
2606
|
-
disabled,
|
|
2607
|
-
isDisabled = disabled,
|
|
2608
2578
|
locale = getCurrentLocale(),
|
|
2609
2579
|
maxDate,
|
|
2610
2580
|
minDate,
|
|
@@ -2613,8 +2583,8 @@ const DatePickerField = forwardRef((props, ref) => {
|
|
|
2613
2583
|
onChange,
|
|
2614
2584
|
previousButtonProps,
|
|
2615
2585
|
value
|
|
2616
|
-
} =
|
|
2617
|
-
forwardedProps = _objectWithoutProperties(
|
|
2586
|
+
} = otherProps,
|
|
2587
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$1c);
|
|
2618
2588
|
const anchorRef = useRef(null);
|
|
2619
2589
|
const [isOpen, close,, toggleOpen] = useBooleanState(false);
|
|
2620
2590
|
const handleKeyboardNav = useCallback(evt => {
|
|
@@ -2648,8 +2618,8 @@ const DatePickerField = forwardRef((props, ref) => {
|
|
|
2648
2618
|
value: textFieldValue,
|
|
2649
2619
|
onClick: toggleOpen,
|
|
2650
2620
|
onChange: onTextFieldChange,
|
|
2651
|
-
onKeyPress: handleKeyboardNav
|
|
2652
|
-
|
|
2621
|
+
onKeyPress: handleKeyboardNav
|
|
2622
|
+
}, disabledStateProps, {
|
|
2653
2623
|
readOnly: true,
|
|
2654
2624
|
"aria-haspopup": "dialog"
|
|
2655
2625
|
})), isOpen ? /*#__PURE__*/React__default.createElement(PopoverDialog
|
|
@@ -3595,7 +3565,7 @@ const useKeyboardListNavigation = (items, ref, onListItemSelected, onListItemNav
|
|
|
3595
3565
|
};
|
|
3596
3566
|
};
|
|
3597
3567
|
|
|
3598
|
-
const _excluded$18 = ["after", "before", "children", "className", "isHighlighted", "isSelected", "
|
|
3568
|
+
const _excluded$18 = ["after", "before", "children", "className", "isHighlighted", "isSelected", "linkAs", "linkProps", "linkRef", "onItemSelected", "size"];
|
|
3599
3569
|
|
|
3600
3570
|
/**
|
|
3601
3571
|
* Defines the props of the component.
|
|
@@ -3637,6 +3607,11 @@ function isClickable({
|
|
|
3637
3607
|
* @return React element.
|
|
3638
3608
|
*/
|
|
3639
3609
|
const ListItem = forwardRef((props, ref) => {
|
|
3610
|
+
const {
|
|
3611
|
+
isAnyDisabled,
|
|
3612
|
+
disabledStateProps,
|
|
3613
|
+
otherProps
|
|
3614
|
+
} = useDisableStateProps(props);
|
|
3640
3615
|
const {
|
|
3641
3616
|
after,
|
|
3642
3617
|
before,
|
|
@@ -3644,14 +3619,13 @@ const ListItem = forwardRef((props, ref) => {
|
|
|
3644
3619
|
className,
|
|
3645
3620
|
isHighlighted,
|
|
3646
3621
|
isSelected,
|
|
3647
|
-
isDisabled,
|
|
3648
3622
|
linkAs,
|
|
3649
3623
|
linkProps = {},
|
|
3650
3624
|
linkRef,
|
|
3651
3625
|
onItemSelected,
|
|
3652
3626
|
size = DEFAULT_PROPS$R.size
|
|
3653
|
-
} =
|
|
3654
|
-
forwardedProps = _objectWithoutProperties(
|
|
3627
|
+
} = otherProps,
|
|
3628
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$18);
|
|
3655
3629
|
const role = linkAs || linkProps.href ? 'link' : 'button';
|
|
3656
3630
|
const onKeyDown = useMemo(() => {
|
|
3657
3631
|
if (onItemSelected && role === 'link') return onEnterPressed(onItemSelected);
|
|
@@ -3678,19 +3652,19 @@ const ListItem = forwardRef((props, ref) => {
|
|
|
3678
3652
|
}) ? (/* Clickable list item */
|
|
3679
3653
|
renderLink(_objectSpread2(_objectSpread2({
|
|
3680
3654
|
linkAs,
|
|
3681
|
-
tabIndex: !
|
|
3655
|
+
tabIndex: !disabledStateProps.disabled ? 0 : undefined,
|
|
3682
3656
|
role,
|
|
3683
|
-
'aria-disabled':
|
|
3657
|
+
'aria-disabled': isAnyDisabled
|
|
3684
3658
|
}, linkProps), {}, {
|
|
3685
|
-
href:
|
|
3659
|
+
href: isAnyDisabled ? undefined : linkProps.href,
|
|
3686
3660
|
className: classNames(handleBasicClasses({
|
|
3687
3661
|
prefix: `${CLASSNAME$13}__link`,
|
|
3688
3662
|
isHighlighted,
|
|
3689
3663
|
isSelected,
|
|
3690
|
-
isDisabled
|
|
3664
|
+
isDisabled: isAnyDisabled
|
|
3691
3665
|
})),
|
|
3692
|
-
onClick:
|
|
3693
|
-
onKeyDown,
|
|
3666
|
+
onClick: isAnyDisabled ? undefined : onItemSelected,
|
|
3667
|
+
onKeyDown: isAnyDisabled ? undefined : onKeyDown,
|
|
3694
3668
|
ref: linkRef
|
|
3695
3669
|
}), content)) :
|
|
3696
3670
|
/*#__PURE__*/
|
|
@@ -8939,7 +8913,7 @@ const Lightbox = forwardRef((props, ref) => {
|
|
|
8939
8913
|
Lightbox.displayName = COMPONENT_NAME$M;
|
|
8940
8914
|
Lightbox.className = CLASSNAME$M;
|
|
8941
8915
|
|
|
8942
|
-
const _excluded$P = ["children", "className", "color", "colorVariant", "
|
|
8916
|
+
const _excluded$P = ["children", "className", "color", "colorVariant", "href", "leftIcon", "linkAs", "rightIcon", "target", "typography"];
|
|
8943
8917
|
|
|
8944
8918
|
/**
|
|
8945
8919
|
* Defines the props of the component.
|
|
@@ -8963,28 +8937,31 @@ const CLASSNAME$L = getRootClassName(COMPONENT_NAME$L);
|
|
|
8963
8937
|
* @return React element.
|
|
8964
8938
|
*/
|
|
8965
8939
|
const Link = forwardRef((props, ref) => {
|
|
8940
|
+
const {
|
|
8941
|
+
isAnyDisabled,
|
|
8942
|
+
disabledStateProps,
|
|
8943
|
+
otherProps
|
|
8944
|
+
} = useDisableStateProps(props);
|
|
8966
8945
|
const {
|
|
8967
8946
|
children,
|
|
8968
8947
|
className,
|
|
8969
8948
|
color: propColor,
|
|
8970
8949
|
colorVariant: propColorVariant,
|
|
8971
|
-
disabled,
|
|
8972
|
-
isDisabled = disabled,
|
|
8973
8950
|
href,
|
|
8974
8951
|
leftIcon,
|
|
8975
8952
|
linkAs,
|
|
8976
8953
|
rightIcon,
|
|
8977
8954
|
target,
|
|
8978
8955
|
typography
|
|
8979
|
-
} =
|
|
8980
|
-
forwardedProps = _objectWithoutProperties(
|
|
8956
|
+
} = otherProps,
|
|
8957
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$P);
|
|
8981
8958
|
const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
|
|
8982
8959
|
const isLink = linkAs || href;
|
|
8983
|
-
const Component = isLink && !
|
|
8960
|
+
const Component = isLink && !isAnyDisabled ? linkAs || 'a' : 'button';
|
|
8984
8961
|
const baseProps = {};
|
|
8985
8962
|
if (Component === 'button') {
|
|
8986
8963
|
baseProps.type = 'button';
|
|
8987
|
-
baseProps
|
|
8964
|
+
Object.assign(baseProps, disabledStateProps);
|
|
8988
8965
|
} else if (isLink) {
|
|
8989
8966
|
baseProps.href = href;
|
|
8990
8967
|
baseProps.target = target;
|
|
@@ -10347,7 +10324,7 @@ ProgressTracker.displayName = COMPONENT_NAME$w;
|
|
|
10347
10324
|
ProgressTracker.className = CLASSNAME$w;
|
|
10348
10325
|
ProgressTracker.defaultProps = DEFAULT_PROPS$r;
|
|
10349
10326
|
|
|
10350
|
-
const _excluded$y = ["className", "
|
|
10327
|
+
const _excluded$y = ["className", "hasError", "helper", "id", "isActive", "isComplete", "label", "onFocus", "onKeyPress", "tabIndex"];
|
|
10351
10328
|
|
|
10352
10329
|
/**
|
|
10353
10330
|
* Defines the props of the component.
|
|
@@ -10378,29 +10355,31 @@ const DEFAULT_PROPS$q = {};
|
|
|
10378
10355
|
* @return React element.
|
|
10379
10356
|
*/
|
|
10380
10357
|
const ProgressTrackerStep = forwardRef((props, ref) => {
|
|
10358
|
+
const {
|
|
10359
|
+
isAnyDisabled,
|
|
10360
|
+
otherProps
|
|
10361
|
+
} = useDisableStateProps(props);
|
|
10381
10362
|
const {
|
|
10382
10363
|
className,
|
|
10383
|
-
disabled,
|
|
10384
10364
|
hasError,
|
|
10385
10365
|
helper,
|
|
10386
10366
|
id,
|
|
10387
10367
|
isActive: propIsActive,
|
|
10388
10368
|
isComplete,
|
|
10389
|
-
isDisabled = disabled,
|
|
10390
10369
|
label,
|
|
10391
10370
|
onFocus,
|
|
10392
10371
|
onKeyPress,
|
|
10393
10372
|
tabIndex = -1
|
|
10394
|
-
} =
|
|
10395
|
-
forwardedProps = _objectWithoutProperties(
|
|
10373
|
+
} = otherProps,
|
|
10374
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$y);
|
|
10396
10375
|
const state = useTabProviderContext('tab', id);
|
|
10397
10376
|
const isActive = propIsActive || (state === null || state === void 0 ? void 0 : state.isActive);
|
|
10398
10377
|
const changeToCurrentTab = useCallback(() => {
|
|
10399
|
-
if (
|
|
10378
|
+
if (isAnyDisabled) {
|
|
10400
10379
|
return;
|
|
10401
10380
|
}
|
|
10402
10381
|
state === null || state === void 0 ? void 0 : state.changeToTab();
|
|
10403
|
-
}, [
|
|
10382
|
+
}, [isAnyDisabled, state]);
|
|
10404
10383
|
const handleFocus = useCallback(event => {
|
|
10405
10384
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
10406
10385
|
if (state !== null && state !== void 0 && state.shouldActivateOnFocus) {
|
|
@@ -10432,7 +10411,7 @@ const ProgressTrackerStep = forwardRef((props, ref) => {
|
|
|
10432
10411
|
prefix: CLASSNAME$v,
|
|
10433
10412
|
hasError,
|
|
10434
10413
|
isActive,
|
|
10435
|
-
isClickable: state && !
|
|
10414
|
+
isClickable: state && !isAnyDisabled,
|
|
10436
10415
|
isComplete
|
|
10437
10416
|
})),
|
|
10438
10417
|
onClick: changeToCurrentTab,
|
|
@@ -10440,7 +10419,7 @@ const ProgressTrackerStep = forwardRef((props, ref) => {
|
|
|
10440
10419
|
onFocus: handleFocus,
|
|
10441
10420
|
role: "tab",
|
|
10442
10421
|
tabIndex: isActive ? 0 : tabIndex,
|
|
10443
|
-
"aria-disabled":
|
|
10422
|
+
"aria-disabled": isAnyDisabled,
|
|
10444
10423
|
"aria-selected": isActive,
|
|
10445
10424
|
"aria-controls": state === null || state === void 0 ? void 0 : state.tabPanelId
|
|
10446
10425
|
}), /*#__PURE__*/React__default.createElement(Icon, {
|
|
@@ -10516,7 +10495,7 @@ ProgressTrackerStepPanel.displayName = COMPONENT_NAME$u;
|
|
|
10516
10495
|
ProgressTrackerStepPanel.className = CLASSNAME$u;
|
|
10517
10496
|
ProgressTrackerStepPanel.defaultProps = DEFAULT_PROPS$p;
|
|
10518
10497
|
|
|
10519
|
-
const _excluded$w = ["checked", "className", "
|
|
10498
|
+
const _excluded$w = ["checked", "className", "helper", "id", "inputRef", "isChecked", "label", "name", "onChange", "theme", "value", "inputProps"];
|
|
10520
10499
|
|
|
10521
10500
|
/**
|
|
10522
10501
|
* Defines the props of the component.
|
|
@@ -10545,24 +10524,27 @@ const DEFAULT_PROPS$o = {};
|
|
|
10545
10524
|
* @return React element.
|
|
10546
10525
|
*/
|
|
10547
10526
|
const RadioButton = forwardRef((props, ref) => {
|
|
10527
|
+
const {
|
|
10528
|
+
isAnyDisabled,
|
|
10529
|
+
disabledStateProps,
|
|
10530
|
+
otherProps
|
|
10531
|
+
} = useDisableStateProps(props);
|
|
10548
10532
|
const defaultTheme = useTheme() || Theme.light;
|
|
10549
10533
|
const {
|
|
10550
10534
|
checked,
|
|
10551
10535
|
className,
|
|
10552
|
-
disabled,
|
|
10553
10536
|
helper,
|
|
10554
10537
|
id,
|
|
10555
10538
|
inputRef,
|
|
10556
10539
|
isChecked = checked,
|
|
10557
|
-
isDisabled = disabled,
|
|
10558
10540
|
label,
|
|
10559
10541
|
name,
|
|
10560
10542
|
onChange,
|
|
10561
10543
|
theme = defaultTheme,
|
|
10562
10544
|
value,
|
|
10563
10545
|
inputProps
|
|
10564
|
-
} =
|
|
10565
|
-
forwardedProps = _objectWithoutProperties(
|
|
10546
|
+
} = otherProps,
|
|
10547
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$w);
|
|
10566
10548
|
const generatedInputId = useId();
|
|
10567
10549
|
const inputId = id || generatedInputId;
|
|
10568
10550
|
const handleChange = event => {
|
|
@@ -10575,7 +10557,7 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
10575
10557
|
}, forwardedProps, {
|
|
10576
10558
|
className: classNames(className, handleBasicClasses({
|
|
10577
10559
|
isChecked,
|
|
10578
|
-
isDisabled,
|
|
10560
|
+
isDisabled: isAnyDisabled,
|
|
10579
10561
|
isUnchecked: !isChecked,
|
|
10580
10562
|
prefix: CLASSNAME$t,
|
|
10581
10563
|
theme
|
|
@@ -10584,15 +10566,15 @@ const RadioButton = forwardRef((props, ref) => {
|
|
|
10584
10566
|
className: `${CLASSNAME$t}__input-wrapper`
|
|
10585
10567
|
}, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
10586
10568
|
ref: inputRef,
|
|
10587
|
-
className: `${CLASSNAME$t}__input-native
|
|
10588
|
-
|
|
10569
|
+
className: `${CLASSNAME$t}__input-native`
|
|
10570
|
+
}, disabledStateProps, {
|
|
10589
10571
|
id: inputId,
|
|
10590
|
-
tabIndex: isDisabled ? -1 : 0,
|
|
10591
10572
|
type: "radio",
|
|
10592
10573
|
name: name,
|
|
10593
10574
|
value: value,
|
|
10594
10575
|
checked: isChecked,
|
|
10595
10576
|
onChange: handleChange,
|
|
10577
|
+
readOnly: (inputProps === null || inputProps === void 0 ? void 0 : inputProps.readOnly) || isAnyDisabled,
|
|
10596
10578
|
"aria-describedby": helper ? `${inputId}-helper` : undefined
|
|
10597
10579
|
}, inputProps)), /*#__PURE__*/React__default.createElement("div", {
|
|
10598
10580
|
className: `${CLASSNAME$t}__input-placeholder`
|
|
@@ -11412,7 +11394,7 @@ const clamp = (value, min, max) => {
|
|
|
11412
11394
|
return value;
|
|
11413
11395
|
};
|
|
11414
11396
|
|
|
11415
|
-
const _excluded$l = ["className", "
|
|
11397
|
+
const _excluded$l = ["className", "helper", "hideMinMaxLabel", "id", "label", "max", "min", "name", "onChange", "onMouseDown", "precision", "steps", "theme", "value"];
|
|
11416
11398
|
|
|
11417
11399
|
/**
|
|
11418
11400
|
* Defines the props of the component.
|
|
@@ -11465,14 +11447,17 @@ const computePercentFromValue = (value, min, max) => Number((value - min) / (max
|
|
|
11465
11447
|
* @return React element.
|
|
11466
11448
|
*/
|
|
11467
11449
|
const Slider = forwardRef((props, ref) => {
|
|
11450
|
+
const {
|
|
11451
|
+
isAnyDisabled,
|
|
11452
|
+
disabledStateProps,
|
|
11453
|
+
otherProps
|
|
11454
|
+
} = useDisableStateProps(props);
|
|
11468
11455
|
const defaultTheme = useTheme() || Theme.light;
|
|
11469
11456
|
const {
|
|
11470
11457
|
className,
|
|
11471
|
-
disabled,
|
|
11472
11458
|
helper,
|
|
11473
11459
|
hideMinMaxLabel,
|
|
11474
11460
|
id,
|
|
11475
|
-
isDisabled = disabled,
|
|
11476
11461
|
label,
|
|
11477
11462
|
max,
|
|
11478
11463
|
min,
|
|
@@ -11483,8 +11468,8 @@ const Slider = forwardRef((props, ref) => {
|
|
|
11483
11468
|
steps = DEFAULT_PROPS$h.steps,
|
|
11484
11469
|
theme = defaultTheme,
|
|
11485
11470
|
value
|
|
11486
|
-
} =
|
|
11487
|
-
forwardedProps = _objectWithoutProperties(
|
|
11471
|
+
} = otherProps,
|
|
11472
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$l);
|
|
11488
11473
|
const generatedId = useId();
|
|
11489
11474
|
const sliderId = id || generatedId;
|
|
11490
11475
|
const sliderLabelId = useMemo(() => `label-${sliderId}`, [sliderId]);
|
|
@@ -11604,7 +11589,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
11604
11589
|
const {
|
|
11605
11590
|
current: slider
|
|
11606
11591
|
} = sliderRef;
|
|
11607
|
-
if (
|
|
11592
|
+
if (isAnyDisabled || !slider) return;
|
|
11608
11593
|
const newValue = getPercentValue(event, slider);
|
|
11609
11594
|
if (onChange) {
|
|
11610
11595
|
onChange(computeValueFromPercent(newValue, min, max, precision), name, event);
|
|
@@ -11621,8 +11606,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
11621
11606
|
theme,
|
|
11622
11607
|
hasLabel: Boolean(label)
|
|
11623
11608
|
})),
|
|
11624
|
-
onMouseDown: handleMouseDown
|
|
11625
|
-
"aria-disabled": isDisabled
|
|
11609
|
+
onMouseDown: handleMouseDown
|
|
11626
11610
|
}), label && /*#__PURE__*/React__default.createElement(InputLabel, {
|
|
11627
11611
|
id: sliderLabelId,
|
|
11628
11612
|
htmlFor: sliderId,
|
|
@@ -11653,7 +11637,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
11653
11637
|
style: {
|
|
11654
11638
|
left: `${step * 100}%`
|
|
11655
11639
|
}
|
|
11656
|
-
}))) : null, /*#__PURE__*/React__default.createElement("button", {
|
|
11640
|
+
}))) : null, /*#__PURE__*/React__default.createElement("button", _extends({
|
|
11657
11641
|
type: "button",
|
|
11658
11642
|
"aria-labelledby": sliderLabelId,
|
|
11659
11643
|
name: name,
|
|
@@ -11662,9 +11646,8 @@ const Slider = forwardRef((props, ref) => {
|
|
|
11662
11646
|
style: {
|
|
11663
11647
|
left: percentString
|
|
11664
11648
|
},
|
|
11665
|
-
onKeyDown: handleKeyDown
|
|
11666
|
-
|
|
11667
|
-
})), !hideMinMaxLabel && /*#__PURE__*/React__default.createElement("span", {
|
|
11649
|
+
onKeyDown: isAnyDisabled ? undefined : handleKeyDown
|
|
11650
|
+
}, disabledStateProps))), !hideMinMaxLabel && /*#__PURE__*/React__default.createElement("span", {
|
|
11668
11651
|
className: `${CLASSNAME$j}__value-label ${CLASSNAME$j}__value-label--max`
|
|
11669
11652
|
}, max)));
|
|
11670
11653
|
});
|
|
@@ -12478,7 +12461,7 @@ const Slides = forwardRef((props, ref) => {
|
|
|
12478
12461
|
Slides.displayName = COMPONENT_NAME$f;
|
|
12479
12462
|
Slides.className = CLASSNAME$f;
|
|
12480
12463
|
|
|
12481
|
-
const _excluded$f = ["checked", "children", "className", "
|
|
12464
|
+
const _excluded$f = ["checked", "children", "className", "helper", "id", "isChecked", "name", "onChange", "position", "theme", "value", "inputProps"];
|
|
12482
12465
|
|
|
12483
12466
|
/**
|
|
12484
12467
|
* Defines the props of the component.
|
|
@@ -12509,24 +12492,27 @@ const DEFAULT_PROPS$e = {
|
|
|
12509
12492
|
* @return React element.
|
|
12510
12493
|
*/
|
|
12511
12494
|
const Switch = forwardRef((props, ref) => {
|
|
12495
|
+
const {
|
|
12496
|
+
isAnyDisabled,
|
|
12497
|
+
disabledStateProps,
|
|
12498
|
+
otherProps
|
|
12499
|
+
} = useDisableStateProps(props);
|
|
12512
12500
|
const defaultTheme = useTheme() || Theme.light;
|
|
12513
12501
|
const {
|
|
12514
12502
|
checked,
|
|
12515
12503
|
children,
|
|
12516
12504
|
className,
|
|
12517
|
-
disabled,
|
|
12518
12505
|
helper,
|
|
12519
12506
|
id,
|
|
12520
12507
|
isChecked = checked,
|
|
12521
|
-
isDisabled = disabled,
|
|
12522
12508
|
name,
|
|
12523
12509
|
onChange,
|
|
12524
12510
|
position = DEFAULT_PROPS$e.position,
|
|
12525
12511
|
theme = defaultTheme,
|
|
12526
12512
|
value,
|
|
12527
12513
|
inputProps = {}
|
|
12528
|
-
} =
|
|
12529
|
-
forwardedProps = _objectWithoutProperties(
|
|
12514
|
+
} = otherProps,
|
|
12515
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$f);
|
|
12530
12516
|
const generatedInputId = useId();
|
|
12531
12517
|
const inputId = id || generatedInputId;
|
|
12532
12518
|
const handleChange = event => {
|
|
@@ -12540,12 +12526,11 @@ const Switch = forwardRef((props, ref) => {
|
|
|
12540
12526
|
className: classNames(className, handleBasicClasses({
|
|
12541
12527
|
prefix: CLASSNAME$e,
|
|
12542
12528
|
isChecked,
|
|
12543
|
-
isDisabled,
|
|
12529
|
+
isDisabled: isAnyDisabled,
|
|
12544
12530
|
position,
|
|
12545
12531
|
theme,
|
|
12546
12532
|
isUnchecked: !isChecked
|
|
12547
|
-
}))
|
|
12548
|
-
"aria-disabled": isDisabled
|
|
12533
|
+
}))
|
|
12549
12534
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
12550
12535
|
className: `${CLASSNAME$e}__input-wrapper`
|
|
12551
12536
|
}, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
@@ -12554,8 +12539,9 @@ const Switch = forwardRef((props, ref) => {
|
|
|
12554
12539
|
id: inputId,
|
|
12555
12540
|
className: `${CLASSNAME$e}__input-native`,
|
|
12556
12541
|
name: name,
|
|
12557
|
-
value: value
|
|
12558
|
-
|
|
12542
|
+
value: value
|
|
12543
|
+
}, disabledStateProps, {
|
|
12544
|
+
readOnly: inputProps.readOnly || isAnyDisabled,
|
|
12559
12545
|
checked: isChecked,
|
|
12560
12546
|
"aria-checked": Boolean(isChecked),
|
|
12561
12547
|
onChange: handleChange,
|
|
@@ -12823,7 +12809,7 @@ TableHeader.displayName = COMPONENT_NAME$a;
|
|
|
12823
12809
|
TableHeader.className = CLASSNAME$a;
|
|
12824
12810
|
TableHeader.defaultProps = DEFAULT_PROPS$b;
|
|
12825
12811
|
|
|
12826
|
-
const _excluded$a = ["children", "className", "
|
|
12812
|
+
const _excluded$a = ["children", "className", "isClickable", "isSelected"];
|
|
12827
12813
|
|
|
12828
12814
|
/**
|
|
12829
12815
|
* Defines the props of the component.
|
|
@@ -12852,26 +12838,29 @@ const DEFAULT_PROPS$a = {};
|
|
|
12852
12838
|
* @return React element.
|
|
12853
12839
|
*/
|
|
12854
12840
|
const TableRow = forwardRef((props, ref) => {
|
|
12841
|
+
const {
|
|
12842
|
+
isAnyDisabled,
|
|
12843
|
+
disabledStateProps,
|
|
12844
|
+
otherProps
|
|
12845
|
+
} = useDisableStateProps(props);
|
|
12855
12846
|
const {
|
|
12856
12847
|
children,
|
|
12857
12848
|
className,
|
|
12858
|
-
disabled,
|
|
12859
12849
|
isClickable,
|
|
12860
|
-
isDisabled = disabled,
|
|
12861
12850
|
isSelected
|
|
12862
|
-
} =
|
|
12863
|
-
forwardedProps = _objectWithoutProperties(
|
|
12851
|
+
} = otherProps,
|
|
12852
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$a);
|
|
12864
12853
|
return /*#__PURE__*/React__default.createElement("tr", _extends({
|
|
12865
12854
|
ref: ref,
|
|
12866
|
-
tabIndex: isClickable && !
|
|
12855
|
+
tabIndex: isClickable && !disabledStateProps.disabled ? 0 : -1
|
|
12867
12856
|
}, forwardedProps, {
|
|
12868
12857
|
className: classNames(className, handleBasicClasses({
|
|
12869
|
-
isClickable: isClickable && !
|
|
12870
|
-
isDisabled,
|
|
12871
|
-
isSelected: isSelected && !
|
|
12858
|
+
isClickable: isClickable && !isAnyDisabled,
|
|
12859
|
+
isDisabled: isAnyDisabled,
|
|
12860
|
+
isSelected: isSelected && !isAnyDisabled,
|
|
12872
12861
|
prefix: CLASSNAME$9
|
|
12873
12862
|
})),
|
|
12874
|
-
"aria-disabled":
|
|
12863
|
+
"aria-disabled": isAnyDisabled
|
|
12875
12864
|
}), children);
|
|
12876
12865
|
});
|
|
12877
12866
|
TableRow.displayName = COMPONENT_NAME$9;
|
|
@@ -13008,7 +12997,7 @@ TabList.displayName = COMPONENT_NAME$8;
|
|
|
13008
12997
|
TabList.className = CLASSNAME$8;
|
|
13009
12998
|
TabList.defaultProps = DEFAULT_PROPS$8;
|
|
13010
12999
|
|
|
13011
|
-
const _excluded$7 = ["className", "
|
|
13000
|
+
const _excluded$7 = ["className", "icon", "iconProps", "id", "isActive", "label", "onFocus", "onKeyPress", "tabIndex"];
|
|
13012
13001
|
|
|
13013
13002
|
/**
|
|
13014
13003
|
* Defines the props of the component.
|
|
@@ -13039,28 +13028,30 @@ const DEFAULT_PROPS$7 = {};
|
|
|
13039
13028
|
* @return React element.
|
|
13040
13029
|
*/
|
|
13041
13030
|
const Tab = forwardRef((props, ref) => {
|
|
13031
|
+
const {
|
|
13032
|
+
isAnyDisabled,
|
|
13033
|
+
otherProps
|
|
13034
|
+
} = useDisableStateProps(props);
|
|
13042
13035
|
const {
|
|
13043
13036
|
className,
|
|
13044
|
-
disabled,
|
|
13045
13037
|
icon,
|
|
13046
13038
|
iconProps = {},
|
|
13047
13039
|
id,
|
|
13048
13040
|
isActive: propIsActive,
|
|
13049
|
-
isDisabled = disabled,
|
|
13050
13041
|
label,
|
|
13051
13042
|
onFocus,
|
|
13052
13043
|
onKeyPress,
|
|
13053
13044
|
tabIndex = -1
|
|
13054
|
-
} =
|
|
13055
|
-
forwardedProps = _objectWithoutProperties(
|
|
13045
|
+
} = otherProps,
|
|
13046
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded$7);
|
|
13056
13047
|
const state = useTabProviderContext('tab', id);
|
|
13057
13048
|
const isActive = propIsActive || (state === null || state === void 0 ? void 0 : state.isActive);
|
|
13058
13049
|
const changeToCurrentTab = useCallback(() => {
|
|
13059
|
-
if (
|
|
13050
|
+
if (isAnyDisabled) {
|
|
13060
13051
|
return;
|
|
13061
13052
|
}
|
|
13062
13053
|
state === null || state === void 0 ? void 0 : state.changeToTab();
|
|
13063
|
-
}, [
|
|
13054
|
+
}, [isAnyDisabled, state]);
|
|
13064
13055
|
const handleFocus = useCallback(event => {
|
|
13065
13056
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
13066
13057
|
if (state !== null && state !== void 0 && state.shouldActivateOnFocus) {
|
|
@@ -13069,11 +13060,11 @@ const Tab = forwardRef((props, ref) => {
|
|
|
13069
13060
|
}, [changeToCurrentTab, onFocus, state === null || state === void 0 ? void 0 : state.shouldActivateOnFocus]);
|
|
13070
13061
|
const handleKeyPress = useCallback(event => {
|
|
13071
13062
|
onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(event);
|
|
13072
|
-
if (event.key !== 'Enter') {
|
|
13063
|
+
if (event.key !== 'Enter' || isAnyDisabled) {
|
|
13073
13064
|
return;
|
|
13074
13065
|
}
|
|
13075
13066
|
changeToCurrentTab();
|
|
13076
|
-
}, [changeToCurrentTab, onKeyPress]);
|
|
13067
|
+
}, [changeToCurrentTab, isAnyDisabled, onKeyPress]);
|
|
13077
13068
|
return /*#__PURE__*/React__default.createElement("button", _extends({
|
|
13078
13069
|
ref: ref
|
|
13079
13070
|
}, forwardedProps, {
|
|
@@ -13082,14 +13073,14 @@ const Tab = forwardRef((props, ref) => {
|
|
|
13082
13073
|
className: classNames(className, handleBasicClasses({
|
|
13083
13074
|
prefix: CLASSNAME$7,
|
|
13084
13075
|
isActive,
|
|
13085
|
-
isDisabled
|
|
13076
|
+
isDisabled: isAnyDisabled
|
|
13086
13077
|
})),
|
|
13087
13078
|
onClick: changeToCurrentTab,
|
|
13088
13079
|
onKeyPress: handleKeyPress,
|
|
13089
13080
|
onFocus: handleFocus,
|
|
13090
13081
|
role: "tab",
|
|
13091
13082
|
tabIndex: isActive ? 0 : tabIndex,
|
|
13092
|
-
"aria-disabled":
|
|
13083
|
+
"aria-disabled": isAnyDisabled,
|
|
13093
13084
|
"aria-selected": isActive,
|
|
13094
13085
|
"aria-controls": state === null || state === void 0 ? void 0 : state.tabPanelId
|
|
13095
13086
|
}), icon && /*#__PURE__*/React__default.createElement(Icon, _extends({
|
|
@@ -13161,8 +13152,8 @@ TabPanel.displayName = COMPONENT_NAME$6;
|
|
|
13161
13152
|
TabPanel.className = CLASSNAME$6;
|
|
13162
13153
|
TabPanel.defaultProps = DEFAULT_PROPS$6;
|
|
13163
13154
|
|
|
13164
|
-
const _excluded$5 = ["id", "
|
|
13165
|
-
_excluded2 = ["chips", "className", "clearButtonProps", "
|
|
13155
|
+
const _excluded$5 = ["id", "isRequired", "placeholder", "multiline", "value", "setFocus", "onChange", "onFocus", "onBlur", "inputRef", "rows", "recomputeNumberOfRows", "type", "name", "hasError", "describedById"],
|
|
13156
|
+
_excluded2 = ["chips", "className", "clearButtonProps", "error", "forceFocusStyle", "hasError", "helper", "icon", "id", "inputRef", "isRequired", "isValid", "label", "labelProps", "maxLength", "minimumRows", "multiline", "name", "onBlur", "onChange", "onClear", "onFocus", "placeholder", "textFieldRef", "theme", "type", "value", "afterElement"];
|
|
13166
13157
|
|
|
13167
13158
|
/**
|
|
13168
13159
|
* Defines the props of the component.
|
|
@@ -13228,7 +13219,6 @@ const useComputeNumberOfRows = minimumRows => {
|
|
|
13228
13219
|
const renderInputNative = props => {
|
|
13229
13220
|
const {
|
|
13230
13221
|
id,
|
|
13231
|
-
isDisabled,
|
|
13232
13222
|
isRequired,
|
|
13233
13223
|
placeholder,
|
|
13234
13224
|
multiline,
|
|
@@ -13274,13 +13264,13 @@ const renderInputNative = props => {
|
|
|
13274
13264
|
placeholder,
|
|
13275
13265
|
value,
|
|
13276
13266
|
name,
|
|
13277
|
-
disabled: isDisabled,
|
|
13278
13267
|
required: isRequired,
|
|
13279
13268
|
onFocus: onTextFieldFocus,
|
|
13280
13269
|
onBlur: onTextFieldBlur,
|
|
13281
13270
|
onChange: handleChange,
|
|
13282
13271
|
'aria-invalid': hasError ? 'true' : undefined,
|
|
13283
13272
|
'aria-describedby': describedById,
|
|
13273
|
+
readOnly: forwardedProps.readOnly || forwardedProps['aria-disabled'],
|
|
13284
13274
|
ref: mergeRefs(inputRef, ref)
|
|
13285
13275
|
});
|
|
13286
13276
|
if (multiline) {
|
|
@@ -13299,12 +13289,16 @@ const renderInputNative = props => {
|
|
|
13299
13289
|
* @return React element.
|
|
13300
13290
|
*/
|
|
13301
13291
|
const TextField = forwardRef((props, ref) => {
|
|
13292
|
+
const {
|
|
13293
|
+
isAnyDisabled,
|
|
13294
|
+
disabledStateProps,
|
|
13295
|
+
otherProps
|
|
13296
|
+
} = useDisableStateProps(props);
|
|
13302
13297
|
const defaultTheme = useTheme() || Theme.light;
|
|
13303
13298
|
const {
|
|
13304
13299
|
chips,
|
|
13305
13300
|
className,
|
|
13306
13301
|
clearButtonProps,
|
|
13307
|
-
disabled,
|
|
13308
13302
|
error,
|
|
13309
13303
|
forceFocusStyle,
|
|
13310
13304
|
hasError,
|
|
@@ -13312,7 +13306,6 @@ const TextField = forwardRef((props, ref) => {
|
|
|
13312
13306
|
icon,
|
|
13313
13307
|
id,
|
|
13314
13308
|
inputRef: inputRefProps,
|
|
13315
|
-
isDisabled = disabled,
|
|
13316
13309
|
isRequired,
|
|
13317
13310
|
isValid,
|
|
13318
13311
|
label,
|
|
@@ -13331,8 +13324,8 @@ const TextField = forwardRef((props, ref) => {
|
|
|
13331
13324
|
type = DEFAULT_PROPS$5.type,
|
|
13332
13325
|
value,
|
|
13333
13326
|
afterElement
|
|
13334
|
-
} =
|
|
13335
|
-
forwardedProps = _objectWithoutProperties(
|
|
13327
|
+
} = otherProps,
|
|
13328
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded2);
|
|
13336
13329
|
const generatedTextFieldId = useId();
|
|
13337
13330
|
const textFieldId = id || generatedTextFieldId;
|
|
13338
13331
|
/** Keep a clean local input ref to manage focus */
|
|
@@ -13390,7 +13383,7 @@ const TextField = forwardRef((props, ref) => {
|
|
|
13390
13383
|
hasPlaceholder: Boolean(placeholder),
|
|
13391
13384
|
hasTextarea: multiline,
|
|
13392
13385
|
hasValue: Boolean(value),
|
|
13393
|
-
isDisabled,
|
|
13386
|
+
isDisabled: isAnyDisabled,
|
|
13394
13387
|
isFocus: isFocus || forceFocusStyle,
|
|
13395
13388
|
isValid,
|
|
13396
13389
|
prefix: CLASSNAME$5,
|
|
@@ -13418,10 +13411,10 @@ const TextField = forwardRef((props, ref) => {
|
|
|
13418
13411
|
size: Size.xs
|
|
13419
13412
|
}), chips && /*#__PURE__*/React__default.createElement("div", {
|
|
13420
13413
|
className: `${CLASSNAME$5}__chips`
|
|
13421
|
-
}, chips, renderInputNative(_objectSpread2({
|
|
13414
|
+
}, chips, renderInputNative(_objectSpread2(_objectSpread2({
|
|
13422
13415
|
id: textFieldId,
|
|
13423
|
-
inputRef
|
|
13424
|
-
|
|
13416
|
+
inputRef
|
|
13417
|
+
}, disabledStateProps), {}, {
|
|
13425
13418
|
isRequired,
|
|
13426
13419
|
maxLength,
|
|
13427
13420
|
multiline,
|
|
@@ -13439,10 +13432,10 @@ const TextField = forwardRef((props, ref) => {
|
|
|
13439
13432
|
describedById
|
|
13440
13433
|
}, forwardedProps))), !chips && /*#__PURE__*/React__default.createElement("div", {
|
|
13441
13434
|
className: `${CLASSNAME$5}__input-wrapper`
|
|
13442
|
-
}, renderInputNative(_objectSpread2({
|
|
13435
|
+
}, renderInputNative(_objectSpread2(_objectSpread2({
|
|
13443
13436
|
id: textFieldId,
|
|
13444
|
-
inputRef
|
|
13445
|
-
|
|
13437
|
+
inputRef
|
|
13438
|
+
}, disabledStateProps), {}, {
|
|
13446
13439
|
isRequired,
|
|
13447
13440
|
maxLength,
|
|
13448
13441
|
multiline,
|
|
@@ -13463,7 +13456,7 @@ const TextField = forwardRef((props, ref) => {
|
|
|
13463
13456
|
color: theme === Theme.dark ? 'light' : undefined,
|
|
13464
13457
|
icon: isValid ? mdiCheckCircle : mdiAlertCircle,
|
|
13465
13458
|
size: Size.xxs
|
|
13466
|
-
}), clearButtonProps && isNotEmpty && /*#__PURE__*/React__default.createElement(IconButton, _extends({}, clearButtonProps, {
|
|
13459
|
+
}), clearButtonProps && isNotEmpty && !isAnyDisabled && /*#__PURE__*/React__default.createElement(IconButton, _extends({}, clearButtonProps, {
|
|
13467
13460
|
className: `${CLASSNAME$5}__input-clear`,
|
|
13468
13461
|
icon: mdiCloseCircle,
|
|
13469
13462
|
emphasis: Emphasis.low,
|