@mcistudio/unoui-vue 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -0
- package/dist/alert/Alert.vue.d.ts +67 -0
- package/dist/alert/index.d.ts +40 -0
- package/dist/alert/index.js +2 -0
- package/dist/attrs.d.ts +11 -0
- package/dist/attrs.js +16 -0
- package/dist/attrs.js.map +1 -0
- package/dist/badge/Badge.vue.d.ts +57 -0
- package/dist/badge/BadgeRibbon.vue.d.ts +34 -0
- package/dist/badge/index.d.ts +42 -0
- package/dist/badge/index.js +2 -0
- package/dist/build.d.ts +2 -0
- package/dist/button/Button.vue.d.ts +46 -0
- package/dist/button/ButtonGroup.vue.d.ts +13 -0
- package/dist/button/index.d.ts +13 -0
- package/dist/button/index.js +2 -0
- package/dist/checkbox/Checkbox.vue.d.ts +47 -0
- package/dist/checkbox/CheckboxGroup.vue.d.ts +38 -0
- package/dist/checkbox/index.d.ts +30 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/chunks/Progress-BL4KZ3HE.js +271 -0
- package/dist/chunks/Progress-BL4KZ3HE.js.map +1 -0
- package/dist/chunks/Skeleton-ohStUD4M.js +153 -0
- package/dist/chunks/Skeleton-ohStUD4M.js.map +1 -0
- package/dist/chunks/Table-DhXmuKQd.js +330 -0
- package/dist/chunks/Table-DhXmuKQd.js.map +1 -0
- package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/chunks/alert-CczW_DKs.js +190 -0
- package/dist/chunks/alert-CczW_DKs.js.map +1 -0
- package/dist/chunks/badge-BHOZeImh.js +287 -0
- package/dist/chunks/badge-BHOZeImh.js.map +1 -0
- package/dist/chunks/button-pDObrN_X.js +168 -0
- package/dist/chunks/button-pDObrN_X.js.map +1 -0
- package/dist/chunks/checkbox-9_0oR4kg.js +260 -0
- package/dist/chunks/checkbox-9_0oR4kg.js.map +1 -0
- package/dist/chunks/colorpicker-CcizUCQv.js +594 -0
- package/dist/chunks/colorpicker-CcizUCQv.js.map +1 -0
- package/dist/chunks/datepicker-Cy808x7X.js +1414 -0
- package/dist/chunks/datepicker-Cy808x7X.js.map +1 -0
- package/dist/chunks/drawer-C3JZ28Xo.js +193 -0
- package/dist/chunks/drawer-C3JZ28Xo.js.map +1 -0
- package/dist/chunks/dropdown-0l967g7D.js +329 -0
- package/dist/chunks/dropdown-0l967g7D.js.map +1 -0
- package/dist/chunks/form-Qeqkd-HH.js +642 -0
- package/dist/chunks/form-Qeqkd-HH.js.map +1 -0
- package/dist/chunks/input-BDOXVCrK.js +1281 -0
- package/dist/chunks/input-BDOXVCrK.js.map +1 -0
- package/dist/chunks/inputOtp-Dyxj9lNj.js +261 -0
- package/dist/chunks/inputOtp-Dyxj9lNj.js.map +1 -0
- package/dist/chunks/message-xPfuG0EX.js +107 -0
- package/dist/chunks/message-xPfuG0EX.js.map +1 -0
- package/dist/chunks/millercolumns-Dp3fBrq6.js +426 -0
- package/dist/chunks/millercolumns-Dp3fBrq6.js.map +1 -0
- package/dist/chunks/modal-D6l1iIvE.js +81 -0
- package/dist/chunks/modal-D6l1iIvE.js.map +1 -0
- package/dist/chunks/pagination-Bc583AQX.js +265 -0
- package/dist/chunks/pagination-Bc583AQX.js.map +1 -0
- package/dist/chunks/popconfirm-D6lUfSxG.js +343 -0
- package/dist/chunks/popconfirm-D6lUfSxG.js.map +1 -0
- package/dist/chunks/qrcode-B0t_pZna.js +1099 -0
- package/dist/chunks/qrcode-B0t_pZna.js.map +1 -0
- package/dist/chunks/radio-DnYm59xH.js +477 -0
- package/dist/chunks/radio-DnYm59xH.js.map +1 -0
- package/dist/chunks/rate-0sme__Kb.js +309 -0
- package/dist/chunks/rate-0sme__Kb.js.map +1 -0
- package/dist/chunks/select-ChTfQM5u.js +417 -0
- package/dist/chunks/select-ChTfQM5u.js.map +1 -0
- package/dist/chunks/slider-C-W5GzTP.js +724 -0
- package/dist/chunks/slider-C-W5GzTP.js.map +1 -0
- package/dist/chunks/splitter-CgfiXY65.js +524 -0
- package/dist/chunks/splitter-CgfiXY65.js.map +1 -0
- package/dist/chunks/switch-BULGbODP.js +327 -0
- package/dist/chunks/switch-BULGbODP.js.map +1 -0
- package/dist/chunks/tab-Dxfg1_To.js +663 -0
- package/dist/chunks/tab-Dxfg1_To.js.map +1 -0
- package/dist/chunks/tag-BYmNsrZC.js +167 -0
- package/dist/chunks/tag-BYmNsrZC.js.map +1 -0
- package/dist/chunks/timepicker-DsGIdcf8.js +1059 -0
- package/dist/chunks/timepicker-DsGIdcf8.js.map +1 -0
- package/dist/chunks/tooltip-DMhiAqto.js +242 -0
- package/dist/chunks/tooltip-DMhiAqto.js.map +1 -0
- package/dist/colorpicker/ColorPicker.vue.d.ts +30 -0
- package/dist/colorpicker/color.d.ts +56 -0
- package/dist/colorpicker/color.js +99 -0
- package/dist/colorpicker/color.js.map +1 -0
- package/dist/colorpicker/index.d.ts +12 -0
- package/dist/colorpicker/index.js +2 -0
- package/dist/config.d.ts +55 -0
- package/dist/config.js +260 -0
- package/dist/config.js.map +1 -0
- package/dist/datepicker/DatePicker.vue.d.ts +82 -0
- package/dist/datepicker/RangePicker.vue.d.ts +87 -0
- package/dist/datepicker/index.d.ts +59 -0
- package/dist/datepicker/index.js +2 -0
- package/dist/drawer/Drawer.vue.d.ts +86 -0
- package/dist/drawer/index.d.ts +23 -0
- package/dist/drawer/index.js +2 -0
- package/dist/dropdown/Dropdown.vue.d.ts +118 -0
- package/dist/dropdown/index.d.ts +2 -0
- package/dist/dropdown/index.js +2 -0
- package/dist/form/Form.vue.d.ts +170 -0
- package/dist/form/FormItem.vue.d.ts +83 -0
- package/dist/form/index.d.ts +176 -0
- package/dist/form/index.js +2 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +32 -0
- package/dist/input/Autocomplete.vue.d.ts +121 -0
- package/dist/input/Input.vue.d.ts +142 -0
- package/dist/input/InputI18n.vue.d.ts +80 -0
- package/dist/input/InputTag.vue.d.ts +114 -0
- package/dist/input/index.d.ts +41 -0
- package/dist/input/index.js +2 -0
- package/dist/inputOtp/InputOtp.vue.d.ts +60 -0
- package/dist/inputOtp/index.d.ts +21 -0
- package/dist/inputOtp/index.js +2 -0
- package/dist/message/MessageContainer.vue.d.ts +11 -0
- package/dist/message/index.d.ts +20 -0
- package/dist/message/index.js +2 -0
- package/dist/message/types.d.ts +25 -0
- package/dist/millercolumns/MillerColumns.vue.d.ts +88 -0
- package/dist/millercolumns/index.d.ts +39 -0
- package/dist/millercolumns/index.js +2 -0
- package/dist/modal/Modal.vue.d.ts +54 -0
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.js +2 -0
- package/dist/pagination/Pagination.vue.d.ts +70 -0
- package/dist/pagination/index.d.ts +12 -0
- package/dist/pagination/index.js +2 -0
- package/dist/popconfirm/Popconfirm.vue.d.ts +104 -0
- package/dist/popconfirm/index.d.ts +36 -0
- package/dist/popconfirm/index.js +2 -0
- package/dist/progress/Progress.vue.d.ts +64 -0
- package/dist/progress/index.d.ts +26 -0
- package/dist/progress/index.js +2 -0
- package/dist/qrcode/QRCode.vue.d.ts +87 -0
- package/dist/qrcode/index.d.ts +43 -0
- package/dist/qrcode/index.js +2 -0
- package/dist/qrcode/qr.d.ts +51 -0
- package/dist/qrcode/qrcodegen.d.ts +94 -0
- package/dist/radio/Radio.vue.d.ts +52 -0
- package/dist/radio/RadioGroup.vue.d.ts +44 -0
- package/dist/radio/index.d.ts +55 -0
- package/dist/radio/index.js +2 -0
- package/dist/rate/Rate.vue.d.ts +100 -0
- package/dist/rate/index.d.ts +38 -0
- package/dist/rate/index.js +2 -0
- package/dist/select/Select.vue.d.ts +129 -0
- package/dist/select/index.d.ts +33 -0
- package/dist/select/index.js +2 -0
- package/dist/skeleton/Skeleton.vue.d.ts +31 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/slider/Slider.vue.d.ts +81 -0
- package/dist/slider/index.d.ts +61 -0
- package/dist/slider/index.js +2 -0
- package/dist/splitter/Splitter.vue.d.ts +63 -0
- package/dist/splitter/SplitterPanel.vue.d.ts +53 -0
- package/dist/splitter/index.d.ts +39 -0
- package/dist/splitter/index.js +2 -0
- package/dist/style.css +2 -0
- package/dist/switch/Switch.vue.d.ts +97 -0
- package/dist/switch/index.d.ts +31 -0
- package/dist/switch/index.js +2 -0
- package/dist/tab/TabPane.vue.d.ts +32 -0
- package/dist/tab/Tabs.vue.d.ts +87 -0
- package/dist/tab/index.d.ts +78 -0
- package/dist/tab/index.js +2 -0
- package/dist/table/Table.vue.d.ts +96 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/index.js +2 -0
- package/dist/table/types.d.ts +35 -0
- package/dist/table/types.js +0 -0
- package/dist/tag/Tag.vue.d.ts +46 -0
- package/dist/tag/index.d.ts +11 -0
- package/dist/tag/index.js +2 -0
- package/dist/timepicker/TimePicker.vue.d.ts +92 -0
- package/dist/timepicker/TimeRangePicker.vue.d.ts +90 -0
- package/dist/timepicker/index.d.ts +39 -0
- package/dist/timepicker/index.js +2 -0
- package/dist/tooltip/Tooltip.vue.d.ts +79 -0
- package/dist/tooltip/index.d.ts +14 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/uno.d.ts +32 -0
- package/dist/uno.js +83 -0
- package/dist/uno.js.map +1 -0
- package/dist/utils/DnD.d.ts +38 -0
- package/package.json +115 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type TagProps } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Tag 是管理端轻量标签组件,统一语义色、尺寸和圆角。
|
|
4
|
+
* variant 提供 dark、light、plain 和无描边柔和底色 soft 四种效果。
|
|
5
|
+
*/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
/** color 是标签语义色,可选,默认 brand。 */
|
|
8
|
+
color?: TagProps['color'];
|
|
9
|
+
/** variant 是标签视觉效果,可选,默认 light。 */
|
|
10
|
+
variant?: TagProps['variant'];
|
|
11
|
+
/** size 是标签尺寸,可选,默认 sm。 */
|
|
12
|
+
size?: TagProps['size'];
|
|
13
|
+
/** radius 是标签圆角,可选,默认 md。 */
|
|
14
|
+
radius?: TagProps['radius'];
|
|
15
|
+
/** closable 表示是否显示关闭按钮,可选,默认 false。 */
|
|
16
|
+
closable?: boolean;
|
|
17
|
+
/** closeIcon 是关闭按钮图标类名,可选,默认 lucide:x。 */
|
|
18
|
+
closeIcon?: string;
|
|
19
|
+
/** closeAriaLabel 是关闭按钮无障碍文案,可选。 */
|
|
20
|
+
closeAriaLabel?: string;
|
|
21
|
+
};
|
|
22
|
+
declare var __VLS_1: {};
|
|
23
|
+
type __VLS_Slots = {} & {
|
|
24
|
+
default?: (props: typeof __VLS_1) => any;
|
|
25
|
+
};
|
|
26
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
|
+
close: (event: MouseEvent) => any;
|
|
28
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
|
+
onClose?: ((event: MouseEvent) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
variant: "dark" | "light" | "plain" | "soft" | null;
|
|
32
|
+
closable: boolean;
|
|
33
|
+
closeAriaLabel: string;
|
|
34
|
+
color: "blue" | "cyan" | "gray" | "green" | "indigo" | "lime" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "brand" | null;
|
|
35
|
+
size: "sm" | "md" | "lg" | null;
|
|
36
|
+
radius: "none" | "round" | "sm" | "md" | "lg" | null;
|
|
37
|
+
closeIcon: string;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { default as Tag } from './Tag.vue';
|
|
3
|
+
/** tag 定义管理端 Tag 组件的样式变体组合。 */
|
|
4
|
+
export declare const tag: (props?: ({
|
|
5
|
+
color?: "blue" | "cyan" | "gray" | "green" | "indigo" | "lime" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "brand" | null | undefined;
|
|
6
|
+
variant?: "dark" | "light" | "plain" | "soft" | null | undefined;
|
|
7
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
8
|
+
radius?: "none" | "round" | "sm" | "md" | "lg" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
/** TagProps 是 tag 变体推导出的组件属性类型。 */
|
|
11
|
+
export type TagProps = VariantProps<typeof tag>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { type TimePickerDisabledTime, type TimePickerModelValue, type TimePickerProps } from '.';
|
|
3
|
+
type TimePickerEmitValue = Exclude<TimePickerModelValue, undefined>;
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** modelValue 是 v-model 绑定值,支持 string、number、Date、Dayjs、null。 */
|
|
6
|
+
modelValue?: TimePickerModelValue;
|
|
7
|
+
/** format 是展示格式,默认 HH:mm:ss;use12Hours 时默认 h:mm:ss A。 */
|
|
8
|
+
format?: string;
|
|
9
|
+
/** valueFormat 是提交字符串格式;未传时优先保持传入值类型。 */
|
|
10
|
+
valueFormat?: string;
|
|
11
|
+
/** placeholder 是无值时的占位文案。 */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** size 是选择器尺寸,可选,默认 md,并与 Input/Button 高度对齐。 */
|
|
14
|
+
size?: TimePickerProps['size'];
|
|
15
|
+
/** disabled 表示是否禁用选择器交互。 */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** clearable 表示是否允许一键清空。 */
|
|
18
|
+
clearable?: boolean;
|
|
19
|
+
/** hourStep 是小时选项步长。 */
|
|
20
|
+
hourStep?: number;
|
|
21
|
+
/** minuteStep 是分钟选项步长。 */
|
|
22
|
+
minuteStep?: number;
|
|
23
|
+
/** secondStep 是秒选项步长。 */
|
|
24
|
+
secondStep?: number;
|
|
25
|
+
/** use12Hours 表示是否启用 12 小时制。 */
|
|
26
|
+
use12Hours?: boolean;
|
|
27
|
+
/** showSecond 控制是否显示秒列;未传时由 format 是否包含秒决定。 */
|
|
28
|
+
showSecond?: boolean;
|
|
29
|
+
/** disabledTime 用于禁用不可选时间。 */
|
|
30
|
+
disabledTime?: TimePickerDisabledTime;
|
|
31
|
+
/** hideDisabledOptions 表示是否隐藏禁用选项。 */
|
|
32
|
+
hideDisabledOptions?: boolean;
|
|
33
|
+
/** needConfirm 表示是否需要点击确定后再提交。 */
|
|
34
|
+
needConfirm?: boolean;
|
|
35
|
+
/** showNow 表示是否显示此刻快捷操作。 */
|
|
36
|
+
showNow?: boolean;
|
|
37
|
+
/** suffixIcon 是右侧时钟图标类名。 */
|
|
38
|
+
suffixIcon?: string;
|
|
39
|
+
/** clearIcon 是清空按钮图标类名。 */
|
|
40
|
+
clearIcon?: string;
|
|
41
|
+
/** teleportedWidth 是下拉层固定宽度,默认按列数自动计算。 */
|
|
42
|
+
teleportedWidth?: string;
|
|
43
|
+
/** name 是隐藏 input 的原生 name,便于表单提交。 */
|
|
44
|
+
name?: string;
|
|
45
|
+
};
|
|
46
|
+
declare function clear(event?: MouseEvent): void;
|
|
47
|
+
declare function focus(): void;
|
|
48
|
+
declare function blur(): void;
|
|
49
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
50
|
+
blur: typeof blur;
|
|
51
|
+
clear: typeof clear;
|
|
52
|
+
focus: typeof focus;
|
|
53
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
54
|
+
clear: () => any;
|
|
55
|
+
change: (value: TimePickerEmitValue, timeString: string) => any;
|
|
56
|
+
focus: (event: FocusEvent) => any;
|
|
57
|
+
blur: (event: FocusEvent) => any;
|
|
58
|
+
"update:modelValue": (value: TimePickerEmitValue) => any;
|
|
59
|
+
"visible-change": (value: boolean) => any;
|
|
60
|
+
ok: (value: TimePickerEmitValue, timeString: string) => any;
|
|
61
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
62
|
+
onClear?: (() => any) | undefined;
|
|
63
|
+
onChange?: ((value: TimePickerEmitValue, timeString: string) => any) | undefined;
|
|
64
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
65
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
66
|
+
"onUpdate:modelValue"?: ((value: TimePickerEmitValue) => any) | undefined;
|
|
67
|
+
"onVisible-change"?: ((value: boolean) => any) | undefined;
|
|
68
|
+
onOk?: ((value: TimePickerEmitValue, timeString: string) => any) | undefined;
|
|
69
|
+
}>, {
|
|
70
|
+
size: "sm" | "md" | "lg" | null;
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
name: string;
|
|
73
|
+
modelValue: string | number | Date | dayjs.Dayjs | null;
|
|
74
|
+
format: string;
|
|
75
|
+
valueFormat: string;
|
|
76
|
+
placeholder: string;
|
|
77
|
+
clearable: boolean;
|
|
78
|
+
suffixIcon: string;
|
|
79
|
+
clearIcon: string;
|
|
80
|
+
teleportedWidth: string;
|
|
81
|
+
hourStep: number;
|
|
82
|
+
minuteStep: number;
|
|
83
|
+
secondStep: number;
|
|
84
|
+
use12Hours: boolean;
|
|
85
|
+
showSecond: boolean;
|
|
86
|
+
disabledTime: TimePickerDisabledTime;
|
|
87
|
+
hideDisabledOptions: boolean;
|
|
88
|
+
needConfirm: boolean;
|
|
89
|
+
showNow: boolean;
|
|
90
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
91
|
+
declare const _default: typeof __VLS_export;
|
|
92
|
+
export default _default;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type TimePickerModelValue, type TimePickerProps, type TimeRangePickerChangeInfo, type TimeRangePickerDisabledTime, type TimeRangePickerModelValue } from '.';
|
|
2
|
+
type TimeRangePickerEmitValue = Exclude<TimeRangePickerModelValue, undefined>;
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** modelValue 是 v-model 绑定值,格式为 [开始时间, 结束时间]。 */
|
|
5
|
+
modelValue?: TimeRangePickerModelValue;
|
|
6
|
+
/** format 是展示格式,默认 HH:mm:ss;use12Hours 时默认 h:mm:ss A。 */
|
|
7
|
+
format?: string;
|
|
8
|
+
/** valueFormat 是提交字符串格式;未传时优先保持传入值类型。 */
|
|
9
|
+
valueFormat?: string;
|
|
10
|
+
/** placeholder 是无值时的起止占位文案。 */
|
|
11
|
+
placeholder?: [string, string];
|
|
12
|
+
/** separatorIcon 是范围连接图标类名。 */
|
|
13
|
+
separatorIcon?: string;
|
|
14
|
+
/** size 是选择器尺寸,可选,默认 md,并与 Input/Button 高度对齐。 */
|
|
15
|
+
size?: TimePickerProps['size'];
|
|
16
|
+
/** disabled 表示是否禁用选择器交互。 */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** clearable 表示是否允许一键清空。 */
|
|
19
|
+
clearable?: boolean;
|
|
20
|
+
/** hourStep 是小时选项步长。 */
|
|
21
|
+
hourStep?: number;
|
|
22
|
+
/** minuteStep 是分钟选项步长。 */
|
|
23
|
+
minuteStep?: number;
|
|
24
|
+
/** secondStep 是秒选项步长。 */
|
|
25
|
+
secondStep?: number;
|
|
26
|
+
/** use12Hours 表示是否启用 12 小时制。 */
|
|
27
|
+
use12Hours?: boolean;
|
|
28
|
+
/** showSecond 控制是否显示秒列;未传时由 format 是否包含秒决定。 */
|
|
29
|
+
showSecond?: boolean;
|
|
30
|
+
/** disabledTime 用于禁用不可选时间。 */
|
|
31
|
+
disabledTime?: TimeRangePickerDisabledTime;
|
|
32
|
+
/** hideDisabledOptions 表示是否隐藏禁用选项。 */
|
|
33
|
+
hideDisabledOptions?: boolean;
|
|
34
|
+
/** suffixIcon 是右侧时钟图标类名。 */
|
|
35
|
+
suffixIcon?: string;
|
|
36
|
+
/** clearIcon 是清空按钮图标类名。 */
|
|
37
|
+
clearIcon?: string;
|
|
38
|
+
/** teleportedWidth 是下拉层固定宽度,默认按列数自动计算。 */
|
|
39
|
+
teleportedWidth?: string;
|
|
40
|
+
/** name 是隐藏 input 的原生 name,便于表单提交,值以逗号拼接。 */
|
|
41
|
+
name?: string;
|
|
42
|
+
};
|
|
43
|
+
declare function clear(event?: MouseEvent): void;
|
|
44
|
+
declare function focus(): void;
|
|
45
|
+
declare function blur(): void;
|
|
46
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
47
|
+
blur: typeof blur;
|
|
48
|
+
clear: typeof clear;
|
|
49
|
+
focus: typeof focus;
|
|
50
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
51
|
+
clear: () => any;
|
|
52
|
+
change: (value: TimeRangePickerEmitValue, timeStrings: [string, string], info: TimeRangePickerChangeInfo) => any;
|
|
53
|
+
focus: (event: FocusEvent) => any;
|
|
54
|
+
blur: (event: FocusEvent) => any;
|
|
55
|
+
"update:modelValue": (value: TimeRangePickerEmitValue) => any;
|
|
56
|
+
"visible-change": (value: boolean) => any;
|
|
57
|
+
ok: (value: TimeRangePickerEmitValue, timeStrings: [string, string], info: TimeRangePickerChangeInfo) => any;
|
|
58
|
+
"calendar-change": (value: TimeRangePickerModelValue, timeStrings: [string, string], info: TimeRangePickerChangeInfo) => any;
|
|
59
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
60
|
+
onClear?: (() => any) | undefined;
|
|
61
|
+
onChange?: ((value: TimeRangePickerEmitValue, timeStrings: [string, string], info: TimeRangePickerChangeInfo) => any) | undefined;
|
|
62
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
63
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
64
|
+
"onUpdate:modelValue"?: ((value: TimeRangePickerEmitValue) => any) | undefined;
|
|
65
|
+
"onVisible-change"?: ((value: boolean) => any) | undefined;
|
|
66
|
+
onOk?: ((value: TimeRangePickerEmitValue, timeStrings: [string, string], info: TimeRangePickerChangeInfo) => any) | undefined;
|
|
67
|
+
"onCalendar-change"?: ((value: TimeRangePickerModelValue, timeStrings: [string, string], info: TimeRangePickerChangeInfo) => any) | undefined;
|
|
68
|
+
}>, {
|
|
69
|
+
size: "sm" | "md" | "lg" | null;
|
|
70
|
+
disabled: boolean;
|
|
71
|
+
name: string;
|
|
72
|
+
modelValue: [TimePickerModelValue, TimePickerModelValue] | null;
|
|
73
|
+
format: string;
|
|
74
|
+
valueFormat: string;
|
|
75
|
+
placeholder: [string, string];
|
|
76
|
+
clearable: boolean;
|
|
77
|
+
suffixIcon: string;
|
|
78
|
+
clearIcon: string;
|
|
79
|
+
teleportedWidth: string;
|
|
80
|
+
separatorIcon: string;
|
|
81
|
+
hourStep: number;
|
|
82
|
+
minuteStep: number;
|
|
83
|
+
secondStep: number;
|
|
84
|
+
use12Hours: boolean;
|
|
85
|
+
showSecond: boolean;
|
|
86
|
+
disabledTime: TimeRangePickerDisabledTime;
|
|
87
|
+
hideDisabledOptions: boolean;
|
|
88
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
89
|
+
declare const _default: typeof __VLS_export;
|
|
90
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { Dayjs } from 'dayjs';
|
|
3
|
+
export { default as TimePicker } from './TimePicker.vue';
|
|
4
|
+
export { default as TimeRangePicker } from './TimeRangePicker.vue';
|
|
5
|
+
export type TimePickerModelValue = string | number | Date | Dayjs | null | undefined;
|
|
6
|
+
export type TimeRangePickerModelValue = [TimePickerModelValue, TimePickerModelValue] | null | undefined;
|
|
7
|
+
export type TimePickerUnit = 'hour' | 'minute' | 'second';
|
|
8
|
+
export type TimeRangePickerSide = 'start' | 'end';
|
|
9
|
+
export type TimeRangePickerDayOffset = 0 | 1;
|
|
10
|
+
/** TimePickerDisabledTimeOptions 定义不可选的小时、分钟和秒。 */
|
|
11
|
+
export interface TimePickerDisabledTimeOptions {
|
|
12
|
+
disabledHours?: () => number[];
|
|
13
|
+
disabledMinutes?: (selectedHour: number) => number[];
|
|
14
|
+
disabledSeconds?: (selectedHour: number, selectedMinute: number) => number[];
|
|
15
|
+
}
|
|
16
|
+
/** TimePickerDisabledTime 用于按当前时间返回不可选时间段。 */
|
|
17
|
+
export type TimePickerDisabledTime = (time: Dayjs) => TimePickerDisabledTimeOptions;
|
|
18
|
+
export type TimeRangePickerDisabledTime = (time: Dayjs, side: TimeRangePickerSide) => TimePickerDisabledTimeOptions;
|
|
19
|
+
export interface TimeRangePickerChangeInfo {
|
|
20
|
+
endDayOffset: TimeRangePickerDayOffset;
|
|
21
|
+
crossesDay: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** timePickerWrapper 定义 TimePicker 触发器的输入框样式。 */
|
|
24
|
+
export declare const timePickerWrapper: (props?: ({
|
|
25
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
26
|
+
focused?: boolean | null | undefined;
|
|
27
|
+
disabled?: boolean | null | undefined;
|
|
28
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
29
|
+
/** timePickerValue 定义触发器内部文本的尺寸与留白。 */
|
|
30
|
+
export declare const timePickerValue: (props?: ({
|
|
31
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
32
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
33
|
+
/** timePickerOption 定义时间列选项的状态样式。 */
|
|
34
|
+
export declare const timePickerOption: (props?: ({
|
|
35
|
+
selected?: boolean | null | undefined;
|
|
36
|
+
disabled?: boolean | null | undefined;
|
|
37
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
38
|
+
/** TimePickerProps 是 timePickerWrapper 变体推导出的组件属性类型。 */
|
|
39
|
+
export type TimePickerProps = VariantProps<typeof timePickerWrapper>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type TooltipArrow, type TooltipPlacement, type TooltipSemanticClassNames, type TooltipSemanticStyles, type TooltipTrigger } from '.';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** title 是提示内容;复杂内容可使用 title 插槽。 */
|
|
4
|
+
title?: string | number;
|
|
5
|
+
/** placement 是浮层位置。 */
|
|
6
|
+
placement?: TooltipPlacement;
|
|
7
|
+
/** trigger 是触发方式,可传单个或多个。 */
|
|
8
|
+
trigger?: TooltipTrigger | TooltipTrigger[];
|
|
9
|
+
/** open 是受控显隐状态。 */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** defaultOpen 是非受控默认显隐状态。 */
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
/** disabled 禁用 Tooltip 触发与展示。 */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** arrow 控制箭头展示,或设置 pointAtCenter。 */
|
|
16
|
+
arrow?: TooltipArrow;
|
|
17
|
+
/** color 自定义浮层背景颜色。 */
|
|
18
|
+
color?: string;
|
|
19
|
+
/** autoAdjustOverflow 表示溢出视口时是否自动翻转和夹紧。 */
|
|
20
|
+
autoAdjustOverflow?: boolean;
|
|
21
|
+
/** destroyOnHidden 隐藏后是否销毁浮层节点。 */
|
|
22
|
+
destroyOnHidden?: boolean;
|
|
23
|
+
/** fresh 表示关闭时仍实时更新内容。 */
|
|
24
|
+
fresh?: boolean;
|
|
25
|
+
/** mouseEnterDelay 是 hover 打开延迟,单位秒。 */
|
|
26
|
+
mouseEnterDelay?: number;
|
|
27
|
+
/** mouseLeaveDelay 是 hover 关闭延迟,单位秒。 */
|
|
28
|
+
mouseLeaveDelay?: number;
|
|
29
|
+
/** zIndex 自定义浮层层级。 */
|
|
30
|
+
zIndex?: number;
|
|
31
|
+
/** forceAlignKey 是外部触发布局重算的标记,适用于触发器位置被样式驱动改变。 */
|
|
32
|
+
forceAlignKey?: string | number;
|
|
33
|
+
/** classNames 定义 root/body/arrow 语义结构类名。 */
|
|
34
|
+
classNames?: TooltipSemanticClassNames;
|
|
35
|
+
/** styles 定义 root/body/arrow 语义结构样式。 */
|
|
36
|
+
styles?: TooltipSemanticStyles;
|
|
37
|
+
/** contentClass 是浮层根节点额外类名。 */
|
|
38
|
+
contentClass?: string;
|
|
39
|
+
};
|
|
40
|
+
declare var __VLS_1: {}, __VLS_9: {};
|
|
41
|
+
type __VLS_Slots = {} & {
|
|
42
|
+
default?: (props: typeof __VLS_1) => any;
|
|
43
|
+
} & {
|
|
44
|
+
title?: (props: typeof __VLS_9) => any;
|
|
45
|
+
};
|
|
46
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
47
|
+
"update:open": (value: boolean) => any;
|
|
48
|
+
openChange: (value: boolean) => any;
|
|
49
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
50
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
51
|
+
onOpenChange?: ((value: boolean) => any) | undefined;
|
|
52
|
+
}>, {
|
|
53
|
+
title: string | number;
|
|
54
|
+
classNames: TooltipSemanticClassNames;
|
|
55
|
+
styles: TooltipSemanticStyles;
|
|
56
|
+
color: string;
|
|
57
|
+
open: boolean;
|
|
58
|
+
disabled: boolean;
|
|
59
|
+
placement: TooltipPlacement;
|
|
60
|
+
zIndex: number;
|
|
61
|
+
trigger: TooltipTrigger | TooltipTrigger[];
|
|
62
|
+
arrow: TooltipArrow;
|
|
63
|
+
autoAdjustOverflow: boolean;
|
|
64
|
+
destroyOnHidden: boolean;
|
|
65
|
+
contentClass: string;
|
|
66
|
+
defaultOpen: boolean;
|
|
67
|
+
fresh: boolean;
|
|
68
|
+
mouseEnterDelay: number;
|
|
69
|
+
mouseLeaveDelay: number;
|
|
70
|
+
forceAlignKey: string | number;
|
|
71
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
72
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
73
|
+
declare const _default: typeof __VLS_export;
|
|
74
|
+
export default _default;
|
|
75
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
76
|
+
new (): {
|
|
77
|
+
$slots: S;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as Tooltip } from './Tooltip.vue';
|
|
2
|
+
export type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
3
|
+
export type TooltipTrigger = 'hover' | 'focus' | 'click' | 'contextMenu';
|
|
4
|
+
export type TooltipArrow = boolean | {
|
|
5
|
+
pointAtCenter?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type TooltipSemanticClassNames = Partial<Record<'root' | 'body' | 'arrow', string>>;
|
|
8
|
+
export type TooltipSemanticStyles = Partial<Record<'root' | 'body' | 'arrow', string | Record<string, string | number>>>;
|
|
9
|
+
/** tooltipRoot 定义 Tooltip 浮层根节点的基础视觉。 */
|
|
10
|
+
export declare const tooltipRoot: (props?: ({
|
|
11
|
+
interactive?: boolean | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
/** tooltipArrow 定义 Tooltip 箭头本体。 */
|
|
14
|
+
export declare const tooltipArrow: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
package/dist/uno.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PresetWind4Theme, Rule } from 'unocss';
|
|
2
|
+
type UnoUITheme = PresetWind4Theme;
|
|
3
|
+
export declare const unoUISemanticColorRules: Rule<UnoUITheme>[];
|
|
4
|
+
export declare const unoUITheme: {
|
|
5
|
+
colors: {
|
|
6
|
+
brand: {
|
|
7
|
+
DEFAULT: string;
|
|
8
|
+
50: string;
|
|
9
|
+
100: string;
|
|
10
|
+
200: string;
|
|
11
|
+
300: string;
|
|
12
|
+
400: string;
|
|
13
|
+
500: string;
|
|
14
|
+
600: string;
|
|
15
|
+
700: string;
|
|
16
|
+
800: string;
|
|
17
|
+
900: string;
|
|
18
|
+
950: string;
|
|
19
|
+
};
|
|
20
|
+
transparent: {
|
|
21
|
+
DEFAULT: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const unoUIPreflights: {
|
|
26
|
+
getCSS: ({ theme }: {
|
|
27
|
+
theme: UnoUITheme;
|
|
28
|
+
}) => string;
|
|
29
|
+
}[];
|
|
30
|
+
export declare const unoUIRules: Rule<UnoUITheme>[];
|
|
31
|
+
export declare const presetUnoUI: import("unocss").PresetFactory<object, undefined>;
|
|
32
|
+
export {};
|
package/dist/uno.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import e from "@unocss/preset-icons";
|
|
2
|
+
import { definePreset as t, presetWind4 as n } from "unocss";
|
|
3
|
+
//#region src/uno.ts
|
|
4
|
+
var r = {
|
|
5
|
+
bg: {
|
|
6
|
+
property: "background-color",
|
|
7
|
+
colors: {
|
|
8
|
+
primary: ["white", "zinc-950"],
|
|
9
|
+
secondary: ["slate-50", "zinc-900"],
|
|
10
|
+
tertiary: ["slate-200", "zinc-800"],
|
|
11
|
+
quaternary: ["slate-300", "zinc-400"],
|
|
12
|
+
quinary: ["slate-400", "zinc-300"]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
text: {
|
|
16
|
+
property: "color",
|
|
17
|
+
colors: {
|
|
18
|
+
primary: ["slate-950", "zinc-200"],
|
|
19
|
+
secondary: ["slate-700", "zinc-300"],
|
|
20
|
+
tertiary: ["slate-500", "zinc-500"],
|
|
21
|
+
quaternary: ["slate-300", "zinc-700"],
|
|
22
|
+
quinary: ["slate-200", "zinc-900"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
border: {
|
|
26
|
+
property: "border-color",
|
|
27
|
+
colors: {
|
|
28
|
+
faint: ["slate-50", "zinc-900"],
|
|
29
|
+
light: ["slate-100", "zinc-800"],
|
|
30
|
+
medium: ["slate-200", "zinc-700"],
|
|
31
|
+
strong: ["slate-400", "zinc-500"],
|
|
32
|
+
dark: ["slate-600", "zinc-400"],
|
|
33
|
+
heavy: ["slate-700", "zinc-300"]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, i = (e, t) => {
|
|
37
|
+
let [n, r] = t.split("-"), i = e.colors?.[n];
|
|
38
|
+
return typeof i == "string" ? i : i === void 0 ? t : r !== void 0 && typeof i[r] == "string" ? i[r] : typeof i.DEFAULT == "string" ? i.DEFAULT : t;
|
|
39
|
+
}, a = (e, t) => `--color-${e}-${t}`, o = (e, t, n) => {
|
|
40
|
+
let r = `var(${a(e, t)})`;
|
|
41
|
+
return n === void 0 ? r : `color-mix(in oklab, ${r} ${n}%, transparent)`;
|
|
42
|
+
}, s = (e) => {
|
|
43
|
+
let t = (t) => Object.entries(r).flatMap(([n, r]) => Object.entries(r.colors).map(([r, o]) => ` ${a(n, r)}: ${i(e, o[t])};`)).join("\n");
|
|
44
|
+
return `:root,\n[data-theme="light"] {\n${t(0)}\n}\n\n[data-theme="dark"] {\n${t(1)}\n}`;
|
|
45
|
+
}, c = Object.entries(r).map(([e, t]) => {
|
|
46
|
+
let n = Object.keys(t.colors).join("|");
|
|
47
|
+
return [RegExp(`^${e}-(${n})(?:/(\\d+))?$`), ([, n, r]) => ({ [t.property]: o(e, n, r) })];
|
|
48
|
+
}), l = { colors: {
|
|
49
|
+
brand: {
|
|
50
|
+
DEFAULT: "oklch(68.98% 0.1679 252.18)",
|
|
51
|
+
50: "oklch(96.63% 0.0165 250.84)",
|
|
52
|
+
100: "oklch(93.48% 0.0328 248.18)",
|
|
53
|
+
200: "oklch(90.16% 0.0498 249.31)",
|
|
54
|
+
300: "oklch(83.84% 0.0838 249.39)",
|
|
55
|
+
400: "oklch(77.49% 0.1190 250.28)",
|
|
56
|
+
500: "oklch(68.98% 0.1679 252.18)",
|
|
57
|
+
600: "oklch(58.50% 0.1407 252.23)",
|
|
58
|
+
700: "oklch(53.80% 0.1324 252.21)",
|
|
59
|
+
800: "oklch(45.87% 0.1122 252.86)",
|
|
60
|
+
900: "oklch(37.56% 0.0891 253.93)",
|
|
61
|
+
950: "oklch(29.01% 0.0633 254.34)"
|
|
62
|
+
},
|
|
63
|
+
transparent: { DEFAULT: "transparent" }
|
|
64
|
+
} }, u = [{ getCSS: ({ theme: e }) => s(e) }], d = [...c, [/^shadow-\[(.+)\]$/, ([, e], { theme: t }) => {
|
|
65
|
+
let n = e.split("_"), r = n[n.length - 1];
|
|
66
|
+
return n[n.length - 1] = i(t, r), { "box-shadow": n.join(" ") };
|
|
67
|
+
}]], f = t(() => ({
|
|
68
|
+
name: "@mcistudio/unoui-vue",
|
|
69
|
+
presets: [n({ dark: {
|
|
70
|
+
light: "[data-theme=\"light\"]",
|
|
71
|
+
dark: "[data-theme=\"dark\"]"
|
|
72
|
+
} }), e({ extraProperties: {
|
|
73
|
+
display: "inline-block",
|
|
74
|
+
"vertical-align": "middle"
|
|
75
|
+
} })],
|
|
76
|
+
theme: l,
|
|
77
|
+
preflights: u,
|
|
78
|
+
rules: d
|
|
79
|
+
}));
|
|
80
|
+
//#endregion
|
|
81
|
+
export { f as presetUnoUI, u as unoUIPreflights, d as unoUIRules, c as unoUISemanticColorRules, l as unoUITheme };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=uno.js.map
|
package/dist/uno.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uno.js","names":[],"sources":["../src/uno.ts"],"sourcesContent":["import presetIcons from '@unocss/preset-icons'\nimport { definePreset, presetWind4 } from 'unocss'\nimport type { PresetWind4Theme, Rule } from 'unocss'\n\ntype UnoUITheme = PresetWind4Theme\n\nconst bgColors = {\n primary: ['white', 'zinc-950'],\n secondary: ['slate-50', 'zinc-900'],\n tertiary: ['slate-200', 'zinc-800'],\n quaternary: ['slate-300', 'zinc-400'],\n quinary: ['slate-400', 'zinc-300']\n}\n\nconst textColors = {\n primary: ['slate-950', 'zinc-200'],\n secondary: ['slate-700', 'zinc-300'],\n tertiary: ['slate-500', 'zinc-500'],\n quaternary: ['slate-300', 'zinc-700'],\n quinary: ['slate-200', 'zinc-900']\n}\n\nconst borderColors = {\n faint: ['slate-50', 'zinc-900'],\n light: ['slate-100', 'zinc-800'],\n medium: ['slate-200', 'zinc-700'],\n strong: ['slate-400', 'zinc-500'],\n dark: ['slate-600', 'zinc-400'],\n heavy: ['slate-700', 'zinc-300']\n}\n\nconst semanticColorGroups = {\n bg: {\n property: 'background-color',\n colors: bgColors\n },\n text: {\n property: 'color',\n colors: textColors\n },\n border: {\n property: 'border-color',\n colors: borderColors\n }\n} as const\n\nconst resolveThemeColor = (theme: Readonly<UnoUITheme>, token: string) => {\n const [colorName, shade] = token.split('-')\n const color = theme.colors?.[colorName]\n if (typeof color === 'string') return color\n if (color === undefined) return token\n if (shade !== undefined && typeof color[shade] === 'string') return color[shade]\n if (typeof color.DEFAULT === 'string') return color.DEFAULT\n return token\n}\n\nconst semanticColorVariable = (group: keyof typeof semanticColorGroups, level: string) => `--color-${group}-${level}`\n\nconst semanticColorValue = (group: keyof typeof semanticColorGroups, level: string, opacity?: string) => {\n const color = `var(${semanticColorVariable(group, level)})`\n return opacity !== undefined ? `color-mix(in oklab, ${color} ${opacity}%, transparent)` : color\n}\n\nconst semanticColorPreflight = (theme: Readonly<UnoUITheme>) => {\n const buildVariables = (mode: 0 | 1) =>\n Object.entries(semanticColorGroups)\n .flatMap(([group, config]) =>\n Object.entries(config.colors).map(([level, colors]) => {\n return ` ${semanticColorVariable(group as keyof typeof semanticColorGroups, level)}: ${resolveThemeColor(theme, colors[mode])};`\n })\n )\n .join('\\n')\n\n return `:root,\\n[data-theme=\"light\"] {\\n${buildVariables(0)}\\n}\\n\\n[data-theme=\"dark\"] {\\n${buildVariables(1)}\\n}`\n}\n\nexport const unoUISemanticColorRules: Rule<UnoUITheme>[] = (Object.entries(semanticColorGroups) as Array<[keyof typeof semanticColorGroups, (typeof semanticColorGroups)[keyof typeof semanticColorGroups]]>).map(([group, config]): Rule<UnoUITheme> => {\n const levels = Object.keys(config.colors).join('|')\n return [\n new RegExp(`^${group}-(${levels})(?:/(\\\\d+))?$`),\n ([, level, opacity]) => ({\n [config.property]: semanticColorValue(group, level, opacity)\n })\n ]\n})\n\nexport const unoUITheme = {\n colors: {\n brand: {\n DEFAULT: 'oklch(68.98% 0.1679 252.18)',\n 50: 'oklch(96.63% 0.0165 250.84)',\n 100: 'oklch(93.48% 0.0328 248.18)',\n 200: 'oklch(90.16% 0.0498 249.31)',\n 300: 'oklch(83.84% 0.0838 249.39)',\n 400: 'oklch(77.49% 0.1190 250.28)',\n 500: 'oklch(68.98% 0.1679 252.18)',\n 600: 'oklch(58.50% 0.1407 252.23)',\n 700: 'oklch(53.80% 0.1324 252.21)',\n 800: 'oklch(45.87% 0.1122 252.86)',\n 900: 'oklch(37.56% 0.0891 253.93)',\n 950: 'oklch(29.01% 0.0633 254.34)'\n },\n transparent: {\n DEFAULT: 'transparent'\n }\n }\n} satisfies UnoUITheme\n\nexport const unoUIPreflights = [\n {\n getCSS: ({ theme }: { theme: UnoUITheme }) => semanticColorPreflight(theme)\n }\n]\n\nexport const unoUIRules: Rule<UnoUITheme>[] = [\n ...unoUISemanticColorRules,\n [\n /^shadow-\\[(.+)\\]$/,\n ([, value], { theme }) => {\n const parts = value.split('_')\n const colorPart = parts[parts.length - 1]\n\n parts[parts.length - 1] = resolveThemeColor(theme, colorPart)\n return {\n 'box-shadow': parts.join(' ')\n }\n }\n ]\n]\n\nexport const presetUnoUI = definePreset(() => ({\n name: '@mcistudio/unoui-vue',\n presets: [\n presetWind4({\n dark: {\n light: '[data-theme=\"light\"]',\n dark: '[data-theme=\"dark\"]'\n }\n }),\n presetIcons({\n extraProperties: {\n display: 'inline-block',\n 'vertical-align': 'middle'\n }\n })\n ],\n theme: unoUITheme,\n preflights: unoUIPreflights,\n rules: unoUIRules\n}))\n"],"mappings":";;;AA+BA,IAAM,IAAsB;CAC1B,IAAI;EACF,UAAU;EACV,QAAQ;GA3BV,SAAS,CAAC,SAAS,UAAU;GAC7B,WAAW,CAAC,YAAY,UAAU;GAClC,UAAU,CAAC,aAAa,UAAU;GAClC,YAAY,CAAC,aAAa,UAAU;GACpC,SAAS,CAAC,aAAa,UAAU;EAuBvB;CACV;CACA,MAAM;EACJ,UAAU;EACV,QAAQ;GAvBV,SAAS,CAAC,aAAa,UAAU;GACjC,WAAW,CAAC,aAAa,UAAU;GACnC,UAAU,CAAC,aAAa,UAAU;GAClC,YAAY,CAAC,aAAa,UAAU;GACpC,SAAS,CAAC,aAAa,UAAU;EAmBvB;CACV;CACA,QAAQ;EACN,UAAU;EACV,QAAQ;GAnBV,OAAO,CAAC,YAAY,UAAU;GAC9B,OAAO,CAAC,aAAa,UAAU;GAC/B,QAAQ,CAAC,aAAa,UAAU;GAChC,QAAQ,CAAC,aAAa,UAAU;GAChC,MAAM,CAAC,aAAa,UAAU;GAC9B,OAAO,CAAC,aAAa,UAAU;EAcrB;CACV;AACF,GAEM,KAAqB,GAA6B,MAAkB;CACxE,IAAM,CAAC,GAAW,KAAS,EAAM,MAAM,GAAG,GACpC,IAAQ,EAAM,SAAS;CAK7B,OAJI,OAAO,KAAU,WAAiB,IAClC,MAAU,KAAA,IAAkB,IAC5B,MAAU,KAAA,KAAa,OAAO,EAAM,MAAW,WAAiB,EAAM,KACtE,OAAO,EAAM,WAAY,WAAiB,EAAM,UAC7C;AACT,GAEM,KAAyB,GAAyC,MAAkB,WAAW,EAAM,GAAG,KAExG,KAAsB,GAAyC,GAAe,MAAqB;CACvG,IAAM,IAAQ,OAAO,EAAsB,GAAO,CAAK,EAAE;CACzD,OAAO,MAAY,KAAA,IAAuE,IAA3D,uBAAuB,EAAM,GAAG,EAAQ;AACzE,GAEM,KAA0B,MAAgC;CAC9D,IAAM,KAAkB,MACtB,OAAO,QAAQ,CAAmB,CAAC,CAChC,SAAS,CAAC,GAAO,OAChB,OAAO,QAAQ,EAAO,MAAM,CAAC,CAAC,KAAK,CAAC,GAAO,OAClC,KAAK,EAAsB,GAA2C,CAAK,EAAE,IAAI,EAAkB,GAAO,EAAO,EAAK,EAAE,EAChI,CACH,CAAC,CACA,KAAK,IAAI;CAEd,OAAO,mCAAmC,EAAe,CAAC,EAAE,gCAAgC,EAAe,CAAC,EAAE;AAChH,GAEa,IAA+C,OAAO,QAAQ,CAAmB,CAAC,CAA+G,KAAK,CAAC,GAAO,OAA8B;CACvP,IAAM,IAAS,OAAO,KAAK,EAAO,MAAM,CAAC,CAAC,KAAK,GAAG;CAClD,OAAO,CACD,OAAO,IAAI,EAAM,IAAI,EAAO,eAAe,IAC9C,GAAG,GAAO,QAAc,GACtB,EAAO,WAAW,EAAmB,GAAO,GAAO,CAAO,EAC7D,EACF;AACF,CAAC,GAEY,IAAa,EACxB,QAAQ;CACN,OAAO;EACL,SAAS;EACT,IAAI;EACJ,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACP;CACA,aAAa,EACX,SAAS,cACX;AACF,EACF,GAEa,IAAkB,CAC7B,EACE,SAAS,EAAE,eAAmC,EAAuB,CAAK,EAC5E,CACF,GAEa,IAAiC,CAC5C,GAAG,GACH,CACE,sBACC,GAAG,IAAQ,EAAE,eAAY;CACxB,IAAM,IAAQ,EAAM,MAAM,GAAG,GACvB,IAAY,EAAM,EAAM,SAAS;CAGvC,OADA,EAAM,EAAM,SAAS,KAAK,EAAkB,GAAO,CAAS,GACrD,EACL,cAAc,EAAM,KAAK,GAAG,EAC9B;AACF,CACF,CACF,GAEa,IAAc,SAAoB;CAC7C,MAAM;CACN,SAAS,CACP,EAAY,EACV,MAAM;EACJ,OAAO;EACP,MAAM;CACR,EACF,CAAC,GACD,EAAY,EACV,iBAAiB;EACf,SAAS;EACT,kBAAkB;CACpB,EACF,CAAC,CACH;CACA,OAAO;CACP,YAAY;CACZ,OAAO;AACT,EAAE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 拖拽排序类。
|
|
3
|
+
*
|
|
4
|
+
* 用于处理列表元素的拖拽排序,支持自动滚动、拖拽手柄和禁止跨层级排序。
|
|
5
|
+
*/
|
|
6
|
+
type IDType<T> = T extends number | string ? T : never;
|
|
7
|
+
interface DnDOptions<T> {
|
|
8
|
+
onReorder: (ids: IDType<T>[]) => void;
|
|
9
|
+
onDrop?: (oldIndex: number, newIndex: number) => void;
|
|
10
|
+
allowNesting?: boolean;
|
|
11
|
+
handle?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class DnD<T> {
|
|
14
|
+
private elRef;
|
|
15
|
+
private onReorder;
|
|
16
|
+
private onDrop?;
|
|
17
|
+
private sourceEl;
|
|
18
|
+
private list;
|
|
19
|
+
private allowNesting;
|
|
20
|
+
private scrollThreshold;
|
|
21
|
+
private scrollInterval;
|
|
22
|
+
private maxScrollSpeed;
|
|
23
|
+
private scrollAcceleration;
|
|
24
|
+
private currentScrollSpeed;
|
|
25
|
+
private isAnimating;
|
|
26
|
+
private oldIndex;
|
|
27
|
+
private handle?;
|
|
28
|
+
private lastMouseDownTarget;
|
|
29
|
+
constructor(elRef: HTMLElement | null, options?: DnDOptions<T>);
|
|
30
|
+
private onMouseDown;
|
|
31
|
+
private onDragStart;
|
|
32
|
+
private handleScroll;
|
|
33
|
+
private onDragOver;
|
|
34
|
+
private onDragEnd;
|
|
35
|
+
init(): void;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
}
|
|
38
|
+
export {};
|