@eightshift/ui-components 5.0.9 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Collection-uTAXq9Br.js → Collection-BRJOMbOa.js} +12 -7
- package/dist/{Dialog-CmAxaSUv.js → Dialog-D6EdDPeu.js} +8 -8
- package/dist/{useFormValidation-Dy0PXJg5.js → Form-Bnyyv3Im.js} +6 -4
- package/dist/{Group-DDPhPPTQ.js → Group-LBogWgyp.js} +2 -2
- package/dist/{Input-BmDS8Juy.js → Input-DfSBLhDx.js} +1 -1
- package/dist/List-BLeHBkfx.js +590 -0
- package/dist/{ListBox-_nDFq8-H.js → ListBox-BY3gwI8c.js} +3 -3
- package/dist/Select-BebwUgKB.js +764 -0
- package/dist/Separator-CTQWg_HO.js +1111 -0
- package/dist/TextField-o2U-uBWv.js +133 -0
- package/dist/assets/style-admin.css +268 -150
- package/dist/assets/style-editor.css +268 -150
- package/dist/assets/style.css +268 -150
- package/dist/assets/wp-font-enhancements.css +1 -1
- package/dist/assets/wp-ui-enhancements.css +1 -1
- package/dist/components/breakpoint-preview/breakpoint-preview.js +3 -4
- package/dist/components/button/button.js +3 -3
- package/dist/components/checkbox/checkbox.js +1 -2
- package/dist/components/color-pickers/color-picker.js +7 -9
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +19 -25
- package/dist/components/color-pickers/solid-color-picker.js +27 -27
- package/dist/components/component-toggle/component-toggle.js +1 -1
- package/dist/components/draggable/draggable-handle.js +2 -2
- package/dist/components/draggable/draggable.js +5 -5
- package/dist/components/draggable-list/draggable-list-item.js +2 -2
- package/dist/components/draggable-list/draggable-list.js +5 -5
- package/dist/components/expandable/expandable.js +1 -1
- package/dist/components/index.js +5 -5
- package/dist/components/input-field/input-field.js +13 -129
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +1463 -17
- package/dist/components/matrix-align/matrix-align.js +11 -14
- package/dist/components/menu/menu.js +4 -8
- package/dist/components/modal/modal.js +3 -3
- package/dist/components/number-picker/number-picker.js +9 -10
- package/dist/components/option-select/option-select.js +140 -156
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/placeholders/image-placeholder.js +3 -3
- package/dist/components/placeholders/media-placeholder.js +2 -2
- package/dist/components/popover/popover.js +10 -5
- package/dist/components/radio/radio.js +4 -5
- package/dist/components/repeater/repeater-item.js +1 -1
- package/dist/components/repeater/repeater.js +6 -6
- package/dist/components/responsive/mini-responsive.js +45 -47
- package/dist/components/responsive/responsive-legacy.js +51 -55
- package/dist/components/responsive/responsive.js +47 -49
- package/dist/components/responsive-preview/responsive-preview.js +12 -15
- package/dist/components/select/async-multi-select.js +4 -4
- package/dist/components/select/async-single-select.js +1 -1
- package/dist/components/select/multi-select-components.js +1 -1
- package/dist/components/select/multi-select.js +4 -4
- package/dist/components/select/shared.js +2 -2
- package/dist/components/select/single-select.js +1 -1
- package/dist/components/select/styles.js +3 -3
- package/dist/components/select/v2/async-select.js +215 -158
- package/dist/components/select/v2/shared.js +29 -20
- package/dist/components/select/v2/single-select.js +202 -851
- package/dist/components/slider/column-config-slider.js +2 -2
- package/dist/components/slider/slider.js +2 -2
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/tabs/tabs.js +7 -8
- package/dist/components/toggle/switch.js +4 -3
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/{default-i18n-CT_oS1Fy.js → default-i18n-OFa3zAyB.js} +5 -9
- package/dist/icons/jsx-svg.js +35 -5
- package/dist/index.js +4 -4
- package/dist/{multi-select-components-Sp-JEFEX.js → multi-select-components-BcKzA24f.js} +3 -3
- package/dist/{react-jsx-parser.min-DZCiis5V.js → react-jsx-parser.min-LF707GK8.js} +312 -332
- package/dist/useAsyncList-fLtZMvJO.js +420 -0
- package/dist/useFilter-BR5z1A4Q.js +50 -0
- package/dist/{useListState-9Hq_FiRF.js → useListState-BrZ2XvDS.js} +1 -1
- package/dist/{useNumberField-D0u2bh8g.js → useNumberField-y0dLc_6m.js} +2 -2
- package/dist/{useSingleSelectListState-DqhemUIh.js → useSingleSelectListState-Bh46cRXs.js} +1 -1
- package/dist/utilities/array-helpers.js +4 -7
- package/dist/utilities/es-dash.js +21 -3
- package/dist/utilities/index.js +2 -1
- package/dist/utilities/text-helpers.js +3 -3
- package/package.json +9 -9
- package/dist/ComboBox-BANSEKnb.js +0 -1915
- package/dist/Form-Cq3fu75_.js +0 -5
- package/dist/List-CZMUbkFU.js +0 -593
- package/dist/Separator-BN3mjL6q.js +0 -332
|
@@ -1,770 +1,20 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { _ as __ } from "../../../default-i18n-
|
|
2
|
+
import { _ as __ } from "../../../default-i18n-OFa3zAyB.js";
|
|
3
3
|
import { BaseControl } from "../../base-control/base-control.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { $ as $
|
|
11
|
-
import {
|
|
12
|
-
import { o as $fb3050f43d946246$export$e32c88dfddc6e1d8, e as $e1995378a142960e$export$bf788dd355e3a401 } from "../../../Collection-uTAXq9Br.js";
|
|
13
|
-
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../../filterDOMProps-EDDcM64A.js";
|
|
14
|
-
import { $ as $fc909762b330b746$export$61c6a8c84e605fb6, f as $9daab02d461809db$export$683480f191c0e3ea } from "../../../OverlayArrow-BUfV-5P3.js";
|
|
15
|
-
import React__default, { useMemo, useRef, useState, forwardRef, createContext, useContext, useCallback, cloneElement } from "react";
|
|
16
|
-
import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../../useLocalizedStringFormatter-C9GO0IDB.js";
|
|
17
|
-
import { a as $e93e671b31057976$export$b8473d3665f3a75a, $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10 } from "../../../useFormValidation-Dy0PXJg5.js";
|
|
18
|
-
import { $ as $a0d645289fe9b86b$export$e7f05e985daf4b5f } from "../../../useSingleSelectListState-DqhemUIh.js";
|
|
19
|
-
import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../../useFocusRing-Bv0UJQl8.js";
|
|
20
|
-
import { f as $325a3faab7a68acd$export$a16aca283550c30d, g as $2a25aae57d74318e$export$a05409b8bb224a5a } from "../../../Separator-BN3mjL6q.js";
|
|
21
|
-
import { q as $507fabe10e71c6fb$export$8397ddfc504fdb9a } from "../../../useHover-C2SkI1Fn.js";
|
|
22
|
-
import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../../useFormReset-D2YaWRIA.js";
|
|
23
|
-
import { a as $5c3e21d68f1c4674$export$a966af930f325cab } from "../../../VisuallyHidden-BYi0pekx.js";
|
|
4
|
+
import { b as $d2f53cda644affe3$export$2f2b9559550c7bbc, c as $440f4836bcb56932$export$b94867ecbd698f21 } from "../../../Separator-CTQWg_HO.js";
|
|
5
|
+
import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../../Button-DH22t_SM.js";
|
|
6
|
+
import { $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../../Input-DfSBLhDx.js";
|
|
7
|
+
import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../../Label-JS_ob-kh.js";
|
|
8
|
+
import { $ as $eed445e0843c11d0$export$41f133550aa26f48 } from "../../../ListBox-BY3gwI8c.js";
|
|
9
|
+
import { e as $07b14b47974efb58$export$5b6b19405a83ff9d } from "../../../Dialog-D6EdDPeu.js";
|
|
10
|
+
import { $ as $82d7e5349645de74$export$ef9b1a59e592288f, a as $82d7e5349645de74$export$e288731fd71264f0, b as $82d7e5349645de74$export$ef445b55be0601bd } from "../../../Select-BebwUgKB.js";
|
|
11
|
+
import { useRef, cloneElement, useContext } from "react";
|
|
24
12
|
import { icons } from "../../../icons/icons.js";
|
|
25
|
-
import "../../../react-jsx-parser.min-
|
|
13
|
+
import "../../../react-jsx-parser.min-LF707GK8.js";
|
|
26
14
|
import { OptionItemBase } from "./shared.js";
|
|
27
15
|
import { RichLabel } from "../../rich-label/rich-label.js";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
let { keyboardDelegate, isDisabled, isRequired, name, validationBehavior = "aria" } = props;
|
|
31
|
-
let collator = $325a3faab7a68acd$export$a16aca283550c30d({
|
|
32
|
-
usage: "search",
|
|
33
|
-
sensitivity: "base"
|
|
34
|
-
});
|
|
35
|
-
let delegate = useMemo(() => keyboardDelegate || new $2a25aae57d74318e$export$a05409b8bb224a5a(state.collection, state.disabledKeys, ref, collator), [
|
|
36
|
-
keyboardDelegate,
|
|
37
|
-
state.collection,
|
|
38
|
-
state.disabledKeys,
|
|
39
|
-
collator,
|
|
40
|
-
ref
|
|
41
|
-
]);
|
|
42
|
-
let { menuTriggerProps, menuProps } = $168583247155ddda$export$dc9c12ed27dd1b49({
|
|
43
|
-
isDisabled,
|
|
44
|
-
type: "listbox"
|
|
45
|
-
}, state, ref);
|
|
46
|
-
let onKeyDown = (e) => {
|
|
47
|
-
switch (e.key) {
|
|
48
|
-
case "ArrowLeft": {
|
|
49
|
-
var _delegate_getKeyAbove, _delegate_getFirstKey;
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
let key = state.selectedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, state.selectedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
|
|
52
|
-
if (key) state.setSelectedKey(key);
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
case "ArrowRight": {
|
|
56
|
-
var _delegate_getKeyBelow, _delegate_getFirstKey1;
|
|
57
|
-
e.preventDefault();
|
|
58
|
-
let key = state.selectedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, state.selectedKey) : (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate);
|
|
59
|
-
if (key) state.setSelectedKey(key);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
let { typeSelectProps } = $fb3050f43d946246$export$e32c88dfddc6e1d8({
|
|
65
|
-
keyboardDelegate: delegate,
|
|
66
|
-
selectionManager: state.selectionManager,
|
|
67
|
-
onTypeSelect(key) {
|
|
68
|
-
state.setSelectedKey(key);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
let { isInvalid, validationErrors, validationDetails } = state.displayValidation;
|
|
72
|
-
let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $2baaea4c71418dea$export$294aa081a6c6f55d({
|
|
73
|
-
...props,
|
|
74
|
-
labelElementType: "span",
|
|
75
|
-
isInvalid,
|
|
76
|
-
errorMessage: props.errorMessage || validationErrors
|
|
77
|
-
});
|
|
78
|
-
typeSelectProps.onKeyDown = typeSelectProps.onKeyDownCapture;
|
|
79
|
-
delete typeSelectProps.onKeyDownCapture;
|
|
80
|
-
let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
81
|
-
labelable: true
|
|
82
|
-
});
|
|
83
|
-
let triggerProps = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, menuTriggerProps, fieldProps);
|
|
84
|
-
let valueId = $bdb11010cef70236$export$f680877a34711e37();
|
|
85
|
-
$58aed456727eb0f3$export$703601b7e90536f8.set(state, {
|
|
86
|
-
isDisabled,
|
|
87
|
-
isRequired,
|
|
88
|
-
name,
|
|
89
|
-
validationBehavior
|
|
90
|
-
});
|
|
91
|
-
return {
|
|
92
|
-
labelProps: {
|
|
93
|
-
...labelProps,
|
|
94
|
-
onClick: () => {
|
|
95
|
-
if (!props.isDisabled) {
|
|
96
|
-
var _ref_current;
|
|
97
|
-
(_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
|
|
98
|
-
$507fabe10e71c6fb$export$8397ddfc504fdb9a("keyboard");
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
triggerProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, {
|
|
103
|
-
...triggerProps,
|
|
104
|
-
isDisabled,
|
|
105
|
-
onKeyDown: $ff5963eb1fccf552$export$e08e3b67e392101e(triggerProps.onKeyDown, onKeyDown, props.onKeyDown),
|
|
106
|
-
onKeyUp: props.onKeyUp,
|
|
107
|
-
"aria-labelledby": [
|
|
108
|
-
valueId,
|
|
109
|
-
triggerProps["aria-labelledby"],
|
|
110
|
-
triggerProps["aria-label"] && !triggerProps["aria-labelledby"] ? triggerProps.id : null
|
|
111
|
-
].filter(Boolean).join(" "),
|
|
112
|
-
onFocus(e) {
|
|
113
|
-
if (state.isFocused) return;
|
|
114
|
-
if (props.onFocus) props.onFocus(e);
|
|
115
|
-
if (props.onFocusChange) props.onFocusChange(true);
|
|
116
|
-
state.setFocused(true);
|
|
117
|
-
},
|
|
118
|
-
onBlur(e) {
|
|
119
|
-
if (state.isOpen) return;
|
|
120
|
-
if (props.onBlur) props.onBlur(e);
|
|
121
|
-
if (props.onFocusChange) props.onFocusChange(false);
|
|
122
|
-
state.setFocused(false);
|
|
123
|
-
}
|
|
124
|
-
}),
|
|
125
|
-
valueProps: {
|
|
126
|
-
id: valueId
|
|
127
|
-
},
|
|
128
|
-
menuProps: {
|
|
129
|
-
...menuProps,
|
|
130
|
-
autoFocus: state.focusStrategy || true,
|
|
131
|
-
shouldSelectOnPressUp: true,
|
|
132
|
-
shouldFocusOnHover: true,
|
|
133
|
-
disallowEmptySelection: true,
|
|
134
|
-
linkBehavior: "selection",
|
|
135
|
-
onBlur: (e) => {
|
|
136
|
-
if (e.currentTarget.contains(e.relatedTarget)) return;
|
|
137
|
-
if (props.onBlur) props.onBlur(e);
|
|
138
|
-
if (props.onFocusChange) props.onFocusChange(false);
|
|
139
|
-
state.setFocused(false);
|
|
140
|
-
},
|
|
141
|
-
"aria-labelledby": [
|
|
142
|
-
fieldProps["aria-labelledby"],
|
|
143
|
-
triggerProps["aria-label"] && !fieldProps["aria-labelledby"] ? triggerProps.id : null
|
|
144
|
-
].filter(Boolean).join(" ")
|
|
145
|
-
},
|
|
146
|
-
descriptionProps,
|
|
147
|
-
errorMessageProps,
|
|
148
|
-
isInvalid,
|
|
149
|
-
validationErrors,
|
|
150
|
-
validationDetails
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
|
|
154
|
-
let data = $58aed456727eb0f3$export$703601b7e90536f8.get(state) || {};
|
|
155
|
-
let { autoComplete, name = data.name, isDisabled = data.isDisabled } = props;
|
|
156
|
-
let { validationBehavior, isRequired } = data;
|
|
157
|
-
let { visuallyHiddenProps } = $5c3e21d68f1c4674$export$a966af930f325cab();
|
|
158
|
-
$99facab73266f662$export$5add1d006293d136(props.selectRef, state.selectedKey, state.setSelectedKey);
|
|
159
|
-
$e93e671b31057976$export$b8473d3665f3a75a({
|
|
160
|
-
validationBehavior,
|
|
161
|
-
focus: () => {
|
|
162
|
-
var _triggerRef_current;
|
|
163
|
-
return (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();
|
|
164
|
-
}
|
|
165
|
-
}, state, props.selectRef);
|
|
166
|
-
var _state_selectedKey;
|
|
167
|
-
return {
|
|
168
|
-
containerProps: {
|
|
169
|
-
...visuallyHiddenProps,
|
|
170
|
-
"aria-hidden": true,
|
|
171
|
-
// @ts-ignore
|
|
172
|
-
["data-react-aria-prevent-focus"]: true,
|
|
173
|
-
// @ts-ignore
|
|
174
|
-
["data-a11y-ignore"]: "aria-hidden-focus"
|
|
175
|
-
},
|
|
176
|
-
inputProps: {
|
|
177
|
-
style: {
|
|
178
|
-
display: "none"
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
selectProps: {
|
|
182
|
-
tabIndex: -1,
|
|
183
|
-
autoComplete,
|
|
184
|
-
disabled: isDisabled,
|
|
185
|
-
required: validationBehavior === "native" && isRequired,
|
|
186
|
-
name,
|
|
187
|
-
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : void 0,
|
|
188
|
-
onChange: (e) => state.setSelectedKey(e.target.value)
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
|
|
193
|
-
let { state, triggerRef, label, name, isDisabled } = props;
|
|
194
|
-
let selectRef = useRef(null);
|
|
195
|
-
let { containerProps, selectProps } = $bdd25dc72710631f$export$f809e80f58e251d1({
|
|
196
|
-
...props,
|
|
197
|
-
selectRef
|
|
198
|
-
}, state, triggerRef);
|
|
199
|
-
var _state_selectedKey;
|
|
200
|
-
if (state.collection.size <= 300) return /* @__PURE__ */ React__default.createElement("div", {
|
|
201
|
-
...containerProps,
|
|
202
|
-
"data-testid": "hidden-select-container"
|
|
203
|
-
}, /* @__PURE__ */ React__default.createElement("label", null, label, /* @__PURE__ */ React__default.createElement("select", {
|
|
204
|
-
...selectProps,
|
|
205
|
-
ref: selectRef
|
|
206
|
-
}, /* @__PURE__ */ React__default.createElement("option", null), [
|
|
207
|
-
...state.collection.getKeys()
|
|
208
|
-
].map((key) => {
|
|
209
|
-
let item = state.collection.getItem(key);
|
|
210
|
-
if (item && item.type === "item") return /* @__PURE__ */ React__default.createElement("option", {
|
|
211
|
-
key: item.key,
|
|
212
|
-
value: item.key
|
|
213
|
-
}, item.textValue);
|
|
214
|
-
}))));
|
|
215
|
-
else if (name) return /* @__PURE__ */ React__default.createElement("input", {
|
|
216
|
-
type: "hidden",
|
|
217
|
-
autoComplete: selectProps.autoComplete,
|
|
218
|
-
name,
|
|
219
|
-
disabled: isDisabled,
|
|
220
|
-
value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ""
|
|
221
|
-
});
|
|
222
|
-
return null;
|
|
223
|
-
}
|
|
224
|
-
function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
|
|
225
|
-
let triggerState = $fc909762b330b746$export$61c6a8c84e605fb6(props);
|
|
226
|
-
let [focusStrategy, setFocusStrategy] = useState(null);
|
|
227
|
-
let listState = $a0d645289fe9b86b$export$e7f05e985daf4b5f({
|
|
228
|
-
...props,
|
|
229
|
-
onSelectionChange: (key) => {
|
|
230
|
-
if (props.onSelectionChange != null) props.onSelectionChange(key);
|
|
231
|
-
triggerState.close();
|
|
232
|
-
validationState.commitValidation();
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
let validationState = $e5be200c675c3b3a$export$fc1a364ae1f3ff10({
|
|
236
|
-
...props,
|
|
237
|
-
value: listState.selectedKey
|
|
238
|
-
});
|
|
239
|
-
let [isFocused, setFocused] = useState(false);
|
|
240
|
-
let isEmpty = useMemo(() => {
|
|
241
|
-
var _listState_collection_getItem;
|
|
242
|
-
return listState.collection.size === 0 || listState.collection.size === 1 && ((_listState_collection_getItem = listState.collection.getItem(listState.collection.getFirstKey())) === null || _listState_collection_getItem === void 0 ? void 0 : _listState_collection_getItem.type) === "loader";
|
|
243
|
-
}, [
|
|
244
|
-
listState.collection
|
|
245
|
-
]);
|
|
246
|
-
return {
|
|
247
|
-
...validationState,
|
|
248
|
-
...listState,
|
|
249
|
-
...triggerState,
|
|
250
|
-
focusStrategy,
|
|
251
|
-
open(focusStrategy2 = null) {
|
|
252
|
-
if (!isEmpty) {
|
|
253
|
-
setFocusStrategy(focusStrategy2);
|
|
254
|
-
triggerState.open();
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
toggle(focusStrategy2 = null) {
|
|
258
|
-
if (!isEmpty) {
|
|
259
|
-
setFocusStrategy(focusStrategy2);
|
|
260
|
-
triggerState.toggle();
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
isFocused,
|
|
264
|
-
setFocused
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
var $e038a7e7a6d81989$exports = {};
|
|
268
|
-
$e038a7e7a6d81989$exports = {
|
|
269
|
-
"colorSwatchPicker": `تغييرات الألوان`,
|
|
270
|
-
"dropzoneLabel": `DropZone`,
|
|
271
|
-
"selectPlaceholder": `حدد عنصرًا`,
|
|
272
|
-
"tableResizer": `أداة تغيير الحجم`
|
|
273
|
-
};
|
|
274
|
-
var $0ec14741b0133644$exports = {};
|
|
275
|
-
$0ec14741b0133644$exports = {
|
|
276
|
-
"colorSwatchPicker": `Цветови мостри`,
|
|
277
|
-
"dropzoneLabel": `DropZone`,
|
|
278
|
-
"selectPlaceholder": `Изберете предмет`,
|
|
279
|
-
"tableResizer": `Преоразмерител`
|
|
280
|
-
};
|
|
281
|
-
var $642f7badf2405784$exports = {};
|
|
282
|
-
$642f7badf2405784$exports = {
|
|
283
|
-
"colorSwatchPicker": `Vzorky barev`,
|
|
284
|
-
"dropzoneLabel": `Místo pro přetažení`,
|
|
285
|
-
"selectPlaceholder": `Vyberte položku`,
|
|
286
|
-
"tableResizer": `Změna velikosti`
|
|
287
|
-
};
|
|
288
|
-
var $30cee8d2535734ec$exports = {};
|
|
289
|
-
$30cee8d2535734ec$exports = {
|
|
290
|
-
"colorSwatchPicker": `Farveprøver`,
|
|
291
|
-
"dropzoneLabel": `DropZone`,
|
|
292
|
-
"selectPlaceholder": `Vælg et element`,
|
|
293
|
-
"tableResizer": `Størrelsesændring`
|
|
294
|
-
};
|
|
295
|
-
var $c302d0504fca332a$exports = {};
|
|
296
|
-
$c302d0504fca332a$exports = {
|
|
297
|
-
"colorSwatchPicker": `Farbfelder`,
|
|
298
|
-
"dropzoneLabel": `Ablegebereich`,
|
|
299
|
-
"selectPlaceholder": `Element wählen`,
|
|
300
|
-
"tableResizer": `Größenanpassung`
|
|
301
|
-
};
|
|
302
|
-
var $0d0703f2bd7e421c$exports = {};
|
|
303
|
-
$0d0703f2bd7e421c$exports = {
|
|
304
|
-
"colorSwatchPicker": `Χρωματικά δείγματα`,
|
|
305
|
-
"dropzoneLabel": `DropZone`,
|
|
306
|
-
"selectPlaceholder": `Επιλέξτε ένα αντικείμενο`,
|
|
307
|
-
"tableResizer": `Αλλαγή μεγέθους`
|
|
308
|
-
};
|
|
309
|
-
var $cafa55beb2fc5ef3$exports = {};
|
|
310
|
-
$cafa55beb2fc5ef3$exports = {
|
|
311
|
-
"selectPlaceholder": `Select an item`,
|
|
312
|
-
"tableResizer": `Resizer`,
|
|
313
|
-
"dropzoneLabel": `DropZone`,
|
|
314
|
-
"colorSwatchPicker": `Color swatches`
|
|
315
|
-
};
|
|
316
|
-
var $18ac2ceede598103$exports = {};
|
|
317
|
-
$18ac2ceede598103$exports = {
|
|
318
|
-
"colorSwatchPicker": `Muestras de colores`,
|
|
319
|
-
"dropzoneLabel": `DropZone`,
|
|
320
|
-
"selectPlaceholder": `Seleccionar un artículo`,
|
|
321
|
-
"tableResizer": `Cambiador de tamaño`
|
|
322
|
-
};
|
|
323
|
-
var $718705a15b8a633a$exports = {};
|
|
324
|
-
$718705a15b8a633a$exports = {
|
|
325
|
-
"colorSwatchPicker": `Värvinäidised`,
|
|
326
|
-
"dropzoneLabel": `DropZone`,
|
|
327
|
-
"selectPlaceholder": `Valige üksus`,
|
|
328
|
-
"tableResizer": `Suuruse muutja`
|
|
329
|
-
};
|
|
330
|
-
var $bf36dae9ecc81ce0$exports = {};
|
|
331
|
-
$bf36dae9ecc81ce0$exports = {
|
|
332
|
-
"colorSwatchPicker": `Värimallit`,
|
|
333
|
-
"dropzoneLabel": `DropZone`,
|
|
334
|
-
"selectPlaceholder": `Valitse kohde`,
|
|
335
|
-
"tableResizer": `Koon muuttaja`
|
|
336
|
-
};
|
|
337
|
-
var $0b4828edb010b855$exports = {};
|
|
338
|
-
$0b4828edb010b855$exports = {
|
|
339
|
-
"colorSwatchPicker": `Échantillons de couleurs`,
|
|
340
|
-
"dropzoneLabel": `DropZone`,
|
|
341
|
-
"selectPlaceholder": `Sélectionner un élément`,
|
|
342
|
-
"tableResizer": `Redimensionneur`
|
|
343
|
-
};
|
|
344
|
-
var $0030f210b040e540$exports = {};
|
|
345
|
-
$0030f210b040e540$exports = {
|
|
346
|
-
"colorSwatchPicker": `דוגמיות צבע`,
|
|
347
|
-
"dropzoneLabel": `DropZone`,
|
|
348
|
-
"selectPlaceholder": `בחר פריט`,
|
|
349
|
-
"tableResizer": `שינוי גודל`
|
|
350
|
-
};
|
|
351
|
-
var $1f0ebacf5a0c0fa1$exports = {};
|
|
352
|
-
$1f0ebacf5a0c0fa1$exports = {
|
|
353
|
-
"colorSwatchPicker": `Uzorci boja`,
|
|
354
|
-
"dropzoneLabel": `Zona spuštanja`,
|
|
355
|
-
"selectPlaceholder": `Odaberite stavku`,
|
|
356
|
-
"tableResizer": `Promjena veličine`
|
|
357
|
-
};
|
|
358
|
-
var $3a706ba61f3d6bba$exports = {};
|
|
359
|
-
$3a706ba61f3d6bba$exports = {
|
|
360
|
-
"colorSwatchPicker": `Színtárak`,
|
|
361
|
-
"dropzoneLabel": `DropZone`,
|
|
362
|
-
"selectPlaceholder": `Válasszon ki egy elemet`,
|
|
363
|
-
"tableResizer": `Átméretező`
|
|
364
|
-
};
|
|
365
|
-
var $0d17809e74607796$exports = {};
|
|
366
|
-
$0d17809e74607796$exports = {
|
|
367
|
-
"colorSwatchPicker": `Campioni di colore`,
|
|
368
|
-
"dropzoneLabel": `Zona di rilascio`,
|
|
369
|
-
"selectPlaceholder": `Seleziona un elemento`,
|
|
370
|
-
"tableResizer": `Ridimensionamento`
|
|
371
|
-
};
|
|
372
|
-
var $65a71f9a56f1398f$exports = {};
|
|
373
|
-
$65a71f9a56f1398f$exports = {
|
|
374
|
-
"colorSwatchPicker": `カラースウォッチ`,
|
|
375
|
-
"dropzoneLabel": `ドロップゾーン`,
|
|
376
|
-
"selectPlaceholder": `項目を選択`,
|
|
377
|
-
"tableResizer": `サイズ変更ツール`
|
|
378
|
-
};
|
|
379
|
-
var $e5efad074a74abef$exports = {};
|
|
380
|
-
$e5efad074a74abef$exports = {
|
|
381
|
-
"colorSwatchPicker": `색상 견본`,
|
|
382
|
-
"dropzoneLabel": `드롭 영역`,
|
|
383
|
-
"selectPlaceholder": `항목 선택`,
|
|
384
|
-
"tableResizer": `크기 조정기`
|
|
385
|
-
};
|
|
386
|
-
var $d70c2a849e55c607$exports = {};
|
|
387
|
-
$d70c2a849e55c607$exports = {
|
|
388
|
-
"colorSwatchPicker": `Spalvų pavyzdžiai`,
|
|
389
|
-
"dropzoneLabel": `„DropZone“`,
|
|
390
|
-
"selectPlaceholder": `Pasirinkite elementą`,
|
|
391
|
-
"tableResizer": `Dydžio keitiklis`
|
|
392
|
-
};
|
|
393
|
-
var $009bbbb440d0e907$exports = {};
|
|
394
|
-
$009bbbb440d0e907$exports = {
|
|
395
|
-
"colorSwatchPicker": `Krāsu paraugi`,
|
|
396
|
-
"dropzoneLabel": `DropZone`,
|
|
397
|
-
"selectPlaceholder": `Izvēlēties vienumu`,
|
|
398
|
-
"tableResizer": `Izmēra mainītājs`
|
|
399
|
-
};
|
|
400
|
-
var $9366fe642464ee83$exports = {};
|
|
401
|
-
$9366fe642464ee83$exports = {
|
|
402
|
-
"colorSwatchPicker": `Fargekart`,
|
|
403
|
-
"dropzoneLabel": `Droppsone`,
|
|
404
|
-
"selectPlaceholder": `Velg et element`,
|
|
405
|
-
"tableResizer": `Størrelsesendrer`
|
|
406
|
-
};
|
|
407
|
-
var $62f9bc1f98ea21de$exports = {};
|
|
408
|
-
$62f9bc1f98ea21de$exports = {
|
|
409
|
-
"colorSwatchPicker": `kleurstalen`,
|
|
410
|
-
"dropzoneLabel": `DropZone`,
|
|
411
|
-
"selectPlaceholder": `Selecteer een item`,
|
|
412
|
-
"tableResizer": `Resizer`
|
|
413
|
-
};
|
|
414
|
-
var $4ec2e5b6623b1b76$exports = {};
|
|
415
|
-
$4ec2e5b6623b1b76$exports = {
|
|
416
|
-
"colorSwatchPicker": `Próbki kolorów`,
|
|
417
|
-
"dropzoneLabel": `Strefa upuszczania`,
|
|
418
|
-
"selectPlaceholder": `Wybierz element`,
|
|
419
|
-
"tableResizer": `Zmiana rozmiaru`
|
|
420
|
-
};
|
|
421
|
-
var $e25098e26647cc04$exports = {};
|
|
422
|
-
$e25098e26647cc04$exports = {
|
|
423
|
-
"colorSwatchPicker": `Amostras de cores`,
|
|
424
|
-
"dropzoneLabel": `DropZone`,
|
|
425
|
-
"selectPlaceholder": `Selecione um item`,
|
|
426
|
-
"tableResizer": `Redimensionador`
|
|
427
|
-
};
|
|
428
|
-
var $dd39c57d242c8156$exports = {};
|
|
429
|
-
$dd39c57d242c8156$exports = {
|
|
430
|
-
"colorSwatchPicker": `Amostras de cores`,
|
|
431
|
-
"dropzoneLabel": `DropZone`,
|
|
432
|
-
"selectPlaceholder": `Selecione um item`,
|
|
433
|
-
"tableResizer": `Redimensionador`
|
|
434
|
-
};
|
|
435
|
-
var $3b4c1ba5afd57b35$exports = {};
|
|
436
|
-
$3b4c1ba5afd57b35$exports = {
|
|
437
|
-
"colorSwatchPicker": `Specimene de culoare`,
|
|
438
|
-
"dropzoneLabel": `Zonă de plasare`,
|
|
439
|
-
"selectPlaceholder": `Selectați un element`,
|
|
440
|
-
"tableResizer": `Instrument de redimensionare`
|
|
441
|
-
};
|
|
442
|
-
var $a455b2cda79eb746$exports = {};
|
|
443
|
-
$a455b2cda79eb746$exports = {
|
|
444
|
-
"colorSwatchPicker": `Цветовые образцы`,
|
|
445
|
-
"dropzoneLabel": `DropZone`,
|
|
446
|
-
"selectPlaceholder": `Выберите элемент`,
|
|
447
|
-
"tableResizer": `Средство изменения размера`
|
|
448
|
-
};
|
|
449
|
-
var $b983ca1383d5b960$exports = {};
|
|
450
|
-
$b983ca1383d5b960$exports = {
|
|
451
|
-
"colorSwatchPicker": `Vzorkovníky farieb`,
|
|
452
|
-
"dropzoneLabel": `DropZone`,
|
|
453
|
-
"selectPlaceholder": `Vyberte položku`,
|
|
454
|
-
"tableResizer": `Nástroj na zmenu veľkosti`
|
|
455
|
-
};
|
|
456
|
-
var $32a515ef673b0655$exports = {};
|
|
457
|
-
$32a515ef673b0655$exports = {
|
|
458
|
-
"colorSwatchPicker": `Barvne palete`,
|
|
459
|
-
"dropzoneLabel": `DropZone`,
|
|
460
|
-
"selectPlaceholder": `Izberite element`,
|
|
461
|
-
"tableResizer": `Spreminjanje velikosti`
|
|
462
|
-
};
|
|
463
|
-
var $89434176ab35446b$exports = {};
|
|
464
|
-
$89434176ab35446b$exports = {
|
|
465
|
-
"colorSwatchPicker": `Uzorci boje`,
|
|
466
|
-
"dropzoneLabel": `DropZone`,
|
|
467
|
-
"selectPlaceholder": `Izaberite stavku`,
|
|
468
|
-
"tableResizer": `Promena veličine`
|
|
469
|
-
};
|
|
470
|
-
var $727da781aca847f9$exports = {};
|
|
471
|
-
$727da781aca847f9$exports = {
|
|
472
|
-
"colorSwatchPicker": `Färgrutor`,
|
|
473
|
-
"dropzoneLabel": `DropZone`,
|
|
474
|
-
"selectPlaceholder": `Välj en artikel`,
|
|
475
|
-
"tableResizer": `Storleksändrare`
|
|
476
|
-
};
|
|
477
|
-
var $fcd2d84b9a2d489c$exports = {};
|
|
478
|
-
$fcd2d84b9a2d489c$exports = {
|
|
479
|
-
"colorSwatchPicker": `Renk örnekleri`,
|
|
480
|
-
"dropzoneLabel": `Bırakma Bölgesi`,
|
|
481
|
-
"selectPlaceholder": `Bir öğe seçin`,
|
|
482
|
-
"tableResizer": `Yeniden boyutlandırıcı`
|
|
483
|
-
};
|
|
484
|
-
var $2422ac328687ee23$exports = {};
|
|
485
|
-
$2422ac328687ee23$exports = {
|
|
486
|
-
"colorSwatchPicker": `Зразки кольорів`,
|
|
487
|
-
"dropzoneLabel": `DropZone`,
|
|
488
|
-
"selectPlaceholder": `Виберіть елемент`,
|
|
489
|
-
"tableResizer": `Засіб змінення розміру`
|
|
490
|
-
};
|
|
491
|
-
var $c9a532d1c973af61$exports = {};
|
|
492
|
-
$c9a532d1c973af61$exports = {
|
|
493
|
-
"colorSwatchPicker": `颜色色板`,
|
|
494
|
-
"dropzoneLabel": `放置区域`,
|
|
495
|
-
"selectPlaceholder": `选择一个项目`,
|
|
496
|
-
"tableResizer": `尺寸调整器`
|
|
497
|
-
};
|
|
498
|
-
var $34de119f14549a4b$exports = {};
|
|
499
|
-
$34de119f14549a4b$exports = {
|
|
500
|
-
"colorSwatchPicker": `色票`,
|
|
501
|
-
"dropzoneLabel": `放置區`,
|
|
502
|
-
"selectPlaceholder": `選取項目`,
|
|
503
|
-
"tableResizer": `大小調整器`
|
|
504
|
-
};
|
|
505
|
-
var $df39c1238ae2b5f3$exports = {};
|
|
506
|
-
$df39c1238ae2b5f3$exports = {
|
|
507
|
-
"ar-AE": $e038a7e7a6d81989$exports,
|
|
508
|
-
"bg-BG": $0ec14741b0133644$exports,
|
|
509
|
-
"cs-CZ": $642f7badf2405784$exports,
|
|
510
|
-
"da-DK": $30cee8d2535734ec$exports,
|
|
511
|
-
"de-DE": $c302d0504fca332a$exports,
|
|
512
|
-
"el-GR": $0d0703f2bd7e421c$exports,
|
|
513
|
-
"en-US": $cafa55beb2fc5ef3$exports,
|
|
514
|
-
"es-ES": $18ac2ceede598103$exports,
|
|
515
|
-
"et-EE": $718705a15b8a633a$exports,
|
|
516
|
-
"fi-FI": $bf36dae9ecc81ce0$exports,
|
|
517
|
-
"fr-FR": $0b4828edb010b855$exports,
|
|
518
|
-
"he-IL": $0030f210b040e540$exports,
|
|
519
|
-
"hr-HR": $1f0ebacf5a0c0fa1$exports,
|
|
520
|
-
"hu-HU": $3a706ba61f3d6bba$exports,
|
|
521
|
-
"it-IT": $0d17809e74607796$exports,
|
|
522
|
-
"ja-JP": $65a71f9a56f1398f$exports,
|
|
523
|
-
"ko-KR": $e5efad074a74abef$exports,
|
|
524
|
-
"lt-LT": $d70c2a849e55c607$exports,
|
|
525
|
-
"lv-LV": $009bbbb440d0e907$exports,
|
|
526
|
-
"nb-NO": $9366fe642464ee83$exports,
|
|
527
|
-
"nl-NL": $62f9bc1f98ea21de$exports,
|
|
528
|
-
"pl-PL": $4ec2e5b6623b1b76$exports,
|
|
529
|
-
"pt-BR": $e25098e26647cc04$exports,
|
|
530
|
-
"pt-PT": $dd39c57d242c8156$exports,
|
|
531
|
-
"ro-RO": $3b4c1ba5afd57b35$exports,
|
|
532
|
-
"ru-RU": $a455b2cda79eb746$exports,
|
|
533
|
-
"sk-SK": $b983ca1383d5b960$exports,
|
|
534
|
-
"sl-SI": $32a515ef673b0655$exports,
|
|
535
|
-
"sr-SP": $89434176ab35446b$exports,
|
|
536
|
-
"sv-SE": $727da781aca847f9$exports,
|
|
537
|
-
"tr-TR": $fcd2d84b9a2d489c$exports,
|
|
538
|
-
"uk-UA": $2422ac328687ee23$exports,
|
|
539
|
-
"zh-CN": $c9a532d1c973af61$exports,
|
|
540
|
-
"zh-TW": $34de119f14549a4b$exports
|
|
541
|
-
};
|
|
542
|
-
function $parcel$interopDefault(a) {
|
|
543
|
-
return a && a.__esModule ? a.default : a;
|
|
544
|
-
}
|
|
545
|
-
const $82d7e5349645de74$export$7540cee5be7dc19b = /* @__PURE__ */ createContext(null);
|
|
546
|
-
const $82d7e5349645de74$export$ef445b55be0601bd = /* @__PURE__ */ createContext(null);
|
|
547
|
-
const $82d7e5349645de74$export$ef9b1a59e592288f = /* @__PURE__ */ forwardRef(function Select(props, ref) {
|
|
548
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $82d7e5349645de74$export$7540cee5be7dc19b);
|
|
549
|
-
let { children, isDisabled = false, isInvalid = false, isRequired = false } = props;
|
|
550
|
-
let content = useMemo(() => typeof children === "function" ? children({
|
|
551
|
-
isOpen: false,
|
|
552
|
-
isDisabled,
|
|
553
|
-
isInvalid,
|
|
554
|
-
isRequired,
|
|
555
|
-
isFocused: false,
|
|
556
|
-
isFocusVisible: false,
|
|
557
|
-
defaultChildren: null
|
|
558
|
-
}) : children, [
|
|
559
|
-
children,
|
|
560
|
-
isDisabled,
|
|
561
|
-
isInvalid,
|
|
562
|
-
isRequired
|
|
563
|
-
]);
|
|
564
|
-
return /* @__PURE__ */ React__default.createElement($e1995378a142960e$export$bf788dd355e3a401, {
|
|
565
|
-
content
|
|
566
|
-
}, (collection) => /* @__PURE__ */ React__default.createElement($82d7e5349645de74$var$SelectInner, {
|
|
567
|
-
props,
|
|
568
|
-
collection,
|
|
569
|
-
selectRef: ref
|
|
570
|
-
}));
|
|
571
|
-
});
|
|
572
|
-
const $82d7e5349645de74$var$CLEAR_CONTEXTS = [
|
|
573
|
-
$01b77f81d0f07f68$export$75b6ee27786ba447,
|
|
574
|
-
$d2b4bc8c273e7be6$export$24d547caef80ccd1,
|
|
575
|
-
$514c0188e459b4c0$export$9afb8bc826b033ea
|
|
576
|
-
];
|
|
577
|
-
function $82d7e5349645de74$var$SelectInner({ props, selectRef: ref, collection }) {
|
|
578
|
-
let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
|
|
579
|
-
var _props_validationBehavior, _ref;
|
|
580
|
-
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
|
|
581
|
-
let state = $2bc3a590c5373a4e$export$5159ec8b34d4ec12({
|
|
582
|
-
...props,
|
|
583
|
-
collection,
|
|
584
|
-
children: void 0,
|
|
585
|
-
validationBehavior
|
|
586
|
-
});
|
|
587
|
-
let { isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f({
|
|
588
|
-
within: true
|
|
589
|
-
});
|
|
590
|
-
let buttonRef = useRef(null);
|
|
591
|
-
let [labelRef, label] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
|
|
592
|
-
let { labelProps, triggerProps, valueProps, menuProps, descriptionProps, errorMessageProps, ...validation } = $58aed456727eb0f3$export$e64b2f635402ca43({
|
|
593
|
-
...$64fa3d84918910a7$export$ef03459518577ad4(props),
|
|
594
|
-
label,
|
|
595
|
-
validationBehavior
|
|
596
|
-
}, state, buttonRef);
|
|
597
|
-
let [buttonWidth, setButtonWidth] = useState(null);
|
|
598
|
-
let onResize = useCallback(() => {
|
|
599
|
-
if (buttonRef.current) setButtonWidth(buttonRef.current.offsetWidth + "px");
|
|
600
|
-
}, [
|
|
601
|
-
buttonRef
|
|
602
|
-
]);
|
|
603
|
-
$9daab02d461809db$export$683480f191c0e3ea({
|
|
604
|
-
ref: buttonRef,
|
|
605
|
-
onResize
|
|
606
|
-
});
|
|
607
|
-
let renderPropsState = useMemo(() => ({
|
|
608
|
-
isOpen: state.isOpen,
|
|
609
|
-
isFocused: state.isFocused,
|
|
610
|
-
isFocusVisible,
|
|
611
|
-
isDisabled: props.isDisabled || false,
|
|
612
|
-
isInvalid: validation.isInvalid || false,
|
|
613
|
-
isRequired: props.isRequired || false
|
|
614
|
-
}), [
|
|
615
|
-
state.isOpen,
|
|
616
|
-
state.isFocused,
|
|
617
|
-
isFocusVisible,
|
|
618
|
-
props.isDisabled,
|
|
619
|
-
validation.isInvalid,
|
|
620
|
-
props.isRequired
|
|
621
|
-
]);
|
|
622
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
623
|
-
...props,
|
|
624
|
-
values: renderPropsState,
|
|
625
|
-
defaultClassName: "react-aria-Select"
|
|
626
|
-
});
|
|
627
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
|
|
628
|
-
delete DOMProps.id;
|
|
629
|
-
let scrollRef = useRef(null);
|
|
630
|
-
return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
631
|
-
values: [
|
|
632
|
-
[
|
|
633
|
-
$82d7e5349645de74$export$7540cee5be7dc19b,
|
|
634
|
-
props
|
|
635
|
-
],
|
|
636
|
-
[
|
|
637
|
-
$82d7e5349645de74$export$ef445b55be0601bd,
|
|
638
|
-
state
|
|
639
|
-
],
|
|
640
|
-
[
|
|
641
|
-
$82d7e5349645de74$export$f8f745c04421623f,
|
|
642
|
-
valueProps
|
|
643
|
-
],
|
|
644
|
-
[
|
|
645
|
-
$01b77f81d0f07f68$export$75b6ee27786ba447,
|
|
646
|
-
{
|
|
647
|
-
...labelProps,
|
|
648
|
-
ref: labelRef,
|
|
649
|
-
elementType: "span"
|
|
650
|
-
}
|
|
651
|
-
],
|
|
652
|
-
[
|
|
653
|
-
$d2b4bc8c273e7be6$export$24d547caef80ccd1,
|
|
654
|
-
{
|
|
655
|
-
...triggerProps,
|
|
656
|
-
ref: buttonRef,
|
|
657
|
-
isPressed: state.isOpen,
|
|
658
|
-
autoFocus: props.autoFocus
|
|
659
|
-
}
|
|
660
|
-
],
|
|
661
|
-
[
|
|
662
|
-
$de32f1b87079253c$export$d2f961adcb0afbe,
|
|
663
|
-
state
|
|
664
|
-
],
|
|
665
|
-
[
|
|
666
|
-
$07b14b47974efb58$export$9b9a0cd73afb7ca4,
|
|
667
|
-
{
|
|
668
|
-
trigger: "Select",
|
|
669
|
-
triggerRef: buttonRef,
|
|
670
|
-
scrollRef,
|
|
671
|
-
placement: "bottom start",
|
|
672
|
-
style: {
|
|
673
|
-
"--trigger-width": buttonWidth
|
|
674
|
-
},
|
|
675
|
-
"aria-labelledby": menuProps["aria-labelledby"],
|
|
676
|
-
clearContexts: $82d7e5349645de74$var$CLEAR_CONTEXTS
|
|
677
|
-
}
|
|
678
|
-
],
|
|
679
|
-
[
|
|
680
|
-
$eed445e0843c11d0$export$7ff8f37d2d81a48d,
|
|
681
|
-
{
|
|
682
|
-
...menuProps,
|
|
683
|
-
ref: scrollRef
|
|
684
|
-
}
|
|
685
|
-
],
|
|
686
|
-
[
|
|
687
|
-
$eed445e0843c11d0$export$7c5906fe4f1f2af2,
|
|
688
|
-
state
|
|
689
|
-
],
|
|
690
|
-
[
|
|
691
|
-
$514c0188e459b4c0$export$9afb8bc826b033ea,
|
|
692
|
-
{
|
|
693
|
-
slots: {
|
|
694
|
-
description: descriptionProps,
|
|
695
|
-
errorMessage: errorMessageProps
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
],
|
|
699
|
-
[
|
|
700
|
-
$ee014567cb39d3f0$export$ff05c3ac10437e03,
|
|
701
|
-
validation
|
|
702
|
-
]
|
|
703
|
-
]
|
|
704
|
-
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
705
|
-
...DOMProps,
|
|
706
|
-
...renderProps,
|
|
707
|
-
...focusProps,
|
|
708
|
-
ref,
|
|
709
|
-
slot: props.slot || void 0,
|
|
710
|
-
"data-focused": state.isFocused || void 0,
|
|
711
|
-
"data-focus-visible": isFocusVisible || void 0,
|
|
712
|
-
"data-open": state.isOpen || void 0,
|
|
713
|
-
"data-disabled": props.isDisabled || void 0,
|
|
714
|
-
"data-invalid": validation.isInvalid || void 0,
|
|
715
|
-
"data-required": props.isRequired || void 0
|
|
716
|
-
}), /* @__PURE__ */ React__default.createElement($bdd25dc72710631f$export$cbd84cdb2e668835, {
|
|
717
|
-
autoComplete: props.autoComplete,
|
|
718
|
-
state,
|
|
719
|
-
triggerRef: buttonRef,
|
|
720
|
-
label,
|
|
721
|
-
name: props.name,
|
|
722
|
-
isDisabled: props.isDisabled
|
|
723
|
-
}));
|
|
724
|
-
}
|
|
725
|
-
const $82d7e5349645de74$export$f8f745c04421623f = /* @__PURE__ */ createContext(null);
|
|
726
|
-
const $82d7e5349645de74$export$e288731fd71264f0 = /* @__PURE__ */ forwardRef(function SelectValue(props, ref) {
|
|
727
|
-
var _state_selectedItem, _state_selectedItem1;
|
|
728
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $82d7e5349645de74$export$f8f745c04421623f);
|
|
729
|
-
let state = useContext($82d7e5349645de74$export$ef445b55be0601bd);
|
|
730
|
-
let { placeholder } = $64fa3d84918910a7$export$fabf2dc03a41866e($82d7e5349645de74$export$7540cee5be7dc19b);
|
|
731
|
-
let selectedItem = state.selectedKey != null ? state.collection.getItem(state.selectedKey) : null;
|
|
732
|
-
let rendered = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.props.children;
|
|
733
|
-
if (typeof rendered === "function") {
|
|
734
|
-
let fn = rendered;
|
|
735
|
-
rendered = fn({
|
|
736
|
-
isHovered: false,
|
|
737
|
-
isPressed: false,
|
|
738
|
-
isSelected: false,
|
|
739
|
-
isFocused: false,
|
|
740
|
-
isFocusVisible: false,
|
|
741
|
-
isDisabled: false,
|
|
742
|
-
selectionMode: "single",
|
|
743
|
-
selectionBehavior: "toggle"
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1($parcel$interopDefault($df39c1238ae2b5f3$exports), "react-aria-components");
|
|
747
|
-
var _ref, _state_selectedItem_value, _state_selectedItem_textValue;
|
|
748
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
749
|
-
...props,
|
|
750
|
-
defaultChildren: (_ref = rendered !== null && rendered !== void 0 ? rendered : placeholder) !== null && _ref !== void 0 ? _ref : stringFormatter.format("selectPlaceholder"),
|
|
751
|
-
defaultClassName: "react-aria-SelectValue",
|
|
752
|
-
values: {
|
|
753
|
-
selectedItem: (_state_selectedItem_value = (_state_selectedItem = state.selectedItem) === null || _state_selectedItem === void 0 ? void 0 : _state_selectedItem.value) !== null && _state_selectedItem_value !== void 0 ? _state_selectedItem_value : null,
|
|
754
|
-
selectedText: (_state_selectedItem_textValue = (_state_selectedItem1 = state.selectedItem) === null || _state_selectedItem1 === void 0 ? void 0 : _state_selectedItem1.textValue) !== null && _state_selectedItem_textValue !== void 0 ? _state_selectedItem_textValue : null,
|
|
755
|
-
isPlaceholder: !selectedItem
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
|
|
759
|
-
return /* @__PURE__ */ React__default.createElement("span", {
|
|
760
|
-
ref,
|
|
761
|
-
...DOMProps,
|
|
762
|
-
...renderProps,
|
|
763
|
-
"data-placeholder": !selectedItem || void 0
|
|
764
|
-
}, /* @__PURE__ */ React__default.createElement($514c0188e459b4c0$export$9afb8bc826b033ea.Provider, {
|
|
765
|
-
value: void 0
|
|
766
|
-
}, renderProps.children));
|
|
767
|
-
});
|
|
16
|
+
import { c as clsx } from "../../../utils-CZt7LCbO.js";
|
|
17
|
+
import { $ as $bb77f239b46e8c72$export$3274cf84b703fff } from "../../../useFilter-BR5z1A4Q.js";
|
|
768
18
|
/**
|
|
769
19
|
* Select menu.
|
|
770
20
|
*
|
|
@@ -785,10 +35,12 @@ const $82d7e5349645de74$export$e288731fd71264f0 = /* @__PURE__ */ forwardRef(fun
|
|
|
785
35
|
* @param {string} [props.placeholder] - Placeholder text to show when no value is selected.
|
|
786
36
|
* @param {JSX.Element} [props.customMenuOption] - If provided, replaces the default item in the dropdown menu (react-select's `components.Option`).
|
|
787
37
|
* @param {JSX.Element} [props.customValueDisplay] - If provided, replaces the default current value display of each selected item (react-select's `components.MultiValue`).
|
|
38
|
+
* @param {JSX.Element} [props.customDropdownArrow] - If provided, replaces the default dropdown arrow indicator.
|
|
788
39
|
* @param {string} [props.className] - Classes to pass to the select menu.
|
|
40
|
+
* @param {boolean} [props.noMinWidth=false] - If `true`, the select menu will not have a minimum width.
|
|
789
41
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
790
42
|
*
|
|
791
|
-
* @returns {JSX.Element} The
|
|
43
|
+
* @returns {JSX.Element} The SelectNext component.
|
|
792
44
|
*
|
|
793
45
|
* @example
|
|
794
46
|
* const [value, setValue] = useState(null);
|
|
@@ -799,7 +51,7 @@ const $82d7e5349645de74$export$e288731fd71264f0 = /* @__PURE__ */ forwardRef(fun
|
|
|
799
51
|
* { label: 'Option 3', value: 'option-3' },
|
|
800
52
|
* ];
|
|
801
53
|
*
|
|
802
|
-
* <
|
|
54
|
+
* <SelectNext
|
|
803
55
|
* label='Select items'
|
|
804
56
|
* options={loadOptions}
|
|
805
57
|
* value={value}
|
|
@@ -808,7 +60,7 @@ const $82d7e5349645de74$export$e288731fd71264f0 = /* @__PURE__ */ forwardRef(fun
|
|
|
808
60
|
*
|
|
809
61
|
* @preserve
|
|
810
62
|
*/
|
|
811
|
-
const
|
|
63
|
+
const SelectNext = (props) => {
|
|
812
64
|
const {
|
|
813
65
|
icon,
|
|
814
66
|
help,
|
|
@@ -822,17 +74,22 @@ const __ExperimentalSelect = (props) => {
|
|
|
822
74
|
simpleValue = false,
|
|
823
75
|
disabled = false,
|
|
824
76
|
clearable = false,
|
|
825
|
-
placeholder,
|
|
77
|
+
placeholder = __("Select...", "eightshift-ui-components"),
|
|
826
78
|
customMenuOption,
|
|
827
79
|
customValueDisplay,
|
|
80
|
+
customDropdownArrow,
|
|
828
81
|
className,
|
|
829
|
-
|
|
82
|
+
noMinWidth = false,
|
|
83
|
+
searchable,
|
|
84
|
+
hidden,
|
|
85
|
+
...rest
|
|
830
86
|
} = props;
|
|
831
87
|
const ref = useRef();
|
|
88
|
+
const currentValue = simpleValue ? value ?? null : value?.value ?? null;
|
|
89
|
+
const { contains } = $bb77f239b46e8c72$export$3274cf84b703fff({ sensitivity: "base" });
|
|
832
90
|
if (hidden) {
|
|
833
91
|
return null;
|
|
834
92
|
}
|
|
835
|
-
const currentValue = (value == null ? void 0 : value.value) ?? value ?? null;
|
|
836
93
|
return /* @__PURE__ */ jsx(
|
|
837
94
|
$82d7e5349645de74$export$ef9b1a59e592288f,
|
|
838
95
|
{
|
|
@@ -857,6 +114,7 @@ const __ExperimentalSelect = (props) => {
|
|
|
857
114
|
onChange(item);
|
|
858
115
|
},
|
|
859
116
|
placeholder,
|
|
117
|
+
...rest,
|
|
860
118
|
children: /* @__PURE__ */ jsxs(
|
|
861
119
|
BaseControl,
|
|
862
120
|
{
|
|
@@ -872,108 +130,201 @@ const __ExperimentalSelect = (props) => {
|
|
|
872
130
|
"div",
|
|
873
131
|
{
|
|
874
132
|
className: clsx(
|
|
875
|
-
"es:relative es:flex es:
|
|
133
|
+
"es:relative es:flex es:items-center es:gap-1 es:px-1.5 es:focus-visible:outline-hidden es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
|
|
876
134
|
"es:h-9 es:rounded-10 es:border es:border-secondary-300 es:bg-white es:text-sm es:shadow-sm es:transition",
|
|
135
|
+
"es:inset-ring es:inset-ring-secondary-100",
|
|
877
136
|
"es:any-focus:outline-hidden",
|
|
137
|
+
!noMinWidth && "es:min-w-48",
|
|
878
138
|
!inline && "es:w-full",
|
|
879
|
-
disabled && "es:select-none",
|
|
880
|
-
"es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:border-accent-500 es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:ring-2 es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:ring-accent-500/50"
|
|
139
|
+
disabled && "es:select-none es:shadow-none!",
|
|
140
|
+
"es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:border-accent-500 es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:ring-2 es:has-[[aria-haspopup=listbox][data-focus-visible=true],[aria-autocomplete=list][data-focus-visible=true]]:ring-accent-500/50",
|
|
141
|
+
className
|
|
881
142
|
),
|
|
882
143
|
ref,
|
|
883
144
|
children: [
|
|
884
|
-
/* @__PURE__ */ jsxs(
|
|
885
|
-
$
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
"es:
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
145
|
+
/* @__PURE__ */ jsxs($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { className: "es:any-focus:outline-hidden es:text-start es:size-full es:inline-block es:group es:overflow-x-clip", children: [
|
|
146
|
+
/* @__PURE__ */ jsx($82d7e5349645de74$export$e288731fd71264f0, { children: ({ isPlaceholder, selectedItem }) => {
|
|
147
|
+
if (!isPlaceholder && currentValue && customValueDisplay) {
|
|
148
|
+
return customValueDisplay(selectedItem);
|
|
149
|
+
}
|
|
150
|
+
if (!currentValue) {
|
|
151
|
+
return /* @__PURE__ */ jsx("span", { className: "es:pointer-events-none es:pr-6 es:text-sm es:text-secondary-500", children: placeholder });
|
|
152
|
+
}
|
|
153
|
+
let icon2 = selectedItem?.icon ?? null;
|
|
154
|
+
if (typeof selectedItem?.icon === "string") {
|
|
155
|
+
icon2 = icons?.[selectedItem.icon] ?? null;
|
|
156
|
+
}
|
|
157
|
+
return /* @__PURE__ */ jsx(
|
|
158
|
+
RichLabel,
|
|
159
|
+
{
|
|
160
|
+
icon: icon2,
|
|
161
|
+
label: selectedItem?.label,
|
|
162
|
+
subtitle: selectedItem.subtitle,
|
|
163
|
+
className: clsx("es:pr-6 es:grow es:w-full", disabled && "es:grayscale es:pointer-events-none"),
|
|
164
|
+
iconClassName: "es:pointer-events-none es:select-none"
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
} }),
|
|
168
|
+
/* @__PURE__ */ jsxs(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: clsx("es:absolute es:bottom-0 es:right-1 es:top-0 es:my-auto es:flex es:items-center", disabled ? "es:text-secondary-300" : "es:text-secondary-500"),
|
|
172
|
+
"aria-hidden": "true",
|
|
173
|
+
children: [
|
|
174
|
+
!customDropdownArrow && cloneElement(icons.dropdownCaretAlt, {
|
|
175
|
+
className: "es:w-4 es:group-aria-expanded:-scale-y-100 es:transition-transform es:duration-200"
|
|
176
|
+
}),
|
|
177
|
+
customDropdownArrow && /* @__PURE__ */ jsx(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
"aria-hidden": "true",
|
|
181
|
+
className: "es:group-aria-expanded:-scale-y-100 es:transition-transform es:duration-200",
|
|
182
|
+
children: customDropdownArrow
|
|
905
183
|
}
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
subtitle: selectedItem.subtitle
|
|
912
|
-
}
|
|
913
|
-
);
|
|
914
|
-
}
|
|
915
|
-
return defaultChildren;
|
|
916
|
-
} }),
|
|
917
|
-
/* @__PURE__ */ jsx(
|
|
918
|
-
"div",
|
|
919
|
-
{
|
|
920
|
-
className: clsx("es:absolute es:bottom-0 es:right-1 es:top-0 es:my-auto es:flex es:items-center", disabled ? "es:text-secondary-300" : "es:text-secondary-500"),
|
|
921
|
-
"aria-hidden": "true",
|
|
922
|
-
children: cloneElement(icons.dropdownCaretAlt, {
|
|
923
|
-
className: "es:w-5.5 es:group-aria-expanded:-scale-y-100 es:transition-transform es:duration-200"
|
|
924
|
-
})
|
|
925
|
-
}
|
|
926
|
-
)
|
|
927
|
-
]
|
|
928
|
-
}
|
|
929
|
-
),
|
|
184
|
+
)
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] }),
|
|
930
189
|
clearable && /* @__PURE__ */ jsx(SelectClearButton, {})
|
|
931
190
|
]
|
|
932
191
|
}
|
|
933
192
|
),
|
|
934
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ jsxs(
|
|
935
194
|
$07b14b47974efb58$export$5b6b19405a83ff9d,
|
|
936
195
|
{
|
|
937
196
|
className: ({ isEntering, isExiting }) => clsx(
|
|
938
|
-
"es:flex es:min-w-9 es:max-w-
|
|
197
|
+
"es:flex es:w-76 es:min-w-9 es:max-w-76 es:flex-col es:-hidden es:rounded-2xl es:border es:border-secondary-200 es:bg-white es:text-sm es:shadow-xl es:inset-ring es:inset-ring-secondary-100",
|
|
939
198
|
"es:any-focus:outline-hidden",
|
|
940
|
-
|
|
941
|
-
|
|
199
|
+
"es:motion-safe:motion-duration-200 es:motion-safe:motion-ease-spring-bouncy",
|
|
200
|
+
"es:placement-bottom:origin-top-left es:placement-top:origin-bottom-left",
|
|
201
|
+
"es:placement-left:origin-right es:placement-right:origin-left",
|
|
202
|
+
isEntering && "es:motion-safe:motion-scale-in-95 es:motion-opacity-in-0",
|
|
203
|
+
isEntering && "es:motion-safe:placement-top:motion-translate-y-in-[5%] es:motion-safe:placement-bottom:motion-translate-y-in-[-5%] es:motion-safe:placement-left:motion-translate-x-in-[5%] es:motion-safe:placement-right:motion-translate-x-in-[-5%]",
|
|
204
|
+
isExiting && "es:motion-safe:motion-scale-out-95 es:motion-opacity-out-0",
|
|
205
|
+
isExiting && "es:motion-safe:placement-top:motion-translate-y-out-[5%] es:motion-safe:placement-bottom:motion-translate-y-out-[-5%] es:motion-safe:placement-left:motion-translate-x-out-[5%] es:motion-safe:placement-right:motion-translate-x-out-[-5%]"
|
|
942
206
|
),
|
|
943
207
|
placement: "bottom left",
|
|
944
208
|
triggerRef: ref,
|
|
945
|
-
children:
|
|
946
|
-
$
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
209
|
+
children: [
|
|
210
|
+
searchable && /* @__PURE__ */ jsxs($d2f53cda644affe3$export$2f2b9559550c7bbc, { filter: contains, children: [
|
|
211
|
+
/* @__PURE__ */ jsxs(
|
|
212
|
+
$440f4836bcb56932$export$b94867ecbd698f21,
|
|
213
|
+
{
|
|
214
|
+
"aria-label": __("Search", "eightshift-ui-components"),
|
|
215
|
+
className: "es:flex es:items-center es:bg-secondary-100 es:m-2 es:rounded-lg es:relative es:placeholder:text-secondary-500",
|
|
216
|
+
autoFocus: true,
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ jsx(
|
|
219
|
+
$3985021b0ad6602f$export$f5b8910cec6cf069,
|
|
220
|
+
{
|
|
221
|
+
placeholder: __("Search...", "eightshift-ui-components"),
|
|
222
|
+
className: "es:peer es:size-full es:h-9 es:outline-hidden es:px-2.5 es:shadow-none es:text-sm es:py-0 es:[&::-webkit-search-cancel-button]:hidden"
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ jsx(
|
|
226
|
+
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
227
|
+
{
|
|
228
|
+
"aria-label": __("Clear", "eightshift-ui-components"),
|
|
229
|
+
className: clsx(
|
|
230
|
+
"es:absolute es:right-2 es:top-0 es:bottom-0 es:my-auto",
|
|
231
|
+
"es:flex es:size-6 es:items-center es:justify-center es:rounded es:text-sm es:text-secondary-600 es:transition es:hover:bg-red-50 es:hover:text-red-900 es:any-focus:outline-hidden es:focus:ring-2 es:focus:ring-accent-500/50 es:disabled:text-secondary-300 es:cursor-pointer",
|
|
232
|
+
"es:peer-placeholder-shown:opacity-0"
|
|
233
|
+
),
|
|
234
|
+
children: icons.clearAlt
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ jsx("div", { className: "es:w-full es:h-px es:bg-secondary-200 es:shrink-0" }),
|
|
241
|
+
/* @__PURE__ */ jsx(
|
|
242
|
+
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
243
|
+
{
|
|
244
|
+
className: "es:space-y-0.5 es:p-1 es:any-focus:outline-hidden es:max-h-72 es:overflow-y-auto",
|
|
245
|
+
items: options,
|
|
246
|
+
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
247
|
+
RichLabel,
|
|
248
|
+
{
|
|
249
|
+
icon: icons.searchEmpty,
|
|
250
|
+
label: __("No results", "eightshift-ui-components"),
|
|
251
|
+
subtitle: __("Try a different search term", "eightshift-ui-components"),
|
|
252
|
+
className: "es:min-h-14 es:p-2 es:w-fit es:mx-auto es:motion-preset-slide-up es:motion-ease-spring-bouncy es:motion-duration-200",
|
|
253
|
+
iconClassName: "es:text-accent-700 es:icon:size-7!",
|
|
254
|
+
noColor: true
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
children: (item) => {
|
|
258
|
+
let icon2 = item?.icon ?? null;
|
|
259
|
+
if (typeof item?.icon === "string") {
|
|
260
|
+
icon2 = icons?.[item.icon] ?? null;
|
|
261
|
+
}
|
|
262
|
+
return /* @__PURE__ */ jsxs(
|
|
263
|
+
OptionItemBase,
|
|
264
|
+
{
|
|
265
|
+
id: item.value,
|
|
266
|
+
className: item?.className,
|
|
267
|
+
children: [
|
|
268
|
+
customMenuOption && customMenuOption(item),
|
|
269
|
+
!customMenuOption && /* @__PURE__ */ jsx(
|
|
270
|
+
RichLabel,
|
|
271
|
+
{
|
|
272
|
+
icon: icon2,
|
|
273
|
+
label: item?.label,
|
|
274
|
+
subtitle: item.subtitle
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
}
|
|
955
281
|
}
|
|
956
|
-
|
|
957
|
-
|
|
282
|
+
)
|
|
283
|
+
] }),
|
|
284
|
+
!searchable && /* @__PURE__ */ jsx(
|
|
285
|
+
$eed445e0843c11d0$export$41f133550aa26f48,
|
|
286
|
+
{
|
|
287
|
+
className: "es:space-y-0.5 es:p-1 es:any-focus:outline-hidden",
|
|
288
|
+
items: options,
|
|
289
|
+
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
290
|
+
RichLabel,
|
|
958
291
|
{
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
{
|
|
966
|
-
icon: icon2,
|
|
967
|
-
label: item == null ? void 0 : item.label,
|
|
968
|
-
subtitle: item.subtitle
|
|
969
|
-
}
|
|
970
|
-
)
|
|
971
|
-
]
|
|
292
|
+
icon: icons.searchEmpty,
|
|
293
|
+
label: __("No results", "eightshift-ui-components"),
|
|
294
|
+
subtitle: __("Try a different search term", "eightshift-ui-components"),
|
|
295
|
+
className: "es:min-h-14 es:p-2 es:w-fit es:mx-auto es:motion-preset-slide-up es:motion-ease-spring-bouncy es:motion-duration-200",
|
|
296
|
+
iconClassName: "es:text-accent-700 es:icon:size-7!",
|
|
297
|
+
noColor: true
|
|
972
298
|
}
|
|
973
|
-
)
|
|
299
|
+
),
|
|
300
|
+
children: (item) => {
|
|
301
|
+
let icon2 = item?.icon ?? null;
|
|
302
|
+
if (typeof item?.icon === "string") {
|
|
303
|
+
icon2 = icons?.[item.icon] ?? null;
|
|
304
|
+
}
|
|
305
|
+
return /* @__PURE__ */ jsxs(
|
|
306
|
+
OptionItemBase,
|
|
307
|
+
{
|
|
308
|
+
id: item.value,
|
|
309
|
+
className: item?.className,
|
|
310
|
+
children: [
|
|
311
|
+
customMenuOption && customMenuOption(item),
|
|
312
|
+
!customMenuOption && /* @__PURE__ */ jsx(
|
|
313
|
+
RichLabel,
|
|
314
|
+
{
|
|
315
|
+
icon: icon2,
|
|
316
|
+
label: item?.label,
|
|
317
|
+
subtitle: item.subtitle,
|
|
318
|
+
noColor: true
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
974
325
|
}
|
|
975
|
-
|
|
976
|
-
|
|
326
|
+
)
|
|
327
|
+
]
|
|
977
328
|
}
|
|
978
329
|
)
|
|
979
330
|
]
|
|
@@ -984,7 +335,7 @@ const __ExperimentalSelect = (props) => {
|
|
|
984
335
|
};
|
|
985
336
|
const SelectClearButton = () => {
|
|
986
337
|
const state = useContext($82d7e5349645de74$export$ef445b55be0601bd);
|
|
987
|
-
const isEmpty =
|
|
338
|
+
const isEmpty = state?.selectedKey === null;
|
|
988
339
|
return /* @__PURE__ */ jsx(
|
|
989
340
|
$d2b4bc8c273e7be6$export$353f5b6fc5456de1,
|
|
990
341
|
{
|
|
@@ -993,12 +344,12 @@ const SelectClearButton = () => {
|
|
|
993
344
|
"es:mr-6 es:flex es:h-6 es:w-8 es:items-center es:justify-center es:rounded es:text-sm es:text-secondary-600 es:transition es:hover:bg-red-50 es:hover:text-red-900 es:any-focus:outline-hidden es:focus:ring-2 es:focus:ring-accent-500/50 es:disabled:text-secondary-300 es:cursor-pointer",
|
|
994
345
|
isEmpty ? "es:hidden" : "es:flex"
|
|
995
346
|
),
|
|
996
|
-
onPress: () => state
|
|
347
|
+
onPress: () => state?.setSelectedKey(null),
|
|
997
348
|
slot: null,
|
|
998
349
|
children: icons.clearAlt
|
|
999
350
|
}
|
|
1000
351
|
);
|
|
1001
352
|
};
|
|
1002
353
|
export {
|
|
1003
|
-
|
|
354
|
+
SelectNext
|
|
1004
355
|
};
|