@jnrs/vue-core 1.2.9 → 1.2.10

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,387 @@
1
+ import { ElSize, ElButtonType } from '../types/base';
2
+ import { BusinessResponse } from '@jnrs/shared/request';
3
+ import { nextTick } from 'vue';
4
+ export interface Props {
5
+ /**
6
+ * 下载导入模板文件的 api 函数
7
+ */
8
+ importTemplateApi?: () => Promise<Blob>;
9
+ /**
10
+ * 数据导入 api 函数
11
+ */
12
+ importApi?: (data: FormData) => Promise<BusinessResponse>;
13
+ /**
14
+ * 数据导入的字段名
15
+ */
16
+ importFieldName?: string;
17
+ /**
18
+ * 导入的参数
19
+ */
20
+ importParams?: Record<string, unknown>;
21
+ /**
22
+ * 导出操作时,MessageBox 的参数配置
23
+ */
24
+ fileUploadConfig?: {
25
+ /**
26
+ * 接受的文件类型,默认为 .xls,.xlsx
27
+ */
28
+ accept: string;
29
+ /**
30
+ * 最大上传文件数量,0 表示不限制,默认为 1
31
+ */
32
+ limit: number;
33
+ };
34
+ /**
35
+ * 导入的按钮名称
36
+ */
37
+ importBtnName?: string;
38
+ /**
39
+ * 是否禁用导入按钮
40
+ */
41
+ importDisabled?: boolean;
42
+ /**
43
+ * 数据导出的 api 函数
44
+ */
45
+ exportApi?: (data: Record<string, unknown>) => Promise<Blob>;
46
+ /**
47
+ * 导出的参数
48
+ */
49
+ exportParams?: Record<string, unknown>;
50
+ /**
51
+ * 导出操作时,MessageBox 的参数配置
52
+ */
53
+ exportDynamicParamsConfig?: {
54
+ /**
55
+ * MessageBox 中名称
56
+ */
57
+ label: string;
58
+ /**
59
+ * 导出的参数值
60
+ */
61
+ prop: string;
62
+ };
63
+ /**
64
+ * 导出操作时,MessageBox 中输入框的校验表达式(正则表达式)
65
+ */
66
+ messageBoxInputPattern?: RegExp;
67
+ /**
68
+ * 导出操作时,MessageBox 中输入框的校验未通过时的提示文本
69
+ */
70
+ messageBoxInputErrorMessage?: string;
71
+ /**
72
+ * 导出的按钮名称
73
+ */
74
+ exportBtnName?: string;
75
+ /**
76
+ * 是否禁用导出按钮
77
+ */
78
+ exportDisabled?: boolean;
79
+ /**
80
+ * 按钮尺寸
81
+ */
82
+ size?: ElSize;
83
+ /**
84
+ * 按钮类型
85
+ */
86
+ buttonType?: ElButtonType;
87
+ /**
88
+ * 是否为朴素按钮
89
+ */
90
+ plain?: boolean;
91
+ /**
92
+ * 是否为文字按钮
93
+ */
94
+ text?: boolean;
95
+ /**
96
+ * 是否显示图标
97
+ */
98
+ icon?: boolean;
99
+ }
100
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
101
+ change: (...args: any[]) => void;
102
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
103
+ onChange?: ((...args: any[]) => any) | undefined;
104
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
105
+ importDialogRef: ({
106
+ $: import('vue').ComponentInternalInstance;
107
+ $data: {};
108
+ $props: {
109
+ readonly title?: string | undefined;
110
+ readonly width?: string | number | undefined;
111
+ readonly onClosed?: (() => any) | undefined;
112
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
113
+ $attrs: {
114
+ [x: string]: unknown;
115
+ };
116
+ $refs: {
117
+ [x: string]: unknown;
118
+ };
119
+ $slots: Readonly<{
120
+ [name: string]: import('vue').Slot<any> | undefined;
121
+ }>;
122
+ $root: import('vue').ComponentPublicInstance | null;
123
+ $parent: import('vue').ComponentPublicInstance | null;
124
+ $host: Element | null;
125
+ $emit: (event: "closed") => void;
126
+ $el: any;
127
+ $options: import('vue').ComponentOptionsBase<Readonly<import('./JnDialog.vue').Props> & Readonly<{
128
+ onClosed?: (() => any) | undefined;
129
+ }>, {
130
+ open: () => void;
131
+ close: () => void;
132
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
133
+ closed: () => any;
134
+ }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
135
+ beforeCreate?: (() => void) | (() => void)[];
136
+ created?: (() => void) | (() => void)[];
137
+ beforeMount?: (() => void) | (() => void)[];
138
+ mounted?: (() => void) | (() => void)[];
139
+ beforeUpdate?: (() => void) | (() => void)[];
140
+ updated?: (() => void) | (() => void)[];
141
+ activated?: (() => void) | (() => void)[];
142
+ deactivated?: (() => void) | (() => void)[];
143
+ beforeDestroy?: (() => void) | (() => void)[];
144
+ beforeUnmount?: (() => void) | (() => void)[];
145
+ destroyed?: (() => void) | (() => void)[];
146
+ unmounted?: (() => void) | (() => void)[];
147
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
148
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
149
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
150
+ };
151
+ $forceUpdate: () => void;
152
+ $nextTick: typeof nextTick;
153
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
154
+ } & Readonly<{}> & Omit<Readonly<import('./JnDialog.vue').Props> & Readonly<{
155
+ onClosed?: (() => any) | undefined;
156
+ }>, "open" | "close"> & import('vue').ShallowUnwrapRef<{
157
+ open: () => void;
158
+ close: () => void;
159
+ }> & {} & import('vue').ComponentCustomProperties & {} & {
160
+ $slots: {
161
+ default?(_: {}): any;
162
+ footer?(_: {}): any;
163
+ };
164
+ }) | null;
165
+ ruleFormRef: ({
166
+ $: import('vue').ComponentInternalInstance;
167
+ $data: {};
168
+ $props: Partial<{
169
+ labelWidth: string | number;
170
+ labelPosition: "left" | "right" | "top";
171
+ showMessage: boolean;
172
+ requireAsteriskPosition: "left" | "right";
173
+ labelSuffix: string;
174
+ validateOnRuleChange: boolean;
175
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
176
+ }> & Omit<{
177
+ readonly labelPosition: "left" | "right" | "top";
178
+ readonly requireAsteriskPosition: "left" | "right";
179
+ readonly labelWidth: string | number;
180
+ readonly labelSuffix: string;
181
+ readonly showMessage: boolean;
182
+ readonly validateOnRuleChange: boolean;
183
+ readonly scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
184
+ readonly size?: import('element-plus').ComponentSize | undefined;
185
+ readonly disabled?: boolean | undefined;
186
+ readonly model?: Record<string, any> | undefined;
187
+ readonly rules?: import('element-plus').FormRules | undefined;
188
+ readonly inline?: boolean | undefined;
189
+ readonly inlineMessage?: boolean | undefined;
190
+ readonly statusIcon?: boolean | undefined;
191
+ readonly hideRequiredAsterisk?: boolean | undefined;
192
+ readonly scrollToError?: boolean | undefined;
193
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined | undefined;
194
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "labelPosition" | "requireAsteriskPosition" | "labelWidth" | "labelSuffix" | "showMessage" | "validateOnRuleChange" | "scrollIntoViewOptions">;
195
+ $attrs: {
196
+ [x: string]: unknown;
197
+ };
198
+ $refs: {
199
+ [x: string]: unknown;
200
+ };
201
+ $slots: Readonly<{
202
+ [name: string]: import('vue').Slot<any> | undefined;
203
+ }>;
204
+ $root: import('vue').ComponentPublicInstance | null;
205
+ $parent: import('vue').ComponentPublicInstance | null;
206
+ $host: Element | null;
207
+ $emit: (event: "validate", prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => void;
208
+ $el: any;
209
+ $options: import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
210
+ size: {
211
+ type: import('vue').PropType<"" | "large" | "default" | "small">;
212
+ };
213
+ disabled: {
214
+ type: import('vue').PropType<boolean>;
215
+ };
216
+ model: {
217
+ type: import('vue').PropType<Record<string, any>>;
218
+ };
219
+ rules: {
220
+ type: import('vue').PropType<Partial<Record<string, Record<string, any> | import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemRule>>>>;
221
+ };
222
+ labelPosition: {
223
+ type: import('vue').PropType<"top" | "left" | "right">;
224
+ default: string;
225
+ };
226
+ requireAsteriskPosition: {
227
+ type: import('vue').PropType<"left" | "right">;
228
+ default: string;
229
+ };
230
+ labelWidth: {
231
+ type: import('vue').PropType<string | number>;
232
+ default: string;
233
+ };
234
+ labelSuffix: {
235
+ type: import('vue').PropType<string>;
236
+ default: string;
237
+ };
238
+ inline: {
239
+ type: import('vue').PropType<boolean>;
240
+ };
241
+ inlineMessage: {
242
+ type: import('vue').PropType<boolean>;
243
+ };
244
+ statusIcon: {
245
+ type: import('vue').PropType<boolean>;
246
+ };
247
+ showMessage: {
248
+ type: import('vue').PropType<boolean>;
249
+ default: boolean;
250
+ };
251
+ validateOnRuleChange: {
252
+ type: import('vue').PropType<boolean>;
253
+ default: boolean;
254
+ };
255
+ hideRequiredAsterisk: {
256
+ type: import('vue').PropType<boolean>;
257
+ };
258
+ scrollToError: {
259
+ type: import('vue').PropType<boolean>;
260
+ };
261
+ scrollIntoViewOptions: {
262
+ type: import('vue').PropType<boolean | ScrollIntoViewOptions>;
263
+ default: boolean;
264
+ };
265
+ }>> & {
266
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
267
+ }, {
268
+ validate: (callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
269
+ validateField: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>, callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
270
+ resetFields: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
271
+ clearValidate: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
272
+ scrollToField: (prop: import('element-plus').FormItemProp) => void;
273
+ getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
274
+ fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
275
+ setInitialValues: (initModel: Record<string, any>) => void;
276
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
277
+ validate: (prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => void;
278
+ }, string, {
279
+ labelWidth: string | number;
280
+ labelPosition: "left" | "right" | "top";
281
+ showMessage: boolean;
282
+ requireAsteriskPosition: "left" | "right";
283
+ labelSuffix: string;
284
+ validateOnRuleChange: boolean;
285
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
286
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
287
+ beforeCreate?: (() => void) | (() => void)[];
288
+ created?: (() => void) | (() => void)[];
289
+ beforeMount?: (() => void) | (() => void)[];
290
+ mounted?: (() => void) | (() => void)[];
291
+ beforeUpdate?: (() => void) | (() => void)[];
292
+ updated?: (() => void) | (() => void)[];
293
+ activated?: (() => void) | (() => void)[];
294
+ deactivated?: (() => void) | (() => void)[];
295
+ beforeDestroy?: (() => void) | (() => void)[];
296
+ beforeUnmount?: (() => void) | (() => void)[];
297
+ destroyed?: (() => void) | (() => void)[];
298
+ unmounted?: (() => void) | (() => void)[];
299
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
300
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
301
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
302
+ };
303
+ $forceUpdate: () => void;
304
+ $nextTick: typeof nextTick;
305
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
306
+ } & Readonly<{
307
+ labelWidth: string | number;
308
+ labelPosition: "left" | "right" | "top";
309
+ showMessage: boolean;
310
+ requireAsteriskPosition: "left" | "right";
311
+ labelSuffix: string;
312
+ validateOnRuleChange: boolean;
313
+ scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
314
+ }> & Omit<Readonly<import('vue').ExtractPropTypes<{
315
+ size: {
316
+ type: import('vue').PropType<"" | "large" | "default" | "small">;
317
+ };
318
+ disabled: {
319
+ type: import('vue').PropType<boolean>;
320
+ };
321
+ model: {
322
+ type: import('vue').PropType<Record<string, any>>;
323
+ };
324
+ rules: {
325
+ type: import('vue').PropType<Partial<Record<string, Record<string, any> | import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemRule>>>>;
326
+ };
327
+ labelPosition: {
328
+ type: import('vue').PropType<"top" | "left" | "right">;
329
+ default: string;
330
+ };
331
+ requireAsteriskPosition: {
332
+ type: import('vue').PropType<"left" | "right">;
333
+ default: string;
334
+ };
335
+ labelWidth: {
336
+ type: import('vue').PropType<string | number>;
337
+ default: string;
338
+ };
339
+ labelSuffix: {
340
+ type: import('vue').PropType<string>;
341
+ default: string;
342
+ };
343
+ inline: {
344
+ type: import('vue').PropType<boolean>;
345
+ };
346
+ inlineMessage: {
347
+ type: import('vue').PropType<boolean>;
348
+ };
349
+ statusIcon: {
350
+ type: import('vue').PropType<boolean>;
351
+ };
352
+ showMessage: {
353
+ type: import('vue').PropType<boolean>;
354
+ default: boolean;
355
+ };
356
+ validateOnRuleChange: {
357
+ type: import('vue').PropType<boolean>;
358
+ default: boolean;
359
+ };
360
+ hideRequiredAsterisk: {
361
+ type: import('vue').PropType<boolean>;
362
+ };
363
+ scrollToError: {
364
+ type: import('vue').PropType<boolean>;
365
+ };
366
+ scrollIntoViewOptions: {
367
+ type: import('vue').PropType<boolean | ScrollIntoViewOptions>;
368
+ default: boolean;
369
+ };
370
+ }>> & {
371
+ onValidate?: ((prop: import('element-plus').FormItemProp, isValid: boolean, message: string) => any) | undefined;
372
+ }, "labelPosition" | "requireAsteriskPosition" | "labelWidth" | "labelSuffix" | "showMessage" | "validateOnRuleChange" | "scrollIntoViewOptions" | "validate" | "validateField" | "resetFields" | "clearValidate" | "scrollToField" | "getField" | "fields" | "setInitialValues"> & import('vue').ShallowUnwrapRef<{
373
+ validate: (callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
374
+ validateField: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>, callback?: import('element-plus').FormValidateCallback) => import('element-plus').FormValidationResult;
375
+ resetFields: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
376
+ clearValidate: (props?: import('element-plus/es/utils/typescript.mjs').Arrayable<import('element-plus').FormItemProp>) => void;
377
+ scrollToField: (prop: import('element-plus').FormItemProp) => void;
378
+ getField: (prop: import('element-plus').FormItemProp) => import('element-plus').FormItemContext | undefined;
379
+ fields: import('vue').Reactive<import('element-plus').FormItemContext[]>;
380
+ setInitialValues: (initModel: Record<string, any>) => void;
381
+ }> & {} & import('vue').ComponentCustomProperties & {} & {
382
+ $slots: {
383
+ default?: (props: {}) => any;
384
+ };
385
+ }) | null;
386
+ }, any>;
387
+ export default _default;