@keyblade/pro-components 0.0.6 → 0.0.8
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/es/components.d.ts +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +13 -9
- package/es/pro-layout/index.js +2 -1
- package/es/pro-modal-form/index.d.ts +949 -0
- package/es/pro-modal-form/index.js +13 -0
- package/es/pro-modal-form/pro-modal-form.vue.d.ts +443 -0
- package/es/pro-modal-form/pro-modal-form.vue.js +63 -0
- package/es/pro-modal-form/pro-modal-form.vue2.js +5 -0
- package/es/style.css +5 -5
- package/package.json +1 -1
- package/src/index.ts +5 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _sfc_main from "./pro-modal-form.vue.js";
|
|
2
|
+
import { Modal } from "@arco-design/web-vue";
|
|
3
|
+
const ProModalForm = Object.assign(_sfc_main, {
|
|
4
|
+
install: (app) => {
|
|
5
|
+
app.use(Modal);
|
|
6
|
+
app.component("KbProModalForm", _sfc_main);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const ProModalForm$1 = ProModalForm;
|
|
10
|
+
export {
|
|
11
|
+
ProModalForm,
|
|
12
|
+
ProModalForm$1 as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import type { FieldData } from '@arco-design/web-vue/es/form/interface';
|
|
2
|
+
import type { DefineComponent, ComponentInternalInstance, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComputedRef, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, Ref, ExtractPropTypes, type PropType } from 'vue';
|
|
3
|
+
import type { FieldRule, ValidatedError } from '@arco-design/web-vue';
|
|
4
|
+
declare const _sfc_main: DefineComponent<{
|
|
5
|
+
form: {
|
|
6
|
+
type: PropType<{
|
|
7
|
+
$: ComponentInternalInstance;
|
|
8
|
+
$data: {};
|
|
9
|
+
$props: Partial<{
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
12
|
+
labelColProps: Record<string, any>;
|
|
13
|
+
wrapperColProps: Record<string, any>;
|
|
14
|
+
labelAlign: "left" | "right";
|
|
15
|
+
autoLabelWidth: boolean;
|
|
16
|
+
}> & Omit<Readonly<{
|
|
17
|
+
model?: unknown;
|
|
18
|
+
layout?: unknown;
|
|
19
|
+
size?: unknown;
|
|
20
|
+
labelColProps?: unknown;
|
|
21
|
+
wrapperColProps?: unknown;
|
|
22
|
+
labelColStyle?: unknown;
|
|
23
|
+
wrapperColStyle?: unknown;
|
|
24
|
+
labelAlign?: unknown;
|
|
25
|
+
disabled?: unknown;
|
|
26
|
+
rules?: unknown;
|
|
27
|
+
autoLabelWidth?: unknown;
|
|
28
|
+
} & {
|
|
29
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
30
|
+
model: Record<string, any>;
|
|
31
|
+
labelColProps: Record<string, any>;
|
|
32
|
+
wrapperColProps: Record<string, any>;
|
|
33
|
+
labelAlign: "left" | "right";
|
|
34
|
+
autoLabelWidth: boolean;
|
|
35
|
+
} & {
|
|
36
|
+
disabled?: boolean | undefined;
|
|
37
|
+
size?: "mini" | "medium" | "large" | "small" | undefined;
|
|
38
|
+
labelColStyle?: Record<string, any> | undefined;
|
|
39
|
+
wrapperColStyle?: Record<string, any> | undefined;
|
|
40
|
+
rules?: Record<string, FieldRule<any> | FieldRule<any>[]> | undefined;
|
|
41
|
+
}> & {
|
|
42
|
+
onSubmit?: ((data: {
|
|
43
|
+
values: Record<string, any>;
|
|
44
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
45
|
+
}, ev: Event) => any) | undefined;
|
|
46
|
+
onSubmitSuccess?: ((values: Record<string, any>, ev: Event) => any) | undefined;
|
|
47
|
+
onSubmitFailed?: ((data: {
|
|
48
|
+
values: Record<string, any>;
|
|
49
|
+
errors: Record<string, ValidatedError>;
|
|
50
|
+
}, ev: Event) => any) | undefined;
|
|
51
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "layout" | "labelColProps" | "wrapperColProps" | "labelAlign" | "disabled" | "autoLabelWidth">;
|
|
52
|
+
$attrs: {
|
|
53
|
+
[x: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
$refs: {
|
|
56
|
+
[x: string]: unknown;
|
|
57
|
+
};
|
|
58
|
+
$slots: Readonly<{
|
|
59
|
+
[name: string]: Slot | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
$root: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
62
|
+
$parent: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
63
|
+
$emit: ((event: "submit", data: {
|
|
64
|
+
values: Record<string, any>;
|
|
65
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
66
|
+
}, ev: Event) => void) & ((event: "submitSuccess", values: Record<string, any>, ev: Event) => void) & ((event: "submitFailed", data: {
|
|
67
|
+
values: Record<string, any>;
|
|
68
|
+
errors: Record<string, ValidatedError>;
|
|
69
|
+
}, ev: Event) => void);
|
|
70
|
+
$el: any;
|
|
71
|
+
$options: ComponentOptionsBase<Readonly<{
|
|
72
|
+
model?: unknown;
|
|
73
|
+
layout?: unknown;
|
|
74
|
+
size?: unknown;
|
|
75
|
+
labelColProps?: unknown;
|
|
76
|
+
wrapperColProps?: unknown;
|
|
77
|
+
labelColStyle?: unknown;
|
|
78
|
+
wrapperColStyle?: unknown;
|
|
79
|
+
labelAlign?: unknown;
|
|
80
|
+
disabled?: unknown;
|
|
81
|
+
rules?: unknown;
|
|
82
|
+
autoLabelWidth?: unknown;
|
|
83
|
+
} & {
|
|
84
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
85
|
+
model: Record<string, any>;
|
|
86
|
+
labelColProps: Record<string, any>;
|
|
87
|
+
wrapperColProps: Record<string, any>;
|
|
88
|
+
labelAlign: "left" | "right";
|
|
89
|
+
autoLabelWidth: boolean;
|
|
90
|
+
} & {
|
|
91
|
+
disabled?: boolean | undefined;
|
|
92
|
+
size?: "mini" | "medium" | "large" | "small" | undefined;
|
|
93
|
+
labelColStyle?: Record<string, any> | undefined;
|
|
94
|
+
wrapperColStyle?: Record<string, any> | undefined;
|
|
95
|
+
rules?: Record<string, FieldRule<any> | FieldRule<any>[]> | undefined;
|
|
96
|
+
}> & {
|
|
97
|
+
onSubmit?: ((data: {
|
|
98
|
+
values: Record<string, any>;
|
|
99
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
100
|
+
}, ev: Event) => any) | undefined;
|
|
101
|
+
onSubmitSuccess?: ((values: Record<string, any>, ev: Event) => any) | undefined;
|
|
102
|
+
onSubmitFailed?: ((data: {
|
|
103
|
+
values: Record<string, any>;
|
|
104
|
+
errors: Record<string, ValidatedError>;
|
|
105
|
+
}, ev: Event) => any) | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
cls: ComputedRef<(string | {
|
|
108
|
+
[x: string]: boolean;
|
|
109
|
+
})[]>;
|
|
110
|
+
handleSubmit: (e: Event) => void;
|
|
111
|
+
innerValidate: (callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined) => Promise<Record<string, ValidatedError> | undefined>;
|
|
112
|
+
innerValidateField: (field: string | string[], callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined) => Promise<Record<string, ValidatedError> | undefined>;
|
|
113
|
+
innerResetFields: (field?: string | string[] | undefined) => void;
|
|
114
|
+
innerClearValidate: (field?: string | string[] | undefined) => void;
|
|
115
|
+
innerSetFields: (data: Record<string, FieldData>) => void;
|
|
116
|
+
}, unknown, {}, {
|
|
117
|
+
validate(callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined): Promise<Record<string, ValidatedError> | undefined>;
|
|
118
|
+
validateField(field: string | string[], callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined): Promise<Record<string, ValidatedError> | undefined>;
|
|
119
|
+
resetFields(field?: string | string[] | undefined): void;
|
|
120
|
+
clearValidate(field?: string | string[] | undefined): void;
|
|
121
|
+
setFields(data: Record<string, FieldData>): void;
|
|
122
|
+
}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
123
|
+
submit: (data: {
|
|
124
|
+
values: Record<string, any>;
|
|
125
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
126
|
+
}, ev: Event) => true;
|
|
127
|
+
submitSuccess: (values: Record<string, any>, ev: Event) => true;
|
|
128
|
+
submitFailed: (data: {
|
|
129
|
+
values: Record<string, any>;
|
|
130
|
+
errors: Record<string, ValidatedError>;
|
|
131
|
+
}, ev: Event) => true;
|
|
132
|
+
}, string, {
|
|
133
|
+
disabled: boolean;
|
|
134
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
135
|
+
labelColProps: Record<string, any>;
|
|
136
|
+
wrapperColProps: Record<string, any>;
|
|
137
|
+
labelAlign: "left" | "right";
|
|
138
|
+
autoLabelWidth: boolean;
|
|
139
|
+
}, {}, string> & {
|
|
140
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
141
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
142
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
143
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
144
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
145
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
146
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
147
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
148
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
149
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
150
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
151
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
152
|
+
renderTracked?: (((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[]) | undefined;
|
|
153
|
+
renderTriggered?: (((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[]) | undefined;
|
|
154
|
+
errorCaptured?: (((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
|
|
155
|
+
};
|
|
156
|
+
$forceUpdate: () => void;
|
|
157
|
+
$nextTick: typeof nextTick;
|
|
158
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: WatchOptions<boolean> | undefined): WatchStopHandle;
|
|
159
|
+
} & Readonly<{
|
|
160
|
+
model?: unknown;
|
|
161
|
+
layout?: unknown;
|
|
162
|
+
size?: unknown;
|
|
163
|
+
labelColProps?: unknown;
|
|
164
|
+
wrapperColProps?: unknown;
|
|
165
|
+
labelColStyle?: unknown;
|
|
166
|
+
wrapperColStyle?: unknown;
|
|
167
|
+
labelAlign?: unknown;
|
|
168
|
+
disabled?: unknown;
|
|
169
|
+
rules?: unknown;
|
|
170
|
+
autoLabelWidth?: unknown;
|
|
171
|
+
} & {
|
|
172
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
173
|
+
model: Record<string, any>;
|
|
174
|
+
labelColProps: Record<string, any>;
|
|
175
|
+
wrapperColProps: Record<string, any>;
|
|
176
|
+
labelAlign: "left" | "right";
|
|
177
|
+
autoLabelWidth: boolean;
|
|
178
|
+
} & {
|
|
179
|
+
disabled?: boolean | undefined;
|
|
180
|
+
size?: "mini" | "medium" | "large" | "small" | undefined;
|
|
181
|
+
labelColStyle?: Record<string, any> | undefined;
|
|
182
|
+
wrapperColStyle?: Record<string, any> | undefined;
|
|
183
|
+
rules?: Record<string, FieldRule<any> | FieldRule<any>[]> | undefined;
|
|
184
|
+
}> & {
|
|
185
|
+
onSubmit?: ((data: {
|
|
186
|
+
values: Record<string, any>;
|
|
187
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
188
|
+
}, ev: Event) => any) | undefined;
|
|
189
|
+
onSubmitSuccess?: ((values: Record<string, any>, ev: Event) => any) | undefined;
|
|
190
|
+
onSubmitFailed?: ((data: {
|
|
191
|
+
values: Record<string, any>;
|
|
192
|
+
errors: Record<string, ValidatedError>;
|
|
193
|
+
}, ev: Event) => any) | undefined;
|
|
194
|
+
} & ShallowUnwrapRef<{
|
|
195
|
+
cls: ComputedRef<(string | {
|
|
196
|
+
[x: string]: boolean;
|
|
197
|
+
})[]>;
|
|
198
|
+
handleSubmit: (e: Event) => void;
|
|
199
|
+
innerValidate: (callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined) => Promise<Record<string, ValidatedError> | undefined>;
|
|
200
|
+
innerValidateField: (field: string | string[], callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined) => Promise<Record<string, ValidatedError> | undefined>;
|
|
201
|
+
innerResetFields: (field?: string | string[] | undefined) => void;
|
|
202
|
+
innerClearValidate: (field?: string | string[] | undefined) => void;
|
|
203
|
+
innerSetFields: (data: Record<string, FieldData>) => void;
|
|
204
|
+
}> & {} & {
|
|
205
|
+
validate(callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined): Promise<Record<string, ValidatedError> | undefined>;
|
|
206
|
+
validateField(field: string | string[], callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined): Promise<Record<string, ValidatedError> | undefined>;
|
|
207
|
+
resetFields(field?: string | string[] | undefined): void;
|
|
208
|
+
clearValidate(field?: string | string[] | undefined): void;
|
|
209
|
+
setFields(data: Record<string, FieldData>): void;
|
|
210
|
+
} & ComponentCustomProperties & {}>;
|
|
211
|
+
required: false;
|
|
212
|
+
};
|
|
213
|
+
}, {
|
|
214
|
+
attrs: {
|
|
215
|
+
onCancel: () => void;
|
|
216
|
+
'unmount-on-close': '' | boolean;
|
|
217
|
+
};
|
|
218
|
+
slots: Readonly<{
|
|
219
|
+
[name: string]: Slot | undefined;
|
|
220
|
+
}>;
|
|
221
|
+
props: any;
|
|
222
|
+
emit: {
|
|
223
|
+
(event: 'finish', callback: (success: boolean) => void): void;
|
|
224
|
+
(event: 'failed', errors: Record<string, ValidatedError>): void;
|
|
225
|
+
};
|
|
226
|
+
okLoading: Ref<boolean>;
|
|
227
|
+
onOk: () => void;
|
|
228
|
+
onBeforeCancel: () => boolean;
|
|
229
|
+
onCancel: () => void;
|
|
230
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("finish" | "failed")[], "finish" | "failed", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
231
|
+
form: {
|
|
232
|
+
type: PropType<{
|
|
233
|
+
$: ComponentInternalInstance;
|
|
234
|
+
$data: {};
|
|
235
|
+
$props: Partial<{
|
|
236
|
+
disabled: boolean;
|
|
237
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
238
|
+
labelColProps: Record<string, any>;
|
|
239
|
+
wrapperColProps: Record<string, any>;
|
|
240
|
+
labelAlign: "left" | "right";
|
|
241
|
+
autoLabelWidth: boolean;
|
|
242
|
+
}> & Omit<Readonly<{
|
|
243
|
+
model?: unknown;
|
|
244
|
+
layout?: unknown;
|
|
245
|
+
size?: unknown;
|
|
246
|
+
labelColProps?: unknown;
|
|
247
|
+
wrapperColProps?: unknown;
|
|
248
|
+
labelColStyle?: unknown;
|
|
249
|
+
wrapperColStyle?: unknown;
|
|
250
|
+
labelAlign?: unknown;
|
|
251
|
+
disabled?: unknown;
|
|
252
|
+
rules?: unknown;
|
|
253
|
+
autoLabelWidth?: unknown;
|
|
254
|
+
} & {
|
|
255
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
256
|
+
model: Record<string, any>;
|
|
257
|
+
labelColProps: Record<string, any>;
|
|
258
|
+
wrapperColProps: Record<string, any>;
|
|
259
|
+
labelAlign: "left" | "right";
|
|
260
|
+
autoLabelWidth: boolean;
|
|
261
|
+
} & {
|
|
262
|
+
disabled?: boolean | undefined;
|
|
263
|
+
size?: "mini" | "medium" | "large" | "small" | undefined;
|
|
264
|
+
labelColStyle?: Record<string, any> | undefined;
|
|
265
|
+
wrapperColStyle?: Record<string, any> | undefined;
|
|
266
|
+
rules?: Record<string, FieldRule<any> | FieldRule<any>[]> | undefined;
|
|
267
|
+
}> & {
|
|
268
|
+
onSubmit?: ((data: {
|
|
269
|
+
values: Record<string, any>;
|
|
270
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
271
|
+
}, ev: Event) => any) | undefined;
|
|
272
|
+
onSubmitSuccess?: ((values: Record<string, any>, ev: Event) => any) | undefined;
|
|
273
|
+
onSubmitFailed?: ((data: {
|
|
274
|
+
values: Record<string, any>;
|
|
275
|
+
errors: Record<string, ValidatedError>;
|
|
276
|
+
}, ev: Event) => any) | undefined;
|
|
277
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "layout" | "labelColProps" | "wrapperColProps" | "labelAlign" | "disabled" | "autoLabelWidth">;
|
|
278
|
+
$attrs: {
|
|
279
|
+
[x: string]: unknown;
|
|
280
|
+
};
|
|
281
|
+
$refs: {
|
|
282
|
+
[x: string]: unknown;
|
|
283
|
+
};
|
|
284
|
+
$slots: Readonly<{
|
|
285
|
+
[name: string]: Slot | undefined;
|
|
286
|
+
}>;
|
|
287
|
+
$root: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
288
|
+
$parent: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
289
|
+
$emit: ((event: "submit", data: {
|
|
290
|
+
values: Record<string, any>;
|
|
291
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
292
|
+
}, ev: Event) => void) & ((event: "submitSuccess", values: Record<string, any>, ev: Event) => void) & ((event: "submitFailed", data: {
|
|
293
|
+
values: Record<string, any>;
|
|
294
|
+
errors: Record<string, ValidatedError>;
|
|
295
|
+
}, ev: Event) => void);
|
|
296
|
+
$el: any;
|
|
297
|
+
$options: ComponentOptionsBase<Readonly<{
|
|
298
|
+
model?: unknown;
|
|
299
|
+
layout?: unknown;
|
|
300
|
+
size?: unknown;
|
|
301
|
+
labelColProps?: unknown;
|
|
302
|
+
wrapperColProps?: unknown;
|
|
303
|
+
labelColStyle?: unknown;
|
|
304
|
+
wrapperColStyle?: unknown;
|
|
305
|
+
labelAlign?: unknown;
|
|
306
|
+
disabled?: unknown;
|
|
307
|
+
rules?: unknown;
|
|
308
|
+
autoLabelWidth?: unknown;
|
|
309
|
+
} & {
|
|
310
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
311
|
+
model: Record<string, any>;
|
|
312
|
+
labelColProps: Record<string, any>;
|
|
313
|
+
wrapperColProps: Record<string, any>;
|
|
314
|
+
labelAlign: "left" | "right";
|
|
315
|
+
autoLabelWidth: boolean;
|
|
316
|
+
} & {
|
|
317
|
+
disabled?: boolean | undefined;
|
|
318
|
+
size?: "mini" | "medium" | "large" | "small" | undefined;
|
|
319
|
+
labelColStyle?: Record<string, any> | undefined;
|
|
320
|
+
wrapperColStyle?: Record<string, any> | undefined;
|
|
321
|
+
rules?: Record<string, FieldRule<any> | FieldRule<any>[]> | undefined;
|
|
322
|
+
}> & {
|
|
323
|
+
onSubmit?: ((data: {
|
|
324
|
+
values: Record<string, any>;
|
|
325
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
326
|
+
}, ev: Event) => any) | undefined;
|
|
327
|
+
onSubmitSuccess?: ((values: Record<string, any>, ev: Event) => any) | undefined;
|
|
328
|
+
onSubmitFailed?: ((data: {
|
|
329
|
+
values: Record<string, any>;
|
|
330
|
+
errors: Record<string, ValidatedError>;
|
|
331
|
+
}, ev: Event) => any) | undefined;
|
|
332
|
+
}, {
|
|
333
|
+
cls: ComputedRef<(string | {
|
|
334
|
+
[x: string]: boolean;
|
|
335
|
+
})[]>;
|
|
336
|
+
handleSubmit: (e: Event) => void;
|
|
337
|
+
innerValidate: (callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined) => Promise<Record<string, ValidatedError> | undefined>;
|
|
338
|
+
innerValidateField: (field: string | string[], callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined) => Promise<Record<string, ValidatedError> | undefined>;
|
|
339
|
+
innerResetFields: (field?: string | string[] | undefined) => void;
|
|
340
|
+
innerClearValidate: (field?: string | string[] | undefined) => void;
|
|
341
|
+
innerSetFields: (data: Record<string, FieldData>) => void;
|
|
342
|
+
}, unknown, {}, {
|
|
343
|
+
validate(callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined): Promise<Record<string, ValidatedError> | undefined>;
|
|
344
|
+
validateField(field: string | string[], callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined): Promise<Record<string, ValidatedError> | undefined>;
|
|
345
|
+
resetFields(field?: string | string[] | undefined): void;
|
|
346
|
+
clearValidate(field?: string | string[] | undefined): void;
|
|
347
|
+
setFields(data: Record<string, FieldData>): void;
|
|
348
|
+
}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
349
|
+
submit: (data: {
|
|
350
|
+
values: Record<string, any>;
|
|
351
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
352
|
+
}, ev: Event) => true;
|
|
353
|
+
submitSuccess: (values: Record<string, any>, ev: Event) => true;
|
|
354
|
+
submitFailed: (data: {
|
|
355
|
+
values: Record<string, any>;
|
|
356
|
+
errors: Record<string, ValidatedError>;
|
|
357
|
+
}, ev: Event) => true;
|
|
358
|
+
}, string, {
|
|
359
|
+
disabled: boolean;
|
|
360
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
361
|
+
labelColProps: Record<string, any>;
|
|
362
|
+
wrapperColProps: Record<string, any>;
|
|
363
|
+
labelAlign: "left" | "right";
|
|
364
|
+
autoLabelWidth: boolean;
|
|
365
|
+
}, {}, string> & {
|
|
366
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
367
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
368
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
369
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
370
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
371
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
372
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
373
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
374
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
375
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
376
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
377
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
378
|
+
renderTracked?: (((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[]) | undefined;
|
|
379
|
+
renderTriggered?: (((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[]) | undefined;
|
|
380
|
+
errorCaptured?: (((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
|
|
381
|
+
};
|
|
382
|
+
$forceUpdate: () => void;
|
|
383
|
+
$nextTick: typeof nextTick;
|
|
384
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: WatchOptions<boolean> | undefined): WatchStopHandle;
|
|
385
|
+
} & Readonly<{
|
|
386
|
+
model?: unknown;
|
|
387
|
+
layout?: unknown;
|
|
388
|
+
size?: unknown;
|
|
389
|
+
labelColProps?: unknown;
|
|
390
|
+
wrapperColProps?: unknown;
|
|
391
|
+
labelColStyle?: unknown;
|
|
392
|
+
wrapperColStyle?: unknown;
|
|
393
|
+
labelAlign?: unknown;
|
|
394
|
+
disabled?: unknown;
|
|
395
|
+
rules?: unknown;
|
|
396
|
+
autoLabelWidth?: unknown;
|
|
397
|
+
} & {
|
|
398
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
399
|
+
model: Record<string, any>;
|
|
400
|
+
labelColProps: Record<string, any>;
|
|
401
|
+
wrapperColProps: Record<string, any>;
|
|
402
|
+
labelAlign: "left" | "right";
|
|
403
|
+
autoLabelWidth: boolean;
|
|
404
|
+
} & {
|
|
405
|
+
disabled?: boolean | undefined;
|
|
406
|
+
size?: "mini" | "medium" | "large" | "small" | undefined;
|
|
407
|
+
labelColStyle?: Record<string, any> | undefined;
|
|
408
|
+
wrapperColStyle?: Record<string, any> | undefined;
|
|
409
|
+
rules?: Record<string, FieldRule<any> | FieldRule<any>[]> | undefined;
|
|
410
|
+
}> & {
|
|
411
|
+
onSubmit?: ((data: {
|
|
412
|
+
values: Record<string, any>;
|
|
413
|
+
errors: Record<string, ValidatedError> | undefined;
|
|
414
|
+
}, ev: Event) => any) | undefined;
|
|
415
|
+
onSubmitSuccess?: ((values: Record<string, any>, ev: Event) => any) | undefined;
|
|
416
|
+
onSubmitFailed?: ((data: {
|
|
417
|
+
values: Record<string, any>;
|
|
418
|
+
errors: Record<string, ValidatedError>;
|
|
419
|
+
}, ev: Event) => any) | undefined;
|
|
420
|
+
} & ShallowUnwrapRef<{
|
|
421
|
+
cls: ComputedRef<(string | {
|
|
422
|
+
[x: string]: boolean;
|
|
423
|
+
})[]>;
|
|
424
|
+
handleSubmit: (e: Event) => void;
|
|
425
|
+
innerValidate: (callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined) => Promise<Record<string, ValidatedError> | undefined>;
|
|
426
|
+
innerValidateField: (field: string | string[], callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined) => Promise<Record<string, ValidatedError> | undefined>;
|
|
427
|
+
innerResetFields: (field?: string | string[] | undefined) => void;
|
|
428
|
+
innerClearValidate: (field?: string | string[] | undefined) => void;
|
|
429
|
+
innerSetFields: (data: Record<string, FieldData>) => void;
|
|
430
|
+
}> & {} & {
|
|
431
|
+
validate(callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined): Promise<Record<string, ValidatedError> | undefined>;
|
|
432
|
+
validateField(field: string | string[], callback?: ((errors: Record<string, ValidatedError> | undefined) => void) | undefined): Promise<Record<string, ValidatedError> | undefined>;
|
|
433
|
+
resetFields(field?: string | string[] | undefined): void;
|
|
434
|
+
clearValidate(field?: string | string[] | undefined): void;
|
|
435
|
+
setFields(data: Record<string, FieldData>): void;
|
|
436
|
+
} & ComponentCustomProperties & {}>;
|
|
437
|
+
required: false;
|
|
438
|
+
};
|
|
439
|
+
}>> & {
|
|
440
|
+
onFinish?: ((...args: any[]) => any) | undefined;
|
|
441
|
+
onFailed?: ((...args: any[]) => any) | undefined;
|
|
442
|
+
}, {}>;
|
|
443
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, useSlots, ref, resolveComponent, openBlock, createBlock, mergeProps, unref, createSlots, renderList, withCtx, renderSlot } from "vue";
|
|
2
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
+
__name: "pro-modal-form",
|
|
4
|
+
props: {
|
|
5
|
+
form: {
|
|
6
|
+
type: Object,
|
|
7
|
+
required: false
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
emits: ["finish", "failed"],
|
|
11
|
+
setup(__props, { emit }) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
const attrs = useAttrs();
|
|
14
|
+
const slots = useSlots();
|
|
15
|
+
const okLoading = ref(false);
|
|
16
|
+
const onOk = () => {
|
|
17
|
+
var _a;
|
|
18
|
+
(_a = props == null ? void 0 : props.form) == null ? void 0 : _a.validate((errors) => {
|
|
19
|
+
if (errors) {
|
|
20
|
+
return emit("failed", errors);
|
|
21
|
+
}
|
|
22
|
+
okLoading.value = true;
|
|
23
|
+
emit("finish", (success) => {
|
|
24
|
+
var _a2;
|
|
25
|
+
okLoading.value = false;
|
|
26
|
+
success && ((_a2 = attrs.onCancel) == null ? void 0 : _a2.call(attrs));
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const onBeforeCancel = () => {
|
|
31
|
+
return !okLoading.value;
|
|
32
|
+
};
|
|
33
|
+
const onCancel = () => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
if (attrs["unmount-on-close"] === "" || attrs["unmount-on-close"]) {
|
|
36
|
+
(_a = props == null ? void 0 : props.form) == null ? void 0 : _a.clearValidate();
|
|
37
|
+
(_b = props == null ? void 0 : props.form) == null ? void 0 : _b.resetFields();
|
|
38
|
+
}
|
|
39
|
+
(_c = attrs.onCancel) == null ? void 0 : _c.call(attrs);
|
|
40
|
+
};
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
const _component_a_modal = resolveComponent("a-modal");
|
|
43
|
+
return openBlock(), createBlock(_component_a_modal, mergeProps(unref(attrs), {
|
|
44
|
+
"ok-loading": okLoading.value,
|
|
45
|
+
"on-before-cancel": onBeforeCancel,
|
|
46
|
+
onOk,
|
|
47
|
+
onCancel
|
|
48
|
+
}), createSlots({ _: 2 }, [
|
|
49
|
+
renderList(Object.keys(unref(slots)), (key) => {
|
|
50
|
+
return {
|
|
51
|
+
name: key,
|
|
52
|
+
fn: withCtx(() => [
|
|
53
|
+
renderSlot(_ctx.$slots, key)
|
|
54
|
+
])
|
|
55
|
+
};
|
|
56
|
+
})
|
|
57
|
+
]), 1040, ["ok-loading"]);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
_sfc_main as default
|
|
63
|
+
};
|
package/es/style.css
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
.keyblade-pro-page-wrapper {
|
|
2
2
|
padding: 0 20px 20px 20px;
|
|
3
3
|
}
|
|
4
|
-
.keyblade-pro-reuse-tabs {
|
|
5
|
-
position: relative;
|
|
6
|
-
background-color: var(--color-bg-2);
|
|
7
|
-
padding: 4px 20px;
|
|
8
|
-
}
|
|
9
4
|
.keyblade-pro-layout {
|
|
10
5
|
width: 100%;
|
|
11
6
|
height: 100%;
|
|
@@ -78,3 +73,8 @@
|
|
|
78
73
|
.keyblade-pro-layout-body-collapsed {
|
|
79
74
|
padding-left: var(--5b964541);
|
|
80
75
|
}
|
|
76
|
+
.keyblade-pro-reuse-tabs {
|
|
77
|
+
position: relative;
|
|
78
|
+
background-color: var(--color-bg-2);
|
|
79
|
+
padding: 4px 20px;
|
|
80
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { App } from 'vue'
|
|
2
2
|
import { ProBreadcrumb } from './pro-breadcrumb'
|
|
3
|
+
import { ProLayout } from './pro-layout'
|
|
3
4
|
import { ProMenu } from './pro-menu'
|
|
5
|
+
import { ProModalForm } from './pro-modal-form'
|
|
4
6
|
import { ProPageWrapper } from './pro-page-wrapper'
|
|
5
7
|
import { ProReuseTabs } from './pro-reuse-tabs'
|
|
6
|
-
import { ProLayout } from './pro-layout'
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
10
|
install(app: App): void {
|
|
10
11
|
app.use(ProBreadcrumb)
|
|
11
12
|
app.use(ProLayout)
|
|
12
13
|
app.use(ProMenu)
|
|
14
|
+
app.use(ProModalForm)
|
|
13
15
|
app.use(ProPageWrapper)
|
|
14
16
|
app.use(ProReuseTabs)
|
|
15
17
|
}
|
|
@@ -23,6 +25,8 @@ export { default as ProLayout } from './pro-layout'
|
|
|
23
25
|
export { default as ProMenu } from './pro-menu'
|
|
24
26
|
export type { IProMenuItem } from './pro-menu'
|
|
25
27
|
|
|
28
|
+
export { default as ProModalForm } from './pro-modal-form'
|
|
29
|
+
|
|
26
30
|
export { default as ProPageWrapper } from './pro-page-wrapper'
|
|
27
31
|
|
|
28
32
|
export { default as ProReuseTabs } from './pro-reuse-tabs'
|