@zendeskgarden/react-dropdowns 8.62.0 → 8.62.2
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/index.cjs.js +215 -212
- package/dist/index.esm.js +34 -28
- package/dist/typings/elements/Menu/Items/AddItem.d.ts +1 -1
- package/dist/typings/elements/Menu/Items/MediaItem.d.ts +1 -1
- package/dist/typings/elements/Menu/Items/NextItem.d.ts +1 -1
- package/dist/typings/elements/Menu/Items/PreviousItem.d.ts +1 -1
- package/dist/typings/types/index.d.ts +4 -0
- package/package.json +4 -4
package/dist/index.cjs.js
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var React = require('react');
|
|
13
11
|
var PropTypes = require('prop-types');
|
|
14
12
|
var styled = require('styled-components');
|
|
@@ -22,7 +20,7 @@ var mergeRefs = require('react-merge-refs');
|
|
|
22
20
|
var containerSelection = require('@zendeskgarden/container-selection');
|
|
23
21
|
var reactDom = require('react-dom');
|
|
24
22
|
|
|
25
|
-
function
|
|
23
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
26
24
|
|
|
27
25
|
function _interopNamespace(e) {
|
|
28
26
|
if (e && e.__esModule) return e;
|
|
@@ -38,16 +36,15 @@ function _interopNamespace(e) {
|
|
|
38
36
|
}
|
|
39
37
|
});
|
|
40
38
|
}
|
|
41
|
-
n
|
|
39
|
+
n.default = e;
|
|
42
40
|
return Object.freeze(n);
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
46
43
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
47
|
-
var PropTypes__default = /*#__PURE__*/
|
|
48
|
-
var styled__default = /*#__PURE__*/
|
|
49
|
-
var Downshift__default = /*#__PURE__*/
|
|
50
|
-
var mergeRefs__default = /*#__PURE__*/
|
|
44
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
45
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
46
|
+
var Downshift__default = /*#__PURE__*/_interopDefault(Downshift);
|
|
47
|
+
var mergeRefs__default = /*#__PURE__*/_interopDefault(mergeRefs);
|
|
51
48
|
|
|
52
49
|
function _extends$5() {
|
|
53
50
|
_extends$5 = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -64,7 +61,7 @@ function _extends$5() {
|
|
|
64
61
|
return _extends$5.apply(this, arguments);
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
const DropdownContext =
|
|
64
|
+
const DropdownContext = React__namespace.default.createContext(undefined);
|
|
68
65
|
const useDropdownContext = () => {
|
|
69
66
|
const dropdownContext = React.useContext(DropdownContext);
|
|
70
67
|
if (!dropdownContext) {
|
|
@@ -144,7 +141,7 @@ const Dropdown = props => {
|
|
|
144
141
|
...downshift
|
|
145
142
|
};
|
|
146
143
|
};
|
|
147
|
-
return
|
|
144
|
+
return React__namespace.default.createElement(reactPopper.Manager, null, React__namespace.default.createElement(Downshift__default.default, _extends$5({
|
|
148
145
|
suppressRefError: true
|
|
149
146
|
,
|
|
150
147
|
isOpen: isOpen,
|
|
@@ -195,7 +192,7 @@ const Dropdown = props => {
|
|
|
195
192
|
},
|
|
196
193
|
stateReducer: (_state, changes) => {
|
|
197
194
|
switch (changes.type) {
|
|
198
|
-
case Downshift__default
|
|
195
|
+
case Downshift__default.default.stateChangeTypes.changeInput:
|
|
199
196
|
if (changes.inputValue === '' && dropdownType === 'combobox') {
|
|
200
197
|
return {
|
|
201
198
|
...changes,
|
|
@@ -207,7 +204,7 @@ const Dropdown = props => {
|
|
|
207
204
|
return changes;
|
|
208
205
|
}
|
|
209
206
|
}
|
|
210
|
-
}, downshiftProps), downshift =>
|
|
207
|
+
}, downshiftProps), downshift => React__namespace.default.createElement(DropdownContext.Provider, {
|
|
211
208
|
value: {
|
|
212
209
|
hasMenuRef,
|
|
213
210
|
itemIndexRef,
|
|
@@ -224,14 +221,14 @@ const Dropdown = props => {
|
|
|
224
221
|
}, children)));
|
|
225
222
|
};
|
|
226
223
|
Dropdown.propTypes = {
|
|
227
|
-
isOpen: PropTypes__default
|
|
228
|
-
selectedItem: PropTypes__default
|
|
229
|
-
selectedItems: PropTypes__default
|
|
230
|
-
highlightedIndex: PropTypes__default
|
|
231
|
-
inputValue: PropTypes__default
|
|
232
|
-
onSelect: PropTypes__default
|
|
233
|
-
onStateChange: PropTypes__default
|
|
234
|
-
downshiftProps: PropTypes__default
|
|
224
|
+
isOpen: PropTypes__default.default.bool,
|
|
225
|
+
selectedItem: PropTypes__default.default.any,
|
|
226
|
+
selectedItems: PropTypes__default.default.arrayOf(PropTypes__default.default.any),
|
|
227
|
+
highlightedIndex: PropTypes__default.default.number,
|
|
228
|
+
inputValue: PropTypes__default.default.string,
|
|
229
|
+
onSelect: PropTypes__default.default.func,
|
|
230
|
+
onStateChange: PropTypes__default.default.func,
|
|
231
|
+
downshiftProps: PropTypes__default.default.object
|
|
235
232
|
};
|
|
236
233
|
|
|
237
234
|
function getPopperPlacement(gardenPlacement) {
|
|
@@ -305,9 +302,9 @@ function getMenuPosition(popperPlacement) {
|
|
|
305
302
|
}
|
|
306
303
|
|
|
307
304
|
const COMPONENT_ID$m = 'dropdowns.menu';
|
|
308
|
-
const StyledMenu = styled__default
|
|
305
|
+
const StyledMenu = styled__default.default.ul.attrs(props => ({
|
|
309
306
|
'data-garden-id': COMPONENT_ID$m,
|
|
310
|
-
'data-garden-version': '8.62.
|
|
307
|
+
'data-garden-version': '8.62.2',
|
|
311
308
|
className: props.isAnimated && 'is-animated'
|
|
312
309
|
})).withConfig({
|
|
313
310
|
displayName: "StyledMenu",
|
|
@@ -322,9 +319,9 @@ StyledMenu.defaultProps = {
|
|
|
322
319
|
};
|
|
323
320
|
|
|
324
321
|
const COMPONENT_ID$l = 'dropdowns.menu_wrapper';
|
|
325
|
-
const StyledMenuWrapper = styled__default
|
|
322
|
+
const StyledMenuWrapper = styled__default.default.div.attrs(props => ({
|
|
326
323
|
'data-garden-id': COMPONENT_ID$l,
|
|
327
|
-
'data-garden-version': '8.62.
|
|
324
|
+
'data-garden-version': '8.62.2',
|
|
328
325
|
className: props.isAnimated && 'is-animated'
|
|
329
326
|
})).withConfig({
|
|
330
327
|
displayName: "StyledMenuWrapper",
|
|
@@ -341,9 +338,9 @@ StyledMenuWrapper.defaultProps = {
|
|
|
341
338
|
};
|
|
342
339
|
|
|
343
340
|
const COMPONENT_ID$k = 'dropdowns.separator';
|
|
344
|
-
const StyledSeparator = styled__default
|
|
341
|
+
const StyledSeparator = styled__default.default.li.attrs({
|
|
345
342
|
'data-garden-id': COMPONENT_ID$k,
|
|
346
|
-
'data-garden-version': '8.62.
|
|
343
|
+
'data-garden-version': '8.62.2',
|
|
347
344
|
role: 'separator'
|
|
348
345
|
}).withConfig({
|
|
349
346
|
displayName: "StyledSeparator",
|
|
@@ -374,9 +371,9 @@ const getColorStyles = props => {
|
|
|
374
371
|
}
|
|
375
372
|
return styled.css(["background-color:", ";color:", ";& a,& a:hover,& a:focus,& a:active{color:inherit;}"], backgroundColor, foregroundColor);
|
|
376
373
|
};
|
|
377
|
-
const StyledItem = styled__default
|
|
374
|
+
const StyledItem = styled__default.default.li.attrs(props => ({
|
|
378
375
|
'data-garden-id': COMPONENT_ID$j,
|
|
379
|
-
'data-garden-version': '8.62.
|
|
376
|
+
'data-garden-version': '8.62.2',
|
|
380
377
|
'aria-disabled': props.disabled
|
|
381
378
|
})).withConfig({
|
|
382
379
|
displayName: "StyledItem",
|
|
@@ -387,9 +384,9 @@ StyledItem.defaultProps = {
|
|
|
387
384
|
};
|
|
388
385
|
|
|
389
386
|
const COMPONENT_ID$i = 'dropdowns.add_item';
|
|
390
|
-
const StyledAddItem = styled__default
|
|
387
|
+
const StyledAddItem = styled__default.default(StyledItem).attrs({
|
|
391
388
|
'data-garden-id': COMPONENT_ID$i,
|
|
392
|
-
'data-garden-version': '8.62.
|
|
389
|
+
'data-garden-version': '8.62.2'
|
|
393
390
|
}).withConfig({
|
|
394
391
|
displayName: "StyledAddItem",
|
|
395
392
|
componentId: "sc-ekqk50-0"
|
|
@@ -399,9 +396,9 @@ StyledAddItem.defaultProps = {
|
|
|
399
396
|
};
|
|
400
397
|
|
|
401
398
|
const COMPONENT_ID$h = 'dropdowns.item_meta';
|
|
402
|
-
const StyledItemMeta = styled__default
|
|
399
|
+
const StyledItemMeta = styled__default.default.span.attrs({
|
|
403
400
|
'data-garden-id': COMPONENT_ID$h,
|
|
404
|
-
'data-garden-version': '8.62.
|
|
401
|
+
'data-garden-version': '8.62.2'
|
|
405
402
|
}).withConfig({
|
|
406
403
|
displayName: "StyledItemMeta",
|
|
407
404
|
componentId: "sc-k6xy28-0"
|
|
@@ -414,9 +411,9 @@ const COMPONENT_ID$g = 'dropdowns.item_icon';
|
|
|
414
411
|
const getSizeStyles = props => {
|
|
415
412
|
return styled.css(["width:", ";height:calc(", "px + ", ");"], props.theme.iconSizes.md, props.theme.space.base * 5, polished.math(`${getItemPaddingVertical(props)} * 2`));
|
|
416
413
|
};
|
|
417
|
-
const StyledItemIcon = styled__default
|
|
414
|
+
const StyledItemIcon = styled__default.default.div.attrs({
|
|
418
415
|
'data-garden-id': COMPONENT_ID$g,
|
|
419
|
-
'data-garden-version': '8.62.
|
|
416
|
+
'data-garden-version': '8.62.2'
|
|
420
417
|
}).withConfig({
|
|
421
418
|
displayName: "StyledItemIcon",
|
|
422
419
|
componentId: "sc-1v0ty11-0"
|
|
@@ -426,9 +423,9 @@ StyledItemIcon.defaultProps = {
|
|
|
426
423
|
};
|
|
427
424
|
|
|
428
425
|
const COMPONENT_ID$f = 'dropdowns.next_item';
|
|
429
|
-
const StyledNextItem = styled__default
|
|
426
|
+
const StyledNextItem = styled__default.default(StyledItem).attrs({
|
|
430
427
|
'data-garden-id': COMPONENT_ID$f,
|
|
431
|
-
'data-garden-version': '8.62.
|
|
428
|
+
'data-garden-version': '8.62.2'
|
|
432
429
|
}).withConfig({
|
|
433
430
|
displayName: "StyledNextItem",
|
|
434
431
|
componentId: "sc-1bcygn5-0"
|
|
@@ -461,13 +458,13 @@ const NextIconComponent = _ref => {
|
|
|
461
458
|
let {
|
|
462
459
|
className
|
|
463
460
|
} = _ref;
|
|
464
|
-
return
|
|
461
|
+
return React__namespace.default.createElement(SvgChevronRightStroke, {
|
|
465
462
|
"data-garden-id": COMPONENT_ID$e,
|
|
466
|
-
"data-garden-version": '8.62.
|
|
463
|
+
"data-garden-version": '8.62.2',
|
|
467
464
|
className: className
|
|
468
465
|
});
|
|
469
466
|
};
|
|
470
|
-
const StyledNextIcon = styled__default
|
|
467
|
+
const StyledNextIcon = styled__default.default(NextIconComponent).withConfig({
|
|
471
468
|
displayName: "StyledNextIcon",
|
|
472
469
|
componentId: "sc-1rinki2-0"
|
|
473
470
|
})(["transform:", ";color:", ";", ";"], props => props.theme.rtl && 'rotate(180deg)', props => props.isDisabled ? 'inherit' : reactTheming.getColor('neutralHue', 600, props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props));
|
|
@@ -476,9 +473,9 @@ StyledNextIcon.defaultProps = {
|
|
|
476
473
|
};
|
|
477
474
|
|
|
478
475
|
const COMPONENT_ID$d = 'dropdowns.previous_item';
|
|
479
|
-
const StyledPreviousItem = styled__default
|
|
476
|
+
const StyledPreviousItem = styled__default.default(StyledItem).attrs({
|
|
480
477
|
'data-garden-id': COMPONENT_ID$d,
|
|
481
|
-
'data-garden-version': '8.62.
|
|
478
|
+
'data-garden-version': '8.62.2'
|
|
482
479
|
}).withConfig({
|
|
483
480
|
displayName: "StyledPreviousItem",
|
|
484
481
|
componentId: "sc-1nmdds9-0"
|
|
@@ -511,13 +508,13 @@ const PreviousIconComponent = _ref => {
|
|
|
511
508
|
let {
|
|
512
509
|
className
|
|
513
510
|
} = _ref;
|
|
514
|
-
return
|
|
511
|
+
return React__namespace.default.createElement(SvgChevronLeftStroke, {
|
|
515
512
|
"data-garden-id": COMPONENT_ID$c,
|
|
516
|
-
"data-garden-version": '8.62.
|
|
513
|
+
"data-garden-version": '8.62.2',
|
|
517
514
|
className: className
|
|
518
515
|
});
|
|
519
516
|
};
|
|
520
|
-
const StyledPreviousIcon = styled__default
|
|
517
|
+
const StyledPreviousIcon = styled__default.default(PreviousIconComponent).withConfig({
|
|
521
518
|
displayName: "StyledPreviousIcon",
|
|
522
519
|
componentId: "sc-czfwj7-0"
|
|
523
520
|
})(["transform:", ";color:", ";", ";"], props => props.theme.rtl && 'rotate(180deg)', props => props.isDisabled ? 'inherit' : reactTheming.getColor('neutralHue', 600, props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$c, props));
|
|
@@ -526,9 +523,9 @@ StyledPreviousIcon.defaultProps = {
|
|
|
526
523
|
};
|
|
527
524
|
|
|
528
525
|
const COMPONENT_ID$b = 'dropdowns.header_icon';
|
|
529
|
-
const StyledHeaderIcon = styled__default
|
|
526
|
+
const StyledHeaderIcon = styled__default.default.div.attrs({
|
|
530
527
|
'data-garden-id': COMPONENT_ID$b,
|
|
531
|
-
'data-garden-version': '8.62.
|
|
528
|
+
'data-garden-version': '8.62.2'
|
|
532
529
|
}).withConfig({
|
|
533
530
|
displayName: "StyledHeaderIcon",
|
|
534
531
|
componentId: "sc-1fl6nsz-0"
|
|
@@ -544,9 +541,9 @@ const getHorizontalPadding = props => {
|
|
|
544
541
|
}
|
|
545
542
|
return `${props.theme.space.base * 3}px`;
|
|
546
543
|
};
|
|
547
|
-
const StyledHeaderItem = styled__default
|
|
544
|
+
const StyledHeaderItem = styled__default.default(StyledItem).attrs({
|
|
548
545
|
'data-garden-id': COMPONENT_ID$a,
|
|
549
|
-
'data-garden-version': '8.62.
|
|
546
|
+
'data-garden-version': '8.62.2'
|
|
550
547
|
}).withConfig({
|
|
551
548
|
displayName: "StyledHeaderItem",
|
|
552
549
|
componentId: "sc-137filx-0"
|
|
@@ -556,9 +553,9 @@ StyledHeaderItem.defaultProps = {
|
|
|
556
553
|
};
|
|
557
554
|
|
|
558
555
|
const COMPONENT_ID$9 = 'dropdowns.media_body';
|
|
559
|
-
const StyledMediaBody = styled__default
|
|
556
|
+
const StyledMediaBody = styled__default.default.div.attrs({
|
|
560
557
|
'data-garden-id': COMPONENT_ID$9,
|
|
561
|
-
'data-garden-version': '8.62.
|
|
558
|
+
'data-garden-version': '8.62.2'
|
|
562
559
|
}).withConfig({
|
|
563
560
|
displayName: "StyledMediaBody",
|
|
564
561
|
componentId: "sc-36j7ef-0"
|
|
@@ -568,7 +565,7 @@ StyledMediaBody.defaultProps = {
|
|
|
568
565
|
};
|
|
569
566
|
|
|
570
567
|
const COMPONENT_ID$8 = 'dropdowns.media_figure';
|
|
571
|
-
const StyledMediaFigure = styled__default
|
|
568
|
+
const StyledMediaFigure = styled__default.default(
|
|
572
569
|
_ref => {
|
|
573
570
|
let {
|
|
574
571
|
children,
|
|
@@ -577,11 +574,11 @@ _ref => {
|
|
|
577
574
|
...props
|
|
578
575
|
} = _ref;
|
|
579
576
|
return (
|
|
580
|
-
|
|
577
|
+
React__namespace.default.cloneElement(React.Children.only(children), props)
|
|
581
578
|
);
|
|
582
579
|
}).attrs({
|
|
583
580
|
'data-garden-id': COMPONENT_ID$8,
|
|
584
|
-
'data-garden-version': '8.62.
|
|
581
|
+
'data-garden-version': '8.62.2'
|
|
585
582
|
}).withConfig({
|
|
586
583
|
displayName: "StyledMediaFigure",
|
|
587
584
|
componentId: "sc-2f2x8x-0"
|
|
@@ -591,9 +588,9 @@ StyledMediaFigure.defaultProps = {
|
|
|
591
588
|
};
|
|
592
589
|
|
|
593
590
|
const COMPONENT_ID$7 = 'dropdowns.media_item';
|
|
594
|
-
const StyledMediaItem = styled__default
|
|
591
|
+
const StyledMediaItem = styled__default.default(StyledItem).attrs({
|
|
595
592
|
'data-garden-id': COMPONENT_ID$7,
|
|
596
|
-
'data-garden-version': '8.62.
|
|
593
|
+
'data-garden-version': '8.62.2'
|
|
597
594
|
}).withConfig({
|
|
598
595
|
displayName: "StyledMediaItem",
|
|
599
596
|
componentId: "sc-ikwshz-0"
|
|
@@ -603,9 +600,9 @@ StyledMediaItem.defaultProps = {
|
|
|
603
600
|
};
|
|
604
601
|
|
|
605
602
|
const COMPONENT_ID$6 = 'dropdowns.faux_input';
|
|
606
|
-
const StyledFauxInput = styled__default
|
|
603
|
+
const StyledFauxInput = styled__default.default(reactForms.FauxInput).attrs(props => ({
|
|
607
604
|
'data-garden-id': COMPONENT_ID$6,
|
|
608
|
-
'data-garden-version': '8.62.
|
|
605
|
+
'data-garden-version': '8.62.2',
|
|
609
606
|
mediaLayout: true,
|
|
610
607
|
theme: props.theme
|
|
611
608
|
})).withConfig({
|
|
@@ -618,9 +615,9 @@ StyledFauxInput.defaultProps = {
|
|
|
618
615
|
|
|
619
616
|
const COMPONENT_ID$5 = 'dropdowns.input';
|
|
620
617
|
const hiddenStyling = styled.css(["position:fixed;border:0;clip:rect(1px,1px,1px,1px);padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
|
|
621
|
-
const StyledInput = styled__default
|
|
618
|
+
const StyledInput = styled__default.default(reactForms.Input).attrs({
|
|
622
619
|
'data-garden-id': COMPONENT_ID$5,
|
|
623
|
-
'data-garden-version': '8.62.
|
|
620
|
+
'data-garden-version': '8.62.2',
|
|
624
621
|
isBare: true
|
|
625
622
|
}).withConfig({
|
|
626
623
|
displayName: "StyledInput",
|
|
@@ -631,9 +628,9 @@ StyledInput.defaultProps = {
|
|
|
631
628
|
};
|
|
632
629
|
|
|
633
630
|
const COMPONENT_ID$4 = 'dropdowns.select';
|
|
634
|
-
const StyledSelect = styled__default
|
|
631
|
+
const StyledSelect = styled__default.default.div.attrs({
|
|
635
632
|
'data-garden-id': COMPONENT_ID$4,
|
|
636
|
-
'data-garden-version': '8.62.
|
|
633
|
+
'data-garden-version': '8.62.2'
|
|
637
634
|
}).withConfig({
|
|
638
635
|
displayName: "StyledSelect",
|
|
639
636
|
componentId: "sc-xifmwj-0"
|
|
@@ -652,9 +649,9 @@ const visibleStyling = props => {
|
|
|
652
649
|
}
|
|
653
650
|
return styled.css(["opacity:", ";margin:", ";width:", ";min-width:", ";height:", ";"], !props.isVisible && 0, margin, !props.isVisible && 0, minWidth, height);
|
|
654
651
|
};
|
|
655
|
-
const StyledMultiselectInput = styled__default
|
|
652
|
+
const StyledMultiselectInput = styled__default.default(StyledInput).attrs({
|
|
656
653
|
'data-garden-id': COMPONENT_ID$3,
|
|
657
|
-
'data-garden-version': '8.62.
|
|
654
|
+
'data-garden-version': '8.62.2'
|
|
658
655
|
}).withConfig({
|
|
659
656
|
displayName: "StyledMultiselectInput",
|
|
660
657
|
componentId: "sc-1avnf6f-0"
|
|
@@ -676,9 +673,9 @@ const sizeStyles = props => {
|
|
|
676
673
|
}
|
|
677
674
|
return styled.css(["margin:", ";padding:", ";"], margin, padding);
|
|
678
675
|
};
|
|
679
|
-
const StyledMultiselectItemsContainer = styled__default
|
|
676
|
+
const StyledMultiselectItemsContainer = styled__default.default.div.attrs({
|
|
680
677
|
'data-garden-id': COMPONENT_ID$2,
|
|
681
|
-
'data-garden-version': '8.62.
|
|
678
|
+
'data-garden-version': '8.62.2'
|
|
682
679
|
}).withConfig({
|
|
683
680
|
displayName: "StyledMultiselectItemsContainer",
|
|
684
681
|
componentId: "sc-1jzhet8-0"
|
|
@@ -688,9 +685,9 @@ StyledMultiselectItemsContainer.defaultProps = {
|
|
|
688
685
|
};
|
|
689
686
|
|
|
690
687
|
const COMPONENT_ID$1 = 'dropdowns.multiselect_item_wrapper';
|
|
691
|
-
const StyledMultiselectItemWrapper = styled__default
|
|
688
|
+
const StyledMultiselectItemWrapper = styled__default.default.div.attrs({
|
|
692
689
|
'data-garden-id': COMPONENT_ID$1,
|
|
693
|
-
'data-garden-version': '8.62.
|
|
690
|
+
'data-garden-version': '8.62.2'
|
|
694
691
|
}).withConfig({
|
|
695
692
|
displayName: "StyledMultiselectItemWrapper",
|
|
696
693
|
componentId: "sc-1rb2bye-0"
|
|
@@ -700,9 +697,9 @@ StyledMultiselectItemWrapper.defaultProps = {
|
|
|
700
697
|
};
|
|
701
698
|
|
|
702
699
|
const COMPONENT_ID = 'dropdowns.multiselect_more_anchor';
|
|
703
|
-
const StyledMultiselectMoreAnchor = styled__default
|
|
700
|
+
const StyledMultiselectMoreAnchor = styled__default.default.div.attrs({
|
|
704
701
|
'data-garden-id': COMPONENT_ID,
|
|
705
|
-
'data-garden-version': '8.62.
|
|
702
|
+
'data-garden-version': '8.62.2'
|
|
706
703
|
}).withConfig({
|
|
707
704
|
displayName: "StyledMultiselectMoreAnchor",
|
|
708
705
|
componentId: "sc-1m9v46e-0"
|
|
@@ -824,7 +821,7 @@ const Trigger = _ref => {
|
|
|
824
821
|
'aria-owns': null
|
|
825
822
|
};
|
|
826
823
|
const toggleButtonProps = hasMenuRef.current ? menuToggleProps : listboxToggleProps;
|
|
827
|
-
return
|
|
824
|
+
return React__namespace.default.cloneElement(React__namespace.default.Children.only(children), {
|
|
828
825
|
...toggleButtonProps,
|
|
829
826
|
[refKey]: childRef => {
|
|
830
827
|
popperRef(childRef);
|
|
@@ -833,11 +830,11 @@ const Trigger = _ref => {
|
|
|
833
830
|
}
|
|
834
831
|
});
|
|
835
832
|
};
|
|
836
|
-
return
|
|
833
|
+
return React__namespace.default.createElement(reactPopper.Reference, null, _ref2 => {
|
|
837
834
|
let {
|
|
838
835
|
ref: popperReference
|
|
839
836
|
} = _ref2;
|
|
840
|
-
return
|
|
837
|
+
return React__namespace.default.createElement(React__namespace.default.Fragment, null, renderChildren(popperReference), React__namespace.default.createElement(StyledInput, getInputProps({
|
|
841
838
|
readOnly: true,
|
|
842
839
|
isHidden: true,
|
|
843
840
|
tabIndex: -1,
|
|
@@ -853,8 +850,8 @@ const Trigger = _ref => {
|
|
|
853
850
|
});
|
|
854
851
|
};
|
|
855
852
|
Trigger.propTypes = {
|
|
856
|
-
children: PropTypes__default
|
|
857
|
-
refKey: PropTypes__default
|
|
853
|
+
children: PropTypes__default.default.any,
|
|
854
|
+
refKey: PropTypes__default.default.string
|
|
858
855
|
};
|
|
859
856
|
Trigger.defaultProps = {
|
|
860
857
|
refKey: 'ref'
|
|
@@ -879,7 +876,7 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
|
879
876
|
})));
|
|
880
877
|
};
|
|
881
878
|
|
|
882
|
-
const FieldContext =
|
|
879
|
+
const FieldContext = React__namespace.default.createContext(undefined);
|
|
883
880
|
const useFieldContext = () => {
|
|
884
881
|
const fieldContext = React.useContext(FieldContext);
|
|
885
882
|
if (!fieldContext) {
|
|
@@ -940,11 +937,11 @@ const Autocomplete = React.forwardRef((_ref, ref) => {
|
|
|
940
937
|
React.useEffect(() => {
|
|
941
938
|
setDropdownType('autocomplete');
|
|
942
939
|
}, [setDropdownType]);
|
|
943
|
-
return
|
|
940
|
+
return React__namespace.default.createElement(reactPopper.Reference, null, _ref2 => {
|
|
944
941
|
let {
|
|
945
942
|
ref: popperReference
|
|
946
943
|
} = _ref2;
|
|
947
|
-
return
|
|
944
|
+
return React__namespace.default.createElement(StyledFauxInput, _extends$5({
|
|
948
945
|
isHovered: isContainerHovered,
|
|
949
946
|
isFocused: isContainerFocused,
|
|
950
947
|
tabIndex: null,
|
|
@@ -952,14 +949,14 @@ const Autocomplete = React.forwardRef((_ref, ref) => {
|
|
|
952
949
|
}, selectProps, {
|
|
953
950
|
ref: selectRef => {
|
|
954
951
|
popperReference(selectRef);
|
|
955
|
-
mergeRefs__default
|
|
952
|
+
mergeRefs__default.default([triggerRef, ref])(selectRef);
|
|
956
953
|
popperReferenceElementRef.current = selectRef;
|
|
957
954
|
}
|
|
958
|
-
}), start &&
|
|
955
|
+
}), start && React__namespace.default.createElement(StyledFauxInput.StartIcon, {
|
|
959
956
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
960
957
|
isFocused: isContainerFocused,
|
|
961
958
|
isDisabled: props.disabled
|
|
962
|
-
}, start), !isOpen &&
|
|
959
|
+
}, start), !isOpen && React__namespace.default.createElement(StyledSelect, null, children), React__namespace.default.createElement(StyledInput, getInputProps({
|
|
963
960
|
isHidden: !isOpen,
|
|
964
961
|
disabled: props.disabled,
|
|
965
962
|
onFocus: () => {
|
|
@@ -974,22 +971,22 @@ const Autocomplete = React.forwardRef((_ref, ref) => {
|
|
|
974
971
|
}
|
|
975
972
|
},
|
|
976
973
|
role: 'combobox',
|
|
977
|
-
ref: mergeRefs__default
|
|
978
|
-
})), !props.isBare &&
|
|
974
|
+
ref: mergeRefs__default.default([inputRef, controlledInputRef || null])
|
|
975
|
+
})), !props.isBare && React__namespace.default.createElement(StyledFauxInput.EndIcon, {
|
|
979
976
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
980
977
|
isFocused: isContainerFocused,
|
|
981
978
|
isDisabled: props.disabled,
|
|
982
979
|
isRotated: isOpen
|
|
983
|
-
},
|
|
980
|
+
}, React__namespace.default.createElement(SvgChevronDownStroke, null)));
|
|
984
981
|
});
|
|
985
982
|
});
|
|
986
983
|
Autocomplete.displayName = 'Autocomplete';
|
|
987
984
|
Autocomplete.propTypes = {
|
|
988
|
-
isCompact: PropTypes__default
|
|
989
|
-
isBare: PropTypes__default
|
|
990
|
-
disabled: PropTypes__default
|
|
991
|
-
focusInset: PropTypes__default
|
|
992
|
-
validation: PropTypes__default
|
|
985
|
+
isCompact: PropTypes__default.default.bool,
|
|
986
|
+
isBare: PropTypes__default.default.bool,
|
|
987
|
+
disabled: PropTypes__default.default.bool,
|
|
988
|
+
focusInset: PropTypes__default.default.bool,
|
|
989
|
+
validation: PropTypes__default.default.oneOf(reactForms.VALIDATION)
|
|
993
990
|
};
|
|
994
991
|
|
|
995
992
|
const Combobox = React.forwardRef((_ref, ref) => {
|
|
@@ -1057,33 +1054,33 @@ const Combobox = React.forwardRef((_ref, ref) => {
|
|
|
1057
1054
|
React.useEffect(() => {
|
|
1058
1055
|
setDropdownType('combobox');
|
|
1059
1056
|
}, [setDropdownType]);
|
|
1060
|
-
return
|
|
1057
|
+
return React__namespace.default.createElement(reactPopper.Reference, null, _ref2 => {
|
|
1061
1058
|
let {
|
|
1062
1059
|
ref: popperReference
|
|
1063
1060
|
} = _ref2;
|
|
1064
1061
|
const wrapperRefProp = element => {
|
|
1065
1062
|
popperReference(element);
|
|
1066
|
-
mergeRefs__default
|
|
1063
|
+
mergeRefs__default.default([wrapperRef, ref])(element);
|
|
1067
1064
|
popperReferenceElementRef.current = element;
|
|
1068
1065
|
};
|
|
1069
|
-
return
|
|
1066
|
+
return React__namespace.default.createElement(reactForms.MediaInput, _extends$5({}, inputProps, {
|
|
1070
1067
|
wrapperProps: wrapperProps,
|
|
1071
1068
|
wrapperRef: wrapperRefProp,
|
|
1072
|
-
ref: mergeRefs__default
|
|
1069
|
+
ref: mergeRefs__default.default([inputRef, inputRefProp])
|
|
1073
1070
|
}));
|
|
1074
1071
|
});
|
|
1075
1072
|
});
|
|
1076
1073
|
Combobox.displayName = 'Combobox';
|
|
1077
1074
|
Combobox.propTypes = {
|
|
1078
|
-
isCompact: PropTypes__default
|
|
1079
|
-
isBare: PropTypes__default
|
|
1080
|
-
disabled: PropTypes__default
|
|
1081
|
-
focusInset: PropTypes__default
|
|
1082
|
-
placeholder: PropTypes__default
|
|
1083
|
-
validation: PropTypes__default
|
|
1075
|
+
isCompact: PropTypes__default.default.bool,
|
|
1076
|
+
isBare: PropTypes__default.default.bool,
|
|
1077
|
+
disabled: PropTypes__default.default.bool,
|
|
1078
|
+
focusInset: PropTypes__default.default.bool,
|
|
1079
|
+
placeholder: PropTypes__default.default.string,
|
|
1080
|
+
validation: PropTypes__default.default.oneOf(reactForms.VALIDATION)
|
|
1084
1081
|
};
|
|
1085
1082
|
|
|
1086
|
-
const Multiselect =
|
|
1083
|
+
const Multiselect = React__namespace.default.forwardRef((_ref, ref) => {
|
|
1087
1084
|
let {
|
|
1088
1085
|
renderItem,
|
|
1089
1086
|
placeholder,
|
|
@@ -1199,8 +1196,8 @@ const Multiselect = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1199
1196
|
value: item,
|
|
1200
1197
|
removeValue
|
|
1201
1198
|
});
|
|
1202
|
-
const focusRef =
|
|
1203
|
-
const clonedChild =
|
|
1199
|
+
const focusRef = React__namespace.default.createRef();
|
|
1200
|
+
const clonedChild = React__namespace.default.cloneElement(renderedItem, {
|
|
1204
1201
|
...getItemProps({
|
|
1205
1202
|
item,
|
|
1206
1203
|
focusRef,
|
|
@@ -1239,7 +1236,7 @@ const Multiselect = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1239
1236
|
size: props.isCompact ? 'medium' : 'large'
|
|
1240
1237
|
});
|
|
1241
1238
|
const key = `${itemToString(item)}-${index}`;
|
|
1242
|
-
return
|
|
1239
|
+
return React__namespace.default.createElement(StyledMultiselectItemWrapper, {
|
|
1243
1240
|
key: key
|
|
1244
1241
|
}, clonedChild);
|
|
1245
1242
|
}, [getItemProps, inputValue, renderItem, setDownshiftState, itemToString, selectedItems, props, inputRef, themeContext.rtl]);
|
|
@@ -1250,7 +1247,7 @@ const Multiselect = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1250
1247
|
const item = itemValues[x];
|
|
1251
1248
|
if (x < maxItems) {
|
|
1252
1249
|
if (props.disabled) {
|
|
1253
|
-
const renderedItem =
|
|
1250
|
+
const renderedItem = React__namespace.default.cloneElement(renderItem({
|
|
1254
1251
|
value: item,
|
|
1255
1252
|
removeValue: () => {
|
|
1256
1253
|
return undefined;
|
|
@@ -1258,16 +1255,16 @@ const Multiselect = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1258
1255
|
}), {
|
|
1259
1256
|
size: props.isCompact ? 'medium' : 'large'
|
|
1260
1257
|
});
|
|
1261
|
-
output.push(
|
|
1258
|
+
output.push( React__namespace.default.createElement(StyledMultiselectItemWrapper, {
|
|
1262
1259
|
key: x
|
|
1263
1260
|
}, renderedItem));
|
|
1264
1261
|
} else {
|
|
1265
1262
|
output.push(renderSelectableItem(item, x));
|
|
1266
1263
|
}
|
|
1267
1264
|
} else if (!isFocused && !inputValue || props.disabled) {
|
|
1268
|
-
output.push(
|
|
1265
|
+
output.push( React__namespace.default.createElement(StyledMultiselectItemWrapper, {
|
|
1269
1266
|
key: "more-anchor"
|
|
1270
|
-
},
|
|
1267
|
+
}, React__namespace.default.createElement(StyledMultiselectMoreAnchor, {
|
|
1271
1268
|
isCompact: props.isCompact,
|
|
1272
1269
|
isDisabled: props.disabled
|
|
1273
1270
|
}, renderShowMore ? renderShowMore(itemValues.length - x) : `+ ${itemValues.length - x} more`)));
|
|
@@ -1283,26 +1280,26 @@ const Multiselect = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1283
1280
|
React.useEffect(() => {
|
|
1284
1281
|
setDropdownType('multiselect');
|
|
1285
1282
|
}, [setDropdownType]);
|
|
1286
|
-
return
|
|
1283
|
+
return React__namespace.default.createElement(reactPopper.Reference, null, _ref2 => {
|
|
1287
1284
|
let {
|
|
1288
1285
|
ref: popperReference
|
|
1289
1286
|
} = _ref2;
|
|
1290
|
-
return
|
|
1287
|
+
return React__namespace.default.createElement(StyledFauxInput, getContainerProps({
|
|
1291
1288
|
...selectProps,
|
|
1292
1289
|
isHovered: isContainerHovered,
|
|
1293
1290
|
isFocused: isContainerFocused,
|
|
1294
1291
|
ref: selectRef => {
|
|
1295
1292
|
popperReference(selectRef);
|
|
1296
|
-
mergeRefs__default
|
|
1293
|
+
mergeRefs__default.default([triggerRef, popperReferenceElementRef, ref])(selectRef);
|
|
1297
1294
|
}
|
|
1298
|
-
}), start &&
|
|
1295
|
+
}), start && React__namespace.default.createElement(StyledFauxInput.StartIcon, {
|
|
1299
1296
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
1300
1297
|
isFocused: isContainerFocused,
|
|
1301
1298
|
isDisabled: props.disabled
|
|
1302
|
-
}, start),
|
|
1299
|
+
}, start), React__namespace.default.createElement(StyledMultiselectItemsContainer, {
|
|
1303
1300
|
isBare: props.isBare,
|
|
1304
1301
|
isCompact: props.isCompact
|
|
1305
|
-
}, items,
|
|
1302
|
+
}, items, React__namespace.default.createElement(StyledMultiselectInput, getInputProps({
|
|
1306
1303
|
disabled: props.disabled,
|
|
1307
1304
|
onFocus: () => {
|
|
1308
1305
|
setFocusedItem(undefined);
|
|
@@ -1332,31 +1329,31 @@ const Multiselect = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1332
1329
|
isVisible: isFocused || inputValue || selectedItems.length === 0,
|
|
1333
1330
|
isCompact: props.isCompact,
|
|
1334
1331
|
role: 'combobox',
|
|
1335
|
-
ref: mergeRefs__default
|
|
1332
|
+
ref: mergeRefs__default.default([inputRef, externalInputRef]),
|
|
1336
1333
|
placeholder: selectedItems.length === 0 ? placeholder : undefined
|
|
1337
|
-
}))), !props.isBare &&
|
|
1334
|
+
}))), !props.isBare && React__namespace.default.createElement(StyledFauxInput.EndIcon, {
|
|
1338
1335
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
1339
1336
|
isFocused: isContainerFocused,
|
|
1340
1337
|
isDisabled: props.disabled,
|
|
1341
1338
|
isRotated: isOpen
|
|
1342
|
-
},
|
|
1339
|
+
}, React__namespace.default.createElement(SvgChevronDownStroke, null)));
|
|
1343
1340
|
});
|
|
1344
1341
|
});
|
|
1345
1342
|
Multiselect.propTypes = {
|
|
1346
|
-
isCompact: PropTypes__default
|
|
1347
|
-
isBare: PropTypes__default
|
|
1348
|
-
disabled: PropTypes__default
|
|
1349
|
-
focusInset: PropTypes__default
|
|
1350
|
-
renderItem: PropTypes__default
|
|
1351
|
-
maxItems: PropTypes__default
|
|
1352
|
-
validation: PropTypes__default
|
|
1343
|
+
isCompact: PropTypes__default.default.bool,
|
|
1344
|
+
isBare: PropTypes__default.default.bool,
|
|
1345
|
+
disabled: PropTypes__default.default.bool,
|
|
1346
|
+
focusInset: PropTypes__default.default.bool,
|
|
1347
|
+
renderItem: PropTypes__default.default.func.isRequired,
|
|
1348
|
+
maxItems: PropTypes__default.default.number,
|
|
1349
|
+
validation: PropTypes__default.default.oneOf(['success', 'warning', 'error'])
|
|
1353
1350
|
};
|
|
1354
1351
|
Multiselect.defaultProps = {
|
|
1355
1352
|
maxItems: 4
|
|
1356
1353
|
};
|
|
1357
1354
|
Multiselect.displayName = 'Multiselect';
|
|
1358
1355
|
|
|
1359
|
-
const Select =
|
|
1356
|
+
const Select = React__namespace.default.forwardRef((_ref, ref) => {
|
|
1360
1357
|
let {
|
|
1361
1358
|
children,
|
|
1362
1359
|
start,
|
|
@@ -1464,24 +1461,24 @@ const Select = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1464
1461
|
});
|
|
1465
1462
|
const isContainerHovered = isLabelHovered && !isOpen;
|
|
1466
1463
|
const isContainerFocused = isFocused || isOpen;
|
|
1467
|
-
return
|
|
1464
|
+
return React__namespace.default.createElement(reactPopper.Reference, null, _ref2 => {
|
|
1468
1465
|
let {
|
|
1469
1466
|
ref: popperReference
|
|
1470
1467
|
} = _ref2;
|
|
1471
|
-
return
|
|
1468
|
+
return React__namespace.default.createElement(StyledFauxInput, _extends$5({
|
|
1472
1469
|
isHovered: isContainerHovered,
|
|
1473
1470
|
isFocused: isContainerFocused
|
|
1474
1471
|
}, selectProps, {
|
|
1475
1472
|
role: "none",
|
|
1476
1473
|
ref: selectRef => {
|
|
1477
1474
|
popperReference(selectRef);
|
|
1478
|
-
mergeRefs__default
|
|
1475
|
+
mergeRefs__default.default([triggerRef, ref, popperReferenceElementRef])(selectRef);
|
|
1479
1476
|
}
|
|
1480
|
-
}), start &&
|
|
1477
|
+
}), start && React__namespace.default.createElement(StyledFauxInput.StartIcon, {
|
|
1481
1478
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
1482
1479
|
isFocused: isContainerFocused,
|
|
1483
1480
|
isDisabled: props.disabled
|
|
1484
|
-
}, start),
|
|
1481
|
+
}, start), React__namespace.default.createElement(StyledSelect, null, children), React__namespace.default.createElement(StyledInput, getInputProps({
|
|
1485
1482
|
readOnly: true,
|
|
1486
1483
|
isHidden: true,
|
|
1487
1484
|
tabIndex: -1,
|
|
@@ -1493,22 +1490,22 @@ const Select = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1493
1490
|
}
|
|
1494
1491
|
},
|
|
1495
1492
|
onKeyDown: onInputKeyDown
|
|
1496
|
-
})), !props.isBare &&
|
|
1493
|
+
})), !props.isBare && React__namespace.default.createElement(StyledFauxInput.EndIcon, {
|
|
1497
1494
|
isHovered: isHovered || isLabelHovered && !isOpen,
|
|
1498
1495
|
isFocused: isContainerFocused,
|
|
1499
1496
|
isDisabled: props.disabled,
|
|
1500
1497
|
isRotated: isOpen
|
|
1501
|
-
},
|
|
1498
|
+
}, React__namespace.default.createElement(SvgChevronDownStroke, null)));
|
|
1502
1499
|
});
|
|
1503
1500
|
});
|
|
1504
1501
|
Select.displayName = 'Select';
|
|
1505
1502
|
Select.propTypes = {
|
|
1506
|
-
isCompact: PropTypes__default
|
|
1507
|
-
isBare: PropTypes__default
|
|
1508
|
-
disabled: PropTypes__default
|
|
1509
|
-
focusInset: PropTypes__default
|
|
1510
|
-
validation: PropTypes__default
|
|
1511
|
-
start: PropTypes__default
|
|
1503
|
+
isCompact: PropTypes__default.default.bool,
|
|
1504
|
+
isBare: PropTypes__default.default.bool,
|
|
1505
|
+
disabled: PropTypes__default.default.bool,
|
|
1506
|
+
focusInset: PropTypes__default.default.bool,
|
|
1507
|
+
validation: PropTypes__default.default.oneOf(reactForms.VALIDATION),
|
|
1508
|
+
start: PropTypes__default.default.any
|
|
1512
1509
|
};
|
|
1513
1510
|
|
|
1514
1511
|
const Field = React.forwardRef((props, fieldRef) => {
|
|
@@ -1525,20 +1522,20 @@ const Field = React.forwardRef((props, fieldRef) => {
|
|
|
1525
1522
|
isLabelHovered,
|
|
1526
1523
|
setIsLabelHovered
|
|
1527
1524
|
}), [isLabelHovered, setIsLabelHovered]);
|
|
1528
|
-
return
|
|
1525
|
+
return React__namespace.default.createElement(FieldContext.Provider, {
|
|
1529
1526
|
value: value
|
|
1530
|
-
},
|
|
1531
|
-
ref: mergeRefs__default
|
|
1527
|
+
}, React__namespace.default.createElement(reactForms.Field, _extends$5({
|
|
1528
|
+
ref: mergeRefs__default.default([ref, fieldRef])
|
|
1532
1529
|
}, props)));
|
|
1533
1530
|
});
|
|
1534
1531
|
Field.displayName = 'Field';
|
|
1535
1532
|
|
|
1536
|
-
const Hint =
|
|
1533
|
+
const Hint = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(reactForms.Hint, _extends$5({
|
|
1537
1534
|
ref: ref
|
|
1538
1535
|
}, props)));
|
|
1539
1536
|
Hint.displayName = 'Hint';
|
|
1540
1537
|
|
|
1541
|
-
const Label =
|
|
1538
|
+
const Label = React__namespace.default.forwardRef((_ref, ref) => {
|
|
1542
1539
|
let {
|
|
1543
1540
|
onMouseEnter,
|
|
1544
1541
|
onMouseLeave,
|
|
@@ -1561,27 +1558,27 @@ const Label = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1561
1558
|
}),
|
|
1562
1559
|
...other
|
|
1563
1560
|
});
|
|
1564
|
-
return
|
|
1561
|
+
return React__namespace.default.createElement(reactForms.Label, _extends$5({
|
|
1565
1562
|
ref: ref
|
|
1566
1563
|
}, labelProps));
|
|
1567
1564
|
});
|
|
1568
1565
|
Label.displayName = 'Label';
|
|
1569
1566
|
Label.propTypes = {
|
|
1570
|
-
isRegular: PropTypes__default
|
|
1567
|
+
isRegular: PropTypes__default.default.bool
|
|
1571
1568
|
};
|
|
1572
1569
|
|
|
1573
|
-
const Message =
|
|
1570
|
+
const Message = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(reactForms.Message, _extends$5({
|
|
1574
1571
|
ref: ref
|
|
1575
1572
|
}, props)));
|
|
1576
1573
|
Message.displayName = 'Message';
|
|
1577
1574
|
Message.propTypes = {
|
|
1578
|
-
validation: PropTypes__default
|
|
1575
|
+
validation: PropTypes__default.default.oneOf(reactForms.VALIDATION)
|
|
1579
1576
|
};
|
|
1580
1577
|
|
|
1581
1578
|
const SHARED_PLACEMENT = ['auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end'];
|
|
1582
1579
|
const PLACEMENT = [...SHARED_PLACEMENT, 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'];
|
|
1583
1580
|
|
|
1584
|
-
const MenuContext =
|
|
1581
|
+
const MenuContext = React__namespace.default.createContext(undefined);
|
|
1585
1582
|
const useMenuContext = () => {
|
|
1586
1583
|
const menuContext = React.useContext(MenuContext);
|
|
1587
1584
|
if (!menuContext) {
|
|
@@ -1641,12 +1638,12 @@ const Menu = React.forwardRef((props, menuRef) => {
|
|
|
1641
1638
|
itemSearchRegistry.current = [];
|
|
1642
1639
|
const popperPlacement = themeContext.rtl ? getRtlPopperPlacement(placement) : getPopperPlacement(placement);
|
|
1643
1640
|
return (
|
|
1644
|
-
|
|
1641
|
+
React__namespace.default.createElement(MenuContext.Provider, {
|
|
1645
1642
|
value: {
|
|
1646
1643
|
itemIndexRef,
|
|
1647
1644
|
isCompact
|
|
1648
1645
|
}
|
|
1649
|
-
},
|
|
1646
|
+
}, React__namespace.default.createElement(reactPopper.Popper, {
|
|
1650
1647
|
placement: popperPlacement,
|
|
1651
1648
|
modifiers: popperModifiers
|
|
1652
1649
|
,
|
|
@@ -1672,7 +1669,7 @@ const Menu = React.forwardRef((props, menuRef) => {
|
|
|
1672
1669
|
isAnimated: isAnimated && (isOpen || isVisible),
|
|
1673
1670
|
...otherProps
|
|
1674
1671
|
});
|
|
1675
|
-
const menu =
|
|
1672
|
+
const menu = React__namespace.default.createElement(StyledMenuWrapper, {
|
|
1676
1673
|
ref: isOpen ? ref : undefined,
|
|
1677
1674
|
hasArrow: menuProps.hasArrow,
|
|
1678
1675
|
placement: menuProps.placement,
|
|
@@ -1680,7 +1677,7 @@ const Menu = React.forwardRef((props, menuRef) => {
|
|
|
1680
1677
|
isHidden: !isOpen,
|
|
1681
1678
|
isAnimated: menuProps.isAnimated,
|
|
1682
1679
|
zIndex: zIndex
|
|
1683
|
-
},
|
|
1680
|
+
}, React__namespace.default.createElement(StyledMenu, _extends$5({
|
|
1684
1681
|
ref: menuRef,
|
|
1685
1682
|
isCompact: isCompact,
|
|
1686
1683
|
maxHeight: maxHeight,
|
|
@@ -1692,15 +1689,15 @@ const Menu = React.forwardRef((props, menuRef) => {
|
|
|
1692
1689
|
});
|
|
1693
1690
|
Menu.displayName = 'Menu';
|
|
1694
1691
|
Menu.propTypes = {
|
|
1695
|
-
popperModifiers: PropTypes__default
|
|
1696
|
-
eventsEnabled: PropTypes__default
|
|
1697
|
-
zIndex: PropTypes__default
|
|
1698
|
-
style: PropTypes__default
|
|
1699
|
-
placement: PropTypes__default
|
|
1700
|
-
isAnimated: PropTypes__default
|
|
1701
|
-
isCompact: PropTypes__default
|
|
1702
|
-
hasArrow: PropTypes__default
|
|
1703
|
-
maxHeight: PropTypes__default
|
|
1692
|
+
popperModifiers: PropTypes__default.default.any,
|
|
1693
|
+
eventsEnabled: PropTypes__default.default.bool,
|
|
1694
|
+
zIndex: PropTypes__default.default.number,
|
|
1695
|
+
style: PropTypes__default.default.object,
|
|
1696
|
+
placement: PropTypes__default.default.oneOf(PLACEMENT),
|
|
1697
|
+
isAnimated: PropTypes__default.default.bool,
|
|
1698
|
+
isCompact: PropTypes__default.default.bool,
|
|
1699
|
+
hasArrow: PropTypes__default.default.bool,
|
|
1700
|
+
maxHeight: PropTypes__default.default.string
|
|
1704
1701
|
};
|
|
1705
1702
|
Menu.defaultProps = {
|
|
1706
1703
|
placement: 'bottom-start',
|
|
@@ -1710,7 +1707,7 @@ Menu.defaultProps = {
|
|
|
1710
1707
|
zIndex: 1000
|
|
1711
1708
|
};
|
|
1712
1709
|
|
|
1713
|
-
const Separator =
|
|
1710
|
+
const Separator = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(StyledSeparator, _extends$5({
|
|
1714
1711
|
ref: ref
|
|
1715
1712
|
}, props)));
|
|
1716
1713
|
Separator.displayName = 'Separator';
|
|
@@ -1757,7 +1754,7 @@ var SvgCheckLgStroke = function SvgCheckLgStroke(props) {
|
|
|
1757
1754
|
})));
|
|
1758
1755
|
};
|
|
1759
1756
|
|
|
1760
|
-
const ItemContext =
|
|
1757
|
+
const ItemContext = React__namespace.default.createContext(undefined);
|
|
1761
1758
|
const useItemContext = () => {
|
|
1762
1759
|
const context = React.useContext(ItemContext);
|
|
1763
1760
|
if (!context) {
|
|
@@ -1766,12 +1763,13 @@ const useItemContext = () => {
|
|
|
1766
1763
|
return context;
|
|
1767
1764
|
};
|
|
1768
1765
|
|
|
1769
|
-
const Item =
|
|
1766
|
+
const Item = React__namespace.default.forwardRef((_ref, forwardRef) => {
|
|
1770
1767
|
let {
|
|
1771
1768
|
value,
|
|
1772
1769
|
disabled,
|
|
1773
1770
|
isDanger,
|
|
1774
1771
|
component = StyledItem,
|
|
1772
|
+
hasIcon,
|
|
1775
1773
|
children,
|
|
1776
1774
|
...props
|
|
1777
1775
|
} = _ref;
|
|
@@ -1827,25 +1825,25 @@ const Item = React__default["default"].forwardRef((_ref, forwardRef) => {
|
|
|
1827
1825
|
const contextValue = React.useMemo(() => ({
|
|
1828
1826
|
isDisabled: disabled
|
|
1829
1827
|
}), [disabled]);
|
|
1830
|
-
const ref = mergeRefs__default
|
|
1828
|
+
const ref = mergeRefs__default.default([itemRef, forwardRef]);
|
|
1831
1829
|
if (disabled) {
|
|
1832
|
-
return
|
|
1830
|
+
return React__namespace.default.createElement(ItemContext.Provider, {
|
|
1833
1831
|
value: contextValue
|
|
1834
|
-
},
|
|
1832
|
+
}, React__namespace.default.createElement(Component, _extends$5({
|
|
1835
1833
|
ref: ref,
|
|
1836
1834
|
disabled: disabled,
|
|
1837
1835
|
isDanger: isDanger,
|
|
1838
1836
|
isCompact: isCompact
|
|
1839
|
-
}, props), isSelected &&
|
|
1837
|
+
}, props), isSelected && !hasIcon && React__namespace.default.createElement(StyledItemIcon, {
|
|
1840
1838
|
isCompact: isCompact,
|
|
1841
1839
|
isVisible: isSelected,
|
|
1842
1840
|
isDisabled: disabled
|
|
1843
|
-
},
|
|
1841
|
+
}, React__namespace.default.createElement(SvgCheckLgStroke, null)), children));
|
|
1844
1842
|
}
|
|
1845
1843
|
itemIndexRef.current++;
|
|
1846
|
-
return
|
|
1844
|
+
return React__namespace.default.createElement(ItemContext.Provider, {
|
|
1847
1845
|
value: contextValue
|
|
1848
|
-
},
|
|
1846
|
+
}, React__namespace.default.createElement(Component, getItemProps({
|
|
1849
1847
|
item: value,
|
|
1850
1848
|
isFocused,
|
|
1851
1849
|
ref,
|
|
@@ -1856,18 +1854,18 @@ const Item = React__default["default"].forwardRef((_ref, forwardRef) => {
|
|
|
1856
1854
|
'aria-selected': null
|
|
1857
1855
|
}),
|
|
1858
1856
|
...props
|
|
1859
|
-
}), isSelected &&
|
|
1857
|
+
}), isSelected && !hasIcon && React__namespace.default.createElement(StyledItemIcon, {
|
|
1860
1858
|
isCompact: isCompact,
|
|
1861
1859
|
isVisible: isSelected
|
|
1862
|
-
},
|
|
1860
|
+
}, React__namespace.default.createElement(SvgCheckLgStroke, null)), children));
|
|
1863
1861
|
});
|
|
1864
1862
|
Item.displayName = 'Item';
|
|
1865
1863
|
Item.propTypes = {
|
|
1866
|
-
value: PropTypes__default
|
|
1867
|
-
disabled: PropTypes__default
|
|
1864
|
+
value: PropTypes__default.default.any,
|
|
1865
|
+
disabled: PropTypes__default.default.bool
|
|
1868
1866
|
};
|
|
1869
1867
|
|
|
1870
|
-
const AddItemComponent =
|
|
1868
|
+
const AddItemComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
1871
1869
|
let {
|
|
1872
1870
|
children,
|
|
1873
1871
|
disabled,
|
|
@@ -1876,55 +1874,57 @@ const AddItemComponent = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1876
1874
|
const {
|
|
1877
1875
|
isCompact
|
|
1878
1876
|
} = useMenuContext();
|
|
1879
|
-
return
|
|
1877
|
+
return React__namespace.default.createElement(StyledAddItem, _extends$5({
|
|
1880
1878
|
ref: ref,
|
|
1881
1879
|
disabled: disabled
|
|
1882
|
-
}, props),
|
|
1880
|
+
}, props), React__namespace.default.createElement(StyledItemIcon, {
|
|
1883
1881
|
isCompact: isCompact,
|
|
1884
1882
|
isVisible: true,
|
|
1885
1883
|
isDisabled: disabled
|
|
1886
|
-
},
|
|
1884
|
+
}, React__namespace.default.createElement(SvgPlusStroke, null)), children);
|
|
1887
1885
|
});
|
|
1888
|
-
const AddItem =
|
|
1886
|
+
const AddItem = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(Item, _extends$5({
|
|
1889
1887
|
component: AddItemComponent,
|
|
1890
1888
|
ref: ref
|
|
1891
|
-
}, props
|
|
1889
|
+
}, props, {
|
|
1890
|
+
hasIcon: true
|
|
1891
|
+
})));
|
|
1892
1892
|
AddItem.displayName = 'AddItem';
|
|
1893
1893
|
AddItem.propTypes = {
|
|
1894
|
-
value: PropTypes__default
|
|
1895
|
-
disabled: PropTypes__default
|
|
1894
|
+
value: PropTypes__default.default.any,
|
|
1895
|
+
disabled: PropTypes__default.default.bool
|
|
1896
1896
|
};
|
|
1897
1897
|
|
|
1898
|
-
const HeaderIcon =
|
|
1898
|
+
const HeaderIcon = React__namespace.default.forwardRef((props, ref) => {
|
|
1899
1899
|
const {
|
|
1900
1900
|
isCompact
|
|
1901
1901
|
} = useMenuContext();
|
|
1902
|
-
return
|
|
1902
|
+
return React__namespace.default.createElement(StyledHeaderIcon, _extends$5({
|
|
1903
1903
|
ref: ref,
|
|
1904
1904
|
isCompact: isCompact
|
|
1905
1905
|
}, props));
|
|
1906
1906
|
});
|
|
1907
1907
|
HeaderIcon.displayName = 'HeaderIcon';
|
|
1908
1908
|
|
|
1909
|
-
const HeaderItem =
|
|
1909
|
+
const HeaderItem = React__namespace.default.forwardRef((props, ref) => {
|
|
1910
1910
|
const {
|
|
1911
1911
|
isCompact
|
|
1912
1912
|
} = useMenuContext();
|
|
1913
|
-
return
|
|
1913
|
+
return React__namespace.default.createElement(StyledHeaderItem, _extends$5({
|
|
1914
1914
|
ref: ref,
|
|
1915
1915
|
isCompact: isCompact
|
|
1916
1916
|
}, props));
|
|
1917
1917
|
});
|
|
1918
1918
|
HeaderItem.displayName = 'HeaderItem';
|
|
1919
1919
|
|
|
1920
|
-
const ItemMeta =
|
|
1920
|
+
const ItemMeta = React__namespace.default.forwardRef((props, ref) => {
|
|
1921
1921
|
const {
|
|
1922
1922
|
isCompact
|
|
1923
1923
|
} = useMenuContext();
|
|
1924
1924
|
const {
|
|
1925
1925
|
isDisabled
|
|
1926
1926
|
} = useItemContext();
|
|
1927
|
-
return
|
|
1927
|
+
return React__namespace.default.createElement(StyledItemMeta, _extends$5({
|
|
1928
1928
|
ref: ref,
|
|
1929
1929
|
isCompact: isCompact,
|
|
1930
1930
|
isDisabled: isDisabled
|
|
@@ -1932,11 +1932,11 @@ const ItemMeta = React__default["default"].forwardRef((props, ref) => {
|
|
|
1932
1932
|
});
|
|
1933
1933
|
ItemMeta.displayName = 'ItemMeta';
|
|
1934
1934
|
|
|
1935
|
-
const MediaBody =
|
|
1935
|
+
const MediaBody = React__namespace.default.forwardRef((props, ref) => {
|
|
1936
1936
|
const {
|
|
1937
1937
|
isCompact
|
|
1938
1938
|
} = useMenuContext();
|
|
1939
|
-
return
|
|
1939
|
+
return React__namespace.default.createElement(StyledMediaBody, _extends$5({
|
|
1940
1940
|
ref: ref,
|
|
1941
1941
|
isCompact: isCompact
|
|
1942
1942
|
}, props));
|
|
@@ -1947,22 +1947,22 @@ const MediaFigure = props => {
|
|
|
1947
1947
|
const {
|
|
1948
1948
|
isCompact
|
|
1949
1949
|
} = useMenuContext();
|
|
1950
|
-
return
|
|
1950
|
+
return React__namespace.default.createElement(StyledMediaFigure, _extends$5({
|
|
1951
1951
|
isCompact: isCompact
|
|
1952
1952
|
}, props));
|
|
1953
1953
|
};
|
|
1954
1954
|
|
|
1955
|
-
const MediaItem =
|
|
1955
|
+
const MediaItem = React__namespace.default.forwardRef((props, ref) => React__namespace.default.createElement(Item, _extends$5({
|
|
1956
1956
|
component: StyledMediaItem,
|
|
1957
1957
|
ref: ref
|
|
1958
1958
|
}, props)));
|
|
1959
1959
|
MediaItem.displayName = 'MediaItem';
|
|
1960
1960
|
MediaItem.propTypes = {
|
|
1961
|
-
value: PropTypes__default
|
|
1962
|
-
disabled: PropTypes__default
|
|
1961
|
+
value: PropTypes__default.default.any,
|
|
1962
|
+
disabled: PropTypes__default.default.bool
|
|
1963
1963
|
};
|
|
1964
1964
|
|
|
1965
|
-
const NextItemComponent =
|
|
1965
|
+
const NextItemComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
1966
1966
|
let {
|
|
1967
1967
|
children,
|
|
1968
1968
|
disabled,
|
|
@@ -1971,18 +1971,18 @@ const NextItemComponent = React__default["default"].forwardRef((_ref, ref) => {
|
|
|
1971
1971
|
const {
|
|
1972
1972
|
isCompact
|
|
1973
1973
|
} = useMenuContext();
|
|
1974
|
-
return
|
|
1974
|
+
return React__namespace.default.createElement(StyledNextItem, _extends$5({
|
|
1975
1975
|
ref: ref,
|
|
1976
1976
|
disabled: disabled
|
|
1977
|
-
}, props),
|
|
1977
|
+
}, props), React__namespace.default.createElement(StyledItemIcon, {
|
|
1978
1978
|
isCompact: isCompact,
|
|
1979
1979
|
isDisabled: disabled,
|
|
1980
1980
|
isVisible: true
|
|
1981
|
-
},
|
|
1981
|
+
}, React__namespace.default.createElement(StyledNextIcon, {
|
|
1982
1982
|
isDisabled: disabled
|
|
1983
1983
|
})), children);
|
|
1984
1984
|
});
|
|
1985
|
-
const NextItem =
|
|
1985
|
+
const NextItem = React__namespace.default.forwardRef((_ref2, ref) => {
|
|
1986
1986
|
let {
|
|
1987
1987
|
value,
|
|
1988
1988
|
disabled,
|
|
@@ -2000,21 +2000,23 @@ const NextItem = React__default["default"].forwardRef((_ref2, ref) => {
|
|
|
2000
2000
|
if (!disabled) {
|
|
2001
2001
|
nextItemsHashRef.current[itemToString(value)] = itemIndexRef.current;
|
|
2002
2002
|
}
|
|
2003
|
-
return
|
|
2003
|
+
return React__namespace.default.createElement(Item, _extends$5({
|
|
2004
2004
|
component: NextItemComponent,
|
|
2005
2005
|
"aria-expanded": true,
|
|
2006
2006
|
disabled: disabled,
|
|
2007
2007
|
value: value,
|
|
2008
2008
|
ref: ref
|
|
2009
|
-
}, props
|
|
2009
|
+
}, props, {
|
|
2010
|
+
hasIcon: true
|
|
2011
|
+
}));
|
|
2010
2012
|
});
|
|
2011
2013
|
NextItem.displayName = 'NextItem';
|
|
2012
2014
|
NextItem.propTypes = {
|
|
2013
|
-
value: PropTypes__default
|
|
2014
|
-
disabled: PropTypes__default
|
|
2015
|
+
value: PropTypes__default.default.any,
|
|
2016
|
+
disabled: PropTypes__default.default.bool
|
|
2015
2017
|
};
|
|
2016
2018
|
|
|
2017
|
-
const PreviousItemComponent =
|
|
2019
|
+
const PreviousItemComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
2018
2020
|
let {
|
|
2019
2021
|
children,
|
|
2020
2022
|
disabled,
|
|
@@ -2023,18 +2025,18 @@ const PreviousItemComponent = React__default["default"].forwardRef((_ref, ref) =
|
|
|
2023
2025
|
const {
|
|
2024
2026
|
isCompact
|
|
2025
2027
|
} = useMenuContext();
|
|
2026
|
-
return
|
|
2028
|
+
return React__namespace.default.createElement(StyledPreviousItem, _extends$5({
|
|
2027
2029
|
ref: ref,
|
|
2028
2030
|
disabled: disabled
|
|
2029
|
-
}, props),
|
|
2031
|
+
}, props), React__namespace.default.createElement(StyledItemIcon, {
|
|
2030
2032
|
isCompact: isCompact,
|
|
2031
2033
|
isDisabled: disabled,
|
|
2032
2034
|
isVisible: true
|
|
2033
|
-
},
|
|
2035
|
+
}, React__namespace.default.createElement(StyledPreviousIcon, {
|
|
2034
2036
|
isDisabled: disabled
|
|
2035
2037
|
})), children);
|
|
2036
2038
|
});
|
|
2037
|
-
const PreviousItem =
|
|
2039
|
+
const PreviousItem = React__namespace.default.forwardRef((_ref2, ref) => {
|
|
2038
2040
|
let {
|
|
2039
2041
|
value,
|
|
2040
2042
|
disabled,
|
|
@@ -2049,19 +2051,20 @@ const PreviousItem = React__default["default"].forwardRef((_ref2, ref) => {
|
|
|
2049
2051
|
if (!disabled) {
|
|
2050
2052
|
previousIndexRef.current = itemIndexRef.current;
|
|
2051
2053
|
}
|
|
2052
|
-
return
|
|
2054
|
+
return React__namespace.default.createElement(Item, _extends$5({
|
|
2053
2055
|
component: PreviousItemComponent,
|
|
2054
2056
|
"aria-expanded": true,
|
|
2055
2057
|
value: value,
|
|
2056
2058
|
disabled: disabled
|
|
2057
2059
|
}, props, {
|
|
2058
|
-
ref: ref
|
|
2060
|
+
ref: ref,
|
|
2061
|
+
hasIcon: true
|
|
2059
2062
|
}));
|
|
2060
2063
|
});
|
|
2061
2064
|
PreviousItem.displayName = 'PreviousItem';
|
|
2062
2065
|
PreviousItem.propTypes = {
|
|
2063
|
-
value: PropTypes__default
|
|
2064
|
-
disabled: PropTypes__default
|
|
2066
|
+
value: PropTypes__default.default.any,
|
|
2067
|
+
disabled: PropTypes__default.default.bool
|
|
2065
2068
|
};
|
|
2066
2069
|
|
|
2067
2070
|
Object.defineProperty(exports, 'resetIdCounter', {
|