tiddy 2.6.2 → 2.7.0
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/dist/index.d.ts +82 -55
- package/dist/index.js +94 -30
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue27 from "vue";
|
|
2
2
|
import { AllowedComponentProps, CSSProperties, Component, ComputedRef, DefineComponent, Directive, ExtractPublicPropTypes, HTMLAttributes, PropType, Raw, Ref, Slot } from "vue";
|
|
3
3
|
import * as element_plus0 from "element-plus";
|
|
4
4
|
import { DialogInstance, DialogProps, FormInstance, FormItemProp, FormItemProps, FormItemRule, FormProps, SelectInstance, TableColumnInstance, TableInstance } from "element-plus";
|
|
@@ -163,21 +163,37 @@ declare const arrayFieldPropsDef: {
|
|
|
163
163
|
type: PropType<AnyFunction>;
|
|
164
164
|
};
|
|
165
165
|
outerEmptyAction: {
|
|
166
|
-
type:
|
|
166
|
+
type: PropType<OrArray<SlotDef>>;
|
|
167
167
|
default: null;
|
|
168
168
|
};
|
|
169
169
|
emptyAction: {
|
|
170
|
-
type:
|
|
170
|
+
type: PropType<OrArray<SlotDef>>;
|
|
171
171
|
default: null;
|
|
172
172
|
};
|
|
173
173
|
rowAction: {
|
|
174
|
-
type:
|
|
174
|
+
type: PropType<OrArray<SlotDef>>;
|
|
175
175
|
default: null;
|
|
176
176
|
};
|
|
177
177
|
lineStyle: {
|
|
178
178
|
type: PropType<CSSProperties>;
|
|
179
179
|
default: () => {};
|
|
180
180
|
};
|
|
181
|
+
item: {
|
|
182
|
+
type: PropType<OrRef<TdFormItemProps>>;
|
|
183
|
+
default: () => {};
|
|
184
|
+
};
|
|
185
|
+
lineClass: {
|
|
186
|
+
type: StringConstructor;
|
|
187
|
+
default: string;
|
|
188
|
+
};
|
|
189
|
+
rowFieldClass: {
|
|
190
|
+
type: StringConstructor;
|
|
191
|
+
default: string;
|
|
192
|
+
};
|
|
193
|
+
rowActionClass: {
|
|
194
|
+
type: StringConstructor;
|
|
195
|
+
default: string;
|
|
196
|
+
};
|
|
181
197
|
mandatory: {
|
|
182
198
|
type: BooleanConstructor;
|
|
183
199
|
default: boolean;
|
|
@@ -211,6 +227,17 @@ declare const layoutFieldPropsDef: {
|
|
|
211
227
|
default: string;
|
|
212
228
|
required: true;
|
|
213
229
|
};
|
|
230
|
+
component: {
|
|
231
|
+
type: PropType<string | Component | Raw<Component>>;
|
|
232
|
+
};
|
|
233
|
+
widget: {
|
|
234
|
+
type: PropType<Record<string, any>>;
|
|
235
|
+
default: () => {};
|
|
236
|
+
};
|
|
237
|
+
on: {
|
|
238
|
+
type: PropType<Record<string, AnyFunction>>;
|
|
239
|
+
default: () => {};
|
|
240
|
+
};
|
|
214
241
|
slots: {
|
|
215
242
|
type: PropType<OrArray<SlotDef>>;
|
|
216
243
|
default: () => never[];
|
|
@@ -260,7 +287,7 @@ declare function isValidateError(prop: string): boolean;
|
|
|
260
287
|
declare const expose$1: {
|
|
261
288
|
reValidateErrorFields: typeof reValidateErrorFields;
|
|
262
289
|
isValidateError: typeof isValidateError;
|
|
263
|
-
model:
|
|
290
|
+
model: vue27.ComputedRef<unknown>;
|
|
264
291
|
};
|
|
265
292
|
type __TdFormExpose = typeof expose$1 & FormInstance;
|
|
266
293
|
declare var __VLS_11$2: {}, __VLS_13$1: {}, __VLS_19$1: {};
|
|
@@ -271,24 +298,24 @@ type __VLS_Slots$4 = {} & {
|
|
|
271
298
|
} & {
|
|
272
299
|
suffix?: (props: typeof __VLS_19$1) => any;
|
|
273
300
|
};
|
|
274
|
-
declare const __VLS_base$4:
|
|
301
|
+
declare const __VLS_base$4: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
275
302
|
fields: {
|
|
276
|
-
type:
|
|
303
|
+
type: vue27.PropType<TdFormFieldProps[]>;
|
|
277
304
|
default: () => never[];
|
|
278
305
|
};
|
|
279
306
|
item: {
|
|
280
|
-
type:
|
|
307
|
+
type: vue27.PropType<element_plus0.FormItemProps>;
|
|
281
308
|
default: () => {};
|
|
282
309
|
};
|
|
283
|
-
}>, __TdFormExpose, {}, {}, {},
|
|
310
|
+
}>, __TdFormExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {
|
|
284
311
|
submit: (data: any) => any;
|
|
285
|
-
}, string,
|
|
312
|
+
}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
286
313
|
fields: {
|
|
287
|
-
type:
|
|
314
|
+
type: vue27.PropType<TdFormFieldProps[]>;
|
|
288
315
|
default: () => never[];
|
|
289
316
|
};
|
|
290
317
|
item: {
|
|
291
|
-
type:
|
|
318
|
+
type: vue27.PropType<element_plus0.FormItemProps>;
|
|
292
319
|
default: () => {};
|
|
293
320
|
};
|
|
294
321
|
}>> & Readonly<{
|
|
@@ -296,7 +323,7 @@ declare const __VLS_base$4: vue64.DefineComponent<vue64.ExtractPropTypes<{
|
|
|
296
323
|
}>, {
|
|
297
324
|
fields: TdFormFieldProps[];
|
|
298
325
|
item: element_plus0.FormItemProps;
|
|
299
|
-
}, {}, {}, {}, string,
|
|
326
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
300
327
|
declare const __VLS_export$6: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
|
|
301
328
|
declare const _default$3: typeof __VLS_export$6;
|
|
302
329
|
type __VLS_WithSlots$4<T, S> = T & {
|
|
@@ -308,38 +335,38 @@ type __VLS_WithSlots$4<T, S> = T & {
|
|
|
308
335
|
//#region src/form/form-item.vue.d.ts
|
|
309
336
|
declare var __VLS_10$1: string | number, __VLS_11$1: any;
|
|
310
337
|
type __VLS_Slots$3 = {} & { [K in NonNullable<typeof __VLS_10$1>]?: (props: typeof __VLS_11$1) => any };
|
|
311
|
-
declare const __VLS_base$3:
|
|
338
|
+
declare const __VLS_base$3: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
312
339
|
messageLabel: {
|
|
313
|
-
type:
|
|
340
|
+
type: vue27.PropType<OrRef<string>>;
|
|
314
341
|
default: string;
|
|
315
342
|
};
|
|
316
343
|
formatMessage: {
|
|
317
|
-
type:
|
|
344
|
+
type: vue27.PropType<AnyFunction>;
|
|
318
345
|
default: null;
|
|
319
346
|
};
|
|
320
347
|
hideRequiredAsterisk: {
|
|
321
|
-
type:
|
|
348
|
+
type: vue27.PropType<boolean>;
|
|
322
349
|
default: boolean;
|
|
323
350
|
};
|
|
324
351
|
errorLayout: {
|
|
325
|
-
type:
|
|
352
|
+
type: vue27.PropType<"nowrap" | "wrap" | "expand">;
|
|
326
353
|
default: string;
|
|
327
354
|
};
|
|
328
|
-
}>, {}, {}, {}, {},
|
|
355
|
+
}>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
329
356
|
messageLabel: {
|
|
330
|
-
type:
|
|
357
|
+
type: vue27.PropType<OrRef<string>>;
|
|
331
358
|
default: string;
|
|
332
359
|
};
|
|
333
360
|
formatMessage: {
|
|
334
|
-
type:
|
|
361
|
+
type: vue27.PropType<AnyFunction>;
|
|
335
362
|
default: null;
|
|
336
363
|
};
|
|
337
364
|
hideRequiredAsterisk: {
|
|
338
|
-
type:
|
|
365
|
+
type: vue27.PropType<boolean>;
|
|
339
366
|
default: boolean;
|
|
340
367
|
};
|
|
341
368
|
errorLayout: {
|
|
342
|
-
type:
|
|
369
|
+
type: vue27.PropType<"nowrap" | "wrap" | "expand">;
|
|
343
370
|
default: string;
|
|
344
371
|
};
|
|
345
372
|
}>> & Readonly<{}>, {
|
|
@@ -347,7 +374,7 @@ declare const __VLS_base$3: vue64.DefineComponent<vue64.ExtractPropTypes<{
|
|
|
347
374
|
messageLabel: OrRef<string>;
|
|
348
375
|
formatMessage: AnyFunction;
|
|
349
376
|
errorLayout: "wrap" | "nowrap" | "expand";
|
|
350
|
-
}, {}, {}, {}, string,
|
|
377
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
351
378
|
declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
|
|
352
379
|
declare const _default$5: typeof __VLS_export$5;
|
|
353
380
|
type __VLS_WithSlots$3<T, S> = T & {
|
|
@@ -357,7 +384,7 @@ type __VLS_WithSlots$3<T, S> = T & {
|
|
|
357
384
|
};
|
|
358
385
|
//#endregion
|
|
359
386
|
//#region src/form/form-field.vue.d.ts
|
|
360
|
-
declare const __VLS_export$4:
|
|
387
|
+
declare const __VLS_export$4: vue27.DefineComponent<{}, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
361
388
|
declare const _default$4: typeof __VLS_export$4;
|
|
362
389
|
//#endregion
|
|
363
390
|
//#region src/form/index.d.ts
|
|
@@ -405,19 +432,19 @@ type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof
|
|
|
405
432
|
} & {
|
|
406
433
|
after?: (props: typeof __VLS_19) => any;
|
|
407
434
|
};
|
|
408
|
-
declare const __VLS_base$2:
|
|
435
|
+
declare const __VLS_base$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
409
436
|
columns: {
|
|
410
|
-
type:
|
|
437
|
+
type: vue27.PropType<TdTableColumnProps[]>;
|
|
411
438
|
default: () => never[];
|
|
412
439
|
};
|
|
413
|
-
}>, TableInstance, {}, {}, {},
|
|
440
|
+
}>, TableInstance, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
414
441
|
columns: {
|
|
415
|
-
type:
|
|
442
|
+
type: vue27.PropType<TdTableColumnProps[]>;
|
|
416
443
|
default: () => never[];
|
|
417
444
|
};
|
|
418
445
|
}>> & Readonly<{}>, {
|
|
419
446
|
columns: TdTableColumnProps[];
|
|
420
|
-
}, {}, {}, {}, string,
|
|
447
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
421
448
|
declare const __VLS_export$3: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
|
|
422
449
|
declare const _default$6: typeof __VLS_export$3;
|
|
423
450
|
type __VLS_WithSlots$2<T, S> = T & {
|
|
@@ -427,55 +454,55 @@ type __VLS_WithSlots$2<T, S> = T & {
|
|
|
427
454
|
};
|
|
428
455
|
//#endregion
|
|
429
456
|
//#region src/table/table-col.vue.d.ts
|
|
430
|
-
declare const __VLS_export$2:
|
|
457
|
+
declare const __VLS_export$2: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
431
458
|
slots: {
|
|
432
|
-
type:
|
|
459
|
+
type: vue27.PropType<OrArray<SlotDef>>;
|
|
433
460
|
default: null;
|
|
434
461
|
};
|
|
435
462
|
columns: {
|
|
436
|
-
type:
|
|
463
|
+
type: vue27.PropType<TdTableColumnProps[]>;
|
|
437
464
|
default: () => never[];
|
|
438
465
|
};
|
|
439
466
|
transform: {
|
|
440
|
-
type:
|
|
467
|
+
type: vue27.PropType<AnyFunction[]>;
|
|
441
468
|
default: () => never[];
|
|
442
469
|
};
|
|
443
470
|
hide: {
|
|
444
|
-
type:
|
|
471
|
+
type: vue27.PropType<boolean | vue27.Ref<boolean>>;
|
|
445
472
|
default: false;
|
|
446
473
|
};
|
|
447
474
|
dangerouslyUseHTMLString: {
|
|
448
|
-
type:
|
|
475
|
+
type: vue27.PropType<boolean | vue27.Ref<boolean>>;
|
|
449
476
|
default: false;
|
|
450
477
|
};
|
|
451
|
-
}>, {}, {}, {}, {},
|
|
478
|
+
}>, {}, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
452
479
|
slots: {
|
|
453
|
-
type:
|
|
480
|
+
type: vue27.PropType<OrArray<SlotDef>>;
|
|
454
481
|
default: null;
|
|
455
482
|
};
|
|
456
483
|
columns: {
|
|
457
|
-
type:
|
|
484
|
+
type: vue27.PropType<TdTableColumnProps[]>;
|
|
458
485
|
default: () => never[];
|
|
459
486
|
};
|
|
460
487
|
transform: {
|
|
461
|
-
type:
|
|
488
|
+
type: vue27.PropType<AnyFunction[]>;
|
|
462
489
|
default: () => never[];
|
|
463
490
|
};
|
|
464
491
|
hide: {
|
|
465
|
-
type:
|
|
492
|
+
type: vue27.PropType<boolean | vue27.Ref<boolean>>;
|
|
466
493
|
default: false;
|
|
467
494
|
};
|
|
468
495
|
dangerouslyUseHTMLString: {
|
|
469
|
-
type:
|
|
496
|
+
type: vue27.PropType<boolean | vue27.Ref<boolean>>;
|
|
470
497
|
default: false;
|
|
471
498
|
};
|
|
472
499
|
}>> & Readonly<{}>, {
|
|
473
500
|
slots: OrArray<SlotDef>;
|
|
501
|
+
hide: boolean | vue27.Ref<boolean, boolean>;
|
|
474
502
|
columns: TdTableColumnProps[];
|
|
475
503
|
transform: AnyFunction[];
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}, {}, {}, {}, string, vue64.ComponentProvideOptions, true, {}, any>;
|
|
504
|
+
dangerouslyUseHTMLString: boolean | vue27.Ref<boolean, boolean>;
|
|
505
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
479
506
|
declare const _default$7: typeof __VLS_export$2;
|
|
480
507
|
//#endregion
|
|
481
508
|
//#region src/table/index.d.ts
|
|
@@ -508,7 +535,7 @@ declare var __VLS_13: "default" | "footer" | "header" | "title", __VLS_14: {
|
|
|
508
535
|
titleClass?: string | undefined;
|
|
509
536
|
};
|
|
510
537
|
type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
|
|
511
|
-
declare const __VLS_base$1:
|
|
538
|
+
declare const __VLS_base$1: vue27.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
512
539
|
declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
513
540
|
declare const _default: typeof __VLS_export$1;
|
|
514
541
|
type __VLS_WithSlots$1<T, S> = T & {
|
|
@@ -547,7 +574,7 @@ type __VLS_Props = {
|
|
|
547
574
|
};
|
|
548
575
|
declare var __VLS_10: string | number, __VLS_11: any;
|
|
549
576
|
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
|
|
550
|
-
declare const __VLS_base:
|
|
577
|
+
declare const __VLS_base: vue27.DefineComponent<__VLS_Props, SelectInstance, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, false, {}, any>;
|
|
551
578
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
552
579
|
declare const _default$2: typeof __VLS_export;
|
|
553
580
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -567,7 +594,7 @@ interface DirectiveConfig {
|
|
|
567
594
|
modifiers?: Record<string, boolean>;
|
|
568
595
|
enable?: boolean;
|
|
569
596
|
}
|
|
570
|
-
declare const _default$1:
|
|
597
|
+
declare const _default$1: vue27.DefineComponent<vue27.ExtractPropTypes<{
|
|
571
598
|
directives: {
|
|
572
599
|
type: () => DirectiveConfig[];
|
|
573
600
|
default: () => never[];
|
|
@@ -580,11 +607,11 @@ declare const _default$1: vue64.DefineComponent<vue64.ExtractPropTypes<{
|
|
|
580
607
|
type: StringConstructor;
|
|
581
608
|
default: string;
|
|
582
609
|
};
|
|
583
|
-
}>, () =>
|
|
610
|
+
}>, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
|
|
584
611
|
[key: string]: any;
|
|
585
|
-
}> |
|
|
612
|
+
}> | vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
|
|
586
613
|
[key: string]: any;
|
|
587
|
-
}>[], {}, {}, {},
|
|
614
|
+
}>[], {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<vue27.ExtractPropTypes<{
|
|
588
615
|
directives: {
|
|
589
616
|
type: () => DirectiveConfig[];
|
|
590
617
|
default: () => never[];
|
|
@@ -601,13 +628,13 @@ declare const _default$1: vue64.DefineComponent<vue64.ExtractPropTypes<{
|
|
|
601
628
|
directives: DirectiveConfig[];
|
|
602
629
|
wrap: boolean;
|
|
603
630
|
tag: string;
|
|
604
|
-
}, {}, {}, {}, string,
|
|
631
|
+
}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any>;
|
|
605
632
|
//#endregion
|
|
606
633
|
//#region src/hooks/use-reuse.d.ts
|
|
607
|
-
declare function useReuse(): (
|
|
634
|
+
declare function useReuse(): (vue27.DefineComponent<{}, () => null, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any> | vue27.DefineComponent<{}, () => vue27.VNode<vue27.RendererNode, vue27.RendererElement, {
|
|
608
635
|
[key: string]: any;
|
|
609
|
-
}>[] | undefined, {}, {}, {},
|
|
610
|
-
[name: string]:
|
|
636
|
+
}>[] | undefined, {}, {}, {}, vue27.ComponentOptionsMixin, vue27.ComponentOptionsMixin, {}, string, vue27.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue27.ComponentProvideOptions, true, {}, any> | vue27.ComputedRef<Readonly<{
|
|
637
|
+
[name: string]: vue27.Slot<any> | undefined;
|
|
611
638
|
}>>)[];
|
|
612
639
|
//#endregion
|
|
613
640
|
//#region src/utils/index.d.ts
|
package/dist/index.js
CHANGED
|
@@ -173,21 +173,49 @@ const arrayFieldPropsDef = {
|
|
|
173
173
|
},
|
|
174
174
|
rawValue: { type: Function },
|
|
175
175
|
outerEmptyAction: {
|
|
176
|
-
type:
|
|
176
|
+
type: [
|
|
177
|
+
Array,
|
|
178
|
+
Object,
|
|
179
|
+
String
|
|
180
|
+
],
|
|
177
181
|
default: null
|
|
178
182
|
},
|
|
179
183
|
emptyAction: {
|
|
180
|
-
type:
|
|
184
|
+
type: [
|
|
185
|
+
Array,
|
|
186
|
+
Object,
|
|
187
|
+
String
|
|
188
|
+
],
|
|
181
189
|
default: null
|
|
182
190
|
},
|
|
183
191
|
rowAction: {
|
|
184
|
-
type:
|
|
192
|
+
type: [
|
|
193
|
+
Array,
|
|
194
|
+
Object,
|
|
195
|
+
String
|
|
196
|
+
],
|
|
185
197
|
default: null
|
|
186
198
|
},
|
|
187
199
|
lineStyle: {
|
|
188
200
|
type: Object,
|
|
189
201
|
default: () => ({})
|
|
190
202
|
},
|
|
203
|
+
item: {
|
|
204
|
+
type: Object,
|
|
205
|
+
default: () => ({})
|
|
206
|
+
},
|
|
207
|
+
lineClass: {
|
|
208
|
+
type: String,
|
|
209
|
+
default: ""
|
|
210
|
+
},
|
|
211
|
+
rowFieldClass: {
|
|
212
|
+
type: String,
|
|
213
|
+
default: ""
|
|
214
|
+
},
|
|
215
|
+
rowActionClass: {
|
|
216
|
+
type: String,
|
|
217
|
+
default: ""
|
|
218
|
+
},
|
|
191
219
|
mandatory: {
|
|
192
220
|
type: Boolean,
|
|
193
221
|
default: false
|
|
@@ -201,6 +229,19 @@ const layoutFieldPropsDef = {
|
|
|
201
229
|
default: "layout",
|
|
202
230
|
required: true
|
|
203
231
|
},
|
|
232
|
+
component: { type: [
|
|
233
|
+
String,
|
|
234
|
+
Object,
|
|
235
|
+
Function
|
|
236
|
+
] },
|
|
237
|
+
widget: {
|
|
238
|
+
type: Object,
|
|
239
|
+
default: () => ({})
|
|
240
|
+
},
|
|
241
|
+
on: {
|
|
242
|
+
type: Object,
|
|
243
|
+
default: () => ({})
|
|
244
|
+
},
|
|
204
245
|
slots: {
|
|
205
246
|
type: [
|
|
206
247
|
Array,
|
|
@@ -339,6 +380,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
339
380
|
}
|
|
340
381
|
const vErrorLayout = {
|
|
341
382
|
mounted(el) {
|
|
383
|
+
lastErrorHeight = 0;
|
|
342
384
|
observer.observe(el);
|
|
343
385
|
},
|
|
344
386
|
beforeUnmount(el) {
|
|
@@ -579,8 +621,6 @@ var widget_field_default = widget_field_vue_vue_type_script_setup_true_lang_defa
|
|
|
579
621
|
|
|
580
622
|
//#endregion
|
|
581
623
|
//#region src/form/array-field.vue?vue&type=script&setup=true&lang.ts
|
|
582
|
-
const _hoisted_1 = { class: "row-item" };
|
|
583
|
-
const _hoisted_2 = { class: "row-action" };
|
|
584
624
|
var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
585
625
|
inheritAttrs: false,
|
|
586
626
|
__name: "array-field",
|
|
@@ -590,14 +630,14 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
590
630
|
const attrs = useAttrs();
|
|
591
631
|
const fieldProps = computed(() => {
|
|
592
632
|
return {
|
|
593
|
-
...cut(props, [(k) => k.endsWith("Action") || ["lineStyle"].includes(k)]),
|
|
633
|
+
...cut(props, [(k) => k.endsWith("Action") || k.endsWith("Class") || ["lineStyle", "item"].includes(k)]),
|
|
594
634
|
...attrs
|
|
595
635
|
};
|
|
596
636
|
});
|
|
597
637
|
const formCtx = inject(formCtxKey);
|
|
598
|
-
const OuterEmptySlot = formCtx.getParentSlots(resolveSlotNames(props.outerEmptyAction
|
|
599
|
-
const EmptySlot = formCtx.getParentSlots(resolveSlotNames(props.emptyAction
|
|
600
|
-
const RowSlot = formCtx.getParentSlots(resolveSlotNames(props.rowAction
|
|
638
|
+
const OuterEmptySlot = formCtx.getParentSlots(resolveSlotNames(props.outerEmptyAction, `${props.prop}-action_outer`))[0];
|
|
639
|
+
const EmptySlot = formCtx.getParentSlots(resolveSlotNames(props.emptyAction, `${props.prop}-action_empty`))[0];
|
|
640
|
+
const RowSlot = formCtx.getParentSlots(resolveSlotNames(props.rowAction, `${props.prop}-action_row`))[0];
|
|
601
641
|
const parentFullProp = computed(() => attrs["full-prop"] || "");
|
|
602
642
|
const values = computed(() => {
|
|
603
643
|
return getDeepValue(formCtx.model, parentFullProp.value, { fallback: [] });
|
|
@@ -609,6 +649,10 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
609
649
|
p.labelPosition = indexProp(p.labelPosition, -1);
|
|
610
650
|
return p;
|
|
611
651
|
});
|
|
652
|
+
const itemAttrs = computed(() => {
|
|
653
|
+
const entries = Object.entries(unref(props.item)).map(([k, v]) => [k, unref(v)]);
|
|
654
|
+
return Object.assign({}, Object.fromEntries(entries), labelProps.value);
|
|
655
|
+
});
|
|
612
656
|
function indexProp(v, index, value) {
|
|
613
657
|
if (isFunction(v)) return v(index);
|
|
614
658
|
if (isNullOrUndef(value)) return v;
|
|
@@ -652,7 +696,7 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
652
696
|
key: 0,
|
|
653
697
|
add: lineAction.add.bind(null, -1),
|
|
654
698
|
empty: true
|
|
655
|
-
}, null, 8, ["add"])) : (openBlock(), createBlock(form_item_default, mergeProps({ key: 1 },
|
|
699
|
+
}, null, 8, ["add"])) : (openBlock(), createBlock(form_item_default, mergeProps({ key: 1 }, itemAttrs.value, { class: "layout-form-item" }), {
|
|
656
700
|
default: withCtx(() => [unref(EmptySlot) && !values.value.length ? (openBlock(), createBlock(resolveDynamicComponent(unref(EmptySlot).component), {
|
|
657
701
|
key: 0,
|
|
658
702
|
add: lineAction.add.bind(null, -1),
|
|
@@ -660,9 +704,9 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
660
704
|
}, null, 8, ["add"])) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(values.value, (v, vi) => {
|
|
661
705
|
return openBlock(), createElementBlock("div", {
|
|
662
706
|
key: unref(getKey)(v),
|
|
663
|
-
class: "list-row",
|
|
707
|
+
class: normalizeClass(["list-row", _ctx.lineClass]),
|
|
664
708
|
style: normalizeStyle(_ctx.lineStyle)
|
|
665
|
-
}, [createElementVNode("div",
|
|
709
|
+
}, [createElementVNode("div", { class: normalizeClass(["row-item", _ctx.rowFieldClass]) }, [createVNode(form_field_default, mergeProps({ "name-space": "layout-form-item" }, { ref_for: true }, fieldProps.value, {
|
|
666
710
|
label: indexProp(_ctx.label, vi),
|
|
667
711
|
"label-width": indexProp(_ctx.labelWidth, vi),
|
|
668
712
|
"label-position": indexProp(_ctx.labelPosition, vi),
|
|
@@ -675,7 +719,7 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
675
719
|
"label-position",
|
|
676
720
|
"full-prop",
|
|
677
721
|
"prop"
|
|
678
|
-
])]), createElementVNode("div",
|
|
722
|
+
])], 2), createElementVNode("div", { class: normalizeClass(["row-action", _ctx.rowActionClass]) }, [unref(RowSlot) ? (openBlock(), createBlock(resolveDynamicComponent(unref(RowSlot).component), {
|
|
679
723
|
key: 0,
|
|
680
724
|
up: lineAction.up.bind(null, vi),
|
|
681
725
|
down: lineAction.down.bind(null, vi),
|
|
@@ -699,7 +743,7 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
699
743
|
"single",
|
|
700
744
|
"row",
|
|
701
745
|
"full-prop"
|
|
702
|
-
])) : createCommentVNode("v-if", true)])],
|
|
746
|
+
])) : createCommentVNode("v-if", true)], 2)], 6);
|
|
703
747
|
}), 128))]),
|
|
704
748
|
_: 1
|
|
705
749
|
}, 16));
|
|
@@ -720,7 +764,17 @@ var layout_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
720
764
|
const props = __props;
|
|
721
765
|
const attrs = useAttrs();
|
|
722
766
|
const layoutProps = computed(() => {
|
|
723
|
-
|
|
767
|
+
const p = Object.assign({}, cut(attrs, [
|
|
768
|
+
"full-prop",
|
|
769
|
+
"widget",
|
|
770
|
+
"on"
|
|
771
|
+
]), cut(props, ["fields"]));
|
|
772
|
+
const w = Object.fromEntries(Object.entries(unref(props.widget)).map(([k, v]) => [k, unref(v)]));
|
|
773
|
+
return Object.assign(p, w);
|
|
774
|
+
});
|
|
775
|
+
const LayoutComponent = computed(() => {
|
|
776
|
+
if (props.component) return props.component;
|
|
777
|
+
return "div";
|
|
724
778
|
});
|
|
725
779
|
const formCtx = inject(formCtxKey);
|
|
726
780
|
const subFields = computed(() => {
|
|
@@ -728,22 +782,32 @@ var layout_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
728
782
|
return [field, { "full-prop": [attrs["full-prop"], field.prop].filter(Boolean).join(".") }];
|
|
729
783
|
});
|
|
730
784
|
});
|
|
731
|
-
const
|
|
785
|
+
const layoutSlots = formCtx.getParentSlots(ensureArray(props.slots));
|
|
786
|
+
const subSlots = props.component ? layoutSlots : [];
|
|
787
|
+
const { prefix: prefixSlots, suffix: suffixSlots } = groupBy(layoutSlots, (slot) => slot.name.match(/^[a-z]+/i)?.[0] ?? "");
|
|
732
788
|
return (_ctx, _cache) => {
|
|
733
|
-
return openBlock(),
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
789
|
+
return openBlock(), createBlock(resolveDynamicComponent(LayoutComponent.value), mergeProps({ class: "layout-item" }, layoutProps.value, toHandlers(_ctx.on)), createSlots({
|
|
790
|
+
default: withCtx(() => [
|
|
791
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(prefixSlots), (psc) => {
|
|
792
|
+
return openBlock(), createBlock(deep_slot_default, mergeProps({ key: psc.name }, { ref_for: true }, psc, { "ctx-key": unref(formCtxKey) }), null, 16, ["ctx-key"]);
|
|
793
|
+
}), 128)),
|
|
794
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(subFields.value, (field) => {
|
|
795
|
+
return openBlock(), createBlock(form_field_default, mergeProps({ key: unref(getKey)(field[0]) }, { ref_for: true }, {
|
|
796
|
+
...field[0],
|
|
797
|
+
...field[1]
|
|
798
|
+
}), null, 16);
|
|
799
|
+
}), 128)),
|
|
800
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(suffixSlots), (psc) => {
|
|
801
|
+
return openBlock(), createBlock(deep_slot_default, mergeProps({ key: psc.name }, { ref_for: true }, psc, { "ctx-key": unref(formCtxKey) }), null, 16, ["ctx-key"]);
|
|
802
|
+
}), 128))
|
|
803
|
+
]),
|
|
804
|
+
_: 2
|
|
805
|
+
}, [renderList(unref(subSlots), (sl) => {
|
|
806
|
+
return {
|
|
807
|
+
name: sl.name,
|
|
808
|
+
fn: withCtx((scope) => [renderSlot(_ctx.$slots, sl.name, normalizeProps(guardReactiveProps(scope)))])
|
|
809
|
+
};
|
|
810
|
+
})]), 1040);
|
|
747
811
|
};
|
|
748
812
|
}
|
|
749
813
|
});
|