@dt-frames/ui 2.0.8 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/es/components/curd/index.js +69 -77
  2. package/es/components/curd/index.less +2 -0
  3. package/es/components/curd/src/components/Curd.d.ts +16 -8
  4. package/es/components/curd/src/hooks/useCurd.d.ts +1 -1
  5. package/es/components/curd/src/props.d.ts +0 -1
  6. package/es/components/form/index.d.ts +1 -3160
  7. package/es/components/form/index.js +64 -98
  8. package/es/components/form/index.less +18 -0
  9. package/es/components/form/src/components/FormButtons.d.ts +13 -3
  10. package/es/components/form/src/components/FormItem.d.ts +0 -1
  11. package/es/components/form/src/components/formIcon.d.ts +11 -11
  12. package/es/components/form/src/components/formInputUseDialog.d.ts +6 -6
  13. package/es/components/form/src/hooks/useFormEvent.d.ts +1 -1
  14. package/es/components/form/src/hooks/useLabelWidth.d.ts +2 -18
  15. package/es/components/form/src/index.d.ts +2 -2
  16. package/es/components/form/src/props.d.ts +3 -4
  17. package/es/components/form/src/types/form.type.d.ts +11 -5
  18. package/es/components/form/src/types/items.type.d.ts +382 -0
  19. package/es/components/modal/index.js +22 -2
  20. package/es/components/modal/index.less +3 -0
  21. package/es/components/modal/src/components/Modal.d.ts +1 -1
  22. package/es/components/modal/src/components/ModalFooter.d.ts +13 -3
  23. package/es/components/modal/src/index.d.ts +23 -13
  24. package/es/components/modal/src/props.d.ts +2 -1
  25. package/es/components/source/index.js +8 -1
  26. package/es/components/source/types/source.type.d.ts +1 -1
  27. package/es/components/table/index.js +42 -61
  28. package/es/components/table/index.less +3 -3
  29. package/es/components/table/src/components/tableSetting/DownloadCtrl.d.ts +15 -5
  30. package/es/theme/index.js +144 -88
  31. package/es/theme/index.less +1 -0
  32. package/es/theme/src/components/header/components/size.d.ts +5 -5
  33. package/es/theme/src/components/header/index.d.ts +5 -5
  34. package/es/theme/src/components/header/multiple-header.d.ts +5 -5
  35. package/es/theme/src/index.d.ts +10 -10
  36. package/es/theme/transition.less +105 -0
  37. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import { toRaw, unref, computed, getCurrentInstance, reactive, readonly, watchEffect, nextTick, defineComponent, useAttrs, openBlock, createBlock, mergeProps, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, createElementVNode, createVNode, normalizeProps, guardReactiveProps, createCommentVNode, toRefs, isVNode, ref, watch, resolveDirective, normalizeStyle, withDirectives, normalizeClass, onMounted, withKeys, createSlots, renderSlot, onUnmounted, inject, h, provide, onBeforeUnmount, resolveDynamicComponent } from "vue";
1
+ import { toRaw, unref, computed, getCurrentInstance, reactive, readonly, watchEffect, nextTick, defineComponent, useAttrs, openBlock, createBlock, mergeProps, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, toRefs, createVNode, isVNode, ref, watch, resolveDirective, normalizeProps, normalizeStyle, withDirectives, normalizeClass, createCommentVNode, createElementVNode, onMounted, withKeys, createSlots, renderSlot, guardReactiveProps, onUnmounted, inject, h, provide, onBeforeUnmount, resolveDynamicComponent } from "vue";
2
2
  import { RadioButton, RadioGroup, Button, FormItem as FormItem$1, Col as Col$1, Row, Form as Form$1, Tooltip as Tooltip$1, Spin } from "ant-design-vue/es";
3
3
  import "ant-design-vue/es/form/style";
4
4
  import "ant-design-vue/es/row/style";
5
- import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, useAppStore, isNumber, useI18n, isString, isFunction, error, useSlots, isArray, isBoolean, isNull, dispatchResize, isObject, isNullAndUnDef, isEmpty, useTimeoutFn, useApp, off, on, windowResizeFn, useMessage } from "@dt-frames/core";
6
- import { cloneDeep, isEqual, omit, upperFirst, uniqBy, set } from "lodash-es";
5
+ import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, useAppStore, isNumber, useI18n, isString, useSlots, isArray, isFunction, error, isBoolean, isNull, dispatchResize, isObject, isNullAndUnDef, isEmpty, useTimeoutFn, useApp, off, on, windowResizeFn, useMessage } from "@dt-frames/core";
6
+ import { cloneDeep, merge, isEqual, upperFirst, uniqBy, set, omit } from "lodash-es";
7
7
  import { Input, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Tooltip, Form, FormItem, Modal } from "ant-design-vue";
8
8
  import { defineStore } from "pinia";
9
9
  import "ant-design-vue/es/radio/style";
@@ -498,18 +498,20 @@ function useLabelWidth(schemaItemRef, propsRef) {
498
498
  layout = appConf.ui.form.layout
499
499
  } = unref(propsRef);
500
500
  let width = (unref(getIsZH) ? labelWidth ?? gLabelWidth : enLabelWidth ?? gEnLabelWidth) ?? labelWidth ?? gLabelWidth ?? 0;
501
- const labelcol = { ...glabelCol, ...labelCol };
502
- const wrapcol = { ...gwrapperCol, ...wrapperCol };
501
+ const labelcol = merge({}, glabelCol, labelCol);
502
+ const wrapcol = merge({}, gwrapperCol, wrapperCol);
503
503
  width = isNumber(width) ? `${width}px` : width;
504
504
  return {
505
- labelCol: {
506
- style: { width },
507
- ...labelcol
508
- },
509
- wrapperCol: {
510
- style: { width: layout === "vertical" ? "100%" : `calc(100% - ${width})` },
511
- ...wrapcol
512
- }
505
+ labelCol: merge(
506
+ {},
507
+ { style: { width } },
508
+ labelcol
509
+ ),
510
+ wrapperCol: merge(
511
+ {},
512
+ { style: { width: layout === "vertical" ? "100%" : `calc(100% - ${width})` } },
513
+ wrapcol
514
+ )
513
515
  };
514
516
  });
515
517
  }
@@ -582,7 +584,7 @@ function useFormValue(props, key = "value", changeEvent = "change", emitData) {
582
584
  });
583
585
  return [state, setState, defaultState];
584
586
  }
585
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
587
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
586
588
  __name: "radioButton",
587
589
  props: {
588
590
  value: {
@@ -633,49 +635,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
633
635
  };
634
636
  }
635
637
  });
636
- const _hoisted_1$2 = { class: "input-with-dialog" };
637
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
638
- __name: "formInputUseDialog",
639
- setup(__props) {
640
- const { t } = useI18n("UI");
641
- const attrs = useAttrs();
642
- const bindProps = computed(() => {
643
- return {
644
- ...omit(attrs, [
645
- "formValues"
646
- ]),
647
- disabled: true
648
- };
649
- });
650
- function onClickInput() {
651
- const { model, schema = {} } = attrs.formValues;
652
- if (!schema.openDialog || !isFunction(schema.openDialog)) {
653
- error(t("MUSE_FUNCTION"));
654
- return;
655
- }
656
- schema.openDialog(model);
657
- }
658
- function clearProps() {
659
- const { model, schema = {} } = attrs.formValues;
660
- [...schema.linkProps, schema.name].forEach((it) => model[it] = null);
661
- }
662
- return (_ctx, _cache) => {
663
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
664
- createElementVNode("div", { onClick: onClickInput }, [
665
- createVNode(unref(Input), normalizeProps(guardReactiveProps(unref(bindProps))), null, 16)
666
- ]),
667
- unref(attrs).formValues?.schema?.linkProps?.length ? (openBlock(), createElementBlock("i", {
668
- key: 0,
669
- class: "i mdi:close-circle",
670
- onClick: clearProps
671
- })) : createCommentVNode("", true)
672
- ]);
673
- };
674
- }
675
- });
676
638
  const components = {
677
639
  Input,
678
- InputWithDialog: _sfc_main$c,
679
640
  InputTextArea: Input.TextArea,
680
641
  InputSearch: Input.Search,
681
642
  InputGroup: Input.Group,
@@ -684,7 +645,7 @@ const components = {
684
645
  TreeSelect,
685
646
  Radio,
686
647
  RadioGroup: Radio.Group,
687
- RadioButtonGroup: _sfc_main$d,
648
+ RadioButtonGroup: _sfc_main$c,
688
649
  Checkbox,
689
650
  CheckboxGroup: Checkbox.Group,
690
651
  AutoComplete,
@@ -820,7 +781,7 @@ const _sfc_main$b = {
820
781
  const getContent = () => {
821
782
  const value = unref(getValues);
822
783
  let _con = slot ? getSlot(slots, slot, value.model) : render ? render(value.model) : renderFormItem();
823
- return component === "InputGroup" || component === "Icon" ? createVNode(FormItem, {
784
+ return component === "InputGroup" ? createVNode(FormItem, {
824
785
  "class": "m-0"
825
786
  }, _isSlot$1(_con) ? _con : {
826
787
  default: () => [_con]
@@ -931,10 +892,13 @@ const _sfc_main$b = {
931
892
  return _disabled;
932
893
  });
933
894
  const getSize = () => {
934
- if (component === "Switch" && unref(getUiSize) === UiSize.LARGE) {
895
+ const {
896
+ size = unref(getUiSize)
897
+ } = props.formProps;
898
+ if (component === "Switch" && size === UiSize.LARGE) {
935
899
  return "default";
936
900
  }
937
- return unref(getUiSize) === UiSize.MIDDLE ? "default" : unref(getUiSize);
901
+ return size === UiSize.MIDDLE ? "default" : size;
938
902
  };
939
903
  const itemProps = {
940
904
  allowClear: _sProps?.allowClear ?? appConf.ui.form.allowClear,
@@ -1049,7 +1013,7 @@ const _sfc_main$b = {
1049
1013
  let _colProps = colProps || gColProps || (mode === "search" ? appConf.ui.form.searchColspan : appConf.ui.form.dialogColspan);
1050
1014
  const values = unref(getValues);
1051
1015
  if (!component) {
1052
- if (!render && !renderCol && !slot) {
1016
+ if (!render && !renderCol && !slot && !colSlot) {
1053
1017
  error(t("NEED_RENDER"));
1054
1018
  return;
1055
1019
  }
@@ -1114,6 +1078,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1114
1078
  isAdvanced: {
1115
1079
  type: Boolean,
1116
1080
  default: true
1081
+ },
1082
+ colspan: {
1083
+ type: Object
1117
1084
  }
1118
1085
  },
1119
1086
  emits: ["handle-method"],
@@ -1133,6 +1100,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1133
1100
  Object.assign(style, {
1134
1101
  display: "inline-block"
1135
1102
  });
1103
+ return { style };
1104
+ } else if (props.mode === null) {
1105
+ Object.assign(style, {
1106
+ display: "flex",
1107
+ justifyContent: "center",
1108
+ marginBottom: "20px"
1109
+ });
1110
+ return {
1111
+ style,
1112
+ span: 24
1113
+ };
1136
1114
  }
1137
1115
  return { style };
1138
1116
  });
@@ -1155,7 +1133,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1155
1133
  }
1156
1134
  }
1157
1135
  watch(() => props.isAdvanced, (v) => {
1158
- if (v) {
1136
+ if (v || props.mode !== "search") {
1159
1137
  nextTick(() => toggleAdvanced());
1160
1138
  }
1161
1139
  }, {
@@ -1462,14 +1440,12 @@ function useFormValues({
1462
1440
  function initDefault() {
1463
1441
  const schema = unref(getSchema), obj = {};
1464
1442
  schema.forEach((item) => {
1465
- const { props = {}, name, component, defaultValue: gDefaultValue, extraName } = item;
1443
+ const { props = {}, name, component, defaultValue: gDefaultValue } = item;
1466
1444
  const { defaultValue: itemDefaultValue, mode, format, treeCheckable } = isFunction(props) ? props(formModel) : props;
1467
1445
  if (!name)
1468
1446
  return;
1469
1447
  let names = [];
1470
- if (component === "InputWithDialog") {
1471
- names = [name, ...extraName];
1472
- } else if (isArray(name)) {
1448
+ if (isArray(name)) {
1473
1449
  names = name;
1474
1450
  } else {
1475
1451
  names = [name];
@@ -1601,8 +1577,7 @@ const BasicProps = {
1601
1577
  default: () => ({})
1602
1578
  },
1603
1579
  size: {
1604
- type: String,
1605
- default: "small"
1580
+ type: String
1606
1581
  },
1607
1582
  disabled: {
1608
1583
  type: Boolean,
@@ -1720,7 +1695,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1720
1695
  formModel[key] = value;
1721
1696
  const { validateTrigger } = unref(getBindValue);
1722
1697
  if (!validateTrigger || validateTrigger === "change") {
1723
- validateFields([key]);
1698
+ validateFields([key]).catch((err) => {
1699
+ });
1724
1700
  }
1725
1701
  }
1726
1702
  function handleEnterPress() {
@@ -1790,8 +1766,19 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1790
1766
  });
1791
1767
  }
1792
1768
  let colspan = mode === "search" ? getAppConf.ui.form.searchColspan : getAppConf.ui.form.dialogColspan;
1769
+ if (mode !== "search") {
1770
+ return {
1771
+ colspan,
1772
+ ...{
1773
+ mode,
1774
+ showAdvancedButton: false,
1775
+ isAdvanced: false,
1776
+ buttonList
1777
+ }
1778
+ };
1779
+ }
1793
1780
  return {
1794
- ...colspan,
1781
+ colspan,
1795
1782
  ...{
1796
1783
  showAdvancedButton,
1797
1784
  buttonList
@@ -1953,13 +1940,6 @@ function useForm(props) {
1953
1940
  };
1954
1941
  return [register, methods];
1955
1942
  }
1956
- const withInstall = (comp) => {
1957
- comp.install = (app) => {
1958
- app.component(comp.name, comp);
1959
- };
1960
- return comp;
1961
- };
1962
- const DtForm = withInstall(_sfc_main$9);
1963
1943
  const orgDialogProp = reactive({});
1964
1944
  const cbTransfer = reactive({});
1965
1945
  const dataTransfer = reactive({});
@@ -2051,6 +2031,12 @@ function useModal(props, setModalData) {
2051
2031
  return;
2052
2032
  nextTick(() => {
2053
2033
  setModalData(data);
2034
+ if (!data)
2035
+ return;
2036
+ if (props?.title && isFunction(props?.title)) {
2037
+ let title = props.title(data);
2038
+ methods.setModalProps({ title });
2039
+ }
2054
2040
  });
2055
2041
  });
2056
2042
  const methods = {
@@ -2610,6 +2596,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2610
2596
  };
2611
2597
  }
2612
2598
  });
2599
+ const withInstall = (comp) => {
2600
+ comp.install = (app) => {
2601
+ app.component(comp.name, comp);
2602
+ };
2603
+ return comp;
2604
+ };
2613
2605
  const DtScrollContainer = withInstall(_sfc_main$5);
2614
2606
  withInstall(_sfc_main$4);
2615
2607
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
@@ -3085,7 +3077,7 @@ function useCurd(curdOpt) {
3085
3077
  "title": title,
3086
3078
  "onRegister": register
3087
3079
  }), {
3088
- default: () => [createVNode(DtForm, {
3080
+ default: () => [createVNode(_sfc_main$9, {
3089
3081
  "onRegister": registerForm
3090
3082
  }, null)]
3091
3083
  })]));
@@ -0,0 +1,2 @@
1
+ @import '../form/index.less';
2
+ @import '../modal/index.less';
@@ -82,7 +82,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
82
82
  };
83
83
  size: {
84
84
  type: import("vue").PropType<"small" | "middle" | "large">;
85
- default: string;
86
85
  };
87
86
  disabled: {
88
87
  type: BooleanConstructor;
@@ -215,7 +214,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
215
214
  default: boolean;
216
215
  };
217
216
  title: {
218
- type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
217
+ type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
219
218
  };
220
219
  loading: {
221
220
  type: BooleanConstructor;
@@ -316,7 +315,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
316
315
  default: boolean;
317
316
  };
318
317
  title: {
319
- type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
318
+ type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
320
319
  };
321
320
  loading: {
322
321
  type: BooleanConstructor;
@@ -425,7 +424,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
425
424
  default: boolean;
426
425
  };
427
426
  title: {
428
- type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
427
+ type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
429
428
  };
430
429
  loading: {
431
430
  type: BooleanConstructor;
@@ -529,7 +528,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
529
528
  default: boolean;
530
529
  };
531
530
  title: {
532
- type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
531
+ type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
533
532
  };
534
533
  loading: {
535
534
  type: BooleanConstructor;
@@ -839,6 +838,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
839
838
  type: BooleanConstructor;
840
839
  default: boolean;
841
840
  };
841
+ colspan: {
842
+ type: ObjectConstructor;
843
+ };
842
844
  }, {
843
845
  props: any;
844
846
  emits: (event: "handle-method", ...args: any[]) => void;
@@ -857,6 +859,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
857
859
  showAdvanceRef: import("vue").ComputedRef<boolean>;
858
860
  colOpt: import("vue").ComputedRef<{
859
861
  style: import("@dt-frames/core").Recordable<any>;
862
+ span?: undefined;
863
+ } | {
864
+ style: import("@dt-frames/core").Recordable<any>;
865
+ span: number;
860
866
  }>;
861
867
  getAdvanceClass: import("vue").ComputedRef<(string | {
862
868
  'basic-arrow--active': boolean;
@@ -888,6 +894,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
888
894
  type: BooleanConstructor;
889
895
  default: boolean;
890
896
  };
897
+ colspan: {
898
+ type: ObjectConstructor;
899
+ };
891
900
  }>> & {
892
901
  "onHandle-method"?: (...args: any[]) => any;
893
902
  }, {
@@ -960,7 +969,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
960
969
  default: boolean;
961
970
  };
962
971
  title: {
963
- type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
972
+ type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
964
973
  };
965
974
  loading: {
966
975
  type: BooleanConstructor;
@@ -1029,6 +1038,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
1029
1038
  loading: boolean;
1030
1039
  visible: boolean;
1031
1040
  mask: boolean;
1041
+ keyboard: boolean;
1032
1042
  closable: boolean;
1033
1043
  destroyOnClose: boolean;
1034
1044
  scrollTop: boolean;
@@ -1041,7 +1051,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
1041
1051
  showOkBtn: boolean;
1042
1052
  showCancelBtn: boolean;
1043
1053
  maskClosable: boolean;
1044
- keyboard: boolean;
1045
1054
  }>;
1046
1055
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1047
1056
  title: {
@@ -1127,7 +1136,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
1127
1136
  };
1128
1137
  size: {
1129
1138
  type: import("vue").PropType<"small" | "middle" | "large">;
1130
- default: string;
1131
1139
  };
1132
1140
  disabled: {
1133
1141
  type: BooleanConstructor;
@@ -46,7 +46,7 @@ export declare function useCurd(curdOpt: Partial<ExtractPropTypes<typeof basicPr
46
46
  default: boolean;
47
47
  };
48
48
  title: {
49
- type: PropType<String | import("vue").ComputedRef<String>>;
49
+ type: PropType<String | import("vue").ComputedRef<String> | ((data: Recordable<any>) => String)>;
50
50
  };
51
51
  loading: {
52
52
  type: BooleanConstructor;
@@ -87,7 +87,6 @@ export declare const basicProps: {
87
87
  };
88
88
  size: {
89
89
  type: PropType<"small" | "middle" | "large">;
90
- default: string;
91
90
  };
92
91
  disabled: {
93
92
  type: BooleanConstructor;