@xiaou66/u-web-ui 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,5 @@ export * from './layout';
2
2
  export * from './Menu';
3
3
  export * from './PageHeader';
4
4
  export * from './Setting';
5
+ export * from './switch';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { SwitchProps } from 'tdesign-vue-next';
2
+ /**
3
+ * SwitchEnable 组件的 Props 类型
4
+ * 继承 TDesign Switch 的所有 props,包括 value 用于 v-model
5
+ */
6
+ export interface SwitchEnableProps extends SwitchProps {
7
+ /**
8
+ * 开关的值,支持 v-model:value
9
+ */
10
+ value?: boolean;
11
+ /**
12
+ * 自定义颜色
13
+ */
14
+ color?: 'green';
15
+ }
16
+ /**
17
+ * SwitchEnable 组件的 Emits 类型
18
+ */
19
+ export interface SwitchEnableEmits {
20
+ /**
21
+ * 开关状态变化时触发
22
+ * @param value 新的开关状态
23
+ * @param context 事件上下文
24
+ */
25
+ change: [value: boolean, context: {
26
+ e: Event;
27
+ }];
28
+ }
29
+ //# sourceMappingURL=SwitchEnable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchEnable.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/SwitchEnable/SwitchEnable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE;QAAE,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;CACjD"}
@@ -0,0 +1,22 @@
1
+ import { SwitchEnableProps } from './SwitchEnable';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ type __VLS_Props = SwitchEnableProps;
4
+ type __VLS_PublicProps = {
5
+ 'value'?: boolean;
6
+ } & __VLS_Props;
7
+ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
8
+ change: (value: boolean, context: {
9
+ e: Event;
10
+ }) => any;
11
+ "update:value": (value: boolean) => any;
12
+ }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ onChange?: ((value: boolean, context: {
14
+ e: Event;
15
+ }) => any) | undefined;
16
+ "onUpdate:value"?: ((value: boolean) => any) | undefined;
17
+ }>, {
18
+ size: "small" | "medium" | "large";
19
+ color: "green";
20
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
21
+ export default _default;
22
+ //# sourceMappingURL=SwitchEnable.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchEnable.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/SwitchEnable/SwitchEnable.vue"],"names":[],"mappings":";AAyDA,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,gBAAgB,CAAA;AAS1E,KAAK,WAAW,GAAG,iBAAiB,CAAC;AA+BrC,KAAK,iBAAiB,GAAG;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;AAqEhB,wBAQG"}
@@ -0,0 +1,3 @@
1
+ export { default as SwitchEnable } from './SwitchEnable.vue';
2
+ export * from './SwitchEnable';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/SwitchEnable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * SwitchPlus 组件的 Props 类型
3
+ * 注意:modelValue 通过 defineModel 定义,不在 Props 中
4
+ */
5
+ export interface SwitchPlusProps {
6
+ /**
7
+ * @zh 默认选中状态(非受控状态)
8
+ * @en Default selected state (uncontrolled state)
9
+ */
10
+ defaultChecked?: boolean;
11
+ /**
12
+ * @zh 是否禁用
13
+ * @en Whether to disable
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * @zh 是否为加载中状态
18
+ * @en Whether it is loading state
19
+ */
20
+ loading?: boolean;
21
+ /**
22
+ * @zh 开关的类型
23
+ * @en Type of switch
24
+ * @values 'circle', 'round', 'line'
25
+ */
26
+ type?: 'circle' | 'round' | 'line';
27
+ /**
28
+ * @zh 开关的大小
29
+ * @en Size of switch
30
+ * @defaultValue 'medium'
31
+ */
32
+ size?: 'small' | 'medium';
33
+ /**
34
+ * @zh 选中时的值
35
+ * @en Value when checked
36
+ */
37
+ checkedValue?: string | number | boolean;
38
+ /**
39
+ * @zh 未选中时的值
40
+ * @en Value when unchecked
41
+ */
42
+ uncheckedValue?: string | number | boolean;
43
+ /**
44
+ * @zh 选中时的开关颜色
45
+ * @en The color of the switch when checked
46
+ */
47
+ checkedColor?: string;
48
+ /**
49
+ * @zh 未选中时的开关颜色
50
+ * @en The color of the switch when unchecked
51
+ */
52
+ uncheckedColor?: string;
53
+ /**
54
+ * @zh switch 状态改变前的钩子, 返回 false 或者返回 Promise 且被 reject 则停止切换。
55
+ * @en before-change hook before the switch state changes. If false is returned or a Promise is returned and then is rejected, will stop switching
56
+ */
57
+ beforeChange?: (newValue: string | number | boolean) => Promise<boolean | void> | boolean | void;
58
+ /**
59
+ * @zh 打开状态时的文案(`type='line'`和`size='small'`时不生效)
60
+ * @en Copywriting when opened (not effective when `type='line'` and `size='small'`)
61
+ */
62
+ checkedText?: string;
63
+ /**
64
+ * @zh 关闭状态时的文案(`type='line'`和`size='small'`时不生效)
65
+ * @en Copywriting when closed (not effective when `type='line'` and `size='small'`)
66
+ */
67
+ uncheckedText?: string;
68
+ }
69
+ /**
70
+ * SwitchPlus 组件的 Emits 类型
71
+ * 注意:update:modelValue 由 defineModel 自动处理,不需要手动定义
72
+ */
73
+ export interface SwitchPlusEmits {
74
+ /**
75
+ * @zh 值改变时触发
76
+ * @en Trigger when the value changes
77
+ * @param { boolean | string | number } value
78
+ * @param {Event} ev
79
+ */
80
+ 'change': [value: boolean | string | number, ev: Event];
81
+ /**
82
+ * @zh 组件获得焦点时触发
83
+ * @en Triggered when the component gets focus
84
+ * @property {FocusEvent} ev
85
+ */
86
+ 'focus': [ev: FocusEvent];
87
+ /**
88
+ * @zh 组件失去焦点时触发
89
+ * @en Fired when the component loses focus
90
+ * @property {FocusEvent} ev
91
+ */
92
+ 'blur': [ev: FocusEvent];
93
+ }
94
+ /**
95
+ * SwitchPlus 组件的插槽类型
96
+ */
97
+ export interface SwitchPlusSlots {
98
+ /**
99
+ * @zh 打开状态时的文案(`type='line'`和`size='small'`时不生效)
100
+ * @en Copywriting when opened (not effective when `type='line'` and `size='small'`)
101
+ */
102
+ checked?(): any;
103
+ /**
104
+ * @zh 关闭状态时的文案(`type='line'`和`size='small'`时不生效)
105
+ * @en Copywriting when closed (not effective when `type='line'` and `size='small'`)
106
+ */
107
+ unchecked?(): any;
108
+ /**
109
+ * @zh 打开状态时,按钮上的图标
110
+ * @en The icon on the button when opened
111
+ */
112
+ 'checked-icon'?(): any;
113
+ /**
114
+ * @zh 关闭状态时,按钮上的图标
115
+ * @en The icon on the button when closed
116
+ */
117
+ 'unchecked-icon'?(): any;
118
+ }
119
+ //# sourceMappingURL=SwitchPlus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchPlus.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/SwitchPlus/SwitchPlus.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACnC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACzC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,CACb,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,KAChC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAC9C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACxD;;;;OAIG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IAC1B;;;;OAIG;IACH,MAAM,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,CAAC,IAAI,GAAG,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,IAAI,GAAG,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,IAAI,GAAG,CAAC;IACvB;;;OAGG;IACH,gBAAgB,CAAC,IAAI,GAAG,CAAC;CAC1B"}
@@ -0,0 +1,40 @@
1
+ import { SwitchPlusProps, SwitchPlusSlots } from './SwitchPlus';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ type __VLS_Props = SwitchPlusProps;
4
+ type __VLS_PublicProps = {
5
+ 'value'?: string | number | boolean;
6
+ } & __VLS_Props;
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: Readonly<SwitchPlusSlots> & SwitchPlusSlots;
10
+ refs: {};
11
+ rootEl: HTMLButtonElement;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
15
+ blur: (ev: FocusEvent) => any;
16
+ change: (value: string | number | boolean, ev: Event) => any;
17
+ focus: (ev: FocusEvent) => any;
18
+ "update:value": (value: string | number | boolean) => any;
19
+ }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ onBlur?: ((ev: FocusEvent) => any) | undefined;
21
+ onChange?: ((value: string | number | boolean, ev: Event) => any) | undefined;
22
+ onFocus?: ((ev: FocusEvent) => any) | undefined;
23
+ "onUpdate:value"?: ((value: string | number | boolean) => any) | undefined;
24
+ }>, {
25
+ size: "small" | "medium";
26
+ type: "circle" | "round" | "line";
27
+ disabled: boolean;
28
+ loading: boolean;
29
+ defaultChecked: boolean;
30
+ checkedValue: string | number | boolean;
31
+ uncheckedValue: string | number | boolean;
32
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
33
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
34
+ export default _default;
35
+ type __VLS_WithTemplateSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
40
+ //# sourceMappingURL=SwitchPlus.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchPlus.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/SwitchPlus/SwitchPlus.vue"],"names":[],"mappings":";AA6LA,OAAO,KAAK,EAAE,eAAe,EAAmB,eAAe,EAAE,MAAM,cAAc,CAAC;AAatF,KAAK,WAAW,GAAG,eAAe,CAAC;AA6InC,KAAK,iBAAiB,GAAG;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACnC,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAkFT,OAAO,IAA6B;;;;EAKjD;AAsBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;2FASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { SwitchPlusProps } from './SwitchPlus';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ type __VLS_Props = SwitchPlusProps;
4
+ type __VLS_PublicProps = {
5
+ 'value'?: string | number | boolean;
6
+ } & __VLS_Props;
7
+ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
8
+ "update:value": (value: string | number | boolean) => any;
9
+ }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
10
+ "onUpdate:value"?: ((value: string | number | boolean) => any) | undefined;
11
+ }>, {
12
+ size: "small" | "medium";
13
+ type: "circle" | "round" | "line";
14
+ disabled: boolean;
15
+ loading: boolean;
16
+ defaultChecked: boolean;
17
+ checkedValue: string | number | boolean;
18
+ uncheckedValue: string | number | boolean;
19
+ checkedColor: string;
20
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
21
+ export default _default;
22
+ //# sourceMappingURL=SwitchPlusEnable.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchPlusEnable.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/SwitchPlus/SwitchPlusEnable.vue"],"names":[],"mappings":";AA4CA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AASnD,KAAK,WAAW,GAAG,eAAe,CAAC;AA2BnC,KAAK,iBAAiB,GAAG;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACnC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;AA0EhB,wBASG"}
@@ -0,0 +1,4 @@
1
+ export { default as SwitchPlus } from './SwitchPlus.vue';
2
+ export { default as SwitchPlusEnable } from './SwitchPlusEnable.vue';
3
+ export * from './SwitchPlus';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/SwitchPlus/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,CAAA;AACjB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,cAAc,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './SwitchEnable';
2
+ export * from './SwitchPlus';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/switch/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}