@nocobase/client 1.5.0-beta.13 → 1.5.0-beta.14

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.
package/es/index.mjs CHANGED
@@ -19809,19 +19809,13 @@ const useDateVariable = ({ operator: e, schema: t, noDisabled: n }) => {
19809
19809
  /** 变量的值 */
19810
19810
  currentUserCtx: (c = a == null ? void 0 : a.data) == null ? void 0 : c.data
19811
19811
  };
19812
- }, useCurrentFormData = () => {
19813
- var t, n;
19814
- const e = useDataBlockRequestData();
19815
- if (!(((t = e == null ? void 0 : e.data) == null ? void 0 : t.length) > 1))
19816
- return ((n = e == null ? void 0 : e.data) == null ? void 0 : n[0]) || (e == null ? void 0 : e.data);
19817
19812
  }, useCurrentFormContext = ({ form: e } = {}) => {
19818
- var i;
19819
- const { form: t } = useFormBlockContext(), n = useCurrentFormData(), { isVariableParsedInOtherContext: o } = useFlag(), r = e || t;
19813
+ const { form: t } = useFormBlockContext(), { isVariableParsedInOtherContext: n } = useFlag(), o = e || t;
19820
19814
  return {
19821
19815
  /** 变量值 */
19822
- currentFormCtx: (r == null ? void 0 : r.readPretty) === !1 && (r != null && r.values) && ((i = Object.keys(r == null ? void 0 : r.values)) != null && i.length) ? r == null ? void 0 : r.values : n || (r == null ? void 0 : r.values),
19816
+ currentFormCtx: o == null ? void 0 : o.values,
19823
19817
  /** 用来判断是否可以显示`当前表单`变量 */
19824
- shouldDisplayCurrentForm: r && !r.readPretty && !o
19818
+ shouldDisplayCurrentForm: o && !o.readPretty && !n
19825
19819
  };
19826
19820
  }, useCurrentFormVariable = ({
19827
19821
  collectionField: e,
@@ -34809,7 +34803,7 @@ function addAppVersion(e, t) {
34809
34803
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
34810
34804
  }), e;
34811
34805
  }
34812
- const name = "@nocobase/client", version = "1.5.0-beta.13", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
34806
+ const name = "@nocobase/client", version = "1.5.0-beta.14", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
34813
34807
  "@ahooksjs/use-url-state": "3.5.1",
34814
34808
  "@ant-design/cssinjs": "^1.11.1",
34815
34809
  "@ant-design/icons": "^5.1.4",
@@ -34831,9 +34825,9 @@ const name = "@nocobase/client", version = "1.5.0-beta.13", license = "AGPL-3.0"
34831
34825
  "@formily/reactive-react": "^2.2.27",
34832
34826
  "@formily/shared": "^2.2.27",
34833
34827
  "@formily/validator": "^2.2.27",
34834
- "@nocobase/evaluators": "1.5.0-beta.13",
34835
- "@nocobase/sdk": "1.5.0-beta.13",
34836
- "@nocobase/utils": "1.5.0-beta.13",
34828
+ "@nocobase/evaluators": "1.5.0-beta.14",
34829
+ "@nocobase/sdk": "1.5.0-beta.14",
34830
+ "@nocobase/utils": "1.5.0-beta.14",
34837
34831
  ahooks: "^3.7.2",
34838
34832
  antd: "5.12.8",
34839
34833
  "antd-style": "3.7.1",
@@ -36445,45 +36439,49 @@ const useFormBlockHeight = () => {
36445
36439
  n["x-linkage-rules"] && (t = n["x-linkage-rules"]);
36446
36440
  }), t;
36447
36441
  }, WithForm = (e) => {
36448
- var c, u;
36449
- const { form: t } = e, n = useFieldSchema(), { setFormValueChanged: o } = useActionContext(), r = useVariables$1(), i = useLocalVariables$1({ currentForm: t }), { templateFinished: a } = useTemplateBlockContext(), l = ((u = getLinkageRules(n) || ((c = n.parent) == null ? void 0 : c["x-linkage-rules"])) == null ? void 0 : u.filter((d) => !d.disabled)) || [];
36442
+ var u, d;
36443
+ const { form: t } = e, n = useFieldSchema(), { setFormValueChanged: o } = useActionContext(), r = useVariables$1(), i = useLocalVariables$1({ currentForm: t }), { templateFinished: a } = useTemplateBlockContext(), { loading: l } = useDataBlockRequest() || {}, c = ((d = getLinkageRules(n) || ((u = n.parent) == null ? void 0 : u["x-linkage-rules"])) == null ? void 0 : d.filter((p) => !p.disabled)) || [];
36450
36444
  return useEffect(() => {
36451
- const d = uid();
36452
- return t.addEffects(d, () => {
36445
+ const p = uid();
36446
+ return t.addEffects(p, () => {
36453
36447
  onFormInputChange(() => {
36454
36448
  o == null || o(!0);
36455
36449
  });
36456
36450
  }), e.disabled && (t.disabled = e.disabled), () => {
36457
- t.removeEffects(d);
36451
+ t.removeEffects(p);
36458
36452
  };
36459
36453
  }, [t, e.disabled, o]), useEffect(() => {
36460
- const d = uid(), p = [];
36461
- return t.addEffects(d, () => {
36462
- forEachLinkageRule(l, (m, h) => {
36463
- var g;
36464
- if ((g = m.targetFields) != null && g.length) {
36465
- const f = m.targetFields.join(",");
36466
- onFieldInit(`*(${f})`, (C, b) => {
36467
- p.push(
36468
- bindLinkageRulesToFiled({
36469
- field: C,
36470
- linkageRules: l,
36471
- formValues: b.values,
36472
- localVariables: i,
36473
- action: m,
36474
- rule: h,
36475
- variables: r
36476
- })
36477
- );
36478
- });
36479
- }
36454
+ if (l)
36455
+ return;
36456
+ const p = uid(), m = [];
36457
+ return setTimeout(() => {
36458
+ t.addEffects(p, () => {
36459
+ forEachLinkageRule(c, (h, g) => {
36460
+ var f;
36461
+ if ((f = h.targetFields) != null && f.length) {
36462
+ const C = h.targetFields.join(",");
36463
+ onFieldInit(`*(${C})`, (b, S) => {
36464
+ m.push(
36465
+ bindLinkageRulesToFiled({
36466
+ field: b,
36467
+ linkageRules: c,
36468
+ formValues: S.values,
36469
+ localVariables: i,
36470
+ action: h,
36471
+ rule: g,
36472
+ variables: r
36473
+ })
36474
+ );
36475
+ });
36476
+ }
36477
+ });
36480
36478
  });
36481
36479
  }), () => {
36482
- t.removeEffects(d), p.forEach((m) => {
36483
- m();
36480
+ t.removeEffects(p), m.forEach((h) => {
36481
+ h();
36484
36482
  });
36485
36483
  };
36486
- }, [l, a]), n["x-decorator"] === "FormV2" ? /* @__PURE__ */ jsx(FormDecorator, x({}, e)) : /* @__PURE__ */ jsx(FormComponent, x({}, e));
36484
+ }, [c, a, l]), n["x-decorator"] === "FormV2" ? /* @__PURE__ */ jsx(FormDecorator, x({}, e)) : /* @__PURE__ */ jsx(FormComponent, x({}, e));
36487
36485
  }, WithoutForm = (e) => {
36488
36486
  const t = useFieldSchema(), { setFormValueChanged: n } = useActionContext(), o = useMemo(
36489
36487
  () => createForm({
@@ -29,11 +29,5 @@ export declare const conditionAnalyses: ({ ruleGroup, variables, localVariables,
29
29
  */
30
30
  variableNameOfLeftCondition?: string;
31
31
  }) => Promise<boolean>;
32
- /**
33
- * 转化成变量字符串,方便解析出值
34
- * @param targetField
35
- * @returns
36
- */
37
- export declare function targetFieldToVariableString(targetField: string[], variableName?: string): string;
38
32
  export declare function getRenderContent(templateEngine: any, content: any, variables: any, localVariables: any, defaultParse: any): Promise<any>;
39
33
  export {};