@nocobase/client 1.5.2 → 1.5.3

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
@@ -12789,28 +12789,26 @@ const setFieldProps$1 = (e, t, n) => {
12789
12789
  }, setRequired$1 = (e, t, n) => {
12790
12790
  typeof t.required == "undefined" && (e.required = !!n.required);
12791
12791
  }, FilterCollectionFieldInternalField = (e) => {
12792
- var g, f, C, b;
12793
- const t = useCompile(), n = useField(), o = useFieldSchema(), { getInterface: r } = useCollectionManager_deprecated(), { uiSchema: i, defaultValue: a, interface: l } = useCollectionField(), { isAllowToSetDefaultValue: c } = useIsAllowToSetDefaultValue(), u = r(l), d = (f = (g = u == null ? void 0 : u.filterable) == null ? void 0 : g.operators) == null ? void 0 : f.find(
12794
- (S, y) => S.value === o["x-filter-operator"] || y === 0
12795
- ), p = useComponent(
12796
- ((C = d == null ? void 0 : d.schema) == null ? void 0 : C["x-component"]) || ((b = o["x-component-props"]) == null ? void 0 : b.component) || (i == null ? void 0 : i["x-component"]) || "Input"
12792
+ var g, f, C, b, S, y;
12793
+ const t = useCompile(), n = useField(), o = useFieldSchema(), { getInterface: r } = useCollectionManager_deprecated(), { uiSchema: i, defaultValue: a, interface: l } = useCollectionField(), { isAllowToSetDefaultValue: c } = useIsAllowToSetDefaultValue(), u = r(l), d = ((f = (g = u == null ? void 0 : u.filterable) == null ? void 0 : g.operators) == null ? void 0 : f.find((v, F) => v.value === (o == null ? void 0 : o["x-filter-operator"]))) || ((b = (C = u == null ? void 0 : u.filterable) == null ? void 0 : C.operators) == null ? void 0 : b[0]), p = useComponent(
12794
+ ((S = d == null ? void 0 : d.schema) == null ? void 0 : S["x-component"]) || ((y = o["x-component-props"]) == null ? void 0 : y.component) || (i == null ? void 0 : i["x-component"]) || "Input"
12797
12795
  ), m = useFormBlockContext(), h = useDynamicComponentProps(i == null ? void 0 : i["x-use-component-props"], e);
12798
12796
  return useEffect(() => {
12799
- var v;
12797
+ var I;
12800
12798
  if (!i)
12801
12799
  return;
12802
- const S = t(i);
12803
- if (setFieldProps$1(n, "content", S["x-content"]), setFieldProps$1(n, "title", S.title), setFieldProps$1(n, "description", S.description), m != null && m.form) {
12804
- const F = c() ? o.default || a : void 0;
12805
- F != null && setFieldProps$1(n, "initialValue", F);
12806
- }
12807
- if (!n.validator && (S["x-validator"] || o["x-validator"])) {
12808
- const F = concat([], S["x-validator"] || [], o["x-validator"] || []);
12809
- n.validator = F;
12810
- }
12811
- o["x-disabled"] === !0 && (n.disabled = !0), o["x-read-pretty"] === !0 && (n.readPretty = !0), setRequired$1(n, o, S), n.dataSource = S.enum;
12812
- const y = t(x(x({}, ((v = d == null ? void 0 : d.schema) == null ? void 0 : v["x-component-props"]) || {}), S["x-component-props"] || {})) || {};
12813
- n.componentProps = merge(y, n.componentProps || {}, h || {});
12800
+ const v = t(i);
12801
+ if (setFieldProps$1(n, "content", v["x-content"]), setFieldProps$1(n, "title", v.title), setFieldProps$1(n, "description", v.description), m != null && m.form) {
12802
+ const R = c() ? o.default || a : void 0;
12803
+ R != null && setFieldProps$1(n, "initialValue", R);
12804
+ }
12805
+ if (!n.validator && (v["x-validator"] || o["x-validator"])) {
12806
+ const R = concat([], v["x-validator"] || [], o["x-validator"] || []);
12807
+ n.validator = R;
12808
+ }
12809
+ o["x-disabled"] === !0 && (n.disabled = !0), o["x-read-pretty"] === !0 && (n.readPretty = !0), setRequired$1(n, o, v), n.dataSource = v.enum;
12810
+ const F = t(x(x({}, ((I = d == null ? void 0 : d.schema) == null ? void 0 : I["x-component-props"]) || {}), v["x-component-props"] || {})) || {};
12811
+ n.componentProps = merge(F, n.componentProps || {}, h || {});
12814
12812
  }, [i]), i ? /* @__PURE__ */ jsx(p, x(x({}, e), h)) : null;
12815
12813
  }, FilterCollectionField = connect((e) => {
12816
12814
  const t = useFieldSchema();
@@ -19528,7 +19526,7 @@ DatePicker.FilterWithPicker = function e(t) {
19528
19526
  });
19529
19527
  }
19530
19528
  }), g = useField(), [f, C] = useState(h);
19531
- return /* @__PURE__ */ jsxs(Space$1.Compact, { children: [
19529
+ return /* @__PURE__ */ jsxs(Space$1.Compact, { style: { width: "100%" }, children: [
19532
19530
  /* @__PURE__ */ jsx(
19533
19531
  Select$1,
19534
19532
  {
@@ -20152,7 +20150,7 @@ const ParentCollectionProvider = (e) => {
20152
20150
  return r ? /* @__PURE__ */ jsx(CollectionProvider, { name: String(t).split(".")[0], children: /* @__PURE__ */ jsx(ParentCollectionProvider, { children: /* @__PURE__ */ jsx(CollectionFieldProvider, { name: t, children: /* @__PURE__ */ jsx(CollectionProvider, { name: r, children: n }) }) }) }) : /* @__PURE__ */ jsx(CollectionDeletedPlaceholder, { type: "Collection", name: t });
20153
20151
  }, useAssociationName = () => {
20154
20152
  const e = useCollectionField();
20155
- return e && ["belongsToMany", "belongsTo", "hasMany", "hasOne"].includes(e.type) ? `${e.collectionName}.${e.name}` : null;
20153
+ return e != null && e.target ? `${e.collectionName}.${e.name}` : null;
20156
20154
  }, useCurrentParentRecordContext = () => {
20157
20155
  var c, u;
20158
20156
  const e = useCollectionRecord(), { name: t, dataSource: n } = useParentCollection() || {}, o = useCollection(), { isInSubForm: r, isInSubTable: i } = useFlag() || {}, a = t ? n : o == null ? void 0 : o.dataSource, l = useCollectionField();
@@ -24177,9 +24175,7 @@ const useGetFilterOptions = () => {
24177
24175
  }
24178
24176
  return t.unflatten(o);
24179
24177
  }, useFilterActionProps$1 = () => {
24180
- const e = useCollection(), t = useFilterOptions(e == null ? void 0 : e.name);
24181
- console.log(t);
24182
- const n = useDataBlockProps();
24178
+ const e = useCollection(), t = useFilterOptions(e == null ? void 0 : e.name), n = useDataBlockProps();
24183
24179
  return useFilterFieldProps({ options: t, params: n == null ? void 0 : n.params });
24184
24180
  }, useFilterFieldProps = ({ options: e, service: t, params: n }) => {
24185
24181
  const { getDataBlockRequest: o } = useDataBlockRequestGetter(), { t: r } = useTranslation(), i = useField(), a = useDataLoadingMode(), l = useFieldSchema(), c = useCompile(), u = useCallback(
@@ -35185,7 +35181,7 @@ function addAppVersion(e, t) {
35185
35181
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
35186
35182
  }), e;
35187
35183
  }
35188
- const name = "@nocobase/client", version = "1.5.2", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
35184
+ const name = "@nocobase/client", version = "1.5.3", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
35189
35185
  "@ahooksjs/use-url-state": "3.5.1",
35190
35186
  "@ant-design/cssinjs": "^1.11.1",
35191
35187
  "@ant-design/icons": "^5.1.4",
@@ -35207,9 +35203,9 @@ const name = "@nocobase/client", version = "1.5.2", license = "AGPL-3.0", main =
35207
35203
  "@formily/reactive-react": "^2.2.27",
35208
35204
  "@formily/shared": "^2.2.27",
35209
35205
  "@formily/validator": "^2.2.27",
35210
- "@nocobase/evaluators": "1.5.2",
35211
- "@nocobase/sdk": "1.5.2",
35212
- "@nocobase/utils": "1.5.2",
35206
+ "@nocobase/evaluators": "1.5.3",
35207
+ "@nocobase/sdk": "1.5.3",
35208
+ "@nocobase/utils": "1.5.3",
35213
35209
  ahooks: "^3.7.2",
35214
35210
  antd: "5.12.8",
35215
35211
  "antd-style": "3.7.1",
@@ -63543,24 +63539,26 @@ const mockAPIClient = () => {
63543
63539
  const e = new MockAPIClient(), t = e.mockAdapter();
63544
63540
  return { apiClient: e, mockRequest: t };
63545
63541
  }, PopupContextProvider = (e) => {
63546
- var p, m;
63547
- const { visible: t, setVisible: n } = e, [o, r] = useState(!1), { visible: i, setVisible: a } = useContext(PopupVisibleProviderContext) || {
63542
+ var h, g;
63543
+ const { visible: t, setVisible: n } = e, [o, r] = useState(!1), [i, a] = useState(!1), { visible: l, setVisible: c } = useContext(PopupVisibleProviderContext) || {
63548
63544
  visible: !1,
63549
63545
  setVisible: () => {
63550
63546
  }
63551
- }, l = useFieldSchema(), c = useCallback(
63552
- (h) => {
63553
- n == null || n(h), r == null || r(h), a == null || a(h);
63547
+ }, u = useFieldSchema(), d = useCallback(
63548
+ (f) => {
63549
+ n == null || n(f), r == null || r(f), c == null || c(f);
63554
63550
  },
63555
- [n, a]
63556
- ), u = ((p = l["x-component-props"]) == null ? void 0 : p.openMode) || "drawer", d = (m = l["x-component-props"]) == null ? void 0 : m.openSize;
63551
+ [n, c]
63552
+ ), p = ((h = u["x-component-props"]) == null ? void 0 : h.openMode) || "drawer", m = (g = u["x-component-props"]) == null ? void 0 : g.openSize;
63557
63553
  return /* @__PURE__ */ jsx(PopupVisibleProvider, { visible: !1, children: /* @__PURE__ */ jsx(
63558
63554
  ActionContextProvider,
63559
63555
  {
63560
- visible: t || o || i,
63561
- setVisible: c,
63562
- openMode: u,
63563
- openSize: d,
63556
+ visible: t || o || l,
63557
+ setVisible: d,
63558
+ openMode: p,
63559
+ openSize: m,
63560
+ formValueChanged: i,
63561
+ setFormValueChanged: a,
63564
63562
  children: e.children
63565
63563
  }
63566
63564
  ) });