@ccn-ui-kit/rich-editor 0.1.2

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.
Files changed (79) hide show
  1. package/dist/index.cjs +1 -0
  2. package/dist/index.js +195 -0
  3. package/dist/packages/components/__tests__/loading.spec.d.ts +1 -0
  4. package/dist/packages/components/badge/index.d.ts +10 -0
  5. package/dist/packages/components/badge/src/badge.d.ts +25 -0
  6. package/dist/packages/components/breadcrumb/index.d.ts +12 -0
  7. package/dist/packages/components/breadcrumb/src/breadcrumb-item.d.ts +13 -0
  8. package/dist/packages/components/breadcrumb/src/breadcrumb.d.ts +10 -0
  9. package/dist/packages/components/button/index.d.ts +10 -0
  10. package/dist/packages/components/button/src/button.d.ts +25 -0
  11. package/dist/packages/components/date-picker/index.d.ts +10 -0
  12. package/dist/packages/components/date-picker/src/date-picker.d.ts +20 -0
  13. package/dist/packages/components/descriptions/index.d.ts +12 -0
  14. package/dist/packages/components/descriptions/src/descriptions-item.d.ts +13 -0
  15. package/dist/packages/components/descriptions/src/descriptions.d.ts +17 -0
  16. package/dist/packages/components/divider/index.d.ts +10 -0
  17. package/dist/packages/components/divider/src/divider.d.ts +20 -0
  18. package/dist/packages/components/dropdown/index.d.ts +12 -0
  19. package/dist/packages/components/dropdown/src/dropdown-item.d.ts +20 -0
  20. package/dist/packages/components/dropdown/src/dropdown.d.ts +46 -0
  21. package/dist/packages/components/form/index.d.ts +12 -0
  22. package/dist/packages/components/form/src/form-item.d.ts +45 -0
  23. package/dist/packages/components/form/src/form.d.ts +96 -0
  24. package/dist/packages/components/icon/index.d.ts +11 -0
  25. package/dist/packages/components/icon/src/icon.d.ts +18 -0
  26. package/dist/packages/components/icon/src/icons.d.ts +50 -0
  27. package/dist/packages/components/input/index.d.ts +10 -0
  28. package/dist/packages/components/input/src/input.d.ts +25 -0
  29. package/dist/packages/components/link/index.d.ts +10 -0
  30. package/dist/packages/components/link/src/link.d.ts +25 -0
  31. package/dist/packages/components/loading/index.d.ts +10 -0
  32. package/dist/packages/components/loading/src/loading.d.ts +15 -0
  33. package/dist/packages/components/menu/index.d.ts +14 -0
  34. package/dist/packages/components/menu/src/menu-item.d.ts +12 -0
  35. package/dist/packages/components/menu/src/menu.d.ts +40 -0
  36. package/dist/packages/components/menu/src/sub-menu.d.ts +12 -0
  37. package/dist/packages/components/message/index.d.ts +12 -0
  38. package/dist/packages/components/message/src/manager.d.ts +14 -0
  39. package/dist/packages/components/message/src/message.d.ts +28 -0
  40. package/dist/packages/components/modal/index.d.ts +10 -0
  41. package/dist/packages/components/modal/src/modal.d.ts +46 -0
  42. package/dist/packages/components/notification/index.d.ts +12 -0
  43. package/dist/packages/components/notification/src/manager.d.ts +14 -0
  44. package/dist/packages/components/notification/src/notification.d.ts +44 -0
  45. package/dist/packages/components/pagination/index.d.ts +10 -0
  46. package/dist/packages/components/pagination/src/pagination.d.ts +30 -0
  47. package/dist/packages/components/popconfirm/index.d.ts +10 -0
  48. package/dist/packages/components/popconfirm/src/popconfirm.d.ts +56 -0
  49. package/dist/packages/components/rich-editor/index.d.ts +10 -0
  50. package/dist/packages/components/rich-editor/src/rich-editor.d.ts +36 -0
  51. package/dist/packages/components/rich-editor/src/rich-editor.vue.d.ts +56 -0
  52. package/dist/packages/components/select/index.d.ts +10 -0
  53. package/dist/packages/components/select/src/select.d.ts +45 -0
  54. package/dist/packages/components/space/index.d.ts +10 -0
  55. package/dist/packages/components/space/src/space.d.ts +33 -0
  56. package/dist/packages/components/steps/index.d.ts +12 -0
  57. package/dist/packages/components/steps/src/step.d.ts +28 -0
  58. package/dist/packages/components/steps/src/steps.d.ts +46 -0
  59. package/dist/packages/components/table/index.d.ts +10 -0
  60. package/dist/packages/components/table/src/table.d.ts +56 -0
  61. package/dist/packages/components/tabs/index.d.ts +12 -0
  62. package/dist/packages/components/tabs/src/tab-pane.d.ts +22 -0
  63. package/dist/packages/components/tabs/src/tabs.d.ts +43 -0
  64. package/dist/packages/components/tree/index.d.ts +10 -0
  65. package/dist/packages/components/tree/src/tree.d.ts +134 -0
  66. package/dist/packages/components/upload/index.d.ts +10 -0
  67. package/dist/packages/components/upload/src/upload.d.ts +103 -0
  68. package/dist/packages/directives/index.d.ts +2 -0
  69. package/dist/packages/directives/loading/index.d.ts +11 -0
  70. package/dist/packages/directives/permission/index.d.ts +3 -0
  71. package/dist/packages/ui-kit/index.d.ts +34 -0
  72. package/dist/packages/utils/dom.d.ts +5 -0
  73. package/dist/packages/utils/index.d.ts +3 -0
  74. package/dist/packages/utils/types.d.ts +7 -0
  75. package/dist/packages/utils/vue-helper.d.ts +9 -0
  76. package/dist/play/main.d.ts +1 -0
  77. package/dist/play/vite.config.d.ts +2 -0
  78. package/package.json +27 -0
  79. package/style/index.scss +104 -0
@@ -0,0 +1,56 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const popconfirmProps: {
4
+ /** 是否显示(v-model) */
5
+ readonly modelValue: {
6
+ readonly type: BooleanConstructor;
7
+ readonly default: false;
8
+ };
9
+ /** 提示文案,也可用 #title 插槽自定义 */
10
+ readonly title: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "";
13
+ };
14
+ /** 确认按钮文案 */
15
+ readonly confirmText: {
16
+ readonly type: StringConstructor;
17
+ readonly default: "确定";
18
+ };
19
+ /** 取消按钮文案 */
20
+ readonly cancelText: {
21
+ readonly type: StringConstructor;
22
+ readonly default: "取消";
23
+ };
24
+ /** 确认按钮类型 */
25
+ readonly confirmButtonType: {
26
+ readonly type: StringConstructor;
27
+ readonly default: "primary";
28
+ };
29
+ /** 面板弹出位置 */
30
+ readonly placement: {
31
+ readonly type: StringConstructor;
32
+ readonly default: "top";
33
+ };
34
+ /** 面板基础宽度(min-width):内容更长时随按钮/文案自适应变宽 */
35
+ readonly width: {
36
+ readonly type: [NumberConstructor, StringConstructor];
37
+ readonly default: 180;
38
+ };
39
+ /** 触发方式:click | hover */
40
+ readonly trigger: {
41
+ readonly type: StringConstructor;
42
+ readonly default: "click";
43
+ };
44
+ /** 是否禁用 */
45
+ readonly disabled: BooleanConstructor;
46
+ };
47
+ export declare const popconfirmEmits: {
48
+ 'update:modelValue': (visible: boolean) => boolean;
49
+ /** 点击确认 */
50
+ confirm: () => boolean;
51
+ /** 点击取消 */
52
+ cancel: () => boolean;
53
+ /** 面板显隐变化 */
54
+ 'visible-change': (visible: boolean) => boolean;
55
+ };
56
+ export type PopconfirmProps = ExtractPropTypes<typeof popconfirmProps>;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as RichEditor } from './src/rich-editor.vue';
3
+
4
+ export declare const RichEditorPlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { RichEditor };
9
+ export default RichEditor;
10
+ export * from './src/rich-editor';
@@ -0,0 +1,36 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+
3
+ export declare const richEditorProps: {
4
+ /** 富文本 HTML 内容(v-model) */
5
+ readonly modelValue: {
6
+ readonly type: StringConstructor;
7
+ readonly default: undefined;
8
+ };
9
+ /** 空内容时的占位文案 */
10
+ readonly placeholder: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "请输入内容";
13
+ };
14
+ /** 是否禁用 */
15
+ readonly disabled: BooleanConstructor;
16
+ /** 编辑区最小高度:数字按 px,字符串作为 CSS 长度 */
17
+ readonly minHeight: {
18
+ readonly type: [NumberConstructor, StringConstructor];
19
+ readonly default: 120;
20
+ };
21
+ /** 工具栏按钮子集(key 见 Tool 配置);缺省展示全部 */
22
+ readonly toolbar: {
23
+ readonly type: PropType<string[]>;
24
+ readonly default: undefined;
25
+ };
26
+ };
27
+ export declare const richEditorEmits: {
28
+ 'update:modelValue': (val: string) => boolean;
29
+ /** 内容变化时触发 */
30
+ input: (val: string) => boolean;
31
+ /** 失焦时触发(提交值) */
32
+ change: (val: string) => boolean;
33
+ focus: () => boolean;
34
+ blur: () => boolean;
35
+ };
36
+ export type RichEditorProps = ExtractPropTypes<typeof richEditorProps>;
@@ -0,0 +1,56 @@
1
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ readonly modelValue: {
3
+ readonly type: StringConstructor;
4
+ readonly default: undefined;
5
+ };
6
+ readonly placeholder: {
7
+ readonly type: StringConstructor;
8
+ readonly default: "请输入内容";
9
+ };
10
+ readonly disabled: BooleanConstructor;
11
+ readonly minHeight: {
12
+ readonly type: [NumberConstructor, StringConstructor];
13
+ readonly default: 120;
14
+ };
15
+ readonly toolbar: {
16
+ readonly type: import('vue').PropType<string[]>;
17
+ readonly default: undefined;
18
+ };
19
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
20
+ input: (val: string) => void;
21
+ "update:modelValue": (val: string) => void;
22
+ change: (val: string) => void;
23
+ blur: () => void;
24
+ focus: () => void;
25
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
26
+ readonly modelValue: {
27
+ readonly type: StringConstructor;
28
+ readonly default: undefined;
29
+ };
30
+ readonly placeholder: {
31
+ readonly type: StringConstructor;
32
+ readonly default: "请输入内容";
33
+ };
34
+ readonly disabled: BooleanConstructor;
35
+ readonly minHeight: {
36
+ readonly type: [NumberConstructor, StringConstructor];
37
+ readonly default: 120;
38
+ };
39
+ readonly toolbar: {
40
+ readonly type: import('vue').PropType<string[]>;
41
+ readonly default: undefined;
42
+ };
43
+ }>> & Readonly<{
44
+ onInput?: ((val: string) => any) | undefined;
45
+ "onUpdate:modelValue"?: ((val: string) => any) | undefined;
46
+ onChange?: ((val: string) => any) | undefined;
47
+ onBlur?: (() => any) | undefined;
48
+ onFocus?: (() => any) | undefined;
49
+ }>, {
50
+ readonly disabled: boolean;
51
+ readonly modelValue: string;
52
+ readonly placeholder: string;
53
+ readonly minHeight: string | number;
54
+ readonly toolbar: string[];
55
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
56
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as Select } from './src/select.vue';
3
+
4
+ export declare const SelectPlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { Select };
9
+ export default Select;
10
+ export * from './src/select';
@@ -0,0 +1,45 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+
3
+ /** 下拉选项 */
4
+ export interface SelectOption {
5
+ label: string;
6
+ value: string | number;
7
+ disabled?: boolean;
8
+ }
9
+ export type SelectValue = string | number;
10
+ export type SelectValues = SelectValue[];
11
+ export declare const selectProps: {
12
+ /** 选中值(v-model)。multiple 时为数组 */
13
+ readonly modelValue: {
14
+ readonly type: PropType<SelectValue | SelectValues | undefined>;
15
+ readonly default: undefined;
16
+ };
17
+ /** 选项列表 */
18
+ readonly options: {
19
+ readonly type: PropType<SelectOption[]>;
20
+ readonly default: () => SelectOption[];
21
+ };
22
+ /** 空状态占位文案 */
23
+ readonly placeholder: {
24
+ readonly type: StringConstructor;
25
+ readonly default: "请选择";
26
+ };
27
+ /** 是否禁用 */
28
+ readonly disabled: BooleanConstructor;
29
+ /** 是否显示清除按钮 */
30
+ readonly clearable: BooleanConstructor;
31
+ /** 是否多选 */
32
+ readonly multiple: BooleanConstructor;
33
+ /** 是否可输入过滤 */
34
+ readonly filterable: BooleanConstructor;
35
+ };
36
+ export declare const selectEmits: {
37
+ 'update:modelValue': (_val: unknown) => boolean;
38
+ /** 选中值变化时触发(单选为值,多选为数组) */
39
+ change: (_val: unknown) => boolean;
40
+ /** 点击清除按钮触发 */
41
+ clear: () => boolean;
42
+ /** 下拉面板显隐变化 */
43
+ 'visible-change': (visible: boolean) => boolean;
44
+ };
45
+ export type SelectProps = ExtractPropTypes<typeof selectProps>;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as Space } from './src/space.vue';
3
+
4
+ export declare const SpacePlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { Space };
9
+ export default Space;
10
+ export * from './src/space';
@@ -0,0 +1,33 @@
1
+ import { ExtractPropTypes, PropType, VNode } from 'vue';
2
+
3
+ export type SpaceDirection = 'horizontal' | 'vertical';
4
+ export type SpaceAlign = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
5
+ /** 数字为 px;字符串可为 'small' | 'default' | 'large' 或带单位值(如 '12px');数组为 [横向, 纵向] */
6
+ export type SpaceSize = number | string | [number | string, number | string];
7
+ export declare const spaceProps: {
8
+ /** 间距,见 SpaceSize */
9
+ readonly size: {
10
+ readonly type: PropType<SpaceSize>;
11
+ readonly default: 8;
12
+ };
13
+ /** 排列方向 */
14
+ readonly direction: {
15
+ readonly type: PropType<SpaceDirection>;
16
+ readonly default: "horizontal";
17
+ };
18
+ /** 交叉轴对齐方式 */
19
+ readonly align: {
20
+ readonly type: PropType<SpaceAlign>;
21
+ readonly default: "start";
22
+ };
23
+ /** 横向时是否允许换行 */
24
+ readonly wrap: BooleanConstructor;
25
+ /** 是否占满容器宽度并使子项均分 */
26
+ readonly fill: BooleanConstructor;
27
+ /** 子项之间的分隔元素,可为 '|' 等字符串或 VNode(如 <UiDivider direction="vertical" />) */
28
+ readonly spacer: {
29
+ readonly type: PropType<string | VNode>;
30
+ readonly default: undefined;
31
+ };
32
+ };
33
+ export type SpaceProps = ExtractPropTypes<typeof spaceProps>;
@@ -0,0 +1,12 @@
1
+ import { App } from 'vue';
2
+ import { default as Steps } from './src/steps.vue';
3
+ import { default as Step } from './src/step.vue';
4
+
5
+ export declare const StepsPlugin: {
6
+ name: string;
7
+ install(app: App): void;
8
+ };
9
+ export { Steps, Step };
10
+ export default Steps;
11
+ export * from './src/steps';
12
+ export * from './src/step';
@@ -0,0 +1,28 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+ import { StepStatus } from './steps';
3
+
4
+ export declare const stepProps: {
5
+ /** 步骤标题 */
6
+ readonly title: {
7
+ readonly type: StringConstructor;
8
+ readonly default: "";
9
+ };
10
+ /** 步骤描述 */
11
+ readonly description: {
12
+ readonly type: StringConstructor;
13
+ readonly default: "";
14
+ };
15
+ /** 自定义图标名(复用 Icon 组件) */
16
+ readonly icon: {
17
+ readonly type: StringConstructor;
18
+ readonly default: "";
19
+ };
20
+ /** 覆盖由父级 active 推断出的状态 */
21
+ readonly status: {
22
+ readonly type: PropType<StepStatus>;
23
+ readonly default: undefined;
24
+ };
25
+ /** 是否禁用 */
26
+ readonly disabled: BooleanConstructor;
27
+ };
28
+ export type StepProps = ExtractPropTypes<typeof stepProps>;
@@ -0,0 +1,46 @@
1
+ import { ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
2
+
3
+ export type StepStatus = 'wait' | 'process' | 'finish' | 'error' | 'success';
4
+ export type StepsDirection = 'horizontal' | 'vertical';
5
+ export declare const stepsProps: {
6
+ /** 当前激活步骤下标(0 起,-1 表示全部处于等待) */
7
+ readonly active: {
8
+ readonly type: NumberConstructor;
9
+ readonly default: 0;
10
+ };
11
+ /** 排列方向 */
12
+ readonly direction: {
13
+ readonly type: PropType<StepsDirection>;
14
+ readonly default: "horizontal";
15
+ };
16
+ /** 当前激活步骤的状态 */
17
+ readonly processStatus: {
18
+ readonly type: PropType<StepStatus>;
19
+ readonly default: "process";
20
+ };
21
+ /** 已走过步骤的状态 */
22
+ readonly finishStatus: {
23
+ readonly type: PropType<StepStatus>;
24
+ readonly default: "finish";
25
+ };
26
+ /** 垂直方向时标题与描述是否居中 */
27
+ readonly alignCenter: BooleanConstructor;
28
+ };
29
+ export type StepsProps = ExtractPropTypes<typeof stepsProps>;
30
+ /** Step 自注册到 Steps 的状态(父级据以计算下标与总数) */
31
+ export interface StepState {
32
+ status?: StepStatus;
33
+ disabled: boolean;
34
+ }
35
+ /** 提供给 Step 的上下文 */
36
+ export interface StepsContext {
37
+ steps: Ref<StepState[]>;
38
+ active: Ref<number>;
39
+ direction: Ref<StepsDirection>;
40
+ processStatus: Ref<StepStatus>;
41
+ finishStatus: Ref<StepStatus>;
42
+ alignCenter: Ref<boolean>;
43
+ registerStep: (step: StepState) => void;
44
+ unregisterStep: (step: StepState) => void;
45
+ }
46
+ export declare const stepsContextKey: InjectionKey<StepsContext>;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as Table } from './src/table.vue';
3
+
4
+ export declare const TablePlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { Table };
9
+ export default Table;
10
+ export * from './src/table';
@@ -0,0 +1,56 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+
3
+ /** 表格列配置 */
4
+ export interface UiTableColumn {
5
+ /** 列标题 */
6
+ label: string;
7
+ /** 对应数据字段 key(通过 data 行的该字段取值) */
8
+ prop?: string;
9
+ /** 列宽:数字按 px,字符串作为 CSS 长度(如 '20%') */
10
+ width?: string | number;
11
+ /** 单元格对齐方式 */
12
+ align?: 'left' | 'center' | 'right';
13
+ /** 自定义单元格内容插槽名(优先级最高,覆盖 formatter 与默认取值) */
14
+ slot?: string;
15
+ /** 自定义表头插槽名 */
16
+ headerSlot?: string;
17
+ /** 单元格格式化函数,返回 HTML 字符串 */
18
+ formatter?: (row: Record<string, unknown>, column: UiTableColumn, cellValue: unknown, index: number) => string;
19
+ /** 是否可排序:点击表头升序 → 降序 → 取消 */
20
+ sortable?: boolean;
21
+ }
22
+ export declare const tableProps: {
23
+ /** 表格数据 */
24
+ readonly data: {
25
+ readonly type: PropType<Record<string, unknown>[]>;
26
+ readonly default: () => never[];
27
+ };
28
+ /** 列配置 */
29
+ readonly columns: {
30
+ readonly type: PropType<UiTableColumn[]>;
31
+ readonly default: () => never[];
32
+ };
33
+ /** 斑马纹行 */
34
+ readonly stripe: BooleanConstructor;
35
+ /** 纵向边框线 */
36
+ readonly border: BooleanConstructor;
37
+ /** 尺寸:large / medium / small */
38
+ readonly size: {
39
+ readonly type: StringConstructor;
40
+ readonly default: "medium";
41
+ };
42
+ /** 空数据文案 */
43
+ readonly emptyText: {
44
+ readonly type: StringConstructor;
45
+ readonly default: "暂无数据";
46
+ };
47
+ };
48
+ export declare const tableEmits: {
49
+ /** 排序状态变化:order 为 ascending / descending / null(取消排序) */
50
+ readonly 'sort-change': (payload: {
51
+ column: UiTableColumn;
52
+ prop: string;
53
+ order: "ascending" | "descending" | null;
54
+ }) => boolean;
55
+ };
56
+ export type TableProps = ExtractPropTypes<typeof tableProps>;
@@ -0,0 +1,12 @@
1
+ import { App } from 'vue';
2
+ import { default as Tabs } from './src/tabs.vue';
3
+ import { default as TabPane } from './src/tab-pane.vue';
4
+
5
+ export declare const TabsPlugin: {
6
+ name: string;
7
+ install(app: App): void;
8
+ };
9
+ export { Tabs, TabPane };
10
+ export default Tabs;
11
+ export * from './src/tabs';
12
+ export * from './src/tab-pane';
@@ -0,0 +1,22 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const tabPaneProps: {
4
+ /** 唯一标识,与 Tabs 的 v-model 对应 */
5
+ readonly name: {
6
+ readonly type: [StringConstructor, NumberConstructor];
7
+ readonly required: true;
8
+ };
9
+ /** 页签标题(可用 #label 插槽完全自定义) */
10
+ readonly label: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "";
13
+ };
14
+ /** 是否禁用 */
15
+ readonly disabled: BooleanConstructor;
16
+ /** 是否显示关闭按钮:缺省继承 Tabs 的 closable */
17
+ readonly closable: {
18
+ readonly type: BooleanConstructor;
19
+ readonly default: undefined;
20
+ };
21
+ };
22
+ export type TabPaneProps = ExtractPropTypes<typeof tabPaneProps>;
@@ -0,0 +1,43 @@
1
+ import { Component, ExtractPropTypes, InjectionKey, Ref } from 'vue';
2
+
3
+ export declare const tabsProps: {
4
+ /** 当前激活页签名(v-model) */
5
+ readonly modelValue: {
6
+ readonly type: [StringConstructor, NumberConstructor];
7
+ readonly default: "";
8
+ };
9
+ /** 页签类型:''(下划线) | card | border-card */
10
+ readonly type: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "";
13
+ };
14
+ /** 全局默认是否可关闭(TabPane 可用 closable 单独覆盖) */
15
+ readonly closable: BooleanConstructor;
16
+ };
17
+ export declare const tabsEmits: {
18
+ 'update:modelValue': (name: string | number) => boolean;
19
+ /** 点击页签时触发,参数为页签名 */
20
+ 'tab-click': (name: string | number) => boolean;
21
+ /** 点击关闭按钮时触发,由外部负责移除对应数据 */
22
+ 'tab-remove': (name: string | number) => boolean;
23
+ };
24
+ export type TabsProps = ExtractPropTypes<typeof tabsProps>;
25
+ /** TabPane 注册到 Tabs 时的页签状态 */
26
+ export interface PaneState {
27
+ name: string | number;
28
+ label: string;
29
+ disabled: boolean;
30
+ /** 是否可关闭:缺省继承 Tabs 的 closable */
31
+ closable?: boolean;
32
+ /** 自定义页签头渲染(TabPane 的 #label 插槽) */
33
+ labelSlot?: Component;
34
+ }
35
+ /** 提供给 TabPane 的上下文 */
36
+ export interface TabsContext {
37
+ activeName: Ref<string | number>;
38
+ type: string;
39
+ closable: boolean;
40
+ registerPane: (pane: PaneState) => void;
41
+ unregisterPane: (name: string | number) => void;
42
+ }
43
+ export declare const tabsContextKey: InjectionKey<TabsContext>;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as Tree } from './src/tree.vue';
3
+
4
+ export declare const TreePlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { Tree };
9
+ export default Tree;
10
+ export * from './src/tree';
@@ -0,0 +1,134 @@
1
+ import { ComputedRef, ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
2
+
3
+ /** 树节点原始数据(字段名可用 props 配置) */
4
+ export interface TreeData {
5
+ [key: string]: unknown;
6
+ children?: TreeData[];
7
+ }
8
+ /** 节点字段映射配置 */
9
+ export interface TreePropsConfig {
10
+ /** 节点显示文案字段 */
11
+ label?: string;
12
+ /** 子节点数组字段 */
13
+ children?: string;
14
+ /** 禁用字段 */
15
+ disabled?: string;
16
+ /** 叶子标记字段(配合 lazy 使用) */
17
+ isLeaf?: string;
18
+ /** 节点唯一键字段 */
19
+ key?: string;
20
+ }
21
+ export declare const defaultTreePropsConfig: TreePropsConfig;
22
+ /** 节点唯一键(统一为 string | number) */
23
+ export type KeyType = string | number;
24
+ /** 组件内部使用的树节点模型(由 data 构建,含父/子引用与层级) */
25
+ export interface TreeNode {
26
+ key: KeyType;
27
+ data: TreeData;
28
+ parent: TreeNode | null;
29
+ children: TreeNode[];
30
+ level: number;
31
+ isLeaf: boolean;
32
+ isLazy: boolean;
33
+ path: string;
34
+ }
35
+ /** 懒加载参数:根节点 load 时 node 为 null */
36
+ export interface TreeNodeLoadArg {
37
+ key: KeyType;
38
+ level: number;
39
+ data: TreeData;
40
+ }
41
+ export type TreeNodeLoader = (node: TreeNodeLoadArg | null, resolve: (children: TreeData[]) => void) => void;
42
+ export declare const treeProps: {
43
+ /** 树数据 */
44
+ readonly data: {
45
+ readonly type: PropType<TreeData[]>;
46
+ readonly default: () => never[];
47
+ };
48
+ /** 字段映射:{ label, children, disabled, isLeaf, key },缺省用默认字段名 */
49
+ readonly props: {
50
+ readonly type: PropType<TreePropsConfig>;
51
+ readonly default: () => {};
52
+ };
53
+ /** 节点唯一键字段,缺省取 props.key */
54
+ readonly nodeKey: {
55
+ readonly type: StringConstructor;
56
+ readonly default: "";
57
+ };
58
+ /** 是否展示复选框 */
59
+ readonly showCheckbox: BooleanConstructor;
60
+ /** 勾选是否严格(父子不联动,仅影响复选框) */
61
+ readonly checkStrictly: BooleanConstructor;
62
+ /** 默认展开所有节点 */
63
+ readonly defaultExpandAll: BooleanConstructor;
64
+ /** 默认展开的节点 key 列表 */
65
+ readonly defaultExpandedKeys: {
66
+ readonly type: PropType<KeyType[]>;
67
+ readonly default: () => never[];
68
+ };
69
+ /** 初始勾选的节点 key 列表(可在外部用 ref.setCheckedKeys 再控制) */
70
+ readonly defaultCheckedKeys: {
71
+ readonly type: PropType<KeyType[]>;
72
+ readonly default: () => never[];
73
+ };
74
+ /** 点击节点是否展开/收起(默认 true) */
75
+ readonly expandOnClickNode: {
76
+ readonly type: BooleanConstructor;
77
+ readonly default: true;
78
+ };
79
+ /** 当前选中节点 key(v-model:current-node-key) */
80
+ readonly currentNodeKey: {
81
+ readonly type: [StringConstructor, NumberConstructor];
82
+ readonly default: null;
83
+ };
84
+ /** 懒加载(需配合 load 使用) */
85
+ readonly lazy: BooleanConstructor;
86
+ /** 懒加载函数:(node, resolve) => void */
87
+ readonly load: {
88
+ readonly type: PropType<TreeNodeLoader>;
89
+ readonly default: undefined;
90
+ };
91
+ /** 空数据提示文案 */
92
+ readonly emptyText: {
93
+ readonly type: StringConstructor;
94
+ readonly default: "暂无数据";
95
+ };
96
+ };
97
+ export declare const treeEmits: {
98
+ 'update:current-node-key': null;
99
+ 'update:checked-keys': null;
100
+ /** 点击节点:node / data / 原生事件 */
101
+ 'node-click': (node: TreeNode, data: TreeData, e: MouseEvent) => boolean;
102
+ /** 节点展开 */
103
+ 'node-expand': () => boolean;
104
+ /** 节点收起 */
105
+ 'node-collapse': () => boolean;
106
+ /** 复选框勾选状态改变 */
107
+ check: (node: TreeNode, data: TreeData) => boolean;
108
+ /** 节点勾选状态变化(含级联影响的节点) */
109
+ 'check-change': (node: TreeNode, data: TreeData, checked: boolean) => boolean;
110
+ /** 右键节点 */
111
+ 'node-contextmenu': (e: MouseEvent, data: TreeData, node: TreeNode) => boolean;
112
+ };
113
+ export type TreeProps = ExtractPropTypes<typeof treeProps>;
114
+ /** 提供给内部 UiTreeNode 的共享上下文 */
115
+ export interface TreeContext {
116
+ config: ComputedRef<Required<TreePropsConfig>>;
117
+ nodeKeyField: ComputedRef<string>;
118
+ expandedKeys: Ref<Set<KeyType>>;
119
+ checkedKeys: Ref<Set<KeyType>>;
120
+ halfCheckedKeys: Ref<Set<KeyType>>;
121
+ selectedKey: Ref<KeyType | null>;
122
+ loadingKeys: Ref<Set<KeyType>>;
123
+ showCheckbox: ComputedRef<boolean>;
124
+ checkStrictly: ComputedRef<boolean>;
125
+ expandOnClickNode: ComputedRef<boolean>;
126
+ lazy: ComputedRef<boolean>;
127
+ isDisabledNode: (node: TreeNode) => boolean;
128
+ toggleExpand: (node: TreeNode) => void;
129
+ handleNodeClick: (node: TreeNode, data: TreeData, e: MouseEvent) => void;
130
+ handleNodeContextMenu: (node: TreeNode, data: TreeData, e: MouseEvent) => void;
131
+ toggleCheck: (node: TreeNode, data: TreeData) => void;
132
+ loadNodeData: (node: TreeNode) => void;
133
+ }
134
+ export declare const treeContextKey: InjectionKey<TreeContext>;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as Upload } from './src/upload.vue';
3
+
4
+ export declare const UploadPlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { Upload };
9
+ export default Upload;
10
+ export * from './src/upload';