@a2simcode/dui 0.0.12 → 0.0.13

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.
@@ -1,3 +1,4 @@
1
+ import { FormSchemaConfig } from '../../../components/form/src/interface';
1
2
  import { DesignComponent } from '../../drag/src/interface';
2
3
  import { FormDeisgnSaveComponent, FormDesignComponent } from './interface';
3
4
  export declare const toFormSchema: (data: {
@@ -6,7 +7,7 @@ export declare const toFormSchema: (data: {
6
7
  components: FormDeisgnSaveComponent[];
7
8
  }) => {
8
9
  formConfig: Record<string, any>;
9
- componentList: SchemaConfig[];
10
+ componentList: FormSchemaConfig[];
10
11
  };
11
12
  export declare const toFormDesignSchema: (data: Record<string, any>, componentsMap: Record<string, FormDesignComponent>) => {
12
13
  formConfig: Record<string, any>;
package/dist/dui.es.js CHANGED
@@ -14105,23 +14105,24 @@ const Qy = { class: "d-layout" }, e0 = ["gs-id", "gs-x", "gs-y", "gs-w", "gs-h",
14105
14105
  });
14106
14106
  }, d0 = (t) => {
14107
14107
  const e = {}, n = {};
14108
- return t.forEach((o) => {
14108
+ return console.log(t, "list"), t.forEach((o) => {
14109
14109
  e[o.containerId] = e[o.containerId] || [];
14110
14110
  const i = {
14111
14111
  id: o.id,
14112
14112
  type: o.runtimeType,
14113
14113
  slot: o.groupId,
14114
- config: {},
14115
- rule: []
14114
+ config: {
14115
+ rule: []
14116
+ }
14116
14117
  };
14117
14118
  o.config && Object.keys(o.config).forEach((r) => {
14118
14119
  if (r === "required") {
14119
- o.config.required && i.rule?.push({ required: !0, message: o.config.requiredMsg || "请输入" });
14120
+ o.config.required && i.config?.rule?.push({ required: !0, message: o.config.requiredMsg || "请输入" });
14120
14121
  return;
14121
14122
  }
14122
14123
  if (r === "patterns") {
14123
14124
  o.config.patterns.forEach((s) => {
14124
- s.reg && s.msg && i.rule?.push({
14125
+ s.reg && s.msg && i.config?.rule?.push({
14125
14126
  pattern: new RegExp(s.reg),
14126
14127
  message: `请输入${s.msg || ""}`
14127
14128
  });
@@ -14131,7 +14132,24 @@ const Qy = { class: "d-layout" }, e0 = ["gs-id", "gs-x", "gs-y", "gs-w", "gs-h",
14131
14132
  i.config[r] = o.config[r];
14132
14133
  }), o.type === "pkey" && (i.config.isPkey = !0), e[o.containerId].push(i), n[o.id] = i;
14133
14134
  }), Object.keys(e).forEach((o) => {
14134
- n[o] && (n[o].children = e[o]);
14135
+ if (n[o]) {
14136
+ const i = n[o], r = e[o];
14137
+ if (["j-tabs", "j-collapse"].includes(i.type || "") && i.config?.groups) {
14138
+ const s = [];
14139
+ i.config.groups.forEach((a) => {
14140
+ const c = r.filter(
14141
+ (l) => l.slot === a.i
14142
+ );
14143
+ s.push({
14144
+ config: {
14145
+ name: a.label,
14146
+ children: c
14147
+ }
14148
+ });
14149
+ }), i.children = s;
14150
+ } else
14151
+ i.children = r;
14152
+ }
14135
14153
  }), e.form;
14136
14154
  };
14137
14155
  function f0(t) {