@tamagui/select 2.7.6 → 3.0.0-beta.637.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Select.cjs +409 -467
- package/dist/cjs/Select.native.cjs +495 -0
- package/dist/cjs/Select.native.js +445 -492
- package/dist/cjs/Select.native.js.map +1 -1
- package/dist/cjs/SelectContent.cjs +80 -79
- package/dist/cjs/SelectContent.native.cjs +30 -0
- package/dist/cjs/SelectContent.native.js +18 -22
- package/dist/cjs/SelectContent.native.js.map +1 -1
- package/dist/cjs/SelectImpl.cjs +299 -319
- package/dist/cjs/SelectImpl.native.cjs +30 -0
- package/dist/cjs/SelectImpl.native.js +17 -24
- package/dist/cjs/SelectImpl.native.js.map +1 -1
- package/dist/cjs/SelectItem.cjs +268 -205
- package/dist/cjs/SelectItem.native.cjs +317 -0
- package/dist/cjs/SelectItem.native.js +291 -211
- package/dist/cjs/SelectItem.native.js.map +1 -1
- package/dist/cjs/SelectItemText.cjs +49 -79
- package/dist/cjs/SelectItemText.native.cjs +74 -0
- package/dist/cjs/SelectItemText.native.js +50 -79
- package/dist/cjs/SelectItemText.native.js.map +1 -1
- package/dist/cjs/SelectScrollButton.cjs +111 -130
- package/dist/cjs/SelectScrollButton.native.cjs +38 -0
- package/dist/cjs/SelectScrollButton.native.js +25 -22
- package/dist/cjs/SelectScrollButton.native.js.map +1 -1
- package/dist/cjs/SelectTrigger.cjs +69 -84
- package/dist/cjs/SelectTrigger.native.cjs +91 -0
- package/dist/cjs/SelectTrigger.native.js +71 -66
- package/dist/cjs/SelectTrigger.native.js.map +1 -1
- package/dist/cjs/SelectViewport.cjs +119 -142
- package/dist/cjs/SelectViewport.native.cjs +73 -0
- package/dist/cjs/SelectViewport.native.js +54 -50
- package/dist/cjs/SelectViewport.native.js.map +1 -1
- package/dist/cjs/constants.cjs +21 -22
- package/dist/cjs/constants.native.cjs +41 -0
- package/dist/cjs/constants.native.js +21 -21
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/context.cjs +38 -48
- package/dist/cjs/context.native.cjs +58 -0
- package/dist/cjs/context.native.js +40 -49
- package/dist/cjs/context.native.js.map +1 -1
- package/dist/cjs/index.cjs +15 -11
- package/dist/cjs/index.native.cjs +27 -0
- package/dist/cjs/index.native.js +15 -10
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/selectionController.cjs +334 -0
- package/dist/cjs/selectionController.native.cjs +403 -0
- package/dist/cjs/selectionController.native.js +405 -0
- package/dist/cjs/selectionController.native.js.map +1 -0
- package/dist/cjs/types.cjs +10 -11
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +10 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/Select.mjs +382 -443
- package/dist/esm/Select.mjs.map +1 -1
- package/dist/esm/Select.native.js +418 -469
- package/dist/esm/Select.native.js.map +1 -1
- package/dist/esm/SelectContent.mjs +67 -61
- package/dist/esm/SelectContent.mjs.map +1 -1
- package/dist/esm/SelectContent.native.js +4 -5
- package/dist/esm/SelectContent.native.js.map +1 -1
- package/dist/esm/SelectImpl.mjs +284 -294
- package/dist/esm/SelectImpl.mjs.map +1 -1
- package/dist/esm/SelectImpl.native.js +5 -8
- package/dist/esm/SelectImpl.native.js.map +1 -1
- package/dist/esm/SelectItem.mjs +252 -182
- package/dist/esm/SelectItem.mjs.map +1 -1
- package/dist/esm/SelectItem.native.js +276 -190
- package/dist/esm/SelectItem.native.js.map +1 -1
- package/dist/esm/SelectItemText.mjs +33 -55
- package/dist/esm/SelectItemText.mjs.map +1 -1
- package/dist/esm/SelectItemText.native.js +34 -56
- package/dist/esm/SelectItemText.native.js.map +1 -1
- package/dist/esm/SelectScrollButton.mjs +95 -107
- package/dist/esm/SelectScrollButton.mjs.map +1 -1
- package/dist/esm/SelectScrollButton.native.js +11 -7
- package/dist/esm/SelectScrollButton.native.js.map +1 -1
- package/dist/esm/SelectTrigger.mjs +56 -58
- package/dist/esm/SelectTrigger.mjs.map +1 -1
- package/dist/esm/SelectTrigger.native.js +54 -44
- package/dist/esm/SelectTrigger.native.js.map +1 -1
- package/dist/esm/SelectViewport.mjs +104 -119
- package/dist/esm/SelectViewport.mjs.map +1 -1
- package/dist/esm/SelectViewport.native.js +44 -39
- package/dist/esm/SelectViewport.native.js.map +1 -1
- package/dist/esm/constants.mjs +1 -0
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +1 -0
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/context.mjs +20 -28
- package/dist/esm/context.mjs.map +1 -1
- package/dist/esm/context.native.js +23 -31
- package/dist/esm/context.native.js.map +1 -1
- package/dist/esm/index.js +13 -3
- package/dist/esm/index.mjs +13 -3
- package/dist/esm/index.native.js +13 -3
- package/dist/esm/selectionController.mjs +305 -0
- package/dist/esm/selectionController.mjs.map +1 -0
- package/dist/esm/selectionController.native.js +372 -0
- package/dist/esm/selectionController.native.js.map +1 -0
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/dist/jsx/Select.mjs +382 -443
- package/dist/jsx/Select.mjs.map +1 -1
- package/dist/jsx/Select.native.cjs +495 -0
- package/dist/jsx/Select.native.js +445 -492
- package/dist/jsx/Select.native.js.map +1 -1
- package/dist/jsx/SelectContent.mjs +67 -61
- package/dist/jsx/SelectContent.mjs.map +1 -1
- package/dist/jsx/SelectContent.native.cjs +30 -0
- package/dist/jsx/SelectContent.native.js +18 -22
- package/dist/jsx/SelectContent.native.js.map +1 -1
- package/dist/jsx/SelectImpl.mjs +284 -294
- package/dist/jsx/SelectImpl.mjs.map +1 -1
- package/dist/jsx/SelectImpl.native.cjs +30 -0
- package/dist/jsx/SelectImpl.native.js +17 -24
- package/dist/jsx/SelectImpl.native.js.map +1 -1
- package/dist/jsx/SelectItem.mjs +252 -182
- package/dist/jsx/SelectItem.mjs.map +1 -1
- package/dist/jsx/SelectItem.native.cjs +317 -0
- package/dist/jsx/SelectItem.native.js +291 -211
- package/dist/jsx/SelectItem.native.js.map +1 -1
- package/dist/jsx/SelectItemText.mjs +33 -55
- package/dist/jsx/SelectItemText.mjs.map +1 -1
- package/dist/jsx/SelectItemText.native.cjs +74 -0
- package/dist/jsx/SelectItemText.native.js +50 -79
- package/dist/jsx/SelectItemText.native.js.map +1 -1
- package/dist/jsx/SelectScrollButton.mjs +95 -107
- package/dist/jsx/SelectScrollButton.mjs.map +1 -1
- package/dist/jsx/SelectScrollButton.native.cjs +38 -0
- package/dist/jsx/SelectScrollButton.native.js +25 -22
- package/dist/jsx/SelectScrollButton.native.js.map +1 -1
- package/dist/jsx/SelectTrigger.mjs +56 -58
- package/dist/jsx/SelectTrigger.mjs.map +1 -1
- package/dist/jsx/SelectTrigger.native.cjs +91 -0
- package/dist/jsx/SelectTrigger.native.js +71 -66
- package/dist/jsx/SelectTrigger.native.js.map +1 -1
- package/dist/jsx/SelectViewport.mjs +104 -119
- package/dist/jsx/SelectViewport.mjs.map +1 -1
- package/dist/jsx/SelectViewport.native.cjs +73 -0
- package/dist/jsx/SelectViewport.native.js +54 -50
- package/dist/jsx/SelectViewport.native.js.map +1 -1
- package/dist/jsx/constants.mjs +1 -0
- package/dist/jsx/constants.mjs.map +1 -1
- package/dist/jsx/constants.native.cjs +41 -0
- package/dist/jsx/constants.native.js +21 -21
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/context.mjs +20 -28
- package/dist/jsx/context.mjs.map +1 -1
- package/dist/jsx/context.native.cjs +58 -0
- package/dist/jsx/context.native.js +40 -49
- package/dist/jsx/context.native.js.map +1 -1
- package/dist/jsx/index.js +13 -3
- package/dist/jsx/index.mjs +13 -3
- package/dist/jsx/index.native.cjs +27 -0
- package/dist/jsx/index.native.js +15 -10
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/selectionController.mjs +305 -0
- package/dist/jsx/selectionController.mjs.map +1 -0
- package/dist/jsx/selectionController.native.cjs +403 -0
- package/dist/jsx/selectionController.native.js +405 -0
- package/dist/jsx/selectionController.native.js.map +1 -0
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.native.cjs +19 -0
- package/dist/jsx/types.native.js +10 -10
- package/dist/jsx/types.native.js.map +1 -1
- package/package.json +28 -28
- package/src/Select.tsx +457 -357
- package/src/SelectContent.tsx +46 -16
- package/src/SelectImpl.native.tsx +0 -8
- package/src/SelectImpl.tsx +87 -100
- package/src/SelectItem.tsx +282 -136
- package/src/SelectItemText.tsx +16 -33
- package/src/SelectScrollButton.native.tsx +13 -4
- package/src/SelectScrollButton.tsx +56 -41
- package/src/SelectTrigger.tsx +77 -53
- package/src/SelectViewport.native.tsx +42 -25
- package/src/SelectViewport.tsx +52 -51
- package/src/context.tsx +6 -2
- package/src/index.tsx +5 -2
- package/src/selectionController.ts +389 -0
- package/src/types.tsx +88 -45
- package/types/Select.d.ts +139 -201
- package/types/Select.d.ts.map +1 -1
- package/types/SelectContent.d.ts +1 -1
- package/types/SelectContent.d.ts.map +1 -1
- package/types/SelectContent.native.d.ts.map +1 -1
- package/types/SelectImpl.d.ts +2 -1
- package/types/SelectImpl.d.ts.map +1 -1
- package/types/SelectImpl.native.d.ts +1 -5
- package/types/SelectImpl.native.d.ts.map +1 -1
- package/types/SelectItem.d.ts +13 -16
- package/types/SelectItem.d.ts.map +1 -1
- package/types/SelectItemText.d.ts +9 -13
- package/types/SelectItemText.d.ts.map +1 -1
- package/types/SelectScrollButton.d.ts +15 -2
- package/types/SelectScrollButton.d.ts.map +1 -1
- package/types/SelectScrollButton.native.d.ts +16 -3
- package/types/SelectScrollButton.native.d.ts.map +1 -1
- package/types/SelectTrigger.d.ts +11 -23
- package/types/SelectTrigger.d.ts.map +1 -1
- package/types/SelectViewport.d.ts +11 -38
- package/types/SelectViewport.d.ts.map +1 -1
- package/types/SelectViewport.native.d.ts +15 -4
- package/types/SelectViewport.native.d.ts.map +1 -1
- package/types/context.d.ts +2 -0
- package/types/context.d.ts.map +1 -1
- package/types/index.d.ts +5 -2
- package/types/index.d.ts.map +1 -1
- package/types/selectionController.d.ts +88 -0
- package/types/selectionController.d.ts.map +1 -0
- package/types/types.d.ts +47 -37
- package/types/types.d.ts.map +1 -1
- package/dist/cjs/BubbleSelect.cjs +0 -50
- package/dist/cjs/BubbleSelect.native.js +0 -30
- package/dist/cjs/BubbleSelect.native.js.map +0 -1
- package/dist/cjs/useSelectBreakpointActive.cjs +0 -32
- package/dist/cjs/useSelectBreakpointActive.native.js +0 -35
- package/dist/cjs/useSelectBreakpointActive.native.js.map +0 -1
- package/dist/esm/BubbleSelect.mjs +0 -27
- package/dist/esm/BubbleSelect.mjs.map +0 -1
- package/dist/esm/BubbleSelect.native.js +0 -4
- package/dist/esm/BubbleSelect.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js.map +0 -1
- package/dist/esm/useSelectBreakpointActive.mjs +0 -7
- package/dist/esm/useSelectBreakpointActive.mjs.map +0 -1
- package/dist/esm/useSelectBreakpointActive.native.js +0 -7
- package/dist/esm/useSelectBreakpointActive.native.js.map +0 -1
- package/dist/jsx/BubbleSelect.mjs +0 -27
- package/dist/jsx/BubbleSelect.mjs.map +0 -1
- package/dist/jsx/BubbleSelect.native.js +0 -30
- package/dist/jsx/BubbleSelect.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/types.mjs.map +0 -1
- package/dist/jsx/useSelectBreakpointActive.mjs +0 -7
- package/dist/jsx/useSelectBreakpointActive.mjs.map +0 -1
- package/dist/jsx/useSelectBreakpointActive.native.js +0 -35
- package/dist/jsx/useSelectBreakpointActive.native.js.map +0 -1
- package/src/BubbleSelect.tsx +0 -50
- package/src/useSelectBreakpointActive.tsx +0 -7
- package/types/BubbleSelect.d.ts +0 -2
- package/types/BubbleSelect.d.ts.map +0 -1
- package/types/useSelectBreakpointActive.d.ts +0 -3
- package/types/useSelectBreakpointActive.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"context.native.js","names":[],"sources":["cjs/context.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar context_exports = {};\n__export(context_exports, {\n ForwardSelectContext: () => ForwardSelectContext,\n SelectItemParentProvider: () => SelectItemParentProvider,\n SelectNativeComponentContext: () => SelectNativeComponentContext,\n SelectProvider: () => SelectProvider,\n SelectZIndexContext: () => SelectZIndexContext,\n useSelectContext: () => useSelectContext,\n useSelectItemParentContext: () => useSelectItemParentContext\n});\nmodule.exports = __toCommonJS(context_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_native = require(\"@tamagui/native\");\nvar import_react = require(\"react\");\nvar SelectZIndexContext = /* @__PURE__ */ (0, import_react.createContext)(void 0);\nvar SelectNativeComponentContext = /* @__PURE__ */ (0, import_react.createContext)(null);\nvar { Provider: SelectProvider, useStyledContext: useSelectContext } = (0, import_core.createStyledContext)(null, \"Select\");\nvar { Provider: SelectItemParentProvider, useStyledContext: useSelectItemParentContext } = (0, import_core.createStyledContext)(null, \"SelectItem\");\nvar ForwardSelectContext = function(param) {\n var { context, itemContext, children } = param;\n var portalState = (0, import_native.getPortal)().state;\n if (portalState.type === \"teleport\") {\n return children;\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectProvider, {\n scope: context.scopeName,\n ...context,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemParentProvider, {\n scope: context.scopeName,\n ...itemContext,\n children\n })\n });\n};\n//# sourceMappingURL=context.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,kBAAkB,CAAC;AACvB,SAAS,iBAAiB;CACxB,4BAA4B;CAC5B,gCAAgC;CAChC,oCAAoC;CACpC,sBAAsB;CACtB,2BAA2B;CAC3B,wBAAwB;CACxB,kCAAkC;AACpC,CAAC;AACD,OAAO,UAAU,aAAa,eAAe;AAC7C,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,cAAc,QAAQ,eAAe;AACzC,IAAI,gBAAgB,QAAQ,iBAAiB;AAC7C,IAAI,eAAe,QAAQ,OAAO;AAClC,IAAI,sBAAsC,iBAAC,GAAG,aAAa,eAAe,KAAK,CAAC;AAChF,IAAI,+BAA+C,iBAAC,GAAG,aAAa,eAAe,IAAI;AACvF,IAAI,EAAE,UAAU,gBAAgB,kBAAkB,sBAAsB,GAAG,YAAY,qBAAqB,MAAM,QAAQ;AAC1H,IAAI,EAAE,UAAU,0BAA0B,kBAAkB,gCAAgC,GAAG,YAAY,qBAAqB,MAAM,YAAY;AAClJ,IAAI,uBAAuB,SAAS,OAAO;CACzC,IAAI,EAAE,SAAS,aAAa,aAAa;CACzC,IAAI,eAAe,GAAG,cAAc,WAAW,EAAE;CACjD,IAAI,YAAY,SAAS,YAAY;EACnC,OAAO;CACT;CACA,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,gBAAgB;EACjE,OAAO,QAAQ;EACf,GAAG;EACH,UAA0B,iBAAC,GAAG,mBAAmB,KAAK,0BAA0B;GAC9E,OAAO,QAAQ;GACf,GAAG;GACH;EACF,CAAC;CACH,CAAC;AACH"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
+
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
6
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
13
14
|
};
|
|
14
15
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: true
|
|
17
|
-
}), mod);
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
17
|
var index_exports = {};
|
|
19
18
|
module.exports = __toCommonJS(index_exports);
|
|
20
19
|
__reExport(index_exports, require("./Select.cjs"), module.exports);
|
|
21
|
-
__reExport(index_exports, require("./
|
|
20
|
+
__reExport(index_exports, require("./SelectItem.cjs"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./SelectItemText.cjs"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./SelectScrollButton.cjs"), module.exports);
|
|
23
|
+
__reExport(index_exports, require("./SelectTrigger.cjs"), module.exports);
|
|
24
|
+
__reExport(index_exports, require("./SelectViewport.cjs"), module.exports);
|
|
25
|
+
__reExport(index_exports, require("./context.cjs"), module.exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(index_exports);
|
|
21
|
+
__reExport(index_exports, require("./Select.native.js"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./SelectItem.native.js"), module.exports);
|
|
23
|
+
__reExport(index_exports, require("./SelectItemText.native.js"), module.exports);
|
|
24
|
+
__reExport(index_exports, require("./SelectScrollButton.native.js"), module.exports);
|
|
25
|
+
__reExport(index_exports, require("./SelectTrigger.native.js"), module.exports);
|
|
26
|
+
__reExport(index_exports, require("./SelectViewport.native.js"), module.exports);
|
|
27
|
+
__reExport(index_exports, require("./context.native.js"), module.exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
11
|
+
get: () => from[key],
|
|
12
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
15
16
|
};
|
|
16
17
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
}), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
19
|
var index_exports = {};
|
|
21
20
|
module.exports = __toCommonJS(index_exports);
|
|
22
21
|
__reExport(index_exports, require("./Select.native.js"), module.exports);
|
|
22
|
+
__reExport(index_exports, require("./SelectItem.native.js"), module.exports);
|
|
23
|
+
__reExport(index_exports, require("./SelectItemText.native.js"), module.exports);
|
|
24
|
+
__reExport(index_exports, require("./SelectScrollButton.native.js"), module.exports);
|
|
25
|
+
__reExport(index_exports, require("./SelectTrigger.native.js"), module.exports);
|
|
26
|
+
__reExport(index_exports, require("./SelectViewport.native.js"), module.exports);
|
|
23
27
|
__reExport(index_exports, require("./context.native.js"), module.exports);
|
|
28
|
+
|
|
24
29
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Select\"), module.exports);\n__reExport(index_exports, require(\"./SelectItem\"), module.exports);\n__reExport(index_exports, require(\"./SelectItemText\"), module.exports);\n__reExport(index_exports, require(\"./SelectScrollButton\"), module.exports);\n__reExport(index_exports, require(\"./SelectTrigger\"), module.exports);\n__reExport(index_exports, require(\"./SelectViewport\"), module.exports);\n__reExport(index_exports, require(\"./context\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,oBAAU,GAAG,OAAO,OAAO;AAC7D,WAAW,eAAe,QAAQ,wBAAc,GAAG,OAAO,OAAO;AACjE,WAAW,eAAe,QAAQ,4BAAkB,GAAG,OAAO,OAAO;AACrE,WAAW,eAAe,QAAQ,gCAAsB,GAAG,OAAO,OAAO;AACzE,WAAW,eAAe,QAAQ,2BAAiB,GAAG,OAAO,OAAO;AACpE,WAAW,eAAe,QAAQ,4BAAkB,GAAG,OAAO,OAAO;AACrE,WAAW,eAAe,QAAQ,qBAAW,GAAG,OAAO,OAAO"}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var selectionController_exports = {};
|
|
23
|
+
__export(selectionController_exports, {
|
|
24
|
+
createSelectItemRegistry: () => createSelectItemRegistry,
|
|
25
|
+
createSelectSelectionController: () => createSelectSelectionController,
|
|
26
|
+
getSelectLabelText: () => getSelectLabelText,
|
|
27
|
+
getSelectListboxProps: () => getSelectListboxProps,
|
|
28
|
+
getSelectOptionProps: () => getSelectOptionProps,
|
|
29
|
+
normalizeSelectSelection: () => normalizeSelectSelection,
|
|
30
|
+
selectedValuesFromSelection: () => selectedValuesFromSelection
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(selectionController_exports);
|
|
33
|
+
function getSelectLabelText(label) {
|
|
34
|
+
if (typeof label === "string" || typeof label === "number") {
|
|
35
|
+
return String(label);
|
|
36
|
+
}
|
|
37
|
+
if (Array.isArray(label)) {
|
|
38
|
+
return label.map(getSelectLabelText).join("");
|
|
39
|
+
}
|
|
40
|
+
if (label && typeof label === "object" && "props" in label) {
|
|
41
|
+
return getSelectLabelText(label.props?.children);
|
|
42
|
+
}
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
45
|
+
function createSelectItemRegistry(onChange) {
|
|
46
|
+
const items = [];
|
|
47
|
+
const labelRegistrations = /* @__PURE__ */ new Map();
|
|
48
|
+
const explicitTextValues = /* @__PURE__ */ new Map();
|
|
49
|
+
const itemNodes = /* @__PURE__ */ new Map();
|
|
50
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
51
|
+
const notify = () => {
|
|
52
|
+
onChange?.();
|
|
53
|
+
listeners.forEach((listener) => listener());
|
|
54
|
+
};
|
|
55
|
+
const getItems = () => items;
|
|
56
|
+
const getItem = (value) => items.find((item) => item.value === value);
|
|
57
|
+
const getIndex = (value) => items.findIndex((item) => item.value === value);
|
|
58
|
+
const getRegisteredLabel = (value) => {
|
|
59
|
+
const registrations = labelRegistrations.get(value);
|
|
60
|
+
if (!registrations?.size) return void 0;
|
|
61
|
+
const values = Array.from(registrations.values());
|
|
62
|
+
return values[values.length - 1];
|
|
63
|
+
};
|
|
64
|
+
const applyRegisteredLabel = (value) => {
|
|
65
|
+
const registeredLabel = getRegisteredLabel(value);
|
|
66
|
+
let changed = false;
|
|
67
|
+
for (const item of items) {
|
|
68
|
+
if (item.value !== value) continue;
|
|
69
|
+
const nextLabel = registeredLabel?.label;
|
|
70
|
+
const nextTextValue = explicitTextValues.get(item.id) || registeredLabel?.textValue;
|
|
71
|
+
if (item.label !== nextLabel || item.textValue !== nextTextValue) {
|
|
72
|
+
item.label = nextLabel;
|
|
73
|
+
item.textValue = nextTextValue;
|
|
74
|
+
changed = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (changed) notify();
|
|
78
|
+
};
|
|
79
|
+
const syncNodeOrder = () => {
|
|
80
|
+
const previousOrder = items.map((item) => item.id);
|
|
81
|
+
items.sort((a, b) => {
|
|
82
|
+
const aNode = itemNodes.get(a.id);
|
|
83
|
+
const bNode = itemNodes.get(b.id);
|
|
84
|
+
if (!aNode || !bNode || typeof aNode.compareDocumentPosition !== "function") {
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
const position = aNode.compareDocumentPosition(bNode);
|
|
88
|
+
if (position & 4) return -1;
|
|
89
|
+
if (position & 2) return 1;
|
|
90
|
+
return 0;
|
|
91
|
+
});
|
|
92
|
+
if (items.some((item, index) => item.id !== previousOrder[index])) {
|
|
93
|
+
notify();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const registerItem = (item) => {
|
|
97
|
+
const id = Symbol(item.value);
|
|
98
|
+
const registeredLabel = getRegisteredLabel(item.value);
|
|
99
|
+
const registeredItem = {
|
|
100
|
+
...item,
|
|
101
|
+
...registeredLabel,
|
|
102
|
+
textValue: item.textValue ?? registeredLabel?.textValue,
|
|
103
|
+
id
|
|
104
|
+
};
|
|
105
|
+
explicitTextValues.set(id, item.textValue);
|
|
106
|
+
items.push(registeredItem);
|
|
107
|
+
notify();
|
|
108
|
+
return {
|
|
109
|
+
id,
|
|
110
|
+
update(next) {
|
|
111
|
+
const index = items.findIndex((current2) => current2.id === id);
|
|
112
|
+
if (index < 0) return;
|
|
113
|
+
const current = items[index];
|
|
114
|
+
if ("textValue" in next) {
|
|
115
|
+
explicitTextValues.set(id, next.textValue);
|
|
116
|
+
}
|
|
117
|
+
const nextItem = {
|
|
118
|
+
...current,
|
|
119
|
+
...next
|
|
120
|
+
};
|
|
121
|
+
if (next.value !== void 0 && next.value !== current.value) {
|
|
122
|
+
const nextLabel = getRegisteredLabel(next.value);
|
|
123
|
+
nextItem.label = nextLabel?.label;
|
|
124
|
+
}
|
|
125
|
+
const explicitTextValue = explicitTextValues.get(id);
|
|
126
|
+
nextItem.textValue = explicitTextValue || getSelectLabelText(nextItem.label) || (nextItem.label ? nextItem.value : void 0);
|
|
127
|
+
const changed = Object.entries(next).some(([key, value]) => current[key] !== value);
|
|
128
|
+
const textValueChanged = current.textValue !== nextItem.textValue;
|
|
129
|
+
if (!changed && !textValueChanged) return;
|
|
130
|
+
items[index] = nextItem;
|
|
131
|
+
notify();
|
|
132
|
+
},
|
|
133
|
+
setNode(node) {
|
|
134
|
+
if (node) {
|
|
135
|
+
itemNodes.set(id, node);
|
|
136
|
+
syncNodeOrder();
|
|
137
|
+
} else {
|
|
138
|
+
itemNodes.delete(id);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
unregister() {
|
|
142
|
+
const index = items.findIndex((current) => current.id === id);
|
|
143
|
+
if (index < 0) return;
|
|
144
|
+
items.splice(index, 1);
|
|
145
|
+
explicitTextValues.delete(id);
|
|
146
|
+
itemNodes.delete(id);
|
|
147
|
+
notify();
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
const registerLabel = (value, label, textValue) => {
|
|
152
|
+
const id = Symbol(value);
|
|
153
|
+
const normalizedTextValue = textValue || getSelectLabelText(label) || value;
|
|
154
|
+
const registrations = labelRegistrations.get(value) ?? (() => {
|
|
155
|
+
const next = /* @__PURE__ */ new Map();
|
|
156
|
+
labelRegistrations.set(value, next);
|
|
157
|
+
return next;
|
|
158
|
+
})();
|
|
159
|
+
registrations.set(id, {
|
|
160
|
+
label,
|
|
161
|
+
textValue: normalizedTextValue
|
|
162
|
+
});
|
|
163
|
+
applyRegisteredLabel(value);
|
|
164
|
+
return () => {
|
|
165
|
+
registrations.delete(id);
|
|
166
|
+
if (!registrations.size) {
|
|
167
|
+
labelRegistrations.delete(value);
|
|
168
|
+
}
|
|
169
|
+
applyRegisteredLabel(value);
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
const firstEnabledIndex = () => items.findIndex((item) => !item.disabled);
|
|
173
|
+
const nextEnabledIndex = (fromIndex, direction) => {
|
|
174
|
+
if (!items.length) return -1;
|
|
175
|
+
if (fromIndex == null || fromIndex < 0 || fromIndex >= items.length) {
|
|
176
|
+
if (direction === 1) return firstEnabledIndex();
|
|
177
|
+
for (let index = items.length - 1; index >= 0; index--) {
|
|
178
|
+
if (!items[index].disabled) return index;
|
|
179
|
+
}
|
|
180
|
+
return -1;
|
|
181
|
+
}
|
|
182
|
+
for (let offset = 1; offset <= items.length; offset++) {
|
|
183
|
+
const index = (fromIndex + direction * offset + items.length) % items.length;
|
|
184
|
+
if (!items[index]?.disabled) return index;
|
|
185
|
+
}
|
|
186
|
+
return -1;
|
|
187
|
+
};
|
|
188
|
+
const findTypeaheadIndex = (search, fromIndex) => {
|
|
189
|
+
const normalizedSearch = search.trim().toLocaleLowerCase();
|
|
190
|
+
if (!normalizedSearch) return -1;
|
|
191
|
+
const start = fromIndex == null || fromIndex < 0 ? -1 : fromIndex;
|
|
192
|
+
for (let offset = 1; offset <= items.length; offset++) {
|
|
193
|
+
const index = (start + offset) % items.length;
|
|
194
|
+
const item = items[index];
|
|
195
|
+
const label = item.textValue || getSelectLabelText(item.label) || item.value;
|
|
196
|
+
if (!item.disabled && label.toLocaleLowerCase().startsWith(normalizedSearch)) {
|
|
197
|
+
return index;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return -1;
|
|
201
|
+
};
|
|
202
|
+
return {
|
|
203
|
+
subscribe(listener) {
|
|
204
|
+
listeners.add(listener);
|
|
205
|
+
return () => {
|
|
206
|
+
listeners.delete(listener);
|
|
207
|
+
};
|
|
208
|
+
},
|
|
209
|
+
registerItem,
|
|
210
|
+
registerLabel,
|
|
211
|
+
getItems,
|
|
212
|
+
getItem,
|
|
213
|
+
getIndex,
|
|
214
|
+
firstEnabledIndex,
|
|
215
|
+
nextEnabledIndex,
|
|
216
|
+
findTypeaheadIndex,
|
|
217
|
+
getDisabledIndices: () => items.flatMap((item, index) => item.disabled ? [index] : []),
|
|
218
|
+
getTypeaheadLabels: () => items.map((item) => item.textValue || getSelectLabelText(item.label) || item.value)
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function normalizeSelectSelection(mode, value) {
|
|
222
|
+
if (mode === "single") {
|
|
223
|
+
return typeof value === "string" ? value : "";
|
|
224
|
+
}
|
|
225
|
+
const values = Array.isArray(value) ? value : [];
|
|
226
|
+
return [...new Set(values)];
|
|
227
|
+
}
|
|
228
|
+
function selectedValuesFromSelection(mode, value) {
|
|
229
|
+
const normalized = normalizeSelectSelection(mode, value);
|
|
230
|
+
return mode === "multiple" ? normalized : normalized ? [normalized] : [];
|
|
231
|
+
}
|
|
232
|
+
function createSelectSelectionController({ mode: initialMode, value: initialValue, registry }) {
|
|
233
|
+
let mode = initialMode;
|
|
234
|
+
let value = normalizeSelectSelection(mode, initialValue);
|
|
235
|
+
let activeIndex = null;
|
|
236
|
+
const selectedValues = () => selectedValuesFromSelection(mode, value);
|
|
237
|
+
const setMode = (nextMode) => {
|
|
238
|
+
if (mode === nextMode) return value;
|
|
239
|
+
mode = nextMode;
|
|
240
|
+
value = normalizeSelectSelection(mode, value);
|
|
241
|
+
return value;
|
|
242
|
+
};
|
|
243
|
+
const setValue = (nextValue) => {
|
|
244
|
+
value = normalizeSelectSelection(mode, nextValue);
|
|
245
|
+
return value;
|
|
246
|
+
};
|
|
247
|
+
const isSelected = (itemValue) => selectedValues().includes(itemValue);
|
|
248
|
+
const toggle = (itemValue) => {
|
|
249
|
+
const item = registry.getItem(itemValue);
|
|
250
|
+
if (!item || item.disabled) return value;
|
|
251
|
+
if (mode === "single") {
|
|
252
|
+
value = itemValue;
|
|
253
|
+
return value;
|
|
254
|
+
}
|
|
255
|
+
const current = selectedValues();
|
|
256
|
+
value = current.includes(itemValue) ? current.filter((currentValue) => currentValue !== itemValue) : [...current, itemValue];
|
|
257
|
+
return value;
|
|
258
|
+
};
|
|
259
|
+
const selectionAnchor = () => {
|
|
260
|
+
const values = selectedValues();
|
|
261
|
+
for (let index = values.length - 1; index >= 0; index--) {
|
|
262
|
+
const item = registry.getItem(values[index]);
|
|
263
|
+
if (item) return item;
|
|
264
|
+
}
|
|
265
|
+
const firstEnabledIndex = registry.firstEnabledIndex();
|
|
266
|
+
return firstEnabledIndex < 0 ? void 0 : registry.getItems()[firstEnabledIndex];
|
|
267
|
+
};
|
|
268
|
+
const selectionAnchorIndex = () => {
|
|
269
|
+
const anchor = selectionAnchor();
|
|
270
|
+
return anchor ? registry.getIndex(anchor.value) : -1;
|
|
271
|
+
};
|
|
272
|
+
const initialActiveIndex = () => {
|
|
273
|
+
const anchorIndex = selectionAnchorIndex();
|
|
274
|
+
const anchor = anchorIndex < 0 ? void 0 : registry.getItems()[anchorIndex];
|
|
275
|
+
return anchor && !anchor.disabled ? anchorIndex : registry.firstEnabledIndex();
|
|
276
|
+
};
|
|
277
|
+
const moveActive = (direction) => {
|
|
278
|
+
const nextIndex = registry.nextEnabledIndex(activeIndex, direction);
|
|
279
|
+
activeIndex = nextIndex < 0 ? null : nextIndex;
|
|
280
|
+
return activeIndex == null ? void 0 : registry.getItems()[activeIndex];
|
|
281
|
+
};
|
|
282
|
+
return {
|
|
283
|
+
registry,
|
|
284
|
+
get mode() {
|
|
285
|
+
return mode;
|
|
286
|
+
},
|
|
287
|
+
get value() {
|
|
288
|
+
return value;
|
|
289
|
+
},
|
|
290
|
+
get activeIndex() {
|
|
291
|
+
return activeIndex;
|
|
292
|
+
},
|
|
293
|
+
get activeItem() {
|
|
294
|
+
return activeIndex == null ? void 0 : registry.getItems()[activeIndex];
|
|
295
|
+
},
|
|
296
|
+
get shouldCloseOnSelect() {
|
|
297
|
+
return mode === "single";
|
|
298
|
+
},
|
|
299
|
+
setMode,
|
|
300
|
+
setValue,
|
|
301
|
+
isSelected,
|
|
302
|
+
toggle,
|
|
303
|
+
selectionAnchor,
|
|
304
|
+
selectionAnchorIndex,
|
|
305
|
+
initialActiveIndex,
|
|
306
|
+
setActiveIndex(index) {
|
|
307
|
+
activeIndex = index;
|
|
308
|
+
},
|
|
309
|
+
moveActive
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function getSelectListboxProps(mode) {
|
|
313
|
+
return {
|
|
314
|
+
role: "listbox",
|
|
315
|
+
"aria-multiselectable": mode === "multiple" ? true : void 0
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function getSelectOptionProps(mode, selected, disabled, platform) {
|
|
319
|
+
if (platform === "native") {
|
|
320
|
+
return {
|
|
321
|
+
accessibilityRole: mode === "multiple" ? "checkbox" : "button",
|
|
322
|
+
accessibilityState: {
|
|
323
|
+
selected: mode === "single" ? selected : void 0,
|
|
324
|
+
checked: mode === "multiple" ? selected : void 0,
|
|
325
|
+
disabled
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
role: "option",
|
|
331
|
+
"aria-selected": selected,
|
|
332
|
+
"aria-disabled": disabled || void 0
|
|
333
|
+
};
|
|
334
|
+
}
|