@nocobase/client 2.0.2 → 2.0.5

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
@@ -3470,6 +3470,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3470
3470
  get appendQueryStringToUrl() {
3471
3471
  return appendQueryStringToUrl;
3472
3472
  },
3473
+ get applyMobilePaginationProps() {
3474
+ return applyMobilePaginationProps;
3475
+ },
3473
3476
  get attachmentFileTypes() {
3474
3477
  return attachmentFileTypes;
3475
3478
  },
@@ -3521,6 +3524,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3521
3524
  get constraintsProps() {
3522
3525
  return constraintsProps;
3523
3526
  },
3527
+ get createCompactSimpleItemRender() {
3528
+ return createCompactSimpleItemRender;
3529
+ },
3524
3530
  get createCreateFormBlockUISchema() {
3525
3531
  return createCreateFormBlockUISchema;
3526
3532
  },
@@ -3788,6 +3794,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3788
3794
  get getLabelWithTooltip() {
3789
3795
  return getLabelWithTooltip;
3790
3796
  },
3797
+ get getMobileCompactPaginationClassName() {
3798
+ return getMobileCompactPaginationClassName;
3799
+ },
3791
3800
  get getPageMenuSchema() {
3792
3801
  return getPageMenuSchema;
3793
3802
  },
@@ -3803,6 +3812,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3803
3812
  get getShouldChange() {
3804
3813
  return getShouldChange;
3805
3814
  },
3815
+ get getSimpleModePaginationClassName() {
3816
+ return getSimpleModePaginationClassName;
3817
+ },
3806
3818
  get getStoredPopupContext() {
3807
3819
  return getStoredPopupContext;
3808
3820
  },
@@ -3824,6 +3836,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3824
3836
  get getUniqueKeyFromCollection() {
3825
3837
  return getUniqueKeyFromCollection;
3826
3838
  },
3839
+ get getUnknownCountPaginationTotal() {
3840
+ return getUnknownCountPaginationTotal;
3841
+ },
3827
3842
  get getValueWithIndex() {
3828
3843
  return getValueWithIndex;
3829
3844
  },
@@ -3974,6 +3989,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3974
3989
  get mergeFilter() {
3975
3990
  return mergeFilter;
3976
3991
  },
3992
+ get mergePaginationClassName() {
3993
+ return mergePaginationClassName;
3994
+ },
3977
3995
  get mockAPIClient() {
3978
3996
  return mockAPIClient;
3979
3997
  },
@@ -9939,7 +9957,7 @@ function addAppVersion(e, t) {
9939
9957
  addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
9940
9958
  }), e;
9941
9959
  }
9942
- const name = "@nocobase/client", version = "2.0.2", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9960
+ const name = "@nocobase/client", version = "2.0.5", license = "Apache-2.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
9943
9961
  "@ahooksjs/use-url-state": "3.5.1",
9944
9962
  "@ant-design/cssinjs": "^1.11.1",
9945
9963
  "@ant-design/icons": "^5.6.1",
@@ -9962,10 +9980,10 @@ const name = "@nocobase/client", version = "2.0.2", license = "AGPL-3.0", main =
9962
9980
  "@formily/reactive-react": "^2.2.27",
9963
9981
  "@formily/shared": "^2.2.27",
9964
9982
  "@formily/validator": "^2.2.27",
9965
- "@nocobase/evaluators": "2.0.2",
9966
- "@nocobase/flow-engine": "2.0.2",
9967
- "@nocobase/sdk": "2.0.2",
9968
- "@nocobase/utils": "2.0.2",
9983
+ "@nocobase/evaluators": "2.0.5",
9984
+ "@nocobase/flow-engine": "2.0.5",
9985
+ "@nocobase/sdk": "2.0.5",
9986
+ "@nocobase/utils": "2.0.5",
9969
9987
  "@tanstack/react-table": "^8.21.3",
9970
9988
  "@types/tabulator-tables": "^6.2.6",
9971
9989
  "acorn-jsx": "^5.3.2",
@@ -26274,6 +26292,17 @@ const components$5 = { TreeSelect: TreeSelect$1 }, toItems$2 = (e, { t, compile:
26274
26292
  children: e.children
26275
26293
  }
26276
26294
  );
26295
+ }, MOBILE_MENU_CLOSE_DELAY_MS = 220, runAfterMobileMenuClosed = ({
26296
+ isMobile: e,
26297
+ closeMobileMenu: t,
26298
+ callback: o,
26299
+ delayMs: n = MOBILE_MENU_CLOSE_DELAY_MS
26300
+ }) => {
26301
+ if (!e) {
26302
+ o();
26303
+ return;
26304
+ }
26305
+ t(), window.setTimeout(o, n);
26277
26306
  }, UserCenterButton = () => {
26278
26307
  const { token: e } = useToken();
26279
26308
  return /* @__PURE__ */ jsx(
@@ -26449,7 +26478,10 @@ const LayoutContent = () => {
26449
26478
  /* @__PURE__ */ jsx(MenuSchemaToolbar, { container: t }),
26450
26479
  /* @__PURE__ */ jsx("div", { ref: e })
26451
26480
  ] });
26452
- }, menuItemStyle = { display: "flex", alignItems: "center", justifyContent: "space-between" }, GroupItem = (e) => {
26481
+ }, menuItemStyle = { display: "flex", alignItems: "center", justifyContent: "space-between" }, MobileMenuControlContext = React.createContext({
26482
+ closeMobileMenu: () => {
26483
+ }
26484
+ }), GroupItem = (e) => {
26453
26485
  var i, a, l, c;
26454
26486
  const { item: t } = e, { designable: o } = useDesignable(), n = useEvaluatedExpression((a = (i = t._route.options) == null ? void 0 : i.badge) == null ? void 0 : a.count), r = { __route__: t._route };
26455
26487
  return /* @__PURE__ */ jsx(ParentRouteContext.Provider, { value: t._parentRoute, children: /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: t._route, children: /* @__PURE__ */ jsxs(SortableItem$1, { id: t._route.id, schema: r, "aria-label": t.name, style: menuItemStyle, children: [
@@ -26468,59 +26500,76 @@ const LayoutContent = () => {
26468
26500
  const { inHeader: t } = useContext(HeaderContext);
26469
26501
  return /* @__PURE__ */ jsx(RouteContext.Consumer, { children: (o) => o.collapsed && !e.hidden && !t ? /* @__PURE__ */ jsx(Tooltip, { title: e.title, placement: "right", children: /* @__PURE__ */ jsx(Badge, A(x({}, e.badgeProps), { style: { transform: "none", maxWidth: "10em" }, dot: !1, children: e.children })) }) : e.children });
26470
26502
  }, MenuItem = (e) => {
26471
- var m, h, g, f, y, b, S, C, F;
26472
- const { item: t } = e, { parseURLAndParams: o } = useParseURLAndParams(), n = useRef(null), r = useLocation(), i = useEvaluatedExpression((h = (m = t._route.options) == null ? void 0 : m.badge) == null ? void 0 : h.count), a = useNavigateNoUpdate(), l = useRouterBasename();
26503
+ var g, f, y, b, S, C, F, P, v, k, I;
26504
+ const { item: t } = e, { parseURLAndParams: o } = useParseURLAndParams(), n = useRef(null), r = useLocation(), i = useEvaluatedExpression((f = (g = t._route.options) == null ? void 0 : g.badge) == null ? void 0 : f.count), a = useNavigateNoUpdate(), l = useRouterBasename(), { closeMobileMenu: c } = useContext(MobileMenuControlContext), u = t.redirect || t.path, d = A(x({}, (y = t._route.options) == null ? void 0 : y.badge), { count: i });
26473
26505
  useEffect(() => {
26474
26506
  n.current && (n.current.parentElement.parentElement.style.order = 999, n.current.parentElement.parentElement.style.paddingLeft = 0, n.current.parentElement.parentElement.style.padding = 0);
26475
26507
  }, []);
26476
- const c = useCallback(
26477
- (P) => V(void 0, null, function* () {
26478
- var D, E, $;
26479
- const v = (D = t._route.options) == null ? void 0 : D.href, k = (E = t._route.options) == null ? void 0 : E.params, I = ($ = t._route.options) == null ? void 0 : $.openInNewWindow;
26480
- P.preventDefault(), P.stopPropagation();
26508
+ const p = useCallback(
26509
+ (D) => V(void 0, null, function* () {
26510
+ var T, w, B, N, j, O;
26511
+ const E = (T = t._route.options) == null ? void 0 : T.href, $ = (w = t._route.options) == null ? void 0 : w.params, M = (B = t._route.options) == null ? void 0 : B.openInNewWindow;
26512
+ D.preventDefault(), D.stopPropagation();
26481
26513
  try {
26482
- const M = yield o(v, k || []);
26483
- I !== !1 ? window.open(M, "_blank") : navigateWithinSelf(v, a, window.location.origin + l);
26484
- } catch (M) {
26485
- console.error(M), window.open(v, "_blank");
26514
+ const q = yield o(E, $ || []);
26515
+ M !== !1 ? ((N = e.options) != null && N.isMobile && c(), window.open(q, "_blank")) : runAfterMobileMenuClosed({
26516
+ isMobile: !!((j = e.options) != null && j.isMobile),
26517
+ closeMobileMenu: c,
26518
+ callback: () => {
26519
+ navigateWithinSelf(E, a, window.location.origin + l);
26520
+ }
26521
+ });
26522
+ } catch (q) {
26523
+ console.error(q), (O = e.options) != null && O.isMobile && c(), window.open(E, "_blank");
26486
26524
  }
26487
26525
  }),
26488
- [o, t]
26526
+ [o, t, (b = e.options) == null ? void 0 : b.isMobile, c, a, l]
26527
+ ), m = useCallback(
26528
+ (D) => {
26529
+ var E, $;
26530
+ if (D.preventDefault(), D.stopPropagation(), !((E = e.options) != null && E.isMobile)) {
26531
+ a(u);
26532
+ return;
26533
+ }
26534
+ runAfterMobileMenuClosed({
26535
+ isMobile: !!(($ = e.options) != null && $.isMobile),
26536
+ closeMobileMenu: c,
26537
+ callback: () => {
26538
+ a(u);
26539
+ }
26540
+ });
26541
+ },
26542
+ [(S = e.options) == null ? void 0 : S.isMobile, c, a, u]
26489
26543
  );
26490
26544
  if (t._hidden)
26491
26545
  return null;
26492
- const u = { __route__: t._route };
26493
- if (t.key === "x-designer-button")
26494
- return /* @__PURE__ */ jsx("div", { ref: n, children: /* @__PURE__ */ jsx(ResetThemeTokenAndKeepAlgorithm, { children: /* @__PURE__ */ jsx(ParentRouteContext.Provider, { value: t._parentRoute, children: /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: t._route, children: e.children }) }) }) });
26495
- if (((g = t._route) == null ? void 0 : g.type) === NocoBaseDesktopRouteType.link)
26496
- return /* @__PURE__ */ jsx(ParentRouteContext.Provider, { value: t._parentRoute, children: /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: t._route, children: /* @__PURE__ */ jsxs(SortableItem$1, { id: t._route.id, schema: u, style: menuItemStyle, children: [
26497
- /* @__PURE__ */ jsx("div", { onClick: c, children: /* @__PURE__ */ jsx(Link$1, { to: r.pathname, "aria-label": t.name, children: e.children }) }),
26498
- /* @__PURE__ */ jsx(MenuSchemaToolbar, {}),
26499
- i != null && /* @__PURE__ */ jsx(
26500
- Badge,
26501
- A(x({}, (f = t._route.options) == null ? void 0 : f.badge), {
26502
- count: i,
26503
- style: { marginLeft: 4, color: (b = (y = t._route.options) == null ? void 0 : y.badge) == null ? void 0 : b.textColor, maxWidth: "10em" },
26504
- dot: !1
26505
- })
26506
- )
26507
- ] }) }) });
26508
- const d = t.redirect || t.path, p = A(x({}, (S = t._route.options) == null ? void 0 : S.badge), { count: i });
26509
- return /* @__PURE__ */ jsx(ParentRouteContext.Provider, { value: t._parentRoute, children: /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: t._route, children: /* @__PURE__ */ jsxs(SortableItem$1, { id: t._route.id, schema: u, style: menuItemStyle, children: [
26546
+ const h = { __route__: t._route };
26547
+ return t.key === "x-designer-button" ? /* @__PURE__ */ jsx("div", { ref: n, children: /* @__PURE__ */ jsx(ResetThemeTokenAndKeepAlgorithm, { children: /* @__PURE__ */ jsx(ParentRouteContext.Provider, { value: t._parentRoute, children: /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: t._route, children: e.children }) }) }) }) : ((C = t._route) == null ? void 0 : C.type) === NocoBaseDesktopRouteType.link ? /* @__PURE__ */ jsx(ParentRouteContext.Provider, { value: t._parentRoute, children: /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: t._route, children: /* @__PURE__ */ jsxs(SortableItem$1, { id: t._route.id, schema: h, style: menuItemStyle, children: [
26548
+ /* @__PURE__ */ jsx("div", { onClick: p, children: /* @__PURE__ */ jsx(Link$1, { to: r.pathname, "aria-label": t.name, children: e.children }) }),
26549
+ /* @__PURE__ */ jsx(MenuSchemaToolbar, {}),
26550
+ i != null && /* @__PURE__ */ jsx(
26551
+ Badge,
26552
+ A(x({}, (F = t._route.options) == null ? void 0 : F.badge), {
26553
+ count: i,
26554
+ style: { marginLeft: 4, color: (v = (P = t._route.options) == null ? void 0 : P.badge) == null ? void 0 : v.textColor, maxWidth: "10em" },
26555
+ dot: !1
26556
+ })
26557
+ )
26558
+ ] }) }) }) : /* @__PURE__ */ jsx(ParentRouteContext.Provider, { value: t._parentRoute, children: /* @__PURE__ */ jsx(NocoBaseRouteContext.Provider, { value: t._route, children: /* @__PURE__ */ jsxs(SortableItem$1, { id: t._route.id, schema: h, style: menuItemStyle, children: [
26510
26559
  /* @__PURE__ */ jsx(
26511
26560
  WithTooltip,
26512
26561
  {
26513
26562
  title: t.name,
26514
26563
  hidden: t._route.type === NocoBaseDesktopRouteType.group || t._depth > 0,
26515
- badgeProps: p,
26516
- children: /* @__PURE__ */ jsx(Link$1, { to: d, "aria-label": t.name, children: e.children })
26564
+ badgeProps: d,
26565
+ children: /* @__PURE__ */ jsx(Link$1, { to: u, "aria-label": t.name, onClick: m, children: e.children })
26517
26566
  }
26518
26567
  ),
26519
26568
  /* @__PURE__ */ jsx(MenuSchemaToolbar, {}),
26520
26569
  i != null && /* @__PURE__ */ jsx(
26521
26570
  Badge,
26522
- A(x({}, p), {
26523
- style: { marginLeft: 4, color: (F = (C = t._route.options) == null ? void 0 : C.badge) == null ? void 0 : F.textColor, maxWidth: "10em" },
26571
+ A(x({}, d), {
26572
+ style: { marginLeft: 4, color: (I = (k = t._route.options) == null ? void 0 : k.badge) == null ? void 0 : I.textColor, maxWidth: "10em" },
26524
26573
  dot: !1
26525
26574
  })
26526
26575
  )
@@ -26639,10 +26688,10 @@ const LayoutContent = () => {
26639
26688
  return /* @__PURE__ */ jsx(t, {});
26640
26689
  }, InternalAdminLayout = (e) => {
26641
26690
  const { allAccessRoutes: t } = useAllAccessDesktopRoutes(), { designable: o } = useDesignable(), n = useLocation(), { onDragEnd: r } = useMenuDragEnd(), { token: i } = useToken(), { isMobileLayout: a } = useMobileLayout(), [l, c] = useState(a), u = useRef(!1), { t: d } = useMenuTranslation(), p = a ? !1 : o, { styles: m } = useHeaderStyle(), { Component: h } = useApplications(), g = useMemo(() => {
26642
- const v = convertRoutesToLayout(t, { designable: p, isMobile: a, t: d });
26691
+ const k = convertRoutesToLayout(t, { designable: p, isMobile: a, t: d });
26643
26692
  return {
26644
26693
  path: "/",
26645
- children: Array.isArray(v) ? v : []
26694
+ children: Array.isArray(k) ? k : []
26646
26695
  };
26647
26696
  }, [t, p, a, d]), f = useMemo(() => ({
26648
26697
  header: {
@@ -26679,17 +26728,19 @@ const LayoutContent = () => {
26679
26728
  }),
26680
26729
  algorithm: b ? [theme.compactAlgorithm, theme.darkAlgorithm] : theme.compactAlgorithm
26681
26730
  // Set mobile mode to always use compact algorithm
26682
- }), [y, b]), C = useCallback((v) => {
26683
- u.current || c(v);
26731
+ }), [y, b]), C = useCallback((k) => {
26732
+ u.current || c(k);
26684
26733
  }, []), F = useCallback(() => {
26685
26734
  u.current = !0, setTimeout(() => {
26686
26735
  u.current = !1;
26687
26736
  });
26688
26737
  }, []), P = useMemo(() => ({
26689
26738
  overflowedIndicatorPopupClassName: m.headerPopup
26690
- }), [m.headerPopup]);
26739
+ }), [m.headerPopup]), v = useCallback(() => {
26740
+ a && c(!0);
26741
+ }, [a]);
26691
26742
  return /* @__PURE__ */ jsxs("div", { style: rootStyle, children: [
26692
- /* @__PURE__ */ jsx("div", { id: "nocobase-app-container", style: appContainerStyle, children: /* @__PURE__ */ jsx(DndContext, { onDragEnd: r, children: /* @__PURE__ */ jsx(
26743
+ /* @__PURE__ */ jsx("div", { id: "nocobase-app-container", style: appContainerStyle, children: /* @__PURE__ */ jsx(MobileMenuControlContext.Provider, { value: { closeMobileMenu: v }, children: /* @__PURE__ */ jsx(DndContext, { onDragEnd: r, children: /* @__PURE__ */ jsx(
26693
26744
  ProLayout,
26694
26745
  A(x({}, e), {
26695
26746
  contentStyle: contentStyle$1,
@@ -26718,15 +26769,15 @@ const LayoutContent = () => {
26718
26769
  autoClose: !1
26719
26770
  },
26720
26771
  menuProps: P,
26721
- children: /* @__PURE__ */ jsx(RouteContext.Consumer, { children: (v) => {
26722
- const { isMobile: k } = v;
26723
- return /* @__PURE__ */ jsx(SetIsMobileLayout, { isMobile: k, children: /* @__PURE__ */ jsxs(ConfigProvider, { theme: k ? S : y, children: [
26772
+ children: /* @__PURE__ */ jsx(RouteContext.Consumer, { children: (k) => {
26773
+ const { isMobile: I } = k;
26774
+ return /* @__PURE__ */ jsx(SetIsMobileLayout, { isMobile: I, children: /* @__PURE__ */ jsxs(ConfigProvider, { theme: I ? S : y, children: [
26724
26775
  /* @__PURE__ */ jsx(GlobalStyle, {}),
26725
26776
  /* @__PURE__ */ jsx(LayoutContent, {})
26726
26777
  ] }) });
26727
26778
  } })
26728
26779
  })
26729
- ) }) }),
26780
+ ) }) }) }),
26730
26781
  /* @__PURE__ */ jsx("div", { id: "nocobase-embed-container", style: embedContainerStyle })
26731
26782
  ] });
26732
26783
  };
@@ -30509,7 +30560,7 @@ const useStyles$a = genStyleHook("nb-markdown", (e, { isDarkTheme: t }) => {
30509
30560
  }, t ? i : r)
30510
30561
  };
30511
30562
  }), parseMarkdown$1 = _.memoize((e) => V(void 0, null, function* () {
30512
- return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
30563
+ return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
30513
30564
  }));
30514
30565
  function useParseMarkdown$1(e) {
30515
30566
  const [t, o] = useState(""), [n, r] = useState(!0);
@@ -71730,7 +71781,7 @@ BlockGridModel.registerFlow({
71730
71781
  }
71731
71782
  });
71732
71783
  const parseMarkdown = _.memoize((e) => V(void 0, null, function* () {
71733
- return e && (yield import("./md-oH2RssNY.mjs")).default.render(e);
71784
+ return e && (yield import("./md-BbvRKckr.mjs")).default.render(e);
71734
71785
  }));
71735
71786
  function useParseMarkdown(e) {
71736
71787
  const [t, o] = useState(""), [n, r] = useState(!0);
@@ -72205,6 +72256,47 @@ class BlockModel extends FlowModel {
72205
72256
  R(this, "customModelClasses", {});
72206
72257
  R(this, "collectionRequired", !1);
72207
72258
  R(this, "ObservedRenderComponent", null);
72259
+ /**
72260
+ * 记录各筛选来源是否活跃(有有效筛选值)
72261
+ * key: filterId (筛选器 uid), value: boolean (是否有有效筛选)
72262
+ */
72263
+ R(this, "activeFilterSources", /* @__PURE__ */ new Map());
72264
+ }
72265
+ /**
72266
+ * 设置指定筛选来源的活跃状态
72267
+ * @param filterId 筛选器 uid
72268
+ * @param active 是否有有效筛选值
72269
+ */
72270
+ setFilterActive(o, n) {
72271
+ this.activeFilterSources.set(o, n);
72272
+ }
72273
+ /**
72274
+ * 检查是否有任何活跃的筛选来源
72275
+ * @returns boolean
72276
+ */
72277
+ hasActiveFilters() {
72278
+ const o = this.resource;
72279
+ if (o && o.filter && Object.keys(o.filter).length > 0)
72280
+ return !0;
72281
+ for (const [, n] of this.activeFilterSources)
72282
+ if (n)
72283
+ return !0;
72284
+ return !1;
72285
+ }
72286
+ /**
72287
+ * 移除指定筛选来源
72288
+ * @param filterId 筛选器 uid
72289
+ */
72290
+ removeFilterSource(o) {
72291
+ this.activeFilterSources.delete(o);
72292
+ }
72293
+ /**
72294
+ * 获取数据加载模式
72295
+ * @returns 'auto' | 'manual'
72296
+ */
72297
+ getDataLoadingMode() {
72298
+ var o;
72299
+ return ((o = this.getStepParams("dataLoadingModeSettings")) == null ? void 0 : o.mode) || "auto";
72208
72300
  }
72209
72301
  static _getScene() {
72210
72302
  return _.castArray(this.scene || []);
@@ -72355,11 +72447,6 @@ class CollectionBlockModel extends DataBlockModel {
72355
72447
  // qs 变化后为了防止区块依赖qs, 因此重跑beforeRender, task-1357
72356
72448
  R(this, "lastSeenDirtyVersion", null);
72357
72449
  R(this, "dirtyRefreshing", !1);
72358
- /**
72359
- * 记录各筛选来源是否活跃(有有效筛选值)
72360
- * key: filterId (筛选器 uid), value: boolean (是否有有效筛选)
72361
- */
72362
- R(this, "activeFilterSources", /* @__PURE__ */ new Map());
72363
72450
  }
72364
72451
  onMount() {
72365
72452
  super.onMount(), this.previousBeforeRenderHash = this.context.location.search;
@@ -72642,42 +72729,6 @@ class CollectionBlockModel extends DataBlockModel {
72642
72729
  }
72643
72730
  });
72644
72731
  }
72645
- /**
72646
- * 获取数据加载模式
72647
- * @returns 'auto' | 'manual'
72648
- */
72649
- getDataLoadingMode() {
72650
- var o;
72651
- return ((o = this.getStepParams("dataLoadingModeSettings")) == null ? void 0 : o.mode) || "auto";
72652
- }
72653
- /**
72654
- * 设置指定筛选来源的活跃状态
72655
- * @param filterId 筛选器 uid
72656
- * @param active 是否有有效筛选值
72657
- */
72658
- setFilterActive(o, n) {
72659
- this.activeFilterSources.set(o, n);
72660
- }
72661
- /**
72662
- * 检查是否有任何活跃的筛选来源
72663
- * @returns boolean
72664
- */
72665
- hasActiveFilters() {
72666
- const o = this.resource;
72667
- if (o && o.filter && Object.keys(o.filter).length > 0)
72668
- return !0;
72669
- for (const [, n] of this.activeFilterSources)
72670
- if (n)
72671
- return !0;
72672
- return !1;
72673
- }
72674
- /**
72675
- * 移除指定筛选来源
72676
- * @param filterId 筛选器 uid
72677
- */
72678
- removeFilterSource(o) {
72679
- this.activeFilterSources.delete(o);
72680
- }
72681
72732
  createResource(o, n) {
72682
72733
  throw new Error("createResource method must be implemented in subclasses of CollectionBlockModel");
72683
72734
  }
@@ -72996,8 +73047,9 @@ class PageModel extends FlowModel {
72996
73047
  ) });
72997
73048
  }
72998
73049
  render() {
72999
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
73000
- this.props.displayTitle && /* @__PURE__ */ jsx(PageHeader, { title: this.props.title, style: this.props.headerStyle }),
73050
+ const o = this.context.themeToken, n = x({}, this.props.headerStyle);
73051
+ return o && (n.paddingBlock = o.paddingSM, n.paddingInline = o.paddingLG), this.props.enableTabs && (n.paddingBottom = 0), /* @__PURE__ */ jsxs(Fragment$1, { children: [
73052
+ this.props.displayTitle && /* @__PURE__ */ jsx(PageHeader, { title: this.props.title, style: n }),
73001
73053
  this.props.enableTabs ? this.renderTabs() : this.renderFirstTab()
73002
73054
  ] });
73003
73055
  }
@@ -73057,24 +73109,25 @@ PageModel.registerFlow({
73057
73109
  },
73058
73110
  handler(e, t) {
73059
73111
  return V(this, null, function* () {
73060
- var o, n;
73112
+ var r, i, a;
73113
+ const o = e.themeToken, n = (r = o == null ? void 0 : o.paddingLG) != null ? r : 16;
73061
73114
  if (e.model.setProps("displayTitle", t.displayTitle), e.model.context.closable)
73062
73115
  e.model.setProps("title", e.t(t.title, { ns: "lm-desktop-routes" }));
73063
73116
  else {
73064
- const r = (n = (o = e.model.context) == null ? void 0 : o.currentRoute) == null ? void 0 : n.title;
73065
- e.model.setProps("title", e.t(t.title || r, { ns: "lm-desktop-routes" }));
73117
+ const l = (a = (i = e.model.context) == null ? void 0 : i.currentRoute) == null ? void 0 : a.title;
73118
+ e.model.setProps("title", e.t(t.title || l, { ns: "lm-desktop-routes" }));
73066
73119
  }
73067
73120
  e.model.setProps("enableTabs", t.enableTabs), e.view.type === "embed" ? (e.model.setProps("headerStyle", {
73068
73121
  backgroundColor: "var(--colorBgContainer)"
73069
73122
  }), e.model.setProps("tabBarStyle", {
73070
73123
  backgroundColor: "var(--colorBgContainer)",
73071
- paddingInline: 16,
73124
+ paddingInline: n,
73072
73125
  marginBottom: 0
73073
73126
  })) : (e.model.setProps("headerStyle", {
73074
73127
  backgroundColor: "var(--colorBgLayout)"
73075
73128
  }), e.model.setProps("tabBarStyle", {
73076
73129
  backgroundColor: "var(--colorBgLayout)",
73077
- paddingInline: 16,
73130
+ paddingInline: n,
73078
73131
  marginBottom: 0
73079
73132
  })), e.model.updateDocumentTitle();
73080
73133
  });
@@ -78027,7 +78080,26 @@ function clearLegacyDefaultValuesFromFormModel(e) {
78027
78080
  const GRID_DELEGATED_STEP_KEYS = {
78028
78081
  formModelSettings: /* @__PURE__ */ new Set(["layout", "assignRules"]),
78029
78082
  eventSettings: /* @__PURE__ */ new Set(["linkageRules"])
78030
- };
78083
+ }, FLOW_KEEP_MOBILE_HORIZONTAL_CLASS = "nb-flow-keep-mobile-horizontal", flowKeepMobileHorizontalClassName = css`
78084
+ &.${FLOW_KEEP_MOBILE_HORIZONTAL_CLASS} {
78085
+ @media (max-width: 575px) {
78086
+ .ant-form-item {
78087
+ flex-wrap: nowrap !important;
78088
+ }
78089
+
78090
+ .ant-form-item .ant-form-item-label {
78091
+ flex: 0 0 auto !important;
78092
+ max-width: none !important;
78093
+ }
78094
+
78095
+ .ant-form-item .ant-form-item-control {
78096
+ flex: 1 1 0 !important;
78097
+ max-width: none !important;
78098
+ min-width: 0;
78099
+ }
78100
+ }
78101
+ }
78102
+ `;
78031
78103
  function isGridDelegatedStep(e, t) {
78032
78104
  var o;
78033
78105
  return !!((o = GRID_DELEGATED_STEP_KEYS[e]) != null && o.has(t));
@@ -78276,29 +78348,35 @@ function FormComponent(i) {
78276
78348
  "layoutProps",
78277
78349
  "initialValues"
78278
78350
  ]);
78279
- var l, c, u;
78351
+ var u, d, p, m;
78352
+ const l = !!((u = e == null ? void 0 : e.context) != null && u.isMobileLayout && (o == null ? void 0 : o.layout) === "horizontal"), c = [
78353
+ r.className,
78354
+ l ? FLOW_KEEP_MOBILE_HORIZONTAL_CLASS : "",
78355
+ l ? flowKeepMobileHorizontalClassName : ""
78356
+ ].filter(Boolean).join(" ");
78280
78357
  return /* @__PURE__ */ jsx(
78281
78358
  Form$2,
78282
78359
  A(x(A(x({
78283
78360
  form: e.form,
78284
- initialValues: ((u = (c = (l = e.context) == null ? void 0 : l.view) == null ? void 0 : c.inputArgs) == null ? void 0 : u.formData) || e.context.record || n
78361
+ initialValues: ((m = (p = (d = e.context) == null ? void 0 : d.view) == null ? void 0 : p.inputArgs) == null ? void 0 : m.formData) || e.context.record || n
78285
78362
  }, omit(o, "labelWidth")), {
78286
78363
  labelCol: { style: { width: o == null ? void 0 : o.labelWidth } },
78287
- onFieldsChange: (d) => {
78288
- const p = e.formValueRuntime;
78289
- p && p.handleFormFieldsChange(d);
78364
+ onFieldsChange: (h) => {
78365
+ const g = e.formValueRuntime;
78366
+ g && g.handleFormFieldsChange(h);
78290
78367
  },
78291
- onValuesChange: (d, p) => {
78292
- var h;
78293
- (h = e.markUserModifiedFields) == null || h.call(e, d);
78294
- const m = e.formValueRuntime;
78295
- if (m) {
78296
- m.handleFormValuesChange(d, p);
78368
+ onValuesChange: (h, g) => {
78369
+ var y;
78370
+ (y = e.markUserModifiedFields) == null || y.call(e, h);
78371
+ const f = e.formValueRuntime;
78372
+ if (f) {
78373
+ f.handleFormValuesChange(h, g);
78297
78374
  return;
78298
78375
  }
78299
- e.dispatchEvent("formValuesChange", { changedValues: d, allValues: p }, { debounce: !0 }), e.emitter.emit("formValuesChange", { changedValues: d, allValues: p });
78376
+ e.dispatchEvent("formValuesChange", { changedValues: h, allValues: g }, { debounce: !0 }), e.emitter.emit("formValuesChange", { changedValues: h, allValues: g });
78300
78377
  }
78301
78378
  }), r), {
78379
+ className: c || void 0,
78302
78380
  children: t
78303
78381
  })
78304
78382
  );
@@ -79069,6 +79147,47 @@ function dispatchEventDeep(e, t, o, n, r) {
79069
79147
  yield Promise.all(u);
79070
79148
  });
79071
79149
  }
79150
+ const getUnknownCountPaginationTotal = (e) => {
79151
+ const t = e.dataLength || 0, o = e.pageSize || 10, n = e.current || 1;
79152
+ return t < o || !e.hasNext ? o * n : o * n + 1;
79153
+ }, getSimpleModePaginationClassName = (e = !1) => css`
79154
+ .ant-pagination-simple-pager {
79155
+ display: none !important;
79156
+ }
79157
+ ${e ? `
79158
+ li {
79159
+ line-height: 32px !important;
79160
+ }
79161
+ ` : ""}
79162
+ `, mobileCompactPaginationClassName = css`
79163
+ justify-content: flex-end !important;
79164
+ .ant-pagination-total-text,
79165
+ .ant-pagination-options,
79166
+ .ant-pagination-jump-prev,
79167
+ .ant-pagination-jump-next {
79168
+ display: none !important;
79169
+ }
79170
+ `, getMobileCompactPaginationClassName = () => mobileCompactPaginationClassName, mergePaginationClassName = (...e) => cx(...e.filter(Boolean)), createCompactSimpleItemRender = (e) => {
79171
+ const t = e.current || 1, o = e.controlHeight || 32, n = e.currentTextMarginLeft ? { marginLeft: `${e.currentTextMarginLeft}px` } : void 0;
79172
+ return (r, i, a) => i === "prev" ? React.createElement(
79173
+ "div",
79174
+ {
79175
+ style: { display: "flex" },
79176
+ className: css`
79177
+ .ant-pagination-item-link {
79178
+ min-width: ${o}px;
79179
+ }
79180
+ `
79181
+ },
79182
+ a,
79183
+ React.createElement("div", { style: n }, t)
79184
+ ) : a;
79185
+ }, applyMobilePaginationProps = (e, t) => t ? A(x({}, e), {
79186
+ showTotal: !1,
79187
+ showSizeChanger: !1,
79188
+ showLessItems: !0,
79189
+ className: mergePaginationClassName(e.className, getMobileCompactPaginationClassName())
79190
+ }) : e;
79072
79191
  class EditFormModel extends FormBlockModel {
79073
79192
  constructor() {
79074
79193
  super(...arguments);
@@ -90827,43 +90946,37 @@ class TableBlockModel extends CollectionBlockModel {
90827
90946
  );
90828
90947
  }
90829
90948
  pagination() {
90830
- const o = this.resource.getMeta("count"), n = this.resource.getPageSize(), r = this.resource.getMeta("hasNext"), i = this.resource.getPage(), a = this.resource.getData();
90831
- return o ? {
90832
- current: i,
90833
- pageSize: n,
90834
- total: o,
90835
- showTotal: (l) => this.translate("Total {{count}} items", { count: l }),
90836
- showSizeChanger: !0
90837
- } : {
90838
- // showTotal: false,
90839
- simple: !0,
90840
- showTitle: !1,
90841
- showSizeChanger: !0,
90842
- hideOnSinglePage: !1,
90843
- pageSize: n,
90844
- total: (a == null ? void 0 : a.length) < n || !r ? n * i : n * i + 1,
90845
- className: css`
90846
- .ant-pagination-simple-pager {
90847
- display: none !important;
90848
- }
90849
- `,
90850
- itemRender: (l, c, u) => c === "prev" ? /* @__PURE__ */ jsxs(
90851
- "div",
90852
- {
90853
- style: { display: "flex" },
90854
- className: css`
90855
- .ant-pagination-item-link {
90856
- min-width: ${this.context.themeToken.controlHeight}px;
90857
- }
90858
- `,
90859
- children: [
90860
- u,
90861
- " ",
90862
- /* @__PURE__ */ jsx("div", { children: this.resource.getPage() })
90863
- ]
90864
- }
90865
- ) : u
90866
- };
90949
+ const o = this.resource.getMeta("count"), n = this.resource.getPageSize(), r = this.resource.getMeta("hasNext"), i = this.resource.getPage(), a = this.resource.getData(), l = !!this.context.isMobileLayout;
90950
+ if (o)
90951
+ return applyMobilePaginationProps({
90952
+ current: i,
90953
+ pageSize: n,
90954
+ total: o,
90955
+ showTotal: (u) => this.translate("Total {{count}} items", { count: u }),
90956
+ showSizeChanger: !0
90957
+ }, l);
90958
+ {
90959
+ const c = n || 10, u = i || 1, d = {
90960
+ // showTotal: false,
90961
+ simple: !0,
90962
+ showTitle: !1,
90963
+ showSizeChanger: !0,
90964
+ hideOnSinglePage: !1,
90965
+ pageSize: c,
90966
+ total: getUnknownCountPaginationTotal({
90967
+ dataLength: a == null ? void 0 : a.length,
90968
+ pageSize: c,
90969
+ current: u,
90970
+ hasNext: r
90971
+ }),
90972
+ className: mergePaginationClassName(getSimpleModePaginationClassName(), void 0),
90973
+ itemRender: createCompactSimpleItemRender({
90974
+ current: u,
90975
+ controlHeight: this.context.themeToken.controlHeight
90976
+ })
90977
+ };
90978
+ return applyMobilePaginationProps(d, l);
90979
+ }
90867
90980
  }
90868
90981
  renderComponent() {
90869
90982
  const o = this.props.highlightedRowKey, n = !!this.context.flowSettingsEnabled, { heightMode: r, height: i } = this.decoratorProps;
@@ -107518,6 +107631,7 @@ export {
107518
107631
  actionSettingsItems,
107519
107632
  allowAddNew,
107520
107633
  appendQueryStringToUrl,
107634
+ applyMobilePaginationProps,
107521
107635
  attachmentFileTypes,
107522
107636
  autoFill,
107523
107637
  autoIncrement,
@@ -107535,6 +107649,7 @@ export {
107535
107649
  confirm$1 as confirm,
107536
107650
  connectFields,
107537
107651
  constraintsProps,
107652
+ createCompactSimpleItemRender,
107538
107653
  createCreateFormBlockUISchema,
107539
107654
  createDefaultCollectionBlockTitle,
107540
107655
  createDesignable,
@@ -107624,11 +107739,13 @@ export {
107624
107739
  getIdsWithChildren$1 as getIdsWithChildren,
107625
107740
  getLabelFormatValue,
107626
107741
  getLabelWithTooltip,
107742
+ getMobileCompactPaginationClassName,
107627
107743
  getPageMenuSchema,
107628
107744
  getPageSchema,
107629
107745
  getPopupPathFromParams,
107630
107746
  getRenderContent,
107631
107747
  getShouldChange,
107748
+ getSimpleModePaginationClassName,
107632
107749
  getStoredPopupContext,
107633
107750
  getSupportFieldsByAssociation,
107634
107751
  getSupportFieldsByForeignKey,
@@ -107636,6 +107753,7 @@ export {
107636
107753
  getURLSearchParams,
107637
107754
  getURLSearchParamsChildren,
107638
107755
  getUniqueKeyFromCollection,
107756
+ getUnknownCountPaginationTotal,
107639
107757
  getValueWithIndex,
107640
107758
  getVariableComponentWithScope,
107641
107759
  getVariableValue,
@@ -107686,6 +107804,7 @@ export {
107686
107804
  markCascadeHydrationDone,
107687
107805
  matchMimetype,
107688
107806
  mergeFilter,
107807
+ mergePaginationClassName,
107689
107808
  mockAPIClient,
107690
107809
  moment2str,
107691
107810
  navigateToTab,