twcpt 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.
@@ -0,0 +1,278 @@
1
+ import { PropType, DefineComponent, ExtractPropTypes, ComputedRef, ComponentOptionsMixin, PublicProps, CreateComponentPublicInstanceWithMixins, GlobalComponents, GlobalDirectives, ComponentProvideOptions, ComponentOptionsBase, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
2
+ import { SFCWithInstall } from 'element-plus/es/utils/index.mjs';
3
+ import { SwitchProps } from 'element-plus';
4
+ declare const _default: DefineComponent<ExtractPropTypes<{
5
+ modelValue: {
6
+ type: PropType<boolean | string | number>;
7
+ default: boolean;
8
+ };
9
+ trueValue: {
10
+ type: PropType<boolean | string | number>;
11
+ default: boolean;
12
+ };
13
+ falseValue: {
14
+ type: PropType<boolean | string | number>;
15
+ default: boolean;
16
+ };
17
+ label: {
18
+ type: StringConstructor;
19
+ default: undefined;
20
+ };
21
+ leftLabel: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ color: {
26
+ type: StringConstructor;
27
+ default: undefined;
28
+ };
29
+ keepColor: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ dense: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ disable: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ readonly: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
45
+ tabindex: {
46
+ type: PropType<string | number>;
47
+ default: undefined;
48
+ };
49
+ icon: {
50
+ type: StringConstructor;
51
+ default: undefined;
52
+ };
53
+ checkedIcon: {
54
+ type: StringConstructor;
55
+ default: undefined;
56
+ };
57
+ uncheckedIcon: {
58
+ type: StringConstructor;
59
+ default: undefined;
60
+ };
61
+ iconColor: {
62
+ type: StringConstructor;
63
+ default: undefined;
64
+ };
65
+ size: {
66
+ type: StringConstructor;
67
+ default: undefined;
68
+ };
69
+ name: {
70
+ type: StringConstructor;
71
+ default: undefined;
72
+ };
73
+ id: {
74
+ type: StringConstructor;
75
+ default: undefined;
76
+ };
77
+ validateEvent: {
78
+ type: BooleanConstructor;
79
+ default: boolean;
80
+ };
81
+ }>, {
82
+ computedSize: ComputedRef<"" | "large" | "small" | "default">;
83
+ computedStyle: ComputedRef<Record<string, string>>;
84
+ computedClass: ComputedRef<string[]>;
85
+ handleUpdateModelValue: (value: boolean | string | number) => void;
86
+ handleChange: (value: boolean | string | number) => void;
87
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
88
+ 'update:modelValue': (_value: boolean | string | number) => true;
89
+ change: (_value: boolean | string | number) => true;
90
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
91
+ modelValue: {
92
+ type: PropType<boolean | string | number>;
93
+ default: boolean;
94
+ };
95
+ trueValue: {
96
+ type: PropType<boolean | string | number>;
97
+ default: boolean;
98
+ };
99
+ falseValue: {
100
+ type: PropType<boolean | string | number>;
101
+ default: boolean;
102
+ };
103
+ label: {
104
+ type: StringConstructor;
105
+ default: undefined;
106
+ };
107
+ leftLabel: {
108
+ type: BooleanConstructor;
109
+ default: boolean;
110
+ };
111
+ color: {
112
+ type: StringConstructor;
113
+ default: undefined;
114
+ };
115
+ keepColor: {
116
+ type: BooleanConstructor;
117
+ default: boolean;
118
+ };
119
+ dense: {
120
+ type: BooleanConstructor;
121
+ default: boolean;
122
+ };
123
+ disable: {
124
+ type: BooleanConstructor;
125
+ default: boolean;
126
+ };
127
+ readonly: {
128
+ type: BooleanConstructor;
129
+ default: boolean;
130
+ };
131
+ tabindex: {
132
+ type: PropType<string | number>;
133
+ default: undefined;
134
+ };
135
+ icon: {
136
+ type: StringConstructor;
137
+ default: undefined;
138
+ };
139
+ checkedIcon: {
140
+ type: StringConstructor;
141
+ default: undefined;
142
+ };
143
+ uncheckedIcon: {
144
+ type: StringConstructor;
145
+ default: undefined;
146
+ };
147
+ iconColor: {
148
+ type: StringConstructor;
149
+ default: undefined;
150
+ };
151
+ size: {
152
+ type: StringConstructor;
153
+ default: undefined;
154
+ };
155
+ name: {
156
+ type: StringConstructor;
157
+ default: undefined;
158
+ };
159
+ id: {
160
+ type: StringConstructor;
161
+ default: undefined;
162
+ };
163
+ validateEvent: {
164
+ type: BooleanConstructor;
165
+ default: boolean;
166
+ };
167
+ }>> & Readonly<{
168
+ "onUpdate:modelValue"?: ((_value: string | number | boolean) => any) | undefined;
169
+ onChange?: ((_value: string | number | boolean) => any) | undefined;
170
+ }>, {
171
+ size: string;
172
+ color: string;
173
+ label: string;
174
+ icon: string;
175
+ id: string;
176
+ name: string;
177
+ modelValue: string | number | boolean;
178
+ validateEvent: boolean;
179
+ tabindex: string | number;
180
+ disable: boolean;
181
+ readonly: boolean;
182
+ dense: boolean;
183
+ trueValue: string | number | boolean;
184
+ falseValue: string | number | boolean;
185
+ leftLabel: boolean;
186
+ keepColor: boolean;
187
+ checkedIcon: string;
188
+ uncheckedIcon: string;
189
+ iconColor: string;
190
+ }, {}, {
191
+ ElSwitch: SFCWithInstall<{
192
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< SwitchProps> & Readonly<{
193
+ onChange?: ((val: string | number | boolean) => any) | undefined;
194
+ onInput?: ((val: string | number | boolean) => any) | undefined;
195
+ "onUpdate:modelValue"?: ((val: string | number | boolean) => any) | undefined;
196
+ }>, {
197
+ focus: () => void;
198
+ checked: ComputedRef<boolean>;
199
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
200
+ "update:modelValue": (val: string | number | boolean) => void;
201
+ change: (val: string | number | boolean) => void;
202
+ input: (val: string | number | boolean) => void;
203
+ }, PublicProps, {
204
+ disabled: boolean;
205
+ validateEvent: boolean;
206
+ modelValue: boolean | string | number;
207
+ width: string | number;
208
+ name: string;
209
+ activeText: string;
210
+ inactiveText: string;
211
+ activeValue: boolean | string | number;
212
+ inactiveValue: boolean | string | number;
213
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
214
+ P: {};
215
+ B: {};
216
+ D: {};
217
+ C: {};
218
+ M: {};
219
+ Defaults: {};
220
+ }, Readonly< SwitchProps> & Readonly<{
221
+ onChange?: ((val: string | number | boolean) => any) | undefined;
222
+ onInput?: ((val: string | number | boolean) => any) | undefined;
223
+ "onUpdate:modelValue"?: ((val: string | number | boolean) => any) | undefined;
224
+ }>, {
225
+ focus: () => void;
226
+ checked: ComputedRef<boolean>;
227
+ }, {}, {}, {}, {
228
+ disabled: boolean;
229
+ validateEvent: boolean;
230
+ modelValue: boolean | string | number;
231
+ width: string | number;
232
+ name: string;
233
+ activeText: string;
234
+ inactiveText: string;
235
+ activeValue: boolean | string | number;
236
+ inactiveValue: boolean | string | number;
237
+ }>;
238
+ __isFragment?: never;
239
+ __isTeleport?: never;
240
+ __isSuspense?: never;
241
+ } & ComponentOptionsBase<Readonly< SwitchProps> & Readonly<{
242
+ onChange?: ((val: string | number | boolean) => any) | undefined;
243
+ onInput?: ((val: string | number | boolean) => any) | undefined;
244
+ "onUpdate:modelValue"?: ((val: string | number | boolean) => any) | undefined;
245
+ }>, {
246
+ focus: () => void;
247
+ checked: ComputedRef<boolean>;
248
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
249
+ "update:modelValue": (val: string | number | boolean) => void;
250
+ change: (val: string | number | boolean) => void;
251
+ input: (val: string | number | boolean) => void;
252
+ }, string, {
253
+ disabled: boolean;
254
+ validateEvent: boolean;
255
+ modelValue: boolean | string | number;
256
+ width: string | number;
257
+ name: string;
258
+ activeText: string;
259
+ inactiveText: string;
260
+ activeValue: boolean | string | number;
261
+ inactiveValue: boolean | string | number;
262
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
263
+ $slots: {
264
+ inactive?: (props: {}) => any;
265
+ } & {
266
+ inactive?: (props: {}) => any;
267
+ } & {
268
+ active?: (props: {}) => any;
269
+ } & {
270
+ 'active-action'?: (props: {}) => any;
271
+ } & {
272
+ 'inactive-action'?: (props: {}) => any;
273
+ } & {
274
+ active?: (props: {}) => any;
275
+ };
276
+ })>;
277
+ }, {}, string, ComponentProvideOptions, true, {}, any>;
278
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { DefineComponent } from 'vue';
2
+ export interface JTWToggleProps {
3
+ modelValue?: boolean | string | number;
4
+ trueValue?: boolean | string | number;
5
+ falseValue?: boolean | string | number;
6
+ label?: string;
7
+ leftLabel?: boolean;
8
+ color?: string;
9
+ keepColor?: boolean;
10
+ dense?: boolean;
11
+ disable?: boolean;
12
+ readonly?: boolean;
13
+ tabindex?: string | number;
14
+ icon?: string;
15
+ checkedIcon?: string;
16
+ uncheckedIcon?: string;
17
+ iconColor?: string;
18
+ size?: string;
19
+ name?: string;
20
+ id?: string;
21
+ validateEvent?: boolean;
22
+ }
23
+ export interface JTWToggleEmits {
24
+ (e: 'update:modelValue', value: boolean | string | number): void;
25
+ (e: 'change', value: boolean | string | number): void;
26
+ }
27
+ export interface JTWToggleSlots {
28
+ default?: () => any;
29
+ }
30
+ export type JTWToggleEmitsOptions = {
31
+ 'update:modelValue': (value: boolean | string | number) => true;
32
+ change: (value: boolean | string | number) => true;
33
+ };
34
+ export type JTWToggleComponent = DefineComponent<JTWToggleProps, {}, {}, {}, {}, {}, {}, JTWToggleEmitsOptions>;
35
+ export type JTWToggleInstance = InstanceType<JTWToggleComponent>;
36
+ export interface JTWToggleTemplateProps extends JTWToggleProps {
37
+ 'onUpdate:modelValue'?: (value: boolean | string | number) => void;
38
+ onChange?: (value: boolean | string | number) => void;
39
+ class?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
40
+ style?: string | Record<string, string>;
41
+ }
@@ -0,0 +1,3 @@
1
+ import { default as JTWTooltip } from './index';
2
+ export default JTWTooltip;
3
+ export * from './types';
@@ -0,0 +1,126 @@
1
+ import { DefineComponent } from 'vue';
2
+ /** Tooltip 位置常量 */
3
+ export declare const JTWTooltipPlacement: {
4
+ readonly TOP: "top";
5
+ readonly TOP_START: "top-start";
6
+ readonly TOP_END: "top-end";
7
+ readonly BOTTOM: "bottom";
8
+ readonly BOTTOM_START: "bottom-start";
9
+ readonly BOTTOM_END: "bottom-end";
10
+ readonly LEFT: "left";
11
+ readonly LEFT_START: "left-start";
12
+ readonly LEFT_END: "left-end";
13
+ readonly RIGHT: "right";
14
+ readonly RIGHT_START: "right-start";
15
+ readonly RIGHT_END: "right-end";
16
+ };
17
+ /** Tooltip 主题常量 */
18
+ export declare const JTWTooltipEffect: {
19
+ readonly DARK: "dark";
20
+ readonly LIGHT: "light";
21
+ };
22
+ /** Tooltip 触发方式常量 */
23
+ export declare const JTWTooltipTrigger: {
24
+ readonly HOVER: "hover";
25
+ readonly CLICK: "click";
26
+ readonly FOCUS: "focus";
27
+ readonly CONTEXTMENU: "contextmenu";
28
+ };
29
+ /** Tooltip 位置类型 */
30
+ export type JTWTooltipPlacementType = (typeof JTWTooltipPlacement)[keyof typeof JTWTooltipPlacement];
31
+ /** Tooltip 主题类型 */
32
+ export type JTWTooltipEffectType = (typeof JTWTooltipEffect)[keyof typeof JTWTooltipEffect];
33
+ /** Tooltip 触发方式类型 */
34
+ export type JTWTooltipTriggerType = (typeof JTWTooltipTrigger)[keyof typeof JTWTooltipTrigger];
35
+ /**
36
+ * @description JTWTooltip 提示框组件(基于 Element Plus)
37
+ */
38
+ export interface JTWTooltipProps {
39
+ /**
40
+ * Tooltip 内容
41
+ * @default ''
42
+ */
43
+ content?: string | number;
44
+ /**
45
+ * 弹出位置
46
+ * @default 'top'
47
+ */
48
+ placement?: JTWTooltipPlacementType;
49
+ /**
50
+ * 主题
51
+ * @default 'dark'
52
+ */
53
+ effect?: JTWTooltipEffectType;
54
+ /**
55
+ * 触发方式
56
+ * @default 'hover'
57
+ */
58
+ trigger?: JTWTooltipTriggerType;
59
+ /**
60
+ * 是否显示箭头
61
+ * @default true
62
+ */
63
+ showArrow?: boolean;
64
+ /**
65
+ * 延迟显示(毫秒)
66
+ * @default 0
67
+ */
68
+ openDelay?: number;
69
+ /**
70
+ * 延迟隐藏(毫秒)
71
+ * @default 200
72
+ */
73
+ closeDelay?: number;
74
+ /**
75
+ * 偏移量(像素)
76
+ * @default 5
77
+ */
78
+ offset?: number;
79
+ /**
80
+ * 是否禁用
81
+ * @default false
82
+ */
83
+ disabled?: boolean;
84
+ /**
85
+ * Tooltip 的自定义类名
86
+ */
87
+ popperClass?: string;
88
+ /**
89
+ * Tooltip 的自定义样式
90
+ */
91
+ popperStyle?: string | Record<string, string>;
92
+ }
93
+ /** JTWTooltip Emits 接口 */
94
+ export interface JTWTooltipEmits {
95
+ (e: 'visible-change', visible: boolean): void;
96
+ }
97
+ /** JTWTooltip Slots 接口 */
98
+ export interface JTWTooltipSlots {
99
+ /** 默认插槽,触发 Tooltip 的元素 */
100
+ default?: () => any;
101
+ /** Tooltip 内容插槽 */
102
+ content?: () => any;
103
+ }
104
+ /** JTWTooltip 暴露的方法 */
105
+ export interface JTWTooltipExpose {
106
+ /** Tooltip 根元素 */
107
+ $el: HTMLElement | undefined;
108
+ /** 显示 Tooltip */
109
+ show: () => void;
110
+ /** 隐藏 Tooltip */
111
+ hide: () => void;
112
+ }
113
+ /** Emits 配置对象格式 */
114
+ export type JTWTooltipEmitsOptions = {
115
+ 'visible-change': (visible: boolean) => true;
116
+ };
117
+ /** JTWTooltip 组件类型定义 */
118
+ export type JTWTooltipComponent = DefineComponent<JTWTooltipProps, JTWTooltipExpose, {}, {}, {}, {}, {}, JTWTooltipEmitsOptions>;
119
+ /** JTWTooltip 实例类型 */
120
+ export type JTWTooltipInstance = InstanceType<JTWTooltipComponent> & JTWTooltipExpose;
121
+ /** JTWTooltip 模板 Props(用于全局类型声明) */
122
+ export interface JTWTooltipTemplateProps extends JTWTooltipProps {
123
+ onVisibleChange?: (visible: boolean) => void;
124
+ class?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
125
+ style?: string | Record<string, string>;
126
+ }
package/dist/global.d.ts CHANGED
@@ -8,11 +8,14 @@ import { JTWDropdownBtnTemplateProps, JTWDropdownBtnSlots, JTWDropdownBtnEmits }
8
8
  import { JTWFormProps, JTWFormSlots, JTWFormEmits } from './components/j-tw-form/types';
9
9
  import { JTWFormItemProps, JTWFormItemSlots } from './components/j-tw-form-item/types';
10
10
  import { JTWInputTemplateProps, JTWInputSlots, JTWInputEmits } from './components/j-tw-input/types';
11
+ import { JTWPaginationTemplateProps, JTWPaginationEmits } from './components/j-tw-pagination/types';
11
12
  import { JTWRadioTemplateProps, JTWRadioSlots, JTWRadioEmits } from './components/j-tw-radio/types';
12
13
  import { JTWRadioGroupTemplateProps, JTWRadioGroupSlots, JTWRadioGroupEmits } from './components/j-tw-radio-group/types';
13
14
  import { JTWSelectTemplateProps, JTWSelectSlots, JTWSelectEmits } from './components/j-tw-select/types';
14
15
  import { JTWStatusImgProps } from './components/j-tw-status-img/types';
15
16
  import { JTWTableTemplateProps, JTWTableSlots, JTWTableEmits } from './components/j-tw-table/types';
17
+ import { JTWToggleTemplateProps, JTWToggleSlots, JTWToggleEmits } from './components/j-tw-toggle/types';
18
+ import { JTWTooltipTemplateProps, JTWTooltipSlots, JTWTooltipEmits } from './components/j-tw-tooltip/types';
16
19
  import { JTWTreeSelectTemplateProps, JTWTreeSelectSlots, JTWTreeSelectEmits } from './components/j-tw-tree-select/types';
17
20
  import { JTWTreeSelectBtnTemplateProps, JTWTreeSelectBtnSlots, JTWTreeSelectBtnEmits } from './components/j-tw-tree-select-btn/types';
18
21
  import { JTWTreeSelectInputTemplateProps, JTWTreeSelectInputSlots, JTWTreeSelectInputEmits } from './components/j-tw-tree-select-input/types';
@@ -108,6 +111,15 @@ declare module 'vue' {
108
111
  $emit: JTWInputEmits;
109
112
  };
110
113
 
114
+ /**
115
+ * JTWPagination - JTWPagination 组件
116
+ */
117
+ JTWPagination: new () => {
118
+ $props: JTWPaginationTemplateProps;
119
+ $slots: {};
120
+ $emit: JTWPaginationEmits;
121
+ };
122
+
111
123
  /**
112
124
  * JTWRadio - JTWRadio 组件
113
125
  */
@@ -153,6 +165,24 @@ declare module 'vue' {
153
165
  $emit: JTWTableEmits;
154
166
  };
155
167
 
168
+ /**
169
+ * JTWToggle - JTWToggle 组件
170
+ */
171
+ JTWToggle: new () => {
172
+ $props: JTWToggleTemplateProps;
173
+ $slots: JTWToggleSlots;
174
+ $emit: JTWToggleEmits;
175
+ };
176
+
177
+ /**
178
+ * JTWTooltip - JTWTooltip 提示框组件(基于 Element Plus)
179
+ */
180
+ JTWTooltip: new () => {
181
+ $props: JTWTooltipTemplateProps;
182
+ $slots: JTWTooltipSlots;
183
+ $emit: JTWTooltipEmits;
184
+ };
185
+
156
186
  /**
157
187
  * JTWTreeSelect - JTWTreeSelect 扁平树形选择器组件
158
188
  */