@nocobase/client 1.6.20 → 1.6.21

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
@@ -9187,7 +9187,7 @@ function addAppVersion(e, t) {
9187
9187
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
9188
9188
  }), e;
9189
9189
  }
9190
- const name = "@nocobase/client", version = "1.6.20", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9190
+ const name = "@nocobase/client", version = "1.6.21", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9191
9191
  "@ahooksjs/use-url-state": "3.5.1",
9192
9192
  "@ant-design/cssinjs": "^1.11.1",
9193
9193
  "@ant-design/icons": "^5.6.1",
@@ -9209,9 +9209,9 @@ const name = "@nocobase/client", version = "1.6.20", license = "AGPL-3.0", main
9209
9209
  "@formily/reactive-react": "^2.2.27",
9210
9210
  "@formily/shared": "^2.2.27",
9211
9211
  "@formily/validator": "^2.2.27",
9212
- "@nocobase/evaluators": "1.6.20",
9213
- "@nocobase/sdk": "1.6.20",
9214
- "@nocobase/utils": "1.6.20",
9212
+ "@nocobase/evaluators": "1.6.21",
9213
+ "@nocobase/sdk": "1.6.21",
9214
+ "@nocobase/utils": "1.6.21",
9215
9215
  ahooks: "^3.7.2",
9216
9216
  antd: "5.12.8",
9217
9217
  "antd-style": "3.7.1",
@@ -9712,7 +9712,7 @@ function useDesignable() {
9712
9712
  if (typeof C != "string")
9713
9713
  return C;
9714
9714
  const b = get$1(i, C);
9715
- return (S = b[LAZY_COMPONENT_KEY]) != null ? S : b;
9715
+ return (S = b == null ? void 0 : b[LAZY_COMPONENT_KEY]) != null ? S : b;
9716
9716
  },
9717
9717
  [get$1]
9718
9718
  ),
@@ -11058,9 +11058,7 @@ const InternalTableBlockProvider = (e) => {
11058
11058
  var g;
11059
11059
  const { t } = useTranslation(), { getCollectionJoinField: o, getCollection: n } = useCollectionManager_deprecated(), r = useFieldSchema(), i = (e == null ? void 0 : e.fieldSchema) || r, a = useField(), l = useForm(), c = (i == null ? void 0 : i["x-read-pretty"]) || a.readPretty || l.readPretty, u = e == null ? void 0 : e.fieldSchema, { getField: d } = useCollection_deprecated(), p = (e == null ? void 0 : e.collectionField) || d(i.name) || o(i["x-collection-field"]), { label: m } = ((g = i["x-component-props"]) == null ? void 0 : g.fieldNames) || {};
11060
11060
  return (useMemo(() => {
11061
- if (!p || !(p != null && p.interface) || !["o2o", "oho", "obo", "o2m", "linkTo", "m2o", "m2m", "updatedBy", "createdBy", "mbm", "attachmentURL"].includes(
11062
- p.interface
11063
- ))
11061
+ if (!p || !(p != null && p.interface) || !["hasOne", "hasMany", "belongsTo", "belongsToMany", "belongsToArray"].includes(p.type))
11064
11062
  return;
11065
11063
  const f = n(p.target);
11066
11064
  if ((f == null ? void 0 : f.template) === "file")
@@ -12069,34 +12067,35 @@ const useGetAriaLabelOfModal = () => {
12069
12067
  }
12070
12068
  );
12071
12069
  function useDelayedVisible(e, t = 200) {
12072
- const [o, n] = useState(!1);
12070
+ const [o, n] = useState(t === 0);
12073
12071
  return useEffect(() => {
12074
- if (e) {
12075
- const r = setTimeout(() => n(!0), t);
12076
- return () => clearTimeout(r);
12077
- } else
12078
- n(!1);
12079
- }, [e]), o;
12072
+ if (!o)
12073
+ if (e) {
12074
+ const r = setTimeout(() => n(!0), t);
12075
+ return () => clearTimeout(r);
12076
+ } else
12077
+ n(!1);
12078
+ }, [t, o, e]), o;
12080
12079
  }
12081
12080
  const InternalActionModal = observer$1(
12082
12081
  (e) => {
12083
- const v = e, { footerNodeName: t = "Action.Modal.Footer", width: o, zIndex: n } = v, r = Y(v, ["footerNodeName", "width", "zIndex"]), { visible: i, setVisible: a, openSize: l = "middle", modalProps: c } = useActionContext(), u = o != null ? o : openSizeWidthMap.get(l), d = useFieldSchema(), p = useField(), { token: m } = useToken(), h = useTabsContext(), g = useZIndexContext(), f = d.reduceProperties((F, I) => I["x-component"] === t ? I : F), { hidden: C } = useCurrentPopupContext(), b = !!f, S = getZIndex("modal", n || g, e.level || 0), y = useDelayedVisible(i, 200);
12084
- return /* @__PURE__ */ jsx(ActionContextNoRerender, { children: /* @__PURE__ */ jsx(zIndexContext.Provider, { value: S, children: /* @__PURE__ */ jsx(TabsContextProvider, P(x({}, h), { tabBarExtraContent: null, children: /* @__PURE__ */ jsx(
12082
+ const F = e, { footerNodeName: t = "Action.Modal.Footer", width: o, zIndex: n, delay: r = 200 } = F, i = Y(F, ["footerNodeName", "width", "zIndex", "delay"]), { visible: a, setVisible: l, openSize: c = "middle", modalProps: u } = useActionContext(), d = o != null ? o : openSizeWidthMap.get(c), p = useFieldSchema(), m = useField(), { token: h } = useToken(), g = useTabsContext(), f = useZIndexContext(), C = p.reduceProperties((I, w) => w["x-component"] === t ? w : I), { hidden: b } = useCurrentPopupContext(), S = !!C, y = getZIndex("modal", n || f, e.level || 0), v = useDelayedVisible(a, r);
12083
+ return /* @__PURE__ */ jsx(ActionContextNoRerender, { children: /* @__PURE__ */ jsx(zIndexContext.Provider, { value: y, children: /* @__PURE__ */ jsx(TabsContextProvider, P(x({}, g), { tabBarExtraContent: null, children: /* @__PURE__ */ jsx(
12085
12084
  Modal,
12086
12085
  P(x(x({
12087
- zIndex: C ? -1 : S,
12088
- width: u,
12089
- title: p.title
12090
- }, r), c), {
12091
- style: x(x({}, c == null ? void 0 : c.style), r == null ? void 0 : r.style),
12086
+ zIndex: b ? -1 : y,
12087
+ width: d,
12088
+ title: m.title
12089
+ }, i), u), {
12090
+ style: x(x({}, u == null ? void 0 : u.style), i == null ? void 0 : i.style),
12092
12091
  destroyOnClose: !0,
12093
- open: i,
12092
+ open: a,
12094
12093
  onCancel: () => {
12095
- a(!1, !0);
12094
+ l(!1, !0);
12096
12095
  },
12097
12096
  className: cls(
12098
- r.className,
12099
- c == null ? void 0 : c.className,
12097
+ i.className,
12098
+ u == null ? void 0 : u.className,
12100
12099
  css`
12101
12100
  &.nb-action-popup {
12102
12101
  .ant-modal-header {
@@ -12111,28 +12110,28 @@ const InternalActionModal = observer$1(
12111
12110
 
12112
12111
  // 这里的样式是为了保证页面 tabs 标签下面的分割线和页面内容对齐(页面内边距可以通过主题编辑器调节)
12113
12112
  .ant-tabs-nav {
12114
- padding-left: ${m.paddingLG - m.paddingPageHorizontal}px;
12115
- padding-right: ${m.paddingLG - m.paddingPageHorizontal}px;
12116
- margin-left: ${m.paddingPageHorizontal - m.paddingLG}px;
12117
- margin-right: ${m.paddingPageHorizontal - m.paddingLG}px;
12113
+ padding-left: ${h.paddingLG - h.paddingPageHorizontal}px;
12114
+ padding-right: ${h.paddingLG - h.paddingPageHorizontal}px;
12115
+ margin-left: ${h.paddingPageHorizontal - h.paddingLG}px;
12116
+ margin-right: ${h.paddingPageHorizontal - h.paddingLG}px;
12118
12117
  }
12119
12118
 
12120
12119
  .ant-modal-footer {
12121
- display: ${b ? "block" : "none"};
12120
+ display: ${S ? "block" : "none"};
12122
12121
  }
12123
12122
  }
12124
12123
  `
12125
12124
  ),
12126
- footer: b ? /* @__PURE__ */ jsx(
12125
+ footer: S ? /* @__PURE__ */ jsx(
12127
12126
  NocoBaseRecursionField,
12128
12127
  {
12129
- basePath: p.address,
12130
- schema: d,
12128
+ basePath: m.address,
12129
+ schema: p,
12131
12130
  onlyRenderProperties: !0,
12132
- filterProperties: (F) => F["x-component"] === t
12131
+ filterProperties: (I) => I["x-component"] === t
12133
12132
  }
12134
12133
  ) : !1,
12135
- children: y ? /* @__PURE__ */ jsx(ActionModalContent, { footerNodeName: t, field: p, schema: d }) : /* @__PURE__ */ jsx(Skeleton, { active: !0, paragraph: { rows: 6 } })
12134
+ children: v ? /* @__PURE__ */ jsx(ActionModalContent, { footerNodeName: t, field: m, schema: p }) : /* @__PURE__ */ jsx(Skeleton, { active: !0, paragraph: { rows: 6 } })
12136
12135
  })
12137
12136
  ) })) }) });
12138
12137
  },
@@ -16988,7 +16987,7 @@ const useFormItemInitializerFields = (e) => {
16988
16987
  }, useCustomFormItemInitializerFields = (e) => {
16989
16988
  var u;
16990
16989
  const { name: t, currentFields: o } = useCollection_deprecated(), { getInterface: n, getCollection: r } = useCollectionManager_deprecated(), i = useForm(), { readPretty: a = i.readPretty, block: l = "Form" } = e || {}, c = useRemoveGridFormItem();
16991
- return (u = o == null ? void 0 : o.filter((d) => (d == null ? void 0 : d.interface) && d.interface !== "snapshot" && d.type !== "sequence")) == null ? void 0 : u.map((d) => {
16990
+ return (u = o == null ? void 0 : o.filter((d) => !d.inherit && (d == null ? void 0 : d.interface) && d.interface !== "snapshot" && d.type !== "sequence")) == null ? void 0 : u.map((d) => {
16992
16991
  var h, g, f;
16993
16992
  const p = n(d.interface), m = {
16994
16993
  type: "string",
@@ -17022,7 +17021,7 @@ const useFormItemInitializerFields = (e) => {
17022
17021
  }, findSchema = (e, t, o, n) => Schema.isSchemaInstance(e) ? e.reduceProperties((r, i) => {
17023
17022
  if (i[t] === o && (!n || i.name === n))
17024
17023
  return i;
17025
- if (i["x-component"] !== "Action.Container" && !i["x-component"].includes("AssociationField")) {
17024
+ if (i["x-component"] && i["x-component"] !== "Action.Container" && !i["x-component"].includes("AssociationField")) {
17026
17025
  const a = findSchema(i, t, o, n);
17027
17026
  if (a)
17028
17027
  return a;
@@ -24759,6 +24758,7 @@ function InputInner(e) {
24759
24758
  );
24760
24759
  return /* @__PURE__ */ jsx(Input$3, P(x({}, n), { onChange: r }));
24761
24760
  }
24761
+ InputInner.Password = Input$3.Password;
24762
24762
  const Input$2 = Object.assign(
24763
24763
  connect(
24764
24764
  InputInner,
@@ -78,6 +78,7 @@ export type ActionDrawerProps<T = DrawerProps> = T & {
78
78
  footerNodeName?: string;
79
79
  /** 当前弹窗嵌套的层级 */
80
80
  level?: number;
81
+ delay?: number;
81
82
  };
82
83
  export type ComposedActionDrawer<T = DrawerProps> = React.FC<ActionDrawerProps<T>> & {
83
84
  Footer?: React.FC;