@a2simcode/dui 0.0.62 → 0.0.63

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.
@@ -20,9 +20,4 @@ export declare const toFormSaveSchema: (formConfig: Record<string, any>, compone
20
20
  components: FormDeisgnSaveComponent[];
21
21
  db: Record<string, any>;
22
22
  };
23
- /**
24
- * 转化方法,转化成具体运行的表单json数据
25
- * @param list
26
- * @returns
27
- */
28
- export declare const formToRuntimeFrom: (list: FormDeisgnSaveComponent[]) => FormSchemaConfig[];
23
+ export declare const toRuntimeFrom: (list: FormDeisgnSaveComponent[]) => FormSchemaConfig[];
@@ -7,9 +7,9 @@ import { default as DDraggable } from './draggable';
7
7
  import { default as DFormDesign } from './formDesign';
8
8
  import { default as DIndexDesign } from './indexDesign';
9
9
  import { default as DBiDesign } from './biDesign';
10
- import { toFormSchema, toFormDesignSchema, toFormSaveSchema, formToRuntimeFrom } from './formDesign/src/utils';
10
+ import { toFormSchema, toFormDesignSchema, toFormSaveSchema, toRuntimeFrom } from './formDesign/src/utils';
11
11
  export { DDrag, dragTool, dragContainer, dragFormList, dragIndexList, DFlowDesign, DInputFlow, DLayout, DDraggable, DFormDesign, DIndexDesign, DBiDesign, };
12
- export { toFormSchema, toFormDesignSchema, toFormSaveSchema, formToRuntimeFrom };
12
+ export { toFormSchema, toFormDesignSchema, toFormSaveSchema, toRuntimeFrom };
13
13
  declare const _default: {
14
14
  install: (app: App, ...options: any[]) => any;
15
15
  };
package/dist/dui.es.js CHANGED
@@ -11170,6 +11170,35 @@ var Q0 = { class: "d-layout" }, U0 = [
11170
11170
  } else r.children = s;
11171
11171
  }
11172
11172
  }), A.form;
11173
+ }, BF = (e) => {
11174
+ const A = [];
11175
+ return e.forEach((t) => {
11176
+ const n = {
11177
+ id: t.id,
11178
+ type: t.runtimeType,
11179
+ slot: t.groupId,
11180
+ config: { rule: [] }
11181
+ };
11182
+ t.config && Object.keys(t.config).forEach((r) => {
11183
+ if (r === "required") {
11184
+ t.config.required && n.config?.rule?.push({
11185
+ required: !0,
11186
+ message: t.config.requiredMsg || "请输入"
11187
+ });
11188
+ return;
11189
+ }
11190
+ if (r === "patterns") {
11191
+ t.config.patterns.forEach((s) => {
11192
+ s.reg && s.msg && n.config?.rule?.push({
11193
+ pattern: new RegExp(s.reg),
11194
+ message: `请输入${s.msg || ""}`
11195
+ });
11196
+ });
11197
+ return;
11198
+ }
11199
+ n.config[r] = t.config[r];
11200
+ }), t.type === "pkey" && (n.config.isPkey = !0), A.push(n);
11201
+ }), A;
11173
11202
  }, Ad = (e, A, t, n, r, s, u, c) => {
11174
11203
  const f = gA(), g = Sr({}), h = yA(() => {
11175
11204
  const U = [];
@@ -17979,7 +18008,7 @@ var kU = /* @__PURE__ */ vo(OU, [["render", RU]]), PU = /* @__PURE__ */ sp(((e,
17979
18008
  const t = A.name;
17980
18009
  t && e.component(t, A);
17981
18010
  }));
17982
- }, BF = { install: fF };
18011
+ }, pF = { install: fF };
17983
18012
  export {
17984
18013
  cF as DBiDesign,
17985
18014
  Fp as DDrag,
@@ -17989,13 +18018,13 @@ export {
17989
18018
  vU as DIndexDesign,
17990
18019
  v0 as DInputFlow,
17991
18020
  b0 as DLayout,
17992
- BF as default,
18021
+ pF as default,
17993
18022
  Ku as dragContainer,
17994
18023
  Ru as dragFormList,
17995
18024
  ku as dragIndexList,
17996
18025
  Ou as dragTool,
17997
- M0 as formToRuntimeFrom,
17998
18026
  N0 as toFormDesignSchema,
17999
18027
  gs as toFormSaveSchema,
18000
- T0 as toFormSchema
18028
+ T0 as toFormSchema,
18029
+ BF as toRuntimeFrom
18001
18030
  };