@nocobase/client 1.3.23-beta → 1.3.25-beta

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
@@ -4101,7 +4101,7 @@ function addAppVersion(e, t) {
4101
4101
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
4102
4102
  }), e;
4103
4103
  }
4104
- const name = "@nocobase/client", version$1 = "1.3.23-beta", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
4104
+ const name = "@nocobase/client", version$1 = "1.3.25-beta", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
4105
4105
  "@ahooksjs/use-url-state": "3.5.1",
4106
4106
  "@ant-design/cssinjs": "^1.11.1",
4107
4107
  "@ant-design/icons": "^5.1.4",
@@ -4122,9 +4122,9 @@ const name = "@nocobase/client", version$1 = "1.3.23-beta", license = "AGPL-3.0"
4122
4122
  "@formily/reactive-react": "^2.2.27",
4123
4123
  "@formily/shared": "^2.2.27",
4124
4124
  "@formily/validator": "^2.2.27",
4125
- "@nocobase/evaluators": "1.3.23-beta",
4126
- "@nocobase/sdk": "1.3.23-beta",
4127
- "@nocobase/utils": "1.3.23-beta",
4125
+ "@nocobase/evaluators": "1.3.25-beta",
4126
+ "@nocobase/sdk": "1.3.25-beta",
4127
+ "@nocobase/utils": "1.3.25-beta",
4128
4128
  ahooks: "^3.7.2",
4129
4129
  antd: "5.12.8",
4130
4130
  "antd-style": "3.4.5",
@@ -6307,13 +6307,12 @@ function getRenderContent(e, t, o, n, r) {
6307
6307
  return z(this, null, function* () {
6308
6308
  if (t && e === "handlebars")
6309
6309
  try {
6310
- try {
6311
- yield replaceVariableValue(t, o, n);
6312
- } catch (c) {
6313
- return null;
6314
- }
6315
- const i = Handlebars.compile(t), a = getVariablesData(n), l = i(g(g({}, o.ctxRef.current), a));
6316
- return yield r(l);
6310
+ const i = Handlebars.compile(t), a = getVariablesData(n), { $nDate: l } = o.ctxRef.current, c = {};
6311
+ Object.keys(l).map((d) => {
6312
+ c[d] = l[d]();
6313
+ });
6314
+ const u = i(F(g(g({}, o.ctxRef.current), a), { $nDate: c }));
6315
+ return yield r(u);
6317
6316
  } catch (i) {
6318
6317
  return console.log(i), t;
6319
6318
  }
@@ -10728,7 +10727,7 @@ const BaseVariableContext = React.createContext(null), BaseVariableProvider = (e
10728
10727
  const v = y.field.target;
10729
10728
  return new Promise((A) => {
10730
10729
  setTimeout(() => {
10731
- const T = (getChildren$2(d(f(v, u), y), {
10730
+ const k = (getChildren$2(d(f(v, u, !0), y), {
10732
10731
  collectionField: e,
10733
10732
  uiSchema: t,
10734
10733
  targetFieldSchema: o,
@@ -10740,12 +10739,12 @@ const BaseVariableContext = React.createContext(null), BaseVariableProvider = (e
10740
10739
  isDisabled: x || isDisabledDefault,
10741
10740
  getCollectionField: C.getCollectionField,
10742
10741
  deprecated: p
10743
- }) || []).sort((k, D) => k.isLeaf && !D.isLeaf ? -1 : !k.isLeaf && D.isLeaf ? 1 : 0).sort((k, D) => k.disabled && !D.disabled ? 1 : !k.disabled && D.disabled ? -1 : 0);
10744
- if (T.length === 0) {
10742
+ }) || []).sort((D, $) => D.isLeaf && !$.isLeaf ? -1 : !D.isLeaf && $.isLeaf ? 1 : 0).sort((D, $) => D.disabled && !$.disabled ? 1 : !D.disabled && $.disabled ? -1 : 0);
10743
+ if (k.length === 0) {
10745
10744
  y.disabled = !0, y.isLeaf = !0, A();
10746
10745
  return;
10747
10746
  }
10748
- y.children = T, A();
10747
+ y.children = k, A();
10749
10748
  }, 5);
10750
10749
  });
10751
10750
  };
@@ -17720,7 +17719,7 @@ const SchemaSettingsDefaultValue = function e(t) {
17720
17719
  type: "switch",
17721
17720
  useVisible() {
17722
17721
  const e = useCollection(), { collectionField: t } = useColumnSchema$1(), { getInterface: o } = useCollectionManager_deprecated(), n = o(t == null ? void 0 : t.interface), { currentMode: r } = useAssociationFieldContext();
17723
- return (n == null ? void 0 : n.sortable) === !0 && !r && (e == null ? void 0 : e.name) === (t == null ? void 0 : t.collectionName);
17722
+ return (n == null ? void 0 : n.sortable) === !0 && !r && ((e == null ? void 0 : e.name) === (t == null ? void 0 : t.collectionName) || !(t != null && t.collectionName));
17724
17723
  },
17725
17724
  useComponentProps() {
17726
17725
  const e = useField(), { t } = useTranslation(), o = useFieldSchema(), { dn: n } = useDesignable();
@@ -23773,48 +23772,48 @@ Filter.Action = FilterAction;
23773
23772
  Filter.Action.Designer = FilterActionDesigner;
23774
23773
  const useGetFilterOptions = () => {
23775
23774
  const { getCollectionFields: e } = useCollectionManager_deprecated(), t = useGetFilterFieldOptions();
23776
- return (o, n) => {
23777
- const r = e(o, n);
23778
- return t(r);
23775
+ return (o, n, r) => {
23776
+ const i = e(o, n);
23777
+ return t(i, r);
23779
23778
  };
23780
23779
  }, useFilterOptions = (e) => {
23781
23780
  const { getCollectionFields: t } = useCollectionManager_deprecated(), o = t(e);
23782
23781
  return useFilterFieldOptions(o);
23783
23782
  }, useGetFilterFieldOptions = () => {
23784
23783
  var a;
23785
- const e = useFieldSchema(), t = ((a = e == null ? void 0 : e["x-component-props"]) == null ? void 0 : a.nonfilterable) || [], { getCollectionFields: o, getInterface: n } = useCollectionManager_deprecated(), r = (l, c) => {
23786
- var f, x;
23784
+ const e = useFieldSchema(), t = ((a = e == null ? void 0 : e["x-component-props"]) == null ? void 0 : a.nonfilterable) || [], { getCollectionFields: o, getInterface: n } = useCollectionManager_deprecated(), r = (l, c, u) => {
23785
+ var x, C;
23787
23786
  if (t.length && c === 1 && t.includes(l.name) || !l.interface)
23788
23787
  return;
23789
- const u = n(l.interface);
23790
- if (!(u != null && u.filterable))
23788
+ const d = n(l.interface);
23789
+ if (!(d != null && d.filterable) && !u)
23791
23790
  return;
23792
- const { nested: d, children: p, operators: m } = u.filterable, h = {
23791
+ const { nested: p, children: m, operators: h } = (d == null ? void 0 : d.filterable) || {}, f = {
23793
23792
  name: l.name,
23794
23793
  type: l.type,
23795
23794
  target: l.target,
23796
- title: ((f = l == null ? void 0 : l.uiSchema) == null ? void 0 : f.title) || l.name,
23795
+ title: ((x = l == null ? void 0 : l.uiSchema) == null ? void 0 : x.title) || l.name,
23797
23796
  schema: l == null ? void 0 : l.uiSchema,
23798
23797
  interface: l.interface,
23799
- operators: ((x = m == null ? void 0 : m.filter) == null ? void 0 : x.call(m, (C) => !(C != null && C.visible) || C.visible(l))) || []
23798
+ operators: ((C = h == null ? void 0 : h.filter) == null ? void 0 : C.call(h, (S) => !(S != null && S.visible) || S.visible(l))) || []
23800
23799
  };
23801
23800
  if (!(l.target && c > 2)) {
23802
23801
  if (c > 2)
23803
- return h;
23804
- if (p != null && p.length && (h.children = p), d) {
23805
- const C = o(l.target), S = i(C, c + 1).filter(Boolean);
23806
- h.children = h.children || [], h.children.push(...S);
23802
+ return f;
23803
+ if (m != null && m.length && (f.children = m), p) {
23804
+ const S = o(l.target), b = i(S, c + 1).filter(Boolean);
23805
+ f.children = f.children || [], f.children.push(...b);
23807
23806
  }
23808
- return h;
23807
+ return f;
23809
23808
  }
23810
- }, i = (l, c) => {
23811
- const u = [];
23812
- return l.forEach((d) => {
23813
- const p = r(d, c);
23814
- p && u.push(p);
23815
- }), u;
23809
+ }, i = (l, c, u) => {
23810
+ const d = [];
23811
+ return l.forEach((p) => {
23812
+ const m = r(p, c, u);
23813
+ m && d.push(m);
23814
+ }), d;
23816
23815
  };
23817
- return (l) => i(l, 1);
23816
+ return (l, c) => i(l, 1, c);
23818
23817
  }, useFilterFieldOptions = (e) => {
23819
23818
  var l;
23820
23819
  const t = useFieldSchema(), o = ((l = t == null ? void 0 : t["x-component-props"]) == null ? void 0 : l.nonfilterable) || [], { getCollectionFields: n, getInterface: r } = useCollectionManager_deprecated(), i = (c, u) => {
@@ -6,9 +6,9 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export declare const useGetFilterOptions: () => (collectionName: any, dataSource?: string) => any[];
9
+ export declare const useGetFilterOptions: () => (collectionName: any, dataSource?: string, usedInVariable?: boolean) => any[];
10
10
  export declare const useFilterOptions: (collectionName: string) => any[];
11
- export declare const useGetFilterFieldOptions: () => (fields: any) => any[];
11
+ export declare const useGetFilterFieldOptions: () => (fields: any, usedInVariable: any) => any[];
12
12
  export declare const useFilterFieldOptions: (fields: any) => any[];
13
13
  export declare const removeNullCondition: (filter: any, customFlat?: any) => any;
14
14
  export declare const useFilterActionProps: () => {