@tu-design/vue 0.5.3 → 0.5.6

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.
Files changed (56) hide show
  1. package/dist/index.d.mts +221 -20
  2. package/dist/index.mjs +518 -163
  3. package/dist/registry/vue/alert-dialog.json +2 -2
  4. package/dist/registry/vue/alert.json +1 -1
  5. package/dist/registry/vue/avatar-group.json +1 -1
  6. package/dist/registry/vue/avatar.json +1 -1
  7. package/dist/registry/vue/badge.json +1 -1
  8. package/dist/registry/vue/button.json +1 -1
  9. package/dist/registry/vue/calendar.json +1 -1
  10. package/dist/registry/vue/card.json +1 -1
  11. package/dist/registry/vue/cascader.json +2 -2
  12. package/dist/registry/vue/checkbox.json +1 -1
  13. package/dist/registry/vue/context-menu.json +3 -3
  14. package/dist/registry/vue/currency-input.json +1 -1
  15. package/dist/registry/vue/date-picker.json +2 -2
  16. package/dist/registry/vue/date-range-picker.json +2 -2
  17. package/dist/registry/vue/date-shared.json +8 -2
  18. package/dist/registry/vue/dialog.json +2 -2
  19. package/dist/registry/vue/drawer.json +2 -2
  20. package/dist/registry/vue/dropdown-menu.json +2 -2
  21. package/dist/registry/vue/empty.json +1 -1
  22. package/dist/registry/vue/form-render.json +1 -1
  23. package/dist/registry/vue/form.json +1 -1
  24. package/dist/registry/vue/icon-shared.json +1 -1
  25. package/dist/registry/vue/input.json +1 -1
  26. package/dist/registry/vue/label.json +1 -1
  27. package/dist/registry/vue/month-picker.json +2 -2
  28. package/dist/registry/vue/number-input.json +1 -1
  29. package/dist/registry/vue/overlay-shared.json +13 -1
  30. package/dist/registry/vue/password-input.json +1 -1
  31. package/dist/registry/vue/pin-input.json +1 -1
  32. package/dist/registry/vue/popconfirm.json +1 -1
  33. package/dist/registry/vue/popover.json +2 -2
  34. package/dist/registry/vue/progress.json +1 -1
  35. package/dist/registry/vue/radio-group.json +1 -1
  36. package/dist/registry/vue/registry.json +52 -52
  37. package/dist/registry/vue/select.json +2 -2
  38. package/dist/registry/vue/separator.json +1 -1
  39. package/dist/registry/vue/skeleton.json +1 -1
  40. package/dist/registry/vue/slider.json +1 -1
  41. package/dist/registry/vue/slot.json +1 -1
  42. package/dist/registry/vue/spin.json +1 -1
  43. package/dist/registry/vue/switch.json +1 -1
  44. package/dist/registry/vue/table-render.json +5 -5
  45. package/dist/registry/vue/tabs.json +1 -1
  46. package/dist/registry/vue/textarea.json +1 -1
  47. package/dist/registry/vue/timeline.json +1 -1
  48. package/dist/registry/vue/toast.json +1 -1
  49. package/dist/registry/vue/tokens.json +2 -2
  50. package/dist/registry/vue/tooltip.json +2 -2
  51. package/dist/registry/vue/tree-select.json +2 -2
  52. package/dist/registry/vue/tree-shared.json +1 -1
  53. package/dist/registry/vue/utils.json +1 -1
  54. package/dist/registry/vue/week-picker.json +2 -2
  55. package/dist/registry/vue/year-picker.json +2 -2
  56. package/package.json +2 -1
package/dist/index.mjs CHANGED
@@ -279,7 +279,7 @@ const _sfc_main$19 = defineComponent({
279
279
  });
280
280
  //#endregion
281
281
  //#region src/components/form/FormDescription.vue
282
- const _hoisted_1$31 = ["id"];
282
+ const _hoisted_1$32 = ["id"];
283
283
  const _sfc_main$20 = /*@__PURE__*/ defineComponent({
284
284
  __name: "FormDescription",
285
285
  props: { class: {} },
@@ -293,7 +293,7 @@ const _sfc_main$20 = /*@__PURE__*/ defineComponent({
293
293
  return openBlock(), createElementBlock("p", {
294
294
  id: unref(itemCtx)?.descriptionId,
295
295
  class: normalizeClass(unref(cn)("text-muted-foreground text-sm", props.class))
296
- }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$31);
296
+ }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$32);
297
297
  };
298
298
  }
299
299
  });
@@ -344,7 +344,7 @@ const _sfc_main$21 = defineComponent({
344
344
  });
345
345
  //#endregion
346
346
  //#region src/components/form/FormItem.vue
347
- const _hoisted_1$30 = ["data-invalid"];
347
+ const _hoisted_1$31 = ["data-invalid"];
348
348
  const _sfc_main$22 = /*@__PURE__*/ defineComponent({
349
349
  __name: "FormItem",
350
350
  setup(__props) {
@@ -369,13 +369,13 @@ const _sfc_main$22 = /*@__PURE__*/ defineComponent({
369
369
  return openBlock(), createElementBlock("div", {
370
370
  class: normalizeClass(unref(cn)("group flex flex-col gap-1.5")),
371
371
  "data-invalid": isInvalid.value ? "" : void 0
372
- }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$30);
372
+ }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$31);
373
373
  };
374
374
  }
375
375
  });
376
376
  //#endregion
377
377
  //#region src/components/form/FormLabel.vue
378
- const _hoisted_1$29 = ["for", "data-invalid"];
378
+ const _hoisted_1$30 = ["for", "data-invalid"];
379
379
  const _sfc_main$23 = /*@__PURE__*/ defineComponent({
380
380
  __name: "FormLabel",
381
381
  props: { class: {} },
@@ -389,13 +389,13 @@ const _sfc_main$23 = /*@__PURE__*/ defineComponent({
389
389
  for: unref(itemCtx)?.controlId,
390
390
  "data-invalid": isInvalid.value ? "" : void 0,
391
391
  class: normalizeClass(unref(cn)("text-sm font-medium leading-none data-invalid:text-destructive", props.class))
392
- }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$29);
392
+ }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$30);
393
393
  };
394
394
  }
395
395
  });
396
396
  //#endregion
397
397
  //#region src/components/form/FormMessage.vue
398
- const _hoisted_1$28 = ["id"];
398
+ const _hoisted_1$29 = ["id"];
399
399
  const _sfc_main$24 = /*@__PURE__*/ defineComponent({
400
400
  __name: "FormMessage",
401
401
  props: {
@@ -420,7 +420,7 @@ const _sfc_main$24 = /*@__PURE__*/ defineComponent({
420
420
  key: 0,
421
421
  id: unref(itemCtx)?.messageId,
422
422
  class: normalizeClass(unref(cn)("text-destructive text-sm", props.class))
423
- }, toDisplayString(errorText.value), 11, _hoisted_1$28)) : createCommentVNode("v-if", true);
423
+ }, toDisplayString(errorText.value), 11, _hoisted_1$29)) : createCommentVNode("v-if", true);
424
424
  };
425
425
  }
426
426
  });
@@ -492,7 +492,7 @@ const _sfc_main$64 = defineComponent({
492
492
  });
493
493
  //#endregion
494
494
  //#region src/components/checkbox/Checkbox.vue
495
- const _hoisted_1$27 = {
495
+ const _hoisted_1$28 = {
496
496
  key: 0,
497
497
  viewBox: "0 0 24 24",
498
498
  fill: "none",
@@ -565,7 +565,7 @@ const _sfc_main$9 = /*@__PURE__*/ defineComponent({
565
565
  createVNode(unref(Checkbox).HiddenInput),
566
566
  createVNode(unref(Checkbox).Control, { class: "border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 peer size-4 shrink-0 rounded-[4px] border bg-transparent shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50" }, {
567
567
  default: withCtx(() => [createVNode(unref(Checkbox).Indicator, { class: "flex items-center justify-center text-current" }, {
568
- default: withCtx(() => [createCommentVNode(" 半选态(data-state=indeterminate)显示短横线,选中态显示对勾 "), isChecked.value === "indeterminate" ? (openBlock(), createElementBlock("svg", _hoisted_1$27, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M5 12h14" }, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_2$18, [..._cache[1] || (_cache[1] = [createElementVNode("path", { d: "M20 6 9 17l-5-5" }, null, -1)])]))]),
568
+ default: withCtx(() => [createCommentVNode(" 半选态(data-state=indeterminate)显示短横线,选中态显示对勾 "), isChecked.value === "indeterminate" ? (openBlock(), createElementBlock("svg", _hoisted_1$28, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M5 12h14" }, null, -1)])])) : (openBlock(), createElementBlock("svg", _hoisted_2$18, [..._cache[1] || (_cache[1] = [createElementVNode("path", { d: "M20 6 9 17l-5-5" }, null, -1)])]))]),
569
569
  _: 1
570
570
  })]),
571
571
  _: 1
@@ -750,7 +750,7 @@ function formatCurrency(value, valueUnit, labelUnit) {
750
750
  }
751
751
  //#endregion
752
752
  //#region src/components/currency-input/CurrencyInput.vue
753
- const _hoisted_1$26 = ["data-invalid"];
753
+ const _hoisted_1$27 = ["data-invalid"];
754
754
  const _hoisted_2$17 = [
755
755
  "value",
756
756
  "placeholder",
@@ -829,7 +829,7 @@ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
829
829
  }), null, 16, _hoisted_2$17), createElementVNode("div", {
830
830
  "aria-hidden": "true",
831
831
  class: normalizeClass(unref(cn)("border-input text-muted-foreground flex h-full shrink-0 items-center border-l bg-muted/40 px-3 text-sm", props.disabled && "opacity-50"))
832
- }, toDisplayString(props.labelUnit), 3)], 10, _hoisted_1$26);
832
+ }, toDisplayString(props.labelUnit), 3)], 10, _hoisted_1$27);
833
833
  };
834
834
  }
835
835
  });
@@ -943,7 +943,7 @@ var export_helper_default = (sfc, props) => {
943
943
  //#endregion
944
944
  //#region src/components/icon-shared/ChevronIcon.vue
945
945
  const _sfc_main$63 = {};
946
- const _hoisted_1$25 = {
946
+ const _hoisted_1$26 = {
947
947
  viewBox: "0 0 24 24",
948
948
  fill: "none",
949
949
  stroke: "currentColor",
@@ -953,7 +953,7 @@ const _hoisted_1$25 = {
953
953
  "aria-hidden": "true"
954
954
  };
955
955
  function _sfc_render$2(_ctx, _cache) {
956
- return openBlock(), createElementBlock("svg", _hoisted_1$25, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "m9 18 6-6-6-6" }, null, -1)])]);
956
+ return openBlock(), createElementBlock("svg", _hoisted_1$26, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "m9 18 6-6-6-6" }, null, -1)])]);
957
957
  }
958
958
  var ChevronIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$63, [["render", _sfc_render$2]]);
959
959
  //#endregion
@@ -1023,7 +1023,7 @@ view: {
1023
1023
  });
1024
1024
  //#endregion
1025
1025
  //#region src/components/calendar/CalendarBody.vue
1026
- const _hoisted_1$24 = { class: "flex gap-6" };
1026
+ const _hoisted_1$25 = { class: "flex gap-6" };
1027
1027
  const dayTriggerCls = "group relative flex h-8 w-full cursor-pointer items-center justify-center outline-none data-[outside-view]:pointer-events-none data-[disabled]:pointer-events-none data-[in-range]:not-data-[outside-view]:not-data-[range-start]:not-data-[range-end]:bg-primary/10 data-[range-start]:rounded-l-[3px] data-[range-end]:rounded-r-[3px] data-[week-selected]:bg-primary data-[week-selected]:data-[outside-view]:bg-primary/40 data-[week-selected]:hover:data-[outside-view]:bg-primary/40 group-hover/week-row:not-data-[week-selected]:not-data-[outside-view]:bg-primary/10 group-hover/week-row:data-[outside-view]:not-data-[week-selected]:bg-primary/5";
1028
1028
  const dayDotCls = "flex size-6 items-center justify-center rounded-[3px] text-sm transition-colors group-hover:not-group-data-[week-selected]:bg-accent group-data-[focus]:not-group-data-[outside-view]:not-group-data-[week-selected]:bg-accent group-data-[selected]:not-group-data-[week-selected]:not-group-data-[outside-view]:bg-primary group-data-[selected]:not-group-data-[week-selected]:not-group-data-[outside-view]:font-medium group-data-[selected]:not-group-data-[week-selected]:not-group-data-[outside-view]:text-primary-foreground group-data-[week-selected]:bg-transparent group-data-[week-selected]:font-medium group-data-[week-selected]:text-primary-foreground group-data-[week-selected]:hover:bg-white/20 group-data-[today]:not-group-data-[selected]:text-primary group-data-[today]:not-group-data-[selected]:font-semibold group-data-[unavailable]:line-through group-data-[unavailable]:opacity-30 group-data-[disabled]:opacity-40 group-data-[outside-view]:opacity-30";
1029
1029
  const cellCls = "flex h-9 w-full items-center justify-center rounded-[3px] text-sm outline-none hover:bg-accent data-[selected]:bg-primary data-[selected]:font-medium data-[selected]:text-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-40";
@@ -1083,7 +1083,7 @@ const _sfc_main$61 = /*@__PURE__*/ defineComponent({
1083
1083
  key: "1"
1084
1084
  } : void 0]), 1024),
1085
1085
  createVNode(unref(DatePicker).Context, null, {
1086
- default: withCtx((context) => [createElementVNode("div", _hoisted_1$24, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.numOfMonths, (i) => {
1086
+ default: withCtx((context) => [createElementVNode("div", _hoisted_1$25, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.numOfMonths, (i) => {
1087
1087
  return openBlock(), createBlock(unref(DatePicker).Table, {
1088
1088
  key: i,
1089
1089
  class: normalizeClass(tableCls)
@@ -1469,7 +1469,7 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
1469
1469
  //#endregion
1470
1470
  //#region src/components/icon-shared/CalendarIcon.vue
1471
1471
  const _sfc_main$60 = {};
1472
- const _hoisted_1$23 = {
1472
+ const _hoisted_1$24 = {
1473
1473
  viewBox: "0 0 24 24",
1474
1474
  fill: "none",
1475
1475
  stroke: "currentColor",
@@ -1479,7 +1479,7 @@ const _hoisted_1$23 = {
1479
1479
  "aria-hidden": "true"
1480
1480
  };
1481
1481
  function _sfc_render$1(_ctx, _cache) {
1482
- return openBlock(), createElementBlock("svg", _hoisted_1$23, [..._cache[0] || (_cache[0] = [
1482
+ return openBlock(), createElementBlock("svg", _hoisted_1$24, [..._cache[0] || (_cache[0] = [
1483
1483
  createElementVNode("rect", {
1484
1484
  width: "18",
1485
1485
  height: "18",
@@ -1496,7 +1496,7 @@ var CalendarIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$60, [["
1496
1496
  //#endregion
1497
1497
  //#region src/components/icon-shared/CloseIcon.vue
1498
1498
  const _sfc_main$59 = {};
1499
- const _hoisted_1$22 = {
1499
+ const _hoisted_1$23 = {
1500
1500
  viewBox: "0 0 24 24",
1501
1501
  fill: "none",
1502
1502
  stroke: "currentColor",
@@ -1506,10 +1506,92 @@ const _hoisted_1$22 = {
1506
1506
  "aria-hidden": "true"
1507
1507
  };
1508
1508
  function _sfc_render(_ctx, _cache) {
1509
- return openBlock(), createElementBlock("svg", _hoisted_1$22, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M18 6 6 18" }, null, -1), createElementVNode("path", { d: "m6 6 12 12" }, null, -1)])]);
1509
+ return openBlock(), createElementBlock("svg", _hoisted_1$23, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M18 6 6 18" }, null, -1), createElementVNode("path", { d: "m6 6 12 12" }, null, -1)])]);
1510
1510
  }
1511
1511
  var CloseIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$59, [["render", _sfc_render]]);
1512
1512
  //#endregion
1513
+ //#region src/components/overlay-shared/sandbox.ts
1514
+ /**
1515
+ * 微前端沙箱探测(按渲染拓扑分派,框架无关)。
1516
+ *
1517
+ * 拓扑三分:
1518
+ * - 同文档(无沙箱 / qiankun / micro-app light DOM / 降级 iframe):absolute 正确
1519
+ * - 真 shadow DOM(web component 沙箱 / micro-app shadowDOM 模式):absolute 正确,
1520
+ * 由组件的 `getRootNode() instanceof ShadowRoot` 检测命中
1521
+ * - graft 型(wujie):iframe 文档树 graft 进 shadowRoot 渲染,absolute 输出视口系
1522
+ * 坐标但包含块是 graft body → 错位;fixed 以最近视口为包含块,是唯一正确解
1523
+ *
1524
+ * 安全性论证:非 graft 拓扑下 absolute 与 fixed 坐标等价(包含块同为最近视口),
1525
+ * iframe realm 下默认 fixed 零副作用;跨域 iframe 下 self/top 仅引用比较,
1526
+ * 不读属性,无 SecurityError。
1527
+ *
1528
+ * 已知边界:
1529
+ * - fixed 元素祖先有 transform/filter 时包含块被劫持(宿主布局应避免;graft 下
1530
+ * absolute 的 offsetParent 解析本就失效,错法不同而非新增错误)
1531
+ * - fixed 面板在祖先滚动时依赖 autoUpdate 重算,重算前一帧有视口驻留(瞬时视觉差异)
1532
+ * - 若未来出现「非 iframe 的 graft 型沙箱」,本探测无法覆盖,需追加该沙箱的 marker 信号
1533
+ */
1534
+ /** 组件 JS 是否运行在 iframe realm(wujie / iframe 型沙箱 / 普通 iframe 嵌入) */
1535
+ function isInIframeRealm() {
1536
+ return typeof window !== "undefined" && window.self !== window.top;
1537
+ }
1538
+ /** 是否处于 wujie graft 沙箱(getRootNode/父链被 wujie patch 伪装,结构探测失效,
1539
+ * 依赖官方标记;wujie 在子应用脚本执行前注入,时序可靠) */
1540
+ function isInWujie() {
1541
+ return typeof window !== "undefined" && window.__POWERED_BY_WUJIE__ === true;
1542
+ }
1543
+ //#endregion
1544
+ //#region src/components/overlay-shared/useSandboxOverlay.ts
1545
+ /**
1546
+ * 浮层沙箱适配公共层(Popover 0.5.3 修复的推广形态,机制与实测依据见 sandbox.ts 头注):
1547
+ * - useSandboxTeleportTarget:Teleport 目标降级(真 shadow DOM / wujie graft → 应用挂载容器)
1548
+ * - withSandboxStrategy:iframe realm 下 positioning.strategy 默认 fixed(absolute 包含块错位修正)
1549
+ */
1550
+ /**
1551
+ * 浮层 Teleport 目标解析:显式 to > shadow DOM / wujie graft 自动降级 > body。
1552
+ *
1553
+ * app._container 在 mount 的 render 完成后才赋值(runtime-core 3.5.43:render L4337
1554
+ * → 赋值 L4340),而子组件 onMounted 在 render 内同步执行、届时仍为 undefined,
1555
+ * 故检测再延后一个微任务(mount 调用栈结束后 _container 必已赋值),结果存 ref
1556
+ * 驱动 computed 重算;getCurrentInstance 仅 setup 同步上下文可用,本函数须在
1557
+ * setup 顶层调用。共享 Vue(__MICRO_SHARED__)下各子应用 app._container 相互
1558
+ * 独立,检测按实例隔离。
1559
+ * 沙箱两类:真 shadow DOM 由 getRootNode() 命中;wujie graft 下 getRootNode/父链
1560
+ * 被 patch 伪装成 iframe 文档语义(实测),结构探测失效,须叠加官方标记位。
1561
+ * 其余微前端(qiankun / micro-app light DOM)body 即主文档 body,兜底正确。
1562
+ *
1563
+ * @param explicitTo 组件显式 to 的取值函数(响应式安全:computed 内重读)
1564
+ * @returns Teleport 目标(显式 to 优先,其次降级容器,兜底 body)
1565
+ */
1566
+ function useSandboxTeleportTarget(explicitTo) {
1567
+ const instance = getCurrentInstance();
1568
+ const inWujie = isInWujie();
1569
+ const detectedTarget = ref("body");
1570
+ onMounted(() => {
1571
+ queueMicrotask(() => {
1572
+ if (explicitTo()) return;
1573
+ const container = (instance?.appContext.app)?._container;
1574
+ if (container && (container.getRootNode() instanceof ShadowRoot || inWujie)) detectedTarget.value = container;
1575
+ });
1576
+ });
1577
+ return computed(() => explicitTo() ?? detectedTarget.value);
1578
+ }
1579
+ /**
1580
+ * iframe realm(wujie graft / iframe 型沙箱 / iframe 嵌入)且用户未显式指定
1581
+ * strategy 时默认 fixed:非 graft 拓扑下 fixed 与 absolute 坐标等价(零副作用),
1582
+ * graft 拓扑(wujie)absolute 包含块错位,fixed 是唯一正确解。
1583
+ * 纯函数、原地写入 merged(调用方传入自己的合成对象,无共享引用风险);
1584
+ * user.strategy 显式给出(含 null 意义上的「未传」判定用 == null)时以其为准。
1585
+ *
1586
+ * @param user 用户原始 positioning(undefined 或经 attrs 透传的合成对象)
1587
+ * @param merged 组件已合成 placement/sameWidth 等的基础 positioning(将被写入)
1588
+ * @returns 写入 strategy 后的 merged(同引用,便于 computed 直接 return)
1589
+ */
1590
+ function withSandboxStrategy(user, merged) {
1591
+ if (isInIframeRealm() && user?.strategy == null) merged.strategy = "fixed";
1592
+ return merged;
1593
+ }
1594
+ //#endregion
1513
1595
  //#region src/components/date-shared/PickerShell.vue
1514
1596
  /** 单值日期族(Date/Month/Year/Week)共用外壳:触发器 + 清空/日历按钮 + 弹层容器。 */
1515
1597
  const _sfc_main$58 = /*@__PURE__*/ defineComponent({
@@ -1578,6 +1660,12 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
1578
1660
  type: Function,
1579
1661
  required: true
1580
1662
  },
1663
+ /** Ark DatePicker Root 的 positioning 配置(placement/gutter 等);
1664
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed */
1665
+ positioning: {
1666
+ type: Object,
1667
+ default: void 0
1668
+ },
1581
1669
  class: {
1582
1670
  type: String,
1583
1671
  default: void 0
@@ -1592,6 +1680,8 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
1592
1680
  if (props.disabled || props.readOnly || props.open) return;
1593
1681
  emit("update:open", true);
1594
1682
  }
1683
+ const teleportTarget = useSandboxTeleportTarget(() => void 0);
1684
+ const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
1595
1685
  return (_ctx, _cache) => {
1596
1686
  return openBlock(), createBlock(unref(DatePicker).Root, {
1597
1687
  "model-value": __props.modelValue,
@@ -1607,6 +1697,7 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
1607
1697
  disabled: __props.disabled,
1608
1698
  format: __props.format,
1609
1699
  parse: __props.parse,
1700
+ positioning: rootPositioning.value,
1610
1701
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
1611
1702
  "onUpdate:open": _cache[1] || (_cache[1] = ($event) => emit("update:open", $event))
1612
1703
  }, {
@@ -1638,14 +1729,14 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
1638
1729
  ]),
1639
1730
  _: 1
1640
1731
  }, 8, ["class", "data-invalid"]),
1641
- createCommentVNode(" 弹层 Teleport 到 body:脱离表单 DOM——隔离外层 FormControl 的 group class\n (group-hover 会污染面板内全部格子),并消除 overflow 容器裁剪弹层的隐患。 "),
1642
- (openBlock(), createBlock(Teleport, { to: "body" }, [createVNode(unref(DatePicker).Positioner, { class: "z-[var(--z-overlay)]" }, {
1732
+ createCommentVNode(" 弹层 Teleport:脱离表单 DOM——隔离外层 FormControl 的 group class\n (group-hover 会污染面板内全部格子),并消除 overflow 容器裁剪弹层的隐患;\n 目标经沙箱适配降级(shadow DOM / wujie graft → 应用挂载容器) "),
1733
+ (openBlock(), createBlock(Teleport, { to: unref(teleportTarget) }, [createVNode(unref(DatePicker).Positioner, { class: "z-[var(--z-overlay)]" }, {
1643
1734
  default: withCtx(() => [createVNode(unref(DatePicker).Content, { class: normalizeClass(unref(cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative z-[var(--z-overlay)] rounded-md border shadow-md")) }, {
1644
1735
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1645
1736
  _: 3
1646
1737
  }, 8, ["class"])]),
1647
1738
  _: 3
1648
- })]))
1739
+ })], 8, ["to"]))
1649
1740
  ]),
1650
1741
  _: 3
1651
1742
  }, 8, [
@@ -1661,7 +1752,8 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
1661
1752
  "read-only",
1662
1753
  "disabled",
1663
1754
  "format",
1664
- "parse"
1755
+ "parse",
1756
+ "positioning"
1665
1757
  ]);
1666
1758
  };
1667
1759
  }
@@ -1785,6 +1877,13 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
1785
1877
  type: String,
1786
1878
  default: "zh-CN"
1787
1879
  },
1880
+ /** Ark DatePicker Root 的 positioning 配置(placement/gutter 等);
1881
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
1882
+ (absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
1883
+ positioning: {
1884
+ type: Object,
1885
+ default: void 0
1886
+ },
1788
1887
  class: {
1789
1888
  type: String,
1790
1889
  default: void 0
@@ -1822,6 +1921,7 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
1822
1921
  disabled: props.disabled,
1823
1922
  invalid: props.invalid,
1824
1923
  placeholder: props.placeholder,
1924
+ positioning: props.positioning,
1825
1925
  class: props.class,
1826
1926
  format: unref(formatIsoDate),
1827
1927
  parse: unref(parseIsoDate),
@@ -1842,6 +1942,7 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
1842
1942
  "disabled",
1843
1943
  "invalid",
1844
1944
  "placeholder",
1945
+ "positioning",
1845
1946
  "class",
1846
1947
  "format",
1847
1948
  "parse",
@@ -1921,6 +2022,12 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
1921
2022
  type: String,
1922
2023
  default: "zh-CN"
1923
2024
  },
2025
+ /** Ark DatePicker Root 的 positioning 配置(placement/gutter 等);
2026
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed */
2027
+ positioning: {
2028
+ type: Object,
2029
+ default: void 0
2030
+ },
1924
2031
  class: {
1925
2032
  type: String,
1926
2033
  default: void 0
@@ -1956,6 +2063,8 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
1956
2063
  defaultValue: () => props.defaultOpen,
1957
2064
  onChange: (open) => emit("update:open", open)
1958
2065
  });
2066
+ const teleportTarget = useSandboxTeleportTarget(() => void 0);
2067
+ const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
1959
2068
  function openFromInput() {
1960
2069
  if (props.disabled || props.readOnly || isOpen.value) return;
1961
2070
  setOpen(true);
@@ -1976,6 +2085,7 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
1976
2085
  disabled: props.disabled,
1977
2086
  format: unref(formatIsoDate),
1978
2087
  parse: unref(parseIsoDate),
2088
+ positioning: rootPositioning.value,
1979
2089
  "onUpdate:modelValue": handleValueUpdate,
1980
2090
  "onUpdate:open": unref(setOpen)
1981
2091
  }, {
@@ -2030,14 +2140,14 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
2030
2140
  ]),
2031
2141
  _: 1
2032
2142
  }, 8, ["class", "data-invalid"]),
2033
- createCommentVNode(" 弹层 Teleport 到 body:脱离表单 DOM——隔离外层 FormControl 的 group class\n (group-hover 会污染面板内全部格子),并消除 overflow 容器裁剪弹层的隐患。 "),
2034
- (openBlock(), createBlock(Teleport, { to: "body" }, [createVNode(unref(DatePicker).Positioner, { class: "z-[var(--z-overlay)]" }, {
2143
+ createCommentVNode(" 弹层 Teleport:脱离表单 DOM——隔离外层 FormControl 的 group class\n (group-hover 会污染面板内全部格子),并消除 overflow 容器裁剪弹层的隐患;\n 目标经沙箱适配降级(shadow DOM / wujie graft → 应用挂载容器) "),
2144
+ (openBlock(), createBlock(Teleport, { to: unref(teleportTarget) }, [createVNode(unref(DatePicker).Positioner, { class: "z-[var(--z-overlay)]" }, {
2035
2145
  default: withCtx(() => [createVNode(unref(DatePicker).Content, { class: normalizeClass(unref(cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative z-[var(--z-overlay)] rounded-md border shadow-md")) }, {
2036
2146
  default: withCtx(() => [createVNode(unref(_sfc_main$6), { "num-of-months": props.numOfMonths }, null, 8, ["num-of-months"])]),
2037
2147
  _: 1
2038
2148
  }, 8, ["class"])]),
2039
2149
  _: 1
2040
- })]))
2150
+ })], 8, ["to"]))
2041
2151
  ]),
2042
2152
  _: 1
2043
2153
  }, 8, [
@@ -2053,6 +2163,7 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
2053
2163
  "disabled",
2054
2164
  "format",
2055
2165
  "parse",
2166
+ "positioning",
2056
2167
  "onUpdate:open"
2057
2168
  ])], 2112);
2058
2169
  };
@@ -2119,6 +2230,13 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
2119
2230
  type: String,
2120
2231
  default: "zh-CN"
2121
2232
  },
2233
+ /** Ark DatePicker Root 的 positioning 配置(placement/gutter 等);
2234
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
2235
+ (absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
2236
+ positioning: {
2237
+ type: Object,
2238
+ default: void 0
2239
+ },
2122
2240
  class: {
2123
2241
  type: String,
2124
2242
  default: void 0
@@ -2160,6 +2278,7 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
2160
2278
  disabled: props.disabled,
2161
2279
  invalid: props.invalid,
2162
2280
  placeholder: props.placeholder,
2281
+ positioning: props.positioning,
2163
2282
  class: props.class,
2164
2283
  format: unref(formatIsoMonth),
2165
2284
  parse: unref(parseIsoMonth),
@@ -2179,6 +2298,7 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
2179
2298
  "disabled",
2180
2299
  "invalid",
2181
2300
  "placeholder",
2301
+ "positioning",
2182
2302
  "class",
2183
2303
  "format",
2184
2304
  "parse",
@@ -2305,7 +2425,7 @@ const _sfc_main$30 = /*@__PURE__*/ defineComponent({
2305
2425
  });
2306
2426
  //#endregion
2307
2427
  //#region src/components/password-input/PasswordInput.vue
2308
- const _hoisted_1$21 = ["data-invalid"];
2428
+ const _hoisted_1$22 = ["data-invalid"];
2309
2429
  const _hoisted_2$16 = [
2310
2430
  "type",
2311
2431
  "value",
@@ -2428,13 +2548,13 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
2428
2548
  cx: "12",
2429
2549
  cy: "12",
2430
2550
  r: "3"
2431
- }, null, -1)])]))])], 8, _hoisted_3$12)], 10, _hoisted_1$21);
2551
+ }, null, -1)])]))])], 8, _hoisted_3$12)], 10, _hoisted_1$22);
2432
2552
  };
2433
2553
  }
2434
2554
  });
2435
2555
  //#endregion
2436
2556
  //#region src/components/textarea/Textarea.vue
2437
- const _hoisted_1$20 = ["aria-invalid"];
2557
+ const _hoisted_1$21 = ["aria-invalid"];
2438
2558
  const _sfc_main$46 = /*@__PURE__*/ defineComponent({
2439
2559
  __name: "Textarea",
2440
2560
  props: /*@__PURE__*/ mergeModels({
@@ -2453,7 +2573,7 @@ const _sfc_main$46 = /*@__PURE__*/ defineComponent({
2453
2573
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
2454
2574
  "aria-invalid": props.invalid ? "true" : void 0,
2455
2575
  class: normalizeClass(unref(cn)("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive md:text-sm", props.class))
2456
- }, null, 10, _hoisted_1$20)), [[vModelText, modelValue.value]]);
2576
+ }, null, 10, _hoisted_1$21)), [[vModelText, modelValue.value]]);
2457
2577
  };
2458
2578
  }
2459
2579
  });
@@ -2523,6 +2643,13 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
2523
2643
  type: String,
2524
2644
  default: "zh-CN"
2525
2645
  },
2646
+ /** Ark DatePicker Root 的 positioning 配置(placement/gutter 等);
2647
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
2648
+ (absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
2649
+ positioning: {
2650
+ type: Object,
2651
+ default: void 0
2652
+ },
2526
2653
  class: {
2527
2654
  type: String,
2528
2655
  default: void 0
@@ -2573,6 +2700,7 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
2573
2700
  disabled: props.disabled,
2574
2701
  invalid: props.invalid,
2575
2702
  placeholder: props.placeholder,
2703
+ positioning: props.positioning,
2576
2704
  class: props.class,
2577
2705
  format: formatDate,
2578
2706
  parse: parseDate,
@@ -2596,6 +2724,7 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
2596
2724
  "disabled",
2597
2725
  "invalid",
2598
2726
  "placeholder",
2727
+ "positioning",
2599
2728
  "class",
2600
2729
  "onUpdate:modelValue",
2601
2730
  "onUpdate:open"
@@ -2664,6 +2793,13 @@ const _sfc_main$52 = /*@__PURE__*/ defineComponent({
2664
2793
  type: String,
2665
2794
  default: "zh-CN"
2666
2795
  },
2796
+ /** Ark DatePicker Root 的 positioning 配置(placement/gutter 等);
2797
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
2798
+ (absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
2799
+ positioning: {
2800
+ type: Object,
2801
+ default: void 0
2802
+ },
2667
2803
  class: {
2668
2804
  type: String,
2669
2805
  default: void 0
@@ -2702,6 +2838,7 @@ const _sfc_main$52 = /*@__PURE__*/ defineComponent({
2702
2838
  disabled: props.disabled,
2703
2839
  invalid: props.invalid,
2704
2840
  placeholder: props.placeholder,
2841
+ positioning: props.positioning,
2705
2842
  class: props.class,
2706
2843
  format: unref(formatIsoYear),
2707
2844
  parse: unref(parseIsoYear),
@@ -2721,6 +2858,7 @@ const _sfc_main$52 = /*@__PURE__*/ defineComponent({
2721
2858
  "disabled",
2722
2859
  "invalid",
2723
2860
  "placeholder",
2861
+ "positioning",
2724
2862
  "class",
2725
2863
  "format",
2726
2864
  "parse",
@@ -2802,7 +2940,7 @@ function renderWeekPickerItem(options = {}) {
2802
2940
  }
2803
2941
  //#endregion
2804
2942
  //#region src/components/input/Input.vue
2805
- const _hoisted_1$19 = ["aria-invalid"];
2943
+ const _hoisted_1$20 = ["aria-invalid"];
2806
2944
  const _sfc_main$27 = /*@__PURE__*/ defineComponent({
2807
2945
  __name: "Input",
2808
2946
  props: /*@__PURE__*/ mergeModels({
@@ -2821,7 +2959,7 @@ const _sfc_main$27 = /*@__PURE__*/ defineComponent({
2821
2959
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
2822
2960
  "aria-invalid": props.invalid ? "true" : void 0,
2823
2961
  class: normalizeClass(unref(cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive", props.class))
2824
- }, null, 10, _hoisted_1$19)), [[vModelText, modelValue.value]]);
2962
+ }, null, 10, _hoisted_1$20)), [[vModelText, modelValue.value]]);
2825
2963
  };
2826
2964
  }
2827
2965
  });
@@ -2837,6 +2975,55 @@ function renderInputItem(options = {}) {
2837
2975
  });
2838
2976
  }
2839
2977
  //#endregion
2978
+ //#region src/components/overlay-shared/useOverlayIds.ts
2979
+ /**
2980
+ * 浮层组件 ids 全量覆盖(无冒号化)。
2981
+ *
2982
+ * 背景:zag 缺省 id 惯例形如 `popover:{scope.id}:title`(各包 *.dom.js get*Id
2983
+ * 兜底分支),而部分 part 元素并不总是渲染(title/description/anchor/clearTrigger/
2984
+ * arrow 等),machine 仍会按状态变更反复 getById 查询。wujie 沙箱把
2985
+ * document.getElementById patch 成 `querySelector('[id="…"]')` miss 后兜底
2986
+ * `querySelector('#'+id)`(wujie proxy.js),冒号未转义 → SyntaxError → catch 打出
2987
+ * "[wujie warn] 不支持document.getElementById()传入特殊字符…" 且打开期间反复刷屏。
2988
+ * ids 派生自 Vue useId()(v-0 格式,无冒号)后,未命中也是合法选择器,静默返回
2989
+ * null,告警消除;原生环境 getElementById 不解析选择器,行为零变化。
2990
+ *
2991
+ * 用法(组件 setup 内,inheritAttrs: false 透传模式下同样适用):
2992
+ * const { ids, resolveId } = useOverlayIds(attrs, {
2993
+ * primary: "content",
2994
+ * parts: ["title", "description", "anchor", "trigger", "closeTrigger", "positioner", "arrow"],
2995
+ * });
2996
+ * // 模板:<ArkXxx.Root v-bind="attrs" :ids="ids">(:ids 须位于 v-bind="attrs" 之后)
2997
+ * // aria 手动接线取元素 id 时用 resolveId(part)(user 覆盖优先,与实际 DOM 一致)
2998
+ *
2999
+ * 边界:parts 只声明「字符串型覆盖口」的 part;函数型 part(如 select 的
3000
+ * item/itemGroup/itemGroupLabel——元素必渲染,[id="…"] 首查即命中,无炸点)不进
3001
+ * parts,由 user 经 attrs.ids 直传原样保留。user 永远最后展开:显式传入以其为准。
3002
+ */
3003
+ function useOverlayIds(attrs, options) {
3004
+ const stemId = useId();
3005
+ const userIds = computed(() => attrs.ids ?? {});
3006
+ /** 默认派生值(不含 user 覆盖),独立于 ids 供 resolveId 回退;构造恒为字符串 */
3007
+ const buildBase = () => {
3008
+ const base = {};
3009
+ for (const part of options.parts) base[part] = part === options.primary ? stemId : `${stemId}-${part}`;
3010
+ return base;
3011
+ };
3012
+ const ids = computed(() => ({
3013
+ ...buildBase(),
3014
+ ...userIds.value
3015
+ }));
3016
+ /** aria 接线用:user 字符串覆盖优先,函数型 user 回退默认值 */
3017
+ const resolveId = (part) => {
3018
+ const v = userIds.value[part];
3019
+ return typeof v === "string" ? v : buildBase()[part];
3020
+ };
3021
+ return {
3022
+ ids,
3023
+ resolveId
3024
+ };
3025
+ }
3026
+ //#endregion
2840
3027
  //#region src/components/select/types.ts
2841
3028
  function normalizeSelectItem(item) {
2842
3029
  return typeof item === "string" ? {
@@ -2846,6 +3033,7 @@ function normalizeSelectItem(item) {
2846
3033
  }
2847
3034
  //#endregion
2848
3035
  //#region src/components/select/Select.vue
3036
+ const _hoisted_1$19 = { class: "min-w-0 flex-1 truncate" };
2849
3037
  const _sfc_main$37 = /*@__PURE__*/ defineComponent({
2850
3038
  __name: "Select",
2851
3039
  props: {
@@ -2886,10 +3074,30 @@ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
2886
3074
  contentClass: {
2887
3075
  type: String,
2888
3076
  default: void 0
3077
+ },
3078
+ /** Ark Select Root 的 positioning 配置(placement/gutter 等);
3079
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
3080
+ (absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
3081
+ positioning: {
3082
+ type: Object,
3083
+ default: void 0
2889
3084
  }
2890
3085
  },
2891
3086
  emits: ["update:modelValue", "update:open"],
2892
3087
  setup(__props, { emit: __emit }) {
3088
+ const { ids: rootIds } = useOverlayIds(useAttrs(), {
3089
+ primary: "content",
3090
+ parts: [
3091
+ "content",
3092
+ "root",
3093
+ "trigger",
3094
+ "control",
3095
+ "clearTrigger",
3096
+ "label",
3097
+ "hiddenSelect",
3098
+ "positioner"
3099
+ ]
3100
+ });
2893
3101
  const props = __props;
2894
3102
  const emit = __emit;
2895
3103
  const toArray = (v) => v === void 0 ? void 0 : [v];
@@ -2913,21 +3121,24 @@ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
2913
3121
  defaultValue: () => props.defaultOpen,
2914
3122
  onChange: (open) => emit("update:open", open)
2915
3123
  });
3124
+ const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
2916
3125
  return (_ctx, _cache) => {
2917
3126
  return openBlock(), createBlock(unref(Select).Root, {
3127
+ ids: unref(rootIds),
2918
3128
  collection: collection.value,
2919
3129
  "model-value": toArray(modelValue.value),
2920
3130
  open: unref(isOpen),
3131
+ positioning: rootPositioning.value,
2921
3132
  "onUpdate:modelValue": handleModelUpdate,
2922
3133
  "onUpdate:open": unref(setOpen)
2923
3134
  }, {
2924
3135
  default: withCtx(() => [
2925
3136
  createCommentVNode(" 触发器(收编自 SelectTrigger:内置选中回显与 chevron) "),
2926
- createVNode(unref(Select).Control, { class: "w-fit" }, {
2927
- default: withCtx(() => [createVNode(unref(Select).Trigger, { class: normalizeClass(unref(cn)("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 flex h-9 w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs focus-visible:outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4", props.triggerClass)) }, {
3137
+ createVNode(unref(Select).Control, { class: "w-full" }, {
3138
+ default: withCtx(() => [createVNode(unref(Select).Trigger, { class: normalizeClass(unref(cn)("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 flex h-9 w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs focus-visible:outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4", props.triggerClass)) }, {
2928
3139
  default: withCtx(() => [
2929
- createCommentVNode(" 注意:不能向 ValueText 传插槽内容,其内部会对默认插槽做字符串化渲染 "),
2930
- createVNode(unref(Select).ValueText, { placeholder: props.placeholder }, null, 8, ["placeholder"]),
3140
+ createCommentVNode(" 截断层:触发器 w-full 定宽后,超长选中值/placeholder 走 ellipsis(flex 子项 overflow 非 visible 时自动最小尺寸归零,min-w-0 双保险)。\n 注意:不能向 ValueText 传插槽内容,其内部会对默认插槽做字符串化渲染 "),
3141
+ createElementVNode("span", _hoisted_1$19, [createVNode(unref(Select).ValueText, { placeholder: props.placeholder }, null, 8, ["placeholder"])]),
2931
3142
  renderSlot(_ctx.$slots, "trigger-icon", {}, () => [createVNode(ChevronIcon_default, { class: "size-4 rotate-90 opacity-50" })])
2932
3143
  ]),
2933
3144
  _: 3
@@ -2971,9 +3182,11 @@ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
2971
3182
  ]),
2972
3183
  _: 3
2973
3184
  }, 8, [
3185
+ "ids",
2974
3186
  "collection",
2975
3187
  "model-value",
2976
3188
  "open",
3189
+ "positioning",
2977
3190
  "onUpdate:open"
2978
3191
  ]);
2979
3192
  };
@@ -4072,6 +4285,12 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
4072
4285
  type: Boolean,
4073
4286
  default: false
4074
4287
  },
4288
+ /** Ark Popover Root 的 positioning 配置(placement/gutter 等);
4289
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed */
4290
+ positioning: {
4291
+ type: Object,
4292
+ default: void 0
4293
+ },
4075
4294
  class: {
4076
4295
  type: String,
4077
4296
  default: void 0
@@ -4083,6 +4302,19 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
4083
4302
  "update:open"
4084
4303
  ],
4085
4304
  setup(__props, { emit: __emit }) {
4305
+ const { ids: rootIds } = useOverlayIds(useAttrs(), {
4306
+ primary: "content",
4307
+ parts: [
4308
+ "content",
4309
+ "title",
4310
+ "description",
4311
+ "anchor",
4312
+ "trigger",
4313
+ "closeTrigger",
4314
+ "positioner",
4315
+ "arrow"
4316
+ ]
4317
+ });
4086
4318
  const props = __props;
4087
4319
  const emit = __emit;
4088
4320
  if (import.meta.env.DEV && getCurrentInstance()?.vnode.props?.["onUpdate:show"]) console.warn("[tu-design] <Cascader> update:show 已弃用,请改用 update:open(v-model:open)。");
@@ -4123,6 +4355,8 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
4123
4355
  emit("update:show", open);
4124
4356
  }
4125
4357
  });
4358
+ const teleportTarget = useSandboxTeleportTarget(() => void 0);
4359
+ const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
4126
4360
  function openFromInput() {
4127
4361
  if (props.disabled || isOpen.value) return;
4128
4362
  syncPanelWidth();
@@ -4277,7 +4511,9 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
4277
4511
  });
4278
4512
  return (_ctx, _cache) => {
4279
4513
  return openBlock(), createBlock(unref(Popover).Root, {
4514
+ ids: unref(rootIds),
4280
4515
  open: unref(isOpen),
4516
+ positioning: rootPositioning.value,
4281
4517
  "onUpdate:open": unref(setOpen)
4282
4518
  }, {
4283
4519
  default: withCtx(() => [createVNode(unref(Popover).Anchor, { "as-child": "" }, {
@@ -4313,7 +4549,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
4313
4549
  onClick: withModifiers(handleClear, ["stop"])
4314
4550
  }, [createVNode(CloseIcon_default, { class: "size-4 shrink-0" })])) : createCommentVNode("v-if", true), createVNode(ChevronIcon_default, { class: normalizeClass(unref(cn)("size-4 shrink-0 text-muted-foreground transition-transform", unref(isOpen) ? "-rotate-90" : "rotate-90")) }, null, 8, ["class"])])], 16, _hoisted_1$16)]),
4315
4551
  _: 1
4316
- }), (openBlock(), createBlock(Teleport, { to: "body" }, [createVNode(unref(Popover).Positioner, null, {
4552
+ }), (openBlock(), createBlock(Teleport, { to: unref(teleportTarget) }, [createVNode(unref(Popover).Positioner, { class: "z-[var(--z-overlay)]" }, {
4317
4553
  default: withCtx(() => [createVNode(unref(Popover).Content, {
4318
4554
  class: normalizeClass(unref(cn)("bg-popover text-popover-foreground z-[var(--z-overlay)] rounded-md border p-0 shadow-md outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95")),
4319
4555
  style: normalizeStyle({ minWidth: panelMinWidth.value }),
@@ -4343,9 +4579,14 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
4343
4579
  _: 1
4344
4580
  }, 8, ["class", "style"])]),
4345
4581
  _: 1
4346
- })]))]),
4582
+ })], 8, ["to"]))]),
4347
4583
  _: 1
4348
- }, 8, ["open", "onUpdate:open"]);
4584
+ }, 8, [
4585
+ "ids",
4586
+ "open",
4587
+ "positioning",
4588
+ "onUpdate:open"
4589
+ ]);
4349
4590
  };
4350
4591
  }
4351
4592
  });
@@ -4612,6 +4853,12 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
4612
4853
  type: Boolean,
4613
4854
  default: false
4614
4855
  },
4856
+ /** Ark Popover Root 的 positioning 配置(placement/gutter 等);
4857
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed */
4858
+ positioning: {
4859
+ type: Object,
4860
+ default: void 0
4861
+ },
4615
4862
  class: {
4616
4863
  type: String,
4617
4864
  default: void 0
@@ -4624,6 +4871,19 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
4624
4871
  "update:expandedKeys"
4625
4872
  ],
4626
4873
  setup(__props, { emit: __emit }) {
4874
+ const { ids: rootIds } = useOverlayIds(useAttrs(), {
4875
+ primary: "content",
4876
+ parts: [
4877
+ "content",
4878
+ "title",
4879
+ "description",
4880
+ "anchor",
4881
+ "trigger",
4882
+ "closeTrigger",
4883
+ "positioner",
4884
+ "arrow"
4885
+ ]
4886
+ });
4627
4887
  const props = __props;
4628
4888
  const emit = __emit;
4629
4889
  if (import.meta.env.DEV && getCurrentInstance()?.vnode.props?.["onUpdate:show"]) console.warn("[tu-design] <TreeSelect> update:show 已弃用,请改用 update:open(v-model:open)。");
@@ -4734,6 +4994,8 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
4734
4994
  emit("update:show", open);
4735
4995
  }
4736
4996
  });
4997
+ const teleportTarget = useSandboxTeleportTarget(() => void 0);
4998
+ const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
4737
4999
  function openFromInput() {
4738
5000
  if (props.disabled || isOpen.value) return;
4739
5001
  syncPanelWidth();
@@ -4826,7 +5088,9 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
4826
5088
  });
4827
5089
  return (_ctx, _cache) => {
4828
5090
  return openBlock(), createBlock(unref(Popover).Root, {
5091
+ ids: unref(rootIds),
4829
5092
  open: unref(isOpen),
5093
+ positioning: rootPositioning.value,
4830
5094
  "onUpdate:open": unref(setOpen)
4831
5095
  }, {
4832
5096
  default: withCtx(() => [
@@ -4884,8 +5148,8 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
4884
5148
  }, [createVNode(CloseIcon_default, { class: "size-4 shrink-0" })])) : createCommentVNode("v-if", true), createVNode(ChevronIcon_default, { class: normalizeClass(unref(cn)("size-4 shrink-0 text-muted-foreground transition-transform", unref(isOpen) ? "-rotate-90" : "rotate-90")) }, null, 8, ["class"])])], 16, _hoisted_1$14)]),
4885
5149
  _: 1
4886
5150
  }),
4887
- createCommentVNode(" 弹层 Teleport 到 body:脱离表单 DOM,消除 overflow 容器裁剪隐患(DatePicker 同款) "),
4888
- (openBlock(), createBlock(Teleport, { to: "body" }, [createVNode(unref(Popover).Positioner, { class: "z-[var(--z-overlay)]" }, {
5151
+ createCommentVNode(" 弹层 Teleport:脱离表单 DOM,消除 overflow 容器裁剪隐患(DatePicker 同款);\n 目标经沙箱适配降级(shadow DOM / wujie graft → 应用挂载容器) "),
5152
+ (openBlock(), createBlock(Teleport, { to: unref(teleportTarget) }, [createVNode(unref(Popover).Positioner, { class: "z-[var(--z-overlay)]" }, {
4889
5153
  default: withCtx(() => [createVNode(unref(Popover).Content, {
4890
5154
  class: normalizeClass(unref(cn)("bg-popover text-popover-foreground z-[var(--z-overlay)] rounded-md border p-0 shadow-md outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95")),
4891
5155
  style: normalizeStyle({ minWidth: panelMinWidth.value }),
@@ -4913,10 +5177,15 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
4913
5177
  _: 1
4914
5178
  }, 8, ["class", "style"])]),
4915
5179
  _: 1
4916
- })]))
5180
+ })], 8, ["to"]))
4917
5181
  ]),
4918
5182
  _: 1
4919
- }, 8, ["open", "onUpdate:open"]);
5183
+ }, 8, [
5184
+ "ids",
5185
+ "open",
5186
+ "positioning",
5187
+ "onUpdate:open"
5188
+ ]);
4920
5189
  };
4921
5190
  }
4922
5191
  });
@@ -5530,6 +5799,18 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
5530
5799
  },
5531
5800
  emits: ["update:open"],
5532
5801
  setup(__props, { emit: __emit }) {
5802
+ const { ids: rootIds } = useOverlayIds(useAttrs(), {
5803
+ primary: "content",
5804
+ parts: [
5805
+ "content",
5806
+ "title",
5807
+ "description",
5808
+ "trigger",
5809
+ "closeTrigger",
5810
+ "positioner",
5811
+ "backdrop"
5812
+ ]
5813
+ });
5533
5814
  const props = __props;
5534
5815
  const emit = __emit;
5535
5816
  const { isOpen, setOpen } = useControlledBoolean({
@@ -5546,6 +5827,7 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
5546
5827
  const contentClass = computed(() => cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed left-1/2 top-1/2 z-[var(--z-overlay)] grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:max-w-lg", props.contentClass));
5547
5828
  return (_ctx, _cache) => {
5548
5829
  return openBlock(), createBlock(unref(Dialog).Root, {
5830
+ ids: unref(rootIds),
5549
5831
  open: unref(isOpen),
5550
5832
  "lazy-mount": props.lazyMount,
5551
5833
  "unmount-on-exit": props.unmountOnExit,
@@ -5597,6 +5879,7 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
5597
5879
  ]),
5598
5880
  _: 3
5599
5881
  }, 8, [
5882
+ "ids",
5600
5883
  "open",
5601
5884
  "lazy-mount",
5602
5885
  "unmount-on-exit",
@@ -5692,6 +5975,13 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
5692
5975
  contentClass: {
5693
5976
  type: String,
5694
5977
  default: void 0
5978
+ },
5979
+ /** Ark Menu Root 的 positioning 配置(placement/gutter 等);
5980
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
5981
+ (absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
5982
+ positioning: {
5983
+ type: Object,
5984
+ default: void 0
5695
5985
  }
5696
5986
  },
5697
5987
  emits: ["update:open", "select"],
@@ -5704,6 +5994,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
5704
5994
  defaultValue: () => props.defaultOpen,
5705
5995
  onChange: (open) => emit("update:open", open)
5706
5996
  });
5997
+ const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
5707
5998
  function handleSelect(details) {
5708
5999
  emit("select", details);
5709
6000
  }
@@ -5712,6 +6003,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
5712
6003
  open: unref(isOpen),
5713
6004
  "lazy-mount": props.lazyMount,
5714
6005
  "unmount-on-exit": props.unmountOnExit,
6006
+ positioning: rootPositioning.value,
5715
6007
  "onUpdate:open": unref(setOpen),
5716
6008
  onSelect: handleSelect
5717
6009
  }, {
@@ -5741,6 +6033,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
5741
6033
  "open",
5742
6034
  "lazy-mount",
5743
6035
  "unmount-on-exit",
6036
+ "positioning",
5744
6037
  "onUpdate:open"
5745
6038
  ]);
5746
6039
  };
@@ -5863,37 +6156,6 @@ const _sfc_main$32 = /*@__PURE__*/ defineComponent({
5863
6156
  }
5864
6157
  });
5865
6158
  //#endregion
5866
- //#region src/components/overlay-shared/sandbox.ts
5867
- /**
5868
- * 微前端沙箱探测(按渲染拓扑分派,框架无关)。
5869
- *
5870
- * 拓扑三分:
5871
- * - 同文档(无沙箱 / qiankun / micro-app light DOM / 降级 iframe):absolute 正确
5872
- * - 真 shadow DOM(web component 沙箱 / micro-app shadowDOM 模式):absolute 正确,
5873
- * 由组件的 `getRootNode() instanceof ShadowRoot` 检测命中
5874
- * - graft 型(wujie):iframe 文档树 graft 进 shadowRoot 渲染,absolute 输出视口系
5875
- * 坐标但包含块是 graft body → 错位;fixed 以最近视口为包含块,是唯一正确解
5876
- *
5877
- * 安全性论证:非 graft 拓扑下 absolute 与 fixed 坐标等价(包含块同为最近视口),
5878
- * iframe realm 下默认 fixed 零副作用;跨域 iframe 下 self/top 仅引用比较,
5879
- * 不读属性,无 SecurityError。
5880
- *
5881
- * 已知边界:
5882
- * - fixed 元素祖先有 transform/filter 时包含块被劫持(宿主布局应避免;graft 下
5883
- * absolute 的 offsetParent 解析本就失效,错法不同而非新增错误)
5884
- * - fixed 面板在祖先滚动时依赖 autoUpdate 重算,重算前一帧有视口驻留(瞬时视觉差异)
5885
- * - 若未来出现「非 iframe 的 graft 型沙箱」,本探测无法覆盖,需追加该沙箱的 marker 信号
5886
- */
5887
- /** 组件 JS 是否运行在 iframe realm(wujie / iframe 型沙箱 / 普通 iframe 嵌入) */
5888
- function isInIframeRealm() {
5889
- return typeof window !== "undefined" && window.self !== window.top;
5890
- }
5891
- /** 是否处于 wujie graft 沙箱(getRootNode/父链被 wujie patch 伪装,结构探测失效,
5892
- * 依赖官方标记;wujie 在子应用脚本执行前注入,时序可靠) */
5893
- function isInWujie() {
5894
- return typeof window !== "undefined" && window.__POWERED_BY_WUJIE__ === true;
5895
- }
5896
- //#endregion
5897
6159
  //#region src/components/popover/Popover.vue
5898
6160
  const _sfc_main$34 = /*@__PURE__*/ defineComponent({
5899
6161
  inheritAttrs: false,
@@ -6002,35 +6264,30 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
6002
6264
  const emit = __emit;
6003
6265
  const slots = useSlots();
6004
6266
  const attrs = useAttrs();
6005
- const instance = getCurrentInstance();
6006
- const inWujie = isInWujie();
6007
- const detectedTarget = ref("body");
6008
- onMounted(() => {
6009
- queueMicrotask(() => {
6010
- if (props.to) return;
6011
- const container = (instance?.appContext.app)?._container;
6012
- if (container && (container.getRootNode() instanceof ShadowRoot || inWujie)) detectedTarget.value = container;
6013
- });
6014
- });
6015
- const teleportTarget = computed(() => props.to ?? detectedTarget.value);
6267
+ const teleportTarget = useSandboxTeleportTarget(() => props.to);
6016
6268
  const { isOpen, setOpen } = useControlledBoolean({
6017
6269
  controlled: () => props.open,
6018
6270
  defaultValue: () => props.defaultOpen,
6019
6271
  onChange: (open) => emit("update:open", open)
6020
6272
  });
6021
6273
  const useNativeTrigger = computed(() => props.trigger === "click" && !props.disabled);
6022
- const contentId = useId();
6023
- const rootIds = computed(() => {
6024
- if (useNativeTrigger.value) return void 0;
6025
- return {
6026
- ...attrs.ids ?? {},
6027
- content: contentId
6028
- };
6274
+ const { ids: rootIds, resolveId } = useOverlayIds(attrs, {
6275
+ primary: "content",
6276
+ parts: [
6277
+ "content",
6278
+ "title",
6279
+ "description",
6280
+ "anchor",
6281
+ "trigger",
6282
+ "closeTrigger",
6283
+ "positioner",
6284
+ "arrow"
6285
+ ]
6029
6286
  });
6030
6287
  const anchorAria = computed(() => useNativeTrigger.value ? {} : {
6031
6288
  "aria-haspopup": "dialog",
6032
6289
  "aria-expanded": isOpen.value,
6033
- "aria-controls": contentId
6290
+ "aria-controls": resolveId("content")
6034
6291
  });
6035
6292
  let timer = null;
6036
6293
  const clearTimer = () => {
@@ -6069,17 +6326,14 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
6069
6326
  schedule(false, props.closeDelay);
6070
6327
  };
6071
6328
  onBeforeUnmount(clearTimer);
6072
- const inIframeRealm = isInIframeRealm();
6073
6329
  const rootPositioning = computed(() => {
6074
6330
  const user = attrs.positioning ?? {};
6075
6331
  const placement = props.align === "center" ? props.side : `${props.side}-${props.align}`;
6076
- const merged = {
6332
+ return withSandboxStrategy(user, {
6077
6333
  ...user,
6078
6334
  placement,
6079
6335
  sameWidth: props.matchTriggerWidth || user.sameWidth
6080
- };
6081
- if (inIframeRealm && user.strategy == null) merged.strategy = "fixed";
6082
- return merged;
6336
+ });
6083
6337
  });
6084
6338
  const contentClass = computed(() => cn("bg-popover text-popover-foreground z-[var(--z-overlay)] w-72 rounded-md border p-4 shadow-md outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", props.contentClass, props.contentProps?.["class"]));
6085
6339
  const arrowClass = computed(() => cn("[--arrow-size:10px] [--arrow-background:var(--popover)]", props.arrowClass));
@@ -6089,7 +6343,7 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
6089
6343
  return openBlock(), createBlock(unref(Popover).Root, mergeProps(unref(attrs), {
6090
6344
  open: unref(isOpen),
6091
6345
  positioning: rootPositioning.value,
6092
- ids: rootIds.value,
6346
+ ids: unref(rootIds),
6093
6347
  "lazy-mount": props.lazyMount,
6094
6348
  "unmount-on-exit": props.unmountOnExit,
6095
6349
  "onUpdate:open": unref(setOpen)
@@ -6113,7 +6367,7 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
6113
6367
  }, 16)], 2112)) : createCommentVNode("v-if", true),
6114
6368
  createCommentVNode(" portal:Teleport(Ark Vue 原语不自带传送,浮层定位不受嵌套 overflow 裁剪影响);\n portal=false 时 disabled Teleport 面板留在原地;to 显式指定目标,\n 缺省时真 shadow DOM(getRootNode 检测)与 wujie graft(marker 检测)沙箱\n 自动降级为应用挂载容器,避免传送出 shadow root "),
6115
6369
  (openBlock(), createBlock(Teleport, {
6116
- to: teleportTarget.value,
6370
+ to: unref(teleportTarget),
6117
6371
  disabled: !props.portal
6118
6372
  }, [createVNode(unref(Popover).Positioner, {
6119
6373
  class: normalizeClass(positionerClass.value),
@@ -6506,10 +6760,26 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
6506
6760
  contentProps: {
6507
6761
  type: Object,
6508
6762
  default: void 0
6763
+ },
6764
+ /** Ark Tooltip Root 的 positioning 配置(placement/gutter 等);
6765
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
6766
+ (absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
6767
+ positioning: {
6768
+ type: Object,
6769
+ default: void 0
6509
6770
  }
6510
6771
  },
6511
6772
  emits: ["update:open"],
6512
6773
  setup(__props, { emit: __emit }) {
6774
+ const { ids: rootIds } = useOverlayIds(useAttrs(), {
6775
+ primary: "content",
6776
+ parts: [
6777
+ "content",
6778
+ "trigger",
6779
+ "positioner",
6780
+ "arrow"
6781
+ ]
6782
+ });
6513
6783
  const props = __props;
6514
6784
  const emit = __emit;
6515
6785
  const slots = useSlots();
@@ -6518,13 +6788,16 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
6518
6788
  defaultValue: () => props.defaultOpen,
6519
6789
  onChange: (open) => emit("update:open", open)
6520
6790
  });
6791
+ const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
6521
6792
  return (_ctx, _cache) => {
6522
6793
  return openBlock(), createBlock(unref(Tooltip).Root, {
6794
+ ids: unref(rootIds),
6523
6795
  open: unref(isOpen),
6524
6796
  "open-delay": props.delayDuration,
6525
6797
  "close-delay": props.closeDuration,
6526
6798
  "lazy-mount": props.lazyMount,
6527
6799
  "unmount-on-exit": props.unmountOnExit,
6800
+ positioning: rootPositioning.value,
6528
6801
  "onUpdate:open": unref(setOpen)
6529
6802
  }, {
6530
6803
  default: withCtx(() => [
@@ -6546,11 +6819,13 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
6546
6819
  ]),
6547
6820
  _: 3
6548
6821
  }, 8, [
6822
+ "ids",
6549
6823
  "open",
6550
6824
  "open-delay",
6551
6825
  "close-delay",
6552
6826
  "lazy-mount",
6553
6827
  "unmount-on-exit",
6828
+ "positioning",
6554
6829
  "onUpdate:open"
6555
6830
  ]);
6556
6831
  };
@@ -6560,6 +6835,8 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
6560
6835
  //#region src/components/table-render/constants.ts
6561
6836
  /** 选择列在 sticky 映射中的哨兵键(选择列不在 columns 内,表头/表体单独渲染) */
6562
6837
  const SELECTION_CELL = "__selection__";
6838
+ /** 布局容器与 TableRender 的跨包填充协议 key:provide(true) 声明容器内 TableRender 应填满、内部滚动、表头固定 */
6839
+ const PAGE_TABLE_FILL_KEY = "tu-design:page-table-fill";
6563
6840
  //#endregion
6564
6841
  //#region src/components/table-render/sticky.ts
6565
6842
  /** sticky 定位样式;head 为 true 时 z-index 高于表体(表头压住表体 sticky) */
@@ -7119,16 +7396,12 @@ function useTableRender(options) {
7119
7396
  }
7120
7397
  //#endregion
7121
7398
  //#region src/components/table-render/TableRender.vue
7122
- const _hoisted_1$8 = {
7123
- key: 0,
7124
- class: "mb-2 flex items-end justify-between gap-2"
7125
- };
7126
- const _hoisted_2$7 = { class: "flex items-center justify-end gap-3 px-3 py-2" };
7127
- const _hoisted_3$4 = ["disabled"];
7128
- const _hoisted_4$2 = { class: "max-h-64 overflow-y-auto py-1" };
7129
- const _hoisted_5$1 = ["data-column-key", "onClick"];
7130
- const _hoisted_6$1 = { class: "min-w-0 flex-1 truncate" };
7131
- const _hoisted_7$1 = {
7399
+ const _hoisted_1$8 = { class: "flex items-center justify-end gap-3 px-3 py-2" };
7400
+ const _hoisted_2$7 = ["disabled"];
7401
+ const _hoisted_3$4 = { class: "max-h-64 overflow-y-auto py-1" };
7402
+ const _hoisted_4$2 = ["data-column-key", "onClick"];
7403
+ const _hoisted_5$1 = { class: "min-w-0 flex-1 truncate" };
7404
+ const _hoisted_6$1 = {
7132
7405
  key: 0,
7133
7406
  xmlns: "http://www.w3.org/2000/svg",
7134
7407
  viewBox: "0 0 24 24",
@@ -7140,24 +7413,23 @@ const _hoisted_7$1 = {
7140
7413
  class: "text-muted-foreground size-3 shrink-0",
7141
7414
  "aria-hidden": "true"
7142
7415
  };
7143
- const _hoisted_8 = { class: "w-full caption-bottom text-sm" };
7144
- const _hoisted_9 = ["aria-sort"];
7145
- const _hoisted_10 = ["onClick"];
7146
- const _hoisted_11 = {
7416
+ const _hoisted_7$1 = ["aria-sort"];
7417
+ const _hoisted_8 = ["onClick"];
7418
+ const _hoisted_9 = {
7147
7419
  "aria-hidden": "true",
7148
7420
  class: "text-xs"
7149
7421
  };
7150
- const _hoisted_12 = { class: "[&_tr:last-child]:border-0" };
7151
- const _hoisted_13 = { "data-error": "" };
7422
+ const _hoisted_10 = { class: "[&_tr:last-child]:border-0" };
7423
+ const _hoisted_11 = { "data-error": "" };
7424
+ const _hoisted_12 = ["colspan"];
7425
+ const _hoisted_13 = { class: "flex flex-col items-center gap-3" };
7152
7426
  const _hoisted_14 = ["colspan"];
7153
- const _hoisted_15 = { class: "flex flex-col items-center gap-3" };
7154
- const _hoisted_16 = ["colspan"];
7155
- const _hoisted_17 = ["colspan"];
7156
- const _hoisted_18 = {
7427
+ const _hoisted_15 = ["colspan"];
7428
+ const _hoisted_16 = {
7157
7429
  key: 4,
7158
7430
  "data-empty": ""
7159
7431
  };
7160
- const _hoisted_19 = ["colspan"];
7432
+ const _hoisted_17 = ["colspan"];
7161
7433
  const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7162
7434
  __name: "TableRender",
7163
7435
  props: {
@@ -7224,6 +7496,14 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7224
7496
  showPagination: {
7225
7497
  type: Boolean,
7226
7498
  default: void 0
7499
+ },
7500
+ /** 填充模式:根容器 h-full 纵向 flex,滚动区 flex-1 内滚;表头 sticky 钉住。
7501
+ * 父链需有确定高度(如页面布局的 .table-body);无确定高度时安全退化为自然高度。
7502
+ * 显式 prop 优先于布局 provide(key: "tu-design:page-table-fill");显式传 false 可强制关闭。
7503
+ * 纯布局属性,不进 defineTable/definition(virtual/height 例外),setup 期定版不支持运行时切换。 */
7504
+ fillHeight: {
7505
+ type: Boolean,
7506
+ default: void 0
7227
7507
  }
7228
7508
  },
7229
7509
  emits: [
@@ -7244,6 +7524,8 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7244
7524
  ],
7245
7525
  setup(__props, { expose: __expose, emit: __emit }) {
7246
7526
  const props = __props;
7527
+ const pageTableFill = inject(PAGE_TABLE_FILL_KEY, false);
7528
+ const fill = props.fillHeight ?? pageTableFill;
7247
7529
  const emit = __emit;
7248
7530
  /** 加载态骨架行数(R14) */
7249
7531
  const SKELETON_ROWS = [
@@ -7353,6 +7635,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7353
7635
  /** 总列数 = 可见业务列 + 选择列(空态 colspan 与骨架行,S8/R23) */
7354
7636
  const columnCount = computed(() => visibleColumns.value.length + (hasSelection.value ? 1 : 0));
7355
7637
  for (const column of columns.value) if (column.fixed !== void 0 && typeof column.width !== "number") console.warn(`[tu-design] <TableRender> fixed 列 "${column.key}" 需要数字 width,已忽略 fixed。`);
7638
+ if (columns.value.length >= 10 && !columns.value.some((c) => typeof c.width === "number")) console.warn(`[tu-design] <TableRender> ${columns.value.length} 列均无数字 width,窄容器下不会出现横向滚动(R32);宽表请为列声明数字 width(px)。`);
7356
7639
  /** sticky 单元格映射(纯渲染层 computed,不进 TanStack pinning state):
7357
7640
  * 选择列视作最左 fixed 列参与累计(offset 0);fixed-left 按列序累加,
7358
7641
  * fixed-right 从最右列反向累计。edge = 该 sticky 组朝滚动方向的交界列(加分隔边框)。
@@ -7397,6 +7680,12 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7397
7680
  }
7398
7681
  return map;
7399
7682
  });
7683
+ const tableMinWidth = computed(() => {
7684
+ let sum = 0;
7685
+ for (const column of visibleColumns.value) if (typeof column.width === "number" && column.width > 0) sum += column.width;
7686
+ if (hasSelection.value && selection.value.width > 0) sum += selection.value.width;
7687
+ return sum;
7688
+ });
7400
7689
  /** 表头全选三态(S10):本页可选行与选中集求交派生(TanStack getter 追踪不稳,自算) */
7401
7690
  const selectableKeys = computed(() => rows.value.filter((row) => row.getCanSelect()).map((row) => rowKeyOf(row.original, row.index)));
7402
7691
  const headerChecked = computed(() => hasSelection.value && selection.value.type === "checkbox" && selectableKeys.value.length > 0 && selectableKeys.value.every((key) => selectedKeys.value.has(key)));
@@ -7448,9 +7737,27 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7448
7737
  }
7449
7738
  const virtualRaw = instance.virtual ?? props.virtual;
7450
7739
  const heightRaw = instance.height ?? props.height;
7451
- if (virtualRaw === true && heightRaw === void 0) console.warn("[tu-design] <TableRender> virtual 需要配置 height,已降级普通渲染。");
7452
- const virtualEnabled = virtualRaw === true && heightRaw !== void 0;
7740
+ if (virtualRaw === true && heightRaw === void 0 && !fill) console.warn("[tu-design] <TableRender> virtual 需要配置 height,已降级普通渲染。");
7741
+ const virtualEnabled = virtualRaw === true && (heightRaw !== void 0 || fill);
7453
7742
  const scrollHeight = computed(() => typeof heightRaw === "number" ? `${heightRaw}px` : heightRaw);
7743
+ /** 表头 sticky 仅在组件内存在真实纵向滚动盒时生效(fill / virtual),普通模式不挂载,行为不变 */
7744
+ const theadSticky = fill || virtualEnabled;
7745
+ /** 滚动区样式:virtual 用固定 height;fill 交给 flex 分配(二者同传以 fill 优先) */
7746
+ const scrollStyle = computed(() => {
7747
+ if (fill || !virtualEnabled) return void 0;
7748
+ return {
7749
+ height: scrollHeight.value,
7750
+ overflowY: "auto"
7751
+ };
7752
+ });
7753
+ /** sticky 表头普通列类:不透明底防行内容透出;分隔线归 th(thead 行级 border 会随行滚走);
7754
+ * z-20 高于表体 fixed 列(--z-sticky: 10),纵向滚动行滑过表头时不穿透;
7755
+ * 表头 fixed 列的 z 由 stickyStyle inline style(var(--z-sticky-head))提供,inline 优先级天然覆盖此处 class */
7756
+ const theadThClass = theadSticky ? "sticky top-0 z-20 border-b border-border bg-background" : "";
7757
+ /** sticky 态 table 改分离边框:preflight 为 border-collapse: collapse,
7758
+ * 折叠边框几何归属 table,Chrome 下 sticky th 粘住后自身 border-b 渲染丢失;
7759
+ * separate + spacing-0 恢复单元格边框。普通模式保持 collapse,零回归。 */
7760
+ const tableClass = theadSticky ? "border-separate border-spacing-0" : "";
7454
7761
  const scrollEl = ref(null);
7455
7762
  const theadEl = ref(null);
7456
7763
  /** 滚动容器内 thead 占据的前缀高度(scrollMargin);表头内容静态,挂载后测量一次 */
@@ -7552,9 +7859,12 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7552
7859
  clearSelection: instance.clearSelection
7553
7860
  });
7554
7861
  return (_ctx, _cache) => {
7555
- return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("w-full", _ctx.$attrs.class)) }, [
7862
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("w-full", unref(fill) && "flex h-full min-h-0 flex-col", _ctx.$attrs.class)) }, [
7556
7863
  createCommentVNode(" 搜索区 + 列设置触发器:同行右对齐(items-end);无搜索时触发器位于表格上方(R27:showSearch=false 关闭搜索区) "),
7557
- showSearchArea.value || showColumnSettings.value ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
7864
+ showSearchArea.value || showColumnSettings.value ? (openBlock(), createElementBlock("div", {
7865
+ key: 0,
7866
+ class: normalizeClass(unref(cn)("mb-2 flex items-end justify-between gap-2", unref(fill) && "shrink-0"))
7867
+ }, [
7558
7868
  showSearchArea.value ? (openBlock(), createBlock(unref(_sfc_main$25), {
7559
7869
  key: 0,
7560
7870
  class: "min-w-0 flex-1",
@@ -7570,18 +7880,18 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7570
7880
  "content-class": "w-56 p-0"
7571
7881
  }, {
7572
7882
  content: withCtx(() => [
7573
- createElementVNode("div", _hoisted_2$7, [createElementVNode("button", {
7883
+ createElementVNode("div", _hoisted_1$8, [createElementVNode("button", {
7574
7884
  type: "button",
7575
7885
  class: "text-muted-foreground hover:text-foreground cursor-pointer text-xs disabled:cursor-not-allowed disabled:opacity-50",
7576
7886
  disabled: allColumnsVisible.value,
7577
7887
  onClick: selectAllColumns
7578
- }, " 全选 ", 8, _hoisted_3$4), createElementVNode("button", {
7888
+ }, " 全选 ", 8, _hoisted_2$7), createElementVNode("button", {
7579
7889
  type: "button",
7580
7890
  class: "text-muted-foreground hover:text-foreground cursor-pointer text-xs",
7581
7891
  onClick: resetColumns
7582
7892
  }, " 重置 ")]),
7583
7893
  createVNode(unref(_sfc_main$38)),
7584
- createElementVNode("div", _hoisted_4$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
7894
+ createElementVNode("div", _hoisted_3$4, [(openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
7585
7895
  return openBlock(), createElementBlock("div", {
7586
7896
  key: column.key,
7587
7897
  "data-column-item": "",
@@ -7599,10 +7909,10 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7599
7909
  "disabled",
7600
7910
  "onUpdate:checked"
7601
7911
  ]),
7602
- createElementVNode("span", _hoisted_6$1, toDisplayString(column.title), 1),
7912
+ createElementVNode("span", _hoisted_5$1, toDisplayString(column.title), 1),
7603
7913
  createCommentVNode(" 有效 fixed 列(数字 width)标识 "),
7604
- column.fixed !== void 0 && typeof column.width === "number" ? (openBlock(), createElementBlock("svg", _hoisted_7$1, [..._cache[4] || (_cache[4] = [createElementVNode("path", { d: "M12 17v5" }, null, -1), createElementVNode("path", { d: "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1z" }, null, -1)])])) : createCommentVNode("v-if", true)
7605
- ], 8, _hoisted_5$1);
7914
+ column.fixed !== void 0 && typeof column.width === "number" ? (openBlock(), createElementBlock("svg", _hoisted_6$1, [..._cache[4] || (_cache[4] = [createElementVNode("path", { d: "M12 17v5" }, null, -1), createElementVNode("path", { d: "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1z" }, null, -1)])])) : createCommentVNode("v-if", true)
7915
+ ], 8, _hoisted_4$2);
7606
7916
  }), 128))])
7607
7917
  ]),
7608
7918
  default: withCtx(() => [createVNode(unref(_sfc_main$5), {
@@ -7647,26 +7957,26 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7647
7957
  content: "列设置"
7648
7958
  }, null, 8, ["open"])
7649
7959
  ], 64)) : createCommentVNode("v-if", true)
7650
- ])) : createCommentVNode("v-if", true),
7651
- createCommentVNode(" 滚动容器:横向滚动时 fixed 列 sticky 生效;virtual 模式兼任纵向滚动(分页条不参与滚动) "),
7960
+ ], 2)) : createCommentVNode("v-if", true),
7961
+ createCommentVNode(" 滚动容器:横向滚动时 fixed 列 sticky 生效;virtual/fill 模式兼任纵向滚动(分页条不参与滚动) "),
7652
7962
  createElementVNode("div", {
7653
7963
  ref_key: "scrollEl",
7654
7964
  ref: scrollEl,
7655
- class: "overflow-x-auto",
7656
- style: normalizeStyle(unref(virtualEnabled) ? {
7657
- height: scrollHeight.value,
7658
- overflowY: "auto"
7659
- } : void 0)
7660
- }, [createElementVNode("table", _hoisted_8, [createElementVNode("thead", {
7965
+ class: normalizeClass(unref(cn)("overflow-x-auto", unref(fill) && "min-h-0 flex-1 overflow-y-auto")),
7966
+ style: normalizeStyle(scrollStyle.value)
7967
+ }, [createElementVNode("table", {
7968
+ class: normalizeClass(["w-full caption-bottom text-sm", unref(tableClass)]),
7969
+ style: normalizeStyle(tableMinWidth.value > 0 ? { minWidth: `${tableMinWidth.value}px` } : void 0)
7970
+ }, [createElementVNode("thead", {
7661
7971
  ref_key: "theadEl",
7662
7972
  ref: theadEl,
7663
- class: "[&_tr]:border-b"
7973
+ class: normalizeClass(unref(theadSticky) ? void 0 : "[&_tr]:border-b")
7664
7974
  }, [createElementVNode("tr", null, [
7665
7975
  createCommentVNode(" 选择列:checkbox 型表头为本页全选三态(S3/S10);radio 型占位;视作最左固定列 "),
7666
7976
  hasSelection.value ? (openBlock(), createElementBlock("th", {
7667
7977
  key: 0,
7668
7978
  scope: "col",
7669
- class: normalizeClass(["h-10 w-12 px-2 align-middle font-medium text-muted-foreground", unref(stickyClass)(stickyOf.value, unref(SELECTION_CELL))]),
7979
+ class: normalizeClass(["h-10 w-12 px-2 align-middle font-medium text-muted-foreground", [unref(stickyClass)(stickyOf.value, unref(SELECTION_CELL)), unref(theadThClass)]]),
7670
7980
  style: normalizeStyle([{ width: `${selection.value.width}px` }, unref(stickyStyle)(stickyOf.value, unref(SELECTION_CELL), true)])
7671
7981
  }, [selection.value.type === "checkbox" ? (openBlock(), createBlock(unref(_sfc_main$9), {
7672
7982
  key: 0,
@@ -7678,7 +7988,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7678
7988
  return openBlock(), createElementBlock("th", {
7679
7989
  key: column.key,
7680
7990
  scope: "col",
7681
- class: normalizeClass(["h-10 px-2 align-middle font-medium text-muted-foreground", unref(stickyClass)(stickyOf.value, column.key)]),
7991
+ class: normalizeClass(["h-10 px-2 align-middle font-medium text-muted-foreground", [unref(stickyClass)(stickyOf.value, column.key), unref(theadThClass)]]),
7682
7992
  style: normalizeStyle([{
7683
7993
  width: column.width,
7684
7994
  textAlign: column.align
@@ -7689,9 +7999,9 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7689
7999
  type: "button",
7690
8000
  class: "inline-flex items-center gap-1 hover:text-foreground",
7691
8001
  onClick: ($event) => onSort(column.key)
7692
- }, [createTextVNode(toDisplayString(column.title) + " ", 1), createElementVNode("span", _hoisted_11, toDisplayString(sortMark(column)), 1)], 8, _hoisted_10)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(column.title), 1)], 64))], 14, _hoisted_9);
8002
+ }, [createTextVNode(toDisplayString(column.title) + " ", 1), createElementVNode("span", _hoisted_9, toDisplayString(sortMark(column)), 1)], 8, _hoisted_8)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(column.title), 1)], 64))], 14, _hoisted_7$1);
7693
8003
  }), 128))
7694
- ])], 512), createElementVNode("tbody", _hoisted_12, [
8004
+ ])], 2), createElementVNode("tbody", _hoisted_10, [
7695
8005
  createCommentVNode(" 加载态:固定 5 行骨架(R14);选择列一并占位(S8);骨架不虚拟化;loading 判定优先 "),
7696
8006
  loading.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList(SKELETON_ROWS, (row) => {
7697
8007
  return createElementVNode("tr", {
@@ -7708,20 +8018,20 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7708
8018
  style: normalizeStyle([{ textAlign: column.align }, unref(stickyStyle)(stickyOf.value, column.key, false)])
7709
8019
  }, [createVNode(unref(_sfc_main$39), { class: "h-4 w-full" })], 6);
7710
8020
  }), 128))]);
7711
- }), 64)) : showError.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 错误态:error 优先于正常数据;插槽可自定义(slot props { error, retry }) "), createElementVNode("tr", _hoisted_13, [createElementVNode("td", {
8021
+ }), 64)) : showError.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 错误态:error 优先于正常数据;插槽可自定义(slot props { error, retry }) "), createElementVNode("tr", _hoisted_11, [createElementVNode("td", {
7712
8022
  colspan: columnCount.value,
7713
8023
  class: "p-8 text-center text-muted-foreground"
7714
8024
  }, [renderSlot(_ctx.$slots, "error", {
7715
8025
  error: loadError.value,
7716
8026
  retry
7717
- }, () => [createElementVNode("div", _hoisted_15, [createElementVNode("p", null, toDisplayString(loadError.value?.message ?? "加载失败"), 1), createVNode(unref(_sfc_main$5), {
8027
+ }, () => [createElementVNode("div", _hoisted_13, [createElementVNode("p", null, toDisplayString(loadError.value?.message ?? "加载失败"), 1), createVNode(unref(_sfc_main$5), {
7718
8028
  variant: "outline",
7719
8029
  size: "sm",
7720
8030
  onClick: retry
7721
8031
  }, {
7722
8032
  default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("重试", -1)])]),
7723
8033
  _: 1
7724
- })])])], 8, _hoisted_14)])], 64)) : unref(virtualEnabled) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
8034
+ })])])], 8, _hoisted_12)])], 64)) : unref(virtualEnabled) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
7725
8035
  createCommentVNode(" 虚拟滚动:窗口行 + 前后占位行(总高撑开滚动区间;行高经 measureElement 动态测量) "),
7726
8036
  createElementVNode("tr", {
7727
8037
  "aria-hidden": "true",
@@ -7730,7 +8040,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7730
8040
  }, [createElementVNode("td", {
7731
8041
  colspan: columnCount.value,
7732
8042
  class: "border-0 p-0"
7733
- }, null, 8, _hoisted_16)], 4),
8043
+ }, null, 8, _hoisted_14)], 4),
7734
8044
  (openBlock(true), createElementBlock(Fragment, null, renderList(virtualLines.value, (item) => {
7735
8045
  return openBlock(), createBlock(_sfc_main$53, {
7736
8046
  key: item.line.key,
@@ -7770,7 +8080,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7770
8080
  }, [createElementVNode("td", {
7771
8081
  colspan: columnCount.value,
7772
8082
  class: "border-0 p-0"
7773
- }, null, 8, _hoisted_17)], 4)
8083
+ }, null, 8, _hoisted_15)], 4)
7774
8084
  ], 64)) : (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(body.value, (line) => {
7775
8085
  return openBlock(), createBlock(_sfc_main$53, {
7776
8086
  key: line.key,
@@ -7800,15 +8110,15 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7800
8110
  ]);
7801
8111
  }), 128)),
7802
8112
  createCommentVNode(" 空态:横跨全列的单单元格,不虚拟化;错误态优先 "),
7803
- !loading.value && !showError.value && body.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_18, [createElementVNode("td", {
8113
+ !loading.value && !showError.value && body.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_16, [createElementVNode("td", {
7804
8114
  colspan: columnCount.value,
7805
8115
  class: "p-8 text-center text-muted-foreground"
7806
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText ?? "暂无数据"), 1)])], 8, _hoisted_19)])) : createCommentVNode("v-if", true)
7807
- ])])], 4),
8116
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText ?? "暂无数据"), 1)])], 8, _hoisted_17)])) : createCommentVNode("v-if", true)
8117
+ ])], 6)], 6),
7808
8118
  createCommentVNode(" R31:手动接线(须经 onPageIndex/onPageSize 包装器保留受控去重);显式补 border-t 与 size select 保持现状 "),
7809
8119
  showPaginationBar.value ? (openBlock(), createBlock(_sfc_main$43, {
7810
8120
  key: 1,
7811
- class: "border-t",
8121
+ class: normalizeClass(unref(cn)("border-t", unref(fill) && "shrink-0")),
7812
8122
  "page-index": unref(instance).page.pageIndex,
7813
8123
  "page-size": unref(instance).page.pageSize,
7814
8124
  "page-size-opts": unref(instance).page.pageSizeOpts,
@@ -7817,6 +8127,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
7817
8127
  "onUpdate:pageIndex": onPageIndex,
7818
8128
  "onUpdate:pageSize": onPageSize
7819
8129
  }, null, 8, [
8130
+ "class",
7820
8131
  "page-index",
7821
8132
  "page-size",
7822
8133
  "page-size-opts",
@@ -8628,6 +8939,18 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
8628
8939
  "cancel"
8629
8940
  ],
8630
8941
  setup(__props, { emit: __emit }) {
8942
+ const { ids: rootIds } = useOverlayIds(useAttrs(), {
8943
+ primary: "content",
8944
+ parts: [
8945
+ "content",
8946
+ "title",
8947
+ "description",
8948
+ "trigger",
8949
+ "closeTrigger",
8950
+ "positioner",
8951
+ "backdrop"
8952
+ ]
8953
+ });
8631
8954
  const props = __props;
8632
8955
  const emit = __emit;
8633
8956
  const instance = getCurrentInstance();
@@ -8652,6 +8975,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
8652
8975
  const contentClass = computed(() => cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed left-1/2 top-1/2 z-[var(--z-overlay)] grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:max-w-md"));
8653
8976
  return (_ctx, _cache) => {
8654
8977
  return openBlock(), createBlock(unref(Dialog).Root, {
8978
+ ids: unref(rootIds),
8655
8979
  open: unref(isOpen),
8656
8980
  "close-on-escape": !unref(loading),
8657
8981
  "close-on-interact-outside": !unref(loading),
@@ -8703,6 +9027,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
8703
9027
  })]),
8704
9028
  _: 3
8705
9029
  }, 8, [
9030
+ "ids",
8706
9031
  "open",
8707
9032
  "close-on-escape",
8708
9033
  "close-on-interact-outside"
@@ -8717,12 +9042,20 @@ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
8717
9042
  name: "ContextMenu",
8718
9043
  inheritAttrs: false,
8719
9044
  __name: "ContextMenu",
8720
- props: {
8721
- /** 菜单项描述列表,与 DropdownMenu 的 items 完全同构(item/label/separator/group 四种形态,group 可嵌套) */
8722
- items: {
8723
- type: Array,
8724
- required: true
8725
- } },
9045
+ props: {
9046
+ /** 菜单项描述列表,与 DropdownMenu 的 items 完全同构(item/label/separator/group 四种形态,group 可嵌套) */
9047
+ items: {
9048
+ type: Array,
9049
+ required: true
9050
+ },
9051
+ /** Ark Menu Root 的 positioning 配置(gutter 等;placement 由指针 anchorPoint 驱动);
9052
+ iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
9053
+ (absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
9054
+ positioning: {
9055
+ type: Object,
9056
+ default: void 0
9057
+ }
9058
+ },
8726
9059
  emits: ["select"],
8727
9060
  setup(__props, { emit: __emit }) {
8728
9061
  const props = __props;
@@ -8731,8 +9064,12 @@ items: {
8731
9064
  function handleSelect(details) {
8732
9065
  emit("select", details);
8733
9066
  }
9067
+ const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
8734
9068
  return (_ctx, _cache) => {
8735
- return openBlock(), createBlock(unref(Menu).Root, { onSelect: handleSelect }, {
9069
+ return openBlock(), createBlock(unref(Menu).Root, {
9070
+ positioning: rootPositioning.value,
9071
+ onSelect: handleSelect
9072
+ }, {
8736
9073
  default: withCtx(() => [
8737
9074
  createCommentVNode(" 默认插槽 = 触发元素本身(ContextTrigger as-child 透传,右键唤出并定位到指针处) "),
8738
9075
  createVNode(unref(Menu).ContextTrigger, { "as-child": "" }, {
@@ -8748,7 +9085,7 @@ items: {
8748
9085
  })
8749
9086
  ]),
8750
9087
  _: 3
8751
- });
9088
+ }, 8, ["positioning"]);
8752
9089
  };
8753
9090
  }
8754
9091
  });
@@ -8813,6 +9150,22 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
8813
9150
  },
8814
9151
  emits: ["update:open"],
8815
9152
  setup(__props, { emit: __emit }) {
9153
+ const { ids: rootIds } = useOverlayIds(useAttrs(), {
9154
+ primary: "content",
9155
+ parts: [
9156
+ "content",
9157
+ "title",
9158
+ "description",
9159
+ "trigger",
9160
+ "closeTrigger",
9161
+ "positioner",
9162
+ "backdrop",
9163
+ "header",
9164
+ "grabber",
9165
+ "grabberIndicator",
9166
+ "swipeArea"
9167
+ ]
9168
+ });
8816
9169
  const props = __props;
8817
9170
  const emit = __emit;
8818
9171
  const { isOpen, setOpen } = useControlledBoolean({
@@ -8874,6 +9227,7 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
8874
9227
  const contentClass = computed(() => cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-[var(--z-overlay)] flex flex-col gap-4 overflow-y-auto p-6 shadow-lg duration-200", config.value.content, isLateral.value ? cn("w-full", config.value.sizes[props.size]) : cn("h-full", config.value.sizes[props.size]), placementAnimations[props.placement]));
8875
9228
  return (_ctx, _cache) => {
8876
9229
  return openBlock(), createBlock(unref(Drawer).Root, {
9230
+ ids: unref(rootIds),
8877
9231
  open: unref(isOpen),
8878
9232
  "lazy-mount": props.lazyMount,
8879
9233
  "unmount-on-exit": props.unmountOnExit,
@@ -8922,6 +9276,7 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
8922
9276
  ]),
8923
9277
  _: 3
8924
9278
  }, 8, [
9279
+ "ids",
8925
9280
  "open",
8926
9281
  "lazy-mount",
8927
9282
  "unmount-on-exit",
@@ -9282,4 +9637,4 @@ const timelineDotVariants = cva("relative z-10 mt-1 block shrink-0 rounded-full"
9282
9637
  }
9283
9638
  });
9284
9639
  //#endregion
9285
- export { _sfc_main as Alert, _sfc_main$1 as AlertDialog, _sfc_main$2 as Avatar, _sfc_main$3 as AvatarGroup, _sfc_main$4 as Badge, _sfc_main$5 as Button, CHECKED, COMPONENT_NAMES, _sfc_main$6 as Calendar, _sfc_main$7 as Card, _sfc_main$8 as Cascader, _sfc_main$9 as Checkbox, _sfc_main$10 as ContextMenu, _sfc_main$11 as CurrencyInput, _sfc_main$12 as DatePicker, _sfc_main$13 as DateRangePicker, _sfc_main$14 as Dialog, _sfc_main$15 as Drawer, _sfc_main$16 as DropdownMenu, _sfc_main$17 as Empty, _sfc_main$18 as Form, _sfc_main$19 as FormControl, _sfc_main$20 as FormDescription, _sfc_main$21 as FormField, _sfc_main$22 as FormItem, _sfc_main$23 as FormLabel, _sfc_main$24 as FormMessage, _sfc_main$25 as FormRender, _sfc_main$26 as FormSubscribe, _sfc_main$27 as Input, _sfc_main$28 as Label, MODEL_VALUE, _sfc_main$29 as MonthPicker, _sfc_main$30 as NumberInput, _sfc_main$31 as PasswordInput, _sfc_main$32 as PinInput, _sfc_main$33 as Popconfirm, _sfc_main$34 as Popover, _sfc_main$35 as Progress, _sfc_main$36 as RadioGroup, SLIDER, _sfc_main$37 as Select, _sfc_main$38 as Separator, _sfc_main$39 as Skeleton, _sfc_main$40 as Slider, Slot, _sfc_main$41 as Spin, _sfc_main$42 as Switch, _sfc_main$43 as TablePagination, _sfc_main$44 as TableRender, _sfc_main$45 as Tabs, _sfc_main$46 as Textarea, _sfc_main$47 as Timeline, _sfc_main$48 as ToastProvider, _sfc_main$49 as Tooltip, _sfc_main$50 as TreeSelect, TuDesignResolver, VALUE, _sfc_main$51 as WeekPicker, _sfc_main$52 as YearPicker, alertIconPaths, alertIconVariants, alertVariants, avatarGroupKey, avatarVariants, badgeVariants, bindField, buttonVariants, cardVariants, cn, columnRenders, defineColumns, defineForm, defineTable, formatCurrency, numberOrNull, parseCurrency, timelineDotVariants, timelineItemVariants, timelineVariants, useFormRender, useTableRender, useToast, widgetRenders };
9640
+ export { _sfc_main as Alert, _sfc_main$1 as AlertDialog, _sfc_main$2 as Avatar, _sfc_main$3 as AvatarGroup, _sfc_main$4 as Badge, _sfc_main$5 as Button, CHECKED, COMPONENT_NAMES, _sfc_main$6 as Calendar, _sfc_main$7 as Card, _sfc_main$8 as Cascader, _sfc_main$9 as Checkbox, _sfc_main$10 as ContextMenu, _sfc_main$11 as CurrencyInput, _sfc_main$12 as DatePicker, _sfc_main$13 as DateRangePicker, _sfc_main$14 as Dialog, _sfc_main$15 as Drawer, _sfc_main$16 as DropdownMenu, _sfc_main$17 as Empty, _sfc_main$18 as Form, _sfc_main$19 as FormControl, _sfc_main$20 as FormDescription, _sfc_main$21 as FormField, _sfc_main$22 as FormItem, _sfc_main$23 as FormLabel, _sfc_main$24 as FormMessage, _sfc_main$25 as FormRender, _sfc_main$26 as FormSubscribe, _sfc_main$27 as Input, _sfc_main$28 as Label, MODEL_VALUE, _sfc_main$29 as MonthPicker, _sfc_main$30 as NumberInput, PAGE_TABLE_FILL_KEY, _sfc_main$31 as PasswordInput, _sfc_main$32 as PinInput, _sfc_main$33 as Popconfirm, _sfc_main$34 as Popover, _sfc_main$35 as Progress, _sfc_main$36 as RadioGroup, SLIDER, _sfc_main$37 as Select, _sfc_main$38 as Separator, _sfc_main$39 as Skeleton, _sfc_main$40 as Slider, Slot, _sfc_main$41 as Spin, _sfc_main$42 as Switch, _sfc_main$43 as TablePagination, _sfc_main$44 as TableRender, _sfc_main$45 as Tabs, _sfc_main$46 as Textarea, _sfc_main$47 as Timeline, _sfc_main$48 as ToastProvider, _sfc_main$49 as Tooltip, _sfc_main$50 as TreeSelect, TuDesignResolver, VALUE, _sfc_main$51 as WeekPicker, _sfc_main$52 as YearPicker, alertIconPaths, alertIconVariants, alertVariants, avatarGroupKey, avatarVariants, badgeVariants, bindField, buttonVariants, cardVariants, cn, columnRenders, defineColumns, defineForm, defineTable, formatCurrency, numberOrNull, parseCurrency, timelineDotVariants, timelineItemVariants, timelineVariants, useFormRender, useTableRender, useToast, widgetRenders };