@innovaccer/design-system 2.24.0 → 2.25.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/CHANGELOG.md +36 -0
- package/css/dist/index.css +129 -1
- package/css/dist/index.css.map +1 -1
- package/css/src/components/card.css +0 -1
- package/css/src/components/listbox.css +115 -0
- package/css/src/core/animation.css +11 -0
- package/dist/.lib/tsconfig.type.tsbuildinfo +209 -4
- package/dist/core/components/organisms/listbox/Listbox.d.ts +33 -0
- package/dist/core/components/organisms/listbox/index.d.ts +3 -0
- package/dist/core/components/organisms/listbox/listboxItem/ListBody.d.ts +3 -0
- package/dist/core/components/organisms/listbox/listboxItem/ListboxItem.d.ts +23 -0
- package/dist/core/components/organisms/listbox/listboxItem/index.d.ts +1 -0
- package/dist/core/components/organisms/listbox/nestedList/Animation.d.ts +2 -0
- package/dist/core/components/organisms/listbox/nestedList/NestedList.d.ts +7 -0
- package/dist/core/components/organisms/listbox/nestedList/index.d.ts +1 -0
- package/dist/core/components/organisms/listbox/reorderList/Draggable.d.ts +71 -0
- package/dist/core/components/organisms/listbox/reorderList/DraggableList.d.ts +2 -0
- package/dist/core/components/organisms/listbox/reorderList/index.d.ts +1 -0
- package/dist/core/components/organisms/listbox/reorderList/types.d.ts +46 -0
- package/dist/core/components/organisms/listbox/reorderList/utils.d.ts +10 -0
- package/dist/core/components/organisms/listbox/utils.d.ts +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.type.d.ts +1 -0
- package/dist/index.esm.js +1043 -86
- package/dist/index.js +925 -3
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
* Generated on:
|
|
3
|
+
* Generated on: 1699952738463
|
|
4
4
|
* Package: @innovaccer/design-system
|
|
5
|
-
* Version: v2.
|
|
5
|
+
* Version: v2.25.0
|
|
6
6
|
* License: MIT
|
|
7
7
|
* Docs: https://innovaccer.github.io/design-system
|
|
8
8
|
*/
|
|
@@ -1227,7 +1227,7 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
1227
1227
|
})));
|
|
1228
1228
|
};
|
|
1229
1229
|
|
|
1230
|
-
var _excluded$
|
|
1230
|
+
var _excluded$G = ["size", "appearance", "iconAlign", "tabIndex", "largeIcon", "type", "children", "icon", "expanded", "selected", "loading", "disabled", "className", "tooltip", "iconType"];
|
|
1231
1231
|
var sizeMapping$3 = {
|
|
1232
1232
|
tiny: 12,
|
|
1233
1233
|
regular: 16,
|
|
@@ -1256,7 +1256,7 @@ var ButtonElement = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
1256
1256
|
className = props.className;
|
|
1257
1257
|
props.tooltip;
|
|
1258
1258
|
var iconType = props.iconType,
|
|
1259
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
1259
|
+
rest = _objectWithoutProperties(props, _excluded$G);
|
|
1260
1260
|
|
|
1261
1261
|
var buttonClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Button', true), _defineProperty$1(_classNames, 'Button--expanded', expanded), _defineProperty$1(_classNames, "Button--".concat(size), size), _defineProperty$1(_classNames, "Button--".concat(size, "Square"), !children), _defineProperty$1(_classNames, "Button--".concat(appearance), appearance), _defineProperty$1(_classNames, 'Button--selected', selected && (appearance === 'basic' || appearance === 'transparent')), _defineProperty$1(_classNames, "Button--iconAlign-".concat(iconAlign), children && iconAlign), _defineProperty$1(_classNames, "".concat(className), className), _classNames));
|
|
1262
1262
|
var iconClass = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'Button-icon', true), _defineProperty$1(_classNames2, "Button-icon--".concat(iconAlign), children && iconAlign), _classNames2));
|
|
@@ -2565,7 +2565,7 @@ _defineProperty$1(Calendar, "defaultProps", {
|
|
|
2565
2565
|
jumpView: true
|
|
2566
2566
|
});
|
|
2567
2567
|
|
|
2568
|
-
var _excluded$
|
|
2568
|
+
var _excluded$F = ["shadow", "children", "className"];
|
|
2569
2569
|
var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
2570
2570
|
var _classNames;
|
|
2571
2571
|
|
|
@@ -2573,7 +2573,7 @@ var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
2573
2573
|
shadow = _props$shadow === void 0 ? 'shadow10' : _props$shadow,
|
|
2574
2574
|
children = props.children,
|
|
2575
2575
|
className = props.className,
|
|
2576
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
2576
|
+
rest = _objectWithoutProperties(props, _excluded$F);
|
|
2577
2577
|
|
|
2578
2578
|
var classes = classnames((_classNames = {
|
|
2579
2579
|
Card: true
|
|
@@ -2590,12 +2590,12 @@ Card.defaultProps = {
|
|
|
2590
2590
|
shadow: 'shadow10'
|
|
2591
2591
|
};
|
|
2592
2592
|
|
|
2593
|
-
var _excluded$
|
|
2593
|
+
var _excluded$E = ["border", "children", "className"];
|
|
2594
2594
|
var CardSubdued = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
2595
2595
|
var border = props.border,
|
|
2596
2596
|
children = props.children,
|
|
2597
2597
|
className = props.className,
|
|
2598
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
2598
|
+
rest = _objectWithoutProperties(props, _excluded$E);
|
|
2599
2599
|
|
|
2600
2600
|
var classes = classnames(_defineProperty$1({
|
|
2601
2601
|
CardSubdued: true
|
|
@@ -2662,7 +2662,7 @@ var isSpaceKey = function isSpaceKey(e) {
|
|
|
2662
2662
|
return e.key === 'Space';
|
|
2663
2663
|
};
|
|
2664
2664
|
|
|
2665
|
-
var _excluded$
|
|
2665
|
+
var _excluded$D = ["onClick", "onKeyDown", "role", "tabIndex"];
|
|
2666
2666
|
var allowed = {
|
|
2667
2667
|
button: new Set(['Enter', 'Space', 'Spacebar', ' ']),
|
|
2668
2668
|
link: new Set(['Enter']),
|
|
@@ -2686,7 +2686,7 @@ var useAccessibilityProps = function useAccessibilityProps(_ref) {
|
|
|
2686
2686
|
_ref$role = _ref.role,
|
|
2687
2687
|
role = _ref$role === void 0 ? 'button' : _ref$role,
|
|
2688
2688
|
tabIndex = _ref.tabIndex,
|
|
2689
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
2689
|
+
rest = _objectWithoutProperties(_ref, _excluded$D);
|
|
2690
2690
|
|
|
2691
2691
|
return _objectSpread2({}, onClick ? {
|
|
2692
2692
|
onClick: onClick,
|
|
@@ -2804,21 +2804,21 @@ Icon.defaultProps = {
|
|
|
2804
2804
|
size: 16
|
|
2805
2805
|
};
|
|
2806
2806
|
|
|
2807
|
-
var _excluded$
|
|
2807
|
+
var _excluded$C = ["children", "componentType", "className"];
|
|
2808
2808
|
|
|
2809
2809
|
var GenericText = function GenericText(_ref) {
|
|
2810
2810
|
var children = _ref.children,
|
|
2811
2811
|
_ref$componentType = _ref.componentType,
|
|
2812
2812
|
componentType = _ref$componentType === void 0 ? 'span' : _ref$componentType,
|
|
2813
2813
|
className = _ref.className,
|
|
2814
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2814
|
+
props = _objectWithoutProperties(_ref, _excluded$C);
|
|
2815
2815
|
|
|
2816
2816
|
return /*#__PURE__*/React.createElement(componentType, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2817
2817
|
className: className
|
|
2818
2818
|
}), children);
|
|
2819
2819
|
};
|
|
2820
2820
|
|
|
2821
|
-
var _excluded$
|
|
2821
|
+
var _excluded$B = ["appearance", "size", "children", "weight", "small", "className", "color"];
|
|
2822
2822
|
var Text = function Text(props) {
|
|
2823
2823
|
var _classNames;
|
|
2824
2824
|
|
|
@@ -2829,7 +2829,7 @@ var Text = function Text(props) {
|
|
|
2829
2829
|
small = props.small,
|
|
2830
2830
|
className = props.className,
|
|
2831
2831
|
color = props.color,
|
|
2832
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
2832
|
+
rest = _objectWithoutProperties(props, _excluded$B);
|
|
2833
2833
|
|
|
2834
2834
|
var classes = classnames((_classNames = {
|
|
2835
2835
|
Text: true
|
|
@@ -3116,7 +3116,7 @@ var CheckboxIcon = function CheckboxIcon(props) {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
};
|
|
3118
3118
|
|
|
3119
|
-
var _excluded$
|
|
3119
|
+
var _excluded$A = ["size", "tabIndex", "defaultChecked", "indeterminate", "label", "error", "disabled", "onChange", "name", "value", "className", "checked", "helpText", "id"];
|
|
3120
3120
|
var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
3121
3121
|
var _classNames, _classNames2, _classNames3, _classNames4, _classNames5, _classNames6;
|
|
3122
3122
|
|
|
@@ -3137,7 +3137,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
3137
3137
|
helpText = props.helpText,
|
|
3138
3138
|
_props$id = props.id,
|
|
3139
3139
|
id = _props$id === void 0 ? "".concat(name, "-").concat(label, "-").concat(uidGenerator()) : _props$id,
|
|
3140
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
3140
|
+
rest = _objectWithoutProperties(props, _excluded$A);
|
|
3141
3141
|
|
|
3142
3142
|
var ref = React.useRef(null);
|
|
3143
3143
|
React.useImperativeHandle(forwardedRef, function () {
|
|
@@ -3218,7 +3218,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
3218
3218
|
});
|
|
3219
3219
|
Checkbox.displayName = 'Checkbox';
|
|
3220
3220
|
|
|
3221
|
-
var _excluded$
|
|
3221
|
+
var _excluded$z = ["size", "sizeXS", "sizeS", "sizeM", "sizeL", "sizeXL", "className", "children"];
|
|
3222
3222
|
var Column = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
3223
3223
|
var _classNames;
|
|
3224
3224
|
|
|
@@ -3230,7 +3230,7 @@ var Column = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
3230
3230
|
sizeXL = props.sizeXL,
|
|
3231
3231
|
className = props.className,
|
|
3232
3232
|
children = props.children,
|
|
3233
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
3233
|
+
rest = _objectWithoutProperties(props, _excluded$z);
|
|
3234
3234
|
|
|
3235
3235
|
var classes = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Col', true), _defineProperty$1(_classNames, "Col--".concat(size), size), _defineProperty$1(_classNames, "Col--xs-".concat(sizeXS), sizeXS), _defineProperty$1(_classNames, "Col--s-".concat(sizeS), sizeS), _defineProperty$1(_classNames, "Col--m-".concat(sizeM), sizeM), _defineProperty$1(_classNames, "Col--l-".concat(sizeL), sizeL), _defineProperty$1(_classNames, "Col--xl-".concat(sizeXL), sizeXL), _defineProperty$1(_classNames, "".concat(className), className), _classNames));
|
|
3236
3236
|
return /*#__PURE__*/React.createElement("div", _extends$2({
|
|
@@ -3341,7 +3341,7 @@ var Trigger$1 = function Trigger(props) {
|
|
|
3341
3341
|
}));
|
|
3342
3342
|
};
|
|
3343
3343
|
|
|
3344
|
-
var _excluded$
|
|
3344
|
+
var _excluded$y = ["date", "open", "position", "inputFormat", "outputFormat", "inputOptions", "validators", "withInput", "disabledBefore", "disabledAfter", "onDateChange", "closeOnSelect", "size", "showTodayDate", "children", "view"];
|
|
3345
3345
|
var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
3346
3346
|
_inherits(DatePicker, _React$Component);
|
|
3347
3347
|
|
|
@@ -3484,7 +3484,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
3484
3484
|
_this$props4$children = _this$props4.children,
|
|
3485
3485
|
children = _this$props4$children === void 0 ? /*#__PURE__*/React.createElement(React.Fragment, null) : _this$props4$children,
|
|
3486
3486
|
view = _this$props4.view,
|
|
3487
|
-
rest = _objectWithoutProperties(_this$props4, _excluded$
|
|
3487
|
+
rest = _objectWithoutProperties(_this$props4, _excluded$y);
|
|
3488
3488
|
|
|
3489
3489
|
var date = this.state.date;
|
|
3490
3490
|
var months = config.months;
|
|
@@ -4548,7 +4548,7 @@ function debounce$1 (delay, atBegin, callback) {
|
|
|
4548
4548
|
return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
|
|
4549
4549
|
}
|
|
4550
4550
|
|
|
4551
|
-
var _excluded$
|
|
4551
|
+
var _excluded$x = ["triggerSize", "placeholder", "menu", "children", "icon", "disabled", "open", "inlineLabel", "error", "iconType"];
|
|
4552
4552
|
var DropdownButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
4553
4553
|
var _classNames, _classNames2;
|
|
4554
4554
|
|
|
@@ -4565,7 +4565,7 @@ var DropdownButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
4565
4565
|
inlineLabel = props.inlineLabel,
|
|
4566
4566
|
error = props.error,
|
|
4567
4567
|
iconType = props.iconType,
|
|
4568
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
4568
|
+
rest = _objectWithoutProperties(props, _excluded$x);
|
|
4569
4569
|
|
|
4570
4570
|
var buttonDisabled = disabled ? 'disabled' : 'default';
|
|
4571
4571
|
var trimmedPlaceholder = placeholder.trim();
|
|
@@ -5638,7 +5638,7 @@ var DropdownList = function DropdownList(props) {
|
|
|
5638
5638
|
|
|
5639
5639
|
DropdownList.displayName = 'DropdownList';
|
|
5640
5640
|
|
|
5641
|
-
var _excluded$
|
|
5641
|
+
var _excluded$w = ["triggerOptions", "selected", "tabIndex"];
|
|
5642
5642
|
var inputRef = /*#__PURE__*/React.createRef();
|
|
5643
5643
|
|
|
5644
5644
|
/**
|
|
@@ -6330,7 +6330,7 @@ var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
6330
6330
|
triggerOptions = _this$props14$trigger === void 0 ? {} : _this$props14$trigger;
|
|
6331
6331
|
_this$props14.selected;
|
|
6332
6332
|
var tabIndex = _this$props14.tabIndex,
|
|
6333
|
-
rest = _objectWithoutProperties(_this$props14, _excluded$
|
|
6333
|
+
rest = _objectWithoutProperties(_this$props14, _excluded$w);
|
|
6334
6334
|
|
|
6335
6335
|
var remainingOptionsLen = searchedOptionsLength - options.length;
|
|
6336
6336
|
var firstEnabledOption = tabIndex ? tabIndex : _isSelectAllPresent(searchTerm, remainingOptionsLen, withSelectAll, withCheckbox) ? 0 : options.findIndex(function (option) {
|
|
@@ -6378,7 +6378,7 @@ _defineProperty$1(Dropdown, "defaultProps", {
|
|
|
6378
6378
|
searchDebounceDuration: 300
|
|
6379
6379
|
});
|
|
6380
6380
|
|
|
6381
|
-
var _excluded$
|
|
6381
|
+
var _excluded$v = ["appearance", "size", "children", "className", "color"];
|
|
6382
6382
|
var sizeMap = {
|
|
6383
6383
|
s: 'h5',
|
|
6384
6384
|
m: 'h4',
|
|
@@ -6394,7 +6394,7 @@ var Heading = function Heading(props) {
|
|
|
6394
6394
|
children = props.children,
|
|
6395
6395
|
className = props.className,
|
|
6396
6396
|
color = props.color,
|
|
6397
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
6397
|
+
rest = _objectWithoutProperties(props, _excluded$v);
|
|
6398
6398
|
|
|
6399
6399
|
var classes = classnames((_classNames = {
|
|
6400
6400
|
Heading: true
|
|
@@ -6412,13 +6412,13 @@ Heading.defaultProps = {
|
|
|
6412
6412
|
size: 'm'
|
|
6413
6413
|
};
|
|
6414
6414
|
|
|
6415
|
-
var _excluded$
|
|
6415
|
+
var _excluded$u = ["className", "iconType"];
|
|
6416
6416
|
var ActionButton$1 = function ActionButton(props) {
|
|
6417
6417
|
var _classNames;
|
|
6418
6418
|
|
|
6419
6419
|
var className = props.className,
|
|
6420
6420
|
iconType = props.iconType,
|
|
6421
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
6421
|
+
rest = _objectWithoutProperties(props, _excluded$u);
|
|
6422
6422
|
|
|
6423
6423
|
var iconClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'ActionButton', true), _defineProperty$1(_classNames, "".concat(className), className), _classNames));
|
|
6424
6424
|
return /*#__PURE__*/React.createElement(Icon, _extends$2({
|
|
@@ -6433,7 +6433,7 @@ ActionButton$1.defaultProps = {
|
|
|
6433
6433
|
type: 'rounded'
|
|
6434
6434
|
};
|
|
6435
6435
|
|
|
6436
|
-
var _excluded$
|
|
6436
|
+
var _excluded$t = ["size", "type", "minWidth", "defaultValue", "name", "placeholder", "value", "icon", "inlineLabel", "required", "error", "info", "onChange", "onClick", "onClear", "onBlur", "onFocus", "onPaste", "actionIcon", "className", "autoFocus", "disabled", "readOnly", "iconType"];
|
|
6437
6437
|
var sizeMapping$2 = {
|
|
6438
6438
|
tiny: 12,
|
|
6439
6439
|
regular: 16,
|
|
@@ -6475,7 +6475,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
6475
6475
|
disabled = props.disabled,
|
|
6476
6476
|
readOnly = props.readOnly,
|
|
6477
6477
|
iconType = props.iconType,
|
|
6478
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
6478
|
+
rest = _objectWithoutProperties(props, _excluded$t);
|
|
6479
6479
|
|
|
6480
6480
|
var ref = React.useRef(null);
|
|
6481
6481
|
|
|
@@ -6584,7 +6584,7 @@ Object.assign(Input, {
|
|
|
6584
6584
|
ActionButton: ActionButton$1
|
|
6585
6585
|
});
|
|
6586
6586
|
|
|
6587
|
-
var _excluded$
|
|
6587
|
+
var _excluded$s = ["size", "defaultValue", "name", "placeholder", "icon", "prefix", "suffix", "error", "min", "max", "onChange", "onClick", "onBlur", "onFocus", "className", "autoFocus", "disabled", "readOnly", "value", "showActionButton", "onKeyDown", "iconType"];
|
|
6588
6588
|
var sizeMapping$1 = {
|
|
6589
6589
|
regular: 16,
|
|
6590
6590
|
large: 20
|
|
@@ -6635,7 +6635,7 @@ var MetricInput = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
6635
6635
|
showActionButton = _props$showActionButt === void 0 ? true : _props$showActionButt,
|
|
6636
6636
|
onKeyDown = props.onKeyDown,
|
|
6637
6637
|
iconType = props.iconType,
|
|
6638
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
6638
|
+
rest = _objectWithoutProperties(props, _excluded$s);
|
|
6639
6639
|
|
|
6640
6640
|
var ref = React.useRef(null);
|
|
6641
6641
|
var isUncontrolled = valueProp === undefined;
|
|
@@ -6799,7 +6799,7 @@ var getDefaultValue = function getDefaultValue(mask, placeholderChar) {
|
|
|
6799
6799
|
return val;
|
|
6800
6800
|
};
|
|
6801
6801
|
|
|
6802
|
-
var _excluded$
|
|
6802
|
+
var _excluded$r = ["mask", "value", "placeholderChar", "validators", "clearOnEmptyBlur", "defaultValue", "mask", "error", "caption", "required", "onChange", "onPaste", "onBlur", "onFocus", "onClear", "className", "id", "helpText"];
|
|
6803
6803
|
|
|
6804
6804
|
/**
|
|
6805
6805
|
* It works as Uncontrolled Input
|
|
@@ -6828,7 +6828,7 @@ var InputMask = /*#__PURE__*/React.forwardRef(function (props, forwardRef) {
|
|
|
6828
6828
|
className = props.className,
|
|
6829
6829
|
id = props.id,
|
|
6830
6830
|
helpText = props.helpText,
|
|
6831
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
6831
|
+
rest = _objectWithoutProperties(props, _excluded$r);
|
|
6832
6832
|
|
|
6833
6833
|
var isEditable = React.useCallback(function (pos) {
|
|
6834
6834
|
return _typeof(mask[pos]) === 'object';
|
|
@@ -7132,7 +7132,7 @@ InputMask.utils = {
|
|
|
7132
7132
|
};
|
|
7133
7133
|
var X = InputMask;
|
|
7134
7134
|
|
|
7135
|
-
var _excluded$
|
|
7135
|
+
var _excluded$q = ["required", "optional", "withInput", "disabled", "children", "className", "info"];
|
|
7136
7136
|
|
|
7137
7137
|
/**
|
|
7138
7138
|
* *NOTE: Extends props with HTMLProps<HTMLLabelElement>*
|
|
@@ -7147,7 +7147,7 @@ var Label = function Label(props) {
|
|
|
7147
7147
|
children = props.children,
|
|
7148
7148
|
className = props.className,
|
|
7149
7149
|
info = props.info,
|
|
7150
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
7150
|
+
rest = _objectWithoutProperties(props, _excluded$q);
|
|
7151
7151
|
|
|
7152
7152
|
var baseProps = extractBaseProps(props);
|
|
7153
7153
|
var LabelClass = classnames((_classNames = {
|
|
@@ -7305,7 +7305,7 @@ var Editable = function Editable(props) {
|
|
|
7305
7305
|
};
|
|
7306
7306
|
Editable.displayName = 'Editable';
|
|
7307
7307
|
|
|
7308
|
-
var _excluded$
|
|
7308
|
+
var _excluded$p = ["onChange", "onClose"];
|
|
7309
7309
|
var EditableDropdown = function EditableDropdown(props) {
|
|
7310
7310
|
var _classNames2;
|
|
7311
7311
|
|
|
@@ -7316,7 +7316,7 @@ var EditableDropdown = function EditableDropdown(props) {
|
|
|
7316
7316
|
|
|
7317
7317
|
var onDropdownChange = dropdownOptions.onChange,
|
|
7318
7318
|
onDropdownClose = dropdownOptions.onClose,
|
|
7319
|
-
rest = _objectWithoutProperties(dropdownOptions, _excluded$
|
|
7319
|
+
rest = _objectWithoutProperties(dropdownOptions, _excluded$p);
|
|
7320
7320
|
|
|
7321
7321
|
var _React$useState = React.useState(placeholder),
|
|
7322
7322
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -7398,7 +7398,7 @@ EditableDropdown.defaultProps = {
|
|
|
7398
7398
|
dropdownOptions: {}
|
|
7399
7399
|
};
|
|
7400
7400
|
|
|
7401
|
-
var _excluded$
|
|
7401
|
+
var _excluded$o = ["children", "className", "appearance", "size", "disabled"];
|
|
7402
7402
|
var Link = function Link(props) {
|
|
7403
7403
|
var _classNames;
|
|
7404
7404
|
|
|
@@ -7407,7 +7407,7 @@ var Link = function Link(props) {
|
|
|
7407
7407
|
appearance = props.appearance,
|
|
7408
7408
|
size = props.size,
|
|
7409
7409
|
disabled = props.disabled,
|
|
7410
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
7410
|
+
rest = _objectWithoutProperties(props, _excluded$o);
|
|
7411
7411
|
|
|
7412
7412
|
var classes = classnames((_classNames = {
|
|
7413
7413
|
Link: true
|
|
@@ -8303,12 +8303,12 @@ _defineProperty$1(MultiSlider, "defaultProps", {
|
|
|
8303
8303
|
|
|
8304
8304
|
_defineProperty$1(MultiSlider, "Handle", MultiSliderHandle);
|
|
8305
8305
|
|
|
8306
|
-
var _excluded$
|
|
8306
|
+
var _excluded$n = ["children", "className", "onOutsideClick"];
|
|
8307
8307
|
var OutsideClick = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
8308
8308
|
var children = props.children,
|
|
8309
8309
|
className = props.className,
|
|
8310
8310
|
onOutsideClick = props.onOutsideClick,
|
|
8311
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8311
|
+
rest = _objectWithoutProperties(props, _excluded$n);
|
|
8312
8312
|
|
|
8313
8313
|
var innerRef = React.useRef(null);
|
|
8314
8314
|
React.useImperativeHandle(ref, function () {
|
|
@@ -8340,7 +8340,7 @@ var OutsideClick = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8340
8340
|
});
|
|
8341
8341
|
OutsideClick.displayName = 'OutsideClick';
|
|
8342
8342
|
|
|
8343
|
-
var _excluded$
|
|
8343
|
+
var _excluded$m = ["appearance", "children", "className", "color"];
|
|
8344
8344
|
var Paragraph = function Paragraph(props) {
|
|
8345
8345
|
var _classNames;
|
|
8346
8346
|
|
|
@@ -8348,7 +8348,7 @@ var Paragraph = function Paragraph(props) {
|
|
|
8348
8348
|
children = props.children,
|
|
8349
8349
|
className = props.className,
|
|
8350
8350
|
color = props.color,
|
|
8351
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8351
|
+
rest = _objectWithoutProperties(props, _excluded$m);
|
|
8352
8352
|
|
|
8353
8353
|
var classes = classnames((_classNames = {
|
|
8354
8354
|
Text: true
|
|
@@ -8396,7 +8396,7 @@ ProgressBar.defaultProps = {
|
|
|
8396
8396
|
size: 'regular'
|
|
8397
8397
|
};
|
|
8398
8398
|
|
|
8399
|
-
var _excluded$
|
|
8399
|
+
var _excluded$l = ["size", "label", "disabled", "onChange", "name", "value", "checked", "defaultChecked", "className", "helpText", "error"];
|
|
8400
8400
|
var Radio = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
8401
8401
|
var _classNames, _classNames2, _classNames3;
|
|
8402
8402
|
|
|
@@ -8412,7 +8412,7 @@ var Radio = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
8412
8412
|
className = props.className,
|
|
8413
8413
|
helpText = props.helpText,
|
|
8414
8414
|
error = props.error,
|
|
8415
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8415
|
+
rest = _objectWithoutProperties(props, _excluded$l);
|
|
8416
8416
|
|
|
8417
8417
|
var ref = React.useRef(null);
|
|
8418
8418
|
React.useImperativeHandle(forwardedRef, function () {
|
|
@@ -8463,11 +8463,11 @@ var Radio = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
|
|
|
8463
8463
|
});
|
|
8464
8464
|
Radio.displayName = 'Radio';
|
|
8465
8465
|
|
|
8466
|
-
var _excluded$
|
|
8466
|
+
var _excluded$k = ["className", "children"];
|
|
8467
8467
|
var Row = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
8468
8468
|
var className = props.className,
|
|
8469
8469
|
children = props.children,
|
|
8470
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8470
|
+
rest = _objectWithoutProperties(props, _excluded$k);
|
|
8471
8471
|
|
|
8472
8472
|
var classes = classnames(_defineProperty$1({
|
|
8473
8473
|
Row: true
|
|
@@ -8584,13 +8584,13 @@ Spinner.defaultProps = {
|
|
|
8584
8584
|
size: 'medium'
|
|
8585
8585
|
};
|
|
8586
8586
|
|
|
8587
|
-
var _excluded$
|
|
8587
|
+
var _excluded$j = ["value", "defaultValue", "onRelease", "onChange"];
|
|
8588
8588
|
var Slider = function Slider(props) {
|
|
8589
8589
|
var valueProp = props.value,
|
|
8590
8590
|
defaultValue = props.defaultValue,
|
|
8591
8591
|
onRelease = props.onRelease,
|
|
8592
8592
|
onChange = props.onChange,
|
|
8593
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8593
|
+
rest = _objectWithoutProperties(props, _excluded$j);
|
|
8594
8594
|
|
|
8595
8595
|
var _React$useState = React.useState(valueProp === undefined ? defaultValue : valueProp),
|
|
8596
8596
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -8623,7 +8623,7 @@ Slider.defaultProps = _objectSpread2(_objectSpread2({}, MultiSlider.defaultProps
|
|
|
8623
8623
|
defaultValue: 0
|
|
8624
8624
|
});
|
|
8625
8625
|
|
|
8626
|
-
var _excluded$
|
|
8626
|
+
var _excluded$i = ["value", "defaultValue", "onChange", "onRelease"];
|
|
8627
8627
|
var RangeIndex;
|
|
8628
8628
|
|
|
8629
8629
|
(function (RangeIndex) {
|
|
@@ -8636,7 +8636,7 @@ var RangeSlider = function RangeSlider(props) {
|
|
|
8636
8636
|
defaultValue = props.defaultValue,
|
|
8637
8637
|
onChange = props.onChange,
|
|
8638
8638
|
onRelease = props.onRelease,
|
|
8639
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8639
|
+
rest = _objectWithoutProperties(props, _excluded$i);
|
|
8640
8640
|
|
|
8641
8641
|
var _React$useState = React.useState(valueProp === undefined ? defaultValue : valueProp),
|
|
8642
8642
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -8672,7 +8672,7 @@ RangeSlider.defaultProps = _objectSpread2(_objectSpread2({}, MultiSlider.default
|
|
|
8672
8672
|
defaultValue: [0, 10]
|
|
8673
8673
|
});
|
|
8674
8674
|
|
|
8675
|
-
var _excluded$
|
|
8675
|
+
var _excluded$h = ["appearance", "children", "className", "color"];
|
|
8676
8676
|
var Subheading = function Subheading(props) {
|
|
8677
8677
|
var _classNames;
|
|
8678
8678
|
|
|
@@ -8680,7 +8680,7 @@ var Subheading = function Subheading(props) {
|
|
|
8680
8680
|
children = props.children,
|
|
8681
8681
|
className = props.className,
|
|
8682
8682
|
color = props.color,
|
|
8683
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8683
|
+
rest = _objectWithoutProperties(props, _excluded$h);
|
|
8684
8684
|
|
|
8685
8685
|
var classes = classnames((_classNames = {
|
|
8686
8686
|
Subheading: true
|
|
@@ -8697,7 +8697,7 @@ Subheading.defaultProps = {
|
|
|
8697
8697
|
appearance: 'default'
|
|
8698
8698
|
};
|
|
8699
8699
|
|
|
8700
|
-
var _excluded$
|
|
8700
|
+
var _excluded$g = ["size", "defaultChecked", "disabled", "onChange", "name", "value", "className", "appearance", "checked"];
|
|
8701
8701
|
|
|
8702
8702
|
/**
|
|
8703
8703
|
* ######Switch has two types:
|
|
@@ -8717,7 +8717,7 @@ var Switch = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8717
8717
|
className = props.className;
|
|
8718
8718
|
props.appearance;
|
|
8719
8719
|
var checkedProp = props.checked,
|
|
8720
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8720
|
+
rest = _objectWithoutProperties(props, _excluded$g);
|
|
8721
8721
|
|
|
8722
8722
|
var _React$useState = React.useState(checkedProp === undefined ? defaultChecked : checkedProp),
|
|
8723
8723
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -8756,7 +8756,7 @@ var Switch = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8756
8756
|
});
|
|
8757
8757
|
Switch.displayName = 'Switch';
|
|
8758
8758
|
|
|
8759
|
-
var _excluded$
|
|
8759
|
+
var _excluded$f = ["rows", "resize", "disabled", "name", "placeholder", "value", "defaultValue", "required", "error", "onChange", "onClick", "onBlur", "onFocus", "className"];
|
|
8760
8760
|
var Textarea = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
8761
8761
|
var _classNames;
|
|
8762
8762
|
|
|
@@ -8776,7 +8776,7 @@ var Textarea = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8776
8776
|
onBlur = props.onBlur,
|
|
8777
8777
|
onFocus = props.onFocus,
|
|
8778
8778
|
className = props.className,
|
|
8779
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
8779
|
+
rest = _objectWithoutProperties(props, _excluded$f);
|
|
8780
8780
|
|
|
8781
8781
|
var classes = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Textarea', true), _defineProperty$1(_classNames, 'Textarea--resize', resize), _defineProperty$1(_classNames, 'Textarea--error', error), _classNames), className);
|
|
8782
8782
|
return /*#__PURE__*/React.createElement("textarea", _extends$2({
|
|
@@ -13905,7 +13905,7 @@ _defineProperty$1(PopperWrapper, "defaultProps", {
|
|
|
13905
13905
|
style: {}
|
|
13906
13906
|
});
|
|
13907
13907
|
|
|
13908
|
-
var _excluded$
|
|
13908
|
+
var _excluded$e = ["position", "customStyle", "dark", "children", "onToggle", "className", "hideOnReferenceEscape", "boundaryElement"];
|
|
13909
13909
|
var propsList = ['appendToBody', 'trigger', 'hoverable', 'on', 'open', 'closeOnBackdropClick', 'offset', 'closeOnScroll'];
|
|
13910
13910
|
var Popover = function Popover(props) {
|
|
13911
13911
|
var position = props.position,
|
|
@@ -13917,7 +13917,7 @@ var Popover = function Popover(props) {
|
|
|
13917
13917
|
hideOnReferenceEscape = props.hideOnReferenceEscape,
|
|
13918
13918
|
_props$boundaryElemen = props.boundaryElement,
|
|
13919
13919
|
boundaryElement = _props$boundaryElemen === void 0 ? document.body : _props$boundaryElemen,
|
|
13920
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
13920
|
+
rest = _objectWithoutProperties(props, _excluded$e);
|
|
13921
13921
|
|
|
13922
13922
|
var _React$useState = React.useState(!!props.open),
|
|
13923
13923
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -13969,7 +13969,7 @@ Popover.defaultProps = Object.assign({}, filterProps(PopperWrapper.defaultProps,
|
|
|
13969
13969
|
customStyle: {}
|
|
13970
13970
|
});
|
|
13971
13971
|
|
|
13972
|
-
var _excluded$
|
|
13972
|
+
var _excluded$d = ["type", "onClick"];
|
|
13973
13973
|
var keyCodes = {
|
|
13974
13974
|
BACKSPACE: 'Backspace',
|
|
13975
13975
|
DELETE: 'Delete',
|
|
@@ -14088,7 +14088,7 @@ var ChipInput = function ChipInput(props) {
|
|
|
14088
14088
|
var _chipOptions$type = chipOptions.type,
|
|
14089
14089
|
type = _chipOptions$type === void 0 ? 'input' : _chipOptions$type,
|
|
14090
14090
|
_onClick = chipOptions.onClick,
|
|
14091
|
-
rest = _objectWithoutProperties(chipOptions, _excluded$
|
|
14091
|
+
rest = _objectWithoutProperties(chipOptions, _excluded$d);
|
|
14092
14092
|
|
|
14093
14093
|
return /*#__PURE__*/React.createElement(Chip, _extends$2({
|
|
14094
14094
|
"data-test": "DesignSystem-ChipInput--Chip",
|
|
@@ -14562,7 +14562,7 @@ var HorizontalNav = function HorizontalNav(props) {
|
|
|
14562
14562
|
}), list);
|
|
14563
14563
|
};
|
|
14564
14564
|
|
|
14565
|
-
var _excluded$
|
|
14565
|
+
var _excluded$c = ["children", "tooltip"];
|
|
14566
14566
|
var tooltipPropsList = ['trigger', 'on', 'open', 'offset', 'onToggle', 'dark', 'customStyle', 'closeOnBackdropClick', 'hideOnReferenceEscape', 'closeOnScroll'];
|
|
14567
14567
|
var positionValue = {
|
|
14568
14568
|
bottom: 'bottom',
|
|
@@ -14577,7 +14577,7 @@ var positionValue = {
|
|
|
14577
14577
|
var Tooltip = function Tooltip(props) {
|
|
14578
14578
|
var children = props.children,
|
|
14579
14579
|
tooltip = props.tooltip,
|
|
14580
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
14580
|
+
rest = _objectWithoutProperties(props, _excluded$c);
|
|
14581
14581
|
|
|
14582
14582
|
var tooltipWrapper = /*#__PURE__*/React.createElement("div", {
|
|
14583
14583
|
className: "Tooltip"
|
|
@@ -14653,7 +14653,7 @@ Dialog.defaultProps = {
|
|
|
14653
14653
|
secondaryButtonAppearance: 'basic'
|
|
14654
14654
|
};
|
|
14655
14655
|
|
|
14656
|
-
var _excluded$
|
|
14656
|
+
var _excluded$b = ["label"];
|
|
14657
14657
|
var OverlayFooter = function OverlayFooter(props) {
|
|
14658
14658
|
var open = props.open,
|
|
14659
14659
|
className = props.className,
|
|
@@ -14690,7 +14690,7 @@ var OverlayFooter = function OverlayFooter(props) {
|
|
|
14690
14690
|
className: classes
|
|
14691
14691
|
}), actions.map(function (_ref, index) {
|
|
14692
14692
|
_ref.label;
|
|
14693
|
-
var options = _objectWithoutProperties(_ref, _excluded$
|
|
14693
|
+
var options = _objectWithoutProperties(_ref, _excluded$b);
|
|
14694
14694
|
|
|
14695
14695
|
return /*#__PURE__*/React.createElement(Button, _extends$2({
|
|
14696
14696
|
type: "button"
|
|
@@ -16051,7 +16051,7 @@ Pagination.defaultProps = {
|
|
|
16051
16051
|
pageJumpDebounceDuration: 750
|
|
16052
16052
|
};
|
|
16053
16053
|
|
|
16054
|
-
var _excluded$
|
|
16054
|
+
var _excluded$a = ["onChange"];
|
|
16055
16055
|
var EditableInput = function EditableInput(props) {
|
|
16056
16056
|
var _classNames2, _classNames4;
|
|
16057
16057
|
|
|
@@ -16065,7 +16065,7 @@ var EditableInput = function EditableInput(props) {
|
|
|
16065
16065
|
className = props.className;
|
|
16066
16066
|
|
|
16067
16067
|
var onInputChange = inputOptions.onChange,
|
|
16068
|
-
rest = _objectWithoutProperties(inputOptions, _excluded$
|
|
16068
|
+
rest = _objectWithoutProperties(inputOptions, _excluded$a);
|
|
16069
16069
|
|
|
16070
16070
|
var _React$useState = React.useState(props.value),
|
|
16071
16071
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -16228,7 +16228,7 @@ EditableInput.defaultProps = {
|
|
|
16228
16228
|
inputOptions: {}
|
|
16229
16229
|
};
|
|
16230
16230
|
|
|
16231
|
-
var _excluded$
|
|
16231
|
+
var _excluded$9 = ["onChange", "chipOptions"],
|
|
16232
16232
|
_excluded2$1 = ["onClick"];
|
|
16233
16233
|
var EditableChipInput = function EditableChipInput(props) {
|
|
16234
16234
|
var _classNames3;
|
|
@@ -16242,7 +16242,7 @@ var EditableChipInput = function EditableChipInput(props) {
|
|
|
16242
16242
|
var onChipInputChange = chipInputOptions.onChange,
|
|
16243
16243
|
_chipInputOptions$chi = chipInputOptions.chipOptions,
|
|
16244
16244
|
chipOptions = _chipInputOptions$chi === void 0 ? {} : _chipInputOptions$chi,
|
|
16245
|
-
rest = _objectWithoutProperties(chipInputOptions, _excluded$
|
|
16245
|
+
rest = _objectWithoutProperties(chipInputOptions, _excluded$9);
|
|
16246
16246
|
|
|
16247
16247
|
var _onClick = chipOptions.onClick,
|
|
16248
16248
|
chipObject = _objectWithoutProperties(chipOptions, _excluded2$1);
|
|
@@ -17058,7 +17058,7 @@ var getCustomDates = function getCustomDates() {
|
|
|
17058
17058
|
};
|
|
17059
17059
|
};
|
|
17060
17060
|
|
|
17061
|
-
var _excluded$
|
|
17061
|
+
var _excluded$8 = ["startDate", "endDate", "yearNav", "monthNav", "open", "inputFormat", "outputFormat", "startInputOptions", "endInputOptions", "validators", "withInput", "position", "disabledBefore", "disabledAfter", "onRangeChange", "rangeLimit"];
|
|
17062
17062
|
var DateRangePicker = /*#__PURE__*/function (_React$Component) {
|
|
17063
17063
|
_inherits(DateRangePicker, _React$Component);
|
|
17064
17064
|
|
|
@@ -17328,7 +17328,7 @@ var DateRangePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
17328
17328
|
disabledAfter = _this$props6.disabledAfter;
|
|
17329
17329
|
_this$props6.onRangeChange;
|
|
17330
17330
|
var rangeLimit = _this$props6.rangeLimit,
|
|
17331
|
-
rest = _objectWithoutProperties(_this$props6, _excluded$
|
|
17331
|
+
rest = _objectWithoutProperties(_this$props6, _excluded$8);
|
|
17332
17332
|
|
|
17333
17333
|
var _this$state3 = this.state,
|
|
17334
17334
|
startDate = _this$state3.startDate,
|
|
@@ -18232,7 +18232,7 @@ function _fromFileEntry() {
|
|
|
18232
18232
|
return _fromFileEntry.apply(this, arguments);
|
|
18233
18233
|
}
|
|
18234
18234
|
|
|
18235
|
-
var _excluded$
|
|
18235
|
+
var _excluded$7 = ["refKey", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnterCallback", "onDragOverCallback", "onDragLeaveCallback", "onDropCallback"],
|
|
18236
18236
|
_excluded2 = ["refKey", "onChange", "onClick"];
|
|
18237
18237
|
var initialState = {
|
|
18238
18238
|
isFocused: false,
|
|
@@ -18510,7 +18510,7 @@ var DropzoneBase = function DropzoneBase(props) {
|
|
|
18510
18510
|
onDragOverCallback = _ref.onDragOverCallback,
|
|
18511
18511
|
onDragLeaveCallback = _ref.onDragLeaveCallback,
|
|
18512
18512
|
onDropCallback = _ref.onDropCallback,
|
|
18513
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18513
|
+
rest = _objectWithoutProperties(_ref, _excluded$7);
|
|
18514
18514
|
|
|
18515
18515
|
return _objectSpread2(_defineProperty$1({
|
|
18516
18516
|
onDragEnter: composeDragHandler(composeEventHandlers(onDragEnterCallback, onDragEnterCb)),
|
|
@@ -20708,7 +20708,7 @@ Header.defaultProps = {
|
|
|
20708
20708
|
showFilters: true
|
|
20709
20709
|
};
|
|
20710
20710
|
|
|
20711
|
-
var _excluded$
|
|
20711
|
+
var _excluded$6 = ["children"];
|
|
20712
20712
|
|
|
20713
20713
|
var defaultErrorTemplate = function defaultErrorTemplate(props) {
|
|
20714
20714
|
var _props$errorType = props.errorType,
|
|
@@ -21093,7 +21093,7 @@ var Table = /*#__PURE__*/function (_React$Component) {
|
|
|
21093
21093
|
|
|
21094
21094
|
var _ref = headerOptions,
|
|
21095
21095
|
headerChildren = _ref.children,
|
|
21096
|
-
headerAttr = _objectWithoutProperties(_ref, _excluded$
|
|
21096
|
+
headerAttr = _objectWithoutProperties(_ref, _excluded$6);
|
|
21097
21097
|
|
|
21098
21098
|
var classes = className ? " ".concat(className) : '';
|
|
21099
21099
|
var totalRecords = this.state.totalRecords;
|
|
@@ -21657,7 +21657,7 @@ FileList.defaultProps = {
|
|
|
21657
21657
|
};
|
|
21658
21658
|
FileList.displayName = 'FileList';
|
|
21659
21659
|
|
|
21660
|
-
var _excluded$
|
|
21660
|
+
var _excluded$5 = ["type", "fields", "placeholder", "autoFocus", "onComplete", "onFocus", "onBlur", "className", "value"];
|
|
21661
21661
|
var KEY_CODE = {
|
|
21662
21662
|
backspace: 'Backspace',
|
|
21663
21663
|
left: 'ArrowLeft',
|
|
@@ -21682,7 +21682,7 @@ var VerificationCodeInput = function VerificationCodeInput(props) {
|
|
|
21682
21682
|
onBlur = props.onBlur,
|
|
21683
21683
|
className = props.className;
|
|
21684
21684
|
props.value;
|
|
21685
|
-
var rest = _objectWithoutProperties(props, _excluded$
|
|
21685
|
+
var rest = _objectWithoutProperties(props, _excluded$5);
|
|
21686
21686
|
|
|
21687
21687
|
var initialValues = useMemo(function () {
|
|
21688
21688
|
if (props.value && props.value.length) {
|
|
@@ -22088,7 +22088,7 @@ var HelpText = function HelpText(props) {
|
|
|
22088
22088
|
};
|
|
22089
22089
|
HelpText.displayName = 'HelpText';
|
|
22090
22090
|
|
|
22091
|
-
var _excluded$
|
|
22091
|
+
var _excluded$4 = ["children", "type", "className", "disabled", "tabIndex", "icon", "subtle", "size", "iconAlign", "iconType"];
|
|
22092
22092
|
var sizeMapping = {
|
|
22093
22093
|
tiny: 12,
|
|
22094
22094
|
regular: 16
|
|
@@ -22106,7 +22106,7 @@ var LinkButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
22106
22106
|
size = props.size,
|
|
22107
22107
|
iconAlign = props.iconAlign,
|
|
22108
22108
|
iconType = props.iconType,
|
|
22109
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
22109
|
+
rest = _objectWithoutProperties(props, _excluded$4);
|
|
22110
22110
|
|
|
22111
22111
|
var buttonClass = classnames((_classNames = {}, _defineProperty$1(_classNames, 'LinkButton', true), _defineProperty$1(_classNames, "LinkButton--".concat(size), size), _defineProperty$1(_classNames, 'LinkButton--default', !subtle), _defineProperty$1(_classNames, 'LinkButton--subtle', subtle), _defineProperty$1(_classNames, "LinkButton--iconAlign-".concat(iconAlign), children && iconAlign), _defineProperty$1(_classNames, "".concat(className), className), _classNames));
|
|
22112
22112
|
var iconClass = classnames((_classNames2 = {}, _defineProperty$1(_classNames2, 'LinkButton-icon', true), _defineProperty$1(_classNames2, "LinkButton-icon--".concat(iconAlign), children && iconAlign), _classNames2));
|
|
@@ -22133,7 +22133,7 @@ LinkButton.defaultProps = {
|
|
|
22133
22133
|
iconAlign: 'left'
|
|
22134
22134
|
};
|
|
22135
22135
|
|
|
22136
|
-
var _excluded$
|
|
22136
|
+
var _excluded$3 = ["children", "disabled", "className", "zIndex", "onClick"];
|
|
22137
22137
|
var ActionCard = function ActionCard(props) {
|
|
22138
22138
|
var _classNames;
|
|
22139
22139
|
|
|
@@ -22142,7 +22142,7 @@ var ActionCard = function ActionCard(props) {
|
|
|
22142
22142
|
className = props.className,
|
|
22143
22143
|
zIndex = props.zIndex,
|
|
22144
22144
|
onClick = props.onClick,
|
|
22145
|
-
rest = _objectWithoutProperties(props, _excluded$
|
|
22145
|
+
rest = _objectWithoutProperties(props, _excluded$3);
|
|
22146
22146
|
|
|
22147
22147
|
var classes = classnames((_classNames = {}, _defineProperty$1(_classNames, 'ActionCard', true), _defineProperty$1(_classNames, 'ActionCard--disabled', disabled), _classNames), className);
|
|
22148
22148
|
|
|
@@ -22244,7 +22244,7 @@ function useSingleSelect() {
|
|
|
22244
22244
|
};
|
|
22245
22245
|
}
|
|
22246
22246
|
|
|
22247
|
-
var _excluded = ["children", "onClick", "disabled", "id", "cardValue", "overlayZIndex", "selected", "className"];
|
|
22247
|
+
var _excluded$2 = ["children", "onClick", "disabled", "id", "cardValue", "overlayZIndex", "selected", "className"];
|
|
22248
22248
|
var SelectionCard = function SelectionCard(props) {
|
|
22249
22249
|
var _classNames;
|
|
22250
22250
|
|
|
@@ -22256,7 +22256,7 @@ var SelectionCard = function SelectionCard(props) {
|
|
|
22256
22256
|
overlayZIndex = props.overlayZIndex,
|
|
22257
22257
|
selected = props.selected,
|
|
22258
22258
|
className = props.className,
|
|
22259
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
22259
|
+
rest = _objectWithoutProperties(props, _excluded$2);
|
|
22260
22260
|
|
|
22261
22261
|
var classes = classnames((_classNames = {}, _defineProperty$1(_classNames, 'Selection-card', true), _defineProperty$1(_classNames, 'Selection-card--selected', selected), _defineProperty$1(_classNames, 'Selection-card--disabled', disabled && !selected), _defineProperty$1(_classNames, 'Selection-card--selected-disabled', disabled && selected), _classNames), className);
|
|
22262
22262
|
|
|
@@ -22295,6 +22295,963 @@ SelectionCard.defaultProps = {
|
|
|
22295
22295
|
SelectionCard.useMultiSelect = useMultiSelect;
|
|
22296
22296
|
SelectionCard.useSingleSelect = useSingleSelect;
|
|
22297
22297
|
|
|
22298
|
-
|
|
22298
|
+
function arrayMove(array, from, to) {
|
|
22299
|
+
array = array.slice();
|
|
22300
|
+
array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);
|
|
22301
|
+
return array;
|
|
22302
|
+
}
|
|
22303
|
+
function getTranslateOffset(element) {
|
|
22304
|
+
var style = window.getComputedStyle(element);
|
|
22305
|
+
return Math.max(parseInt(style['margin-top'], 10), parseInt(style['margin-bottom'], 10)) + element.getBoundingClientRect().height;
|
|
22306
|
+
}
|
|
22307
|
+
function isTouchEvent(event) {
|
|
22308
|
+
return event.touches && event.touches.length || event.changedTouches && event.changedTouches.length;
|
|
22309
|
+
}
|
|
22310
|
+
function transformItem(element) {
|
|
22311
|
+
var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
22312
|
+
var offsetX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
22313
|
+
if (!element) return;
|
|
22314
|
+
|
|
22315
|
+
if (offsetY === null || offsetX === null) {
|
|
22316
|
+
element.style.removeProperty('transform');
|
|
22317
|
+
return;
|
|
22318
|
+
}
|
|
22319
|
+
|
|
22320
|
+
element.style.transform = "translate(".concat(offsetX, "px, ").concat(offsetY, "px)");
|
|
22321
|
+
}
|
|
22322
|
+
function setItemTransition(element, duration, timing) {
|
|
22323
|
+
if (element) {
|
|
22324
|
+
element.style['transition'] = "transform ".concat(duration, "ms").concat(timing ? " ".concat(timing) : '');
|
|
22325
|
+
}
|
|
22326
|
+
} // returns the "slot" for the targetValue, aka where it should go
|
|
22327
|
+
// in an ordered "array", it starts with -1 index
|
|
22328
|
+
|
|
22329
|
+
function binarySearch(array, targetValue) {
|
|
22330
|
+
var min = 0;
|
|
22331
|
+
var max = array.length - 1;
|
|
22332
|
+
var guess;
|
|
22333
|
+
|
|
22334
|
+
while (min <= max) {
|
|
22335
|
+
guess = Math.floor((max + min) / 2);
|
|
22336
|
+
|
|
22337
|
+
if (!array[guess + 1] || array[guess] <= targetValue && array[guess + 1] >= targetValue) {
|
|
22338
|
+
return guess;
|
|
22339
|
+
} else if (array[guess] < targetValue && array[guess + 1] < targetValue) {
|
|
22340
|
+
min = guess + 1;
|
|
22341
|
+
} else {
|
|
22342
|
+
max = guess - 1;
|
|
22343
|
+
}
|
|
22344
|
+
}
|
|
22345
|
+
|
|
22346
|
+
return -1;
|
|
22347
|
+
} // A throttle function that uses requestAnimationFrame to rate limit
|
|
22348
|
+
|
|
22349
|
+
var schd = function schd(fn) {
|
|
22350
|
+
var lastArgs = [];
|
|
22351
|
+
var frameId = null;
|
|
22352
|
+
|
|
22353
|
+
var wrapperFn = function wrapperFn() {
|
|
22354
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22355
|
+
args[_key] = arguments[_key];
|
|
22356
|
+
}
|
|
22357
|
+
|
|
22358
|
+
lastArgs = args;
|
|
22359
|
+
|
|
22360
|
+
if (frameId) {
|
|
22361
|
+
return;
|
|
22362
|
+
}
|
|
22363
|
+
|
|
22364
|
+
frameId = requestAnimationFrame(function () {
|
|
22365
|
+
frameId = null;
|
|
22366
|
+
fn.apply(void 0, _toConsumableArray(lastArgs));
|
|
22367
|
+
});
|
|
22368
|
+
};
|
|
22369
|
+
|
|
22370
|
+
wrapperFn.cancel = function () {
|
|
22371
|
+
if (frameId) {
|
|
22372
|
+
cancelAnimationFrame(frameId);
|
|
22373
|
+
}
|
|
22374
|
+
};
|
|
22375
|
+
|
|
22376
|
+
return wrapperFn;
|
|
22377
|
+
};
|
|
22378
|
+
|
|
22379
|
+
var AUTOSCROLL_ACTIVE_OFFSET = 200;
|
|
22380
|
+
var AUTOSCROLL_SPEED_RATIO = 10;
|
|
22381
|
+
|
|
22382
|
+
var Draggable = /*#__PURE__*/function (_React$Component) {
|
|
22383
|
+
_inherits(Draggable, _React$Component);
|
|
22384
|
+
|
|
22385
|
+
var _super = _createSuper(Draggable);
|
|
22386
|
+
|
|
22387
|
+
function Draggable(props) {
|
|
22388
|
+
var _this;
|
|
22389
|
+
|
|
22390
|
+
_classCallCheck(this, Draggable);
|
|
22391
|
+
|
|
22392
|
+
_this = _super.call(this, props);
|
|
22393
|
+
|
|
22394
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "listRef", /*#__PURE__*/React.createRef());
|
|
22395
|
+
|
|
22396
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "ghostRef", /*#__PURE__*/React.createRef());
|
|
22397
|
+
|
|
22398
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "topOffsets", []);
|
|
22399
|
+
|
|
22400
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "itemTranslateOffsets", []);
|
|
22401
|
+
|
|
22402
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "initialYOffset", 0);
|
|
22403
|
+
|
|
22404
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "lastScroll", 0);
|
|
22405
|
+
|
|
22406
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "lastYOffset", 0);
|
|
22407
|
+
|
|
22408
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "lastListYOffset", 0);
|
|
22409
|
+
|
|
22410
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "dropTimeout", void 0);
|
|
22411
|
+
|
|
22412
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "needle", -1);
|
|
22413
|
+
|
|
22414
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "afterIndex", -2);
|
|
22415
|
+
|
|
22416
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "state", {
|
|
22417
|
+
itemDragged: -1,
|
|
22418
|
+
itemDraggedOutOfBounds: -1,
|
|
22419
|
+
selectedItem: -1,
|
|
22420
|
+
initialX: 0,
|
|
22421
|
+
initialY: 0,
|
|
22422
|
+
targetX: 0,
|
|
22423
|
+
targetY: 0,
|
|
22424
|
+
targetHeight: 0,
|
|
22425
|
+
targetWidth: 0,
|
|
22426
|
+
scrollingSpeed: 0,
|
|
22427
|
+
scrollWindow: false
|
|
22428
|
+
});
|
|
22429
|
+
|
|
22430
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "schdOnMouseMove", void 0);
|
|
22431
|
+
|
|
22432
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "schdOnTouchMove", void 0);
|
|
22433
|
+
|
|
22434
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "schdOnEnd", void 0);
|
|
22435
|
+
|
|
22436
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "doScrolling", function () {
|
|
22437
|
+
var _this$state = _this.state,
|
|
22438
|
+
scrollingSpeed = _this$state.scrollingSpeed,
|
|
22439
|
+
scrollWindow = _this$state.scrollWindow;
|
|
22440
|
+
var listEl = _this.listRef.current;
|
|
22441
|
+
window.requestAnimationFrame(function () {
|
|
22442
|
+
if (scrollWindow) {
|
|
22443
|
+
window.scrollTo(window.pageXOffset, window.pageYOffset + scrollingSpeed * 1.5);
|
|
22444
|
+
} else {
|
|
22445
|
+
listEl.scrollTop += scrollingSpeed;
|
|
22446
|
+
}
|
|
22447
|
+
|
|
22448
|
+
if (scrollingSpeed !== 0) {
|
|
22449
|
+
_this.doScrolling();
|
|
22450
|
+
}
|
|
22451
|
+
});
|
|
22452
|
+
});
|
|
22453
|
+
|
|
22454
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "getChildren", function () {
|
|
22455
|
+
if (_this.listRef && _this.listRef.current) {
|
|
22456
|
+
return Array.from(_this.listRef.current.children);
|
|
22457
|
+
}
|
|
22458
|
+
|
|
22459
|
+
return [];
|
|
22460
|
+
});
|
|
22461
|
+
|
|
22462
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "calculateOffsets", function () {
|
|
22463
|
+
_this.topOffsets = _this.getChildren().map(function (item) {
|
|
22464
|
+
return item.getBoundingClientRect().top;
|
|
22465
|
+
});
|
|
22466
|
+
_this.itemTranslateOffsets = _this.getChildren().map(function (item) {
|
|
22467
|
+
return getTranslateOffset(item);
|
|
22468
|
+
});
|
|
22469
|
+
});
|
|
22470
|
+
|
|
22471
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "getTargetIndex", function (e) {
|
|
22472
|
+
return _this.getChildren().findIndex(function (child) {
|
|
22473
|
+
return child === e.target || child.contains(e.target);
|
|
22474
|
+
});
|
|
22475
|
+
});
|
|
22476
|
+
|
|
22477
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "onMouseOrTouchStart", function (e) {
|
|
22478
|
+
var _e$target;
|
|
22479
|
+
|
|
22480
|
+
if (_this.dropTimeout && _this.state.itemDragged > -1) {
|
|
22481
|
+
window.clearTimeout(_this.dropTimeout);
|
|
22482
|
+
|
|
22483
|
+
_this.finishDrop();
|
|
22484
|
+
}
|
|
22485
|
+
|
|
22486
|
+
var isTouch = isTouchEvent(e);
|
|
22487
|
+
if (!isTouch && e.button !== 0) return;
|
|
22488
|
+
|
|
22489
|
+
var index = _this.getTargetIndex(e);
|
|
22490
|
+
|
|
22491
|
+
var listItemTouched = _this.getChildren()[index];
|
|
22492
|
+
|
|
22493
|
+
var isValidDragHandle = (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.classList.contains('Listbox-item--drag-icon');
|
|
22494
|
+
if (!isValidDragHandle) return;
|
|
22495
|
+
e.preventDefault();
|
|
22496
|
+
|
|
22497
|
+
if (isTouch) {
|
|
22498
|
+
var opts = {
|
|
22499
|
+
passive: false
|
|
22500
|
+
};
|
|
22501
|
+
listItemTouched.style.touchAction = 'none';
|
|
22502
|
+
document.addEventListener('touchend', _this.schdOnEnd, opts);
|
|
22503
|
+
document.addEventListener('touchmove', _this.schdOnTouchMove, opts);
|
|
22504
|
+
document.addEventListener('touchcancel', _this.schdOnEnd, opts);
|
|
22505
|
+
} else {
|
|
22506
|
+
document.addEventListener('mousemove', _this.schdOnMouseMove);
|
|
22507
|
+
document.addEventListener('mouseup', _this.schdOnEnd);
|
|
22508
|
+
|
|
22509
|
+
var listItemDragged = _this.getChildren()[_this.state.itemDragged];
|
|
22510
|
+
|
|
22511
|
+
if (listItemDragged && listItemDragged.style) {
|
|
22512
|
+
listItemDragged.style.touchAction = '';
|
|
22513
|
+
}
|
|
22514
|
+
}
|
|
22515
|
+
|
|
22516
|
+
_this.onStart(listItemTouched, isTouch ? e.touches[0].clientX : e.clientX, isTouch ? e.touches[0].clientY : e.clientY, index);
|
|
22517
|
+
});
|
|
22518
|
+
|
|
22519
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "getYOffset", function () {
|
|
22520
|
+
var listScroll = _this.listRef.current ? _this.listRef.current.scrollTop : 0;
|
|
22521
|
+
return window.pageYOffset + listScroll;
|
|
22522
|
+
});
|
|
22523
|
+
|
|
22524
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "onStart", function (target, clientX, clientY, index) {
|
|
22525
|
+
if (_this.state.selectedItem > -1) {
|
|
22526
|
+
_this.setState({
|
|
22527
|
+
selectedItem: -1
|
|
22528
|
+
});
|
|
22529
|
+
|
|
22530
|
+
_this.needle = -1;
|
|
22531
|
+
}
|
|
22532
|
+
|
|
22533
|
+
var targetRect = target.getBoundingClientRect();
|
|
22534
|
+
var targetStyles = window.getComputedStyle(target);
|
|
22535
|
+
|
|
22536
|
+
_this.calculateOffsets();
|
|
22537
|
+
|
|
22538
|
+
_this.initialYOffset = _this.getYOffset();
|
|
22539
|
+
_this.lastYOffset = window.pageYOffset;
|
|
22540
|
+
_this.lastListYOffset = _this.listRef.current.scrollTop;
|
|
22541
|
+
|
|
22542
|
+
_this.setState({
|
|
22543
|
+
itemDragged: index,
|
|
22544
|
+
targetX: targetRect.left - parseInt(targetStyles['margin-left'], 10),
|
|
22545
|
+
targetY: targetRect.top - parseInt(targetStyles['margin-top'], 10),
|
|
22546
|
+
targetHeight: targetRect.height,
|
|
22547
|
+
targetWidth: targetRect.width,
|
|
22548
|
+
initialX: clientX,
|
|
22549
|
+
initialY: clientY
|
|
22550
|
+
});
|
|
22551
|
+
});
|
|
22552
|
+
|
|
22553
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "onMouseMove", function (e) {
|
|
22554
|
+
e.cancelable && e.preventDefault();
|
|
22555
|
+
|
|
22556
|
+
_this.onMove(e.clientX, e.clientY);
|
|
22557
|
+
});
|
|
22558
|
+
|
|
22559
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "onTouchMove", function (e) {
|
|
22560
|
+
e.cancelable && e.preventDefault();
|
|
22561
|
+
|
|
22562
|
+
_this.onMove(e.touches[0].clientX, e.touches[0].clientY);
|
|
22563
|
+
});
|
|
22564
|
+
|
|
22565
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "onWheel", function (e) {
|
|
22566
|
+
if (_this.state.itemDragged < 0) return;
|
|
22567
|
+
_this.lastScroll = _this.listRef.current.scrollTop += e.deltaY;
|
|
22568
|
+
|
|
22569
|
+
_this.moveOtherItems();
|
|
22570
|
+
});
|
|
22571
|
+
|
|
22572
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "onMove", function (clientX, clientY) {
|
|
22573
|
+
if (_this.state.itemDragged === -1) return null;
|
|
22574
|
+
transformItem(_this.ghostRef.current, clientY - _this.state.initialY, _this.props.lockVertically ? 0 : clientX - _this.state.initialX);
|
|
22575
|
+
|
|
22576
|
+
_this.autoScrolling(clientY);
|
|
22577
|
+
|
|
22578
|
+
_this.moveOtherItems();
|
|
22579
|
+
|
|
22580
|
+
return;
|
|
22581
|
+
});
|
|
22582
|
+
|
|
22583
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "moveOtherItems", function () {
|
|
22584
|
+
var targetRect = _this.ghostRef.current.getBoundingClientRect();
|
|
22585
|
+
|
|
22586
|
+
var itemVerticalCenter = targetRect.top + targetRect.height / 2;
|
|
22587
|
+
var offset = getTranslateOffset(_this.getChildren()[_this.state.itemDragged]);
|
|
22588
|
+
|
|
22589
|
+
var currentYOffset = _this.getYOffset(); // adjust offsets if scrolling happens during the item movement
|
|
22590
|
+
|
|
22591
|
+
|
|
22592
|
+
if (_this.initialYOffset !== currentYOffset) {
|
|
22593
|
+
_this.topOffsets = _this.topOffsets.map(function (offset) {
|
|
22594
|
+
return offset - (currentYOffset - _this.initialYOffset);
|
|
22595
|
+
});
|
|
22596
|
+
_this.initialYOffset = currentYOffset;
|
|
22597
|
+
}
|
|
22598
|
+
|
|
22599
|
+
if (_this.isDraggedItemOutOfBounds() && _this.props.removableByMove) {
|
|
22600
|
+
_this.afterIndex = _this.topOffsets.length + 1;
|
|
22601
|
+
} else {
|
|
22602
|
+
_this.afterIndex = binarySearch(_this.topOffsets, itemVerticalCenter);
|
|
22603
|
+
}
|
|
22604
|
+
|
|
22605
|
+
_this.animateItems(_this.afterIndex === -1 ? 0 : _this.afterIndex, _this.state.itemDragged, offset);
|
|
22606
|
+
});
|
|
22607
|
+
|
|
22608
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "autoScrolling", function (clientY) {
|
|
22609
|
+
var _getBoundingClientRec = _this.listRef.current.getBoundingClientRect(),
|
|
22610
|
+
top = _getBoundingClientRec.top,
|
|
22611
|
+
bottom = _getBoundingClientRec.bottom,
|
|
22612
|
+
height = _getBoundingClientRec.height;
|
|
22613
|
+
|
|
22614
|
+
var viewportHeight = window.innerHeight || document.documentElement.clientHeight; // auto scrolling for the window (down)
|
|
22615
|
+
|
|
22616
|
+
if (bottom > viewportHeight && viewportHeight - clientY < AUTOSCROLL_ACTIVE_OFFSET) {
|
|
22617
|
+
_this.setState({
|
|
22618
|
+
scrollingSpeed: Math.round((AUTOSCROLL_ACTIVE_OFFSET - (viewportHeight - clientY)) / AUTOSCROLL_SPEED_RATIO),
|
|
22619
|
+
scrollWindow: true
|
|
22620
|
+
}); // auto scrolling for the window (up)
|
|
22621
|
+
|
|
22622
|
+
} else if (top < 0 && clientY < AUTOSCROLL_ACTIVE_OFFSET) {
|
|
22623
|
+
_this.setState({
|
|
22624
|
+
scrollingSpeed: Math.round((AUTOSCROLL_ACTIVE_OFFSET - clientY) / -AUTOSCROLL_SPEED_RATIO),
|
|
22625
|
+
scrollWindow: true
|
|
22626
|
+
});
|
|
22627
|
+
} else {
|
|
22628
|
+
if (_this.state.scrollWindow && _this.state.scrollingSpeed !== 0) {
|
|
22629
|
+
_this.setState({
|
|
22630
|
+
scrollingSpeed: 0,
|
|
22631
|
+
scrollWindow: false
|
|
22632
|
+
});
|
|
22633
|
+
} // auto scrolling for containers with overflow
|
|
22634
|
+
|
|
22635
|
+
|
|
22636
|
+
if (height + 20 < _this.listRef.current.scrollHeight) {
|
|
22637
|
+
var scrollingSpeed = 0;
|
|
22638
|
+
|
|
22639
|
+
if (clientY - top < AUTOSCROLL_ACTIVE_OFFSET) {
|
|
22640
|
+
scrollingSpeed = Math.round((AUTOSCROLL_ACTIVE_OFFSET - (clientY - top)) / -AUTOSCROLL_SPEED_RATIO);
|
|
22641
|
+
} else if (bottom - clientY < AUTOSCROLL_ACTIVE_OFFSET) {
|
|
22642
|
+
scrollingSpeed = Math.round((AUTOSCROLL_ACTIVE_OFFSET - (bottom - clientY)) / AUTOSCROLL_SPEED_RATIO);
|
|
22643
|
+
}
|
|
22644
|
+
|
|
22645
|
+
if (_this.state.scrollingSpeed !== scrollingSpeed) {
|
|
22646
|
+
_this.setState({
|
|
22647
|
+
scrollingSpeed: scrollingSpeed
|
|
22648
|
+
});
|
|
22649
|
+
}
|
|
22650
|
+
}
|
|
22651
|
+
}
|
|
22652
|
+
});
|
|
22653
|
+
|
|
22654
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "animateItems", function (needle, movedItem, offset) {
|
|
22655
|
+
var animateMovedItem = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
22656
|
+
|
|
22657
|
+
_this.getChildren().forEach(function (item, i) {
|
|
22658
|
+
setItemTransition(item, _this.props.transitionDuration);
|
|
22659
|
+
|
|
22660
|
+
if (movedItem === i && animateMovedItem) {
|
|
22661
|
+
if (movedItem === needle) {
|
|
22662
|
+
return transformItem(item, null);
|
|
22663
|
+
}
|
|
22664
|
+
|
|
22665
|
+
transformItem(item, movedItem < needle ? _this.itemTranslateOffsets.slice(movedItem + 1, needle + 1).reduce(function (a, b) {
|
|
22666
|
+
return a + b;
|
|
22667
|
+
}, 0) : _this.itemTranslateOffsets.slice(needle, movedItem).reduce(function (a, b) {
|
|
22668
|
+
return a + b;
|
|
22669
|
+
}, 0) * -1);
|
|
22670
|
+
} else if (movedItem < needle && i > movedItem && i <= needle) {
|
|
22671
|
+
transformItem(item, -offset);
|
|
22672
|
+
} else if (i < movedItem && movedItem > needle && i >= needle) {
|
|
22673
|
+
transformItem(item, offset);
|
|
22674
|
+
} else {
|
|
22675
|
+
transformItem(item, null);
|
|
22676
|
+
}
|
|
22677
|
+
});
|
|
22678
|
+
});
|
|
22679
|
+
|
|
22680
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "isDraggedItemOutOfBounds", function () {
|
|
22681
|
+
var initialRect = _this.getChildren()[_this.state.itemDragged].getBoundingClientRect();
|
|
22682
|
+
|
|
22683
|
+
var targetRect = _this.ghostRef.current.getBoundingClientRect();
|
|
22684
|
+
|
|
22685
|
+
if (Math.abs(initialRect.left - targetRect.left) > targetRect.width) {
|
|
22686
|
+
if (_this.state.itemDraggedOutOfBounds === -1) {
|
|
22687
|
+
_this.setState({
|
|
22688
|
+
itemDraggedOutOfBounds: _this.state.itemDragged
|
|
22689
|
+
});
|
|
22690
|
+
}
|
|
22691
|
+
|
|
22692
|
+
return true;
|
|
22693
|
+
}
|
|
22694
|
+
|
|
22695
|
+
if (_this.state.itemDraggedOutOfBounds > -1) {
|
|
22696
|
+
_this.setState({
|
|
22697
|
+
itemDraggedOutOfBounds: -1
|
|
22698
|
+
});
|
|
22699
|
+
}
|
|
22700
|
+
|
|
22701
|
+
return false;
|
|
22702
|
+
});
|
|
22703
|
+
|
|
22704
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "onEnd", function (e) {
|
|
22705
|
+
e.cancelable && e.preventDefault();
|
|
22706
|
+
document.removeEventListener('mousemove', _this.schdOnMouseMove);
|
|
22707
|
+
document.removeEventListener('touchmove', _this.schdOnTouchMove);
|
|
22708
|
+
document.removeEventListener('mouseup', _this.schdOnEnd);
|
|
22709
|
+
document.removeEventListener('touchup', _this.schdOnEnd);
|
|
22710
|
+
document.removeEventListener('touchcancel', _this.schdOnEnd);
|
|
22711
|
+
|
|
22712
|
+
var removeItem = _this.props.removableByMove && _this.isDraggedItemOutOfBounds();
|
|
22713
|
+
|
|
22714
|
+
if (!removeItem && _this.props.transitionDuration > 0 && _this.afterIndex !== -2) {
|
|
22715
|
+
// animate drop
|
|
22716
|
+
schd(function () {
|
|
22717
|
+
setItemTransition(_this.ghostRef.current, _this.props.transitionDuration, 'cubic-bezier(0.2, 0, 0.38, 0.9)');
|
|
22718
|
+
|
|
22719
|
+
if (_this.afterIndex < 1 && _this.state.itemDragged === 0) {
|
|
22720
|
+
transformItem(_this.ghostRef.current, 0, 0);
|
|
22721
|
+
} else {
|
|
22722
|
+
transformItem(_this.ghostRef.current, // compensate window scroll
|
|
22723
|
+
-(window.pageYOffset - _this.lastYOffset) + // compensate container scroll
|
|
22724
|
+
-(_this.listRef.current.scrollTop - _this.lastListYOffset) + (_this.state.itemDragged < _this.afterIndex ? _this.itemTranslateOffsets.slice(_this.state.itemDragged + 1, _this.afterIndex + 1).reduce(function (a, b) {
|
|
22725
|
+
return a + b;
|
|
22726
|
+
}, 0) : _this.itemTranslateOffsets.slice(_this.afterIndex < 0 ? 0 : _this.afterIndex, _this.state.itemDragged).reduce(function (a, b) {
|
|
22727
|
+
return a + b;
|
|
22728
|
+
}, 0) * -1), 0);
|
|
22729
|
+
}
|
|
22730
|
+
})();
|
|
22731
|
+
}
|
|
22732
|
+
|
|
22733
|
+
_this.dropTimeout = window.setTimeout(_this.finishDrop, removeItem || _this.afterIndex === -2 ? 0 : _this.props.transitionDuration);
|
|
22734
|
+
});
|
|
22735
|
+
|
|
22736
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "finishDrop", function () {
|
|
22737
|
+
var removeItem = _this.props.removableByMove && _this.isDraggedItemOutOfBounds();
|
|
22738
|
+
|
|
22739
|
+
if (removeItem || _this.afterIndex > -2 && _this.state.itemDragged !== _this.afterIndex) {
|
|
22740
|
+
_this.props.onChange({
|
|
22741
|
+
oldIndex: _this.state.itemDragged,
|
|
22742
|
+
newIndex: removeItem ? -1 : Math.max(_this.afterIndex, 0),
|
|
22743
|
+
targetRect: _this.ghostRef.current.getBoundingClientRect()
|
|
22744
|
+
});
|
|
22745
|
+
}
|
|
22746
|
+
|
|
22747
|
+
_this.getChildren().forEach(function (item) {
|
|
22748
|
+
setItemTransition(item, 0);
|
|
22749
|
+
transformItem(item, null);
|
|
22750
|
+
item.style.touchAction = '';
|
|
22751
|
+
});
|
|
22752
|
+
|
|
22753
|
+
_this.setState({
|
|
22754
|
+
itemDragged: -1,
|
|
22755
|
+
scrollingSpeed: 0
|
|
22756
|
+
});
|
|
22757
|
+
|
|
22758
|
+
_this.afterIndex = -2; // sometimes the scroll gets messed up after the drop, fix:
|
|
22759
|
+
|
|
22760
|
+
if (_this.lastScroll > 0) {
|
|
22761
|
+
_this.listRef.current.scrollTop = _this.lastScroll;
|
|
22762
|
+
_this.lastScroll = 0;
|
|
22763
|
+
}
|
|
22764
|
+
});
|
|
22765
|
+
|
|
22766
|
+
_defineProperty$1(_assertThisInitialized$1(_this), "onKeyDown", function (e) {
|
|
22767
|
+
var selectedItem = _this.state.selectedItem;
|
|
22768
|
+
|
|
22769
|
+
var index = _this.getTargetIndex(e);
|
|
22770
|
+
|
|
22771
|
+
if (index === -1 || _this.props.values[index] && _this.props.values[index].props.disabled) {
|
|
22772
|
+
return;
|
|
22773
|
+
}
|
|
22774
|
+
|
|
22775
|
+
if (e.key === ' ') {
|
|
22776
|
+
e.preventDefault();
|
|
22777
|
+
|
|
22778
|
+
if (selectedItem === index) {
|
|
22779
|
+
if (selectedItem !== _this.needle) {
|
|
22780
|
+
_this.getChildren().forEach(function (item) {
|
|
22781
|
+
setItemTransition(item, 0);
|
|
22782
|
+
transformItem(item, null);
|
|
22783
|
+
});
|
|
22784
|
+
|
|
22785
|
+
_this.props.onChange({
|
|
22786
|
+
oldIndex: selectedItem,
|
|
22787
|
+
newIndex: _this.needle,
|
|
22788
|
+
targetRect: _this.getChildren()[_this.needle].getBoundingClientRect()
|
|
22789
|
+
});
|
|
22790
|
+
|
|
22791
|
+
_this.getChildren()[_this.needle].focus();
|
|
22792
|
+
}
|
|
22793
|
+
|
|
22794
|
+
_this.setState({
|
|
22795
|
+
selectedItem: -1
|
|
22796
|
+
});
|
|
22797
|
+
|
|
22798
|
+
_this.needle = -1;
|
|
22799
|
+
} else {
|
|
22800
|
+
_this.setState({
|
|
22801
|
+
selectedItem: index
|
|
22802
|
+
});
|
|
22803
|
+
|
|
22804
|
+
_this.needle = index;
|
|
22805
|
+
|
|
22806
|
+
_this.calculateOffsets();
|
|
22807
|
+
}
|
|
22808
|
+
}
|
|
22809
|
+
|
|
22810
|
+
if ((e.key === 'ArrowDown' || e.key === 'j') && selectedItem > -1 && _this.needle < _this.props.values.length - 1) {
|
|
22811
|
+
e.preventDefault();
|
|
22812
|
+
var offset = getTranslateOffset(_this.getChildren()[selectedItem]);
|
|
22813
|
+
_this.needle++;
|
|
22814
|
+
|
|
22815
|
+
_this.animateItems(_this.needle, selectedItem, offset, true);
|
|
22816
|
+
}
|
|
22817
|
+
|
|
22818
|
+
if ((e.key === 'ArrowUp' || e.key === 'k') && selectedItem > -1 && _this.needle > 0) {
|
|
22819
|
+
e.preventDefault();
|
|
22820
|
+
|
|
22821
|
+
var _offset = getTranslateOffset(_this.getChildren()[selectedItem]);
|
|
22822
|
+
|
|
22823
|
+
_this.needle--;
|
|
22824
|
+
|
|
22825
|
+
_this.animateItems(_this.needle, selectedItem, _offset, true);
|
|
22826
|
+
}
|
|
22827
|
+
|
|
22828
|
+
if (e.key === 'Escape' && selectedItem > -1) {
|
|
22829
|
+
_this.getChildren().forEach(function (item) {
|
|
22830
|
+
setItemTransition(item, 0);
|
|
22831
|
+
transformItem(item, null);
|
|
22832
|
+
});
|
|
22833
|
+
|
|
22834
|
+
_this.setState({
|
|
22835
|
+
selectedItem: -1
|
|
22836
|
+
});
|
|
22837
|
+
|
|
22838
|
+
_this.needle = -1;
|
|
22839
|
+
}
|
|
22840
|
+
|
|
22841
|
+
if ((e.key === 'Tab' || e.key === 'Enter') && selectedItem > -1) {
|
|
22842
|
+
e.preventDefault();
|
|
22843
|
+
}
|
|
22844
|
+
});
|
|
22845
|
+
|
|
22846
|
+
_this.schdOnMouseMove = schd(_this.onMouseMove);
|
|
22847
|
+
_this.schdOnTouchMove = schd(_this.onTouchMove);
|
|
22848
|
+
_this.schdOnEnd = schd(_this.onEnd);
|
|
22849
|
+
return _this;
|
|
22850
|
+
}
|
|
22851
|
+
|
|
22852
|
+
_createClass(Draggable, [{
|
|
22853
|
+
key: "componentDidMount",
|
|
22854
|
+
value: function componentDidMount() {
|
|
22855
|
+
this.calculateOffsets();
|
|
22856
|
+
document.addEventListener('touchstart', this.onMouseOrTouchStart, {
|
|
22857
|
+
passive: false,
|
|
22858
|
+
capture: false
|
|
22859
|
+
});
|
|
22860
|
+
document.addEventListener('mousedown', this.onMouseOrTouchStart);
|
|
22861
|
+
}
|
|
22862
|
+
}, {
|
|
22863
|
+
key: "componentDidUpdate",
|
|
22864
|
+
value: function componentDidUpdate(_prevProps, prevState) {
|
|
22865
|
+
if (prevState.scrollingSpeed !== this.state.scrollingSpeed && prevState.scrollingSpeed === 0) {
|
|
22866
|
+
this.doScrolling();
|
|
22867
|
+
}
|
|
22868
|
+
}
|
|
22869
|
+
}, {
|
|
22870
|
+
key: "componentWillUnmount",
|
|
22871
|
+
value: function componentWillUnmount() {
|
|
22872
|
+
document.removeEventListener('touchstart', this.onMouseOrTouchStart);
|
|
22873
|
+
document.removeEventListener('mousedown', this.onMouseOrTouchStart);
|
|
22874
|
+
|
|
22875
|
+
if (this.dropTimeout) {
|
|
22876
|
+
window.clearTimeout(this.dropTimeout);
|
|
22877
|
+
}
|
|
22878
|
+
|
|
22879
|
+
this.schdOnMouseMove.cancel();
|
|
22880
|
+
this.schdOnTouchMove.cancel();
|
|
22881
|
+
this.schdOnEnd.cancel();
|
|
22882
|
+
}
|
|
22883
|
+
}, {
|
|
22884
|
+
key: "render",
|
|
22885
|
+
value: function render() {
|
|
22886
|
+
var _this2 = this;
|
|
22887
|
+
|
|
22888
|
+
var baseStyle = {
|
|
22889
|
+
userSelect: 'none',
|
|
22890
|
+
WebkitUserSelect: 'none',
|
|
22891
|
+
MozUserSelect: 'none',
|
|
22892
|
+
msUserSelect: 'none',
|
|
22893
|
+
boxSizing: 'border-box',
|
|
22894
|
+
position: 'relative'
|
|
22895
|
+
};
|
|
22896
|
+
|
|
22897
|
+
var ghostStyle = _objectSpread2(_objectSpread2({}, baseStyle), {}, {
|
|
22898
|
+
top: this.state.targetY,
|
|
22899
|
+
left: this.state.targetX,
|
|
22900
|
+
width: this.state.targetWidth,
|
|
22901
|
+
height: this.state.targetHeight,
|
|
22902
|
+
backgroundColor: '#ffffff',
|
|
22903
|
+
listStyleType: 'none',
|
|
22904
|
+
margin: 0,
|
|
22905
|
+
position: 'fixed',
|
|
22906
|
+
boxShadow: '0 4px 16px 0 rgba(0, 0, 0, 0.16)'
|
|
22907
|
+
});
|
|
22908
|
+
|
|
22909
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, this.props.renderList({
|
|
22910
|
+
children: this.props.values.map(function (value, index) {
|
|
22911
|
+
var isHidden = index === _this2.state.itemDragged;
|
|
22912
|
+
var isSelected = index === _this2.state.selectedItem;
|
|
22913
|
+
var isDisabled = _this2.props.values[index] && _this2.props.values[index].props.disabled;
|
|
22914
|
+
var props = {
|
|
22915
|
+
key: index,
|
|
22916
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
22917
|
+
onKeyDown: _this2.onKeyDown,
|
|
22918
|
+
style: _objectSpread2(_objectSpread2({}, baseStyle), {}, {
|
|
22919
|
+
visibility: isHidden ? 'hidden' : undefined,
|
|
22920
|
+
zIndex: isSelected ? 5000 : 0
|
|
22921
|
+
})
|
|
22922
|
+
};
|
|
22923
|
+
return _this2.props.renderItem({
|
|
22924
|
+
value: value,
|
|
22925
|
+
props: props,
|
|
22926
|
+
index: index,
|
|
22927
|
+
isDragged: false,
|
|
22928
|
+
isSelected: isSelected,
|
|
22929
|
+
isOutOfBounds: false
|
|
22930
|
+
});
|
|
22931
|
+
}),
|
|
22932
|
+
isDragged: this.state.itemDragged > -1,
|
|
22933
|
+
props: {
|
|
22934
|
+
ref: this.listRef
|
|
22935
|
+
}
|
|
22936
|
+
}), this.state.itemDragged > -1 && /*#__PURE__*/ReactDOM.createPortal(this.props.renderItem({
|
|
22937
|
+
value: this.props.values[this.state.itemDragged],
|
|
22938
|
+
props: {
|
|
22939
|
+
ref: this.ghostRef,
|
|
22940
|
+
style: ghostStyle,
|
|
22941
|
+
onWheel: this.onWheel
|
|
22942
|
+
},
|
|
22943
|
+
index: this.state.itemDragged,
|
|
22944
|
+
isDragged: true,
|
|
22945
|
+
isSelected: false,
|
|
22946
|
+
isOutOfBounds: this.state.itemDraggedOutOfBounds > -1
|
|
22947
|
+
}), document.body));
|
|
22948
|
+
}
|
|
22949
|
+
}]);
|
|
22950
|
+
|
|
22951
|
+
return Draggable;
|
|
22952
|
+
}(React.Component);
|
|
22953
|
+
|
|
22954
|
+
_defineProperty$1(Draggable, "defaultProps", {
|
|
22955
|
+
transitionDuration: 240,
|
|
22956
|
+
lockVertically: false,
|
|
22957
|
+
removableByMove: false
|
|
22958
|
+
});
|
|
22959
|
+
|
|
22960
|
+
var DraggableList = function DraggableList(props) {
|
|
22961
|
+
var children = props.children,
|
|
22962
|
+
className = props.className,
|
|
22963
|
+
Tag = props.tagName;
|
|
22964
|
+
var baseProps = extractBaseProps(props);
|
|
22965
|
+
var classes = classnames({
|
|
22966
|
+
Listbox: true
|
|
22967
|
+
}, className);
|
|
22968
|
+
var renderChildren = React__default.Children.toArray(children).map(function (child) {
|
|
22969
|
+
var element = /*#__PURE__*/React__default.cloneElement(child, {
|
|
22970
|
+
parentProps: _objectSpread2({}, props)
|
|
22971
|
+
});
|
|
22972
|
+
return element;
|
|
22973
|
+
});
|
|
22974
|
+
|
|
22975
|
+
var _React$useState = React__default.useState(renderChildren),
|
|
22976
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
22977
|
+
childList = _React$useState2[0],
|
|
22978
|
+
setChildList = _React$useState2[1];
|
|
22979
|
+
|
|
22980
|
+
var onChangeHandler = function onChangeHandler(props) {
|
|
22981
|
+
var oldIndex = props.oldIndex,
|
|
22982
|
+
newIndex = props.newIndex;
|
|
22983
|
+
var updatedList = arrayMove(childList, oldIndex, newIndex);
|
|
22984
|
+
setChildList(updatedList);
|
|
22985
|
+
};
|
|
22986
|
+
|
|
22987
|
+
return /*#__PURE__*/React__default.createElement(Draggable, {
|
|
22988
|
+
values: childList,
|
|
22989
|
+
onChange: onChangeHandler,
|
|
22990
|
+
renderItem: function renderItem(_ref) {
|
|
22991
|
+
var value = _ref.value,
|
|
22992
|
+
props = _ref.props;
|
|
22993
|
+
return /*#__PURE__*/React__default.createElement("div", _extends$2({}, props, {
|
|
22994
|
+
className: "Listbox-item--draggable"
|
|
22995
|
+
}), value);
|
|
22996
|
+
},
|
|
22997
|
+
renderList: function renderList(_ref2) {
|
|
22998
|
+
var children = _ref2.children,
|
|
22999
|
+
props = _ref2.props;
|
|
23000
|
+
return /*#__PURE__*/React__default.createElement(Tag, _extends$2({
|
|
23001
|
+
"data-test": "DesignSystem-Listbox"
|
|
23002
|
+
}, baseProps, {
|
|
23003
|
+
className: classes
|
|
23004
|
+
}, props), children);
|
|
23005
|
+
}
|
|
23006
|
+
});
|
|
23007
|
+
};
|
|
23008
|
+
|
|
23009
|
+
var isDisabledElement = function isDisabledElement(element) {
|
|
23010
|
+
return element && element.getAttribute('data-disabled') === 'true';
|
|
23011
|
+
};
|
|
23012
|
+
|
|
23013
|
+
var getNextSibling = function getNextSibling(element) {
|
|
23014
|
+
var _element$parentNode, _element$parentNode$n;
|
|
23015
|
+
|
|
23016
|
+
return element === null || element === void 0 ? void 0 : (_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : (_element$parentNode$n = _element$parentNode.nextSibling) === null || _element$parentNode$n === void 0 ? void 0 : _element$parentNode$n.firstChild;
|
|
23017
|
+
};
|
|
23018
|
+
|
|
23019
|
+
var getPrevSibling = function getPrevSibling(element) {
|
|
23020
|
+
var _element$parentNode2, _element$parentNode2$;
|
|
23021
|
+
|
|
23022
|
+
return element === null || element === void 0 ? void 0 : (_element$parentNode2 = element.parentNode) === null || _element$parentNode2 === void 0 ? void 0 : (_element$parentNode2$ = _element$parentNode2.previousSibling) === null || _element$parentNode2$ === void 0 ? void 0 : _element$parentNode2$.firstChild;
|
|
23023
|
+
};
|
|
23024
|
+
|
|
23025
|
+
var focusOption = function focusOption(element, direction) {
|
|
23026
|
+
var iterateElement = element;
|
|
23027
|
+
|
|
23028
|
+
while (iterateElement) {
|
|
23029
|
+
if (!isDisabledElement(iterateElement)) {
|
|
23030
|
+
iterateElement.focus();
|
|
23031
|
+
break;
|
|
23032
|
+
}
|
|
23033
|
+
|
|
23034
|
+
if (direction === 'down') {
|
|
23035
|
+
iterateElement = getNextSibling(iterateElement);
|
|
23036
|
+
} else {
|
|
23037
|
+
iterateElement = getPrevSibling(iterateElement);
|
|
23038
|
+
}
|
|
23039
|
+
}
|
|
23040
|
+
};
|
|
23041
|
+
|
|
23042
|
+
var onKeyDown = function onKeyDown(event) {
|
|
23043
|
+
var sourceElement = event.target;
|
|
23044
|
+
var nextElement = getNextSibling(sourceElement);
|
|
23045
|
+
var prevElement = getPrevSibling(sourceElement);
|
|
23046
|
+
|
|
23047
|
+
switch (event.key) {
|
|
23048
|
+
case 'ArrowDown':
|
|
23049
|
+
event.preventDefault();
|
|
23050
|
+
focusOption(nextElement, 'down');
|
|
23051
|
+
break;
|
|
23052
|
+
|
|
23053
|
+
case 'ArrowUp':
|
|
23054
|
+
event.preventDefault();
|
|
23055
|
+
focusOption(prevElement, 'up');
|
|
23056
|
+
break;
|
|
23057
|
+
}
|
|
23058
|
+
};
|
|
23059
|
+
|
|
23060
|
+
var ListBody = function ListBody(props) {
|
|
23061
|
+
var _classNames;
|
|
23062
|
+
|
|
23063
|
+
var children = props.children,
|
|
23064
|
+
className = props.className,
|
|
23065
|
+
disabled = props.disabled,
|
|
23066
|
+
selected = props.selected,
|
|
23067
|
+
activated = props.activated;
|
|
23068
|
+
var contextProp = React.useContext(ListboxContext);
|
|
23069
|
+
var size = contextProp.size,
|
|
23070
|
+
type = contextProp.type,
|
|
23071
|
+
draggable = contextProp.draggable;
|
|
23072
|
+
var itemClass = classnames((_classNames = {
|
|
23073
|
+
'Listbox-item': true
|
|
23074
|
+
}, _defineProperty$1(_classNames, "Listbox-item--".concat(size), size), _defineProperty$1(_classNames, "Listbox-item--".concat(type), type), _defineProperty$1(_classNames, 'Listbox-item--disabled', disabled), _defineProperty$1(_classNames, 'Listbox-item--selected', selected && type === 'option'), _defineProperty$1(_classNames, 'Listbox-item--activated', activated && type === 'resource'), _classNames), className);
|
|
23075
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23076
|
+
"data-disabled": disabled,
|
|
23077
|
+
"data-test": "DesignSystem-Listbox-ItemWrapper",
|
|
23078
|
+
tabIndex: draggable ? -1 : 0,
|
|
23079
|
+
className: itemClass,
|
|
23080
|
+
onKeyDown: onKeyDown,
|
|
23081
|
+
role: "tablist"
|
|
23082
|
+
}, draggable && /*#__PURE__*/React.createElement(Icon, {
|
|
23083
|
+
size: 16,
|
|
23084
|
+
appearance: "subtle",
|
|
23085
|
+
name: "drag_indicator",
|
|
23086
|
+
className: "Listbox-item--drag-icon",
|
|
23087
|
+
"data-test": "DesignSystem-Listbox-DragIcon"
|
|
23088
|
+
}), children);
|
|
23089
|
+
};
|
|
23090
|
+
|
|
23091
|
+
var getAnimationClass = function getAnimationClass(uniqueKey, expanded) {
|
|
23092
|
+
if (expanded) return "nestedList-open-".concat(uniqueKey, " 240ms cubic-bezier(0, 0, 0.38, 0.9)");else if (!expanded) return "nestedList-close-".concat(uniqueKey, " 160ms cubic-bezier(0.2, 0, 1, 0.9)");
|
|
23093
|
+
return '';
|
|
23094
|
+
};
|
|
23095
|
+
|
|
23096
|
+
var getHeight = function getHeight(listItemRef) {
|
|
23097
|
+
var _listItemRef$current;
|
|
23098
|
+
|
|
23099
|
+
var scrollHeight = (_listItemRef$current = listItemRef.current) === null || _listItemRef$current === void 0 ? void 0 : _listItemRef$current.scrollHeight;
|
|
23100
|
+
return scrollHeight;
|
|
23101
|
+
};
|
|
23102
|
+
|
|
23103
|
+
var menuItemAnimation = function menuItemAnimation(listItemRef, uniqueKey) {
|
|
23104
|
+
return "\n @keyframes nestedList-open-".concat(uniqueKey, " {\n from {\n height: 0px;\n }\n to {\n height: ").concat(getHeight(listItemRef), "px;\n }\n }\n\n @keyframes nestedList-close-").concat(uniqueKey, " {\n from {\n height: ").concat(getHeight(listItemRef), "px;\n }\n to {\n height: 0px;\n }\n }\n ");
|
|
23105
|
+
};
|
|
23106
|
+
|
|
23107
|
+
function usePrevious(value) {
|
|
23108
|
+
var ref = React.useRef();
|
|
23109
|
+
React.useEffect(function () {
|
|
23110
|
+
if (value != undefined) {
|
|
23111
|
+
ref.current = value;
|
|
23112
|
+
}
|
|
23113
|
+
}, [value]);
|
|
23114
|
+
return ref.current;
|
|
23115
|
+
}
|
|
23116
|
+
|
|
23117
|
+
var NestedList = function NestedList(props) {
|
|
23118
|
+
var nestedBody = props.nestedBody,
|
|
23119
|
+
expanded = props.expanded;
|
|
23120
|
+
var prevState = usePrevious(expanded);
|
|
23121
|
+
|
|
23122
|
+
var _React$useState = React.useState(expanded),
|
|
23123
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
23124
|
+
open = _React$useState2[0],
|
|
23125
|
+
setOpen = _React$useState2[1];
|
|
23126
|
+
|
|
23127
|
+
var _React$useState3 = React.useState(''),
|
|
23128
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
23129
|
+
keyframe = _React$useState4[0],
|
|
23130
|
+
setKeyframe = _React$useState4[1];
|
|
23131
|
+
|
|
23132
|
+
var listItemRef = React.useRef(null);
|
|
23133
|
+
var uniqueKey = Math.random().toString(36).substring(2, 6);
|
|
23134
|
+
|
|
23135
|
+
var _React$useState5 = React.useState(getAnimationClass(uniqueKey, expanded)),
|
|
23136
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
23137
|
+
animation = _React$useState6[0],
|
|
23138
|
+
setAnimation = _React$useState6[1];
|
|
23139
|
+
|
|
23140
|
+
React.useEffect(function () {
|
|
23141
|
+
if (prevState != undefined && prevState !== expanded) {
|
|
23142
|
+
setOpen(true);
|
|
23143
|
+
}
|
|
23144
|
+
|
|
23145
|
+
requestAnimationFrame(function () {
|
|
23146
|
+
var result = menuItemAnimation(listItemRef, uniqueKey);
|
|
23147
|
+
setKeyframe(result);
|
|
23148
|
+
});
|
|
23149
|
+
var animationClass = getAnimationClass(uniqueKey, expanded);
|
|
23150
|
+
setAnimation(animationClass);
|
|
23151
|
+
}, [expanded]);
|
|
23152
|
+
|
|
23153
|
+
var handleAnimationEnd = function handleAnimationEnd() {
|
|
23154
|
+
!expanded && setOpen(false);
|
|
23155
|
+
};
|
|
23156
|
+
|
|
23157
|
+
var styles = {
|
|
23158
|
+
animation: animation,
|
|
23159
|
+
overflow: 'hidden',
|
|
23160
|
+
animationFillMode: 'forwards'
|
|
23161
|
+
};
|
|
23162
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, keyframe), nestedBody && open && /*#__PURE__*/React.createElement("div", {
|
|
23163
|
+
style: styles,
|
|
23164
|
+
onAnimationEnd: handleAnimationEnd,
|
|
23165
|
+
"data-test": "DesignSystem-Listbox--Nested-Item",
|
|
23166
|
+
ref: listItemRef
|
|
23167
|
+
}, nestedBody));
|
|
23168
|
+
};
|
|
23169
|
+
|
|
23170
|
+
var _excluded$1 = ["nestedBody", "expanded", "id", "onClick", "value", "tagName"];
|
|
23171
|
+
var ListboxItem = function ListboxItem(props) {
|
|
23172
|
+
var nestedBody = props.nestedBody,
|
|
23173
|
+
expanded = props.expanded,
|
|
23174
|
+
id = props.id,
|
|
23175
|
+
onClick = props.onClick,
|
|
23176
|
+
value = props.value,
|
|
23177
|
+
Tag = props.tagName,
|
|
23178
|
+
rest = _objectWithoutProperties(props, _excluded$1);
|
|
23179
|
+
|
|
23180
|
+
var contextProp = React.useContext(ListboxContext);
|
|
23181
|
+
var showDivider = contextProp.showDivider,
|
|
23182
|
+
draggable = contextProp.draggable;
|
|
23183
|
+
|
|
23184
|
+
var onClickHandler = function onClickHandler(e) {
|
|
23185
|
+
onClick && onClick(e, id, value);
|
|
23186
|
+
};
|
|
23187
|
+
|
|
23188
|
+
var tagClass = classnames(_defineProperty$1({}, 'Listbox-item-wrapper', !draggable));
|
|
23189
|
+
return /*#__PURE__*/React.createElement(Tag, _extends$2({
|
|
23190
|
+
id: id,
|
|
23191
|
+
key: id
|
|
23192
|
+
}, rest, {
|
|
23193
|
+
"data-test": "DesignSystem-Listbox-Item",
|
|
23194
|
+
onClick: onClickHandler,
|
|
23195
|
+
"data-value": value,
|
|
23196
|
+
className: tagClass
|
|
23197
|
+
}), /*#__PURE__*/React.createElement(ListBody, props), nestedBody && /*#__PURE__*/React.createElement(NestedList, {
|
|
23198
|
+
expanded: expanded,
|
|
23199
|
+
nestedBody: nestedBody
|
|
23200
|
+
}), showDivider && /*#__PURE__*/React.createElement(Divider, {
|
|
23201
|
+
className: "Listbox-divider"
|
|
23202
|
+
}));
|
|
23203
|
+
};
|
|
23204
|
+
ListboxItem.displayName = 'ListboxItem';
|
|
23205
|
+
ListboxItem.defaultProps = {
|
|
23206
|
+
tagName: 'li'
|
|
23207
|
+
};
|
|
23208
|
+
|
|
23209
|
+
var _excluded = ["children", "className", "draggable", "size", "type", "showDivider", "tagName"];
|
|
23210
|
+
var ListboxContext = /*#__PURE__*/React.createContext({
|
|
23211
|
+
size: 'standard',
|
|
23212
|
+
type: 'resource',
|
|
23213
|
+
draggable: false,
|
|
23214
|
+
showDivider: true
|
|
23215
|
+
});
|
|
23216
|
+
var Provider = ListboxContext.Provider;
|
|
23217
|
+
var Listbox = function Listbox(props) {
|
|
23218
|
+
var children = props.children,
|
|
23219
|
+
className = props.className,
|
|
23220
|
+
draggable = props.draggable,
|
|
23221
|
+
size = props.size,
|
|
23222
|
+
type = props.type,
|
|
23223
|
+
showDivider = props.showDivider,
|
|
23224
|
+
Tag = props.tagName,
|
|
23225
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
23226
|
+
|
|
23227
|
+
var baseProps = extractBaseProps(props);
|
|
23228
|
+
var classes = classnames({
|
|
23229
|
+
Listbox: true
|
|
23230
|
+
}, className);
|
|
23231
|
+
var sharedProp = {
|
|
23232
|
+
size: size,
|
|
23233
|
+
type: type,
|
|
23234
|
+
draggable: draggable,
|
|
23235
|
+
showDivider: showDivider
|
|
23236
|
+
};
|
|
23237
|
+
return /*#__PURE__*/React.createElement(Provider, {
|
|
23238
|
+
value: sharedProp
|
|
23239
|
+
}, draggable ? /*#__PURE__*/React.createElement(DraggableList, props) : /*#__PURE__*/React.createElement(Tag, _extends$2({
|
|
23240
|
+
"data-test": "DesignSystem-Listbox"
|
|
23241
|
+
}, baseProps, {
|
|
23242
|
+
className: classes
|
|
23243
|
+
}, rest), children));
|
|
23244
|
+
};
|
|
23245
|
+
Listbox.displayName = 'Listbox';
|
|
23246
|
+
Listbox.defaultProps = {
|
|
23247
|
+
tagName: 'ul',
|
|
23248
|
+
size: 'standard',
|
|
23249
|
+
type: 'resource',
|
|
23250
|
+
draggable: false,
|
|
23251
|
+
showDivider: true
|
|
23252
|
+
};
|
|
23253
|
+
Listbox.Item = ListboxItem;
|
|
23254
|
+
|
|
23255
|
+
var version = "2.25.0";
|
|
22299
23256
|
|
|
22300
|
-
export { ActionCard, Avatar, AvatarGroup, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, DatePicker, DateRangePicker, Dialog, Divider, Dropdown, Dropzone, EditableChipInput, EditableDropdown, EditableInput, EmptyState, FileList, FileUploader, FileUploaderList, FullscreenModal, Grid, GridCell, Heading, HelpText, HorizontalNav, Icon, InlineMessage, Input, X as InputMask, Label, Legend, Link, LinkButton, List, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderImage, PlaceholderParagraph, Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, SelectionCard, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, Textarea, TimePicker, Toast, Tooltip, index as Utils, VerificationCodeInput, VerticalNav, version };
|
|
23257
|
+
export { ActionCard, Avatar, AvatarGroup, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, DatePicker, DateRangePicker, Dialog, Divider, Dropdown, Dropzone, EditableChipInput, EditableDropdown, EditableInput, EmptyState, FileList, FileUploader, FileUploaderList, FullscreenModal, Grid, GridCell, Heading, HelpText, HorizontalNav, Icon, InlineMessage, Input, X as InputMask, Label, Legend, Link, LinkButton, List, Listbox, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderImage, PlaceholderParagraph, Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, SelectionCard, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, Textarea, TimePicker, Toast, Tooltip, index as Utils, VerificationCodeInput, VerticalNav, version };
|