@zendeskgarden/react-dropdowns 8.47.0 → 8.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +300 -311
- package/dist/index.esm.js +115 -122
- package/dist/typings/elements/Autocomplete/Autocomplete.d.ts +1 -2
- package/dist/typings/elements/Combobox/Combobox.d.ts +3 -4
- package/dist/typings/elements/Dropdown/Dropdown.d.ts +16 -4
- package/dist/typings/elements/Fields/Field.d.ts +2 -2
- package/dist/typings/elements/Menu/Items/AddItem.d.ts +1 -1
- package/dist/typings/elements/Menu/Items/MediaFigure.d.ts +3 -3
- 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/elements/Menu/Menu.d.ts +1 -2
- package/dist/typings/elements/Multiselect/Multiselect.d.ts +1 -2
- package/dist/typings/elements/Select/Select.d.ts +0 -2
- package/dist/typings/elements/Trigger/Trigger.d.ts +12 -3
- package/dist/typings/index.d.ts +6 -6
- package/dist/typings/styled/items/media/StyledMediaFigure.d.ts +176 -176
- package/dist/typings/styled/select/StyledFauxInput.d.ts +11 -1
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import React__default, { useContext, useRef, useState, Children, useEffect, useCallback, useMemo } from 'react';
|
|
9
|
+
import React__default, { useContext, useRef, useState, Children, useEffect, useCallback, forwardRef, useMemo } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
+
import styled, { ThemeContext, css } from 'styled-components';
|
|
11
12
|
import Downshift from 'downshift';
|
|
12
13
|
export { resetIdCounter } from 'downshift';
|
|
13
14
|
import { Manager, Reference, Popper } from 'react-popper';
|
|
14
|
-
import { withTheme, isRtl, arrowStyles, retrieveComponentStyles, DEFAULT_THEME, menuStyles, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
15
15
|
import { composeEventHandlers, KEY_CODES } from '@zendeskgarden/container-utilities';
|
|
16
|
-
import
|
|
16
|
+
import { arrowStyles, retrieveComponentStyles, DEFAULT_THEME, menuStyles, getColor, getLineHeight } from '@zendeskgarden/react-theming';
|
|
17
17
|
import { rgba, math } from 'polished';
|
|
18
18
|
import { FauxInput, Input, MediaInput, Field as Field$1, Hint as Hint$1, Label as Label$1, Message as Message$1 } from '@zendeskgarden/react-forms';
|
|
19
19
|
import mergeRefs from 'react-merge-refs';
|
|
@@ -24,14 +24,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
24
24
|
|
|
25
25
|
if (Object.getOwnPropertySymbols) {
|
|
26
26
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
keys.push.apply(keys, symbols);
|
|
27
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
28
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
29
|
+
})), keys.push.apply(keys, symbols);
|
|
35
30
|
}
|
|
36
31
|
|
|
37
32
|
return keys;
|
|
@@ -39,19 +34,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
39
34
|
|
|
40
35
|
function _objectSpread2(target) {
|
|
41
36
|
for (var i = 1; i < arguments.length; i++) {
|
|
42
|
-
var source = arguments[i]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
49
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
50
|
-
} else {
|
|
51
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
52
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
53
|
-
});
|
|
54
|
-
}
|
|
37
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
38
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
39
|
+
_defineProperty(target, key, source[key]);
|
|
40
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
41
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
42
|
+
});
|
|
55
43
|
}
|
|
56
44
|
|
|
57
45
|
return target;
|
|
@@ -218,6 +206,7 @@ var Dropdown = function Dropdown(props) {
|
|
|
218
206
|
_useState2 = _slicedToArray(_useState, 2),
|
|
219
207
|
dropdownType = _useState2[0],
|
|
220
208
|
setDropdownType = _useState2[1];
|
|
209
|
+
var themeContext = useContext(ThemeContext);
|
|
221
210
|
var hasMenuRef = useRef(false);
|
|
222
211
|
var popperReferenceElementRef = useRef(null);
|
|
223
212
|
var customGetInputProps = function customGetInputProps(_ref, downshift, rtl) {
|
|
@@ -255,7 +244,7 @@ var Dropdown = function Dropdown(props) {
|
|
|
255
244
|
downshift = _objectWithoutProperties(_ref2, _excluded2$6);
|
|
256
245
|
return _objectSpread2({
|
|
257
246
|
getInputProps: function getInputProps(p) {
|
|
258
|
-
return _getInputProps(customGetInputProps(p, downshift,
|
|
247
|
+
return _getInputProps(customGetInputProps(p, downshift, themeContext.rtl));
|
|
259
248
|
},
|
|
260
249
|
getToggleButtonProps: function getToggleButtonProps(p) {
|
|
261
250
|
return _getToggleButtonProps(_objectSpread2({
|
|
@@ -352,7 +341,6 @@ Dropdown.propTypes = {
|
|
|
352
341
|
onStateChange: PropTypes.func,
|
|
353
342
|
downshiftProps: PropTypes.object
|
|
354
343
|
};
|
|
355
|
-
var Dropdown$1 = withTheme(Dropdown);
|
|
356
344
|
|
|
357
345
|
function getPopperPlacement(gardenPlacement) {
|
|
358
346
|
switch (gardenPlacement) {
|
|
@@ -428,7 +416,7 @@ var COMPONENT_ID$m = 'dropdowns.menu';
|
|
|
428
416
|
var StyledMenu = styled.ul.attrs(function (props) {
|
|
429
417
|
return {
|
|
430
418
|
'data-garden-id': COMPONENT_ID$m,
|
|
431
|
-
'data-garden-version': '8.
|
|
419
|
+
'data-garden-version': '8.48.1',
|
|
432
420
|
className: props.isAnimated && 'is-animated'
|
|
433
421
|
};
|
|
434
422
|
}).withConfig({
|
|
@@ -453,7 +441,7 @@ var COMPONENT_ID$l = 'dropdowns.menu_wrapper';
|
|
|
453
441
|
var StyledMenuWrapper = styled.div.attrs(function (props) {
|
|
454
442
|
return {
|
|
455
443
|
'data-garden-id': COMPONENT_ID$l,
|
|
456
|
-
'data-garden-version': '8.
|
|
444
|
+
'data-garden-version': '8.48.1',
|
|
457
445
|
className: props.isAnimated && 'is-animated'
|
|
458
446
|
};
|
|
459
447
|
}).withConfig({
|
|
@@ -477,7 +465,7 @@ StyledMenuWrapper.defaultProps = {
|
|
|
477
465
|
var COMPONENT_ID$k = 'dropdowns.separator';
|
|
478
466
|
var StyledSeparator = styled.li.attrs({
|
|
479
467
|
'data-garden-id': COMPONENT_ID$k,
|
|
480
|
-
'data-garden-version': '8.
|
|
468
|
+
'data-garden-version': '8.48.1',
|
|
481
469
|
role: 'separator'
|
|
482
470
|
}).withConfig({
|
|
483
471
|
displayName: "StyledSeparator",
|
|
@@ -517,7 +505,7 @@ var getColorStyles = function getColorStyles(props) {
|
|
|
517
505
|
var StyledItem = styled.li.attrs(function (props) {
|
|
518
506
|
return {
|
|
519
507
|
'data-garden-id': COMPONENT_ID$j,
|
|
520
|
-
'data-garden-version': '8.
|
|
508
|
+
'data-garden-version': '8.48.1',
|
|
521
509
|
'aria-disabled': props.disabled
|
|
522
510
|
};
|
|
523
511
|
}).withConfig({
|
|
@@ -547,7 +535,7 @@ StyledItem.defaultProps = {
|
|
|
547
535
|
var COMPONENT_ID$i = 'dropdowns.add_item';
|
|
548
536
|
var StyledAddItem = styled(StyledItem).attrs({
|
|
549
537
|
'data-garden-id': COMPONENT_ID$i,
|
|
550
|
-
'data-garden-version': '8.
|
|
538
|
+
'data-garden-version': '8.48.1'
|
|
551
539
|
}).withConfig({
|
|
552
540
|
displayName: "StyledAddItem",
|
|
553
541
|
componentId: "sc-ekqk50-0"
|
|
@@ -563,7 +551,7 @@ StyledAddItem.defaultProps = {
|
|
|
563
551
|
var COMPONENT_ID$h = 'dropdowns.item_meta';
|
|
564
552
|
var StyledItemMeta = styled.span.attrs({
|
|
565
553
|
'data-garden-id': COMPONENT_ID$h,
|
|
566
|
-
'data-garden-version': '8.
|
|
554
|
+
'data-garden-version': '8.48.1'
|
|
567
555
|
}).withConfig({
|
|
568
556
|
displayName: "StyledItemMeta",
|
|
569
557
|
componentId: "sc-k6xy28-0"
|
|
@@ -586,7 +574,7 @@ var getSizeStyles = function getSizeStyles(props) {
|
|
|
586
574
|
};
|
|
587
575
|
var StyledItemIcon = styled.div.attrs({
|
|
588
576
|
'data-garden-id': COMPONENT_ID$g,
|
|
589
|
-
'data-garden-version': '8.
|
|
577
|
+
'data-garden-version': '8.48.1'
|
|
590
578
|
}).withConfig({
|
|
591
579
|
displayName: "StyledItemIcon",
|
|
592
580
|
componentId: "sc-1v0ty11-0"
|
|
@@ -612,7 +600,7 @@ StyledItemIcon.defaultProps = {
|
|
|
612
600
|
var COMPONENT_ID$f = 'dropdowns.next_item';
|
|
613
601
|
var StyledNextItem = styled(StyledItem).attrs({
|
|
614
602
|
'data-garden-id': COMPONENT_ID$f,
|
|
615
|
-
'data-garden-version': '8.
|
|
603
|
+
'data-garden-version': '8.48.1'
|
|
616
604
|
}).withConfig({
|
|
617
605
|
displayName: "StyledNextItem",
|
|
618
606
|
componentId: "sc-1bcygn5-0"
|
|
@@ -627,30 +615,30 @@ StyledNextItem.defaultProps = {
|
|
|
627
615
|
theme: DEFAULT_THEME
|
|
628
616
|
};
|
|
629
617
|
|
|
630
|
-
|
|
618
|
+
var _path$4;
|
|
631
619
|
|
|
632
|
-
|
|
633
|
-
fill: "currentColor",
|
|
634
|
-
d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
|
|
635
|
-
});
|
|
620
|
+
function _extends$4() { _extends$4 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
|
|
636
621
|
|
|
637
|
-
function SvgChevronRightStroke(props) {
|
|
622
|
+
var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
|
|
638
623
|
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
639
624
|
xmlns: "http://www.w3.org/2000/svg",
|
|
640
625
|
width: 16,
|
|
641
626
|
height: 16,
|
|
642
|
-
viewBox: "0 0 16 16",
|
|
643
627
|
focusable: "false",
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
}
|
|
628
|
+
viewBox: "0 0 16 16",
|
|
629
|
+
"aria-hidden": "true"
|
|
630
|
+
}, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
|
|
631
|
+
fill: "currentColor",
|
|
632
|
+
d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
|
|
633
|
+
})));
|
|
634
|
+
};
|
|
647
635
|
|
|
648
636
|
var COMPONENT_ID$e = 'dropdowns.next_item_icon';
|
|
649
637
|
var NextIconComponent = function NextIconComponent(_ref) {
|
|
650
638
|
var className = _ref.className;
|
|
651
639
|
return React__default.createElement(SvgChevronRightStroke, {
|
|
652
640
|
"data-garden-id": COMPONENT_ID$e,
|
|
653
|
-
"data-garden-version": '8.
|
|
641
|
+
"data-garden-version": '8.48.1',
|
|
654
642
|
className: className
|
|
655
643
|
});
|
|
656
644
|
};
|
|
@@ -671,7 +659,7 @@ StyledNextIcon.defaultProps = {
|
|
|
671
659
|
var COMPONENT_ID$d = 'dropdowns.previous_item';
|
|
672
660
|
var StyledPreviousItem = styled(StyledItem).attrs({
|
|
673
661
|
'data-garden-id': COMPONENT_ID$d,
|
|
674
|
-
'data-garden-version': '8.
|
|
662
|
+
'data-garden-version': '8.48.1'
|
|
675
663
|
}).withConfig({
|
|
676
664
|
displayName: "StyledPreviousItem",
|
|
677
665
|
componentId: "sc-1nmdds9-0"
|
|
@@ -684,30 +672,30 @@ StyledPreviousItem.defaultProps = {
|
|
|
684
672
|
theme: DEFAULT_THEME
|
|
685
673
|
};
|
|
686
674
|
|
|
687
|
-
|
|
675
|
+
var _path$3;
|
|
688
676
|
|
|
689
|
-
|
|
690
|
-
fill: "currentColor",
|
|
691
|
-
d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
|
|
692
|
-
});
|
|
677
|
+
function _extends$3() { _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
693
678
|
|
|
694
|
-
function SvgChevronLeftStroke(props) {
|
|
679
|
+
var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
|
|
695
680
|
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
696
681
|
xmlns: "http://www.w3.org/2000/svg",
|
|
697
682
|
width: 16,
|
|
698
683
|
height: 16,
|
|
699
|
-
viewBox: "0 0 16 16",
|
|
700
684
|
focusable: "false",
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
}
|
|
685
|
+
viewBox: "0 0 16 16",
|
|
686
|
+
"aria-hidden": "true"
|
|
687
|
+
}, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
|
|
688
|
+
fill: "currentColor",
|
|
689
|
+
d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
|
|
690
|
+
})));
|
|
691
|
+
};
|
|
704
692
|
|
|
705
693
|
var COMPONENT_ID$c = 'dropdowns.previous_item_icon';
|
|
706
694
|
var PreviousIconComponent = function PreviousIconComponent(_ref) {
|
|
707
695
|
var className = _ref.className;
|
|
708
696
|
return React__default.createElement(SvgChevronLeftStroke, {
|
|
709
697
|
"data-garden-id": COMPONENT_ID$c,
|
|
710
|
-
"data-garden-version": '8.
|
|
698
|
+
"data-garden-version": '8.48.1',
|
|
711
699
|
className: className
|
|
712
700
|
});
|
|
713
701
|
};
|
|
@@ -728,7 +716,7 @@ StyledPreviousIcon.defaultProps = {
|
|
|
728
716
|
var COMPONENT_ID$b = 'dropdowns.header_icon';
|
|
729
717
|
var StyledHeaderIcon = styled.div.attrs({
|
|
730
718
|
'data-garden-id': COMPONENT_ID$b,
|
|
731
|
-
'data-garden-version': '8.
|
|
719
|
+
'data-garden-version': '8.48.1'
|
|
732
720
|
}).withConfig({
|
|
733
721
|
displayName: "StyledHeaderIcon",
|
|
734
722
|
componentId: "sc-1fl6nsz-0"
|
|
@@ -758,7 +746,7 @@ var getHorizontalPadding = function getHorizontalPadding(props) {
|
|
|
758
746
|
};
|
|
759
747
|
var StyledHeaderItem = styled(StyledItem).attrs({
|
|
760
748
|
'data-garden-id': COMPONENT_ID$a,
|
|
761
|
-
'data-garden-version': '8.
|
|
749
|
+
'data-garden-version': '8.48.1'
|
|
762
750
|
}).withConfig({
|
|
763
751
|
displayName: "StyledHeaderItem",
|
|
764
752
|
componentId: "sc-137filx-0"
|
|
@@ -778,7 +766,7 @@ StyledHeaderItem.defaultProps = {
|
|
|
778
766
|
var COMPONENT_ID$9 = 'dropdowns.media_body';
|
|
779
767
|
var StyledMediaBody = styled.div.attrs({
|
|
780
768
|
'data-garden-id': COMPONENT_ID$9,
|
|
781
|
-
'data-garden-version': '8.
|
|
769
|
+
'data-garden-version': '8.48.1'
|
|
782
770
|
}).withConfig({
|
|
783
771
|
displayName: "StyledMediaBody",
|
|
784
772
|
componentId: "sc-36j7ef-0"
|
|
@@ -806,7 +794,7 @@ function (_ref) {
|
|
|
806
794
|
);
|
|
807
795
|
}).attrs({
|
|
808
796
|
'data-garden-id': COMPONENT_ID$8,
|
|
809
|
-
'data-garden-version': '8.
|
|
797
|
+
'data-garden-version': '8.48.1'
|
|
810
798
|
}).withConfig({
|
|
811
799
|
displayName: "StyledMediaFigure",
|
|
812
800
|
componentId: "sc-2f2x8x-0"
|
|
@@ -828,7 +816,7 @@ StyledMediaFigure.defaultProps = {
|
|
|
828
816
|
var COMPONENT_ID$7 = 'dropdowns.media_item';
|
|
829
817
|
var StyledMediaItem = styled(StyledItem).attrs({
|
|
830
818
|
'data-garden-id': COMPONENT_ID$7,
|
|
831
|
-
'data-garden-version': '8.
|
|
819
|
+
'data-garden-version': '8.48.1'
|
|
832
820
|
}).withConfig({
|
|
833
821
|
displayName: "StyledMediaItem",
|
|
834
822
|
componentId: "sc-ikwshz-0"
|
|
@@ -843,7 +831,7 @@ var COMPONENT_ID$6 = 'dropdowns.faux_input';
|
|
|
843
831
|
var StyledFauxInput = styled(FauxInput).attrs(function (props) {
|
|
844
832
|
return {
|
|
845
833
|
'data-garden-id': COMPONENT_ID$6,
|
|
846
|
-
'data-garden-version': '8.
|
|
834
|
+
'data-garden-version': '8.48.1',
|
|
847
835
|
mediaLayout: true,
|
|
848
836
|
theme: props.theme
|
|
849
837
|
};
|
|
@@ -865,7 +853,7 @@ var COMPONENT_ID$5 = 'dropdowns.input';
|
|
|
865
853
|
var hiddenStyling = css(["position:fixed;border:0;clip:rect(1px,1px,1px,1px);padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
|
|
866
854
|
var StyledInput = styled(Input).attrs({
|
|
867
855
|
'data-garden-id': COMPONENT_ID$5,
|
|
868
|
-
'data-garden-version': '8.
|
|
856
|
+
'data-garden-version': '8.48.1',
|
|
869
857
|
isBare: true
|
|
870
858
|
}).withConfig({
|
|
871
859
|
displayName: "StyledInput",
|
|
@@ -882,7 +870,7 @@ StyledInput.defaultProps = {
|
|
|
882
870
|
var COMPONENT_ID$4 = 'dropdowns.select';
|
|
883
871
|
var StyledSelect = styled.div.attrs({
|
|
884
872
|
'data-garden-id': COMPONENT_ID$4,
|
|
885
|
-
'data-garden-version': '8.
|
|
873
|
+
'data-garden-version': '8.48.1'
|
|
886
874
|
}).withConfig({
|
|
887
875
|
displayName: "StyledSelect",
|
|
888
876
|
componentId: "sc-xifmwj-0"
|
|
@@ -905,7 +893,7 @@ var visibleStyling = function visibleStyling(props) {
|
|
|
905
893
|
};
|
|
906
894
|
var StyledMultiselectInput = styled(StyledInput).attrs({
|
|
907
895
|
'data-garden-id': COMPONENT_ID$3,
|
|
908
|
-
'data-garden-version': '8.
|
|
896
|
+
'data-garden-version': '8.48.1'
|
|
909
897
|
}).withConfig({
|
|
910
898
|
displayName: "StyledMultiselectInput",
|
|
911
899
|
componentId: "sc-1avnf6f-0"
|
|
@@ -935,7 +923,7 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
935
923
|
};
|
|
936
924
|
var StyledMultiselectItemsContainer = styled.div.attrs({
|
|
937
925
|
'data-garden-id': COMPONENT_ID$2,
|
|
938
|
-
'data-garden-version': '8.
|
|
926
|
+
'data-garden-version': '8.48.1'
|
|
939
927
|
}).withConfig({
|
|
940
928
|
displayName: "StyledMultiselectItemsContainer",
|
|
941
929
|
componentId: "sc-1jzhet8-0"
|
|
@@ -951,7 +939,7 @@ StyledMultiselectItemsContainer.defaultProps = {
|
|
|
951
939
|
var COMPONENT_ID$1 = 'dropdowns.multiselect_item_wrapper';
|
|
952
940
|
var StyledMultiselectItemWrapper = styled.div.attrs({
|
|
953
941
|
'data-garden-id': COMPONENT_ID$1,
|
|
954
|
-
'data-garden-version': '8.
|
|
942
|
+
'data-garden-version': '8.48.1'
|
|
955
943
|
}).withConfig({
|
|
956
944
|
displayName: "StyledMultiselectItemWrapper",
|
|
957
945
|
componentId: "sc-1rb2bye-0"
|
|
@@ -967,7 +955,7 @@ StyledMultiselectItemWrapper.defaultProps = {
|
|
|
967
955
|
var COMPONENT_ID = 'dropdowns.multiselect_more_anchor';
|
|
968
956
|
var StyledMultiselectMoreAnchor = styled.div.attrs({
|
|
969
957
|
'data-garden-id': COMPONENT_ID,
|
|
970
|
-
'data-garden-version': '8.
|
|
958
|
+
'data-garden-version': '8.48.1'
|
|
971
959
|
}).withConfig({
|
|
972
960
|
displayName: "StyledMultiselectMoreAnchor",
|
|
973
961
|
componentId: "sc-1m9v46e-0"
|
|
@@ -1128,23 +1116,23 @@ Trigger.defaultProps = {
|
|
|
1128
1116
|
refKey: 'ref'
|
|
1129
1117
|
};
|
|
1130
1118
|
|
|
1131
|
-
|
|
1119
|
+
var _path$2;
|
|
1132
1120
|
|
|
1133
|
-
|
|
1134
|
-
fill: "currentColor",
|
|
1135
|
-
d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
|
|
1136
|
-
});
|
|
1121
|
+
function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
1137
1122
|
|
|
1138
|
-
function SvgChevronDownStroke(props) {
|
|
1123
|
+
var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
|
|
1139
1124
|
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
1140
1125
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1141
1126
|
width: 16,
|
|
1142
1127
|
height: 16,
|
|
1143
|
-
viewBox: "0 0 16 16",
|
|
1144
1128
|
focusable: "false",
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
}
|
|
1129
|
+
viewBox: "0 0 16 16",
|
|
1130
|
+
"aria-hidden": "true"
|
|
1131
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
1132
|
+
fill: "currentColor",
|
|
1133
|
+
d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
|
|
1134
|
+
})));
|
|
1135
|
+
};
|
|
1148
1136
|
|
|
1149
1137
|
var FieldContext = React__default.createContext(undefined);
|
|
1150
1138
|
var useFieldContext = function useFieldContext() {
|
|
@@ -1157,7 +1145,7 @@ var useFieldContext = function useFieldContext() {
|
|
|
1157
1145
|
|
|
1158
1146
|
var _excluded$9 = ["children", "inputRef", "start"],
|
|
1159
1147
|
_excluded2$4 = ["type"];
|
|
1160
|
-
var Autocomplete =
|
|
1148
|
+
var Autocomplete = forwardRef(function (_ref, _ref3) {
|
|
1161
1149
|
var children = _ref.children,
|
|
1162
1150
|
controlledInputRef = _ref.inputRef,
|
|
1163
1151
|
start = _ref.start,
|
|
@@ -1260,7 +1248,7 @@ Autocomplete.propTypes = {
|
|
|
1260
1248
|
};
|
|
1261
1249
|
|
|
1262
1250
|
var _excluded$8 = ["isCompact", "isBare", "disabled", "focusInset", "placeholder", "validation", "inputRef", "start", "end"];
|
|
1263
|
-
var Combobox =
|
|
1251
|
+
var Combobox = forwardRef(function (_ref, ref) {
|
|
1264
1252
|
var isCompact = _ref.isCompact,
|
|
1265
1253
|
isBare = _ref.isBare,
|
|
1266
1254
|
disabled = _ref.disabled,
|
|
@@ -1342,7 +1330,7 @@ Combobox.propTypes = {
|
|
|
1342
1330
|
validation: PropTypes.oneOf(['success', 'warning', 'error'])
|
|
1343
1331
|
};
|
|
1344
1332
|
|
|
1345
|
-
var _excluded$7 = ["renderItem", "placeholder", "maxItems", "renderShowMore", "inputRef", "start"],
|
|
1333
|
+
var _excluded$7 = ["renderItem", "placeholder", "maxItems", "renderShowMore", "inputRef", "start", "onKeyDown"],
|
|
1346
1334
|
_excluded2$3 = ["type"];
|
|
1347
1335
|
var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
1348
1336
|
var renderItem = _ref.renderItem,
|
|
@@ -1352,6 +1340,7 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1352
1340
|
_ref$inputRef = _ref.inputRef,
|
|
1353
1341
|
externalInputRef = _ref$inputRef === void 0 ? null : _ref$inputRef,
|
|
1354
1342
|
start = _ref.start,
|
|
1343
|
+
onKeyDown = _ref.onKeyDown,
|
|
1355
1344
|
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1356
1345
|
var _useDropdownContext = useDropdownContext(),
|
|
1357
1346
|
popperReferenceElementRef = _useDropdownContext.popperReferenceElementRef,
|
|
@@ -1388,8 +1377,9 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1388
1377
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1389
1378
|
focusedItem = _useState6[0],
|
|
1390
1379
|
setFocusedItem = _useState6[1];
|
|
1380
|
+
var themeContext = useContext(ThemeContext);
|
|
1391
1381
|
var _useSelection = useSelection({
|
|
1392
|
-
rtl:
|
|
1382
|
+
rtl: themeContext.rtl,
|
|
1393
1383
|
focusedItem: focusedItem,
|
|
1394
1384
|
selectedItem: undefined,
|
|
1395
1385
|
onFocus: function onFocus(item) {
|
|
@@ -1423,14 +1413,14 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1423
1413
|
}, [focusedItem, isOpen, closeMenu]);
|
|
1424
1414
|
var _getToggleButtonProps = getToggleButtonProps(getRootProps(_objectSpread2({
|
|
1425
1415
|
tabIndex: props.disabled ? undefined : -1,
|
|
1426
|
-
onKeyDown: function
|
|
1416
|
+
onKeyDown: composeEventHandlers(onKeyDown, function (e) {
|
|
1427
1417
|
if (isOpen) {
|
|
1428
1418
|
e.nativeEvent.preventDownshiftDefault = true;
|
|
1429
1419
|
} else if (!inputValue && e.keyCode === KEY_CODES.HOME) {
|
|
1430
1420
|
setFocusedItem(selectedItems[0]);
|
|
1431
1421
|
e.preventDefault();
|
|
1432
1422
|
}
|
|
1433
|
-
},
|
|
1423
|
+
}),
|
|
1434
1424
|
onFocus: function onFocus() {
|
|
1435
1425
|
setIsFocused(true);
|
|
1436
1426
|
},
|
|
@@ -1477,7 +1467,7 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1477
1467
|
inputRef.current && inputRef.current.focus();
|
|
1478
1468
|
e.preventDefault();
|
|
1479
1469
|
}
|
|
1480
|
-
if (
|
|
1470
|
+
if (themeContext.rtl) {
|
|
1481
1471
|
if (e.keyCode === KEY_CODES.RIGHT && index === 0) {
|
|
1482
1472
|
e.preventDefault();
|
|
1483
1473
|
}
|
|
@@ -1506,7 +1496,7 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1506
1496
|
return React__default.createElement(StyledMultiselectItemWrapper, {
|
|
1507
1497
|
key: key
|
|
1508
1498
|
}, clonedChild);
|
|
1509
|
-
}, [getItemProps, inputValue, renderItem, setDownshiftState, itemToString, selectedItems, props, inputRef]);
|
|
1499
|
+
}, [getItemProps, inputValue, renderItem, setDownshiftState, itemToString, selectedItems, props, inputRef, themeContext.rtl]);
|
|
1510
1500
|
var items = useMemo(function () {
|
|
1511
1501
|
var itemValues = selectedItems || [];
|
|
1512
1502
|
var output = [];
|
|
@@ -1575,9 +1565,9 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
|
|
|
1575
1565
|
},
|
|
1576
1566
|
onKeyDown: function onKeyDown(e) {
|
|
1577
1567
|
if (!inputValue) {
|
|
1578
|
-
if (
|
|
1568
|
+
if (themeContext.rtl && e.keyCode === KEY_CODES.RIGHT && selectedItems.length > 0 && previousIndexRef.current === undefined) {
|
|
1579
1569
|
setFocusedItem(selectedItems[selectedItems.length - 1]);
|
|
1580
|
-
} else if (!
|
|
1570
|
+
} else if (!themeContext.rtl && e.keyCode === KEY_CODES.LEFT && selectedItems.length > 0 && previousIndexRef.current === undefined) {
|
|
1581
1571
|
setFocusedItem(selectedItems[selectedItems.length - 1]);
|
|
1582
1572
|
} else if (e.keyCode === KEY_CODES.BACKSPACE && selectedItems.length > 0) {
|
|
1583
1573
|
setDownshiftState({
|
|
@@ -1615,7 +1605,7 @@ Multiselect.propTypes = {
|
|
|
1615
1605
|
Multiselect.defaultProps = {
|
|
1616
1606
|
maxItems: 4
|
|
1617
1607
|
};
|
|
1618
|
-
|
|
1608
|
+
Multiselect.displayName = 'Multiselect';
|
|
1619
1609
|
|
|
1620
1610
|
var _excluded$6 = ["children", "start"],
|
|
1621
1611
|
_excluded2$2 = ["type"];
|
|
@@ -1780,7 +1770,7 @@ Select.propTypes = {
|
|
|
1780
1770
|
validation: PropTypes.oneOf(['success', 'warning', 'error'])
|
|
1781
1771
|
};
|
|
1782
1772
|
|
|
1783
|
-
var Field = function
|
|
1773
|
+
var Field = forwardRef(function (props, fieldRef) {
|
|
1784
1774
|
var _useDropdownContext = useDropdownContext(),
|
|
1785
1775
|
getRootProps = _useDropdownContext.downshift.getRootProps;
|
|
1786
1776
|
var _useState = useState(false),
|
|
@@ -1798,9 +1788,10 @@ var Field = function Field(props) {
|
|
|
1798
1788
|
return React__default.createElement(FieldContext.Provider, {
|
|
1799
1789
|
value: value
|
|
1800
1790
|
}, React__default.createElement(Field$1, _extends$5({
|
|
1801
|
-
ref: ref
|
|
1791
|
+
ref: mergeRefs([ref, fieldRef])
|
|
1802
1792
|
}, props)));
|
|
1803
|
-
};
|
|
1793
|
+
});
|
|
1794
|
+
Field.displayName = 'Field';
|
|
1804
1795
|
|
|
1805
1796
|
var Hint = React__default.forwardRef(function (props, ref) {
|
|
1806
1797
|
return React__default.createElement(Hint$1, _extends$5({
|
|
@@ -1855,7 +1846,7 @@ var useMenuContext = function useMenuContext() {
|
|
|
1855
1846
|
};
|
|
1856
1847
|
|
|
1857
1848
|
var _excluded$4 = ["placement", "popperModifiers", "eventsEnabled", "isAnimated", "maxHeight", "style", "zIndex", "isCompact", "children"];
|
|
1858
|
-
var Menu = function
|
|
1849
|
+
var Menu = forwardRef(function (props, menuRef) {
|
|
1859
1850
|
var placement = props.placement,
|
|
1860
1851
|
popperModifiers = props.popperModifiers,
|
|
1861
1852
|
eventsEnabled = props.eventsEnabled,
|
|
@@ -1901,11 +1892,12 @@ var Menu = function Menu(props) {
|
|
|
1901
1892
|
return clearTimeout(timeout);
|
|
1902
1893
|
};
|
|
1903
1894
|
}, [isOpen, isAnimated]);
|
|
1895
|
+
var themeContext = useContext(ThemeContext);
|
|
1904
1896
|
itemIndexRef.current = 0;
|
|
1905
1897
|
nextItemsHashRef.current = {};
|
|
1906
1898
|
previousIndexRef.current = undefined;
|
|
1907
1899
|
itemSearchRegistry.current = [];
|
|
1908
|
-
var popperPlacement =
|
|
1900
|
+
var popperPlacement = themeContext.rtl ? getRtlPopperPlacement(placement) : getPopperPlacement(placement);
|
|
1909
1901
|
return (
|
|
1910
1902
|
React__default.createElement(MenuContext.Provider, {
|
|
1911
1903
|
value: {
|
|
@@ -1943,13 +1935,15 @@ var Menu = function Menu(props) {
|
|
|
1943
1935
|
isAnimated: menuProps.isAnimated,
|
|
1944
1936
|
zIndex: zIndex
|
|
1945
1937
|
}, React__default.createElement(StyledMenu, _extends$5({
|
|
1938
|
+
ref: menuRef,
|
|
1946
1939
|
isCompact: isCompact,
|
|
1947
1940
|
maxHeight: maxHeight,
|
|
1948
1941
|
style: computedStyle
|
|
1949
1942
|
}, menuProps), (isOpen || isVisible) && children));
|
|
1950
1943
|
}))
|
|
1951
1944
|
);
|
|
1952
|
-
};
|
|
1945
|
+
});
|
|
1946
|
+
Menu.displayName = 'Menu';
|
|
1953
1947
|
Menu.propTypes = {
|
|
1954
1948
|
popperModifiers: PropTypes.any,
|
|
1955
1949
|
eventsEnabled: PropTypes.bool,
|
|
@@ -1968,7 +1962,6 @@ Menu.defaultProps = {
|
|
|
1968
1962
|
maxHeight: '400px',
|
|
1969
1963
|
zIndex: 1000
|
|
1970
1964
|
};
|
|
1971
|
-
var Menu$1 = withTheme(Menu);
|
|
1972
1965
|
|
|
1973
1966
|
var Separator = React__default.forwardRef(function (props, ref) {
|
|
1974
1967
|
return React__default.createElement(StyledSeparator, _extends$5({
|
|
@@ -1977,45 +1970,45 @@ var Separator = React__default.forwardRef(function (props, ref) {
|
|
|
1977
1970
|
});
|
|
1978
1971
|
Separator.displayName = 'Separator';
|
|
1979
1972
|
|
|
1980
|
-
|
|
1973
|
+
var _path$1;
|
|
1981
1974
|
|
|
1982
|
-
|
|
1983
|
-
stroke: "currentColor",
|
|
1984
|
-
strokeLinecap: "round",
|
|
1985
|
-
d: "M7.5 2.5v12m6-6h-12"
|
|
1986
|
-
});
|
|
1975
|
+
function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
1987
1976
|
|
|
1988
|
-
function SvgPlusStroke(props) {
|
|
1977
|
+
var SvgPlusStroke = function SvgPlusStroke(props) {
|
|
1989
1978
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
1990
1979
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1991
1980
|
width: 16,
|
|
1992
1981
|
height: 16,
|
|
1993
|
-
viewBox: "0 0 16 16",
|
|
1994
1982
|
focusable: "false",
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
}
|
|
1983
|
+
viewBox: "0 0 16 16",
|
|
1984
|
+
"aria-hidden": "true"
|
|
1985
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
1986
|
+
stroke: "currentColor",
|
|
1987
|
+
strokeLinecap: "round",
|
|
1988
|
+
d: "M7.5 2.5v12m6-6h-12"
|
|
1989
|
+
})));
|
|
1990
|
+
};
|
|
1998
1991
|
|
|
1999
|
-
|
|
1992
|
+
var _path;
|
|
2000
1993
|
|
|
2001
|
-
var
|
|
2002
|
-
fill: "none",
|
|
2003
|
-
stroke: "currentColor",
|
|
2004
|
-
strokeLinecap: "round",
|
|
2005
|
-
strokeLinejoin: "round",
|
|
2006
|
-
d: "M1 9l4 4L15 3"
|
|
2007
|
-
});
|
|
1994
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2008
1995
|
|
|
2009
|
-
function SvgCheckLgStroke(props) {
|
|
1996
|
+
var SvgCheckLgStroke = function SvgCheckLgStroke(props) {
|
|
2010
1997
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
2011
1998
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2012
1999
|
width: 16,
|
|
2013
2000
|
height: 16,
|
|
2014
|
-
viewBox: "0 0 16 16",
|
|
2015
2001
|
focusable: "false",
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
}
|
|
2002
|
+
viewBox: "0 0 16 16",
|
|
2003
|
+
"aria-hidden": "true"
|
|
2004
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
2005
|
+
fill: "none",
|
|
2006
|
+
stroke: "currentColor",
|
|
2007
|
+
strokeLinecap: "round",
|
|
2008
|
+
strokeLinejoin: "round",
|
|
2009
|
+
d: "M1 9l4 4L15 3"
|
|
2010
|
+
})));
|
|
2011
|
+
};
|
|
2019
2012
|
|
|
2020
2013
|
var ItemContext = React__default.createContext(undefined);
|
|
2021
2014
|
var useItemContext = function useItemContext() {
|
|
@@ -2305,4 +2298,4 @@ PreviousItem.propTypes = {
|
|
|
2305
2298
|
disabled: PropTypes.bool
|
|
2306
2299
|
};
|
|
2307
2300
|
|
|
2308
|
-
export { AddItem, Autocomplete, Combobox, Dropdown
|
|
2301
|
+
export { AddItem, Autocomplete, Combobox, Dropdown, Field, HeaderIcon, HeaderItem, Hint, Item, ItemMeta, Label, MediaBody, MediaFigure, MediaItem, Menu, Message, Multiselect, NextItem, PreviousItem, Select, Separator, Trigger };
|
|
@@ -22,8 +22,7 @@ export interface IAutocompleteProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
22
22
|
/** Defines the icon rendered in the start position */
|
|
23
23
|
start?: any;
|
|
24
24
|
}
|
|
25
|
-
declare const _default: React.FunctionComponent<IAutocompleteProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
25
|
/**
|
|
27
26
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
28
27
|
*/
|
|
29
|
-
export
|
|
28
|
+
export declare const Autocomplete: React.ForwardRefExoticComponent<IAutocompleteProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { HTMLAttributes } from 'react';
|
|
8
8
|
import { VALIDATION } from '../../utils/validation';
|
|
9
|
-
export interface IComboboxProps extends
|
|
9
|
+
export interface IComboboxProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
10
|
/** Applies compact styling */
|
|
11
11
|
isCompact?: boolean;
|
|
12
12
|
/** Removes borders and padding */
|
|
@@ -26,8 +26,7 @@ export interface IComboboxProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
26
26
|
/** Defines the icon rendered in the end position */
|
|
27
27
|
end?: any;
|
|
28
28
|
}
|
|
29
|
-
declare const _default: React.FC<IComboboxProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
29
|
/**
|
|
31
30
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
32
31
|
*/
|
|
33
|
-
export
|
|
32
|
+
export declare const Combobox: React.ForwardRefExoticComponent<IComboboxProps & React.RefAttributes<HTMLDivElement>>;
|