@tu-design/vue 0.4.1 → 0.4.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/README.md +2 -2
- package/dist/index.d.mts +355 -260
- package/dist/index.mjs +402 -79
- package/dist/registry/vue/alert-dialog.json +1 -0
- package/dist/registry/vue/alert.json +1 -0
- package/dist/registry/vue/avatar-group.json +1 -0
- package/dist/registry/vue/avatar.json +1 -0
- package/dist/registry/vue/badge.json +1 -0
- package/dist/registry/vue/button.json +1 -0
- package/dist/registry/vue/calendar.json +1 -0
- package/dist/registry/vue/card.json +2 -0
- package/dist/registry/vue/cascader.json +1 -0
- package/dist/registry/vue/checkbox.json +1 -0
- package/dist/registry/vue/context-menu.json +1 -0
- package/dist/registry/vue/currency-input.json +1 -0
- package/dist/registry/vue/date-picker.json +1 -0
- package/dist/registry/vue/date-range-picker.json +1 -0
- package/dist/registry/vue/date-shared.json +1 -0
- package/dist/registry/vue/dialog.json +1 -0
- package/dist/registry/vue/drawer.json +1 -0
- package/dist/registry/vue/dropdown-menu.json +1 -0
- package/dist/registry/vue/empty.json +1 -0
- package/dist/registry/vue/form-render.json +1 -0
- package/dist/registry/vue/form.json +1 -0
- package/dist/registry/vue/input.json +1 -0
- package/dist/registry/vue/label.json +1 -0
- package/dist/registry/vue/month-picker.json +1 -0
- package/dist/registry/vue/number-input.json +1 -0
- package/dist/registry/vue/overlay-shared.json +1 -0
- package/dist/registry/vue/password-input.json +1 -0
- package/dist/registry/vue/pin-input.json +1 -0
- package/dist/registry/vue/popconfirm.json +1 -0
- package/dist/registry/vue/popover.json +1 -0
- package/dist/registry/vue/progress.json +1 -0
- package/dist/registry/vue/radio-group.json +1 -0
- package/dist/registry/vue/registry.json +57 -0
- package/dist/registry/vue/select.json +1 -0
- package/dist/registry/vue/separator.json +1 -0
- package/dist/registry/vue/skeleton.json +1 -0
- package/dist/registry/vue/slider.json +1 -0
- package/dist/registry/vue/slot.json +1 -0
- package/dist/registry/vue/spin.json +1 -0
- package/dist/registry/vue/switch.json +1 -0
- package/dist/registry/vue/table-render.json +1 -0
- package/dist/registry/vue/tabs.json +9 -2
- package/dist/registry/vue/textarea.json +1 -0
- package/dist/registry/vue/timeline.json +23 -0
- package/dist/registry/vue/toast.json +1 -0
- package/dist/registry/vue/tokens.json +1 -0
- package/dist/registry/vue/tooltip.json +1 -0
- package/dist/registry/vue/tree-select.json +1 -0
- package/dist/registry/vue/tree-shared.json +3 -2
- package/dist/registry/vue/utils.json +1 -0
- package/dist/registry/vue/week-picker.json +1 -0
- package/dist/registry/vue/year-picker.json +1 -0
- package/dist/style.css +10 -0
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -86,6 +86,7 @@ const COMPONENT_NAMES = [
|
|
|
86
86
|
"TableRender",
|
|
87
87
|
"Tabs",
|
|
88
88
|
"Textarea",
|
|
89
|
+
"Timeline",
|
|
89
90
|
"ToastProvider",
|
|
90
91
|
"TreeSelect",
|
|
91
92
|
"Tooltip",
|
|
@@ -448,7 +449,7 @@ const _sfc_main$26 = /*@__PURE__*/ defineComponent({
|
|
|
448
449
|
* aria 接线(id/aria-invalid/aria-describedby)由 FormControl 的 cloneVNode 机制继承。
|
|
449
450
|
* widget 调用发生在 FormField 插槽期,拿到 field 实例后组装 WidgetContext。
|
|
450
451
|
*/
|
|
451
|
-
const _sfc_main$
|
|
452
|
+
const _sfc_main$65 = defineComponent({
|
|
452
453
|
name: "TuFormRenderField",
|
|
453
454
|
props: {
|
|
454
455
|
item: {
|
|
@@ -944,7 +945,7 @@ const navBtnCls = "text-muted-foreground inline-flex size-8 items-center justify
|
|
|
944
945
|
const viewTriggerCls = "hover:bg-accent inline-flex items-center gap-1 rounded-[3px] px-3 py-1.5 text-sm font-semibold text-foreground outline-none transition-colors disabled:pointer-events-none";
|
|
945
946
|
const viewTitleCls = "text-sm font-semibold text-foreground";
|
|
946
947
|
/** 年代范围文本(zag 无现成 part,由 focusedValue.year 推算):2026 → "2020 - 2029" */
|
|
947
|
-
const _sfc_main$
|
|
948
|
+
const _sfc_main$64 = /*@__PURE__*/ defineComponent({
|
|
948
949
|
__name: "CalendarNav",
|
|
949
950
|
props: {
|
|
950
951
|
/** 导航条服务的视图,决定中间内容形态:day=ViewTrigger(上钻)/ month=年份 / year=年代 */
|
|
@@ -1023,7 +1024,7 @@ const headCellCls = "text-muted-foreground h-8 border-x-0! border-t-0! border-b
|
|
|
1023
1024
|
const bodyCellCls = "border-0! p-0! text-center";
|
|
1024
1025
|
const rowCls = "bg-transparent!";
|
|
1025
1026
|
/** 表 i 的锚点月起点(zag getOffset({months: i-1}).visibleRange.start) */
|
|
1026
|
-
const _sfc_main$
|
|
1027
|
+
const _sfc_main$63 = /*@__PURE__*/ defineComponent({
|
|
1027
1028
|
__name: "CalendarBody",
|
|
1028
1029
|
props: {
|
|
1029
1030
|
mode: { default: "day" },
|
|
@@ -1064,7 +1065,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1064
1065
|
createVNode(unref(DatePicker).View, { view: "day" }, {
|
|
1065
1066
|
default: withCtx(() => [
|
|
1066
1067
|
createCommentVNode(" day 视图导航条在 View 内:viewProps=day → GOTO.NEXT=focusNextPage(翻月) "),
|
|
1067
|
-
createVNode(_sfc_main$
|
|
1068
|
+
createVNode(_sfc_main$64, { view: "day" }),
|
|
1068
1069
|
createVNode(unref(DatePicker).Context, null, {
|
|
1069
1070
|
default: withCtx((context) => [createElementVNode("div", _hoisted_1$26, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.numOfMonths, (i) => {
|
|
1070
1071
|
return openBlock(), createBlock(unref(DatePicker).Table, {
|
|
@@ -1123,7 +1124,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1123
1124
|
createVNode(unref(DatePicker).View, { view: "month" }, {
|
|
1124
1125
|
default: withCtx(() => [
|
|
1125
1126
|
createCommentVNode(" 切换视图导航条也在 View 内:DatePicker 切月视图后 GOTO.NEXT=focusNextYear(修复 backlog) "),
|
|
1126
|
-
createVNode(_sfc_main$
|
|
1127
|
+
createVNode(_sfc_main$64, { view: "month" }),
|
|
1127
1128
|
createVNode(unref(DatePicker).Context, null, {
|
|
1128
1129
|
default: withCtx((context) => [createVNode(unref(DatePicker).Table, { class: normalizeClass(tableCls) }, {
|
|
1129
1130
|
default: withCtx(() => [createVNode(unref(DatePicker).TableBody, null, {
|
|
@@ -1161,7 +1162,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1161
1162
|
_: 1
|
|
1162
1163
|
}),
|
|
1163
1164
|
createVNode(unref(DatePicker).View, { view: "year" }, {
|
|
1164
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
1165
|
+
default: withCtx(() => [createVNode(_sfc_main$64, { view: "year" }), createVNode(unref(DatePicker).Context, null, {
|
|
1165
1166
|
default: withCtx((context) => [createVNode(unref(DatePicker).Table, { class: normalizeClass(tableCls) }, {
|
|
1166
1167
|
default: withCtx(() => [createVNode(unref(DatePicker).TableBody, null, {
|
|
1167
1168
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(context.getYearsGrid({ columns: 4 }), (yearsRow, id) => {
|
|
@@ -1199,7 +1200,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1199
1200
|
}, {
|
|
1200
1201
|
default: withCtx(() => [
|
|
1201
1202
|
createCommentVNode(" 导航条必须在 View 子树内:Prev/NextTrigger 才能拿到 view=\"month\"(GOTO.NEXT=focusNextYear) "),
|
|
1202
|
-
createVNode(_sfc_main$
|
|
1203
|
+
createVNode(_sfc_main$64, { view: "month" }),
|
|
1203
1204
|
createVNode(unref(DatePicker).Context, null, {
|
|
1204
1205
|
default: withCtx((context) => [createVNode(unref(DatePicker).Table, { class: normalizeClass(tableCls) }, {
|
|
1205
1206
|
default: withCtx(() => [createVNode(unref(DatePicker).TableBody, null, {
|
|
@@ -1241,7 +1242,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1241
1242
|
}, {
|
|
1242
1243
|
default: withCtx(() => [
|
|
1243
1244
|
createCommentVNode(" 导航条必须在 View 子树内:Prev/NextTrigger 才能拿到 view=\"year\"(GOTO.NEXT=focusNextDecade) "),
|
|
1244
|
-
createVNode(_sfc_main$
|
|
1245
|
+
createVNode(_sfc_main$64, { view: "year" }),
|
|
1245
1246
|
createVNode(unref(DatePicker).Context, null, {
|
|
1246
1247
|
default: withCtx((context) => [createVNode(unref(DatePicker).Table, { class: normalizeClass(tableCls) }, {
|
|
1247
1248
|
default: withCtx(() => [createVNode(unref(DatePicker).TableBody, null, {
|
|
@@ -1364,7 +1365,7 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
|
1364
1365
|
"onUpdate:modelValue": handleValueUpdate
|
|
1365
1366
|
}, {
|
|
1366
1367
|
default: withCtx(() => [createVNode(unref(DatePicker).Content, null, {
|
|
1367
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
1368
|
+
default: withCtx(() => [createVNode(_sfc_main$63, {
|
|
1368
1369
|
mode: props.mode,
|
|
1369
1370
|
"num-of-months": props.numOfMonths,
|
|
1370
1371
|
week: props.week,
|
|
@@ -1387,7 +1388,7 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
|
1387
1388
|
"max",
|
|
1388
1389
|
"is-date-unavailable",
|
|
1389
1390
|
"locale"
|
|
1390
|
-
])], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" embedded 内嵌形态:宿主 Picker 的 Root 供能,纯卡片内核 "), createVNode(_sfc_main$
|
|
1391
|
+
])], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" embedded 内嵌形态:宿主 Picker 的 Root 供能,纯卡片内核 "), createVNode(_sfc_main$63, {
|
|
1391
1392
|
mode: props.mode,
|
|
1392
1393
|
"num-of-months": props.numOfMonths,
|
|
1393
1394
|
week: props.week,
|
|
@@ -1410,7 +1411,7 @@ var export_helper_default = (sfc, props) => {
|
|
|
1410
1411
|
};
|
|
1411
1412
|
//#endregion
|
|
1412
1413
|
//#region src/components/date-shared/CalendarIcon.vue
|
|
1413
|
-
const _sfc_main$
|
|
1414
|
+
const _sfc_main$62 = {};
|
|
1414
1415
|
const _hoisted_1$25 = {
|
|
1415
1416
|
viewBox: "0 0 24 24",
|
|
1416
1417
|
fill: "none",
|
|
@@ -1434,10 +1435,10 @@ function _sfc_render$3(_ctx, _cache) {
|
|
|
1434
1435
|
createElementVNode("path", { d: "M3 10h18" }, null, -1)
|
|
1435
1436
|
])]);
|
|
1436
1437
|
}
|
|
1437
|
-
var CalendarIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
1438
|
+
var CalendarIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$62, [["render", _sfc_render$3]]);
|
|
1438
1439
|
//#endregion
|
|
1439
1440
|
//#region src/components/date-shared/ClearIcon.vue
|
|
1440
|
-
const _sfc_main$
|
|
1441
|
+
const _sfc_main$61 = {};
|
|
1441
1442
|
const _hoisted_1$24 = {
|
|
1442
1443
|
viewBox: "0 0 24 24",
|
|
1443
1444
|
fill: "none",
|
|
@@ -1450,11 +1451,11 @@ const _hoisted_1$24 = {
|
|
|
1450
1451
|
function _sfc_render$2(_ctx, _cache) {
|
|
1451
1452
|
return openBlock(), createElementBlock("svg", _hoisted_1$24, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M18 6 6 18" }, null, -1), createElementVNode("path", { d: "m6 6 12 12" }, null, -1)])]);
|
|
1452
1453
|
}
|
|
1453
|
-
var ClearIcon_default$1 = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
1454
|
+
var ClearIcon_default$1 = /*#__PURE__*/ export_helper_default(_sfc_main$61, [["render", _sfc_render$2]]);
|
|
1454
1455
|
//#endregion
|
|
1455
1456
|
//#region src/components/date-shared/PickerShell.vue
|
|
1456
1457
|
/** 单值日期族(Date/Month/Year/Week)共用外壳:触发器 + 清空/日历按钮 + 弹层容器。 */
|
|
1457
|
-
const _sfc_main$
|
|
1458
|
+
const _sfc_main$60 = /*@__PURE__*/ defineComponent({
|
|
1458
1459
|
inheritAttrs: false,
|
|
1459
1460
|
__name: "PickerShell",
|
|
1460
1461
|
props: {
|
|
@@ -1752,7 +1753,7 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
|
1752
1753
|
const minDate = computed(() => parseIsoDate(props.min ?? ""));
|
|
1753
1754
|
const maxDate = computed(() => parseIsoDate(props.max ?? ""));
|
|
1754
1755
|
return (_ctx, _cache) => {
|
|
1755
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1756
|
+
return openBlock(), createBlock(_sfc_main$60, mergeProps(_ctx.$attrs, {
|
|
1756
1757
|
"model-value": unref(rootValue),
|
|
1757
1758
|
open: unref(isOpen),
|
|
1758
1759
|
locale: props.locale,
|
|
@@ -2089,7 +2090,7 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
|
|
|
2089
2090
|
return anchor ? anchor.set({ day: 31 }) : void 0;
|
|
2090
2091
|
});
|
|
2091
2092
|
return (_ctx, _cache) => {
|
|
2092
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2093
|
+
return openBlock(), createBlock(_sfc_main$60, mergeProps(_ctx.$attrs, {
|
|
2093
2094
|
"model-value": unref(rootValue),
|
|
2094
2095
|
open: unref(isOpen),
|
|
2095
2096
|
locale: props.locale,
|
|
@@ -2401,7 +2402,7 @@ const _sfc_main$45 = /*@__PURE__*/ defineComponent({
|
|
|
2401
2402
|
});
|
|
2402
2403
|
//#endregion
|
|
2403
2404
|
//#region src/components/week-picker/WeekPicker.vue
|
|
2404
|
-
const _sfc_main$
|
|
2405
|
+
const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
2405
2406
|
inheritAttrs: false,
|
|
2406
2407
|
__name: "WeekPicker",
|
|
2407
2408
|
props: {
|
|
@@ -2503,7 +2504,7 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
2503
2504
|
return date ? weekStartOf(date, props.locale) : void 0;
|
|
2504
2505
|
}
|
|
2505
2506
|
return (_ctx, _cache) => {
|
|
2506
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2507
|
+
return openBlock(), createBlock(_sfc_main$60, mergeProps(_ctx.$attrs, {
|
|
2507
2508
|
"model-value": unref(rootValue),
|
|
2508
2509
|
open: unref(isOpen),
|
|
2509
2510
|
locale: props.locale,
|
|
@@ -2547,7 +2548,7 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
2547
2548
|
});
|
|
2548
2549
|
//#endregion
|
|
2549
2550
|
//#region src/components/year-picker/YearPicker.vue
|
|
2550
|
-
const _sfc_main$
|
|
2551
|
+
const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
2551
2552
|
inheritAttrs: false,
|
|
2552
2553
|
__name: "YearPicker",
|
|
2553
2554
|
props: {
|
|
@@ -2631,7 +2632,7 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
2631
2632
|
const minDate = computed(() => parseIsoYear(props.min ?? ""));
|
|
2632
2633
|
const maxDate = computed(() => parseIsoYear(props.max ?? ""));
|
|
2633
2634
|
return (_ctx, _cache) => {
|
|
2634
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2635
|
+
return openBlock(), createBlock(_sfc_main$60, mergeProps(_ctx.$attrs, {
|
|
2635
2636
|
"model-value": unref(rootValue),
|
|
2636
2637
|
open: unref(isOpen),
|
|
2637
2638
|
locale: props.locale,
|
|
@@ -2733,14 +2734,14 @@ function renderMonthPickerItem(options = {}) {
|
|
|
2733
2734
|
return pickerRenderer(_sfc_main$29, options);
|
|
2734
2735
|
}
|
|
2735
2736
|
function renderYearPickerItem(options = {}) {
|
|
2736
|
-
return pickerRenderer(_sfc_main$
|
|
2737
|
+
return pickerRenderer(_sfc_main$51, options);
|
|
2737
2738
|
}
|
|
2738
2739
|
/** dateRangePicker widget:[start, end] | null 形态 */
|
|
2739
2740
|
function renderDateRangePickerItem(options = {}) {
|
|
2740
2741
|
return pickerRenderer(_sfc_main$13, options);
|
|
2741
2742
|
}
|
|
2742
2743
|
function renderWeekPickerItem(options = {}) {
|
|
2743
|
-
return pickerRenderer(_sfc_main$
|
|
2744
|
+
return pickerRenderer(_sfc_main$50, options);
|
|
2744
2745
|
}
|
|
2745
2746
|
//#endregion
|
|
2746
2747
|
//#region src/components/input/Input.vue
|
|
@@ -3117,7 +3118,7 @@ function renderSliderItem(options = {}) {
|
|
|
3117
3118
|
}
|
|
3118
3119
|
//#endregion
|
|
3119
3120
|
//#region src/components/tree-shared/ChevronIcon.vue
|
|
3120
|
-
const _sfc_main$
|
|
3121
|
+
const _sfc_main$59 = {};
|
|
3121
3122
|
const _hoisted_1$20 = {
|
|
3122
3123
|
viewBox: "0 0 24 24",
|
|
3123
3124
|
fill: "none",
|
|
@@ -3131,10 +3132,10 @@ const _hoisted_1$20 = {
|
|
|
3131
3132
|
function _sfc_render$1(_ctx, _cache) {
|
|
3132
3133
|
return openBlock(), createElementBlock("svg", _hoisted_1$20, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "m9 18 6-6-6-6" }, null, -1)])]);
|
|
3133
3134
|
}
|
|
3134
|
-
var ChevronIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
3135
|
+
var ChevronIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$59, [["render", _sfc_render$1]]);
|
|
3135
3136
|
//#endregion
|
|
3136
3137
|
//#region src/components/tree-shared/ClearIcon.vue
|
|
3137
|
-
const _sfc_main$
|
|
3138
|
+
const _sfc_main$58 = {};
|
|
3138
3139
|
const _hoisted_1$19 = {
|
|
3139
3140
|
viewBox: "0 0 24 24",
|
|
3140
3141
|
fill: "none",
|
|
@@ -3147,7 +3148,7 @@ const _hoisted_1$19 = {
|
|
|
3147
3148
|
function _sfc_render(_ctx, _cache) {
|
|
3148
3149
|
return openBlock(), createElementBlock("svg", _hoisted_1$19, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M18 6 6 18" }, null, -1), createElementVNode("path", { d: "m6 6 12 12" }, null, -1)])]);
|
|
3149
3150
|
}
|
|
3150
|
-
var ClearIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
3151
|
+
var ClearIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$58, [["render", _sfc_render]]);
|
|
3151
3152
|
//#endregion
|
|
3152
3153
|
//#region src/components/tree-shared/ValueTags.vue
|
|
3153
3154
|
const _hoisted_1$18 = ["data-key"];
|
|
@@ -3158,7 +3159,7 @@ const _hoisted_4$8 = {
|
|
|
3158
3159
|
"data-part": "tag-overflow",
|
|
3159
3160
|
class: "text-xs text-muted-foreground"
|
|
3160
3161
|
};
|
|
3161
|
-
const _sfc_main$
|
|
3162
|
+
const _sfc_main$57 = /*@__PURE__*/ defineComponent({
|
|
3162
3163
|
__name: "ValueTags",
|
|
3163
3164
|
props: {
|
|
3164
3165
|
/** 展示的选中值(key + label) */
|
|
@@ -3238,7 +3239,7 @@ const _sfc_main$56 = /*@__PURE__*/ defineComponent({
|
|
|
3238
3239
|
/*!
|
|
3239
3240
|
* 移植自 treemate v0.3.11 —— https://github.com/07akioni/treemate
|
|
3240
3241
|
* MIT License · Copyright (c) 07akioni
|
|
3241
|
-
*
|
|
3242
|
+
* 本地改动:defaultGetChildren 返回类型同步 GetChildren 塌缩为 `unknown`(语义不变)。
|
|
3242
3243
|
*/
|
|
3243
3244
|
function toArray(arg) {
|
|
3244
3245
|
if (Array.isArray(arg)) return arg;
|
|
@@ -3855,7 +3856,7 @@ const _hoisted_7$4 = {
|
|
|
3855
3856
|
key: 0,
|
|
3856
3857
|
class: "px-3 py-1.5 text-sm text-muted-foreground"
|
|
3857
3858
|
};
|
|
3858
|
-
const _sfc_main$
|
|
3859
|
+
const _sfc_main$56 = /*@__PURE__*/ defineComponent({
|
|
3859
3860
|
__name: "CascaderPanel",
|
|
3860
3861
|
props: {
|
|
3861
3862
|
/** 列数据:columns[0] 为根层,后续每列为展开路径的子层 */
|
|
@@ -4293,7 +4294,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4293
4294
|
class: unref(cn)(unref(controlCls), "min-h-9 cursor-pointer gap-2 px-3 py-1.5 text-sm", props.disabled && "cursor-not-allowed opacity-50", props.class),
|
|
4294
4295
|
onClick: openFromInput,
|
|
4295
4296
|
onKeydown: handleKeydown
|
|
4296
|
-
}), [isMulti.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [tags.value.length ? (openBlock(), createBlock(_sfc_main$
|
|
4297
|
+
}), [isMulti.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [tags.value.length ? (openBlock(), createBlock(_sfc_main$57, {
|
|
4297
4298
|
key: 0,
|
|
4298
4299
|
values: tags.value,
|
|
4299
4300
|
"max-tag-count": props.maxTagCount,
|
|
@@ -4318,7 +4319,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4318
4319
|
style: normalizeStyle({ minWidth: panelMinWidth.value }),
|
|
4319
4320
|
onKeydown: handleKeydown
|
|
4320
4321
|
}, {
|
|
4321
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
4322
|
+
default: withCtx(() => [createVNode(_sfc_main$56, {
|
|
4322
4323
|
columns: columns.value,
|
|
4323
4324
|
"expand-trigger": props.expandTrigger,
|
|
4324
4325
|
"selected-keys": isMulti.value ? selectedKeys.value : [],
|
|
@@ -4393,7 +4394,7 @@ const _hoisted_8$1 = {
|
|
|
4393
4394
|
key: 0,
|
|
4394
4395
|
class: "px-2 py-6 text-center text-sm text-muted-foreground"
|
|
4395
4396
|
};
|
|
4396
|
-
const _sfc_main$
|
|
4397
|
+
const _sfc_main$55 = /*@__PURE__*/ defineComponent({
|
|
4397
4398
|
__name: "TreePanel",
|
|
4398
4399
|
props: {
|
|
4399
4400
|
/** 展开态扁平化的可见节点序列(来自 treeMate.getFlattenedNodes(expandedKeys)) */
|
|
@@ -4519,7 +4520,7 @@ const _hoisted_6$2 = {
|
|
|
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$49 = /*@__PURE__*/ defineComponent({
|
|
4523
4524
|
inheritAttrs: false,
|
|
4524
4525
|
__name: "TreeSelect",
|
|
4525
4526
|
props: {
|
|
@@ -4844,7 +4845,7 @@ const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
|
4844
4845
|
onClick: openFromInput,
|
|
4845
4846
|
onKeydown: handleKeydown
|
|
4846
4847
|
}), [isMulti.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4847
|
-
tags.value.length ? (openBlock(), createBlock(_sfc_main$
|
|
4848
|
+
tags.value.length ? (openBlock(), createBlock(_sfc_main$57, {
|
|
4848
4849
|
key: 0,
|
|
4849
4850
|
values: tags.value,
|
|
4850
4851
|
"max-tag-count": props.maxTagCount,
|
|
@@ -4890,7 +4891,7 @@ const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
|
4890
4891
|
style: normalizeStyle({ minWidth: panelMinWidth.value }),
|
|
4891
4892
|
onKeydown: handleKeydown
|
|
4892
4893
|
}, {
|
|
4893
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
4894
|
+
default: withCtx(() => [createVNode(_sfc_main$55, {
|
|
4894
4895
|
nodes: filteredNodes.value,
|
|
4895
4896
|
"selected-keys": selectedKeys.value,
|
|
4896
4897
|
"expanded-keys": expandedKeys.value,
|
|
@@ -4923,7 +4924,7 @@ const _sfc_main$48 = /*@__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$49, {
|
|
4927
4928
|
placeholder: placeholder ?? ctx.item.placeholder,
|
|
4928
4929
|
...rest,
|
|
4929
4930
|
...bindField(ctx.field, MODEL_VALUE),
|
|
@@ -5060,7 +5061,7 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5060
5061
|
return openBlock(), createElementBlock("div", {
|
|
5061
5062
|
key: String(item.key),
|
|
5062
5063
|
style: normalizeStyle(spanStyle(item.span))
|
|
5063
|
-
}, [createVNode(_sfc_main$
|
|
5064
|
+
}, [createVNode(_sfc_main$65, {
|
|
5064
5065
|
item,
|
|
5065
5066
|
widget: widgetOf(item),
|
|
5066
5067
|
values: unref(valuesRef)
|
|
@@ -5588,7 +5589,7 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
5588
5589
|
const itemCls = "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0";
|
|
5589
5590
|
const labelCls = "px-2 py-1.5 text-sm font-medium";
|
|
5590
5591
|
const separatorCls = "-mx-1 my-1 h-px bg-muted";
|
|
5591
|
-
const _sfc_main$
|
|
5592
|
+
const _sfc_main$54 = /*@__PURE__*/ defineComponent({
|
|
5592
5593
|
__name: "MenuItems",
|
|
5593
5594
|
props: { items: {} },
|
|
5594
5595
|
setup(__props) {
|
|
@@ -5703,7 +5704,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
5703
5704
|
}, 8, ["class"]),
|
|
5704
5705
|
createVNode(unref(Menu).Positioner, { class: "z-[var(--z-overlay)]" }, {
|
|
5705
5706
|
default: withCtx(() => [createVNode(unref(Menu).Content, mergeProps(unref(attrs), { class: unref(cn)(contentCls$1, props.contentClass) }), {
|
|
5706
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
5707
|
+
default: withCtx(() => [createVNode(_sfc_main$54, { items: props.items }, createSlots({ _: 2 }, [_ctx.$slots.item ? {
|
|
5707
5708
|
name: "item",
|
|
5708
5709
|
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps(slotProps)))]),
|
|
5709
5710
|
key: "0"
|
|
@@ -6044,7 +6045,7 @@ function columnRenders() {
|
|
|
6044
6045
|
}
|
|
6045
6046
|
//#endregion
|
|
6046
6047
|
//#region src/components/tooltip/Tooltip.vue
|
|
6047
|
-
const _sfc_main$
|
|
6048
|
+
const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
6048
6049
|
__name: "Tooltip",
|
|
6049
6050
|
props: {
|
|
6050
6051
|
/** 提示文字;#content 插槽可覆盖以渲染富内容 */
|
|
@@ -6177,7 +6178,7 @@ const _hoisted_4$3 = {
|
|
|
6177
6178
|
key: 2,
|
|
6178
6179
|
class: "min-w-0 truncate"
|
|
6179
6180
|
};
|
|
6180
|
-
const _sfc_main$
|
|
6181
|
+
const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
6181
6182
|
__name: "TableBodyRow",
|
|
6182
6183
|
props: {
|
|
6183
6184
|
/** 表体行数据(cells 值矩阵已由父层按可见列计算) */
|
|
@@ -6227,7 +6228,7 @@ const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
|
6227
6228
|
* VNode(render 工厂)单元格经 cloneVNode 复制进触发位(VNode 不可二次挂载)。 */
|
|
6228
6229
|
function tooltipCell(value, text) {
|
|
6229
6230
|
const trigger = isVNode(value) ? cloneVNode(value) : h("span", { class: "block truncate" }, text);
|
|
6230
|
-
return h(_sfc_main$
|
|
6231
|
+
return h(_sfc_main$48, {
|
|
6231
6232
|
delayDuration: 0,
|
|
6232
6233
|
content: text
|
|
6233
6234
|
}, { default: () => [trigger] });
|
|
@@ -6307,7 +6308,7 @@ const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
|
6307
6308
|
const _hoisted_1$9 = { class: "flex items-center gap-2 text-muted-foreground" };
|
|
6308
6309
|
const _hoisted_2$8 = ["value"];
|
|
6309
6310
|
const _hoisted_3$5 = ["value"];
|
|
6310
|
-
const _sfc_main$
|
|
6311
|
+
const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
6311
6312
|
__name: "TablePagination",
|
|
6312
6313
|
props: {
|
|
6313
6314
|
pageIndex: {},
|
|
@@ -7318,7 +7319,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7318
7319
|
_: 1
|
|
7319
7320
|
}),
|
|
7320
7321
|
createCommentVNode(" 纯受控气泡(无默认插槽,不渲染触发器):开合由触发钮 pointerenter/leave 驱动 "),
|
|
7321
|
-
createVNode(unref(_sfc_main$
|
|
7322
|
+
createVNode(unref(_sfc_main$48), {
|
|
7322
7323
|
open: settingsTipOpen.value,
|
|
7323
7324
|
content: "列设置"
|
|
7324
7325
|
}, null, 8, ["open"])
|
|
@@ -7408,7 +7409,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7408
7409
|
class: "border-0 p-0"
|
|
7409
7410
|
}, null, 8, _hoisted_16)], 4),
|
|
7410
7411
|
(openBlock(true), createElementBlock(Fragment, null, renderList(virtualLines.value, (item) => {
|
|
7411
|
-
return openBlock(), createBlock(_sfc_main$
|
|
7412
|
+
return openBlock(), createBlock(_sfc_main$53, {
|
|
7412
7413
|
key: item.line.key,
|
|
7413
7414
|
ref_for: true,
|
|
7414
7415
|
ref: measureRow,
|
|
@@ -7448,7 +7449,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7448
7449
|
class: "border-0 p-0"
|
|
7449
7450
|
}, null, 8, _hoisted_17)], 4)
|
|
7450
7451
|
], 64)) : (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(body.value, (line) => {
|
|
7451
|
-
return openBlock(), createBlock(_sfc_main$
|
|
7452
|
+
return openBlock(), createBlock(_sfc_main$53, {
|
|
7452
7453
|
key: line.key,
|
|
7453
7454
|
line,
|
|
7454
7455
|
columns: visibleColumns.value,
|
|
@@ -7481,7 +7482,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7481
7482
|
class: "p-8 text-center text-muted-foreground"
|
|
7482
7483
|
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(__props.emptyText ?? "暂无数据"), 1)])], 8, _hoisted_19)])) : createCommentVNode("v-if", true)
|
|
7483
7484
|
])])], 4),
|
|
7484
|
-
showPagination.value ? (openBlock(), createBlock(_sfc_main$
|
|
7485
|
+
showPagination.value ? (openBlock(), createBlock(_sfc_main$52, {
|
|
7485
7486
|
key: 1,
|
|
7486
7487
|
"page-index": unref(instance).page.pageIndex,
|
|
7487
7488
|
"page-size": unref(instance).page.pageSize,
|
|
@@ -7522,7 +7523,11 @@ function defineTable(config) {
|
|
|
7522
7523
|
}
|
|
7523
7524
|
//#endregion
|
|
7524
7525
|
//#region src/components/tabs/Tabs.vue
|
|
7525
|
-
const _hoisted_1$7 = [
|
|
7526
|
+
const _hoisted_1$7 = [
|
|
7527
|
+
"aria-label",
|
|
7528
|
+
"onClick",
|
|
7529
|
+
"onKeydown"
|
|
7530
|
+
];
|
|
7526
7531
|
const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
7527
7532
|
__name: "Tabs",
|
|
7528
7533
|
props: {
|
|
@@ -7531,18 +7536,81 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
7531
7536
|
defaultValue: {},
|
|
7532
7537
|
activationMode: {},
|
|
7533
7538
|
lazyMount: { type: Boolean },
|
|
7534
|
-
unmountOnExit: { type: Boolean }
|
|
7539
|
+
unmountOnExit: { type: Boolean },
|
|
7540
|
+
orientation: {},
|
|
7541
|
+
loopFocus: { type: Boolean },
|
|
7542
|
+
deselectable: { type: Boolean },
|
|
7543
|
+
beforeLeave: { type: Function },
|
|
7544
|
+
type: {},
|
|
7545
|
+
placement: {},
|
|
7546
|
+
animated: { type: Boolean }
|
|
7535
7547
|
},
|
|
7536
|
-
emits: ["update:value"],
|
|
7548
|
+
emits: ["update:value", "close"],
|
|
7537
7549
|
setup(__props, { emit: __emit }) {
|
|
7538
7550
|
const props = __props;
|
|
7551
|
+
const slots = useSlots();
|
|
7552
|
+
/** 有效方向:placement 优先(right→vertical、bottom→horizontal),未传回落 orientation */
|
|
7553
|
+
const effOrientation = computed(() => {
|
|
7554
|
+
if (props.placement === "right") return "vertical";
|
|
7555
|
+
if (props.placement === "bottom") return "horizontal";
|
|
7556
|
+
return props.orientation ?? "horizontal";
|
|
7557
|
+
});
|
|
7558
|
+
const isVertical = computed(() => effOrientation.value === "vertical");
|
|
7559
|
+
const isLine = computed(() => props.type === "line");
|
|
7560
|
+
const hasBarExtras = computed(() => !!(slots.prefix || slots.suffix));
|
|
7561
|
+
const placementClass = computed(() => {
|
|
7562
|
+
if (props.placement === "bottom") return "flex flex-col-reverse";
|
|
7563
|
+
if (props.placement === "right") return "flex flex-row-reverse";
|
|
7564
|
+
});
|
|
7565
|
+
const isBottom = computed(() => props.placement === "bottom");
|
|
7566
|
+
const listClass = computed(() => cn("text-muted-foreground inline-flex w-fit items-center justify-center rounded-lg", isLine.value ? "relative bg-transparent" : "bg-muted p-[3px]", isVertical.value ? ["h-fit flex-col items-stretch", isLine.value && "border-r border-border"] : ["h-9", isLine.value && "border-b border-border"]));
|
|
7567
|
+
const triggerClass = (item) => cn("inline-flex h-[calc(100%-1px)] items-center gap-1.5 px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-ring/50 focus-visible:outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50", isLine.value ? "text-muted-foreground data-[selected]:text-foreground" : "border border-transparent data-[selected]:bg-background data-[selected]:text-foreground data-[selected]:shadow-sm", isVertical.value ? "w-full justify-start" : "flex-1 justify-center", item.class);
|
|
7568
|
+
const indicatorClass = computed(() => cn("bg-primary pointer-events-none absolute", isVertical.value ? "h-[var(--height)] w-[2px]" : "h-[2px] w-[var(--width)]", isVertical.value ? isBottom.value ? "left-0" : "right-0" : isBottom.value ? "top-0" : "-bottom-px"));
|
|
7569
|
+
const animatedClass = computed(() => props.animated ? "data-[selected]:animate-[tu-tabs-fade-in_0.25s_ease]" : void 0);
|
|
7539
7570
|
const emit = __emit;
|
|
7540
7571
|
const internalValue = ref(props.defaultValue);
|
|
7541
7572
|
const currentValue = computed(() => props.value ?? internalValue.value);
|
|
7542
|
-
|
|
7573
|
+
const guardPending = ref(false);
|
|
7574
|
+
function commitValue(next) {
|
|
7543
7575
|
internalValue.value = next;
|
|
7544
7576
|
emit("update:value", next);
|
|
7545
7577
|
}
|
|
7578
|
+
async function handleValueUpdate(next) {
|
|
7579
|
+
const guard = props.beforeLeave;
|
|
7580
|
+
if (!guard) return commitValue(next);
|
|
7581
|
+
if (guardPending.value) return;
|
|
7582
|
+
const prev = currentValue.value ?? null;
|
|
7583
|
+
let result;
|
|
7584
|
+
try {
|
|
7585
|
+
result = guard(next, prev);
|
|
7586
|
+
} catch {
|
|
7587
|
+
return;
|
|
7588
|
+
}
|
|
7589
|
+
if (result instanceof Promise) {
|
|
7590
|
+
guardPending.value = true;
|
|
7591
|
+
try {
|
|
7592
|
+
if (await result) commitValue(next);
|
|
7593
|
+
} catch {} finally {
|
|
7594
|
+
guardPending.value = false;
|
|
7595
|
+
}
|
|
7596
|
+
return;
|
|
7597
|
+
}
|
|
7598
|
+
if (result) commitValue(next);
|
|
7599
|
+
}
|
|
7600
|
+
const valueSet = computed(() => new Set(props.items.map((i) => i.value)));
|
|
7601
|
+
let prevValues = props.items.map((i) => i.value);
|
|
7602
|
+
watch(valueSet, (set) => {
|
|
7603
|
+
const values = props.items.map((i) => i.value);
|
|
7604
|
+
const v = currentValue.value;
|
|
7605
|
+
if (props.value !== void 0 || v == null || set.has(v)) {
|
|
7606
|
+
prevValues = values;
|
|
7607
|
+
return;
|
|
7608
|
+
}
|
|
7609
|
+
const oldIdx = prevValues.indexOf(v);
|
|
7610
|
+
const fallback = prevValues.slice(0, oldIdx).reverse().find((x) => set.has(x)) ?? values[0] ?? null;
|
|
7611
|
+
internalValue.value = fallback;
|
|
7612
|
+
prevValues = values;
|
|
7613
|
+
}, { immediate: true });
|
|
7546
7614
|
const activatedValues = ref(/* @__PURE__ */ new Set());
|
|
7547
7615
|
watch(currentValue, (v) => {
|
|
7548
7616
|
if (v == null || activatedValues.value.has(v)) return;
|
|
@@ -7557,45 +7625,78 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
7557
7625
|
}
|
|
7558
7626
|
return (_ctx, _cache) => {
|
|
7559
7627
|
return openBlock(), createBlock(unref(Tabs).Root, {
|
|
7560
|
-
"model-value": currentValue.value,
|
|
7628
|
+
"model-value": currentValue.value ?? void 0,
|
|
7561
7629
|
"activation-mode": props.activationMode,
|
|
7630
|
+
orientation: effOrientation.value,
|
|
7631
|
+
"loop-focus": props.loopFocus,
|
|
7632
|
+
deselectable: props.deselectable,
|
|
7633
|
+
class: normalizeClass(placementClass.value),
|
|
7562
7634
|
"onUpdate:modelValue": handleValueUpdate
|
|
7563
7635
|
}, {
|
|
7564
7636
|
default: withCtx(() => [
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7637
|
+
createCommentVNode(" 标签栏容器:有 prefix/suffix 时为 flex 布局;否则 display:contents 布局零回归 "),
|
|
7638
|
+
createElementVNode("div", { class: normalizeClass(hasBarExtras.value ? "flex items-center" : "contents") }, [
|
|
7639
|
+
renderSlot(_ctx.$slots, "prefix"),
|
|
7640
|
+
createVNode(unref(Tabs).List, { class: normalizeClass(listClass.value) }, {
|
|
7641
|
+
default: withCtx(() => [
|
|
7642
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.items, (item) => {
|
|
7643
|
+
return openBlock(), createBlock(unref(Tabs).Trigger, {
|
|
7644
|
+
key: item.value,
|
|
7645
|
+
value: item.value,
|
|
7646
|
+
disabled: item.disabled,
|
|
7647
|
+
class: normalizeClass(triggerClass(item))
|
|
7648
|
+
}, {
|
|
7649
|
+
default: withCtx(() => [
|
|
7650
|
+
renderSlot(_ctx.$slots, "trigger", { item }, () => [createTextVNode(toDisplayString(item.label), 1)]),
|
|
7651
|
+
createCommentVNode(" 关闭按钮:button 嵌套非法,用 span + role;mousedown.prevent 阻断焦点转移到 trigger(automatic 模式会经 onFocus 选中) "),
|
|
7652
|
+
item.closable ? (openBlock(), createElementBlock("span", {
|
|
7653
|
+
key: 0,
|
|
7654
|
+
role: "button",
|
|
7655
|
+
tabindex: "-1",
|
|
7656
|
+
"aria-label": `关闭 ${item.label}`,
|
|
7657
|
+
class: "text-muted-foreground -mr-0.5 flex size-3.5 items-center justify-center rounded-sm text-xs opacity-60 transition-opacity hover:opacity-100",
|
|
7658
|
+
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
|
|
7659
|
+
onClick: withModifiers(($event) => emit("close", item.value), ["stop"]),
|
|
7660
|
+
onKeydown: [withKeys(withModifiers(($event) => emit("close", item.value), ["stop", "prevent"]), ["enter"]), withKeys(withModifiers(($event) => emit("close", item.value), ["stop", "prevent"]), ["space"])]
|
|
7661
|
+
}, "×", 40, _hoisted_1$7)) : createCommentVNode("v-if", true)
|
|
7662
|
+
]),
|
|
7663
|
+
_: 2
|
|
7664
|
+
}, 1032, [
|
|
7665
|
+
"value",
|
|
7666
|
+
"disabled",
|
|
7667
|
+
"class"
|
|
7668
|
+
]);
|
|
7669
|
+
}), 128)),
|
|
7670
|
+
createCommentVNode(" 下划线指示条:zag 自动计算选中项位置与过渡动画;jsdom 无布局时恒 hidden "),
|
|
7671
|
+
isLine.value ? (openBlock(), createBlock(unref(Tabs).Indicator, {
|
|
7672
|
+
key: 0,
|
|
7673
|
+
class: normalizeClass(indicatorClass.value)
|
|
7674
|
+
}, null, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
7675
|
+
]),
|
|
7676
|
+
_: 3
|
|
7677
|
+
}, 8, ["class"]),
|
|
7678
|
+
renderSlot(_ctx.$slots, "suffix")
|
|
7679
|
+
], 2),
|
|
7583
7680
|
createCommentVNode(" 面板:hidden/挂载由本组件按 item 配置逐面板控制,不走 Root 的全局渲染策略 "),
|
|
7584
7681
|
createVNode(unref(Tabs).Context, null, {
|
|
7585
7682
|
default: withCtx((api) => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.items, (item) => {
|
|
7586
7683
|
return openBlock(), createElementBlock(Fragment, { key: item.value }, [!isPanelUnmounted(item) ? (openBlock(), createElementBlock("div", mergeProps({
|
|
7587
7684
|
key: 0,
|
|
7588
7685
|
ref_for: true
|
|
7589
|
-
}, api.getContentProps({ value: item.value }), {
|
|
7590
|
-
"data-state": currentValue.value === item.value ? "open" : "closed",
|
|
7591
|
-
class: "flex-1 outline-none"
|
|
7592
|
-
}), [renderSlot(_ctx.$slots, "panel", { item })], 16, _hoisted_1$7)) : createCommentVNode("v-if", true)], 64);
|
|
7686
|
+
}, api.getContentProps({ value: item.value }), { class: unref(cn)("flex-1 outline-none", animatedClass.value) }), [renderSlot(_ctx.$slots, "panel", { item })], 16)) : createCommentVNode("v-if", true)], 64);
|
|
7593
7687
|
}), 128))]),
|
|
7594
7688
|
_: 3
|
|
7595
7689
|
})
|
|
7596
7690
|
]),
|
|
7597
7691
|
_: 3
|
|
7598
|
-
}, 8, [
|
|
7692
|
+
}, 8, [
|
|
7693
|
+
"model-value",
|
|
7694
|
+
"activation-mode",
|
|
7695
|
+
"orientation",
|
|
7696
|
+
"loop-focus",
|
|
7697
|
+
"deselectable",
|
|
7698
|
+
"class"
|
|
7699
|
+
]);
|
|
7599
7700
|
};
|
|
7600
7701
|
}
|
|
7601
7702
|
});
|
|
@@ -8028,7 +8129,7 @@ const _hoisted_7 = { class: "flex shrink-0 items-center gap-1" };
|
|
|
8028
8129
|
* 内部按 props 重建 useToast 单例 store,随后所有 toast 方法经单例转发到这里渲染。
|
|
8029
8130
|
*/
|
|
8030
8131
|
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";
|
|
8031
|
-
const _sfc_main$
|
|
8132
|
+
const _sfc_main$47 = /*@__PURE__*/ defineComponent({
|
|
8032
8133
|
__name: "ToastProvider",
|
|
8033
8134
|
props: {
|
|
8034
8135
|
/** 弹出位置 */
|
|
@@ -8332,7 +8433,7 @@ items: {
|
|
|
8332
8433
|
}),
|
|
8333
8434
|
createVNode(unref(Menu).Positioner, { class: "z-[var(--z-overlay)]" }, {
|
|
8334
8435
|
default: withCtx(() => [createVNode(unref(Menu).Content, mergeProps(unref(attrs), { class: unref(cn)(contentCls) }), {
|
|
8335
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
8436
|
+
default: withCtx(() => [createVNode(_sfc_main$54, { items: props.items }, null, 8, ["items"])]),
|
|
8336
8437
|
_: 1
|
|
8337
8438
|
}, 16, ["class"])]),
|
|
8338
8439
|
_: 1
|
|
@@ -8659,4 +8760,226 @@ const _sfc_main$33 = /*@__PURE__*/ defineComponent({
|
|
|
8659
8760
|
}
|
|
8660
8761
|
});
|
|
8661
8762
|
//#endregion
|
|
8662
|
-
|
|
8763
|
+
//#region src/components/timeline/Timeline.vue
|
|
8764
|
+
const _sfc_main$46 = /*@__PURE__*/ defineComponent({
|
|
8765
|
+
__name: "Timeline",
|
|
8766
|
+
props: {
|
|
8767
|
+
items: {},
|
|
8768
|
+
mode: { default: "right" },
|
|
8769
|
+
size: { default: "default" },
|
|
8770
|
+
class: {}
|
|
8771
|
+
},
|
|
8772
|
+
setup(__props) {
|
|
8773
|
+
const props = __props;
|
|
8774
|
+
const rootClass = computed(() => cn(timelineVariants({ mode: props.mode }), props.class));
|
|
8775
|
+
const itemClass = computed(() => timelineItemVariants({
|
|
8776
|
+
mode: props.mode,
|
|
8777
|
+
size: props.size
|
|
8778
|
+
}));
|
|
8779
|
+
const titleClass = computed(() => props.size === "sm" ? "text-xs leading-4 font-medium text-foreground" : "text-sm font-medium leading-5 text-foreground");
|
|
8780
|
+
const descriptionClass = computed(() => props.size === "sm" ? "mt-1 text-xs leading-relaxed text-muted-foreground" : "mt-1 text-sm leading-relaxed text-muted-foreground");
|
|
8781
|
+
/** 连线类:首末项按 index 裁切(不用 first:/last: 伪类——line 恒为 li 首个子元素,伪类会全量误命中) */
|
|
8782
|
+
function lineClass(index) {
|
|
8783
|
+
const isFirst = index === 0;
|
|
8784
|
+
const isLast = index === props.items.length - 1;
|
|
8785
|
+
return cn("absolute w-0.5 -translate-x-1/2 bg-border", props.mode === "alternate" ? "left-1/2" : props.size === "sm" ? "left-[5px]" : "left-[6px]", isFirst ? "top-[10px]" : "top-0", isLast ? "bottom-[calc(100%-10px)]" : "bottom-0");
|
|
8786
|
+
}
|
|
8787
|
+
/** 节点类:颜色/空心取自单项数据,位置与尺寸取自组件变体 */
|
|
8788
|
+
function dotClass(item) {
|
|
8789
|
+
return cn(timelineDotVariants({
|
|
8790
|
+
mode: props.mode,
|
|
8791
|
+
size: props.size,
|
|
8792
|
+
color: item.dotColor,
|
|
8793
|
+
hollow: item.hollow
|
|
8794
|
+
}));
|
|
8795
|
+
}
|
|
8796
|
+
/** 内容区类:right 占第 2 列;alternate 按奇偶交替占第 1/3 列并切换对齐 */
|
|
8797
|
+
function contentClass(index) {
|
|
8798
|
+
const base = "min-w-0 flex flex-col";
|
|
8799
|
+
if (props.mode === "alternate") return cn(base, index % 2 === 0 ? "col-start-1 row-start-1 pr-4 text-right" : "col-start-3 row-start-1 pl-4 text-left");
|
|
8800
|
+
return cn(base, props.size === "sm" ? "pl-2.5" : "pl-3");
|
|
8801
|
+
}
|
|
8802
|
+
/** 时间戳类:bottom 时 DOM 仍在前部,仅切 order-last 移到内容下方(不分支 DOM) */
|
|
8803
|
+
function timestampClass(item) {
|
|
8804
|
+
return item.timestampPlacement === "bottom" ? "mb-1 mt-1.5 order-last text-xs leading-4 text-muted-foreground tabular-nums" : "mb-1 text-xs leading-4 text-muted-foreground tabular-nums";
|
|
8805
|
+
}
|
|
8806
|
+
return (_ctx, _cache) => {
|
|
8807
|
+
return openBlock(), createElementBlock("ol", {
|
|
8808
|
+
"data-slot": "timeline",
|
|
8809
|
+
class: normalizeClass(rootClass.value)
|
|
8810
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
|
|
8811
|
+
return openBlock(), createElementBlock("li", {
|
|
8812
|
+
key: index,
|
|
8813
|
+
"data-slot": "timeline-item",
|
|
8814
|
+
class: normalizeClass(itemClass.value)
|
|
8815
|
+
}, [
|
|
8816
|
+
createElementVNode("span", {
|
|
8817
|
+
"data-slot": "timeline-line",
|
|
8818
|
+
"aria-hidden": "true",
|
|
8819
|
+
class: normalizeClass(lineClass(index))
|
|
8820
|
+
}, null, 2),
|
|
8821
|
+
createElementVNode("span", {
|
|
8822
|
+
"data-slot": "timeline-dot",
|
|
8823
|
+
class: normalizeClass(dotClass(item))
|
|
8824
|
+
}, null, 2),
|
|
8825
|
+
createElementVNode("div", {
|
|
8826
|
+
"data-slot": "timeline-content",
|
|
8827
|
+
class: normalizeClass(contentClass(index))
|
|
8828
|
+
}, [createCommentVNode(" #item 整项内容覆盖(dot 与 line 不受影响),默认渲染 timestamp/title/content "), renderSlot(_ctx.$slots, "item", {
|
|
8829
|
+
item,
|
|
8830
|
+
index
|
|
8831
|
+
}, () => [
|
|
8832
|
+
item.timestamp ? (openBlock(), createElementBlock("span", {
|
|
8833
|
+
key: 0,
|
|
8834
|
+
"data-slot": "timeline-timestamp",
|
|
8835
|
+
class: normalizeClass(timestampClass(item))
|
|
8836
|
+
}, toDisplayString(item.timestamp), 3)) : createCommentVNode("v-if", true),
|
|
8837
|
+
item.title ? (openBlock(), createElementBlock("p", {
|
|
8838
|
+
key: 1,
|
|
8839
|
+
"data-slot": "timeline-title",
|
|
8840
|
+
class: normalizeClass(titleClass.value)
|
|
8841
|
+
}, toDisplayString(item.title), 3)) : createCommentVNode("v-if", true),
|
|
8842
|
+
item.content ? (openBlock(), createElementBlock("p", {
|
|
8843
|
+
key: 2,
|
|
8844
|
+
"data-slot": "timeline-description",
|
|
8845
|
+
class: normalizeClass(descriptionClass.value)
|
|
8846
|
+
}, toDisplayString(item.content), 3)) : createCommentVNode("v-if", true)
|
|
8847
|
+
])], 2)
|
|
8848
|
+
], 2);
|
|
8849
|
+
}), 128))], 2);
|
|
8850
|
+
};
|
|
8851
|
+
}
|
|
8852
|
+
});
|
|
8853
|
+
//#endregion
|
|
8854
|
+
//#region src/components/timeline/index.ts
|
|
8855
|
+
/** 容器变体:alternate 模式加 isolate 隔离堆叠上下文,避免连线/节点受外部 z-index 干扰 */
|
|
8856
|
+
const timelineVariants = cva("relative m-0 list-none p-0", {
|
|
8857
|
+
variants: { mode: {
|
|
8858
|
+
right: "",
|
|
8859
|
+
alternate: "isolate"
|
|
8860
|
+
} },
|
|
8861
|
+
defaultVariants: { mode: "right" }
|
|
8862
|
+
});
|
|
8863
|
+
/** 项变体:li 的 last:pb-0 相对 ol 语义正确;首末项连线裁切在模板内按 index 计算,不用伪类 */
|
|
8864
|
+
const timelineItemVariants = cva("relative grid items-start last:pb-0", {
|
|
8865
|
+
variants: {
|
|
8866
|
+
mode: {
|
|
8867
|
+
right: "",
|
|
8868
|
+
alternate: ""
|
|
8869
|
+
},
|
|
8870
|
+
size: {
|
|
8871
|
+
default: "pb-8",
|
|
8872
|
+
sm: "pb-6"
|
|
8873
|
+
}
|
|
8874
|
+
},
|
|
8875
|
+
compoundVariants: [
|
|
8876
|
+
{
|
|
8877
|
+
mode: "right",
|
|
8878
|
+
size: "default",
|
|
8879
|
+
class: "grid-cols-[12px_minmax(0,1fr)]"
|
|
8880
|
+
},
|
|
8881
|
+
{
|
|
8882
|
+
mode: "right",
|
|
8883
|
+
size: "sm",
|
|
8884
|
+
class: "grid-cols-[10px_minmax(0,1fr)]"
|
|
8885
|
+
},
|
|
8886
|
+
{
|
|
8887
|
+
mode: "alternate",
|
|
8888
|
+
size: "default",
|
|
8889
|
+
class: "grid-cols-[minmax(0,1fr)_12px_minmax(0,1fr)]"
|
|
8890
|
+
},
|
|
8891
|
+
{
|
|
8892
|
+
mode: "alternate",
|
|
8893
|
+
size: "sm",
|
|
8894
|
+
class: "grid-cols-[minmax(0,1fr)_10px_minmax(0,1fr)]"
|
|
8895
|
+
}
|
|
8896
|
+
],
|
|
8897
|
+
defaultVariants: {
|
|
8898
|
+
mode: "right",
|
|
8899
|
+
size: "default"
|
|
8900
|
+
}
|
|
8901
|
+
});
|
|
8902
|
+
/** 节点变体:hollow × color 经 compoundVariants 配对出边框色,实心直接配底色 */
|
|
8903
|
+
const timelineDotVariants = cva("relative z-10 mt-1 block shrink-0 rounded-full", {
|
|
8904
|
+
variants: {
|
|
8905
|
+
mode: {
|
|
8906
|
+
right: "col-start-1",
|
|
8907
|
+
alternate: "col-start-2 row-start-1"
|
|
8908
|
+
},
|
|
8909
|
+
size: {
|
|
8910
|
+
default: "size-3",
|
|
8911
|
+
sm: "size-2.5 mt-[5px]"
|
|
8912
|
+
},
|
|
8913
|
+
color: {
|
|
8914
|
+
primary: "",
|
|
8915
|
+
success: "",
|
|
8916
|
+
warning: "",
|
|
8917
|
+
destructive: "",
|
|
8918
|
+
muted: ""
|
|
8919
|
+
},
|
|
8920
|
+
hollow: {
|
|
8921
|
+
true: "border-2 bg-background",
|
|
8922
|
+
false: ""
|
|
8923
|
+
}
|
|
8924
|
+
},
|
|
8925
|
+
compoundVariants: [
|
|
8926
|
+
{
|
|
8927
|
+
hollow: false,
|
|
8928
|
+
color: "primary",
|
|
8929
|
+
class: "bg-primary"
|
|
8930
|
+
},
|
|
8931
|
+
{
|
|
8932
|
+
hollow: false,
|
|
8933
|
+
color: "success",
|
|
8934
|
+
class: "bg-success"
|
|
8935
|
+
},
|
|
8936
|
+
{
|
|
8937
|
+
hollow: false,
|
|
8938
|
+
color: "warning",
|
|
8939
|
+
class: "bg-warning"
|
|
8940
|
+
},
|
|
8941
|
+
{
|
|
8942
|
+
hollow: false,
|
|
8943
|
+
color: "destructive",
|
|
8944
|
+
class: "bg-destructive"
|
|
8945
|
+
},
|
|
8946
|
+
{
|
|
8947
|
+
hollow: false,
|
|
8948
|
+
color: "muted",
|
|
8949
|
+
class: "bg-muted-foreground"
|
|
8950
|
+
},
|
|
8951
|
+
{
|
|
8952
|
+
hollow: true,
|
|
8953
|
+
color: "primary",
|
|
8954
|
+
class: "border-primary"
|
|
8955
|
+
},
|
|
8956
|
+
{
|
|
8957
|
+
hollow: true,
|
|
8958
|
+
color: "success",
|
|
8959
|
+
class: "border-success"
|
|
8960
|
+
},
|
|
8961
|
+
{
|
|
8962
|
+
hollow: true,
|
|
8963
|
+
color: "warning",
|
|
8964
|
+
class: "border-warning"
|
|
8965
|
+
},
|
|
8966
|
+
{
|
|
8967
|
+
hollow: true,
|
|
8968
|
+
color: "destructive",
|
|
8969
|
+
class: "border-destructive"
|
|
8970
|
+
},
|
|
8971
|
+
{
|
|
8972
|
+
hollow: true,
|
|
8973
|
+
color: "muted",
|
|
8974
|
+
class: "border-muted-foreground"
|
|
8975
|
+
}
|
|
8976
|
+
],
|
|
8977
|
+
defaultVariants: {
|
|
8978
|
+
mode: "right",
|
|
8979
|
+
size: "default",
|
|
8980
|
+
color: "primary",
|
|
8981
|
+
hollow: false
|
|
8982
|
+
}
|
|
8983
|
+
});
|
|
8984
|
+
//#endregion
|
|
8985
|
+
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 TableRender, _sfc_main$44 as Tabs, _sfc_main$45 as Textarea, _sfc_main$46 as Timeline, _sfc_main$47 as ToastProvider, _sfc_main$48 as Tooltip, _sfc_main$49 as TreeSelect, TuDesignResolver, VALUE, _sfc_main$50 as WeekPicker, _sfc_main$51 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 };
|