@tu-design/vue 0.5.12 → 0.5.14
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 +19 -19
- package/dist/index.mjs +72 -6
- package/dist/registry/vue/alert-dialog.json +2 -2
- package/dist/registry/vue/alert.json +1 -1
- package/dist/registry/vue/avatar-group.json +1 -1
- package/dist/registry/vue/avatar.json +1 -1
- package/dist/registry/vue/badge.json +1 -1
- package/dist/registry/vue/button.json +1 -1
- package/dist/registry/vue/calendar.json +1 -1
- package/dist/registry/vue/card.json +1 -1
- package/dist/registry/vue/cascader.json +1 -1
- package/dist/registry/vue/checkbox.json +1 -1
- package/dist/registry/vue/context-menu.json +1 -1
- package/dist/registry/vue/currency-input.json +1 -1
- package/dist/registry/vue/date-picker.json +1 -1
- package/dist/registry/vue/date-range-picker.json +1 -1
- package/dist/registry/vue/date-shared.json +1 -1
- package/dist/registry/vue/dialog.json +2 -2
- package/dist/registry/vue/drawer.json +1 -1
- package/dist/registry/vue/dropdown-menu.json +1 -1
- package/dist/registry/vue/empty.json +1 -1
- package/dist/registry/vue/form-render.json +1 -1
- package/dist/registry/vue/form.json +1 -1
- package/dist/registry/vue/icon-shared.json +1 -1
- package/dist/registry/vue/input.json +1 -1
- package/dist/registry/vue/label.json +1 -1
- package/dist/registry/vue/month-picker.json +1 -1
- package/dist/registry/vue/number-input.json +1 -1
- package/dist/registry/vue/overlay-shared.json +7 -1
- package/dist/registry/vue/password-input.json +1 -1
- package/dist/registry/vue/pin-input.json +1 -1
- package/dist/registry/vue/popconfirm.json +1 -1
- package/dist/registry/vue/popover.json +1 -1
- package/dist/registry/vue/progress.json +1 -1
- package/dist/registry/vue/provider.json +2 -2
- package/dist/registry/vue/radio-group.json +1 -1
- package/dist/registry/vue/registry.json +53 -53
- package/dist/registry/vue/select.json +1 -1
- package/dist/registry/vue/separator.json +1 -1
- package/dist/registry/vue/skeleton.json +1 -1
- package/dist/registry/vue/slider.json +1 -1
- package/dist/registry/vue/slot.json +1 -1
- package/dist/registry/vue/spin.json +1 -1
- package/dist/registry/vue/switch.json +1 -1
- package/dist/registry/vue/table-render.json +1 -1
- package/dist/registry/vue/tabs.json +1 -1
- package/dist/registry/vue/textarea.json +1 -1
- package/dist/registry/vue/timeline.json +1 -1
- package/dist/registry/vue/toast.json +3 -3
- package/dist/registry/vue/tokens.json +1 -1
- package/dist/registry/vue/tooltip.json +1 -1
- package/dist/registry/vue/tree-select.json +1 -1
- package/dist/registry/vue/tree-shared.json +1 -1
- package/dist/registry/vue/utils.json +1 -1
- package/dist/registry/vue/week-picker.json +1 -1
- package/dist/registry/vue/year-picker.json +1 -1
- package/dist/style.css +21 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -209,10 +209,10 @@ declare const __VLS_export$52: import("vue").DefineComponent<import("vue").Extra
|
|
|
209
209
|
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
210
210
|
}>, {
|
|
211
211
|
class: string;
|
|
212
|
+
invalid: boolean | undefined;
|
|
212
213
|
modelValue: number | null | undefined;
|
|
213
214
|
disabled: boolean | undefined;
|
|
214
215
|
placeholder: string;
|
|
215
|
-
invalid: boolean | undefined;
|
|
216
216
|
labelUnit: CurrencyUnit;
|
|
217
217
|
valueUnit: CurrencyUnit;
|
|
218
218
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -378,8 +378,9 @@ declare const __VLS_export$51: import("vue").DefineComponent<import("vue").Extra
|
|
|
378
378
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
379
379
|
}>, {
|
|
380
380
|
class: string;
|
|
381
|
-
|
|
381
|
+
invalid: boolean | undefined;
|
|
382
382
|
modelValue: string | null | undefined;
|
|
383
|
+
max: string;
|
|
383
384
|
defaultValue: string;
|
|
384
385
|
min: string;
|
|
385
386
|
isDateUnavailable: (date: DateValue) => boolean;
|
|
@@ -388,7 +389,6 @@ declare const __VLS_export$51: import("vue").DefineComponent<import("vue").Extra
|
|
|
388
389
|
open: boolean | undefined;
|
|
389
390
|
defaultOpen: boolean;
|
|
390
391
|
placeholder: string;
|
|
391
|
-
invalid: boolean | undefined;
|
|
392
392
|
readOnly: boolean | undefined;
|
|
393
393
|
closeOnSelect: boolean;
|
|
394
394
|
positioning: import("@zag-js/popper").PositioningOptions;
|
|
@@ -552,9 +552,10 @@ declare const __VLS_export$50: import("vue").DefineComponent<import("vue").Extra
|
|
|
552
552
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
553
553
|
}>, {
|
|
554
554
|
class: string;
|
|
555
|
+
invalid: boolean | undefined;
|
|
556
|
+
modelValue: [string, string] | null | undefined;
|
|
555
557
|
max: string;
|
|
556
558
|
numOfMonths: number;
|
|
557
|
-
modelValue: [string, string] | null | undefined;
|
|
558
559
|
defaultValue: [string, string] | undefined;
|
|
559
560
|
min: string;
|
|
560
561
|
isDateUnavailable: (date: DateValue) => boolean;
|
|
@@ -563,7 +564,6 @@ declare const __VLS_export$50: import("vue").DefineComponent<import("vue").Extra
|
|
|
563
564
|
open: boolean | undefined;
|
|
564
565
|
defaultOpen: boolean;
|
|
565
566
|
placeholder: string;
|
|
566
|
-
invalid: boolean | undefined;
|
|
567
567
|
readOnly: boolean | undefined;
|
|
568
568
|
closeOnSelect: boolean;
|
|
569
569
|
positioning: import("@zag-js/popper").PositioningOptions;
|
|
@@ -725,8 +725,9 @@ declare const __VLS_export$48: import("vue").DefineComponent<import("vue").Extra
|
|
|
725
725
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
726
726
|
}>, {
|
|
727
727
|
class: string;
|
|
728
|
-
|
|
728
|
+
invalid: boolean | undefined;
|
|
729
729
|
modelValue: string | null | undefined;
|
|
730
|
+
max: string;
|
|
730
731
|
defaultValue: string;
|
|
731
732
|
min: string;
|
|
732
733
|
locale: string;
|
|
@@ -734,7 +735,6 @@ declare const __VLS_export$48: import("vue").DefineComponent<import("vue").Extra
|
|
|
734
735
|
open: boolean | undefined;
|
|
735
736
|
defaultOpen: boolean;
|
|
736
737
|
placeholder: string;
|
|
737
|
-
invalid: boolean | undefined;
|
|
738
738
|
readOnly: boolean | undefined;
|
|
739
739
|
closeOnSelect: boolean;
|
|
740
740
|
positioning: import("@zag-js/popper").PositioningOptions;
|
|
@@ -892,8 +892,9 @@ declare const __VLS_export$47: import("vue").DefineComponent<import("vue").Extra
|
|
|
892
892
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
893
893
|
}>, {
|
|
894
894
|
class: string;
|
|
895
|
-
|
|
895
|
+
invalid: boolean | undefined;
|
|
896
896
|
modelValue: string | null | undefined;
|
|
897
|
+
max: string;
|
|
897
898
|
defaultValue: string;
|
|
898
899
|
min: string;
|
|
899
900
|
isDateUnavailable: (date: DateValue) => boolean;
|
|
@@ -902,7 +903,6 @@ declare const __VLS_export$47: import("vue").DefineComponent<import("vue").Extra
|
|
|
902
903
|
open: boolean | undefined;
|
|
903
904
|
defaultOpen: boolean;
|
|
904
905
|
placeholder: string;
|
|
905
|
-
invalid: boolean | undefined;
|
|
906
906
|
readOnly: boolean | undefined;
|
|
907
907
|
closeOnSelect: boolean;
|
|
908
908
|
positioning: import("@zag-js/popper").PositioningOptions;
|
|
@@ -990,11 +990,11 @@ declare const __VLS_base$34: import("vue").DefineComponent<import("vue").Extract
|
|
|
990
990
|
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
991
991
|
}>, {
|
|
992
992
|
class: string;
|
|
993
|
-
|
|
993
|
+
invalid: boolean | undefined;
|
|
994
994
|
modelValue: number | null | undefined;
|
|
995
|
+
max: number;
|
|
995
996
|
min: number;
|
|
996
997
|
disabled: boolean | undefined;
|
|
997
|
-
invalid: boolean | undefined;
|
|
998
998
|
step: number;
|
|
999
999
|
formatOptions: Intl.NumberFormatOptions;
|
|
1000
1000
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1092,10 +1092,10 @@ declare const __VLS_base$33: import("vue").DefineComponent<import("vue").Extract
|
|
|
1092
1092
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
1093
1093
|
}>, {
|
|
1094
1094
|
class: string;
|
|
1095
|
+
invalid: boolean | undefined;
|
|
1095
1096
|
modelValue: string | undefined;
|
|
1096
1097
|
disabled: boolean | undefined;
|
|
1097
1098
|
placeholder: string;
|
|
1098
|
-
invalid: boolean | undefined;
|
|
1099
1099
|
visible: boolean | undefined;
|
|
1100
1100
|
autoComplete: "current-password" | "new-password";
|
|
1101
1101
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1955,8 +1955,9 @@ declare const __VLS_export$37: import("vue").DefineComponent<import("vue").Extra
|
|
|
1955
1955
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
1956
1956
|
}>, {
|
|
1957
1957
|
class: string;
|
|
1958
|
-
|
|
1958
|
+
invalid: boolean | undefined;
|
|
1959
1959
|
modelValue: string | null | undefined;
|
|
1960
|
+
max: string;
|
|
1960
1961
|
defaultValue: string;
|
|
1961
1962
|
min: string;
|
|
1962
1963
|
locale: string;
|
|
@@ -1964,7 +1965,6 @@ declare const __VLS_export$37: import("vue").DefineComponent<import("vue").Extra
|
|
|
1964
1965
|
open: boolean | undefined;
|
|
1965
1966
|
defaultOpen: boolean;
|
|
1966
1967
|
placeholder: string;
|
|
1967
|
-
invalid: boolean | undefined;
|
|
1968
1968
|
readOnly: boolean | undefined;
|
|
1969
1969
|
closeOnSelect: boolean;
|
|
1970
1970
|
positioning: import("@zag-js/popper").PositioningOptions;
|
|
@@ -2572,9 +2572,9 @@ declare const __VLS_base$24: import("vue").DefineComponent<import("vue").Extract
|
|
|
2572
2572
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
2573
2573
|
}>, {
|
|
2574
2574
|
mode: "day" | "month" | "year";
|
|
2575
|
+
modelValue: string | null | undefined;
|
|
2575
2576
|
max: string;
|
|
2576
2577
|
numOfMonths: number;
|
|
2577
|
-
modelValue: string | null | undefined;
|
|
2578
2578
|
defaultValue: string;
|
|
2579
2579
|
min: string;
|
|
2580
2580
|
isDateUnavailable: (date: DateValue) => boolean;
|
|
@@ -3171,11 +3171,11 @@ declare const __VLS_base$14: import("vue").DefineComponent<import("vue").Extract
|
|
|
3171
3171
|
}>, {
|
|
3172
3172
|
class: string;
|
|
3173
3173
|
length: number;
|
|
3174
|
-
|
|
3174
|
+
invalid: boolean | undefined;
|
|
3175
3175
|
modelValue: string[] | undefined;
|
|
3176
|
+
type: "numeric" | "alphanumeric" | undefined;
|
|
3176
3177
|
disabled: boolean | undefined;
|
|
3177
3178
|
placeholder: string;
|
|
3178
|
-
invalid: boolean | undefined;
|
|
3179
3179
|
otp: boolean | undefined;
|
|
3180
3180
|
mask: boolean | undefined;
|
|
3181
3181
|
autoSubmit: boolean | undefined;
|
|
@@ -3413,6 +3413,7 @@ declare const __VLS_base$13: import("vue").DefineComponent<import("vue").Extract
|
|
|
3413
3413
|
lazyMount: boolean;
|
|
3414
3414
|
unmountOnExit: boolean;
|
|
3415
3415
|
contentClass: string;
|
|
3416
|
+
contentProps: Record<string, unknown>;
|
|
3416
3417
|
trigger: TriggerMode;
|
|
3417
3418
|
openDelay: number;
|
|
3418
3419
|
closeDelay: number;
|
|
@@ -3425,7 +3426,6 @@ declare const __VLS_base$13: import("vue").DefineComponent<import("vue").Extract
|
|
|
3425
3426
|
to: string | HTMLElement;
|
|
3426
3427
|
matchTriggerWidth: boolean;
|
|
3427
3428
|
zIndex: number;
|
|
3428
|
-
contentProps: Record<string, unknown>;
|
|
3429
3429
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
3430
3430
|
declare const __VLS_export$17: __VLS_WithSlots$13<typeof __VLS_base$13, __VLS_Slots$13>;
|
|
3431
3431
|
declare const _default$34: typeof __VLS_export$17;
|
|
@@ -4438,10 +4438,10 @@ declare const __VLS_base$10: import("vue").DefineComponent<import("vue").Extract
|
|
|
4438
4438
|
lazyMount: boolean;
|
|
4439
4439
|
unmountOnExit: boolean;
|
|
4440
4440
|
contentClass: string;
|
|
4441
|
-
contentProps: Record<string, unknown>;
|
|
4442
4441
|
content: string;
|
|
4443
4442
|
delayDuration: number;
|
|
4444
4443
|
closeDuration: number;
|
|
4444
|
+
contentProps: Record<string, unknown>;
|
|
4445
4445
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
4446
4446
|
declare const __VLS_export$11: __VLS_WithSlots$10<typeof __VLS_base$10, __VLS_Slots$10>;
|
|
4447
4447
|
declare const _default$49: typeof __VLS_export$11;
|
package/dist/index.mjs
CHANGED
|
@@ -6353,7 +6353,7 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
6353
6353
|
}
|
|
6354
6354
|
const hasHeader = computed(() => Boolean(props.title || props.description));
|
|
6355
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));
|
|
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]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:ease-in data-[state=open]:ease-out sm:max-w-lg", props.contentClass));
|
|
6357
6357
|
return (_ctx, _cache) => {
|
|
6358
6358
|
return openBlock(), createBlock(unref(Dialog).Root, {
|
|
6359
6359
|
ids: unref(rootIds),
|
|
@@ -6372,7 +6372,7 @@ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
|
|
|
6372
6372
|
default: withCtx(() => [renderSlot(_ctx.$slots, "trigger")]),
|
|
6373
6373
|
_: 3
|
|
6374
6374
|
})) : createCommentVNode("v-if", true),
|
|
6375
|
-
createVNode(unref(Dialog).Backdrop, { class: "fixed inset-0 z-[var(--z-modal,60)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
|
|
6375
|
+
createVNode(unref(Dialog).Backdrop, { class: "fixed inset-0 z-[var(--z-modal,60)] bg-black/50 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:ease-in data-[state=open]:ease-out" }),
|
|
6376
6376
|
createVNode(unref(Dialog).Positioner, { class: "fixed inset-0 z-[var(--z-modal,60)] flex items-center justify-center p-4" }, {
|
|
6377
6377
|
default: withCtx(() => [createVNode(unref(Dialog).Content, { class: normalizeClass(contentClass.value) }, {
|
|
6378
6378
|
default: withCtx(() => [
|
|
@@ -10161,6 +10161,64 @@ const _sfc_main$41 = /*@__PURE__*/ defineComponent({
|
|
|
10161
10161
|
};
|
|
10162
10162
|
}
|
|
10163
10163
|
});
|
|
10164
|
+
/** 全局幂等标记:Symbol.for 注册表键,抗 HMR 模块重载(同键恒等) */
|
|
10165
|
+
const GUARD_FLAG = Symbol.for("tu-design.raf-clock-guard");
|
|
10166
|
+
const NOOP_HANDLE = Object.freeze({
|
|
10167
|
+
installed: false,
|
|
10168
|
+
driftMs: NaN,
|
|
10169
|
+
restore: () => {}
|
|
10170
|
+
});
|
|
10171
|
+
/**
|
|
10172
|
+
* 安装 rAF 时钟守卫(幂等;同步包装、异步哨兵裁决)。
|
|
10173
|
+
*
|
|
10174
|
+
* 接线点:TuDesignProvider / ToastProvider setup 顶层(mode="none" 跳过)。
|
|
10175
|
+
* 任意环境可安全调用——干净时间线首帧即自恢复,零残留。
|
|
10176
|
+
*
|
|
10177
|
+
* @param win 宿主窗口(DI 入参;缺省全局 window,SSR 环境返回 no-op)
|
|
10178
|
+
* @returns 哨兵裁决后的句柄(幂等重入时返回已存在句柄的裁决)
|
|
10179
|
+
*/
|
|
10180
|
+
function ensureRafClockGuard(win) {
|
|
10181
|
+
const target = win ?? (typeof window !== "undefined" ? window : void 0);
|
|
10182
|
+
if (!target) return Promise.resolve(NOOP_HANDLE);
|
|
10183
|
+
const w = target;
|
|
10184
|
+
const existing = w[GUARD_FLAG];
|
|
10185
|
+
if (existing) return Promise.resolve(existing);
|
|
10186
|
+
const rawRef = w.requestAnimationFrame;
|
|
10187
|
+
const rawRaf = rawRef.bind(w);
|
|
10188
|
+
const perf = w.performance;
|
|
10189
|
+
let state = "probing";
|
|
10190
|
+
let driftMs = NaN;
|
|
10191
|
+
let resolveDecision;
|
|
10192
|
+
const wrapper = (cb) => {
|
|
10193
|
+
return rawRaf((ts) => {
|
|
10194
|
+
if (state === "probing") {
|
|
10195
|
+
driftMs = Math.round(Math.abs(ts - perf.now()));
|
|
10196
|
+
state = driftMs >= 100 ? "armed" : "clean";
|
|
10197
|
+
if (state === "clean") w.requestAnimationFrame = rawRef;
|
|
10198
|
+
else if (import.meta.env.DEV) console.info(`[tu-design] 检测到 rAF 时间线漂移 ${driftMs}ms(沙箱 rAF/performance 时钟混用),已安装时钟归一化守卫,回调时间戳改传本地 performance.now()。机制详注 overlay-shared/rafClock.ts(issue #6)。`);
|
|
10199
|
+
resolveDecision(handle);
|
|
10200
|
+
}
|
|
10201
|
+
cb(state === "armed" ? perf.now() : ts);
|
|
10202
|
+
});
|
|
10203
|
+
};
|
|
10204
|
+
const handle = {
|
|
10205
|
+
get installed() {
|
|
10206
|
+
return state === "armed";
|
|
10207
|
+
},
|
|
10208
|
+
get driftMs() {
|
|
10209
|
+
return driftMs;
|
|
10210
|
+
},
|
|
10211
|
+
restore() {
|
|
10212
|
+
w.requestAnimationFrame = rawRef;
|
|
10213
|
+
}
|
|
10214
|
+
};
|
|
10215
|
+
w[GUARD_FLAG] = handle;
|
|
10216
|
+
w.requestAnimationFrame = wrapper;
|
|
10217
|
+
wrapper(() => {});
|
|
10218
|
+
return new Promise((resolve) => {
|
|
10219
|
+
resolveDecision = resolve;
|
|
10220
|
+
});
|
|
10221
|
+
}
|
|
10164
10222
|
// src/components/toast/useToast.ts
|
|
10165
10223
|
/** Provider 缺省配置(与 Provider props 默认值保持一致) */
|
|
10166
10224
|
const DEFAULTS = {
|
|
@@ -10358,8 +10416,11 @@ const _hoisted_7 = { class: "flex shrink-0 items-center gap-1" };
|
|
|
10358
10416
|
*
|
|
10359
10417
|
* 兼容出口:新接入推荐 `<TuDesignProvider :toast="{...}">`(内部组合本组件)。
|
|
10360
10418
|
* 两者同时挂载即双宿主,dev 告警且后挂载者配置生效,请二选一。
|
|
10419
|
+
*
|
|
10420
|
+
* rAF 时钟守卫:独立挂载路径兜底(组合挂载时 TuDesignProvider 已装,幂等无害);
|
|
10421
|
+
* mode="none"(经 inject 继承)显式跳过,其余哨兵门控(详注 overlay-shared/rafClock.ts)。
|
|
10361
10422
|
*/
|
|
10362
|
-
const rootBase = "flex w-[22rem] max-w-[calc(100vw-2rem)] items-start gap-3 rounded-md border p-4 shadow-lg
|
|
10423
|
+
const rootBase = "flex w-[22rem] max-w-[calc(100vw-2rem)] items-start gap-3 rounded-md border p-4 shadow-lg";
|
|
10363
10424
|
const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
10364
10425
|
__name: "ToastProvider",
|
|
10365
10426
|
props: {
|
|
@@ -10386,6 +10447,7 @@ const _sfc_main$48 = /*@__PURE__*/ defineComponent({
|
|
|
10386
10447
|
duration: props.duration,
|
|
10387
10448
|
max: props.max
|
|
10388
10449
|
}));
|
|
10450
|
+
if (useTuProvider().mode !== "none") ensureRafClockGuard();
|
|
10389
10451
|
onMounted(() => __setToastMounted(true));
|
|
10390
10452
|
onBeforeUnmount(() => __setToastMounted(false));
|
|
10391
10453
|
/** 语义 type → token 样式(tokens.css 的 success/warning/info/destructive) */
|
|
@@ -10543,7 +10605,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
10543
10605
|
emitCancel: () => emit("cancel"),
|
|
10544
10606
|
close
|
|
10545
10607
|
});
|
|
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"));
|
|
10608
|
+
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]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:ease-in data-[state=open]:ease-out sm:max-w-md"));
|
|
10547
10609
|
const preventScroll = overlayPreventScroll();
|
|
10548
10610
|
return (_ctx, _cache) => {
|
|
10549
10611
|
return openBlock(), createBlock(unref(Dialog).Root, {
|
|
@@ -10554,7 +10616,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
10554
10616
|
"close-on-interact-outside": !unref(loading),
|
|
10555
10617
|
"onUpdate:open": handleUpdate
|
|
10556
10618
|
}, {
|
|
10557
|
-
default: withCtx(() => [createVNode(unref(Dialog).Backdrop, { class: "fixed inset-0 z-[var(--z-modal,60)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }), createVNode(unref(Dialog).Positioner, { class: "fixed inset-0 z-[var(--z-modal,60)] flex items-center justify-center p-4" }, {
|
|
10619
|
+
default: withCtx(() => [createVNode(unref(Dialog).Backdrop, { class: "fixed inset-0 z-[var(--z-modal,60)] bg-black/50 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:ease-in data-[state=open]:ease-out" }), createVNode(unref(Dialog).Positioner, { class: "fixed inset-0 z-[var(--z-modal,60)] flex items-center justify-center p-4" }, {
|
|
10558
10620
|
default: withCtx(() => [createCommentVNode(" role=\"alertdialog\":覆盖 Ark Content 默认 role=\"dialog\",补偿无上游 AlertDialog 原语的角色语义 "), createVNode(unref(Dialog).Content, {
|
|
10559
10621
|
class: normalizeClass(contentClass.value),
|
|
10560
10622
|
role: "alertdialog",
|
|
@@ -11111,8 +11173,11 @@ const timelineDotVariants = cva("relative z-10 mt-1 block shrink-0 rounded-full"
|
|
|
11111
11173
|
* 与独立挂载 ToastProvider 二选一,双挂载 dev 告警。
|
|
11112
11174
|
* 3. `:overlay`:滚动锁契约(present = enabled,语义 B:仅锁禁用拓扑生效);
|
|
11113
11175
|
* 经 provide 快照透传,消费判定见 overlayContract()。非锁禁用拓扑下 dev 告警。
|
|
11176
|
+
* 4. rAF 时钟守卫(无 prop,哨兵自动):沙箱时钟混用家族修复(issue #6,
|
|
11177
|
+
* 机制详注 overlay-shared/rafClock.ts);mode="none" 显式关闭,其余 mode
|
|
11178
|
+
* 哨兵命中才安装(幂等,干净环境首帧自恢复零残留)。
|
|
11114
11179
|
*
|
|
11115
|
-
*
|
|
11180
|
+
* 四者均为 mount-time 契约(provide 快照 / ToastProvider 挂载时消费),
|
|
11116
11181
|
* 动态变更用 :key 重挂载。须包住子应用根(inject 沿逻辑树,Teleport 子树同样命中;
|
|
11117
11182
|
* 组件挂载在 Provider 子树之外时回落 auto 兜底)。
|
|
11118
11183
|
*/
|
|
@@ -11142,6 +11207,7 @@ const _sfc_main$51 = /*@__PURE__*/ defineComponent({
|
|
|
11142
11207
|
mode: props.mode,
|
|
11143
11208
|
overlay: props.overlay
|
|
11144
11209
|
});
|
|
11210
|
+
if (props.mode !== "none") ensureRafClockGuard();
|
|
11145
11211
|
if (import.meta.env.DEV && props.overlay && preventScrollOverride(props.mode) !== false) console.warn("[tu-design] TuDesignProvider :overlay 仅锁禁用拓扑生效(语义 B):当前 mode 下滚动锁未被禁用,overlay 契约不会被消费。");
|
|
11146
11212
|
return (_ctx, _cache) => {
|
|
11147
11213
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "alert-dialog",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "确认弹窗单组件:v-model:open 控制显隐,title/description 传文案,@confirm/@cancel 处理确认与取消;确认处理器返回 Promise 时按钮进入 loading 并锁定 ESC/遮罩关闭,resolve 自动关闭、reject 保持打开;内容节点为 role=alertdialog。",
|
|
7
7
|
"registryDependencies": ["button", "utils", "overlay-shared"],
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"path": "alert-dialog/AlertDialog.vue",
|
|
12
12
|
"type": "registry:component",
|
|
13
13
|
"target": "components/ui/alert-dialog/AlertDialog.vue",
|
|
14
|
-
"content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed, getCurrentInstance, useAttrs } from \"vue\";\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\nimport { useConfirmPending } from \"../overlay-shared/useConfirmPending\";\nimport { useControlledBoolean } from \"../overlay-shared/useControlledBoolean\";\nimport { useOverlayIds } from \"../overlay-shared/useOverlayIds\";\nimport { useOverlayScrollLock } from \"../overlay-shared/useOverlayScrollLock\";\nimport { overlayPreventScroll } from \"../overlay-shared/useSandboxOverlay\";\n\nconst attrs = useAttrs();\n\n// ids 全量覆盖(无冒号):规避 wujie patch getElementById 对 zag 缺省冒号 id 的\n// SyntaxError 刷屏(详注见 useOverlayIds);复用 dialog machine,parts 同 Dialog\nconst { ids: rootIds } = useOverlayIds(attrs, {\n primary: \"content\",\n parts: [\"content\", \"title\", \"description\", \"trigger\", \"closeTrigger\", \"positioner\", \"backdrop\"],\n});\n\n// 用运行时 props 显式 default: undefined:Boolean prop 缺省时 Vue 会 cast 成 false,\n// 导致无法区分「未传(非受控)」与「传了 false(受控关闭)」。与 Dialog.vue 同款约定。\nconst props = defineProps({\n /** 受控开关(配合 v-model:open);不传时为非受控,由内部状态管理 */\n open: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** 标题文案(#title 插槽优先) */\n title: { type: String, required: true },\n /** 描述文案(#description 插槽优先,可不传) */\n description: { type: String, default: undefined },\n /** 确认按钮文案 */\n confirmText: { type: String, default: \"确定\" },\n /** 取消按钮文案 */\n cancelText: { type: String, default: \"取消\" },\n /** 确认按钮使用 destructive 语义色(危险操作场景) */\n destructive: { type: Boolean, default: false },\n});\n\nconst emit = defineEmits<{\n \"update:open\": [open: boolean];\n confirm: [];\n cancel: [];\n}>();\n\n// 对 Root 恒走受控模式(open 恒为布尔):非受控语义由内部 ref 实现,与 Dialog.vue 一致。\n// setup 期间捕获实例:getCurrentInstance 仅在 setup/生命周期内有效,事件回调里返回 null。\nconst instance = getCurrentInstance();\nconst { isOpen, setOpen } = useControlledBoolean({\n controlled: () => props.open,\n onChange: (open) => emit(\"update:open\", open),\n});\n\n// overlay 滚动锁契约(issue #5,语义 B 拓扑闸在 overlayContract 内);\n// isModal 仅在 isOpen 转换回调内求值(冻结语义,不 watch attrs)\nuseOverlayScrollLock(isOpen, () => attrs.modal !== false && attrs.modal !== \"false\");\n\nfunction handleUpdate(open: boolean) {\n // pending 期间忽略一切关闭请求(走受控桥拒绝同步,弹窗保持打开)——\n // 与 Popconfirm 同款锁定方案;Root 仍保留 :close-on-escape/:close-on-interact-outside 双保险\n if (!open && loading.value) return;\n setOpen(open);\n}\n\n/** 关闭弹窗:走受控桥把 open 置 false,退出动画/焦点还原由 zag 处理 */\nfunction close() {\n handleUpdate(false);\n}\n\n// 确认 Promise pending 时锁定关闭通道(ESC/遮罩/取消按钮全部锁死),只能等 Promise 落定\nconst { loading, handleConfirm, handleCancel } = useConfirmPending({\n instance,\n emitConfirm: () => emit(\"confirm\"),\n emitCancel: () => emit(\"cancel\"),\n close,\n});\n\n// 面板样式:复用 Dialog 的内容面板类(含 --dialog 模态表面位,issue #2),宽度收窄为 sm:max-w-md 的确认弹窗尺度\nconst contentClass = computed(() =>\n cn(\n \"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\",\n ),\n);\n\n// 滚动锁沙箱降级(wujie graft 下禁用,机制与论证见 overlayPreventScroll / issue #4)\nconst preventScroll = overlayPreventScroll();\n</script>\n\n<template>\n <ArkDialog.Root\n :ids=\"rootIds\"\n :open=\"isOpen\"\n :prevent-scroll=\"preventScroll\"\n :close-on-escape=\"!loading\"\n :close-on-interact-outside=\"!loading\"\n @update:open=\"handleUpdate\"\n >\n <ArkDialog.Backdrop\n class=\"fixed inset-0 z-[var(--z-modal,60)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\"\n />\n <ArkDialog.Positioner\n class=\"fixed inset-0 z-[var(--z-modal,60)] flex items-center justify-center p-4\"\n >\n <!-- role=\"alertdialog\":覆盖 Ark Content 默认 role=\"dialog\",补偿无上游 AlertDialog 原语的角色语义 -->\n <ArkDialog.Content :class=\"contentClass\" role=\"alertdialog\" aria-modal=\"true\">\n <div class=\"flex flex-col gap-2 text-center sm:text-left\">\n <ArkDialog.Title class=\"text-lg font-semibold leading-none tracking-tight\">\n <slot name=\"title\">{{ props.title }}</slot>\n </ArkDialog.Title>\n <ArkDialog.Description\n v-if=\"$slots.description || props.description\"\n class=\"text-sm text-muted-foreground\"\n >\n <slot name=\"description\">{{ props.description }}</slot>\n </ArkDialog.Description>\n </div>\n\n <!-- 默认插槽:补充正文(可选) -->\n <slot />\n\n <!-- 底部操作区:取消 outline,确认按 destructive 切换语义色;pending 时确认钮转 loading -->\n <div class=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <Button variant=\"outline\" :disabled=\"loading\" @click=\"handleCancel\">\n {{ props.cancelText }}\n </Button>\n <Button\n :variant=\"props.destructive ? 'destructive' : 'default'\"\n :disabled=\"loading\"\n @click=\"handleConfirm\"\n >\n <svg\n v-if=\"loading\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n class=\"size-4 animate-spin\"\n aria-hidden=\"true\"\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n {{ props.confirmText }}\n </Button>\n </div>\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n </ArkDialog.Root>\n</template>\n"
|
|
14
|
+
"content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed, getCurrentInstance, useAttrs } from \"vue\";\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\nimport { useConfirmPending } from \"../overlay-shared/useConfirmPending\";\nimport { useControlledBoolean } from \"../overlay-shared/useControlledBoolean\";\nimport { useOverlayIds } from \"../overlay-shared/useOverlayIds\";\nimport { useOverlayScrollLock } from \"../overlay-shared/useOverlayScrollLock\";\nimport { overlayPreventScroll } from \"../overlay-shared/useSandboxOverlay\";\n\nconst attrs = useAttrs();\n\n// ids 全量覆盖(无冒号):规避 wujie patch getElementById 对 zag 缺省冒号 id 的\n// SyntaxError 刷屏(详注见 useOverlayIds);复用 dialog machine,parts 同 Dialog\nconst { ids: rootIds } = useOverlayIds(attrs, {\n primary: \"content\",\n parts: [\"content\", \"title\", \"description\", \"trigger\", \"closeTrigger\", \"positioner\", \"backdrop\"],\n});\n\n// 用运行时 props 显式 default: undefined:Boolean prop 缺省时 Vue 会 cast 成 false,\n// 导致无法区分「未传(非受控)」与「传了 false(受控关闭)」。与 Dialog.vue 同款约定。\nconst props = defineProps({\n /** 受控开关(配合 v-model:open);不传时为非受控,由内部状态管理 */\n open: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** 标题文案(#title 插槽优先) */\n title: { type: String, required: true },\n /** 描述文案(#description 插槽优先,可不传) */\n description: { type: String, default: undefined },\n /** 确认按钮文案 */\n confirmText: { type: String, default: \"确定\" },\n /** 取消按钮文案 */\n cancelText: { type: String, default: \"取消\" },\n /** 确认按钮使用 destructive 语义色(危险操作场景) */\n destructive: { type: Boolean, default: false },\n});\n\nconst emit = defineEmits<{\n \"update:open\": [open: boolean];\n confirm: [];\n cancel: [];\n}>();\n\n// 对 Root 恒走受控模式(open 恒为布尔):非受控语义由内部 ref 实现,与 Dialog.vue 一致。\n// setup 期间捕获实例:getCurrentInstance 仅在 setup/生命周期内有效,事件回调里返回 null。\nconst instance = getCurrentInstance();\nconst { isOpen, setOpen } = useControlledBoolean({\n controlled: () => props.open,\n onChange: (open) => emit(\"update:open\", open),\n});\n\n// overlay 滚动锁契约(issue #5,语义 B 拓扑闸在 overlayContract 内);\n// isModal 仅在 isOpen 转换回调内求值(冻结语义,不 watch attrs)\nuseOverlayScrollLock(isOpen, () => attrs.modal !== false && attrs.modal !== \"false\");\n\nfunction handleUpdate(open: boolean) {\n // pending 期间忽略一切关闭请求(走受控桥拒绝同步,弹窗保持打开)——\n // 与 Popconfirm 同款锁定方案;Root 仍保留 :close-on-escape/:close-on-interact-outside 双保险\n if (!open && loading.value) return;\n setOpen(open);\n}\n\n/** 关闭弹窗:走受控桥把 open 置 false,退出动画/焦点还原由 zag 处理 */\nfunction close() {\n handleUpdate(false);\n}\n\n// 确认 Promise pending 时锁定关闭通道(ESC/遮罩/取消按钮全部锁死),只能等 Promise 落定\nconst { loading, handleConfirm, handleCancel } = useConfirmPending({\n instance,\n emitConfirm: () => emit(\"confirm\"),\n emitCancel: () => emit(\"cancel\"),\n close,\n});\n\n// 面板样式:复用 Dialog 的内容面板类(含 --dialog 模态表面位,issue #2),宽度收窄为 sm:max-w-md 的确认弹窗尺度\n// 进出场动画与 Dialog.vue 保持同款(fade + zoom-95 + 上方 8px 落位,200ms,进 ease-out 出 ease-in)\nconst contentClass = computed(() =>\n cn(\n \"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]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:ease-in data-[state=open]:ease-out sm:max-w-md\",\n ),\n);\n\n// 滚动锁沙箱降级(wujie graft 下禁用,机制与论证见 overlayPreventScroll / issue #4)\nconst preventScroll = overlayPreventScroll();\n</script>\n\n<template>\n <ArkDialog.Root\n :ids=\"rootIds\"\n :open=\"isOpen\"\n :prevent-scroll=\"preventScroll\"\n :close-on-escape=\"!loading\"\n :close-on-interact-outside=\"!loading\"\n @update:open=\"handleUpdate\"\n >\n <ArkDialog.Backdrop\n class=\"fixed inset-0 z-[var(--z-modal,60)] bg-black/50 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:ease-in data-[state=open]:ease-out\"\n />\n <ArkDialog.Positioner\n class=\"fixed inset-0 z-[var(--z-modal,60)] flex items-center justify-center p-4\"\n >\n <!-- role=\"alertdialog\":覆盖 Ark Content 默认 role=\"dialog\",补偿无上游 AlertDialog 原语的角色语义 -->\n <ArkDialog.Content :class=\"contentClass\" role=\"alertdialog\" aria-modal=\"true\">\n <div class=\"flex flex-col gap-2 text-center sm:text-left\">\n <ArkDialog.Title class=\"text-lg font-semibold leading-none tracking-tight\">\n <slot name=\"title\">{{ props.title }}</slot>\n </ArkDialog.Title>\n <ArkDialog.Description\n v-if=\"$slots.description || props.description\"\n class=\"text-sm text-muted-foreground\"\n >\n <slot name=\"description\">{{ props.description }}</slot>\n </ArkDialog.Description>\n </div>\n\n <!-- 默认插槽:补充正文(可选) -->\n <slot />\n\n <!-- 底部操作区:取消 outline,确认按 destructive 切换语义色;pending 时确认钮转 loading -->\n <div class=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <Button variant=\"outline\" :disabled=\"loading\" @click=\"handleCancel\">\n {{ props.cancelText }}\n </Button>\n <Button\n :variant=\"props.destructive ? 'destructive' : 'default'\"\n :disabled=\"loading\"\n @click=\"handleConfirm\"\n >\n <svg\n v-if=\"loading\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n class=\"size-4 animate-spin\"\n aria-hidden=\"true\"\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n {{ props.confirmText }}\n </Button>\n </div>\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n </ArkDialog.Root>\n</template>\n"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"path": "alert-dialog/index.ts",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "calendar",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "日历(TCalendar):紧凑日历卡。Picker 弹层内为 embedded 内嵌形态(TDatePicker/TDateRangePicker 自动挂靠,纯卡片内核);独立使用即 standalone 独立形态(自带日历状态与 v-model,恒开展示)。",
|
|
7
7
|
"registryDependencies": ["icon-shared", "utils", "date-shared"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "card",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "卡片容器:单组件 API,title/description 头部 + 命名插槽(cover/action/footer/header),支持尺寸、视觉变体、分段分隔与可关闭。",
|
|
7
7
|
"registryDependencies": ["utils"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "cascader",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "级联选择:一站式 props 驱动,多列联动、勾选级联、路径回显与多标签。",
|
|
7
7
|
"registryDependencies": ["icon-shared", "tree-shared", "utils", "date-shared", "overlay-shared"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "context-menu",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "右键菜单:单组件模式,items 描述菜单项(与 dropdown-menu 同构,含分组/标题/分隔线,支持嵌套),默认插槽为触发元素(ContextTrigger as-child,右键唤出并定位到指针处),内置键盘导航与选中回调。",
|
|
7
7
|
"registryDependencies": ["overlay-shared", "utils", "dropdown-menu"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "currency-input",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "金额输入框:内置万/元/角/分单位后缀,labelUnit 输入单位与 valueUnit 存储单位自动换算(整数分最小精度),值以 number|null 受控。",
|
|
7
7
|
"registryDependencies": ["utils"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "date-picker",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "日期选择器:输入框 + 日历弹层(月/年视图切换),支持手动键入/清空/min-max 边界/不可选谓词,值以 \"yyyy-MM-dd\" 字符串受控。",
|
|
7
7
|
"registryDependencies": ["utils", "date-shared", "calendar"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "date-range-picker",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "日期范围选择器:双月日历弹层(月/年视图切换),点选起点与终点,值以 [\"yyyy-MM-dd\", \"yyyy-MM-dd\"] 有序元组受控,空值归一 null。",
|
|
7
7
|
"registryDependencies": ["icon-shared", "utils", "date-shared", "calendar", "overlay-shared"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "date-shared",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "日期家族共享模块:ISO 值域解析(日期/月/年/区间)、日历样式常量与单值选择器外壳(PickerShell/usePickerBridge)。",
|
|
7
7
|
"registryDependencies": ["icon-shared", "utils", "overlay-shared"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "dialog",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "模态对话框单组件:#trigger 放触发元素,title/description 传文案,#footer 注入 close 关闭;基于 Ark UI Dialog 原语,含焦点圈定、Escape/遮罩关闭与进出场动画,支持 v-model:open。",
|
|
7
7
|
"registryDependencies": ["icon-shared", "utils", "overlay-shared"],
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"path": "dialog/Dialog.vue",
|
|
12
12
|
"type": "registry:component",
|
|
13
13
|
"target": "components/ui/dialog/Dialog.vue",
|
|
14
|
-
"content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed, useAttrs } from \"vue\";\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\nimport { cn } from \"@/lib/utils\";\nimport { useControlledBoolean } from \"../overlay-shared/useControlledBoolean\";\nimport { useOverlayIds } from \"../overlay-shared/useOverlayIds\";\nimport { useOverlayScrollLock } from \"../overlay-shared/useOverlayScrollLock\";\nimport { overlayPreventScroll } from \"../overlay-shared/useSandboxOverlay\";\nimport CloseIcon from \"../icon-shared/CloseIcon.vue\";\n\nconst attrs = useAttrs();\n\n// ids 全量覆盖(无冒号):规避 wujie patch getElementById 对 zag 缺省冒号 id 的\n// SyntaxError 刷屏(详注见 useOverlayIds)\nconst { ids: rootIds } = useOverlayIds(attrs, {\n primary: \"content\",\n parts: [\"content\", \"title\", \"description\", \"trigger\", \"closeTrigger\", \"positioner\", \"backdrop\"],\n});\n\n// 用运行时 props 显式 default: undefined:Boolean prop 缺省时 Vue 会 cast 成 false,\n// 导致无法区分「未传(非受控)」与「传了 false(受控关闭)」。\nconst props = defineProps({\n /** 受控开关(配合 v-model:open);不传时为非受控,由内部状态管理 */\n open: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** 非受控时的初始开关 */\n defaultOpen: { type: Boolean, default: false },\n /** 首次打开前不挂载内容 */\n lazyMount: { type: Boolean, default: false },\n /** 关闭后卸载内容(关闭动画结束后) */\n unmountOnExit: { type: Boolean, default: false },\n /** 标题文案(#title 插槽优先,两者皆无则不渲染标题) */\n title: { type: String, default: undefined },\n /** 描述文案(#description 插槽优先,两者皆无则不渲染描述) */\n description: { type: String, default: undefined },\n /** 是否渲染右上角内置关闭按钮 */\n showCloseButton: { type: Boolean, default: true },\n /** 追加/覆盖面板样式类(默认 sm:max-w-lg 可由此覆盖,如 \"sm:max-w-xl\") */\n contentClass: { type: String, default: undefined },\n});\n\nconst emit = defineEmits<{ \"update:open\": [open: boolean] }>();\n\n// 对 Root 恒走受控模式(open 恒为布尔):非受控语义由内部 ref 实现,\n// 避开 zag uncontrolled 内部状态在部分环境下不同步的问题,两种模式行为一致。\nconst { isOpen, setOpen } = useControlledBoolean({\n controlled: () => props.open,\n defaultValue: () => props.defaultOpen,\n onChange: (open) => emit(\"update:open\", open),\n});\n\n// overlay 滚动锁契约(issue #5,语义 B 拓扑闸在 overlayContract 内);\n// isModal 仅在 isOpen 转换回调内求值(冻结语义,不 watch attrs)\nuseOverlayScrollLock(isOpen, () => attrs.modal !== false && attrs.modal !== \"false\");\n\n/** 关闭对话框(#footer 作用域插槽注入):走受控桥把 open 置 false,\n * 与原 TDialogClose(Ark CloseTrigger)的关闭语义等价,退出动画/焦点还原由 zag 处理 */\nfunction close() {\n setOpen(false);\n}\n\n// 标题/描述有任一来源(props 或插槽)时才渲染头部区块(原 TDialogHeader 布局类)\nconst hasHeader = computed(() => Boolean(props.title || props.description));\n\n// 滚动锁沙箱降级(wujie graft 下禁用,机制与论证见 overlayPreventScroll / issue #4);\n// wujie marker 先于子应用脚本注入,setup 顶层求值时序可靠\nconst preventScroll = overlayPreventScroll();\n\n// 面板样式:内置类 + contentClass 合并(twMerge 自动去冲突,后者优先)。\n// 面板底色走 --dialog 模态表面位(issue #2):--background 是页面画布语义,画布带色的主题下面板不被染色。\nconst contentClass = computed(() =>\n cn(\n \"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\",\n props.contentClass,\n ),\n);\n</script>\n\n<template>\n <ArkDialog.Root\n :ids=\"rootIds\"\n :open=\"isOpen\"\n :prevent-scroll=\"preventScroll\"\n :lazy-mount=\"props.lazyMount\"\n :unmount-on-exit=\"props.unmountOnExit\"\n @update:open=\"setOpen\"\n >\n <!-- #trigger:触发元素本体(asChild 语义合并到子元素,原 TDialogTrigger 同款实现);未提供则不渲染触发器 -->\n <ArkDialog.Trigger v-if=\"$slots.trigger\" as-child>\n <slot name=\"trigger\" />\n </ArkDialog.Trigger>\n\n <ArkDialog.Backdrop\n class=\"fixed inset-0 z-[var(--z-modal,60)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\"\n />\n <ArkDialog.Positioner\n class=\"fixed inset-0 z-[var(--z-modal,60)] flex items-center justify-center p-4\"\n >\n <ArkDialog.Content :class=\"contentClass\">\n <!-- 标题/描述:#title / #description 插槽优先,回退 title/description props;皆无则不渲染对应 DOM -->\n <div\n v-if=\"hasHeader || $slots.title || $slots.description\"\n class=\"flex flex-col gap-2 text-center sm:text-left\"\n >\n <ArkDialog.Title\n v-if=\"$slots.title || props.title\"\n class=\"text-lg font-semibold leading-none tracking-tight\"\n >\n <slot name=\"title\">{{ props.title }}</slot>\n </ArkDialog.Title>\n <ArkDialog.Description\n v-if=\"$slots.description || props.description\"\n class=\"text-sm text-muted-foreground\"\n >\n <slot name=\"description\">{{ props.description }}</slot>\n </ArkDialog.Description>\n </div>\n\n <!-- 默认插槽:弹层内容区(原 TDialogContent 的 body 部分) -->\n <slot />\n\n <!-- 底部操作区:#footer=\"{ close }\" 注入关闭函数,替代原 TDialogClose -->\n <div v-if=\"$slots.footer\" class=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <slot name=\"footer\" :close=\"close\" />\n </div>\n\n <ArkDialog.CloseTrigger\n v-if=\"props.showCloseButton\"\n class=\"absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none\"\n >\n <slot name=\"close\">\n <CloseIcon class=\"size-4\" />\n <span class=\"sr-only\">关闭</span>\n </slot>\n </ArkDialog.CloseTrigger>\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n </ArkDialog.Root>\n</template>\n"
|
|
14
|
+
"content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed, useAttrs } from \"vue\";\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\nimport { cn } from \"@/lib/utils\";\nimport { useControlledBoolean } from \"../overlay-shared/useControlledBoolean\";\nimport { useOverlayIds } from \"../overlay-shared/useOverlayIds\";\nimport { useOverlayScrollLock } from \"../overlay-shared/useOverlayScrollLock\";\nimport { overlayPreventScroll } from \"../overlay-shared/useSandboxOverlay\";\nimport CloseIcon from \"../icon-shared/CloseIcon.vue\";\n\nconst attrs = useAttrs();\n\n// ids 全量覆盖(无冒号):规避 wujie patch getElementById 对 zag 缺省冒号 id 的\n// SyntaxError 刷屏(详注见 useOverlayIds)\nconst { ids: rootIds } = useOverlayIds(attrs, {\n primary: \"content\",\n parts: [\"content\", \"title\", \"description\", \"trigger\", \"closeTrigger\", \"positioner\", \"backdrop\"],\n});\n\n// 用运行时 props 显式 default: undefined:Boolean prop 缺省时 Vue 会 cast 成 false,\n// 导致无法区分「未传(非受控)」与「传了 false(受控关闭)」。\nconst props = defineProps({\n /** 受控开关(配合 v-model:open);不传时为非受控,由内部状态管理 */\n open: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** 非受控时的初始开关 */\n defaultOpen: { type: Boolean, default: false },\n /** 首次打开前不挂载内容 */\n lazyMount: { type: Boolean, default: false },\n /** 关闭后卸载内容(关闭动画结束后) */\n unmountOnExit: { type: Boolean, default: false },\n /** 标题文案(#title 插槽优先,两者皆无则不渲染标题) */\n title: { type: String, default: undefined },\n /** 描述文案(#description 插槽优先,两者皆无则不渲染描述) */\n description: { type: String, default: undefined },\n /** 是否渲染右上角内置关闭按钮 */\n showCloseButton: { type: Boolean, default: true },\n /** 追加/覆盖面板样式类(默认 sm:max-w-lg 可由此覆盖,如 \"sm:max-w-xl\") */\n contentClass: { type: String, default: undefined },\n});\n\nconst emit = defineEmits<{ \"update:open\": [open: boolean] }>();\n\n// 对 Root 恒走受控模式(open 恒为布尔):非受控语义由内部 ref 实现,\n// 避开 zag uncontrolled 内部状态在部分环境下不同步的问题,两种模式行为一致。\nconst { isOpen, setOpen } = useControlledBoolean({\n controlled: () => props.open,\n defaultValue: () => props.defaultOpen,\n onChange: (open) => emit(\"update:open\", open),\n});\n\n// overlay 滚动锁契约(issue #5,语义 B 拓扑闸在 overlayContract 内);\n// isModal 仅在 isOpen 转换回调内求值(冻结语义,不 watch attrs)\nuseOverlayScrollLock(isOpen, () => attrs.modal !== false && attrs.modal !== \"false\");\n\n/** 关闭对话框(#footer 作用域插槽注入):走受控桥把 open 置 false,\n * 与原 TDialogClose(Ark CloseTrigger)的关闭语义等价,退出动画/焦点还原由 zag 处理 */\nfunction close() {\n setOpen(false);\n}\n\n// 标题/描述有任一来源(props 或插槽)时才渲染头部区块(原 TDialogHeader 布局类)\nconst hasHeader = computed(() => Boolean(props.title || props.description));\n\n// 滚动锁沙箱降级(wujie graft 下禁用,机制与论证见 overlayPreventScroll / issue #4);\n// wujie marker 先于子应用脚本注入,setup 顶层求值时序可靠\nconst preventScroll = overlayPreventScroll();\n\n// 面板样式:内置类 + contentClass 合并(twMerge 自动去冲突,后者优先)。\n// 面板底色走 --dialog 模态表面位(issue #2):--background 是页面画布语义,画布带色的主题下面板不被染色。\n// 进出场:fade + zoom-95 + 自上方 8px 落位(退场对称回退),200ms 进 ease-out 出 ease-in;\n// slide 走 transform 通道,与 -translate-x/y-1/2 居中的 translate 属性通道互不覆盖。\nconst contentClass = computed(() =>\n cn(\n \"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]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 data-[state=closed]:ease-in data-[state=open]:ease-out sm:max-w-lg\",\n props.contentClass,\n ),\n);\n</script>\n\n<template>\n <ArkDialog.Root\n :ids=\"rootIds\"\n :open=\"isOpen\"\n :prevent-scroll=\"preventScroll\"\n :lazy-mount=\"props.lazyMount\"\n :unmount-on-exit=\"props.unmountOnExit\"\n @update:open=\"setOpen\"\n >\n <!-- #trigger:触发元素本体(asChild 语义合并到子元素,原 TDialogTrigger 同款实现);未提供则不渲染触发器 -->\n <ArkDialog.Trigger v-if=\"$slots.trigger\" as-child>\n <slot name=\"trigger\" />\n </ArkDialog.Trigger>\n\n <ArkDialog.Backdrop\n class=\"fixed inset-0 z-[var(--z-modal,60)] bg-black/50 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:ease-in data-[state=open]:ease-out\"\n />\n <ArkDialog.Positioner\n class=\"fixed inset-0 z-[var(--z-modal,60)] flex items-center justify-center p-4\"\n >\n <ArkDialog.Content :class=\"contentClass\">\n <!-- 标题/描述:#title / #description 插槽优先,回退 title/description props;皆无则不渲染对应 DOM -->\n <div\n v-if=\"hasHeader || $slots.title || $slots.description\"\n class=\"flex flex-col gap-2 text-center sm:text-left\"\n >\n <ArkDialog.Title\n v-if=\"$slots.title || props.title\"\n class=\"text-lg font-semibold leading-none tracking-tight\"\n >\n <slot name=\"title\">{{ props.title }}</slot>\n </ArkDialog.Title>\n <ArkDialog.Description\n v-if=\"$slots.description || props.description\"\n class=\"text-sm text-muted-foreground\"\n >\n <slot name=\"description\">{{ props.description }}</slot>\n </ArkDialog.Description>\n </div>\n\n <!-- 默认插槽:弹层内容区(原 TDialogContent 的 body 部分) -->\n <slot />\n\n <!-- 底部操作区:#footer=\"{ close }\" 注入关闭函数,替代原 TDialogClose -->\n <div v-if=\"$slots.footer\" class=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <slot name=\"footer\" :close=\"close\" />\n </div>\n\n <ArkDialog.CloseTrigger\n v-if=\"props.showCloseButton\"\n class=\"absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none\"\n >\n <slot name=\"close\">\n <CloseIcon class=\"size-4\" />\n <span class=\"sr-only\">关闭</span>\n </slot>\n </ArkDialog.CloseTrigger>\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n </ArkDialog.Root>\n</template>\n"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"path": "dialog/index.ts",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "drawer",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "抽屉单组件:从四方向滑出的侧边/顶底面板,#trigger 放触发元素,title/description 传文案,#footer 注入 close 关闭;基于 Ark UI Drawer 原语,进出场动画随 placement 方向自适应,含焦点圈定、Escape/遮罩关闭,支持 v-model:open。",
|
|
7
7
|
"registryDependencies": ["icon-shared", "utils", "overlay-shared"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "dropdown-menu",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "下拉菜单:单组件模式,items 描述菜单项(含分组/标题/分隔线,支持嵌套),内置键盘导航与选中回调,默认插槽为触发元素(asChild 透传)。",
|
|
7
7
|
"registryDependencies": ["utils", "overlay-shared"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "form-render",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "配置驱动表单渲染器:defineForm 聚合 TanStack Form 实例与字段配置,柯里化 widget DSL 声明控件,Tailwind 栅格自适应布局,复用 Form 家族 aria 接线。",
|
|
7
7
|
"registryDependencies": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "form",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "表单状态与校验:基于 TanStack Form,配合 Valibot(Standard Schema)声明式校验,aria 自动接线。",
|
|
7
7
|
"registryDependencies": ["utils", "input", "button", "label"],
|