@nocobase/client 1.5.13 → 1.5.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.
Files changed (3) hide show
  1. package/es/index.mjs +61 -59
  2. package/lib/index.js +23 -26
  3. package/package.json +5 -5
package/es/index.mjs CHANGED
@@ -9033,7 +9033,8 @@ const genCommonStyle = (e, t) => {
9033
9033
  }
9034
9034
  },
9035
9035
  [`${t}-item-content`]: {
9036
- marginLeft: e.marginXS
9036
+ // 相当于 Menu 的 iconMarginInlineEnd,参见:https://github.com/ant-design/ant-design/blob/6a62d9e7eaf3e683c673091e39fe65ba3204d94b/components/menu/style/index.ts#L942
9037
+ marginLeft: e.controlHeightSM - e.fontSize
9037
9038
  }
9038
9039
  };
9039
9040
  }), SchemaInitializerContext = createContext({});
@@ -35211,7 +35212,7 @@ function addAppVersion(e, t) {
35211
35212
  addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
35212
35213
  }), e;
35213
35214
  }
35214
- const name = "@nocobase/client", version = "1.5.13", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
35215
+ const name = "@nocobase/client", version = "1.5.15", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
35215
35216
  "@ahooksjs/use-url-state": "3.5.1",
35216
35217
  "@ant-design/cssinjs": "^1.11.1",
35217
35218
  "@ant-design/icons": "^5.1.4",
@@ -35233,9 +35234,9 @@ const name = "@nocobase/client", version = "1.5.13", license = "AGPL-3.0", main
35233
35234
  "@formily/reactive-react": "^2.2.27",
35234
35235
  "@formily/shared": "^2.2.27",
35235
35236
  "@formily/validator": "^2.2.27",
35236
- "@nocobase/evaluators": "1.5.13",
35237
- "@nocobase/sdk": "1.5.13",
35238
- "@nocobase/utils": "1.5.13",
35237
+ "@nocobase/evaluators": "1.5.15",
35238
+ "@nocobase/sdk": "1.5.15",
35239
+ "@nocobase/utils": "1.5.15",
35239
35240
  ahooks: "^3.7.2",
35240
35241
  antd: "5.12.8",
35241
35242
  "antd-style": "3.7.1",
@@ -38779,7 +38780,7 @@ function Uploader(n) {
38779
38780
  var M;
38780
38781
  return c((M = B.response) == null ? void 0 : M.data);
38781
38782
  })];
38782
- z.length ? d(w) : (l == null || l([...a, ...w]), d([]));
38783
+ z.length ? d(w) : (l == null || l([...a || [], ...w]), d([]));
38783
38784
  }
38784
38785
  } else {
38785
38786
  const $ = j.fileList.find((w) => w.uid === j.file.uid);
@@ -39421,32 +39422,34 @@ function transformNestedData(e) {
39421
39422
  }
39422
39423
  return e && n(e), t;
39423
39424
  }
39424
- const InternalNesterCss = css`
39425
- & .ant-formily-item-layout-vertical {
39426
- margin-bottom: 10px;
39427
- }
39428
- .ant-card-body {
39429
- padding: 15px 20px 5px;
39430
- }
39431
- .ant-divider-horizontal {
39432
- margin: 10px 0;
39433
- }
39434
- `, InternalNesterCardCss = css`
39425
+ const InternalNesterCardCss = css`
39435
39426
  .ant-card-bordered {
39436
39427
  border: none;
39437
39428
  }
39438
39429
  .ant-card-body {
39439
- padding: 0px 20px 20px 0px;
39430
+ padding: 0px 20px 0px 0px;
39440
39431
  }
39441
39432
  `, InternalNester = observer$1(
39442
39433
  () => {
39443
- var p, m;
39444
- const e = useField(), t = useFieldSchema(), n = useInsertSchema$1("Nester"), { options: o } = useAssociationFieldContext(), r = (m = (p = t["x-decorator-props"]) == null ? void 0 : p.showTitle) != null ? m : !0, { actionName: i } = useACLActionParamsContext(), { token: a } = theme$1.useToken(), {
39434
+ var m, h;
39435
+ const e = useField(), t = useFieldSchema(), n = useInsertSchema$1("Nester"), { options: o } = useAssociationFieldContext(), r = (h = (m = t["x-decorator-props"]) == null ? void 0 : m.showTitle) != null ? h : !0, { actionName: i } = useACLActionParamsContext(), { token: a } = theme$1.useToken(), {
39445
39436
  layout: l = "vertical",
39446
39437
  labelAlign: c = "left",
39447
39438
  labelWidth: u = 120,
39448
39439
  labelWrap: d = !0
39449
- } = (t == null ? void 0 : t["x-component-props"]) || {};
39440
+ } = (t == null ? void 0 : t["x-component-props"]) || {}, p = css`
39441
+ margin-top: 0.4em;
39442
+
39443
+ & .ant-formily-item-layout-vertical {
39444
+ margin-bottom: 10px;
39445
+ }
39446
+ .ant-card-body {
39447
+ padding: ${a.padding}px ${a.paddingLG}px;
39448
+ }
39449
+ .ant-divider-horizontal {
39450
+ margin: 10px 0;
39451
+ }
39452
+ `;
39450
39453
  return useEffect(() => {
39451
39454
  n(schema$1.Nester);
39452
39455
  }, []), /* @__PURE__ */ jsx(CollectionProvider_deprecated, { name: o.target, children: /* @__PURE__ */ jsx(ACLCollectionProvider, { actionPath: `${o.target}:${i || "view"}`, children: /* @__PURE__ */ jsx(
@@ -39460,7 +39463,7 @@ const InternalNesterCss = css`
39460
39463
  "div",
39461
39464
  {
39462
39465
  className: cx(
39463
- InternalNesterCss,
39466
+ p,
39464
39467
  {
39465
39468
  [InternalNesterCardCss]: r === !1
39466
39469
  },
@@ -39482,7 +39485,7 @@ const InternalNesterCss = css`
39482
39485
  onlyRenderProperties: !0,
39483
39486
  basePath: e.address,
39484
39487
  schema: t,
39485
- filterProperties: (h) => h["x-component"] === "AssociationField.Nester"
39488
+ filterProperties: (g) => g["x-component"] === "AssociationField.Nester"
39486
39489
  }
39487
39490
  )
39488
39491
  }
@@ -42817,6 +42820,14 @@ const Block = observer$1(
42817
42820
  const { componentCls: t } = e;
42818
42821
  return {
42819
42822
  [t]: {
42823
+ ".nb-action-bar": {
42824
+ borderRadius: e.borderRadiusBlock,
42825
+ marginBottom: `${e.marginBlock / 2}px !important`
42826
+ },
42827
+ ".ant-list-pagination": {
42828
+ borderRadius: e.borderRadiusBlock,
42829
+ marginTop: `${e.marginBlock / 2}px !important`
42830
+ },
42820
42831
  "& > .nb-block-item": {
42821
42832
  marginBottom: e.marginLG,
42822
42833
  "& > .nb-action-bar:has(:first-child:not(:empty))": {
@@ -42867,15 +42878,10 @@ const InternalGridCardBlockProvider = (e) => {
42867
42878
  `, gridCardCss = css`
42868
42879
  height: 100%;
42869
42880
  > .ant-card-body {
42870
- padding: 24px 24px 0px;
42871
42881
  height: 100%;
42872
- button {
42873
- margin-bottom: 0px !important;
42874
- margin-top: 5px;
42875
- }
42876
42882
  }
42877
42883
  .nb-action-bar {
42878
- padding: 5px 0;
42884
+ padding-top: 5px;
42879
42885
  }
42880
42886
  `, GridCardItem = withDynamicSchemaProps(
42881
42887
  (e) => {
@@ -42895,10 +42901,6 @@ const InternalGridCardBlockProvider = (e) => {
42895
42901
  return;
42896
42902
  const u = t || r ? e.controlHeight + 2 * e.paddingLG + e.marginLG : 0, d = c ? e.controlHeight + 2 * e.paddingLG + e.marginLG : 0;
42897
42903
  return n - u - d;
42898
- }, rowGutter = {
42899
- md: 12,
42900
- sm: 5,
42901
- xs: 5
42902
42904
  }, designerCss$2 = css`
42903
42905
  width: 100%;
42904
42906
  &:hover {
@@ -42963,31 +42965,31 @@ const InternalGridCardBlockProvider = (e) => {
42963
42965
  };
42964
42966
  }, InternalGridCard = withSkeletonComponent(
42965
42967
  (e) => {
42966
- var F;
42967
- const { columnCount: t, pagination: n } = useProps(e), { service: o, columnCount: r = defaultColumnCount } = useGridCardBlockContext(), i = t || r, { run: a, params: l } = o, c = (F = o == null ? void 0 : o.data) == null ? void 0 : F.meta, u = useFieldSchema(), d = useField(), p = useDesigner(), m = useGridCardBodyHeight(), h = useCallback(
42968
- (I) => new Schema({
42968
+ var I;
42969
+ const { columnCount: t, pagination: n } = useProps(e), { service: o, columnCount: r = defaultColumnCount } = useGridCardBlockContext(), i = t || r, { run: a, params: l } = o, c = (I = o == null ? void 0 : o.data) == null ? void 0 : I.meta, u = useFieldSchema(), d = useField(), p = useDesigner(), m = useGridCardBodyHeight(), h = useCallback(
42970
+ (R) => new Schema({
42969
42971
  type: "object",
42970
42972
  properties: {
42971
- [I]: x({}, u.properties.item)
42973
+ [R]: x({}, u.properties.item)
42972
42974
  }
42973
42975
  }),
42974
42976
  [u.properties]
42975
- ), g = useCallback(
42976
- (I, R) => {
42977
+ ), { token: g } = useToken$1(), f = useCallback(
42978
+ (R, k) => {
42977
42979
  a(P(x({}, l == null ? void 0 : l[0]), {
42978
- page: I,
42979
- pageSize: R
42980
+ page: R,
42981
+ pageSize: k
42980
42982
  }));
42981
42983
  },
42982
42984
  [a, l]
42983
- ), f = P(x(x({}, usePaginationProps$1()), n), {
42984
- onChange: g
42985
- }), C = getCardItemSchema == null ? void 0 : getCardItemSchema(u), {
42986
- layout: b = "vertical",
42987
- labelAlign: S = "left",
42988
- labelWidth: y = 120,
42989
- labelWrap: v = !0
42990
- } = (C == null ? void 0 : C["x-component-props"]) || {};
42985
+ ), C = P(x(x({}, usePaginationProps$1()), n), {
42986
+ onChange: f
42987
+ }), b = getCardItemSchema == null ? void 0 : getCardItemSchema(u), {
42988
+ layout: S = "vertical",
42989
+ labelAlign: y = "left",
42990
+ labelWidth: v = 120,
42991
+ labelWrap: F = !0
42992
+ } = (b == null ? void 0 : b["x-component-props"]) || {};
42991
42993
  return /* @__PURE__ */ jsx(
42992
42994
  SchemaComponentOptions,
42993
42995
  {
@@ -43016,29 +43018,29 @@ const InternalGridCardBlockProvider = (e) => {
43016
43018
  /* @__PURE__ */ jsx(
43017
43019
  FormLayout,
43018
43020
  {
43019
- layout: b,
43020
- labelAlign: S,
43021
- labelWidth: b === "horizontal" ? y : null,
43022
- labelWrap: v,
43021
+ layout: S,
43022
+ labelAlign: y,
43023
+ labelWidth: S === "horizontal" ? v : null,
43024
+ labelWrap: F,
43023
43025
  children: /* @__PURE__ */ jsx(
43024
43026
  List$1,
43025
43027
  {
43026
- pagination: !c || c.count <= c.pageSize ? !1 : x({}, f),
43028
+ pagination: !c || c.count <= c.pageSize ? !1 : x({}, C),
43027
43029
  dataSource: d.value,
43028
43030
  grid: P(x({}, i), {
43029
43031
  sm: i.xs,
43030
43032
  xl: i.lg,
43031
- gutter: [rowGutter, rowGutter]
43033
+ gutter: [g.marginBlock / 2, g.marginBlock / 2]
43032
43034
  }),
43033
- renderItem: (I, R) => /* @__PURE__ */ jsx(Col, { style: { height: "100%" }, className: "nb-card-item-warper", children: /* @__PURE__ */ jsx(
43035
+ renderItem: (R, k) => /* @__PURE__ */ jsx(Col, { style: { height: "100%" }, className: "nb-card-item-warper", children: /* @__PURE__ */ jsx(
43034
43036
  NocoBaseRecursionField,
43035
43037
  {
43036
43038
  basePath: d.address,
43037
- name: R,
43039
+ name: k,
43038
43040
  onlyRenderProperties: !0,
43039
- schema: h(R)
43041
+ schema: h(k)
43040
43042
  },
43041
- R
43043
+ k
43042
43044
  ) }),
43043
43045
  loading: o == null ? void 0 : o.loading
43044
43046
  }