@tu-design/vue 0.5.2 → 0.5.5
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/index.d.mts +533 -181
- package/dist/index.mjs +790 -264
- package/dist/registry/vue/alert-dialog.json +2 -2
- package/dist/registry/vue/alert.json +1 -1
- package/dist/registry/vue/avatar-group.json +1 -1
- package/dist/registry/vue/avatar.json +1 -1
- package/dist/registry/vue/badge.json +1 -1
- package/dist/registry/vue/button.json +1 -1
- package/dist/registry/vue/calendar.json +1 -1
- package/dist/registry/vue/card.json +1 -1
- package/dist/registry/vue/cascader.json +2 -2
- package/dist/registry/vue/checkbox.json +1 -1
- package/dist/registry/vue/context-menu.json +3 -3
- package/dist/registry/vue/currency-input.json +1 -1
- package/dist/registry/vue/date-picker.json +2 -2
- package/dist/registry/vue/date-range-picker.json +2 -2
- package/dist/registry/vue/date-shared.json +8 -2
- package/dist/registry/vue/dialog.json +2 -2
- package/dist/registry/vue/drawer.json +2 -2
- package/dist/registry/vue/dropdown-menu.json +2 -2
- package/dist/registry/vue/empty.json +1 -1
- package/dist/registry/vue/form-render.json +6 -6
- package/dist/registry/vue/form.json +1 -1
- package/dist/registry/vue/icon-shared.json +1 -1
- package/dist/registry/vue/input.json +1 -1
- package/dist/registry/vue/label.json +1 -1
- package/dist/registry/vue/month-picker.json +2 -2
- package/dist/registry/vue/number-input.json +1 -1
- package/dist/registry/vue/overlay-shared.json +19 -1
- package/dist/registry/vue/password-input.json +1 -1
- package/dist/registry/vue/pin-input.json +1 -1
- package/dist/registry/vue/popconfirm.json +1 -1
- package/dist/registry/vue/popover.json +2 -2
- package/dist/registry/vue/progress.json +1 -1
- package/dist/registry/vue/radio-group.json +1 -1
- package/dist/registry/vue/registry.json +52 -52
- package/dist/registry/vue/select.json +2 -2
- package/dist/registry/vue/separator.json +1 -1
- package/dist/registry/vue/skeleton.json +1 -1
- package/dist/registry/vue/slider.json +1 -1
- package/dist/registry/vue/slot.json +1 -1
- package/dist/registry/vue/spin.json +1 -1
- package/dist/registry/vue/switch.json +1 -1
- package/dist/registry/vue/table-render.json +5 -5
- package/dist/registry/vue/tabs.json +1 -1
- package/dist/registry/vue/textarea.json +1 -1
- package/dist/registry/vue/timeline.json +1 -1
- package/dist/registry/vue/toast.json +1 -1
- package/dist/registry/vue/tokens.json +2 -2
- package/dist/registry/vue/tooltip.json +2 -2
- package/dist/registry/vue/tree-select.json +2 -2
- package/dist/registry/vue/tree-shared.json +1 -1
- package/dist/registry/vue/utils.json +1 -1
- package/dist/registry/vue/week-picker.json +2 -2
- package/dist/registry/vue/year-picker.json +2 -2
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -16,9 +16,9 @@ import { Avatar } from "@ark-ui/vue/avatar";
|
|
|
16
16
|
import { Dialog } from "@ark-ui/vue/dialog";
|
|
17
17
|
import { Menu } from "@ark-ui/vue/menu";
|
|
18
18
|
import { PinInput } from "@ark-ui/vue/pin-input";
|
|
19
|
+
import { PaginationEllipsis, PaginationItem, PaginationNextTrigger, PaginationPrevTrigger, PaginationRoot } from "@ark-ui/vue/pagination";
|
|
19
20
|
import { useVirtualizer } from "@tanstack/vue-virtual";
|
|
20
21
|
import { Tooltip } from "@ark-ui/vue/tooltip";
|
|
21
|
-
import { PaginationEllipsis, PaginationItem, PaginationNextTrigger, PaginationPrevTrigger, PaginationRoot } from "@ark-ui/vue/pagination";
|
|
22
22
|
import { getCoreRowModel, getExpandedRowModel, getPaginationRowModel, getSortedRowModel, useVueTable } from "@tanstack/vue-table";
|
|
23
23
|
import { Tabs } from "@ark-ui/vue/tabs";
|
|
24
24
|
import { Progress } from "@ark-ui/vue/progress";
|
|
@@ -83,6 +83,7 @@ const COMPONENT_NAMES = [
|
|
|
83
83
|
"Slot",
|
|
84
84
|
"Spin",
|
|
85
85
|
"Switch",
|
|
86
|
+
"TablePagination",
|
|
86
87
|
"TableRender",
|
|
87
88
|
"Tabs",
|
|
88
89
|
"Textarea",
|
|
@@ -1509,6 +1510,88 @@ function _sfc_render(_ctx, _cache) {
|
|
|
1509
1510
|
}
|
|
1510
1511
|
var CloseIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$59, [["render", _sfc_render]]);
|
|
1511
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
|
|
1512
1595
|
//#region src/components/date-shared/PickerShell.vue
|
|
1513
1596
|
/** 单值日期族(Date/Month/Year/Week)共用外壳:触发器 + 清空/日历按钮 + 弹层容器。 */
|
|
1514
1597
|
const _sfc_main$58 = /*@__PURE__*/ defineComponent({
|
|
@@ -1577,6 +1660,12 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
|
|
|
1577
1660
|
type: Function,
|
|
1578
1661
|
required: true
|
|
1579
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
|
+
},
|
|
1580
1669
|
class: {
|
|
1581
1670
|
type: String,
|
|
1582
1671
|
default: void 0
|
|
@@ -1591,6 +1680,8 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
|
|
|
1591
1680
|
if (props.disabled || props.readOnly || props.open) return;
|
|
1592
1681
|
emit("update:open", true);
|
|
1593
1682
|
}
|
|
1683
|
+
const teleportTarget = useSandboxTeleportTarget(() => void 0);
|
|
1684
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
|
|
1594
1685
|
return (_ctx, _cache) => {
|
|
1595
1686
|
return openBlock(), createBlock(unref(DatePicker).Root, {
|
|
1596
1687
|
"model-value": __props.modelValue,
|
|
@@ -1606,6 +1697,7 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
|
|
|
1606
1697
|
disabled: __props.disabled,
|
|
1607
1698
|
format: __props.format,
|
|
1608
1699
|
parse: __props.parse,
|
|
1700
|
+
positioning: rootPositioning.value,
|
|
1609
1701
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
|
|
1610
1702
|
"onUpdate:open": _cache[1] || (_cache[1] = ($event) => emit("update:open", $event))
|
|
1611
1703
|
}, {
|
|
@@ -1637,14 +1729,14 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
|
|
|
1637
1729
|
]),
|
|
1638
1730
|
_: 1
|
|
1639
1731
|
}, 8, ["class", "data-invalid"]),
|
|
1640
|
-
createCommentVNode(" 弹层 Teleport
|
|
1641
|
-
(openBlock(), createBlock(Teleport, { to:
|
|
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)]" }, {
|
|
1642
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")) }, {
|
|
1643
1735
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1644
1736
|
_: 3
|
|
1645
1737
|
}, 8, ["class"])]),
|
|
1646
1738
|
_: 3
|
|
1647
|
-
})]))
|
|
1739
|
+
})], 8, ["to"]))
|
|
1648
1740
|
]),
|
|
1649
1741
|
_: 3
|
|
1650
1742
|
}, 8, [
|
|
@@ -1660,7 +1752,8 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
|
|
|
1660
1752
|
"read-only",
|
|
1661
1753
|
"disabled",
|
|
1662
1754
|
"format",
|
|
1663
|
-
"parse"
|
|
1755
|
+
"parse",
|
|
1756
|
+
"positioning"
|
|
1664
1757
|
]);
|
|
1665
1758
|
};
|
|
1666
1759
|
}
|
|
@@ -1784,6 +1877,13 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
|
1784
1877
|
type: String,
|
|
1785
1878
|
default: "zh-CN"
|
|
1786
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
|
+
},
|
|
1787
1887
|
class: {
|
|
1788
1888
|
type: String,
|
|
1789
1889
|
default: void 0
|
|
@@ -1821,6 +1921,7 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
|
1821
1921
|
disabled: props.disabled,
|
|
1822
1922
|
invalid: props.invalid,
|
|
1823
1923
|
placeholder: props.placeholder,
|
|
1924
|
+
positioning: props.positioning,
|
|
1824
1925
|
class: props.class,
|
|
1825
1926
|
format: unref(formatIsoDate),
|
|
1826
1927
|
parse: unref(parseIsoDate),
|
|
@@ -1841,6 +1942,7 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
|
1841
1942
|
"disabled",
|
|
1842
1943
|
"invalid",
|
|
1843
1944
|
"placeholder",
|
|
1945
|
+
"positioning",
|
|
1844
1946
|
"class",
|
|
1845
1947
|
"format",
|
|
1846
1948
|
"parse",
|
|
@@ -1920,6 +2022,12 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
1920
2022
|
type: String,
|
|
1921
2023
|
default: "zh-CN"
|
|
1922
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
|
+
},
|
|
1923
2031
|
class: {
|
|
1924
2032
|
type: String,
|
|
1925
2033
|
default: void 0
|
|
@@ -1955,6 +2063,8 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
1955
2063
|
defaultValue: () => props.defaultOpen,
|
|
1956
2064
|
onChange: (open) => emit("update:open", open)
|
|
1957
2065
|
});
|
|
2066
|
+
const teleportTarget = useSandboxTeleportTarget(() => void 0);
|
|
2067
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
|
|
1958
2068
|
function openFromInput() {
|
|
1959
2069
|
if (props.disabled || props.readOnly || isOpen.value) return;
|
|
1960
2070
|
setOpen(true);
|
|
@@ -1975,6 +2085,7 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
1975
2085
|
disabled: props.disabled,
|
|
1976
2086
|
format: unref(formatIsoDate),
|
|
1977
2087
|
parse: unref(parseIsoDate),
|
|
2088
|
+
positioning: rootPositioning.value,
|
|
1978
2089
|
"onUpdate:modelValue": handleValueUpdate,
|
|
1979
2090
|
"onUpdate:open": unref(setOpen)
|
|
1980
2091
|
}, {
|
|
@@ -2029,14 +2140,14 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
2029
2140
|
]),
|
|
2030
2141
|
_: 1
|
|
2031
2142
|
}, 8, ["class", "data-invalid"]),
|
|
2032
|
-
createCommentVNode(" 弹层 Teleport
|
|
2033
|
-
(openBlock(), createBlock(Teleport, { to:
|
|
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)]" }, {
|
|
2034
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")) }, {
|
|
2035
2146
|
default: withCtx(() => [createVNode(unref(_sfc_main$6), { "num-of-months": props.numOfMonths }, null, 8, ["num-of-months"])]),
|
|
2036
2147
|
_: 1
|
|
2037
2148
|
}, 8, ["class"])]),
|
|
2038
2149
|
_: 1
|
|
2039
|
-
})]))
|
|
2150
|
+
})], 8, ["to"]))
|
|
2040
2151
|
]),
|
|
2041
2152
|
_: 1
|
|
2042
2153
|
}, 8, [
|
|
@@ -2052,6 +2163,7 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
2052
2163
|
"disabled",
|
|
2053
2164
|
"format",
|
|
2054
2165
|
"parse",
|
|
2166
|
+
"positioning",
|
|
2055
2167
|
"onUpdate:open"
|
|
2056
2168
|
])], 2112);
|
|
2057
2169
|
};
|
|
@@ -2118,6 +2230,13 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
|
|
|
2118
2230
|
type: String,
|
|
2119
2231
|
default: "zh-CN"
|
|
2120
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
|
+
},
|
|
2121
2240
|
class: {
|
|
2122
2241
|
type: String,
|
|
2123
2242
|
default: void 0
|
|
@@ -2159,6 +2278,7 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
|
|
|
2159
2278
|
disabled: props.disabled,
|
|
2160
2279
|
invalid: props.invalid,
|
|
2161
2280
|
placeholder: props.placeholder,
|
|
2281
|
+
positioning: props.positioning,
|
|
2162
2282
|
class: props.class,
|
|
2163
2283
|
format: unref(formatIsoMonth),
|
|
2164
2284
|
parse: unref(parseIsoMonth),
|
|
@@ -2178,6 +2298,7 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
|
|
|
2178
2298
|
"disabled",
|
|
2179
2299
|
"invalid",
|
|
2180
2300
|
"placeholder",
|
|
2301
|
+
"positioning",
|
|
2181
2302
|
"class",
|
|
2182
2303
|
"format",
|
|
2183
2304
|
"parse",
|
|
@@ -2318,7 +2439,7 @@ const _hoisted_3$12 = [
|
|
|
2318
2439
|
"aria-pressed",
|
|
2319
2440
|
"disabled"
|
|
2320
2441
|
];
|
|
2321
|
-
const _hoisted_4$
|
|
2442
|
+
const _hoisted_4$10 = {
|
|
2322
2443
|
key: 0,
|
|
2323
2444
|
viewBox: "0 0 24 24",
|
|
2324
2445
|
fill: "none",
|
|
@@ -2329,7 +2450,7 @@ const _hoisted_4$9 = {
|
|
|
2329
2450
|
class: "size-4",
|
|
2330
2451
|
"aria-hidden": "true"
|
|
2331
2452
|
};
|
|
2332
|
-
const _hoisted_5$
|
|
2453
|
+
const _hoisted_5$7 = {
|
|
2333
2454
|
key: 1,
|
|
2334
2455
|
viewBox: "0 0 24 24",
|
|
2335
2456
|
fill: "none",
|
|
@@ -2413,7 +2534,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
2413
2534
|
disabled: props.disabled,
|
|
2414
2535
|
class: normalizeClass("hover:text-foreground mr-1 flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none disabled:cursor-not-allowed disabled:opacity-50"),
|
|
2415
2536
|
onClick: toggleVisible
|
|
2416
|
-
}, [createCommentVNode(" 可见时显示 EyeOff(点击隐藏),默认显示 Eye(点击查看) "), renderSlot(_ctx.$slots, "visibility-icon", { visible: isVisible.value }, () => [isVisible.value ? (openBlock(), createElementBlock("svg", _hoisted_4$
|
|
2537
|
+
}, [createCommentVNode(" 可见时显示 EyeOff(点击隐藏),默认显示 Eye(点击查看) "), renderSlot(_ctx.$slots, "visibility-icon", { visible: isVisible.value }, () => [isVisible.value ? (openBlock(), createElementBlock("svg", _hoisted_4$10, [..._cache[0] || (_cache[0] = [
|
|
2417
2538
|
createElementVNode("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }, null, -1),
|
|
2418
2539
|
createElementVNode("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }, null, -1),
|
|
2419
2540
|
createElementVNode("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }, null, -1),
|
|
@@ -2423,7 +2544,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
2423
2544
|
y1: "2",
|
|
2424
2545
|
y2: "22"
|
|
2425
2546
|
}, null, -1)
|
|
2426
|
-
])])) : (openBlock(), createElementBlock("svg", _hoisted_5$
|
|
2547
|
+
])])) : (openBlock(), createElementBlock("svg", _hoisted_5$7, [..._cache[1] || (_cache[1] = [createElementVNode("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }, null, -1), createElementVNode("circle", {
|
|
2427
2548
|
cx: "12",
|
|
2428
2549
|
cy: "12",
|
|
2429
2550
|
r: "3"
|
|
@@ -2434,7 +2555,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
2434
2555
|
//#endregion
|
|
2435
2556
|
//#region src/components/textarea/Textarea.vue
|
|
2436
2557
|
const _hoisted_1$20 = ["aria-invalid"];
|
|
2437
|
-
const _sfc_main$
|
|
2558
|
+
const _sfc_main$46 = /*@__PURE__*/ defineComponent({
|
|
2438
2559
|
__name: "Textarea",
|
|
2439
2560
|
props: /*@__PURE__*/ mergeModels({
|
|
2440
2561
|
class: {},
|
|
@@ -2458,7 +2579,7 @@ const _sfc_main$45 = /*@__PURE__*/ defineComponent({
|
|
|
2458
2579
|
});
|
|
2459
2580
|
//#endregion
|
|
2460
2581
|
//#region src/components/week-picker/WeekPicker.vue
|
|
2461
|
-
const _sfc_main$
|
|
2582
|
+
const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
2462
2583
|
inheritAttrs: false,
|
|
2463
2584
|
__name: "WeekPicker",
|
|
2464
2585
|
props: {
|
|
@@ -2522,6 +2643,13 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
2522
2643
|
type: String,
|
|
2523
2644
|
default: "zh-CN"
|
|
2524
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
|
+
},
|
|
2525
2653
|
class: {
|
|
2526
2654
|
type: String,
|
|
2527
2655
|
default: void 0
|
|
@@ -2572,6 +2700,7 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
2572
2700
|
disabled: props.disabled,
|
|
2573
2701
|
invalid: props.invalid,
|
|
2574
2702
|
placeholder: props.placeholder,
|
|
2703
|
+
positioning: props.positioning,
|
|
2575
2704
|
class: props.class,
|
|
2576
2705
|
format: formatDate,
|
|
2577
2706
|
parse: parseDate,
|
|
@@ -2595,6 +2724,7 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
2595
2724
|
"disabled",
|
|
2596
2725
|
"invalid",
|
|
2597
2726
|
"placeholder",
|
|
2727
|
+
"positioning",
|
|
2598
2728
|
"class",
|
|
2599
2729
|
"onUpdate:modelValue",
|
|
2600
2730
|
"onUpdate:open"
|
|
@@ -2604,7 +2734,7 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
2604
2734
|
});
|
|
2605
2735
|
//#endregion
|
|
2606
2736
|
//#region src/components/year-picker/YearPicker.vue
|
|
2607
|
-
const _sfc_main$
|
|
2737
|
+
const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
2608
2738
|
inheritAttrs: false,
|
|
2609
2739
|
__name: "YearPicker",
|
|
2610
2740
|
props: {
|
|
@@ -2663,6 +2793,13 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
|
2663
2793
|
type: String,
|
|
2664
2794
|
default: "zh-CN"
|
|
2665
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
|
+
},
|
|
2666
2803
|
class: {
|
|
2667
2804
|
type: String,
|
|
2668
2805
|
default: void 0
|
|
@@ -2701,6 +2838,7 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
|
2701
2838
|
disabled: props.disabled,
|
|
2702
2839
|
invalid: props.invalid,
|
|
2703
2840
|
placeholder: props.placeholder,
|
|
2841
|
+
positioning: props.positioning,
|
|
2704
2842
|
class: props.class,
|
|
2705
2843
|
format: unref(formatIsoYear),
|
|
2706
2844
|
parse: unref(parseIsoYear),
|
|
@@ -2720,6 +2858,7 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
|
2720
2858
|
"disabled",
|
|
2721
2859
|
"invalid",
|
|
2722
2860
|
"placeholder",
|
|
2861
|
+
"positioning",
|
|
2723
2862
|
"class",
|
|
2724
2863
|
"format",
|
|
2725
2864
|
"parse",
|
|
@@ -2764,7 +2903,7 @@ function renderCurrencyItem(options = {}) {
|
|
|
2764
2903
|
}
|
|
2765
2904
|
/** textarea widget:多行文本(placeholder/rows 为原生 attr 透传) */
|
|
2766
2905
|
function renderTextareaItem(options = {}) {
|
|
2767
|
-
return (ctx) => h(_sfc_main$
|
|
2906
|
+
return (ctx) => h(_sfc_main$46, {
|
|
2768
2907
|
placeholder: ctx.item.placeholder,
|
|
2769
2908
|
...options,
|
|
2770
2909
|
...bindField(ctx.field, MODEL_VALUE),
|
|
@@ -2790,14 +2929,14 @@ function renderMonthPickerItem(options = {}) {
|
|
|
2790
2929
|
return pickerRenderer(_sfc_main$29, options);
|
|
2791
2930
|
}
|
|
2792
2931
|
function renderYearPickerItem(options = {}) {
|
|
2793
|
-
return pickerRenderer(_sfc_main$
|
|
2932
|
+
return pickerRenderer(_sfc_main$52, options);
|
|
2794
2933
|
}
|
|
2795
2934
|
/** dateRangePicker widget:[start, end] | null 形态 */
|
|
2796
2935
|
function renderDateRangePickerItem(options = {}) {
|
|
2797
2936
|
return pickerRenderer(_sfc_main$13, options);
|
|
2798
2937
|
}
|
|
2799
2938
|
function renderWeekPickerItem(options = {}) {
|
|
2800
|
-
return pickerRenderer(_sfc_main$
|
|
2939
|
+
return pickerRenderer(_sfc_main$51, options);
|
|
2801
2940
|
}
|
|
2802
2941
|
//#endregion
|
|
2803
2942
|
//#region src/components/input/Input.vue
|
|
@@ -2836,6 +2975,55 @@ function renderInputItem(options = {}) {
|
|
|
2836
2975
|
});
|
|
2837
2976
|
}
|
|
2838
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
|
|
2839
3027
|
//#region src/components/select/types.ts
|
|
2840
3028
|
function normalizeSelectItem(item) {
|
|
2841
3029
|
return typeof item === "string" ? {
|
|
@@ -2885,10 +3073,30 @@ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
|
|
|
2885
3073
|
contentClass: {
|
|
2886
3074
|
type: String,
|
|
2887
3075
|
default: void 0
|
|
3076
|
+
},
|
|
3077
|
+
/** Ark Select Root 的 positioning 配置(placement/gutter 等);
|
|
3078
|
+
iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
|
|
3079
|
+
(absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
|
|
3080
|
+
positioning: {
|
|
3081
|
+
type: Object,
|
|
3082
|
+
default: void 0
|
|
2888
3083
|
}
|
|
2889
3084
|
},
|
|
2890
3085
|
emits: ["update:modelValue", "update:open"],
|
|
2891
3086
|
setup(__props, { emit: __emit }) {
|
|
3087
|
+
const { ids: rootIds } = useOverlayIds(useAttrs(), {
|
|
3088
|
+
primary: "content",
|
|
3089
|
+
parts: [
|
|
3090
|
+
"content",
|
|
3091
|
+
"root",
|
|
3092
|
+
"trigger",
|
|
3093
|
+
"control",
|
|
3094
|
+
"clearTrigger",
|
|
3095
|
+
"label",
|
|
3096
|
+
"hiddenSelect",
|
|
3097
|
+
"positioner"
|
|
3098
|
+
]
|
|
3099
|
+
});
|
|
2892
3100
|
const props = __props;
|
|
2893
3101
|
const emit = __emit;
|
|
2894
3102
|
const toArray = (v) => v === void 0 ? void 0 : [v];
|
|
@@ -2912,11 +3120,14 @@ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
|
|
|
2912
3120
|
defaultValue: () => props.defaultOpen,
|
|
2913
3121
|
onChange: (open) => emit("update:open", open)
|
|
2914
3122
|
});
|
|
3123
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
|
|
2915
3124
|
return (_ctx, _cache) => {
|
|
2916
3125
|
return openBlock(), createBlock(unref(Select).Root, {
|
|
3126
|
+
ids: unref(rootIds),
|
|
2917
3127
|
collection: collection.value,
|
|
2918
3128
|
"model-value": toArray(modelValue.value),
|
|
2919
3129
|
open: unref(isOpen),
|
|
3130
|
+
positioning: rootPositioning.value,
|
|
2920
3131
|
"onUpdate:modelValue": handleModelUpdate,
|
|
2921
3132
|
"onUpdate:open": unref(setOpen)
|
|
2922
3133
|
}, {
|
|
@@ -2970,9 +3181,11 @@ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
|
|
|
2970
3181
|
]),
|
|
2971
3182
|
_: 3
|
|
2972
3183
|
}, 8, [
|
|
3184
|
+
"ids",
|
|
2973
3185
|
"collection",
|
|
2974
3186
|
"model-value",
|
|
2975
3187
|
"open",
|
|
3188
|
+
"positioning",
|
|
2976
3189
|
"onUpdate:open"
|
|
2977
3190
|
]);
|
|
2978
3191
|
};
|
|
@@ -3169,7 +3382,7 @@ function renderSliderItem(options = {}) {
|
|
|
3169
3382
|
const _hoisted_1$18 = ["data-key"];
|
|
3170
3383
|
const _hoisted_2$15 = { class: "truncate" };
|
|
3171
3384
|
const _hoisted_3$11 = ["aria-label", "onClick"];
|
|
3172
|
-
const _hoisted_4$
|
|
3385
|
+
const _hoisted_4$9 = {
|
|
3173
3386
|
key: 0,
|
|
3174
3387
|
"data-part": "tag-overflow",
|
|
3175
3388
|
class: "text-xs text-muted-foreground"
|
|
@@ -3220,7 +3433,7 @@ const _sfc_main$57 = /*@__PURE__*/ defineComponent({
|
|
|
3220
3433
|
onClick: withModifiers(($event) => emit("remove", v.key), ["stop"])
|
|
3221
3434
|
}, [createVNode(CloseIcon_default, { class: "size-3" })], 8, _hoisted_3$11)) : createCommentVNode("v-if", true)], 8, _hoisted_1$18);
|
|
3222
3435
|
}), 128)),
|
|
3223
|
-
overflow.value > 0 ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
3436
|
+
overflow.value > 0 ? (openBlock(), createElementBlock("span", _hoisted_4$9, "+" + toDisplayString(overflow.value), 1)) : createCommentVNode("v-if", true),
|
|
3224
3437
|
__props.clearable && !__props.disabled ? (openBlock(), createElementBlock("button", {
|
|
3225
3438
|
key: 1,
|
|
3226
3439
|
type: "button",
|
|
@@ -3834,7 +4047,7 @@ const _hoisted_2$14 = [
|
|
|
3834
4047
|
"onPointerenter"
|
|
3835
4048
|
];
|
|
3836
4049
|
const _hoisted_3$10 = ["onClick"];
|
|
3837
|
-
const _hoisted_4$
|
|
4050
|
+
const _hoisted_4$8 = {
|
|
3838
4051
|
key: 0,
|
|
3839
4052
|
viewBox: "0 0 24 24",
|
|
3840
4053
|
fill: "none",
|
|
@@ -3842,7 +4055,7 @@ const _hoisted_4$7 = {
|
|
|
3842
4055
|
"stroke-width": "3",
|
|
3843
4056
|
class: "size-3"
|
|
3844
4057
|
};
|
|
3845
|
-
const _hoisted_5$
|
|
4058
|
+
const _hoisted_5$6 = {
|
|
3846
4059
|
key: 1,
|
|
3847
4060
|
viewBox: "0 0 24 24",
|
|
3848
4061
|
fill: "none",
|
|
@@ -3850,7 +4063,7 @@ const _hoisted_5$5 = {
|
|
|
3850
4063
|
"stroke-width": "3",
|
|
3851
4064
|
class: "size-3"
|
|
3852
4065
|
};
|
|
3853
|
-
const _hoisted_6$
|
|
4066
|
+
const _hoisted_6$5 = { class: "flex-1 truncate" };
|
|
3854
4067
|
const _hoisted_7$4 = {
|
|
3855
4068
|
key: 0,
|
|
3856
4069
|
class: "px-3 py-1.5 text-sm text-muted-foreground"
|
|
@@ -3955,8 +4168,8 @@ const _sfc_main$56 = /*@__PURE__*/ defineComponent({
|
|
|
3955
4168
|
"data-part": "checkbox",
|
|
3956
4169
|
class: normalizeClass(["flex size-4 shrink-0 items-center justify-center rounded-sm border", checkedSet.value.has(node.key) ? "border-primary bg-primary text-primary-foreground" : "border-input"]),
|
|
3957
4170
|
onClick: withModifiers(($event) => toggleCheck(node), ["stop"])
|
|
3958
|
-
}, [checkedSet.value.has(node.key) ? (openBlock(), createElementBlock("svg", _hoisted_4$
|
|
3959
|
-
createElementVNode("span", _hoisted_6$
|
|
4171
|
+
}, [checkedSet.value.has(node.key) ? (openBlock(), createElementBlock("svg", _hoisted_4$8, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M20 6 9 17l-5-5" }, null, -1)])])) : indeterminateSet.value.has(node.key) ? (openBlock(), createElementBlock("svg", _hoisted_5$6, [..._cache[1] || (_cache[1] = [createElementVNode("path", { d: "M5 12h14" }, null, -1)])])) : createCommentVNode("v-if", true)], 10, _hoisted_3$10)) : createCommentVNode("v-if", true),
|
|
4172
|
+
createElementVNode("span", _hoisted_6$5, toDisplayString(labelOf(node)), 1),
|
|
3960
4173
|
node.children?.length ? (openBlock(), createBlock(ChevronIcon_default, {
|
|
3961
4174
|
key: 1,
|
|
3962
4175
|
class: normalizeClass(unref(cn)("size-3.5 shrink-0 text-muted-foreground transition-transform", props.isExpanded(node) && "rotate-90"))
|
|
@@ -3978,11 +4191,11 @@ const _hoisted_3$9 = {
|
|
|
3978
4191
|
key: 0,
|
|
3979
4192
|
class: "truncate"
|
|
3980
4193
|
};
|
|
3981
|
-
const _hoisted_4$
|
|
4194
|
+
const _hoisted_4$7 = {
|
|
3982
4195
|
key: 1,
|
|
3983
4196
|
class: "truncate text-muted-foreground"
|
|
3984
4197
|
};
|
|
3985
|
-
const _hoisted_5$
|
|
4198
|
+
const _hoisted_5$5 = { class: "ml-auto flex shrink-0 items-center gap-1" };
|
|
3986
4199
|
const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
3987
4200
|
inheritAttrs: false,
|
|
3988
4201
|
__name: "Cascader",
|
|
@@ -4071,6 +4284,12 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4071
4284
|
type: Boolean,
|
|
4072
4285
|
default: false
|
|
4073
4286
|
},
|
|
4287
|
+
/** Ark Popover Root 的 positioning 配置(placement/gutter 等);
|
|
4288
|
+
iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed */
|
|
4289
|
+
positioning: {
|
|
4290
|
+
type: Object,
|
|
4291
|
+
default: void 0
|
|
4292
|
+
},
|
|
4074
4293
|
class: {
|
|
4075
4294
|
type: String,
|
|
4076
4295
|
default: void 0
|
|
@@ -4082,6 +4301,19 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4082
4301
|
"update:open"
|
|
4083
4302
|
],
|
|
4084
4303
|
setup(__props, { emit: __emit }) {
|
|
4304
|
+
const { ids: rootIds } = useOverlayIds(useAttrs(), {
|
|
4305
|
+
primary: "content",
|
|
4306
|
+
parts: [
|
|
4307
|
+
"content",
|
|
4308
|
+
"title",
|
|
4309
|
+
"description",
|
|
4310
|
+
"anchor",
|
|
4311
|
+
"trigger",
|
|
4312
|
+
"closeTrigger",
|
|
4313
|
+
"positioner",
|
|
4314
|
+
"arrow"
|
|
4315
|
+
]
|
|
4316
|
+
});
|
|
4085
4317
|
const props = __props;
|
|
4086
4318
|
const emit = __emit;
|
|
4087
4319
|
if (import.meta.env.DEV && getCurrentInstance()?.vnode.props?.["onUpdate:show"]) console.warn("[tu-design] <Cascader> update:show 已弃用,请改用 update:open(v-model:open)。");
|
|
@@ -4122,6 +4354,8 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4122
4354
|
emit("update:show", open);
|
|
4123
4355
|
}
|
|
4124
4356
|
});
|
|
4357
|
+
const teleportTarget = useSandboxTeleportTarget(() => void 0);
|
|
4358
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
|
|
4125
4359
|
function openFromInput() {
|
|
4126
4360
|
if (props.disabled || isOpen.value) return;
|
|
4127
4361
|
syncPanelWidth();
|
|
@@ -4276,7 +4510,9 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4276
4510
|
});
|
|
4277
4511
|
return (_ctx, _cache) => {
|
|
4278
4512
|
return openBlock(), createBlock(unref(Popover).Root, {
|
|
4513
|
+
ids: unref(rootIds),
|
|
4279
4514
|
open: unref(isOpen),
|
|
4515
|
+
positioning: rootPositioning.value,
|
|
4280
4516
|
"onUpdate:open": unref(setOpen)
|
|
4281
4517
|
}, {
|
|
4282
4518
|
default: withCtx(() => [createVNode(unref(Popover).Anchor, { "as-child": "" }, {
|
|
@@ -4303,7 +4539,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4303
4539
|
"values",
|
|
4304
4540
|
"max-tag-count",
|
|
4305
4541
|
"disabled"
|
|
4306
|
-
])) : createCommentVNode("v-if", true), !tags.value.length ? (openBlock(), createElementBlock("span", _hoisted_2$13, toDisplayString(props.placeholder), 1)) : createCommentVNode("v-if", true)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [singleLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$9, toDisplayString(singleLabel.value), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
4542
|
+
])) : createCommentVNode("v-if", true), !tags.value.length ? (openBlock(), createElementBlock("span", _hoisted_2$13, toDisplayString(props.placeholder), 1)) : createCommentVNode("v-if", true)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [singleLabel.value ? (openBlock(), createElementBlock("span", _hoisted_3$9, toDisplayString(singleLabel.value), 1)) : (openBlock(), createElementBlock("span", _hoisted_4$7, toDisplayString(props.placeholder), 1))], 64)), createElementVNode("span", _hoisted_5$5, [props.clearable && hasValue.value && !props.disabled ? (openBlock(), createElementBlock("span", {
|
|
4307
4543
|
key: 0,
|
|
4308
4544
|
role: "button",
|
|
4309
4545
|
"data-part": "clear",
|
|
@@ -4312,7 +4548,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4312
4548
|
onClick: withModifiers(handleClear, ["stop"])
|
|
4313
4549
|
}, [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)]),
|
|
4314
4550
|
_: 1
|
|
4315
|
-
}), (openBlock(), createBlock(Teleport, { to:
|
|
4551
|
+
}), (openBlock(), createBlock(Teleport, { to: unref(teleportTarget) }, [createVNode(unref(Popover).Positioner, { class: "z-[var(--z-overlay)]" }, {
|
|
4316
4552
|
default: withCtx(() => [createVNode(unref(Popover).Content, {
|
|
4317
4553
|
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")),
|
|
4318
4554
|
style: normalizeStyle({ minWidth: panelMinWidth.value }),
|
|
@@ -4342,9 +4578,14 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4342
4578
|
_: 1
|
|
4343
4579
|
}, 8, ["class", "style"])]),
|
|
4344
4580
|
_: 1
|
|
4345
|
-
})]))]),
|
|
4581
|
+
})], 8, ["to"]))]),
|
|
4346
4582
|
_: 1
|
|
4347
|
-
}, 8, [
|
|
4583
|
+
}, 8, [
|
|
4584
|
+
"ids",
|
|
4585
|
+
"open",
|
|
4586
|
+
"positioning",
|
|
4587
|
+
"onUpdate:open"
|
|
4588
|
+
]);
|
|
4348
4589
|
};
|
|
4349
4590
|
}
|
|
4350
4591
|
});
|
|
@@ -4368,8 +4609,8 @@ const _hoisted_3$8 = {
|
|
|
4368
4609
|
class: "size-4 shrink-0",
|
|
4369
4610
|
"aria-hidden": "true"
|
|
4370
4611
|
};
|
|
4371
|
-
const _hoisted_4$
|
|
4372
|
-
const _hoisted_5$
|
|
4612
|
+
const _hoisted_4$6 = ["data-checked", "data-indeterminate"];
|
|
4613
|
+
const _hoisted_5$4 = {
|
|
4373
4614
|
key: 0,
|
|
4374
4615
|
viewBox: "0 0 24 24",
|
|
4375
4616
|
fill: "none",
|
|
@@ -4379,7 +4620,7 @@ const _hoisted_5$3 = {
|
|
|
4379
4620
|
"stroke-linejoin": "round",
|
|
4380
4621
|
class: "size-3"
|
|
4381
4622
|
};
|
|
4382
|
-
const _hoisted_6$
|
|
4623
|
+
const _hoisted_6$4 = {
|
|
4383
4624
|
key: 1,
|
|
4384
4625
|
viewBox: "0 0 24 24",
|
|
4385
4626
|
fill: "none",
|
|
@@ -4494,7 +4735,7 @@ const _sfc_main$55 = /*@__PURE__*/ defineComponent({
|
|
|
4494
4735
|
"data-indeterminate": isIndeterminate(node) ? "" : void 0,
|
|
4495
4736
|
class: "flex size-4 shrink-0 items-center justify-center rounded-[3px] border border-input bg-background text-background data-[checked]:border-primary data-[checked]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:bg-primary",
|
|
4496
4737
|
"aria-hidden": "true"
|
|
4497
|
-
}, [isChecked(node) ? (openBlock(), createElementBlock("svg", _hoisted_5$
|
|
4738
|
+
}, [isChecked(node) ? (openBlock(), createElementBlock("svg", _hoisted_5$4, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M20 6 9 17l-5-5" }, null, -1)])])) : isIndeterminate(node) ? (openBlock(), createElementBlock("svg", _hoisted_6$4, [..._cache[1] || (_cache[1] = [createElementVNode("path", { d: "M5 12h14" }, null, -1)])])) : createCommentVNode("v-if", true)], 8, _hoisted_4$6)) : createCommentVNode("v-if", true),
|
|
4498
4739
|
createElementVNode("span", _hoisted_7$3, toDisplayString(label(node)), 1)
|
|
4499
4740
|
], 12, _hoisted_1$15);
|
|
4500
4741
|
}), 128)), __props.nodes.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_8$1, " 无数据 ")) : createCommentVNode("v-if", true)], 2);
|
|
@@ -4509,17 +4750,17 @@ const _hoisted_3$7 = {
|
|
|
4509
4750
|
key: 2,
|
|
4510
4751
|
class: "truncate text-muted-foreground"
|
|
4511
4752
|
};
|
|
4512
|
-
const _hoisted_4$
|
|
4513
|
-
const _hoisted_5$
|
|
4753
|
+
const _hoisted_4$5 = ["placeholder", "aria-label"];
|
|
4754
|
+
const _hoisted_5$3 = {
|
|
4514
4755
|
key: 0,
|
|
4515
4756
|
class: "truncate"
|
|
4516
4757
|
};
|
|
4517
|
-
const _hoisted_6$
|
|
4758
|
+
const _hoisted_6$3 = {
|
|
4518
4759
|
key: 1,
|
|
4519
4760
|
class: "truncate text-muted-foreground"
|
|
4520
4761
|
};
|
|
4521
4762
|
const _hoisted_7$2 = { class: "ml-auto flex shrink-0 items-center gap-1" };
|
|
4522
|
-
const _sfc_main$
|
|
4763
|
+
const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
4523
4764
|
inheritAttrs: false,
|
|
4524
4765
|
__name: "TreeSelect",
|
|
4525
4766
|
props: {
|
|
@@ -4611,6 +4852,12 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4611
4852
|
type: Boolean,
|
|
4612
4853
|
default: false
|
|
4613
4854
|
},
|
|
4855
|
+
/** Ark Popover Root 的 positioning 配置(placement/gutter 等);
|
|
4856
|
+
iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed */
|
|
4857
|
+
positioning: {
|
|
4858
|
+
type: Object,
|
|
4859
|
+
default: void 0
|
|
4860
|
+
},
|
|
4614
4861
|
class: {
|
|
4615
4862
|
type: String,
|
|
4616
4863
|
default: void 0
|
|
@@ -4623,6 +4870,19 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4623
4870
|
"update:expandedKeys"
|
|
4624
4871
|
],
|
|
4625
4872
|
setup(__props, { emit: __emit }) {
|
|
4873
|
+
const { ids: rootIds } = useOverlayIds(useAttrs(), {
|
|
4874
|
+
primary: "content",
|
|
4875
|
+
parts: [
|
|
4876
|
+
"content",
|
|
4877
|
+
"title",
|
|
4878
|
+
"description",
|
|
4879
|
+
"anchor",
|
|
4880
|
+
"trigger",
|
|
4881
|
+
"closeTrigger",
|
|
4882
|
+
"positioner",
|
|
4883
|
+
"arrow"
|
|
4884
|
+
]
|
|
4885
|
+
});
|
|
4626
4886
|
const props = __props;
|
|
4627
4887
|
const emit = __emit;
|
|
4628
4888
|
if (import.meta.env.DEV && getCurrentInstance()?.vnode.props?.["onUpdate:show"]) console.warn("[tu-design] <TreeSelect> update:show 已弃用,请改用 update:open(v-model:open)。");
|
|
@@ -4733,6 +4993,8 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4733
4993
|
emit("update:show", open);
|
|
4734
4994
|
}
|
|
4735
4995
|
});
|
|
4996
|
+
const teleportTarget = useSandboxTeleportTarget(() => void 0);
|
|
4997
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
|
|
4736
4998
|
function openFromInput() {
|
|
4737
4999
|
if (props.disabled || isOpen.value) return;
|
|
4738
5000
|
syncPanelWidth();
|
|
@@ -4825,7 +5087,9 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4825
5087
|
});
|
|
4826
5088
|
return (_ctx, _cache) => {
|
|
4827
5089
|
return openBlock(), createBlock(unref(Popover).Root, {
|
|
5090
|
+
ids: unref(rootIds),
|
|
4828
5091
|
open: unref(isOpen),
|
|
5092
|
+
positioning: rootPositioning.value,
|
|
4829
5093
|
"onUpdate:open": unref(setOpen)
|
|
4830
5094
|
}, {
|
|
4831
5095
|
default: withCtx(() => [
|
|
@@ -4873,7 +5137,7 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4873
5137
|
class: "h-full w-full min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground",
|
|
4874
5138
|
placeholder: singleLabel.value || props.placeholder,
|
|
4875
5139
|
"aria-label": props.placeholder
|
|
4876
|
-
}, null, 8, _hoisted_4$
|
|
5140
|
+
}, null, 8, _hoisted_4$5)), [[vModelText, pattern.value]]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [singleLabel.value ? (openBlock(), createElementBlock("span", _hoisted_5$3, toDisplayString(singleLabel.value), 1)) : (openBlock(), createElementBlock("span", _hoisted_6$3, toDisplayString(props.placeholder), 1))], 64))], 64)), createElementVNode("span", _hoisted_7$2, [props.clearable && hasValue.value && !props.disabled ? (openBlock(), createElementBlock("span", {
|
|
4877
5141
|
key: 0,
|
|
4878
5142
|
role: "button",
|
|
4879
5143
|
"data-part": "clear",
|
|
@@ -4883,8 +5147,8 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4883
5147
|
}, [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)]),
|
|
4884
5148
|
_: 1
|
|
4885
5149
|
}),
|
|
4886
|
-
createCommentVNode(" 弹层 Teleport
|
|
4887
|
-
(openBlock(), createBlock(Teleport, { to:
|
|
5150
|
+
createCommentVNode(" 弹层 Teleport:脱离表单 DOM,消除 overflow 容器裁剪隐患(DatePicker 同款);\n 目标经沙箱适配降级(shadow DOM / wujie graft → 应用挂载容器) "),
|
|
5151
|
+
(openBlock(), createBlock(Teleport, { to: unref(teleportTarget) }, [createVNode(unref(Popover).Positioner, { class: "z-[var(--z-overlay)]" }, {
|
|
4888
5152
|
default: withCtx(() => [createVNode(unref(Popover).Content, {
|
|
4889
5153
|
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")),
|
|
4890
5154
|
style: normalizeStyle({ minWidth: panelMinWidth.value }),
|
|
@@ -4912,10 +5176,15 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4912
5176
|
_: 1
|
|
4913
5177
|
}, 8, ["class", "style"])]),
|
|
4914
5178
|
_: 1
|
|
4915
|
-
})]))
|
|
5179
|
+
})], 8, ["to"]))
|
|
4916
5180
|
]),
|
|
4917
5181
|
_: 1
|
|
4918
|
-
}, 8, [
|
|
5182
|
+
}, 8, [
|
|
5183
|
+
"ids",
|
|
5184
|
+
"open",
|
|
5185
|
+
"positioning",
|
|
5186
|
+
"onUpdate:open"
|
|
5187
|
+
]);
|
|
4919
5188
|
};
|
|
4920
5189
|
}
|
|
4921
5190
|
});
|
|
@@ -4923,7 +5192,7 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4923
5192
|
//#region src/components/form-render/widgets/tree.ts
|
|
4924
5193
|
function renderTreeSelectItem(options) {
|
|
4925
5194
|
const { placeholder, ...rest } = options;
|
|
4926
|
-
return (ctx) => h(_sfc_main$
|
|
5195
|
+
return (ctx) => h(_sfc_main$50, {
|
|
4927
5196
|
placeholder: placeholder ?? ctx.item.placeholder,
|
|
4928
5197
|
...rest,
|
|
4929
5198
|
...bindField(ctx.field, MODEL_VALUE),
|
|
@@ -5030,17 +5299,31 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5030
5299
|
if (span === "full") return { gridColumn: "1 / -1" };
|
|
5031
5300
|
if (typeof span === "number") return { gridColumn: `span ${span}` };
|
|
5032
5301
|
}
|
|
5033
|
-
const
|
|
5034
|
-
const
|
|
5035
|
-
const
|
|
5036
|
-
|
|
5302
|
+
const actions = props.definition?.actions;
|
|
5303
|
+
const searchable = computed(() => (actions ? actions.searchable : props.searchable) ?? false);
|
|
5304
|
+
const submitable = computed(() => (actions ? actions.submitable : props.submitable) ?? false);
|
|
5305
|
+
const showReset = computed(() => (actions ? actions.resetable : props.resetable) ?? !!searchable.value);
|
|
5306
|
+
const showCancel = computed(() => (actions ? actions.cancelable : props.cancelable) ?? !!submitable.value);
|
|
5307
|
+
const showActions = computed(() => searchable.value || submitable.value || showReset.value || showCancel.value);
|
|
5308
|
+
const resolvedSearchText = computed(() => (actions ? actions.searchText : props.searchText) ?? "搜索");
|
|
5309
|
+
const resolvedSubmitText = computed(() => (actions ? actions.submitText : props.submitText) ?? "提交");
|
|
5310
|
+
const resolvedResetText = computed(() => (actions ? actions.resetText : props.resetText) ?? "重置");
|
|
5311
|
+
if (import.meta.env.DEV && actions) {
|
|
5312
|
+
if (props.searchable !== void 0 || props.submitable !== void 0 || props.resetable !== void 0 || props.cancelable !== void 0 || props.searchText !== void 0 || props.submitText !== void 0 || props.resetText !== void 0) console.warn("[tu-design] <FormRender> definition.actions 与按钮 props 同传,已按 actions 渲染。");
|
|
5313
|
+
}
|
|
5314
|
+
/** I4:校验失败时 isFieldsValid=false,不 emit;成功后才 emit(事件回调中一次性读取不受 S1 限制)。
|
|
5315
|
+
* 校验语义单点化(R30):definition 存在时复用 definition.submit();拆分式 :form + :items 走内联逻辑 */
|
|
5037
5316
|
async function submit(mode) {
|
|
5038
5317
|
if (!instance) return;
|
|
5039
|
-
|
|
5040
|
-
if (
|
|
5041
|
-
|
|
5042
|
-
|
|
5318
|
+
let valid;
|
|
5319
|
+
if (props.definition) valid = await props.definition.submit();
|
|
5320
|
+
else {
|
|
5321
|
+
await instance.handleSubmit();
|
|
5322
|
+
valid = instance.state.isFieldsValid;
|
|
5043
5323
|
}
|
|
5324
|
+
if (!valid) return;
|
|
5325
|
+
if (mode === "search") emit("search");
|
|
5326
|
+
else emit("submit");
|
|
5044
5327
|
}
|
|
5045
5328
|
function onReset() {
|
|
5046
5329
|
if (props.definition) props.definition.resetToDefaults();
|
|
@@ -5070,11 +5353,11 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5070
5353
|
"values"
|
|
5071
5354
|
])], 4);
|
|
5072
5355
|
}), 128)), showActions.value ? (openBlock(), createElementBlock("div", _hoisted_1$13, [renderSlot(_ctx.$slots, "actions", {}, () => [
|
|
5073
|
-
|
|
5356
|
+
searchable.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
5074
5357
|
key: 0,
|
|
5075
5358
|
onClick: _cache[0] || (_cache[0] = ($event) => submit("search"))
|
|
5076
5359
|
}, {
|
|
5077
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
5360
|
+
default: withCtx(() => [createTextVNode(toDisplayString(resolvedSearchText.value), 1)]),
|
|
5078
5361
|
_: 1
|
|
5079
5362
|
})) : createCommentVNode("v-if", true),
|
|
5080
5363
|
showReset.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
@@ -5082,14 +5365,14 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5082
5365
|
variant: "outline",
|
|
5083
5366
|
onClick: onReset
|
|
5084
5367
|
}, {
|
|
5085
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
5368
|
+
default: withCtx(() => [createTextVNode(toDisplayString(resolvedResetText.value), 1)]),
|
|
5086
5369
|
_: 1
|
|
5087
5370
|
})) : createCommentVNode("v-if", true),
|
|
5088
|
-
|
|
5371
|
+
submitable.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
5089
5372
|
key: 2,
|
|
5090
5373
|
onClick: _cache[1] || (_cache[1] = ($event) => submit("submit"))
|
|
5091
5374
|
}, {
|
|
5092
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
5375
|
+
default: withCtx(() => [createTextVNode(toDisplayString(resolvedSubmitText.value), 1)]),
|
|
5093
5376
|
_: 1
|
|
5094
5377
|
})) : createCommentVNode("v-if", true),
|
|
5095
5378
|
showCancel.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
@@ -5114,7 +5397,16 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5114
5397
|
* - 须在组件 setup 中调用(TanStack useForm 内部 `onMounted(formApi.mount)`)。
|
|
5115
5398
|
*/
|
|
5116
5399
|
function useFormRender(options) {
|
|
5117
|
-
const { items, schema, onSubmit, formOptions } = options;
|
|
5400
|
+
const { items, schema, onSubmit, formOptions, searchable, submitable, resetable, cancelable, searchText, submitText, resetText } = options;
|
|
5401
|
+
const actions = searchable === void 0 && submitable === void 0 && resetable === void 0 && cancelable === void 0 && searchText === void 0 && submitText === void 0 && resetText === void 0 ? void 0 : {
|
|
5402
|
+
searchable,
|
|
5403
|
+
submitable,
|
|
5404
|
+
resetable,
|
|
5405
|
+
cancelable,
|
|
5406
|
+
searchText,
|
|
5407
|
+
submitText,
|
|
5408
|
+
resetText
|
|
5409
|
+
};
|
|
5118
5410
|
const defaultValues = Object.fromEntries(items.map((item) => [String(item.key), typeof item.default === "function" ? item.default() : item.default ?? null]));
|
|
5119
5411
|
const form = useForm({
|
|
5120
5412
|
defaultValues,
|
|
@@ -5126,18 +5418,25 @@ function useFormRender(options) {
|
|
|
5126
5418
|
return {
|
|
5127
5419
|
items,
|
|
5128
5420
|
form,
|
|
5129
|
-
resetToDefaults: () => form.reset()
|
|
5421
|
+
resetToDefaults: () => form.reset(),
|
|
5422
|
+
submit: async () => {
|
|
5423
|
+
await form.handleSubmit();
|
|
5424
|
+
return form.state.isFieldsValid;
|
|
5425
|
+
},
|
|
5426
|
+
actions
|
|
5130
5427
|
};
|
|
5131
5428
|
}
|
|
5132
5429
|
//#endregion
|
|
5133
5430
|
//#region src/components/form-render/define-form.ts
|
|
5134
5431
|
/**
|
|
5135
|
-
* 聚合入口:单次调用完成「字段定义 + 类型约束 +
|
|
5432
|
+
* 聚合入口:单次调用完成「字段定义 + 类型约束 + 表单实例 + 按钮预设」。
|
|
5136
5433
|
*
|
|
5137
|
-
* 返回 `{ items, form, resetToDefaults }`:
|
|
5434
|
+
* 返回 `{ items, form, resetToDefaults, submit, actions? }`:
|
|
5138
5435
|
* - `items` / `form` 传给 `<FormRender>`(支持 `:definition` 单 prop 或 `:form` + `:items` 拆分);
|
|
5139
5436
|
* - `form` 可直接 `reset()` / `validate()` / `handleSubmit()`;
|
|
5140
|
-
* - `resetToDefaults()` 重置到 `items.default`(搜索表单"重置"
|
|
5437
|
+
* - `resetToDefaults()` 重置到 `items.default`(搜索表单"重置"语义);
|
|
5438
|
+
* - `submit()` 全量校验并返回是否通过(R30,组合式查询链路);
|
|
5439
|
+
* - `actions` 按钮预设(searchable 等七项直传):存在时 `<FormRender>` 组件按钮 props 全量忽略(A1 块级互斥)。
|
|
5141
5440
|
*
|
|
5142
5441
|
* 须在组件 setup 中调用(TanStack useForm 约束)。
|
|
5143
5442
|
*/
|
|
@@ -5499,6 +5798,18 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
5499
5798
|
},
|
|
5500
5799
|
emits: ["update:open"],
|
|
5501
5800
|
setup(__props, { emit: __emit }) {
|
|
5801
|
+
const { ids: rootIds } = useOverlayIds(useAttrs(), {
|
|
5802
|
+
primary: "content",
|
|
5803
|
+
parts: [
|
|
5804
|
+
"content",
|
|
5805
|
+
"title",
|
|
5806
|
+
"description",
|
|
5807
|
+
"trigger",
|
|
5808
|
+
"closeTrigger",
|
|
5809
|
+
"positioner",
|
|
5810
|
+
"backdrop"
|
|
5811
|
+
]
|
|
5812
|
+
});
|
|
5502
5813
|
const props = __props;
|
|
5503
5814
|
const emit = __emit;
|
|
5504
5815
|
const { isOpen, setOpen } = useControlledBoolean({
|
|
@@ -5515,6 +5826,7 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
5515
5826
|
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));
|
|
5516
5827
|
return (_ctx, _cache) => {
|
|
5517
5828
|
return openBlock(), createBlock(unref(Dialog).Root, {
|
|
5829
|
+
ids: unref(rootIds),
|
|
5518
5830
|
open: unref(isOpen),
|
|
5519
5831
|
"lazy-mount": props.lazyMount,
|
|
5520
5832
|
"unmount-on-exit": props.unmountOnExit,
|
|
@@ -5566,6 +5878,7 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
5566
5878
|
]),
|
|
5567
5879
|
_: 3
|
|
5568
5880
|
}, 8, [
|
|
5881
|
+
"ids",
|
|
5569
5882
|
"open",
|
|
5570
5883
|
"lazy-mount",
|
|
5571
5884
|
"unmount-on-exit",
|
|
@@ -5661,6 +5974,13 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
5661
5974
|
contentClass: {
|
|
5662
5975
|
type: String,
|
|
5663
5976
|
default: void 0
|
|
5977
|
+
},
|
|
5978
|
+
/** Ark Menu Root 的 positioning 配置(placement/gutter 等);
|
|
5979
|
+
iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
|
|
5980
|
+
(absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
|
|
5981
|
+
positioning: {
|
|
5982
|
+
type: Object,
|
|
5983
|
+
default: void 0
|
|
5664
5984
|
}
|
|
5665
5985
|
},
|
|
5666
5986
|
emits: ["update:open", "select"],
|
|
@@ -5673,6 +5993,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
5673
5993
|
defaultValue: () => props.defaultOpen,
|
|
5674
5994
|
onChange: (open) => emit("update:open", open)
|
|
5675
5995
|
});
|
|
5996
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
|
|
5676
5997
|
function handleSelect(details) {
|
|
5677
5998
|
emit("select", details);
|
|
5678
5999
|
}
|
|
@@ -5681,6 +6002,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
5681
6002
|
open: unref(isOpen),
|
|
5682
6003
|
"lazy-mount": props.lazyMount,
|
|
5683
6004
|
"unmount-on-exit": props.unmountOnExit,
|
|
6005
|
+
positioning: rootPositioning.value,
|
|
5684
6006
|
"onUpdate:open": unref(setOpen),
|
|
5685
6007
|
onSelect: handleSelect
|
|
5686
6008
|
}, {
|
|
@@ -5710,6 +6032,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
5710
6032
|
"open",
|
|
5711
6033
|
"lazy-mount",
|
|
5712
6034
|
"unmount-on-exit",
|
|
6035
|
+
"positioning",
|
|
5713
6036
|
"onUpdate:open"
|
|
5714
6037
|
]);
|
|
5715
6038
|
};
|
|
@@ -5908,7 +6231,7 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
5908
6231
|
default: true
|
|
5909
6232
|
},
|
|
5910
6233
|
/** Teleport 目标(选择器或元素),仅 portal=true 时生效;
|
|
5911
|
-
缺省时若应用挂载容器处于 shadow DOM
|
|
6234
|
+
缺省时若应用挂载容器处于 shadow DOM 或 wujie graft 沙箱,自动降级为该容器,否则 body */
|
|
5912
6235
|
to: {
|
|
5913
6236
|
type: [String, Object],
|
|
5914
6237
|
default: void 0
|
|
@@ -5940,34 +6263,30 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
5940
6263
|
const emit = __emit;
|
|
5941
6264
|
const slots = useSlots();
|
|
5942
6265
|
const attrs = useAttrs();
|
|
5943
|
-
const
|
|
5944
|
-
const detectedTarget = ref("body");
|
|
5945
|
-
onMounted(() => {
|
|
5946
|
-
queueMicrotask(() => {
|
|
5947
|
-
if (props.to) return;
|
|
5948
|
-
const container = (instance?.appContext.app)?._container;
|
|
5949
|
-
if (container && container.getRootNode() instanceof ShadowRoot) detectedTarget.value = container;
|
|
5950
|
-
});
|
|
5951
|
-
});
|
|
5952
|
-
const teleportTarget = computed(() => props.to ?? detectedTarget.value);
|
|
6266
|
+
const teleportTarget = useSandboxTeleportTarget(() => props.to);
|
|
5953
6267
|
const { isOpen, setOpen } = useControlledBoolean({
|
|
5954
6268
|
controlled: () => props.open,
|
|
5955
6269
|
defaultValue: () => props.defaultOpen,
|
|
5956
6270
|
onChange: (open) => emit("update:open", open)
|
|
5957
6271
|
});
|
|
5958
6272
|
const useNativeTrigger = computed(() => props.trigger === "click" && !props.disabled);
|
|
5959
|
-
const
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
6273
|
+
const { ids: rootIds, resolveId } = useOverlayIds(attrs, {
|
|
6274
|
+
primary: "content",
|
|
6275
|
+
parts: [
|
|
6276
|
+
"content",
|
|
6277
|
+
"title",
|
|
6278
|
+
"description",
|
|
6279
|
+
"anchor",
|
|
6280
|
+
"trigger",
|
|
6281
|
+
"closeTrigger",
|
|
6282
|
+
"positioner",
|
|
6283
|
+
"arrow"
|
|
6284
|
+
]
|
|
5966
6285
|
});
|
|
5967
6286
|
const anchorAria = computed(() => useNativeTrigger.value ? {} : {
|
|
5968
6287
|
"aria-haspopup": "dialog",
|
|
5969
6288
|
"aria-expanded": isOpen.value,
|
|
5970
|
-
"aria-controls":
|
|
6289
|
+
"aria-controls": resolveId("content")
|
|
5971
6290
|
});
|
|
5972
6291
|
let timer = null;
|
|
5973
6292
|
const clearTimer = () => {
|
|
@@ -6009,11 +6328,11 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
6009
6328
|
const rootPositioning = computed(() => {
|
|
6010
6329
|
const user = attrs.positioning ?? {};
|
|
6011
6330
|
const placement = props.align === "center" ? props.side : `${props.side}-${props.align}`;
|
|
6012
|
-
return {
|
|
6331
|
+
return withSandboxStrategy(user, {
|
|
6013
6332
|
...user,
|
|
6014
6333
|
placement,
|
|
6015
6334
|
sameWidth: props.matchTriggerWidth || user.sameWidth
|
|
6016
|
-
};
|
|
6335
|
+
});
|
|
6017
6336
|
});
|
|
6018
6337
|
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"]));
|
|
6019
6338
|
const arrowClass = computed(() => cn("[--arrow-size:10px] [--arrow-background:var(--popover)]", props.arrowClass));
|
|
@@ -6023,7 +6342,7 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
6023
6342
|
return openBlock(), createBlock(unref(Popover).Root, mergeProps(unref(attrs), {
|
|
6024
6343
|
open: unref(isOpen),
|
|
6025
6344
|
positioning: rootPositioning.value,
|
|
6026
|
-
ids: rootIds
|
|
6345
|
+
ids: unref(rootIds),
|
|
6027
6346
|
"lazy-mount": props.lazyMount,
|
|
6028
6347
|
"unmount-on-exit": props.unmountOnExit,
|
|
6029
6348
|
"onUpdate:open": unref(setOpen)
|
|
@@ -6045,9 +6364,9 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
6045
6364
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
6046
6365
|
_: 3
|
|
6047
6366
|
}, 16)], 2112)) : createCommentVNode("v-if", true),
|
|
6048
|
-
createCommentVNode(" portal:Teleport(Ark Vue 原语不自带传送,浮层定位不受嵌套 overflow 裁剪影响);\n portal=false 时 disabled Teleport 面板留在原地;to 显式指定目标,\n
|
|
6367
|
+
createCommentVNode(" portal:Teleport(Ark Vue 原语不自带传送,浮层定位不受嵌套 overflow 裁剪影响);\n portal=false 时 disabled Teleport 面板留在原地;to 显式指定目标,\n 缺省时真 shadow DOM(getRootNode 检测)与 wujie graft(marker 检测)沙箱\n 自动降级为应用挂载容器,避免传送出 shadow root "),
|
|
6049
6368
|
(openBlock(), createBlock(Teleport, {
|
|
6050
|
-
to: teleportTarget
|
|
6369
|
+
to: unref(teleportTarget),
|
|
6051
6370
|
disabled: !props.portal
|
|
6052
6371
|
}, [createVNode(unref(Popover).Positioner, {
|
|
6053
6372
|
class: normalizeClass(positionerClass.value),
|
|
@@ -6125,6 +6444,203 @@ const _sfc_main$39 = /*@__PURE__*/ defineComponent({
|
|
|
6125
6444
|
}
|
|
6126
6445
|
});
|
|
6127
6446
|
//#endregion
|
|
6447
|
+
//#region src/components/table-render/TablePagination.vue
|
|
6448
|
+
const _hoisted_1$10 = {
|
|
6449
|
+
key: 0,
|
|
6450
|
+
class: "flex items-center gap-2 text-muted-foreground"
|
|
6451
|
+
};
|
|
6452
|
+
const _hoisted_2$9 = { key: 0 };
|
|
6453
|
+
const _hoisted_3$6 = ["value"];
|
|
6454
|
+
const _hoisted_4$4 = ["value"];
|
|
6455
|
+
const _hoisted_5$2 = {
|
|
6456
|
+
key: 0,
|
|
6457
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6458
|
+
viewBox: "0 0 24 24",
|
|
6459
|
+
fill: "none",
|
|
6460
|
+
stroke: "currentColor",
|
|
6461
|
+
"stroke-width": "2",
|
|
6462
|
+
"stroke-linecap": "round",
|
|
6463
|
+
"stroke-linejoin": "round",
|
|
6464
|
+
class: "size-4",
|
|
6465
|
+
"aria-hidden": "true"
|
|
6466
|
+
};
|
|
6467
|
+
const _hoisted_6$2 = {
|
|
6468
|
+
key: 0,
|
|
6469
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6470
|
+
viewBox: "0 0 24 24",
|
|
6471
|
+
fill: "none",
|
|
6472
|
+
stroke: "currentColor",
|
|
6473
|
+
"stroke-width": "2",
|
|
6474
|
+
"stroke-linecap": "round",
|
|
6475
|
+
"stroke-linejoin": "round",
|
|
6476
|
+
class: "size-4",
|
|
6477
|
+
"aria-hidden": "true"
|
|
6478
|
+
};
|
|
6479
|
+
const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
6480
|
+
__name: "TablePagination",
|
|
6481
|
+
props: {
|
|
6482
|
+
/** 组合式:传 defineTable 返回值,自动接线 page/动作并按 R13 单页自隐藏;
|
|
6483
|
+
* 与手动分页 props 同传时以 definition 为准(DEV 警告,R29/R4 对齐) */
|
|
6484
|
+
definition: { type: Object },
|
|
6485
|
+
/** 1-based 当前页码(手动模式) */
|
|
6486
|
+
pageIndex: {
|
|
6487
|
+
type: Number,
|
|
6488
|
+
default: void 0
|
|
6489
|
+
},
|
|
6490
|
+
pageSize: {
|
|
6491
|
+
type: Number,
|
|
6492
|
+
default: void 0
|
|
6493
|
+
},
|
|
6494
|
+
pageSizeOpts: {
|
|
6495
|
+
type: Array,
|
|
6496
|
+
default: void 0
|
|
6497
|
+
},
|
|
6498
|
+
total: {
|
|
6499
|
+
type: Number,
|
|
6500
|
+
default: void 0
|
|
6501
|
+
},
|
|
6502
|
+
/** 「共 N 条」,缺省 true */
|
|
6503
|
+
showTotal: {
|
|
6504
|
+
type: Boolean,
|
|
6505
|
+
default: void 0
|
|
6506
|
+
},
|
|
6507
|
+
/** 条/页 select,缺省 false(组合式简形分页条可保持关闭) */
|
|
6508
|
+
showSizeSelect: {
|
|
6509
|
+
type: Boolean,
|
|
6510
|
+
default: void 0
|
|
6511
|
+
},
|
|
6512
|
+
/** 上一页/下一页形态:text 文字(缺省)/ icon 图标 */
|
|
6513
|
+
navMode: {
|
|
6514
|
+
type: String,
|
|
6515
|
+
default: "text"
|
|
6516
|
+
}
|
|
6517
|
+
},
|
|
6518
|
+
emits: ["update:pageIndex", "update:pageSize"],
|
|
6519
|
+
setup(__props, { emit: __emit }) {
|
|
6520
|
+
const props = __props;
|
|
6521
|
+
const emit = __emit;
|
|
6522
|
+
if (import.meta.env.DEV) {
|
|
6523
|
+
if (props.definition && (props.pageIndex !== void 0 || props.pageSize !== void 0 || props.pageSizeOpts !== void 0 || props.total !== void 0)) console.warn("[tu-design] <TablePagination> definition 与手动分页 props 同传,已按 definition 渲染。");
|
|
6524
|
+
if (!props.definition && (props.pageIndex === void 0 || props.pageSize === void 0 || props.total === void 0)) console.warn("[tu-design] <TablePagination> 缺少 definition 或 pageIndex/pageSize/total,组件不渲染。");
|
|
6525
|
+
}
|
|
6526
|
+
const pageIndex = computed(() => props.definition?.page.pageIndex ?? props.pageIndex);
|
|
6527
|
+
const pageSize = computed(() => props.definition?.page.pageSize ?? props.pageSize);
|
|
6528
|
+
const pageSizeOpts = computed(() => props.definition?.page.pageSizeOpts ?? props.pageSizeOpts);
|
|
6529
|
+
const total = computed(() => props.definition?.page.total ?? props.total);
|
|
6530
|
+
const totalPages = computed(() => Math.max(1, Math.ceil((total.value ?? 0) / (pageSize.value ?? 1))));
|
|
6531
|
+
/** 可见性:definition 模式按 R13 单页自隐藏;手动模式须 pageIndex/pageSize/total 齐备(缺项 DEV 警告 + 不渲染) */
|
|
6532
|
+
const visible = computed(() => {
|
|
6533
|
+
if (props.definition !== void 0) return Math.ceil((total.value ?? 0) / (pageSize.value ?? 1)) > 1;
|
|
6534
|
+
return props.pageIndex !== void 0 && props.pageSize !== void 0 && props.total !== void 0;
|
|
6535
|
+
});
|
|
6536
|
+
const showTotalBar = computed(() => props.showTotal ?? true);
|
|
6537
|
+
const showSelect = computed(() => props.showSizeSelect ?? false);
|
|
6538
|
+
const iconMode = computed(() => props.navMode === "icon");
|
|
6539
|
+
const hasLeft = computed(() => showTotalBar.value || showSelect.value);
|
|
6540
|
+
function onPageIndex(value) {
|
|
6541
|
+
props.definition?.setPageIndex(value);
|
|
6542
|
+
emit("update:pageIndex", value);
|
|
6543
|
+
}
|
|
6544
|
+
function onPageSize(value) {
|
|
6545
|
+
props.definition?.setPageSize(value);
|
|
6546
|
+
emit("update:pageSize", value);
|
|
6547
|
+
}
|
|
6548
|
+
/** 页码窗口:首页/尾页 + 当前页 ±1,跳过段用省略号(D12) */
|
|
6549
|
+
const pages = computed(() => {
|
|
6550
|
+
const count = totalPages.value;
|
|
6551
|
+
const current = pageIndex.value ?? 1;
|
|
6552
|
+
const window = [.../* @__PURE__ */ new Set([
|
|
6553
|
+
1,
|
|
6554
|
+
count,
|
|
6555
|
+
current - 1,
|
|
6556
|
+
current,
|
|
6557
|
+
current + 1
|
|
6558
|
+
])].filter((page) => page >= 1 && page <= count).sort((a, b) => a - b);
|
|
6559
|
+
const items = [];
|
|
6560
|
+
let previous = 0;
|
|
6561
|
+
for (const page of window) {
|
|
6562
|
+
if (previous && page - previous > 1) items.push("…");
|
|
6563
|
+
items.push(page);
|
|
6564
|
+
previous = page;
|
|
6565
|
+
}
|
|
6566
|
+
return items;
|
|
6567
|
+
});
|
|
6568
|
+
return (_ctx, _cache) => {
|
|
6569
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" R31:不带 border-t(布局归使用方,TableRender 内置使用处显式补);左区缺省时页码靠右 "), visible.value ? (openBlock(), createElementBlock("div", {
|
|
6570
|
+
key: 0,
|
|
6571
|
+
class: normalizeClass(unref(cn)("flex w-full items-center gap-4 p-2 text-sm", hasLeft.value ? "justify-between" : "justify-end", _ctx.$attrs.class))
|
|
6572
|
+
}, [
|
|
6573
|
+
hasLeft.value ? (openBlock(), createElementBlock("div", _hoisted_1$10, [showTotalBar.value ? (openBlock(), createElementBlock("span", _hoisted_2$9, "共 " + toDisplayString(total.value) + " 条", 1)) : createCommentVNode("v-if", true), showSelect.value ? (openBlock(), createElementBlock("select", {
|
|
6574
|
+
key: 1,
|
|
6575
|
+
class: "h-8 rounded-md border bg-transparent px-2 text-sm",
|
|
6576
|
+
value: pageSize.value,
|
|
6577
|
+
onChange: _cache[0] || (_cache[0] = ($event) => onPageSize(Number($event.target.value)))
|
|
6578
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(pageSizeOpts.value, (size) => {
|
|
6579
|
+
return openBlock(), createElementBlock("option", {
|
|
6580
|
+
key: size,
|
|
6581
|
+
value: size
|
|
6582
|
+
}, toDisplayString(size) + " 条/页", 9, _hoisted_4$4);
|
|
6583
|
+
}), 128))], 40, _hoisted_3$6)) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
|
|
6584
|
+
createCommentVNode(" Root 渲染为裸 nav 且 Ellipsis 是块级 div,必须显式 flex 才不会断行 "),
|
|
6585
|
+
createVNode(unref(PaginationRoot), {
|
|
6586
|
+
class: "flex items-center gap-1",
|
|
6587
|
+
count: total.value ?? 0,
|
|
6588
|
+
page: pageIndex.value ?? 1,
|
|
6589
|
+
"page-size": pageSize.value ?? 1,
|
|
6590
|
+
"sibling-count": 1,
|
|
6591
|
+
onPageChange: _cache[1] || (_cache[1] = ($event) => onPageIndex($event.page))
|
|
6592
|
+
}, {
|
|
6593
|
+
default: withCtx(() => [
|
|
6594
|
+
createVNode(unref(PaginationPrevTrigger), {
|
|
6595
|
+
class: normalizeClass(["h-8 rounded-md border px-2 disabled:opacity-50", { "px-3": !iconMode.value }]),
|
|
6596
|
+
disabled: (pageIndex.value ?? 1) <= 1,
|
|
6597
|
+
"aria-label": iconMode.value ? "上一页" : void 0
|
|
6598
|
+
}, {
|
|
6599
|
+
default: withCtx(() => [iconMode.value ? (openBlock(), createElementBlock("svg", _hoisted_5$2, [..._cache[2] || (_cache[2] = [createElementVNode("path", { d: "m15 18-6-6 6-6" }, null, -1)])])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode("上一页")], 64))]),
|
|
6600
|
+
_: 1
|
|
6601
|
+
}, 8, [
|
|
6602
|
+
"class",
|
|
6603
|
+
"disabled",
|
|
6604
|
+
"aria-label"
|
|
6605
|
+
]),
|
|
6606
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (item, index) => {
|
|
6607
|
+
return openBlock(), createElementBlock(Fragment, { key: typeof item === "number" ? item : `gap-${index}` }, [typeof item === "string" ? (openBlock(), createBlock(unref(PaginationEllipsis), {
|
|
6608
|
+
key: 0,
|
|
6609
|
+
index
|
|
6610
|
+
}, null, 8, ["index"])) : (openBlock(), createBlock(unref(PaginationItem), {
|
|
6611
|
+
key: 1,
|
|
6612
|
+
type: "page",
|
|
6613
|
+
class: "h-8 min-w-8 rounded-md border px-2 data-[selected]:bg-primary data-[selected]:text-primary-foreground",
|
|
6614
|
+
value: item
|
|
6615
|
+
}, {
|
|
6616
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item), 1)]),
|
|
6617
|
+
_: 2
|
|
6618
|
+
}, 1032, ["value"]))], 64);
|
|
6619
|
+
}), 128)),
|
|
6620
|
+
createVNode(unref(PaginationNextTrigger), {
|
|
6621
|
+
class: normalizeClass(["h-8 rounded-md border px-2 disabled:opacity-50", { "px-3": !iconMode.value }]),
|
|
6622
|
+
disabled: (pageIndex.value ?? 1) >= totalPages.value,
|
|
6623
|
+
"aria-label": iconMode.value ? "下一页" : void 0
|
|
6624
|
+
}, {
|
|
6625
|
+
default: withCtx(() => [iconMode.value ? (openBlock(), createElementBlock("svg", _hoisted_6$2, [..._cache[3] || (_cache[3] = [createElementVNode("path", { d: "m9 18 6-6-6-6" }, null, -1)])])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode("下一页")], 64))]),
|
|
6626
|
+
_: 1
|
|
6627
|
+
}, 8, [
|
|
6628
|
+
"class",
|
|
6629
|
+
"disabled",
|
|
6630
|
+
"aria-label"
|
|
6631
|
+
])
|
|
6632
|
+
]),
|
|
6633
|
+
_: 1
|
|
6634
|
+
}, 8, [
|
|
6635
|
+
"count",
|
|
6636
|
+
"page",
|
|
6637
|
+
"page-size"
|
|
6638
|
+
])
|
|
6639
|
+
], 2)) : createCommentVNode("v-if", true)], 2112);
|
|
6640
|
+
};
|
|
6641
|
+
}
|
|
6642
|
+
});
|
|
6643
|
+
//#endregion
|
|
6128
6644
|
//#region src/components/table-render/column-renders.ts
|
|
6129
6645
|
const pad = (value) => String(value).padStart(2, "0");
|
|
6130
6646
|
/** 迷你日期令牌格式化,不引入 date-fns;非法输入原样返回 */
|
|
@@ -6199,7 +6715,7 @@ function columnRenders() {
|
|
|
6199
6715
|
}
|
|
6200
6716
|
//#endregion
|
|
6201
6717
|
//#region src/components/tooltip/Tooltip.vue
|
|
6202
|
-
const _sfc_main$
|
|
6718
|
+
const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
6203
6719
|
__name: "Tooltip",
|
|
6204
6720
|
props: {
|
|
6205
6721
|
/** 提示文字;#content 插槽可覆盖以渲染富内容 */
|
|
@@ -6243,10 +6759,26 @@ const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
|
6243
6759
|
contentProps: {
|
|
6244
6760
|
type: Object,
|
|
6245
6761
|
default: void 0
|
|
6762
|
+
},
|
|
6763
|
+
/** Ark Tooltip Root 的 positioning 配置(placement/gutter 等);
|
|
6764
|
+
iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
|
|
6765
|
+
(absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
|
|
6766
|
+
positioning: {
|
|
6767
|
+
type: Object,
|
|
6768
|
+
default: void 0
|
|
6246
6769
|
}
|
|
6247
6770
|
},
|
|
6248
6771
|
emits: ["update:open"],
|
|
6249
6772
|
setup(__props, { emit: __emit }) {
|
|
6773
|
+
const { ids: rootIds } = useOverlayIds(useAttrs(), {
|
|
6774
|
+
primary: "content",
|
|
6775
|
+
parts: [
|
|
6776
|
+
"content",
|
|
6777
|
+
"trigger",
|
|
6778
|
+
"positioner",
|
|
6779
|
+
"arrow"
|
|
6780
|
+
]
|
|
6781
|
+
});
|
|
6250
6782
|
const props = __props;
|
|
6251
6783
|
const emit = __emit;
|
|
6252
6784
|
const slots = useSlots();
|
|
@@ -6255,13 +6787,16 @@ const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
|
6255
6787
|
defaultValue: () => props.defaultOpen,
|
|
6256
6788
|
onChange: (open) => emit("update:open", open)
|
|
6257
6789
|
});
|
|
6790
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
|
|
6258
6791
|
return (_ctx, _cache) => {
|
|
6259
6792
|
return openBlock(), createBlock(unref(Tooltip).Root, {
|
|
6793
|
+
ids: unref(rootIds),
|
|
6260
6794
|
open: unref(isOpen),
|
|
6261
6795
|
"open-delay": props.delayDuration,
|
|
6262
6796
|
"close-delay": props.closeDuration,
|
|
6263
6797
|
"lazy-mount": props.lazyMount,
|
|
6264
6798
|
"unmount-on-exit": props.unmountOnExit,
|
|
6799
|
+
positioning: rootPositioning.value,
|
|
6265
6800
|
"onUpdate:open": unref(setOpen)
|
|
6266
6801
|
}, {
|
|
6267
6802
|
default: withCtx(() => [
|
|
@@ -6283,11 +6818,13 @@ const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
|
6283
6818
|
]),
|
|
6284
6819
|
_: 3
|
|
6285
6820
|
}, 8, [
|
|
6821
|
+
"ids",
|
|
6286
6822
|
"open",
|
|
6287
6823
|
"open-delay",
|
|
6288
6824
|
"close-delay",
|
|
6289
6825
|
"lazy-mount",
|
|
6290
6826
|
"unmount-on-exit",
|
|
6827
|
+
"positioning",
|
|
6291
6828
|
"onUpdate:open"
|
|
6292
6829
|
]);
|
|
6293
6830
|
};
|
|
@@ -6297,6 +6834,8 @@ const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
|
6297
6834
|
//#region src/components/table-render/constants.ts
|
|
6298
6835
|
/** 选择列在 sticky 映射中的哨兵键(选择列不在 columns 内,表头/表体单独渲染) */
|
|
6299
6836
|
const SELECTION_CELL = "__selection__";
|
|
6837
|
+
/** 布局容器与 TableRender 的跨包填充协议 key:provide(true) 声明容器内 TableRender 应填满、内部滚动、表头固定 */
|
|
6838
|
+
const PAGE_TABLE_FILL_KEY = "tu-design:page-table-fill";
|
|
6300
6839
|
//#endregion
|
|
6301
6840
|
//#region src/components/table-render/sticky.ts
|
|
6302
6841
|
/** sticky 定位样式;head 为 true 时 z-index 高于表体(表头压住表体 sticky) */
|
|
@@ -6321,13 +6860,13 @@ function stickyClass(sticky, key) {
|
|
|
6321
6860
|
}
|
|
6322
6861
|
//#endregion
|
|
6323
6862
|
//#region src/components/table-render/TableBodyRow.vue
|
|
6324
|
-
const _hoisted_1$
|
|
6863
|
+
const _hoisted_1$9 = [
|
|
6325
6864
|
"checked",
|
|
6326
6865
|
"disabled",
|
|
6327
6866
|
"aria-label"
|
|
6328
6867
|
];
|
|
6329
|
-
const _hoisted_2$
|
|
6330
|
-
const _hoisted_3$
|
|
6868
|
+
const _hoisted_2$8 = ["title", "onClick"];
|
|
6869
|
+
const _hoisted_3$5 = ["aria-expanded", "aria-label"];
|
|
6331
6870
|
const _hoisted_4$3 = {
|
|
6332
6871
|
key: 2,
|
|
6333
6872
|
class: "min-w-0 truncate"
|
|
@@ -6382,7 +6921,7 @@ const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
|
6382
6921
|
* VNode(render 工厂)单元格经 cloneVNode 复制进触发位(VNode 不可二次挂载)。 */
|
|
6383
6922
|
function tooltipCell(value, text) {
|
|
6384
6923
|
const trigger = isVNode(value) ? cloneVNode(value) : h("span", { class: "block truncate" }, text);
|
|
6385
|
-
return h(_sfc_main$
|
|
6924
|
+
return h(_sfc_main$49, {
|
|
6386
6925
|
delayDuration: 0,
|
|
6387
6926
|
content: text
|
|
6388
6927
|
}, { default: () => [trigger] });
|
|
@@ -6408,7 +6947,7 @@ const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
|
6408
6947
|
disabled: !props.line.canSelect,
|
|
6409
6948
|
"aria-label": `选择第 ${props.line.index + 1} 行`,
|
|
6410
6949
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("select", !props.selected))
|
|
6411
|
-
}, null, 8, _hoisted_1$
|
|
6950
|
+
}, null, 8, _hoisted_1$9)) : (openBlock(), createBlock(unref(_sfc_main$9), {
|
|
6412
6951
|
key: 1,
|
|
6413
6952
|
checked: props.selected,
|
|
6414
6953
|
disabled: !props.line.canSelect,
|
|
@@ -6438,114 +6977,16 @@ const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
|
6438
6977
|
"aria-expanded": props.line.row.getIsExpanded(),
|
|
6439
6978
|
"aria-label": props.line.row.getIsExpanded() ? "收起" : "展开",
|
|
6440
6979
|
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => props.line.row.toggleExpanded(), ["stop"]))
|
|
6441
|
-
}, [createVNode(ChevronIcon_default, { class: normalizeClass(["size-3.5 transition-transform", { "rotate-90": props.line.row.getIsExpanded() }]) }, null, 8, ["class"])], 8, _hoisted_3$
|
|
6980
|
+
}, [createVNode(ChevronIcon_default, { class: normalizeClass(["size-3.5 transition-transform", { "rotate-90": props.line.row.getIsExpanded() }]) }, null, 8, ["class"])], 8, _hoisted_3$5)) : createCommentVNode("v-if", true),
|
|
6442
6981
|
createCommentVNode(" VNode 必须走子节点渲染;文本插值会序列化 vnode 导致循环引用 "),
|
|
6443
6982
|
isVNode(value) ? (openBlock(), createBlock(resolveDynamicComponent(value), { key: 1 })) : (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString(value), 1))
|
|
6444
|
-
], 4)) : props.columns[index].ellipsis === "tooltip" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" ellipsis: \"tooltip\":Tooltip 包装(VNode 经 cloneVNode 复制,避免二次挂载) "), (openBlock(), createBlock(resolveDynamicComponent(tooltipCell(value, cellText(props.line, index)))))], 2112)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" VNode 必须走子节点渲染;文本插值会序列化 vnode 导致循环引用 "), isVNode(value) ? (openBlock(), createBlock(resolveDynamicComponent(value), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(value), 1)], 64))], 64))], 14, _hoisted_2$
|
|
6983
|
+
], 4)) : props.columns[index].ellipsis === "tooltip" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" ellipsis: \"tooltip\":Tooltip 包装(VNode 经 cloneVNode 复制,避免二次挂载) "), (openBlock(), createBlock(resolveDynamicComponent(tooltipCell(value, cellText(props.line, index)))))], 2112)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" VNode 必须走子节点渲染;文本插值会序列化 vnode 导致循环引用 "), isVNode(value) ? (openBlock(), createBlock(resolveDynamicComponent(value), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(value), 1)], 64))], 64))], 14, _hoisted_2$8);
|
|
6445
6984
|
}), 128))
|
|
6446
6985
|
], 32);
|
|
6447
6986
|
};
|
|
6448
6987
|
}
|
|
6449
6988
|
});
|
|
6450
6989
|
//#endregion
|
|
6451
|
-
//#region src/components/table-render/TablePagination.vue
|
|
6452
|
-
const _hoisted_1$9 = { class: "flex items-center gap-2 text-muted-foreground" };
|
|
6453
|
-
const _hoisted_2$8 = ["value"];
|
|
6454
|
-
const _hoisted_3$5 = ["value"];
|
|
6455
|
-
const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
6456
|
-
__name: "TablePagination",
|
|
6457
|
-
props: {
|
|
6458
|
-
pageIndex: {},
|
|
6459
|
-
pageSize: {},
|
|
6460
|
-
pageSizeOpts: {},
|
|
6461
|
-
total: {}
|
|
6462
|
-
},
|
|
6463
|
-
emits: ["update:pageIndex", "update:pageSize"],
|
|
6464
|
-
setup(__props, { emit: __emit }) {
|
|
6465
|
-
const props = __props;
|
|
6466
|
-
const emit = __emit;
|
|
6467
|
-
const totalPages = computed(() => Math.max(1, Math.ceil(props.total / props.pageSize)));
|
|
6468
|
-
/** 页码窗口:首页/尾页 + 当前页 ±1,跳过段用省略号(D12) */
|
|
6469
|
-
const pages = computed(() => {
|
|
6470
|
-
const count = totalPages.value;
|
|
6471
|
-
const window = [.../* @__PURE__ */ new Set([
|
|
6472
|
-
1,
|
|
6473
|
-
count,
|
|
6474
|
-
props.pageIndex - 1,
|
|
6475
|
-
props.pageIndex,
|
|
6476
|
-
props.pageIndex + 1
|
|
6477
|
-
])].filter((page) => page >= 1 && page <= count).sort((a, b) => a - b);
|
|
6478
|
-
const items = [];
|
|
6479
|
-
let previous = 0;
|
|
6480
|
-
for (const page of window) {
|
|
6481
|
-
if (previous && page - previous > 1) items.push("…");
|
|
6482
|
-
items.push(page);
|
|
6483
|
-
previous = page;
|
|
6484
|
-
}
|
|
6485
|
-
return items;
|
|
6486
|
-
});
|
|
6487
|
-
return (_ctx, _cache) => {
|
|
6488
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("flex w-full items-center justify-between gap-4 border-t p-2 text-sm", _ctx.$attrs.class)) }, [
|
|
6489
|
-
createElementVNode("div", _hoisted_1$9, [createElementVNode("span", null, "共 " + toDisplayString(__props.total) + " 条", 1), createElementVNode("select", {
|
|
6490
|
-
class: "h-8 rounded-md border bg-transparent px-2 text-sm",
|
|
6491
|
-
value: __props.pageSize,
|
|
6492
|
-
onChange: _cache[0] || (_cache[0] = ($event) => emit("update:pageSize", Number($event.target.value)))
|
|
6493
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.pageSizeOpts, (size) => {
|
|
6494
|
-
return openBlock(), createElementBlock("option", {
|
|
6495
|
-
key: size,
|
|
6496
|
-
value: size
|
|
6497
|
-
}, toDisplayString(size) + " 条/页", 9, _hoisted_3$5);
|
|
6498
|
-
}), 128))], 40, _hoisted_2$8)]),
|
|
6499
|
-
createCommentVNode(" Root 渲染为裸 nav 且 Ellipsis 是块级 div,必须显式 flex 才不会断行 "),
|
|
6500
|
-
createVNode(unref(PaginationRoot), {
|
|
6501
|
-
class: "flex items-center gap-1",
|
|
6502
|
-
count: __props.total,
|
|
6503
|
-
page: __props.pageIndex,
|
|
6504
|
-
"page-size": __props.pageSize,
|
|
6505
|
-
"sibling-count": 1,
|
|
6506
|
-
onPageChange: _cache[1] || (_cache[1] = ($event) => emit("update:pageIndex", $event.page))
|
|
6507
|
-
}, {
|
|
6508
|
-
default: withCtx(() => [
|
|
6509
|
-
createVNode(unref(PaginationPrevTrigger), {
|
|
6510
|
-
class: "h-8 rounded-md border px-3 disabled:opacity-50",
|
|
6511
|
-
disabled: __props.pageIndex <= 1
|
|
6512
|
-
}, {
|
|
6513
|
-
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" 上一页 ", -1)])]),
|
|
6514
|
-
_: 1
|
|
6515
|
-
}, 8, ["disabled"]),
|
|
6516
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (item, index) => {
|
|
6517
|
-
return openBlock(), createElementBlock(Fragment, { key: typeof item === "number" ? item : `gap-${index}` }, [typeof item === "string" ? (openBlock(), createBlock(unref(PaginationEllipsis), {
|
|
6518
|
-
key: 0,
|
|
6519
|
-
index
|
|
6520
|
-
}, null, 8, ["index"])) : (openBlock(), createBlock(unref(PaginationItem), {
|
|
6521
|
-
key: 1,
|
|
6522
|
-
type: "page",
|
|
6523
|
-
class: "h-8 min-w-8 rounded-md border px-2 data-[selected]:bg-primary data-[selected]:text-primary-foreground",
|
|
6524
|
-
value: item
|
|
6525
|
-
}, {
|
|
6526
|
-
default: withCtx(() => [createTextVNode(toDisplayString(item), 1)]),
|
|
6527
|
-
_: 2
|
|
6528
|
-
}, 1032, ["value"]))], 64);
|
|
6529
|
-
}), 128)),
|
|
6530
|
-
createVNode(unref(PaginationNextTrigger), {
|
|
6531
|
-
class: "h-8 rounded-md border px-3 disabled:opacity-50",
|
|
6532
|
-
disabled: __props.pageIndex >= totalPages.value
|
|
6533
|
-
}, {
|
|
6534
|
-
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" 下一页 ", -1)])]),
|
|
6535
|
-
_: 1
|
|
6536
|
-
}, 8, ["disabled"])
|
|
6537
|
-
]),
|
|
6538
|
-
_: 1
|
|
6539
|
-
}, 8, [
|
|
6540
|
-
"count",
|
|
6541
|
-
"page",
|
|
6542
|
-
"page-size"
|
|
6543
|
-
])
|
|
6544
|
-
], 2);
|
|
6545
|
-
};
|
|
6546
|
-
}
|
|
6547
|
-
});
|
|
6548
|
-
//#endregion
|
|
6549
6990
|
//#region src/components/table-render/useTableRender.ts
|
|
6550
6991
|
const DEFAULT_PAGE_SIZE_OPTS = [
|
|
6551
6992
|
10,
|
|
@@ -6954,16 +7395,12 @@ function useTableRender(options) {
|
|
|
6954
7395
|
}
|
|
6955
7396
|
//#endregion
|
|
6956
7397
|
//#region src/components/table-render/TableRender.vue
|
|
6957
|
-
const _hoisted_1$8 = {
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
const
|
|
6962
|
-
const
|
|
6963
|
-
const _hoisted_4$2 = { class: "max-h-64 overflow-y-auto py-1" };
|
|
6964
|
-
const _hoisted_5$1 = ["data-column-key", "onClick"];
|
|
6965
|
-
const _hoisted_6$1 = { class: "min-w-0 flex-1 truncate" };
|
|
6966
|
-
const _hoisted_7$1 = {
|
|
7398
|
+
const _hoisted_1$8 = { class: "flex items-center justify-end gap-3 px-3 py-2" };
|
|
7399
|
+
const _hoisted_2$7 = ["disabled"];
|
|
7400
|
+
const _hoisted_3$4 = { class: "max-h-64 overflow-y-auto py-1" };
|
|
7401
|
+
const _hoisted_4$2 = ["data-column-key", "onClick"];
|
|
7402
|
+
const _hoisted_5$1 = { class: "min-w-0 flex-1 truncate" };
|
|
7403
|
+
const _hoisted_6$1 = {
|
|
6967
7404
|
key: 0,
|
|
6968
7405
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6969
7406
|
viewBox: "0 0 24 24",
|
|
@@ -6975,25 +7412,24 @@ const _hoisted_7$1 = {
|
|
|
6975
7412
|
class: "text-muted-foreground size-3 shrink-0",
|
|
6976
7413
|
"aria-hidden": "true"
|
|
6977
7414
|
};
|
|
6978
|
-
const
|
|
6979
|
-
const
|
|
6980
|
-
const
|
|
6981
|
-
const _hoisted_11 = {
|
|
7415
|
+
const _hoisted_7$1 = ["aria-sort"];
|
|
7416
|
+
const _hoisted_8 = ["onClick"];
|
|
7417
|
+
const _hoisted_9 = {
|
|
6982
7418
|
"aria-hidden": "true",
|
|
6983
7419
|
class: "text-xs"
|
|
6984
7420
|
};
|
|
6985
|
-
const
|
|
6986
|
-
const
|
|
7421
|
+
const _hoisted_10 = { class: "[&_tr:last-child]:border-0" };
|
|
7422
|
+
const _hoisted_11 = { "data-error": "" };
|
|
7423
|
+
const _hoisted_12 = ["colspan"];
|
|
7424
|
+
const _hoisted_13 = { class: "flex flex-col items-center gap-3" };
|
|
6987
7425
|
const _hoisted_14 = ["colspan"];
|
|
6988
|
-
const _hoisted_15 =
|
|
6989
|
-
const _hoisted_16 =
|
|
6990
|
-
const _hoisted_17 = ["colspan"];
|
|
6991
|
-
const _hoisted_18 = {
|
|
7426
|
+
const _hoisted_15 = ["colspan"];
|
|
7427
|
+
const _hoisted_16 = {
|
|
6992
7428
|
key: 4,
|
|
6993
7429
|
"data-empty": ""
|
|
6994
7430
|
};
|
|
6995
|
-
const
|
|
6996
|
-
const _sfc_main$
|
|
7431
|
+
const _hoisted_17 = ["colspan"];
|
|
7432
|
+
const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
6997
7433
|
__name: "TableRender",
|
|
6998
7434
|
props: {
|
|
6999
7435
|
/** 聚合式(推荐):defineTable 返回的定义对象 */
|
|
@@ -7049,6 +7485,24 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7049
7485
|
columnSettings: {
|
|
7050
7486
|
type: Boolean,
|
|
7051
7487
|
default: void 0
|
|
7488
|
+
},
|
|
7489
|
+
/** 搜索区渲染开关(R27):false 关闭内置搜索区(组合式外置 FormRender);数据链路不变 */
|
|
7490
|
+
showSearch: {
|
|
7491
|
+
type: Boolean,
|
|
7492
|
+
default: void 0
|
|
7493
|
+
},
|
|
7494
|
+
/** 分页条渲染开关(R28):false 关闭内置分页条(组合式外置 TablePagination);缺省模式 R13 不变 */
|
|
7495
|
+
showPagination: {
|
|
7496
|
+
type: Boolean,
|
|
7497
|
+
default: void 0
|
|
7498
|
+
},
|
|
7499
|
+
/** 填充模式:根容器 h-full 纵向 flex,滚动区 flex-1 内滚;表头 sticky 钉住。
|
|
7500
|
+
* 父链需有确定高度(如页面布局的 .table-body);无确定高度时安全退化为自然高度。
|
|
7501
|
+
* 显式 prop 优先于布局 provide(key: "tu-design:page-table-fill");显式传 false 可强制关闭。
|
|
7502
|
+
* 纯布局属性,不进 defineTable/definition(virtual/height 例外),setup 期定版不支持运行时切换。 */
|
|
7503
|
+
fillHeight: {
|
|
7504
|
+
type: Boolean,
|
|
7505
|
+
default: void 0
|
|
7052
7506
|
}
|
|
7053
7507
|
},
|
|
7054
7508
|
emits: [
|
|
@@ -7069,6 +7523,8 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7069
7523
|
],
|
|
7070
7524
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7071
7525
|
const props = __props;
|
|
7526
|
+
const pageTableFill = inject(PAGE_TABLE_FILL_KEY, false);
|
|
7527
|
+
const fill = props.fillHeight ?? pageTableFill;
|
|
7072
7528
|
const emit = __emit;
|
|
7073
7529
|
/** 加载态骨架行数(R14) */
|
|
7074
7530
|
const SKELETON_ROWS = [
|
|
@@ -7132,6 +7588,10 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7132
7588
|
/** 内部加载态 ∪ 外部受控加载态(R14) */
|
|
7133
7589
|
const loading = computed(() => props.loading === true || instance.loading.value);
|
|
7134
7590
|
const showPagination = computed(() => Math.ceil(instance.page.total / instance.page.pageSize) > 1);
|
|
7591
|
+
/** 内置分页条开关(R28):showPagination=false 关闭;R13 仅作用于缺省模式 */
|
|
7592
|
+
const showPaginationBar = computed(() => showPagination.value && props.showPagination !== false);
|
|
7593
|
+
/** 内置搜索区开关(R27):配置了 search 且未被 showSearch=false 关闭;列设置触发器不受影响 */
|
|
7594
|
+
const showSearchArea = computed(() => search !== void 0 && props.showSearch !== false);
|
|
7135
7595
|
const loadError = computed(() => instance.error.value);
|
|
7136
7596
|
const showError = computed(() => !loading.value && loadError.value !== void 0);
|
|
7137
7597
|
watch(loadError, (err) => {
|
|
@@ -7269,9 +7729,27 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7269
7729
|
}
|
|
7270
7730
|
const virtualRaw = instance.virtual ?? props.virtual;
|
|
7271
7731
|
const heightRaw = instance.height ?? props.height;
|
|
7272
|
-
if (virtualRaw === true && heightRaw === void 0) console.warn("[tu-design] <TableRender> virtual 需要配置 height,已降级普通渲染。");
|
|
7273
|
-
const virtualEnabled = virtualRaw === true && heightRaw !== void 0;
|
|
7732
|
+
if (virtualRaw === true && heightRaw === void 0 && !fill) console.warn("[tu-design] <TableRender> virtual 需要配置 height,已降级普通渲染。");
|
|
7733
|
+
const virtualEnabled = virtualRaw === true && (heightRaw !== void 0 || fill);
|
|
7274
7734
|
const scrollHeight = computed(() => typeof heightRaw === "number" ? `${heightRaw}px` : heightRaw);
|
|
7735
|
+
/** 表头 sticky 仅在组件内存在真实纵向滚动盒时生效(fill / virtual),普通模式不挂载,行为不变 */
|
|
7736
|
+
const theadSticky = fill || virtualEnabled;
|
|
7737
|
+
/** 滚动区样式:virtual 用固定 height;fill 交给 flex 分配(二者同传以 fill 优先) */
|
|
7738
|
+
const scrollStyle = computed(() => {
|
|
7739
|
+
if (fill || !virtualEnabled) return void 0;
|
|
7740
|
+
return {
|
|
7741
|
+
height: scrollHeight.value,
|
|
7742
|
+
overflowY: "auto"
|
|
7743
|
+
};
|
|
7744
|
+
});
|
|
7745
|
+
/** sticky 表头普通列类:不透明底防行内容透出;分隔线归 th(thead 行级 border 会随行滚走);
|
|
7746
|
+
* z-20 高于表体 fixed 列(--z-sticky: 10),纵向滚动行滑过表头时不穿透;
|
|
7747
|
+
* 表头 fixed 列的 z 由 stickyStyle inline style(var(--z-sticky-head))提供,inline 优先级天然覆盖此处 class */
|
|
7748
|
+
const theadThClass = theadSticky ? "sticky top-0 z-20 border-b border-border bg-background" : "";
|
|
7749
|
+
/** sticky 态 table 改分离边框:preflight 为 border-collapse: collapse,
|
|
7750
|
+
* 折叠边框几何归属 table,Chrome 下 sticky th 粘住后自身 border-b 渲染丢失;
|
|
7751
|
+
* separate + spacing-0 恢复单元格边框。普通模式保持 collapse,零回归。 */
|
|
7752
|
+
const tableClass = theadSticky ? "border-separate border-spacing-0" : "";
|
|
7275
7753
|
const scrollEl = ref(null);
|
|
7276
7754
|
const theadEl = ref(null);
|
|
7277
7755
|
/** 滚动容器内 thead 占据的前缀高度(scrollMargin);表头内容静态,挂载后测量一次 */
|
|
@@ -7373,17 +7851,20 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7373
7851
|
clearSelection: instance.clearSelection
|
|
7374
7852
|
});
|
|
7375
7853
|
return (_ctx, _cache) => {
|
|
7376
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("w-full", _ctx.$attrs.class)) }, [
|
|
7377
|
-
createCommentVNode(" 搜索区 + 列设置触发器:同行右对齐(items-end
|
|
7378
|
-
|
|
7379
|
-
|
|
7854
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("w-full", unref(fill) && "flex h-full min-h-0 flex-col", _ctx.$attrs.class)) }, [
|
|
7855
|
+
createCommentVNode(" 搜索区 + 列设置触发器:同行右对齐(items-end);无搜索时触发器位于表格上方(R27:showSearch=false 关闭搜索区) "),
|
|
7856
|
+
showSearchArea.value || showColumnSettings.value ? (openBlock(), createElementBlock("div", {
|
|
7857
|
+
key: 0,
|
|
7858
|
+
class: normalizeClass(unref(cn)("mb-2 flex items-end justify-between gap-2", unref(fill) && "shrink-0"))
|
|
7859
|
+
}, [
|
|
7860
|
+
showSearchArea.value ? (openBlock(), createBlock(unref(_sfc_main$25), {
|
|
7380
7861
|
key: 0,
|
|
7381
7862
|
class: "min-w-0 flex-1",
|
|
7382
7863
|
definition: unref(search),
|
|
7383
|
-
searchable:
|
|
7864
|
+
searchable: unref(search).actions ? void 0 : true,
|
|
7384
7865
|
onSearch,
|
|
7385
7866
|
onReset
|
|
7386
|
-
}, null, 8, ["definition"])) : createCommentVNode("v-if", true),
|
|
7867
|
+
}, null, 8, ["definition", "searchable"])) : createCommentVNode("v-if", true),
|
|
7387
7868
|
createCommentVNode(" 列设置:Popover 面板(R20 最少一列 / R21 重置 / R22 不含选择列);\n 触发钮 Tooltip 手动受控开合(Tooltip 与 Popover 触发器嵌套会吞点击,故并列渲染、不走 hover 自动触发) "),
|
|
7388
7869
|
showColumnSettings.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
7389
7870
|
createVNode(unref(_sfc_main$34), {
|
|
@@ -7391,18 +7872,18 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7391
7872
|
"content-class": "w-56 p-0"
|
|
7392
7873
|
}, {
|
|
7393
7874
|
content: withCtx(() => [
|
|
7394
|
-
createElementVNode("div",
|
|
7875
|
+
createElementVNode("div", _hoisted_1$8, [createElementVNode("button", {
|
|
7395
7876
|
type: "button",
|
|
7396
7877
|
class: "text-muted-foreground hover:text-foreground cursor-pointer text-xs disabled:cursor-not-allowed disabled:opacity-50",
|
|
7397
7878
|
disabled: allColumnsVisible.value,
|
|
7398
7879
|
onClick: selectAllColumns
|
|
7399
|
-
}, " 全选 ", 8,
|
|
7880
|
+
}, " 全选 ", 8, _hoisted_2$7), createElementVNode("button", {
|
|
7400
7881
|
type: "button",
|
|
7401
7882
|
class: "text-muted-foreground hover:text-foreground cursor-pointer text-xs",
|
|
7402
7883
|
onClick: resetColumns
|
|
7403
7884
|
}, " 重置 ")]),
|
|
7404
7885
|
createVNode(unref(_sfc_main$38)),
|
|
7405
|
-
createElementVNode("div",
|
|
7886
|
+
createElementVNode("div", _hoisted_3$4, [(openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column) => {
|
|
7406
7887
|
return openBlock(), createElementBlock("div", {
|
|
7407
7888
|
key: column.key,
|
|
7408
7889
|
"data-column-item": "",
|
|
@@ -7420,10 +7901,10 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7420
7901
|
"disabled",
|
|
7421
7902
|
"onUpdate:checked"
|
|
7422
7903
|
]),
|
|
7423
|
-
createElementVNode("span",
|
|
7904
|
+
createElementVNode("span", _hoisted_5$1, toDisplayString(column.title), 1),
|
|
7424
7905
|
createCommentVNode(" 有效 fixed 列(数字 width)标识 "),
|
|
7425
|
-
column.fixed !== void 0 && typeof column.width === "number" ? (openBlock(), createElementBlock("svg",
|
|
7426
|
-
], 8,
|
|
7906
|
+
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)
|
|
7907
|
+
], 8, _hoisted_4$2);
|
|
7427
7908
|
}), 128))])
|
|
7428
7909
|
]),
|
|
7429
7910
|
default: withCtx(() => [createVNode(unref(_sfc_main$5), {
|
|
@@ -7463,31 +7944,28 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7463
7944
|
_: 1
|
|
7464
7945
|
}),
|
|
7465
7946
|
createCommentVNode(" 纯受控气泡(无默认插槽,不渲染触发器):开合由触发钮 pointerenter/leave 驱动 "),
|
|
7466
|
-
createVNode(unref(_sfc_main$
|
|
7947
|
+
createVNode(unref(_sfc_main$49), {
|
|
7467
7948
|
open: settingsTipOpen.value,
|
|
7468
7949
|
content: "列设置"
|
|
7469
7950
|
}, null, 8, ["open"])
|
|
7470
7951
|
], 64)) : createCommentVNode("v-if", true)
|
|
7471
|
-
])) : createCommentVNode("v-if", true),
|
|
7472
|
-
createCommentVNode(" 滚动容器:横向滚动时 fixed 列 sticky 生效;virtual 模式兼任纵向滚动(分页条不参与滚动) "),
|
|
7952
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
7953
|
+
createCommentVNode(" 滚动容器:横向滚动时 fixed 列 sticky 生效;virtual/fill 模式兼任纵向滚动(分页条不参与滚动) "),
|
|
7473
7954
|
createElementVNode("div", {
|
|
7474
7955
|
ref_key: "scrollEl",
|
|
7475
7956
|
ref: scrollEl,
|
|
7476
|
-
class: "overflow-x-auto",
|
|
7477
|
-
style: normalizeStyle(
|
|
7478
|
-
|
|
7479
|
-
overflowY: "auto"
|
|
7480
|
-
} : void 0)
|
|
7481
|
-
}, [createElementVNode("table", _hoisted_8, [createElementVNode("thead", {
|
|
7957
|
+
class: normalizeClass(unref(cn)("overflow-x-auto", unref(fill) && "min-h-0 flex-1 overflow-y-auto")),
|
|
7958
|
+
style: normalizeStyle(scrollStyle.value)
|
|
7959
|
+
}, [createElementVNode("table", { class: normalizeClass(["w-full caption-bottom text-sm", unref(tableClass)]) }, [createElementVNode("thead", {
|
|
7482
7960
|
ref_key: "theadEl",
|
|
7483
7961
|
ref: theadEl,
|
|
7484
|
-
class: "[&_tr]:border-b"
|
|
7962
|
+
class: normalizeClass(unref(theadSticky) ? void 0 : "[&_tr]:border-b")
|
|
7485
7963
|
}, [createElementVNode("tr", null, [
|
|
7486
7964
|
createCommentVNode(" 选择列:checkbox 型表头为本页全选三态(S3/S10);radio 型占位;视作最左固定列 "),
|
|
7487
7965
|
hasSelection.value ? (openBlock(), createElementBlock("th", {
|
|
7488
7966
|
key: 0,
|
|
7489
7967
|
scope: "col",
|
|
7490
|
-
class: normalizeClass(["h-10 w-12 px-2 align-middle font-medium text-muted-foreground", unref(stickyClass)(stickyOf.value, unref(SELECTION_CELL))]),
|
|
7968
|
+
class: normalizeClass(["h-10 w-12 px-2 align-middle font-medium text-muted-foreground", [unref(stickyClass)(stickyOf.value, unref(SELECTION_CELL)), unref(theadThClass)]]),
|
|
7491
7969
|
style: normalizeStyle([{ width: `${selection.value.width}px` }, unref(stickyStyle)(stickyOf.value, unref(SELECTION_CELL), true)])
|
|
7492
7970
|
}, [selection.value.type === "checkbox" ? (openBlock(), createBlock(unref(_sfc_main$9), {
|
|
7493
7971
|
key: 0,
|
|
@@ -7499,7 +7977,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7499
7977
|
return openBlock(), createElementBlock("th", {
|
|
7500
7978
|
key: column.key,
|
|
7501
7979
|
scope: "col",
|
|
7502
|
-
class: normalizeClass(["h-10 px-2 align-middle font-medium text-muted-foreground", unref(stickyClass)(stickyOf.value, column.key)]),
|
|
7980
|
+
class: normalizeClass(["h-10 px-2 align-middle font-medium text-muted-foreground", [unref(stickyClass)(stickyOf.value, column.key), unref(theadThClass)]]),
|
|
7503
7981
|
style: normalizeStyle([{
|
|
7504
7982
|
width: column.width,
|
|
7505
7983
|
textAlign: column.align
|
|
@@ -7510,9 +7988,9 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7510
7988
|
type: "button",
|
|
7511
7989
|
class: "inline-flex items-center gap-1 hover:text-foreground",
|
|
7512
7990
|
onClick: ($event) => onSort(column.key)
|
|
7513
|
-
}, [createTextVNode(toDisplayString(column.title) + " ", 1), createElementVNode("span",
|
|
7991
|
+
}, [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);
|
|
7514
7992
|
}), 128))
|
|
7515
|
-
])],
|
|
7993
|
+
])], 2), createElementVNode("tbody", _hoisted_10, [
|
|
7516
7994
|
createCommentVNode(" 加载态:固定 5 行骨架(R14);选择列一并占位(S8);骨架不虚拟化;loading 判定优先 "),
|
|
7517
7995
|
loading.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList(SKELETON_ROWS, (row) => {
|
|
7518
7996
|
return createElementVNode("tr", {
|
|
@@ -7529,20 +8007,20 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7529
8007
|
style: normalizeStyle([{ textAlign: column.align }, unref(stickyStyle)(stickyOf.value, column.key, false)])
|
|
7530
8008
|
}, [createVNode(unref(_sfc_main$39), { class: "h-4 w-full" })], 6);
|
|
7531
8009
|
}), 128))]);
|
|
7532
|
-
}), 64)) : showError.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 错误态:error 优先于正常数据;插槽可自定义(slot props { error, retry }) "), createElementVNode("tr",
|
|
8010
|
+
}), 64)) : showError.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" 错误态:error 优先于正常数据;插槽可自定义(slot props { error, retry }) "), createElementVNode("tr", _hoisted_11, [createElementVNode("td", {
|
|
7533
8011
|
colspan: columnCount.value,
|
|
7534
8012
|
class: "p-8 text-center text-muted-foreground"
|
|
7535
8013
|
}, [renderSlot(_ctx.$slots, "error", {
|
|
7536
8014
|
error: loadError.value,
|
|
7537
8015
|
retry
|
|
7538
|
-
}, () => [createElementVNode("div",
|
|
8016
|
+
}, () => [createElementVNode("div", _hoisted_13, [createElementVNode("p", null, toDisplayString(loadError.value?.message ?? "加载失败"), 1), createVNode(unref(_sfc_main$5), {
|
|
7539
8017
|
variant: "outline",
|
|
7540
8018
|
size: "sm",
|
|
7541
8019
|
onClick: retry
|
|
7542
8020
|
}, {
|
|
7543
8021
|
default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("重试", -1)])]),
|
|
7544
8022
|
_: 1
|
|
7545
|
-
})])])], 8,
|
|
8023
|
+
})])])], 8, _hoisted_12)])], 64)) : unref(virtualEnabled) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
7546
8024
|
createCommentVNode(" 虚拟滚动:窗口行 + 前后占位行(总高撑开滚动区间;行高经 measureElement 动态测量) "),
|
|
7547
8025
|
createElementVNode("tr", {
|
|
7548
8026
|
"aria-hidden": "true",
|
|
@@ -7551,7 +8029,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7551
8029
|
}, [createElementVNode("td", {
|
|
7552
8030
|
colspan: columnCount.value,
|
|
7553
8031
|
class: "border-0 p-0"
|
|
7554
|
-
}, null, 8,
|
|
8032
|
+
}, null, 8, _hoisted_14)], 4),
|
|
7555
8033
|
(openBlock(true), createElementBlock(Fragment, null, renderList(virtualLines.value, (item) => {
|
|
7556
8034
|
return openBlock(), createBlock(_sfc_main$53, {
|
|
7557
8035
|
key: item.line.key,
|
|
@@ -7591,7 +8069,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7591
8069
|
}, [createElementVNode("td", {
|
|
7592
8070
|
colspan: columnCount.value,
|
|
7593
8071
|
class: "border-0 p-0"
|
|
7594
|
-
}, null, 8,
|
|
8072
|
+
}, null, 8, _hoisted_15)], 4)
|
|
7595
8073
|
], 64)) : (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(body.value, (line) => {
|
|
7596
8074
|
return openBlock(), createBlock(_sfc_main$53, {
|
|
7597
8075
|
key: line.key,
|
|
@@ -7621,20 +8099,24 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7621
8099
|
]);
|
|
7622
8100
|
}), 128)),
|
|
7623
8101
|
createCommentVNode(" 空态:横跨全列的单单元格,不虚拟化;错误态优先 "),
|
|
7624
|
-
!loading.value && !showError.value && body.value.length === 0 ? (openBlock(), createElementBlock("tr",
|
|
8102
|
+
!loading.value && !showError.value && body.value.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_16, [createElementVNode("td", {
|
|
7625
8103
|
colspan: columnCount.value,
|
|
7626
8104
|
class: "p-8 text-center text-muted-foreground"
|
|
7627
|
-
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText ?? "暂无数据"), 1)])], 8,
|
|
7628
|
-
])])],
|
|
7629
|
-
|
|
8105
|
+
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText ?? "暂无数据"), 1)])], 8, _hoisted_17)])) : createCommentVNode("v-if", true)
|
|
8106
|
+
])], 2)], 6),
|
|
8107
|
+
createCommentVNode(" R31:手动接线(须经 onPageIndex/onPageSize 包装器保留受控去重);显式补 border-t 与 size select 保持现状 "),
|
|
8108
|
+
showPaginationBar.value ? (openBlock(), createBlock(_sfc_main$43, {
|
|
7630
8109
|
key: 1,
|
|
8110
|
+
class: normalizeClass(unref(cn)("border-t", unref(fill) && "shrink-0")),
|
|
7631
8111
|
"page-index": unref(instance).page.pageIndex,
|
|
7632
8112
|
"page-size": unref(instance).page.pageSize,
|
|
7633
8113
|
"page-size-opts": unref(instance).page.pageSizeOpts,
|
|
7634
8114
|
total: unref(instance).page.total,
|
|
8115
|
+
"show-size-select": true,
|
|
7635
8116
|
"onUpdate:pageIndex": onPageIndex,
|
|
7636
8117
|
"onUpdate:pageSize": onPageSize
|
|
7637
8118
|
}, null, 8, [
|
|
8119
|
+
"class",
|
|
7638
8120
|
"page-index",
|
|
7639
8121
|
"page-size",
|
|
7640
8122
|
"page-size-opts",
|
|
@@ -7672,7 +8154,7 @@ const _hoisted_1$7 = [
|
|
|
7672
8154
|
"onClick",
|
|
7673
8155
|
"onKeydown"
|
|
7674
8156
|
];
|
|
7675
|
-
const _sfc_main$
|
|
8157
|
+
const _sfc_main$45 = /*@__PURE__*/ defineComponent({
|
|
7676
8158
|
__name: "Tabs",
|
|
7677
8159
|
props: {
|
|
7678
8160
|
items: {},
|
|
@@ -8263,7 +8745,7 @@ const _hoisted_7 = { class: "flex shrink-0 items-center gap-1" };
|
|
|
8263
8745
|
* 内部按 props 重建 useToast 单例 store,随后所有 toast 方法经单例转发到这里渲染。
|
|
8264
8746
|
*/
|
|
8265
8747
|
const rootBase = "flex w-[22rem] max-w-[calc(100vw-2rem)] items-start gap-3 rounded-md border p-4 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[placement*=top]:data-[state=open]:slide-in-from-top-2 data-[placement*=top]:data-[state=closed]:slide-out-to-top-2 data-[placement*=bottom]:data-[state=open]:slide-in-from-bottom-2 data-[placement*=bottom]:data-[state=closed]:slide-out-to-bottom-2";
|
|
8266
|
-
const _sfc_main$
|
|
8748
|
+
const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
8267
8749
|
__name: "ToastProvider",
|
|
8268
8750
|
props: {
|
|
8269
8751
|
/** 弹出位置 */
|
|
@@ -8446,6 +8928,18 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
8446
8928
|
"cancel"
|
|
8447
8929
|
],
|
|
8448
8930
|
setup(__props, { emit: __emit }) {
|
|
8931
|
+
const { ids: rootIds } = useOverlayIds(useAttrs(), {
|
|
8932
|
+
primary: "content",
|
|
8933
|
+
parts: [
|
|
8934
|
+
"content",
|
|
8935
|
+
"title",
|
|
8936
|
+
"description",
|
|
8937
|
+
"trigger",
|
|
8938
|
+
"closeTrigger",
|
|
8939
|
+
"positioner",
|
|
8940
|
+
"backdrop"
|
|
8941
|
+
]
|
|
8942
|
+
});
|
|
8449
8943
|
const props = __props;
|
|
8450
8944
|
const emit = __emit;
|
|
8451
8945
|
const instance = getCurrentInstance();
|
|
@@ -8470,6 +8964,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
8470
8964
|
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"));
|
|
8471
8965
|
return (_ctx, _cache) => {
|
|
8472
8966
|
return openBlock(), createBlock(unref(Dialog).Root, {
|
|
8967
|
+
ids: unref(rootIds),
|
|
8473
8968
|
open: unref(isOpen),
|
|
8474
8969
|
"close-on-escape": !unref(loading),
|
|
8475
8970
|
"close-on-interact-outside": !unref(loading),
|
|
@@ -8521,6 +9016,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
8521
9016
|
})]),
|
|
8522
9017
|
_: 3
|
|
8523
9018
|
}, 8, [
|
|
9019
|
+
"ids",
|
|
8524
9020
|
"open",
|
|
8525
9021
|
"close-on-escape",
|
|
8526
9022
|
"close-on-interact-outside"
|
|
@@ -8535,12 +9031,20 @@ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
|
8535
9031
|
name: "ContextMenu",
|
|
8536
9032
|
inheritAttrs: false,
|
|
8537
9033
|
__name: "ContextMenu",
|
|
8538
|
-
props: {
|
|
8539
|
-
|
|
8540
|
-
items: {
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
9034
|
+
props: {
|
|
9035
|
+
/** 菜单项描述列表,与 DropdownMenu 的 items 完全同构(item/label/separator/group 四种形态,group 可嵌套) */
|
|
9036
|
+
items: {
|
|
9037
|
+
type: Array,
|
|
9038
|
+
required: true
|
|
9039
|
+
},
|
|
9040
|
+
/** Ark Menu Root 的 positioning 配置(gutter 等;placement 由指针 anchorPoint 驱动);
|
|
9041
|
+
iframe realm(wujie graft / iframe 嵌入)下 strategy 未显式指定时默认 fixed
|
|
9042
|
+
(absolute 包含块错位修正,机制详注见 useSandboxOverlay / sandbox.ts) */
|
|
9043
|
+
positioning: {
|
|
9044
|
+
type: Object,
|
|
9045
|
+
default: void 0
|
|
9046
|
+
}
|
|
9047
|
+
},
|
|
8544
9048
|
emits: ["select"],
|
|
8545
9049
|
setup(__props, { emit: __emit }) {
|
|
8546
9050
|
const props = __props;
|
|
@@ -8549,8 +9053,12 @@ items: {
|
|
|
8549
9053
|
function handleSelect(details) {
|
|
8550
9054
|
emit("select", details);
|
|
8551
9055
|
}
|
|
9056
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }));
|
|
8552
9057
|
return (_ctx, _cache) => {
|
|
8553
|
-
return openBlock(), createBlock(unref(Menu).Root, {
|
|
9058
|
+
return openBlock(), createBlock(unref(Menu).Root, {
|
|
9059
|
+
positioning: rootPositioning.value,
|
|
9060
|
+
onSelect: handleSelect
|
|
9061
|
+
}, {
|
|
8554
9062
|
default: withCtx(() => [
|
|
8555
9063
|
createCommentVNode(" 默认插槽 = 触发元素本身(ContextTrigger as-child 透传,右键唤出并定位到指针处) "),
|
|
8556
9064
|
createVNode(unref(Menu).ContextTrigger, { "as-child": "" }, {
|
|
@@ -8566,7 +9074,7 @@ items: {
|
|
|
8566
9074
|
})
|
|
8567
9075
|
]),
|
|
8568
9076
|
_: 3
|
|
8569
|
-
});
|
|
9077
|
+
}, 8, ["positioning"]);
|
|
8570
9078
|
};
|
|
8571
9079
|
}
|
|
8572
9080
|
});
|
|
@@ -8631,6 +9139,22 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
8631
9139
|
},
|
|
8632
9140
|
emits: ["update:open"],
|
|
8633
9141
|
setup(__props, { emit: __emit }) {
|
|
9142
|
+
const { ids: rootIds } = useOverlayIds(useAttrs(), {
|
|
9143
|
+
primary: "content",
|
|
9144
|
+
parts: [
|
|
9145
|
+
"content",
|
|
9146
|
+
"title",
|
|
9147
|
+
"description",
|
|
9148
|
+
"trigger",
|
|
9149
|
+
"closeTrigger",
|
|
9150
|
+
"positioner",
|
|
9151
|
+
"backdrop",
|
|
9152
|
+
"header",
|
|
9153
|
+
"grabber",
|
|
9154
|
+
"grabberIndicator",
|
|
9155
|
+
"swipeArea"
|
|
9156
|
+
]
|
|
9157
|
+
});
|
|
8634
9158
|
const props = __props;
|
|
8635
9159
|
const emit = __emit;
|
|
8636
9160
|
const { isOpen, setOpen } = useControlledBoolean({
|
|
@@ -8692,6 +9216,7 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
8692
9216
|
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]));
|
|
8693
9217
|
return (_ctx, _cache) => {
|
|
8694
9218
|
return openBlock(), createBlock(unref(Drawer).Root, {
|
|
9219
|
+
ids: unref(rootIds),
|
|
8695
9220
|
open: unref(isOpen),
|
|
8696
9221
|
"lazy-mount": props.lazyMount,
|
|
8697
9222
|
"unmount-on-exit": props.unmountOnExit,
|
|
@@ -8740,6 +9265,7 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
8740
9265
|
]),
|
|
8741
9266
|
_: 3
|
|
8742
9267
|
}, 8, [
|
|
9268
|
+
"ids",
|
|
8743
9269
|
"open",
|
|
8744
9270
|
"lazy-mount",
|
|
8745
9271
|
"unmount-on-exit",
|
|
@@ -8879,7 +9405,7 @@ const _sfc_main$33 = /*@__PURE__*/ defineComponent({
|
|
|
8879
9405
|
});
|
|
8880
9406
|
//#endregion
|
|
8881
9407
|
//#region src/components/timeline/Timeline.vue
|
|
8882
|
-
const _sfc_main$
|
|
9408
|
+
const _sfc_main$47 = /*@__PURE__*/ defineComponent({
|
|
8883
9409
|
__name: "Timeline",
|
|
8884
9410
|
props: {
|
|
8885
9411
|
items: {},
|
|
@@ -9100,4 +9626,4 @@ const timelineDotVariants = cva("relative z-10 mt-1 block shrink-0 rounded-full"
|
|
|
9100
9626
|
}
|
|
9101
9627
|
});
|
|
9102
9628
|
//#endregion
|
|
9103
|
-
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
|
|
9629
|
+
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 };
|