@tamagui/select 2.7.7 → 3.0.0-beta.643.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":"SelectTrigger.native.js","names":[],"sources":["jsx/SelectTrigger.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar SelectTrigger_exports = {};\n__export(SelectTrigger_exports, {\n\tSelectTrigger: () => SelectTrigger,\n\tSelectTriggerFrame: () => SelectTriggerFrame\n});\nmodule.exports = __toCommonJS(SelectTrigger_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core = require(\"@tamagui/core\");\nvar import_helpers = require(\"@tamagui/helpers\");\n__toESM(require(\"react\"), 1);\nvar import_context = require(\"./context\");\nvar SelectTriggerFrame = (0, import_core.styled)(import_core.View, {\n\tdisplayName: \"SelectTrigger\",\n\talignItems: \"center\",\n\tflexDirection: \"row\",\n\trender: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", { type: \"button\" })\n});\nvar SelectTrigger = (0, import_core.createStyledHOC)(SelectTriggerFrame, function SelectTrigger2(props, forwardedRef) {\n\tvar _context_floatingContext;\n\tvar { scope, disabled = false, ...triggerProps } = props;\n\tvar context = (0, import_context.useSelectContext)(scope);\n\tvar itemParentContext = (0, import_context.useSelectItemParentContext)(scope);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, (_context_floatingContext = context.floatingContext) === null || _context_floatingContext === void 0 ? void 0 : _context_floatingContext.refs.setReference);\n\tif (itemParentContext.shouldRenderWebNative) return null;\n\tvar toggleOpen = function(event) {\n\t\tvar reason = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"trigger-press\";\n\t\tif (!disabled) itemParentContext.requestOpenChange(!context.open, (0, import_core.createChangeEventDetails)(reason, (event === null || event === void 0 ? void 0 : event.nativeEvent) || event, event === null || event === void 0 ? void 0 : event.currentTarget));\n\t};\n\tvar interactionProps = {\n\t\t...triggerProps,\n\t\t...import_constants.isWeb ? { onMouseDown: (0, import_helpers.composeEventHandlers)(triggerProps.onMouseDown, function(event) {\n\t\t\tevent.preventDefault();\n\t\t\ttoggleOpen(event);\n\t\t}) } : { onPress: (0, import_helpers.composeEventHandlers)(triggerProps.onPress, toggleOpen) },\n\t\tonKeyDown: (0, import_helpers.composeEventHandlers)(triggerProps.onKeyDown, function(event) {\n\t\t\tif (event.key === \"Enter\" || event.key === \" \") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleOpen(event, \"keyboard\");\n\t\t\t}\n\t\t})\n\t};\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectTriggerFrame, {\n\t\ttype: \"button\",\n\t\tid: itemParentContext.id,\n\t\trole: \"combobox\",\n\t\t\"aria-haspopup\": \"listbox\",\n\t\t\"aria-expanded\": context.open,\n\t\t\"aria-autocomplete\": \"none\",\n\t\taccessibilityRole: import_constants.isWeb ? void 0 : \"button\",\n\t\taccessibilityState: import_constants.isWeb ? void 0 : {\n\t\t\texpanded: context.open,\n\t\t\tdisabled\n\t\t},\n\t\tdir: context.dir,\n\t\tdisabled,\n\t\t\"data-disabled\": disabled ? \"\" : void 0,\n\t\t...interactionProps,\n\t\tref: composedRefs\n\t});\n});\n//# sourceMappingURL=SelectTrigger.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKpG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa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AkB,kBAAkB,CAAC,QAAQ,OAAO,GAAG,YAAY,0BAA0B,SAAS,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,gBAAgB,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,aAAa,CAAC;CACnQ;CACA,IAAI,mBAAmB;EACtB,GAAG;EACH,GAAG,iBAAiB,QAAQ,EAAE,cAAc,GAAG,eAAe,sBAAsB,aAAa,aAAa,SAAS,OAAO;GAC7H,MAAM,eAAe;GACrB,WAAW,KAAK;EACjB,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,eAAe,sBAAsB,aAAa,SAAS,UAAU,EAAE;EAC7F,YAAY,GAAG,eAAe,sBAAsB,aAAa,WAAW,SAAS,OAAO;GAC3F,IAAI,MAAM,QAAQ,WAAW,MAAM,QAAQ,KAAK;IAC/C,MAAM,eAAe;IACrB,WAAW,OAAO,UAAU;GAC7B;EACD,CAAC;CACF;CACA,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,oBAAoB;EACtE,MAAM;EACN,IAAI,kBAAkB;EACtB,MAAM;EACN,iBAAiB;EACjB,iBAAiB,QAAQ;EACzB,qBAAqB;EACrB,mBAAmB,iBAAiB,QAAQ,KAAK,IAAI;EACrD,oBAAoB,iBAAiB,QAAQ,KAAK,IAAI;GACrD,UAAU,QAAQ;GAClB;EACD;EACA,KAAK,QAAQ;EACb;EACA,iBAAiB,WAAW,KAAK,KAAK;EACtC,GAAG;EACH,KAAK;CACN,CAAC;AACF,CAAC"}
|
|
@@ -2,142 +2,127 @@ import { AdaptPortalContents, useAdaptIsActive } from "@tamagui/adapt";
|
|
|
2
2
|
import { AnimatePresence } from "@tamagui/animate-presence";
|
|
3
3
|
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
4
4
|
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
5
|
-
import { styled } from "@tamagui/core";
|
|
5
|
+
import { View, createStyledHOC, styled } from "@tamagui/core";
|
|
6
6
|
import { needsPortalRepropagation } from "@tamagui/portal";
|
|
7
|
-
import {
|
|
7
|
+
import { YStack } from "@tamagui/stacks";
|
|
8
8
|
import { startTransition } from "@tamagui/start-transition";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { VIEWPORT_NAME } from "./constants.mjs";
|
|
11
11
|
import { ForwardSelectContext, useSelectContext, useSelectItemParentContext } from "./context.mjs";
|
|
12
|
+
import { getSelectListboxProps } from "./selectionController.mjs";
|
|
12
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
false: {
|
|
18
|
-
size: "$2",
|
|
19
|
-
backgroundColor: "$background",
|
|
20
|
-
elevate: true,
|
|
21
|
-
bordered: true,
|
|
22
|
-
userSelect: "none",
|
|
23
|
-
outlineWidth: 0
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
size: {
|
|
27
|
-
"...size": (val, {
|
|
28
|
-
tokens
|
|
29
|
-
}) => {
|
|
30
|
-
return {
|
|
31
|
-
borderRadius: tokens.radius[val] ?? val
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
defaultVariants: {
|
|
37
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
38
|
-
}
|
|
14
|
+
|
|
15
|
+
const SelectViewportFrame = styled(View, {
|
|
16
|
+
displayName: VIEWPORT_NAME,
|
|
17
|
+
position: "relative"
|
|
39
18
|
});
|
|
40
19
|
const needsRepropagation = needsPortalRepropagation();
|
|
41
|
-
const SelectViewport = SelectViewportFrame
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
20
|
+
const SelectViewport = createStyledHOC(SelectViewportFrame, function SelectViewport2(props, forwardedRef) {
|
|
21
|
+
const { scope, children, disableScroll, ...viewportProps } = props;
|
|
22
|
+
const context = useSelectContext(scope);
|
|
23
|
+
const itemContext = useSelectItemParentContext(scope);
|
|
24
|
+
const isAdapted = useAdaptIsActive(context.adaptScope);
|
|
25
|
+
const viewportRef = React.useRef(null);
|
|
26
|
+
const registeredItemCount = itemContext.registry.getItems().length;
|
|
27
|
+
const [lazyMounted, setLazyMounted] = React.useState(context.lazyMount ? false : true);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
if (!context.lazyMount) return;
|
|
30
|
+
if (!context.open) return;
|
|
31
|
+
if (lazyMounted) return;
|
|
32
|
+
startTransition(() => {
|
|
33
|
+
setLazyMounted(true);
|
|
34
|
+
});
|
|
35
|
+
}, [
|
|
36
|
+
context.lazyMount,
|
|
37
|
+
context.open,
|
|
38
|
+
lazyMounted
|
|
39
|
+
]);
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
if (!isWeb || !isAdapted || !context.open) return;
|
|
42
|
+
const frame = requestAnimationFrame(() => {
|
|
43
|
+
const index = context.activeIndexRef.current ?? itemContext.registry.firstEnabledIndex();
|
|
44
|
+
const activeItem = viewportRef.current?.querySelector("[role=\"option\"][tabindex=\"0\"]") ?? (index >= 0 ? itemContext.listRef?.current[index] : null);
|
|
45
|
+
activeItem?.focus();
|
|
46
|
+
});
|
|
47
|
+
return () => cancelAnimationFrame(frame);
|
|
48
|
+
}, [
|
|
49
|
+
context.activeIndex,
|
|
50
|
+
context.open,
|
|
51
|
+
isAdapted,
|
|
52
|
+
registeredItemCount
|
|
53
|
+
]);
|
|
54
|
+
const composedRefs = useComposedRefs(forwardedRef, viewportRef, context.floatingContext?.refs.setFloating);
|
|
55
|
+
useIsomorphicLayoutEffect(() => {
|
|
56
|
+
if (context.update) {
|
|
57
|
+
context.update();
|
|
58
|
+
}
|
|
59
|
+
}, [isAdapted]);
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
if (context.lazyMount && lazyMounted && context.open && context.update) {
|
|
62
|
+
const frame = requestAnimationFrame(context.update);
|
|
63
|
+
return () => cancelAnimationFrame(frame);
|
|
64
|
+
}
|
|
65
|
+
}, [lazyMounted, registeredItemCount]);
|
|
66
|
+
if (itemContext.shouldRenderWebNative) {
|
|
67
|
+
return /* @__PURE__ */ jsx(YStack, {
|
|
68
|
+
position: "relative",
|
|
69
|
+
children
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (isAdapted || !isWeb) {
|
|
73
|
+
let content = /* @__PURE__ */ jsx(SelectViewportFrame, {
|
|
74
|
+
...viewportProps,
|
|
75
|
+
...isWeb ? getSelectListboxProps(itemContext.mode) : {},
|
|
76
|
+
"data-select-viewport": "",
|
|
77
|
+
ref: composedRefs,
|
|
78
|
+
children: lazyMounted ? children : null
|
|
79
|
+
});
|
|
80
|
+
if (needsRepropagation) {
|
|
81
|
+
content = /* @__PURE__ */ jsx(ForwardSelectContext, {
|
|
82
|
+
itemContext,
|
|
83
|
+
context,
|
|
84
|
+
children: content
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return /* @__PURE__ */ jsx(AdaptPortalContents, {
|
|
88
|
+
scope: context.adaptScope,
|
|
89
|
+
children: content
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (!itemContext.interactions) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
const { style, className, ...floatingProps } = itemContext.interactions.getFloatingProps();
|
|
96
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
97
|
+
!disableScroll && /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: selectViewportCSS } }),
|
|
98
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: context.open ? /* @__PURE__ */ jsx(SelectViewportFrame, {
|
|
99
|
+
"data-select-viewport": "",
|
|
100
|
+
...isWeb && { "data-state": context.open ? "open" : "closed" },
|
|
101
|
+
...viewportProps,
|
|
102
|
+
...style,
|
|
103
|
+
...floatingProps,
|
|
104
|
+
...getSelectListboxProps(itemContext.mode),
|
|
105
|
+
overflowY: disableScroll ? void 0 : style.overflow ?? "auto",
|
|
106
|
+
ref: composedRefs,
|
|
107
|
+
children: lazyMounted ? children : null
|
|
108
|
+
}, "select-viewport") : null }),
|
|
109
|
+
!context.open && !(context.lazyMount && context.renderValue) && lazyMounted && /* @__PURE__ */ jsx("div", {
|
|
110
|
+
style: { display: "none" },
|
|
111
|
+
children
|
|
112
|
+
})
|
|
113
|
+
] });
|
|
130
114
|
});
|
|
131
115
|
const selectViewportCSS = `
|
|
132
|
-
|
|
116
|
+
[data-select-viewport] {
|
|
133
117
|
scrollbar-width: none;
|
|
134
118
|
-webkit-overflow-scrolling: touch;
|
|
135
119
|
overscroll-behavior: contain;
|
|
136
120
|
}
|
|
137
121
|
|
|
138
|
-
|
|
122
|
+
[data-select-viewport]::-webkit-scrollbar{
|
|
139
123
|
display:none
|
|
140
124
|
}
|
|
141
125
|
`;
|
|
126
|
+
|
|
142
127
|
export { SelectViewport, SelectViewportFrame };
|
|
143
128
|
//# sourceMappingURL=SelectViewport.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"SelectViewport.js","names":[],"sources":["jsx/SelectViewport.js"],"sourcesContent":["import { AdaptPortalContents, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { AnimatePresence } from \"@tamagui/animate-presence\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createStyledHOC, styled, View } from \"@tamagui/core\";\nimport { needsPortalRepropagation } from \"@tamagui/portal\";\nimport { YStack } from \"@tamagui/stacks\";\nimport { startTransition } from \"@tamagui/start-transition\";\nimport * as React from \"react\";\nimport { VIEWPORT_NAME } from \"./constants\";\nimport {\n ForwardSelectContext,\n useSelectContext,\n useSelectItemParentContext\n} from \"./context\";\nimport { getSelectListboxProps } from \"./selectionController\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nconst SelectViewportFrame = styled(View, {\n displayName: VIEWPORT_NAME,\n position: \"relative\"\n});\nconst needsRepropagation = needsPortalRepropagation();\nconst SelectViewport = createStyledHOC(\n SelectViewportFrame,\n function SelectViewport2(props, forwardedRef) {\n const { scope, children, disableScroll, ...viewportProps } = props;\n const context = useSelectContext(scope);\n const itemContext = useSelectItemParentContext(scope);\n const isAdapted = useAdaptIsActive(context.adaptScope);\n const viewportRef = React.useRef(null);\n const registeredItemCount = itemContext.registry.getItems().length;\n const [lazyMounted, setLazyMounted] = React.useState(context.lazyMount ? false : true);\n React.useEffect(() => {\n if (!context.lazyMount) return;\n if (!context.open) return;\n if (lazyMounted) return;\n startTransition(() => {\n setLazyMounted(true);\n });\n }, [context.lazyMount, context.open, lazyMounted]);\n React.useEffect(() => {\n if (!isWeb || !isAdapted || !context.open) return;\n const frame = requestAnimationFrame(() => {\n const index = context.activeIndexRef.current ?? itemContext.registry.firstEnabledIndex();\n const activeItem = viewportRef.current?.querySelector(\n '[role=\"option\"][tabindex=\"0\"]'\n ) ?? (index >= 0 ? itemContext.listRef?.current[index] : null);\n activeItem?.focus();\n });\n return () => cancelAnimationFrame(frame);\n }, [context.activeIndex, context.open, isAdapted, registeredItemCount]);\n const composedRefs = useComposedRefs(\n // @ts-ignore react 19 ref type mismatch\n forwardedRef,\n viewportRef,\n context.floatingContext?.refs.setFloating\n );\n useIsomorphicLayoutEffect(() => {\n if (context.update) {\n context.update();\n }\n }, [isAdapted]);\n React.useEffect(() => {\n if (context.lazyMount && lazyMounted && context.open && context.update) {\n const frame = requestAnimationFrame(context.update);\n return () => cancelAnimationFrame(frame);\n }\n }, [lazyMounted, registeredItemCount]);\n if (itemContext.shouldRenderWebNative) {\n return /* @__PURE__ */ jsx(YStack, { position: \"relative\", children });\n }\n if (isAdapted || !isWeb) {\n let content = /* @__PURE__ */ jsx(\n SelectViewportFrame,\n {\n ...viewportProps,\n ...isWeb ? getSelectListboxProps(itemContext.mode) : {},\n \"data-select-viewport\": \"\",\n ref: composedRefs,\n children: lazyMounted ? children : null\n }\n );\n if (needsRepropagation) {\n content = /* @__PURE__ */ jsx(ForwardSelectContext, { itemContext, context, children: content });\n }\n return /* @__PURE__ */ jsx(AdaptPortalContents, { scope: context.adaptScope, children: content });\n }\n if (!itemContext.interactions) {\n return null;\n }\n const {\n style,\n // remove this, it was set to \"Select\" always\n className,\n ...floatingProps\n } = itemContext.interactions.getFloatingProps();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n !disableScroll && /* @__PURE__ */ jsx(\n \"style\",\n {\n dangerouslySetInnerHTML: {\n __html: selectViewportCSS\n }\n }\n ),\n /* @__PURE__ */ jsx(AnimatePresence, { children: context.open ? /* @__PURE__ */ jsx(\n SelectViewportFrame,\n {\n \"data-select-viewport\": \"\",\n ...isWeb && {\n \"data-state\": context.open ? \"open\" : \"closed\"\n },\n ...viewportProps,\n ...style,\n ...floatingProps,\n ...getSelectListboxProps(itemContext.mode),\n overflowY: disableScroll ? void 0 : style.overflow ?? \"auto\",\n ref: composedRefs,\n children: lazyMounted ? children : null\n },\n \"select-viewport\"\n ) : null }),\n !context.open && !(context.lazyMount && context.renderValue) && lazyMounted && /* @__PURE__ */ jsx(\"div\", { style: { display: \"none\" }, children })\n ] });\n }\n);\nconst selectViewportCSS = `\n[data-select-viewport] {\n scrollbar-width: none;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n}\n\n[data-select-viewport]::-webkit-scrollbar{\n display:none\n}\n`;\nexport {\n SelectViewport,\n SelectViewportFrame\n};\n//# sourceMappingURL=SelectViewport.js.map\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAM,sBAAsB,OAAO,MAAM;CACvC,aAAa;CACb,UAAU;AACZ,CAAC;AACD,MAAM,qBAAqB,yBAAyB;AACpD,MAAM,iBAAiB,gBACrB,qBACA,SAAS,gBAAgB,OAAO,cAAc;CAC5C,MAAM,EAAE,OAAO,UAAU,eAAe,GAAG,kBAAkB;CAC7D,MAAM,UAAU,iBAAiB,KAAK;CACtC,MAAM,cAAc,2BAA2B,KAAK;CACpD,MAAM,YAAY,iBAAiB,QAAQ,UAAU;CACrD,MAAM,cAAc,MAAM,OAAO,IAAI;CACrC,MAAM,sBAAsB,YAAY,SAAS,SAAS,EAAE;CAC5D,MAAM,CAAC,aAAa,kBAAkB,MAAM,SAAS,QAAQ,YAAY,QAAQ,IAAI;CACrF,MAAM,gBAAgB;EACpB,IAAI,CAAC,QAAQ,WA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jG;EACA,OAAuB,oBAAI,qBAAqB;GAAE,OAAO,QAAQ;GAAY,UAAU;EAAQ,CAAC;CAClG;CACA,IAAI,CAAC,YAAY,cAAc;EAC7B,OAAO;CACT;CACA,MAAM,EACJ,OAEA,WACA,GAAG,kBACD,YAAY,aAAa,iBAAiB;CAC9C,OAAuB,qBAAK,UAAU,EAAE,UAAU;EAChD,CAAC,iBAAiC,oBAChC,SACA,EACE,yBAAyB,EACvB,QAAQ,kBACV,EACF,CACF;EACgB,oBAAI,iBAAiB,EAAE,UAAU,QAAQ,OAAuB,oBAC9E,qBACA;GACE,wBAAwB;GACxB,GAAG,SAAS,EACV,cAAc,QAAQ,OAAO,SAAS,SACxC;GACA,GAAG;GACH,GAAG;GACH,GAAG;GACH,GAAG,sBAAsB,YAAY,IAAI;GACzC,WAAW,gBAAgB,KAAK,IAAI,MAAM,YAAY;GACtD,KAAK;GACL,UAAU,cAAc,WAAW;EACrC,GACA,iBACF,IAAI,KAAK,CAAC;EACV,CAAC,QAAQ,QAAQ,EAAE,QAAQ,aAAa,QAAQ,gBAAgB,eAA+B,oBAAI,OAAO;GAAE,OAAO,EAAE,SAAS,OAAO;GAAG;EAAS,CAAC;CACpJ,EAAE,CAAC;AACL,CACF;AACA,MAAM,oBAAoB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 __export = (target, all) => {
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var SelectViewport_native_exports = {};
|
|
25
|
+
__export(SelectViewport_native_exports, {
|
|
26
|
+
SelectViewport: () => SelectViewport,
|
|
27
|
+
SelectViewportFrame: () => SelectViewportFrame
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(SelectViewport_native_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var import_adapt = require("@tamagui/adapt");
|
|
32
|
+
var import_core = require("@tamagui/core");
|
|
33
|
+
var import_constants = require("./constants.native.js");
|
|
34
|
+
var import_context = require("./context.native.js");
|
|
35
|
+
var SelectViewportFrame = (0, import_core.styled)(import_core.View, {
|
|
36
|
+
displayName: import_constants.VIEWPORT_NAME,
|
|
37
|
+
position: "relative"
|
|
38
|
+
});
|
|
39
|
+
var SelectViewport = (0, import_core.createStyledHOC)(SelectViewportFrame, function SelectViewport2(props, forwardedRef) {
|
|
40
|
+
var { scope, children, disableScroll: _disableScroll, ...viewportProps } = props;
|
|
41
|
+
var context = (0, import_context.useSelectContext)(scope);
|
|
42
|
+
var itemParentContext = (0, import_context.useSelectItemParentContext)(scope);
|
|
43
|
+
var themeName = (0, import_core.useThemeName)();
|
|
44
|
+
var adaptContext = (0, import_adapt.useAdaptContext)();
|
|
45
|
+
var isAdapted = (0, import_adapt.useAdaptIsActive)(context.adaptScope);
|
|
46
|
+
var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {
|
|
47
|
+
name: themeName,
|
|
48
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.ForwardSelectContext, {
|
|
49
|
+
itemContext: itemParentContext,
|
|
50
|
+
context,
|
|
51
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptContext.Provider, {
|
|
52
|
+
...adaptContext,
|
|
53
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
|
|
54
|
+
...viewportProps,
|
|
55
|
+
ref: forwardedRef,
|
|
56
|
+
children
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
if (!context.open) {
|
|
62
|
+
if (context.lazyMount && context.renderValue) return null;
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
|
|
64
|
+
display: "none",
|
|
65
|
+
children: contents
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {
|
|
69
|
+
scope: context.adaptScope,
|
|
70
|
+
children: contents
|
|
71
|
+
}) : contents;
|
|
72
|
+
});
|
|
73
|
+
SelectViewport.displayName = import_constants.VIEWPORT_NAME;
|
|
@@ -1,71 +1,75 @@
|
|
|
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 __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
}), mod);
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
24
|
var SelectViewport_native_exports = {};
|
|
26
25
|
__export(SelectViewport_native_exports, {
|
|
27
|
-
|
|
26
|
+
SelectViewport: () => SelectViewport,
|
|
27
|
+
SelectViewportFrame: () => SelectViewportFrame
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(SelectViewport_native_exports);
|
|
30
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
31
|
var import_adapt = require("@tamagui/adapt");
|
|
32
32
|
var import_core = require("@tamagui/core");
|
|
33
|
-
var import_stacks = require("@tamagui/stacks");
|
|
34
33
|
var import_constants = require("./constants.native.js");
|
|
35
34
|
var import_context = require("./context.native.js");
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
35
|
+
var SelectViewportFrame = (0, import_core.styled)(import_core.View, {
|
|
36
|
+
displayName: import_constants.VIEWPORT_NAME,
|
|
37
|
+
position: "relative"
|
|
38
|
+
});
|
|
39
|
+
var SelectViewport = (0, import_core.createStyledHOC)(SelectViewportFrame, function SelectViewport2(props, forwardedRef) {
|
|
40
|
+
var { scope, children, disableScroll: _disableScroll, ...viewportProps } = props;
|
|
41
|
+
var context = (0, import_context.useSelectContext)(scope);
|
|
42
|
+
var itemParentContext = (0, import_context.useSelectItemParentContext)(scope);
|
|
43
|
+
var themeName = (0, import_core.useThemeName)();
|
|
44
|
+
var adaptContext = (0, import_adapt.useAdaptContext)();
|
|
45
|
+
var isAdapted = (0, import_adapt.useAdaptIsActive)(context.adaptScope);
|
|
46
|
+
var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {
|
|
47
|
+
name: themeName,
|
|
48
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.ForwardSelectContext, {
|
|
49
|
+
itemContext: itemParentContext,
|
|
50
|
+
context,
|
|
51
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptContext.Provider, {
|
|
52
|
+
...adaptContext,
|
|
53
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
|
|
54
|
+
...viewportProps,
|
|
55
|
+
ref: forwardedRef,
|
|
56
|
+
children
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
if (!context.open) {
|
|
62
|
+
if (context.lazyMount && context.renderValue) return null;
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {
|
|
64
|
+
display: "none",
|
|
65
|
+
children: contents
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {
|
|
69
|
+
scope: context.adaptScope,
|
|
70
|
+
children: contents
|
|
71
|
+
}) : contents;
|
|
72
|
+
});
|
|
70
73
|
SelectViewport.displayName = import_constants.VIEWPORT_NAME;
|
|
74
|
+
|
|
71
75
|
//# sourceMappingURL=SelectViewport.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"SelectViewport.native.js","names":[],"sources":["jsx/SelectViewport.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 SelectViewport_native_exports = {};\n__export(SelectViewport_native_exports, {\n SelectViewport: () => SelectViewport,\n SelectViewportFrame: () => SelectViewportFrame\n});\nmodule.exports = __toCommonJS(SelectViewport_native_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_adapt = require(\"@tamagui/adapt\");\nvar import_core = require(\"@tamagui/core\");\nvar import_constants = require(\"./constants\");\nvar import_context = require(\"./context\");\nvar SelectViewportFrame = (0, import_core.styled)(import_core.View, {\n displayName: import_constants.VIEWPORT_NAME,\n position: \"relative\"\n});\nvar SelectViewport = (0, import_core.createStyledHOC)(SelectViewportFrame, function SelectViewport2(props, forwardedRef) {\n var { scope, children, disableScroll: _disableScroll, ...viewportProps } = props;\n var context = (0, import_context.useSelectContext)(scope);\n var itemParentContext = (0, import_context.useSelectItemParentContext)(scope);\n var themeName = (0, import_core.useThemeName)();\n var adaptContext = (0, import_adapt.useAdaptContext)();\n var isAdapted = (0, import_adapt.useAdaptIsActive)(context.adaptScope);\n var contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {\n name: themeName,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_context.ForwardSelectContext, {\n itemContext: itemParentContext,\n context,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptContext.Provider, {\n ...adaptContext,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {\n ...viewportProps,\n ref: forwardedRef,\n children\n })\n })\n })\n });\n if (!context.open) {\n if (context.lazyMount && context.renderValue) return null;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportFrame, {\n display: \"none\",\n children: contents\n });\n }\n return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptPortalContents, {\n scope: context.adaptScope,\n children: contents\n }) : contents;\n});\nSelectViewport.displayName = import_constants.VIEWPORT_NAME;\n//# sourceMappingURL=SelectViewport.native.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;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K;KACL;IACF,CAAC;GACH,CAAC;EACH,CAAC;CACH,CAAC;CACD,IAAI,CAAC,QAAQ,MAAM;EACjB,IAAI,QAAQ,aAAa,QAAQ,aAAa,OAAO;EACrD,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,qBAAqB;GACtE,SAAS;GACT,UAAU;EACZ,CAAC;CACH;CACA,OAAO,YAA4B,iBAAC,GAAG,mBAAmB,KAAK,aAAa,qBAAqB;EAC/F,OAAO,QAAQ;EACf,UAAU;CACZ,CAAC,IAAI;AACP,CAAC;AACD,eAAe,cAAc,iBAAiB"}
|
package/dist/jsx/constants.mjs
CHANGED
|
@@ -5,5 +5,6 @@ const SCROLL_ARROW_THRESHOLD = 8;
|
|
|
5
5
|
const MIN_HEIGHT = 80;
|
|
6
6
|
const FALLBACK_THRESHOLD = 16;
|
|
7
7
|
const VIEWPORT_NAME = "SelectViewport";
|
|
8
|
+
|
|
8
9
|
export { FALLBACK_THRESHOLD, MIN_HEIGHT, SCROLL_ARROW_THRESHOLD, SCROLL_ARROW_VELOCITY, SELECT_NAME, VIEWPORT_NAME, WINDOW_PADDING };
|
|
9
10
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["jsx/constants.js"],"sourcesContent":["const SELECT_NAME = \"Select\";\nconst WINDOW_PADDING = 8;\nconst SCROLL_ARROW_VELOCITY = 8;\nconst SCROLL_ARROW_THRESHOLD = 8;\nconst MIN_HEIGHT = 80;\nconst FALLBACK_THRESHOLD = 16;\nconst VIEWPORT_NAME = \"SelectViewport\";\nexport {\n FALLBACK_THRESHOLD,\n MIN_HEIGHT,\n SCROLL_ARROW_THRESHOLD,\n SCROLL_ARROW_VELOCITY,\n SELECT_NAME,\n VIEWPORT_NAME,\n WINDOW_PADDING\n};\n//# sourceMappingURL=constants.js.map\n"],"mappings":";AAAA,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM,wBAAwB;AAC9B,MAAM,yBAAyB;AAC/B,MAAM,aAAa;AACnB,MAAM,qBAAqB;AAC3B,MAAM,gBAAgB"}
|