@nocobase/client 1.7.8 → 1.7.10

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.
Files changed (3) hide show
  1. package/es/index.mjs +34 -28
  2. package/lib/index.js +20 -20
  3. package/package.json +5 -5
package/es/index.mjs CHANGED
@@ -4251,13 +4251,14 @@ class APIClient extends APIClient$1 {
4251
4251
  A(this, "notification", notification);
4252
4252
  }
4253
4253
  cloneInstance() {
4254
+ var r;
4254
4255
  const n = new APIClient(this.options);
4255
4256
  n.options = this.options, n.services = this.services, n.storage = this.storage, n.app = this.app, n.auth = this.auth, n.storagePrefix = this.storagePrefix, n.notification = this.notification;
4256
4257
  const o = [];
4257
- for (const r of this.axios.interceptors.response.handlers)
4258
- r.rejected._name === "handleNotificationError" ? o.push(P(x({}, r), {
4258
+ for (const a of this.axios.interceptors.response.handlers)
4259
+ ((r = a == null ? void 0 : a.rejected) == null ? void 0 : r._name) === "handleNotificationError" ? o.push(P(x({}, a), {
4259
4260
  rejected: n.handleNotificationError.bind(n)
4260
- })) : o.push(r);
4261
+ })) : o.push(a);
4261
4262
  return n.axios.interceptors.response.handlers = o, n;
4262
4263
  }
4263
4264
  getHeaders() {
@@ -6882,7 +6883,10 @@ function bindLinkageRulesToFiled({
6882
6883
  // 1. 条件中的字段值;
6883
6884
  // 2. 条件中的变量值;
6884
6885
  // 3. value 表达式中的变量值;
6885
- () => (getFieldValuesInCondition({ linkageRules: t, formValues: n }), getVariableValuesInCondition({ linkageRules: t, localVariables: o }), getVariableValuesInExpression({ action: r, localVariables: o }), uid$1()),
6886
+ () => {
6887
+ const f = getFieldValuesInCondition({ linkageRules: t, formValues: n }), C = getVariableValuesInCondition({ linkageRules: t, localVariables: o }), b = getVariableValuesInExpression({ action: r, localVariables: o });
6888
+ return [f, C, b].map((y) => JSON.stringify(y)).join(",");
6889
+ },
6886
6890
  getSubscriber({ action: r, field: e, rule: a, variables: i, localVariables: o, variableNameOfLeftCondition: l }, c),
6887
6891
  { fireImmediately: !0, equals: _.isEqual }
6888
6892
  );
@@ -8705,7 +8709,7 @@ function addAppVersion(e, t) {
8705
8709
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
8706
8710
  }), e;
8707
8711
  }
8708
- const name = "@nocobase/client", version = "1.7.8", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8712
+ const name = "@nocobase/client", version = "1.7.10", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
8709
8713
  "@ahooksjs/use-url-state": "3.5.1",
8710
8714
  "@ant-design/cssinjs": "^1.11.1",
8711
8715
  "@ant-design/icons": "^5.6.1",
@@ -8726,9 +8730,9 @@ const name = "@nocobase/client", version = "1.7.8", license = "AGPL-3.0", main =
8726
8730
  "@formily/reactive-react": "^2.2.27",
8727
8731
  "@formily/shared": "^2.2.27",
8728
8732
  "@formily/validator": "^2.2.27",
8729
- "@nocobase/evaluators": "1.7.8",
8730
- "@nocobase/sdk": "1.7.8",
8731
- "@nocobase/utils": "1.7.8",
8733
+ "@nocobase/evaluators": "1.7.10",
8734
+ "@nocobase/sdk": "1.7.10",
8735
+ "@nocobase/utils": "1.7.10",
8732
8736
  ahooks: "^3.7.2",
8733
8737
  antd: "5.24.2",
8734
8738
  "antd-style": "3.7.1",
@@ -39351,8 +39355,8 @@ const RenderButton = ({
39351
39355
  RenderButton.displayName = "RenderButton";
39352
39356
  const RenderButtonInner = observer$1(
39353
39357
  (e) => {
39354
- var O, k;
39355
- const w = e, {
39358
+ var j, M;
39359
+ const O = e, {
39356
39360
  designable: t,
39357
39361
  field: n,
39358
39362
  aclCtx: o,
@@ -39373,7 +39377,7 @@ const RenderButtonInner = observer$1(
39373
39377
  title: S,
39374
39378
  isLink: y,
39375
39379
  onlyIcon: v
39376
- } = w, F = W(w, [
39380
+ } = O, F = W(O, [
39377
39381
  "designable",
39378
39382
  "field",
39379
39383
  "aclCtx",
@@ -39396,30 +39400,32 @@ const RenderButtonInner = observer$1(
39396
39400
  "onlyIcon"
39397
39401
  ]), { t: I } = useTranslation(), T = useCallback(
39398
39402
  debounce$1(
39399
- (M, q = !0) => {
39400
- d(M, q);
39403
+ (q, E = !0) => {
39404
+ d(q, E);
39401
39405
  },
39402
39406
  300,
39403
39407
  { leading: !0, trailing: !1 }
39404
39408
  ),
39405
39409
  [d]
39406
39410
  );
39407
- if (useEffect(() => () => {
39411
+ useEffect(() => () => {
39408
39412
  T.cancel();
39409
- }, []), !t && ((O = n == null ? void 0 : n.data) != null && O.hidden || !o))
39410
- return null;
39411
- const R = S != null ? S : n == null ? void 0 : n.title, D = typeof R == "string" ? I(R, { ns: NAMESPACE_UI_SCHEMA }) : R, j = l, { opacity: B } = j, N = W(j, ["opacity"]), $ = y && B ? { opacity: B } : void 0, L = useMemo(
39413
+ }, []);
39414
+ const R = useMemo(
39412
39415
  () => React.forwardRef(
39413
- (H, U) => {
39414
- var Y = H, { component: M = p || Button, icon: q, onlyIcon: E, children: V } = Y, G = W(Y, ["component", "icon", "onlyIcon", "children"]);
39415
- return /* @__PURE__ */ jsxs(M, P(x({ ref: U }, G), { children: [
39416
- E ? /* @__PURE__ */ jsx(Tooltip, { title: G.title, children: /* @__PURE__ */ jsx("span", { style: { padding: 3 }, children: q && typeof q == "string" ? /* @__PURE__ */ jsx(Icon, { type: q }) : q }) }) : /* @__PURE__ */ jsx("span", { style: { paddingRight: 3 }, children: q && typeof q == "string" ? /* @__PURE__ */ jsx(Icon, { type: q }) : q }),
39417
- E ? V[1] : V
39416
+ (Y, H) => {
39417
+ var J = Y, { component: q = p || Button, icon: E, onlyIcon: V, children: G } = J, U = W(J, ["component", "icon", "onlyIcon", "children"]);
39418
+ return /* @__PURE__ */ jsxs(q, P(x({ ref: H }, U), { children: [
39419
+ V ? /* @__PURE__ */ jsx(Tooltip, { title: U.title, children: /* @__PURE__ */ jsx("span", { style: { padding: 3 }, children: E && typeof E == "string" ? /* @__PURE__ */ jsx(Icon, { type: E }) : E }) }) : /* @__PURE__ */ jsx("span", { style: { paddingRight: 3 }, children: E && typeof E == "string" ? /* @__PURE__ */ jsx(Icon, { type: E }) : E }),
39420
+ V ? G[1] : G
39418
39421
  ] }));
39419
39422
  }
39420
39423
  ),
39421
39424
  [v]
39422
39425
  );
39426
+ if (!t && ((j = n == null ? void 0 : n.data) != null && j.hidden || !o))
39427
+ return null;
39428
+ const D = S != null ? S : n == null ? void 0 : n.title, B = typeof D == "string" ? I(D, { ns: NAMESPACE_UI_SCHEMA }) : D, k = l, { opacity: N } = k, $ = W(k, ["opacity"]), L = y && N ? { opacity: N } : void 0, w = v || p ? R : p || Button;
39423
39429
  return /* @__PURE__ */ jsxs(
39424
39430
  SortableItem,
39425
39431
  P(x({
@@ -39427,18 +39433,18 @@ const RenderButtonInner = observer$1(
39427
39433
  "aria-label": u()
39428
39434
  }, F), {
39429
39435
  onMouseEnter: c,
39430
- loading: ((k = n == null ? void 0 : n.data) == null ? void 0 : k.loading) || a,
39431
- icon: typeof r == "string" ? /* @__PURE__ */ jsx(Icon, { type: r, style: $ }) : r,
39436
+ loading: ((M = n == null ? void 0 : n.data) == null ? void 0 : M.loading) || a,
39437
+ icon: typeof r == "string" ? /* @__PURE__ */ jsx(Icon, { type: r, style: L }) : r,
39432
39438
  disabled: i,
39433
- style: y ? N : l,
39439
+ style: y ? $ : l,
39434
39440
  onClick: T,
39435
- component: v || p ? L : p || Button,
39441
+ component: w,
39436
39442
  className: cls(m, h, g, "nb-action"),
39437
39443
  type: f === "danger" ? void 0 : f,
39438
- title: D,
39444
+ title: B,
39439
39445
  onlyIcon: v,
39440
39446
  children: [
39441
- !v && D && /* @__PURE__ */ jsx("span", { className: r ? "nb-action-title" : null, style: $, children: D }),
39447
+ !v && B && /* @__PURE__ */ jsx("span", { className: r ? "nb-action-title" : null, style: L, children: B }),
39442
39448
  /* @__PURE__ */ jsx(C, x({}, b))
39443
39449
  ]
39444
39450
  })