@splunk/react-ui 5.0.0-beta.2 → 5.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +185 -243
- package/Animation.js +2 -2
- package/Button.js +4 -4
- package/ButtonGroup.js +10 -11
- package/ButtonSimple.js +48 -42
- package/CHANGELOG.md +26 -0
- package/CHANGELOG.v5.mdx +81 -0
- package/Calendar.js +352 -469
- package/Card.js +178 -321
- package/Chip.js +154 -296
- package/Clickable.js +30 -30
- package/Code.js +64 -49
- package/Color.js +546 -462
- package/ComboBox.js +575 -767
- package/Date.js +144 -136
- package/Divider.js +29 -26
- package/DualListbox.js +441 -444
- package/File.js +707 -981
- package/FormRows.js +260 -286
- package/Image.js +124 -251
- package/JSONTree.js +129 -129
- package/Layout.d.ts +2 -0
- package/Link.js +12 -12
- package/MIGRATION.mdx +22 -1
- package/MIGRATION.v5.mdx +12 -1
- package/Menu.js +76 -76
- package/Message.js +77 -100
- package/MessageBar.js +141 -251
- package/Modal.js +42 -40
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1989 -2362
- package/NonInteractiveCheckbox.js +30 -118
- package/Number.js +75 -73
- package/Popover.js +348 -350
- package/Progress.js +1 -1
- package/RadioBar.js +136 -136
- package/Resize.js +62 -65
- package/Scroll.js +2 -2
- package/Select.js +281 -283
- package/SidePanel.js +53 -55
- package/Slider.js +370 -364
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +170 -343
- package/StaticContent.js +15 -13
- package/StepBar.js +61 -60
- package/Switch.js +150 -164
- package/TabBar.js +544 -417
- package/Table.js +1711 -1540
- package/Text.js +28 -26
- package/TextArea.js +26 -26
- package/Tooltip.js +416 -562
- package/TransitionOpen.js +179 -158
- package/Tree.d.ts +2 -0
- package/WaitSpinner.js +1 -1
- package/package.json +7 -9
- package/types/src/Accordion/Accordion.d.ts +14 -21
- package/types/src/Accordion/AccordionContext.d.ts +0 -1
- package/types/src/Animation/Animation.d.ts +2 -3
- package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
- package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
- package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
- package/types/src/Button/Button.d.ts +2 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Calendar/Calendar.d.ts +2 -2
- package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
- package/types/src/Calendar/Day.d.ts +8 -4
- package/types/src/Card/Card.d.ts +27 -14
- package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
- package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
- package/types/src/Clickable/Clickable.d.ts +1 -1
- package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
- package/types/src/Color/Color.d.ts +3 -3
- package/types/src/Color/ColorInput.d.ts +27 -0
- package/types/src/Color/Palette.d.ts +11 -18
- package/types/src/Color/Swatch.d.ts +3 -1
- package/types/src/ComboBox/ComboBox.d.ts +46 -50
- package/types/src/ComboBox/Option.d.ts +34 -18
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
- package/types/src/Date/Date.d.ts +3 -2
- package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
- package/types/src/Divider/Divider.d.ts +14 -6
- package/types/src/Divider/docs/examples/Appearance.d.ts +3 -0
- package/types/src/DualListbox/DualListbox.d.ts +5 -1
- package/types/src/File/File.d.ts +6 -6
- package/types/src/File/FileContext.d.ts +0 -1
- package/types/src/File/Item.d.ts +11 -3
- package/types/src/File/ItemIcon.d.ts +7 -0
- package/types/src/File/docs/examples/Disabled.d.ts +2 -2
- package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
- package/types/src/File/docs/examples/Multi.d.ts +2 -2
- package/types/src/File/docs/examples/Single.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +8 -8
- package/types/src/FormRows/FormRowsContext.d.ts +1 -2
- package/types/src/FormRows/Row.d.ts +2 -2
- package/types/src/FormRows/RowInternal.d.ts +1 -1
- package/types/src/FormRows/SortableRow.d.ts +3 -3
- package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
- package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
- package/types/src/Image/Image.d.ts +1 -4
- package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
- package/types/src/Layout/Layout.d.ts +1 -0
- package/types/src/Link/icons/External.d.ts +1 -2
- package/types/src/Menu/Divider.d.ts +1 -1
- package/types/src/Menu/MenuContext.d.ts +0 -1
- package/types/src/MessageBar/MessageBar.d.ts +5 -1
- package/types/src/Modal/ModalContext.d.ts +0 -1
- package/types/src/Multiselect/Compact.d.ts +49 -21
- package/types/src/Multiselect/Multiselect.d.ts +73 -30
- package/types/src/Multiselect/Normal.d.ts +46 -57
- package/types/src/Multiselect/Option.d.ts +42 -18
- package/types/src/Multiselect/docs/examples/Children.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Error.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -2
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +9 -8
- package/types/src/Number/Number.d.ts +1 -0
- package/types/src/Number/docs/examples/Basic.d.ts +2 -2
- package/types/src/Number/docs/examples/Limits.d.ts +2 -2
- package/types/src/Number/docs/examples/Locale.d.ts +2 -2
- package/types/src/Popover/Popover.d.ts +1 -1
- package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
- package/types/src/RadioBar/RadioBar.d.ts +1 -1
- package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
- package/types/src/RadioList/RadioListContext.d.ts +0 -1
- package/types/src/Scroll/Inner.d.ts +1 -1
- package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Search/Search.d.ts +2 -2
- package/types/src/Select/SelectBase.d.ts +2 -2
- package/types/src/SidePanel/SidePanel.d.ts +8 -3
- package/types/src/Slider/Slider.d.ts +1 -1
- package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
- package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
- package/types/src/SlidingPanels/Panel.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
- package/types/src/SplitButton/Item.d.ts +34 -20
- package/types/src/SplitButton/SplitButton.d.ts +4 -1
- package/types/src/StaticContent/StaticContent.d.ts +3 -1
- package/types/src/StepBar/Step.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +1 -1
- package/types/src/StepBar/StepBarContext.d.ts +0 -1
- package/types/src/Switch/Switch.d.ts +1 -9
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
- package/types/src/TabBar/Tab.d.ts +12 -5
- package/types/src/TabBar/TabBar.d.ts +4 -3
- package/types/src/TabBar/TabBarContext.d.ts +7 -2
- package/types/src/Table/Head.d.ts +4 -15
- package/types/src/Table/HeadCell.d.ts +23 -25
- package/types/src/Table/HeadDropdownCell.d.ts +23 -26
- package/types/src/Table/HeadInner.d.ts +4 -10
- package/types/src/Table/Row.d.ts +6 -6
- package/types/src/Table/Table.d.ts +3 -8
- package/types/src/Table/TableContext.d.ts +0 -1
- package/types/src/Table/Toggle.d.ts +1 -1
- package/types/src/Text/Text.d.ts +5 -1
- package/types/src/Tooltip/Tooltip.d.ts +26 -58
- package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
- package/types/src/TransitionOpen/TransitionOpen.d.ts +6 -1
- package/types/src/Tree/TreeContext.d.ts +0 -1
- package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
- package/types/src/utils/types.d.ts +2 -3
- package/useResizeObserver.js +26 -19
- package/types/src/File/Icon.d.ts +0 -3
- package/types/src/File/IconCloud.d.ts +0 -3
- package/types/src/File/PaperClip.d.ts +0 -3
- package/types/src/File/Retry.d.ts +0 -2
- package/types/src/File/Trash.d.ts +0 -3
- package/types/src/FormRows/icons/FormRowsPlusIcon.d.ts +0 -3
- package/types/src/Image/icons/Cross.d.ts +0 -3
- package/types/src/Multiselect/docs/examples/CompactSelectAll.d.ts +0 -3
- package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
- package/types/src/Tooltip/InfoIcon.d.ts +0 -4
package/ComboBox.js
CHANGED
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
9
9
|
/******/ (() => {
|
|
10
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
-
/******/ e.n =
|
|
12
|
-
/******/ var
|
|
13
|
-
/******/ () =>
|
|
14
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = n => {
|
|
12
|
+
/******/ var r = n && n.__esModule ?
|
|
13
|
+
/******/ () => n["default"]
|
|
14
|
+
/******/ : () => n
|
|
15
15
|
/******/;
|
|
16
|
-
e.d(
|
|
17
|
-
a:
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
18
|
});
|
|
19
|
-
/******/ return
|
|
19
|
+
/******/ return r;
|
|
20
20
|
/******/ };
|
|
21
21
|
/******/ })();
|
|
22
22
|
/******/
|
|
23
23
|
/******/ /* webpack/runtime/define property getters */
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/ e.d = (
|
|
27
|
-
/******/ for (var
|
|
28
|
-
/******/ if (e.o(
|
|
29
|
-
/******/ Object.defineProperty(
|
|
26
|
+
/******/ e.d = (n, r) => {
|
|
27
|
+
/******/ for (var t in r) {
|
|
28
|
+
/******/ if (e.o(r, t) && !e.o(n, t)) {
|
|
29
|
+
/******/ Object.defineProperty(n, t, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get:
|
|
31
|
+
get: r[t]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/******/
|
|
38
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
39
|
/******/ (() => {
|
|
40
|
-
/******/ e.o = (e,
|
|
40
|
+
/******/ e.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)
|
|
41
41
|
/******/;
|
|
42
42
|
})();
|
|
43
43
|
/******/
|
|
@@ -56,855 +56,663 @@
|
|
|
56
56
|
/******/ };
|
|
57
57
|
/******/ })();
|
|
58
58
|
/******/
|
|
59
|
-
/************************************************************************/ var
|
|
59
|
+
/************************************************************************/ var n = {};
|
|
60
60
|
// ESM COMPAT FLAG
|
|
61
|
-
e.r(
|
|
61
|
+
e.r(n);
|
|
62
62
|
// EXPORTS
|
|
63
|
-
e.d(
|
|
64
|
-
Divider: () => /* reexport */
|
|
65
|
-
Heading: () => /* reexport */
|
|
66
|
-
Option: () => /* reexport */
|
|
67
|
-
default: () => /* reexport */
|
|
63
|
+
e.d(n, {
|
|
64
|
+
Divider: () => /* reexport */ d.Divider,
|
|
65
|
+
Heading: () => /* reexport */ d.Heading,
|
|
66
|
+
Option: () => /* reexport */ D,
|
|
67
|
+
default: () => /* reexport */ re
|
|
68
68
|
});
|
|
69
69
|
// CONCATENATED MODULE: external "react"
|
|
70
|
-
const
|
|
71
|
-
var
|
|
70
|
+
const r = require("react");
|
|
71
|
+
var t = e.n(r);
|
|
72
72
|
// CONCATENATED MODULE: external "prop-types"
|
|
73
|
-
const
|
|
74
|
-
var
|
|
73
|
+
const o = require("prop-types");
|
|
74
|
+
var a = e.n(o);
|
|
75
75
|
// CONCATENATED MODULE: external "lodash/extend"
|
|
76
|
-
const
|
|
77
|
-
var l = e.n(
|
|
78
|
-
// CONCATENATED MODULE: external "lodash/has"
|
|
79
|
-
const u = require("lodash/has");
|
|
80
|
-
var c = e.n(u);
|
|
76
|
+
const i = require("lodash/extend");
|
|
77
|
+
var l = e.n(i);
|
|
81
78
|
// CONCATENATED MODULE: external "lodash/memoize"
|
|
82
|
-
const
|
|
83
|
-
var
|
|
84
|
-
// CONCATENATED MODULE: external "lodash/omit"
|
|
85
|
-
const f = require("lodash/omit");
|
|
86
|
-
var d = e.n(f);
|
|
87
|
-
// CONCATENATED MODULE: external "lodash/pick"
|
|
88
|
-
const v = require("lodash/pick");
|
|
89
|
-
var b = e.n(v);
|
|
79
|
+
const u = require("lodash/memoize");
|
|
80
|
+
var c = e.n(u);
|
|
90
81
|
// CONCATENATED MODULE: external "lodash/some"
|
|
91
|
-
const
|
|
92
|
-
var
|
|
93
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
94
|
-
const m = require("@splunk/ui-utils/filter");
|
|
95
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
96
|
-
const g = require("@splunk/ui-utils/id");
|
|
97
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
98
|
-
const O = require("@splunk/ui-utils/i18n");
|
|
99
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
100
|
-
const w = require("@splunk/ui-utils/keyboard");
|
|
82
|
+
const s = require("lodash/some");
|
|
83
|
+
var f = e.n(s);
|
|
101
84
|
// CONCATENATED MODULE: external "@splunk/react-ui/Menu"
|
|
102
|
-
const
|
|
85
|
+
const d = require("@splunk/react-ui/Menu");
|
|
103
86
|
// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
|
|
104
|
-
const
|
|
105
|
-
var
|
|
87
|
+
const p = require("@splunk/react-ui/Popover");
|
|
88
|
+
var v = e.n(p);
|
|
106
89
|
// CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
107
|
-
const
|
|
108
|
-
var
|
|
90
|
+
const b = require("@splunk/react-ui/ResultsMenu");
|
|
91
|
+
var m = e.n(b);
|
|
109
92
|
// CONCATENATED MODULE: external "@splunk/react-ui/Text"
|
|
110
|
-
const
|
|
111
|
-
var
|
|
112
|
-
// CONCATENATED MODULE:
|
|
113
|
-
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
93
|
+
const y = require("@splunk/react-ui/Text");
|
|
94
|
+
var g = e.n(y);
|
|
95
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
|
|
96
|
+
const h = require("@splunk/react-ui/useControlled");
|
|
97
|
+
var O = e.n(h);
|
|
98
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
|
|
99
|
+
const S = require("@splunk/react-ui/usePrevious");
|
|
100
|
+
var C = e.n(S);
|
|
101
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/filter"
|
|
102
|
+
const k = require("@splunk/ui-utils/filter");
|
|
103
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
104
|
+
const P = require("@splunk/ui-utils/i18n");
|
|
105
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
106
|
+
const w = require("@splunk/ui-utils/id");
|
|
107
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
108
|
+
const j = require("@splunk/ui-utils/keyboard");
|
|
109
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
110
|
+
/**
|
|
111
|
+
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
112
|
+
*
|
|
113
|
+
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
114
|
+
* @param current - The new value of the ref.
|
|
115
|
+
*/
|
|
116
|
+
function R(e, n) {
|
|
117
|
+
if (e) {
|
|
118
|
+
if (typeof e === "function") {
|
|
119
|
+
e(n);
|
|
120
|
+
} else {
|
|
121
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
122
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
123
|
+
e.current = n;
|
|
124
|
+
// eslint-disable-line no-param-reassign
|
|
125
|
+
}
|
|
128
126
|
}
|
|
129
|
-
};
|
|
130
|
-
// CONCATENATED MODULE: ./src/ComboBox/Option.tsx
|
|
131
|
-
function E(e) {
|
|
132
|
-
"@babel/helpers - typeof";
|
|
133
|
-
return E = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
134
|
-
return typeof e;
|
|
135
|
-
} : function(e) {
|
|
136
|
-
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
137
|
-
}, E(e);
|
|
138
127
|
}
|
|
128
|
+
// CONCATENATED MODULE: ./src/ComboBox/Option.tsx
|
|
139
129
|
function M() {
|
|
140
130
|
return M = Object.assign ? Object.assign.bind() : function(e) {
|
|
141
|
-
for (var
|
|
142
|
-
var
|
|
143
|
-
for (var
|
|
144
|
-
({}).hasOwnProperty.call(
|
|
131
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
132
|
+
var r = arguments[n];
|
|
133
|
+
for (var t in r) {
|
|
134
|
+
({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
145
135
|
}
|
|
146
136
|
}
|
|
147
137
|
return e;
|
|
148
138
|
}, M.apply(null, arguments);
|
|
149
139
|
}
|
|
150
|
-
function
|
|
140
|
+
function q(e, n) {
|
|
151
141
|
if (null == e) return {};
|
|
152
|
-
var
|
|
142
|
+
var r, t, o = E(e, n);
|
|
153
143
|
if (Object.getOwnPropertySymbols) {
|
|
154
|
-
var
|
|
155
|
-
for (
|
|
156
|
-
|
|
144
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
145
|
+
for (t = 0; t < a.length; t++) {
|
|
146
|
+
r = a[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
157
147
|
}
|
|
158
148
|
}
|
|
159
|
-
return
|
|
149
|
+
return o;
|
|
160
150
|
}
|
|
161
|
-
function
|
|
151
|
+
function E(e, n) {
|
|
162
152
|
if (null == e) return {};
|
|
163
|
-
var
|
|
164
|
-
for (var
|
|
165
|
-
if ({}.hasOwnProperty.call(e,
|
|
166
|
-
if (
|
|
167
|
-
|
|
153
|
+
var r = {};
|
|
154
|
+
for (var t in e) {
|
|
155
|
+
if ({}.hasOwnProperty.call(e, t)) {
|
|
156
|
+
if (n.includes(t)) continue;
|
|
157
|
+
r[t] = e[t];
|
|
168
158
|
}
|
|
169
159
|
}
|
|
170
|
-
return
|
|
171
|
-
}
|
|
172
|
-
function D(e, t) {
|
|
173
|
-
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
174
|
-
}
|
|
175
|
-
function q(e, t) {
|
|
176
|
-
for (var n = 0; n < t.length; n++) {
|
|
177
|
-
var o = t[n];
|
|
178
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),
|
|
179
|
-
Object.defineProperty(e, W(o.key), o);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function _(e, t, n) {
|
|
183
|
-
return t && q(e.prototype, t), n && q(e, n), Object.defineProperty(e, "prototype", {
|
|
184
|
-
writable: !1
|
|
185
|
-
}), e;
|
|
186
|
-
}
|
|
187
|
-
function B(e, t) {
|
|
188
|
-
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
189
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
190
|
-
constructor: {
|
|
191
|
-
value: e,
|
|
192
|
-
writable: !0,
|
|
193
|
-
configurable: !0
|
|
194
|
-
}
|
|
195
|
-
}), Object.defineProperty(e, "prototype", {
|
|
196
|
-
writable: !1
|
|
197
|
-
}), t && A(e, t);
|
|
198
|
-
}
|
|
199
|
-
function A(e, t) {
|
|
200
|
-
return A = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
201
|
-
return e.__proto__ = t, e;
|
|
202
|
-
}, A(e, t);
|
|
203
|
-
}
|
|
204
|
-
function H(e) {
|
|
205
|
-
var t = K();
|
|
206
|
-
return function() {
|
|
207
|
-
var n, o = N(e);
|
|
208
|
-
if (t) {
|
|
209
|
-
var r = N(this).constructor;
|
|
210
|
-
n = Reflect.construct(o, arguments, r);
|
|
211
|
-
} else n = o.apply(this, arguments);
|
|
212
|
-
return L(this, n);
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function L(e, t) {
|
|
216
|
-
if (t && ("object" == E(t) || "function" == typeof t)) return t;
|
|
217
|
-
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
218
|
-
return F(e);
|
|
219
|
-
}
|
|
220
|
-
function F(e) {
|
|
221
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
222
|
-
return e;
|
|
223
|
-
}
|
|
224
|
-
function K() {
|
|
225
|
-
try {
|
|
226
|
-
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
227
|
-
} catch (e) {}
|
|
228
|
-
return (K = function t() {
|
|
229
|
-
return !!e;
|
|
230
|
-
})();
|
|
231
|
-
}
|
|
232
|
-
function N(e) {
|
|
233
|
-
return N = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
234
|
-
return e.__proto__ || Object.getPrototypeOf(e);
|
|
235
|
-
}, N(e);
|
|
236
|
-
}
|
|
237
|
-
function z(e, t, n) {
|
|
238
|
-
return (t = W(t)) in e ? Object.defineProperty(e, t, {
|
|
239
|
-
value: n,
|
|
240
|
-
enumerable: !0,
|
|
241
|
-
configurable: !0,
|
|
242
|
-
writable: !0
|
|
243
|
-
}) : e[t] = n, e;
|
|
244
|
-
}
|
|
245
|
-
function W(e) {
|
|
246
|
-
var t = U(e, "string");
|
|
247
|
-
return "symbol" == E(t) ? t : t + "";
|
|
248
|
-
}
|
|
249
|
-
function U(e, t) {
|
|
250
|
-
if ("object" != E(e) || !e) return e;
|
|
251
|
-
var n = e[Symbol.toPrimitive];
|
|
252
|
-
if (void 0 !== n) {
|
|
253
|
-
var o = n.call(e, t || "default");
|
|
254
|
-
if ("object" != E(o)) return o;
|
|
255
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
256
|
-
}
|
|
257
|
-
return ("string" === t ? String : Number)(e);
|
|
160
|
+
return r;
|
|
258
161
|
}
|
|
259
|
-
var
|
|
162
|
+
var T = {
|
|
260
163
|
/** @private */
|
|
261
|
-
active:
|
|
262
|
-
description:
|
|
263
|
-
descriptionPosition:
|
|
264
|
-
disabled:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
164
|
+
active: a().bool,
|
|
165
|
+
description: a().string,
|
|
166
|
+
descriptionPosition: a().oneOf([ "right", "bottom" ]),
|
|
167
|
+
disabled: a().bool,
|
|
168
|
+
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
169
|
+
icon: a().node,
|
|
170
|
+
label: a().string,
|
|
171
|
+
matchRanges: a().arrayOf(a().shape({
|
|
172
|
+
start: a().number.isRequired,
|
|
173
|
+
end: a().number.isRequired
|
|
270
174
|
})),
|
|
271
175
|
/** @private */
|
|
272
|
-
onClick:
|
|
273
|
-
truncate:
|
|
274
|
-
value:
|
|
275
|
-
};
|
|
276
|
-
var Y = {
|
|
277
|
-
active: false,
|
|
278
|
-
descriptionPosition: "bottom",
|
|
279
|
-
disabled: false,
|
|
280
|
-
truncate: false
|
|
176
|
+
onClick: a().func,
|
|
177
|
+
truncate: a().bool,
|
|
178
|
+
value: a().string.isRequired
|
|
281
179
|
};
|
|
282
180
|
/**
|
|
283
|
-
* An option within a `ComboBox`.
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
for (var r = arguments.length, i = new Array(r), a = 0; a < r; a++) {
|
|
293
|
-
i[a] = arguments[a];
|
|
181
|
+
* An option within a `ComboBox`.
|
|
182
|
+
*/ function B(e) {
|
|
183
|
+
var n = e.active, o = e.description, a = e.descriptionPosition, i = a === void 0 ? "bottom" : a, l = e.disabled, u = e.elementRef, c = e.icon, s = e.label, f = e.matchRanges, p = e.onClick, v = e.truncate, b = e.value, m = q(e, [ "active", "description", "descriptionPosition", "disabled", "elementRef", "icon", "label", "matchRanges", "onClick", "truncate", "value" ]);
|
|
184
|
+
// @docs-props-type OptionPropsBase
|
|
185
|
+
var y = (0, r.useCallback)((function(e) {
|
|
186
|
+
if (!l) {
|
|
187
|
+
p === null || p === void 0 ? void 0 : p(e, {
|
|
188
|
+
value: b
|
|
189
|
+
});
|
|
294
190
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
191
|
+
}), [ l, p, b ]);
|
|
192
|
+
var g = (0, r.useCallback)((function(e) {
|
|
193
|
+
R(u, e);
|
|
194
|
+
}), [ u ]);
|
|
195
|
+
var h = s === undefined ? b : s;
|
|
196
|
+
|
|
197
|
+
return t().createElement(d.Item, M({
|
|
198
|
+
active: n,
|
|
199
|
+
"data-test": "option",
|
|
200
|
+
"data-test-value": b,
|
|
201
|
+
description: o,
|
|
202
|
+
descriptionPosition: i,
|
|
203
|
+
disabled: l,
|
|
204
|
+
elementRef: g,
|
|
205
|
+
startAdornment: c,
|
|
206
|
+
matchRanges: f,
|
|
207
|
+
onClick: y,
|
|
208
|
+
truncate: v
|
|
209
|
+
}, m, {
|
|
210
|
+
role: "option"
|
|
211
|
+
}), h);
|
|
212
|
+
}
|
|
213
|
+
B.propTypes = T;
|
|
214
|
+
B.as = "Item";
|
|
215
|
+
/* harmony default export */ const D = B;
|
|
216
|
+
// CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
|
|
217
|
+
// A utility that attempts to move an element into view by scrolling it's derived parent.
|
|
218
|
+
var x = function e(n) {
|
|
219
|
+
if (!n) {
|
|
220
|
+
return;
|
|
306
221
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
311
|
-
value: function e() {
|
|
312
|
-
R(this.itemRef.current);
|
|
313
|
-
}
|
|
314
|
-
}, {
|
|
315
|
-
key: "render",
|
|
316
|
-
value: function e() {
|
|
317
|
-
// eslint-disable-next-line no-unused-vars
|
|
318
|
-
var t = this.props, n = t.value, r = t.label, i = V(t, [ "value", "label" ]);
|
|
319
|
-
var a = r === undefined ? n : r;
|
|
320
|
-
|
|
321
|
-
return o().createElement(S.Item, M({
|
|
322
|
-
elementRef: this.itemRef,
|
|
323
|
-
"data-test": "option",
|
|
324
|
-
"data-test-value": n
|
|
325
|
-
}, i, {
|
|
326
|
-
onClick: this.handleClick,
|
|
327
|
-
role: "option"
|
|
328
|
-
}), a);
|
|
329
|
-
}
|
|
330
|
-
} ]);
|
|
331
|
-
return n;
|
|
332
|
-
}(n.PureComponent);
|
|
333
|
-
z(G, "propTypes", X);
|
|
334
|
-
z(G, "defaultProps", Y);
|
|
335
|
-
/* harmony default export */ const J = G;
|
|
336
|
-
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
337
|
-
/**
|
|
338
|
-
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
339
|
-
*
|
|
340
|
-
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
341
|
-
* @param current - The new value of the ref.
|
|
342
|
-
*/
|
|
343
|
-
function Q(e, t) {
|
|
344
|
-
if (e) {
|
|
345
|
-
if (typeof e === "function") {
|
|
346
|
-
e(t);
|
|
347
|
-
} else {
|
|
348
|
-
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
349
|
-
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
350
|
-
e.current = t;
|
|
351
|
-
// eslint-disable-line no-param-reassign
|
|
352
|
-
}
|
|
222
|
+
var r = n.offsetParent;
|
|
223
|
+
if (!r) {
|
|
224
|
+
return;
|
|
353
225
|
}
|
|
354
|
-
|
|
226
|
+
// Below the bottom of the container.
|
|
227
|
+
if (r.scrollTop + r.clientHeight < n.offsetTop + n.clientHeight) {
|
|
228
|
+
r.scrollTop = n.offsetTop + n.clientHeight - r.clientHeight;
|
|
229
|
+
// Above the top of the container.
|
|
230
|
+
} else if (r.scrollTop > n.offsetTop) {
|
|
231
|
+
r.scrollTop = n.offsetTop;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
355
234
|
// CONCATENATED MODULE: ./src/ComboBox/ComboBox.tsx
|
|
356
|
-
function
|
|
235
|
+
function I(e) {
|
|
357
236
|
"@babel/helpers - typeof";
|
|
358
|
-
return
|
|
237
|
+
return I = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
359
238
|
return typeof e;
|
|
360
239
|
} : function(e) {
|
|
361
240
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
362
|
-
},
|
|
363
|
-
}
|
|
364
|
-
function
|
|
365
|
-
return
|
|
366
|
-
for (var
|
|
367
|
-
var
|
|
368
|
-
for (var
|
|
369
|
-
({}).hasOwnProperty.call(
|
|
241
|
+
}, I(e);
|
|
242
|
+
}
|
|
243
|
+
function A() {
|
|
244
|
+
return A = Object.assign ? Object.assign.bind() : function(e) {
|
|
245
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
246
|
+
var r = arguments[n];
|
|
247
|
+
for (var t in r) {
|
|
248
|
+
({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
370
249
|
}
|
|
371
250
|
}
|
|
372
251
|
return e;
|
|
373
|
-
},
|
|
252
|
+
}, A.apply(null, arguments);
|
|
374
253
|
}
|
|
375
|
-
function
|
|
376
|
-
var
|
|
254
|
+
function H(e, n) {
|
|
255
|
+
var r = Object.keys(e);
|
|
377
256
|
if (Object.getOwnPropertySymbols) {
|
|
378
|
-
var
|
|
379
|
-
|
|
380
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
381
|
-
}))),
|
|
257
|
+
var t = Object.getOwnPropertySymbols(e);
|
|
258
|
+
n && (t = t.filter((function(n) {
|
|
259
|
+
return Object.getOwnPropertyDescriptor(e, n).enumerable;
|
|
260
|
+
}))), r.push.apply(r, t);
|
|
382
261
|
}
|
|
383
|
-
return
|
|
262
|
+
return r;
|
|
384
263
|
}
|
|
385
|
-
function
|
|
386
|
-
for (var
|
|
387
|
-
var
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
391
|
-
Object.defineProperty(e,
|
|
264
|
+
function L(e) {
|
|
265
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
266
|
+
var r = null != arguments[n] ? arguments[n] : {};
|
|
267
|
+
n % 2 ? H(Object(r), !0).forEach((function(n) {
|
|
268
|
+
z(e, n, r[n]);
|
|
269
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : H(Object(r)).forEach((function(n) {
|
|
270
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
392
271
|
}));
|
|
393
272
|
}
|
|
394
273
|
return e;
|
|
395
274
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
275
|
+
function z(e, n, r) {
|
|
276
|
+
return (n = F(n)) in e ? Object.defineProperty(e, n, {
|
|
277
|
+
value: r,
|
|
278
|
+
enumerable: !0,
|
|
279
|
+
configurable: !0,
|
|
280
|
+
writable: !0
|
|
281
|
+
}) : e[n] = r, e;
|
|
398
282
|
}
|
|
399
|
-
function
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
283
|
+
function F(e) {
|
|
284
|
+
var n = V(e, "string");
|
|
285
|
+
return "symbol" == I(n) ? n : n + "";
|
|
286
|
+
}
|
|
287
|
+
function V(e, n) {
|
|
288
|
+
if ("object" != I(e) || !e) return e;
|
|
289
|
+
var r = e[Symbol.toPrimitive];
|
|
290
|
+
if (void 0 !== r) {
|
|
291
|
+
var t = r.call(e, n || "default");
|
|
292
|
+
if ("object" != I(t)) return t;
|
|
293
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
404
294
|
}
|
|
295
|
+
return ("string" === n ? String : Number)(e);
|
|
405
296
|
}
|
|
406
|
-
function
|
|
407
|
-
return
|
|
408
|
-
writable: !1
|
|
409
|
-
}), e;
|
|
297
|
+
function K(e, n) {
|
|
298
|
+
return X(e) || U(e, n) || W(e, n) || _();
|
|
410
299
|
}
|
|
411
|
-
function
|
|
412
|
-
|
|
413
|
-
e.prototype = Object.create(t && t.prototype, {
|
|
414
|
-
constructor: {
|
|
415
|
-
value: e,
|
|
416
|
-
writable: !0,
|
|
417
|
-
configurable: !0
|
|
418
|
-
}
|
|
419
|
-
}), Object.defineProperty(e, "prototype", {
|
|
420
|
-
writable: !1
|
|
421
|
-
}), t && ae(e, t);
|
|
422
|
-
}
|
|
423
|
-
function ae(e, t) {
|
|
424
|
-
return ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
425
|
-
return e.__proto__ = t, e;
|
|
426
|
-
}, ae(e, t);
|
|
427
|
-
}
|
|
428
|
-
function le(e) {
|
|
429
|
-
var t = se();
|
|
430
|
-
return function() {
|
|
431
|
-
var n, o = pe(e);
|
|
432
|
-
if (t) {
|
|
433
|
-
var r = pe(this).constructor;
|
|
434
|
-
n = Reflect.construct(o, arguments, r);
|
|
435
|
-
} else n = o.apply(this, arguments);
|
|
436
|
-
return ue(this, n);
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
function ue(e, t) {
|
|
440
|
-
if (t && ("object" == Z(t) || "function" == typeof t)) return t;
|
|
441
|
-
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
442
|
-
return ce(e);
|
|
443
|
-
}
|
|
444
|
-
function ce(e) {
|
|
445
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
446
|
-
return e;
|
|
300
|
+
function _() {
|
|
301
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
447
302
|
}
|
|
448
|
-
function
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
})();
|
|
303
|
+
function W(e, n) {
|
|
304
|
+
if (e) {
|
|
305
|
+
if ("string" == typeof e) return N(e, n);
|
|
306
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
307
|
+
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? N(e, n) : void 0;
|
|
308
|
+
}
|
|
455
309
|
}
|
|
456
|
-
function
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
310
|
+
function N(e, n) {
|
|
311
|
+
(null == n || n > e.length) && (n = e.length);
|
|
312
|
+
for (var r = 0, t = Array(n); r < n; r++) {
|
|
313
|
+
t[r] = e[r];
|
|
314
|
+
}
|
|
315
|
+
return t;
|
|
316
|
+
}
|
|
317
|
+
function U(e, n) {
|
|
318
|
+
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
319
|
+
if (null != r) {
|
|
320
|
+
var t, o, a, i, l = [], u = !0, c = !1;
|
|
321
|
+
try {
|
|
322
|
+
if (a = (r = r.call(e)).next, 0 === n) {
|
|
323
|
+
if (Object(r) !== r) return;
|
|
324
|
+
u = !1;
|
|
325
|
+
} else for (;!(u = (t = a.call(r)).done) && (l.push(t.value), l.length !== n); u = !0) {
|
|
326
|
+
}
|
|
327
|
+
} catch (e) {
|
|
328
|
+
c = !0, o = e;
|
|
329
|
+
} finally {
|
|
330
|
+
try {
|
|
331
|
+
if (!u && null != r["return"] && (i = r["return"](), Object(i) !== i)) return;
|
|
332
|
+
} finally {
|
|
333
|
+
if (c) throw o;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return l;
|
|
337
|
+
}
|
|
460
338
|
}
|
|
461
|
-
function
|
|
462
|
-
|
|
463
|
-
value: n,
|
|
464
|
-
enumerable: !0,
|
|
465
|
-
configurable: !0,
|
|
466
|
-
writable: !0
|
|
467
|
-
}) : e[t] = n, e;
|
|
339
|
+
function X(e) {
|
|
340
|
+
if (Array.isArray(e)) return e;
|
|
468
341
|
}
|
|
469
|
-
function
|
|
470
|
-
|
|
471
|
-
|
|
342
|
+
function Y(e, n) {
|
|
343
|
+
if (null == e) return {};
|
|
344
|
+
var r, t, o = $(e, n);
|
|
345
|
+
if (Object.getOwnPropertySymbols) {
|
|
346
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
347
|
+
for (t = 0; t < a.length; t++) {
|
|
348
|
+
r = a[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return o;
|
|
472
352
|
}
|
|
473
|
-
function
|
|
474
|
-
if (
|
|
475
|
-
var
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
353
|
+
function $(e, n) {
|
|
354
|
+
if (null == e) return {};
|
|
355
|
+
var r = {};
|
|
356
|
+
for (var t in e) {
|
|
357
|
+
if ({}.hasOwnProperty.call(e, t)) {
|
|
358
|
+
if (n.includes(t)) continue;
|
|
359
|
+
r[t] = e[t];
|
|
360
|
+
}
|
|
480
361
|
}
|
|
481
|
-
return
|
|
362
|
+
return r;
|
|
482
363
|
}
|
|
483
364
|
/** @public */
|
|
484
365
|
/** @public */
|
|
485
366
|
/** @public */
|
|
486
|
-
/** @public */ var
|
|
487
|
-
animateLoading:
|
|
488
|
-
append:
|
|
489
|
-
children:
|
|
490
|
-
controlledFilter:
|
|
491
|
-
defaultPlacement:
|
|
492
|
-
defaultValue:
|
|
493
|
-
describedBy:
|
|
494
|
-
disabled:
|
|
495
|
-
elementRef:
|
|
496
|
-
error:
|
|
497
|
-
footerMessage:
|
|
498
|
-
inline:
|
|
499
|
-
inputId:
|
|
500
|
-
inputRef:
|
|
501
|
-
isLoadingOptions:
|
|
502
|
-
labelledBy:
|
|
503
|
-
loadingMessage:
|
|
504
|
-
menuStyle:
|
|
505
|
-
name:
|
|
506
|
-
noOptionsMessage:
|
|
507
|
-
onBlur:
|
|
508
|
-
onChange:
|
|
509
|
-
onClose:
|
|
510
|
-
onFocus:
|
|
511
|
-
onKeyDown:
|
|
512
|
-
onOpen:
|
|
513
|
-
onScroll:
|
|
514
|
-
onScrollBottom:
|
|
515
|
-
onSelect:
|
|
516
|
-
placeholder:
|
|
517
|
-
prepend:
|
|
518
|
-
value:
|
|
367
|
+
/** @public */ var G = {
|
|
368
|
+
animateLoading: a().bool,
|
|
369
|
+
append: a().bool,
|
|
370
|
+
children: a().node,
|
|
371
|
+
controlledFilter: a().bool,
|
|
372
|
+
defaultPlacement: a().oneOf([ "above", "below", "vertical" ]),
|
|
373
|
+
defaultValue: a().string,
|
|
374
|
+
describedBy: a().string,
|
|
375
|
+
disabled: a().bool,
|
|
376
|
+
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
377
|
+
error: a().bool,
|
|
378
|
+
footerMessage: a().node,
|
|
379
|
+
inline: a().bool,
|
|
380
|
+
inputId: a().string,
|
|
381
|
+
inputRef: a().oneOfType([ a().func, a().object ]),
|
|
382
|
+
isLoadingOptions: a().bool,
|
|
383
|
+
labelledBy: a().string,
|
|
384
|
+
loadingMessage: a().node,
|
|
385
|
+
menuStyle: a().object,
|
|
386
|
+
name: a().string,
|
|
387
|
+
noOptionsMessage: a().node,
|
|
388
|
+
onBlur: a().func,
|
|
389
|
+
onChange: a().func,
|
|
390
|
+
onClose: a().func,
|
|
391
|
+
onFocus: a().func,
|
|
392
|
+
onKeyDown: a().func,
|
|
393
|
+
onOpen: a().func,
|
|
394
|
+
onScroll: a().func,
|
|
395
|
+
onScrollBottom: a().func,
|
|
396
|
+
onSelect: a().func,
|
|
397
|
+
placeholder: a().string,
|
|
398
|
+
prepend: a().bool,
|
|
399
|
+
value: a().string,
|
|
519
400
|
/** @private. */
|
|
520
|
-
virtualization:
|
|
521
|
-
};
|
|
522
|
-
var he = {
|
|
523
|
-
animateLoading: false,
|
|
524
|
-
controlledFilter: false,
|
|
525
|
-
defaultPlacement: "vertical",
|
|
526
|
-
disabled: false,
|
|
527
|
-
error: false,
|
|
528
|
-
inline: false,
|
|
529
|
-
isLoadingOptions: false,
|
|
530
|
-
menuStyle: {},
|
|
531
|
-
placeholder: (0, O._)("Select...")
|
|
401
|
+
virtualization: a().number
|
|
532
402
|
};
|
|
533
|
-
function
|
|
534
|
-
var
|
|
535
|
-
var
|
|
536
|
-
return
|
|
403
|
+
function J(e, n) {
|
|
404
|
+
var r = n.clientX, t = n.clientY;
|
|
405
|
+
var o = e.getBoundingClientRect(), a = o.top, i = o.left, l = o.bottom, u = o.right;
|
|
406
|
+
return r > i && r < u && t > a && t < l;
|
|
537
407
|
}
|
|
538
|
-
var
|
|
539
|
-
var
|
|
408
|
+
var Q = c()((function(e) {
|
|
409
|
+
var n = e.anchorWidth, r = e.maxHeight, t = e.menuStyle;
|
|
540
410
|
return l()({
|
|
541
|
-
maxHeight:
|
|
411
|
+
maxHeight: r,
|
|
542
412
|
overflow: "auto",
|
|
543
|
-
width: Math.max(
|
|
544
|
-
},
|
|
413
|
+
width: Math.max(n !== null && n !== void 0 ? n : 0, 200)
|
|
414
|
+
}, t);
|
|
545
415
|
}));
|
|
416
|
+
var Z = {};
|
|
417
|
+
var ee = (0, P._)("Select...");
|
|
546
418
|
/**
|
|
547
419
|
* `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
|
|
548
420
|
* and `Multiselect`, `Option` value must always be a string.
|
|
549
|
-
*/
|
|
550
|
-
ie(
|
|
551
|
-
var t = le(r);
|
|
421
|
+
*/ function ne(e) {
|
|
422
|
+
var n = e.animateLoading, o = e.append, a = e.children, i = e.controlledFilter, l = e.defaultPlacement, u = l === void 0 ? "vertical" : l, c = e.defaultValue, s = e.describedBy, d = e.disabled, p = e.elementRef, y = e.error, h = e.footerMessage, S = e.inline, M = e.inputId, q = e.inputRef, E = e.isLoadingOptions, T = e.labelledBy, B = e.loadingMessage, I = e.menuStyle, H = I === void 0 ? Z : I, z = e.name, F = e.noOptionsMessage, V = e.onBlur, _ = e.onChange, W = e.onClose, N = e.onFocus, U = e.onKeyDown, X = e.onOpen, $ = e.onScroll, G = e.onScrollBottom, ne = e.onSelect, re = e.placeholder, te = re === void 0 ? ee : re, oe = e.prepend, ae = e.value, ie = e.virtualization, le = Y(e, [ "animateLoading", "append", "children", "controlledFilter", "defaultPlacement", "defaultValue", "describedBy", "disabled", "elementRef", "error", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onBlur", "onChange", "onClose", "onFocus", "onKeyDown", "onOpen", "onScroll", "onScrollBottom", "onSelect", "placeholder", "prepend", "value", "virtualization" ]);
|
|
552
423
|
// @docs-props-type ComboBoxPropsBase
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
424
|
+
var ue = O()({
|
|
425
|
+
componentName: "ComboBox",
|
|
426
|
+
/* eslint-disable-next-line prefer-rest-params */
|
|
427
|
+
componentProps: arguments[0]
|
|
428
|
+
});
|
|
429
|
+
var ce = (0, r.useState)(0), se = K(ce, 2), fe = se[0], de = se[1];
|
|
430
|
+
var pe = (0, r.useState)(null), ve = K(pe, 2), be = ve[0], me = ve[1];
|
|
431
|
+
var ye = (0, r.useState)(false), ge = K(ye, 2), he = ge[0], Oe = ge[1];
|
|
432
|
+
var Se = (0, r.useState)(null), Ce = K(Se, 2), ke = Ce[0], Pe = Ce[1];
|
|
433
|
+
var we = (0, r.useState)(), je = K(we, 2), Re = je[0], Me = je[1];
|
|
434
|
+
var qe = (0, r.useState)(c || ""), Ee = K(qe, 2), Te = Ee[0], Be = Ee[1];
|
|
435
|
+
var De = C()(fe);
|
|
436
|
+
var xe = (0, r.useRef)();
|
|
437
|
+
var Ie = (0, r.useRef)(0);
|
|
438
|
+
var Ae = (0, r.useRef)(De);
|
|
439
|
+
var He = (0, w.createDOMID)("popover");
|
|
440
|
+
var Le = (0, w.createDOMID)("active-item");
|
|
441
|
+
var ze = (0, r.useCallback)((function() {
|
|
442
|
+
Oe(false);
|
|
443
|
+
Ae.current = null;
|
|
444
|
+
W === null || W === void 0 ? void 0 : W();
|
|
445
|
+
}), [ W ]);
|
|
446
|
+
var Fe = (0, r.useCallback)((function() {
|
|
447
|
+
if (!he) {
|
|
448
|
+
Oe(true);
|
|
449
|
+
de(0);
|
|
450
|
+
X === null || X === void 0 ? void 0 : X();
|
|
451
|
+
}
|
|
452
|
+
}), [ he, X ]);
|
|
453
|
+
var Ve = (0, r.useCallback)((function() {
|
|
454
|
+
return ue ? ae : Te;
|
|
455
|
+
}), [ ue, ae, Te ]);
|
|
456
|
+
var Ke = (0, r.useCallback)((function() {
|
|
457
|
+
var e = Ve();
|
|
458
|
+
var n = r.Children.toArray(a).filter(r.isValidElement);
|
|
459
|
+
var t = !Re && n.find((function(n) {
|
|
460
|
+
return n.props.label !== undefined && n.props.value === e;
|
|
568
461
|
}));
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
462
|
+
if (t) {
|
|
463
|
+
return t === null || t === void 0 ? void 0 : t.props.label;
|
|
464
|
+
}
|
|
465
|
+
return e;
|
|
466
|
+
}), [ a, Ve, Re ]);
|
|
467
|
+
var _e = (0, r.useCallback)((function(e) {
|
|
468
|
+
Pe(e);
|
|
469
|
+
R(q, e);
|
|
470
|
+
}), [ q ]);
|
|
471
|
+
var We = (0, r.useCallback)((function(e) {
|
|
472
|
+
me(e);
|
|
473
|
+
R(p, e);
|
|
474
|
+
}), [ p ]);
|
|
475
|
+
var Ne = (0, r.useCallback)((function(e) {
|
|
476
|
+
if (Ae.current !== fe) {
|
|
477
|
+
x(e);
|
|
478
|
+
}
|
|
479
|
+
}), [ fe, Ae ]);
|
|
480
|
+
var Ue = (0, r.useCallback)((function(e, n) {
|
|
481
|
+
Fe();
|
|
482
|
+
N === null || N === void 0 ? void 0 : N(e, n);
|
|
483
|
+
}), [ N, Fe ]);
|
|
484
|
+
var Xe = (0, r.useCallback)((function(e, n) {
|
|
485
|
+
var r = n.value, t = n.selectedOption;
|
|
486
|
+
e.stopPropagation();
|
|
487
|
+
var o = t ? undefined : r;
|
|
488
|
+
de(0);
|
|
489
|
+
Me(o);
|
|
490
|
+
if (!ue) {
|
|
491
|
+
Be(r);
|
|
492
|
+
}
|
|
493
|
+
_ === null || _ === void 0 ? void 0 : _(e, {
|
|
494
|
+
value: r,
|
|
495
|
+
name: z
|
|
496
|
+
});
|
|
497
|
+
}), [ ue, z, _ ]);
|
|
498
|
+
var Ye = (0, r.useCallback)((function(e, n) {
|
|
499
|
+
Xe(e, L(L({}, n), {}, {
|
|
500
|
+
selectedOption: true
|
|
574
501
|
}));
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
502
|
+
ke === null || ke === void 0 ? void 0 : ke.focus();
|
|
503
|
+
ze();
|
|
504
|
+
}), [ ze, Xe, ke ]);
|
|
505
|
+
var $e = (0, r.useCallback)((function(e) {
|
|
506
|
+
e.stopPropagation();
|
|
507
|
+
if (!d) {
|
|
508
|
+
Fe();
|
|
509
|
+
}
|
|
510
|
+
}), [ d, Fe ]);
|
|
511
|
+
var Ge = (0, r.useCallback)((function(e) {
|
|
512
|
+
var n = e.event, r = e.reason;
|
|
513
|
+
var t = r === "offScreen" || r === "escapeKey" || r === "clickAway" && be && !J(be, n);
|
|
514
|
+
if (t) {
|
|
515
|
+
ze();
|
|
516
|
+
}
|
|
517
|
+
}), [ be, ze ]);
|
|
518
|
+
var Je = (0, r.useCallback)((function(e) {
|
|
519
|
+
if (he && !E) {
|
|
520
|
+
G === null || G === void 0 ? void 0 : G(e);
|
|
521
|
+
}
|
|
522
|
+
}), [ E, he, G ]);
|
|
523
|
+
var Qe = (0, r.useMemo)((function() {
|
|
524
|
+
var e = Ve();
|
|
525
|
+
var n = r.Children.toArray(a).filter(r.isValidElement);
|
|
526
|
+
var o = f()(n, (function(n) {
|
|
527
|
+
if (n.props.label === undefined) {
|
|
528
|
+
return n.props.value === e;
|
|
578
529
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
var n, o;
|
|
582
|
-
i.open();
|
|
583
|
-
(n = (o = i.props).onFocus) === null || n === void 0 ? void 0 : n.call(o, e, t);
|
|
584
|
-
}));
|
|
585
|
-
fe(ce(i), "handleChange", (function(e, t) {
|
|
586
|
-
var n, o;
|
|
587
|
-
var r = t.value, a = t.selectedOption;
|
|
588
|
-
e.stopPropagation();
|
|
589
|
-
var l = i.props.name;
|
|
590
|
-
var u = a ? undefined : r;
|
|
591
|
-
if (i.isControlled()) {
|
|
592
|
-
i.setState({
|
|
593
|
-
activeIndex: 0,
|
|
594
|
-
typedValue: u
|
|
595
|
-
});
|
|
596
|
-
} else {
|
|
597
|
-
i.setState({
|
|
598
|
-
value: r,
|
|
599
|
-
activeIndex: 0,
|
|
600
|
-
typedValue: u
|
|
601
|
-
});
|
|
530
|
+
if (n.props.label !== undefined && Re !== undefined) {
|
|
531
|
+
return n.props.label === e;
|
|
602
532
|
}
|
|
603
|
-
|
|
604
|
-
value: r,
|
|
605
|
-
name: l
|
|
606
|
-
});
|
|
533
|
+
return n.props.value === e;
|
|
607
534
|
}));
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
535
|
+
if (!o && e) {
|
|
536
|
+
n.unshift( t().createElement(D, {
|
|
537
|
+
description: (0, P._)("(New value)"),
|
|
538
|
+
descriptionPosition: "right",
|
|
539
|
+
key: "currentValueOption",
|
|
540
|
+
value: e,
|
|
541
|
+
"data-test-current-value-option": e
|
|
611
542
|
}));
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
if (i.state.open) {
|
|
621
|
-
switch (c) {
|
|
622
|
-
case "enter":
|
|
623
|
-
{
|
|
624
|
-
if (u) {
|
|
625
|
-
i.handleSelectOption(e, {
|
|
626
|
-
value: u
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
break;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
case "tab":
|
|
633
|
-
i.close();
|
|
634
|
-
break;
|
|
635
|
-
|
|
636
|
-
case "down":
|
|
637
|
-
i.setState((function(e) {
|
|
638
|
-
return {
|
|
639
|
-
activeIndex: Math.min(e.activeIndex + 1, l - 1)
|
|
640
|
-
};
|
|
641
|
-
}));
|
|
642
|
-
if (o && a) {
|
|
643
|
-
var s = n.Children.count(o) - 2;
|
|
644
|
-
if (i.state.activeIndex === s) {
|
|
645
|
-
i.handleScrollBottom(e);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
break;
|
|
649
|
-
|
|
650
|
-
case "up":
|
|
651
|
-
i.setState((function(e) {
|
|
652
|
-
return {
|
|
653
|
-
activeIndex: Math.max(e.activeIndex - 1, 0)
|
|
654
|
-
};
|
|
655
|
-
}));
|
|
656
|
-
break;
|
|
657
|
-
|
|
658
|
-
default:
|
|
659
|
-
// do nothing
|
|
660
|
-
}
|
|
661
|
-
} else if ((0, w.addsCharacter)(e.nativeEvent) !== false ||
|
|
662
|
-
// Safari 9.0 returns undefined
|
|
663
|
-
c === "enter" || c === "backspace" || c === "down" || c === "up") {
|
|
664
|
-
i.open();
|
|
665
|
-
}
|
|
666
|
-
r === null || r === void 0 ? void 0 : r(e);
|
|
667
|
-
}));
|
|
668
|
-
fe(ce(i), "handleInputClick", (function(e) {
|
|
669
|
-
e.stopPropagation();
|
|
670
|
-
if (!i.state.open && !i.props.disabled) {
|
|
671
|
-
i.open();
|
|
672
|
-
}
|
|
673
|
-
}));
|
|
674
|
-
fe(ce(i), "handleRequestClose", (function(e) {
|
|
675
|
-
var t = e.event, n = e.reason;
|
|
676
|
-
var o = n === "offScreen" || n === "escapeKey" || n === "clickAway" && i.state.anchor && !ye(i.state.anchor, t);
|
|
677
|
-
if (o) {
|
|
678
|
-
i.close();
|
|
543
|
+
}
|
|
544
|
+
// Highlight Active
|
|
545
|
+
Ie.current = 0;
|
|
546
|
+
xe.current = undefined;
|
|
547
|
+
var l = (0, k.stringToKeywords)(Re ? e : Ke());
|
|
548
|
+
return (i ? n : n.filter((function(e) {
|
|
549
|
+
if (e.props.label !== undefined) {
|
|
550
|
+
return (0, k.testPhrase)(e.props.label, l);
|
|
679
551
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
if (i.state.open && !i.props.isLoadingOptions) {
|
|
683
|
-
var t, n;
|
|
684
|
-
(t = (n = i.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
|
|
552
|
+
if (e.props.value !== undefined) {
|
|
553
|
+
return (0, k.testPhrase)(e.props.value, l);
|
|
685
554
|
}
|
|
686
|
-
|
|
687
|
-
fe(ce(i), "prepareOptions", (function() {
|
|
688
|
-
var e = i.props, t = e.children, r = e.controlledFilter;
|
|
689
|
-
var a = i.state, l = a.activeIndex, u = a.typedValue;
|
|
690
|
-
var s = i.getValue();
|
|
691
|
-
var p = n.Children.toArray(t).filter(n.isValidElement);
|
|
692
|
-
var f = y()(p, (function(e) {
|
|
693
|
-
if (e.type === S.Heading) {
|
|
694
|
-
return false;
|
|
695
|
-
}
|
|
696
|
-
if (e.props.label === undefined) {
|
|
697
|
-
return e.props.value === s;
|
|
698
|
-
}
|
|
699
|
-
if (e.props.label !== undefined && u !== undefined) {
|
|
700
|
-
return e.props.label === s;
|
|
701
|
-
}
|
|
702
|
-
return e.props.value === s;
|
|
703
|
-
}));
|
|
704
|
-
if (!f && s) {
|
|
705
|
-
p.unshift( o().createElement(J, {
|
|
706
|
-
description: (0, O._)("(New value)"),
|
|
707
|
-
descriptionPosition: "right",
|
|
708
|
-
key: "currentValueOption",
|
|
709
|
-
value: s,
|
|
710
|
-
"data-test-current-value-option": s
|
|
711
|
-
}));
|
|
712
|
-
}
|
|
713
|
-
// Highlight Active
|
|
714
|
-
i.availableOptionCount = 0;
|
|
715
|
-
i.activeValue = undefined;
|
|
716
|
-
var d = (0, m.stringToKeywords)(u ? s : i.getDisplayValue());
|
|
717
|
-
i.options = (r ? p : p.filter((function(e) {
|
|
718
|
-
if (e.props.label !== undefined) {
|
|
719
|
-
return (0, m.testPhrase)(e.props.label, d);
|
|
720
|
-
}
|
|
721
|
-
if (e.props.value !== undefined) {
|
|
722
|
-
return (0, m.testPhrase)(e.props.value, d);
|
|
723
|
-
}
|
|
724
|
-
return true;
|
|
555
|
+
return true;
|
|
725
556
|
// Keep all headers and non-interactive options
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
return (0, n.cloneElement)(e, {
|
|
742
|
-
ref: i.handleActiveOptionMount,
|
|
743
|
-
id: i.activeItemId,
|
|
744
|
-
onClick: i.handleSelectOption,
|
|
745
|
-
matchRanges: u || p,
|
|
746
|
-
active: true
|
|
747
|
-
});
|
|
557
|
+
}))).map((function(n, t) {
|
|
558
|
+
if (n.type.as !== "Item") {
|
|
559
|
+
// ignore non-Option items such as Headings and Dividers
|
|
560
|
+
return n;
|
|
561
|
+
}
|
|
562
|
+
var a = Ie.current === fe;
|
|
563
|
+
Ie.current += 1;
|
|
564
|
+
var u = n.props.label !== undefined ? n.props.label : n.props.value;
|
|
565
|
+
var c = n.props.matchRanges;
|
|
566
|
+
var s = !i && e && (o || t > 0) ? (0, k.keywordLocations)(u, l) || undefined : undefined;
|
|
567
|
+
if (a) {
|
|
568
|
+
if (!n.props.disabled) {
|
|
569
|
+
xe.current = n.props.value;
|
|
748
570
|
}
|
|
749
571
|
|
|
750
|
-
return (0,
|
|
751
|
-
|
|
752
|
-
|
|
572
|
+
return (0, r.cloneElement)(n, {
|
|
573
|
+
elementRef: Ne,
|
|
574
|
+
id: Le,
|
|
575
|
+
onClick: Ye,
|
|
576
|
+
matchRanges: c || s,
|
|
577
|
+
active: true
|
|
753
578
|
});
|
|
754
|
-
}));
|
|
755
|
-
}));
|
|
756
|
-
fe(ce(i), "renderMenu", (function(e) {
|
|
757
|
-
var t = e.anchorWidth, n = e.maxHeight;
|
|
758
|
-
var r = i.props, a = r.isLoadingOptions, l = r.menuStyle, u = r.onScrollBottom, c = r.virtualization;
|
|
759
|
-
var s = me({
|
|
760
|
-
anchorWidth: t,
|
|
761
|
-
maxHeight: n,
|
|
762
|
-
menuStyle: l
|
|
763
|
-
});
|
|
764
|
-
var p = te({
|
|
765
|
-
style: s,
|
|
766
|
-
controlledExternally: true,
|
|
767
|
-
onScrollBottom: u ? i.handleScrollBottom : undefined,
|
|
768
|
-
isLoading: a
|
|
769
|
-
}, b()(i.props, "className", "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll"));
|
|
770
|
-
if (c) {
|
|
771
|
-
|
|
772
|
-
return o().createElement(I.VirtualizedResultsMenu, $({
|
|
773
|
-
virtualization: c
|
|
774
|
-
}, p), i.options);
|
|
775
579
|
}
|
|
776
580
|
|
|
777
|
-
return
|
|
581
|
+
return (0, r.cloneElement)(n, {
|
|
582
|
+
onClick: Ye,
|
|
583
|
+
matchRanges: c || s
|
|
584
|
+
});
|
|
778
585
|
}));
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
}, (function() {
|
|
826
|
-
var e, n;
|
|
827
|
-
(e = (n = t.props).onOpen) === null || e === void 0 ? void 0 : e.call(n);
|
|
828
|
-
}));
|
|
829
|
-
}
|
|
830
|
-
}, {
|
|
831
|
-
key: "close",
|
|
832
|
-
value: function e() {
|
|
833
|
-
var t = this;
|
|
834
|
-
this.setState({
|
|
835
|
-
open: false
|
|
836
|
-
}, (function() {
|
|
837
|
-
var e, n;
|
|
838
|
-
t.previousActiveIndex = null;
|
|
839
|
-
(e = (n = t.props).onClose) === null || e === void 0 ? void 0 : e.call(n);
|
|
840
|
-
}));
|
|
841
|
-
}
|
|
842
|
-
/**
|
|
843
|
-
* Focus the `ComboBox`.
|
|
844
|
-
*/ }, {
|
|
845
|
-
key: "focus",
|
|
846
|
-
value: function e() {
|
|
847
|
-
var t;
|
|
848
|
-
(t = this.textInput) === null || t === void 0 ? void 0 : t.focus();
|
|
849
|
-
}
|
|
850
|
-
}, {
|
|
851
|
-
key: "isControlled",
|
|
852
|
-
value: function e() {
|
|
853
|
-
return this.controlledExternally;
|
|
586
|
+
}), [ fe, Le, a, i, Ke, Ve, Ne, Ye, Re ]);
|
|
587
|
+
var Ze = (0, r.useCallback)((function(e) {
|
|
588
|
+
var n = Ie.current;
|
|
589
|
+
var t = xe.current;
|
|
590
|
+
var o = (0, j.keycode)(e.nativeEvent);
|
|
591
|
+
if (he) {
|
|
592
|
+
switch (o) {
|
|
593
|
+
case "enter":
|
|
594
|
+
{
|
|
595
|
+
if (t) {
|
|
596
|
+
Ye(e, {
|
|
597
|
+
value: t
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
break;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
case "tab":
|
|
604
|
+
ze();
|
|
605
|
+
break;
|
|
606
|
+
|
|
607
|
+
case "down":
|
|
608
|
+
de((function(e) {
|
|
609
|
+
return Math.min(e + 1, n - 1);
|
|
610
|
+
}));
|
|
611
|
+
if (a && G) {
|
|
612
|
+
var i = r.Children.count(a) - 2;
|
|
613
|
+
if (fe === i) {
|
|
614
|
+
Je(e);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
break;
|
|
618
|
+
|
|
619
|
+
case "up":
|
|
620
|
+
de((function(e) {
|
|
621
|
+
return Math.max(e - 1, 0);
|
|
622
|
+
}));
|
|
623
|
+
break;
|
|
624
|
+
|
|
625
|
+
default:
|
|
626
|
+
// do nothing
|
|
627
|
+
}
|
|
628
|
+
} else if ((0, j.addsCharacter)(e.nativeEvent) !== false ||
|
|
629
|
+
// Safari 9.0 returns undefined
|
|
630
|
+
o === "enter" || o === "backspace" || o === "down" || o === "up") {
|
|
631
|
+
Fe();
|
|
854
632
|
}
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
633
|
+
U === null || U === void 0 ? void 0 : U(e);
|
|
634
|
+
}), [ fe, a, ze, Je, Ye, he, U, G, Fe ]);
|
|
635
|
+
var en = Ve();
|
|
636
|
+
var nn = Ke();
|
|
637
|
+
var rn = function e(r) {
|
|
638
|
+
var o = r.anchorWidth, a = r.maxHeight;
|
|
639
|
+
var i = Q({
|
|
640
|
+
anchorWidth: o,
|
|
641
|
+
maxHeight: a,
|
|
642
|
+
menuStyle: H
|
|
643
|
+
});
|
|
644
|
+
var l = {
|
|
645
|
+
animateLoading: n,
|
|
646
|
+
controlledExternally: ue,
|
|
647
|
+
footerMessage: h,
|
|
648
|
+
isLoading: E,
|
|
649
|
+
loadingMessage: B,
|
|
650
|
+
noOptionsMessage: F,
|
|
651
|
+
onScroll: $,
|
|
652
|
+
onScrollBottom: G ? Je : undefined,
|
|
653
|
+
style: i
|
|
654
|
+
};
|
|
655
|
+
if (ie) {
|
|
863
656
|
|
|
864
|
-
return
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
autoCorrect: "off",
|
|
868
|
-
spellCheck: false,
|
|
869
|
-
canClear: true,
|
|
870
|
-
"data-test": "combo-box"
|
|
871
|
-
}, d()(this.props, "animateLoading", "className", "controlledFilter", "defaultValue", "footerMessage", "inputId", "isLoadingOptions", "loadingMessage", "menuStyle", "noOptionsMessage", "onClose", "onOpen", "onScroll", "onScrollBottom", "spellCheck"), {
|
|
872
|
-
"data-test-popover-id": this.popoverId,
|
|
873
|
-
"data-test-label": c,
|
|
874
|
-
"data-test-value": u,
|
|
875
|
-
"data-test-open": l && !!a,
|
|
876
|
-
onFocus: this.handleInputFocus,
|
|
877
|
-
onClick: this.handleInputClick,
|
|
878
|
-
onChange: this.handleChange,
|
|
879
|
-
onKeyDown: this.handleInputKeyDown,
|
|
880
|
-
inputId: r,
|
|
881
|
-
inputRef: this.handleInputMount,
|
|
882
|
-
elementRef: this.handleAnchorMount,
|
|
883
|
-
role: "combobox",
|
|
884
|
-
value: c,
|
|
885
|
-
"aria-activedescendant": this.state.open && Array.isArray(this.options) && this.options.length > 0 ? this.activeItemId : undefined,
|
|
886
|
-
"aria-expanded": l,
|
|
887
|
-
"aria-controls": l ? this.popoverId : undefined
|
|
888
|
-
}), o().createElement(j(), {
|
|
889
|
-
anchor: a,
|
|
890
|
-
autoCloseWhenOffScreen: true,
|
|
891
|
-
canCoverAnchor: false,
|
|
892
|
-
defaultPlacement: n,
|
|
893
|
-
id: this.popoverId,
|
|
894
|
-
onRequestClose: this.handleRequestClose,
|
|
895
|
-
open: l && !!a,
|
|
896
|
-
repositionMode: "flip"
|
|
897
|
-
}, this.renderMenu));
|
|
657
|
+
return t().createElement(b.VirtualizedResultsMenu, A({
|
|
658
|
+
virtualization: ie
|
|
659
|
+
}, l), Qe);
|
|
898
660
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
661
|
+
|
|
662
|
+
return t().createElement(m(), l, Qe);
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
return t().createElement(g(), A({
|
|
666
|
+
append: o,
|
|
667
|
+
"aria-activedescendant": he && Array.isArray(Qe) && Qe.length > 0 ? Le : undefined,
|
|
668
|
+
"aria-expanded": he,
|
|
669
|
+
"aria-controls": he ? He : undefined,
|
|
670
|
+
autoCapitalize: "off",
|
|
671
|
+
autoComplete: "off",
|
|
672
|
+
autoCorrect: "off",
|
|
673
|
+
canClear: true,
|
|
674
|
+
"data-test": "combo-box",
|
|
675
|
+
"data-test-popover-id": He,
|
|
676
|
+
"data-test-label": nn,
|
|
677
|
+
"data-test-value": en,
|
|
678
|
+
"data-test-open": he && !!be,
|
|
679
|
+
describedBy: s,
|
|
680
|
+
disabled: d,
|
|
681
|
+
elementRef: We,
|
|
682
|
+
error: y,
|
|
683
|
+
inline: S,
|
|
684
|
+
inputId: M,
|
|
685
|
+
inputRef: _e,
|
|
686
|
+
labelledBy: T,
|
|
687
|
+
name: z,
|
|
688
|
+
onBlur: V,
|
|
689
|
+
onFocus: Ue,
|
|
690
|
+
onChange: Xe,
|
|
691
|
+
onClick: $e,
|
|
692
|
+
onKeyDown: Ze,
|
|
693
|
+
onSelect: ne,
|
|
694
|
+
placeholder: te,
|
|
695
|
+
prepend: oe,
|
|
696
|
+
role: "combobox",
|
|
697
|
+
value: nn
|
|
698
|
+
}, le, {
|
|
699
|
+
spellCheck: false
|
|
700
|
+
}), t().createElement(v(), {
|
|
701
|
+
anchor: be,
|
|
702
|
+
autoCloseWhenOffScreen: true,
|
|
703
|
+
canCoverAnchor: false,
|
|
704
|
+
defaultPlacement: u,
|
|
705
|
+
id: He,
|
|
706
|
+
onRequestClose: Ge,
|
|
707
|
+
open: he && !!be,
|
|
708
|
+
repositionMode: "flip"
|
|
709
|
+
}, rn));
|
|
710
|
+
}
|
|
711
|
+
ne.Divider = d.Divider;
|
|
712
|
+
ne.Heading = d.Heading;
|
|
713
|
+
ne.Option = D;
|
|
714
|
+
ne.propTypes = G;
|
|
715
|
+
/* harmony default export */ const re = ne;
|
|
908
716
|
// CONCATENATED MODULE: ./src/ComboBox/index.ts
|
|
909
|
-
module.exports =
|
|
717
|
+
module.exports = n;
|
|
910
718
|
/******/})();
|