@dt-frames/ui 2.0.17 → 2.0.19

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 (35) 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 +62 -65
  7. package/es/components/form/src/components/FormButtons.d.ts +3056 -4
  8. package/es/components/form/src/components/FormItem.d.ts +3 -4
  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 +8 -8
  12. package/es/components/form/src/types/form.type.d.ts +1 -0
  13. package/es/components/form/src/types/items.type.d.ts +8 -0
  14. package/es/components/modal/index.js +19 -7
  15. package/es/components/modal/index.less +1 -9
  16. package/es/components/source/index.js +20 -10
  17. package/es/components/table/index.js +262 -150
  18. package/es/components/table/index.less +5 -1
  19. package/es/components/table/src/types/table.type.d.ts +1 -0
  20. package/es/components/tree/index.js +59 -57
  21. package/es/components/tree/index.less +6 -0
  22. package/es/components/tree/src/type/tree.d.ts +0 -4
  23. package/es/components/tree/src/utils/tree.d.ts +3 -1
  24. package/es/components/upload/index.js +103 -41
  25. package/es/components/upload/src/basicProps.d.ts +5 -1
  26. package/es/components/upload/src/hooks/useFile.d.ts +7 -6
  27. package/es/components/upload/src/index.d.ts +16 -0
  28. package/es/components/upload/src/type/file.d.ts +9 -2
  29. package/es/components/upload/src/utils/fileSize.d.ts +1 -0
  30. package/es/theme/index.js +149 -97
  31. package/es/theme/index.less +14 -0
  32. package/es/theme/src/components/sider/index.d.ts +1 -1
  33. package/es/theme/src/components/sider/mix-sider.d.ts +1 -1
  34. package/es/theme/src/index.d.ts +1 -1
  35. 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";
@@ -169,14 +169,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
169
169
  };
170
170
  }
171
171
  });
172
- const _export_sfc = (sfc, props) => {
173
- const target = sfc.__vccOpts || sfc;
174
- for (const [key, val] of props) {
175
- target[key] = val;
176
- }
177
- return target;
178
- };
179
- const RadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/radioButton.vue"]]);
180
172
  const _hoisted_1$1 = { class: "input-with-dialog" };
181
173
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
182
174
  __name: "formInputUseDialog",
@@ -213,15 +205,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
213
205
  key: 0,
214
206
  class: "i mdi:close-circle",
215
207
  onClick: clearProps
216
- })) : createCommentVNode("v-if", true)
208
+ })) : createCommentVNode("", true)
217
209
  ]);
218
210
  };
219
211
  }
220
212
  });
221
- const DtFormInputDialog = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/formInputUseDialog.vue"]]);
222
213
  const components = {
223
214
  Input: Input$1,
224
- InputWithDialog: DtFormInputDialog,
215
+ InputWithDialog: _sfc_main$3,
225
216
  InputTextArea: Input$1.TextArea,
226
217
  InputSearch: Input$1.Search,
227
218
  InputGroup: Input$1.Group,
@@ -230,7 +221,7 @@ const components = {
230
221
  TreeSelect,
231
222
  Radio,
232
223
  RadioGroup: Radio.Group,
233
- RadioButtonGroup,
224
+ RadioButtonGroup: _sfc_main$4,
234
225
  Checkbox,
235
226
  CheckboxGroup: Checkbox.Group,
236
227
  AutoComplete,
@@ -282,7 +273,6 @@ const _sfc_main$2 = {
282
273
  }
283
274
  },
284
275
  setup(props, {
285
- emit,
286
276
  slots
287
277
  }) {
288
278
  const {
@@ -297,6 +287,7 @@ const _sfc_main$2 = {
297
287
  const {
298
288
  appConf
299
289
  } = useAppStore();
290
+ const uploadFiles = ref([]);
300
291
  const {
301
292
  schema,
302
293
  formProps
@@ -358,7 +349,8 @@ const _sfc_main$2 = {
358
349
  name,
359
350
  colon = appConf.ui.form.colon,
360
351
  suffix,
361
- prefix
352
+ prefix,
353
+ description
362
354
  } = props.schema;
363
355
  const {
364
356
  labelCol,
@@ -398,7 +390,9 @@ const _sfc_main$2 = {
398
390
  "style": "flex:1; width: 100%;"
399
391
  }, [getContent()]), !!suffix && createVNode("span", {
400
392
  "class": "suffix px-2"
401
- }, [getSuffix()])])]
393
+ }, [getSuffix()])]), description && createVNode("div", {
394
+ "class": "opacity-50 text-12"
395
+ }, [description])]
402
396
  });
403
397
  }
404
398
  function renderLabel() {
@@ -408,7 +402,7 @@ const _sfc_main$2 = {
408
402
  subLabel,
409
403
  toolTipProps = {}
410
404
  } = props.schema;
411
- const renderLabel2 = subLabel ? createVNode("span", null, [createTextVNode(" "), label, createTextVNode(" "), createVNode("span", {
405
+ const renderLabel2 = subLabel ? createVNode("span", null, [" ", label, createTextVNode(" "), createVNode("span", {
412
406
  "class": "text-secondary opacity-50"
413
407
  }, [createTextVNode("("), subLabel, createTextVNode(")")])]) : label;
414
408
  const _toolTip = isFunction(toolTip) ? toolTip(unref(getValues).model) : toolTip;
@@ -443,13 +437,17 @@ const _sfc_main$2 = {
443
437
  const [e] = args;
444
438
  const target = e ? e.target : null;
445
439
  const value = target ? isCheck ? target.checked : target.value : e;
440
+ if (component === "Upload") {
441
+ uploadFiles.value = unref(args[1]);
442
+ }
446
443
  if (isString(name)) {
447
444
  props.setFormModel(name, value);
448
445
  } else if (isArray(name)) {
449
446
  name.map((key) => props.setFormModel(key, value));
450
447
  }
451
- if (_sProps && _sProps[eventKey])
448
+ if (_sProps && _sProps[eventKey]) {
452
449
  _sProps[eventKey](...args, formModel);
450
+ }
453
451
  }
454
452
  };
455
453
  for (let it in _sProps) {
@@ -470,10 +468,12 @@ const _sfc_main$2 = {
470
468
  disabled: itemDisabled = false
471
469
  } = unref(getComponentProps);
472
470
  let _disabled = !!gDisabled || itemDisabled;
473
- if (isBoolean(disabled))
471
+ if (isBoolean(disabled)) {
474
472
  _disabled = disabled;
475
- if (isFunction(disabled))
473
+ }
474
+ if (isFunction(disabled)) {
476
475
  _disabled = disabled(unref(getValues).model);
476
+ }
477
477
  return _disabled;
478
478
  });
479
479
  const getSize = () => {
@@ -492,10 +492,8 @@ const _sfc_main$2 = {
492
492
  disabled: unref(getDisable)
493
493
  };
494
494
  if (component === "Select") {
495
- {
496
- itemProps.showSearch = true;
497
- itemProps.optionFilterProp = "label";
498
- }
495
+ itemProps.showSearch = true;
496
+ itemProps.optionFilterProp = "label";
499
497
  }
500
498
  if (component !== "RangePicker") {
501
499
  itemProps.placeholder = unref(getComponentProps)?.placeholder || createPlaceholder(component);
@@ -505,6 +503,7 @@ const _sfc_main$2 = {
505
503
  }
506
504
  if (component === "Upload" && !itemProps.defaultFiles && extraName?.length) {
507
505
  itemProps.defaultFiles = unref(getValues).values?.[extraName[0]];
506
+ itemProps.emitSnippet = true;
508
507
  }
509
508
  itemProps.formValues = unref(getValues);
510
509
  if (["Select", "DatePicker", "MonthPicker", "WeekPicker", "RangePicker"].includes(component)) {
@@ -539,8 +538,9 @@ const _sfc_main$2 = {
539
538
  dynamicRules,
540
539
  required
541
540
  } = props.schema;
542
- if (!component)
541
+ if (!component) {
543
542
  return [];
543
+ }
544
544
  if (isFunction(dynamicRules)) {
545
545
  return dynamicRules(unref(getValues).model);
546
546
  }
@@ -548,6 +548,9 @@ const _sfc_main$2 = {
548
548
  let rules = cloneDeep(defaultRules);
549
549
  const getRequired = isFunction(required) ? required(unref(getValues).model) : required;
550
550
  function validator(rule, value) {
551
+ if (component === "Upload" && unref(uploadFiles).map((file) => file.fileId).includes(void 0)) {
552
+ return Promise.resolve();
553
+ }
551
554
  const msg = rule.message || defaultMsg;
552
555
  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
556
  return Promise.reject(msg);
@@ -648,7 +651,6 @@ const _sfc_main$2 = {
648
651
  };
649
652
  }
650
653
  };
651
- const DtFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/FormItem.vue"]]);
652
654
  const _hoisted_1 = {
653
655
  key: 0,
654
656
  className: "preIcon pr-1"
@@ -815,18 +817,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
815
817
  icon: withCtx(() => [
816
818
  button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1, null, 512)), [
817
819
  [_directive_icon, button.preIcon]
818
- ]) : createCommentVNode("v-if", true)
820
+ ]) : createCommentVNode("", true)
819
821
  ]),
820
822
  default: withCtx(() => [
821
823
  createTextVNode(" " + toDisplayString(unref(t)(button.label)) + " ", 1),
822
824
  button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2, null, 512)), [
823
825
  [_directive_icon, button.postIcon]
824
- ]) : createCommentVNode("v-if", true)
826
+ ]) : createCommentVNode("", true)
825
827
  ]),
826
828
  _: 2
827
829
  }, 1032, ["type", "class", "loading", "disabled", "onClick"])), [
828
830
  [_directive_auth, getAuth(button.auth)]
829
- ]) : createCommentVNode("v-if", true)
831
+ ]) : createCommentVNode("", true)
830
832
  ], 64);
831
833
  }), 256)),
832
834
  unref(showAdvanceRef) ? (openBlock(), createBlock(_component_AButton, {
@@ -836,24 +838,22 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
836
838
  onClick: toggleAdvanced
837
839
  }, {
838
840
  default: withCtx(() => [
839
- createCommentVNode(" \u6536\u8D77 | \u5C55\u5F00 "),
840
841
  createElementVNode("span", _hoisted_3, toDisplayString(advancedRef.value ? unref(t)("UI.ADVANCED") : unref(t)("UI.EXPAND")), 1),
841
842
  createElementVNode("span", {
842
843
  class: normalizeClass(unref(getAdvanceClass))
843
844
  }, _hoisted_5, 2)
844
845
  ]),
845
846
  _: 1
846
- })) : createCommentVNode("v-if", true)
847
+ })) : createCommentVNode("", true)
847
848
  ]),
848
849
  _: 1
849
850
  }, 8, ["style"])
850
851
  ]),
851
852
  _: 1
852
- }, 16)) : createCommentVNode("v-if", true);
853
+ }, 16)) : createCommentVNode("", true);
853
854
  };
854
855
  }
855
856
  });
856
- const DtFormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/FormButtons.vue"]]);
857
857
  const SEARCH_BTN_NAME = "UI.SEARCH";
858
858
  const RESET_BTN_NAME = "UI.RESET";
859
859
  const SEARCH_BTNS = [
@@ -954,22 +954,22 @@ function useFormEvents({
954
954
  schemaRef.value = schemaList;
955
955
  }
956
956
  function _removeSchemaByName(name, schemaList) {
957
- const index2 = schemaList.findIndex((schema) => schema.name === name);
958
- if (index2 !== -1) {
957
+ const index = schemaList.findIndex((schema) => schema.name === name);
958
+ if (index !== -1) {
959
959
  delete formModel[name];
960
- schemaList.splice(index2, 1);
960
+ schemaList.splice(index, 1);
961
961
  }
962
962
  }
963
963
  function appendFormItems(schema, prefixName, first = false) {
964
964
  const schemaList = cloneDeep(unref(getSchema));
965
- const index2 = schemaList.findIndex((schema2) => schema2.name === prefixName);
966
- if (!prefixName || index2 === -1 || first) {
965
+ const index = schemaList.findIndex((schema2) => schema2.name === prefixName);
966
+ if (!prefixName || index === -1 || first) {
967
967
  first ? schemaList.unshift(...schema) : schemaList.push(...schema);
968
968
  schemaRef.value = schemaList;
969
969
  return;
970
970
  }
971
- if (index2 !== -1) {
972
- schemaList.splice(index2 + 1, 0, ...schema);
971
+ if (index !== -1) {
972
+ schemaList.splice(index + 1, 0, ...schema);
973
973
  }
974
974
  schemaRef.value = schemaList;
975
975
  }
@@ -988,7 +988,6 @@ function useFormEvents({
988
988
  return;
989
989
  }
990
990
  const names = unref(getSchema).map((item) => item.name).filter(Boolean);
991
- const validKeys = [];
992
991
  Object.keys(values).forEach((key) => {
993
992
  const schema = unref(getSchema).find((item) => item.name === key);
994
993
  let value = values[key];
@@ -1013,12 +1012,10 @@ function useFormEvents({
1013
1012
  } else {
1014
1013
  formModel[key] = value;
1015
1014
  }
1016
- validKeys.push(key);
1017
1015
  } else {
1018
1016
  formModel[key] = value;
1019
1017
  }
1020
1018
  });
1021
- return validateFields(validKeys);
1022
1019
  }
1023
1020
  async function validate(nameList) {
1024
1021
  return await unref(formElRef)?.validate(nameList);
@@ -1098,7 +1095,7 @@ function useFormValues({
1098
1095
  if (isArray(defaultValue2)) {
1099
1096
  let vals = defaultValue2.map((it) => format ? dayjs(it, format) : dayjs(it));
1100
1097
  if (names.length > 1) {
1101
- names.map((key, index2) => obj[key] = vals[index2] ?? null);
1098
+ names.map((key, index) => obj[key] = vals[index] ?? null);
1102
1099
  } else {
1103
1100
  obj[names[0]] = vals;
1104
1101
  }
@@ -1107,11 +1104,11 @@ function useFormValues({
1107
1104
  }
1108
1105
  } else {
1109
1106
  if (names.length > 1) {
1110
- names.forEach((key, index2) => {
1111
- if (!defaultValue2 || defaultValue2.length - 1 < index2) {
1107
+ names.forEach((key, index) => {
1108
+ if (!defaultValue2 || defaultValue2.length - 1 < index) {
1112
1109
  obj[key] = null;
1113
1110
  } else {
1114
- obj[key] = defaultValue2[index2];
1111
+ obj[key] = defaultValue2[index];
1115
1112
  }
1116
1113
  });
1117
1114
  } else {
@@ -1120,7 +1117,7 @@ function useFormValues({
1120
1117
  }
1121
1118
  } else {
1122
1119
  names.map((it) => {
1123
- if (component === "TreeSelect" || (mode === "multiple" || treeCheckable) || component === "Select" && mode === "multiple") {
1120
+ if (component === "TreeSelect" && (mode === "multiple" || treeCheckable) || component === "Select" && mode === "multiple") {
1124
1121
  obj[it] = [];
1125
1122
  } else {
1126
1123
  obj[it] = null;
@@ -1149,8 +1146,8 @@ function useFormActions(opt) {
1149
1146
  } = unref(getProps);
1150
1147
  let schema = [...schemas];
1151
1148
  if (showAdvancedButton) {
1152
- schema = schemas.reduce((t, it, index2) => {
1153
- if (index2 > minShowColumn - 1)
1149
+ schema = schemas.reduce((t, it, index) => {
1150
+ if (index > minShowColumn - 1)
1154
1151
  it.isAdvanced = isAdvanced;
1155
1152
  t.push(it);
1156
1153
  return t;
@@ -1334,7 +1331,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1334
1331
  formModel[key] = value;
1335
1332
  const { validateTrigger } = unref(getBindValue);
1336
1333
  if (!validateTrigger || validateTrigger === "change") {
1337
- validateFields([key]).catch((err) => {
1334
+ validateFields([key]).catch(() => {
1338
1335
  });
1339
1336
  }
1340
1337
  }
@@ -1419,7 +1416,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1419
1416
  return {
1420
1417
  colspan,
1421
1418
  style: {
1422
- marginLeft: "auto"
1419
+ marginLeft: showAdvancedButton ? "auto" : ""
1423
1420
  },
1424
1421
  ...{
1425
1422
  showAdvancedButton,
@@ -1455,10 +1452,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1455
1452
  );
1456
1453
  watch(
1457
1454
  () => unref(getProps).model,
1458
- (v) => {
1455
+ () => {
1459
1456
  const { model } = unref(getProps);
1460
- if (!model || !Object.keys(model).length)
1457
+ if (!model || !Object.keys(model).length) {
1461
1458
  return;
1459
+ }
1462
1460
  setFormValues(model);
1463
1461
  },
1464
1462
  {
@@ -1483,14 +1481,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1483
1481
  } }), {
1484
1482
  default: withCtx(() => [
1485
1483
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSchema), (schema) => {
1486
- return openBlock(), createBlock(unref(DtFormItem), {
1484
+ return openBlock(), createBlock(unref(_sfc_main$2), {
1487
1485
  key: schema.name,
1488
1486
  schema,
1489
- formProps: unref(getProps),
1490
- formModel,
1491
- defaultValues: defaultValue.value,
1492
- setFormModel,
1493
- formActionType: formActionMethods
1487
+ "form-props": unref(getProps),
1488
+ "form-model": formModel,
1489
+ "default-values": defaultValue.value,
1490
+ "set-form-model": setFormModel,
1491
+ "form-action-type": formActionMethods
1494
1492
  }, createSlots({ _: 2 }, [
1495
1493
  renderList(Object.keys(_ctx.$slots), (item) => {
1496
1494
  return {
@@ -1500,9 +1498,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1500
1498
  ])
1501
1499
  };
1502
1500
  })
1503
- ]), 1032, ["schema", "formProps", "formModel", "defaultValues"]);
1501
+ ]), 1032, ["schema", "form-props", "form-model", "default-values"]);
1504
1502
  }), 128)),
1505
- unref(getActionsProps).buttonList?.length ? (openBlock(), createBlock(unref(DtFormButtons), mergeProps({ key: 0 }, unref(getActionsProps), { onHandleMethod: unref(handleMethod) }), null, 16, ["onHandleMethod"])) : createCommentVNode("v-if", true)
1503
+ unref(getActionsProps).buttonList?.length ? (openBlock(), createBlock(unref(_sfc_main$1), mergeProps({ key: 0 }, unref(getActionsProps), { onHandleMethod: unref(handleMethod) }), null, 16, ["onHandleMethod"])) : createCommentVNode("", true)
1506
1504
  ]),
1507
1505
  _: 3
1508
1506
  }, 16)
@@ -1512,7 +1510,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1512
1510
  };
1513
1511
  }
1514
1512
  });
1515
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/index.vue"]]);
1516
1513
  function useForm(props) {
1517
1514
  const formRef = ref(null);
1518
1515
  const loadedRef = ref(false);
@@ -1584,7 +1581,7 @@ function useForm(props) {
1584
1581
  return [register, methods];
1585
1582
  }
1586
1583
  export {
1587
- index as DtForm,
1588
- DtFormButtons,
1584
+ _sfc_main as DtForm,
1585
+ _sfc_main$1 as DtFormButtons,
1589
1586
  useForm
1590
1587
  };