@tu-design/vue 0.5.1 → 0.5.3
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 +398 -101
- package/dist/index.mjs +524 -179
- package/dist/registry/vue/alert-dialog.json +1 -1
- 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 +1 -1
- package/dist/registry/vue/checkbox.json +1 -1
- package/dist/registry/vue/context-menu.json +1 -1
- package/dist/registry/vue/currency-input.json +1 -1
- package/dist/registry/vue/date-picker.json +1 -1
- package/dist/registry/vue/date-range-picker.json +1 -1
- package/dist/registry/vue/date-shared.json +1 -1
- package/dist/registry/vue/dialog.json +1 -1
- package/dist/registry/vue/drawer.json +1 -1
- package/dist/registry/vue/dropdown-menu.json +1 -1
- 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 +1 -1
- package/dist/registry/vue/number-input.json +1 -1
- package/dist/registry/vue/overlay-shared.json +7 -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 +1 -1
- 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 +4 -4
- 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 +1 -1
- package/dist/registry/vue/tooltip.json +1 -1
- package/dist/registry/vue/tree-select.json +1 -1
- package/dist/registry/vue/tree-shared.json +1 -1
- package/dist/registry/vue/utils.json +1 -1
- package/dist/registry/vue/week-picker.json +1 -1
- package/dist/registry/vue/year-picker.json +1 -1
- package/package.json +1 -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",
|
|
@@ -2318,7 +2319,7 @@ const _hoisted_3$12 = [
|
|
|
2318
2319
|
"aria-pressed",
|
|
2319
2320
|
"disabled"
|
|
2320
2321
|
];
|
|
2321
|
-
const _hoisted_4$
|
|
2322
|
+
const _hoisted_4$10 = {
|
|
2322
2323
|
key: 0,
|
|
2323
2324
|
viewBox: "0 0 24 24",
|
|
2324
2325
|
fill: "none",
|
|
@@ -2329,7 +2330,7 @@ const _hoisted_4$9 = {
|
|
|
2329
2330
|
class: "size-4",
|
|
2330
2331
|
"aria-hidden": "true"
|
|
2331
2332
|
};
|
|
2332
|
-
const _hoisted_5$
|
|
2333
|
+
const _hoisted_5$7 = {
|
|
2333
2334
|
key: 1,
|
|
2334
2335
|
viewBox: "0 0 24 24",
|
|
2335
2336
|
fill: "none",
|
|
@@ -2413,7 +2414,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
2413
2414
|
disabled: props.disabled,
|
|
2414
2415
|
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
2416
|
onClick: toggleVisible
|
|
2416
|
-
}, [createCommentVNode(" 可见时显示 EyeOff(点击隐藏),默认显示 Eye(点击查看) "), renderSlot(_ctx.$slots, "visibility-icon", { visible: isVisible.value }, () => [isVisible.value ? (openBlock(), createElementBlock("svg", _hoisted_4$
|
|
2417
|
+
}, [createCommentVNode(" 可见时显示 EyeOff(点击隐藏),默认显示 Eye(点击查看) "), renderSlot(_ctx.$slots, "visibility-icon", { visible: isVisible.value }, () => [isVisible.value ? (openBlock(), createElementBlock("svg", _hoisted_4$10, [..._cache[0] || (_cache[0] = [
|
|
2417
2418
|
createElementVNode("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }, null, -1),
|
|
2418
2419
|
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
2420
|
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 +2424,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
2423
2424
|
y1: "2",
|
|
2424
2425
|
y2: "22"
|
|
2425
2426
|
}, null, -1)
|
|
2426
|
-
])])) : (openBlock(), createElementBlock("svg", _hoisted_5$
|
|
2427
|
+
])])) : (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
2428
|
cx: "12",
|
|
2428
2429
|
cy: "12",
|
|
2429
2430
|
r: "3"
|
|
@@ -2434,7 +2435,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
2434
2435
|
//#endregion
|
|
2435
2436
|
//#region src/components/textarea/Textarea.vue
|
|
2436
2437
|
const _hoisted_1$20 = ["aria-invalid"];
|
|
2437
|
-
const _sfc_main$
|
|
2438
|
+
const _sfc_main$46 = /*@__PURE__*/ defineComponent({
|
|
2438
2439
|
__name: "Textarea",
|
|
2439
2440
|
props: /*@__PURE__*/ mergeModels({
|
|
2440
2441
|
class: {},
|
|
@@ -2458,7 +2459,7 @@ const _sfc_main$45 = /*@__PURE__*/ defineComponent({
|
|
|
2458
2459
|
});
|
|
2459
2460
|
//#endregion
|
|
2460
2461
|
//#region src/components/week-picker/WeekPicker.vue
|
|
2461
|
-
const _sfc_main$
|
|
2462
|
+
const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
2462
2463
|
inheritAttrs: false,
|
|
2463
2464
|
__name: "WeekPicker",
|
|
2464
2465
|
props: {
|
|
@@ -2604,7 +2605,7 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
2604
2605
|
});
|
|
2605
2606
|
//#endregion
|
|
2606
2607
|
//#region src/components/year-picker/YearPicker.vue
|
|
2607
|
-
const _sfc_main$
|
|
2608
|
+
const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
2608
2609
|
inheritAttrs: false,
|
|
2609
2610
|
__name: "YearPicker",
|
|
2610
2611
|
props: {
|
|
@@ -2764,7 +2765,7 @@ function renderCurrencyItem(options = {}) {
|
|
|
2764
2765
|
}
|
|
2765
2766
|
/** textarea widget:多行文本(placeholder/rows 为原生 attr 透传) */
|
|
2766
2767
|
function renderTextareaItem(options = {}) {
|
|
2767
|
-
return (ctx) => h(_sfc_main$
|
|
2768
|
+
return (ctx) => h(_sfc_main$46, {
|
|
2768
2769
|
placeholder: ctx.item.placeholder,
|
|
2769
2770
|
...options,
|
|
2770
2771
|
...bindField(ctx.field, MODEL_VALUE),
|
|
@@ -2790,14 +2791,14 @@ function renderMonthPickerItem(options = {}) {
|
|
|
2790
2791
|
return pickerRenderer(_sfc_main$29, options);
|
|
2791
2792
|
}
|
|
2792
2793
|
function renderYearPickerItem(options = {}) {
|
|
2793
|
-
return pickerRenderer(_sfc_main$
|
|
2794
|
+
return pickerRenderer(_sfc_main$52, options);
|
|
2794
2795
|
}
|
|
2795
2796
|
/** dateRangePicker widget:[start, end] | null 形态 */
|
|
2796
2797
|
function renderDateRangePickerItem(options = {}) {
|
|
2797
2798
|
return pickerRenderer(_sfc_main$13, options);
|
|
2798
2799
|
}
|
|
2799
2800
|
function renderWeekPickerItem(options = {}) {
|
|
2800
|
-
return pickerRenderer(_sfc_main$
|
|
2801
|
+
return pickerRenderer(_sfc_main$51, options);
|
|
2801
2802
|
}
|
|
2802
2803
|
//#endregion
|
|
2803
2804
|
//#region src/components/input/Input.vue
|
|
@@ -3169,7 +3170,7 @@ function renderSliderItem(options = {}) {
|
|
|
3169
3170
|
const _hoisted_1$18 = ["data-key"];
|
|
3170
3171
|
const _hoisted_2$15 = { class: "truncate" };
|
|
3171
3172
|
const _hoisted_3$11 = ["aria-label", "onClick"];
|
|
3172
|
-
const _hoisted_4$
|
|
3173
|
+
const _hoisted_4$9 = {
|
|
3173
3174
|
key: 0,
|
|
3174
3175
|
"data-part": "tag-overflow",
|
|
3175
3176
|
class: "text-xs text-muted-foreground"
|
|
@@ -3220,7 +3221,7 @@ const _sfc_main$57 = /*@__PURE__*/ defineComponent({
|
|
|
3220
3221
|
onClick: withModifiers(($event) => emit("remove", v.key), ["stop"])
|
|
3221
3222
|
}, [createVNode(CloseIcon_default, { class: "size-3" })], 8, _hoisted_3$11)) : createCommentVNode("v-if", true)], 8, _hoisted_1$18);
|
|
3222
3223
|
}), 128)),
|
|
3223
|
-
overflow.value > 0 ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
3224
|
+
overflow.value > 0 ? (openBlock(), createElementBlock("span", _hoisted_4$9, "+" + toDisplayString(overflow.value), 1)) : createCommentVNode("v-if", true),
|
|
3224
3225
|
__props.clearable && !__props.disabled ? (openBlock(), createElementBlock("button", {
|
|
3225
3226
|
key: 1,
|
|
3226
3227
|
type: "button",
|
|
@@ -3834,7 +3835,7 @@ const _hoisted_2$14 = [
|
|
|
3834
3835
|
"onPointerenter"
|
|
3835
3836
|
];
|
|
3836
3837
|
const _hoisted_3$10 = ["onClick"];
|
|
3837
|
-
const _hoisted_4$
|
|
3838
|
+
const _hoisted_4$8 = {
|
|
3838
3839
|
key: 0,
|
|
3839
3840
|
viewBox: "0 0 24 24",
|
|
3840
3841
|
fill: "none",
|
|
@@ -3842,7 +3843,7 @@ const _hoisted_4$7 = {
|
|
|
3842
3843
|
"stroke-width": "3",
|
|
3843
3844
|
class: "size-3"
|
|
3844
3845
|
};
|
|
3845
|
-
const _hoisted_5$
|
|
3846
|
+
const _hoisted_5$6 = {
|
|
3846
3847
|
key: 1,
|
|
3847
3848
|
viewBox: "0 0 24 24",
|
|
3848
3849
|
fill: "none",
|
|
@@ -3850,7 +3851,7 @@ const _hoisted_5$5 = {
|
|
|
3850
3851
|
"stroke-width": "3",
|
|
3851
3852
|
class: "size-3"
|
|
3852
3853
|
};
|
|
3853
|
-
const _hoisted_6$
|
|
3854
|
+
const _hoisted_6$5 = { class: "flex-1 truncate" };
|
|
3854
3855
|
const _hoisted_7$4 = {
|
|
3855
3856
|
key: 0,
|
|
3856
3857
|
class: "px-3 py-1.5 text-sm text-muted-foreground"
|
|
@@ -3955,8 +3956,8 @@ const _sfc_main$56 = /*@__PURE__*/ defineComponent({
|
|
|
3955
3956
|
"data-part": "checkbox",
|
|
3956
3957
|
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
3958
|
onClick: withModifiers(($event) => toggleCheck(node), ["stop"])
|
|
3958
|
-
}, [checkedSet.value.has(node.key) ? (openBlock(), createElementBlock("svg", _hoisted_4$
|
|
3959
|
-
createElementVNode("span", _hoisted_6$
|
|
3959
|
+
}, [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),
|
|
3960
|
+
createElementVNode("span", _hoisted_6$5, toDisplayString(labelOf(node)), 1),
|
|
3960
3961
|
node.children?.length ? (openBlock(), createBlock(ChevronIcon_default, {
|
|
3961
3962
|
key: 1,
|
|
3962
3963
|
class: normalizeClass(unref(cn)("size-3.5 shrink-0 text-muted-foreground transition-transform", props.isExpanded(node) && "rotate-90"))
|
|
@@ -3978,11 +3979,11 @@ const _hoisted_3$9 = {
|
|
|
3978
3979
|
key: 0,
|
|
3979
3980
|
class: "truncate"
|
|
3980
3981
|
};
|
|
3981
|
-
const _hoisted_4$
|
|
3982
|
+
const _hoisted_4$7 = {
|
|
3982
3983
|
key: 1,
|
|
3983
3984
|
class: "truncate text-muted-foreground"
|
|
3984
3985
|
};
|
|
3985
|
-
const _hoisted_5$
|
|
3986
|
+
const _hoisted_5$5 = { class: "ml-auto flex shrink-0 items-center gap-1" };
|
|
3986
3987
|
const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
3987
3988
|
inheritAttrs: false,
|
|
3988
3989
|
__name: "Cascader",
|
|
@@ -4303,7 +4304,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4303
4304
|
"values",
|
|
4304
4305
|
"max-tag-count",
|
|
4305
4306
|
"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$
|
|
4307
|
+
])) : 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
4308
|
key: 0,
|
|
4308
4309
|
role: "button",
|
|
4309
4310
|
"data-part": "clear",
|
|
@@ -4368,8 +4369,8 @@ const _hoisted_3$8 = {
|
|
|
4368
4369
|
class: "size-4 shrink-0",
|
|
4369
4370
|
"aria-hidden": "true"
|
|
4370
4371
|
};
|
|
4371
|
-
const _hoisted_4$
|
|
4372
|
-
const _hoisted_5$
|
|
4372
|
+
const _hoisted_4$6 = ["data-checked", "data-indeterminate"];
|
|
4373
|
+
const _hoisted_5$4 = {
|
|
4373
4374
|
key: 0,
|
|
4374
4375
|
viewBox: "0 0 24 24",
|
|
4375
4376
|
fill: "none",
|
|
@@ -4379,7 +4380,7 @@ const _hoisted_5$3 = {
|
|
|
4379
4380
|
"stroke-linejoin": "round",
|
|
4380
4381
|
class: "size-3"
|
|
4381
4382
|
};
|
|
4382
|
-
const _hoisted_6$
|
|
4383
|
+
const _hoisted_6$4 = {
|
|
4383
4384
|
key: 1,
|
|
4384
4385
|
viewBox: "0 0 24 24",
|
|
4385
4386
|
fill: "none",
|
|
@@ -4494,7 +4495,7 @@ const _sfc_main$55 = /*@__PURE__*/ defineComponent({
|
|
|
4494
4495
|
"data-indeterminate": isIndeterminate(node) ? "" : void 0,
|
|
4495
4496
|
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
4497
|
"aria-hidden": "true"
|
|
4497
|
-
}, [isChecked(node) ? (openBlock(), createElementBlock("svg", _hoisted_5$
|
|
4498
|
+
}, [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
4499
|
createElementVNode("span", _hoisted_7$3, toDisplayString(label(node)), 1)
|
|
4499
4500
|
], 12, _hoisted_1$15);
|
|
4500
4501
|
}), 128)), __props.nodes.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_8$1, " 无数据 ")) : createCommentVNode("v-if", true)], 2);
|
|
@@ -4509,17 +4510,17 @@ const _hoisted_3$7 = {
|
|
|
4509
4510
|
key: 2,
|
|
4510
4511
|
class: "truncate text-muted-foreground"
|
|
4511
4512
|
};
|
|
4512
|
-
const _hoisted_4$
|
|
4513
|
-
const _hoisted_5$
|
|
4513
|
+
const _hoisted_4$5 = ["placeholder", "aria-label"];
|
|
4514
|
+
const _hoisted_5$3 = {
|
|
4514
4515
|
key: 0,
|
|
4515
4516
|
class: "truncate"
|
|
4516
4517
|
};
|
|
4517
|
-
const _hoisted_6$
|
|
4518
|
+
const _hoisted_6$3 = {
|
|
4518
4519
|
key: 1,
|
|
4519
4520
|
class: "truncate text-muted-foreground"
|
|
4520
4521
|
};
|
|
4521
4522
|
const _hoisted_7$2 = { class: "ml-auto flex shrink-0 items-center gap-1" };
|
|
4522
|
-
const _sfc_main$
|
|
4523
|
+
const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
4523
4524
|
inheritAttrs: false,
|
|
4524
4525
|
__name: "TreeSelect",
|
|
4525
4526
|
props: {
|
|
@@ -4873,7 +4874,7 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4873
4874
|
class: "h-full w-full min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground",
|
|
4874
4875
|
placeholder: singleLabel.value || props.placeholder,
|
|
4875
4876
|
"aria-label": props.placeholder
|
|
4876
|
-
}, null, 8, _hoisted_4$
|
|
4877
|
+
}, 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
4878
|
key: 0,
|
|
4878
4879
|
role: "button",
|
|
4879
4880
|
"data-part": "clear",
|
|
@@ -4923,7 +4924,7 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
4923
4924
|
//#region src/components/form-render/widgets/tree.ts
|
|
4924
4925
|
function renderTreeSelectItem(options) {
|
|
4925
4926
|
const { placeholder, ...rest } = options;
|
|
4926
|
-
return (ctx) => h(_sfc_main$
|
|
4927
|
+
return (ctx) => h(_sfc_main$50, {
|
|
4927
4928
|
placeholder: placeholder ?? ctx.item.placeholder,
|
|
4928
4929
|
...rest,
|
|
4929
4930
|
...bindField(ctx.field, MODEL_VALUE),
|
|
@@ -5030,17 +5031,31 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5030
5031
|
if (span === "full") return { gridColumn: "1 / -1" };
|
|
5031
5032
|
if (typeof span === "number") return { gridColumn: `span ${span}` };
|
|
5032
5033
|
}
|
|
5033
|
-
const
|
|
5034
|
-
const
|
|
5035
|
-
const
|
|
5036
|
-
|
|
5034
|
+
const actions = props.definition?.actions;
|
|
5035
|
+
const searchable = computed(() => (actions ? actions.searchable : props.searchable) ?? false);
|
|
5036
|
+
const submitable = computed(() => (actions ? actions.submitable : props.submitable) ?? false);
|
|
5037
|
+
const showReset = computed(() => (actions ? actions.resetable : props.resetable) ?? !!searchable.value);
|
|
5038
|
+
const showCancel = computed(() => (actions ? actions.cancelable : props.cancelable) ?? !!submitable.value);
|
|
5039
|
+
const showActions = computed(() => searchable.value || submitable.value || showReset.value || showCancel.value);
|
|
5040
|
+
const resolvedSearchText = computed(() => (actions ? actions.searchText : props.searchText) ?? "搜索");
|
|
5041
|
+
const resolvedSubmitText = computed(() => (actions ? actions.submitText : props.submitText) ?? "提交");
|
|
5042
|
+
const resolvedResetText = computed(() => (actions ? actions.resetText : props.resetText) ?? "重置");
|
|
5043
|
+
if (import.meta.env.DEV && actions) {
|
|
5044
|
+
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 渲染。");
|
|
5045
|
+
}
|
|
5046
|
+
/** I4:校验失败时 isFieldsValid=false,不 emit;成功后才 emit(事件回调中一次性读取不受 S1 限制)。
|
|
5047
|
+
* 校验语义单点化(R30):definition 存在时复用 definition.submit();拆分式 :form + :items 走内联逻辑 */
|
|
5037
5048
|
async function submit(mode) {
|
|
5038
5049
|
if (!instance) return;
|
|
5039
|
-
|
|
5040
|
-
if (
|
|
5041
|
-
|
|
5042
|
-
|
|
5050
|
+
let valid;
|
|
5051
|
+
if (props.definition) valid = await props.definition.submit();
|
|
5052
|
+
else {
|
|
5053
|
+
await instance.handleSubmit();
|
|
5054
|
+
valid = instance.state.isFieldsValid;
|
|
5043
5055
|
}
|
|
5056
|
+
if (!valid) return;
|
|
5057
|
+
if (mode === "search") emit("search");
|
|
5058
|
+
else emit("submit");
|
|
5044
5059
|
}
|
|
5045
5060
|
function onReset() {
|
|
5046
5061
|
if (props.definition) props.definition.resetToDefaults();
|
|
@@ -5070,11 +5085,11 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5070
5085
|
"values"
|
|
5071
5086
|
])], 4);
|
|
5072
5087
|
}), 128)), showActions.value ? (openBlock(), createElementBlock("div", _hoisted_1$13, [renderSlot(_ctx.$slots, "actions", {}, () => [
|
|
5073
|
-
|
|
5088
|
+
searchable.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
5074
5089
|
key: 0,
|
|
5075
5090
|
onClick: _cache[0] || (_cache[0] = ($event) => submit("search"))
|
|
5076
5091
|
}, {
|
|
5077
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
5092
|
+
default: withCtx(() => [createTextVNode(toDisplayString(resolvedSearchText.value), 1)]),
|
|
5078
5093
|
_: 1
|
|
5079
5094
|
})) : createCommentVNode("v-if", true),
|
|
5080
5095
|
showReset.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
@@ -5082,14 +5097,14 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5082
5097
|
variant: "outline",
|
|
5083
5098
|
onClick: onReset
|
|
5084
5099
|
}, {
|
|
5085
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
5100
|
+
default: withCtx(() => [createTextVNode(toDisplayString(resolvedResetText.value), 1)]),
|
|
5086
5101
|
_: 1
|
|
5087
5102
|
})) : createCommentVNode("v-if", true),
|
|
5088
|
-
|
|
5103
|
+
submitable.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
5089
5104
|
key: 2,
|
|
5090
5105
|
onClick: _cache[1] || (_cache[1] = ($event) => submit("submit"))
|
|
5091
5106
|
}, {
|
|
5092
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
5107
|
+
default: withCtx(() => [createTextVNode(toDisplayString(resolvedSubmitText.value), 1)]),
|
|
5093
5108
|
_: 1
|
|
5094
5109
|
})) : createCommentVNode("v-if", true),
|
|
5095
5110
|
showCancel.value ? (openBlock(), createBlock(unref(_sfc_main$5), {
|
|
@@ -5114,7 +5129,16 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5114
5129
|
* - 须在组件 setup 中调用(TanStack useForm 内部 `onMounted(formApi.mount)`)。
|
|
5115
5130
|
*/
|
|
5116
5131
|
function useFormRender(options) {
|
|
5117
|
-
const { items, schema, onSubmit, formOptions } = options;
|
|
5132
|
+
const { items, schema, onSubmit, formOptions, searchable, submitable, resetable, cancelable, searchText, submitText, resetText } = options;
|
|
5133
|
+
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 : {
|
|
5134
|
+
searchable,
|
|
5135
|
+
submitable,
|
|
5136
|
+
resetable,
|
|
5137
|
+
cancelable,
|
|
5138
|
+
searchText,
|
|
5139
|
+
submitText,
|
|
5140
|
+
resetText
|
|
5141
|
+
};
|
|
5118
5142
|
const defaultValues = Object.fromEntries(items.map((item) => [String(item.key), typeof item.default === "function" ? item.default() : item.default ?? null]));
|
|
5119
5143
|
const form = useForm({
|
|
5120
5144
|
defaultValues,
|
|
@@ -5126,18 +5150,25 @@ function useFormRender(options) {
|
|
|
5126
5150
|
return {
|
|
5127
5151
|
items,
|
|
5128
5152
|
form,
|
|
5129
|
-
resetToDefaults: () => form.reset()
|
|
5153
|
+
resetToDefaults: () => form.reset(),
|
|
5154
|
+
submit: async () => {
|
|
5155
|
+
await form.handleSubmit();
|
|
5156
|
+
return form.state.isFieldsValid;
|
|
5157
|
+
},
|
|
5158
|
+
actions
|
|
5130
5159
|
};
|
|
5131
5160
|
}
|
|
5132
5161
|
//#endregion
|
|
5133
5162
|
//#region src/components/form-render/define-form.ts
|
|
5134
5163
|
/**
|
|
5135
|
-
* 聚合入口:单次调用完成「字段定义 + 类型约束 +
|
|
5164
|
+
* 聚合入口:单次调用完成「字段定义 + 类型约束 + 表单实例 + 按钮预设」。
|
|
5136
5165
|
*
|
|
5137
|
-
* 返回 `{ items, form, resetToDefaults }`:
|
|
5166
|
+
* 返回 `{ items, form, resetToDefaults, submit, actions? }`:
|
|
5138
5167
|
* - `items` / `form` 传给 `<FormRender>`(支持 `:definition` 单 prop 或 `:form` + `:items` 拆分);
|
|
5139
5168
|
* - `form` 可直接 `reset()` / `validate()` / `handleSubmit()`;
|
|
5140
|
-
* - `resetToDefaults()` 重置到 `items.default`(搜索表单"重置"
|
|
5169
|
+
* - `resetToDefaults()` 重置到 `items.default`(搜索表单"重置"语义);
|
|
5170
|
+
* - `submit()` 全量校验并返回是否通过(R30,组合式查询链路);
|
|
5171
|
+
* - `actions` 按钮预设(searchable 等七项直传):存在时 `<FormRender>` 组件按钮 props 全量忽略(A1 块级互斥)。
|
|
5141
5172
|
*
|
|
5142
5173
|
* 须在组件 setup 中调用(TanStack useForm 约束)。
|
|
5143
5174
|
*/
|
|
@@ -5832,6 +5863,37 @@ const _sfc_main$32 = /*@__PURE__*/ defineComponent({
|
|
|
5832
5863
|
}
|
|
5833
5864
|
});
|
|
5834
5865
|
//#endregion
|
|
5866
|
+
//#region src/components/overlay-shared/sandbox.ts
|
|
5867
|
+
/**
|
|
5868
|
+
* 微前端沙箱探测(按渲染拓扑分派,框架无关)。
|
|
5869
|
+
*
|
|
5870
|
+
* 拓扑三分:
|
|
5871
|
+
* - 同文档(无沙箱 / qiankun / micro-app light DOM / 降级 iframe):absolute 正确
|
|
5872
|
+
* - 真 shadow DOM(web component 沙箱 / micro-app shadowDOM 模式):absolute 正确,
|
|
5873
|
+
* 由组件的 `getRootNode() instanceof ShadowRoot` 检测命中
|
|
5874
|
+
* - graft 型(wujie):iframe 文档树 graft 进 shadowRoot 渲染,absolute 输出视口系
|
|
5875
|
+
* 坐标但包含块是 graft body → 错位;fixed 以最近视口为包含块,是唯一正确解
|
|
5876
|
+
*
|
|
5877
|
+
* 安全性论证:非 graft 拓扑下 absolute 与 fixed 坐标等价(包含块同为最近视口),
|
|
5878
|
+
* iframe realm 下默认 fixed 零副作用;跨域 iframe 下 self/top 仅引用比较,
|
|
5879
|
+
* 不读属性,无 SecurityError。
|
|
5880
|
+
*
|
|
5881
|
+
* 已知边界:
|
|
5882
|
+
* - fixed 元素祖先有 transform/filter 时包含块被劫持(宿主布局应避免;graft 下
|
|
5883
|
+
* absolute 的 offsetParent 解析本就失效,错法不同而非新增错误)
|
|
5884
|
+
* - fixed 面板在祖先滚动时依赖 autoUpdate 重算,重算前一帧有视口驻留(瞬时视觉差异)
|
|
5885
|
+
* - 若未来出现「非 iframe 的 graft 型沙箱」,本探测无法覆盖,需追加该沙箱的 marker 信号
|
|
5886
|
+
*/
|
|
5887
|
+
/** 组件 JS 是否运行在 iframe realm(wujie / iframe 型沙箱 / 普通 iframe 嵌入) */
|
|
5888
|
+
function isInIframeRealm() {
|
|
5889
|
+
return typeof window !== "undefined" && window.self !== window.top;
|
|
5890
|
+
}
|
|
5891
|
+
/** 是否处于 wujie graft 沙箱(getRootNode/父链被 wujie patch 伪装,结构探测失效,
|
|
5892
|
+
* 依赖官方标记;wujie 在子应用脚本执行前注入,时序可靠) */
|
|
5893
|
+
function isInWujie() {
|
|
5894
|
+
return typeof window !== "undefined" && window.__POWERED_BY_WUJIE__ === true;
|
|
5895
|
+
}
|
|
5896
|
+
//#endregion
|
|
5835
5897
|
//#region src/components/popover/Popover.vue
|
|
5836
5898
|
const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
5837
5899
|
inheritAttrs: false,
|
|
@@ -5857,11 +5919,72 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
5857
5919
|
type: Boolean,
|
|
5858
5920
|
default: false
|
|
5859
5921
|
},
|
|
5860
|
-
/**
|
|
5922
|
+
/** 触发方式:click(默认,内建切换+完整 aria) / hover / focus(带延迟,Anchor+手动 aria) / manual(纯受控,仅定位锚点) */
|
|
5923
|
+
trigger: {
|
|
5924
|
+
type: String,
|
|
5925
|
+
default: "click"
|
|
5926
|
+
},
|
|
5927
|
+
/** hover/focus 打开延迟(毫秒) */
|
|
5928
|
+
openDelay: {
|
|
5929
|
+
type: Number,
|
|
5930
|
+
default: 100
|
|
5931
|
+
},
|
|
5932
|
+
/** hover/focus 关闭延迟(毫秒) */
|
|
5933
|
+
closeDelay: {
|
|
5934
|
+
type: Number,
|
|
5935
|
+
default: 100
|
|
5936
|
+
},
|
|
5937
|
+
/** hover/focus 时悬浮/聚焦面板保持打开 */
|
|
5938
|
+
keepAliveOnHover: {
|
|
5939
|
+
type: Boolean,
|
|
5940
|
+
default: true
|
|
5941
|
+
},
|
|
5942
|
+
/** 面板主轴方向(与 align 组合定位);attrs.positioning.placement 显式给出时以其为准 */
|
|
5943
|
+
side: {
|
|
5944
|
+
type: String,
|
|
5945
|
+
default: "bottom"
|
|
5946
|
+
},
|
|
5947
|
+
/** 面板相对触发器的对齐方向(默认居中) */
|
|
5861
5948
|
align: {
|
|
5862
5949
|
type: String,
|
|
5863
5950
|
default: "center"
|
|
5864
5951
|
},
|
|
5952
|
+
/** 显示箭头(shadcn 风格默认无箭头) */
|
|
5953
|
+
arrow: {
|
|
5954
|
+
type: Boolean,
|
|
5955
|
+
default: false
|
|
5956
|
+
},
|
|
5957
|
+
/** 追加/覆盖箭头样式类 */
|
|
5958
|
+
arrowClass: {
|
|
5959
|
+
type: String,
|
|
5960
|
+
default: void 0
|
|
5961
|
+
},
|
|
5962
|
+
/** 禁用触发(不响应任何触发事件;已打开状态不受影响) */
|
|
5963
|
+
disabled: {
|
|
5964
|
+
type: Boolean,
|
|
5965
|
+
default: false
|
|
5966
|
+
},
|
|
5967
|
+
/** 是否 Teleport(浮层定位不受嵌套裁剪影响);false 时面板留在原地 */
|
|
5968
|
+
portal: {
|
|
5969
|
+
type: Boolean,
|
|
5970
|
+
default: true
|
|
5971
|
+
},
|
|
5972
|
+
/** Teleport 目标(选择器或元素),仅 portal=true 时生效;
|
|
5973
|
+
缺省时若应用挂载容器处于 shadow DOM 或 wujie graft 沙箱,自动降级为该容器,否则 body */
|
|
5974
|
+
to: {
|
|
5975
|
+
type: [String, Object],
|
|
5976
|
+
default: void 0
|
|
5977
|
+
},
|
|
5978
|
+
/** 面板宽度与触发元素一致 */
|
|
5979
|
+
matchTriggerWidth: {
|
|
5980
|
+
type: Boolean,
|
|
5981
|
+
default: false
|
|
5982
|
+
},
|
|
5983
|
+
/** 覆盖面板/定位层级(默认走 --z-overlay) */
|
|
5984
|
+
zIndex: {
|
|
5985
|
+
type: Number,
|
|
5986
|
+
default: void 0
|
|
5987
|
+
},
|
|
5865
5988
|
/** 追加/覆盖面板样式类(默认 w-72 可由此覆盖,如 "w-56 p-0") */
|
|
5866
5989
|
contentClass: {
|
|
5867
5990
|
type: String,
|
|
@@ -5877,48 +6000,154 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
5877
6000
|
setup(__props, { emit: __emit }) {
|
|
5878
6001
|
const props = __props;
|
|
5879
6002
|
const emit = __emit;
|
|
6003
|
+
const slots = useSlots();
|
|
5880
6004
|
const attrs = useAttrs();
|
|
6005
|
+
const instance = getCurrentInstance();
|
|
6006
|
+
const inWujie = isInWujie();
|
|
6007
|
+
const detectedTarget = ref("body");
|
|
6008
|
+
onMounted(() => {
|
|
6009
|
+
queueMicrotask(() => {
|
|
6010
|
+
if (props.to) return;
|
|
6011
|
+
const container = (instance?.appContext.app)?._container;
|
|
6012
|
+
if (container && (container.getRootNode() instanceof ShadowRoot || inWujie)) detectedTarget.value = container;
|
|
6013
|
+
});
|
|
6014
|
+
});
|
|
6015
|
+
const teleportTarget = computed(() => props.to ?? detectedTarget.value);
|
|
5881
6016
|
const { isOpen, setOpen } = useControlledBoolean({
|
|
5882
6017
|
controlled: () => props.open,
|
|
5883
6018
|
defaultValue: () => props.defaultOpen,
|
|
5884
6019
|
onChange: (open) => emit("update:open", open)
|
|
5885
6020
|
});
|
|
6021
|
+
const useNativeTrigger = computed(() => props.trigger === "click" && !props.disabled);
|
|
6022
|
+
const contentId = useId();
|
|
6023
|
+
const rootIds = computed(() => {
|
|
6024
|
+
if (useNativeTrigger.value) return void 0;
|
|
6025
|
+
return {
|
|
6026
|
+
...attrs.ids ?? {},
|
|
6027
|
+
content: contentId
|
|
6028
|
+
};
|
|
6029
|
+
});
|
|
6030
|
+
const anchorAria = computed(() => useNativeTrigger.value ? {} : {
|
|
6031
|
+
"aria-haspopup": "dialog",
|
|
6032
|
+
"aria-expanded": isOpen.value,
|
|
6033
|
+
"aria-controls": contentId
|
|
6034
|
+
});
|
|
6035
|
+
let timer = null;
|
|
6036
|
+
const clearTimer = () => {
|
|
6037
|
+
if (timer !== null) {
|
|
6038
|
+
clearTimeout(timer);
|
|
6039
|
+
timer = null;
|
|
6040
|
+
}
|
|
6041
|
+
};
|
|
6042
|
+
const schedule = (next, delay) => {
|
|
6043
|
+
if (props.disabled) return;
|
|
6044
|
+
clearTimer();
|
|
6045
|
+
if (delay <= 0) {
|
|
6046
|
+
setOpen(next);
|
|
6047
|
+
return;
|
|
6048
|
+
}
|
|
6049
|
+
timer = setTimeout(() => {
|
|
6050
|
+
timer = null;
|
|
6051
|
+
if (!props.disabled) setOpen(next);
|
|
6052
|
+
}, delay);
|
|
6053
|
+
};
|
|
6054
|
+
const isHoverFocus = () => props.trigger === "hover" || props.trigger === "focus";
|
|
6055
|
+
const onTriggerEnter = () => {
|
|
6056
|
+
if (!isHoverFocus()) return;
|
|
6057
|
+
schedule(true, props.openDelay);
|
|
6058
|
+
};
|
|
6059
|
+
const onTriggerLeave = () => {
|
|
6060
|
+
if (!isHoverFocus()) return;
|
|
6061
|
+
schedule(false, props.closeDelay);
|
|
6062
|
+
};
|
|
6063
|
+
const onPanelEnter = () => {
|
|
6064
|
+
if (!isHoverFocus() || !props.keepAliveOnHover) return;
|
|
6065
|
+
clearTimer();
|
|
6066
|
+
};
|
|
6067
|
+
const onPanelLeave = () => {
|
|
6068
|
+
if (!isHoverFocus()) return;
|
|
6069
|
+
schedule(false, props.closeDelay);
|
|
6070
|
+
};
|
|
6071
|
+
onBeforeUnmount(clearTimer);
|
|
6072
|
+
const inIframeRealm = isInIframeRealm();
|
|
5886
6073
|
const rootPositioning = computed(() => {
|
|
5887
6074
|
const user = attrs.positioning ?? {};
|
|
5888
|
-
|
|
5889
|
-
const
|
|
5890
|
-
return {
|
|
6075
|
+
const placement = props.align === "center" ? props.side : `${props.side}-${props.align}`;
|
|
6076
|
+
const merged = {
|
|
5891
6077
|
...user,
|
|
5892
|
-
placement
|
|
6078
|
+
placement,
|
|
6079
|
+
sameWidth: props.matchTriggerWidth || user.sameWidth
|
|
5893
6080
|
};
|
|
6081
|
+
if (inIframeRealm && user.strategy == null) merged.strategy = "fixed";
|
|
6082
|
+
return merged;
|
|
5894
6083
|
});
|
|
5895
6084
|
const contentClass = computed(() => cn("bg-popover text-popover-foreground z-[var(--z-overlay)] w-72 rounded-md border p-4 shadow-md outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", props.contentClass, props.contentProps?.["class"]));
|
|
6085
|
+
const arrowClass = computed(() => cn("[--arrow-size:10px] [--arrow-background:var(--popover)]", props.arrowClass));
|
|
6086
|
+
const positionerClass = computed(() => props.zIndex != null ? "" : "z-[var(--z-overlay)]");
|
|
6087
|
+
const positionerStyle = computed(() => props.zIndex != null ? { zIndex: props.zIndex } : void 0);
|
|
5896
6088
|
return (_ctx, _cache) => {
|
|
5897
6089
|
return openBlock(), createBlock(unref(Popover).Root, mergeProps(unref(attrs), {
|
|
5898
6090
|
open: unref(isOpen),
|
|
5899
6091
|
positioning: rootPositioning.value,
|
|
6092
|
+
ids: rootIds.value,
|
|
5900
6093
|
"lazy-mount": props.lazyMount,
|
|
5901
6094
|
"unmount-on-exit": props.unmountOnExit,
|
|
5902
6095
|
"onUpdate:open": unref(setOpen)
|
|
5903
6096
|
}), {
|
|
5904
6097
|
default: withCtx(() => [
|
|
5905
|
-
createCommentVNode("
|
|
5906
|
-
|
|
6098
|
+
createCommentVNode(" click 且未禁用:内建 Trigger,行为/aria 与旧版完全一致 "),
|
|
6099
|
+
useNativeTrigger.value ? (openBlock(), createBlock(unref(Popover).Trigger, {
|
|
6100
|
+
key: 0,
|
|
6101
|
+
"as-child": ""
|
|
6102
|
+
}, {
|
|
5907
6103
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
5908
6104
|
_: 3
|
|
5909
|
-
}),
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
6105
|
+
})) : unref(slots).default ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" hover/focus/manual 或 disabled:Anchor + 自绑监听 + 手动 aria "), createVNode(unref(Popover).Anchor, mergeProps({ "as-child": "" }, anchorAria.value, {
|
|
6106
|
+
onMouseenter: onTriggerEnter,
|
|
6107
|
+
onMouseleave: onTriggerLeave,
|
|
6108
|
+
onFocusin: onTriggerEnter,
|
|
6109
|
+
onFocusout: onTriggerLeave
|
|
6110
|
+
}), {
|
|
6111
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
6112
|
+
_: 3
|
|
6113
|
+
}, 16)], 2112)) : createCommentVNode("v-if", true),
|
|
6114
|
+
createCommentVNode(" portal:Teleport(Ark Vue 原语不自带传送,浮层定位不受嵌套 overflow 裁剪影响);\n portal=false 时 disabled Teleport 面板留在原地;to 显式指定目标,\n 缺省时真 shadow DOM(getRootNode 检测)与 wujie graft(marker 检测)沙箱\n 自动降级为应用挂载容器,避免传送出 shadow root "),
|
|
6115
|
+
(openBlock(), createBlock(Teleport, {
|
|
6116
|
+
to: teleportTarget.value,
|
|
6117
|
+
disabled: !props.portal
|
|
6118
|
+
}, [createVNode(unref(Popover).Positioner, {
|
|
6119
|
+
class: normalizeClass(positionerClass.value),
|
|
6120
|
+
style: normalizeStyle(positionerStyle.value)
|
|
6121
|
+
}, {
|
|
6122
|
+
default: withCtx(() => [createVNode(unref(Popover).Content, mergeProps(props.contentProps, {
|
|
6123
|
+
class: contentClass.value,
|
|
6124
|
+
onMouseenter: onPanelEnter,
|
|
6125
|
+
onMouseleave: onPanelLeave,
|
|
6126
|
+
onFocusin: onPanelEnter,
|
|
6127
|
+
onFocusout: onPanelLeave
|
|
6128
|
+
}), {
|
|
6129
|
+
default: withCtx(() => [
|
|
6130
|
+
props.arrow ? (openBlock(), createBlock(unref(Popover).Arrow, {
|
|
6131
|
+
key: 0,
|
|
6132
|
+
class: normalizeClass(arrowClass.value)
|
|
6133
|
+
}, {
|
|
6134
|
+
default: withCtx(() => [createVNode(unref(Popover).ArrowTip)]),
|
|
6135
|
+
_: 1
|
|
6136
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
6137
|
+
renderSlot(_ctx.$slots, "header"),
|
|
6138
|
+
renderSlot(_ctx.$slots, "content"),
|
|
6139
|
+
renderSlot(_ctx.$slots, "footer")
|
|
6140
|
+
]),
|
|
5913
6141
|
_: 3
|
|
5914
6142
|
}, 16, ["class"])]),
|
|
5915
6143
|
_: 3
|
|
5916
|
-
})
|
|
6144
|
+
}, 8, ["class", "style"])], 8, ["to", "disabled"]))
|
|
5917
6145
|
]),
|
|
5918
6146
|
_: 3
|
|
5919
6147
|
}, 16, [
|
|
5920
6148
|
"open",
|
|
5921
6149
|
"positioning",
|
|
6150
|
+
"ids",
|
|
5922
6151
|
"lazy-mount",
|
|
5923
6152
|
"unmount-on-exit",
|
|
5924
6153
|
"onUpdate:open"
|
|
@@ -5962,6 +6191,203 @@ const _sfc_main$39 = /*@__PURE__*/ defineComponent({
|
|
|
5962
6191
|
}
|
|
5963
6192
|
});
|
|
5964
6193
|
//#endregion
|
|
6194
|
+
//#region src/components/table-render/TablePagination.vue
|
|
6195
|
+
const _hoisted_1$10 = {
|
|
6196
|
+
key: 0,
|
|
6197
|
+
class: "flex items-center gap-2 text-muted-foreground"
|
|
6198
|
+
};
|
|
6199
|
+
const _hoisted_2$9 = { key: 0 };
|
|
6200
|
+
const _hoisted_3$6 = ["value"];
|
|
6201
|
+
const _hoisted_4$4 = ["value"];
|
|
6202
|
+
const _hoisted_5$2 = {
|
|
6203
|
+
key: 0,
|
|
6204
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6205
|
+
viewBox: "0 0 24 24",
|
|
6206
|
+
fill: "none",
|
|
6207
|
+
stroke: "currentColor",
|
|
6208
|
+
"stroke-width": "2",
|
|
6209
|
+
"stroke-linecap": "round",
|
|
6210
|
+
"stroke-linejoin": "round",
|
|
6211
|
+
class: "size-4",
|
|
6212
|
+
"aria-hidden": "true"
|
|
6213
|
+
};
|
|
6214
|
+
const _hoisted_6$2 = {
|
|
6215
|
+
key: 0,
|
|
6216
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6217
|
+
viewBox: "0 0 24 24",
|
|
6218
|
+
fill: "none",
|
|
6219
|
+
stroke: "currentColor",
|
|
6220
|
+
"stroke-width": "2",
|
|
6221
|
+
"stroke-linecap": "round",
|
|
6222
|
+
"stroke-linejoin": "round",
|
|
6223
|
+
class: "size-4",
|
|
6224
|
+
"aria-hidden": "true"
|
|
6225
|
+
};
|
|
6226
|
+
const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
6227
|
+
__name: "TablePagination",
|
|
6228
|
+
props: {
|
|
6229
|
+
/** 组合式:传 defineTable 返回值,自动接线 page/动作并按 R13 单页自隐藏;
|
|
6230
|
+
* 与手动分页 props 同传时以 definition 为准(DEV 警告,R29/R4 对齐) */
|
|
6231
|
+
definition: { type: Object },
|
|
6232
|
+
/** 1-based 当前页码(手动模式) */
|
|
6233
|
+
pageIndex: {
|
|
6234
|
+
type: Number,
|
|
6235
|
+
default: void 0
|
|
6236
|
+
},
|
|
6237
|
+
pageSize: {
|
|
6238
|
+
type: Number,
|
|
6239
|
+
default: void 0
|
|
6240
|
+
},
|
|
6241
|
+
pageSizeOpts: {
|
|
6242
|
+
type: Array,
|
|
6243
|
+
default: void 0
|
|
6244
|
+
},
|
|
6245
|
+
total: {
|
|
6246
|
+
type: Number,
|
|
6247
|
+
default: void 0
|
|
6248
|
+
},
|
|
6249
|
+
/** 「共 N 条」,缺省 true */
|
|
6250
|
+
showTotal: {
|
|
6251
|
+
type: Boolean,
|
|
6252
|
+
default: void 0
|
|
6253
|
+
},
|
|
6254
|
+
/** 条/页 select,缺省 false(组合式简形分页条可保持关闭) */
|
|
6255
|
+
showSizeSelect: {
|
|
6256
|
+
type: Boolean,
|
|
6257
|
+
default: void 0
|
|
6258
|
+
},
|
|
6259
|
+
/** 上一页/下一页形态:text 文字(缺省)/ icon 图标 */
|
|
6260
|
+
navMode: {
|
|
6261
|
+
type: String,
|
|
6262
|
+
default: "text"
|
|
6263
|
+
}
|
|
6264
|
+
},
|
|
6265
|
+
emits: ["update:pageIndex", "update:pageSize"],
|
|
6266
|
+
setup(__props, { emit: __emit }) {
|
|
6267
|
+
const props = __props;
|
|
6268
|
+
const emit = __emit;
|
|
6269
|
+
if (import.meta.env.DEV) {
|
|
6270
|
+
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 渲染。");
|
|
6271
|
+
if (!props.definition && (props.pageIndex === void 0 || props.pageSize === void 0 || props.total === void 0)) console.warn("[tu-design] <TablePagination> 缺少 definition 或 pageIndex/pageSize/total,组件不渲染。");
|
|
6272
|
+
}
|
|
6273
|
+
const pageIndex = computed(() => props.definition?.page.pageIndex ?? props.pageIndex);
|
|
6274
|
+
const pageSize = computed(() => props.definition?.page.pageSize ?? props.pageSize);
|
|
6275
|
+
const pageSizeOpts = computed(() => props.definition?.page.pageSizeOpts ?? props.pageSizeOpts);
|
|
6276
|
+
const total = computed(() => props.definition?.page.total ?? props.total);
|
|
6277
|
+
const totalPages = computed(() => Math.max(1, Math.ceil((total.value ?? 0) / (pageSize.value ?? 1))));
|
|
6278
|
+
/** 可见性:definition 模式按 R13 单页自隐藏;手动模式须 pageIndex/pageSize/total 齐备(缺项 DEV 警告 + 不渲染) */
|
|
6279
|
+
const visible = computed(() => {
|
|
6280
|
+
if (props.definition !== void 0) return Math.ceil((total.value ?? 0) / (pageSize.value ?? 1)) > 1;
|
|
6281
|
+
return props.pageIndex !== void 0 && props.pageSize !== void 0 && props.total !== void 0;
|
|
6282
|
+
});
|
|
6283
|
+
const showTotalBar = computed(() => props.showTotal ?? true);
|
|
6284
|
+
const showSelect = computed(() => props.showSizeSelect ?? false);
|
|
6285
|
+
const iconMode = computed(() => props.navMode === "icon");
|
|
6286
|
+
const hasLeft = computed(() => showTotalBar.value || showSelect.value);
|
|
6287
|
+
function onPageIndex(value) {
|
|
6288
|
+
props.definition?.setPageIndex(value);
|
|
6289
|
+
emit("update:pageIndex", value);
|
|
6290
|
+
}
|
|
6291
|
+
function onPageSize(value) {
|
|
6292
|
+
props.definition?.setPageSize(value);
|
|
6293
|
+
emit("update:pageSize", value);
|
|
6294
|
+
}
|
|
6295
|
+
/** 页码窗口:首页/尾页 + 当前页 ±1,跳过段用省略号(D12) */
|
|
6296
|
+
const pages = computed(() => {
|
|
6297
|
+
const count = totalPages.value;
|
|
6298
|
+
const current = pageIndex.value ?? 1;
|
|
6299
|
+
const window = [.../* @__PURE__ */ new Set([
|
|
6300
|
+
1,
|
|
6301
|
+
count,
|
|
6302
|
+
current - 1,
|
|
6303
|
+
current,
|
|
6304
|
+
current + 1
|
|
6305
|
+
])].filter((page) => page >= 1 && page <= count).sort((a, b) => a - b);
|
|
6306
|
+
const items = [];
|
|
6307
|
+
let previous = 0;
|
|
6308
|
+
for (const page of window) {
|
|
6309
|
+
if (previous && page - previous > 1) items.push("…");
|
|
6310
|
+
items.push(page);
|
|
6311
|
+
previous = page;
|
|
6312
|
+
}
|
|
6313
|
+
return items;
|
|
6314
|
+
});
|
|
6315
|
+
return (_ctx, _cache) => {
|
|
6316
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" R31:不带 border-t(布局归使用方,TableRender 内置使用处显式补);左区缺省时页码靠右 "), visible.value ? (openBlock(), createElementBlock("div", {
|
|
6317
|
+
key: 0,
|
|
6318
|
+
class: normalizeClass(unref(cn)("flex w-full items-center gap-4 p-2 text-sm", hasLeft.value ? "justify-between" : "justify-end", _ctx.$attrs.class))
|
|
6319
|
+
}, [
|
|
6320
|
+
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", {
|
|
6321
|
+
key: 1,
|
|
6322
|
+
class: "h-8 rounded-md border bg-transparent px-2 text-sm",
|
|
6323
|
+
value: pageSize.value,
|
|
6324
|
+
onChange: _cache[0] || (_cache[0] = ($event) => onPageSize(Number($event.target.value)))
|
|
6325
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(pageSizeOpts.value, (size) => {
|
|
6326
|
+
return openBlock(), createElementBlock("option", {
|
|
6327
|
+
key: size,
|
|
6328
|
+
value: size
|
|
6329
|
+
}, toDisplayString(size) + " 条/页", 9, _hoisted_4$4);
|
|
6330
|
+
}), 128))], 40, _hoisted_3$6)) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
|
|
6331
|
+
createCommentVNode(" Root 渲染为裸 nav 且 Ellipsis 是块级 div,必须显式 flex 才不会断行 "),
|
|
6332
|
+
createVNode(unref(PaginationRoot), {
|
|
6333
|
+
class: "flex items-center gap-1",
|
|
6334
|
+
count: total.value ?? 0,
|
|
6335
|
+
page: pageIndex.value ?? 1,
|
|
6336
|
+
"page-size": pageSize.value ?? 1,
|
|
6337
|
+
"sibling-count": 1,
|
|
6338
|
+
onPageChange: _cache[1] || (_cache[1] = ($event) => onPageIndex($event.page))
|
|
6339
|
+
}, {
|
|
6340
|
+
default: withCtx(() => [
|
|
6341
|
+
createVNode(unref(PaginationPrevTrigger), {
|
|
6342
|
+
class: normalizeClass(["h-8 rounded-md border px-2 disabled:opacity-50", { "px-3": !iconMode.value }]),
|
|
6343
|
+
disabled: (pageIndex.value ?? 1) <= 1,
|
|
6344
|
+
"aria-label": iconMode.value ? "上一页" : void 0
|
|
6345
|
+
}, {
|
|
6346
|
+
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))]),
|
|
6347
|
+
_: 1
|
|
6348
|
+
}, 8, [
|
|
6349
|
+
"class",
|
|
6350
|
+
"disabled",
|
|
6351
|
+
"aria-label"
|
|
6352
|
+
]),
|
|
6353
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (item, index) => {
|
|
6354
|
+
return openBlock(), createElementBlock(Fragment, { key: typeof item === "number" ? item : `gap-${index}` }, [typeof item === "string" ? (openBlock(), createBlock(unref(PaginationEllipsis), {
|
|
6355
|
+
key: 0,
|
|
6356
|
+
index
|
|
6357
|
+
}, null, 8, ["index"])) : (openBlock(), createBlock(unref(PaginationItem), {
|
|
6358
|
+
key: 1,
|
|
6359
|
+
type: "page",
|
|
6360
|
+
class: "h-8 min-w-8 rounded-md border px-2 data-[selected]:bg-primary data-[selected]:text-primary-foreground",
|
|
6361
|
+
value: item
|
|
6362
|
+
}, {
|
|
6363
|
+
default: withCtx(() => [createTextVNode(toDisplayString(item), 1)]),
|
|
6364
|
+
_: 2
|
|
6365
|
+
}, 1032, ["value"]))], 64);
|
|
6366
|
+
}), 128)),
|
|
6367
|
+
createVNode(unref(PaginationNextTrigger), {
|
|
6368
|
+
class: normalizeClass(["h-8 rounded-md border px-2 disabled:opacity-50", { "px-3": !iconMode.value }]),
|
|
6369
|
+
disabled: (pageIndex.value ?? 1) >= totalPages.value,
|
|
6370
|
+
"aria-label": iconMode.value ? "下一页" : void 0
|
|
6371
|
+
}, {
|
|
6372
|
+
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))]),
|
|
6373
|
+
_: 1
|
|
6374
|
+
}, 8, [
|
|
6375
|
+
"class",
|
|
6376
|
+
"disabled",
|
|
6377
|
+
"aria-label"
|
|
6378
|
+
])
|
|
6379
|
+
]),
|
|
6380
|
+
_: 1
|
|
6381
|
+
}, 8, [
|
|
6382
|
+
"count",
|
|
6383
|
+
"page",
|
|
6384
|
+
"page-size"
|
|
6385
|
+
])
|
|
6386
|
+
], 2)) : createCommentVNode("v-if", true)], 2112);
|
|
6387
|
+
};
|
|
6388
|
+
}
|
|
6389
|
+
});
|
|
6390
|
+
//#endregion
|
|
5965
6391
|
//#region src/components/table-render/column-renders.ts
|
|
5966
6392
|
const pad = (value) => String(value).padStart(2, "0");
|
|
5967
6393
|
/** 迷你日期令牌格式化,不引入 date-fns;非法输入原样返回 */
|
|
@@ -6036,7 +6462,7 @@ function columnRenders() {
|
|
|
6036
6462
|
}
|
|
6037
6463
|
//#endregion
|
|
6038
6464
|
//#region src/components/tooltip/Tooltip.vue
|
|
6039
|
-
const _sfc_main$
|
|
6465
|
+
const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
6040
6466
|
__name: "Tooltip",
|
|
6041
6467
|
props: {
|
|
6042
6468
|
/** 提示文字;#content 插槽可覆盖以渲染富内容 */
|
|
@@ -6158,13 +6584,13 @@ function stickyClass(sticky, key) {
|
|
|
6158
6584
|
}
|
|
6159
6585
|
//#endregion
|
|
6160
6586
|
//#region src/components/table-render/TableBodyRow.vue
|
|
6161
|
-
const _hoisted_1$
|
|
6587
|
+
const _hoisted_1$9 = [
|
|
6162
6588
|
"checked",
|
|
6163
6589
|
"disabled",
|
|
6164
6590
|
"aria-label"
|
|
6165
6591
|
];
|
|
6166
|
-
const _hoisted_2$
|
|
6167
|
-
const _hoisted_3$
|
|
6592
|
+
const _hoisted_2$8 = ["title", "onClick"];
|
|
6593
|
+
const _hoisted_3$5 = ["aria-expanded", "aria-label"];
|
|
6168
6594
|
const _hoisted_4$3 = {
|
|
6169
6595
|
key: 2,
|
|
6170
6596
|
class: "min-w-0 truncate"
|
|
@@ -6219,7 +6645,7 @@ const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
|
6219
6645
|
* VNode(render 工厂)单元格经 cloneVNode 复制进触发位(VNode 不可二次挂载)。 */
|
|
6220
6646
|
function tooltipCell(value, text) {
|
|
6221
6647
|
const trigger = isVNode(value) ? cloneVNode(value) : h("span", { class: "block truncate" }, text);
|
|
6222
|
-
return h(_sfc_main$
|
|
6648
|
+
return h(_sfc_main$49, {
|
|
6223
6649
|
delayDuration: 0,
|
|
6224
6650
|
content: text
|
|
6225
6651
|
}, { default: () => [trigger] });
|
|
@@ -6245,7 +6671,7 @@ const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
|
6245
6671
|
disabled: !props.line.canSelect,
|
|
6246
6672
|
"aria-label": `选择第 ${props.line.index + 1} 行`,
|
|
6247
6673
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("select", !props.selected))
|
|
6248
|
-
}, null, 8, _hoisted_1$
|
|
6674
|
+
}, null, 8, _hoisted_1$9)) : (openBlock(), createBlock(unref(_sfc_main$9), {
|
|
6249
6675
|
key: 1,
|
|
6250
6676
|
checked: props.selected,
|
|
6251
6677
|
disabled: !props.line.canSelect,
|
|
@@ -6275,114 +6701,16 @@ const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
|
6275
6701
|
"aria-expanded": props.line.row.getIsExpanded(),
|
|
6276
6702
|
"aria-label": props.line.row.getIsExpanded() ? "收起" : "展开",
|
|
6277
6703
|
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => props.line.row.toggleExpanded(), ["stop"]))
|
|
6278
|
-
}, [createVNode(ChevronIcon_default, { class: normalizeClass(["size-3.5 transition-transform", { "rotate-90": props.line.row.getIsExpanded() }]) }, null, 8, ["class"])], 8, _hoisted_3$
|
|
6704
|
+
}, [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),
|
|
6279
6705
|
createCommentVNode(" VNode 必须走子节点渲染;文本插值会序列化 vnode 导致循环引用 "),
|
|
6280
6706
|
isVNode(value) ? (openBlock(), createBlock(resolveDynamicComponent(value), { key: 1 })) : (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString(value), 1))
|
|
6281
|
-
], 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$
|
|
6707
|
+
], 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);
|
|
6282
6708
|
}), 128))
|
|
6283
6709
|
], 32);
|
|
6284
6710
|
};
|
|
6285
6711
|
}
|
|
6286
6712
|
});
|
|
6287
6713
|
//#endregion
|
|
6288
|
-
//#region src/components/table-render/TablePagination.vue
|
|
6289
|
-
const _hoisted_1$9 = { class: "flex items-center gap-2 text-muted-foreground" };
|
|
6290
|
-
const _hoisted_2$8 = ["value"];
|
|
6291
|
-
const _hoisted_3$5 = ["value"];
|
|
6292
|
-
const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
6293
|
-
__name: "TablePagination",
|
|
6294
|
-
props: {
|
|
6295
|
-
pageIndex: {},
|
|
6296
|
-
pageSize: {},
|
|
6297
|
-
pageSizeOpts: {},
|
|
6298
|
-
total: {}
|
|
6299
|
-
},
|
|
6300
|
-
emits: ["update:pageIndex", "update:pageSize"],
|
|
6301
|
-
setup(__props, { emit: __emit }) {
|
|
6302
|
-
const props = __props;
|
|
6303
|
-
const emit = __emit;
|
|
6304
|
-
const totalPages = computed(() => Math.max(1, Math.ceil(props.total / props.pageSize)));
|
|
6305
|
-
/** 页码窗口:首页/尾页 + 当前页 ±1,跳过段用省略号(D12) */
|
|
6306
|
-
const pages = computed(() => {
|
|
6307
|
-
const count = totalPages.value;
|
|
6308
|
-
const window = [.../* @__PURE__ */ new Set([
|
|
6309
|
-
1,
|
|
6310
|
-
count,
|
|
6311
|
-
props.pageIndex - 1,
|
|
6312
|
-
props.pageIndex,
|
|
6313
|
-
props.pageIndex + 1
|
|
6314
|
-
])].filter((page) => page >= 1 && page <= count).sort((a, b) => a - b);
|
|
6315
|
-
const items = [];
|
|
6316
|
-
let previous = 0;
|
|
6317
|
-
for (const page of window) {
|
|
6318
|
-
if (previous && page - previous > 1) items.push("…");
|
|
6319
|
-
items.push(page);
|
|
6320
|
-
previous = page;
|
|
6321
|
-
}
|
|
6322
|
-
return items;
|
|
6323
|
-
});
|
|
6324
|
-
return (_ctx, _cache) => {
|
|
6325
|
-
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)) }, [
|
|
6326
|
-
createElementVNode("div", _hoisted_1$9, [createElementVNode("span", null, "共 " + toDisplayString(__props.total) + " 条", 1), createElementVNode("select", {
|
|
6327
|
-
class: "h-8 rounded-md border bg-transparent px-2 text-sm",
|
|
6328
|
-
value: __props.pageSize,
|
|
6329
|
-
onChange: _cache[0] || (_cache[0] = ($event) => emit("update:pageSize", Number($event.target.value)))
|
|
6330
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.pageSizeOpts, (size) => {
|
|
6331
|
-
return openBlock(), createElementBlock("option", {
|
|
6332
|
-
key: size,
|
|
6333
|
-
value: size
|
|
6334
|
-
}, toDisplayString(size) + " 条/页", 9, _hoisted_3$5);
|
|
6335
|
-
}), 128))], 40, _hoisted_2$8)]),
|
|
6336
|
-
createCommentVNode(" Root 渲染为裸 nav 且 Ellipsis 是块级 div,必须显式 flex 才不会断行 "),
|
|
6337
|
-
createVNode(unref(PaginationRoot), {
|
|
6338
|
-
class: "flex items-center gap-1",
|
|
6339
|
-
count: __props.total,
|
|
6340
|
-
page: __props.pageIndex,
|
|
6341
|
-
"page-size": __props.pageSize,
|
|
6342
|
-
"sibling-count": 1,
|
|
6343
|
-
onPageChange: _cache[1] || (_cache[1] = ($event) => emit("update:pageIndex", $event.page))
|
|
6344
|
-
}, {
|
|
6345
|
-
default: withCtx(() => [
|
|
6346
|
-
createVNode(unref(PaginationPrevTrigger), {
|
|
6347
|
-
class: "h-8 rounded-md border px-3 disabled:opacity-50",
|
|
6348
|
-
disabled: __props.pageIndex <= 1
|
|
6349
|
-
}, {
|
|
6350
|
-
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" 上一页 ", -1)])]),
|
|
6351
|
-
_: 1
|
|
6352
|
-
}, 8, ["disabled"]),
|
|
6353
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (item, index) => {
|
|
6354
|
-
return openBlock(), createElementBlock(Fragment, { key: typeof item === "number" ? item : `gap-${index}` }, [typeof item === "string" ? (openBlock(), createBlock(unref(PaginationEllipsis), {
|
|
6355
|
-
key: 0,
|
|
6356
|
-
index
|
|
6357
|
-
}, null, 8, ["index"])) : (openBlock(), createBlock(unref(PaginationItem), {
|
|
6358
|
-
key: 1,
|
|
6359
|
-
type: "page",
|
|
6360
|
-
class: "h-8 min-w-8 rounded-md border px-2 data-[selected]:bg-primary data-[selected]:text-primary-foreground",
|
|
6361
|
-
value: item
|
|
6362
|
-
}, {
|
|
6363
|
-
default: withCtx(() => [createTextVNode(toDisplayString(item), 1)]),
|
|
6364
|
-
_: 2
|
|
6365
|
-
}, 1032, ["value"]))], 64);
|
|
6366
|
-
}), 128)),
|
|
6367
|
-
createVNode(unref(PaginationNextTrigger), {
|
|
6368
|
-
class: "h-8 rounded-md border px-3 disabled:opacity-50",
|
|
6369
|
-
disabled: __props.pageIndex >= totalPages.value
|
|
6370
|
-
}, {
|
|
6371
|
-
default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" 下一页 ", -1)])]),
|
|
6372
|
-
_: 1
|
|
6373
|
-
}, 8, ["disabled"])
|
|
6374
|
-
]),
|
|
6375
|
-
_: 1
|
|
6376
|
-
}, 8, [
|
|
6377
|
-
"count",
|
|
6378
|
-
"page",
|
|
6379
|
-
"page-size"
|
|
6380
|
-
])
|
|
6381
|
-
], 2);
|
|
6382
|
-
};
|
|
6383
|
-
}
|
|
6384
|
-
});
|
|
6385
|
-
//#endregion
|
|
6386
6714
|
//#region src/components/table-render/useTableRender.ts
|
|
6387
6715
|
const DEFAULT_PAGE_SIZE_OPTS = [
|
|
6388
6716
|
10,
|
|
@@ -6830,7 +7158,7 @@ const _hoisted_18 = {
|
|
|
6830
7158
|
"data-empty": ""
|
|
6831
7159
|
};
|
|
6832
7160
|
const _hoisted_19 = ["colspan"];
|
|
6833
|
-
const _sfc_main$
|
|
7161
|
+
const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
6834
7162
|
__name: "TableRender",
|
|
6835
7163
|
props: {
|
|
6836
7164
|
/** 聚合式(推荐):defineTable 返回的定义对象 */
|
|
@@ -6886,6 +7214,16 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
6886
7214
|
columnSettings: {
|
|
6887
7215
|
type: Boolean,
|
|
6888
7216
|
default: void 0
|
|
7217
|
+
},
|
|
7218
|
+
/** 搜索区渲染开关(R27):false 关闭内置搜索区(组合式外置 FormRender);数据链路不变 */
|
|
7219
|
+
showSearch: {
|
|
7220
|
+
type: Boolean,
|
|
7221
|
+
default: void 0
|
|
7222
|
+
},
|
|
7223
|
+
/** 分页条渲染开关(R28):false 关闭内置分页条(组合式外置 TablePagination);缺省模式 R13 不变 */
|
|
7224
|
+
showPagination: {
|
|
7225
|
+
type: Boolean,
|
|
7226
|
+
default: void 0
|
|
6889
7227
|
}
|
|
6890
7228
|
},
|
|
6891
7229
|
emits: [
|
|
@@ -6969,6 +7307,10 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
6969
7307
|
/** 内部加载态 ∪ 外部受控加载态(R14) */
|
|
6970
7308
|
const loading = computed(() => props.loading === true || instance.loading.value);
|
|
6971
7309
|
const showPagination = computed(() => Math.ceil(instance.page.total / instance.page.pageSize) > 1);
|
|
7310
|
+
/** 内置分页条开关(R28):showPagination=false 关闭;R13 仅作用于缺省模式 */
|
|
7311
|
+
const showPaginationBar = computed(() => showPagination.value && props.showPagination !== false);
|
|
7312
|
+
/** 内置搜索区开关(R27):配置了 search 且未被 showSearch=false 关闭;列设置触发器不受影响 */
|
|
7313
|
+
const showSearchArea = computed(() => search !== void 0 && props.showSearch !== false);
|
|
6972
7314
|
const loadError = computed(() => instance.error.value);
|
|
6973
7315
|
const showError = computed(() => !loading.value && loadError.value !== void 0);
|
|
6974
7316
|
watch(loadError, (err) => {
|
|
@@ -7211,16 +7553,16 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7211
7553
|
});
|
|
7212
7554
|
return (_ctx, _cache) => {
|
|
7213
7555
|
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("w-full", _ctx.$attrs.class)) }, [
|
|
7214
|
-
createCommentVNode(" 搜索区 + 列设置触发器:同行右对齐(items-end
|
|
7215
|
-
|
|
7216
|
-
|
|
7556
|
+
createCommentVNode(" 搜索区 + 列设置触发器:同行右对齐(items-end);无搜索时触发器位于表格上方(R27:showSearch=false 关闭搜索区) "),
|
|
7557
|
+
showSearchArea.value || showColumnSettings.value ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
7558
|
+
showSearchArea.value ? (openBlock(), createBlock(unref(_sfc_main$25), {
|
|
7217
7559
|
key: 0,
|
|
7218
7560
|
class: "min-w-0 flex-1",
|
|
7219
7561
|
definition: unref(search),
|
|
7220
|
-
searchable:
|
|
7562
|
+
searchable: unref(search).actions ? void 0 : true,
|
|
7221
7563
|
onSearch,
|
|
7222
7564
|
onReset
|
|
7223
|
-
}, null, 8, ["definition"])) : createCommentVNode("v-if", true),
|
|
7565
|
+
}, null, 8, ["definition", "searchable"])) : createCommentVNode("v-if", true),
|
|
7224
7566
|
createCommentVNode(" 列设置:Popover 面板(R20 最少一列 / R21 重置 / R22 不含选择列);\n 触发钮 Tooltip 手动受控开合(Tooltip 与 Popover 触发器嵌套会吞点击,故并列渲染、不走 hover 自动触发) "),
|
|
7225
7567
|
showColumnSettings.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
7226
7568
|
createVNode(unref(_sfc_main$34), {
|
|
@@ -7300,7 +7642,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7300
7642
|
_: 1
|
|
7301
7643
|
}),
|
|
7302
7644
|
createCommentVNode(" 纯受控气泡(无默认插槽,不渲染触发器):开合由触发钮 pointerenter/leave 驱动 "),
|
|
7303
|
-
createVNode(unref(_sfc_main$
|
|
7645
|
+
createVNode(unref(_sfc_main$49), {
|
|
7304
7646
|
open: settingsTipOpen.value,
|
|
7305
7647
|
content: "列设置"
|
|
7306
7648
|
}, null, 8, ["open"])
|
|
@@ -7463,12 +7805,15 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7463
7805
|
class: "p-8 text-center text-muted-foreground"
|
|
7464
7806
|
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText ?? "暂无数据"), 1)])], 8, _hoisted_19)])) : createCommentVNode("v-if", true)
|
|
7465
7807
|
])])], 4),
|
|
7466
|
-
|
|
7808
|
+
createCommentVNode(" R31:手动接线(须经 onPageIndex/onPageSize 包装器保留受控去重);显式补 border-t 与 size select 保持现状 "),
|
|
7809
|
+
showPaginationBar.value ? (openBlock(), createBlock(_sfc_main$43, {
|
|
7467
7810
|
key: 1,
|
|
7811
|
+
class: "border-t",
|
|
7468
7812
|
"page-index": unref(instance).page.pageIndex,
|
|
7469
7813
|
"page-size": unref(instance).page.pageSize,
|
|
7470
7814
|
"page-size-opts": unref(instance).page.pageSizeOpts,
|
|
7471
7815
|
total: unref(instance).page.total,
|
|
7816
|
+
"show-size-select": true,
|
|
7472
7817
|
"onUpdate:pageIndex": onPageIndex,
|
|
7473
7818
|
"onUpdate:pageSize": onPageSize
|
|
7474
7819
|
}, null, 8, [
|
|
@@ -7509,7 +7854,7 @@ const _hoisted_1$7 = [
|
|
|
7509
7854
|
"onClick",
|
|
7510
7855
|
"onKeydown"
|
|
7511
7856
|
];
|
|
7512
|
-
const _sfc_main$
|
|
7857
|
+
const _sfc_main$45 = /*@__PURE__*/ defineComponent({
|
|
7513
7858
|
__name: "Tabs",
|
|
7514
7859
|
props: {
|
|
7515
7860
|
items: {},
|
|
@@ -8100,7 +8445,7 @@ const _hoisted_7 = { class: "flex shrink-0 items-center gap-1" };
|
|
|
8100
8445
|
* 内部按 props 重建 useToast 单例 store,随后所有 toast 方法经单例转发到这里渲染。
|
|
8101
8446
|
*/
|
|
8102
8447
|
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";
|
|
8103
|
-
const _sfc_main$
|
|
8448
|
+
const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
8104
8449
|
__name: "ToastProvider",
|
|
8105
8450
|
props: {
|
|
8106
8451
|
/** 弹出位置 */
|
|
@@ -8716,7 +9061,7 @@ const _sfc_main$33 = /*@__PURE__*/ defineComponent({
|
|
|
8716
9061
|
});
|
|
8717
9062
|
//#endregion
|
|
8718
9063
|
//#region src/components/timeline/Timeline.vue
|
|
8719
|
-
const _sfc_main$
|
|
9064
|
+
const _sfc_main$47 = /*@__PURE__*/ defineComponent({
|
|
8720
9065
|
__name: "Timeline",
|
|
8721
9066
|
props: {
|
|
8722
9067
|
items: {},
|
|
@@ -8937,4 +9282,4 @@ const timelineDotVariants = cva("relative z-10 mt-1 block shrink-0 rounded-full"
|
|
|
8937
9282
|
}
|
|
8938
9283
|
});
|
|
8939
9284
|
//#endregion
|
|
8940
|
-
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
|
|
9285
|
+
export { _sfc_main as Alert, _sfc_main$1 as AlertDialog, _sfc_main$2 as Avatar, _sfc_main$3 as AvatarGroup, _sfc_main$4 as Badge, _sfc_main$5 as Button, CHECKED, COMPONENT_NAMES, _sfc_main$6 as Calendar, _sfc_main$7 as Card, _sfc_main$8 as Cascader, _sfc_main$9 as Checkbox, _sfc_main$10 as ContextMenu, _sfc_main$11 as CurrencyInput, _sfc_main$12 as DatePicker, _sfc_main$13 as DateRangePicker, _sfc_main$14 as Dialog, _sfc_main$15 as Drawer, _sfc_main$16 as DropdownMenu, _sfc_main$17 as Empty, _sfc_main$18 as Form, _sfc_main$19 as FormControl, _sfc_main$20 as FormDescription, _sfc_main$21 as FormField, _sfc_main$22 as FormItem, _sfc_main$23 as FormLabel, _sfc_main$24 as FormMessage, _sfc_main$25 as FormRender, _sfc_main$26 as FormSubscribe, _sfc_main$27 as Input, _sfc_main$28 as Label, MODEL_VALUE, _sfc_main$29 as MonthPicker, _sfc_main$30 as NumberInput, _sfc_main$31 as PasswordInput, _sfc_main$32 as PinInput, _sfc_main$33 as Popconfirm, _sfc_main$34 as Popover, _sfc_main$35 as Progress, _sfc_main$36 as RadioGroup, SLIDER, _sfc_main$37 as Select, _sfc_main$38 as Separator, _sfc_main$39 as Skeleton, _sfc_main$40 as Slider, Slot, _sfc_main$41 as Spin, _sfc_main$42 as Switch, _sfc_main$43 as TablePagination, _sfc_main$44 as TableRender, _sfc_main$45 as Tabs, _sfc_main$46 as Textarea, _sfc_main$47 as Timeline, _sfc_main$48 as ToastProvider, _sfc_main$49 as Tooltip, _sfc_main$50 as TreeSelect, TuDesignResolver, VALUE, _sfc_main$51 as WeekPicker, _sfc_main$52 as YearPicker, alertIconPaths, alertIconVariants, alertVariants, avatarGroupKey, avatarVariants, badgeVariants, bindField, buttonVariants, cardVariants, cn, columnRenders, defineColumns, defineForm, defineTable, formatCurrency, numberOrNull, parseCurrency, timelineDotVariants, timelineItemVariants, timelineVariants, useFormRender, useTableRender, useToast, widgetRenders };
|