msw-dev-tool 3.1.3 → 3.2.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/cjs/lib/handlerStore.js +38 -15
- package/dist/cjs/lib/handlerStore.js.map +1 -1
- package/dist/cjs/lib/types/core.js +19 -0
- package/dist/cjs/lib/types/core.js.map +1 -0
- package/dist/cjs/lib/types/http.js +71 -0
- package/dist/cjs/lib/types/http.js.map +1 -0
- package/dist/cjs/lib/types/utils.js +10 -0
- package/dist/cjs/lib/types/utils.js.map +1 -0
- package/dist/cjs/lib/{util.js → utils/index.js} +11 -10
- package/dist/cjs/lib/utils/index.js.map +1 -0
- package/dist/cjs/msw-dev-tool.css +1 -1
- package/dist/cjs/node_modules/@hookform/resolvers/dist/resolvers.js +9 -0
- package/dist/cjs/node_modules/@hookform/resolvers/dist/resolvers.js.map +1 -0
- package/dist/cjs/node_modules/@hookform/resolvers/zod/dist/zod.js +9 -0
- package/dist/cjs/node_modules/@hookform/resolvers/zod/dist/zod.js.map +1 -0
- package/dist/cjs/node_modules/@radix-ui/react-select/dist/index.js +81 -81
- package/dist/cjs/node_modules/react-hook-form/dist/index.esm.js +1930 -0
- package/dist/cjs/node_modules/react-hook-form/dist/index.esm.js.map +1 -0
- package/dist/cjs/schema/handler.js +68 -0
- package/dist/cjs/schema/handler.js.map +1 -0
- package/dist/cjs/ui/DevToolContent/Form/FormFieldBase.js +1 -1
- package/dist/cjs/ui/DevToolContent/Form/FormFieldBase.js.map +1 -1
- package/dist/cjs/ui/DevToolContent/Form/Select.js +4 -3
- package/dist/cjs/ui/DevToolContent/Form/Select.js.map +1 -1
- package/dist/cjs/ui/DevToolContent/Form/SelectFormField.js +9 -3
- package/dist/cjs/ui/DevToolContent/Form/SelectFormField.js.map +1 -1
- package/dist/cjs/ui/DevToolContent/HandlerTable/BehaviorSelect.js +4 -3
- package/dist/cjs/ui/DevToolContent/HandlerTable/BehaviorSelect.js.map +1 -1
- package/dist/cjs/ui/DevToolContent/ToolButtonGroup/HandlerForm.js +33 -35
- package/dist/cjs/ui/DevToolContent/ToolButtonGroup/HandlerForm.js.map +1 -1
- package/dist/cjs/ui/DevToolContent/ToolButtonGroup/util.js +25 -0
- package/dist/cjs/ui/DevToolContent/ToolButtonGroup/util.js.map +1 -1
- package/dist/esm/lib/handlerStore.js +31 -8
- package/dist/esm/lib/handlerStore.js.map +1 -1
- package/dist/esm/lib/types/core.js +16 -0
- package/dist/esm/lib/types/core.js.map +1 -0
- package/dist/esm/lib/types/http.js +64 -0
- package/dist/esm/lib/types/http.js.map +1 -0
- package/dist/esm/lib/types/utils.js +8 -0
- package/dist/esm/lib/types/utils.js.map +1 -0
- package/dist/esm/lib/{util.js → utils/index.js} +5 -4
- package/dist/esm/lib/utils/index.js.map +1 -0
- package/dist/esm/msw-dev-tool.css +1 -1
- package/dist/esm/node_modules/@hookform/resolvers/dist/resolvers.js +6 -0
- package/dist/esm/node_modules/@hookform/resolvers/dist/resolvers.js.map +1 -0
- package/dist/esm/node_modules/@hookform/resolvers/zod/dist/zod.js +7 -0
- package/dist/esm/node_modules/@hookform/resolvers/zod/dist/zod.js.map +1 -0
- package/dist/esm/node_modules/@radix-ui/react-select/dist/index.js +2 -2
- package/dist/esm/node_modules/react-hook-form/dist/index.esm.js +1924 -0
- package/dist/esm/node_modules/react-hook-form/dist/index.esm.js.map +1 -0
- package/dist/esm/schema/handler.js +66 -0
- package/dist/esm/schema/handler.js.map +1 -0
- package/dist/esm/ui/DevToolContent/Form/FormFieldBase.js +1 -1
- package/dist/esm/ui/DevToolContent/Form/FormFieldBase.js.map +1 -1
- package/dist/esm/ui/DevToolContent/Form/Select.js +7 -6
- package/dist/esm/ui/DevToolContent/Form/Select.js.map +1 -1
- package/dist/esm/ui/DevToolContent/Form/SelectFormField.js +10 -4
- package/dist/esm/ui/DevToolContent/Form/SelectFormField.js.map +1 -1
- package/dist/esm/ui/DevToolContent/HandlerTable/BehaviorSelect.js +2 -1
- package/dist/esm/ui/DevToolContent/HandlerTable/BehaviorSelect.js.map +1 -1
- package/dist/esm/ui/DevToolContent/ToolButtonGroup/HandlerForm.js +34 -36
- package/dist/esm/ui/DevToolContent/ToolButtonGroup/HandlerForm.js.map +1 -1
- package/dist/esm/ui/DevToolContent/ToolButtonGroup/util.js +22 -1
- package/dist/esm/ui/DevToolContent/ToolButtonGroup/util.js.map +1 -1
- package/dist/types/index.d.ts +21 -20
- package/package.json +6 -1
- package/dist/cjs/lib/type.js +0 -57
- package/dist/cjs/lib/type.js.map +0 -1
- package/dist/cjs/lib/util.js.map +0 -1
- package/dist/cjs/ui/DevToolContent/ToolButtonGroup/schema.js +0 -31
- package/dist/cjs/ui/DevToolContent/ToolButtonGroup/schema.js.map +0 -1
- package/dist/esm/lib/type.js +0 -52
- package/dist/esm/lib/type.js.map +0 -1
- package/dist/esm/lib/util.js.map +0 -1
- package/dist/esm/ui/DevToolContent/ToolButtonGroup/schema.js +0 -29
- package/dist/esm/ui/DevToolContent/ToolButtonGroup/schema.js.map +0 -1
@@ -0,0 +1,9 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var index_esm = require('../../../react-hook-form/dist/index.esm.js');
|
4
|
+
|
5
|
+
const r=(t,r,o)=>{if(t&&"reportValidity"in t){const s=index_esm.get(o,r);t.setCustomValidity(s&&s.message||""),t.reportValidity();}},o=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&"reportValidity"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e));}},s=(r,s)=>{s.shouldUseNativeValidation&&o(r,s);const n={};for(const o in r){const f=index_esm.get(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},index_esm.get(n,o));index_esm.set(r,"root",c),index_esm.set(n,o,r);}else index_esm.set(n,o,c);}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\.\\d+`))};function n(e){return e.replace(/\]|\[/g,"")}
|
6
|
+
|
7
|
+
exports.toNestErrors = s;
|
8
|
+
exports.validateFieldsNatively = o;
|
9
|
+
//# sourceMappingURL=resolvers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resolvers.js","sources":["../../../../../../../../node_modules/@hookform/resolvers/dist/resolvers.mjs"],"sourcesContent":["import{get as e,set as t}from\"react-hook-form\";const r=(t,r,o)=>{if(t&&\"reportValidity\"in t){const s=e(o,r);t.setCustomValidity(s&&s.message||\"\"),t.reportValidity()}},o=(e,t)=>{for(const o in t.fields){const s=t.fields[o];s&&s.ref&&\"reportValidity\"in s.ref?r(s.ref,o,e):s&&s.refs&&s.refs.forEach(t=>r(t,o,e))}},s=(r,s)=>{s.shouldUseNativeValidation&&o(r,s);const n={};for(const o in r){const f=e(s.fields,o),c=Object.assign(r[o]||{},{ref:f&&f.ref});if(i(s.names||Object.keys(r),o)){const r=Object.assign({},e(n,o));t(r,\"root\",c),t(n,o,r)}else t(n,o,c)}return n},i=(e,t)=>{const r=n(t);return e.some(e=>n(e).match(`^${r}\\\\.\\\\d+`))};function n(e){return e.replace(/\\]|\\[/g,\"\")}export{s as toNestErrors,o as validateFieldsNatively};\n//# sourceMappingURL=resolvers.mjs.map\n"],"names":["e","t"],"mappings":";;;;AAAoD,MAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,gBAAgB,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAACA,aAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAACA,aAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAACA,aAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACC,aAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAACA,aAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,KAAKA,aAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;;;;;","x_google_ignoreList":[0]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var resolvers = require('../../dist/resolvers.js');
|
4
|
+
var index_esm = require('../../../../react-hook-form/dist/index.esm.js');
|
5
|
+
|
6
|
+
function n(r,e){for(var n={};r.length;){var s=r[0],t=s.code,i=s.message,a=s.path.join(".");if(!n[a])if("unionErrors"in s){var u=s.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code};}else n[a]={message:i,type:t};if("unionErrors"in s&&s.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[s.code];n[a]=index_esm.appendErrors(a,e,n,t,f?[].concat(f,s.message):s.message);}r.shift();}return n}function s(o,s,t){return void 0===t&&(t={}),function(i,a,u){try{return Promise.resolve(function(e,n){try{var a=Promise.resolve(o["sync"===t.mode?"parse":"parseAsync"](i,s)).then(function(e){return u.shouldUseNativeValidation&&resolvers.validateFieldsNatively({},u),{errors:{},values:t.raw?Object.assign({},i):e}});}catch(r){return n(r)}return a&&a.then?a.then(void 0,n):a}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return {values:{},errors:resolvers.toNestErrors(n(r.errors,!u.shouldUseNativeValidation&&"all"===u.criteriaMode),u)};throw r}))}catch(r){return Promise.reject(r)}}}
|
7
|
+
|
8
|
+
exports.zodResolver = s;
|
9
|
+
//# sourceMappingURL=zod.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"zod.js","sources":["../../../../../../../../../node_modules/@hookform/resolvers/zod/dist/zod.mjs"],"sourcesContent":["import{validateFieldsNatively as r,toNestErrors as e}from\"@hookform/resolvers\";import{appendErrors as o}from\"react-hook-form\";function n(r,e){for(var n={};r.length;){var s=r[0],t=s.code,i=s.message,a=s.path.join(\".\");if(!n[a])if(\"unionErrors\"in s){var u=s.unionErrors[0].errors[0];n[a]={message:u.message,type:u.code}}else n[a]={message:i,type:t};if(\"unionErrors\"in s&&s.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return r.push(e)})}),e){var c=n[a].types,f=c&&c[s.code];n[a]=o(a,e,n,t,f?[].concat(f,s.message):s.message)}r.shift()}return n}function s(o,s,t){return void 0===t&&(t={}),function(i,a,u){try{return Promise.resolve(function(e,n){try{var a=Promise.resolve(o[\"sync\"===t.mode?\"parse\":\"parseAsync\"](i,s)).then(function(e){return u.shouldUseNativeValidation&&r({},u),{errors:{},values:t.raw?Object.assign({},i):e}})}catch(r){return n(r)}return a&&a.then?a.then(void 0,n):a}(0,function(r){if(function(r){return Array.isArray(null==r?void 0:r.errors)}(r))return{values:{},errors:e(n(r.errors,!u.shouldUseNativeValidation&&\"all\"===u.criteriaMode),u)};throw r}))}catch(r){return Promise.reject(r)}}}export{s as zodResolver};\n//# sourceMappingURL=zod.module.js.map\n"],"names":["o","r","e"],"mappings":"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","x_google_ignoreList":[0]}
|
@@ -2,26 +2,26 @@
|
|
2
2
|
|
3
3
|
var React = require('react');
|
4
4
|
var ReactDOM = require('react-dom');
|
5
|
-
var index$
|
6
|
-
var index$
|
5
|
+
var index$j = require('../../number/dist/index.js');
|
6
|
+
var index$8 = require('../../primitive/dist/index.js');
|
7
7
|
var index = require('../../react-collection/dist/index.js');
|
8
|
-
var index$
|
8
|
+
var index$6 = require('../../react-compose-refs/dist/index.js');
|
9
9
|
var index$1 = require('../../react-context/dist/index.js');
|
10
|
-
var index$
|
11
|
-
var index$
|
12
|
-
var index$
|
13
|
-
var index$
|
14
|
-
var index$
|
10
|
+
var index$3 = require('../../react-direction/dist/index.js');
|
11
|
+
var index$f = require('../../react-dismissable-layer/dist/index.js');
|
12
|
+
var index$c = require('../../react-focus-guards/dist/index.js');
|
13
|
+
var index$e = require('../../react-focus-scope/dist/index.js');
|
14
|
+
var index$5 = require('../../react-id/dist/index.js');
|
15
15
|
var index$2 = require('../../react-popper/dist/index.js');
|
16
|
-
var index$
|
17
|
-
var index$
|
18
|
-
var index$
|
19
|
-
var index$
|
20
|
-
var index$
|
21
|
-
var index$
|
22
|
-
var index$
|
23
|
-
var index$
|
24
|
-
var index$
|
16
|
+
var index$a = require('../../react-portal/dist/index.js');
|
17
|
+
var index$7 = require('../../react-primitive/dist/index.js');
|
18
|
+
var index$d = require('../../react-slot/dist/index.js');
|
19
|
+
var index$i = require('../../react-use-callback-ref/dist/index.js');
|
20
|
+
var index$4 = require('../../react-use-controllable-state/dist/index.js');
|
21
|
+
var index$9 = require('../../react-use-layout-effect/dist/index.js');
|
22
|
+
var index$g = require('../../react-use-previous/dist/index.js');
|
23
|
+
var index$h = require('../../react-visually-hidden/dist/index.js');
|
24
|
+
var index$b = require('../../../aria-hidden/dist/es2015/index.js');
|
25
25
|
var Combination = require('../../../react-remove-scroll/dist/es2015/Combination.js');
|
26
26
|
var jsxRuntime = require('react/jsx-runtime');
|
27
27
|
|
@@ -77,13 +77,13 @@ var Select = (props) => {
|
|
77
77
|
const [trigger, setTrigger] = React__namespace.useState(null);
|
78
78
|
const [valueNode, setValueNode] = React__namespace.useState(null);
|
79
79
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React__namespace.useState(false);
|
80
|
-
const direction = index$
|
81
|
-
const [open = false, setOpen] = index$
|
80
|
+
const direction = index$3.useDirection(dir);
|
81
|
+
const [open = false, setOpen] = index$4.useControllableState({
|
82
82
|
prop: openProp,
|
83
83
|
defaultProp: defaultOpen,
|
84
84
|
onChange: onOpenChange
|
85
85
|
});
|
86
|
-
const [value, setValue] = index$
|
86
|
+
const [value, setValue] = index$4.useControllableState({
|
87
87
|
prop: valueProp,
|
88
88
|
defaultProp: defaultValue,
|
89
89
|
onChange: onValueChange
|
@@ -103,7 +103,7 @@ var Select = (props) => {
|
|
103
103
|
onValueNodeChange: setValueNode,
|
104
104
|
valueNodeHasChildren,
|
105
105
|
onValueNodeHasChildrenChange: setValueNodeHasChildren,
|
106
|
-
contentId: index$
|
106
|
+
contentId: index$5.useId(),
|
107
107
|
value,
|
108
108
|
onValueChange: setValue,
|
109
109
|
open,
|
@@ -160,7 +160,7 @@ var SelectTrigger = React__namespace.forwardRef(
|
|
160
160
|
const popperScope = usePopperScope(__scopeSelect);
|
161
161
|
const context = useSelectContext(TRIGGER_NAME, __scopeSelect);
|
162
162
|
const isDisabled = context.disabled || disabled;
|
163
|
-
const composedRefs = index$
|
163
|
+
const composedRefs = index$6.useComposedRefs(forwardedRef, context.onTriggerChange);
|
164
164
|
const getItems = useCollection(__scopeSelect);
|
165
165
|
const pointerTypeRef = React__namespace.useRef("touch");
|
166
166
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {
|
@@ -184,7 +184,7 @@ var SelectTrigger = React__namespace.forwardRef(
|
|
184
184
|
}
|
185
185
|
};
|
186
186
|
return /* @__PURE__ */ jsxRuntime.jsx(index$2.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
187
|
-
index$
|
187
|
+
index$7.Primitive.button,
|
188
188
|
{
|
189
189
|
type: "button",
|
190
190
|
role: "combobox",
|
@@ -199,13 +199,13 @@ var SelectTrigger = React__namespace.forwardRef(
|
|
199
199
|
"data-placeholder": shouldShowPlaceholder(context.value) ? "" : void 0,
|
200
200
|
...triggerProps,
|
201
201
|
ref: composedRefs,
|
202
|
-
onClick: index$
|
202
|
+
onClick: index$8.composeEventHandlers(triggerProps.onClick, (event) => {
|
203
203
|
event.currentTarget.focus();
|
204
204
|
if (pointerTypeRef.current !== "mouse") {
|
205
205
|
handleOpen(event);
|
206
206
|
}
|
207
207
|
}),
|
208
|
-
onPointerDown: index$
|
208
|
+
onPointerDown: index$8.composeEventHandlers(triggerProps.onPointerDown, (event) => {
|
209
209
|
pointerTypeRef.current = event.pointerType;
|
210
210
|
const target = event.target;
|
211
211
|
if (target.hasPointerCapture(event.pointerId)) {
|
@@ -216,7 +216,7 @@ var SelectTrigger = React__namespace.forwardRef(
|
|
216
216
|
event.preventDefault();
|
217
217
|
}
|
218
218
|
}),
|
219
|
-
onKeyDown: index$
|
219
|
+
onKeyDown: index$8.composeEventHandlers(triggerProps.onKeyDown, (event) => {
|
220
220
|
const isTypingAhead = searchRef.current !== "";
|
221
221
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
222
222
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
@@ -238,12 +238,12 @@ var SelectValue = React__namespace.forwardRef(
|
|
238
238
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
239
239
|
const { onValueNodeHasChildrenChange } = context;
|
240
240
|
const hasChildren = children !== void 0;
|
241
|
-
const composedRefs = index$
|
242
|
-
index$
|
241
|
+
const composedRefs = index$6.useComposedRefs(forwardedRef, context.onValueNodeChange);
|
242
|
+
index$9.useLayoutEffect(() => {
|
243
243
|
onValueNodeHasChildrenChange(hasChildren);
|
244
244
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
245
245
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
246
|
-
index$
|
246
|
+
index$7.Primitive.span,
|
247
247
|
{
|
248
248
|
...valueProps,
|
249
249
|
ref: composedRefs,
|
@@ -258,13 +258,13 @@ var ICON_NAME = "SelectIcon";
|
|
258
258
|
var SelectIcon = React__namespace.forwardRef(
|
259
259
|
(props, forwardedRef) => {
|
260
260
|
const { __scopeSelect, children, ...iconProps } = props;
|
261
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index$
|
261
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$7.Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" });
|
262
262
|
}
|
263
263
|
);
|
264
264
|
SelectIcon.displayName = ICON_NAME;
|
265
265
|
var PORTAL_NAME = "SelectPortal";
|
266
266
|
var SelectPortal = (props) => {
|
267
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index$
|
267
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$a.Portal, { asChild: true, ...props });
|
268
268
|
};
|
269
269
|
SelectPortal.displayName = PORTAL_NAME;
|
270
270
|
var CONTENT_NAME = "SelectContent";
|
@@ -272,7 +272,7 @@ var SelectContent = React__namespace.forwardRef(
|
|
272
272
|
(props, forwardedRef) => {
|
273
273
|
const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);
|
274
274
|
const [fragment, setFragment] = React__namespace.useState();
|
275
|
-
index$
|
275
|
+
index$9.useLayoutEffect(() => {
|
276
276
|
setFragment(new DocumentFragment());
|
277
277
|
}, []);
|
278
278
|
if (!context.open) {
|
@@ -315,7 +315,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
315
315
|
const context = useSelectContext(CONTENT_NAME, __scopeSelect);
|
316
316
|
const [content, setContent] = React__namespace.useState(null);
|
317
317
|
const [viewport, setViewport] = React__namespace.useState(null);
|
318
|
-
const composedRefs = index$
|
318
|
+
const composedRefs = index$6.useComposedRefs(forwardedRef, (node) => setContent(node));
|
319
319
|
const [selectedItem, setSelectedItem] = React__namespace.useState(null);
|
320
320
|
const [selectedItemText, setSelectedItemText] = React__namespace.useState(
|
321
321
|
null
|
@@ -324,9 +324,9 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
324
324
|
const [isPositioned, setIsPositioned] = React__namespace.useState(false);
|
325
325
|
const firstValidItemFoundRef = React__namespace.useRef(false);
|
326
326
|
React__namespace.useEffect(() => {
|
327
|
-
if (content) return index$
|
327
|
+
if (content) return index$b.hideOthers(content);
|
328
328
|
}, [content]);
|
329
|
-
index$
|
329
|
+
index$c.useFocusGuards();
|
330
330
|
const focusFirst = React__namespace.useCallback(
|
331
331
|
(candidates) => {
|
332
332
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
@@ -451,20 +451,20 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
451
451
|
position,
|
452
452
|
isPositioned,
|
453
453
|
searchRef,
|
454
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Combination.default, { as: index$
|
455
|
-
index$
|
454
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Combination.default, { as: index$d.Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
455
|
+
index$e.FocusScope,
|
456
456
|
{
|
457
457
|
asChild: true,
|
458
458
|
trapped: context.open,
|
459
459
|
onMountAutoFocus: (event) => {
|
460
460
|
event.preventDefault();
|
461
461
|
},
|
462
|
-
onUnmountAutoFocus: index$
|
462
|
+
onUnmountAutoFocus: index$8.composeEventHandlers(onCloseAutoFocus, (event) => {
|
463
463
|
context.trigger?.focus({ preventScroll: true });
|
464
464
|
event.preventDefault();
|
465
465
|
}),
|
466
466
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
467
|
-
index$
|
467
|
+
index$f.DismissableLayer,
|
468
468
|
{
|
469
469
|
asChild: true,
|
470
470
|
disableOutsidePointerEvents: true,
|
@@ -492,7 +492,7 @@ var SelectContentImpl = React__namespace.forwardRef(
|
|
492
492
|
outline: "none",
|
493
493
|
...contentProps.style
|
494
494
|
},
|
495
|
-
onKeyDown: index$
|
495
|
+
onKeyDown: index$8.composeEventHandlers(contentProps.onKeyDown, (event) => {
|
496
496
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
497
497
|
if (event.key === "Tab") event.preventDefault();
|
498
498
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
@@ -529,7 +529,7 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
529
529
|
const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);
|
530
530
|
const [contentWrapper, setContentWrapper] = React__namespace.useState(null);
|
531
531
|
const [content, setContent] = React__namespace.useState(null);
|
532
|
-
const composedRefs = index$
|
532
|
+
const composedRefs = index$6.useComposedRefs(forwardedRef, (node) => setContent(node));
|
533
533
|
const getItems = useCollection(__scopeSelect);
|
534
534
|
const shouldExpandOnScrollRef = React__namespace.useRef(false);
|
535
535
|
const shouldRepositionRef = React__namespace.useRef(true);
|
@@ -547,7 +547,7 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
547
547
|
const minContentWidth = triggerRect.width + leftDelta;
|
548
548
|
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
549
549
|
const rightEdge = window.innerWidth - CONTENT_MARGIN;
|
550
|
-
const clampedLeft = index$
|
550
|
+
const clampedLeft = index$j.clamp(left, [
|
551
551
|
CONTENT_MARGIN,
|
552
552
|
// Prevents the content from going off the starting edge of the
|
553
553
|
// viewport. It may still go off the ending edge, but this can be
|
@@ -565,7 +565,7 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
565
565
|
const minContentWidth = triggerRect.width + rightDelta;
|
566
566
|
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
567
567
|
const leftEdge = window.innerWidth - CONTENT_MARGIN;
|
568
|
-
const clampedRight = index$
|
568
|
+
const clampedRight = index$j.clamp(right, [
|
569
569
|
CONTENT_MARGIN,
|
570
570
|
Math.max(CONTENT_MARGIN, leftEdge - contentWidth)
|
571
571
|
]);
|
@@ -633,9 +633,9 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
633
633
|
context.dir,
|
634
634
|
onPlaced
|
635
635
|
]);
|
636
|
-
index$
|
636
|
+
index$9.useLayoutEffect(() => position(), [position]);
|
637
637
|
const [contentZIndex, setContentZIndex] = React__namespace.useState();
|
638
|
-
index$
|
638
|
+
index$9.useLayoutEffect(() => {
|
639
639
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
640
640
|
}, [content]);
|
641
641
|
const handleScrollButtonChange = React__namespace.useCallback(
|
@@ -666,7 +666,7 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
666
666
|
zIndex: contentZIndex
|
667
667
|
},
|
668
668
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
669
|
-
index$
|
669
|
+
index$7.Primitive.div,
|
670
670
|
{
|
671
671
|
...popperProps,
|
672
672
|
ref: composedRefs,
|
@@ -727,7 +727,7 @@ var SelectViewport = React__namespace.forwardRef(
|
|
727
727
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
728
728
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
729
729
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
730
|
-
const composedRefs = index$
|
730
|
+
const composedRefs = index$6.useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
731
731
|
const prevScrollTopRef = React__namespace.useRef(0);
|
732
732
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
733
733
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -740,7 +740,7 @@ var SelectViewport = React__namespace.forwardRef(
|
|
740
740
|
}
|
741
741
|
),
|
742
742
|
/* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsxRuntime.jsx(
|
743
|
-
index$
|
743
|
+
index$7.Primitive.div,
|
744
744
|
{
|
745
745
|
"data-radix-select-viewport": "",
|
746
746
|
role: "presentation",
|
@@ -759,7 +759,7 @@ var SelectViewport = React__namespace.forwardRef(
|
|
759
759
|
overflow: "hidden auto",
|
760
760
|
...viewportProps.style
|
761
761
|
},
|
762
|
-
onScroll: index$
|
762
|
+
onScroll: index$8.composeEventHandlers(viewportProps.onScroll, (event) => {
|
763
763
|
const viewport = event.currentTarget;
|
764
764
|
const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;
|
765
765
|
if (shouldExpandOnScrollRef?.current && contentWrapper) {
|
@@ -794,8 +794,8 @@ var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GR
|
|
794
794
|
var SelectGroup = React__namespace.forwardRef(
|
795
795
|
(props, forwardedRef) => {
|
796
796
|
const { __scopeSelect, ...groupProps } = props;
|
797
|
-
const groupId = index$
|
798
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsxRuntime.jsx(index$
|
797
|
+
const groupId = index$5.useId();
|
798
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsxRuntime.jsx(index$7.Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
799
799
|
}
|
800
800
|
);
|
801
801
|
SelectGroup.displayName = GROUP_NAME;
|
@@ -804,7 +804,7 @@ var SelectLabel = React__namespace.forwardRef(
|
|
804
804
|
(props, forwardedRef) => {
|
805
805
|
const { __scopeSelect, ...labelProps } = props;
|
806
806
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
807
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index$
|
807
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$7.Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
808
808
|
}
|
809
809
|
);
|
810
810
|
SelectLabel.displayName = LABEL_NAME;
|
@@ -824,11 +824,11 @@ var SelectItem = React__namespace.forwardRef(
|
|
824
824
|
const isSelected = context.value === value;
|
825
825
|
const [textValue, setTextValue] = React__namespace.useState(textValueProp ?? "");
|
826
826
|
const [isFocused, setIsFocused] = React__namespace.useState(false);
|
827
|
-
const composedRefs = index$
|
827
|
+
const composedRefs = index$6.useComposedRefs(
|
828
828
|
forwardedRef,
|
829
829
|
(node) => contentContext.itemRefCallback?.(node, value, disabled)
|
830
830
|
);
|
831
|
-
const textId = index$
|
831
|
+
const textId = index$5.useId();
|
832
832
|
const pointerTypeRef = React__namespace.useRef("touch");
|
833
833
|
const handleSelect = () => {
|
834
834
|
if (!disabled) {
|
@@ -860,7 +860,7 @@ var SelectItem = React__namespace.forwardRef(
|
|
860
860
|
disabled,
|
861
861
|
textValue,
|
862
862
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
863
|
-
index$
|
863
|
+
index$7.Primitive.div,
|
864
864
|
{
|
865
865
|
role: "option",
|
866
866
|
"aria-labelledby": textId,
|
@@ -872,18 +872,18 @@ var SelectItem = React__namespace.forwardRef(
|
|
872
872
|
tabIndex: disabled ? void 0 : -1,
|
873
873
|
...itemProps,
|
874
874
|
ref: composedRefs,
|
875
|
-
onFocus: index$
|
876
|
-
onBlur: index$
|
877
|
-
onClick: index$
|
875
|
+
onFocus: index$8.composeEventHandlers(itemProps.onFocus, () => setIsFocused(true)),
|
876
|
+
onBlur: index$8.composeEventHandlers(itemProps.onBlur, () => setIsFocused(false)),
|
877
|
+
onClick: index$8.composeEventHandlers(itemProps.onClick, () => {
|
878
878
|
if (pointerTypeRef.current !== "mouse") handleSelect();
|
879
879
|
}),
|
880
|
-
onPointerUp: index$
|
880
|
+
onPointerUp: index$8.composeEventHandlers(itemProps.onPointerUp, () => {
|
881
881
|
if (pointerTypeRef.current === "mouse") handleSelect();
|
882
882
|
}),
|
883
|
-
onPointerDown: index$
|
883
|
+
onPointerDown: index$8.composeEventHandlers(itemProps.onPointerDown, (event) => {
|
884
884
|
pointerTypeRef.current = event.pointerType;
|
885
885
|
}),
|
886
|
-
onPointerMove: index$
|
886
|
+
onPointerMove: index$8.composeEventHandlers(itemProps.onPointerMove, (event) => {
|
887
887
|
pointerTypeRef.current = event.pointerType;
|
888
888
|
if (disabled) {
|
889
889
|
contentContext.onItemLeave?.();
|
@@ -891,12 +891,12 @@ var SelectItem = React__namespace.forwardRef(
|
|
891
891
|
event.currentTarget.focus({ preventScroll: true });
|
892
892
|
}
|
893
893
|
}),
|
894
|
-
onPointerLeave: index$
|
894
|
+
onPointerLeave: index$8.composeEventHandlers(itemProps.onPointerLeave, (event) => {
|
895
895
|
if (event.currentTarget === document.activeElement) {
|
896
896
|
contentContext.onItemLeave?.();
|
897
897
|
}
|
898
898
|
}),
|
899
|
-
onKeyDown: index$
|
899
|
+
onKeyDown: index$8.composeEventHandlers(itemProps.onKeyDown, (event) => {
|
900
900
|
const isTypingAhead = contentContext.searchRef?.current !== "";
|
901
901
|
if (isTypingAhead && event.key === " ") return;
|
902
902
|
if (SELECTION_KEYS.includes(event.key)) handleSelect();
|
@@ -920,7 +920,7 @@ var SelectItemText = React__namespace.forwardRef(
|
|
920
920
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
921
921
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
922
922
|
const [itemTextNode, setItemTextNode] = React__namespace.useState(null);
|
923
|
-
const composedRefs = index$
|
923
|
+
const composedRefs = index$6.useComposedRefs(
|
924
924
|
forwardedRef,
|
925
925
|
(node) => setItemTextNode(node),
|
926
926
|
itemContext.onItemTextChange,
|
@@ -932,12 +932,12 @@ var SelectItemText = React__namespace.forwardRef(
|
|
932
932
|
[itemContext.disabled, itemContext.value, textContent]
|
933
933
|
);
|
934
934
|
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
935
|
-
index$
|
935
|
+
index$9.useLayoutEffect(() => {
|
936
936
|
onNativeOptionAdd(nativeOption);
|
937
937
|
return () => onNativeOptionRemove(nativeOption);
|
938
938
|
}, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
|
939
939
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
940
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$
|
940
|
+
/* @__PURE__ */ jsxRuntime.jsx(index$7.Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
|
941
941
|
itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM__namespace.createPortal(itemTextProps.children, context.valueNode) : null
|
942
942
|
] });
|
943
943
|
}
|
@@ -948,7 +948,7 @@ var SelectItemIndicator = React__namespace.forwardRef(
|
|
948
948
|
(props, forwardedRef) => {
|
949
949
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
950
950
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
951
|
-
return itemContext.isSelected ? /* @__PURE__ */ jsxRuntime.jsx(index$
|
951
|
+
return itemContext.isSelected ? /* @__PURE__ */ jsxRuntime.jsx(index$7.Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
952
952
|
}
|
953
953
|
);
|
954
954
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
@@ -957,8 +957,8 @@ var SelectScrollUpButton = React__namespace.forwardRef((props, forwardedRef) =>
|
|
957
957
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
958
958
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
959
959
|
const [canScrollUp, setCanScrollUp] = React__namespace.useState(false);
|
960
|
-
const composedRefs = index$
|
961
|
-
index$
|
960
|
+
const composedRefs = index$6.useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
961
|
+
index$9.useLayoutEffect(() => {
|
962
962
|
if (contentContext.viewport && contentContext.isPositioned) {
|
963
963
|
let handleScroll2 = function() {
|
964
964
|
const canScrollUp2 = viewport.scrollTop > 0;
|
@@ -990,8 +990,8 @@ var SelectScrollDownButton = React__namespace.forwardRef((props, forwardedRef) =
|
|
990
990
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
991
991
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
992
992
|
const [canScrollDown, setCanScrollDown] = React__namespace.useState(false);
|
993
|
-
const composedRefs = index$
|
994
|
-
index$
|
993
|
+
const composedRefs = index$6.useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
994
|
+
index$9.useLayoutEffect(() => {
|
995
995
|
if (contentContext.viewport && contentContext.isPositioned) {
|
996
996
|
let handleScroll2 = function() {
|
997
997
|
const maxScroll = viewport.scrollHeight - viewport.clientHeight;
|
@@ -1033,29 +1033,29 @@ var SelectScrollButtonImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
1033
1033
|
React__namespace.useEffect(() => {
|
1034
1034
|
return () => clearAutoScrollTimer();
|
1035
1035
|
}, [clearAutoScrollTimer]);
|
1036
|
-
index$
|
1036
|
+
index$9.useLayoutEffect(() => {
|
1037
1037
|
const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
|
1038
1038
|
activeItem?.ref.current?.scrollIntoView({ block: "nearest" });
|
1039
1039
|
}, [getItems]);
|
1040
1040
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
1041
|
-
index$
|
1041
|
+
index$7.Primitive.div,
|
1042
1042
|
{
|
1043
1043
|
"aria-hidden": true,
|
1044
1044
|
...scrollIndicatorProps,
|
1045
1045
|
ref: forwardedRef,
|
1046
1046
|
style: { flexShrink: 0, ...scrollIndicatorProps.style },
|
1047
|
-
onPointerDown: index$
|
1047
|
+
onPointerDown: index$8.composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {
|
1048
1048
|
if (autoScrollTimerRef.current === null) {
|
1049
1049
|
autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
1050
1050
|
}
|
1051
1051
|
}),
|
1052
|
-
onPointerMove: index$
|
1052
|
+
onPointerMove: index$8.composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {
|
1053
1053
|
contentContext.onItemLeave?.();
|
1054
1054
|
if (autoScrollTimerRef.current === null) {
|
1055
1055
|
autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
1056
1056
|
}
|
1057
1057
|
}),
|
1058
|
-
onPointerLeave: index$
|
1058
|
+
onPointerLeave: index$8.composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {
|
1059
1059
|
clearAutoScrollTimer();
|
1060
1060
|
})
|
1061
1061
|
}
|
@@ -1065,7 +1065,7 @@ var SEPARATOR_NAME = "SelectSeparator";
|
|
1065
1065
|
var SelectSeparator = React__namespace.forwardRef(
|
1066
1066
|
(props, forwardedRef) => {
|
1067
1067
|
const { __scopeSelect, ...separatorProps } = props;
|
1068
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index$
|
1068
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$7.Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
1069
1069
|
}
|
1070
1070
|
);
|
1071
1071
|
SelectSeparator.displayName = SEPARATOR_NAME;
|
@@ -1087,8 +1087,8 @@ var BubbleSelect = React__namespace.forwardRef(
|
|
1087
1087
|
(props, forwardedRef) => {
|
1088
1088
|
const { value, ...selectProps } = props;
|
1089
1089
|
const ref = React__namespace.useRef(null);
|
1090
|
-
const composedRefs = index$
|
1091
|
-
const prevValue = index$
|
1090
|
+
const composedRefs = index$6.useComposedRefs(forwardedRef, ref);
|
1091
|
+
const prevValue = index$g.usePrevious(value);
|
1092
1092
|
React__namespace.useEffect(() => {
|
1093
1093
|
const select = ref.current;
|
1094
1094
|
const selectProto = window.HTMLSelectElement.prototype;
|
@@ -1103,12 +1103,12 @@ var BubbleSelect = React__namespace.forwardRef(
|
|
1103
1103
|
select.dispatchEvent(event);
|
1104
1104
|
}
|
1105
1105
|
}, [prevValue, value]);
|
1106
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index$
|
1106
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$h.VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("select", { ...selectProps, ref: composedRefs, defaultValue: value }) });
|
1107
1107
|
}
|
1108
1108
|
);
|
1109
1109
|
BubbleSelect.displayName = "BubbleSelect";
|
1110
1110
|
function useTypeaheadSearch(onSearchChange) {
|
1111
|
-
const handleSearchChange = index$
|
1111
|
+
const handleSearchChange = index$i.useCallbackRef(onSearchChange);
|
1112
1112
|
const searchRef = React__namespace.useRef("");
|
1113
1113
|
const timerRef = React__namespace.useRef(0);
|
1114
1114
|
const handleTypeaheadSearch = React__namespace.useCallback(
|