@nocobase/client 1.2.16-alpha → 1.2.19-alpha

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.
@@ -54,7 +54,7 @@ export declare const useFormBlockContext: () => {
54
54
  /**
55
55
  * @internal
56
56
  */
57
- export declare const useFormBlockProps: () => {
57
+ export declare const useFormBlockProps: (shouldClearInitialValues?: boolean) => {
58
58
  form: any;
59
59
  };
60
60
  /**
package/es/index.mjs CHANGED
@@ -3941,7 +3941,7 @@ function addAppVersion(e, t) {
3941
3941
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
3942
3942
  }), e;
3943
3943
  }
3944
- const name = "@nocobase/client", version$1 = "1.2.16-alpha", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
3944
+ const name = "@nocobase/client", version$1 = "1.2.19-alpha", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
3945
3945
  "@ahooksjs/use-url-state": "3.5.1",
3946
3946
  "@ant-design/cssinjs": "^1.11.1",
3947
3947
  "@ant-design/icons": "^5.1.4",
@@ -3962,9 +3962,9 @@ const name = "@nocobase/client", version$1 = "1.2.16-alpha", license = "AGPL-3.0
3962
3962
  "@formily/reactive-react": "^2.2.27",
3963
3963
  "@formily/shared": "^2.2.27",
3964
3964
  "@formily/validator": "^2.2.27",
3965
- "@nocobase/evaluators": "1.2.16-alpha",
3966
- "@nocobase/sdk": "1.2.16-alpha",
3967
- "@nocobase/utils": "1.2.16-alpha",
3965
+ "@nocobase/evaluators": "1.2.19-alpha",
3966
+ "@nocobase/sdk": "1.2.19-alpha",
3967
+ "@nocobase/utils": "1.2.19-alpha",
3968
3968
  ahooks: "^3.7.2",
3969
3969
  antd: "^5.12.8",
3970
3970
  "antd-style": "3.4.5",
@@ -4819,19 +4819,22 @@ const InternalFormBlockProvider = (e) => {
4819
4819
  children: /* @__PURE__ */ jsx(FormActiveFieldsProvider, { name: "form", children: /* @__PURE__ */ jsx(InternalFormBlockProvider, g({}, e)) })
4820
4820
  })
4821
4821
  ) });
4822
- }), useFormBlockContext = () => useContext(FormBlockContext$1), useFormBlockProps$1 = () => {
4823
- var r, i;
4824
- const e = useFormBlockContext(), t = useTreeParentRecord(), { fieldSchema: o } = useActionContext(), n = (r = o == null ? void 0 : o["x-component-props"]) == null ? void 0 : r.addChild;
4822
+ }), useFormBlockContext = () => useContext(FormBlockContext$1), useFormBlockProps$1 = (e = !1) => {
4823
+ var i, a;
4824
+ const t = useFormBlockContext(), o = useTreeParentRecord(), { fieldSchema: n } = useActionContext(), r = (i = n == null ? void 0 : n["x-component-props"]) == null ? void 0 : i.addChild;
4825
4825
  return useEffect(() => {
4826
- var a;
4827
- n && ((a = e.form) == null || a.query("parent").take((l) => {
4828
- l.disabled = !0, l.value = t;
4826
+ var l;
4827
+ r && ((l = t.form) == null || l.query("parent").take((c) => {
4828
+ c.disabled = !0, c.value = o;
4829
4829
  }));
4830
4830
  }), useEffect(() => {
4831
- var a, l, c, u;
4832
- (a = e == null ? void 0 : e.service) != null && a.loading || (u = e.form) == null || u.setInitialValues((c = (l = e.service) == null ? void 0 : l.data) == null ? void 0 : c.data);
4833
- }, [(i = e == null ? void 0 : e.service) == null ? void 0 : i.loading]), {
4834
- form: e.form
4831
+ var l, c, u;
4832
+ if (!((l = t == null ? void 0 : t.service) != null && l.loading)) {
4833
+ const d = t.form;
4834
+ d && (e && (d.initialValues = {}), d.setInitialValues((u = (c = t.service) == null ? void 0 : c.data) == null ? void 0 : u.data));
4835
+ }
4836
+ }, [(a = t == null ? void 0 : t.service) == null ? void 0 : a.loading]), {
4837
+ form: t.form
4835
4838
  };
4836
4839
  }, findFormBlock = (e) => {
4837
4840
  for (; e; ) {
@@ -11163,7 +11166,7 @@ function useFormBlockParams() {
11163
11166
  return useParamsFromRecord();
11164
11167
  }
11165
11168
  function useEditFormBlockProps() {
11166
- return useFormBlockProps$1();
11169
+ return useFormBlockProps$1(!0);
11167
11170
  }
11168
11171
  function useGridCardBlockParams(e) {
11169
11172
  const { params: t } = e, { filter: o, parseVariableLoading: n } = useParsedFilter({
@@ -32109,7 +32112,7 @@ const AppendsTreeSelect = (e) => {
32109
32112
  }, InternalAssociationSelect$1 = observer$1(
32110
32113
  (e) => {
32111
32114
  var k;
32112
- const I = e, { objectValue: t = !0, addMode: o } = I, n = H(I, ["objectValue", "addMode"]), r = useField(), i = useFieldSchema(), a = useServiceOptions$1(e), { options: l } = useAssociationFieldContext(), c = isVariable(e.value) ? void 0 : e.value, u = Array.isArray(c) ? c.filter(Boolean) : c, [d, p] = useState(u), m = (k = i["x-component-props"]) == null ? void 0 : k.addMode, { t: h } = useTranslation(), { multiple: f } = e, x = useForm(), S = useAPIClient().resource(l.target), b = useCollectionRecordData();
32115
+ const I = e, { objectValue: t = !0, addMode: o } = I, n = H(I, ["objectValue", "addMode"]), r = useField(), i = useFieldSchema(), a = useServiceOptions$1((i == null ? void 0 : i["x-component-props"]) || e), { options: l } = useAssociationFieldContext(), c = isVariable(e.value) ? void 0 : e.value, u = Array.isArray(c) ? c.filter(Boolean) : c, [d, p] = useState(u), m = (k = i["x-component-props"]) == null ? void 0 : k.addMode, { t: h } = useTranslation(), { multiple: f } = e, x = useForm(), S = useAPIClient().resource(l.target), b = useCollectionRecordData();
32113
32116
  useEffect(() => {
32114
32117
  const A = isVariable(r.value) ? void 0 : r.value, w = Array.isArray(A) ? A.filter(Boolean) : A;
32115
32118
  p(w);