tiddy 2.1.0 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
- import * as vue54 from "vue";
1
+ import * as vue46 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[];
@@ -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: vue54.ComputedRef<unknown>;
255
+ model: vue46.ComputedRef<unknown>;
256
256
  };
257
257
  type __TdFormExpose = typeof expose$1 & FormInstance;
258
- declare var __VLS_11$1: {}, __VLS_13$1: {}, __VLS_19$1: {};
259
- type __VLS_Slots$3 = {} & {
260
- prefix?: (props: typeof __VLS_11$1) => any;
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$3: vue54.DefineComponent<vue54.ExtractPropTypes<{
266
+ declare const __VLS_base$4: vue46.DefineComponent<vue46.ExtractPropTypes<{
267
267
  fields: {
268
- type: vue54.PropType<TdFormFieldProps[]>;
268
+ type: vue46.PropType<TdFormFieldProps[]>;
269
269
  default: () => never[];
270
270
  };
271
271
  item: {
272
- type: vue54.PropType<element_plus0.FormItemProps>;
272
+ type: vue46.PropType<element_plus0.FormItemProps>;
273
273
  default: () => {};
274
274
  };
275
- }>, __TdFormExpose, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {
275
+ }>, __TdFormExpose, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {
276
276
  submit: (data: any) => any;
277
- }, string, vue54.PublicProps, Readonly<vue54.ExtractPropTypes<{
277
+ }, string, vue46.PublicProps, Readonly<vue46.ExtractPropTypes<{
278
278
  fields: {
279
- type: vue54.PropType<TdFormFieldProps[]>;
279
+ type: vue46.PropType<TdFormFieldProps[]>;
280
280
  default: () => never[];
281
281
  };
282
282
  item: {
283
- type: vue54.PropType<element_plus0.FormItemProps>;
283
+ type: vue46.PropType<element_plus0.FormItemProps>;
284
284
  default: () => {};
285
285
  };
286
286
  }>> & Readonly<{
@@ -288,65 +288,65 @@ declare const __VLS_base$3: vue54.DefineComponent<vue54.ExtractPropTypes<{
288
288
  }>, {
289
289
  fields: TdFormFieldProps[];
290
290
  item: element_plus0.FormItemProps;
291
- }, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
292
- declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
293
- declare const _default$1: typeof __VLS_export$5;
294
- type __VLS_WithSlots$3<T, S> = T & {
291
+ }, {}, {}, {}, string, vue46.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$2 = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
303
- declare const __VLS_base$2: vue54.DefineComponent<vue54.ExtractPropTypes<{
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: vue46.DefineComponent<vue46.ExtractPropTypes<{
304
304
  messageLabel: {
305
- type: vue54.PropType<OrRef<string>>;
305
+ type: vue46.PropType<OrRef<string>>;
306
306
  default: string;
307
307
  };
308
308
  formatMessage: {
309
- type: vue54.PropType<AnyFunction>;
309
+ type: vue46.PropType<AnyFunction>;
310
310
  default: null;
311
311
  };
312
312
  hideRequiredAsterisk: {
313
- type: vue54.PropType<boolean>;
313
+ type: vue46.PropType<boolean>;
314
314
  default: boolean;
315
315
  };
316
- }>, {}, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<vue54.ExtractPropTypes<{
316
+ }>, {}, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {}, string, vue46.PublicProps, Readonly<vue46.ExtractPropTypes<{
317
317
  messageLabel: {
318
- type: vue54.PropType<OrRef<string>>;
318
+ type: vue46.PropType<OrRef<string>>;
319
319
  default: string;
320
320
  };
321
321
  formatMessage: {
322
- type: vue54.PropType<AnyFunction>;
322
+ type: vue46.PropType<AnyFunction>;
323
323
  default: null;
324
324
  };
325
325
  hideRequiredAsterisk: {
326
- type: vue54.PropType<boolean>;
326
+ type: vue46.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, vue54.ComponentProvideOptions, true, {}, any>;
334
- declare const __VLS_export$4: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
335
- declare const _default$3: typeof __VLS_export$4;
336
- type __VLS_WithSlots$2<T, S> = T & {
333
+ }, {}, {}, {}, string, vue46.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$3: vue54.DefineComponent<{}, {}, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
344
- declare const _default$2: typeof __VLS_export$3;
343
+ declare const __VLS_export$4: vue46.DefineComponent<{}, {}, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {}, string, vue46.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue46.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$1>;
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$3>;
349
+ type TdFormItemInstance = InstanceType<typeof _default$4>;
350
350
  //#endregion
351
351
  //#region src/table/utils.d.ts
352
352
  type TableColumnProp = {
@@ -366,6 +366,10 @@ type TableColumnProp = {
366
366
  type: PropType<boolean | Ref$1<boolean>>;
367
367
  default: false;
368
368
  };
369
+ dangerouslyUseHTMLString: {
370
+ type: PropType<boolean | Ref$1<boolean>>;
371
+ default: false;
372
+ };
369
373
  };
370
374
  type TdTableColumnProps = ExtractPublicPropTypes<TableColumnProp> & TableColumnInstance["$props"];
371
375
  declare const tableColumnPropsDef: TableColumnProp;
@@ -379,77 +383,86 @@ type TdTableProps = ExtractPublicPropTypes<typeof tablePropsDef>;
379
383
  //#endregion
380
384
  //#region src/table/table.vue.d.ts
381
385
  declare var __VLS_1: {}, __VLS_16: string, __VLS_17: any, __VLS_19: {};
382
- type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any } & {
386
+ type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any } & {
383
387
  before?: (props: typeof __VLS_1) => any;
384
388
  } & {
385
389
  after?: (props: typeof __VLS_19) => any;
386
390
  };
387
- declare const __VLS_base$1: vue54.DefineComponent<vue54.ExtractPropTypes<{
391
+ declare const __VLS_base$2: vue46.DefineComponent<vue46.ExtractPropTypes<{
388
392
  columns: {
389
- type: vue54.PropType<TdTableColumnProps[]>;
393
+ type: vue46.PropType<TdTableColumnProps[]>;
390
394
  default: () => never[];
391
395
  };
392
- }>, TableInstance, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<vue54.ExtractPropTypes<{
396
+ }>, TableInstance, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {}, string, vue46.PublicProps, Readonly<vue46.ExtractPropTypes<{
393
397
  columns: {
394
- type: vue54.PropType<TdTableColumnProps[]>;
398
+ type: vue46.PropType<TdTableColumnProps[]>;
395
399
  default: () => never[];
396
400
  };
397
401
  }>> & Readonly<{}>, {
398
402
  columns: TdTableColumnProps[];
399
- }, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
400
- declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
401
- declare const _default$4: typeof __VLS_export$2;
402
- type __VLS_WithSlots$1<T, S> = T & {
403
+ }, {}, {}, {}, string, vue46.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 & {
403
407
  new (): {
404
408
  $slots: S;
405
409
  };
406
410
  };
407
411
  //#endregion
408
412
  //#region src/table/table-col.vue.d.ts
409
- declare const __VLS_export$1: vue54.DefineComponent<vue54.ExtractPropTypes<{
413
+ declare const __VLS_export$2: vue46.DefineComponent<vue46.ExtractPropTypes<{
410
414
  slots: {
411
- type: vue54.PropType<OrArray<SlotDef>>;
415
+ type: vue46.PropType<OrArray<SlotDef>>;
412
416
  default: null;
413
417
  };
414
418
  columns: {
415
- type: vue54.PropType<TdTableColumnProps[]>;
419
+ type: vue46.PropType<TdTableColumnProps[]>;
416
420
  default: () => never[];
417
421
  };
418
422
  transform: {
419
- type: vue54.PropType<AnyFunction[]>;
423
+ type: vue46.PropType<AnyFunction[]>;
420
424
  default: () => never[];
421
425
  };
422
426
  hide: {
423
- type: vue54.PropType<boolean | vue54.Ref<boolean>>;
427
+ type: vue46.PropType<boolean | vue46.Ref<boolean>>;
428
+ default: false;
429
+ };
430
+ dangerouslyUseHTMLString: {
431
+ type: vue46.PropType<boolean | vue46.Ref<boolean>>;
424
432
  default: false;
425
433
  };
426
- }>, {}, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<vue54.ExtractPropTypes<{
434
+ }>, {}, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {}, string, vue46.PublicProps, Readonly<vue46.ExtractPropTypes<{
427
435
  slots: {
428
- type: vue54.PropType<OrArray<SlotDef>>;
436
+ type: vue46.PropType<OrArray<SlotDef>>;
429
437
  default: null;
430
438
  };
431
439
  columns: {
432
- type: vue54.PropType<TdTableColumnProps[]>;
440
+ type: vue46.PropType<TdTableColumnProps[]>;
433
441
  default: () => never[];
434
442
  };
435
443
  transform: {
436
- type: vue54.PropType<AnyFunction[]>;
444
+ type: vue46.PropType<AnyFunction[]>;
437
445
  default: () => never[];
438
446
  };
439
447
  hide: {
440
- type: vue54.PropType<boolean | vue54.Ref<boolean>>;
448
+ type: vue46.PropType<boolean | vue46.Ref<boolean>>;
449
+ default: false;
450
+ };
451
+ dangerouslyUseHTMLString: {
452
+ type: vue46.PropType<boolean | vue46.Ref<boolean>>;
441
453
  default: false;
442
454
  };
443
455
  }>> & Readonly<{}>, {
444
456
  slots: OrArray<SlotDef>;
445
457
  columns: TdTableColumnProps[];
446
458
  transform: AnyFunction[];
447
- hide: boolean | vue54.Ref<boolean, boolean>;
448
- }, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
449
- declare const _default$5: typeof __VLS_export$1;
459
+ hide: boolean | vue46.Ref<boolean, boolean>;
460
+ dangerouslyUseHTMLString: boolean | vue46.Ref<boolean, boolean>;
461
+ }, {}, {}, {}, string, vue46.ComponentProvideOptions, true, {}, any>;
462
+ declare const _default$6: typeof __VLS_export$2;
450
463
  //#endregion
451
464
  //#region src/table/index.d.ts
452
- type Instance$1 = InstanceType<typeof _default$4>;
465
+ type Instance$1 = InstanceType<typeof _default$5>;
453
466
  type TdTableInstance = Instance$1 & Omit<TableInstance, keyof Instance$1>;
454
467
  //#endregion
455
468
  //#region src/dialog/utils.d.ts
@@ -477,11 +490,11 @@ declare var __VLS_13: "default" | "title" | "header" | "footer", __VLS_14: {
477
490
  titleId?: string | undefined;
478
491
  titleClass?: string | undefined;
479
492
  };
480
- type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
481
- declare const __VLS_base: vue54.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any>;
482
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
483
- declare const _default: typeof __VLS_export;
484
- 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: vue46.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {}, string, vue46.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue46.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 & {
485
498
  new (): {
486
499
  $slots: S;
487
500
  };
@@ -491,14 +504,46 @@ type __VLS_WithSlots<T, S> = T & {
491
504
  type Instance = InstanceType<typeof _default>;
492
505
  type TdDialogInstance = Instance & Omit<DialogInstance, keyof Instance & string>;
493
506
  //#endregion
507
+ //#region src/enum-select/enum-select.vue.d.ts
508
+ type __VLS_Props = {
509
+ code: string;
510
+ fetch?: (code: string) => Promise<Array<{
511
+ label: string;
512
+ value: string;
513
+ }>>;
514
+ };
515
+ declare var __VLS_10: string | number, __VLS_11: any;
516
+ type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
517
+ declare const __VLS_base: vue46.DefineComponent<__VLS_Props, SelectInstance, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {}, string, vue46.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue46.ComponentProvideOptions, false, {}, any>;
518
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
519
+ declare const _default$1: typeof __VLS_export;
520
+ type __VLS_WithSlots<T, S> = T & {
521
+ new (): {
522
+ $slots: S;
523
+ };
524
+ };
525
+ //#endregion
526
+ //#region src/enum-select/store.d.ts
527
+ declare function clearEnum(code: string): void;
528
+ declare function getEnum(code: string, value: string, fetch?: (code: string) => Promise<Array<{
529
+ label: string;
530
+ value: string;
531
+ }>>): vue46.ComputedRef<{
532
+ label: string;
533
+ value: string;
534
+ } | undefined>;
535
+ //#endregion
536
+ //#region src/enum-select/index.d.ts
537
+ type TdEnumSelectInstance = InstanceType<typeof _default$1>;
538
+ //#endregion
494
539
  //#region src/hooks/use-reuse.d.ts
495
- declare function useReuse(): (vue54.DefineComponent<{}, () => null, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any> | vue54.DefineComponent<{}, () => vue54.VNode<vue54.RendererNode, vue54.RendererElement, {
540
+ declare function useReuse(): (vue46.DefineComponent<{}, () => null, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {}, string, vue46.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue46.ComponentProvideOptions, true, {}, any> | vue46.DefineComponent<{}, () => vue46.VNode<vue46.RendererNode, vue46.RendererElement, {
496
541
  [key: string]: any;
497
- }>[] | undefined, {}, {}, {}, vue54.ComponentOptionsMixin, vue54.ComponentOptionsMixin, {}, string, vue54.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue54.ComponentProvideOptions, true, {}, any> | vue54.ComputedRef<Readonly<{
498
- [name: string]: vue54.Slot<any> | undefined;
542
+ }>[] | undefined, {}, {}, {}, vue46.ComponentOptionsMixin, vue46.ComponentOptionsMixin, {}, string, vue46.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue46.ComponentProvideOptions, true, {}, any> | vue46.ComputedRef<Readonly<{
543
+ [name: string]: vue46.Slot<any> | undefined;
499
544
  }>>)[];
500
545
  //#endregion
501
546
  //#region src/utils/index.d.ts
502
547
  declare function getKey(obj: any): string;
503
548
  //#endregion
504
- export { _default as TdDialog, TdDialogInstance, type TdDialogProps, _default$1 as TdForm, _default$2 as TdFormField, type TdFormFieldProps, TdFormInstance, _default$3 as TdFormItem, TdFormItemInstance, type TdFormProps, _default$4 as TdTable, _default$5 as TdTableCol, type TdTableColumnProps, TdTableInstance, type TdTableProps, formPropsDef, getKey, tableColumnPropsDef, tablePropsDef, useReuse, widget };
549
+ 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, tableColumnPropsDef, tablePropsDef, useReuse, widget };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, 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";
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, 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
@@ -498,7 +498,7 @@ var widget_field_default = widget_field_vue_vue_type_script_setup_true_lang_defa
498
498
 
499
499
  //#endregion
500
500
  //#region src/form/array-field.vue?vue&type=script&setup=true&lang.ts
501
- const _hoisted_1$1 = { class: "row-item" };
501
+ const _hoisted_1 = { class: "row-item" };
502
502
  const _hoisted_2 = { class: "row-action" };
503
503
  var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
504
504
  inheritAttrs: false,
@@ -581,7 +581,7 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
581
581
  key: unref(getKey)(v),
582
582
  class: "list-row",
583
583
  style: normalizeStyle(_ctx.lineStyle)
584
- }, [createElementVNode("div", _hoisted_1$1, [createVNode(form_field_default, mergeProps({ "name-space": "layout-form-item" }, { ref_for: true }, fieldProps.value, {
584
+ }, [createElementVNode("div", _hoisted_1, [createVNode(form_field_default, mergeProps({ "name-space": "layout-form-item" }, { ref_for: true }, fieldProps.value, {
585
585
  label: indexProp(_ctx.label, vi),
586
586
  "label-width": indexProp(_ctx.labelWidth, vi),
587
587
  "label-position": indexProp(_ctx.labelPosition, vi),
@@ -798,6 +798,10 @@ const tableColumnPropsDef = {
798
798
  hide: {
799
799
  type: [Boolean, Object],
800
800
  default: false
801
+ },
802
+ dangerouslyUseHTMLString: {
803
+ type: [Boolean, Object],
804
+ default: false
801
805
  }
802
806
  };
803
807
  const tablePropsDef = { columns: {
@@ -807,7 +811,6 @@ const tablePropsDef = { columns: {
807
811
 
808
812
  //#endregion
809
813
  //#region src/table/table-col.vue?vue&type=script&setup=true&lang.ts
810
- const _hoisted_1 = ["innerHTML"];
811
814
  var table_col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
812
815
  name: "TdTableCol",
813
816
  __name: "table-col",
@@ -816,9 +819,11 @@ var table_col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
816
819
  const props = __props;
817
820
  const attrs = useAttrs();
818
821
  const visibleColumns = computed(() => props.columns.filter((col) => !unref(col.hide)));
819
- function filtered(scope) {
822
+ function renderer(scope) {
820
823
  const { row, column } = scope;
821
- return props.transform.reduce((res, filter) => filter(res, row, column), getDeepValue(row, column.property));
824
+ const nodes = props.transform.reduce((res, filter) => filter(res, row, column), getDeepValue(row, column.property));
825
+ if (props.dangerouslyUseHTMLString) return h("div", { innerHTML: nodes });
826
+ return h("div", null, ensureArray(nodes));
822
827
  }
823
828
  const columnSlots = inject(tableCtxKey).getParentSlots(resolveSlotNames(props.slots, attrs.prop));
824
829
  return (_ctx, _cache) => {
@@ -838,7 +843,7 @@ var table_col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
838
843
  };
839
844
  }), _ctx.transform.length ? {
840
845
  name: "default",
841
- fn: withCtx((scope) => [createElementVNode("div", { innerHTML: filtered(scope) }, null, 8, _hoisted_1)]),
846
+ fn: withCtx((scope) => [(openBlock(), createBlock(resolveDynamicComponent(renderer(scope))))]),
842
847
  key: "0"
843
848
  } : void 0]), 1040);
844
849
  };
@@ -976,6 +981,87 @@ var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
976
981
  //#region src/dialog/dialog.vue
977
982
  var dialog_default = dialog_vue_vue_type_script_setup_true_lang_default;
978
983
 
984
+ //#endregion
985
+ //#region src/enum-select/store.ts
986
+ const store = ref(/* @__PURE__ */ new Map());
987
+ function getOptions(code, fetch) {
988
+ return computed(() => {
989
+ if (!store.value.has(code)) store.value.set(code, {
990
+ loading: false,
991
+ options: []
992
+ });
993
+ const data = store.value.get(code);
994
+ if (!data.options.length && !data.loading) fetchOptions(code, fetch);
995
+ return data.options;
996
+ });
997
+ }
998
+ async function fetchOptions(code, fetch) {
999
+ if (!store.value.has(code)) store.value.set(code, {
1000
+ loading: true,
1001
+ options: []
1002
+ });
1003
+ const data = store.value.get(code);
1004
+ data.loading = true;
1005
+ const options = await fetch?.(code);
1006
+ if (options) {
1007
+ data.loading = false;
1008
+ data.options = options;
1009
+ }
1010
+ }
1011
+ function clearEnum(code) {
1012
+ store.value.delete(code);
1013
+ }
1014
+ function getEnum(code, value, fetch) {
1015
+ return computed(() => {
1016
+ return getOptions(code, fetch).value.find((item) => item.value === value);
1017
+ });
1018
+ }
1019
+
1020
+ //#endregion
1021
+ //#region src/enum-select/enum-select.vue?vue&type=script&setup=true&lang.ts
1022
+ var enum_select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
1023
+ __name: "enum-select",
1024
+ props: {
1025
+ code: {
1026
+ type: String,
1027
+ required: true
1028
+ },
1029
+ fetch: {
1030
+ type: Function,
1031
+ required: false
1032
+ }
1033
+ },
1034
+ setup(__props, { expose: __expose }) {
1035
+ const props = __props;
1036
+ const selectRef = useTemplateRef("selectRef");
1037
+ const options = getOptions(props.code, props.fetch);
1038
+ __expose(new Proxy({}, {
1039
+ get(target, key) {
1040
+ return Reflect.get(selectRef.value || {}, key);
1041
+ },
1042
+ has(target, key) {
1043
+ return Reflect.has(selectRef.value || {}, key);
1044
+ }
1045
+ }));
1046
+ return (_ctx, _cache) => {
1047
+ return openBlock(), createBlock(unref(ElSelect), mergeProps({
1048
+ ref_key: "selectRef",
1049
+ ref: selectRef,
1050
+ options: unref(options)
1051
+ }, _ctx.$attrs), createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => {
1052
+ return {
1053
+ name,
1054
+ fn: withCtx((scope) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(scope)))])
1055
+ };
1056
+ })]), 1040, ["options"]);
1057
+ };
1058
+ }
1059
+ });
1060
+
1061
+ //#endregion
1062
+ //#region src/enum-select/enum-select.vue
1063
+ var enum_select_default = enum_select_vue_vue_type_script_setup_true_lang_default;
1064
+
979
1065
  //#endregion
980
1066
  //#region src/hooks/use-reuse.ts
981
1067
  function useReuse() {
@@ -1012,4 +1098,4 @@ function useReuse() {
1012
1098
  }
1013
1099
 
1014
1100
  //#endregion
1015
- 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 };
1101
+ 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, tableColumnPropsDef, tablePropsDef, useReuse, widget };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiddy",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "packageManager": "pnpm@10.11.0",
5
5
  "description": "A set of Vue 3 components based on element-plus",
6
6
  "type": "module",