@pingux/astro 2.242.0-alpha.0 → 2.243.0-alpha.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/lib/cjs/components/CodeView/CodeView.js +8 -4
- package/lib/cjs/components/CopyText/CopyButton.js +2 -7
- package/lib/cjs/components/CopyText/CopyText.js +10 -3
- package/lib/cjs/components/MultivaluesField/BadgeLabelTooltip.d.ts +3 -0
- package/lib/cjs/components/MultivaluesField/BadgeLabelTooltip.js +3 -3
- package/lib/cjs/components/MultivaluesField/CondensedMultivaluesField.d.ts +4 -0
- package/lib/cjs/components/MultivaluesField/CondensedMultivaluesField.js +24 -132
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.d.ts +4 -0
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.js +33 -139
- package/lib/cjs/components/MultivaluesField/MultivaluesField.d.ts +4 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +6 -104
- package/lib/cjs/components/MultivaluesField/index.d.ts +1 -0
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +1 -1
- package/lib/cjs/styles/themes/next-gen/codeView/codeView.d.ts +6 -42
- package/lib/cjs/styles/themes/next-gen/codeView/codeView.js +2 -14
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +10 -70
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +2 -14
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +4 -28
- package/lib/cjs/types/MultivaluesField.d.ts +212 -0
- package/lib/cjs/types/MultivaluesField.js +5 -0
- package/lib/cjs/types/copyText.d.ts +1 -0
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +11 -0
- package/lib/components/CodeView/CodeView.js +8 -4
- package/lib/components/CopyText/CopyButton.js +2 -7
- package/lib/components/CopyText/CopyText.js +10 -3
- package/lib/components/MultivaluesField/BadgeLabelTooltip.js +3 -3
- package/lib/components/MultivaluesField/CondensedMultivaluesField.js +24 -132
- package/lib/components/MultivaluesField/DefaultMultivaluesField.js +33 -139
- package/lib/components/MultivaluesField/MultivaluesField.js +7 -105
- package/lib/components/RadioGroupField/RadioGroupField.js +1 -1
- package/lib/styles/themes/next-gen/codeView/codeView.js +2 -14
- package/lib/types/MultivaluesField.js +1 -0
- package/lib/types/index.js +1 -0
- package/package.json +1 -1
|
@@ -12,16 +12,12 @@ var _i18n = require("@react-aria/i18n");
|
|
|
12
12
|
var _utils = require("@react-aria/utils");
|
|
13
13
|
var _visuallyHidden = require("@react-aria/visually-hidden");
|
|
14
14
|
var _list = require("@react-stately/list");
|
|
15
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
15
|
var _ = require("../..");
|
|
17
16
|
var _MultivaluesContext = require("../../context/MultivaluesContext");
|
|
18
17
|
var _hooks = require("../../hooks");
|
|
19
18
|
var _loadingStates = _interopRequireDefault(require("../../utils/devUtils/constants/loadingStates"));
|
|
20
19
|
var _pendoID = require("../../utils/devUtils/constants/pendoID");
|
|
21
|
-
var
|
|
22
|
-
var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
|
|
23
|
-
var _fieldAttributes = require("../../utils/docUtils/fieldAttributes");
|
|
24
|
-
var _statusProp = require("../../utils/docUtils/statusProp");
|
|
20
|
+
var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
|
|
25
21
|
var _ListBox = _interopRequireDefault(require("../ListBox"));
|
|
26
22
|
var _Popover = _interopRequireDefault(require("../Popover/Popover"));
|
|
27
23
|
var _BadgeLabelTooltip = _interopRequireDefault(require("./BadgeLabelTooltip"));
|
|
@@ -34,7 +30,7 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
34
30
|
} = props;
|
|
35
31
|
const {
|
|
36
32
|
defaultSelectedKeys,
|
|
37
|
-
direction,
|
|
33
|
+
direction = 'bottom',
|
|
38
34
|
disabledKeys = [],
|
|
39
35
|
containerProps,
|
|
40
36
|
hasAutoFocus,
|
|
@@ -44,7 +40,7 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
44
40
|
isDisabled,
|
|
45
41
|
isFilteringDisabled,
|
|
46
42
|
isNotFlippable,
|
|
47
|
-
isReadOnly,
|
|
43
|
+
isReadOnly = false,
|
|
48
44
|
isRequired,
|
|
49
45
|
label,
|
|
50
46
|
loadingState,
|
|
@@ -62,8 +58,10 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
62
58
|
placeholder,
|
|
63
59
|
readOnlyKeys = [],
|
|
64
60
|
selectedKeys,
|
|
65
|
-
scrollBoxProps
|
|
66
|
-
|
|
61
|
+
scrollBoxProps = {
|
|
62
|
+
maxHeight: 300
|
|
63
|
+
},
|
|
64
|
+
status = _statuses.default.DEFAULT,
|
|
67
65
|
...others
|
|
68
66
|
} = otherProps;
|
|
69
67
|
const hasCustomValue = mode === 'non-restrictive';
|
|
@@ -85,7 +83,7 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
85
83
|
}
|
|
86
84
|
}, [initialItems, mode]);
|
|
87
85
|
const toggleItems = keys => {
|
|
88
|
-
setItems(initialItems.filter(item => !Array.from(keys).includes(item.key)));
|
|
86
|
+
setItems((initialItems || []).filter(item => !Array.from(keys).includes(item.key)));
|
|
89
87
|
if (onSelectionChange) onSelectionChange(keys);
|
|
90
88
|
// Selecting an option removes it from the list, unmounting its row while
|
|
91
89
|
// focusedKey still points at it — the virtualizer then holds DOM focus on
|
|
@@ -106,7 +104,7 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
106
104
|
};
|
|
107
105
|
const state = (0, _list.useListState)({
|
|
108
106
|
...otherProps,
|
|
109
|
-
items: items.filter(({
|
|
107
|
+
items: (items || []).filter(({
|
|
110
108
|
key
|
|
111
109
|
}) => !readOnlyKeys.includes(key)),
|
|
112
110
|
onSelectionChange: toggleItems,
|
|
@@ -118,6 +116,10 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
118
116
|
const {
|
|
119
117
|
selectionManager
|
|
120
118
|
} = state;
|
|
119
|
+
|
|
120
|
+
// `selectionManager.state` is private in the react-stately typings but is
|
|
121
|
+
// read throughout this component; the access is kept via a cast.
|
|
122
|
+
const selectionManagerState = selectionManager.state;
|
|
121
123
|
const filteredItems = (0, _react.useMemo)(() => Array.from(state.collection), [state.collection, filterString]);
|
|
122
124
|
const close = () => setIsOpen(false);
|
|
123
125
|
const {
|
|
@@ -127,13 +129,13 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
127
129
|
inputValue: filterString
|
|
128
130
|
});
|
|
129
131
|
const closeBadgeRefs = (0, _react.useRef)([]);
|
|
130
|
-
const inputWrapperRef = (0, _react.useRef)();
|
|
131
|
-
const inputRef = (0, _react.useRef)();
|
|
132
|
+
const inputWrapperRef = (0, _react.useRef)(null);
|
|
133
|
+
const inputRef = (0, _react.useRef)(null);
|
|
132
134
|
/* istanbul ignore next */
|
|
133
135
|
(0, _react.useImperativeHandle)(ref, () => inputWrapperRef.current);
|
|
134
136
|
(0, _react.useImperativeHandle)(ref, () => inputRef.current);
|
|
135
|
-
const listBoxRef = (0, _react.useRef)();
|
|
136
|
-
const popoverRef = (0, _react.useRef)();
|
|
137
|
+
const listBoxRef = (0, _react.useRef)(null);
|
|
138
|
+
const popoverRef = (0, _react.useRef)(null);
|
|
137
139
|
|
|
138
140
|
// Measure the width of the input to inform the width of the menu (below).
|
|
139
141
|
const [menuWidth, setMenuWidth] = (0, _react.useState)(null);
|
|
@@ -159,13 +161,13 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
159
161
|
(0, _react.useEffect)(() => {
|
|
160
162
|
if (defaultSelectedKeys) {
|
|
161
163
|
selectionManager.setSelectedKeys(defaultSelectedKeys);
|
|
162
|
-
setItems(prevItems => prevItems.filter(item => !Array.from(defaultSelectedKeys).includes(item.key)));
|
|
164
|
+
setItems(prevItems => (prevItems || []).filter(item => !Array.from(defaultSelectedKeys).includes(item.key)));
|
|
163
165
|
}
|
|
164
166
|
}, []);
|
|
165
167
|
(0, _react.useEffect)(() => {
|
|
166
168
|
if (selectedKeys) {
|
|
167
169
|
selectionManager.setSelectedKeys(selectedKeys);
|
|
168
|
-
setItems(prevItems => prevItems.filter(item => !Array.from(selectedKeys).includes(item.key)));
|
|
170
|
+
setItems(prevItems => (prevItems || []).filter(item => !Array.from(selectedKeys).includes(item.key)));
|
|
169
171
|
}
|
|
170
172
|
}, []);
|
|
171
173
|
(0, _react.useEffect)(() => {
|
|
@@ -180,7 +182,7 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
180
182
|
if (state.selectionManager.isSelected(key)) {
|
|
181
183
|
return;
|
|
182
184
|
}
|
|
183
|
-
selectionManager.setSelectedKeys([].concat(Array.from(
|
|
185
|
+
selectionManager.setSelectedKeys([].concat(Array.from(selectionManagerState.selectedKeys), [key]));
|
|
184
186
|
setCustomItems([].concat(customItems, [{
|
|
185
187
|
id: key,
|
|
186
188
|
key,
|
|
@@ -269,9 +271,9 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
269
271
|
if (activeBadgesKeys.length > 1) {
|
|
270
272
|
const badgeIndex = activeBadgesKeys.findIndex(item => item === key);
|
|
271
273
|
const nextFocusBadgeIndex = badgeIndex === activeBadgesKeys.length - 1 ? badgeIndex - 1 : badgeIndex;
|
|
272
|
-
closeBadgeRefs.current[nextFocusBadgeIndex]
|
|
274
|
+
closeBadgeRefs.current[nextFocusBadgeIndex]?.focus();
|
|
273
275
|
} else {
|
|
274
|
-
inputRef.current
|
|
276
|
+
inputRef.current?.focus();
|
|
275
277
|
}
|
|
276
278
|
};
|
|
277
279
|
const readOnlyFieldBadge = (key, name) => {
|
|
@@ -300,28 +302,28 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
300
302
|
}, name);
|
|
301
303
|
};
|
|
302
304
|
const readOnlyInputEntry = isReadOnly && (readOnlyKeys.length ? readOnlyKeys.map(key => {
|
|
303
|
-
const item = [].concat(initialItems, customItems).find(el => el.key === key);
|
|
305
|
+
const item = [].concat(initialItems || [], customItems).find(el => el.key === key);
|
|
304
306
|
if (item) {
|
|
305
|
-
return readOnlyTextItem(item.key, item.name);
|
|
307
|
+
return item.key !== undefined && readOnlyTextItem(item.key, item.name);
|
|
306
308
|
}
|
|
307
309
|
return null;
|
|
308
|
-
}) : initialItems.map(item => {
|
|
309
|
-
return readOnlyTextItem(item.key, item.name);
|
|
310
|
+
}) : (initialItems || []).map(item => {
|
|
311
|
+
return item.key !== undefined && readOnlyTextItem(item.key, item.name);
|
|
310
312
|
}));
|
|
311
313
|
const onyxReadOnlyInputEntry = isReadOnly && (0, _react2.jsx)(_.Box, {
|
|
312
314
|
isRow: true,
|
|
313
315
|
gap: "xs"
|
|
314
|
-
}, initialItems.map(item => {
|
|
315
|
-
return readOnlyFieldBadge(item.key, item.name);
|
|
316
|
+
}, (initialItems || []).map(item => {
|
|
317
|
+
return item.key !== undefined && readOnlyFieldBadge(item.key, item.name || '');
|
|
316
318
|
}));
|
|
317
319
|
const readOnlyItems = !isReadOnly && readOnlyKeys.map(key => {
|
|
318
|
-
const item = initialItems.find(el => el.key === key);
|
|
320
|
+
const item = (initialItems || []).find(el => el.key === key);
|
|
319
321
|
if (item) {
|
|
320
322
|
return (0, _react2.jsx)(_.Badge, {
|
|
321
323
|
key: item.key,
|
|
322
324
|
label: item.name,
|
|
323
325
|
variant: "readOnlyBadge",
|
|
324
|
-
as:
|
|
326
|
+
as: 'li',
|
|
325
327
|
tabIndex: 0
|
|
326
328
|
});
|
|
327
329
|
}
|
|
@@ -335,7 +337,7 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
335
337
|
closeBadgeRefs: closeBadgeRefs
|
|
336
338
|
});
|
|
337
339
|
const selectedItems = (0, _react2.jsx)(_react.default.Fragment, null, Array.from(selectionManager.selectedKeys).map((key, i) => {
|
|
338
|
-
const item = [].concat(initialItems, customItems).find(el => el.key === key);
|
|
340
|
+
const item = [].concat(initialItems || [], customItems).find(el => el.key === key);
|
|
339
341
|
if (item) {
|
|
340
342
|
return multivaluesFieldBadge(item, i);
|
|
341
343
|
}
|
|
@@ -399,7 +401,7 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
399
401
|
isDisabled,
|
|
400
402
|
isReadOnly,
|
|
401
403
|
isRequired,
|
|
402
|
-
label,
|
|
404
|
+
label: label,
|
|
403
405
|
placeholder,
|
|
404
406
|
wrapperProps: {
|
|
405
407
|
ref: inputWrapperRef,
|
|
@@ -456,7 +458,7 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
456
458
|
}, selectedItems), isOnyx ? onyxReadOnlyInputEntry : readOnlyInputEntry, selectionManager.selectedKeys.size > 0 && visuallyHidden)
|
|
457
459
|
},
|
|
458
460
|
value: filterString,
|
|
459
|
-
helperText
|
|
461
|
+
helperText,
|
|
460
462
|
"aria-invalid": status === 'error' && true
|
|
461
463
|
}, (0, _pendoID.getPendoID)('MultivaluesField'), others, inputProps)), (0, _react2.jsx)(_Popover.default, {
|
|
462
464
|
hasNoArrow: true,
|
|
@@ -470,112 +472,4 @@ const DefaultMultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
|
|
|
470
472
|
sx: menuWidthSx
|
|
471
473
|
}, listbox), (0, _react2.jsx)(EmptyVisuallyHidden, null)));
|
|
472
474
|
});
|
|
473
|
-
DefaultMultivaluesField.propTypes = {
|
|
474
|
-
/** The initial selected keys in the collection (uncontrolled). */
|
|
475
|
-
defaultSelectedKeys: _isIterable.isIterableProp,
|
|
476
|
-
/** Where the menu opens relative to its trigger. */
|
|
477
|
-
direction: _propTypes.default.oneOf(['top', 'right', 'bottom', 'left']),
|
|
478
|
-
/**
|
|
479
|
-
* The item keys that are disabled. These items cannot be selected.
|
|
480
|
-
*/
|
|
481
|
-
disabledKeys: _isIterable.isIterableProp,
|
|
482
|
-
/** Whether the element should receive focus on render. */
|
|
483
|
-
hasAutoFocus: _propTypes.default.bool,
|
|
484
|
-
/** Whether the field has a status indicator. */
|
|
485
|
-
hasNoStatusIndicator: _propTypes.default.bool,
|
|
486
|
-
/** Text rendered below the input. */
|
|
487
|
-
helperText: _propTypes.default.node,
|
|
488
|
-
/**
|
|
489
|
-
* Props that get passed as-is to the underlying TextField element
|
|
490
|
-
*/
|
|
491
|
-
inputProps: _propTypes.default.shape({}),
|
|
492
|
-
/** Whether the input is disabled. */
|
|
493
|
-
isDisabled: _propTypes.default.bool,
|
|
494
|
-
/**
|
|
495
|
-
* Whether the menu is prevented from flipping directions when insufficient space is
|
|
496
|
-
* available for the given `direction` placement.
|
|
497
|
-
*/
|
|
498
|
-
isNotFlippable: _propTypes.default.bool,
|
|
499
|
-
/** Whether the input can be selected but not changed by the user. */
|
|
500
|
-
isReadOnly: _propTypes.default.bool,
|
|
501
|
-
/** Whether user input is required on the input before form submission. */
|
|
502
|
-
isRequired: _propTypes.default.bool,
|
|
503
|
-
/** The list of items.
|
|
504
|
-
*
|
|
505
|
-
* **Note:** Every item needs to have key and name properties.
|
|
506
|
-
*
|
|
507
|
-
* `Array<{key: string, name: string}>`
|
|
508
|
-
*/
|
|
509
|
-
items: _isIterable.isIterableProp,
|
|
510
|
-
/** The rendered label for the field. */
|
|
511
|
-
label: _propTypes.default.string,
|
|
512
|
-
/** Whether the component allows to create new values or only choose from the selection list */
|
|
513
|
-
mode: _propTypes.default.oneOf(['restrictive', 'non-restrictive']),
|
|
514
|
-
/**
|
|
515
|
-
* Handler that is called when the element loses focus.
|
|
516
|
-
*
|
|
517
|
-
* `(e: FocusEvent) => void`
|
|
518
|
-
*/
|
|
519
|
-
onBlur: _propTypes.default.func,
|
|
520
|
-
/**
|
|
521
|
-
* Handler that is called when the element receives focus.
|
|
522
|
-
*
|
|
523
|
-
* `(e: FocusEvent) => void`
|
|
524
|
-
*/
|
|
525
|
-
onFocus: _propTypes.default.func,
|
|
526
|
-
/**
|
|
527
|
-
* Handler that is called when the input value changes.
|
|
528
|
-
*
|
|
529
|
-
* `(value: string) => void`
|
|
530
|
-
*/
|
|
531
|
-
onInputChange: _propTypes.default.func,
|
|
532
|
-
/**
|
|
533
|
-
* Handler that is called when a key is pressed.
|
|
534
|
-
*
|
|
535
|
-
* `(e: KeyboardEvent) => void`
|
|
536
|
-
*/
|
|
537
|
-
onKeyDown: _propTypes.default.func,
|
|
538
|
-
/**
|
|
539
|
-
* Handler that is called when a key is released.
|
|
540
|
-
*
|
|
541
|
-
* `(e: KeyboardEvent) => void`
|
|
542
|
-
*/
|
|
543
|
-
onKeyUp: _propTypes.default.func,
|
|
544
|
-
/**
|
|
545
|
-
* Method that is called when the open state of the menu changes.
|
|
546
|
-
*
|
|
547
|
-
* `(isOpen: boolean) => void`
|
|
548
|
-
*/
|
|
549
|
-
onOpenChange: _propTypes.default.func,
|
|
550
|
-
/**
|
|
551
|
-
* Handler that is called when the selection changes.
|
|
552
|
-
*
|
|
553
|
-
* `(keys: Iterable<Key>) => any`
|
|
554
|
-
*/
|
|
555
|
-
onSelectionChange: _propTypes.default.func,
|
|
556
|
-
/** Temporary text that occupies the text input when it is empty. */
|
|
557
|
-
placeholder: _propTypes.default.string,
|
|
558
|
-
/**
|
|
559
|
-
* The item keys that are readonly. These items cannot be changed or selected.
|
|
560
|
-
*/
|
|
561
|
-
readOnlyKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
562
|
-
/** The currently selected keys in the collection (controlled). */
|
|
563
|
-
selectedKeys: _isIterable.isIterableProp,
|
|
564
|
-
// /** Props object that is spread directly into the ScrollBox element. */
|
|
565
|
-
/** @ignore */
|
|
566
|
-
scrollBoxProps: _propTypes.default.shape({
|
|
567
|
-
maxHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.number])
|
|
568
|
-
}),
|
|
569
|
-
..._statusProp.statusPropTypes,
|
|
570
|
-
..._ariaAttributes.ariaAttributesBasePropTypes,
|
|
571
|
-
..._fieldAttributes.inputFieldAttributesBasePropTypes
|
|
572
|
-
};
|
|
573
|
-
DefaultMultivaluesField.defaultProps = {
|
|
574
|
-
direction: 'bottom',
|
|
575
|
-
isReadOnly: false,
|
|
576
|
-
scrollBoxProps: {
|
|
577
|
-
maxHeight: 300
|
|
578
|
-
},
|
|
579
|
-
..._statusProp.statusDefaultProp
|
|
580
|
-
};
|
|
581
475
|
var _default = exports.default = DefaultMultivaluesField;
|
|
@@ -7,121 +7,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _isIterable = require("../../utils/devUtils/props/isIterable");
|
|
12
|
-
var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
|
|
13
|
-
var _fieldAttributes = require("../../utils/docUtils/fieldAttributes");
|
|
14
10
|
var _statusProp = require("../../utils/docUtils/statusProp");
|
|
15
11
|
var _CondensedMultivaluesField = _interopRequireDefault(require("./CondensedMultivaluesField"));
|
|
16
12
|
var _DefaultMultivaluesField = _interopRequireDefault(require("./DefaultMultivaluesField"));
|
|
17
13
|
var _react2 = require("@emotion/react");
|
|
18
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
const displayName = 'MultivaluesField';
|
|
16
|
+
|
|
17
|
+
// No cast on the forwardRef result: a type assertion makes the react-docgen
|
|
18
|
+
// analyzer fail to extract the props table, which breaks the Storybook docs
|
|
19
|
+
// controls (argTypes lose their types and options).
|
|
19
20
|
const MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
20
21
|
const Component = props.mode === 'condensed' ? _CondensedMultivaluesField.default : _DefaultMultivaluesField.default;
|
|
21
22
|
return (0, _react2.jsx)(Component, (0, _extends2.default)({
|
|
22
23
|
ref: ref
|
|
23
24
|
}, props));
|
|
24
25
|
});
|
|
25
|
-
MultivaluesField.propTypes = {
|
|
26
|
-
/** The initial selected keys in the collection (uncontrolled). */
|
|
27
|
-
defaultSelectedKeys: _isIterable.isIterableProp,
|
|
28
|
-
/** Where the menu opens relative to its trigger. */
|
|
29
|
-
direction: _propTypes.default.oneOf(['top', 'right', 'bottom', 'left']),
|
|
30
|
-
/**
|
|
31
|
-
* The item keys that are disabled. These items cannot be selected.
|
|
32
|
-
*/
|
|
33
|
-
disabledKeys: _isIterable.isIterableProp,
|
|
34
|
-
/** Whether the element should receive focus on render. */
|
|
35
|
-
hasAutoFocus: _propTypes.default.bool,
|
|
36
|
-
/** Whether the field has a status indicator. */
|
|
37
|
-
hasNoStatusIndicator: _propTypes.default.bool,
|
|
38
|
-
/** Text rendered below the input. */
|
|
39
|
-
helperText: _propTypes.default.node,
|
|
40
|
-
/**
|
|
41
|
-
* Props that get passed as-is to the underlying TextField element
|
|
42
|
-
*/
|
|
43
|
-
inputProps: _propTypes.default.shape({}),
|
|
44
|
-
/** Whether the input is disabled. */
|
|
45
|
-
isDisabled: _propTypes.default.bool,
|
|
46
|
-
/**
|
|
47
|
-
* Whether the menu is prevented from flipping directions when insufficient space is
|
|
48
|
-
* available for the given `direction` placement.
|
|
49
|
-
*/
|
|
50
|
-
isNotFlippable: _propTypes.default.bool,
|
|
51
|
-
/** Whether the input can be selected but not changed by the user. */
|
|
52
|
-
isReadOnly: _propTypes.default.bool,
|
|
53
|
-
/** Whether user input is required on the input before form submission. */
|
|
54
|
-
isRequired: _propTypes.default.bool,
|
|
55
|
-
/** The list of items.
|
|
56
|
-
*
|
|
57
|
-
* **Note:** Every item needs to have key and name properties.
|
|
58
|
-
*
|
|
59
|
-
* `Array<{key: string, name: string}>`
|
|
60
|
-
*/
|
|
61
|
-
items: _isIterable.isIterableProp,
|
|
62
|
-
/** The rendered label for the field. */
|
|
63
|
-
label: _propTypes.default.string,
|
|
64
|
-
/** Whether the component allows to create new values or only choose from the selection list */
|
|
65
|
-
mode: _propTypes.default.oneOf(['restrictive', 'non-restrictive', 'condensed']),
|
|
66
|
-
/**
|
|
67
|
-
* Handler that is called when the element loses focus.
|
|
68
|
-
*
|
|
69
|
-
* `(e: FocusEvent) => void`
|
|
70
|
-
*/
|
|
71
|
-
onBlur: _propTypes.default.func,
|
|
72
|
-
/**
|
|
73
|
-
* Handler that is called when the element receives focus.
|
|
74
|
-
*
|
|
75
|
-
* `(e: FocusEvent) => void`
|
|
76
|
-
*/
|
|
77
|
-
onFocus: _propTypes.default.func,
|
|
78
|
-
/**
|
|
79
|
-
* Handler that is called when the input value changes.
|
|
80
|
-
*
|
|
81
|
-
* `(value: string) => void`
|
|
82
|
-
*/
|
|
83
|
-
onInputChange: _propTypes.default.func,
|
|
84
|
-
/**
|
|
85
|
-
* Handler that is called when a key is pressed.
|
|
86
|
-
*
|
|
87
|
-
* `(e: KeyboardEvent) => void`
|
|
88
|
-
*/
|
|
89
|
-
onKeyDown: _propTypes.default.func,
|
|
90
|
-
/**
|
|
91
|
-
* Handler that is called when a key is released.
|
|
92
|
-
*
|
|
93
|
-
* `(e: KeyboardEvent) => void`
|
|
94
|
-
*/
|
|
95
|
-
onKeyUp: _propTypes.default.func,
|
|
96
|
-
/**
|
|
97
|
-
* Method that is called when the open state of the menu changes.
|
|
98
|
-
*
|
|
99
|
-
* `(isOpen: boolean) => void`
|
|
100
|
-
*/
|
|
101
|
-
onOpenChange: _propTypes.default.func,
|
|
102
|
-
/**
|
|
103
|
-
* Handler that is called when the selection changes.
|
|
104
|
-
*
|
|
105
|
-
* `(keys: Iterable<Key>) => any`
|
|
106
|
-
*/
|
|
107
|
-
onSelectionChange: _propTypes.default.func,
|
|
108
|
-
/** Temporary text that occupies the text input when it is empty. */
|
|
109
|
-
placeholder: _propTypes.default.string,
|
|
110
|
-
/**
|
|
111
|
-
* The item keys that are readonly. These items cannot be changed or selected.
|
|
112
|
-
*/
|
|
113
|
-
readOnlyKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
114
|
-
/** The currently selected keys in the collection (controlled). */
|
|
115
|
-
selectedKeys: _isIterable.isIterableProp,
|
|
116
|
-
// /** Props object that is spread directly into the ScrollBox element. */
|
|
117
|
-
/** @ignore */
|
|
118
|
-
scrollBoxProps: _propTypes.default.shape({
|
|
119
|
-
maxHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.number])
|
|
120
|
-
}),
|
|
121
|
-
..._statusProp.statusPropTypes,
|
|
122
|
-
..._ariaAttributes.ariaAttributesBasePropTypes,
|
|
123
|
-
..._fieldAttributes.inputFieldAttributesBasePropTypes
|
|
124
|
-
};
|
|
125
26
|
MultivaluesField.defaultProps = {
|
|
126
27
|
direction: 'bottom',
|
|
127
28
|
isReadOnly: false,
|
|
@@ -130,4 +31,5 @@ MultivaluesField.defaultProps = {
|
|
|
130
31
|
},
|
|
131
32
|
..._statusProp.statusDefaultProp
|
|
132
33
|
};
|
|
34
|
+
MultivaluesField.displayName = displayName;
|
|
133
35
|
var _default = exports.default = MultivaluesField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MultivaluesField';
|
|
@@ -49,7 +49,7 @@ const RadioGroupField = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
49
49
|
return (0, _react2.jsx)(_.Box, (0, _extends2.default)({
|
|
50
50
|
ref: ref,
|
|
51
51
|
className: classNames
|
|
52
|
-
}, (0, _pendoID.getPendoID)(displayName), unhandledAriaProps, radioGroupProps), (0, _react2.jsx)(_.Label, (0, _extends2.default)({
|
|
52
|
+
}, (0, _pendoID.getPendoID)(displayName), unhandledAriaProps, radioGroupProps), label && (0, _react2.jsx)(_.Label, (0, _extends2.default)({
|
|
53
53
|
isDisabled: isDisabled,
|
|
54
54
|
hintText: hintText,
|
|
55
55
|
isRequired: isRequired,
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
export declare const copyButton: {
|
|
2
|
+
mx: string;
|
|
2
3
|
path: {
|
|
3
4
|
fill: string;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
mx: string;
|
|
7
|
-
path: {
|
|
8
|
-
fill: string;
|
|
9
|
-
};
|
|
10
|
-
border: string;
|
|
11
|
-
};
|
|
12
|
-
light: {
|
|
13
|
-
mx: string;
|
|
14
|
-
path: {
|
|
15
|
-
fill: string;
|
|
16
|
-
};
|
|
17
|
-
border: string;
|
|
18
|
-
};
|
|
6
|
+
border: string;
|
|
19
7
|
};
|
|
20
8
|
declare const _default: {
|
|
21
9
|
default: {
|
|
@@ -133,23 +121,11 @@ declare const _default: {
|
|
|
133
121
|
lineHeight: string;
|
|
134
122
|
};
|
|
135
123
|
copyButton: {
|
|
124
|
+
mx: string;
|
|
136
125
|
path: {
|
|
137
126
|
fill: string;
|
|
138
127
|
};
|
|
139
|
-
|
|
140
|
-
mx: string;
|
|
141
|
-
path: {
|
|
142
|
-
fill: string;
|
|
143
|
-
};
|
|
144
|
-
border: string;
|
|
145
|
-
};
|
|
146
|
-
light: {
|
|
147
|
-
mx: string;
|
|
148
|
-
path: {
|
|
149
|
-
fill: string;
|
|
150
|
-
};
|
|
151
|
-
border: string;
|
|
152
|
-
};
|
|
128
|
+
border: string;
|
|
153
129
|
};
|
|
154
130
|
};
|
|
155
131
|
light: {
|
|
@@ -267,23 +243,11 @@ declare const _default: {
|
|
|
267
243
|
backgroundColor: string;
|
|
268
244
|
};
|
|
269
245
|
copyButton: {
|
|
246
|
+
mx: string;
|
|
270
247
|
path: {
|
|
271
248
|
fill: string;
|
|
272
249
|
};
|
|
273
|
-
|
|
274
|
-
mx: string;
|
|
275
|
-
path: {
|
|
276
|
-
fill: string;
|
|
277
|
-
};
|
|
278
|
-
border: string;
|
|
279
|
-
};
|
|
280
|
-
light: {
|
|
281
|
-
mx: string;
|
|
282
|
-
path: {
|
|
283
|
-
fill: string;
|
|
284
|
-
};
|
|
285
|
-
border: string;
|
|
286
|
-
};
|
|
250
|
+
border: string;
|
|
287
251
|
};
|
|
288
252
|
};
|
|
289
253
|
};
|
|
@@ -137,23 +137,11 @@ const lineNo = {
|
|
|
137
137
|
backgroundColor: 'transparent'
|
|
138
138
|
};
|
|
139
139
|
const copyButton = exports.copyButton = {
|
|
140
|
+
mx: 'sm',
|
|
140
141
|
path: {
|
|
141
142
|
fill: 'text.primary'
|
|
142
143
|
},
|
|
143
|
-
|
|
144
|
-
mx: 'sm',
|
|
145
|
-
path: {
|
|
146
|
-
fill: 'white'
|
|
147
|
-
},
|
|
148
|
-
border: 'none !important'
|
|
149
|
-
},
|
|
150
|
-
light: {
|
|
151
|
-
mx: 'sm',
|
|
152
|
-
path: {
|
|
153
|
-
fill: 'black'
|
|
154
|
-
},
|
|
155
|
-
border: 'none !important'
|
|
156
|
-
}
|
|
144
|
+
border: 'none !important'
|
|
157
145
|
};
|
|
158
146
|
const codeView = {
|
|
159
147
|
theme: nextGenCodeViewTheme,
|
|
@@ -1476,23 +1476,11 @@ declare const _default: {
|
|
|
1476
1476
|
alignSelf: string;
|
|
1477
1477
|
};
|
|
1478
1478
|
copyButton: {
|
|
1479
|
+
mx: string;
|
|
1479
1480
|
path: {
|
|
1480
1481
|
fill: string;
|
|
1481
1482
|
};
|
|
1482
|
-
|
|
1483
|
-
mx: string;
|
|
1484
|
-
path: {
|
|
1485
|
-
fill: string;
|
|
1486
|
-
};
|
|
1487
|
-
border: string;
|
|
1488
|
-
};
|
|
1489
|
-
light: {
|
|
1490
|
-
mx: string;
|
|
1491
|
-
path: {
|
|
1492
|
-
fill: string;
|
|
1493
|
-
};
|
|
1494
|
-
border: string;
|
|
1495
|
-
};
|
|
1483
|
+
border: string;
|
|
1496
1484
|
};
|
|
1497
1485
|
deleteAttachment: {
|
|
1498
1486
|
backgroundColor: string;
|
|
@@ -5761,23 +5749,11 @@ declare const _default: {
|
|
|
5761
5749
|
lineHeight: string;
|
|
5762
5750
|
};
|
|
5763
5751
|
copyButton: {
|
|
5752
|
+
mx: string;
|
|
5764
5753
|
path: {
|
|
5765
5754
|
fill: string;
|
|
5766
5755
|
};
|
|
5767
|
-
|
|
5768
|
-
mx: string;
|
|
5769
|
-
path: {
|
|
5770
|
-
fill: string;
|
|
5771
|
-
};
|
|
5772
|
-
border: string;
|
|
5773
|
-
};
|
|
5774
|
-
light: {
|
|
5775
|
-
mx: string;
|
|
5776
|
-
path: {
|
|
5777
|
-
fill: string;
|
|
5778
|
-
};
|
|
5779
|
-
border: string;
|
|
5780
|
-
};
|
|
5756
|
+
border: string;
|
|
5781
5757
|
};
|
|
5782
5758
|
};
|
|
5783
5759
|
light: {
|
|
@@ -5895,23 +5871,11 @@ declare const _default: {
|
|
|
5895
5871
|
backgroundColor: string;
|
|
5896
5872
|
};
|
|
5897
5873
|
copyButton: {
|
|
5874
|
+
mx: string;
|
|
5898
5875
|
path: {
|
|
5899
5876
|
fill: string;
|
|
5900
5877
|
};
|
|
5901
|
-
|
|
5902
|
-
mx: string;
|
|
5903
|
-
path: {
|
|
5904
|
-
fill: string;
|
|
5905
|
-
};
|
|
5906
|
-
border: string;
|
|
5907
|
-
};
|
|
5908
|
-
light: {
|
|
5909
|
-
mx: string;
|
|
5910
|
-
path: {
|
|
5911
|
-
fill: string;
|
|
5912
|
-
};
|
|
5913
|
-
border: string;
|
|
5914
|
-
};
|
|
5878
|
+
border: string;
|
|
5915
5879
|
};
|
|
5916
5880
|
};
|
|
5917
5881
|
};
|
|
@@ -7795,23 +7759,11 @@ declare const _default: {
|
|
|
7795
7759
|
lineHeight: string;
|
|
7796
7760
|
};
|
|
7797
7761
|
copyButton: {
|
|
7762
|
+
mx: string;
|
|
7798
7763
|
path: {
|
|
7799
7764
|
fill: string;
|
|
7800
7765
|
};
|
|
7801
|
-
|
|
7802
|
-
mx: string;
|
|
7803
|
-
path: {
|
|
7804
|
-
fill: string;
|
|
7805
|
-
};
|
|
7806
|
-
border: string;
|
|
7807
|
-
};
|
|
7808
|
-
light: {
|
|
7809
|
-
mx: string;
|
|
7810
|
-
path: {
|
|
7811
|
-
fill: string;
|
|
7812
|
-
};
|
|
7813
|
-
border: string;
|
|
7814
|
-
};
|
|
7766
|
+
border: string;
|
|
7815
7767
|
};
|
|
7816
7768
|
};
|
|
7817
7769
|
light: {
|
|
@@ -7929,23 +7881,11 @@ declare const _default: {
|
|
|
7929
7881
|
backgroundColor: string;
|
|
7930
7882
|
};
|
|
7931
7883
|
copyButton: {
|
|
7884
|
+
mx: string;
|
|
7932
7885
|
path: {
|
|
7933
7886
|
fill: string;
|
|
7934
7887
|
};
|
|
7935
|
-
|
|
7936
|
-
mx: string;
|
|
7937
|
-
path: {
|
|
7938
|
-
fill: string;
|
|
7939
|
-
};
|
|
7940
|
-
border: string;
|
|
7941
|
-
};
|
|
7942
|
-
light: {
|
|
7943
|
-
mx: string;
|
|
7944
|
-
path: {
|
|
7945
|
-
fill: string;
|
|
7946
|
-
};
|
|
7947
|
-
border: string;
|
|
7948
|
-
};
|
|
7888
|
+
border: string;
|
|
7949
7889
|
};
|
|
7950
7890
|
};
|
|
7951
7891
|
};
|