tiddy 2.0.9 → 2.2.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,4 +1,4 @@
1
- import * as vue32 from "vue";
1
+ import * as vue51 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
4
  import { DialogInstance, DialogProps, FormInstance, FormItemProp, FormItemProps, FormItemRule, FormProps, TableColumnInstance, TableInstance } from "element-plus";
@@ -252,7 +252,7 @@ declare function isValidateError(prop: string): boolean;
252
252
  declare const expose$1: {
253
253
  reValidateErrorFields: typeof reValidateErrorFields;
254
254
  isValidateError: typeof isValidateError;
255
- model: vue32.ComputedRef<unknown>;
255
+ model: vue51.ComputedRef<unknown>;
256
256
  };
257
257
  type __TdFormExpose = typeof expose$1 & FormInstance;
258
258
  declare var __VLS_11$1: {}, __VLS_13$1: {}, __VLS_19$1: {};
@@ -263,24 +263,24 @@ type __VLS_Slots$3 = {} & {
263
263
  } & {
264
264
  suffix?: (props: typeof __VLS_19$1) => any;
265
265
  };
266
- declare const __VLS_base$3: vue32.DefineComponent<vue32.ExtractPropTypes<{
266
+ declare const __VLS_base$3: vue51.DefineComponent<vue51.ExtractPropTypes<{
267
267
  fields: {
268
- type: vue32.PropType<TdFormFieldProps[]>;
268
+ type: vue51.PropType<TdFormFieldProps[]>;
269
269
  default: () => never[];
270
270
  };
271
271
  item: {
272
- type: vue32.PropType<element_plus0.FormItemProps>;
272
+ type: vue51.PropType<element_plus0.FormItemProps>;
273
273
  default: () => {};
274
274
  };
275
- }>, __TdFormExpose, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {
275
+ }>, __TdFormExpose, {}, {}, {}, vue51.ComponentOptionsMixin, vue51.ComponentOptionsMixin, {
276
276
  submit: (data: any) => any;
277
- }, string, vue32.PublicProps, Readonly<vue32.ExtractPropTypes<{
277
+ }, string, vue51.PublicProps, Readonly<vue51.ExtractPropTypes<{
278
278
  fields: {
279
- type: vue32.PropType<TdFormFieldProps[]>;
279
+ type: vue51.PropType<TdFormFieldProps[]>;
280
280
  default: () => never[];
281
281
  };
282
282
  item: {
283
- type: vue32.PropType<element_plus0.FormItemProps>;
283
+ type: vue51.PropType<element_plus0.FormItemProps>;
284
284
  default: () => {};
285
285
  };
286
286
  }>> & Readonly<{
@@ -288,7 +288,7 @@ declare const __VLS_base$3: vue32.DefineComponent<vue32.ExtractPropTypes<{
288
288
  }>, {
289
289
  fields: TdFormFieldProps[];
290
290
  item: element_plus0.FormItemProps;
291
- }, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
291
+ }, {}, {}, {}, string, vue51.ComponentProvideOptions, true, {}, any>;
292
292
  declare const __VLS_export$5: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
293
293
  declare const _default$1: typeof __VLS_export$5;
294
294
  type __VLS_WithSlots$3<T, S> = T & {
@@ -300,37 +300,37 @@ type __VLS_WithSlots$3<T, S> = T & {
300
300
  //#region src/form/form-item.vue.d.ts
301
301
  declare var __VLS_10: string | number, __VLS_11: any;
302
302
  type __VLS_Slots$2 = {} & { [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any };
303
- declare const __VLS_base$2: vue32.DefineComponent<vue32.ExtractPropTypes<{
303
+ declare const __VLS_base$2: vue51.DefineComponent<vue51.ExtractPropTypes<{
304
304
  messageLabel: {
305
- type: vue32.PropType<OrRef<string>>;
305
+ type: vue51.PropType<OrRef<string>>;
306
306
  default: string;
307
307
  };
308
308
  formatMessage: {
309
- type: vue32.PropType<AnyFunction>;
309
+ type: vue51.PropType<AnyFunction>;
310
310
  default: null;
311
311
  };
312
312
  hideRequiredAsterisk: {
313
- type: vue32.PropType<boolean>;
313
+ type: vue51.PropType<boolean>;
314
314
  default: boolean;
315
315
  };
316
- }>, {}, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<vue32.ExtractPropTypes<{
316
+ }>, {}, {}, {}, {}, vue51.ComponentOptionsMixin, vue51.ComponentOptionsMixin, {}, string, vue51.PublicProps, Readonly<vue51.ExtractPropTypes<{
317
317
  messageLabel: {
318
- type: vue32.PropType<OrRef<string>>;
318
+ type: vue51.PropType<OrRef<string>>;
319
319
  default: string;
320
320
  };
321
321
  formatMessage: {
322
- type: vue32.PropType<AnyFunction>;
322
+ type: vue51.PropType<AnyFunction>;
323
323
  default: null;
324
324
  };
325
325
  hideRequiredAsterisk: {
326
- type: vue32.PropType<boolean>;
326
+ type: vue51.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, vue32.ComponentProvideOptions, true, {}, any>;
333
+ }, {}, {}, {}, string, vue51.ComponentProvideOptions, true, {}, any>;
334
334
  declare const __VLS_export$4: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
335
335
  declare const _default$3: typeof __VLS_export$4;
336
336
  type __VLS_WithSlots$2<T, S> = T & {
@@ -340,7 +340,7 @@ type __VLS_WithSlots$2<T, S> = T & {
340
340
  };
341
341
  //#endregion
342
342
  //#region src/form/form-field.vue.d.ts
343
- declare const __VLS_export$3: vue32.DefineComponent<{}, {}, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
343
+ declare const __VLS_export$3: vue51.DefineComponent<{}, {}, {}, {}, {}, vue51.ComponentOptionsMixin, vue51.ComponentOptionsMixin, {}, string, vue51.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue51.ComponentProvideOptions, true, {}, any>;
344
344
  declare const _default$2: typeof __VLS_export$3;
345
345
  //#endregion
346
346
  //#region src/form/index.d.ts
@@ -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;
@@ -384,19 +388,19 @@ type __VLS_Slots$1 = {} & { [K in NonNullable<typeof __VLS_16>]?: (props: typeof
384
388
  } & {
385
389
  after?: (props: typeof __VLS_19) => any;
386
390
  };
387
- declare const __VLS_base$1: vue32.DefineComponent<vue32.ExtractPropTypes<{
391
+ declare const __VLS_base$1: vue51.DefineComponent<vue51.ExtractPropTypes<{
388
392
  columns: {
389
- type: vue32.PropType<TdTableColumnProps[]>;
393
+ type: vue51.PropType<TdTableColumnProps[]>;
390
394
  default: () => never[];
391
395
  };
392
- }>, TableInstance, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<vue32.ExtractPropTypes<{
396
+ }>, TableInstance, {}, {}, {}, vue51.ComponentOptionsMixin, vue51.ComponentOptionsMixin, {}, string, vue51.PublicProps, Readonly<vue51.ExtractPropTypes<{
393
397
  columns: {
394
- type: vue32.PropType<TdTableColumnProps[]>;
398
+ type: vue51.PropType<TdTableColumnProps[]>;
395
399
  default: () => never[];
396
400
  };
397
401
  }>> & Readonly<{}>, {
398
402
  columns: TdTableColumnProps[];
399
- }, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
403
+ }, {}, {}, {}, string, vue51.ComponentProvideOptions, true, {}, any>;
400
404
  declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
401
405
  declare const _default$4: typeof __VLS_export$2;
402
406
  type __VLS_WithSlots$1<T, S> = T & {
@@ -406,46 +410,55 @@ type __VLS_WithSlots$1<T, S> = T & {
406
410
  };
407
411
  //#endregion
408
412
  //#region src/table/table-col.vue.d.ts
409
- declare const __VLS_export$1: vue32.DefineComponent<vue32.ExtractPropTypes<{
413
+ declare const __VLS_export$1: vue51.DefineComponent<vue51.ExtractPropTypes<{
410
414
  slots: {
411
- type: vue32.PropType<OrArray<SlotDef>>;
415
+ type: vue51.PropType<OrArray<SlotDef>>;
412
416
  default: null;
413
417
  };
414
418
  columns: {
415
- type: vue32.PropType<TdTableColumnProps[]>;
419
+ type: vue51.PropType<TdTableColumnProps[]>;
416
420
  default: () => never[];
417
421
  };
418
422
  transform: {
419
- type: vue32.PropType<AnyFunction[]>;
423
+ type: vue51.PropType<AnyFunction[]>;
420
424
  default: () => never[];
421
425
  };
422
426
  hide: {
423
- type: vue32.PropType<boolean | vue32.Ref<boolean>>;
427
+ type: vue51.PropType<boolean | vue51.Ref<boolean>>;
424
428
  default: false;
425
429
  };
426
- }>, {}, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<vue32.ExtractPropTypes<{
430
+ dangerouslyUseHTMLString: {
431
+ type: vue51.PropType<boolean | vue51.Ref<boolean>>;
432
+ default: false;
433
+ };
434
+ }>, {}, {}, {}, {}, vue51.ComponentOptionsMixin, vue51.ComponentOptionsMixin, {}, string, vue51.PublicProps, Readonly<vue51.ExtractPropTypes<{
427
435
  slots: {
428
- type: vue32.PropType<OrArray<SlotDef>>;
436
+ type: vue51.PropType<OrArray<SlotDef>>;
429
437
  default: null;
430
438
  };
431
439
  columns: {
432
- type: vue32.PropType<TdTableColumnProps[]>;
440
+ type: vue51.PropType<TdTableColumnProps[]>;
433
441
  default: () => never[];
434
442
  };
435
443
  transform: {
436
- type: vue32.PropType<AnyFunction[]>;
444
+ type: vue51.PropType<AnyFunction[]>;
437
445
  default: () => never[];
438
446
  };
439
447
  hide: {
440
- type: vue32.PropType<boolean | vue32.Ref<boolean>>;
448
+ type: vue51.PropType<boolean | vue51.Ref<boolean>>;
449
+ default: false;
450
+ };
451
+ dangerouslyUseHTMLString: {
452
+ type: vue51.PropType<boolean | vue51.Ref<boolean>>;
441
453
  default: false;
442
454
  };
443
455
  }>> & Readonly<{}>, {
444
- hide: boolean | vue32.Ref<boolean, boolean>;
445
456
  slots: OrArray<SlotDef>;
446
457
  columns: TdTableColumnProps[];
447
458
  transform: AnyFunction[];
448
- }, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
459
+ hide: boolean | vue51.Ref<boolean, boolean>;
460
+ dangerouslyUseHTMLString: boolean | vue51.Ref<boolean, boolean>;
461
+ }, {}, {}, {}, string, vue51.ComponentProvideOptions, true, {}, any>;
449
462
  declare const _default$5: typeof __VLS_export$1;
450
463
  //#endregion
451
464
  //#region src/table/index.d.ts
@@ -478,7 +491,7 @@ declare var __VLS_13: "default" | "title" | "header" | "footer", __VLS_14: {
478
491
  titleClass?: string | undefined;
479
492
  };
480
493
  type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any };
481
- declare const __VLS_base: vue32.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any>;
494
+ declare const __VLS_base: vue51.DefineComponent<{}, __TdDialogExpose, {}, {}, {}, vue51.ComponentOptionsMixin, vue51.ComponentOptionsMixin, {}, string, vue51.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue51.ComponentProvideOptions, true, {}, any>;
482
495
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
483
496
  declare const _default: typeof __VLS_export;
484
497
  type __VLS_WithSlots<T, S> = T & {
@@ -492,10 +505,10 @@ type Instance = InstanceType<typeof _default>;
492
505
  type TdDialogInstance = Instance & Omit<DialogInstance, keyof Instance & string>;
493
506
  //#endregion
494
507
  //#region src/hooks/use-reuse.d.ts
495
- declare function useReuse(): (vue32.DefineComponent<{}, () => null, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any> | vue32.DefineComponent<{}, () => vue32.VNode<vue32.RendererNode, vue32.RendererElement, {
508
+ declare function useReuse(): (vue51.DefineComponent<{}, () => null, {}, {}, {}, vue51.ComponentOptionsMixin, vue51.ComponentOptionsMixin, {}, string, vue51.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue51.ComponentProvideOptions, true, {}, any> | vue51.DefineComponent<{}, () => vue51.VNode<vue51.RendererNode, vue51.RendererElement, {
496
509
  [key: string]: any;
497
- }>[] | undefined, {}, {}, {}, vue32.ComponentOptionsMixin, vue32.ComponentOptionsMixin, {}, string, vue32.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue32.ComponentProvideOptions, true, {}, any> | vue32.ComputedRef<Readonly<{
498
- [name: string]: vue32.Slot<any> | undefined;
510
+ }>[] | undefined, {}, {}, {}, vue51.ComponentOptionsMixin, vue51.ComponentOptionsMixin, {}, string, vue51.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue51.ComponentProvideOptions, true, {}, any> | vue51.ComputedRef<Readonly<{
511
+ [name: string]: vue51.Slot<any> | undefined;
499
512
  }>>)[];
500
513
  //#endregion
501
514
  //#region src/utils/index.d.ts
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
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";
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
2
  import { ElDialog, ElForm, ElFormItem, 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
 
@@ -414,7 +414,6 @@ var widget_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
414
414
  const attrs = useAttrs();
415
415
  const formCtx = inject(formCtxKey);
416
416
  const modelModifiers = computed(() => Object.fromEntries(props.modifiers.map((m) => [m, true])));
417
- console.log(modelModifiers.value);
418
417
  const widgetModel = computed({
419
418
  get() {
420
419
  return props.formatter(getDeepValue(formCtx.model, attrs["full-prop"]));
@@ -499,7 +498,7 @@ var widget_field_default = widget_field_vue_vue_type_script_setup_true_lang_defa
499
498
 
500
499
  //#endregion
501
500
  //#region src/form/array-field.vue?vue&type=script&setup=true&lang.ts
502
- const _hoisted_1$1 = { class: "row-item" };
501
+ const _hoisted_1 = { class: "row-item" };
503
502
  const _hoisted_2 = { class: "row-action" };
504
503
  var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
505
504
  inheritAttrs: false,
@@ -549,9 +548,9 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
549
548
  temp.splice(index + 1, 0, current);
550
549
  updateValue(temp);
551
550
  },
552
- add(index) {
551
+ add(index, newValue) {
553
552
  const temp = values.value.slice();
554
- const rawValue = props.rawValue?.() || {};
553
+ const rawValue = newValue instanceof Event || isNullOrUndef(newValue) ? props.rawValue?.() || {} : newValue;
555
554
  temp.splice(index + 1, 0, rawValue);
556
555
  updateValue(temp);
557
556
  },
@@ -582,7 +581,7 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
582
581
  key: unref(getKey)(v),
583
582
  class: "list-row",
584
583
  style: normalizeStyle(_ctx.lineStyle)
585
- }, [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, {
586
585
  label: indexProp(_ctx.label, vi),
587
586
  "label-width": indexProp(_ctx.labelWidth, vi),
588
587
  "label-position": indexProp(_ctx.labelPosition, vi),
@@ -605,7 +604,9 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
605
604
  first: !vi,
606
605
  last: vi === values.value.length - 1,
607
606
  empty: false,
608
- single: values.value.length === 1
607
+ single: values.value.length === 1,
608
+ row: v,
609
+ "full-prop": parentFullProp.value
609
610
  }, null, 8, [
610
611
  "up",
611
612
  "down",
@@ -614,7 +615,9 @@ var array_field_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
614
615
  "index",
615
616
  "first",
616
617
  "last",
617
- "single"
618
+ "single",
619
+ "row",
620
+ "full-prop"
618
621
  ])) : createCommentVNode("v-if", true)])], 4);
619
622
  }), 128))]),
620
623
  _: 1
@@ -795,6 +798,10 @@ const tableColumnPropsDef = {
795
798
  hide: {
796
799
  type: [Boolean, Object],
797
800
  default: false
801
+ },
802
+ dangerouslyUseHTMLString: {
803
+ type: [Boolean, Object],
804
+ default: false
798
805
  }
799
806
  };
800
807
  const tablePropsDef = { columns: {
@@ -804,7 +811,6 @@ const tablePropsDef = { columns: {
804
811
 
805
812
  //#endregion
806
813
  //#region src/table/table-col.vue?vue&type=script&setup=true&lang.ts
807
- const _hoisted_1 = ["innerHTML"];
808
814
  var table_col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
809
815
  name: "TdTableCol",
810
816
  __name: "table-col",
@@ -813,9 +819,11 @@ var table_col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
813
819
  const props = __props;
814
820
  const attrs = useAttrs();
815
821
  const visibleColumns = computed(() => props.columns.filter((col) => !unref(col.hide)));
816
- function filtered(scope) {
822
+ function renderer(scope) {
817
823
  const { row, column } = scope;
818
- 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));
819
827
  }
820
828
  const columnSlots = inject(tableCtxKey).getParentSlots(resolveSlotNames(props.slots, attrs.prop));
821
829
  return (_ctx, _cache) => {
@@ -835,7 +843,7 @@ var table_col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
835
843
  };
836
844
  }), _ctx.transform.length ? {
837
845
  name: "default",
838
- fn: withCtx((scope) => [createElementVNode("div", { innerHTML: filtered(scope) }, null, 8, _hoisted_1)]),
846
+ fn: withCtx((scope) => [(openBlock(), createBlock(resolveDynamicComponent(renderer(scope))))]),
839
847
  key: "0"
840
848
  } : void 0]), 1040);
841
849
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiddy",
3
- "version": "2.0.9",
3
+ "version": "2.2.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",