@dt-frames/ui 2.0.16 → 2.0.18

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 (43) hide show
  1. package/es/components/drawer/index.d.ts +3 -4
  2. package/es/components/drawer/index.js +11 -15
  3. package/es/components/drawer/index.less +6 -0
  4. package/es/components/drawer/src/index.d.ts +5 -7
  5. package/es/components/drawer/src/types/index.type.d.ts +3 -1
  6. package/es/components/form/index.js +33 -7
  7. package/es/components/form/src/components/FormButtons.d.ts +3056 -4
  8. package/es/components/form/src/components/FormItem.d.ts +2 -2
  9. package/es/components/form/src/components/formIcon.d.ts +0 -1209
  10. package/es/components/form/src/components/formInputUseDialog.d.ts +0 -894
  11. package/es/components/form/src/props.d.ts +3 -3
  12. package/es/components/form/src/types/items.type.d.ts +8 -0
  13. package/es/components/modal/index.js +19 -7
  14. package/es/components/modal/index.less +1 -9
  15. package/es/components/source/index.js +15 -7
  16. package/es/components/table/index.js +210 -201
  17. package/es/components/table/index.less +29 -0
  18. package/es/components/table/src/components/editTable/EditTableCell.d.ts +1 -0
  19. package/es/components/table/src/index.d.ts +0 -10
  20. package/es/components/table/src/props.d.ts +0 -4
  21. package/es/components/table/src/types/table.type.d.ts +8 -0
  22. package/es/components/tree/index.js +46 -44
  23. package/es/components/tree/index.less +13 -0
  24. package/es/components/tree/src/basicProps.d.ts +9 -4
  25. package/es/components/tree/src/components/ContextMenu.d.ts +6 -0
  26. package/es/components/tree/src/index.d.ts +11 -11
  27. package/es/components/tree/src/type/menu.d.ts +3 -0
  28. package/es/components/tree/src/type/tree.d.ts +0 -5
  29. package/es/components/tree/src/utils/tree.d.ts +3 -1
  30. package/es/components/upload/index.js +170 -69
  31. package/es/components/upload/index.less +7 -0
  32. package/es/components/upload/src/basicProps.d.ts +5 -1
  33. package/es/components/upload/src/components/WordView.d.ts +1 -0
  34. package/es/components/upload/src/hooks/useFile.d.ts +7 -6
  35. package/es/components/upload/src/index.d.ts +17 -0
  36. package/es/components/upload/src/type/file.d.ts +9 -2
  37. package/es/components/upload/src/utils/fileSize.d.ts +1 -0
  38. package/es/theme/index.js +157 -100
  39. package/es/theme/index.less +14 -0
  40. package/es/theme/src/components/sider/index.d.ts +1 -1
  41. package/es/theme/src/components/sider/mix-sider.d.ts +1 -1
  42. package/es/theme/src/index.d.ts +1 -1
  43. package/package.json +1 -1
@@ -67,6 +67,7 @@ declare const DtDrawer: import('../../utils/withInstall').SFCWithInstall<import(
67
67
  };
68
68
  props: any;
69
69
  propsRef: import("vue").Ref<{
70
+ t?: string;
70
71
  loading?: boolean;
71
72
  loadingText?: string;
72
73
  visible?: boolean;
@@ -1600,7 +1601,7 @@ declare const DtDrawer: import('../../utils/withInstall').SFCWithInstall<import(
1600
1601
  "text-anchor"?: import("csstype").TextAnchorProperty;
1601
1602
  "vector-effect"?: import("csstype").VectorEffectProperty;
1602
1603
  };
1603
- title?: string;
1604
+ title?: string | ((data: import("@dt-frames/core").Recordable<any>) => string);
1604
1605
  wrapClassName?: string;
1605
1606
  class?: string;
1606
1607
  wrapStyle?: {
@@ -7711,7 +7712,7 @@ declare const DtDrawer: import('../../utils/withInstall').SFCWithInstall<import(
7711
7712
  t?: string;
7712
7713
  label: string;
7713
7714
  color?: "" | "error" | "warning" | "success";
7714
- type?: "default" | "dashed" | "text" | "primary" | "ghost" | "link";
7715
+ type?: "link" | "default" | "dashed" | "text" | "primary" | "ghost";
7715
7716
  class?: string;
7716
7717
  disabled?: boolean;
7717
7718
  show?: boolean;
@@ -7732,13 +7733,11 @@ declare const DtDrawer: import('../../utils/withInstall').SFCWithInstall<import(
7732
7733
  getMergeProps: import("vue").ComputedRef<any>;
7733
7734
  getshowFooter: import("vue").ComputedRef<boolean>;
7734
7735
  getProps: import("vue").ComputedRef<import("./src/types/index.type").DrawerProps>;
7735
- getScrollContentStyle: import("vue").ComputedRef<import("vue").CSSProperties>;
7736
7736
  handleSave: () => void;
7737
7737
  handleCancel: (e?: Event) => Promise<void>;
7738
7738
  setDrawerProps: (props: Partial<import("./src/types/index.type").DrawerProps>) => void;
7739
7739
  drawerMethods: import("./src/types/index.type").DrawerMethods;
7740
7740
  instance: import("vue").ComponentInternalInstance;
7741
- readonly DtScrollContainer: import('../../utils/withInstall').SFCWithInstall<import("vue").DefineComponent<{}, {}, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
7742
7741
  DrawerHeader: import("vue").DefineComponent<{
7743
7742
  title: {
7744
7743
  type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
@@ -1,4 +1,4 @@
1
- import { Drawer as Drawer$1 } from "ant-design-vue/es";
1
+ import { Drawer } from "ant-design-vue/es";
2
2
  import "ant-design-vue/es/drawer/style";
3
3
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, computed, createVNode, unref, useAttrs, ref, toRaw, getCurrentInstance, watch, createBlock, mergeProps, createSlots, withCtx, renderList, normalizeProps, guardReactiveProps, reactive, watchEffect, nextTick, onUnmounted } from "vue";
4
4
  import { useI18n, DtCache, CacheKey, deepMerge, isUnDef, isFunction, useApp, isObject, error } from "@dt-frames/core";
@@ -23,14 +23,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
23
23
  };
24
24
  }
25
25
  });
26
- const _export_sfc = (sfc, props) => {
27
- const target = sfc.__vccOpts || sfc;
28
- for (const [key, val] of props) {
29
- target[key] = val;
30
- }
31
- return target;
32
- };
33
- const DrawerHeader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/components/DrawerHeader.vue"]]);
34
26
  const _hoisted_1 = {
35
27
  class: "flex items-center",
36
28
  style: { gap: "10px" }
@@ -86,7 +78,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
86
78
  };
87
79
  }
88
80
  });
89
- const DrawerFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/components/DrawerFooter.vue"]]);
90
81
  const basicProps = {
91
82
  t: {
92
83
  type: String
@@ -213,7 +204,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
213
204
  { immediate: false }
214
205
  );
215
206
  return (_ctx, _cache) => {
216
- const _component_ADrawer = Drawer$1;
207
+ const _component_ADrawer = Drawer;
217
208
  return openBlock(), createBlock(_component_ADrawer, mergeProps({
218
209
  class: "dt-drawer",
219
210
  onClose: handleCancel
@@ -230,7 +221,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
230
221
  !_ctx.$slots.title ? {
231
222
  name: "title",
232
223
  fn: withCtx(() => [
233
- createVNode(DrawerHeader, {
224
+ createVNode(_sfc_main$2, {
234
225
  title: unref(getProps).title
235
226
  }, {
236
227
  titleToolbar: withCtx(() => [
@@ -250,7 +241,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
250
241
  unref(getshowFooter) ? {
251
242
  name: "footer",
252
243
  fn: withCtx(() => [
253
- createVNode(DrawerFooter, {
244
+ createVNode(_sfc_main$1, {
254
245
  buttons: propsRef.value?.footer,
255
246
  showSave: unref(getProps).showOkBtn,
256
247
  showCancel: unref(getProps).showCancelBtn,
@@ -275,7 +266,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
275
266
  };
276
267
  }
277
268
  });
278
- const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/index.vue"]]);
279
269
  const orgDialogProp = reactive({});
280
270
  const cbTransfer = reactive({});
281
271
  const dataTransfer = reactive({});
@@ -370,6 +360,12 @@ function useDrawer(props, setModalData) {
370
360
  return;
371
361
  }
372
362
  setModalData(data ?? {});
363
+ if (!data)
364
+ return;
365
+ if (props?.title && isFunction(props?.title)) {
366
+ let title = props.title(data);
367
+ methods.setDrawerProps({ title });
368
+ }
373
369
  });
374
370
  });
375
371
  const methods = {
@@ -393,7 +389,7 @@ const withInstall = (comp) => {
393
389
  };
394
390
  return comp;
395
391
  };
396
- const DtDrawer = withInstall(Drawer);
392
+ const DtDrawer = withInstall(_sfc_main);
397
393
  export {
398
394
  DtDrawer,
399
395
  useDrawer,
@@ -7,4 +7,10 @@
7
7
 
8
8
  .ant-drawer-footer > div{
9
9
  float: right;
10
+ }
11
+
12
+ .ant-drawer-header-title{
13
+ button{
14
+ display: flex;
15
+ }
10
16
  }
@@ -1,5 +1,4 @@
1
1
  import { DrawerMethods, DrawerProps } from './types/index.type';
2
- import { CSSProperties } from 'vue';
3
2
  declare const _sfc_main: import("vue").DefineComponent<{
4
3
  t: {
5
4
  type: StringConstructor;
@@ -29,7 +28,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
29
28
  type: BooleanConstructor;
30
29
  default: boolean;
31
30
  };
32
- maskStyle: import("vue").PropType<CSSProperties>;
31
+ maskStyle: import("vue").PropType<import("vue").CSSProperties>;
33
32
  closeFunc: {
34
33
  type: import("vue").PropType<any>;
35
34
  default: any;
@@ -68,6 +67,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
68
67
  };
69
68
  props: any;
70
69
  propsRef: import("vue").Ref<{
70
+ t?: string;
71
71
  loading?: boolean;
72
72
  loadingText?: string;
73
73
  visible?: boolean;
@@ -1601,7 +1601,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
1601
1601
  "text-anchor"?: import("csstype").TextAnchorProperty;
1602
1602
  "vector-effect"?: import("csstype").VectorEffectProperty;
1603
1603
  };
1604
- title?: string;
1604
+ title?: string | ((data: import("@dt-frames/core").Recordable<any>) => string);
1605
1605
  wrapClassName?: string;
1606
1606
  class?: string;
1607
1607
  wrapStyle?: {
@@ -7712,7 +7712,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
7712
7712
  t?: string;
7713
7713
  label: string;
7714
7714
  color?: "" | "error" | "warning" | "success";
7715
- type?: "default" | "dashed" | "text" | "primary" | "ghost" | "link";
7715
+ type?: "link" | "default" | "dashed" | "text" | "primary" | "ghost";
7716
7716
  class?: string;
7717
7717
  disabled?: boolean;
7718
7718
  show?: boolean;
@@ -7733,13 +7733,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
7733
7733
  getMergeProps: import("vue").ComputedRef<any>;
7734
7734
  getshowFooter: import("vue").ComputedRef<boolean>;
7735
7735
  getProps: import("vue").ComputedRef<DrawerProps>;
7736
- getScrollContentStyle: import("vue").ComputedRef<CSSProperties>;
7737
7736
  handleSave: () => void;
7738
7737
  handleCancel: (e?: Event) => Promise<void>;
7739
7738
  setDrawerProps: (props: Partial<DrawerProps>) => void;
7740
7739
  drawerMethods: DrawerMethods;
7741
7740
  instance: import("vue").ComponentInternalInstance;
7742
- readonly DtScrollContainer: import("../../../utils/withInstall").SFCWithInstall<import("vue").DefineComponent<{}, {}, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
7743
7741
  DrawerHeader: import("vue").DefineComponent<{
7744
7742
  title: {
7745
7743
  type: import("vue").PropType<String | import("vue").ComputedRef<String>>;
@@ -7831,7 +7829,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
7831
7829
  type: BooleanConstructor;
7832
7830
  default: boolean;
7833
7831
  };
7834
- maskStyle: import("vue").PropType<CSSProperties>;
7832
+ maskStyle: import("vue").PropType<import("vue").CSSProperties>;
7835
7833
  closeFunc: {
7836
7834
  type: import("vue").PropType<any>;
7837
7835
  default: any;
@@ -1,6 +1,8 @@
1
1
  import { ButtonProps } from '../../../form';
2
+ import { Recordable } from "@dt-frames/core";
2
3
  import { CSSProperties, ComputedRef } from "vue";
3
4
  export declare type DrawerProps = {
5
+ t?: string;
4
6
  loading?: boolean;
5
7
  loadingText?: string;
6
8
  visible?: boolean;
@@ -11,7 +13,7 @@ export declare type DrawerProps = {
11
13
  maskClosable?: boolean;
12
14
  keyboard?: boolean;
13
15
  maskStyle?: CSSProperties;
14
- title?: ComputedRef<string> | string;
16
+ title?: ComputedRef<string> | string | ((data: Recordable) => string);
15
17
  wrapClassName?: string;
16
18
  class?: string;
17
19
  wrapStyle?: CSSProperties;
@@ -1,7 +1,7 @@
1
1
  import { RadioButton, RadioGroup, Input, Button, FormItem as FormItem$1, Col as Col$1, Row, Form as Form$1 } from "ant-design-vue/es";
2
2
  import "ant-design-vue/es/form/style";
3
3
  import "ant-design-vue/es/row/style";
4
- import { computed, unref, getCurrentInstance, reactive, readonly, watchEffect, nextTick, toRaw, 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 } from "vue";
4
+ import { computed, unref, getCurrentInstance, reactive, readonly, watchEffect, nextTick, toRaw, defineComponent, useAttrs, openBlock, createBlock, mergeProps, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, createElementVNode, createVNode, normalizeProps, guardReactiveProps, createCommentVNode, ref, toRefs, isVNode, watch, resolveDirective, normalizeStyle, withDirectives, normalizeClass, onMounted, withKeys, createSlots, renderSlot } from "vue";
5
5
  import { useAppStore, isNumber, useI18n, isString, isFunction, error, useSlots, isArray, isUnDef, isBoolean, isNull, dispatchResize, isObject, deepMerge, isNullAndUnDef, useTimeoutFn } from "@dt-frames/core";
6
6
  import { merge, isEqual, omit, cloneDeep, upperFirst, uniqBy, set } from "lodash-es";
7
7
  import { Input as Input$1, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Tooltip, Form, FormItem } from "ant-design-vue";
@@ -297,6 +297,7 @@ const _sfc_main$2 = {
297
297
  const {
298
298
  appConf
299
299
  } = useAppStore();
300
+ const uploadFiles = ref([]);
300
301
  const {
301
302
  schema,
302
303
  formProps
@@ -443,6 +444,9 @@ const _sfc_main$2 = {
443
444
  const [e] = args;
444
445
  const target = e ? e.target : null;
445
446
  const value = target ? isCheck ? target.checked : target.value : e;
447
+ if (component === "Upload") {
448
+ uploadFiles.value = unref(args[1]);
449
+ }
446
450
  if (isString(name)) {
447
451
  props.setFormModel(name, value);
448
452
  } else if (isArray(name)) {
@@ -505,6 +509,7 @@ const _sfc_main$2 = {
505
509
  }
506
510
  if (component === "Upload" && !itemProps.defaultFiles && extraName?.length) {
507
511
  itemProps.defaultFiles = unref(getValues).values?.[extraName[0]];
512
+ itemProps.emitSnippet = true;
508
513
  }
509
514
  itemProps.formValues = unref(getValues);
510
515
  if (["Select", "DatePicker", "MonthPicker", "WeekPicker", "RangePicker"].includes(component)) {
@@ -548,6 +553,8 @@ const _sfc_main$2 = {
548
553
  let rules = cloneDeep(defaultRules);
549
554
  const getRequired = isFunction(required) ? required(unref(getValues).model) : required;
550
555
  function validator(rule, value) {
556
+ if (component === "Upload" && unref(uploadFiles).map((file) => file.fileId).includes(void 0))
557
+ return Promise.resolve();
551
558
  const msg = rule.message || defaultMsg;
552
559
  if (value === void 0 || isNull(value) || Array.isArray(value) && value.length === 0 || typeof value === "string" && value.trim() === "" || typeof value === "object" && Reflect.has(value, "checked") && Reflect.has(value, "halfChecked") && Array.isArray(value.checked) && Array.isArray(value.halfChecked) && value.checked.length === 0 && value.halfChecked.length === 0) {
553
560
  return Promise.reject(msg);
@@ -694,6 +701,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
694
701
  },
695
702
  colspan: {
696
703
  type: Object
704
+ },
705
+ style: {
706
+ type: Object,
707
+ default: () => {
708
+ }
697
709
  }
698
710
  },
699
711
  emits: ["handle-method"],
@@ -717,11 +729,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
717
729
  let style = {
718
730
  textAlign: "right"
719
731
  };
732
+ let gStyle = props.style ?? {};
720
733
  if (props.mode === "dialog") {
721
734
  Object.assign(style, {
722
735
  display: "inline-block"
723
736
  });
724
- return { style };
737
+ return {
738
+ style: {
739
+ ...gStyle,
740
+ ...style
741
+ }
742
+ };
725
743
  } else if (props.mode === null) {
726
744
  Object.assign(style, {
727
745
  display: "flex",
@@ -729,11 +747,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
729
747
  marginBottom: "20px"
730
748
  });
731
749
  return {
732
- style,
750
+ style: {
751
+ ...gStyle,
752
+ ...style
753
+ },
733
754
  span: 24
734
755
  };
735
756
  }
736
- return { style };
757
+ return {
758
+ style: {
759
+ ...props.style,
760
+ ...style
761
+ }
762
+ };
737
763
  });
738
764
  const getAdvanceClass = computed(() => {
739
765
  return [
@@ -969,7 +995,6 @@ function useFormEvents({
969
995
  return;
970
996
  }
971
997
  const names = unref(getSchema).map((item) => item.name).filter(Boolean);
972
- const validKeys = [];
973
998
  Object.keys(values).forEach((key) => {
974
999
  const schema = unref(getSchema).find((item) => item.name === key);
975
1000
  let value = values[key];
@@ -994,12 +1019,10 @@ function useFormEvents({
994
1019
  } else {
995
1020
  formModel[key] = value;
996
1021
  }
997
- validKeys.push(key);
998
1022
  } else {
999
1023
  formModel[key] = value;
1000
1024
  }
1001
1025
  });
1002
- return validateFields(validKeys);
1003
1026
  }
1004
1027
  async function validate(nameList) {
1005
1028
  return await unref(formElRef)?.validate(nameList);
@@ -1399,6 +1422,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1399
1422
  }
1400
1423
  return {
1401
1424
  colspan,
1425
+ style: {
1426
+ marginLeft: "auto"
1427
+ },
1402
1428
  ...{
1403
1429
  showAdvancedButton,
1404
1430
  buttonList