@tamagui/select 1.1.7 → 1.1.9
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/BubbleSelect.js +4 -0
- package/dist/cjs/BubbleSelect.js.map +1 -1
- package/dist/cjs/Select.js +127 -112
- package/dist/cjs/Select.js.map +1 -1
- package/dist/cjs/SelectContent.js +3 -25
- package/dist/cjs/SelectContent.js.map +1 -1
- package/dist/cjs/SelectImpl.js +33 -26
- package/dist/cjs/SelectImpl.js.map +1 -1
- package/dist/cjs/SelectImpl.native.js +1 -3
- package/dist/cjs/SelectImpl.native.js.map +1 -1
- package/dist/cjs/SelectScrollButton.js +58 -45
- package/dist/cjs/SelectScrollButton.js.map +1 -1
- package/dist/cjs/SelectViewport.js +24 -25
- package/dist/cjs/SelectViewport.js.map +1 -1
- package/dist/cjs/SelectViewport.native.js +5 -14
- package/dist/cjs/SelectViewport.native.js.map +1 -1
- package/dist/cjs/context.js +1 -6
- package/dist/cjs/context.js.map +1 -1
- package/dist/cjs/useSelectBreakpointActive.js.map +1 -1
- package/dist/esm/BubbleSelect.js.map +1 -1
- package/dist/esm/Select.js +123 -112
- package/dist/esm/Select.js.map +1 -1
- package/dist/esm/SelectContent.js +3 -25
- package/dist/esm/SelectContent.js.map +1 -1
- package/dist/esm/SelectImpl.js +29 -26
- package/dist/esm/SelectImpl.js.map +1 -1
- package/dist/esm/SelectImpl.native.js +1 -3
- package/dist/esm/SelectImpl.native.js.map +1 -1
- package/dist/esm/SelectScrollButton.js +54 -45
- package/dist/esm/SelectScrollButton.js.map +1 -1
- package/dist/esm/SelectViewport.js +20 -25
- package/dist/esm/SelectViewport.js.map +1 -1
- package/dist/esm/SelectViewport.native.js +1 -14
- package/dist/esm/SelectViewport.native.js.map +1 -1
- package/dist/esm/context.js +1 -6
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/useSelectBreakpointActive.js.map +1 -1
- package/dist/jsx/BubbleSelect.js.map +1 -1
- package/dist/jsx/Select.js +121 -18
- package/dist/jsx/Select.js.map +1 -1
- package/dist/jsx/SelectContent.js.map +1 -1
- package/dist/jsx/SelectImpl.js +25 -3
- package/dist/jsx/SelectImpl.js.map +1 -1
- package/dist/jsx/SelectScrollButton.js +47 -25
- package/dist/jsx/SelectScrollButton.js.map +1 -1
- package/dist/jsx/SelectViewport.js +13 -4
- package/dist/jsx/SelectViewport.js.map +1 -1
- package/dist/jsx/useSelectBreakpointActive.js.map +1 -1
- package/package.json +15 -15
package/dist/cjs/BubbleSelect.js
CHANGED
|
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/BubbleSelect.tsx"],
|
|
4
4
|
"sourcesContent": ["import { usePrevious } from '@radix-ui/react-use-previous'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport * as React from 'react'\n\n/* -----------------------------------------------------------------------------------------------*/\nconst BubbleSelect = React.forwardRef<\n HTMLSelectElement,\n React.ComponentPropsWithoutRef<'select'>\n>((props, forwardedRef) => {\n const { value, ...selectProps } = props\n const ref = React.useRef<HTMLSelectElement>(null)\n const composedRefs = useComposedRefs(forwardedRef, ref)\n const prevValue = usePrevious(value)\n\n // Bubble value change to parents (e.g form change event)\n React.useEffect(() => {\n const select = ref.current!\n const selectProto = window.HTMLSelectElement.prototype\n const descriptor = Object.getOwnPropertyDescriptor(\n selectProto,\n 'value',\n ) as PropertyDescriptor\n const setValue = descriptor.set\n if (prevValue !== value && setValue) {\n const event = new Event('change', { bubbles: true })\n setValue.call(select, value)\n select.dispatchEvent(event)\n }\n }, [prevValue, value])\n\n /**\n * We purposefully use a `select` here to support form autofill as much\n * as possible.\n *\n * We purposefully do not add the `value` attribute here to allow the value\n * to be set programatically and bubble to any parent form `onChange` event.\n * Adding the `value` will cause React to consider the programatic\n * dispatch a duplicate and it will get swallowed.\n *\n * We use `VisuallyHidden` rather than `display: \"none\"` because Safari autofill\n * won't work otherwise.\n */\n // TODO\n return null\n // return (\n // <VisuallyHidden asChild>\n // <select {...selectProps} ref={composedRefs} defaultValue={value} />\n // </VisuallyHidden>\n // )\n})\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,gCAA4B;AAC5B,0BAAgC;AAChC,YAAuB;AAGvB,MAAM,eAAe,MAAM,WAGzB,CAAC,OAAO,iBAAiB;AACzB,QAAM,EAAE,OAAO,GAAG,YAAY,IAAI;AAClC,QAAM,MAAM,MAAM,OAA0B,IAAI;AAChD,QAAM,mBAAe,qCAAgB,cAAc,GAAG;AACtD,QAAM,gBAAY,uCAAY,KAAK;AAGnC,QAAM,UAAU,MAAM;AACpB,UAAM,SAAS,IAAI;AACnB,UAAM,cAAc,OAAO,kBAAkB;AAC7C,UAAM,aAAa,OAAO;AAAA,MACxB;AAAA,MACA;AAAA,IACF;AACA,UAAM,WAAW,WAAW;AAC5B,QAAI,cAAc,SAAS,UAAU;AACnC,YAAM,QAAQ,IAAI,MAAM,UAAU,EAAE,SAAS,KAAK,CAAC;AACnD,eAAS,KAAK,QAAQ,KAAK;AAC3B,aAAO,cAAc,KAAK;AAAA,IAC5B;AAAA,EACF,GAAG,CAAC,WAAW,KAAK,CAAC;AAerB,SAAO;AAMT,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/Select.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -60,35 +64,39 @@ const SelectTrigger = React.forwardRef(
|
|
|
60
64
|
const {
|
|
61
65
|
__scopeSelect,
|
|
62
66
|
disabled = false,
|
|
67
|
+
// @ts-ignore
|
|
63
68
|
"aria-labelledby": ariaLabelledby,
|
|
64
69
|
...triggerProps
|
|
65
70
|
} = props;
|
|
66
71
|
const context = (0, import_context.useSelectContext)(TRIGGER_NAME, __scopeSelect);
|
|
67
72
|
const labelledBy = ariaLabelledby;
|
|
68
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
import_list_item.ListItem,
|
|
75
|
+
{
|
|
76
|
+
componentName: TRIGGER_NAME,
|
|
77
|
+
backgrounded: true,
|
|
78
|
+
radiused: true,
|
|
79
|
+
hoverTheme: true,
|
|
80
|
+
pressTheme: true,
|
|
81
|
+
focusTheme: true,
|
|
82
|
+
focusable: true,
|
|
83
|
+
borderWidth: 1,
|
|
84
|
+
size: context.size,
|
|
85
|
+
"aria-expanded": context.open,
|
|
86
|
+
"aria-autocomplete": "none",
|
|
87
|
+
"aria-labelledby": labelledBy,
|
|
88
|
+
dir: context.dir,
|
|
89
|
+
disabled,
|
|
90
|
+
"data-disabled": disabled ? "" : void 0,
|
|
91
|
+
...triggerProps,
|
|
92
|
+
ref: forwardedRef,
|
|
93
|
+
...process.env.TAMAGUI_TARGET === "web" && context.interactions ? context.interactions.getReferenceProps() : {
|
|
94
|
+
onPress() {
|
|
95
|
+
context.setOpen(!context.open);
|
|
96
|
+
}
|
|
89
97
|
}
|
|
90
98
|
}
|
|
91
|
-
|
|
99
|
+
);
|
|
92
100
|
}
|
|
93
101
|
);
|
|
94
102
|
SelectTrigger.displayName = TRIGGER_NAME;
|
|
@@ -113,22 +121,24 @@ const SelectValue = SelectValueFrame.extractable(
|
|
|
113
121
|
(0, import_core2.useIsomorphicLayoutEffect)(() => {
|
|
114
122
|
onValueNodeHasChildrenChange(hasChildren);
|
|
115
123
|
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
SelectValueFrame,
|
|
126
|
+
{
|
|
127
|
+
size: context.size,
|
|
128
|
+
ref: composedRefs,
|
|
129
|
+
pointerEvents: "none",
|
|
130
|
+
children: selectValueChildren
|
|
131
|
+
}
|
|
132
|
+
);
|
|
122
133
|
}
|
|
123
134
|
)
|
|
124
135
|
);
|
|
125
136
|
SelectValue.displayName = VALUE_NAME;
|
|
126
137
|
const SelectIcon = (0, import_core2.styled)(import_stacks.XStack, {
|
|
127
138
|
name: "SelectIcon",
|
|
139
|
+
// @ts-ignore
|
|
128
140
|
"aria-hidden": true,
|
|
129
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Paragraph, {
|
|
130
|
-
children: "\u25BC"
|
|
131
|
-
})
|
|
141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Paragraph, { children: "\u25BC" })
|
|
132
142
|
});
|
|
133
143
|
const ITEM_NAME = "SelectItem";
|
|
134
144
|
const [SelectItemContextProvider, useSelectItemContext] = (0, import_context.createSelectContext)(ITEM_NAME);
|
|
@@ -210,31 +220,37 @@ const SelectItem = React.forwardRef(
|
|
|
210
220
|
}) : {
|
|
211
221
|
onPress: handleSelect
|
|
212
222
|
};
|
|
213
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
224
|
+
SelectItemContextProvider,
|
|
225
|
+
{
|
|
226
|
+
scope: __scopeSelect,
|
|
227
|
+
value,
|
|
228
|
+
textId: textId || "",
|
|
229
|
+
isSelected,
|
|
230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
231
|
+
import_list_item.ListItem,
|
|
232
|
+
{
|
|
233
|
+
tag: "div",
|
|
234
|
+
backgrounded: true,
|
|
235
|
+
pressTheme: true,
|
|
236
|
+
cursor: "",
|
|
237
|
+
focusTheme: true,
|
|
238
|
+
outlineWidth: 0,
|
|
239
|
+
componentName: ITEM_NAME,
|
|
240
|
+
ref: composedRefs,
|
|
241
|
+
"aria-labelledby": textId,
|
|
242
|
+
"aria-selected": isSelected,
|
|
243
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
244
|
+
"aria-disabled": disabled || void 0,
|
|
245
|
+
"data-disabled": disabled ? "" : void 0,
|
|
246
|
+
tabIndex: disabled ? void 0 : -1,
|
|
247
|
+
size: context.size,
|
|
248
|
+
...itemProps,
|
|
249
|
+
...selectItemProps
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
);
|
|
238
254
|
}
|
|
239
255
|
);
|
|
240
256
|
SelectItem.displayName = ITEM_NAME;
|
|
@@ -252,13 +268,17 @@ const SelectItemText = React.forwardRef(
|
|
|
252
268
|
const composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref);
|
|
253
269
|
const isSelected = Boolean(itemContext.isSelected && context.valueNode);
|
|
254
270
|
const contents = React.useMemo(
|
|
255
|
-
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
271
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
272
|
+
SelectItemTextFrame,
|
|
273
|
+
{
|
|
274
|
+
className,
|
|
275
|
+
size: context.size,
|
|
276
|
+
id: itemContext.textId,
|
|
277
|
+
...itemTextProps,
|
|
278
|
+
ref: composedRefs
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
262
282
|
[props, context.size, className, itemContext.textId]
|
|
263
283
|
);
|
|
264
284
|
(0, import_core2.useIsomorphicLayoutEffect)(() => {
|
|
@@ -266,9 +286,7 @@ const SelectItemText = React.forwardRef(
|
|
|
266
286
|
context.setSelectedItem(contents);
|
|
267
287
|
}
|
|
268
288
|
}, [isSelected, contents]);
|
|
269
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
270
|
-
children: contents
|
|
271
|
-
});
|
|
289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: contents });
|
|
272
290
|
}
|
|
273
291
|
);
|
|
274
292
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
@@ -280,11 +298,7 @@ const SelectItemIndicator = React.forwardRef(
|
|
|
280
298
|
(props, forwardedRef) => {
|
|
281
299
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
282
300
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
283
|
-
return itemContext.isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemIndicatorFrame, {
|
|
284
|
-
"aria-hidden": true,
|
|
285
|
-
...itemIndicatorProps,
|
|
286
|
-
ref: forwardedRef
|
|
287
|
-
}) : null;
|
|
301
|
+
return itemContext.isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemIndicatorFrame, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
288
302
|
}
|
|
289
303
|
);
|
|
290
304
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
@@ -298,16 +312,15 @@ const SelectGroup = React.forwardRef(
|
|
|
298
312
|
(props, forwardedRef) => {
|
|
299
313
|
const { __scopeSelect, ...groupProps } = props;
|
|
300
314
|
const groupId = (0, import_core3.useId)();
|
|
301
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContextProvider, {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupFrame, {
|
|
315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId || "", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
316
|
+
SelectGroupFrame,
|
|
317
|
+
{
|
|
305
318
|
role: "group",
|
|
306
319
|
"aria-labelledby": groupId,
|
|
307
320
|
...groupProps,
|
|
308
321
|
ref: forwardedRef
|
|
309
|
-
}
|
|
310
|
-
});
|
|
322
|
+
}
|
|
323
|
+
) });
|
|
311
324
|
}
|
|
312
325
|
);
|
|
313
326
|
SelectGroup.displayName = GROUP_NAME;
|
|
@@ -317,15 +330,18 @@ const SelectLabel = React.forwardRef(
|
|
|
317
330
|
const { __scopeSelect, ...labelProps } = props;
|
|
318
331
|
const context = (0, import_context.useSelectContext)(LABEL_NAME, __scopeSelect);
|
|
319
332
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
320
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
334
|
+
import_list_item.ListItem,
|
|
335
|
+
{
|
|
336
|
+
tag: "div",
|
|
337
|
+
componentName: LABEL_NAME,
|
|
338
|
+
fontWeight: "800",
|
|
339
|
+
id: groupContext.id,
|
|
340
|
+
size: context.size,
|
|
341
|
+
...labelProps,
|
|
342
|
+
ref: forwardedRef
|
|
343
|
+
}
|
|
344
|
+
);
|
|
329
345
|
}
|
|
330
346
|
);
|
|
331
347
|
SelectLabel.displayName = LABEL_NAME;
|
|
@@ -337,21 +353,22 @@ const SelectSheetController = (props) => {
|
|
|
337
353
|
const showSheet = (0, import_useSelectBreakpointActive.useShowSelectSheet)(context);
|
|
338
354
|
const breakpointActive = (0, import_useSelectBreakpointActive.useSelectBreakpointActive)(context.sheetBreakpoint);
|
|
339
355
|
const getShowSheet = (0, import_core2.useGet)(showSheet);
|
|
340
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
357
|
+
import_sheet.SheetController,
|
|
358
|
+
{
|
|
359
|
+
onOpenChange: (val) => {
|
|
360
|
+
if (getShowSheet()) {
|
|
361
|
+
props.onOpenChange(val);
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
open: context.open,
|
|
365
|
+
hidden: breakpointActive === false,
|
|
366
|
+
children: props.children
|
|
367
|
+
}
|
|
368
|
+
);
|
|
350
369
|
};
|
|
351
370
|
const SelectSheetImpl = (props) => {
|
|
352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
353
|
-
children: props.children
|
|
354
|
-
});
|
|
371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: props.children });
|
|
355
372
|
};
|
|
356
373
|
const Select = (0, import_core2.withStaticProperties)(
|
|
357
374
|
(props) => {
|
|
@@ -371,9 +388,7 @@ const Select = (0, import_core2.withStaticProperties)(
|
|
|
371
388
|
const scopeKey = __scopeSelect ? Object.keys(__scopeSelect)[0] ?? id : id;
|
|
372
389
|
const { when, AdaptProvider } = (0, import_adapt.useAdaptParent)({
|
|
373
390
|
Contents: React.useCallback(
|
|
374
|
-
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalHost, {
|
|
375
|
-
name: `${scopeKey}SheetContents`
|
|
376
|
-
}),
|
|
391
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.PortalHost, { name: `${scopeKey}SheetContents` }),
|
|
377
392
|
[scopeKey]
|
|
378
393
|
)
|
|
379
394
|
});
|
|
@@ -406,8 +421,9 @@ const Select = (0, import_core2.withStaticProperties)(
|
|
|
406
421
|
selectedIndexRef.current = selectedIndex;
|
|
407
422
|
activeIndexRef.current = activeIndex;
|
|
408
423
|
});
|
|
409
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdaptProvider, {
|
|
410
|
-
|
|
424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdaptProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
425
|
+
import_context.SelectProvider,
|
|
426
|
+
{
|
|
411
427
|
dir,
|
|
412
428
|
blockSelection: false,
|
|
413
429
|
size: sizeProp,
|
|
@@ -433,10 +449,9 @@ const Select = (0, import_core2.withStaticProperties)(
|
|
|
433
449
|
setSelectedIndex,
|
|
434
450
|
value,
|
|
435
451
|
open,
|
|
436
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectSheetController, {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectImpl, {
|
|
452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectSheetController, { onOpenChange: setOpen, __scopeSelect, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
453
|
+
SelectImpl,
|
|
454
|
+
{
|
|
440
455
|
activeIndexRef,
|
|
441
456
|
listContentRef,
|
|
442
457
|
selectedIndexRef,
|
|
@@ -444,10 +459,10 @@ const Select = (0, import_core2.withStaticProperties)(
|
|
|
444
459
|
open,
|
|
445
460
|
value,
|
|
446
461
|
children
|
|
447
|
-
}
|
|
448
|
-
})
|
|
449
|
-
}
|
|
450
|
-
});
|
|
462
|
+
}
|
|
463
|
+
) })
|
|
464
|
+
}
|
|
465
|
+
) });
|
|
451
466
|
},
|
|
452
467
|
{
|
|
453
468
|
Adapt: import_adapt.Adapt,
|
package/dist/cjs/Select.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Select.tsx"],
|
|
4
4
|
"sourcesContent": ["import { Adapt, useAdaptParent } from '@tamagui/adapt'\nimport { useComposedRefs } from '@tamagui/compose-refs'\nimport { GetProps, TamaguiElement, isClient, isWeb } from '@tamagui/core'\nimport {\n styled,\n useGet,\n useIsomorphicLayoutEffect,\n withStaticProperties,\n} from '@tamagui/core'\nimport { useId } from '@tamagui/core'\nimport { ListItem, ListItemProps } from '@tamagui/list-item'\nimport { PortalHost } from '@tamagui/portal'\nimport { Separator } from '@tamagui/separator'\nimport { ControlledSheet, SheetController } from '@tamagui/sheet'\nimport { XStack, YStack, YStackProps } from '@tamagui/stacks'\nimport { Paragraph, SizableText } from '@tamagui/text'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\n\nimport { SELECT_NAME } from './constants'\nimport { SelectProvider, createSelectContext, useSelectContext } from './context'\nimport { SelectContent } from './SelectContent'\nimport { SelectInlineImpl } from './SelectImpl'\nimport { SelectScrollDownButton, SelectScrollUpButton } from './SelectScrollButton'\nimport { SelectViewport } from './SelectViewport'\nimport { ScopedProps, SelectImplProps, SelectProps } from './types'\nimport {\n useSelectBreakpointActive,\n useShowSelectSheet,\n} from './useSelectBreakpointActive'\n\n/* -------------------------------------------------------------------------------------------------\n * SelectTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'SelectTrigger'\n\nexport type SelectTriggerProps = ListItemProps\n\nexport const SelectTrigger = React.forwardRef<TamaguiElement, SelectTriggerProps>(\n (props: ScopedProps<SelectTriggerProps>, forwardedRef) => {\n const {\n __scopeSelect,\n disabled = false,\n // @ts-ignore\n 'aria-labelledby': ariaLabelledby,\n ...triggerProps\n } = props\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect)\n // const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange)\n // const getItems = useCollection(__scopeSelect)\n // const labelId = useLabelContext(context.trigger)\n const labelledBy = ariaLabelledby // || labelId\n\n return (\n <ListItem\n componentName={TRIGGER_NAME}\n backgrounded\n radiused\n hoverTheme\n pressTheme\n focusTheme\n focusable\n borderWidth={1}\n size={context.size}\n // aria-controls={context.contentId}\n aria-expanded={context.open}\n aria-autocomplete=\"none\"\n aria-labelledby={labelledBy}\n dir={context.dir}\n disabled={disabled}\n data-disabled={disabled ? '' : undefined}\n {...triggerProps}\n ref={forwardedRef}\n {...(process.env.TAMAGUI_TARGET === 'web' && context.interactions\n ? context.interactions.getReferenceProps()\n : {\n onPress() {\n context.setOpen(!context.open)\n },\n })}\n />\n )\n }\n)\n\nSelectTrigger.displayName = TRIGGER_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectValue\n * -----------------------------------------------------------------------------------------------*/\n\nconst VALUE_NAME = 'SelectValue'\n\nconst SelectValueFrame = styled(Paragraph, {\n name: VALUE_NAME,\n userSelect: 'none',\n})\n\ntype SelectValueProps = GetProps<typeof SelectValueFrame> & {\n placeholder?: React.ReactNode\n}\n\nconst SelectValue = SelectValueFrame.extractable(\n React.forwardRef<TamaguiElement, SelectValueProps>(\n (\n {\n __scopeSelect,\n children: childrenProp,\n placeholder,\n }: ScopedProps<SelectValueProps>,\n forwardedRef\n ) => {\n // We ignore `className` and `style` as this part shouldn't be styled.\n const context = useSelectContext(VALUE_NAME, __scopeSelect)\n const { onValueNodeHasChildrenChange } = context\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange)\n\n const children = childrenProp ?? context.selectedItem\n const hasChildren = !!children\n const selectValueChildren =\n context.value === undefined && placeholder !== undefined ? placeholder : children\n\n useIsomorphicLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren)\n }, [onValueNodeHasChildrenChange, hasChildren])\n\n return (\n <SelectValueFrame\n size={context.size}\n ref={composedRefs}\n // we don't want events from the portalled `SelectValue` children to bubble\n // through the item they came from\n pointerEvents=\"none\"\n >\n {selectValueChildren}\n </SelectValueFrame>\n )\n }\n )\n)\n\nSelectValue.displayName = VALUE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectIcon\n * -----------------------------------------------------------------------------------------------*/\n\nexport const SelectIcon = styled(XStack, {\n name: 'SelectIcon',\n // @ts-ignore\n 'aria-hidden': true,\n children: <Paragraph>\u25BC</Paragraph>,\n})\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'SelectItem'\n\ntype SelectItemContextValue = {\n value: string\n textId: string\n isSelected: boolean\n}\n\nconst [SelectItemContextProvider, useSelectItemContext] =\n createSelectContext<SelectItemContextValue>(ITEM_NAME)\n\nexport interface SelectItemProps extends ListItemProps {\n value: string\n index: number\n disabled?: boolean\n textValue?: string\n}\n\nexport const SelectItem = React.forwardRef<TamaguiElement, SelectItemProps>(\n (props: ScopedProps<SelectItemProps>, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n index,\n ...itemProps\n } = props\n const context = useSelectContext(ITEM_NAME, __scopeSelect)\n const isSelected = context.value === value\n const textId = useId()\n\n const {\n selectedIndex,\n setSelectedIndex,\n listRef,\n open,\n setOpen,\n onChange,\n setActiveIndex,\n allowMouseUpRef,\n allowSelectRef,\n setValueAtIndex,\n selectTimeoutRef,\n dataRef,\n } = context\n\n const composedRefs = useComposedRefs(forwardedRef, (node) => {\n if (!isWeb) return\n if (node instanceof HTMLElement) {\n if (listRef) {\n listRef.current[index] = node\n }\n }\n })\n\n React.useEffect(() => {\n setValueAtIndex(index, value)\n }, [index, setValueAtIndex, value])\n\n function handleSelect() {\n setSelectedIndex(index)\n onChange(value)\n setOpen(false)\n }\n\n const selectItemProps = context.interactions\n ? context.interactions.getItemProps({\n onTouchStart() {\n allowSelectRef!.current = true\n allowMouseUpRef!.current = false\n },\n onKeyDown(event) {\n if (\n event.key === 'Enter' ||\n (event.key === ' ' && !dataRef?.current.typing)\n ) {\n event.preventDefault()\n handleSelect()\n } else {\n allowSelectRef!.current = true\n }\n },\n onClick() {\n if (allowSelectRef!.current) {\n setSelectedIndex(index)\n setOpen(false)\n }\n },\n onMouseUp() {\n if (!allowMouseUpRef!.current) {\n return\n }\n\n if (allowSelectRef!.current) {\n handleSelect()\n }\n\n // On touch devices, prevent the element from\n // immediately closing `onClick` by deferring it\n clearTimeout(selectTimeoutRef!.current)\n selectTimeoutRef!.current = setTimeout(() => {\n allowSelectRef!.current = true\n })\n },\n })\n : {\n onPress: handleSelect,\n }\n\n return (\n <SelectItemContextProvider\n scope={__scopeSelect}\n value={value}\n textId={textId || ''}\n isSelected={isSelected}\n >\n <ListItem\n tag=\"div\"\n backgrounded\n pressTheme\n cursor=\"\"\n focusTheme\n outlineWidth={0}\n componentName={ITEM_NAME}\n ref={composedRefs}\n aria-labelledby={textId}\n aria-selected={isSelected}\n data-state={isSelected ? 'active' : 'inactive'}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? '' : undefined}\n tabIndex={disabled ? undefined : -1}\n size={context.size}\n {...itemProps}\n {...selectItemProps}\n />\n </SelectItemContextProvider>\n )\n }\n)\n\nSelectItem.displayName = ITEM_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemText\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_TEXT_NAME = 'SelectItemText'\n\nexport const SelectItemTextFrame = styled(SizableText, {\n name: ITEM_TEXT_NAME,\n userSelect: 'none',\n})\n\ntype SelectItemTextProps = GetProps<typeof SelectItemTextFrame>\n\nconst SelectItemText = React.forwardRef<TamaguiElement, SelectItemTextProps>(\n (props: ScopedProps<SelectItemTextProps>, forwardedRef) => {\n const { __scopeSelect, className, ...itemTextProps } = props\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect)\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect)\n const ref = React.useRef<TamaguiElement | null>(null)\n const composedRefs = useComposedRefs(forwardedRef, ref)\n const isSelected = Boolean(itemContext.isSelected && context.valueNode)\n\n const contents = React.useMemo(\n () => (\n <SelectItemTextFrame\n className={className}\n size={context.size}\n id={itemContext.textId}\n {...itemTextProps}\n ref={composedRefs}\n />\n ),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props, context.size, className, itemContext.textId]\n )\n\n // until portals work in sub-trees on RN, use this just for native:\n useIsomorphicLayoutEffect(() => {\n if (isSelected) {\n context.setSelectedItem(contents)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isSelected, contents])\n\n return (\n <>\n {contents}\n\n {/* Portal the select item text into the trigger value node */}\n {/* this needs some extra stability between renders */}\n {/* {isWeb && isSelected\n ? ReactDOM.createPortal(itemTextProps.children, context.valueNode!)\n : null} */}\n\n {/* Portal an option in the bubble select */}\n {/* {context.bubbleSelect\n ? ReactDOM.createPortal(\n // we use `.textContent` because `option` only support `string` or `number`\n <option value={itemContext.value}>{ref.current?.textContent}</option>,\n context.bubbleSelect\n )\n : null} */}\n </>\n )\n }\n)\n\nSelectItemText.displayName = ITEM_TEXT_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'SelectItemIndicator'\n\nconst SelectItemIndicatorFrame = styled(XStack, {\n name: ITEM_TEXT_NAME,\n})\n\ntype SelectItemIndicatorProps = GetProps<typeof SelectItemIndicatorFrame>\n\nconst SelectItemIndicator = React.forwardRef<TamaguiElement, SelectItemIndicatorProps>(\n (props: ScopedProps<SelectItemIndicatorProps>, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect)\n return itemContext.isSelected ? (\n <SelectItemIndicatorFrame aria-hidden {...itemIndicatorProps} ref={forwardedRef} />\n ) : null\n }\n)\n\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'SelectGroup'\n\ntype SelectGroupContextValue = { id: string }\n\nconst [SelectGroupContextProvider, useSelectGroupContext] =\n createSelectContext<SelectGroupContextValue>(GROUP_NAME)\n\nexport const SelectGroupFrame = styled(YStack, {\n name: GROUP_NAME,\n width: '100%',\n})\n\ntype SelectGroupProps = GetProps<typeof SelectGroupFrame>\n\nconst SelectGroup = React.forwardRef<TamaguiElement, SelectGroupProps>(\n (props: ScopedProps<SelectGroupProps>, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props\n const groupId = useId()\n return (\n <SelectGroupContextProvider scope={__scopeSelect} id={groupId || ''}>\n <SelectGroupFrame\n // @ts-ignore\n role=\"group\"\n aria-labelledby={groupId}\n {...groupProps}\n ref={forwardedRef}\n />\n </SelectGroupContextProvider>\n )\n }\n)\n\nSelectGroup.displayName = GROUP_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'SelectLabel'\n\nexport type SelectLabelProps = ListItemProps\n\nconst SelectLabel = React.forwardRef<TamaguiElement, SelectLabelProps>(\n (props: ScopedProps<SelectLabelProps>, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props\n const context = useSelectContext(LABEL_NAME, __scopeSelect)\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect)\n return (\n <ListItem\n tag=\"div\"\n componentName={LABEL_NAME}\n fontWeight=\"800\"\n id={groupContext.id}\n size={context.size}\n {...labelProps}\n ref={forwardedRef}\n />\n )\n }\n)\n\nSelectLabel.displayName = LABEL_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * SelectSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nexport const SelectSeparator = styled(Separator, {\n name: 'SelectSeparator',\n})\n\nconst SelectSheetController = (\n props: ScopedProps<{}> & {\n children: React.ReactNode\n onOpenChange: React.Dispatch<React.SetStateAction<boolean>>\n }\n) => {\n const context = useSelectContext('SelectSheetController', props.__scopeSelect)\n const showSheet = useShowSelectSheet(context)\n const breakpointActive = useSelectBreakpointActive(context.sheetBreakpoint)\n const getShowSheet = useGet(showSheet)\n\n return (\n <SheetController\n onOpenChange={(val) => {\n if (getShowSheet()) {\n props.onOpenChange(val)\n }\n }}\n open={context.open}\n hidden={breakpointActive === false}\n >\n {props.children}\n </SheetController>\n )\n}\n\nconst SelectSheetImpl = (props: SelectImplProps) => {\n return <>{props.children}</>\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Select\n * -----------------------------------------------------------------------------------------------*/\n\nexport const Select = withStaticProperties(\n (props: ScopedProps<SelectProps>) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n size: sizeProp = '$true',\n dir,\n } = props\n\n const id = useId()\n const scopeKey = __scopeSelect ? Object.keys(__scopeSelect)[0] ?? id : id\n\n const { when, AdaptProvider } = useAdaptParent({\n Contents: React.useCallback(\n () => <PortalHost name={`${scopeKey}SheetContents`} />,\n [scopeKey]\n ),\n })\n const sheetBreakpoint = when\n const isSheet = useSelectBreakpointActive(sheetBreakpoint)\n const SelectImpl = isSheet || !isWeb ? SelectSheetImpl : SelectInlineImpl\n const forceUpdate = React.useReducer(() => ({}), {})[1]\n const [selectedItem, setSelectedItem] = React.useState<React.ReactNode>(null)\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen || false,\n onChange: onOpenChange,\n strategy: 'most-recent-wins',\n })\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue || '',\n onChange: onValueChange,\n strategy: 'most-recent-wins',\n transition: true,\n })\n\n const [activeIndex, setActiveIndex] = React.useState<number | null>(0)\n const selectedIndexRef = React.useRef<number | null>(null)\n const activeIndexRef = React.useRef<number | null>(null)\n const listContentRef = React.useRef<string[]>([])\n const [selectedIndex, setSelectedIndex] = React.useState(0)\n const [valueNode, setValueNode] = React.useState<HTMLElement | null>(null)\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false)\n\n useIsomorphicLayoutEffect(() => {\n selectedIndexRef.current = selectedIndex\n activeIndexRef.current = activeIndex\n })\n\n return (\n <AdaptProvider>\n <SelectProvider\n dir={dir}\n blockSelection={false}\n size={sizeProp}\n fallback={false}\n selectedItem={selectedItem}\n setSelectedItem={setSelectedItem}\n forceUpdate={forceUpdate}\n valueNode={valueNode}\n onValueNodeChange={setValueNode}\n onValueNodeHasChildrenChange={setValueNodeHasChildren}\n valueNodeHasChildren={valueNodeHasChildren}\n scopeKey={scopeKey}\n sheetBreakpoint={sheetBreakpoint}\n scope={__scopeSelect}\n setValueAtIndex={(index, value) => {\n listContentRef.current[index] = value\n }}\n activeIndex={activeIndex}\n onChange={setValue}\n selectedIndex={selectedIndex}\n setActiveIndex={setActiveIndex}\n setOpen={setOpen}\n setSelectedIndex={setSelectedIndex}\n value={value}\n open={open}\n >\n <SelectSheetController onOpenChange={setOpen} __scopeSelect={__scopeSelect}>\n <SelectImpl\n activeIndexRef={activeIndexRef}\n listContentRef={listContentRef}\n selectedIndexRef={selectedIndexRef}\n {...props}\n open={open}\n value={value}\n >\n {children}\n </SelectImpl>\n </SelectSheetController>\n </SelectProvider>\n </AdaptProvider>\n )\n },\n {\n Adapt,\n Content: SelectContent,\n Group: SelectGroup,\n Icon: SelectIcon,\n Item: SelectItem,\n ItemIndicator: SelectItemIndicator,\n ItemText: SelectItemText,\n Label: SelectLabel,\n ScrollDownButton: SelectScrollDownButton,\n ScrollUpButton: SelectScrollUpButton,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Viewport: SelectViewport,\n Sheet: ControlledSheet,\n }\n)\n\n// @ts-ignore\nSelect.displayName = SELECT_NAME\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuDM;AAvDN,mBAAsC;AACtC,0BAAgC;AAChC,kBAA0D;AAC1D,IAAAA,eAKO;AACP,IAAAA,eAAsB;AACtB,uBAAwC;AACxC,oBAA2B;AAC3B,uBAA0B;AAC1B,mBAAiD;AACjD,oBAA4C;AAC5C,kBAAuC;AACvC,oCAAqC;AACrC,YAAuB;AAEvB,uBAA4B;AAC5B,q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AAAA,IACA,SAAS;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,eAAe;AAAA,IACf,UAAU;AAAA,IACV,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAGA,OAAO,cAAc;",
|
|
6
6
|
"names": ["import_core", "value"]
|
|
7
7
|
}
|
|
@@ -38,37 +38,15 @@ const SelectContent = ({
|
|
|
38
38
|
const context = (0, import_context.useSelectContext)(CONTENT_NAME, __scopeSelect);
|
|
39
39
|
const themeName = (0, import_core.useThemeName)();
|
|
40
40
|
const showSheet = (0, import_useSelectBreakpointActive.useShowSelectSheet)(context);
|
|
41
|
-
const contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, {
|
|
42
|
-
forceClassName: true,
|
|
43
|
-
name: themeName,
|
|
44
|
-
children
|
|
45
|
-
});
|
|
41
|
+
const contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, { forceClassName: true, name: themeName, children });
|
|
46
42
|
const touch = (0, import_core.useIsTouchDevice)();
|
|
47
43
|
if (showSheet) {
|
|
48
44
|
if (!context.open) {
|
|
49
45
|
return null;
|
|
50
46
|
}
|
|
51
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
52
|
-
children: contents
|
|
53
|
-
});
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: contents });
|
|
54
48
|
}
|
|
55
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_dom_interactions.FloatingPortal, {
|
|
56
|
-
children: context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_dom_interactions.FloatingOverlay, {
|
|
57
|
-
style: { zIndex },
|
|
58
|
-
lockScroll: !touch,
|
|
59
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_focus_scope.FocusScope, {
|
|
60
|
-
loop: true,
|
|
61
|
-
trapped: true,
|
|
62
|
-
...focusScopeProps,
|
|
63
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dismissable.Dismissable, {
|
|
64
|
-
children: contents
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
68
|
-
style: { display: "none" },
|
|
69
|
-
children: contents
|
|
70
|
-
})
|
|
71
|
-
});
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_dom_interactions.FloatingPortal, { children: context.open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_dom_interactions.FloatingOverlay, { style: { zIndex }, lockScroll: !touch, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_focus_scope.FocusScope, { loop: true, trapped: true, ...focusScopeProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dismissable.Dismissable, { children: contents }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { display: "none" }, children: contents }) });
|
|
72
50
|
};
|
|
73
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
74
52
|
0 && (module.exports = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SelectContent.tsx"],
|
|
4
4
|
"sourcesContent": ["import { FloatingOverlay, FloatingPortal } from '@floating-ui/react-dom-interactions'\nimport { Theme, useIsTouchDevice, useThemeName } from '@tamagui/core'\nimport { Dismissable } from '@tamagui/dismissable'\nimport { FocusScope, FocusScopeProps } from '@tamagui/focus-scope'\n\nimport { useSelectContext } from './context'\nimport { SelectContentProps } from './types'\nimport { useShowSelectSheet } from './useSelectBreakpointActive'\n\n/* -------------------------------------------------------------------------------------------------\n * SelectContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'SelectContent'\n\nexport const SelectContent = ({\n children,\n __scopeSelect,\n zIndex = 1000,\n ...focusScopeProps\n}: SelectContentProps & FocusScopeProps) => {\n const context = useSelectContext(CONTENT_NAME, __scopeSelect)\n const themeName = useThemeName()\n const showSheet = useShowSelectSheet(context)\n const contents = (\n <Theme forceClassName name={themeName}>\n {children}\n </Theme>\n )\n const touch = useIsTouchDevice()\n\n if (showSheet) {\n if (!context.open) {\n return null\n }\n return <>{contents}</>\n }\n\n return (\n <FloatingPortal>\n {context.open ? (\n <FloatingOverlay style={{ zIndex }} lockScroll={!touch}>\n <FocusScope loop trapped {...focusScopeProps}>\n <Dismissable>{contents}</Dismissable>\n </FocusScope>\n </FloatingOverlay>\n ) : (\n <div style={{ display: 'none' }}>{contents}</div>\n )}\n </FloatingPortal>\n )\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBI;AAzBJ,oCAAgD;AAChD,kBAAsD;AACtD,yBAA4B;AAC5B,yBAA4C;AAE5C,qBAAiC;AAEjC,uCAAmC;AAMnC,MAAM,eAAe;AAEd,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,SAAS;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBI;AAzBJ,oCAAgD;AAChD,kBAAsD;AACtD,yBAA4B;AAC5B,yBAA4C;AAE5C,qBAAiC;AAEjC,uCAAmC;AAMnC,MAAM,eAAe;AAEd,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,GAAG;AACL,MAA4C;AAC1C,QAAM,cAAU,iCAAiB,cAAc,aAAa;AAC5D,QAAM,gBAAY,0BAAa;AAC/B,QAAM,gBAAY,qDAAmB,OAAO;AAC5C,QAAM,WACJ,4CAAC,qBAAM,gBAAc,MAAC,MAAM,WACzB,UACH;AAEF,QAAM,YAAQ,8BAAiB;AAE/B,MAAI,WAAW;AACb,QAAI,CAAC,QAAQ,MAAM;AACjB,aAAO;AAAA,IACT;AACA,WAAO,2EAAG,oBAAS;AAAA,EACrB;AAEA,SACE,4CAAC,gDACE,kBAAQ,OACP,4CAAC,iDAAgB,OAAO,EAAE,OAAO,GAAG,YAAY,CAAC,OAC/C,sDAAC,iCAAW,MAAI,MAAC,SAAO,MAAE,GAAG,iBAC3B,sDAAC,kCAAa,oBAAS,GACzB,GACF,IAEA,4CAAC,SAAI,OAAO,EAAE,SAAS,OAAO,GAAI,oBAAS,GAE/C;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/SelectImpl.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -267,32 +271,35 @@ const SelectInlineImpl = (props) => {
|
|
|
267
271
|
refs.floating.current.style.maxHeight = "";
|
|
268
272
|
}
|
|
269
273
|
}, [refs, fallback]);
|
|
270
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
275
|
+
import_context.SelectProvider,
|
|
276
|
+
{
|
|
277
|
+
scope: __scopeSelect,
|
|
278
|
+
...selectContext,
|
|
279
|
+
setScrollTop,
|
|
280
|
+
setInnerOffset,
|
|
281
|
+
floatingRef,
|
|
282
|
+
setValueAtIndex: (index, value) => {
|
|
283
|
+
listContentRef.current[index] = value;
|
|
284
|
+
},
|
|
285
|
+
fallback,
|
|
286
|
+
interactions: interactionsContext,
|
|
287
|
+
floatingContext: context,
|
|
288
|
+
activeIndex,
|
|
289
|
+
canScrollDown: !!showDownArrow,
|
|
290
|
+
canScrollUp: !!showUpArrow,
|
|
291
|
+
controlledScrolling,
|
|
292
|
+
dataRef: context.dataRef,
|
|
293
|
+
listRef: listItemsRef,
|
|
294
|
+
blockSelection,
|
|
295
|
+
allowMouseUpRef,
|
|
296
|
+
upArrowRef,
|
|
297
|
+
downArrowRef,
|
|
298
|
+
selectTimeoutRef,
|
|
299
|
+
allowSelectRef,
|
|
300
|
+
children
|
|
301
|
+
}
|
|
302
|
+
);
|
|
296
303
|
};
|
|
297
304
|
const userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
|
|
298
305
|
// Annotate the CommonJS export names for ESM import in node:
|