@nocobase/client 1.6.0-beta.13 → 1.6.0-beta.15

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.
@@ -40,6 +40,6 @@ export declare const useFilterAPI: () => {
40
40
  /** 当前区块是否已连接其它区块 */
41
41
  isConnected: boolean;
42
42
  /** 调用该方法进行过滤 */
43
- doFilter: (value: any, field?: string | ((target: FilterTarget['targets'][0]) => string), operator?: string | ((target: FilterTarget['targets'][0]) => string)) => void;
43
+ doFilter: (value: any, field?: string | ((target: FilterTarget['targets'][0], block: DataBlock) => string), operator?: string | ((target: FilterTarget['targets'][0]) => string)) => void;
44
44
  };
45
45
  export declare const isInFilterFormBlock: (fieldSchema: Schema) => boolean;
package/es/index.mjs CHANGED
@@ -6715,7 +6715,7 @@ const mergeFilter = (e, t = "$and") => {
6715
6715
  const g = n.find((v) => v.uid === m.uid);
6716
6716
  if (!g)
6717
6717
  return;
6718
- _.isFunction(d) && (d = d(g)), _.isFunction(p) && (p = p(g));
6718
+ _.isFunction(u) && (u = u(g, m)), _.isFunction(d) && (d = d(g, m)), _.isFunction(p) && (p = p(g));
6719
6719
  const h = ((b = m.service.params) == null ? void 0 : b[0]) || {}, f = ((y = (S = m.service.params) == null ? void 0 : S[1]) == null ? void 0 : y.filters) || {};
6720
6720
  u !== void 0 ? f[o] = {
6721
6721
  $and: [
@@ -9076,7 +9076,7 @@ function addAppVersion(e, t) {
9076
9076
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
9077
9077
  }), e;
9078
9078
  }
9079
- const name = "@nocobase/client", version = "1.6.0-beta.13", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9079
+ const name = "@nocobase/client", version = "1.6.0-beta.15", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9080
9080
  "@ahooksjs/use-url-state": "3.5.1",
9081
9081
  "@ant-design/cssinjs": "^1.11.1",
9082
9082
  "@ant-design/icons": "^5.6.1",
@@ -9098,9 +9098,9 @@ const name = "@nocobase/client", version = "1.6.0-beta.13", license = "AGPL-3.0"
9098
9098
  "@formily/reactive-react": "^2.2.27",
9099
9099
  "@formily/shared": "^2.2.27",
9100
9100
  "@formily/validator": "^2.2.27",
9101
- "@nocobase/evaluators": "1.6.0-beta.13",
9102
- "@nocobase/sdk": "1.6.0-beta.13",
9103
- "@nocobase/utils": "1.6.0-beta.13",
9101
+ "@nocobase/evaluators": "1.6.0-beta.15",
9102
+ "@nocobase/sdk": "1.6.0-beta.15",
9103
+ "@nocobase/utils": "1.6.0-beta.15",
9104
9104
  ahooks: "^3.7.2",
9105
9105
  antd: "5.12.8",
9106
9106
  "antd-style": "3.7.1",
@@ -38754,16 +38754,12 @@ const useMenuDragEnd = () => {
38754
38754
  const { moveRoute: e } = useNocoBaseRoutes();
38755
38755
  return { onDragEnd: useCallback(
38756
38756
  (n) => {
38757
- var u, d, p, m;
38758
- const { active: o, over: r } = n, i = (d = (u = o == null ? void 0 : o.data) == null ? void 0 : u.current) == null ? void 0 : d.schema, a = (m = (p = r == null ? void 0 : r.data) == null ? void 0 : p.current) == null ? void 0 : m.schema;
38759
- if (!i || !a)
38760
- return;
38761
- const l = i.__route__.sort, c = a.__route__.sort;
38762
- e({
38757
+ var l, c, u, d;
38758
+ const { active: o, over: r } = n, i = (c = (l = o == null ? void 0 : o.data) == null ? void 0 : l.current) == null ? void 0 : c.schema, a = (d = (u = r == null ? void 0 : r.data) == null ? void 0 : u.current) == null ? void 0 : d.schema;
38759
+ !i || !a || e({
38763
38760
  sourceId: i.__route__.id,
38764
38761
  targetId: a.__route__.id,
38765
- sortField: "sort",
38766
- method: l > c ? "prepend" : "insertAfter"
38762
+ sortField: "sort"
38767
38763
  });
38768
38764
  },
38769
38765
  [e]
@@ -59446,7 +59442,7 @@ function useMenuSearch({
59446
59442
  })) : h, [e, c, u, h]);
59447
59443
  }
59448
59444
  const DataBlockInitializer = (e) => {
59449
- var B;
59445
+ var B, $;
59450
59446
  const {
59451
59447
  templateWrap: t,
59452
59448
  onCreateBlockSchema: n,
@@ -59467,15 +59463,15 @@ const DataBlockInitializer = (e) => {
59467
59463
  currentText: b,
59468
59464
  otherText: S
59469
59465
  } = e, { insert: y, setVisible: v } = useSchemaInitializer(), F = useCompile(), { getTemplateSchemaByMode: A } = useSchemaTemplateManager(), R = useCallback(
59470
- ($) => q(void 0, null, function* () {
59471
- const { item: T, fromOthersInPopup: z } = $;
59466
+ (T) => q(void 0, null, function* () {
59467
+ const { item: z, fromOthersInPopup: E } = T;
59472
59468
  if (f)
59473
- return f($);
59474
- if (T.template) {
59475
- const E = yield A(T);
59476
- y(t ? t(E, { item: T, fromOthersInPopup: z }) : E);
59469
+ return f(T);
59470
+ if (z.template) {
59471
+ const L = yield A(z);
59472
+ y(t ? t(L, { item: z, fromOthersInPopup: E }) : L);
59477
59473
  } else
59478
- n && n({ item: T, fromOthersInPopup: z });
59474
+ n && n({ item: z, fromOthersInPopup: E });
59479
59475
  v(!1);
59480
59476
  }),
59481
59477
  [A, y, v, n, f, t]
@@ -59494,24 +59490,24 @@ const DataBlockInitializer = (e) => {
59494
59490
  currentText: b,
59495
59491
  otherText: S
59496
59492
  }), D = useGetSchemaInitializerMenuItems(R), M = useMemo(() => D(k, i), [D, k, i]), [N, O] = useState([]), j = useMenuSearch({ data: M, openKeys: N, hideSearch: u }), w = useMemo(() => {
59497
- let $ = j.filter((T) => T.key !== "search" && T.key !== "empty");
59498
- return p && $.length === 1 ? $ = $[0].children : $ = j, [
59493
+ let T = j.filter((z) => z.key !== "search" && z.key !== "empty");
59494
+ return p && T.length === 1 ? T = T[0].children : T = j, [
59499
59495
  {
59500
59496
  key: i,
59501
59497
  label: F(a),
59502
59498
  icon: typeof r == "string" ? /* @__PURE__ */ jsx(antIcons__default, { type: r }) : r,
59503
- onClick: (T) => {
59504
- T.key === i && R(P(x({}, T), { item: e }));
59499
+ onClick: (z) => {
59500
+ z.key === i && R(P(x({}, z), { item: e }));
59505
59501
  },
59506
- children: $
59502
+ children: T
59507
59503
  }
59508
59504
  ];
59509
59505
  }, [j, p, i, F, a, r, R, e]);
59510
- return M.length > 1 || M.length === 1 && ((B = M[0].children) == null ? void 0 : B.length) > 0 ? /* @__PURE__ */ jsx(
59506
+ return M.length > 1 || M.length === 1 && (($ = (B = M[0]) == null ? void 0 : B.children) == null ? void 0 : $.length) > 0 ? /* @__PURE__ */ jsx(
59511
59507
  SchemaInitializerMenu,
59512
59508
  {
59513
- onOpenChange: ($) => {
59514
- O($);
59509
+ onOpenChange: (T) => {
59510
+ O(T);
59515
59511
  },
59516
59512
  items: w
59517
59513
  }