tiddy 2.2.0 → 2.3.1
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 +111 -72
- package/dist/index.js +95 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue37 from "vue";
|
|
2
2
|
import { AllowedComponentProps, CSSProperties, Component, DefineComponent, ExtractPublicPropTypes, PropType, Raw, Ref as Ref$1, Slot } from "vue";
|
|
3
3
|
import * as element_plus0 from "element-plus";
|
|
4
|
-
import { DialogInstance, DialogProps, FormInstance, FormItemProp, FormItemProps, FormItemRule, FormProps, TableColumnInstance, TableInstance } from "element-plus";
|
|
4
|
+
import { DialogInstance, DialogProps, FormInstance, FormItemProp, FormItemProps, FormItemRule, FormProps, SelectInstance, TableColumnInstance, TableInstance } from "element-plus";
|
|
5
5
|
|
|
6
6
|
//#region src/types.d.ts
|
|
7
7
|
type OrArray<T> = T | T[];
|
|
@@ -184,7 +184,7 @@ type TdArrayFieldProps = TdFieldsProps & ExtractPublicPropTypes<typeof arrayFiel
|
|
|
184
184
|
declare const layoutFieldPropsDef: {
|
|
185
185
|
prop: {
|
|
186
186
|
type: PropType<OrFunction<string>>;
|
|
187
|
-
required:
|
|
187
|
+
required: false;
|
|
188
188
|
};
|
|
189
189
|
hide: {
|
|
190
190
|
type: PropType<OrFunction<boolean> | OrRef<boolean>>;
|
|
@@ -213,7 +213,7 @@ declare const layoutFieldPropsDef: {
|
|
|
213
213
|
default: () => never[];
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
|
-
type TdLayoutFieldProps = Partial<TdFieldsProps> & MakeOptional<ExtractPublicPropTypes<typeof layoutFieldPropsDef>,
|
|
216
|
+
type TdLayoutFieldProps = Partial<TdFieldsProps> & MakeOptional<ExtractPublicPropTypes<typeof layoutFieldPropsDef>, 'prop'> & AllowedComponentProps;
|
|
217
217
|
type TdFormFieldProps = TdObjectFieldProps | TdWidgetFieldProps | TdArrayFieldProps | TdLayoutFieldProps;
|
|
218
218
|
declare const formPropsDef: {
|
|
219
219
|
fields: {
|
|
@@ -252,35 +252,35 @@ declare function isValidateError(prop: string): boolean;
|
|
|
252
252
|
declare const expose$1: {
|
|
253
253
|
reValidateErrorFields: typeof reValidateErrorFields;
|
|
254
254
|
isValidateError: typeof isValidateError;
|
|
255
|
-
model:
|
|
255
|
+
model: vue37.ComputedRef<unknown>;
|
|
256
256
|
};
|
|
257
257
|
type __TdFormExpose = typeof expose$1 & FormInstance;
|
|
258
|
-
declare var __VLS_11$
|
|
259
|
-
type __VLS_Slots$
|
|
260
|
-
prefix?: (props: typeof __VLS_11$
|
|
258
|
+
declare var __VLS_11$2: {}, __VLS_13$1: {}, __VLS_19$1: {};
|
|
259
|
+
type __VLS_Slots$4 = {} & {
|
|
260
|
+
prefix?: (props: typeof __VLS_11$2) => any;
|
|
261
261
|
} & {
|
|
262
262
|
default?: (props: typeof __VLS_13$1) => any;
|
|
263
263
|
} & {
|
|
264
264
|
suffix?: (props: typeof __VLS_19$1) => any;
|
|
265
265
|
};
|
|
266
|
-
declare const __VLS_base$
|
|
266
|
+
declare const __VLS_base$4: vue37.DefineComponent<vue37.ExtractPropTypes<{
|
|
267
267
|
fields: {
|
|
268
|
-
type:
|
|
268
|
+
type: vue37.PropType<TdFormFieldProps[]>;
|
|
269
269
|
default: () => never[];
|
|
270
270
|
};
|
|
271
271
|
item: {
|
|
272
|
-
type:
|
|
272
|
+
type: vue37.PropType<element_plus0.FormItemProps>;
|
|
273
273
|
default: () => {};
|
|
274
274
|
};
|
|
275
|
-
}>, __TdFormExpose, {}, {}, {},
|
|
275
|
+
}>, __TdFormExpose, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {
|
|
276
276
|
submit: (data: any) => any;
|
|
277
|
-
}, string,
|
|
277
|
+
}, string, vue37.PublicProps, Readonly<vue37.ExtractPropTypes<{
|
|
278
278
|
fields: {
|
|
279
|
-
type:
|
|
279
|
+
type: vue37.PropType<TdFormFieldProps[]>;
|
|
280
280
|
default: () => never[];
|
|
281
281
|
};
|
|
282
282
|
item: {
|
|
283
|
-
type:
|
|
283
|
+
type: vue37.PropType<element_plus0.FormItemProps>;
|
|
284
284
|
default: () => {};
|
|
285
285
|
};
|
|
286
286
|
}>> & Readonly<{
|
|
@@ -288,65 +288,65 @@ declare const __VLS_base$3: vue51.DefineComponent<vue51.ExtractPropTypes<{
|
|
|
288
288
|
}>, {
|
|
289
289
|
fields: TdFormFieldProps[];
|
|
290
290
|
item: element_plus0.FormItemProps;
|
|
291
|
-
}, {}, {}, {}, string,
|
|
292
|
-
declare const __VLS_export$
|
|
293
|
-
declare const _default$
|
|
294
|
-
type __VLS_WithSlots$
|
|
291
|
+
}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
|
|
292
|
+
declare const __VLS_export$6: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
|
|
293
|
+
declare const _default$2: typeof __VLS_export$6;
|
|
294
|
+
type __VLS_WithSlots$4<T, S> = T & {
|
|
295
295
|
new (): {
|
|
296
296
|
$slots: S;
|
|
297
297
|
};
|
|
298
298
|
};
|
|
299
299
|
//#endregion
|
|
300
300
|
//#region src/form/form-item.vue.d.ts
|
|
301
|
-
declare var __VLS_10: string | number, __VLS_11: any;
|
|
302
|
-
type __VLS_Slots$
|
|
303
|
-
declare const __VLS_base$
|
|
301
|
+
declare var __VLS_10$1: string | number, __VLS_11$1: any;
|
|
302
|
+
type __VLS_Slots$3 = {} & { [K in NonNullable<typeof __VLS_10$1>]?: (props: typeof __VLS_11$1) => any };
|
|
303
|
+
declare const __VLS_base$3: vue37.DefineComponent<vue37.ExtractPropTypes<{
|
|
304
304
|
messageLabel: {
|
|
305
|
-
type:
|
|
305
|
+
type: vue37.PropType<OrRef<string>>;
|
|
306
306
|
default: string;
|
|
307
307
|
};
|
|
308
308
|
formatMessage: {
|
|
309
|
-
type:
|
|
309
|
+
type: vue37.PropType<AnyFunction>;
|
|
310
310
|
default: null;
|
|
311
311
|
};
|
|
312
312
|
hideRequiredAsterisk: {
|
|
313
|
-
type:
|
|
313
|
+
type: vue37.PropType<boolean>;
|
|
314
314
|
default: boolean;
|
|
315
315
|
};
|
|
316
|
-
}>, {}, {}, {}, {},
|
|
316
|
+
}>, {}, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<vue37.ExtractPropTypes<{
|
|
317
317
|
messageLabel: {
|
|
318
|
-
type:
|
|
318
|
+
type: vue37.PropType<OrRef<string>>;
|
|
319
319
|
default: string;
|
|
320
320
|
};
|
|
321
321
|
formatMessage: {
|
|
322
|
-
type:
|
|
322
|
+
type: vue37.PropType<AnyFunction>;
|
|
323
323
|
default: null;
|
|
324
324
|
};
|
|
325
325
|
hideRequiredAsterisk: {
|
|
326
|
-
type:
|
|
326
|
+
type: vue37.PropType<boolean>;
|
|
327
327
|
default: boolean;
|
|
328
328
|
};
|
|
329
329
|
}>> & Readonly<{}>, {
|
|
330
330
|
hideRequiredAsterisk: boolean;
|
|
331
331
|
messageLabel: any;
|
|
332
332
|
formatMessage: AnyFunction;
|
|
333
|
-
}, {}, {}, {}, string,
|
|
334
|
-
declare const __VLS_export$
|
|
335
|
-
declare const _default$
|
|
336
|
-
type __VLS_WithSlots$
|
|
333
|
+
}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
|
|
334
|
+
declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
|
|
335
|
+
declare const _default$4: typeof __VLS_export$5;
|
|
336
|
+
type __VLS_WithSlots$3<T, S> = T & {
|
|
337
337
|
new (): {
|
|
338
338
|
$slots: S;
|
|
339
339
|
};
|
|
340
340
|
};
|
|
341
341
|
//#endregion
|
|
342
342
|
//#region src/form/form-field.vue.d.ts
|
|
343
|
-
declare const __VLS_export$
|
|
344
|
-
declare const _default$
|
|
343
|
+
declare const __VLS_export$4: vue37.DefineComponent<{}, {}, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
|
|
344
|
+
declare const _default$3: typeof __VLS_export$4;
|
|
345
345
|
//#endregion
|
|
346
346
|
//#region src/form/index.d.ts
|
|
347
|
-
type Instance$2 = InstanceType<typeof _default$
|
|
347
|
+
type Instance$2 = InstanceType<typeof _default$2>;
|
|
348
348
|
type TdFormInstance = Instance$2 & Omit<FormInstance, keyof Instance$2>;
|
|
349
|
-
type TdFormItemInstance = InstanceType<typeof _default$
|
|
349
|
+
type TdFormItemInstance = InstanceType<typeof _default$4>;
|
|
350
350
|
//#endregion
|
|
351
351
|
//#region src/table/utils.d.ts
|
|
352
352
|
type TableColumnProp = {
|
|
@@ -383,86 +383,86 @@ type TdTableProps = ExtractPublicPropTypes<typeof tablePropsDef>;
|
|
|
383
383
|
//#endregion
|
|
384
384
|
//#region src/table/table.vue.d.ts
|
|
385
385
|
declare var __VLS_1: {}, __VLS_16: string, __VLS_17: any, __VLS_19: {};
|
|
386
|
-
type __VLS_Slots$
|
|
386
|
+
type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any } & {
|
|
387
387
|
before?: (props: typeof __VLS_1) => any;
|
|
388
388
|
} & {
|
|
389
389
|
after?: (props: typeof __VLS_19) => any;
|
|
390
390
|
};
|
|
391
|
-
declare const __VLS_base$
|
|
391
|
+
declare const __VLS_base$2: vue37.DefineComponent<vue37.ExtractPropTypes<{
|
|
392
392
|
columns: {
|
|
393
|
-
type:
|
|
393
|
+
type: vue37.PropType<TdTableColumnProps[]>;
|
|
394
394
|
default: () => never[];
|
|
395
395
|
};
|
|
396
|
-
}>, TableInstance, {}, {}, {},
|
|
396
|
+
}>, TableInstance, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<vue37.ExtractPropTypes<{
|
|
397
397
|
columns: {
|
|
398
|
-
type:
|
|
398
|
+
type: vue37.PropType<TdTableColumnProps[]>;
|
|
399
399
|
default: () => never[];
|
|
400
400
|
};
|
|
401
401
|
}>> & Readonly<{}>, {
|
|
402
402
|
columns: TdTableColumnProps[];
|
|
403
|
-
}, {}, {}, {}, string,
|
|
404
|
-
declare const __VLS_export$
|
|
405
|
-
declare const _default$
|
|
406
|
-
type __VLS_WithSlots$
|
|
403
|
+
}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
|
|
404
|
+
declare const __VLS_export$3: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
|
|
405
|
+
declare const _default$5: typeof __VLS_export$3;
|
|
406
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
407
407
|
new (): {
|
|
408
408
|
$slots: S;
|
|
409
409
|
};
|
|
410
410
|
};
|
|
411
411
|
//#endregion
|
|
412
412
|
//#region src/table/table-col.vue.d.ts
|
|
413
|
-
declare const __VLS_export$
|
|
413
|
+
declare const __VLS_export$2: vue37.DefineComponent<vue37.ExtractPropTypes<{
|
|
414
414
|
slots: {
|
|
415
|
-
type:
|
|
415
|
+
type: vue37.PropType<OrArray<SlotDef>>;
|
|
416
416
|
default: null;
|
|
417
417
|
};
|
|
418
418
|
columns: {
|
|
419
|
-
type:
|
|
419
|
+
type: vue37.PropType<TdTableColumnProps[]>;
|
|
420
420
|
default: () => never[];
|
|
421
421
|
};
|
|
422
422
|
transform: {
|
|
423
|
-
type:
|
|
423
|
+
type: vue37.PropType<AnyFunction[]>;
|
|
424
424
|
default: () => never[];
|
|
425
425
|
};
|
|
426
426
|
hide: {
|
|
427
|
-
type:
|
|
427
|
+
type: vue37.PropType<boolean | vue37.Ref<boolean>>;
|
|
428
428
|
default: false;
|
|
429
429
|
};
|
|
430
430
|
dangerouslyUseHTMLString: {
|
|
431
|
-
type:
|
|
431
|
+
type: vue37.PropType<boolean | vue37.Ref<boolean>>;
|
|
432
432
|
default: false;
|
|
433
433
|
};
|
|
434
|
-
}>, {}, {}, {}, {},
|
|
434
|
+
}>, {}, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<vue37.ExtractPropTypes<{
|
|
435
435
|
slots: {
|
|
436
|
-
type:
|
|
436
|
+
type: vue37.PropType<OrArray<SlotDef>>;
|
|
437
437
|
default: null;
|
|
438
438
|
};
|
|
439
439
|
columns: {
|
|
440
|
-
type:
|
|
440
|
+
type: vue37.PropType<TdTableColumnProps[]>;
|
|
441
441
|
default: () => never[];
|
|
442
442
|
};
|
|
443
443
|
transform: {
|
|
444
|
-
type:
|
|
444
|
+
type: vue37.PropType<AnyFunction[]>;
|
|
445
445
|
default: () => never[];
|
|
446
446
|
};
|
|
447
447
|
hide: {
|
|
448
|
-
type:
|
|
448
|
+
type: vue37.PropType<boolean | vue37.Ref<boolean>>;
|
|
449
449
|
default: false;
|
|
450
450
|
};
|
|
451
451
|
dangerouslyUseHTMLString: {
|
|
452
|
-
type:
|
|
452
|
+
type: vue37.PropType<boolean | vue37.Ref<boolean>>;
|
|
453
453
|
default: false;
|
|
454
454
|
};
|
|
455
455
|
}>> & Readonly<{}>, {
|
|
456
|
+
hide: boolean | vue37.Ref<boolean, boolean>;
|
|
456
457
|
slots: OrArray<SlotDef>;
|
|
457
458
|
columns: TdTableColumnProps[];
|
|
458
459
|
transform: AnyFunction[];
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
declare const _default$5: typeof __VLS_export$1;
|
|
460
|
+
dangerouslyUseHTMLString: boolean | vue37.Ref<boolean, boolean>;
|
|
461
|
+
}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
|
|
462
|
+
declare const _default$6: typeof __VLS_export$2;
|
|
463
463
|
//#endregion
|
|
464
464
|
//#region src/table/index.d.ts
|
|
465
|
-
type Instance$1 = InstanceType<typeof _default$
|
|
465
|
+
type Instance$1 = InstanceType<typeof _default$5>;
|
|
466
466
|
type TdTableInstance = Instance$1 & Omit<TableInstance, keyof Instance$1>;
|
|
467
467
|
//#endregion
|
|
468
468
|
//#region src/dialog/utils.d.ts
|
|
@@ -490,11 +490,11 @@ declare var __VLS_13: "default" | "title" | "header" | "footer", __VLS_14: {
|
|
|
490
490
|
titleId?: string | undefined;
|
|
491
491
|
titleClass?: string | undefined;
|
|
492
492
|
};
|
|
493
|
-
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
|
|
494
|
-
declare const __VLS_base:
|
|
495
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
496
|
-
declare const _default: typeof __VLS_export;
|
|
497
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
493
|
+
type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
|
|
494
|
+
declare const __VLS_base$1: vue37.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any>;
|
|
495
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
496
|
+
declare const _default: typeof __VLS_export$1;
|
|
497
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
498
498
|
new (): {
|
|
499
499
|
$slots: S;
|
|
500
500
|
};
|
|
@@ -504,14 +504,53 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
504
504
|
type Instance = InstanceType<typeof _default>;
|
|
505
505
|
type TdDialogInstance = Instance & Omit<DialogInstance, keyof Instance & string>;
|
|
506
506
|
//#endregion
|
|
507
|
+
//#region src/enum-select/store.d.ts
|
|
508
|
+
type DataOption = {
|
|
509
|
+
loading: boolean;
|
|
510
|
+
options: Array<{
|
|
511
|
+
label: string;
|
|
512
|
+
value: string;
|
|
513
|
+
}>;
|
|
514
|
+
fetch?: (code: string) => Promise<Array<{
|
|
515
|
+
label: string;
|
|
516
|
+
value: string;
|
|
517
|
+
}>>;
|
|
518
|
+
};
|
|
519
|
+
declare function clearEnum(code: string): void;
|
|
520
|
+
declare function getEnum(code: string, value: string, fetch?: DataOption['fetch']): vue37.ComputedRef<{
|
|
521
|
+
label: string;
|
|
522
|
+
value: string;
|
|
523
|
+
} | undefined>;
|
|
524
|
+
declare function resetEnum(code: string): void;
|
|
525
|
+
declare function setDefaultEnumFetch(fetch: Exclude<DataOption['fetch'], undefined>): void;
|
|
526
|
+
//#endregion
|
|
527
|
+
//#region src/enum-select/enum-select.vue.d.ts
|
|
528
|
+
type __VLS_Props = {
|
|
529
|
+
code: string;
|
|
530
|
+
fetch?: DataOption['fetch'];
|
|
531
|
+
};
|
|
532
|
+
declare var __VLS_10: string | number, __VLS_11: any;
|
|
533
|
+
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
|
|
534
|
+
declare const __VLS_base: vue37.DefineComponent<__VLS_Props, SelectInstance, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, false, {}, any>;
|
|
535
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
536
|
+
declare const _default$1: typeof __VLS_export;
|
|
537
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
538
|
+
new (): {
|
|
539
|
+
$slots: S;
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/enum-select/index.d.ts
|
|
544
|
+
type TdEnumSelectInstance = InstanceType<typeof _default$1>;
|
|
545
|
+
//#endregion
|
|
507
546
|
//#region src/hooks/use-reuse.d.ts
|
|
508
|
-
declare function useReuse(): (
|
|
547
|
+
declare function useReuse(): (vue37.DefineComponent<{}, () => null, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any> | vue37.DefineComponent<{}, () => vue37.VNode<vue37.RendererNode, vue37.RendererElement, {
|
|
509
548
|
[key: string]: any;
|
|
510
|
-
}>[] | undefined, {}, {}, {},
|
|
511
|
-
[name: string]:
|
|
549
|
+
}>[] | undefined, {}, {}, {}, vue37.ComponentOptionsMixin, vue37.ComponentOptionsMixin, {}, string, vue37.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue37.ComponentProvideOptions, true, {}, any> | vue37.ComputedRef<Readonly<{
|
|
550
|
+
[name: string]: vue37.Slot<any> | undefined;
|
|
512
551
|
}>>)[];
|
|
513
552
|
//#endregion
|
|
514
553
|
//#region src/utils/index.d.ts
|
|
515
554
|
declare function getKey(obj: any): string;
|
|
516
555
|
//#endregion
|
|
517
|
-
export { _default as TdDialog, TdDialogInstance, type TdDialogProps, _default$1 as
|
|
556
|
+
export { _default as TdDialog, TdDialogInstance, type TdDialogProps, _default$1 as TdEnumSelect, TdEnumSelectInstance, _default$2 as TdForm, _default$3 as TdFormField, type TdFormFieldProps, TdFormInstance, _default$4 as TdFormItem, TdFormItemInstance, type TdFormProps, _default$5 as TdTable, _default$6 as TdTableCol, type TdTableColumnProps, TdTableInstance, type TdTableProps, clearEnum, formPropsDef, getEnum, getKey, resetEnum, setDefaultEnumFetch, tableColumnPropsDef, tablePropsDef, useReuse, widget };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, isRef, markRaw, mergeProps, normalizeClass, normalizeProps, normalizeStyle, onMounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toHandlers, toRaw, toRef, unref, useAttrs, useSlots, useTemplateRef, withCtx, withModifiers } from "vue";
|
|
2
|
-
import { ElDialog, ElForm, ElFormItem, ElTable, ElTableColumn, useNamespace } from "element-plus";
|
|
2
|
+
import { ElDialog, ElForm, ElFormItem, ElSelect, ElTable, ElTableColumn, useNamespace } from "element-plus";
|
|
3
3
|
import { cut, ensureArray, getDeepValue, groupBy, isFunction, isNullOrUndef, isObject, isString, pick, setDeepValue, toCamelCase, toKebabCase, uid } from "yatter";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/index.ts
|
|
@@ -206,7 +206,11 @@ const layoutFieldPropsDef = {
|
|
|
206
206
|
default: () => []
|
|
207
207
|
},
|
|
208
208
|
...fieldsPropsDef,
|
|
209
|
-
...commonFieldPropsDef
|
|
209
|
+
...commonFieldPropsDef,
|
|
210
|
+
prop: {
|
|
211
|
+
type: [String, Function],
|
|
212
|
+
required: false
|
|
213
|
+
}
|
|
210
214
|
};
|
|
211
215
|
const formPropsDef = {
|
|
212
216
|
fields: {
|
|
@@ -981,6 +985,94 @@ var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
981
985
|
//#region src/dialog/dialog.vue
|
|
982
986
|
var dialog_default = dialog_vue_vue_type_script_setup_true_lang_default;
|
|
983
987
|
|
|
988
|
+
//#endregion
|
|
989
|
+
//#region src/enum-select/store.ts
|
|
990
|
+
let defaultFetch;
|
|
991
|
+
const store = ref(/* @__PURE__ */ new Map());
|
|
992
|
+
function getOptions(code, fetch) {
|
|
993
|
+
return computed(() => {
|
|
994
|
+
if (!store.value.has(code)) store.value.set(code, {
|
|
995
|
+
loading: false,
|
|
996
|
+
options: [],
|
|
997
|
+
fetch
|
|
998
|
+
});
|
|
999
|
+
const data = store.value.get(code);
|
|
1000
|
+
if (!data.options.length && !data.loading) fetchOptions(code);
|
|
1001
|
+
return data.options;
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
async function fetchOptions(code) {
|
|
1005
|
+
const data = store.value.get(code);
|
|
1006
|
+
data.loading = true;
|
|
1007
|
+
const options = await (data.fetch || defaultFetch)?.(code);
|
|
1008
|
+
if (options) {
|
|
1009
|
+
data.loading = false;
|
|
1010
|
+
data.options = options;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
function clearEnum(code) {
|
|
1014
|
+
const data = store.value.get(code);
|
|
1015
|
+
if (!data) return;
|
|
1016
|
+
data.options = [];
|
|
1017
|
+
}
|
|
1018
|
+
function getEnum(code, value, fetch) {
|
|
1019
|
+
return computed(() => {
|
|
1020
|
+
return getOptions(code, fetch).value.find((item) => item.value === value);
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
function resetEnum(code) {
|
|
1024
|
+
if (!store.value.has(code)) return;
|
|
1025
|
+
fetchOptions(code);
|
|
1026
|
+
}
|
|
1027
|
+
function setDefaultEnumFetch(fetch) {
|
|
1028
|
+
defaultFetch = fetch;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
//#endregion
|
|
1032
|
+
//#region src/enum-select/enum-select.vue?vue&type=script&setup=true&lang.ts
|
|
1033
|
+
var enum_select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1034
|
+
__name: "enum-select",
|
|
1035
|
+
props: {
|
|
1036
|
+
code: {
|
|
1037
|
+
type: String,
|
|
1038
|
+
required: true
|
|
1039
|
+
},
|
|
1040
|
+
fetch: {
|
|
1041
|
+
type: Function,
|
|
1042
|
+
required: false
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
setup(__props, { expose: __expose }) {
|
|
1046
|
+
const props = __props;
|
|
1047
|
+
const selectRef = useTemplateRef("selectRef");
|
|
1048
|
+
const options = getOptions(props.code, props.fetch);
|
|
1049
|
+
__expose(new Proxy({}, {
|
|
1050
|
+
get(target, key) {
|
|
1051
|
+
return Reflect.get(selectRef.value || {}, key);
|
|
1052
|
+
},
|
|
1053
|
+
has(target, key) {
|
|
1054
|
+
return Reflect.has(selectRef.value || {}, key);
|
|
1055
|
+
}
|
|
1056
|
+
}));
|
|
1057
|
+
return (_ctx, _cache) => {
|
|
1058
|
+
return openBlock(), createBlock(unref(ElSelect), mergeProps({
|
|
1059
|
+
ref_key: "selectRef",
|
|
1060
|
+
ref: selectRef,
|
|
1061
|
+
options: unref(options)
|
|
1062
|
+
}, _ctx.$attrs), createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => {
|
|
1063
|
+
return {
|
|
1064
|
+
name,
|
|
1065
|
+
fn: withCtx((scope) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(scope)))])
|
|
1066
|
+
};
|
|
1067
|
+
})]), 1040, ["options"]);
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
|
|
1072
|
+
//#endregion
|
|
1073
|
+
//#region src/enum-select/enum-select.vue
|
|
1074
|
+
var enum_select_default = enum_select_vue_vue_type_script_setup_true_lang_default;
|
|
1075
|
+
|
|
984
1076
|
//#endregion
|
|
985
1077
|
//#region src/hooks/use-reuse.ts
|
|
986
1078
|
function useReuse() {
|
|
@@ -1017,4 +1109,4 @@ function useReuse() {
|
|
|
1017
1109
|
}
|
|
1018
1110
|
|
|
1019
1111
|
//#endregion
|
|
1020
|
-
export { dialog_default as TdDialog, form_default as TdForm, form_field_default as TdFormField, form_item_default as TdFormItem, table_default as TdTable, table_col_default as TdTableCol, formPropsDef, getKey, tableColumnPropsDef, tablePropsDef, useReuse, widget };
|
|
1112
|
+
export { dialog_default as TdDialog, enum_select_default as TdEnumSelect, form_default as TdForm, form_field_default as TdFormField, form_item_default as TdFormItem, table_default as TdTable, table_col_default as TdTableCol, clearEnum, formPropsDef, getEnum, getKey, resetEnum, setDefaultEnumFetch, tableColumnPropsDef, tablePropsDef, useReuse, widget };
|