@tu-design/vue 0.5.10 → 0.5.12
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 +1164 -1151
- package/dist/index.mjs +444 -321
- package/dist/registry/vue/alert-dialog.json +3 -3
- package/dist/registry/vue/alert.json +1 -1
- package/dist/registry/vue/avatar-group.json +1 -1
- package/dist/registry/vue/avatar.json +2 -2
- package/dist/registry/vue/badge.json +1 -1
- package/dist/registry/vue/button.json +1 -1
- package/dist/registry/vue/calendar.json +2 -2
- package/dist/registry/vue/card.json +1 -1
- package/dist/registry/vue/cascader.json +4 -4
- package/dist/registry/vue/checkbox.json +2 -2
- package/dist/registry/vue/context-menu.json +3 -3
- package/dist/registry/vue/currency-input.json +2 -2
- package/dist/registry/vue/date-picker.json +2 -2
- package/dist/registry/vue/date-range-picker.json +3 -3
- package/dist/registry/vue/date-shared.json +3 -3
- package/dist/registry/vue/dialog.json +3 -3
- package/dist/registry/vue/drawer.json +3 -3
- package/dist/registry/vue/dropdown-menu.json +3 -3
- package/dist/registry/vue/empty.json +1 -1
- package/dist/registry/vue/form-render.json +1 -1
- package/dist/registry/vue/form.json +2 -2
- package/dist/registry/vue/icon-shared.json +1 -1
- package/dist/registry/vue/input.json +1 -1
- package/dist/registry/vue/label.json +1 -1
- package/dist/registry/vue/month-picker.json +2 -2
- package/dist/registry/vue/number-input.json +2 -2
- package/dist/registry/vue/overlay-shared.json +15 -3
- package/dist/registry/vue/password-input.json +1 -1
- package/dist/registry/vue/pin-input.json +2 -2
- package/dist/registry/vue/popconfirm.json +2 -2
- package/dist/registry/vue/popover.json +3 -3
- package/dist/registry/vue/progress.json +2 -2
- package/dist/registry/vue/provider.json +28 -0
- package/dist/registry/vue/radio-group.json +2 -2
- package/dist/registry/vue/registry.json +59 -52
- package/dist/registry/vue/select.json +3 -3
- package/dist/registry/vue/separator.json +1 -1
- package/dist/registry/vue/skeleton.json +1 -1
- package/dist/registry/vue/slider.json +2 -2
- package/dist/registry/vue/slot.json +1 -1
- package/dist/registry/vue/spin.json +1 -1
- package/dist/registry/vue/switch.json +2 -2
- package/dist/registry/vue/table-render.json +8 -8
- package/dist/registry/vue/tabs.json +2 -2
- package/dist/registry/vue/textarea.json +1 -1
- package/dist/registry/vue/timeline.json +1 -1
- package/dist/registry/vue/toast.json +4 -4
- package/dist/registry/vue/tokens.json +2 -2
- package/dist/registry/vue/tooltip.json +3 -3
- package/dist/registry/vue/tree-select.json +4 -4
- package/dist/registry/vue/tree-shared.json +3 -3
- package/dist/registry/vue/utils.json +1 -1
- package/dist/registry/vue/week-picker.json +2 -2
- package/dist/registry/vue/year-picker.json +2 -2
- package/package.json +16 -16
package/dist/index.mjs
CHANGED
|
@@ -19,12 +19,12 @@ import { PinInput } from "@ark-ui/vue/pin-input";
|
|
|
19
19
|
import { PaginationEllipsis, PaginationItem, PaginationNextTrigger, PaginationPrevTrigger, PaginationRoot } from "@ark-ui/vue/pagination";
|
|
20
20
|
import { useVirtualizer } from "@tanstack/vue-virtual";
|
|
21
21
|
import { Tooltip } from "@ark-ui/vue/tooltip";
|
|
22
|
-
import {
|
|
22
|
+
import { createExpandedRowModel, createPaginatedRowModel, createSortedRowModel, rowExpandingFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, tableFeatures, useTable } from "@tanstack/vue-table";
|
|
23
23
|
import { Tabs } from "@ark-ui/vue/tabs";
|
|
24
24
|
import { Progress } from "@ark-ui/vue/progress";
|
|
25
25
|
import { Toast, Toaster, createToaster } from "@ark-ui/vue/toast";
|
|
26
26
|
import { Drawer } from "@ark-ui/vue/drawer";
|
|
27
|
-
|
|
27
|
+
// src/lib/utils.ts
|
|
28
28
|
/**
|
|
29
29
|
* 合并 Tailwind CSS 类名:clsx 组合条件类名,tailwind-merge 消解冲突规则。
|
|
30
30
|
* @param inputs - 任意数量的类名值(字符串、数组或对象)
|
|
@@ -33,8 +33,7 @@ import { Drawer } from "@ark-ui/vue/drawer";
|
|
|
33
33
|
function cn(...inputs) {
|
|
34
34
|
return twMerge(clsx(inputs));
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
//#region src/resolver.ts
|
|
36
|
+
// src/resolver.ts
|
|
38
37
|
/**
|
|
39
38
|
* unplugin-vue-components 专用 Resolver:
|
|
40
39
|
* 消费者配置后可在模板中直接使用 <TButton> / <t-button>,无需手动 import。
|
|
@@ -96,6 +95,7 @@ const COMPONENT_NAMES = [
|
|
|
96
95
|
"ToastProvider",
|
|
97
96
|
"TreeSelect",
|
|
98
97
|
"Tooltip",
|
|
98
|
+
"TuDesignProvider",
|
|
99
99
|
"WeekPicker",
|
|
100
100
|
"YearPicker"
|
|
101
101
|
];
|
|
@@ -116,8 +116,7 @@ function TuDesignResolver() {
|
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
//#region src/components/slot/Slot.ts
|
|
119
|
+
// src/components/slot/Slot.ts
|
|
121
120
|
/**
|
|
122
121
|
* 递归展平 `<slot />` 插槽出口(renderSlot)产生的 Fragment 包裹,取出真实子节点。
|
|
123
122
|
* @param children - 插槽渲染输出的 vnode 数组
|
|
@@ -171,8 +170,7 @@ const Slot = defineComponent({
|
|
|
171
170
|
};
|
|
172
171
|
}
|
|
173
172
|
});
|
|
174
|
-
|
|
175
|
-
//#region src/components/button/Button.vue
|
|
173
|
+
// src/components/button/Button.vue
|
|
176
174
|
const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
177
175
|
__name: "Button",
|
|
178
176
|
props: {
|
|
@@ -207,8 +205,7 @@ const _sfc_main$5 = /*@__PURE__*/ defineComponent({
|
|
|
207
205
|
};
|
|
208
206
|
}
|
|
209
207
|
});
|
|
210
|
-
|
|
211
|
-
//#region src/components/button/index.ts
|
|
208
|
+
// src/components/button/index.ts
|
|
212
209
|
const buttonVariants = cva("inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-[color,background-color,border-color,box-shadow,transform] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:scale-[0.98]", {
|
|
213
210
|
variants: {
|
|
214
211
|
variant: {
|
|
@@ -231,13 +228,11 @@ const buttonVariants = cva("inline-flex select-none items-center justify-center
|
|
|
231
228
|
size: "default"
|
|
232
229
|
}
|
|
233
230
|
});
|
|
234
|
-
|
|
235
|
-
//#region src/components/form/context.ts
|
|
231
|
+
// src/components/form/context.ts
|
|
236
232
|
const FORM_KEY = Symbol("tu-form");
|
|
237
233
|
const FIELD_KEY = Symbol("tu-form-field");
|
|
238
234
|
const FORM_ITEM_KEY = Symbol("tu-form-item");
|
|
239
|
-
|
|
240
|
-
//#region src/components/form/Form.vue
|
|
235
|
+
// src/components/form/Form.vue
|
|
241
236
|
const _sfc_main$18 = /*@__PURE__*/ defineComponent({
|
|
242
237
|
__name: "Form",
|
|
243
238
|
props: {
|
|
@@ -256,8 +251,7 @@ const _sfc_main$18 = /*@__PURE__*/ defineComponent({
|
|
|
256
251
|
};
|
|
257
252
|
}
|
|
258
253
|
});
|
|
259
|
-
|
|
260
|
-
//#region src/components/form/FormControl.vue
|
|
254
|
+
// src/components/form/FormControl.vue
|
|
261
255
|
/**
|
|
262
256
|
* 把 id / aria-invalid / aria-describedby 合并到唯一子元素(cloneVNode)。
|
|
263
257
|
* aria 全同步计算:description/message 的 presence 由 FormItem 的 refs 提供。
|
|
@@ -292,8 +286,7 @@ const _sfc_main$19 = defineComponent({
|
|
|
292
286
|
};
|
|
293
287
|
}
|
|
294
288
|
});
|
|
295
|
-
|
|
296
|
-
//#region src/components/form/FormDescription.vue
|
|
289
|
+
// src/components/form/FormDescription.vue
|
|
297
290
|
const _hoisted_1$33 = ["id"];
|
|
298
291
|
const _sfc_main$20 = /*@__PURE__*/ defineComponent({
|
|
299
292
|
__name: "FormDescription",
|
|
@@ -312,8 +305,7 @@ const _sfc_main$20 = /*@__PURE__*/ defineComponent({
|
|
|
312
305
|
};
|
|
313
306
|
}
|
|
314
307
|
});
|
|
315
|
-
|
|
316
|
-
//#region src/components/form/FormField.vue
|
|
308
|
+
// src/components/form/FormField.vue
|
|
317
309
|
const _sfc_main$21 = defineComponent(
|
|
318
310
|
/**
|
|
319
311
|
* @param props - 组件 props(name/validators/mode)
|
|
@@ -357,8 +349,7 @@ const _sfc_main$21 = defineComponent(
|
|
|
357
349
|
}
|
|
358
350
|
}
|
|
359
351
|
);
|
|
360
|
-
|
|
361
|
-
//#region src/components/form/FormItem.vue
|
|
352
|
+
// src/components/form/FormItem.vue
|
|
362
353
|
const _hoisted_1$32 = ["data-invalid"];
|
|
363
354
|
const _sfc_main$22 = /*@__PURE__*/ defineComponent({
|
|
364
355
|
__name: "FormItem",
|
|
@@ -388,8 +379,7 @@ const _sfc_main$22 = /*@__PURE__*/ defineComponent({
|
|
|
388
379
|
};
|
|
389
380
|
}
|
|
390
381
|
});
|
|
391
|
-
|
|
392
|
-
//#region src/components/form/FormLabel.vue
|
|
382
|
+
// src/components/form/FormLabel.vue
|
|
393
383
|
const _hoisted_1$31 = ["for", "data-invalid"];
|
|
394
384
|
const _sfc_main$23 = /*@__PURE__*/ defineComponent({
|
|
395
385
|
__name: "FormLabel",
|
|
@@ -408,8 +398,7 @@ const _sfc_main$23 = /*@__PURE__*/ defineComponent({
|
|
|
408
398
|
};
|
|
409
399
|
}
|
|
410
400
|
});
|
|
411
|
-
|
|
412
|
-
//#region src/components/form/FormMessage.vue
|
|
401
|
+
// src/components/form/FormMessage.vue
|
|
413
402
|
const _hoisted_1$30 = ["id"];
|
|
414
403
|
const _sfc_main$24 = /*@__PURE__*/ defineComponent({
|
|
415
404
|
__name: "FormMessage",
|
|
@@ -439,8 +428,7 @@ const _sfc_main$24 = /*@__PURE__*/ defineComponent({
|
|
|
439
428
|
};
|
|
440
429
|
}
|
|
441
430
|
});
|
|
442
|
-
|
|
443
|
-
//#region src/components/form/FormSubscribe.vue
|
|
431
|
+
// src/components/form/FormSubscribe.vue
|
|
444
432
|
const _sfc_main$26 = /*@__PURE__*/ defineComponent({
|
|
445
433
|
__name: "FormSubscribe",
|
|
446
434
|
setup(__props) {
|
|
@@ -457,15 +445,14 @@ const _sfc_main$26 = /*@__PURE__*/ defineComponent({
|
|
|
457
445
|
};
|
|
458
446
|
}
|
|
459
447
|
});
|
|
460
|
-
|
|
461
|
-
//#region src/components/form-render/FormRenderField.vue
|
|
448
|
+
// src/components/form-render/FormRenderField.vue
|
|
462
449
|
/**
|
|
463
450
|
* 单字段桥接:复用 <FormField>(form.Field 动态渲染 + FIELD_KEY provide 时序),
|
|
464
451
|
* 内部组装 FormItem/FormLabel/FormControl/FormDescription/FormMessage,
|
|
465
452
|
* aria 接线(id/aria-invalid/aria-describedby)由 FormControl 的 cloneVNode 机制继承。
|
|
466
453
|
* widget 调用发生在 FormField 插槽期,拿到 field 实例后组装 WidgetContext。
|
|
467
454
|
*/
|
|
468
|
-
const _sfc_main$
|
|
455
|
+
const _sfc_main$66 = defineComponent({
|
|
469
456
|
name: "TuFormRenderField",
|
|
470
457
|
props: {
|
|
471
458
|
item: {
|
|
@@ -505,8 +492,7 @@ const _sfc_main$65 = defineComponent({
|
|
|
505
492
|
} });
|
|
506
493
|
}
|
|
507
494
|
});
|
|
508
|
-
|
|
509
|
-
//#region src/components/checkbox/Checkbox.vue
|
|
495
|
+
// src/components/checkbox/Checkbox.vue
|
|
510
496
|
const _hoisted_1$29 = {
|
|
511
497
|
key: 0,
|
|
512
498
|
viewBox: "0 0 24 24",
|
|
@@ -604,8 +590,7 @@ const _sfc_main$9 = /*@__PURE__*/ defineComponent({
|
|
|
604
590
|
};
|
|
605
591
|
}
|
|
606
592
|
});
|
|
607
|
-
|
|
608
|
-
//#region src/components/switch/Switch.vue
|
|
593
|
+
// src/components/switch/Switch.vue
|
|
609
594
|
const _sfc_main$42 = /*@__PURE__*/ defineComponent({
|
|
610
595
|
__name: "Switch",
|
|
611
596
|
props: {
|
|
@@ -666,8 +651,7 @@ const _sfc_main$42 = /*@__PURE__*/ defineComponent({
|
|
|
666
651
|
};
|
|
667
652
|
}
|
|
668
653
|
});
|
|
669
|
-
|
|
670
|
-
//#region src/components/form-render/widgets/bind.ts
|
|
654
|
+
// src/components/form-render/widgets/bind.ts
|
|
671
655
|
const MODEL_VALUE = {
|
|
672
656
|
prop: "modelValue",
|
|
673
657
|
event: "modelValue"
|
|
@@ -700,8 +684,7 @@ function bindField(field, spec) {
|
|
|
700
684
|
onBlur: field.handleBlur
|
|
701
685
|
};
|
|
702
686
|
}
|
|
703
|
-
|
|
704
|
-
//#region src/components/form-render/widgets/boolean.ts
|
|
687
|
+
// src/components/form-render/widgets/boolean.ts
|
|
705
688
|
/**
|
|
706
689
|
* checkbox/switch widget:boolean 形态(值 prop 为 checked,非 modelValue)。
|
|
707
690
|
* 单行布局倾向 hideLabel + label 经 item.title 展示由使用者决定。
|
|
@@ -727,8 +710,7 @@ function renderSwitchItem(options = {}) {
|
|
|
727
710
|
...ctx.item.componentProps
|
|
728
711
|
});
|
|
729
712
|
}
|
|
730
|
-
|
|
731
|
-
//#region src/components/currency-input/utils.ts
|
|
713
|
+
// src/components/currency-input/utils.ts
|
|
732
714
|
/** 各单位折合整数分:分=1、角=10、元=100、万=1000000 */
|
|
733
715
|
const UNIT_FEN_EXP = {
|
|
734
716
|
万: 6,
|
|
@@ -781,8 +763,7 @@ function formatCurrency(value, valueUnit, labelUnit) {
|
|
|
781
763
|
}
|
|
782
764
|
return negative ? `-${text}` : text;
|
|
783
765
|
}
|
|
784
|
-
|
|
785
|
-
//#region src/components/currency-input/CurrencyInput.vue
|
|
766
|
+
// src/components/currency-input/CurrencyInput.vue
|
|
786
767
|
const _hoisted_1$28 = ["data-invalid"];
|
|
787
768
|
const _hoisted_2$17 = [
|
|
788
769
|
"value",
|
|
@@ -844,7 +825,7 @@ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
|
|
|
844
825
|
}
|
|
845
826
|
watch(() => props.modelValue, (value) => {
|
|
846
827
|
if (!isControlled.value || value === lastEmitted) return;
|
|
847
|
-
display.value = value
|
|
828
|
+
display.value = value == null ? "" : formatCurrency(value, props.valueUnit, props.labelUnit);
|
|
848
829
|
});
|
|
849
830
|
return (_ctx, _cache) => {
|
|
850
831
|
return openBlock(), createElementBlock("div", {
|
|
@@ -866,8 +847,7 @@ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
|
|
|
866
847
|
};
|
|
867
848
|
}
|
|
868
849
|
});
|
|
869
|
-
|
|
870
|
-
//#region src/components/date-shared/shared.ts
|
|
850
|
+
// src/components/date-shared/shared.ts
|
|
871
851
|
/**
|
|
872
852
|
* 日期家族共享模块:ISO 值域解析(日期/月/年/区间)与日历样式常量。
|
|
873
853
|
* 供 DatePicker / DateRangePicker 及后续变体(Month/Year/WeekPicker)复用。
|
|
@@ -1019,16 +999,14 @@ function parseIsoRange(raw) {
|
|
|
1019
999
|
}
|
|
1020
1000
|
const controlCls = "border-input flex h-9 w-full items-center overflow-hidden rounded-md border bg-transparent shadow-xs transition-[color,box-shadow] outline-none focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px] data-invalid:border-destructive data-invalid:ring-destructive/20 data-invalid:ring-[3px]";
|
|
1021
1001
|
const iconBtnCls = "text-muted-foreground/70 hover:text-foreground flex h-full w-8 shrink-0 items-center justify-center outline-none disabled:cursor-not-allowed disabled:opacity-30";
|
|
1022
|
-
|
|
1023
|
-
//#region \0/plugin-vue/export-helper
|
|
1002
|
+
// \0/plugin-vue/export-helper
|
|
1024
1003
|
var export_helper_default = (sfc, props) => {
|
|
1025
1004
|
const target = sfc.__vccOpts || sfc;
|
|
1026
1005
|
for (const [key, val] of props) target[key] = val;
|
|
1027
1006
|
return target;
|
|
1028
1007
|
};
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
const _sfc_main$64 = {};
|
|
1008
|
+
// src/components/icon-shared/ChevronIcon.vue
|
|
1009
|
+
const _sfc_main$65 = {};
|
|
1032
1010
|
const _hoisted_1$27 = {
|
|
1033
1011
|
viewBox: "0 0 24 24",
|
|
1034
1012
|
fill: "none",
|
|
@@ -1041,9 +1019,8 @@ const _hoisted_1$27 = {
|
|
|
1041
1019
|
function _sfc_render$3(_ctx, _cache) {
|
|
1042
1020
|
return openBlock(), createElementBlock("svg", _hoisted_1$27, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "m9 18 6-6-6-6" }, null, -1)])]);
|
|
1043
1021
|
}
|
|
1044
|
-
var ChevronIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
1045
|
-
|
|
1046
|
-
//#region src/components/calendar/CalendarNav.vue
|
|
1022
|
+
var ChevronIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$65, [["render", _sfc_render$3]]);
|
|
1023
|
+
// src/components/calendar/CalendarNav.vue
|
|
1047
1024
|
/**
|
|
1048
1025
|
* 视图导航条(内部件)。必须渲染在 <ArkDatePicker.View> 子树内:
|
|
1049
1026
|
* Prev/NextTrigger 的 view 参数由 View provide(ViewPropsContext),
|
|
@@ -1059,7 +1036,7 @@ const viewTitleCls = "text-sm font-semibold text-foreground";
|
|
|
1059
1036
|
* @param year - 聚焦年份
|
|
1060
1037
|
* @returns "起 - 止" 形式的年代范围文本
|
|
1061
1038
|
*/
|
|
1062
|
-
const _sfc_main$
|
|
1039
|
+
const _sfc_main$64 = /*@__PURE__*/ defineComponent({
|
|
1063
1040
|
__name: "CalendarNav",
|
|
1064
1041
|
props: {
|
|
1065
1042
|
/** 导航条服务的视图,决定中间内容形态:day=ViewTrigger(上钻)/ month=年份 / year=年代 */
|
|
@@ -1111,8 +1088,7 @@ view: {
|
|
|
1111
1088
|
};
|
|
1112
1089
|
}
|
|
1113
1090
|
});
|
|
1114
|
-
|
|
1115
|
-
//#region src/components/calendar/CalendarBody.vue
|
|
1091
|
+
// src/components/calendar/CalendarBody.vue
|
|
1116
1092
|
const _hoisted_1$26 = { class: "flex gap-6" };
|
|
1117
1093
|
const dayTriggerCls = "group relative flex h-8 w-full cursor-pointer items-center justify-center outline-none data-[outside-view]:pointer-events-none data-[disabled]:pointer-events-none data-[in-range]:not-data-[outside-view]:not-data-[range-start]:not-data-[range-end]:bg-primary/10 data-[range-start]:rounded-l-[3px] data-[range-end]:rounded-r-[3px] data-[week-selected]:bg-primary data-[week-selected]:data-[outside-view]:bg-primary/40 data-[week-selected]:hover:data-[outside-view]:bg-primary/40 group-hover/week-row:not-data-[week-selected]:not-data-[outside-view]:bg-primary/10 group-hover/week-row:data-[outside-view]:not-data-[week-selected]:bg-primary/5";
|
|
1118
1094
|
const dayDotCls = "flex size-6 items-center justify-center rounded-[3px] text-sm transition-colors group-hover:not-group-data-[week-selected]:bg-accent group-data-[focus]:not-group-data-[outside-view]:not-group-data-[week-selected]:bg-accent group-data-[selected]:not-group-data-[week-selected]:not-group-data-[outside-view]:bg-primary group-data-[selected]:not-group-data-[week-selected]:not-group-data-[outside-view]:font-medium group-data-[selected]:not-group-data-[week-selected]:not-group-data-[outside-view]:text-primary-foreground group-data-[week-selected]:bg-transparent group-data-[week-selected]:font-medium group-data-[week-selected]:text-primary-foreground group-data-[week-selected]:hover:bg-white/20 group-data-[today]:not-group-data-[selected]:text-primary group-data-[today]:not-group-data-[selected]:font-semibold group-data-[unavailable]:line-through group-data-[unavailable]:opacity-30 group-data-[disabled]:opacity-40 group-data-[outside-view]:opacity-30";
|
|
@@ -1127,7 +1103,7 @@ const rowCls = "bg-transparent!";
|
|
|
1127
1103
|
* @param i - 表序号(1-based,相对当前锚点月偏移 i-1 个月)
|
|
1128
1104
|
* @returns 该表锚点月的起始日期
|
|
1129
1105
|
*/
|
|
1130
|
-
const _sfc_main$
|
|
1106
|
+
const _sfc_main$63 = /*@__PURE__*/ defineComponent({
|
|
1131
1107
|
__name: "CalendarBody",
|
|
1132
1108
|
props: {
|
|
1133
1109
|
mode: { default: "day" },
|
|
@@ -1176,7 +1152,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1176
1152
|
createVNode(unref(DatePicker).View, { view: "day" }, {
|
|
1177
1153
|
default: withCtx(() => [
|
|
1178
1154
|
createCommentVNode(" day 视图导航条在 View 内:viewProps=day → GOTO.NEXT=focusNextPage(翻月) "),
|
|
1179
|
-
createVNode(_sfc_main$
|
|
1155
|
+
createVNode(_sfc_main$64, { view: "day" }, createSlots({ _: 2 }, [_ctx.$slots["prev-icon"] ? {
|
|
1180
1156
|
name: "prev-icon",
|
|
1181
1157
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "prev-icon")]),
|
|
1182
1158
|
key: "0"
|
|
@@ -1243,7 +1219,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1243
1219
|
createVNode(unref(DatePicker).View, { view: "month" }, {
|
|
1244
1220
|
default: withCtx(() => [
|
|
1245
1221
|
createCommentVNode(" 切换视图导航条也在 View 内:DatePicker 切月视图后 GOTO.NEXT=focusNextYear(修复 backlog) "),
|
|
1246
|
-
createVNode(_sfc_main$
|
|
1222
|
+
createVNode(_sfc_main$64, { view: "month" }, createSlots({ _: 2 }, [_ctx.$slots["prev-icon"] ? {
|
|
1247
1223
|
name: "prev-icon",
|
|
1248
1224
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "prev-icon")]),
|
|
1249
1225
|
key: "0"
|
|
@@ -1289,7 +1265,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1289
1265
|
_: 3
|
|
1290
1266
|
}),
|
|
1291
1267
|
createVNode(unref(DatePicker).View, { view: "year" }, {
|
|
1292
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
1268
|
+
default: withCtx(() => [createVNode(_sfc_main$64, { view: "year" }, createSlots({ _: 2 }, [_ctx.$slots["prev-icon"] ? {
|
|
1293
1269
|
name: "prev-icon",
|
|
1294
1270
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "prev-icon")]),
|
|
1295
1271
|
key: "0"
|
|
@@ -1335,7 +1311,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1335
1311
|
}, {
|
|
1336
1312
|
default: withCtx(() => [
|
|
1337
1313
|
createCommentVNode(" 导航条必须在 View 子树内:Prev/NextTrigger 才能拿到 view=\"month\"(GOTO.NEXT=focusNextYear) "),
|
|
1338
|
-
createVNode(_sfc_main$
|
|
1314
|
+
createVNode(_sfc_main$64, { view: "month" }, createSlots({ _: 2 }, [_ctx.$slots["prev-icon"] ? {
|
|
1339
1315
|
name: "prev-icon",
|
|
1340
1316
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "prev-icon")]),
|
|
1341
1317
|
key: "0"
|
|
@@ -1385,7 +1361,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1385
1361
|
}, {
|
|
1386
1362
|
default: withCtx(() => [
|
|
1387
1363
|
createCommentVNode(" 导航条必须在 View 子树内:Prev/NextTrigger 才能拿到 view=\"year\"(GOTO.NEXT=focusNextDecade) "),
|
|
1388
|
-
createVNode(_sfc_main$
|
|
1364
|
+
createVNode(_sfc_main$64, { view: "year" }, createSlots({ _: 2 }, [_ctx.$slots["prev-icon"] ? {
|
|
1389
1365
|
name: "prev-icon",
|
|
1390
1366
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "prev-icon")]),
|
|
1391
1367
|
key: "0"
|
|
@@ -1430,8 +1406,7 @@ const _sfc_main$62 = /*@__PURE__*/ defineComponent({
|
|
|
1430
1406
|
};
|
|
1431
1407
|
}
|
|
1432
1408
|
});
|
|
1433
|
-
|
|
1434
|
-
//#region src/components/calendar/Calendar.vue
|
|
1409
|
+
// src/components/calendar/Calendar.vue
|
|
1435
1410
|
const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
1436
1411
|
__name: "Calendar",
|
|
1437
1412
|
props: {
|
|
@@ -1516,7 +1491,7 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
|
1516
1491
|
"onUpdate:modelValue": handleValueUpdate
|
|
1517
1492
|
}, {
|
|
1518
1493
|
default: withCtx(() => [createVNode(unref(DatePicker).Content, null, {
|
|
1519
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
1494
|
+
default: withCtx(() => [createVNode(_sfc_main$63, {
|
|
1520
1495
|
mode: props.mode,
|
|
1521
1496
|
"num-of-months": props.numOfMonths,
|
|
1522
1497
|
week: props.week,
|
|
@@ -1547,7 +1522,7 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
|
1547
1522
|
"max",
|
|
1548
1523
|
"is-date-unavailable",
|
|
1549
1524
|
"locale"
|
|
1550
|
-
])], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" embedded 内嵌形态:宿主 Picker 的 Root 供能,纯卡片内核 "), createVNode(_sfc_main$
|
|
1525
|
+
])], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" embedded 内嵌形态:宿主 Picker 的 Root 供能,纯卡片内核 "), createVNode(_sfc_main$63, {
|
|
1551
1526
|
mode: props.mode,
|
|
1552
1527
|
"num-of-months": props.numOfMonths,
|
|
1553
1528
|
week: props.week,
|
|
@@ -1569,9 +1544,8 @@ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
|
|
|
1569
1544
|
};
|
|
1570
1545
|
}
|
|
1571
1546
|
});
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
const _sfc_main$61 = {};
|
|
1547
|
+
// src/components/icon-shared/CalendarIcon.vue
|
|
1548
|
+
const _sfc_main$62 = {};
|
|
1575
1549
|
const _hoisted_1$25 = {
|
|
1576
1550
|
viewBox: "0 0 24 24",
|
|
1577
1551
|
fill: "none",
|
|
@@ -1595,10 +1569,9 @@ function _sfc_render$2(_ctx, _cache) {
|
|
|
1595
1569
|
createElementVNode("path", { d: "M3 10h18" }, null, -1)
|
|
1596
1570
|
])]);
|
|
1597
1571
|
}
|
|
1598
|
-
var CalendarIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
const _sfc_main$60 = {};
|
|
1572
|
+
var CalendarIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$62, [["render", _sfc_render$2]]);
|
|
1573
|
+
// src/components/icon-shared/CloseIcon.vue
|
|
1574
|
+
const _sfc_main$61 = {};
|
|
1602
1575
|
const _hoisted_1$24 = {
|
|
1603
1576
|
viewBox: "0 0 24 24",
|
|
1604
1577
|
fill: "none",
|
|
@@ -1611,9 +1584,8 @@ const _hoisted_1$24 = {
|
|
|
1611
1584
|
function _sfc_render$1(_ctx, _cache) {
|
|
1612
1585
|
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)])]);
|
|
1613
1586
|
}
|
|
1614
|
-
var CloseIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
1615
|
-
|
|
1616
|
-
//#region src/components/overlay-shared/sandbox.ts
|
|
1587
|
+
var CloseIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$61, [["render", _sfc_render$1]]);
|
|
1588
|
+
// src/components/overlay-shared/sandbox.ts
|
|
1617
1589
|
/**
|
|
1618
1590
|
* 微前端沙箱探测(按渲染拓扑分派,框架无关)。
|
|
1619
1591
|
*
|
|
@@ -1632,6 +1604,9 @@ var CloseIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$60, [["ren
|
|
|
1632
1604
|
* - fixed 元素祖先有 transform/filter 时包含块被劫持(宿主布局应避免;graft 下
|
|
1633
1605
|
* absolute 的 offsetParent 解析本就失效,错法不同而非新增错误)
|
|
1634
1606
|
* - fixed 面板在祖先滚动时依赖 autoUpdate 重算,重算前一帧有视口驻留(瞬时视觉差异)
|
|
1607
|
+
* - 模态滚动锁(remove-scroll)同属 graft 坐标系差异家族:innerWidth(宿主视口)与
|
|
1608
|
+
* clientWidth(子应用容器)相减把宿主 chrome 宽误当滚动条 → 弹窗开合整页重排,
|
|
1609
|
+
* 策略收敛于 useSandboxOverlay.overlayPreventScroll()(wujie 下禁用,issue #4)
|
|
1635
1610
|
* - 若未来出现「非 iframe 的 graft 型沙箱」,本探测无法覆盖,需追加该沙箱的 marker 信号
|
|
1636
1611
|
*/
|
|
1637
1612
|
/**
|
|
@@ -1649,15 +1624,87 @@ function isInIframeRealm() {
|
|
|
1649
1624
|
function isInWujie() {
|
|
1650
1625
|
return typeof window !== "undefined" && window.__POWERED_BY_WUJIE__ === true;
|
|
1651
1626
|
}
|
|
1652
|
-
|
|
1653
|
-
|
|
1627
|
+
// src/components/overlay-shared/config.ts
|
|
1628
|
+
/** provide/inject 契约键(沿逻辑树传递,Teleport 子树同样命中) */
|
|
1629
|
+
const TU_PROVIDER_KEY = Symbol("tu-provider");
|
|
1630
|
+
const DEFAULT_CONFIG = { mode: "auto" };
|
|
1631
|
+
/**
|
|
1632
|
+
* 读取应用级配置;无 Provider 时缺省 auto(= 未引入本特性前的行为,向后兼容兜底)。
|
|
1633
|
+
* 须在 setup 顶层调用(inject 约束)。
|
|
1634
|
+
* @returns 最近 Provider 的配置快照,或 { mode: "auto" }
|
|
1635
|
+
*/
|
|
1636
|
+
function useTuProvider() {
|
|
1637
|
+
return inject(TU_PROVIDER_KEY, DEFAULT_CONFIG);
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Teleport 目标降级判定:shadow / shadow-iframe → 降级到应用挂载容器;
|
|
1641
|
+
* none → 恒 body;auto → 现行 isInWujie 探测(结构 shadowRoot 信号在
|
|
1642
|
+
* useSandboxTeleportTarget 内与本结果 OR,仅 auto 分支参与)。
|
|
1643
|
+
* @param mode 环境声明
|
|
1644
|
+
* @returns 是否强制降级(显式 mode 下不执行任何探测)
|
|
1645
|
+
*/
|
|
1646
|
+
function teleportDegrade(mode) {
|
|
1647
|
+
switch (mode) {
|
|
1648
|
+
case "none": return false;
|
|
1649
|
+
case "shadow":
|
|
1650
|
+
case "shadow-iframe": return true;
|
|
1651
|
+
case "auto": return isInWujie();
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* positioning.strategy 缺省 fixed 判定:仅 shadow-iframe(iframe realm + graft 坐标错位)
|
|
1656
|
+
* 与 auto 的 isInIframeRealm 探测注入;用户显式 strategy 的优先级在调用方
|
|
1657
|
+
* (withSandboxStrategy)先行短路。
|
|
1658
|
+
* @param mode 环境声明
|
|
1659
|
+
* @returns 用户未指定 strategy 时是否注入 fixed
|
|
1660
|
+
*/
|
|
1661
|
+
function strategyFixed(mode) {
|
|
1662
|
+
switch (mode) {
|
|
1663
|
+
case "none":
|
|
1664
|
+
case "shadow": return false;
|
|
1665
|
+
case "shadow-iframe": return true;
|
|
1666
|
+
case "auto": return isInIframeRealm();
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
* 模态滚动锁策略:shadow-iframe → false(禁用,issue #4 的 graft 坐标系误补偿);
|
|
1671
|
+
* none / shadow → undefined(交还 Ark preventScroll=modal 派生默认);
|
|
1672
|
+
* auto → 现行 isInWujie ? false : undefined。
|
|
1673
|
+
* 传硬编码 true 永远禁止——attrs 透传 :modal=false 的既有用法会被强加滚动锁(行为回归)。
|
|
1674
|
+
* @param mode 环境声明
|
|
1675
|
+
* @returns false=显式禁用;undefined=不覆盖 Ark 缺省
|
|
1676
|
+
*/
|
|
1677
|
+
function preventScrollOverride(mode) {
|
|
1678
|
+
switch (mode) {
|
|
1679
|
+
case "none":
|
|
1680
|
+
case "shadow": return;
|
|
1681
|
+
case "shadow-iframe": return false;
|
|
1682
|
+
case "auto": return isInWujie() ? false : void 0;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
/**
|
|
1686
|
+
* overlay 契约消费判定(语义 B:仅锁禁用拓扑消费,issue #5)。
|
|
1687
|
+
* overlay 命名空间 prop present = enabled,mount-time 消费;
|
|
1688
|
+
* 仅当 preventScrollOverride(mode) === false(shadow-iframe 显式 / auto 探测命中 wujie)
|
|
1689
|
+
* 时透传契约引用,其余拓扑(none / shadow / auto 非 wujie / 未提供 overlay)一律 null。
|
|
1690
|
+
* 显式 mode 短路探测的性质由 preventScrollOverride 继承(marker 漂移免疫)。
|
|
1691
|
+
* @param config Provider 配置快照
|
|
1692
|
+
* @returns 锁禁用拓扑下为 config.overlay 同引用,否则 null
|
|
1693
|
+
*/
|
|
1694
|
+
function overlayContract(config) {
|
|
1695
|
+
return config.overlay && preventScrollOverride(config.mode) === false ? config.overlay : null;
|
|
1696
|
+
}
|
|
1697
|
+
// src/components/overlay-shared/useSandboxOverlay.ts
|
|
1654
1698
|
/**
|
|
1655
1699
|
* 浮层沙箱适配公共层(Popover 0.5.3 修复的推广形态,机制与实测依据见 sandbox.ts 头注):
|
|
1656
1700
|
* - useSandboxTeleportTarget:Teleport 目标降级(真 shadow DOM / wujie graft → 应用挂载容器)
|
|
1657
1701
|
* - withSandboxStrategy:iframe realm 下 positioning.strategy 默认 fixed(absolute 包含块错位修正)
|
|
1702
|
+
* - overlayPreventScroll:模态浮层滚动锁按沙箱拓扑降级(wujie graft 下禁用,issue #4)
|
|
1703
|
+
*
|
|
1704
|
+
* 三项均「Provider mode 显式声明优先、缺省 auto 走探测」,解析语义见 config.ts。
|
|
1658
1705
|
*/
|
|
1659
1706
|
/**
|
|
1660
|
-
* 浮层 Teleport 目标解析:显式 to >
|
|
1707
|
+
* 浮层 Teleport 目标解析:显式 to > Provider mode / 探测降级 > body。
|
|
1661
1708
|
*
|
|
1662
1709
|
* app._container 在 mount 的 render 完成后才赋值(runtime-core 3.5.43:render L4337
|
|
1663
1710
|
* → 赋值 L4340),而子组件 onMounted 在 render 内同步执行、届时仍为 undefined,
|
|
@@ -1665,45 +1712,69 @@ function isInWujie() {
|
|
|
1665
1712
|
* 驱动 computed 重算;getCurrentInstance 仅 setup 同步上下文可用,本函数须在
|
|
1666
1713
|
* setup 顶层调用。共享 Vue(__MICRO_SHARED__)下各子应用 app._container 相互
|
|
1667
1714
|
* 独立,检测按实例隔离。
|
|
1668
|
-
*
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1715
|
+
* 降级判定:显式 mode(shadow / shadow-iframe)短路降级、none 恒不降;auto 走现行
|
|
1716
|
+
* 双信号——真 shadow DOM 由 getRootNode() 命中,wujie graft 下 getRootNode/父链被
|
|
1717
|
+
* patch 伪装(实测)故叠加 marker。结构 shadowRoot 信号仅 auto 分支参与(显式声明
|
|
1718
|
+
* 时不再猜测)。其余微前端(qiankun / micro-app light DOM)body 即主文档 body,兜底正确。
|
|
1671
1719
|
*
|
|
1672
1720
|
* @param explicitTo 组件显式 to 的取值函数(响应式安全:computed 内重读)
|
|
1673
1721
|
* @returns Teleport 目标(显式 to 优先,其次降级容器,兜底 body)
|
|
1674
1722
|
*/
|
|
1675
1723
|
function useSandboxTeleportTarget(explicitTo) {
|
|
1676
1724
|
const instance = getCurrentInstance();
|
|
1677
|
-
const
|
|
1725
|
+
const { mode } = useTuProvider();
|
|
1726
|
+
const degrade = teleportDegrade(mode);
|
|
1678
1727
|
const detectedTarget = ref("body");
|
|
1679
1728
|
onMounted(() => {
|
|
1680
1729
|
queueMicrotask(() => {
|
|
1681
1730
|
if (explicitTo()) return;
|
|
1682
1731
|
const container = (instance?.appContext.app)?._container;
|
|
1683
|
-
if (container && (container.getRootNode() instanceof ShadowRoot
|
|
1732
|
+
if (container && (degrade || mode === "auto" && container.getRootNode() instanceof ShadowRoot)) detectedTarget.value = container;
|
|
1684
1733
|
});
|
|
1685
1734
|
});
|
|
1686
1735
|
return computed(() => explicitTo() ?? detectedTarget.value);
|
|
1687
1736
|
}
|
|
1688
1737
|
/**
|
|
1689
|
-
*
|
|
1690
|
-
*
|
|
1691
|
-
* graft
|
|
1738
|
+
* 用户未显式指定 strategy 时按环境注入缺省 fixed:shadow-iframe 显式注入、
|
|
1739
|
+
* none / shadow 恒不注入、auto 走 isInIframeRealm 探测(非 graft 拓扑下 fixed 与
|
|
1740
|
+
* absolute 坐标等价,零副作用;graft 下 absolute 包含块错位,fixed 是唯一正确解)。
|
|
1741
|
+
* 优先级:user.strategy > Provider mode/探测 > 不注入。
|
|
1692
1742
|
* 纯函数、原地写入 merged(调用方传入自己的合成对象,无共享引用风险);
|
|
1693
1743
|
* user.strategy 显式给出(含 null 意义上的「未传」判定用 == null)时以其为准。
|
|
1744
|
+
* config 须在组件 setup 顶层经 useTuProvider() 捕获后传入(computed 内 inject 不可用)。
|
|
1694
1745
|
*
|
|
1695
1746
|
* @param user 用户原始 positioning(undefined 或经 attrs 透传的合成对象)
|
|
1696
1747
|
* @param merged 组件已合成 placement/sameWidth 等的基础 positioning(将被写入)
|
|
1748
|
+
* @param config 应用级沙箱配置快照(setup 顶层 useTuProvider() 结果)
|
|
1697
1749
|
* @returns 写入 strategy 后的 merged(同引用,便于 computed 直接 return)
|
|
1698
1750
|
*/
|
|
1699
|
-
function withSandboxStrategy(user, merged) {
|
|
1700
|
-
if (
|
|
1751
|
+
function withSandboxStrategy(user, merged, config) {
|
|
1752
|
+
if (user?.strategy == null && strategyFixed(config.mode)) merged.strategy = "fixed";
|
|
1701
1753
|
return merged;
|
|
1702
1754
|
}
|
|
1703
|
-
|
|
1704
|
-
|
|
1755
|
+
/**
|
|
1756
|
+
* 模态浮层滚动锁策略(dialog / alert-dialog / drawer 共用,issue #4):
|
|
1757
|
+
* 按 useTuProvider().mode 解析(shadow-iframe 禁用 / none、shadow 交还缺省 /
|
|
1758
|
+
* auto 走 isInWujie 探测)。禁用依据:@zag-js/remove-scroll 的补偿公式
|
|
1759
|
+
* `scrollbarWidth = win.innerWidth − documentElement.clientWidth` 在 graft 下跨坐标系
|
|
1760
|
+
* (iframe 报宿主视口宽,documentElement 是 graft 进 shadowRoot 的子应用容器),
|
|
1761
|
+
* 宿主 chrome 宽被误当滚动条写入渲染 body(padding-right)→ 弹窗开合整页重排抖动;
|
|
1762
|
+
* 且主流 wujie 拓扑下子应用 body 本就不滚(滚动在宿主容器),锁无收益只有副作用。
|
|
1763
|
+
* 拓扑边界:若子应用 body 自身可滚,禁用后背景随弹窗可滚——带误补偿的锁不如不要,
|
|
1764
|
+
* wujie 下真正的「锁背景」需宿主参与(见 plan §6 follow-up)。
|
|
1765
|
+
* 传硬编码 true 永远禁止——本库组件单根、attrs 透传,消费方 :modal="false" 的
|
|
1766
|
+
* 既有用法会被强加滚动锁(行为回归),undefined 经适配层 cleanProps 过滤后
|
|
1767
|
+
* 保留 zag 缺省 preventScroll = modal。
|
|
1768
|
+
* 须在 setup 顶层调用(inject 约束)。
|
|
1769
|
+
*
|
|
1770
|
+
* @returns false=禁用滚动锁;undefined=不覆盖 Ark 缺省
|
|
1771
|
+
*/
|
|
1772
|
+
function overlayPreventScroll() {
|
|
1773
|
+
return preventScrollOverride(useTuProvider().mode);
|
|
1774
|
+
}
|
|
1775
|
+
// src/components/date-shared/PickerShell.vue
|
|
1705
1776
|
/** 单值日期族(Date/Month/Year/Week)共用外壳:触发器 + 清空/日历按钮 + 弹层容器。 */
|
|
1706
|
-
const _sfc_main$
|
|
1777
|
+
const _sfc_main$60 = /*@__PURE__*/ defineComponent({
|
|
1707
1778
|
inheritAttrs: false,
|
|
1708
1779
|
__name: "PickerShell",
|
|
1709
1780
|
props: {
|
|
@@ -1790,7 +1861,8 @@ const _sfc_main$59 = /*@__PURE__*/ defineComponent({
|
|
|
1790
1861
|
emit("update:open", true);
|
|
1791
1862
|
}
|
|
1792
1863
|
const teleportTarget = useSandboxTeleportTarget(() => void 0);
|
|
1793
|
-
const
|
|
1864
|
+
const tuProvider = useTuProvider();
|
|
1865
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }, tuProvider));
|
|
1794
1866
|
return (_ctx, _cache) => {
|
|
1795
1867
|
return openBlock(), createBlock(unref(DatePicker).Root, {
|
|
1796
1868
|
"model-value": __props.modelValue,
|
|
@@ -1867,8 +1939,7 @@ const _sfc_main$59 = /*@__PURE__*/ defineComponent({
|
|
|
1867
1939
|
};
|
|
1868
1940
|
}
|
|
1869
1941
|
});
|
|
1870
|
-
|
|
1871
|
-
//#region src/components/overlay-shared/useControlledBoolean.ts
|
|
1942
|
+
// src/components/overlay-shared/useControlledBoolean.ts
|
|
1872
1943
|
/**
|
|
1873
1944
|
* 业务组件惯例:Ark Root 恒走受控,非受控语义由内部 ref 实现。
|
|
1874
1945
|
* `controlled()` 返回 undefined 时用内部值,否则永远跟随外部 prop。
|
|
@@ -1887,8 +1958,7 @@ function useControlledBoolean(options) {
|
|
|
1887
1958
|
setOpen
|
|
1888
1959
|
};
|
|
1889
1960
|
}
|
|
1890
|
-
|
|
1891
|
-
//#region src/components/date-shared/usePickerBridge.ts
|
|
1961
|
+
// src/components/date-shared/usePickerBridge.ts
|
|
1892
1962
|
/**
|
|
1893
1963
|
* 单值日期选择器的受控桥接:值以内部 ref 为镜像、Root 恒走受控,
|
|
1894
1964
|
* 开合复用 useControlledBoolean,openFromInput 统一「点击/↓ 输入框即开」。
|
|
@@ -1925,8 +1995,7 @@ function usePickerBridge(options) {
|
|
|
1925
1995
|
handleValueUpdate
|
|
1926
1996
|
};
|
|
1927
1997
|
}
|
|
1928
|
-
|
|
1929
|
-
//#region src/components/date-picker/DatePicker.vue
|
|
1998
|
+
// src/components/date-picker/DatePicker.vue
|
|
1930
1999
|
const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
1931
2000
|
inheritAttrs: false,
|
|
1932
2001
|
__name: "DatePicker",
|
|
@@ -2022,7 +2091,7 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
|
2022
2091
|
const minDate = computed(() => parseIsoDate(props.min ?? ""));
|
|
2023
2092
|
const maxDate = computed(() => parseIsoDate(props.max ?? ""));
|
|
2024
2093
|
return (_ctx, _cache) => {
|
|
2025
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2094
|
+
return openBlock(), createBlock(_sfc_main$60, mergeProps(_ctx.$attrs, {
|
|
2026
2095
|
"model-value": unref(rootValue),
|
|
2027
2096
|
open: unref(isOpen),
|
|
2028
2097
|
locale: props.locale,
|
|
@@ -2065,8 +2134,7 @@ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
|
|
|
2065
2134
|
};
|
|
2066
2135
|
}
|
|
2067
2136
|
});
|
|
2068
|
-
|
|
2069
|
-
//#region src/components/date-range-picker/DateRangePicker.vue
|
|
2137
|
+
// src/components/date-range-picker/DateRangePicker.vue
|
|
2070
2138
|
const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
2071
2139
|
inheritAttrs: false,
|
|
2072
2140
|
__name: "DateRangePicker",
|
|
@@ -2177,7 +2245,8 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
2177
2245
|
onChange: (open) => emit("update:open", open)
|
|
2178
2246
|
});
|
|
2179
2247
|
const teleportTarget = useSandboxTeleportTarget(() => void 0);
|
|
2180
|
-
const
|
|
2248
|
+
const tuProvider = useTuProvider();
|
|
2249
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }, tuProvider));
|
|
2181
2250
|
function openFromInput() {
|
|
2182
2251
|
if (props.disabled || props.readOnly || isOpen.value) return;
|
|
2183
2252
|
setOpen(true);
|
|
@@ -2282,8 +2351,7 @@ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
|
|
|
2282
2351
|
};
|
|
2283
2352
|
}
|
|
2284
2353
|
});
|
|
2285
|
-
|
|
2286
|
-
//#region src/components/month-picker/MonthPicker.vue
|
|
2354
|
+
// src/components/month-picker/MonthPicker.vue
|
|
2287
2355
|
const _sfc_main$29 = /*@__PURE__*/ defineComponent({
|
|
2288
2356
|
inheritAttrs: false,
|
|
2289
2357
|
__name: "MonthPicker",
|
|
@@ -2378,7 +2446,7 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
|
|
|
2378
2446
|
return anchor ? anchor.set({ day: 31 }) : void 0;
|
|
2379
2447
|
});
|
|
2380
2448
|
return (_ctx, _cache) => {
|
|
2381
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2449
|
+
return openBlock(), createBlock(_sfc_main$60, mergeProps(_ctx.$attrs, {
|
|
2382
2450
|
"model-value": unref(rootValue),
|
|
2383
2451
|
open: unref(isOpen),
|
|
2384
2452
|
locale: props.locale,
|
|
@@ -2421,8 +2489,7 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
|
|
|
2421
2489
|
};
|
|
2422
2490
|
}
|
|
2423
2491
|
});
|
|
2424
|
-
|
|
2425
|
-
//#region src/components/number-input/utils.ts
|
|
2492
|
+
// src/components/number-input/utils.ts
|
|
2426
2493
|
/**
|
|
2427
2494
|
* Ark ValueChangeDetails → number|null(空串/NaN 归一 null,numberOrNull 为可单测的纯函数)
|
|
2428
2495
|
* @param details - Ark NumberInput 的 ValueChangeDetails
|
|
@@ -2431,8 +2498,7 @@ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
|
|
|
2431
2498
|
function numberOrNull(details) {
|
|
2432
2499
|
return details.value === "" || Number.isNaN(details.valueAsNumber) ? null : details.valueAsNumber;
|
|
2433
2500
|
}
|
|
2434
|
-
|
|
2435
|
-
//#region src/components/number-input/NumberInput.vue
|
|
2501
|
+
// src/components/number-input/NumberInput.vue
|
|
2436
2502
|
const _sfc_main$30 = /*@__PURE__*/ defineComponent({
|
|
2437
2503
|
inheritAttrs: false,
|
|
2438
2504
|
__name: "NumberInput",
|
|
@@ -2543,8 +2609,7 @@ const _sfc_main$30 = /*@__PURE__*/ defineComponent({
|
|
|
2543
2609
|
};
|
|
2544
2610
|
}
|
|
2545
2611
|
});
|
|
2546
|
-
|
|
2547
|
-
//#region src/components/password-input/PasswordInput.vue
|
|
2612
|
+
// src/components/password-input/PasswordInput.vue
|
|
2548
2613
|
const _hoisted_1$23 = ["data-invalid"];
|
|
2549
2614
|
const _hoisted_2$16 = [
|
|
2550
2615
|
"type",
|
|
@@ -2672,8 +2737,7 @@ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
|
|
|
2672
2737
|
};
|
|
2673
2738
|
}
|
|
2674
2739
|
});
|
|
2675
|
-
|
|
2676
|
-
//#region src/components/textarea/Textarea.vue
|
|
2740
|
+
// src/components/textarea/Textarea.vue
|
|
2677
2741
|
const _hoisted_1$22 = ["aria-invalid"];
|
|
2678
2742
|
const _sfc_main$46 = /*@__PURE__*/ defineComponent({
|
|
2679
2743
|
__name: "Textarea",
|
|
@@ -2701,9 +2765,8 @@ const _sfc_main$46 = /*@__PURE__*/ defineComponent({
|
|
|
2701
2765
|
};
|
|
2702
2766
|
}
|
|
2703
2767
|
});
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
2768
|
+
// src/components/week-picker/WeekPicker.vue
|
|
2769
|
+
const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
2707
2770
|
inheritAttrs: false,
|
|
2708
2771
|
__name: "WeekPicker",
|
|
2709
2772
|
props: {
|
|
@@ -2816,7 +2879,7 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
|
2816
2879
|
return date ? weekStartOf(date, props.locale) : void 0;
|
|
2817
2880
|
}
|
|
2818
2881
|
return (_ctx, _cache) => {
|
|
2819
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2882
|
+
return openBlock(), createBlock(_sfc_main$60, mergeProps(_ctx.$attrs, {
|
|
2820
2883
|
"model-value": unref(rootValue),
|
|
2821
2884
|
open: unref(isOpen),
|
|
2822
2885
|
locale: props.locale,
|
|
@@ -2860,9 +2923,8 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
|
2860
2923
|
};
|
|
2861
2924
|
}
|
|
2862
2925
|
});
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
2926
|
+
// src/components/year-picker/YearPicker.vue
|
|
2927
|
+
const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
2866
2928
|
inheritAttrs: false,
|
|
2867
2929
|
__name: "YearPicker",
|
|
2868
2930
|
props: {
|
|
@@ -2953,7 +3015,7 @@ const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
|
2953
3015
|
const minDate = computed(() => parseIsoYear(props.min ?? ""));
|
|
2954
3016
|
const maxDate = computed(() => parseIsoYear(props.max ?? ""));
|
|
2955
3017
|
return (_ctx, _cache) => {
|
|
2956
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3018
|
+
return openBlock(), createBlock(_sfc_main$60, mergeProps(_ctx.$attrs, {
|
|
2957
3019
|
"model-value": unref(rootValue),
|
|
2958
3020
|
open: unref(isOpen),
|
|
2959
3021
|
locale: props.locale,
|
|
@@ -2996,8 +3058,7 @@ const _sfc_main$52 = /*@__PURE__*/ defineComponent({
|
|
|
2996
3058
|
};
|
|
2997
3059
|
}
|
|
2998
3060
|
});
|
|
2999
|
-
|
|
3000
|
-
//#region src/components/form-render/widgets/model-value.ts
|
|
3061
|
+
// src/components/form-render/widgets/model-value.ts
|
|
3001
3062
|
/**
|
|
3002
3063
|
* modelValue 形态 widgets 统一展开模式(方案 C):
|
|
3003
3064
|
* item 级缺省 → options 整体展开(命名穿透,组件全 props)→ 受控绑定 → 逃逸口。
|
|
@@ -3091,7 +3152,7 @@ function renderMonthPickerItem(options = {}) {
|
|
|
3091
3152
|
* @returns 渲染函数,接收渲染上下文并产出 YearPicker vnode
|
|
3092
3153
|
*/
|
|
3093
3154
|
function renderYearPickerItem(options = {}) {
|
|
3094
|
-
return pickerRenderer(_sfc_main$
|
|
3155
|
+
return pickerRenderer(_sfc_main$53, options);
|
|
3095
3156
|
}
|
|
3096
3157
|
/**
|
|
3097
3158
|
* dateRangePicker widget:[start, end] | null 形态
|
|
@@ -3107,10 +3168,9 @@ function renderDateRangePickerItem(options = {}) {
|
|
|
3107
3168
|
* @returns 渲染函数,接收渲染上下文并产出 WeekPicker vnode
|
|
3108
3169
|
*/
|
|
3109
3170
|
function renderWeekPickerItem(options = {}) {
|
|
3110
|
-
return pickerRenderer(_sfc_main$
|
|
3171
|
+
return pickerRenderer(_sfc_main$52, options);
|
|
3111
3172
|
}
|
|
3112
|
-
|
|
3113
|
-
//#region src/components/input/Input.vue
|
|
3173
|
+
// src/components/input/Input.vue
|
|
3114
3174
|
const _hoisted_1$21 = ["aria-invalid"];
|
|
3115
3175
|
const _sfc_main$27 = /*@__PURE__*/ defineComponent({
|
|
3116
3176
|
__name: "Input",
|
|
@@ -3138,8 +3198,7 @@ const _sfc_main$27 = /*@__PURE__*/ defineComponent({
|
|
|
3138
3198
|
};
|
|
3139
3199
|
}
|
|
3140
3200
|
});
|
|
3141
|
-
|
|
3142
|
-
//#region src/components/form-render/widgets/input.ts
|
|
3201
|
+
// src/components/form-render/widgets/input.ts
|
|
3143
3202
|
/**
|
|
3144
3203
|
* input widget:单行文本输入(placeholder 为原生 attr 透传,aria-invalid 由 FormControl 接线)
|
|
3145
3204
|
* @param options - widget 选项,整体展开后经 modelValue 受控绑定与 componentProps 透传给 Input
|
|
@@ -3153,8 +3212,7 @@ function renderInputItem(options = {}) {
|
|
|
3153
3212
|
...ctx.item.componentProps
|
|
3154
3213
|
});
|
|
3155
3214
|
}
|
|
3156
|
-
|
|
3157
|
-
//#region src/components/overlay-shared/useOverlayIds.ts
|
|
3215
|
+
// src/components/overlay-shared/useOverlayIds.ts
|
|
3158
3216
|
/**
|
|
3159
3217
|
* 浮层组件 ids 全量覆盖(无冒号化)。
|
|
3160
3218
|
*
|
|
@@ -3212,8 +3270,7 @@ function useOverlayIds(attrs, options) {
|
|
|
3212
3270
|
resolveId
|
|
3213
3271
|
};
|
|
3214
3272
|
}
|
|
3215
|
-
|
|
3216
|
-
//#region src/components/select/types.ts
|
|
3273
|
+
// src/components/select/types.ts
|
|
3217
3274
|
/**
|
|
3218
3275
|
* 将字符串简写归一为完整选项对象:字符串同时作为 label 与 value。
|
|
3219
3276
|
* @param item - 字符串简写或完整选项对象
|
|
@@ -3225,8 +3282,7 @@ function normalizeSelectItem(item) {
|
|
|
3225
3282
|
value: item
|
|
3226
3283
|
} : item;
|
|
3227
3284
|
}
|
|
3228
|
-
|
|
3229
|
-
//#region src/components/select/Select.vue
|
|
3285
|
+
// src/components/select/Select.vue
|
|
3230
3286
|
const _hoisted_1$20 = { class: "min-w-0 flex-1 truncate" };
|
|
3231
3287
|
const _sfc_main$37 = /*@__PURE__*/ defineComponent({
|
|
3232
3288
|
__name: "Select",
|
|
@@ -3315,10 +3371,11 @@ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
|
|
|
3315
3371
|
defaultValue: () => props.defaultOpen,
|
|
3316
3372
|
onChange: (open) => emit("update:open", open)
|
|
3317
3373
|
});
|
|
3374
|
+
const tuProvider = useTuProvider();
|
|
3318
3375
|
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, {
|
|
3319
3376
|
sameWidth: true,
|
|
3320
3377
|
...props.positioning
|
|
3321
|
-
}));
|
|
3378
|
+
}, tuProvider));
|
|
3322
3379
|
return (_ctx, _cache) => {
|
|
3323
3380
|
return openBlock(), createBlock(unref(Select).Root, {
|
|
3324
3381
|
ids: unref(rootIds),
|
|
@@ -3389,8 +3446,7 @@ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
|
|
|
3389
3446
|
};
|
|
3390
3447
|
}
|
|
3391
3448
|
});
|
|
3392
|
-
|
|
3393
|
-
//#region src/components/form-render/widgets/select.ts
|
|
3449
|
+
// src/components/form-render/widgets/select.ts
|
|
3394
3450
|
/**
|
|
3395
3451
|
* select widget:Select 已单组件化,items/placeholder 均为正式 prop 直写。
|
|
3396
3452
|
* v3 命名穿透:options 整体透传给 Select(内部做 string 归一化);
|
|
@@ -3408,8 +3464,7 @@ function renderSelectItem(options) {
|
|
|
3408
3464
|
...ctx.item.componentProps
|
|
3409
3465
|
});
|
|
3410
3466
|
}
|
|
3411
|
-
|
|
3412
|
-
//#region src/components/radio-group/RadioGroup.vue
|
|
3467
|
+
// src/components/radio-group/RadioGroup.vue
|
|
3413
3468
|
const _sfc_main$36 = /*@__PURE__*/ defineComponent({
|
|
3414
3469
|
__name: "RadioGroup",
|
|
3415
3470
|
props: {
|
|
@@ -3493,8 +3548,7 @@ const _sfc_main$36 = /*@__PURE__*/ defineComponent({
|
|
|
3493
3548
|
};
|
|
3494
3549
|
}
|
|
3495
3550
|
});
|
|
3496
|
-
|
|
3497
|
-
//#region src/components/slider/Slider.vue
|
|
3551
|
+
// src/components/slider/Slider.vue
|
|
3498
3552
|
const _sfc_main$40 = /*@__PURE__*/ defineComponent({
|
|
3499
3553
|
__name: "Slider",
|
|
3500
3554
|
props: {
|
|
@@ -3553,8 +3607,7 @@ const _sfc_main$40 = /*@__PURE__*/ defineComponent({
|
|
|
3553
3607
|
};
|
|
3554
3608
|
}
|
|
3555
3609
|
});
|
|
3556
|
-
|
|
3557
|
-
//#region src/components/form-render/widgets/value.ts
|
|
3610
|
+
// src/components/form-render/widgets/value.ts
|
|
3558
3611
|
/**
|
|
3559
3612
|
* radioGroup widget:单选组(值 prop 为 value)。
|
|
3560
3613
|
* 命名穿透:选项字段为组件 required prop `items`,整体直传,widget 不做组装。
|
|
@@ -3581,8 +3634,7 @@ function renderSliderItem(options = {}) {
|
|
|
3581
3634
|
...ctx.item.componentProps
|
|
3582
3635
|
});
|
|
3583
3636
|
}
|
|
3584
|
-
|
|
3585
|
-
//#region src/components/tree-shared/ValueTags.vue
|
|
3637
|
+
// src/components/tree-shared/ValueTags.vue
|
|
3586
3638
|
const _hoisted_1$19 = ["data-key"];
|
|
3587
3639
|
const _hoisted_2$15 = { class: "truncate" };
|
|
3588
3640
|
const _hoisted_3$11 = ["aria-label", "onClick"];
|
|
@@ -3591,7 +3643,7 @@ const _hoisted_4$9 = {
|
|
|
3591
3643
|
"data-part": "tag-overflow",
|
|
3592
3644
|
class: "text-xs text-muted-foreground"
|
|
3593
3645
|
};
|
|
3594
|
-
const _sfc_main$
|
|
3646
|
+
const _sfc_main$59 = /*@__PURE__*/ defineComponent({
|
|
3595
3647
|
__name: "ValueTags",
|
|
3596
3648
|
props: {
|
|
3597
3649
|
/** 展示的选中值(key + label) */
|
|
@@ -3650,8 +3702,7 @@ const _sfc_main$58 = /*@__PURE__*/ defineComponent({
|
|
|
3650
3702
|
};
|
|
3651
3703
|
}
|
|
3652
3704
|
});
|
|
3653
|
-
|
|
3654
|
-
//#region src/components/tree-shared/utils.ts
|
|
3705
|
+
// src/components/tree-shared/utils.ts
|
|
3655
3706
|
/*!
|
|
3656
3707
|
* 移植自 treemate v0.3.11 —— https://github.com/07akioni/treemate
|
|
3657
3708
|
* MIT License · Copyright (c) 07akioni
|
|
@@ -3842,8 +3893,7 @@ function minus(originalKeys, keysToRemove) {
|
|
|
3842
3893
|
function isGroup(rawNode) {
|
|
3843
3894
|
return rawNode?.type === "group";
|
|
3844
3895
|
}
|
|
3845
|
-
|
|
3846
|
-
//#region src/components/tree-shared/check.ts
|
|
3896
|
+
// src/components/tree-shared/check.ts
|
|
3847
3897
|
/*!
|
|
3848
3898
|
* 移植自 treemate v0.3.11 —— https://github.com/07akioni/treemate
|
|
3849
3899
|
* MIT License · Copyright (c) 07akioni
|
|
@@ -4011,8 +4061,7 @@ function getExtendedCheckedKeySet(checkedKeys, treeMate, isUnchecking = false) {
|
|
|
4011
4061
|
});
|
|
4012
4062
|
return extendedKeySet;
|
|
4013
4063
|
}
|
|
4014
|
-
|
|
4015
|
-
//#region src/components/tree-shared/path.ts
|
|
4064
|
+
// src/components/tree-shared/path.ts
|
|
4016
4065
|
/*!
|
|
4017
4066
|
* 移植自 treemate v0.3.11 —— https://github.com/07akioni/treemate
|
|
4018
4067
|
* MIT License · Copyright (c) 07akioni
|
|
@@ -4049,8 +4098,7 @@ function getPath(key, { includeGroup = false, includeSelf = true }, treeMate) {
|
|
|
4049
4098
|
mergedPath.keyPath = mergedPath.treeNodePath.map((treeNode) => treeNode.key);
|
|
4050
4099
|
return mergedPath;
|
|
4051
4100
|
}
|
|
4052
|
-
|
|
4053
|
-
//#region src/components/tree-shared/move.ts
|
|
4101
|
+
// src/components/tree-shared/move.ts
|
|
4054
4102
|
/*!
|
|
4055
4103
|
* 移植自 treemate v0.3.11 —— https://github.com/07akioni/treemate
|
|
4056
4104
|
* MIT License · Copyright (c) 07akioni
|
|
@@ -4201,8 +4249,7 @@ const moveMethods = {
|
|
|
4201
4249
|
return move(this, "prev", options);
|
|
4202
4250
|
}
|
|
4203
4251
|
};
|
|
4204
|
-
|
|
4205
|
-
//#region src/components/tree-shared/flatten.ts
|
|
4252
|
+
// src/components/tree-shared/flatten.ts
|
|
4206
4253
|
/*!
|
|
4207
4254
|
* 移植自 treemate v0.3.11 —— https://github.com/07akioni/treemate
|
|
4208
4255
|
* MIT License · Copyright (c) 07akioni
|
|
@@ -4234,8 +4281,7 @@ function flatten(treeNodes, expandedKeys) {
|
|
|
4234
4281
|
traverse(treeNodes);
|
|
4235
4282
|
return flattenedNodes;
|
|
4236
4283
|
}
|
|
4237
|
-
|
|
4238
|
-
//#region src/components/tree-shared/contains.ts
|
|
4284
|
+
// src/components/tree-shared/contains.ts
|
|
4239
4285
|
/*!
|
|
4240
4286
|
* 移植自 treemate v0.3.11 —— https://github.com/07akioni/treemate
|
|
4241
4287
|
* MIT License · Copyright (c) 07akioni
|
|
@@ -4255,8 +4301,7 @@ function contains(parent, child) {
|
|
|
4255
4301
|
}
|
|
4256
4302
|
return false;
|
|
4257
4303
|
}
|
|
4258
|
-
|
|
4259
|
-
//#region src/components/tree-shared/create.ts
|
|
4304
|
+
// src/components/tree-shared/create.ts
|
|
4260
4305
|
/*!
|
|
4261
4306
|
* 移植自 treemate v0.3.11 —— https://github.com/07akioni/treemate
|
|
4262
4307
|
* MIT License · Copyright (c) 07akioni
|
|
@@ -4431,8 +4476,7 @@ function createTreeMate(rawNodes, options = {}) {
|
|
|
4431
4476
|
};
|
|
4432
4477
|
return treemate;
|
|
4433
4478
|
}
|
|
4434
|
-
|
|
4435
|
-
//#region src/components/tree-shared/keyboard.ts
|
|
4479
|
+
// src/components/tree-shared/keyboard.ts
|
|
4436
4480
|
/*!
|
|
4437
4481
|
* 树形键盘游标移动(本仓库自研,供 TreeSelect / Cascader 面板共用)。
|
|
4438
4482
|
*/
|
|
@@ -4468,8 +4512,7 @@ function nextActiveKey(flattened, activeKey, key, options) {
|
|
|
4468
4512
|
}
|
|
4469
4513
|
}
|
|
4470
4514
|
}
|
|
4471
|
-
|
|
4472
|
-
//#region src/components/cascader/CascaderPanel.vue
|
|
4515
|
+
// src/components/cascader/CascaderPanel.vue
|
|
4473
4516
|
const _hoisted_1$18 = ["aria-label"];
|
|
4474
4517
|
const _hoisted_2$14 = [
|
|
4475
4518
|
"data-key",
|
|
@@ -4506,7 +4549,7 @@ const _hoisted_7$4 = {
|
|
|
4506
4549
|
key: 0,
|
|
4507
4550
|
class: "px-3 py-1.5 text-sm text-muted-foreground"
|
|
4508
4551
|
};
|
|
4509
|
-
const _sfc_main$
|
|
4552
|
+
const _sfc_main$58 = /*@__PURE__*/ defineComponent({
|
|
4510
4553
|
__name: "CascaderPanel",
|
|
4511
4554
|
props: {
|
|
4512
4555
|
/** 列数据:columns[0] 为根层,后续每列为展开路径的子层 */
|
|
@@ -4618,8 +4661,7 @@ const _sfc_main$57 = /*@__PURE__*/ defineComponent({
|
|
|
4618
4661
|
};
|
|
4619
4662
|
}
|
|
4620
4663
|
});
|
|
4621
|
-
|
|
4622
|
-
//#region src/components/cascader/Cascader.vue
|
|
4664
|
+
// src/components/cascader/Cascader.vue
|
|
4623
4665
|
const _hoisted_1$17 = ["aria-expanded", "aria-disabled"];
|
|
4624
4666
|
const _hoisted_2$13 = {
|
|
4625
4667
|
key: 1,
|
|
@@ -4793,7 +4835,8 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4793
4835
|
}
|
|
4794
4836
|
});
|
|
4795
4837
|
const teleportTarget = useSandboxTeleportTarget(() => void 0);
|
|
4796
|
-
const
|
|
4838
|
+
const tuProvider = useTuProvider();
|
|
4839
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }, tuProvider));
|
|
4797
4840
|
function openFromInput() {
|
|
4798
4841
|
if (props.disabled || isOpen.value) return;
|
|
4799
4842
|
syncPanelWidth();
|
|
@@ -4967,7 +5010,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4967
5010
|
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),
|
|
4968
5011
|
onClick: openFromInput,
|
|
4969
5012
|
onKeydown: handleKeydown
|
|
4970
|
-
}), [isMulti.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [tags.value.length ? (openBlock(), createBlock(_sfc_main$
|
|
5013
|
+
}), [isMulti.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [tags.value.length ? (openBlock(), createBlock(_sfc_main$59, {
|
|
4971
5014
|
key: 0,
|
|
4972
5015
|
values: tags.value,
|
|
4973
5016
|
"max-tag-count": props.maxTagCount,
|
|
@@ -4992,7 +5035,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
4992
5035
|
style: normalizeStyle({ minWidth: panelMinWidth.value }),
|
|
4993
5036
|
onKeydown: handleKeydown
|
|
4994
5037
|
}, {
|
|
4995
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
5038
|
+
default: withCtx(() => [createVNode(_sfc_main$58, {
|
|
4996
5039
|
columns: columns.value,
|
|
4997
5040
|
"expand-trigger": props.expandTrigger,
|
|
4998
5041
|
"selected-keys": isMulti.value ? selectedKeys.value : [],
|
|
@@ -5027,8 +5070,7 @@ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
|
|
|
5027
5070
|
};
|
|
5028
5071
|
}
|
|
5029
5072
|
});
|
|
5030
|
-
|
|
5031
|
-
//#region src/components/tree-select/TreePanel.vue
|
|
5073
|
+
// src/components/tree-select/TreePanel.vue
|
|
5032
5074
|
const _hoisted_1$16 = [
|
|
5033
5075
|
"aria-level",
|
|
5034
5076
|
"aria-selected",
|
|
@@ -5072,7 +5114,7 @@ const _hoisted_8$1 = {
|
|
|
5072
5114
|
key: 0,
|
|
5073
5115
|
class: "px-2 py-6 text-center text-sm text-muted-foreground"
|
|
5074
5116
|
};
|
|
5075
|
-
const _sfc_main$
|
|
5117
|
+
const _sfc_main$57 = /*@__PURE__*/ defineComponent({
|
|
5076
5118
|
__name: "TreePanel",
|
|
5077
5119
|
props: {
|
|
5078
5120
|
/** 展开态扁平化的可见节点序列(来自 treeMate.getFlattenedNodes(expandedKeys)) */
|
|
@@ -5180,8 +5222,7 @@ const _sfc_main$56 = /*@__PURE__*/ defineComponent({
|
|
|
5180
5222
|
};
|
|
5181
5223
|
}
|
|
5182
5224
|
});
|
|
5183
|
-
|
|
5184
|
-
//#region src/components/tree-select/TreeSelect.vue
|
|
5225
|
+
// src/components/tree-select/TreeSelect.vue
|
|
5185
5226
|
const _hoisted_1$15 = ["aria-expanded", "aria-disabled"];
|
|
5186
5227
|
const _hoisted_2$11 = ["placeholder", "aria-label"];
|
|
5187
5228
|
const _hoisted_3$7 = {
|
|
@@ -5432,7 +5473,8 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
5432
5473
|
}
|
|
5433
5474
|
});
|
|
5434
5475
|
const teleportTarget = useSandboxTeleportTarget(() => void 0);
|
|
5435
|
-
const
|
|
5476
|
+
const tuProvider = useTuProvider();
|
|
5477
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }, tuProvider));
|
|
5436
5478
|
function openFromInput() {
|
|
5437
5479
|
if (props.disabled || isOpen.value) return;
|
|
5438
5480
|
syncPanelWidth();
|
|
@@ -5546,7 +5588,7 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
5546
5588
|
onClick: openFromInput,
|
|
5547
5589
|
onKeydown: handleKeydown
|
|
5548
5590
|
}), [isMulti.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
5549
|
-
tags.value.length ? (openBlock(), createBlock(_sfc_main$
|
|
5591
|
+
tags.value.length ? (openBlock(), createBlock(_sfc_main$59, {
|
|
5550
5592
|
key: 0,
|
|
5551
5593
|
values: tags.value,
|
|
5552
5594
|
"max-tag-count": props.maxTagCount,
|
|
@@ -5592,7 +5634,7 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
5592
5634
|
style: normalizeStyle({ minWidth: panelMinWidth.value }),
|
|
5593
5635
|
onKeydown: handleKeydown
|
|
5594
5636
|
}, {
|
|
5595
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
5637
|
+
default: withCtx(() => [createVNode(_sfc_main$57, {
|
|
5596
5638
|
nodes: filteredNodes.value,
|
|
5597
5639
|
"selected-keys": selectedKeys.value,
|
|
5598
5640
|
"expanded-keys": expandedKeys.value,
|
|
@@ -5626,8 +5668,7 @@ const _sfc_main$50 = /*@__PURE__*/ defineComponent({
|
|
|
5626
5668
|
};
|
|
5627
5669
|
}
|
|
5628
5670
|
});
|
|
5629
|
-
|
|
5630
|
-
//#region src/components/form-render/widgets/tree.ts
|
|
5671
|
+
// src/components/form-render/widgets/tree.ts
|
|
5631
5672
|
/**
|
|
5632
5673
|
* treeSelect widget:树形下拉选择,options 原名直传(TreeOption 命名穿透),
|
|
5633
5674
|
* placeholder 先用 item 级回退,options.placeholder 展开时覆盖。
|
|
@@ -5658,8 +5699,7 @@ function renderCascaderItem(options) {
|
|
|
5658
5699
|
...ctx.item.componentProps
|
|
5659
5700
|
});
|
|
5660
5701
|
}
|
|
5661
|
-
|
|
5662
|
-
//#region src/components/form-render/widgets/index.ts
|
|
5702
|
+
// src/components/form-render/widgets/index.ts
|
|
5663
5703
|
/**
|
|
5664
5704
|
* widget 注册表:`r.input({...})` 等柯里化工厂的运行时对象。
|
|
5665
5705
|
* 文件按绑定形态聚合:input / model-value(modelValue 系)/ boolean(checked 系)/
|
|
@@ -5688,8 +5728,7 @@ function widgetRenders() {
|
|
|
5688
5728
|
render: (fn) => fn
|
|
5689
5729
|
};
|
|
5690
5730
|
}
|
|
5691
|
-
|
|
5692
|
-
//#region src/components/form-render/FormRender.vue
|
|
5731
|
+
// src/components/form-render/FormRender.vue
|
|
5693
5732
|
const _hoisted_1$14 = {
|
|
5694
5733
|
key: 0,
|
|
5695
5734
|
class: "col-span-full flex justify-end gap-2"
|
|
@@ -5797,7 +5836,7 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5797
5836
|
return openBlock(), createElementBlock("div", {
|
|
5798
5837
|
key: String(item.key),
|
|
5799
5838
|
style: normalizeStyle(spanStyle(item.span))
|
|
5800
|
-
}, [createVNode(_sfc_main$
|
|
5839
|
+
}, [createVNode(_sfc_main$66, {
|
|
5801
5840
|
item,
|
|
5802
5841
|
widget: widgetOf(item),
|
|
5803
5842
|
values: unref(valuesRef)
|
|
@@ -5841,8 +5880,7 @@ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
|
|
|
5841
5880
|
};
|
|
5842
5881
|
}
|
|
5843
5882
|
});
|
|
5844
|
-
|
|
5845
|
-
//#region src/components/form-render/useFormRender.ts
|
|
5883
|
+
// src/components/form-render/useFormRender.ts
|
|
5846
5884
|
/**
|
|
5847
5885
|
* 底层原语:包装 TanStack useForm(聚合入口 defineForm 内部也走这里)。
|
|
5848
5886
|
*
|
|
@@ -5882,8 +5920,7 @@ function useFormRender(options) {
|
|
|
5882
5920
|
actions
|
|
5883
5921
|
};
|
|
5884
5922
|
}
|
|
5885
|
-
|
|
5886
|
-
//#region src/components/form-render/define-form.ts
|
|
5923
|
+
// src/components/form-render/define-form.ts
|
|
5887
5924
|
/**
|
|
5888
5925
|
* 聚合入口:单次调用完成「字段定义 + 类型约束 + 表单实例 + 按钮预设」。
|
|
5889
5926
|
*
|
|
@@ -5901,8 +5938,7 @@ function useFormRender(options) {
|
|
|
5901
5938
|
function defineForm(config) {
|
|
5902
5939
|
return useFormRender(config);
|
|
5903
5940
|
}
|
|
5904
|
-
|
|
5905
|
-
//#region src/components/avatar/Avatar.vue
|
|
5941
|
+
// src/components/avatar/Avatar.vue
|
|
5906
5942
|
const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
5907
5943
|
__name: "Avatar",
|
|
5908
5944
|
props: {
|
|
@@ -5977,8 +6013,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
5977
6013
|
};
|
|
5978
6014
|
}
|
|
5979
6015
|
});
|
|
5980
|
-
|
|
5981
|
-
//#region src/components/avatar/index.ts
|
|
6016
|
+
// src/components/avatar/index.ts
|
|
5982
6017
|
const avatarVariants = cva("inline-flex shrink-0 overflow-hidden bg-muted", { variants: {
|
|
5983
6018
|
size: {
|
|
5984
6019
|
xs: "size-6 text-[10px]",
|
|
@@ -5992,8 +6027,7 @@ const avatarVariants = cva("inline-flex shrink-0 overflow-hidden bg-muted", { va
|
|
|
5992
6027
|
}
|
|
5993
6028
|
} });
|
|
5994
6029
|
const avatarGroupKey = Symbol("tu-avatar-group");
|
|
5995
|
-
|
|
5996
|
-
//#region src/components/avatar-group/AvatarGroup.vue
|
|
6030
|
+
// src/components/avatar-group/AvatarGroup.vue
|
|
5997
6031
|
const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
5998
6032
|
__name: "AvatarGroup",
|
|
5999
6033
|
props: {
|
|
@@ -6043,8 +6077,7 @@ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
|
|
|
6043
6077
|
};
|
|
6044
6078
|
}
|
|
6045
6079
|
});
|
|
6046
|
-
|
|
6047
|
-
//#region src/components/badge/Badge.vue
|
|
6080
|
+
// src/components/badge/Badge.vue
|
|
6048
6081
|
const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
6049
6082
|
__name: "Badge",
|
|
6050
6083
|
props: {
|
|
@@ -6058,8 +6091,7 @@ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
|
|
|
6058
6091
|
};
|
|
6059
6092
|
}
|
|
6060
6093
|
});
|
|
6061
|
-
|
|
6062
|
-
//#region src/components/badge/index.ts
|
|
6094
|
+
// src/components/badge/index.ts
|
|
6063
6095
|
const badgeVariants = cva("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0", {
|
|
6064
6096
|
variants: { variant: {
|
|
6065
6097
|
default: "bg-primary text-primary-foreground",
|
|
@@ -6069,8 +6101,7 @@ const badgeVariants = cva("inline-flex items-center justify-center rounded-md bo
|
|
|
6069
6101
|
} },
|
|
6070
6102
|
defaultVariants: { variant: "default" }
|
|
6071
6103
|
});
|
|
6072
|
-
|
|
6073
|
-
//#region src/components/card/Card.vue
|
|
6104
|
+
// src/components/card/Card.vue
|
|
6074
6105
|
const headerClass = "grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 p-6 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]";
|
|
6075
6106
|
const titleClass = "font-semibold leading-none tracking-tight";
|
|
6076
6107
|
const descriptionClass = "text-sm text-muted-foreground";
|
|
@@ -6178,8 +6209,7 @@ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
|
|
|
6178
6209
|
};
|
|
6179
6210
|
}
|
|
6180
6211
|
});
|
|
6181
|
-
|
|
6182
|
-
//#region src/components/card/index.ts
|
|
6212
|
+
// src/components/card/index.ts
|
|
6183
6213
|
const cardVariants = cva("relative rounded-xl border border-border bg-card text-card-foreground shadow-xs", {
|
|
6184
6214
|
variants: {
|
|
6185
6215
|
size: {
|
|
@@ -6200,8 +6230,47 @@ const cardVariants = cva("relative rounded-xl border border-border bg-card text-
|
|
|
6200
6230
|
bordered: true
|
|
6201
6231
|
}
|
|
6202
6232
|
});
|
|
6203
|
-
|
|
6204
|
-
|
|
6233
|
+
// src/components/overlay-shared/useOverlayScrollLock.ts
|
|
6234
|
+
/**
|
|
6235
|
+
* overlay 滚动锁契约消费(issue #5):wujie graft 下 Ark 原生滚动锁被禁用(issue #4),
|
|
6236
|
+
* 「锁背景」改由宿主经 Provider overlay 命名空间 prop 提供 lock() → 解锁函数契约。
|
|
6237
|
+
*
|
|
6238
|
+
* 设计依据(冻结语义):
|
|
6239
|
+
* - 语义 B 拓扑闸:仅锁禁用拓扑消费契约(overlayContract 内判定,shadow-iframe 显式 /
|
|
6240
|
+
* auto 探测命中 wujie),其余拓扑 setup 顶层直接 return,零 watch 零副作用。
|
|
6241
|
+
* - RAII 配对:lock() 返回的 release 与开合状态一一对应——open 且模态时持锁,
|
|
6242
|
+
* 关闭/非模态时释放,onBeforeUnmount 补调防泄漏(打开态直接卸载不丢 release)。
|
|
6243
|
+
* - sync + immediate:flush:"sync" 使 lock/release 在 isOpen 转换内同步完成,
|
|
6244
|
+
* 无 nextTick 窗口、同 tick 快速翻转不合并(true-false-true → lock 2 次 release 1 次);
|
|
6245
|
+
* immediate 覆盖初始 open=true 的挂载即锁场景。
|
|
6246
|
+
* - isModal 仅在 isOpen 转换回调内求值,不 watch attrs:打开期间 modal 变化不触发
|
|
6247
|
+
* 锁状态变更(三组件接线 () => attrs.modal !== false && attrs.modal !== "false")。
|
|
6248
|
+
*
|
|
6249
|
+
* @param isOpen - 开合状态(受控桥 ComputedRef 或内部 ref 均可)
|
|
6250
|
+
* @param isModal - 模态判定读取器(仅转换回调内求值)
|
|
6251
|
+
*/
|
|
6252
|
+
function useOverlayScrollLock(isOpen, isModal) {
|
|
6253
|
+
const contract = overlayContract(useTuProvider());
|
|
6254
|
+
if (!contract) return;
|
|
6255
|
+
let release = null;
|
|
6256
|
+
watch(isOpen, (open) => {
|
|
6257
|
+
if (open && isModal() && !release) release = contract.lock();
|
|
6258
|
+
else if ((!open || !isModal()) && release) {
|
|
6259
|
+
release();
|
|
6260
|
+
release = null;
|
|
6261
|
+
}
|
|
6262
|
+
}, {
|
|
6263
|
+
immediate: true,
|
|
6264
|
+
flush: "sync"
|
|
6265
|
+
});
|
|
6266
|
+
onBeforeUnmount(() => {
|
|
6267
|
+
if (release) {
|
|
6268
|
+
release();
|
|
6269
|
+
release = null;
|
|
6270
|
+
}
|
|
6271
|
+
});
|
|
6272
|
+
}
|
|
6273
|
+
// src/components/dialog/Dialog.vue
|
|
6205
6274
|
const _hoisted_1$13 = {
|
|
6206
6275
|
key: 0,
|
|
6207
6276
|
class: "flex flex-col gap-2 text-center sm:text-left"
|
|
@@ -6256,7 +6325,8 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
6256
6325
|
},
|
|
6257
6326
|
emits: ["update:open"],
|
|
6258
6327
|
setup(__props, { emit: __emit }) {
|
|
6259
|
-
const
|
|
6328
|
+
const attrs = useAttrs();
|
|
6329
|
+
const { ids: rootIds } = useOverlayIds(attrs, {
|
|
6260
6330
|
primary: "content",
|
|
6261
6331
|
parts: [
|
|
6262
6332
|
"content",
|
|
@@ -6275,17 +6345,20 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
6275
6345
|
defaultValue: () => props.defaultOpen,
|
|
6276
6346
|
onChange: (open) => emit("update:open", open)
|
|
6277
6347
|
});
|
|
6348
|
+
useOverlayScrollLock(isOpen, () => attrs.modal !== false && attrs.modal !== "false");
|
|
6278
6349
|
/** 关闭对话框(#footer 作用域插槽注入):走受控桥把 open 置 false,
|
|
6279
6350
|
* 与原 TDialogClose(Ark CloseTrigger)的关闭语义等价,退出动画/焦点还原由 zag 处理 */
|
|
6280
6351
|
function close() {
|
|
6281
6352
|
setOpen(false);
|
|
6282
6353
|
}
|
|
6283
6354
|
const hasHeader = computed(() => Boolean(props.title || props.description));
|
|
6284
|
-
const
|
|
6355
|
+
const preventScroll = overlayPreventScroll();
|
|
6356
|
+
const contentClass = computed(() => cn("bg-dialog text-dialog-foreground data-[state=open]:animate-in data-[state=closed]:animate-out fixed left-1/2 top-1/2 z-[var(--z-modal,60)] grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:max-w-lg", props.contentClass));
|
|
6285
6357
|
return (_ctx, _cache) => {
|
|
6286
6358
|
return openBlock(), createBlock(unref(Dialog).Root, {
|
|
6287
6359
|
ids: unref(rootIds),
|
|
6288
6360
|
open: unref(isOpen),
|
|
6361
|
+
"prevent-scroll": unref(preventScroll),
|
|
6289
6362
|
"lazy-mount": props.lazyMount,
|
|
6290
6363
|
"unmount-on-exit": props.unmountOnExit,
|
|
6291
6364
|
"onUpdate:open": unref(setOpen)
|
|
@@ -6338,6 +6411,7 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
6338
6411
|
}, 8, [
|
|
6339
6412
|
"ids",
|
|
6340
6413
|
"open",
|
|
6414
|
+
"prevent-scroll",
|
|
6341
6415
|
"lazy-mount",
|
|
6342
6416
|
"unmount-on-exit",
|
|
6343
6417
|
"onUpdate:open"
|
|
@@ -6345,13 +6419,12 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
6345
6419
|
};
|
|
6346
6420
|
}
|
|
6347
6421
|
});
|
|
6348
|
-
|
|
6349
|
-
//#region src/components/dropdown-menu/MenuItems.vue
|
|
6422
|
+
// src/components/dropdown-menu/MenuItems.vue
|
|
6350
6423
|
/** 当前层级要渲染的菜单项描述列表 */
|
|
6351
6424
|
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";
|
|
6352
6425
|
const labelCls = "px-2 py-1.5 text-sm font-medium";
|
|
6353
6426
|
const separatorCls = "-mx-1 my-1 h-px bg-muted";
|
|
6354
|
-
const _sfc_main$
|
|
6427
|
+
const _sfc_main$56 = /*@__PURE__*/ defineComponent({
|
|
6355
6428
|
__name: "MenuItems",
|
|
6356
6429
|
props: { items: {} },
|
|
6357
6430
|
setup(__props) {
|
|
@@ -6393,8 +6466,7 @@ const _sfc_main$55 = /*@__PURE__*/ defineComponent({
|
|
|
6393
6466
|
};
|
|
6394
6467
|
}
|
|
6395
6468
|
});
|
|
6396
|
-
|
|
6397
|
-
//#region src/components/dropdown-menu/DropdownMenu.vue
|
|
6469
|
+
// src/components/dropdown-menu/DropdownMenu.vue
|
|
6398
6470
|
const contentCls$1 = "bg-popover text-popover-foreground z-[var(--z-overlay)] min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95";
|
|
6399
6471
|
const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
6400
6472
|
name: "DropdownMenu",
|
|
@@ -6451,7 +6523,8 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
6451
6523
|
defaultValue: () => props.defaultOpen,
|
|
6452
6524
|
onChange: (open) => emit("update:open", open)
|
|
6453
6525
|
});
|
|
6454
|
-
const
|
|
6526
|
+
const tuProvider = useTuProvider();
|
|
6527
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }, tuProvider));
|
|
6455
6528
|
function handleSelect(details) {
|
|
6456
6529
|
emit("select", details);
|
|
6457
6530
|
}
|
|
@@ -6475,7 +6548,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
6475
6548
|
}, 8, ["class"]),
|
|
6476
6549
|
createVNode(unref(Menu).Positioner, { class: "z-[var(--z-overlay)]" }, {
|
|
6477
6550
|
default: withCtx(() => [createVNode(unref(Menu).Content, mergeProps(unref(attrs), { class: unref(cn)(contentCls$1, props.contentClass) }), {
|
|
6478
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
6551
|
+
default: withCtx(() => [createVNode(_sfc_main$56, { items: props.items }, createSlots({ _: 2 }, [_ctx.$slots.item ? {
|
|
6479
6552
|
name: "item",
|
|
6480
6553
|
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps(slotProps)))]),
|
|
6481
6554
|
key: "0"
|
|
@@ -6496,8 +6569,7 @@ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
|
|
|
6496
6569
|
};
|
|
6497
6570
|
}
|
|
6498
6571
|
});
|
|
6499
|
-
|
|
6500
|
-
//#region src/components/label/Label.vue
|
|
6572
|
+
// src/components/label/Label.vue
|
|
6501
6573
|
const _sfc_main$28 = /*@__PURE__*/ defineComponent({
|
|
6502
6574
|
__name: "Label",
|
|
6503
6575
|
props: { class: {} },
|
|
@@ -6508,8 +6580,7 @@ const _sfc_main$28 = /*@__PURE__*/ defineComponent({
|
|
|
6508
6580
|
};
|
|
6509
6581
|
}
|
|
6510
6582
|
});
|
|
6511
|
-
|
|
6512
|
-
//#region src/components/pin-input/PinInput.vue
|
|
6583
|
+
// src/components/pin-input/PinInput.vue
|
|
6513
6584
|
const _sfc_main$32 = /*@__PURE__*/ defineComponent({
|
|
6514
6585
|
inheritAttrs: false,
|
|
6515
6586
|
__name: "PinInput",
|
|
@@ -6612,8 +6683,7 @@ const _sfc_main$32 = /*@__PURE__*/ defineComponent({
|
|
|
6612
6683
|
};
|
|
6613
6684
|
}
|
|
6614
6685
|
});
|
|
6615
|
-
|
|
6616
|
-
//#region src/components/popover/Popover.vue
|
|
6686
|
+
// src/components/popover/Popover.vue
|
|
6617
6687
|
const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
6618
6688
|
inheritAttrs: false,
|
|
6619
6689
|
__name: "Popover",
|
|
@@ -6783,6 +6853,7 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
6783
6853
|
schedule(false, props.closeDelay);
|
|
6784
6854
|
};
|
|
6785
6855
|
onBeforeUnmount(clearTimer);
|
|
6856
|
+
const tuProvider = useTuProvider();
|
|
6786
6857
|
const rootPositioning = computed(() => {
|
|
6787
6858
|
const user = attrs.positioning ?? {};
|
|
6788
6859
|
const placement = props.align === "center" ? props.side : `${props.side}-${props.align}`;
|
|
@@ -6790,7 +6861,7 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
6790
6861
|
...user,
|
|
6791
6862
|
placement,
|
|
6792
6863
|
sameWidth: props.matchTriggerWidth || user.sameWidth
|
|
6793
|
-
});
|
|
6864
|
+
}, tuProvider);
|
|
6794
6865
|
});
|
|
6795
6866
|
const contentClass = computed(() => cn("bg-popover text-popover-foreground z-[var(--z-modal,60)] 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"]));
|
|
6796
6867
|
const arrowClass = computed(() => cn("[--arrow-size:10px] [--arrow-background:var(--popover)]", props.arrowClass));
|
|
@@ -6866,8 +6937,7 @@ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
|
|
|
6866
6937
|
};
|
|
6867
6938
|
}
|
|
6868
6939
|
});
|
|
6869
|
-
|
|
6870
|
-
//#region src/components/separator/Separator.vue
|
|
6940
|
+
// src/components/separator/Separator.vue
|
|
6871
6941
|
const _hoisted_1$12 = ["data-orientation"];
|
|
6872
6942
|
const _sfc_main$38 = /*@__PURE__*/ defineComponent({
|
|
6873
6943
|
__name: "Separator",
|
|
@@ -6886,8 +6956,7 @@ const _sfc_main$38 = /*@__PURE__*/ defineComponent({
|
|
|
6886
6956
|
};
|
|
6887
6957
|
}
|
|
6888
6958
|
});
|
|
6889
|
-
|
|
6890
|
-
//#region src/components/skeleton/Skeleton.vue
|
|
6959
|
+
// src/components/skeleton/Skeleton.vue
|
|
6891
6960
|
const _sfc_main$39 = /*@__PURE__*/ defineComponent({
|
|
6892
6961
|
__name: "Skeleton",
|
|
6893
6962
|
props: { class: {} },
|
|
@@ -6901,8 +6970,7 @@ const _sfc_main$39 = /*@__PURE__*/ defineComponent({
|
|
|
6901
6970
|
};
|
|
6902
6971
|
}
|
|
6903
6972
|
});
|
|
6904
|
-
|
|
6905
|
-
//#region src/components/table-render/TablePagination.vue
|
|
6973
|
+
// src/components/table-render/TablePagination.vue
|
|
6906
6974
|
const _hoisted_1$11 = {
|
|
6907
6975
|
key: 0,
|
|
6908
6976
|
class: "flex items-center gap-2 text-muted-foreground"
|
|
@@ -7098,8 +7166,7 @@ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
|
|
|
7098
7166
|
};
|
|
7099
7167
|
}
|
|
7100
7168
|
});
|
|
7101
|
-
|
|
7102
|
-
//#region src/components/overlay-shared/useConfirmPending.ts
|
|
7169
|
+
// src/components/overlay-shared/useConfirmPending.ts
|
|
7103
7170
|
/**
|
|
7104
7171
|
* 确认弹层公共 pending 语义:@confirm 处理器返回 Promise 时锁定关闭通道,
|
|
7105
7172
|
* resolve 后自动关闭,reject 保持打开并退出 loading;同步处理器直接关闭。
|
|
@@ -7134,8 +7201,7 @@ function useConfirmPending(options) {
|
|
|
7134
7201
|
handleCancel
|
|
7135
7202
|
};
|
|
7136
7203
|
}
|
|
7137
|
-
|
|
7138
|
-
//#region src/components/popconfirm/Popconfirm.vue
|
|
7204
|
+
// src/components/popconfirm/Popconfirm.vue
|
|
7139
7205
|
const _hoisted_1$10 = { class: "mt-3 flex items-center justify-end gap-2" };
|
|
7140
7206
|
const _hoisted_2$8 = {
|
|
7141
7207
|
key: 0,
|
|
@@ -7263,8 +7329,7 @@ const _sfc_main$33 = /*@__PURE__*/ defineComponent({
|
|
|
7263
7329
|
};
|
|
7264
7330
|
}
|
|
7265
7331
|
});
|
|
7266
|
-
|
|
7267
|
-
//#region src/components/table-render/column-renders.ts
|
|
7332
|
+
// src/components/table-render/column-renders.ts
|
|
7268
7333
|
/**
|
|
7269
7334
|
* 两位补零
|
|
7270
7335
|
* @param value - 数字(月/日/时/分/秒)
|
|
@@ -7475,8 +7540,7 @@ function columnRenders() {
|
|
|
7475
7540
|
}
|
|
7476
7541
|
};
|
|
7477
7542
|
}
|
|
7478
|
-
|
|
7479
|
-
//#region src/components/tooltip/Tooltip.vue
|
|
7543
|
+
// src/components/tooltip/Tooltip.vue
|
|
7480
7544
|
const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
7481
7545
|
__name: "Tooltip",
|
|
7482
7546
|
props: {
|
|
@@ -7549,7 +7613,8 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
7549
7613
|
defaultValue: () => props.defaultOpen,
|
|
7550
7614
|
onChange: (open) => emit("update:open", open)
|
|
7551
7615
|
});
|
|
7552
|
-
const
|
|
7616
|
+
const tuProvider = useTuProvider();
|
|
7617
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }, tuProvider));
|
|
7553
7618
|
return (_ctx, _cache) => {
|
|
7554
7619
|
return openBlock(), createBlock(unref(Tooltip).Root, {
|
|
7555
7620
|
ids: unref(rootIds),
|
|
@@ -7592,8 +7657,7 @@ const _sfc_main$49 = /*@__PURE__*/ defineComponent({
|
|
|
7592
7657
|
};
|
|
7593
7658
|
}
|
|
7594
7659
|
});
|
|
7595
|
-
|
|
7596
|
-
//#region src/components/table-render/columns.ts
|
|
7660
|
+
// src/components/table-render/columns.ts
|
|
7597
7661
|
/**
|
|
7598
7662
|
* 列节点工具:分组判别与叶子扁平化(多级表头支撑)。
|
|
7599
7663
|
*
|
|
@@ -7623,16 +7687,27 @@ function flattenColumns(nodes) {
|
|
|
7623
7687
|
walk(nodes);
|
|
7624
7688
|
return leaves;
|
|
7625
7689
|
}
|
|
7626
|
-
|
|
7627
|
-
//#region src/components/table-render/constants.ts
|
|
7690
|
+
// src/components/table-render/constants.ts
|
|
7628
7691
|
/** 选择列在 sticky 映射中的哨兵键(选择列不在 columns 内,表头/表体单独渲染) */
|
|
7629
7692
|
const SELECTION_CELL = "__selection__";
|
|
7630
7693
|
/** 拖拽把手列在 sticky 映射中的哨兵键(同选择列:不在 columns 内,表头/表体单独渲染) */
|
|
7631
7694
|
const DRAG_CELL = "__drag__";
|
|
7632
7695
|
/** 布局容器与 TableRender 的跨包填充协议 key:provide(true) 声明容器内 TableRender 应填满、内部滚动、表头固定 */
|
|
7633
7696
|
const PAGE_TABLE_FILL_KEY = "tu-design:page-table-fill";
|
|
7634
|
-
|
|
7635
|
-
|
|
7697
|
+
/**
|
|
7698
|
+
* TanStack v9 特性装配(模块级静态,跨实例共享稳定引用):行选择 + 排序 + 分页 + 树形展开。
|
|
7699
|
+
* row model 槽位须排在其前置特性之后(v9 tableFeatures 的校验规则)。
|
|
7700
|
+
*/
|
|
7701
|
+
const TABLE_FEATURES = tableFeatures({
|
|
7702
|
+
rowSelectionFeature,
|
|
7703
|
+
rowSortingFeature,
|
|
7704
|
+
rowPaginationFeature,
|
|
7705
|
+
rowExpandingFeature,
|
|
7706
|
+
sortedRowModel: createSortedRowModel(),
|
|
7707
|
+
paginatedRowModel: createPaginatedRowModel(),
|
|
7708
|
+
expandedRowModel: createExpandedRowModel()
|
|
7709
|
+
});
|
|
7710
|
+
// src/components/table-render/sticky.ts
|
|
7636
7711
|
/**
|
|
7637
7712
|
* sticky 定位样式;head 为 true 时 z-index 高于表体(表头压住表体 sticky)
|
|
7638
7713
|
* @param sticky - 列 key → sticky 信息的映射
|
|
@@ -7664,9 +7739,8 @@ function stickyClass(sticky, key) {
|
|
|
7664
7739
|
info.side === "right" && info.edge ? "border-l border-border" : ""
|
|
7665
7740
|
];
|
|
7666
7741
|
}
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
const _sfc_main$54 = {};
|
|
7742
|
+
// src/components/icon-shared/GripIcon.vue
|
|
7743
|
+
const _sfc_main$55 = {};
|
|
7670
7744
|
const _hoisted_1$9 = {
|
|
7671
7745
|
viewBox: "0 0 24 24",
|
|
7672
7746
|
fill: "none",
|
|
@@ -7679,9 +7753,8 @@ const _hoisted_1$9 = {
|
|
|
7679
7753
|
function _sfc_render(_ctx, _cache) {
|
|
7680
7754
|
return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [createStaticVNode("<circle cx=\"9\" cy=\"12\" r=\"1\"></circle><circle cx=\"9\" cy=\"5\" r=\"1\"></circle><circle cx=\"9\" cy=\"19\" r=\"1\"></circle><circle cx=\"15\" cy=\"12\" r=\"1\"></circle><circle cx=\"15\" cy=\"5\" r=\"1\"></circle><circle cx=\"15\" cy=\"19\" r=\"1\"></circle>", 6)])]);
|
|
7681
7755
|
}
|
|
7682
|
-
var GripIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$
|
|
7683
|
-
|
|
7684
|
-
//#region src/components/table-render/TableBodyRow.vue
|
|
7756
|
+
var GripIcon_default = /*#__PURE__*/ export_helper_default(_sfc_main$55, [["render", _sfc_render]]);
|
|
7757
|
+
// src/components/table-render/TableBodyRow.vue
|
|
7685
7758
|
const _hoisted_1$8 = [
|
|
7686
7759
|
"checked",
|
|
7687
7760
|
"disabled",
|
|
@@ -7698,7 +7771,7 @@ const _hoisted_5$2 = {
|
|
|
7698
7771
|
key: 2,
|
|
7699
7772
|
class: "min-w-0 truncate"
|
|
7700
7773
|
};
|
|
7701
|
-
const _sfc_main$
|
|
7774
|
+
const _sfc_main$54 = /*@__PURE__*/ defineComponent({
|
|
7702
7775
|
__name: "TableBodyRow",
|
|
7703
7776
|
props: {
|
|
7704
7777
|
/** 表体行数据(cells 值矩阵已由父层按可见列计算) */
|
|
@@ -7855,8 +7928,7 @@ const _sfc_main$53 = /*@__PURE__*/ defineComponent({
|
|
|
7855
7928
|
};
|
|
7856
7929
|
}
|
|
7857
7930
|
});
|
|
7858
|
-
|
|
7859
|
-
//#region src/components/table-render/useTableRender.ts
|
|
7931
|
+
// src/components/table-render/useTableRender.ts
|
|
7860
7932
|
const DEFAULT_PAGE_SIZE_OPTS = [
|
|
7861
7933
|
10,
|
|
7862
7934
|
20,
|
|
@@ -8025,16 +8097,16 @@ function useTableRender(options) {
|
|
|
8025
8097
|
}
|
|
8026
8098
|
if (selectedKeys.value.size > 0) selectionEmitSafe();
|
|
8027
8099
|
}
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8100
|
+
syncData();
|
|
8101
|
+
const selectionSlice = computed(() => ({ rowSelection: rowSelectionState.value }));
|
|
8102
|
+
const table = useTable({
|
|
8103
|
+
features: TABLE_FEATURES,
|
|
8104
|
+
data: rows,
|
|
8032
8105
|
getRowId: (originalRow, index) => rowIdOf(originalRow, index),
|
|
8033
8106
|
getSubRows: (originalRow) => {
|
|
8034
8107
|
const children = originalRow[childrenKey];
|
|
8035
8108
|
return Array.isArray(children) ? children : [];
|
|
8036
8109
|
},
|
|
8037
|
-
getExpandedRowModel: getExpandedRowModel(),
|
|
8038
8110
|
columns: columns.map((column) => ({
|
|
8039
8111
|
accessorKey: column.key,
|
|
8040
8112
|
header: column.title,
|
|
@@ -8051,14 +8123,9 @@ function useTableRender(options) {
|
|
|
8051
8123
|
},
|
|
8052
8124
|
expanded: tree?.defaultExpandAll === true ? true : {}
|
|
8053
8125
|
},
|
|
8054
|
-
getCoreRowModel: getCoreRowModel(),
|
|
8055
|
-
getPaginationRowModel: getPaginationRowModel(),
|
|
8056
|
-
getSortedRowModel: getSortedRowModel(),
|
|
8057
8126
|
manualPagination: serverMode,
|
|
8058
8127
|
manualSorting: serverMode,
|
|
8059
|
-
|
|
8060
|
-
return { rowSelection: rowSelectionState.value };
|
|
8061
|
-
},
|
|
8128
|
+
state: selectionSlice,
|
|
8062
8129
|
enableRowSelection: selectionConfig?.selectable ? (row) => selectionConfig.selectable(row.original) : selectionConfig !== void 0,
|
|
8063
8130
|
enableMultiRowSelection: selectionConfig?.type !== "radio",
|
|
8064
8131
|
onRowSelectionChange: (updater) => {
|
|
@@ -8068,12 +8135,12 @@ function useTableRender(options) {
|
|
|
8068
8135
|
applyRowSelection(next);
|
|
8069
8136
|
}
|
|
8070
8137
|
});
|
|
8071
|
-
watch(() => table.
|
|
8138
|
+
watch(() => table.atoms.pagination.get(), (pagination) => {
|
|
8072
8139
|
if (page.pageIndex === pagination.pageIndex + 1 && page.pageSize === pagination.pageSize) return;
|
|
8073
8140
|
page.pageIndex = pagination.pageIndex + 1;
|
|
8074
8141
|
page.pageSize = pagination.pageSize;
|
|
8075
8142
|
}, { immediate: true });
|
|
8076
|
-
watch(() => table.
|
|
8143
|
+
watch(() => table.atoms.sorting.get(), (sorting) => {
|
|
8077
8144
|
const next = sorting[0] ? {
|
|
8078
8145
|
key: sorting[0].id,
|
|
8079
8146
|
direction: sorting[0].desc ? "desc" : "asc"
|
|
@@ -8087,7 +8154,7 @@ function useTableRender(options) {
|
|
|
8087
8154
|
rows.value = Array.isArray(data) ? [...data] : [];
|
|
8088
8155
|
page.total = rows.value.length;
|
|
8089
8156
|
}
|
|
8090
|
-
watch(() => toValue(options.data), syncData
|
|
8157
|
+
watch(() => toValue(options.data), syncData);
|
|
8091
8158
|
function setPageIndex(pageIndex) {
|
|
8092
8159
|
table.setPageIndex(Math.max(0, pageIndex - 1));
|
|
8093
8160
|
}
|
|
@@ -8353,8 +8420,7 @@ function useTableRender(options) {
|
|
|
8353
8420
|
setRowKey
|
|
8354
8421
|
};
|
|
8355
8422
|
}
|
|
8356
|
-
|
|
8357
|
-
//#region src/components/table-render/useRowDrag.ts
|
|
8423
|
+
// src/components/table-render/useRowDrag.ts
|
|
8358
8424
|
/**
|
|
8359
8425
|
* 行拖拽状态机(原生 HTML5 DnD):内部状态是唯一事实源,不读 dataTransfer
|
|
8360
8426
|
* (happy-dom 的 DragEvent 是 Event 别名、无 dataTransfer,测试直接派发普通 Event)。
|
|
@@ -8451,8 +8517,7 @@ function createRowSnapshot(tr) {
|
|
|
8451
8517
|
document.body.appendChild(table);
|
|
8452
8518
|
return table;
|
|
8453
8519
|
}
|
|
8454
|
-
|
|
8455
|
-
//#region src/components/table-render/TableRender.vue
|
|
8520
|
+
// src/components/table-render/TableRender.vue
|
|
8456
8521
|
const _hoisted_1$7 = { class: "flex items-center justify-end gap-3 px-3 py-2" };
|
|
8457
8522
|
const _hoisted_2$6 = ["disabled"];
|
|
8458
8523
|
const _hoisted_3$4 = { class: "max-h-64 overflow-y-auto py-1" };
|
|
@@ -8518,7 +8583,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
8518
8583
|
type: String,
|
|
8519
8584
|
required: true
|
|
8520
8585
|
},
|
|
8521
|
-
/** 拆分式:与 definition 二选一,definition
|
|
8586
|
+
/** 拆分式:与 definition 二选一,definition 优先(支持分组列节点;列泛型不约束记录形态) */
|
|
8522
8587
|
columns: { type: Array },
|
|
8523
8588
|
onLoad: { type: Function },
|
|
8524
8589
|
data: { type: Array },
|
|
@@ -8641,7 +8706,6 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
8641
8706
|
pageSize: () => props.pageSize,
|
|
8642
8707
|
sort: () => props.sort,
|
|
8643
8708
|
selectedKeys: () => props.selectedKeys,
|
|
8644
|
-
columnVisibility: props.definition?.columnVisibility,
|
|
8645
8709
|
defaultVisibleKeys: () => props.defaultVisibleKeys,
|
|
8646
8710
|
visibleKeys: () => props.visibleKeys
|
|
8647
8711
|
});
|
|
@@ -9279,7 +9343,6 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
9279
9343
|
__expose({
|
|
9280
9344
|
table: instance.table,
|
|
9281
9345
|
page: instance.page,
|
|
9282
|
-
sort: instance.sort,
|
|
9283
9346
|
loading: instance.loading,
|
|
9284
9347
|
error: instance.error,
|
|
9285
9348
|
visibleKeys: instance.visibleKeys,
|
|
@@ -9304,7 +9367,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
9304
9367
|
key: 0,
|
|
9305
9368
|
class: "min-w-0 flex-1",
|
|
9306
9369
|
definition: unref(search),
|
|
9307
|
-
searchable: unref(search)
|
|
9370
|
+
searchable: unref(search)?.actions ? void 0 : true,
|
|
9308
9371
|
onSearch,
|
|
9309
9372
|
onReset
|
|
9310
9373
|
}, null, 8, ["definition", "searchable"])) : createCommentVNode("v-if", true),
|
|
@@ -9509,7 +9572,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
9509
9572
|
class: "border-0 p-0"
|
|
9510
9573
|
}, null, 8, _hoisted_16)], 4),
|
|
9511
9574
|
(openBlock(true), createElementBlock(Fragment, null, renderList(virtualLines.value, (item) => {
|
|
9512
|
-
return openBlock(), createBlock(_sfc_main$
|
|
9575
|
+
return openBlock(), createBlock(_sfc_main$54, {
|
|
9513
9576
|
key: item.line.key,
|
|
9514
9577
|
ref_for: true,
|
|
9515
9578
|
ref: measureRow,
|
|
@@ -9562,7 +9625,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
9562
9625
|
class: "border-0 p-0"
|
|
9563
9626
|
}, null, 8, _hoisted_17)], 4)
|
|
9564
9627
|
], 64)) : (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(displayBody.value, (line) => {
|
|
9565
|
-
return openBlock(), createBlock(_sfc_main$
|
|
9628
|
+
return openBlock(), createBlock(_sfc_main$54, {
|
|
9566
9629
|
key: line.key,
|
|
9567
9630
|
line,
|
|
9568
9631
|
columns: visibleColumns.value,
|
|
@@ -9630,8 +9693,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
9630
9693
|
};
|
|
9631
9694
|
}
|
|
9632
9695
|
});
|
|
9633
|
-
|
|
9634
|
-
//#region src/components/table-render/define-columns.ts
|
|
9696
|
+
// src/components/table-render/define-columns.ts
|
|
9635
9697
|
/**
|
|
9636
9698
|
* 列定义辅助:补全泛型推导,便于把列配置抽到独立文件。
|
|
9637
9699
|
*
|
|
@@ -9642,8 +9704,7 @@ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
|
|
|
9642
9704
|
function defineColumns(columns) {
|
|
9643
9705
|
return columns;
|
|
9644
9706
|
}
|
|
9645
|
-
|
|
9646
|
-
//#region src/components/table-render/define-table.ts
|
|
9707
|
+
// src/components/table-render/define-table.ts
|
|
9647
9708
|
/**
|
|
9648
9709
|
* 聚合入口:单次调用完成「列定义 + 数据内核 + 分页排序状态 + 实例动作」。
|
|
9649
9710
|
*
|
|
@@ -9655,8 +9716,7 @@ function defineColumns(columns) {
|
|
|
9655
9716
|
function defineTable(config) {
|
|
9656
9717
|
return useTableRender(config);
|
|
9657
9718
|
}
|
|
9658
|
-
|
|
9659
|
-
//#region src/components/tabs/Tabs.vue
|
|
9719
|
+
// src/components/tabs/Tabs.vue
|
|
9660
9720
|
const _hoisted_1$6 = [
|
|
9661
9721
|
"aria-label",
|
|
9662
9722
|
"onClick",
|
|
@@ -9834,8 +9894,7 @@ const _sfc_main$45 = /*@__PURE__*/ defineComponent({
|
|
|
9834
9894
|
};
|
|
9835
9895
|
}
|
|
9836
9896
|
});
|
|
9837
|
-
|
|
9838
|
-
//#region src/components/alert/Alert.vue
|
|
9897
|
+
// src/components/alert/Alert.vue
|
|
9839
9898
|
const _hoisted_1$5 = ["role"];
|
|
9840
9899
|
const _hoisted_2$5 = ["d"];
|
|
9841
9900
|
const _hoisted_3$3 = { class: "min-w-0 flex-1" };
|
|
@@ -9910,8 +9969,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
9910
9969
|
};
|
|
9911
9970
|
}
|
|
9912
9971
|
});
|
|
9913
|
-
|
|
9914
|
-
//#region src/components/alert/index.ts
|
|
9972
|
+
// src/components/alert/index.ts
|
|
9915
9973
|
const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm flex gap-3 items-start", {
|
|
9916
9974
|
variants: { variant: {
|
|
9917
9975
|
default: "border-border bg-card text-card-foreground",
|
|
@@ -9947,8 +10005,7 @@ const alertIconPaths = {
|
|
|
9947
10005
|
warning: "M12 9v4m0 4h.01M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z",
|
|
9948
10006
|
error: "M22 12a10 10 0 1 1-20 0 10 10 0 0 1 20 0ZM15 9l-6 6m0-6 6 6"
|
|
9949
10007
|
};
|
|
9950
|
-
|
|
9951
|
-
//#region src/components/empty/Empty.vue
|
|
10008
|
+
// src/components/empty/Empty.vue
|
|
9952
10009
|
const _hoisted_1$4 = { class: "text-muted-foreground/60 [&_svg]:size-24" };
|
|
9953
10010
|
const _hoisted_2$4 = { class: "text-sm text-muted-foreground" };
|
|
9954
10011
|
const _hoisted_3$2 = {
|
|
@@ -9975,8 +10032,7 @@ const _sfc_main$17 = /*@__PURE__*/ defineComponent({
|
|
|
9975
10032
|
};
|
|
9976
10033
|
}
|
|
9977
10034
|
});
|
|
9978
|
-
|
|
9979
|
-
//#region src/components/progress/Progress.vue
|
|
10035
|
+
// src/components/progress/Progress.vue
|
|
9980
10036
|
const _sfc_main$35 = /*@__PURE__*/ defineComponent({
|
|
9981
10037
|
__name: "Progress",
|
|
9982
10038
|
props: {
|
|
@@ -10047,8 +10103,7 @@ const _sfc_main$35 = /*@__PURE__*/ defineComponent({
|
|
|
10047
10103
|
};
|
|
10048
10104
|
}
|
|
10049
10105
|
});
|
|
10050
|
-
|
|
10051
|
-
//#region src/components/spin/Spin.vue
|
|
10106
|
+
// src/components/spin/Spin.vue
|
|
10052
10107
|
const _hoisted_1$3 = ["inert"];
|
|
10053
10108
|
const _hoisted_2$3 = ["aria-busy", "aria-label"];
|
|
10054
10109
|
const _sfc_main$41 = /*@__PURE__*/ defineComponent({
|
|
@@ -10106,8 +10161,7 @@ const _sfc_main$41 = /*@__PURE__*/ defineComponent({
|
|
|
10106
10161
|
};
|
|
10107
10162
|
}
|
|
10108
10163
|
});
|
|
10109
|
-
|
|
10110
|
-
//#region src/components/toast/useToast.ts
|
|
10164
|
+
// src/components/toast/useToast.ts
|
|
10111
10165
|
/** Provider 缺省配置(与 Provider props 默认值保持一致) */
|
|
10112
10166
|
const DEFAULTS = {
|
|
10113
10167
|
placement: "bottom-end",
|
|
@@ -10116,7 +10170,8 @@ const DEFAULTS = {
|
|
|
10116
10170
|
};
|
|
10117
10171
|
let current = createToaster(DEFAULTS);
|
|
10118
10172
|
let currentConfig = { ...DEFAULTS };
|
|
10119
|
-
let
|
|
10173
|
+
let hostCount = 0;
|
|
10174
|
+
let doubleHostWarned = false;
|
|
10120
10175
|
/**
|
|
10121
10176
|
* 按 props 重建单例内部 store(ToastProvider 挂载时调用)。
|
|
10122
10177
|
* 配置未变化时复用现有 store,避免 Provider 重挂载丢弃排队中的 toast。
|
|
@@ -10135,17 +10190,25 @@ function __configureToaster(props = {}) {
|
|
|
10135
10190
|
return current;
|
|
10136
10191
|
}
|
|
10137
10192
|
/**
|
|
10138
|
-
*
|
|
10139
|
-
*
|
|
10193
|
+
* 宿主挂载/卸载计数的测试出口:true 计 +1,false 计 −1(下限 0)。
|
|
10194
|
+
* 计数 >1(双宿主并存,TuDesignProvider :toast 与 ToastProvider 同挂)时 dev 告警一次。
|
|
10195
|
+
* @param value - true 表示一个宿主挂载,false 表示一个宿主卸载
|
|
10140
10196
|
*/
|
|
10141
10197
|
function __setToastMounted(value) {
|
|
10142
|
-
|
|
10198
|
+
hostCount += value ? 1 : -1;
|
|
10199
|
+
if (hostCount <= 0) {
|
|
10200
|
+
hostCount = 0;
|
|
10201
|
+
doubleHostWarned = false;
|
|
10202
|
+
} else if (hostCount > 1 && import.meta.env.DEV && !doubleHostWarned) {
|
|
10203
|
+
doubleHostWarned = true;
|
|
10204
|
+
console.warn("[tu-design] toast 宿主重复挂载:<TuDesignProvider :toast> 与 <ToastProvider> 二选一,同时挂载时后挂载者的配置生效,请先卸载其一。");
|
|
10205
|
+
}
|
|
10143
10206
|
}
|
|
10144
10207
|
/**
|
|
10145
10208
|
* Provider 未挂载时在开发环境输出告警,提醒先在应用根部挂载 <ToastProvider>。
|
|
10146
10209
|
*/
|
|
10147
10210
|
function warnIfUnmounted() {
|
|
10148
|
-
if (
|
|
10211
|
+
if (hostCount === 0 && import.meta.env.DEV) console.warn("[tu-design] 在 <ToastProvider> 挂载前调用了 toast。请在应用根部挂载一次 <ToastProvider>,否则提示不会渲染。");
|
|
10149
10212
|
}
|
|
10150
10213
|
const toastApi = {
|
|
10151
10214
|
/**
|
|
@@ -10236,8 +10299,7 @@ const toastApi = {
|
|
|
10236
10299
|
function useToast() {
|
|
10237
10300
|
return toastApi;
|
|
10238
10301
|
}
|
|
10239
|
-
|
|
10240
|
-
//#region src/components/toast/ToastProvider.vue
|
|
10302
|
+
// src/components/toast/ToastProvider.vue
|
|
10241
10303
|
const _hoisted_1$2 = {
|
|
10242
10304
|
key: 0,
|
|
10243
10305
|
viewBox: "0 0 24 24",
|
|
@@ -10293,6 +10355,9 @@ const _hoisted_7 = { class: "flex shrink-0 items-center gap-1" };
|
|
|
10293
10355
|
/**
|
|
10294
10356
|
* Toast 渲染容器:在应用根部挂载一次。
|
|
10295
10357
|
* 内部按 props 重建 useToast 单例 store,随后所有 toast 方法经单例转发到这里渲染。
|
|
10358
|
+
*
|
|
10359
|
+
* 兼容出口:新接入推荐 `<TuDesignProvider :toast="{...}">`(内部组合本组件)。
|
|
10360
|
+
* 两者同时挂载即双宿主,dev 告警且后挂载者配置生效,请二选一。
|
|
10296
10361
|
*/
|
|
10297
10362
|
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";
|
|
10298
10363
|
const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
@@ -10390,8 +10455,7 @@ const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
|
10390
10455
|
};
|
|
10391
10456
|
}
|
|
10392
10457
|
});
|
|
10393
|
-
|
|
10394
|
-
//#region src/components/alert-dialog/AlertDialog.vue
|
|
10458
|
+
// src/components/alert-dialog/AlertDialog.vue
|
|
10395
10459
|
const _hoisted_1$1 = { class: "flex flex-col gap-2 text-center sm:text-left" };
|
|
10396
10460
|
const _hoisted_2$1 = { class: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end" };
|
|
10397
10461
|
const _hoisted_3 = {
|
|
@@ -10444,7 +10508,8 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
10444
10508
|
"cancel"
|
|
10445
10509
|
],
|
|
10446
10510
|
setup(__props, { emit: __emit }) {
|
|
10447
|
-
const
|
|
10511
|
+
const attrs = useAttrs();
|
|
10512
|
+
const { ids: rootIds } = useOverlayIds(attrs, {
|
|
10448
10513
|
primary: "content",
|
|
10449
10514
|
parts: [
|
|
10450
10515
|
"content",
|
|
@@ -10463,6 +10528,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
10463
10528
|
controlled: () => props.open,
|
|
10464
10529
|
onChange: (open) => emit("update:open", open)
|
|
10465
10530
|
});
|
|
10531
|
+
useOverlayScrollLock(isOpen, () => attrs.modal !== false && attrs.modal !== "false");
|
|
10466
10532
|
function handleUpdate(open) {
|
|
10467
10533
|
if (!open && loading.value) return;
|
|
10468
10534
|
setOpen(open);
|
|
@@ -10477,11 +10543,13 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
10477
10543
|
emitCancel: () => emit("cancel"),
|
|
10478
10544
|
close
|
|
10479
10545
|
});
|
|
10480
|
-
const contentClass = computed(() => cn("bg-
|
|
10546
|
+
const contentClass = computed(() => cn("bg-dialog text-dialog-foreground data-[state=open]:animate-in data-[state=closed]:animate-out fixed left-1/2 top-1/2 z-[var(--z-modal,60)] grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:max-w-md"));
|
|
10547
|
+
const preventScroll = overlayPreventScroll();
|
|
10481
10548
|
return (_ctx, _cache) => {
|
|
10482
10549
|
return openBlock(), createBlock(unref(Dialog).Root, {
|
|
10483
10550
|
ids: unref(rootIds),
|
|
10484
10551
|
open: unref(isOpen),
|
|
10552
|
+
"prevent-scroll": unref(preventScroll),
|
|
10485
10553
|
"close-on-escape": !unref(loading),
|
|
10486
10554
|
"close-on-interact-outside": !unref(loading),
|
|
10487
10555
|
"onUpdate:open": handleUpdate
|
|
@@ -10534,14 +10602,14 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
10534
10602
|
}, 8, [
|
|
10535
10603
|
"ids",
|
|
10536
10604
|
"open",
|
|
10605
|
+
"prevent-scroll",
|
|
10537
10606
|
"close-on-escape",
|
|
10538
10607
|
"close-on-interact-outside"
|
|
10539
10608
|
]);
|
|
10540
10609
|
};
|
|
10541
10610
|
}
|
|
10542
10611
|
});
|
|
10543
|
-
|
|
10544
|
-
//#region src/components/context-menu/ContextMenu.vue
|
|
10612
|
+
// src/components/context-menu/ContextMenu.vue
|
|
10545
10613
|
const contentCls = "bg-popover text-popover-foreground z-[var(--z-overlay)] min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95";
|
|
10546
10614
|
const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
10547
10615
|
name: "ContextMenu",
|
|
@@ -10569,7 +10637,8 @@ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
|
10569
10637
|
function handleSelect(details) {
|
|
10570
10638
|
emit("select", details);
|
|
10571
10639
|
}
|
|
10572
|
-
const
|
|
10640
|
+
const tuProvider = useTuProvider();
|
|
10641
|
+
const rootPositioning = computed(() => withSandboxStrategy(props.positioning, { ...props.positioning }, tuProvider));
|
|
10573
10642
|
return (_ctx, _cache) => {
|
|
10574
10643
|
return openBlock(), createBlock(unref(Menu).Root, {
|
|
10575
10644
|
positioning: rootPositioning.value,
|
|
@@ -10583,7 +10652,7 @@ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
|
10583
10652
|
}),
|
|
10584
10653
|
createVNode(unref(Menu).Positioner, { class: "z-[var(--z-overlay)]" }, {
|
|
10585
10654
|
default: withCtx(() => [createVNode(unref(Menu).Content, mergeProps(unref(attrs), { class: unref(cn)(contentCls) }), {
|
|
10586
|
-
default: withCtx(() => [createVNode(_sfc_main$
|
|
10655
|
+
default: withCtx(() => [createVNode(_sfc_main$56, { items: props.items }, null, 8, ["items"])]),
|
|
10587
10656
|
_: 1
|
|
10588
10657
|
}, 16, ["class"])]),
|
|
10589
10658
|
_: 1
|
|
@@ -10594,8 +10663,7 @@ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
|
|
|
10594
10663
|
};
|
|
10595
10664
|
}
|
|
10596
10665
|
});
|
|
10597
|
-
|
|
10598
|
-
//#region src/components/drawer/Drawer.vue
|
|
10666
|
+
// src/components/drawer/Drawer.vue
|
|
10599
10667
|
const _hoisted_1 = {
|
|
10600
10668
|
key: 0,
|
|
10601
10669
|
class: "flex flex-col gap-1.5"
|
|
@@ -10655,7 +10723,8 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
10655
10723
|
},
|
|
10656
10724
|
emits: ["update:open"],
|
|
10657
10725
|
setup(__props, { emit: __emit }) {
|
|
10658
|
-
const
|
|
10726
|
+
const attrs = useAttrs();
|
|
10727
|
+
const { ids: rootIds } = useOverlayIds(attrs, {
|
|
10659
10728
|
primary: "content",
|
|
10660
10729
|
parts: [
|
|
10661
10730
|
"content",
|
|
@@ -10678,6 +10747,7 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
10678
10747
|
defaultValue: () => props.defaultOpen,
|
|
10679
10748
|
onChange: (open) => emit("update:open", open)
|
|
10680
10749
|
});
|
|
10750
|
+
useOverlayScrollLock(isOpen, () => attrs.modal !== false && attrs.modal !== "false");
|
|
10681
10751
|
/** 关闭抽屉(#footer 作用域插槽注入) */
|
|
10682
10752
|
function close() {
|
|
10683
10753
|
setOpen(false);
|
|
@@ -10729,11 +10799,13 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
10729
10799
|
};
|
|
10730
10800
|
const config = computed(() => placementConfig[props.placement]);
|
|
10731
10801
|
const isLateral = computed(() => props.placement === "left" || props.placement === "right");
|
|
10732
|
-
const contentClass = computed(() => cn("bg-
|
|
10802
|
+
const contentClass = computed(() => cn("bg-dialog text-dialog-foreground data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-[var(--z-modal,60)] flex flex-col gap-4 overflow-y-auto p-6 shadow-lg duration-200", config.value.content, isLateral.value ? cn("w-full", config.value.sizes[props.size]) : cn("h-full", config.value.sizes[props.size]), placementAnimations[props.placement]));
|
|
10803
|
+
const preventScroll = overlayPreventScroll();
|
|
10733
10804
|
return (_ctx, _cache) => {
|
|
10734
10805
|
return openBlock(), createBlock(unref(Drawer).Root, {
|
|
10735
10806
|
ids: unref(rootIds),
|
|
10736
10807
|
open: unref(isOpen),
|
|
10808
|
+
"prevent-scroll": unref(preventScroll),
|
|
10737
10809
|
"lazy-mount": props.lazyMount,
|
|
10738
10810
|
"unmount-on-exit": props.unmountOnExit,
|
|
10739
10811
|
"onUpdate:open": unref(setOpen)
|
|
@@ -10783,6 +10855,7 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
10783
10855
|
}, 8, [
|
|
10784
10856
|
"ids",
|
|
10785
10857
|
"open",
|
|
10858
|
+
"prevent-scroll",
|
|
10786
10859
|
"lazy-mount",
|
|
10787
10860
|
"unmount-on-exit",
|
|
10788
10861
|
"onUpdate:open"
|
|
@@ -10790,8 +10863,7 @@ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
|
|
|
10790
10863
|
};
|
|
10791
10864
|
}
|
|
10792
10865
|
});
|
|
10793
|
-
|
|
10794
|
-
//#region src/components/timeline/Timeline.vue
|
|
10866
|
+
// src/components/timeline/Timeline.vue
|
|
10795
10867
|
const _sfc_main$47 = /*@__PURE__*/ defineComponent({
|
|
10796
10868
|
__name: "Timeline",
|
|
10797
10869
|
props: {
|
|
@@ -10897,8 +10969,7 @@ const _sfc_main$47 = /*@__PURE__*/ defineComponent({
|
|
|
10897
10969
|
};
|
|
10898
10970
|
}
|
|
10899
10971
|
});
|
|
10900
|
-
|
|
10901
|
-
//#region src/components/timeline/index.ts
|
|
10972
|
+
// src/components/timeline/index.ts
|
|
10902
10973
|
/** 容器变体:alternate 模式加 isolate 隔离堆叠上下文,避免连线/节点受外部 z-index 干扰 */
|
|
10903
10974
|
const timelineVariants = cva("relative m-0 list-none p-0", {
|
|
10904
10975
|
variants: { mode: {
|
|
@@ -11028,5 +11099,57 @@ const timelineDotVariants = cva("relative z-10 mt-1 block shrink-0 rounded-full"
|
|
|
11028
11099
|
hollow: false
|
|
11029
11100
|
}
|
|
11030
11101
|
});
|
|
11031
|
-
|
|
11032
|
-
|
|
11102
|
+
// src/components/provider/TuDesignProvider.vue
|
|
11103
|
+
/**
|
|
11104
|
+
* 应用根组件(可选层):微前端环境显式声明 + 根部能力聚合。
|
|
11105
|
+
*
|
|
11106
|
+
* 1. `mode`:声明渲染环境,覆盖浮层组件的自动沙箱探测(Teleport 降级 /
|
|
11107
|
+
* 定位策略 / 模态滚动锁)。解析优先级:组件显式 prop > 本 mode > 自动探测。
|
|
11108
|
+
* 行为组语义与框架映射表见文档「微前端与沙箱 · 手动声明运行环境」。
|
|
11109
|
+
* 不挂载本组件或不传 mode 时,一切行为与自动探测现行版本完全一致。
|
|
11110
|
+
* 2. `:toast`:消息提示宿主(组合渲染 ToastProvider,present = enabled);
|
|
11111
|
+
* 与独立挂载 ToastProvider 二选一,双挂载 dev 告警。
|
|
11112
|
+
* 3. `:overlay`:滚动锁契约(present = enabled,语义 B:仅锁禁用拓扑生效);
|
|
11113
|
+
* 经 provide 快照透传,消费判定见 overlayContract()。非锁禁用拓扑下 dev 告警。
|
|
11114
|
+
*
|
|
11115
|
+
* 三者均为 mount-time 契约(provide 快照 / ToastProvider 挂载时消费),
|
|
11116
|
+
* 动态变更用 :key 重挂载。须包住子应用根(inject 沿逻辑树,Teleport 子树同样命中;
|
|
11117
|
+
* 组件挂载在 Provider 子树之外时回落 auto 兜底)。
|
|
11118
|
+
*/
|
|
11119
|
+
const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
11120
|
+
inheritAttrs: false,
|
|
11121
|
+
__name: "TuDesignProvider",
|
|
11122
|
+
props: {
|
|
11123
|
+
/** 渲染环境声明(行为组名,非框架名);缺省 auto = 现行探测链 */
|
|
11124
|
+
mode: {
|
|
11125
|
+
type: String,
|
|
11126
|
+
default: "auto"
|
|
11127
|
+
},
|
|
11128
|
+
/** 消息提示宿主配置:未传不渲染 Toaster;传 {} 全走缺省 */
|
|
11129
|
+
toast: {
|
|
11130
|
+
type: Object,
|
|
11131
|
+
default: void 0
|
|
11132
|
+
},
|
|
11133
|
+
/** overlay 滚动锁契约(present = enabled):仅锁禁用拓扑消费(语义 B),mount-time */
|
|
11134
|
+
overlay: {
|
|
11135
|
+
type: Object,
|
|
11136
|
+
default: void 0
|
|
11137
|
+
}
|
|
11138
|
+
},
|
|
11139
|
+
setup(__props) {
|
|
11140
|
+
const props = __props;
|
|
11141
|
+
provide(TU_PROVIDER_KEY, {
|
|
11142
|
+
mode: props.mode,
|
|
11143
|
+
overlay: props.overlay
|
|
11144
|
+
});
|
|
11145
|
+
if (import.meta.env.DEV && props.overlay && preventScrollOverride(props.mode) !== false) console.warn("[tu-design] TuDesignProvider :overlay 仅锁禁用拓扑生效(语义 B):当前 mode 下滚动锁未被禁用,overlay 契约不会被消费。");
|
|
11146
|
+
return (_ctx, _cache) => {
|
|
11147
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
11148
|
+
createCommentVNode(" present = enabled::toast 传入即挂载消息宿主(组合复用 ToastProvider,零复制) "),
|
|
11149
|
+
props.toast ? (openBlock(), createBlock(unref(_sfc_main$48), normalizeProps(mergeProps({ key: 0 }, props.toast)), null, 16)) : createCommentVNode("v-if", true),
|
|
11150
|
+
renderSlot(_ctx.$slots, "default")
|
|
11151
|
+
], 64);
|
|
11152
|
+
};
|
|
11153
|
+
}
|
|
11154
|
+
});
|
|
11155
|
+
export { _sfc_main as Alert, _sfc_main$1 as AlertDialog, _sfc_main$2 as Avatar, _sfc_main$3 as AvatarGroup, _sfc_main$4 as Badge, _sfc_main$5 as Button, CHECKED, COMPONENT_NAMES, _sfc_main$6 as Calendar, _sfc_main$7 as Card, _sfc_main$8 as Cascader, _sfc_main$9 as Checkbox, _sfc_main$10 as ContextMenu, _sfc_main$11 as CurrencyInput, _sfc_main$12 as DatePicker, _sfc_main$13 as DateRangePicker, _sfc_main$14 as Dialog, _sfc_main$15 as Drawer, _sfc_main$16 as DropdownMenu, _sfc_main$17 as Empty, _sfc_main$18 as Form, _sfc_main$19 as FormControl, _sfc_main$20 as FormDescription, _sfc_main$21 as FormField, _sfc_main$22 as FormItem, _sfc_main$23 as FormLabel, _sfc_main$24 as FormMessage, _sfc_main$25 as FormRender, _sfc_main$26 as FormSubscribe, _sfc_main$27 as Input, _sfc_main$28 as Label, MODEL_VALUE, _sfc_main$29 as MonthPicker, _sfc_main$30 as NumberInput, PAGE_TABLE_FILL_KEY, _sfc_main$31 as PasswordInput, _sfc_main$32 as PinInput, _sfc_main$33 as Popconfirm, _sfc_main$34 as Popover, _sfc_main$35 as Progress, _sfc_main$36 as RadioGroup, SLIDER, _sfc_main$37 as Select, _sfc_main$38 as Separator, _sfc_main$39 as Skeleton, _sfc_main$40 as Slider, Slot, _sfc_main$41 as Spin, _sfc_main$42 as Switch, _sfc_main$43 as TablePagination, _sfc_main$44 as TableRender, _sfc_main$45 as Tabs, _sfc_main$46 as Textarea, _sfc_main$47 as Timeline, _sfc_main$48 as ToastProvider, _sfc_main$49 as Tooltip, _sfc_main$50 as TreeSelect, _sfc_main$51 as TuDesignProvider, TuDesignResolver, VALUE, _sfc_main$52 as WeekPicker, _sfc_main$53 as YearPicker, alertIconPaths, alertIconVariants, alertVariants, avatarGroupKey, avatarVariants, badgeVariants, bindField, buttonVariants, cardVariants, cn, columnRenders, defineColumns, defineForm, defineTable, flattenColumns, formatCurrency, isColumnGroup, numberOrNull, parseCurrency, timelineDotVariants, timelineItemVariants, timelineVariants, useFormRender, useTableRender, useToast, widgetRenders };
|