@multiplatform.one/forms 7.80.0 → 7.81.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/AdaptivePopup/index.cjs +2 -1
- package/dist/cjs/AdaptivePopup/index.native.js +2 -1
- package/dist/cjs/AdaptivePopup/index.native.js.map +1 -1
- package/dist/cjs/Button/index.cjs +12 -5
- package/dist/cjs/Button/index.native.js +14 -6
- package/dist/cjs/Button/index.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/PanelHeader.cjs +3 -8
- package/dist/cjs/FloatingPanel/PanelHeader.native.js +3 -8
- package/dist/cjs/FloatingPanel/PanelHeader.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/coverRect.cjs +0 -8
- package/dist/cjs/FloatingPanel/coverRect.native.js +0 -8
- package/dist/cjs/FloatingPanel/coverRect.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/echoContext.cjs +5 -27
- package/dist/cjs/FloatingPanel/echoContext.native.js +5 -28
- package/dist/cjs/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/cjs/FloatingPanel/index.cjs +49 -131
- package/dist/cjs/FloatingPanel/index.native.js +216 -135
- package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
- package/dist/cjs/fields/Combobox/index.cjs +3 -10
- package/dist/cjs/fields/Combobox/index.native.js +3 -10
- package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
- package/dist/cjs/fields/Select/InlineChoices.cjs +4 -8
- package/dist/cjs/fields/Select/InlineChoices.native.js +4 -8
- package/dist/cjs/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/cjs/fields/Select/index.cjs +65 -201
- package/dist/cjs/fields/Select/index.native.js +74 -209
- package/dist/cjs/fields/Select/index.native.js.map +1 -1
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.cjs +2 -2
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js +2 -2
- package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.native.js +4 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/CheckGlyph.cjs +40 -0
- package/dist/cjs/shared/CheckGlyph.native.js +44 -0
- package/dist/cjs/shared/CheckGlyph.native.js.map +1 -0
- package/dist/cjs/shared/checkedOnField.cjs +104 -0
- package/dist/cjs/shared/checkedOnField.native.js +117 -0
- package/dist/cjs/shared/checkedOnField.native.js.map +1 -0
- package/dist/cjs/shared/floatingList.cjs +12 -5
- package/dist/cjs/shared/floatingList.native.js +15 -7
- package/dist/cjs/shared/floatingList.native.js.map +1 -1
- package/dist/esm/AdaptivePopup/index.mjs +3 -2
- package/dist/esm/AdaptivePopup/index.mjs.map +1 -1
- package/dist/esm/AdaptivePopup/index.native.js +3 -2
- package/dist/esm/AdaptivePopup/index.native.js.map +1 -1
- package/dist/esm/Button/index.mjs +12 -5
- package/dist/esm/Button/index.mjs.map +1 -1
- package/dist/esm/Button/index.native.js +14 -6
- package/dist/esm/Button/index.native.js.map +1 -1
- package/dist/esm/FloatingPanel/PanelHeader.mjs +3 -8
- package/dist/esm/FloatingPanel/PanelHeader.mjs.map +1 -1
- package/dist/esm/FloatingPanel/PanelHeader.native.js +3 -8
- package/dist/esm/FloatingPanel/PanelHeader.native.js.map +1 -1
- package/dist/esm/FloatingPanel/coverRect.mjs +1 -8
- package/dist/esm/FloatingPanel/coverRect.mjs.map +1 -1
- package/dist/esm/FloatingPanel/coverRect.native.js +1 -8
- package/dist/esm/FloatingPanel/coverRect.native.js.map +1 -1
- package/dist/esm/FloatingPanel/echoContext.mjs +4 -24
- package/dist/esm/FloatingPanel/echoContext.mjs.map +1 -1
- package/dist/esm/FloatingPanel/echoContext.native.js +4 -25
- package/dist/esm/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/esm/FloatingPanel/index.mjs +53 -135
- package/dist/esm/FloatingPanel/index.mjs.map +1 -1
- package/dist/esm/FloatingPanel/index.native.js +180 -99
- package/dist/esm/FloatingPanel/index.native.js.map +1 -1
- package/dist/esm/fields/Combobox/index.mjs +4 -11
- package/dist/esm/fields/Combobox/index.mjs.map +1 -1
- package/dist/esm/fields/Combobox/index.native.js +4 -11
- package/dist/esm/fields/Combobox/index.native.js.map +1 -1
- package/dist/esm/fields/Select/InlineChoices.mjs +2 -6
- package/dist/esm/fields/Select/InlineChoices.mjs.map +1 -1
- package/dist/esm/fields/Select/InlineChoices.native.js +2 -6
- package/dist/esm/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/esm/fields/Select/index.mjs +68 -204
- package/dist/esm/fields/Select/index.mjs.map +1 -1
- package/dist/esm/fields/Select/index.native.js +77 -212
- package/dist/esm/fields/Select/index.native.js.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs +3 -3
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js +3 -3
- package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/CheckGlyph.mjs +15 -0
- package/dist/esm/shared/CheckGlyph.mjs.map +1 -0
- package/dist/esm/shared/CheckGlyph.native.js +16 -0
- package/dist/esm/shared/CheckGlyph.native.js.map +1 -0
- package/dist/esm/shared/checkedOnField.mjs +76 -0
- package/dist/esm/shared/checkedOnField.mjs.map +1 -0
- package/dist/esm/shared/checkedOnField.native.js +86 -0
- package/dist/esm/shared/checkedOnField.native.js.map +1 -0
- package/dist/esm/shared/floatingList.mjs +9 -5
- package/dist/esm/shared/floatingList.mjs.map +1 -1
- package/dist/esm/shared/floatingList.native.js +12 -7
- package/dist/esm/shared/floatingList.native.js.map +1 -1
- package/dist/jsx/AdaptivePopup/index.mjs +3 -2
- package/dist/jsx/AdaptivePopup/index.mjs.map +1 -1
- package/dist/jsx/AdaptivePopup/index.native.js +2 -1
- package/dist/jsx/AdaptivePopup/index.native.js.map +1 -1
- package/dist/jsx/Button/index.mjs +12 -5
- package/dist/jsx/Button/index.mjs.map +1 -1
- package/dist/jsx/Button/index.native.js +14 -6
- package/dist/jsx/Button/index.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/PanelHeader.mjs +3 -8
- package/dist/jsx/FloatingPanel/PanelHeader.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/PanelHeader.native.js +3 -8
- package/dist/jsx/FloatingPanel/PanelHeader.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/coverRect.mjs +1 -8
- package/dist/jsx/FloatingPanel/coverRect.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/coverRect.native.js +0 -8
- package/dist/jsx/FloatingPanel/coverRect.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/echoContext.mjs +4 -24
- package/dist/jsx/FloatingPanel/echoContext.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/echoContext.native.js +5 -28
- package/dist/jsx/FloatingPanel/echoContext.native.js.map +1 -1
- package/dist/jsx/FloatingPanel/index.mjs +53 -135
- package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
- package/dist/jsx/FloatingPanel/index.native.js +216 -135
- package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
- package/dist/jsx/fields/Combobox/index.mjs +4 -11
- package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
- package/dist/jsx/fields/Combobox/index.native.js +3 -10
- package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
- package/dist/jsx/fields/Select/InlineChoices.mjs +2 -6
- package/dist/jsx/fields/Select/InlineChoices.mjs.map +1 -1
- package/dist/jsx/fields/Select/InlineChoices.native.js +4 -8
- package/dist/jsx/fields/Select/InlineChoices.native.js.map +1 -1
- package/dist/jsx/fields/Select/index.mjs +68 -204
- package/dist/jsx/fields/Select/index.mjs.map +1 -1
- package/dist/jsx/fields/Select/index.native.js +74 -209
- package/dist/jsx/fields/Select/index.native.js.map +1 -1
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs +3 -3
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js +2 -2
- package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
- package/dist/jsx/index.js +3 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +3 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +4 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/CheckGlyph.mjs +15 -0
- package/dist/jsx/shared/CheckGlyph.mjs.map +1 -0
- package/dist/jsx/shared/CheckGlyph.native.js +44 -0
- package/dist/jsx/shared/CheckGlyph.native.js.map +1 -0
- package/dist/jsx/shared/checkedOnField.mjs +76 -0
- package/dist/jsx/shared/checkedOnField.mjs.map +1 -0
- package/dist/jsx/shared/checkedOnField.native.js +117 -0
- package/dist/jsx/shared/checkedOnField.native.js.map +1 -0
- package/dist/jsx/shared/floatingList.mjs +9 -5
- package/dist/jsx/shared/floatingList.mjs.map +1 -1
- package/dist/jsx/shared/floatingList.native.js +15 -7
- package/dist/jsx/shared/floatingList.native.js.map +1 -1
- package/package.json +8 -8
- package/src/AdaptivePopup/index.tsx +6 -3
- package/src/Button/Button.iconButton.spec.tsx +39 -0
- package/src/Button/index.tsx +20 -8
- package/src/FloatingPanel/FloatingPanel.iconCover.spec.tsx +279 -0
- package/src/FloatingPanel/FloatingPanel.menuFace.native.spec.tsx +78 -69
- package/src/FloatingPanel/FloatingPanel.seamlessCover.spec.tsx +12 -0
- package/src/FloatingPanel/PanelHeader.tsx +4 -12
- package/src/FloatingPanel/coverRect.ts +2 -15
- package/src/FloatingPanel/echoContext.ts +6 -40
- package/src/FloatingPanel/index.native.tsx +209 -144
- package/src/FloatingPanel/index.tsx +71 -187
- package/src/FloatingPanel/pointAnchor.spec.ts +1 -1
- package/src/FloatingPanel/pointAnchor.ts +4 -4
- package/src/FloatingPanel/sheetGrabber.spec.tsx +53 -0
- package/src/fields/Combobox/index.tsx +4 -9
- package/src/fields/Select/InlineChoices.tsx +2 -2
- package/src/fields/Select/Select.containingBlock.spec.tsx +131 -130
- package/src/fields/Select/Select.popUp.native.spec.tsx +276 -0
- package/src/fields/Select/Select.stories.tsx +26 -0
- package/src/fields/Select/index.tsx +84 -255
- package/src/fields/nativeDateTime/OsDateTimeSheet.tsx +3 -3
- package/src/index.ts +2 -1
- package/src/shared/CheckGlyph.tsx +12 -0
- package/src/shared/checkedOnField.ts +116 -0
- package/src/shared/floatingList.spec.tsx +154 -1
- package/src/shared/floatingList.tsx +18 -9
- package/types/AdaptivePopup/index.d.ts.map +1 -1
- package/types/Button/index.d.ts.map +1 -1
- package/types/FloatingPanel/PanelHeader.d.ts +1 -6
- package/types/FloatingPanel/PanelHeader.d.ts.map +1 -1
- package/types/FloatingPanel/coverRect.d.ts +2 -11
- package/types/FloatingPanel/coverRect.d.ts.map +1 -1
- package/types/FloatingPanel/echoContext.d.ts +5 -22
- package/types/FloatingPanel/echoContext.d.ts.map +1 -1
- package/types/FloatingPanel/index.d.ts +22 -9
- package/types/FloatingPanel/index.d.ts.map +1 -1
- package/types/FloatingPanel/index.native.d.ts +8 -1
- package/types/FloatingPanel/index.native.d.ts.map +1 -1
- package/types/FloatingPanel/pointAnchor.d.ts +4 -4
- package/types/fields/Combobox/index.d.ts.map +1 -1
- package/types/fields/Select/index.d.ts.map +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/shared/CheckGlyph.d.ts +10 -0
- package/types/shared/CheckGlyph.d.ts.map +1 -0
- package/types/shared/checkedOnField.d.ts +54 -0
- package/types/shared/checkedOnField.d.ts.map +1 -0
- package/types/shared/floatingList.d.ts +5 -2
- package/types/shared/floatingList.d.ts.map +1 -1
- package/dist/cjs/FloatingPanel/iconEcho.cjs +0 -106
- package/dist/cjs/FloatingPanel/iconEcho.native.js +0 -116
- package/dist/cjs/FloatingPanel/iconEcho.native.js.map +0 -1
- package/dist/esm/FloatingPanel/iconEcho.mjs +0 -79
- package/dist/esm/FloatingPanel/iconEcho.mjs.map +0 -1
- package/dist/esm/FloatingPanel/iconEcho.native.js +0 -86
- package/dist/esm/FloatingPanel/iconEcho.native.js.map +0 -1
- package/dist/jsx/FloatingPanel/iconEcho.mjs +0 -79
- package/dist/jsx/FloatingPanel/iconEcho.mjs.map +0 -1
- package/dist/jsx/FloatingPanel/iconEcho.native.js +0 -116
- package/dist/jsx/FloatingPanel/iconEcho.native.js.map +0 -1
- package/src/FloatingPanel/FloatingPanel.iconEcho.spec.tsx +0 -357
- package/src/FloatingPanel/iconEcho.tsx +0 -124
- package/types/FloatingPanel/iconEcho.d.ts +0 -29
- package/types/FloatingPanel/iconEcho.d.ts.map +0 -1
|
@@ -54,7 +54,6 @@ var import_compactFace = require("./compactFace.cjs");
|
|
|
54
54
|
var import_nestedAction = require("./nestedAction.cjs");
|
|
55
55
|
var import_PanelPortal = require("./PanelPortal.cjs");
|
|
56
56
|
var import_echoContext = require("./echoContext.cjs");
|
|
57
|
-
var import_iconEcho = require("./iconEcho.cjs");
|
|
58
57
|
var import_coverRect = require("./coverRect.cjs");
|
|
59
58
|
var import_paintedBox = require("./paintedBox.cjs");
|
|
60
59
|
var import_pointAnchor = require("./pointAnchor.cjs");
|
|
@@ -164,7 +163,6 @@ function TriggerEchoRow({
|
|
|
164
163
|
const stretched = grown > rect.width;
|
|
165
164
|
row.style.width = `${stretched ? grown : rect.width}px`;
|
|
166
165
|
row.style.height = `${rect.height}px`;
|
|
167
|
-
const rtl = isRtl(source2);
|
|
168
166
|
row.style.alignSelf = "flex-start";
|
|
169
167
|
const frameStyle = row.parentElement ? getComputedStyle(row.parentElement) : null;
|
|
170
168
|
row.style.position = "sticky";
|
|
@@ -172,8 +170,8 @@ function TriggerEchoRow({
|
|
|
172
170
|
row.style.top = row.style.marginTop;
|
|
173
171
|
row.style.zIndex = "1";
|
|
174
172
|
row.style.backgroundColor = frameStyle?.backgroundColor ?? "";
|
|
175
|
-
row.style.marginLeft =
|
|
176
|
-
row.style.marginRight =
|
|
173
|
+
row.style.marginLeft = `${-(parseFloat(frameStyle?.borderLeftWidth || "0") || 0)}px`;
|
|
174
|
+
row.style.marginRight = `${-(parseFloat(frameStyle?.borderRightWidth || "0") || 0)}px`;
|
|
177
175
|
const snapshot = children == null ? source2.cloneNode(true) : visualRef.current;
|
|
178
176
|
if (!snapshot) return;
|
|
179
177
|
const sourceFields = source2.querySelectorAll("input, textarea");
|
|
@@ -257,71 +255,6 @@ function placeEchoOverTrigger(panelElement, geometry, {
|
|
|
257
255
|
}
|
|
258
256
|
}
|
|
259
257
|
}
|
|
260
|
-
function IconEchoRow({
|
|
261
|
-
children
|
|
262
|
-
}) {
|
|
263
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
264
|
-
"data-fp-icon-echo": "",
|
|
265
|
-
flexShrink: 0,
|
|
266
|
-
alignSelf: "stretch",
|
|
267
|
-
pointerEvents: "box-none",
|
|
268
|
-
style: {
|
|
269
|
-
order: -1,
|
|
270
|
-
position: "sticky",
|
|
271
|
-
zIndex: 1
|
|
272
|
-
},
|
|
273
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
274
|
-
"data-fp-icon-echo-box": "",
|
|
275
|
-
alignItems: "flex-start",
|
|
276
|
-
justifyContent: "flex-start",
|
|
277
|
-
children
|
|
278
|
-
})
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
function placeIconEcho(panelElement, {
|
|
282
|
-
offset,
|
|
283
|
-
width,
|
|
284
|
-
height,
|
|
285
|
-
up,
|
|
286
|
-
overlay,
|
|
287
|
-
group = null
|
|
288
|
-
}) {
|
|
289
|
-
const row = panelElement.querySelector("[data-fp-icon-echo]");
|
|
290
|
-
const box = row?.querySelector("[data-fp-icon-echo-box]");
|
|
291
|
-
if (!row || !box) return;
|
|
292
|
-
const frame = getComputedStyle(panelElement);
|
|
293
|
-
const border = side => parseFloat(frame[`border${side}Width`] || "0") || 0;
|
|
294
|
-
const rtl = panelElement.dir === "rtl";
|
|
295
|
-
row.style.order = up ? "1" : "-1";
|
|
296
|
-
row.style.height = `${height}px`;
|
|
297
|
-
row.style.backgroundColor = overlay ? "transparent" : frame.backgroundColor;
|
|
298
|
-
if (up) {
|
|
299
|
-
row.style.top = "";
|
|
300
|
-
row.style.marginTop = "";
|
|
301
|
-
row.style.marginBottom = `${-border("Bottom")}px`;
|
|
302
|
-
row.style.bottom = row.style.marginBottom;
|
|
303
|
-
} else {
|
|
304
|
-
row.style.bottom = "";
|
|
305
|
-
row.style.marginTop = `${-border("Top")}px`;
|
|
306
|
-
row.style.marginBottom = overlay ? `${-(height - border("Top"))}px` : "";
|
|
307
|
-
row.style.top = row.style.marginTop;
|
|
308
|
-
}
|
|
309
|
-
row.setAttribute("data-fp-icon-echo", overlay ? "overlay" : "band");
|
|
310
|
-
if (group) {
|
|
311
|
-
row.style.height = `${group.height}px`;
|
|
312
|
-
if (!up && overlay) row.style.marginBottom = `${-(group.height - border("Top"))}px`;
|
|
313
|
-
}
|
|
314
|
-
row.style.marginLeft = `${-border("Left")}px`;
|
|
315
|
-
row.style.marginRight = `${-border("Right")}px`;
|
|
316
|
-
box.style.width = `${width}px`;
|
|
317
|
-
box.style.height = `${height}px`;
|
|
318
|
-
box.style.marginLeft = rtl ? "" : `${offset}px`;
|
|
319
|
-
box.style.marginRight = rtl ? `${offset}px` : "";
|
|
320
|
-
box.style.alignSelf = "flex-start";
|
|
321
|
-
box.style.marginTop = group ? `${group.top}px` : "";
|
|
322
|
-
box.style.position = "relative";
|
|
323
|
-
box.style.zIndex = "1";
|
|
324
|
-
}
|
|
325
258
|
function layoutParentOf(element) {
|
|
326
259
|
let parent = element?.parentElement ?? null;
|
|
327
260
|
while (parent && getComputedStyle(parent).display === "contents") parent = parent.parentElement;
|
|
@@ -472,14 +405,17 @@ function FloatingPanelSheet({
|
|
|
472
405
|
...(0, import_theme.transitionProps)(slideMotion),
|
|
473
406
|
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Sheet.Overlay, {
|
|
474
407
|
...(0, import_theme.transitionProps)(scrimMotion),
|
|
475
|
-
backgroundColor:
|
|
408
|
+
backgroundColor: import_theme.overlayScrim,
|
|
476
409
|
enterStyle: {
|
|
477
410
|
opacity: 0
|
|
478
411
|
},
|
|
479
412
|
exitStyle: {
|
|
480
413
|
opacity: 0
|
|
481
414
|
}
|
|
482
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Sheet.Handle, {
|
|
415
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Sheet.Handle, {
|
|
416
|
+
...import_theme.sheetGrabber,
|
|
417
|
+
"aria-label": "Resize"
|
|
418
|
+
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Sheet.Frame, {
|
|
483
419
|
"data-testid": "floating-panel-sheet",
|
|
484
420
|
...{
|
|
485
421
|
ref: sheetFrameRef,
|
|
@@ -488,16 +424,34 @@ function FloatingPanelSheet({
|
|
|
488
424
|
...knobProps.elevatedSurface,
|
|
489
425
|
borderBottomLeftRadius: 0,
|
|
490
426
|
borderBottomRightRadius: 0,
|
|
427
|
+
borderLeftWidth: 0,
|
|
428
|
+
borderRightWidth: 0,
|
|
429
|
+
borderBottomWidth: 0,
|
|
491
430
|
...panelChromeFocus,
|
|
492
431
|
padding: framePadding,
|
|
432
|
+
...(contentPadding === "none" ? {
|
|
433
|
+
paddingTop: import_theme.sheetGrabberClearance
|
|
434
|
+
} : null),
|
|
493
435
|
gap: frameGap,
|
|
494
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.
|
|
436
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_overlayStack.OverlayStackProvider, {
|
|
495
437
|
zIndex: sheetZIndex,
|
|
496
|
-
children:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
438
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_echoContext.PanelSheetContext.Provider, {
|
|
439
|
+
value: true,
|
|
440
|
+
children: [header, scrollable ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.Sheet.ScrollView, {
|
|
441
|
+
flex: header ? 1 : void 0,
|
|
442
|
+
...scrollViewProps,
|
|
443
|
+
children
|
|
444
|
+
}) : children, contentPadding === "none" ?
|
|
445
|
+
// An edge-to-edge list clears the home indicator (HIG); a padded
|
|
446
|
+
// frame's own padding already does.
|
|
447
|
+
/* @__PURE__ */
|
|
448
|
+
(0, import_jsx_runtime.jsx)(import_tamagui.View, {
|
|
449
|
+
style: {
|
|
450
|
+
height: "env(safe-area-inset-bottom)"
|
|
451
|
+
},
|
|
452
|
+
flexShrink: 0
|
|
453
|
+
}) : null]
|
|
454
|
+
})
|
|
501
455
|
})
|
|
502
456
|
})]
|
|
503
457
|
})]
|
|
@@ -519,7 +473,7 @@ function FloatingPanelWeb({
|
|
|
519
473
|
cover = true,
|
|
520
474
|
triggerEcho = true,
|
|
521
475
|
coverAlign = "start",
|
|
522
|
-
|
|
476
|
+
iconCover,
|
|
523
477
|
triggerRow,
|
|
524
478
|
anchorRect,
|
|
525
479
|
clampCollisions = false,
|
|
@@ -530,10 +484,8 @@ function FloatingPanelWeb({
|
|
|
530
484
|
const isFill = sizing === "fill";
|
|
531
485
|
const isContextMenu = openOn === "contextmenu";
|
|
532
486
|
const pointMenu = isContextMenu && sheetProps.anchorMode !== "cover-trigger";
|
|
533
|
-
const
|
|
534
|
-
const
|
|
535
|
-
const iconEchoUpRef = (0, import_react.useRef)(false);
|
|
536
|
-
const [echoBox, setEchoBox] = (0, import_react.useState)(null);
|
|
487
|
+
const coversIcon = cover && !pointMenu && iconCover === true;
|
|
488
|
+
const openedUpRef = (0, import_react.useRef)(false);
|
|
537
489
|
const overlayStyleRef = (0, import_react.useRef)(null);
|
|
538
490
|
const pinnedTopRef = (0, import_react.useRef)(0);
|
|
539
491
|
const pinnedHeightRef = (0, import_react.useRef)(0);
|
|
@@ -621,19 +573,19 @@ function FloatingPanelWeb({
|
|
|
621
573
|
const viewportRight = viewportLeft + (viewport?.width ?? (document.documentElement.clientWidth || window.innerWidth));
|
|
622
574
|
const viewportBottom = viewportTop + (viewport?.height ?? window.innerHeight);
|
|
623
575
|
dropdownElement.style.left = `${viewportLeft - containingBlock.left}px`;
|
|
624
|
-
const groupSurface =
|
|
576
|
+
const groupSurface = coversIcon ? (0, import_paintedBox.groupSurfaceOf)(trig) : null;
|
|
625
577
|
const groupBox = groupSurface?.getBoundingClientRect() ?? null;
|
|
626
|
-
if (
|
|
578
|
+
if (coversIcon) dropdownElement.style.minWidth = groupBox ? `${groupBox.width}px` : "";
|
|
627
579
|
const layoutStyle = getComputedStyle(dropdownElement);
|
|
628
580
|
const scale = layoutStyle.transform && layoutStyle.transform !== "none" && typeof DOMMatrixReadOnly !== "undefined" ? Math.abs(new DOMMatrixReadOnly(layoutStyle.transform).a) : 1;
|
|
629
581
|
const layoutWidth = dropdownElement.getBoundingClientRect().width / (scale || 1);
|
|
630
582
|
const width = Math.max(layoutWidth || dropdownElement.offsetWidth, measured.width);
|
|
631
583
|
const startLeft = rtl ? measured.right - width : measured.left;
|
|
632
584
|
const endLeft = rtl ? measured.left : measured.right - width;
|
|
633
|
-
const
|
|
585
|
+
const iconCover2 = coverAlign === "auto";
|
|
634
586
|
const startFree = rtl ? startLeft >= viewportLeft + import_useFloatingPanel.panelViewportPadding : startLeft + width <= viewportRight - import_useFloatingPanel.panelViewportPadding;
|
|
635
587
|
const endFree = rtl ? endLeft + width <= viewportRight - import_useFloatingPanel.panelViewportPadding : endLeft >= viewportLeft + import_useFloatingPanel.panelViewportPadding;
|
|
636
|
-
let alignEnd =
|
|
588
|
+
let alignEnd = iconCover2 && !startFree && endFree;
|
|
637
589
|
const slides = (0, import_panelWidth.slidesAlongScreen)(panelWidth);
|
|
638
590
|
const margins = {
|
|
639
591
|
boundsLeft: viewportLeft + import_useFloatingPanel.panelViewportPadding,
|
|
@@ -660,7 +612,7 @@ function FloatingPanelWeb({
|
|
|
660
612
|
const bodyStyle = contentRef.current ? getComputedStyle(contentRef.current) : null;
|
|
661
613
|
const bodyPadding = (parseFloat(bodyStyle?.paddingTop || "0") || 0) + (parseFloat(bodyStyle?.paddingBottom || "0") || 0);
|
|
662
614
|
const neededHeight = sheetProps.scrollable ? Math.min(totalContentHeight, measured.height + firstActionHeight + bodyPadding + totalBorderWidth) : totalContentHeight;
|
|
663
|
-
const painted =
|
|
615
|
+
const painted = coversIcon ? (0, import_paintedBox.paintedTriggerBox)(trig, measured) : null;
|
|
664
616
|
const coverRect = painted ? (0, import_coverRect.iconCoverRect)({
|
|
665
617
|
x: painted.left,
|
|
666
618
|
y: measured.top,
|
|
@@ -672,16 +624,10 @@ function FloatingPanelWeb({
|
|
|
672
624
|
width: groupBox.width,
|
|
673
625
|
height: groupBox.height
|
|
674
626
|
} : null) : null;
|
|
675
|
-
const echoCover = coverRect ? (0, import_coverRect.echoInCover)({
|
|
676
|
-
x: measured.left,
|
|
677
|
-
y: measured.top,
|
|
678
|
-
width: measured.width,
|
|
679
|
-
height: measured.height
|
|
680
|
-
}, coverRect) : null;
|
|
681
627
|
let placedTop = measured.top;
|
|
682
628
|
let placedLeft = left;
|
|
683
629
|
let placedMaxHeight = null;
|
|
684
|
-
|
|
630
|
+
openedUpRef.current = false;
|
|
685
631
|
if (coverRect && measured.width > 0 && measured.height > 0) {
|
|
686
632
|
const placed = (0, import_pointAnchor.placeOverTrigger)({
|
|
687
633
|
trigger: coverRect,
|
|
@@ -701,9 +647,9 @@ function FloatingPanelWeb({
|
|
|
701
647
|
if (!slides) placedLeft = placed.left;
|
|
702
648
|
alignEnd = placed.end;
|
|
703
649
|
placedMaxHeight = placed.maxHeight;
|
|
704
|
-
|
|
650
|
+
openedUpRef.current = placed.up;
|
|
705
651
|
} else if (measured.width > 0 && measured.height > 0 && (!slides && (left < viewportLeft || left + width > Math.max(measured.right, viewportRight - import_useFloatingPanel.panelViewportPadding)) || measured.right > viewportRight || measured.top < viewportTop || measured.top + Math.max(neededHeight, measured.height) > viewportBottom - import_useFloatingPanel.panelViewportPadding)) {
|
|
706
|
-
if (!clampCollisions && !
|
|
652
|
+
if (!clampCollisions && !iconCover2) {
|
|
707
653
|
dropdownElement.style.visibility = "hidden";
|
|
708
654
|
setCollisionSheet(true);
|
|
709
655
|
return;
|
|
@@ -731,30 +677,7 @@ function FloatingPanelWeb({
|
|
|
731
677
|
alignEnd = placed.end;
|
|
732
678
|
}
|
|
733
679
|
coverAlignEndRef.current = alignEnd;
|
|
734
|
-
|
|
735
|
-
triggerLeft: measured.left,
|
|
736
|
-
triggerRight: measured.right,
|
|
737
|
-
panelLeft: placedLeft,
|
|
738
|
-
panelWidth: width,
|
|
739
|
-
rtl
|
|
740
|
-
});
|
|
741
|
-
const echoOverlays = iconEcho != null && (0, import_iconEcho.iconEchoOverlays)(iconEcho, iconEchoUpRef.current);
|
|
742
|
-
const nextEchoBox = showIconEcho && echoOverlays ? (0, import_echoContext.echoHeaderBox)({
|
|
743
|
-
offset: echoStart,
|
|
744
|
-
width: measured.width,
|
|
745
|
-
height: echoCover?.height ?? measured.height,
|
|
746
|
-
panelWidth: width,
|
|
747
|
-
rtl
|
|
748
|
-
}) : null;
|
|
749
|
-
setEchoBox(previous => (0, import_echoContext.sameEchoBox)(previous, nextEchoBox) ? previous : nextEchoBox);
|
|
750
|
-
placeIconEcho(dropdownElement, {
|
|
751
|
-
offset: echoStart,
|
|
752
|
-
width: measured.width,
|
|
753
|
-
height: measured.height,
|
|
754
|
-
up: iconEchoUpRef.current,
|
|
755
|
-
overlay: echoOverlays,
|
|
756
|
-
group: echoCover
|
|
757
|
-
});
|
|
680
|
+
placedLeft = Math.round(placedLeft);
|
|
758
681
|
placeEchoOverTrigger(dropdownElement, {
|
|
759
682
|
triggerLeft: measured.left,
|
|
760
683
|
triggerRight: measured.right,
|
|
@@ -771,7 +694,7 @@ function FloatingPanelWeb({
|
|
|
771
694
|
dropdownElement.style.left = `${cssLeft2}px`;
|
|
772
695
|
dropdownElement.style.maxHeight = `${maxHeight}px`;
|
|
773
696
|
dropdownElement.dir = rtl ? "rtl" : "ltr";
|
|
774
|
-
dropdownElement.style.transformOrigin = `${
|
|
697
|
+
dropdownElement.style.transformOrigin = `${openedUpRef.current ? "bottom" : "top"} ${rtl !== alignEnd ? "right" : "left"}`;
|
|
775
698
|
dropdownElement.style.visibility = "visible";
|
|
776
699
|
overlayStyleRef.current = {
|
|
777
700
|
top: top2,
|
|
@@ -902,7 +825,7 @@ function FloatingPanelWeb({
|
|
|
902
825
|
});
|
|
903
826
|
}
|
|
904
827
|
});
|
|
905
|
-
}, [isFill, isContextMenu, pointMenu,
|
|
828
|
+
}, [isFill, isContextMenu, pointMenu, coversIcon, cover, anchorRect, clampCollisions, sheetProps.scrollable, triggerEcho, coverAlign, panel.placement, panel.refs, panel.triggerRef, panel.updateArrows, panel.panelTransition]);
|
|
906
829
|
repositionFnRef.current = repositionOverlay;
|
|
907
830
|
const click = (0, import_react2.useClick)(panel.context, {
|
|
908
831
|
event: "mousedown",
|
|
@@ -1079,7 +1002,7 @@ function FloatingPanelWeb({
|
|
|
1079
1002
|
// then positions against this box and is clipped by its scroll.
|
|
1080
1003
|
transform: panel.visible ? "none" : "scale(0.96)",
|
|
1081
1004
|
transition: webTransition,
|
|
1082
|
-
transformOrigin: cover && !pointMenu ? `${
|
|
1005
|
+
transformOrigin: cover && !pointMenu ? `${openedUpRef.current ? "bottom" : "top"} ${isRtl(panel.triggerRef.current) !== coverAlignEndRef.current ? "right" : "left"}` : panelTransformOrigin(pointPlacementRef.current ? `${pointPlacementRef.current.dropup ? "top" : "bottom"}-${pointPlacementRef.current.alignEnd ? "end" : "start"}` : panel.placement)
|
|
1083
1006
|
},
|
|
1084
1007
|
onScroll: handleScroll,
|
|
1085
1008
|
onTransitionEnd: event => {
|
|
@@ -1096,7 +1019,7 @@ function FloatingPanelWeb({
|
|
|
1096
1019
|
borderRadius: panel.dropdownRadius,
|
|
1097
1020
|
paddingVertical: 0,
|
|
1098
1021
|
paddingBottom: panel.coverCornerInset || 0,
|
|
1099
|
-
children: [pointMenu || !cover || !triggerEcho ||
|
|
1022
|
+
children: [pointMenu || !cover || !triggerEcho || coversIcon ? null : /* @__PURE__ */(0, import_jsx_runtime.jsx)(TriggerEchoRow, {
|
|
1100
1023
|
sourceRef: panel.triggerRef,
|
|
1101
1024
|
source: trigger,
|
|
1102
1025
|
anchorRect,
|
|
@@ -1113,19 +1036,14 @@ function FloatingPanelWeb({
|
|
|
1113
1036
|
...(contentPadding !== "none" ? panel.knobProps.gapLg : void 0),
|
|
1114
1037
|
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_overlayStack.OverlayStackProvider, {
|
|
1115
1038
|
zIndex: panelZIndex,
|
|
1116
|
-
children
|
|
1117
|
-
value: echoBox,
|
|
1118
|
-
children
|
|
1119
|
-
})
|
|
1039
|
+
children
|
|
1120
1040
|
})
|
|
1121
1041
|
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_floatingList.ScrollArrow, {
|
|
1122
1042
|
direction: "down",
|
|
1123
1043
|
scrollRef: panel.refs.floating,
|
|
1124
1044
|
visible: panel.arrowDown,
|
|
1125
1045
|
arrowScrollDirRef: panel.arrowScrollDirRef
|
|
1126
|
-
})
|
|
1127
|
-
children: (0, import_iconEcho.iconEchoElement)(trigger, iconEcho, () => onOpenChange(false), triggerSurface)
|
|
1128
|
-
}) : null]
|
|
1046
|
+
})]
|
|
1129
1047
|
})
|
|
1130
1048
|
})
|
|
1131
1049
|
})]
|