@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
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# @mcistudio/unoui-vue
|
|
2
|
+
|
|
3
|
+
An UnoCSS component library for Vue 3 admin applications.
|
|
4
|
+
|
|
5
|
+
[Live demo](https://giacomohuang.github.io/UnoUI/) · [Repository](https://github.com/giacomohuang/UnoUI)
|
|
6
|
+
|
|
7
|
+
UnoUI provides common admin components for forms, data display, selection, and feedback overlays. It supports focused component imports, TypeScript types, semantic theme tokens, and light and dark themes.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Vue 3 Composition API with TypeScript types
|
|
12
|
+
- UnoCSS utilities and Iconify icons
|
|
13
|
+
- Light and dark themes controlled through `data-theme`
|
|
14
|
+
- Focused component subpath imports
|
|
15
|
+
- Compact controls for data-dense admin interfaces
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
| Dependency | Version |
|
|
20
|
+
| ---------------------- | ------------------------- |
|
|
21
|
+
| Vue | `^3.5.0` |
|
|
22
|
+
| Vue I18n | `^11.0.0` |
|
|
23
|
+
| UnoCSS | `^66.7.3` |
|
|
24
|
+
| `@unocss/preset-icons` | `^66.7.3` |
|
|
25
|
+
| Node.js | `^20.19.0` or `>=22.12.0` |
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm add @mcistudio/unoui-vue
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
Import the generated UnoCSS output and UnoUI component styles once in the application entry:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { configureUnoUI } from '@mcistudio/unoui-vue/config'
|
|
39
|
+
import { createApp } from 'vue'
|
|
40
|
+
|
|
41
|
+
import App from './App.vue'
|
|
42
|
+
|
|
43
|
+
import 'virtual:uno.css'
|
|
44
|
+
import '@mcistudio/unoui-vue/style.css'
|
|
45
|
+
|
|
46
|
+
configureUnoUI({
|
|
47
|
+
locale: 'en'
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
createApp(App).mount('#app')
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Enable the UnoUI preset and scan the compiled package entries in `uno.config.ts`:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { defineConfig, transformerDirectives, transformerVariantGroup } from 'unocss'
|
|
57
|
+
import { presetUnoUI } from '@mcistudio/unoui-vue/uno'
|
|
58
|
+
|
|
59
|
+
export default defineConfig({
|
|
60
|
+
presets: [presetUnoUI()],
|
|
61
|
+
transformers: [transformerDirectives(), transformerVariantGroup()],
|
|
62
|
+
content: {
|
|
63
|
+
pipeline: {
|
|
64
|
+
include: ['src/**/*.{vue,js,ts}', 'node_modules/@mcistudio/unoui-vue/dist/**/*.js']
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Import components and types from focused subpaths:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { Button } from '@mcistudio/unoui-vue/button'
|
|
74
|
+
import { Input } from '@mcistudio/unoui-vue/input'
|
|
75
|
+
import { Table, type TableColumn } from '@mcistudio/unoui-vue/table'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Themes
|
|
79
|
+
|
|
80
|
+
Set `data-theme="dark"` on the document root to enable the dark theme. The light theme is used when the attribute is absent.
|
|
81
|
+
|
|
82
|
+
## Components
|
|
83
|
+
|
|
84
|
+
| Category | Components |
|
|
85
|
+
| --------------------- | --------------------------------------------------------------------------------------------- |
|
|
86
|
+
| Layout | `Splitter`, `SplitterPanel` |
|
|
87
|
+
| General | `Button`, `ButtonGroup`, `Tag`, `Badge`, `BadgeRibbon` |
|
|
88
|
+
| Form | `Form`, `FormItem`, `Input`, `Autocomplete`, `InputTag`, `InputI18n`, `InputOtp` |
|
|
89
|
+
| Selection | `Checkbox`, `CheckboxGroup`, `Radio`, `RadioGroup`, `Switch`, `Select` |
|
|
90
|
+
| Date and numeric | `DatePicker`, `RangePicker`, `TimePicker`, `TimeRangePicker`, `Slider`, `ColorPicker`, `Rate` |
|
|
91
|
+
| Data display | `Table`, `Pagination`, `Progress`, `Skeleton`, `QRCode`, `MillerColumns` |
|
|
92
|
+
| Feedback and overlays | `Alert`, `message`, `Modal`, `Drawer`, `Tooltip`, `Popconfirm`, `Dropdown` |
|
|
93
|
+
| Navigation | `Tabs`, `TabPane` |
|
|
94
|
+
|
|
95
|
+
See the [live demo](https://giacomohuang.github.io/UnoUI/) for complete examples, API tables, and interaction states.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type AlertClosableOptions, type AlertSemanticClassNames, type AlertSemanticStyles, type AlertType, type AlertVariant } from '.';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** title 是警告提示主内容。 */
|
|
4
|
+
title?: string | number;
|
|
5
|
+
/** description 是警告提示辅助说明。 */
|
|
6
|
+
description?: string | number;
|
|
7
|
+
/** type 指定 success、info、warning、error 四种语义状态。 */
|
|
8
|
+
type?: AlertType;
|
|
9
|
+
/** variant 指定边框样式或填充样式。 */
|
|
10
|
+
variant?: AlertVariant;
|
|
11
|
+
/** banner 表示顶部公告形态,默认展示图标且类型为 warning。 */
|
|
12
|
+
banner?: boolean;
|
|
13
|
+
/** showIcon 控制是否展示状态图标,banner 模式默认展示。 */
|
|
14
|
+
showIcon?: boolean;
|
|
15
|
+
/** icon 是自定义 UnoCSS/Iconify 图标类名,仅 showIcon 生效。 */
|
|
16
|
+
icon?: string;
|
|
17
|
+
/** action 是简短操作文本;复杂操作建议使用 action 插槽。 */
|
|
18
|
+
action?: string | number;
|
|
19
|
+
/** closable 控制关闭按钮;对象形式可配置关闭图标和回调。 */
|
|
20
|
+
closable?: boolean | AlertClosableOptions;
|
|
21
|
+
/** closeAriaLabel 是关闭按钮无障碍文案。 */
|
|
22
|
+
closeAriaLabel?: string;
|
|
23
|
+
/** classNames 定义 root/icon/section/title/description/actions/close 语义结构类名。 */
|
|
24
|
+
classNames?: AlertSemanticClassNames;
|
|
25
|
+
/** styles 定义 root/icon/section/title/description/actions/close 语义结构样式。 */
|
|
26
|
+
styles?: AlertSemanticStyles;
|
|
27
|
+
};
|
|
28
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {}, __VLS_9: {};
|
|
29
|
+
type __VLS_Slots = {} & {
|
|
30
|
+
icon?: (props: typeof __VLS_1) => any;
|
|
31
|
+
} & {
|
|
32
|
+
title?: (props: typeof __VLS_3) => any;
|
|
33
|
+
} & {
|
|
34
|
+
description?: (props: typeof __VLS_5) => any;
|
|
35
|
+
} & {
|
|
36
|
+
action?: (props: typeof __VLS_7) => any;
|
|
37
|
+
} & {
|
|
38
|
+
closeIcon?: (props: typeof __VLS_9) => any;
|
|
39
|
+
};
|
|
40
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
41
|
+
close: (event: MouseEvent) => any;
|
|
42
|
+
afterClose: () => any;
|
|
43
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
44
|
+
onClose?: ((event: MouseEvent) => any) | undefined;
|
|
45
|
+
onAfterClose?: (() => any) | undefined;
|
|
46
|
+
}>, {
|
|
47
|
+
icon: string;
|
|
48
|
+
title: string | number;
|
|
49
|
+
description: string | number;
|
|
50
|
+
type: AlertType;
|
|
51
|
+
variant: AlertVariant;
|
|
52
|
+
banner: boolean;
|
|
53
|
+
showIcon: boolean;
|
|
54
|
+
action: string | number;
|
|
55
|
+
closable: boolean | AlertClosableOptions;
|
|
56
|
+
closeAriaLabel: string;
|
|
57
|
+
classNames: AlertSemanticClassNames;
|
|
58
|
+
styles: AlertSemanticStyles;
|
|
59
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
60
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
61
|
+
declare const _default: typeof __VLS_export;
|
|
62
|
+
export default _default;
|
|
63
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
64
|
+
new (): {
|
|
65
|
+
$slots: S;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { CSSProperties } from 'vue';
|
|
3
|
+
export { default as Alert } from './Alert.vue';
|
|
4
|
+
export type AlertType = 'success' | 'info' | 'warning' | 'error';
|
|
5
|
+
export type AlertVariant = 'outlined' | 'filled';
|
|
6
|
+
export type AlertSemanticName = 'root' | 'icon' | 'section' | 'title' | 'description' | 'actions' | 'close';
|
|
7
|
+
export type AlertSemanticClassNames = Partial<Record<AlertSemanticName, string>>;
|
|
8
|
+
export type AlertSemanticStyles = Partial<Record<AlertSemanticName, CSSProperties | string>>;
|
|
9
|
+
export interface AlertClosableOptions {
|
|
10
|
+
closeIcon?: string;
|
|
11
|
+
closeAriaLabel?: string;
|
|
12
|
+
afterClose?: () => void;
|
|
13
|
+
onClose?: (event: MouseEvent) => void;
|
|
14
|
+
}
|
|
15
|
+
/** alertRoot 定义 Alert 根节点的状态色、边框和关闭动画。 */
|
|
16
|
+
export declare const alertRoot: (props?: ({
|
|
17
|
+
type?: "success" | "info" | "warning" | "error" | null | undefined;
|
|
18
|
+
variant?: "outlined" | "filled" | null | undefined;
|
|
19
|
+
banner?: boolean | null | undefined;
|
|
20
|
+
withDescription?: boolean | null | undefined;
|
|
21
|
+
closing?: boolean | null | undefined;
|
|
22
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
23
|
+
/** alertIcon 定义 Alert 状态图标尺寸和颜色。 */
|
|
24
|
+
export declare const alertIcon: (props?: ({
|
|
25
|
+
type?: "success" | "info" | "warning" | "error" | null | undefined;
|
|
26
|
+
withDescription?: boolean | null | undefined;
|
|
27
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
28
|
+
/** alertSection 定义 Alert 文案区布局。 */
|
|
29
|
+
export declare const alertSection: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
30
|
+
/** alertTitle 定义 Alert 标题文本样式。 */
|
|
31
|
+
export declare const alertTitle: (props?: ({
|
|
32
|
+
withDescription?: boolean | null | undefined;
|
|
33
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
34
|
+
/** alertDescription 定义 Alert 辅助描述文本样式。 */
|
|
35
|
+
export declare const alertDescription: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
36
|
+
/** alertActions 定义 Alert 操作区布局。 */
|
|
37
|
+
export declare const alertActions: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
38
|
+
/** alertCloseButton 定义 Alert 关闭按钮交互样式。 */
|
|
39
|
+
export declare const alertCloseButton: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
40
|
+
export type AlertRootProps = VariantProps<typeof alertRoot>;
|
package/dist/attrs.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { StyleValue } from 'vue';
|
|
2
|
+
type UiAttrs = Record<string, unknown>;
|
|
3
|
+
/** 获取透传 class,供根节点样式计算复用。 */
|
|
4
|
+
export declare function getUiAttrClass(attrs: UiAttrs): string;
|
|
5
|
+
/** 获取透传 style,供根节点直接绑定。 */
|
|
6
|
+
export declare function getUiAttrStyle(attrs: UiAttrs): StyleValue | undefined;
|
|
7
|
+
/** class/style 通常绑定在组件根节点,其余属性继续透传给内部原生节点。 */
|
|
8
|
+
export declare function getUiExposeAttrs(attrs: UiAttrs): {
|
|
9
|
+
[x: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
package/dist/attrs.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { clsx as e } from "clsx";
|
|
2
|
+
//#region src/attrs.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
return e(t.class);
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
return e.style;
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
let { class: t, style: n, ...r } = e;
|
|
11
|
+
return r;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as getUiAttrClass, n as getUiAttrStyle, r as getUiExposeAttrs };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=attrs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attrs.js","names":[],"sources":["../src/attrs.ts"],"sourcesContent":["import { clsx } from 'clsx'\nimport type { StyleValue } from 'vue'\n\ntype UiAttrs = Record<string, unknown>\n\n/** 获取透传 class,供根节点样式计算复用。 */\nexport function getUiAttrClass(attrs: UiAttrs) {\n return clsx(attrs.class as string | undefined)\n}\n\n/** 获取透传 style,供根节点直接绑定。 */\nexport function getUiAttrStyle(attrs: UiAttrs) {\n return attrs.style as StyleValue | undefined\n}\n\n/** class/style 通常绑定在组件根节点,其余属性继续透传给内部原生节点。 */\nexport function getUiExposeAttrs(attrs: UiAttrs) {\n const { class: _class, style: _style, ...rest } = attrs\n return rest\n}\n"],"mappings":";;AAMA,SAAgB,EAAe,GAAgB;CAC7C,OAAO,EAAK,EAAM,KAA2B;AAC/C;AAGA,SAAgB,EAAe,GAAgB;CAC7C,OAAO,EAAM;AACf;AAGA,SAAgB,EAAiB,GAAgB;CAC/C,IAAM,EAAE,OAAO,GAAQ,OAAO,GAAQ,GAAG,MAAS;CAClD,OAAO;AACT"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type BadgeSemanticClassNames, type BadgeSemanticStyles, type BadgeSize, type BadgeStatus } from '.';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** count 是展示的数字或文本,大于 overflowCount 时显示为 overflowCount+。 */
|
|
4
|
+
count?: number | string;
|
|
5
|
+
/** dot 表示只展示小圆点,不展示数字。 */
|
|
6
|
+
dot?: boolean;
|
|
7
|
+
/** overflowCount 是数字封顶值。 */
|
|
8
|
+
overflowCount?: number;
|
|
9
|
+
/** showZero 控制 count 为 0 时是否仍展示徽标。 */
|
|
10
|
+
showZero?: boolean;
|
|
11
|
+
/** status 将 Badge 切换为状态点模式。 */
|
|
12
|
+
status?: BadgeStatus;
|
|
13
|
+
/** text 是状态点旁边的说明文本。 */
|
|
14
|
+
text?: string | number;
|
|
15
|
+
/** color 自定义徽标或状态点背景色。 */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** size 在数字徽标模式下控制大小。 */
|
|
18
|
+
size?: BadgeSize;
|
|
19
|
+
/** offset 设置徽标相对默认位置的 [x, y] 偏移,单位 px。 */
|
|
20
|
+
offset?: [number, number];
|
|
21
|
+
/** title 是徽标的原生 title。 */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** classNames 定义 root/indicator/text 语义结构类名。 */
|
|
24
|
+
classNames?: BadgeSemanticClassNames;
|
|
25
|
+
/** styles 定义 root/indicator/text 语义结构样式。 */
|
|
26
|
+
styles?: BadgeSemanticStyles;
|
|
27
|
+
};
|
|
28
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_11: {};
|
|
29
|
+
type __VLS_Slots = {} & {
|
|
30
|
+
text?: (props: typeof __VLS_1) => any;
|
|
31
|
+
} & {
|
|
32
|
+
default?: (props: typeof __VLS_3) => any;
|
|
33
|
+
} & {
|
|
34
|
+
count?: (props: typeof __VLS_11) => any;
|
|
35
|
+
};
|
|
36
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
37
|
+
title: string;
|
|
38
|
+
classNames: BadgeSemanticClassNames;
|
|
39
|
+
styles: BadgeSemanticStyles;
|
|
40
|
+
text: string | number;
|
|
41
|
+
count: number | string;
|
|
42
|
+
dot: boolean;
|
|
43
|
+
overflowCount: number;
|
|
44
|
+
showZero: boolean;
|
|
45
|
+
status: BadgeStatus;
|
|
46
|
+
color: string;
|
|
47
|
+
size: BadgeSize;
|
|
48
|
+
offset: [number, number];
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
51
|
+
declare const _default: typeof __VLS_export;
|
|
52
|
+
export default _default;
|
|
53
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
54
|
+
new (): {
|
|
55
|
+
$slots: S;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type BadgeRibbonColor, type BadgeRibbonPlacement, type BadgeRibbonSemanticClassNames, type BadgeRibbonSemanticStyles } from '.';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** text 是缎带中展示的内容;复杂内容可使用 text 插槽。 */
|
|
4
|
+
text?: string | number;
|
|
5
|
+
/** color 支持内置颜色名或 CSS 颜色值。 */
|
|
6
|
+
color?: BadgeRibbonColor | string;
|
|
7
|
+
/** placement 控制缎带贴在起始侧或结束侧。 */
|
|
8
|
+
placement?: BadgeRibbonPlacement;
|
|
9
|
+
/** classNames 定义 root/indicator/content 语义结构类名。 */
|
|
10
|
+
classNames?: BadgeRibbonSemanticClassNames;
|
|
11
|
+
/** styles 定义 root/indicator/content 语义结构样式。 */
|
|
12
|
+
styles?: BadgeRibbonSemanticStyles;
|
|
13
|
+
};
|
|
14
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_1) => any;
|
|
17
|
+
} & {
|
|
18
|
+
text?: (props: typeof __VLS_3) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
21
|
+
classNames: BadgeRibbonSemanticClassNames;
|
|
22
|
+
styles: BadgeRibbonSemanticStyles;
|
|
23
|
+
text: string | number;
|
|
24
|
+
color: BadgeRibbonColor | string;
|
|
25
|
+
placement: BadgeRibbonPlacement;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { CSSProperties } from 'vue';
|
|
3
|
+
export { default as Badge } from './Badge.vue';
|
|
4
|
+
export { default as BadgeRibbon } from './BadgeRibbon.vue';
|
|
5
|
+
export type BadgeStatus = 'success' | 'processing' | 'default' | 'error' | 'warning';
|
|
6
|
+
export type BadgeSize = 'medium' | 'small';
|
|
7
|
+
export type BadgeRibbonPlacement = 'start' | 'end';
|
|
8
|
+
export type BadgeSemanticName = 'root' | 'indicator' | 'text';
|
|
9
|
+
export type BadgeRibbonSemanticName = 'root' | 'indicator' | 'content';
|
|
10
|
+
export type BadgeSemanticClassNames = Partial<Record<BadgeSemanticName, string>>;
|
|
11
|
+
export type BadgeRibbonSemanticClassNames = Partial<Record<BadgeRibbonSemanticName, string>>;
|
|
12
|
+
export type BadgeSemanticStyles = Partial<Record<BadgeSemanticName, CSSProperties | string>>;
|
|
13
|
+
export type BadgeRibbonSemanticStyles = Partial<Record<BadgeRibbonSemanticName, CSSProperties | string>>;
|
|
14
|
+
/** badgeRoot 定义 Badge 包裹节点或状态点节点布局。 */
|
|
15
|
+
export declare const badgeRoot: (props?: ({
|
|
16
|
+
statusMode?: boolean | null | undefined;
|
|
17
|
+
standalone?: boolean | null | undefined;
|
|
18
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
|
+
/** badgeIndicator 定义数字徽标和小红点的核心样式。 */
|
|
20
|
+
export declare const badgeIndicator: (props?: ({
|
|
21
|
+
mode?: "count" | "dot" | "status" | null | undefined;
|
|
22
|
+
size?: "small" | "medium" | null | undefined;
|
|
23
|
+
anchored?: boolean | null | undefined;
|
|
24
|
+
status?: "success" | "warning" | "error" | "default" | "processing" | null | undefined;
|
|
25
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
26
|
+
/** badgeStatusText 定义状态点旁文本。 */
|
|
27
|
+
export declare const badgeStatusText: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
28
|
+
/** badgeRibbonRoot 定义缎带徽标包裹容器,允许折角伸出内容边界。 */
|
|
29
|
+
export declare const badgeRibbonRoot: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
30
|
+
/** badgeRibbonIndicator 定义缎带徽标位置、颜色和阴影。 */
|
|
31
|
+
export declare const badgeRibbonIndicator: (props?: ({
|
|
32
|
+
placement?: "end" | "start" | null | undefined;
|
|
33
|
+
color?: "blue" | "gray" | "green" | "orange" | "red" | "yellow" | "brand" | "custom" | null | undefined;
|
|
34
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
35
|
+
/** badgeRibbonFold 定义缎带折角阴影。 */
|
|
36
|
+
export declare const badgeRibbonFold: (props?: ({
|
|
37
|
+
placement?: "end" | "start" | null | undefined;
|
|
38
|
+
color?: "blue" | "gray" | "green" | "orange" | "red" | "yellow" | "brand" | "custom" | null | undefined;
|
|
39
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
40
|
+
export type BadgeIndicatorProps = VariantProps<typeof badgeIndicator>;
|
|
41
|
+
export type BadgeRibbonIndicatorProps = VariantProps<typeof badgeRibbonIndicator>;
|
|
42
|
+
export type BadgeRibbonColor = NonNullable<BadgeRibbonIndicatorProps['color']>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../chunks/badge-BHOZeImh.js";
|
|
2
|
+
export { t as Badge, o as BadgeRibbon, s as badgeIndicator, r as badgeRibbonFold, a as badgeRibbonIndicator, n as badgeRibbonRoot, e as badgeRoot, i as badgeStatusText };
|
package/dist/build.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ButtonProps } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Button 是管理端轻量按钮组件,统一颜色、尺寸、圆角、图标和加载态样式。
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
/** color 是按钮色彩语义,可选,默认 brand。 */
|
|
7
|
+
color?: ButtonProps['color'];
|
|
8
|
+
/** variant 是按钮视觉变体,可选,默认 default。 */
|
|
9
|
+
variant?: ButtonProps['variant'];
|
|
10
|
+
/** icon 是 UnoCSS/Iconify 图标类名,可选。 */
|
|
11
|
+
icon?: string;
|
|
12
|
+
/** iconSize 是图标字号像素值字符串,可选,默认 14。 */
|
|
13
|
+
iconSize?: string;
|
|
14
|
+
/** size 是按钮尺寸,可选,默认 md。 */
|
|
15
|
+
size?: ButtonProps['size'];
|
|
16
|
+
/** radius 是按钮圆角尺寸,可选,默认 md。 */
|
|
17
|
+
radius?: ButtonProps['radius'];
|
|
18
|
+
/** loading 表示是否展示加载图标,可选,默认 false。 */
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
/** disabled 表示是否禁用点击和指针事件,可选,默认 false。 */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** type 是原生 button 类型,可选,默认 button,避免表单内误触发提交。 */
|
|
23
|
+
type?: 'button' | 'submit' | 'reset';
|
|
24
|
+
};
|
|
25
|
+
declare var __VLS_1: {};
|
|
26
|
+
type __VLS_Slots = {} & {
|
|
27
|
+
default?: (props: typeof __VLS_1) => any;
|
|
28
|
+
};
|
|
29
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
30
|
+
type: "button" | "submit" | "reset";
|
|
31
|
+
variant: "link" | "default" | "dashed" | "outline" | "mono" | null;
|
|
32
|
+
color: "gray" | "green" | "orange" | "red" | "yellow" | "brand" | null;
|
|
33
|
+
size: "icon" | "sm" | "md" | "lg" | "icon-md" | "icon-lg" | null;
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
radius: "none" | "sm" | "md" | "lg" | "full" | null;
|
|
36
|
+
iconSize: string;
|
|
37
|
+
loading: boolean;
|
|
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,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export { default as Button } from './Button.vue';
|
|
3
|
+
export { default as ButtonGroup } from './ButtonGroup.vue';
|
|
4
|
+
/** button 定义管理端 Button 组件的样式变体组合。 */
|
|
5
|
+
export declare const button: (props?: ({
|
|
6
|
+
color?: "gray" | "green" | "orange" | "red" | "yellow" | "brand" | null | undefined;
|
|
7
|
+
variant?: "link" | "default" | "dashed" | "outline" | "mono" | null | undefined;
|
|
8
|
+
size?: "icon" | "sm" | "md" | "lg" | "icon-md" | "icon-lg" | null | undefined;
|
|
9
|
+
radius?: "none" | "sm" | "md" | "lg" | "full" | null | undefined;
|
|
10
|
+
disabled?: boolean | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
/** ButtonProps 是 button 变体推导出的组件属性类型。 */
|
|
13
|
+
export type ButtonProps = VariantProps<typeof button>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type CheckboxSize, type CheckboxValue } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Checkbox 是编辑器 UI 使用的原生复选框封装。
|
|
4
|
+
*
|
|
5
|
+
* 组件保留 input 原生事件;组内受控值由 CheckboxGroup 统一管理。
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
/** checked 是非受控单个 Checkbox 的默认选中态;组内选中态由 CheckboxGroup 控制。 */
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
/** indeterminate 表示部分选中状态,只控制视觉和原生 input 中间态。 */
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
/** value 是当前 Checkbox 代表的值,组内选中时会同步到 CheckboxGroup modelValue。 */
|
|
13
|
+
value?: CheckboxValue;
|
|
14
|
+
/** disabled 表示是否禁用交互,可选,默认 false。 */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** size 表示复选框尺寸;未传时继承 CheckboxGroup,组外默认 md。 */
|
|
17
|
+
size?: CheckboxSize;
|
|
18
|
+
/** name 是原生 checkbox name;未传时继承 CheckboxGroup。 */
|
|
19
|
+
name?: string;
|
|
20
|
+
};
|
|
21
|
+
declare var __VLS_1: {};
|
|
22
|
+
type __VLS_Slots = {} & {
|
|
23
|
+
default?: (props: typeof __VLS_1) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
|
+
input: (event: Event) => any;
|
|
27
|
+
change: (checked: boolean, event: Event) => any;
|
|
28
|
+
focus: (event: FocusEvent) => any;
|
|
29
|
+
blur: (event: FocusEvent) => any;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
|
+
onInput?: ((event: Event) => any) | undefined;
|
|
32
|
+
onChange?: ((checked: boolean, event: Event) => any) | undefined;
|
|
33
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
34
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
checked: boolean;
|
|
38
|
+
indeterminate: boolean;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
|
+
declare const _default: typeof __VLS_export;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type CheckboxGroupDirection, type CheckboxSize, type CheckboxValue } from '.';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** modelValue 是组内当前选中值数组。 */
|
|
4
|
+
modelValue?: CheckboxValue[];
|
|
5
|
+
/** disabled 会禁用组内所有 Checkbox。 */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** size 统一设置组内 Checkbox 尺寸,可被子项显式 size 覆盖。 */
|
|
8
|
+
size?: CheckboxSize;
|
|
9
|
+
/** name 统一设置组内原生 checkbox name。 */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** direction 控制组内排列方向。 */
|
|
12
|
+
direction?: CheckboxGroupDirection;
|
|
13
|
+
};
|
|
14
|
+
declare var __VLS_1: {};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_1) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
19
|
+
change: (value: CheckboxValue[], event: Event) => any;
|
|
20
|
+
"update:modelValue": (value: CheckboxValue[]) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onChange?: ((value: CheckboxValue[], event: Event) => any) | undefined;
|
|
23
|
+
"onUpdate:modelValue"?: ((value: CheckboxValue[]) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
size: CheckboxSize;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
name: string;
|
|
28
|
+
modelValue: CheckboxValue[];
|
|
29
|
+
direction: CheckboxGroupDirection;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
3
|
+
export { default as Checkbox } from './Checkbox.vue';
|
|
4
|
+
export { default as CheckboxGroup } from './CheckboxGroup.vue';
|
|
5
|
+
export type CheckboxValue = string | number;
|
|
6
|
+
export type CheckboxSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
export type CheckboxGroupDirection = 'horizontal' | 'vertical';
|
|
8
|
+
export interface CheckboxGroupContext {
|
|
9
|
+
modelValue: Readonly<Ref<CheckboxValue[]>>;
|
|
10
|
+
disabled: Readonly<Ref<boolean>>;
|
|
11
|
+
size: Readonly<Ref<CheckboxSize>>;
|
|
12
|
+
name: Readonly<Ref<string | undefined>>;
|
|
13
|
+
updateValue: (value: CheckboxValue, checked: boolean, event: Event) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const checkboxGroupContextKey: InjectionKey<CheckboxGroupContext>;
|
|
16
|
+
/** checkbox 定义管理端 Checkbox 组件的样式变体组合。 */
|
|
17
|
+
export declare const checkbox: (props?: ({
|
|
18
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
19
|
+
checked?: boolean | null | undefined;
|
|
20
|
+
disabled?: boolean | null | undefined;
|
|
21
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
|
+
/** checkboxGroup 定义 CheckboxGroup 根节点布局。 */
|
|
23
|
+
export declare const checkboxGroup: (props?: ({
|
|
24
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
25
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
26
|
+
disabled?: boolean | null | undefined;
|
|
27
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
28
|
+
/** CheckboxProps 是 checkbox 变体推导出的组件属性类型。 */
|
|
29
|
+
export type CheckboxProps = VariantProps<typeof checkbox>;
|
|
30
|
+
export type CheckboxGroupProps = VariantProps<typeof checkboxGroup>;
|