@xn-lib/component 0.0.20 → 0.0.22

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.
@@ -0,0 +1,45 @@
1
+ import type { TreeNode } from './types';
2
+ interface Props {
3
+ show: boolean;
4
+ menuModel: TreeNode[][];
5
+ onFocus: (e: FocusEvent) => void;
6
+ onBlur: (e: FocusEvent) => void;
7
+ onKeydown: (e: KeyboardEvent) => void;
8
+ onMousedown: (e: MouseEvent) => void;
9
+ getColumnStyle?: (detail: {
10
+ level: number;
11
+ }) => string | Record<string, any>;
12
+ virtualScroll?: boolean;
13
+ optionHeight?: number;
14
+ }
15
+ declare var __VLS_20: {
16
+ option: import("./types").CascaderOption;
17
+ checked: any;
18
+ }, __VLS_36: {
19
+ option: import("./types").CascaderOption;
20
+ checked: any;
21
+ }, __VLS_38: {}, __VLS_45: {};
22
+ type __VLS_Slots = {} & {
23
+ label?: (props: typeof __VLS_20) => any;
24
+ } & {
25
+ label?: (props: typeof __VLS_36) => any;
26
+ } & {
27
+ empty?: (props: typeof __VLS_38) => any;
28
+ } & {
29
+ action?: (props: typeof __VLS_45) => any;
30
+ };
31
+ declare const __VLS_base: import("vue").DefineComponent<Props, {
32
+ scroll: (depth: number, index: number, elSize: number) => void;
33
+ showErrorMessage: (label: string) => void;
34
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
35
+ virtualScroll: boolean;
36
+ optionHeight: number;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
39
+ declare const _default: typeof __VLS_export;
40
+ export default _default;
41
+ type __VLS_WithSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,20 @@
1
+ import type { TreeNode } from './types';
2
+ interface Props {
3
+ tmNode: TreeNode;
4
+ }
5
+ declare var __VLS_9: {
6
+ option: import("./types").CascaderOption;
7
+ checked: any;
8
+ };
9
+ type __VLS_Slots = {} & {
10
+ label?: (props: typeof __VLS_9) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,38 @@
1
+ import type { TreeNode, CascaderValue, Filter } from './types';
2
+ interface Props {
3
+ show: boolean;
4
+ pattern: string;
5
+ multiple: boolean;
6
+ tmNodes: TreeNode[];
7
+ filter?: Filter;
8
+ labelField: string;
9
+ separator: string;
10
+ value: CascaderValue | null;
11
+ virtualScroll?: boolean;
12
+ optionHeight?: number;
13
+ }
14
+ declare function prev(): void;
15
+ declare function next(): void;
16
+ declare function enter(): boolean;
17
+ declare var __VLS_31: {}, __VLS_69: {};
18
+ type __VLS_Slots = {} & {
19
+ 'not-found'?: (props: typeof __VLS_31) => any;
20
+ } & {
21
+ 'not-found'?: (props: typeof __VLS_69) => any;
22
+ };
23
+ declare const __VLS_base: import("vue").DefineComponent<Props, {
24
+ prev: typeof prev;
25
+ next: typeof next;
26
+ enter: typeof enter;
27
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
28
+ virtualScroll: boolean;
29
+ optionHeight: number;
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,6 @@
1
+ import type { Plugin } from 'vue';
2
+ import type { CascaderInst } from './types';
3
+ import CascaderComponent from './index.vue';
4
+ declare const Cascader: typeof CascaderComponent & Plugin;
5
+ export default Cascader;
6
+ export type { CascaderInst as XnCascaderInstance };
@@ -0,0 +1,90 @@
1
+ import type { CascaderOption, CascaderValue, ExpandTrigger, CheckStrategy, Filter, OnLoad, CascaderInst } from './types';
2
+ interface Props {
3
+ modelValue?: CascaderValue | null;
4
+ options?: CascaderOption[];
5
+ placeholder?: string;
6
+ disabled?: boolean;
7
+ clearable?: boolean;
8
+ filterable?: boolean;
9
+ multiple?: boolean;
10
+ size?: 'large' | 'default' | 'small';
11
+ expandTrigger?: ExpandTrigger;
12
+ separator?: string;
13
+ showPath?: boolean;
14
+ cascade?: boolean;
15
+ checkStrategy?: CheckStrategy;
16
+ remote?: boolean;
17
+ onLoad?: OnLoad;
18
+ filter?: Filter;
19
+ valueField?: string;
20
+ labelField?: string;
21
+ childrenField?: string;
22
+ disabledField?: string;
23
+ maxTagCount?: number;
24
+ popperClass?: string;
25
+ getColumnStyle?: (detail: {
26
+ level: number;
27
+ }) => string | Record<string, any>;
28
+ clearFilterAfterSelect?: boolean;
29
+ virtualScroll?: boolean;
30
+ optionHeight?: number;
31
+ showCheckbox?: boolean;
32
+ emitPath?: boolean;
33
+ }
34
+ declare var __VLS_27: {}, __VLS_38: {
35
+ option: CascaderOption;
36
+ checked: any;
37
+ }, __VLS_41: {}, __VLS_44: {};
38
+ type __VLS_Slots = {} & {
39
+ 'not-found'?: (props: typeof __VLS_27) => any;
40
+ } & {
41
+ label?: (props: typeof __VLS_38) => any;
42
+ } & {
43
+ empty?: (props: typeof __VLS_41) => any;
44
+ } & {
45
+ action?: (props: typeof __VLS_44) => any;
46
+ };
47
+ declare const __VLS_base: import("vue").DefineComponent<Props, CascaderInst, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
+ "update:modelValue": (value: CascaderValue | null) => any;
49
+ change: (value: CascaderValue | null, option: CascaderOption | (CascaderOption | null)[] | null, path: CascaderOption[] | (CascaderOption[] | null)[] | null) => any;
50
+ blur: (e: FocusEvent) => any;
51
+ focus: (e: FocusEvent) => any;
52
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
53
+ "onUpdate:modelValue"?: ((value: CascaderValue | null) => any) | undefined;
54
+ onChange?: ((value: CascaderValue | null, option: CascaderOption | (CascaderOption | null)[] | null, path: CascaderOption[] | (CascaderOption[] | null)[] | null) => any) | undefined;
55
+ onBlur?: ((e: FocusEvent) => any) | undefined;
56
+ onFocus?: ((e: FocusEvent) => any) | undefined;
57
+ }>, {
58
+ disabled: boolean;
59
+ modelValue: CascaderValue | null;
60
+ size: "large" | "default" | "small";
61
+ showCheckbox: boolean;
62
+ placeholder: string;
63
+ virtualScroll: boolean;
64
+ optionHeight: number;
65
+ multiple: boolean;
66
+ labelField: string;
67
+ separator: string;
68
+ options: CascaderOption[];
69
+ clearable: boolean;
70
+ filterable: boolean;
71
+ expandTrigger: ExpandTrigger;
72
+ showPath: boolean;
73
+ cascade: boolean;
74
+ checkStrategy: CheckStrategy;
75
+ remote: boolean;
76
+ valueField: string;
77
+ childrenField: string;
78
+ disabledField: string;
79
+ maxTagCount: number;
80
+ clearFilterAfterSelect: boolean;
81
+ emitPath: boolean;
82
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
83
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
84
+ declare const _default: typeof __VLS_export;
85
+ export default _default;
86
+ type __VLS_WithSlots<T, S> = T & {
87
+ new (): {
88
+ $slots: S;
89
+ };
90
+ };
@@ -0,0 +1,119 @@
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ import type { CascaderOption, CascaderValue, ExpandTrigger, CheckStrategy, Filter, OnLoad } from './types';
3
+ export declare const cascaderProps: {
4
+ readonly modelValue: {
5
+ readonly type: PropType<CascaderValue | null>;
6
+ readonly default: null;
7
+ };
8
+ readonly options: {
9
+ readonly type: PropType<CascaderOption[]>;
10
+ readonly default: () => never[];
11
+ };
12
+ readonly placeholder: {
13
+ readonly type: StringConstructor;
14
+ readonly default: "请选择";
15
+ };
16
+ readonly disabled: {
17
+ readonly type: BooleanConstructor;
18
+ readonly default: false;
19
+ };
20
+ readonly clearable: {
21
+ readonly type: BooleanConstructor;
22
+ readonly default: false;
23
+ };
24
+ readonly filterable: {
25
+ readonly type: BooleanConstructor;
26
+ readonly default: false;
27
+ };
28
+ readonly multiple: {
29
+ readonly type: BooleanConstructor;
30
+ readonly default: false;
31
+ };
32
+ readonly size: {
33
+ readonly type: PropType<"large" | "default" | "small">;
34
+ readonly default: "default";
35
+ };
36
+ readonly expandTrigger: {
37
+ readonly type: PropType<ExpandTrigger>;
38
+ readonly default: "click";
39
+ };
40
+ readonly separator: {
41
+ readonly type: StringConstructor;
42
+ readonly default: " / ";
43
+ };
44
+ readonly showPath: {
45
+ readonly type: BooleanConstructor;
46
+ readonly default: true;
47
+ };
48
+ readonly cascade: {
49
+ readonly type: BooleanConstructor;
50
+ readonly default: true;
51
+ };
52
+ readonly checkStrategy: {
53
+ readonly type: PropType<CheckStrategy>;
54
+ readonly default: "all";
55
+ };
56
+ readonly remote: {
57
+ readonly type: BooleanConstructor;
58
+ readonly default: false;
59
+ };
60
+ readonly onLoad: {
61
+ readonly type: PropType<OnLoad>;
62
+ readonly default: undefined;
63
+ };
64
+ readonly filter: {
65
+ readonly type: PropType<Filter>;
66
+ readonly default: undefined;
67
+ };
68
+ readonly valueField: {
69
+ readonly type: StringConstructor;
70
+ readonly default: "value";
71
+ };
72
+ readonly labelField: {
73
+ readonly type: StringConstructor;
74
+ readonly default: "label";
75
+ };
76
+ readonly childrenField: {
77
+ readonly type: StringConstructor;
78
+ readonly default: "children";
79
+ };
80
+ readonly disabledField: {
81
+ readonly type: StringConstructor;
82
+ readonly default: "disabled";
83
+ };
84
+ readonly maxTagCount: {
85
+ readonly type: NumberConstructor;
86
+ readonly default: 1;
87
+ };
88
+ readonly popperClass: {
89
+ readonly type: StringConstructor;
90
+ readonly default: "";
91
+ };
92
+ readonly getColumnStyle: {
93
+ readonly type: PropType<(detail: {
94
+ level: number;
95
+ }) => string | Record<string, any>>;
96
+ readonly default: undefined;
97
+ };
98
+ readonly clearFilterAfterSelect: {
99
+ readonly type: BooleanConstructor;
100
+ readonly default: true;
101
+ };
102
+ readonly virtualScroll: {
103
+ readonly type: BooleanConstructor;
104
+ readonly default: true;
105
+ };
106
+ readonly optionHeight: {
107
+ readonly type: NumberConstructor;
108
+ readonly default: 34;
109
+ };
110
+ readonly showCheckbox: {
111
+ readonly type: BooleanConstructor;
112
+ readonly default: undefined;
113
+ };
114
+ readonly emitPath: {
115
+ readonly type: BooleanConstructor;
116
+ readonly default: false;
117
+ };
118
+ };
119
+ export type CascaderProps = ExtractPropTypes<typeof cascaderProps>;
@@ -0,0 +1,69 @@
1
+ export type ValueAtom = string | number;
2
+ export type CascaderValue = ValueAtom | ValueAtom[] | ValueAtom[][];
3
+ export type Key = ValueAtom;
4
+ export interface CascaderOption {
5
+ label?: string;
6
+ value?: ValueAtom;
7
+ disabled?: boolean;
8
+ children?: CascaderOption[];
9
+ [key: string]: unknown;
10
+ }
11
+ export type ExpandTrigger = 'hover' | 'click';
12
+ export type CheckStrategy = 'all' | 'parent' | 'child';
13
+ export type Filter = (pattern: string, option: CascaderOption, path: CascaderOption[]) => boolean;
14
+ export type OnLoad = (option: CascaderOption) => Promise<void>;
15
+ export type OnUpdateValue = (value: CascaderValue | null, option: CascaderOption | null | Array<CascaderOption | null>, path: Array<CascaderOption[] | null> | CascaderOption[] | null) => void;
16
+ export interface TreeNode {
17
+ key: Key;
18
+ rawNode: CascaderOption;
19
+ level: number;
20
+ index: number;
21
+ isLeaf: boolean;
22
+ isGroup: boolean;
23
+ ignored: boolean;
24
+ disabled: boolean;
25
+ shallowLoaded: boolean;
26
+ parent: TreeNode | null;
27
+ children?: TreeNode[];
28
+ siblings: TreeNode[];
29
+ }
30
+ export interface CascaderInst {
31
+ focus: () => void;
32
+ blur: () => void;
33
+ getCheckedData: () => {
34
+ keys: Key[];
35
+ options: Array<CascaderOption | null>;
36
+ };
37
+ getIndeterminateData: () => {
38
+ keys: Key[];
39
+ options: Array<CascaderOption | null>;
40
+ };
41
+ }
42
+ export interface CascaderContext {
43
+ mergedValue: CascaderValue | null;
44
+ checkedKeys: Key[];
45
+ indeterminateKeys: Key[];
46
+ hoverKeyPath: Key[];
47
+ keyboardKey: Key | null;
48
+ hoverKey: Key | null;
49
+ loadingKeySet: Set<Key>;
50
+ multiple: boolean;
51
+ cascade: boolean;
52
+ checkStrategy: CheckStrategy;
53
+ expandTrigger: ExpandTrigger;
54
+ remote: boolean;
55
+ showCheckbox: boolean;
56
+ labelField: string;
57
+ valueField: string;
58
+ childrenField: string;
59
+ disabledField: string;
60
+ onLoad?: OnLoad;
61
+ updateHoverKey: (key: Key | null) => void;
62
+ updateKeyboardKey: (key: Key | null) => void;
63
+ addLoadingKey: (key: Key) => void;
64
+ deleteLoadingKey: (key: Key) => void;
65
+ doCheck: (key: Key) => boolean;
66
+ doUncheck: (key: Key) => void;
67
+ closeMenu: (returnFocus?: boolean) => void;
68
+ clearPattern: () => void;
69
+ }
@@ -0,0 +1,53 @@
1
+ import type { CascaderOption, TreeNode, Key, CheckStrategy } from './types';
2
+ export declare function createTreeMate(options: CascaderOption[], config: {
3
+ getKey: (node: CascaderOption) => Key;
4
+ getChildren: (node: CascaderOption) => CascaderOption[] | undefined;
5
+ getDisabled: (node: CascaderOption) => boolean;
6
+ }): {
7
+ treeNodes: TreeNode[];
8
+ getNode: (key: Key) => TreeNode | null;
9
+ getPath: (key: Key | null) => {
10
+ treeNodePath: TreeNode[];
11
+ keyPath: Key[];
12
+ treeNode: TreeNode | null;
13
+ };
14
+ getCheckedKeys: (keys: Key[], options: {
15
+ cascade: boolean;
16
+ checkStrategy: CheckStrategy;
17
+ allowNotLoaded?: boolean;
18
+ }) => {
19
+ checkedKeys: Key[];
20
+ indeterminateKeys: Key[];
21
+ };
22
+ check: (key: Key, checkedKeys: Key[], options: {
23
+ cascade: boolean;
24
+ checkStrategy: CheckStrategy;
25
+ allowNotLoaded?: boolean;
26
+ }) => {
27
+ checkedKeys: Key[];
28
+ };
29
+ uncheck: (key: Key, checkedKeys: Key[], options: {
30
+ cascade: boolean;
31
+ checkStrategy: CheckStrategy;
32
+ allowNotLoaded?: boolean;
33
+ }) => {
34
+ checkedKeys: Key[];
35
+ };
36
+ getPrev: (key: Key, options: {
37
+ loop: boolean;
38
+ }) => TreeNode | null;
39
+ getNext: (key: Key, options: {
40
+ loop: boolean;
41
+ }) => TreeNode | null;
42
+ getChild: (key: Key) => TreeNode | null;
43
+ getParent: (key: Key) => TreeNode | null;
44
+ getFirstAvailableNode: () => TreeNode | null;
45
+ };
46
+ export declare function getRawNodePath(tmNodes: TreeNode[] | undefined): CascaderOption[] | null;
47
+ export declare function getPathLabel(node: TreeNode | null, separator: string, labelField: string): string;
48
+ export declare function createSelectOptions(tmNodes: TreeNode[], checkStrategyIsChild: boolean, labelField: string, separator: string): Array<{
49
+ label: string;
50
+ value: Key;
51
+ rawNode: CascaderOption;
52
+ path: CascaderOption[];
53
+ }>;
@@ -0,0 +1,13 @@
1
+ import type { Plugin } from 'vue';
2
+ import type { Component } from 'vue';
3
+ import XnCascader from './cascader/index';
4
+ import XnTag from './tag/index';
5
+ export { XnCascader, XnTag };
6
+ export declare const components: Record<string, Component>;
7
+ export type { CascaderProps } from './cascader/props';
8
+ export type { TagProps } from './tag/props';
9
+ export * from './types';
10
+ export * from './cascader/types';
11
+ export * from './tag/types';
12
+ declare const plugin: Plugin;
13
+ export default plugin;
@@ -0,0 +1,6 @@
1
+ import type { Plugin } from 'vue';
2
+ import type { TagInst } from './types.ts';
3
+ import TagComponent from './index.vue';
4
+ declare const Tag: typeof TagComponent & Plugin;
5
+ export default Tag;
6
+ export type { TagInst as XnTagInstance };
@@ -0,0 +1,123 @@
1
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
2
+ type __VLS_Slots = {} & {
3
+ prefix?: (props: typeof __VLS_1) => any;
4
+ } & {
5
+ default?: (props: typeof __VLS_3) => any;
6
+ } & {
7
+ suffix?: (props: typeof __VLS_5) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ readonly type: {
11
+ readonly type: import("vue").PropType<import("..").DefaultSize>;
12
+ readonly default: "default";
13
+ };
14
+ readonly color: {
15
+ readonly type: StringConstructor;
16
+ readonly default: undefined;
17
+ };
18
+ readonly bgColor: {
19
+ readonly type: StringConstructor;
20
+ readonly default: undefined;
21
+ };
22
+ readonly size: {
23
+ readonly type: import("vue").PropType<import("..").DefaultType>;
24
+ readonly default: "default";
25
+ };
26
+ readonly dot: {
27
+ readonly type: BooleanConstructor;
28
+ readonly default: false;
29
+ };
30
+ readonly dotColor: {
31
+ readonly type: StringConstructor;
32
+ readonly default: undefined;
33
+ };
34
+ readonly icon: {
35
+ readonly type: StringConstructor;
36
+ readonly default: undefined;
37
+ };
38
+ readonly plain: {
39
+ readonly type: BooleanConstructor;
40
+ readonly default: false;
41
+ };
42
+ readonly round: {
43
+ readonly type: BooleanConstructor;
44
+ readonly default: false;
45
+ };
46
+ readonly closable: {
47
+ readonly type: BooleanConstructor;
48
+ readonly default: false;
49
+ };
50
+ readonly border: {
51
+ readonly type: BooleanConstructor;
52
+ readonly default: true;
53
+ };
54
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
55
+ close: () => any;
56
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
57
+ readonly type: {
58
+ readonly type: import("vue").PropType<import("..").DefaultSize>;
59
+ readonly default: "default";
60
+ };
61
+ readonly color: {
62
+ readonly type: StringConstructor;
63
+ readonly default: undefined;
64
+ };
65
+ readonly bgColor: {
66
+ readonly type: StringConstructor;
67
+ readonly default: undefined;
68
+ };
69
+ readonly size: {
70
+ readonly type: import("vue").PropType<import("..").DefaultType>;
71
+ readonly default: "default";
72
+ };
73
+ readonly dot: {
74
+ readonly type: BooleanConstructor;
75
+ readonly default: false;
76
+ };
77
+ readonly dotColor: {
78
+ readonly type: StringConstructor;
79
+ readonly default: undefined;
80
+ };
81
+ readonly icon: {
82
+ readonly type: StringConstructor;
83
+ readonly default: undefined;
84
+ };
85
+ readonly plain: {
86
+ readonly type: BooleanConstructor;
87
+ readonly default: false;
88
+ };
89
+ readonly round: {
90
+ readonly type: BooleanConstructor;
91
+ readonly default: false;
92
+ };
93
+ readonly closable: {
94
+ readonly type: BooleanConstructor;
95
+ readonly default: false;
96
+ };
97
+ readonly border: {
98
+ readonly type: BooleanConstructor;
99
+ readonly default: true;
100
+ };
101
+ }>> & Readonly<{
102
+ onClose?: (() => any) | undefined;
103
+ }>, {
104
+ readonly border: boolean;
105
+ readonly size: import("..").DefaultType;
106
+ readonly type: import("..").DefaultSize;
107
+ readonly color: string;
108
+ readonly bgColor: string;
109
+ readonly dot: boolean;
110
+ readonly dotColor: string;
111
+ readonly icon: string;
112
+ readonly plain: boolean;
113
+ readonly round: boolean;
114
+ readonly closable: boolean;
115
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
116
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
117
+ declare const _default: typeof __VLS_export;
118
+ export default _default;
119
+ type __VLS_WithSlots<T, S> = T & {
120
+ new (): {
121
+ $slots: S;
122
+ };
123
+ };
@@ -0,0 +1,49 @@
1
+ import type { PropType, ExtractPropTypes } from 'vue';
2
+ import type { DefaultSize, DefaultType } from '../types';
3
+ export declare const tagProps: {
4
+ readonly type: {
5
+ readonly type: PropType<DefaultSize>;
6
+ readonly default: "default";
7
+ };
8
+ readonly color: {
9
+ readonly type: StringConstructor;
10
+ readonly default: undefined;
11
+ };
12
+ readonly bgColor: {
13
+ readonly type: StringConstructor;
14
+ readonly default: undefined;
15
+ };
16
+ readonly size: {
17
+ readonly type: PropType<DefaultType>;
18
+ readonly default: "default";
19
+ };
20
+ readonly dot: {
21
+ readonly type: BooleanConstructor;
22
+ readonly default: false;
23
+ };
24
+ readonly dotColor: {
25
+ readonly type: StringConstructor;
26
+ readonly default: undefined;
27
+ };
28
+ readonly icon: {
29
+ readonly type: StringConstructor;
30
+ readonly default: undefined;
31
+ };
32
+ readonly plain: {
33
+ readonly type: BooleanConstructor;
34
+ readonly default: false;
35
+ };
36
+ readonly round: {
37
+ readonly type: BooleanConstructor;
38
+ readonly default: false;
39
+ };
40
+ readonly closable: {
41
+ readonly type: BooleanConstructor;
42
+ readonly default: false;
43
+ };
44
+ readonly border: {
45
+ readonly type: BooleanConstructor;
46
+ readonly default: true;
47
+ };
48
+ };
49
+ export type TagProps = Readonly<ExtractPropTypes<typeof tagProps>>;
@@ -0,0 +1,17 @@
1
+ import type { DefaultSize, DefaultType } from '../types';
2
+ export interface TagProps {
3
+ type?: DefaultType;
4
+ color?: string;
5
+ bgColor?: string;
6
+ size?: DefaultSize;
7
+ dot?: boolean;
8
+ dotColor?: string;
9
+ icon?: string;
10
+ plain?: boolean;
11
+ round?: boolean;
12
+ closable?: boolean;
13
+ border?: boolean;
14
+ }
15
+ export interface TagInst {
16
+ close: () => void;
17
+ }
@@ -0,0 +1,2 @@
1
+ export type DefaultType = 'success' | 'info' | 'warning' | 'danger' | 'primary' | 'default';
2
+ export type DefaultSize = 'small' | 'default' | 'large';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@xn-lib/component",
4
- "version": "0.0.20",
4
+ "version": "0.0.22",
5
5
  "description": "",
6
6
  "main": "./dist/index.umd.js",
7
7
  "module": "./dist/index.mjs",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "https://github.com/zjwmmx/mmx-ui"
30
+ "url": "http://git.wonchuan.top/frontend/xiaoniu/xiaoniu-package"
31
31
  },
32
32
  "keywords": [],
33
33
  "license": "ISC",