@nocobase/client 1.3.35-beta → 1.3.37-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
@@ -3588,6 +3588,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3588
3588
  get useSortFields() {
3589
3589
  return useSortFields;
3590
3590
  },
3591
+ get useSourceId() {
3592
+ return useSourceId;
3593
+ },
3591
3594
  get useSourceIdFromParentRecord() {
3592
3595
  return useSourceIdFromParentRecord;
3593
3596
  },
@@ -4125,7 +4128,7 @@ function addAppVersion(e, t) {
4125
4128
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
4126
4129
  }), e;
4127
4130
  }
4128
- const name = "@nocobase/client", version$1 = "1.3.35-beta", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
4131
+ const name = "@nocobase/client", version$1 = "1.3.37-beta", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
4129
4132
  "@ahooksjs/use-url-state": "3.5.1",
4130
4133
  "@ant-design/cssinjs": "^1.11.1",
4131
4134
  "@ant-design/icons": "^5.1.4",
@@ -4146,9 +4149,9 @@ const name = "@nocobase/client", version$1 = "1.3.35-beta", license = "AGPL-3.0"
4146
4149
  "@formily/reactive-react": "^2.2.27",
4147
4150
  "@formily/shared": "^2.2.27",
4148
4151
  "@formily/validator": "^2.2.27",
4149
- "@nocobase/evaluators": "1.3.35-beta",
4150
- "@nocobase/sdk": "1.3.35-beta",
4151
- "@nocobase/utils": "1.3.35-beta",
4152
+ "@nocobase/evaluators": "1.3.37-beta",
4153
+ "@nocobase/sdk": "1.3.37-beta",
4154
+ "@nocobase/utils": "1.3.37-beta",
4152
4155
  ahooks: "^3.7.2",
4153
4156
  antd: "5.12.8",
4154
4157
  "antd-style": "3.4.5",
@@ -13968,7 +13971,7 @@ Grid.Col = observer$1(
13968
13971
  }
13969
13972
  }), /* @__PURE__ */ jsx(GridColContext.Provider, { value: { cols: t, schema: n }, children: /* @__PURE__ */ jsx("div", { ref: c, style: g(g({}, a), p), className: cls("nb-grid-col"), children: e.children }) });
13970
13973
  },
13971
- { displayName: "Grid.Row" }
13974
+ { displayName: "Grid.Col" }
13972
13975
  );
13973
13976
  Grid.wrap = (e) => ({
13974
13977
  type: "void",
@@ -19557,20 +19560,17 @@ function WorkflowSelect(r) {
19557
19560
  function WorkflowConfig() {
19558
19561
  var u;
19559
19562
  const { dn: e } = useDesignable(), { t } = useTranslation(), o = useFieldSchema(), n = useCollection_deprecated(), r = useFormBlockContext(), i = (r == null ? void 0 : r.type) || o["x-action"], a = r == null ? void 0 : r.type, l = o["x-action"], c = {
19560
- submit: t(
19561
- "Workflow will be triggered before or after submitting succeeded based on workflow type (supports pre/post action event in local mode, and approval event).",
19562
- {
19563
- ns: "workflow"
19564
- }
19565
- ),
19563
+ submit: t("Support pre-action event (local mode), post-action event (local mode), and approval event here.", {
19564
+ ns: "workflow"
19565
+ }),
19566
19566
  "customize:save": t(
19567
- "Workflow will be triggered before or after submitting succeeded based on workflow type (supports pre/post action event in local mode, and approval event).",
19567
+ "Support pre-action event (local mode), post-action event (local mode), and approval event here.",
19568
19568
  {
19569
19569
  ns: "workflow"
19570
19570
  }
19571
19571
  ),
19572
19572
  "customize:update": t(
19573
- "Workflow will be triggered before or after submitting succeeded based on workflow type (supports pre/post action event in local mode, and approval event).",
19573
+ "Support pre-action event (local mode), post-action event (local mode), and approval event here.",
19574
19574
  { ns: "workflow" }
19575
19575
  ),
19576
19576
  "customize:triggerWorkflows": t(
@@ -36222,15 +36222,15 @@ const useColumnsDeepMemoized = (e) => {
36222
36222
  const n = e, { index: t } = n, o = W(n, ["index"]);
36223
36223
  return /* @__PURE__ */ jsx("div", F(g({ className: cls("nb-table-index"), style: { padding: "0 8px 0 16px" } }, o), { children: t }));
36224
36224
  }, pageSizeOptions$1 = [5, 10, 20, 50, 100, 200], usePaginationProps$2 = (e, t) => {
36225
- var x;
36225
+ var x, f;
36226
36226
  const { t: o } = useTranslation(), n = useField(), { token: r } = useToken(), { data: i } = useDataBlockRequest() || {}, { meta: a } = i || {}, { hasNext: l } = a || {}, c = useMemo(
36227
36227
  () => g(g({}, e), t),
36228
36228
  [JSON.stringify(g(g({}, e), t))]
36229
36229
  ), { total: u, current: d, pageSize: p } = c || {}, m = useCallback(
36230
- (f) => o("Total {{count}} items", { count: f }),
36230
+ (C) => o("Total {{count}} items", { count: C }),
36231
36231
  [o, u]
36232
36232
  ), h = useMemo(() => {
36233
- var f;
36233
+ var C;
36234
36234
  return u ? g({
36235
36235
  pageSizeOptions: pageSizeOptions$1,
36236
36236
  showTotal: m,
@@ -36243,13 +36243,13 @@ const useColumnsDeepMemoized = (e) => {
36243
36243
  showSizeChanger: !0,
36244
36244
  hideOnSinglePage: !1
36245
36245
  }, c), {
36246
- total: ((f = n.value) == null ? void 0 : f.length) < p || !l ? p * d : p * d + 1,
36246
+ total: ((C = n.value) == null ? void 0 : C.length) < p || !l ? p * d : p * d + 1,
36247
36247
  className: css`
36248
36248
  .ant-pagination-simple-pager {
36249
36249
  display: none !important;
36250
36250
  }
36251
36251
  `,
36252
- itemRender: (C, S, b) => S === "prev" ? /* @__PURE__ */ jsxs(
36252
+ itemRender: (S, b, v) => b === "prev" ? /* @__PURE__ */ jsxs(
36253
36253
  "div",
36254
36254
  {
36255
36255
  style: { display: "flex" },
@@ -36259,15 +36259,15 @@ const useColumnsDeepMemoized = (e) => {
36259
36259
  }
36260
36260
  `,
36261
36261
  children: [
36262
- b,
36262
+ v,
36263
36263
  " ",
36264
36264
  /* @__PURE__ */ jsx("div", { style: { marginLeft: "7px" }, children: d })
36265
36265
  ]
36266
36266
  }
36267
- ) : b
36267
+ ) : v
36268
36268
  });
36269
36269
  }, [c, o, m, (x = n.value) == null ? void 0 : x.length]);
36270
- return t === !1 || !t && e === !1 || h.total <= h.pageSize ? !1 : h;
36270
+ return t === !1 || !t && e === !1 ? !1 : ((f = n.value) == null ? void 0 : f.length) > 0 ? h : !1;
36271
36271
  }, headerClass = css`
36272
36272
  max-width: 300px;
36273
36273
  white-space: nowrap;
@@ -38969,23 +38969,23 @@ const InternalListBlockProvider = (e) => {
38969
38969
  const d = i ? o.fontSizeLG * o.lineHeightLG + o.padding * 2 - 1 : 0, m = Object.keys(((x = t.parent.properties.actionBar) == null ? void 0 : x.properties) || {}).length > 0 || n ? o.controlHeight + 2 * o.marginLG : o.marginLG, h = u ? o.controlHeight + o.paddingLG + o.marginLG : o.marginLG;
38970
38970
  return e - m - h - d;
38971
38971
  }, InternalList = (e) => {
38972
- var S, b;
38972
+ var S, b, v;
38973
38973
  const { service: t } = useListBlockContext(), { run: o, params: n } = t, r = useFieldSchema(), i = useDesigner(), a = (S = t == null ? void 0 : t.data) == null ? void 0 : S.meta, l = useField(), [c] = useState(/* @__PURE__ */ new Map()), { wrapSSR: u, componentCls: d, hashId: p } = useStyles$5(), m = useListBlockHeight(), { token: h } = theme.useToken(), x = useCallback(
38974
- (v) => (c.has(v) || c.set(
38975
- v,
38974
+ (y) => (c.has(y) || c.set(
38975
+ y,
38976
38976
  new Schema({
38977
38977
  type: "object",
38978
38978
  properties: {
38979
- [v]: r.properties.item
38979
+ [y]: r.properties.item
38980
38980
  }
38981
38981
  })
38982
- ), c.get(v)),
38982
+ ), c.get(y)),
38983
38983
  [r.properties, c]
38984
38984
  ), f = [5, 10, 20, 50, 100, 200], C = useCallback(
38985
- (v, y) => {
38985
+ (y, P) => {
38986
38986
  o(F(g({}, n == null ? void 0 : n[0]), {
38987
- page: v,
38988
- pageSize: y
38987
+ page: y,
38988
+ pageSize: P
38989
38989
  }));
38990
38990
  },
38991
38991
  [o, n]
@@ -39020,7 +39020,7 @@ const InternalListBlockProvider = (e) => {
39020
39020
  /* @__PURE__ */ jsx("div", { className: "nb-list-container", children: /* @__PURE__ */ jsx(
39021
39021
  List$1,
39022
39022
  F(g({}, e), {
39023
- pagination: !a || a.count <= a.pageSize ? !1 : {
39023
+ pagination: !a || !((b = l.value) != null && b.length) ? !1 : {
39024
39024
  onChange: C,
39025
39025
  total: (a == null ? void 0 : a.count) || 0,
39026
39026
  pageSize: (a == null ? void 0 : a.pageSize) || 10,
@@ -39029,15 +39029,15 @@ const InternalListBlockProvider = (e) => {
39029
39029
  pageSizeOptions: f
39030
39030
  },
39031
39031
  loading: t == null ? void 0 : t.loading,
39032
- children: (b = l.value) != null && b.length ? l.value.map((v, y) => /* @__PURE__ */ jsx(
39032
+ children: (v = l.value) != null && v.length ? l.value.map((y, P) => /* @__PURE__ */ jsx(
39033
39033
  RecursionField,
39034
39034
  {
39035
39035
  basePath: l.address,
39036
- name: y,
39036
+ name: P,
39037
39037
  onlyRenderProperties: !0,
39038
- schema: x(y)
39038
+ schema: x(P)
39039
39039
  },
39040
- y
39040
+ P
39041
39041
  )) : null
39042
39042
  })
39043
39043
  ) }),
@@ -60023,6 +60023,7 @@ export {
60023
60023
  useSchemaToolbar,
60024
60024
  useSchemaToolbarRender,
60025
60025
  useSortFields,
60026
+ useSourceId,
60026
60027
  useSourceIdFromParentRecord,
60027
60028
  useSourceIdFromRecord,
60028
60029
  useStyles$3 as useStyles,
@@ -9,3 +9,4 @@
9
9
  export * from './data-blocks/details-multi';
10
10
  export * from './data-blocks/details-single';
11
11
  export * from './useActionAvailable';
12
+ export * from './useSourceId';
@@ -86,4 +86,5 @@ export declare function toValueItem(file: any): any;
86
86
  export declare const toItem: (file: any) => any;
87
87
  export declare const toFileList: (fileList: any) => any[];
88
88
  export declare const toValue: (fileList: any) => any[];
89
+ export declare function validate(file: any, rules: Record<string, any>): string;
89
90
  export declare function useBeforeUpload(rules: any): (file: any) => boolean;