@jobber/components 3.5.10 → 4.0.1-pre.4
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/dist/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/Autocomplete/Option.d.ts +2 -2
- package/dist/Autocomplete/index.js +51 -67
- package/dist/Avatar/Avatar.d.ts +2 -2
- package/dist/Avatar/index.js +2 -2
- package/dist/{Avatar-cfd04e86.js → Avatar-89cfd0a6.js} +14 -18
- package/dist/Banner/Banner.d.ts +1 -1
- package/dist/Banner/index.js +15 -19
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/index.js +3 -4
- package/dist/{Button-cd30df0f.js → Button-16e043ec.js} +21 -24
- package/dist/ButtonDismiss/index.js +4 -5
- package/dist/{ButtonDismiss-a9590195.js → ButtonDismiss-3fb1eaf9.js} +2 -3
- package/dist/Card/Card.d.ts +1 -1
- package/dist/Card/index.js +6 -7
- package/dist/Card/types.d.ts +1 -1
- package/dist/{Card-b9f8d6f3.js → Card-edab9c3c.js} +18 -22
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Checkbox/index.js +4 -5
- package/dist/{Checkbox-5103d2b9.js → Checkbox-c1efc2f6.js} +10 -12
- package/dist/Chips/ChipsTypes.d.ts +1 -1
- package/dist/Chips/InternalChipDismissible/InternalChipDismissibleTypes.d.ts +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissible.d.ts +1 -1
- package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +3 -3
- package/dist/Chips/InternalChipMultiSelect.d.ts +1 -1
- package/dist/Chips/InternalChipSingleSelect.d.ts +1 -1
- package/dist/Chips/index.js +165 -185
- package/dist/ConfirmationModal/ConfirmationModal.d.ts +1 -1
- package/dist/ConfirmationModal/index.js +11 -12
- package/dist/{ConfirmationModal-e95f46d7.js → ConfirmationModal-6a7beee2.js} +28 -31
- package/dist/Content/index.js +1 -1
- package/dist/{Content-18de5fbb.js → Content-05df8f7f.js} +2 -3
- package/dist/Countdown/Countdown.d.ts +1 -1
- package/dist/Countdown/computeTimeUnit.d.ts +1 -1
- package/dist/Countdown/index.js +15 -18
- package/dist/DataDump/index.js +9 -11
- package/dist/DataTable/Footer.d.ts +1 -1
- package/dist/DataTable/createTableSettings.d.ts +2 -2
- package/dist/DataTable/index.js +74 -106
- package/dist/DataTable/test-utilities/helpers.d.ts +1 -1
- package/dist/DataTable/types.d.ts +2 -2
- package/dist/DatePicker/DatePicker.d.ts +1 -1
- package/dist/DatePicker/index.js +4 -5
- package/dist/{DatePicker-7c67e8d2.js → DatePicker-af21ae91.js} +31 -36
- package/dist/DescriptionList/index.js +5 -10
- package/dist/Disclosure/index.js +8 -10
- package/dist/Divider/index.js +8 -10
- package/dist/Drawer/index.js +10 -14
- package/dist/Emphasis/index.js +2 -3
- package/dist/{Emphasis-75a3f411.js → Emphasis-23dc2a0a.js} +4 -6
- package/dist/FeatureSwitch/index.js +15 -17
- package/dist/Form/index.js +23 -33
- package/dist/FormField/FormFieldTypes.d.ts +2 -2
- package/dist/FormField/index.js +8 -8
- package/dist/{FormField-76068c0b.js → FormField-1e444bb6.js} +68 -76
- package/dist/FormatDate/index.js +2 -3
- package/dist/FormatEmail/index.js +2 -3
- package/dist/FormatFile/index.js +13 -14
- package/dist/{FormatFile-18e8a54a.js → FormatFile-3512f838.js} +33 -40
- package/dist/FormatRelativeDateTime/index.js +5 -6
- package/dist/FormatTime/index.js +6 -7
- package/dist/Gallery/GalleryTypes.d.ts +2 -2
- package/dist/Gallery/index.js +31 -33
- package/dist/Heading/index.js +2 -3
- package/dist/{Heading-a9a66964.js → Heading-7b203f7f.js} +4 -6
- package/dist/Icon/index.js +1 -1
- package/dist/{Icon-d5ad1a6d.js → Icon-405a216c.js} +7 -8
- package/dist/InlineLabel/InlineLabel.d.ts +1 -1
- package/dist/InlineLabel/index.js +4 -6
- package/dist/InputAvatar/index.js +15 -20
- package/dist/InputDate/index.js +15 -15
- package/dist/InputEmail/InputEmail.d.ts +1 -1
- package/dist/InputEmail/index.js +12 -12
- package/dist/InputFile/index.js +6 -6
- package/dist/{InputFile-e108a7f8.js → InputFile-5e0ed2b5.js} +48 -62
- package/dist/InputGroup/index.js +4 -5
- package/dist/InputNumber/index.js +22 -22
- package/dist/InputPassword/index.js +12 -12
- package/dist/InputText/InputText.d.ts +1 -1
- package/dist/InputText/index.js +9 -9
- package/dist/{InputText-523d0e48.js → InputText-12b112a9.js} +23 -24
- package/dist/InputTime/index.js +27 -27
- package/dist/InputValidation/index.js +4 -5
- package/dist/{InputValidation-06a8a7ba.js → InputValidation-97dd0dcf.js} +7 -8
- package/dist/LightBox/index.js +5 -6
- package/dist/{LightBox-1ad62669.js → LightBox-dd1afa97.js} +22 -26
- package/dist/List/index.js +26 -32
- package/dist/Markdown/index.js +6 -7
- package/dist/{Markdown-b53e0308.js → Markdown-be2dcd0c.js} +12 -18
- package/dist/Menu/index.js +4 -5
- package/dist/{Menu-826cfb89.js → Menu-d6a7d17b.js} +31 -36
- package/dist/Modal/index.js +6 -7
- package/dist/{Modal-cc3bd7bf.js → Modal-757e83fd.js} +13 -17
- package/dist/MultiSelect/index.js +53 -60
- package/dist/MultiSelect/types.d.ts +1 -1
- package/dist/{Option-fdf21181.js → Option-13150f4a.js} +3 -5
- package/dist/Page/Page.d.ts +1 -1
- package/dist/Page/index.js +21 -24
- package/dist/Popover/index.js +11 -13
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-e9a49129.js → ProgressBar-f028b159.js} +3 -4
- package/dist/RadioGroup/RadioOption.d.ts +2 -2
- package/dist/RadioGroup/index.js +9 -13
- package/dist/RecurringSelect/types.d.ts +2 -2
- package/dist/Select/Select.d.ts +1 -1
- package/dist/Select/index.js +9 -9
- package/dist/Spinner/index.js +1 -1
- package/dist/{Spinner-e4e9c8eb.js → Spinner-ae4c8a85.js} +5 -7
- package/dist/StatusLabel/StatusLabel.d.ts +1 -1
- package/dist/StatusLabel/index.js +6 -9
- package/dist/Switch/index.js +2 -3
- package/dist/{Switch-f03b70fc.js → Switch-7ac32f7b.js} +12 -16
- package/dist/Table/index.js +9 -17
- package/dist/Tabs/index.js +28 -34
- package/dist/Text/index.js +2 -3
- package/dist/{Text-e012fb46.js → Text-7ce00adb.js} +4 -5
- package/dist/Toast/Toast.d.ts +2 -2
- package/dist/Toast/index.js +42 -40
- package/dist/Tooltip/index.js +3 -4
- package/dist/Tooltip/useTooltipPositioning.d.ts +1 -1
- package/dist/{Tooltip-041feb00.js → Tooltip-1090a43d.js} +25 -28
- package/dist/Typography/Typography.d.ts +1 -1
- package/dist/Typography/index.js +1 -2
- package/dist/{Typography-fbe0ed6e.js → Typography-9262511f.js} +5 -7
- package/dist/tslib.es6-efe27175.js +38 -0
- package/package.json +8 -8
- package/dist/tslib.es6-5b50eb8e.js +0 -103
package/dist/Chips/index.js
CHANGED
|
@@ -3,20 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
|
|
7
6
|
var classnames = require('classnames');
|
|
8
7
|
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
9
8
|
var jobberHooks = require('@jobber/hooks');
|
|
10
|
-
var Icon = require('../Icon-
|
|
11
|
-
var Avatar = require('../Avatar-
|
|
12
|
-
var Typography = require('../Typography-
|
|
13
|
-
var Tooltip = require('../Tooltip-
|
|
9
|
+
var Icon = require('../Icon-405a216c.js');
|
|
10
|
+
var Avatar = require('../Avatar-89cfd0a6.js');
|
|
11
|
+
var Typography = require('../Typography-9262511f.js');
|
|
12
|
+
var Tooltip = require('../Tooltip-1090a43d.js');
|
|
14
13
|
var uuid = require('uuid');
|
|
15
14
|
var lodash = require('lodash');
|
|
16
15
|
var reactPopper = require('react-popper');
|
|
17
|
-
var Text = require('../Text-
|
|
18
|
-
var Button = require('../Button-
|
|
19
|
-
var Spinner = require('../Spinner-
|
|
16
|
+
var Text = require('../Text-7ce00adb.js');
|
|
17
|
+
var Button = require('../Button-16e043ec.js');
|
|
18
|
+
var Spinner = require('../Spinner-ae4c8a85.js');
|
|
20
19
|
require('@jobber/design');
|
|
21
20
|
require('color');
|
|
22
21
|
require('react-dom');
|
|
@@ -32,10 +31,9 @@ var css$1 = "/**\n * Used in the wrapping chips component:\n * - InternalChipSin
|
|
|
32
31
|
var styles$1 = {"wrapper":"uhcyg-a-GLRKF_7oHwvMP","chip":"_2XfthED8eqbKIyTNoH1aWp","hasPrefix":"_4U2lNr3Kk6xnNZTk3Fxgm","hasSuffix":"fl19i7ccgBu7NZkxnpvcI","clickable":"_3Uf2El5YBbG3DmUWHBhuea","input":"_35he2rVDYRU4YQko5r4adP","active":"_18wCcoIrboygQTnIVm8yzS","invalid":"_1FTJ2ALrm1mVaT7HdMFFGN","disabled":"B1ELFzeQy9Ihy9oYcv-px","button":"_1M_ek3kiaa7OApx5rwBEc3","icon":"_3AG5dSWeyKYD1Xfu9fN_DL"};
|
|
33
32
|
styleInject_es.styleInject(css$1);
|
|
34
33
|
|
|
35
|
-
function InternalChipButton(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return (React__default["default"].createElement("div", { ref: buttonRef, className: styles$1.button, tabIndex: 0, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, onClick: handleClick, role: "button", "aria-label": "Remove " + label, "aria-hidden": true, "aria-disabled": disabled, "data-testid": "remove-chip-button" },
|
|
34
|
+
function InternalChipButton({ icon, invalid, disabled, label, onClick, }) {
|
|
35
|
+
const buttonRef = React.useRef();
|
|
36
|
+
return (React__default["default"].createElement("div", { ref: buttonRef, className: styles$1.button, tabIndex: 0, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, onClick: handleClick, role: "button", "aria-label": `Remove ${label}`, "aria-hidden": true, "aria-disabled": disabled, "data-testid": "remove-chip-button" },
|
|
39
37
|
React__default["default"].createElement(Icon.Icon, { name: icon, color: getColor() })));
|
|
40
38
|
function handleKeyUp(event) {
|
|
41
39
|
if (document.activeElement === buttonRef.current &&
|
|
@@ -63,22 +61,21 @@ function InternalChipButton(_a) {
|
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
function InternalChipAffix(
|
|
67
|
-
var affix = _a.affix, active = _a.active, invalid = _a.invalid, disabled = _a.disabled;
|
|
64
|
+
function InternalChipAffix({ affix, active, invalid, disabled, }) {
|
|
68
65
|
assertProps();
|
|
69
66
|
if ((affix === null || affix === void 0 ? void 0 : affix.type) === Avatar.Avatar) {
|
|
70
|
-
return React__default["default"].createElement(Avatar.Avatar,
|
|
67
|
+
return React__default["default"].createElement(Avatar.Avatar, Object.assign({}, affix.props, { size: "small" }));
|
|
71
68
|
}
|
|
72
69
|
if ((affix === null || affix === void 0 ? void 0 : affix.type) === Icon.Icon) {
|
|
73
70
|
return renderChipIcon(affix);
|
|
74
71
|
}
|
|
75
72
|
if ((affix === null || affix === void 0 ? void 0 : affix.type) === InternalChipButton) {
|
|
76
|
-
return React__default["default"].createElement(InternalChipButton,
|
|
73
|
+
return React__default["default"].createElement(InternalChipButton, Object.assign({}, affix.props));
|
|
77
74
|
}
|
|
78
75
|
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
79
76
|
function renderChipIcon(icon) {
|
|
80
|
-
|
|
81
|
-
return (React__default["default"].createElement("div", { className: styles$1.icon }, React__default["default"].cloneElement(icon,
|
|
77
|
+
const color = getIconColor();
|
|
78
|
+
return (React__default["default"].createElement("div", { className: styles$1.icon }, React__default["default"].cloneElement(icon, Object.assign({ size: "base" }, (color && { color: color })))));
|
|
82
79
|
}
|
|
83
80
|
function getIconColor() {
|
|
84
81
|
if (disabled && !active)
|
|
@@ -90,95 +87,90 @@ function InternalChipAffix(_a) {
|
|
|
90
87
|
return;
|
|
91
88
|
}
|
|
92
89
|
function assertProps() {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
jobberHooks.useAssert(!!affix && !(isAvatar || isIcon || isChipButton),
|
|
90
|
+
const isAvatar = (affix === null || affix === void 0 ? void 0 : affix.type) === Avatar.Avatar || false;
|
|
91
|
+
const isIcon = (affix === null || affix === void 0 ? void 0 : affix.type) === Icon.Icon || false;
|
|
92
|
+
const isChipButton = (affix === null || affix === void 0 ? void 0 : affix.type) === InternalChipButton || false;
|
|
93
|
+
jobberHooks.useAssert(!!affix && !(isAvatar || isIcon || isChipButton), `Prefix prop only accepts "<Avatar />" or "<Icon />" component. You have "${affix === null || affix === void 0 ? void 0 : affix.type}".`);
|
|
97
94
|
}
|
|
98
95
|
}
|
|
99
96
|
|
|
100
|
-
function InternalChip(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var chip = (React__default["default"].createElement(Tag, tslib_es6.__assign({ className: classNames }, (isClickable && { onClick: onClick, disabled: disabled }), { onKeyDown: onKeyDown, "data-testid": "chip-wrapper", "aria-label": ariaLabel, tabIndex: tabIndex, role: tabIndex !== undefined ? "option" : undefined }),
|
|
116
|
-
React__default["default"].createElement(InternalChipAffix, tslib_es6.__assign({ affix: prefix }, affixProps)),
|
|
97
|
+
function InternalChip({ label, active = false, disabled = false, invalid = false, prefix, suffix, tabIndex, ariaLabel, onClick, onKeyDown, }) {
|
|
98
|
+
const [truncateRef, setTruncateRef] = React.useState();
|
|
99
|
+
const isClickable = onClick && !disabled;
|
|
100
|
+
const classNames = classnames__default["default"](styles$1.chip, {
|
|
101
|
+
[styles$1.clickable]: isClickable,
|
|
102
|
+
[styles$1.active]: active,
|
|
103
|
+
[styles$1.disabled]: disabled,
|
|
104
|
+
[styles$1.invalid]: invalid,
|
|
105
|
+
[styles$1.hasPrefix]: prefix,
|
|
106
|
+
[styles$1.hasSuffix]: suffix,
|
|
107
|
+
});
|
|
108
|
+
const affixProps = { active, invalid, disabled };
|
|
109
|
+
const Tag = onClick ? "button" : "div";
|
|
110
|
+
const chip = (React__default["default"].createElement(Tag, Object.assign({ className: classNames }, (isClickable && { onClick, disabled }), { onKeyDown: onKeyDown, "data-testid": "chip-wrapper", "aria-label": ariaLabel, tabIndex: tabIndex, role: tabIndex !== undefined ? "option" : undefined }),
|
|
111
|
+
React__default["default"].createElement(InternalChipAffix, Object.assign({ affix: prefix }, affixProps)),
|
|
117
112
|
React__default["default"].createElement(Typography.Typography, { element: "span", numberOfLines: 1, size: "base" },
|
|
118
113
|
React__default["default"].createElement("span", { ref: setTruncateRef }, label)),
|
|
119
|
-
React__default["default"].createElement(InternalChipAffix,
|
|
114
|
+
React__default["default"].createElement(InternalChipAffix, Object.assign({ affix: suffix }, affixProps))));
|
|
120
115
|
return isTruncated() ? React__default["default"].createElement(Tooltip.Tooltip, { message: label }, chip) : chip;
|
|
121
116
|
function isTruncated() {
|
|
122
117
|
var _a;
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
const truncateParentHeight = ((_a = truncateRef === null || truncateRef === void 0 ? void 0 : truncateRef.parentElement) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0;
|
|
119
|
+
const truncateChildHeight = (truncateRef === null || truncateRef === void 0 ? void 0 : truncateRef.offsetHeight) || 0;
|
|
125
120
|
return truncateChildHeight >= truncateParentHeight * 2;
|
|
126
121
|
}
|
|
127
122
|
}
|
|
128
123
|
|
|
129
|
-
function ChipDismissible(
|
|
130
|
-
var label = _a.label, disabled = _a.disabled, invalid = _a.invalid, prefix = _a.prefix, onClick = _a.onClick, onRequestRemove = _a.onRequestRemove;
|
|
124
|
+
function ChipDismissible({ label, disabled, invalid, prefix, onClick, onRequestRemove, }) {
|
|
131
125
|
return (React__default["default"].createElement(InternalChip, { label: label, disabled: disabled, invalid: invalid, prefix: prefix, onClick: onClick, suffix: React__default["default"].createElement(InternalChipButton, { icon: "remove", label: label, invalid: invalid, disabled: disabled, onClick: onRequestRemove }) }));
|
|
132
126
|
}
|
|
133
127
|
|
|
134
|
-
function InternalChipSingleSelect(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var isSelected = child.props.value === selected;
|
|
128
|
+
function InternalChipSingleSelect({ children, selected, name = uuid.v1(), onChange, onClick, }) {
|
|
129
|
+
return (React__default["default"].createElement("div", { className: styles$1.wrapper, "data-testid": "singleselect-chips" }, React__default["default"].Children.map(children, child => {
|
|
130
|
+
const isSelected = child.props.value === selected;
|
|
138
131
|
return (React__default["default"].createElement("label", null,
|
|
139
|
-
React__default["default"].createElement("input", { type: "radio", checked: isSelected, className: styles$1.input, name: name, onClick: handleClick(child.props.value), onKeyUp: handleKeyUp(isSelected, child.props.value), onChange:
|
|
132
|
+
React__default["default"].createElement("input", { type: "radio", checked: isSelected, className: styles$1.input, name: name, onClick: handleClick(child.props.value), onKeyUp: handleKeyUp(isSelected, child.props.value), onChange: () => {
|
|
140
133
|
/* No op. onClick handles the change to allow deselecting. */
|
|
141
134
|
}, disabled: child.props.disabled }),
|
|
142
|
-
React__default["default"].createElement(InternalChip,
|
|
135
|
+
React__default["default"].createElement(InternalChip, Object.assign({}, child.props, { active: isSelected }))));
|
|
143
136
|
})));
|
|
144
137
|
function handleKeyUp(active, value) {
|
|
145
138
|
if (!active)
|
|
146
139
|
return;
|
|
147
|
-
return
|
|
140
|
+
return (event) => {
|
|
148
141
|
if (event.key === " ") {
|
|
149
142
|
// Wait for DOM changes before applying the new change.
|
|
150
|
-
setTimeout(
|
|
143
|
+
setTimeout(() => handleChange(value), 0);
|
|
151
144
|
}
|
|
152
145
|
};
|
|
153
146
|
}
|
|
154
147
|
function handleClick(value) {
|
|
155
|
-
return
|
|
148
|
+
return (event) => {
|
|
156
149
|
onClick === null || onClick === void 0 ? void 0 : onClick(event, value);
|
|
157
150
|
handleChange(value);
|
|
158
151
|
};
|
|
159
152
|
}
|
|
160
153
|
function handleChange(value) {
|
|
161
|
-
|
|
154
|
+
const newValue = value !== selected ? value : undefined;
|
|
162
155
|
onChange(newValue);
|
|
163
156
|
}
|
|
164
157
|
}
|
|
165
158
|
|
|
166
|
-
function InternalChipMultiSelect(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
var isChipActive = isChipSelected(chip.props.value);
|
|
159
|
+
function InternalChipMultiSelect({ children, selected, onChange, onClick, }) {
|
|
160
|
+
return (React__default["default"].createElement("div", { className: styles$1.wrapper, "data-testid": "multiselect-chips" }, React__default["default"].Children.map(children, chip => {
|
|
161
|
+
const isChipActive = isChipSelected(chip.props.value);
|
|
170
162
|
return (React__default["default"].createElement("label", null,
|
|
171
163
|
React__default["default"].createElement("input", { type: "checkbox", checked: isChipActive, className: styles$1.input, onClick: handleClick(chip.props.value), onChange: handleChange(chip.props.value), disabled: chip.props.disabled }),
|
|
172
|
-
React__default["default"].createElement(InternalChip,
|
|
164
|
+
React__default["default"].createElement(InternalChip, Object.assign({}, chip.props, { active: isChipActive, suffix: checkmarkIcon(isChipActive) }))));
|
|
173
165
|
})));
|
|
174
166
|
function isChipSelected(value) {
|
|
175
167
|
return selected.includes(value);
|
|
176
168
|
}
|
|
177
169
|
function handleClick(value) {
|
|
178
|
-
return
|
|
170
|
+
return (event) => onClick === null || onClick === void 0 ? void 0 : onClick(event, value);
|
|
179
171
|
}
|
|
180
172
|
function handleChange(value) {
|
|
181
|
-
return
|
|
173
|
+
return () => {
|
|
182
174
|
if (isChipSelected(value)) {
|
|
183
175
|
handleDeselect(value);
|
|
184
176
|
}
|
|
@@ -188,12 +180,12 @@ function InternalChipMultiSelect(_a) {
|
|
|
188
180
|
};
|
|
189
181
|
}
|
|
190
182
|
function handleSelect(value) {
|
|
191
|
-
|
|
183
|
+
const newVal = [...selected, value];
|
|
192
184
|
onChange(newVal);
|
|
193
185
|
}
|
|
194
186
|
function handleDeselect(value) {
|
|
195
|
-
|
|
196
|
-
|
|
187
|
+
const values = selected;
|
|
188
|
+
const newVal = values.filter(val => val !== value);
|
|
197
189
|
onChange(newVal);
|
|
198
190
|
}
|
|
199
191
|
function checkmarkIcon(show) {
|
|
@@ -212,39 +204,34 @@ var css = ".UICoKaZcJNyJZu_jLSFe0 {\n display: -ms-flexbox;\n display: flex;\n
|
|
|
212
204
|
var styles = {"wrapper":"UICoKaZcJNyJZu_jLSFe0","input":"iYpu9Vckapbgfo7nKby6-","menu":"_3Y-bhobfNvAAUslopzbOoq","menuList":"_3pV83Z-mpuL-nlud9deXib","menuListOption":"yZlvrckyLt2bbuJSDc3s_","loadingIndicator":"_1JS35aIdiRtVwq3RLMJLlj","activeOption":"_1P6NA2S4eCq-AiLRgspXJX"};
|
|
213
205
|
styleInject_es.styleInject(css);
|
|
214
206
|
|
|
215
|
-
function useInternalChipDismissible(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var actions = {
|
|
228
|
-
handleChipRemove: function (value) {
|
|
229
|
-
return function () {
|
|
230
|
-
liveAnnounce(value + " Removed");
|
|
231
|
-
onChange(selected.filter(function (val) { return val !== value; }));
|
|
207
|
+
function useInternalChipDismissible({ children, selected, onChange, onClick, onCustomAdd, }) {
|
|
208
|
+
const ref = React.useRef(null);
|
|
209
|
+
const chipOptions = children.map(chip => chip.props);
|
|
210
|
+
const visibleChipOptions = chipOptions.filter(chip => selected.includes(chip.value));
|
|
211
|
+
const sortedVisibleChipOptions = lodash.sortBy(visibleChipOptions, chip => selected.indexOf(chip.value));
|
|
212
|
+
const availableChipOptions = chipOptions.filter(chip => !selected.includes(chip.value));
|
|
213
|
+
const { liveAnnounce } = jobberHooks.useLiveAnnounce();
|
|
214
|
+
const actions = {
|
|
215
|
+
handleChipRemove: (value) => {
|
|
216
|
+
return () => {
|
|
217
|
+
liveAnnounce(`${value} Removed`);
|
|
218
|
+
onChange(selected.filter(val => val !== value));
|
|
232
219
|
};
|
|
233
220
|
},
|
|
234
|
-
handleChipAdd:
|
|
221
|
+
handleChipAdd: (value) => onChange([...selected, value]),
|
|
235
222
|
handleCustomAdd: onCustomAdd,
|
|
236
|
-
handleChipClick:
|
|
223
|
+
handleChipClick: (value) => {
|
|
237
224
|
if (onClick === undefined)
|
|
238
225
|
return;
|
|
239
|
-
return
|
|
226
|
+
return (event) => onClick(event, value);
|
|
240
227
|
},
|
|
241
|
-
handleWrapperKeyDown:
|
|
242
|
-
|
|
243
|
-
|
|
228
|
+
handleWrapperKeyDown: (event) => {
|
|
229
|
+
const target = event.target;
|
|
230
|
+
const isInputAndHasValue = target instanceof HTMLInputElement && target.value;
|
|
244
231
|
if (isInputAndHasValue)
|
|
245
232
|
return;
|
|
246
|
-
|
|
247
|
-
|
|
233
|
+
const nextElementToFocus = target.nextElementSibling;
|
|
234
|
+
const prevElementToFocus = target.previousElementSibling;
|
|
248
235
|
if (event.key === "ArrowLeft" &&
|
|
249
236
|
prevElementToFocus instanceof HTMLElement) {
|
|
250
237
|
prevElementToFocus.focus();
|
|
@@ -254,13 +241,13 @@ function useInternalChipDismissible(_a) {
|
|
|
254
241
|
nextElementToFocus.focus();
|
|
255
242
|
}
|
|
256
243
|
},
|
|
257
|
-
handleChipKeyDown:
|
|
258
|
-
return
|
|
244
|
+
handleChipKeyDown: (value) => {
|
|
245
|
+
return (event) => {
|
|
259
246
|
if (event.key === "Backspace" || event.key === "Delete") {
|
|
260
|
-
|
|
247
|
+
const target = event.target;
|
|
261
248
|
if (target instanceof HTMLElement) {
|
|
262
|
-
|
|
263
|
-
|
|
249
|
+
const prevElement = target.previousElementSibling;
|
|
250
|
+
const nextElement = target.nextElementSibling;
|
|
264
251
|
if (prevElement instanceof HTMLElement) {
|
|
265
252
|
prevElement.focus();
|
|
266
253
|
}
|
|
@@ -273,100 +260,99 @@ function useInternalChipDismissible(_a) {
|
|
|
273
260
|
};
|
|
274
261
|
},
|
|
275
262
|
};
|
|
276
|
-
return
|
|
277
|
-
sortedVisibleChipOptions
|
|
278
|
-
availableChipOptions
|
|
263
|
+
return Object.assign(Object.assign({}, actions), { ref,
|
|
264
|
+
sortedVisibleChipOptions,
|
|
265
|
+
availableChipOptions });
|
|
279
266
|
}
|
|
280
267
|
|
|
281
|
-
|
|
268
|
+
const menuId = uuid.v1();
|
|
282
269
|
// eslint-disable-next-line max-statements
|
|
283
|
-
function useInternalChipDismissibleInput(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
React.useEffect(function () {
|
|
270
|
+
function useInternalChipDismissibleInput({ options, isLoadingMore = false, onCustomOptionSelect, onOptionSelect, onSearch, }) {
|
|
271
|
+
const [allOptions, setAllOptions] = React.useState([]);
|
|
272
|
+
const [searchValue, setSearchValue] = React.useState("");
|
|
273
|
+
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
274
|
+
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
275
|
+
const [shouldCancelBlur, setShouldCancelBlur] = React.useState(false);
|
|
276
|
+
const [shouldCancelEnter, setShouldCancelEnter] = React.useState(false);
|
|
277
|
+
const canAddCustomOption = onCustomOptionSelect !== undefined && !isLoadingMore;
|
|
278
|
+
const maxOptionIndex = allOptions.length - 1;
|
|
279
|
+
const { liveAnnounce } = jobberHooks.useLiveAnnounce();
|
|
280
|
+
React.useEffect(() => {
|
|
295
281
|
setAllOptions(generateOptions(options, searchValue, canAddCustomOption));
|
|
296
282
|
}, [options]);
|
|
297
|
-
|
|
298
|
-
menuId
|
|
283
|
+
const computed = {
|
|
284
|
+
menuId,
|
|
299
285
|
inputRef: React.useRef(null),
|
|
300
286
|
activeOption: allOptions[activeIndex],
|
|
301
287
|
hasAvailableOptions: allOptions.length > 0,
|
|
302
288
|
nextOptionIndex: activeIndex < maxOptionIndex ? activeIndex + 1 : 0,
|
|
303
289
|
previousOptionIndex: activeIndex > 0 ? activeIndex - 1 : maxOptionIndex,
|
|
304
290
|
};
|
|
305
|
-
|
|
306
|
-
generateDescendantId:
|
|
307
|
-
handleReset:
|
|
291
|
+
const actions = {
|
|
292
|
+
generateDescendantId: (index) => `${computed.menuId}-${index}`,
|
|
293
|
+
handleReset: () => {
|
|
308
294
|
setActiveIndex(activeIndex === 0 ? activeIndex : activeIndex - 1);
|
|
309
295
|
setSearchValue("");
|
|
310
296
|
},
|
|
311
|
-
handleOpenMenu:
|
|
312
|
-
handleCloseMenu:
|
|
297
|
+
handleOpenMenu: () => setMenuOpen(true),
|
|
298
|
+
handleCloseMenu: () => {
|
|
313
299
|
setMenuOpen(false);
|
|
314
300
|
setActiveIndex(0);
|
|
315
301
|
},
|
|
316
|
-
handleCancelBlur:
|
|
317
|
-
handleEnableBlur:
|
|
318
|
-
handleBlur:
|
|
302
|
+
handleCancelBlur: () => setShouldCancelBlur(true),
|
|
303
|
+
handleEnableBlur: () => setShouldCancelBlur(false),
|
|
304
|
+
handleBlur: () => {
|
|
319
305
|
if (shouldCancelBlur)
|
|
320
306
|
return;
|
|
321
307
|
actions.handleReset();
|
|
322
308
|
actions.handleCloseMenu();
|
|
323
309
|
},
|
|
324
|
-
handleSearchChange:
|
|
310
|
+
handleSearchChange: (event) => {
|
|
325
311
|
setActiveIndex(0);
|
|
326
312
|
setSearchValue(event.currentTarget.value);
|
|
327
313
|
setShouldCancelEnter(true);
|
|
328
314
|
},
|
|
329
|
-
handleSetActiveOnMouseOver:
|
|
330
|
-
return
|
|
315
|
+
handleSetActiveOnMouseOver: (index) => {
|
|
316
|
+
return () => setActiveIndex(index);
|
|
331
317
|
},
|
|
332
|
-
handleSelectOption:
|
|
318
|
+
handleSelectOption: (selected) => {
|
|
333
319
|
var _a;
|
|
334
320
|
if (allOptions.length === 0)
|
|
335
321
|
return;
|
|
336
|
-
|
|
322
|
+
const setValue = selected.custom ? onCustomOptionSelect : onOptionSelect;
|
|
337
323
|
if (setValue) {
|
|
338
324
|
setValue(selected.value);
|
|
339
|
-
liveAnnounce(selected.label
|
|
325
|
+
liveAnnounce(`${selected.label} Added`);
|
|
340
326
|
actions.handleReset();
|
|
341
327
|
(_a = computed.inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
342
328
|
}
|
|
343
329
|
},
|
|
344
|
-
handleKeyDown:
|
|
345
|
-
|
|
346
|
-
Enter:
|
|
330
|
+
handleKeyDown: (event) => {
|
|
331
|
+
const callbacks = {
|
|
332
|
+
Enter: () => {
|
|
347
333
|
if (shouldCancelEnter)
|
|
348
334
|
return;
|
|
349
335
|
actions.handleSelectOption(computed.activeOption);
|
|
350
336
|
},
|
|
351
|
-
Tab:
|
|
352
|
-
",":
|
|
337
|
+
Tab: () => actions.handleSelectOption(computed.activeOption),
|
|
338
|
+
",": () => {
|
|
353
339
|
if (searchValue.length === 0)
|
|
354
340
|
return;
|
|
355
341
|
actions.handleSelectOption(generateCustomOptionObject(searchValue));
|
|
356
342
|
},
|
|
357
|
-
ArrowDown:
|
|
343
|
+
ArrowDown: () => {
|
|
358
344
|
if (isLoadingMore && activeIndex === maxOptionIndex)
|
|
359
345
|
return;
|
|
360
346
|
setActiveIndex(computed.nextOptionIndex);
|
|
361
347
|
},
|
|
362
|
-
ArrowUp:
|
|
348
|
+
ArrowUp: () => setActiveIndex(computed.previousOptionIndex),
|
|
363
349
|
};
|
|
364
350
|
if (searchValue.length === 0) {
|
|
365
|
-
callbacks.Backspace =
|
|
351
|
+
callbacks.Backspace = () => {
|
|
366
352
|
var _a;
|
|
367
353
|
// If there's no text left to delete,
|
|
368
354
|
// and delete is pressed again, focus on a chip instead.
|
|
369
|
-
|
|
355
|
+
const target = (_a = computed.inputRef.current) === null || _a === void 0 ? void 0 : _a.previousElementSibling;
|
|
370
356
|
if (target instanceof HTMLElement) {
|
|
371
357
|
target.focus();
|
|
372
358
|
}
|
|
@@ -374,30 +360,28 @@ function useInternalChipDismissibleInput(_a) {
|
|
|
374
360
|
}
|
|
375
361
|
handleKeydownEvents(callbacks, event);
|
|
376
362
|
},
|
|
377
|
-
handleDebouncedSearch: lodash.debounce(
|
|
363
|
+
handleDebouncedSearch: lodash.debounce(() => {
|
|
378
364
|
onSearch && onSearch(searchValue);
|
|
379
365
|
setAllOptions(generateOptions(options, searchValue, canAddCustomOption));
|
|
380
366
|
setShouldCancelEnter(false);
|
|
381
367
|
}, 300),
|
|
382
368
|
};
|
|
383
|
-
return
|
|
384
|
-
allOptions
|
|
385
|
-
searchValue
|
|
386
|
-
shouldCancelBlur
|
|
369
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, actions), { activeIndex,
|
|
370
|
+
allOptions }), computed), { menuOpen,
|
|
371
|
+
searchValue,
|
|
372
|
+
shouldCancelBlur });
|
|
387
373
|
}
|
|
388
374
|
function generateOptions(options, searchValue, canAddCustomOption) {
|
|
389
|
-
|
|
390
|
-
.filter(
|
|
391
|
-
|
|
392
|
-
})
|
|
393
|
-
.map(function (opt) { return (tslib_es6.__assign(tslib_es6.__assign({}, opt), { custom: false })); });
|
|
394
|
-
var _a = generateCustomOption(allOptions, searchValue, canAddCustomOption), shouldAddCustomOption = _a.shouldAddCustomOption, customOption = _a.customOption;
|
|
375
|
+
const allOptions = options
|
|
376
|
+
.filter(option => option.label.toLowerCase().match(searchValue.trim().toLowerCase()))
|
|
377
|
+
.map(opt => (Object.assign(Object.assign({}, opt), { custom: false })));
|
|
378
|
+
const { shouldAddCustomOption, customOption } = generateCustomOption(allOptions, searchValue, canAddCustomOption);
|
|
395
379
|
shouldAddCustomOption && allOptions.push(customOption);
|
|
396
380
|
return allOptions;
|
|
397
381
|
}
|
|
398
382
|
function generateCustomOption(options, searchValue, canAddCustomOption) {
|
|
399
383
|
function shouldAddCustomOption() {
|
|
400
|
-
|
|
384
|
+
const isMatchingOption = options.some(option => option.label.toLowerCase() === searchValue.trim().toLowerCase());
|
|
401
385
|
return !!searchValue && !isMatchingOption;
|
|
402
386
|
}
|
|
403
387
|
return {
|
|
@@ -416,8 +400,7 @@ function generateCustomOptionObject(searchValue) {
|
|
|
416
400
|
function handleKeydownEvents(callbacks, event) {
|
|
417
401
|
if (event.shiftKey)
|
|
418
402
|
return;
|
|
419
|
-
Object.entries(callbacks).forEach(
|
|
420
|
-
var _b = tslib_es6.__read(_a, 2), key = _b[0], callback = _b[1];
|
|
403
|
+
Object.entries(callbacks).forEach(([key, callback]) => {
|
|
421
404
|
if (event.key === key) {
|
|
422
405
|
event.preventDefault();
|
|
423
406
|
callback(event);
|
|
@@ -426,40 +409,40 @@ function handleKeydownEvents(callbacks, event) {
|
|
|
426
409
|
}
|
|
427
410
|
|
|
428
411
|
function useInView() {
|
|
429
|
-
|
|
430
|
-
|
|
412
|
+
const ref = React.useRef(null);
|
|
413
|
+
const [isInView, setIsInView] = React.useState(false);
|
|
431
414
|
if (window.IntersectionObserver) {
|
|
432
|
-
|
|
415
|
+
const observer = new IntersectionObserver(entries => {
|
|
433
416
|
setIsInView(entries[0].isIntersecting);
|
|
434
417
|
});
|
|
435
|
-
React.useEffect(
|
|
436
|
-
ref.current &&
|
|
437
|
-
return
|
|
418
|
+
React.useEffect(() => {
|
|
419
|
+
ref.current && observer.observe(ref.current);
|
|
420
|
+
return () => {
|
|
438
421
|
if (!ref.current)
|
|
439
422
|
return;
|
|
440
|
-
|
|
423
|
+
observer.unobserve(ref.current);
|
|
441
424
|
};
|
|
442
425
|
});
|
|
443
426
|
}
|
|
444
|
-
return { ref
|
|
427
|
+
return { ref, isInView };
|
|
445
428
|
}
|
|
446
429
|
|
|
447
430
|
function useRepositionMenu(attachTo) {
|
|
448
431
|
var _a;
|
|
449
|
-
|
|
450
|
-
|
|
432
|
+
const [positionElement, setPositionedElementRef] = React.useState();
|
|
433
|
+
const popper = reactPopper.usePopper(attachTo.current, positionElement, {
|
|
451
434
|
modifiers: [
|
|
452
435
|
{ name: "offset", options: { offset: [0, 8] } },
|
|
453
436
|
{ name: "flip", options: { fallbackPlacements: ["top"] } },
|
|
454
437
|
],
|
|
455
438
|
});
|
|
456
|
-
|
|
457
|
-
return
|
|
439
|
+
const targetWidth = (_a = attachTo.current) === null || _a === void 0 ? void 0 : _a.clientWidth;
|
|
440
|
+
return Object.assign(Object.assign({}, popper), { setPositionedElementRef, targetWidth });
|
|
458
441
|
}
|
|
459
442
|
|
|
460
443
|
function useScrollToActive(index) {
|
|
461
|
-
|
|
462
|
-
React.useEffect(
|
|
444
|
+
const ref = React.useRef(null);
|
|
445
|
+
React.useEffect(() => {
|
|
463
446
|
var _a, _b;
|
|
464
447
|
if (!window.HTMLElement.prototype.scrollIntoView)
|
|
465
448
|
return;
|
|
@@ -473,20 +456,20 @@ function useScrollToActive(index) {
|
|
|
473
456
|
}
|
|
474
457
|
|
|
475
458
|
function InternalChipDismissibleInput(props) {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
React.useEffect(
|
|
459
|
+
const { activator = React__default["default"].createElement(Button.Button, { icon: "add", type: "secondary", ariaLabel: "Add" }), attachTo, isLoadingMore = false, onLoadMore, } = props;
|
|
460
|
+
const { activeIndex, allOptions, hasAvailableOptions, inputRef, menuId, menuOpen, searchValue, generateDescendantId, handleBlur, handleOpenMenu, handleSearchChange, handleCancelBlur, handleEnableBlur, handleSetActiveOnMouseOver, handleKeyDown, handleSelectOption, handleDebouncedSearch, } = useInternalChipDismissibleInput(props);
|
|
461
|
+
const menuRef = useScrollToActive(activeIndex);
|
|
462
|
+
const { ref: visibleChildRef, isInView } = useInView();
|
|
463
|
+
const { styles: popperStyles, attributes, update, setPositionedElementRef, } = useRepositionMenu(attachTo);
|
|
464
|
+
React.useEffect(() => {
|
|
482
465
|
if (menuOpen && update)
|
|
483
466
|
update();
|
|
484
467
|
}, [allOptions]);
|
|
485
|
-
React.useEffect(
|
|
468
|
+
React.useEffect(() => {
|
|
486
469
|
handleDebouncedSearch();
|
|
487
470
|
return handleDebouncedSearch.cancel;
|
|
488
471
|
}, [searchValue]);
|
|
489
|
-
React.useEffect(
|
|
472
|
+
React.useEffect(() => {
|
|
490
473
|
isInView && onLoadMore && onLoadMore(searchValue);
|
|
491
474
|
}, [isInView]);
|
|
492
475
|
if (!menuOpen) {
|
|
@@ -494,36 +477,33 @@ function InternalChipDismissibleInput(props) {
|
|
|
494
477
|
}
|
|
495
478
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
496
479
|
React__default["default"].createElement("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": "Press up and down arrow to cycle through the options or type to narrow down the results", "aria-autocomplete": "list", "aria-owns": menuId, "aria-expanded": hasAvailableOptions, "aria-activedescendant": generateDescendantId(activeIndex), value: searchValue, onChange: handleSearchChange, onKeyDown: handleKeyDown, onBlur: lodash.debounce(handleBlur, 200), onFocus: handleOpenMenu, autoFocus: true }),
|
|
497
|
-
(hasAvailableOptions || isLoadingMore) && (React__default["default"].createElement("div",
|
|
480
|
+
(hasAvailableOptions || isLoadingMore) && (React__default["default"].createElement("div", Object.assign({ ref: setPositionedElementRef, className: styles.menu, style: popperStyles.popper }, attributes.popper),
|
|
498
481
|
React__default["default"].createElement("div", { ref: menuRef, role: "listbox", id: menuId, className: styles.menuList, "data-testid": "chip-menu" },
|
|
499
|
-
allOptions.map(
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
React__default["default"].createElement("span", { "aria-hidden": true }, option.prefix),
|
|
505
|
-
React__default["default"].createElement(Text.Text, null, option.label)));
|
|
506
|
-
}),
|
|
482
|
+
allOptions.map((option, i) => (React__default["default"].createElement("button", { key: option.value, role: "option", id: generateDescendantId(i), className: classnames__default["default"](styles.menuListOption, {
|
|
483
|
+
[styles.activeOption]: activeIndex === i,
|
|
484
|
+
}), onClick: () => handleSelectOption(option), onMouseEnter: handleSetActiveOnMouseOver(i), onMouseDown: handleCancelBlur, onMouseUp: handleEnableBlur },
|
|
485
|
+
React__default["default"].createElement("span", { "aria-hidden": true }, option.prefix),
|
|
486
|
+
React__default["default"].createElement(Text.Text, null, option.label)))),
|
|
507
487
|
React__default["default"].createElement("div", { ref: visibleChildRef }),
|
|
508
488
|
isLoadingMore && (React__default["default"].createElement("div", { className: styles.loadingIndicator },
|
|
509
489
|
React__default["default"].createElement(Spinner.Spinner, { size: "small", inline: true }))))))));
|
|
510
490
|
}
|
|
511
491
|
|
|
512
492
|
function InternalChipDismissible(props) {
|
|
513
|
-
|
|
493
|
+
const { availableChipOptions, ref: wrapperRef, sortedVisibleChipOptions, handleChipAdd, handleChipClick, handleChipKeyDown, handleChipRemove, handleCustomAdd, handleWrapperKeyDown, } = useInternalChipDismissible(props);
|
|
514
494
|
return (React__default["default"].createElement("div", { ref: wrapperRef, className: styles.wrapper, "data-testid": "dismissible-chips", onKeyDown: handleWrapperKeyDown, role: "listbox" },
|
|
515
|
-
sortedVisibleChipOptions.map(
|
|
495
|
+
sortedVisibleChipOptions.map(chip => (React__default["default"].createElement(InternalChip, Object.assign({ key: chip.value }, chip, { onKeyDown: handleChipKeyDown(chip.value), onClick: handleChipClick(chip.value), ariaLabel: `${chip.value}. Press delete or backspace to remove ${chip.value}`, tabIndex: 0, suffix: React__default["default"].createElement(InternalChipButton, { icon: "remove", invalid: chip.invalid, disabled: chip.disabled, label: chip.label, onClick: handleChipRemove(chip.value) }) })))),
|
|
516
496
|
React__default["default"].createElement(InternalChipDismissibleInput, { activator: props.activator, attachTo: wrapperRef, isLoadingMore: props.isLoadingMore, options: availableChipOptions, onOptionSelect: handleChipAdd, onCustomOptionSelect: handleCustomAdd, onSearch: props.onSearch, onLoadMore: props.onLoadMore })));
|
|
517
497
|
}
|
|
518
498
|
|
|
519
499
|
function Chips(props) {
|
|
520
500
|
switch (props.type) {
|
|
521
501
|
case "dismissible":
|
|
522
|
-
return React__default["default"].createElement(InternalChipDismissible,
|
|
502
|
+
return React__default["default"].createElement(InternalChipDismissible, Object.assign({}, props));
|
|
523
503
|
case "multiselect":
|
|
524
|
-
return React__default["default"].createElement(InternalChipMultiSelect,
|
|
504
|
+
return React__default["default"].createElement(InternalChipMultiSelect, Object.assign({}, props));
|
|
525
505
|
default:
|
|
526
|
-
return React__default["default"].createElement(InternalChipSingleSelect,
|
|
506
|
+
return React__default["default"].createElement(InternalChipSingleSelect, Object.assign({}, props));
|
|
527
507
|
}
|
|
528
508
|
}
|
|
529
509
|
|