@nocobase/client 2.0.1 → 2.0.3

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/README.md CHANGED
@@ -1,17 +1,24 @@
1
1
  # NocoBase
2
2
 
3
3
  <video width="100%" controls>
4
- <source src="https://static-docs.nocobase.com/NocoBase0510.mp4" type="video/mp4">
4
+ <source src="https://github.com/user-attachments/assets/4d11a87b-00e2-48f3-9bf7-389d21072d13" type="video/mp4">
5
5
  </video>
6
6
 
7
+ <p align="center">
8
+ <a href="https://trendshift.io/repositories/4112" target="_blank"><img src="https://trendshift.io/api/badge/repositories/4112" alt="nocobase%2Fnocobase | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
9
+ <a href="https://www.producthunt.com/posts/nocobase?embed=true&utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_souce=badge-nocobase" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=456520&theme=light&period=weekly&topic_id=267" alt="NocoBase - Scalability&#0045;first&#0044;&#0032;open&#0045;source&#0032;no&#0045;code&#0032;platform | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
10
+ </p>
7
11
 
8
12
  ## What is NocoBase
9
13
 
10
- NocoBase is a scalability-first, open-source no-code development platform.
11
- Instead of investing years of time and millions of dollars in research and development, deploy NocoBase in a few minutes and you'll have a private, controllable, and extremely scalable no-code development platform!
14
+ NocoBase is the most extensible AI-powered no-code platform.
15
+ Total control. Infinite extensibility. AI collaboration.
16
+ Enable your team to adapt quickly and cut costs dramatically.
17
+ No years of development. No millions wasted.
18
+ Deploy NocoBase in minutes — and take control of everything.
12
19
 
13
20
  Homepage:
14
- https://www.nocobase.com/
21
+ https://www.nocobase.com/
15
22
 
16
23
  Online Demo:
17
24
  https://demo.nocobase.com/new
@@ -19,12 +26,74 @@ https://demo.nocobase.com/new
19
26
  Documents:
20
27
  https://docs.nocobase.com/
21
28
 
22
- Commericial license & plugins:
23
- https://www.nocobase.com/en/commercial
29
+ Forum:
30
+ https://forum.nocobase.com/
24
31
 
25
- License agreement:
26
- https://www.nocobase.com/en/agreement
32
+ Use Cases:
33
+ https://www.nocobase.com/en/blog/tags/customer-stories
27
34
 
35
+ ## Release Notes
28
36
 
29
- ## Contact Us:
30
- hello@nocobase.com
37
+ Our [blog](https://www.nocobase.com/en/blog/timeline) is regularly updated with release notes and provides a weekly summary.
38
+
39
+ ## Distinctive features
40
+
41
+ ### 1. Data model-driven, not form/table–driven
42
+
43
+ Instead of being constrained by forms or tables, NocoBase adopts a data model–driven approach, separating data structure from user interface to unlock unlimited possibilities.
44
+
45
+ - UI and data structure are fully decoupled
46
+ - Multiple blocks and actions can be created for the same table or record in any quantity or form
47
+ - Supports the main database, external databases, and third-party APIs as data sources
48
+
49
+ ![model](https://static-docs.nocobase.com/model.png)
50
+
51
+ ### 2. AI employees, integrated into your business systems
52
+ Unlike standalone AI demos, NocoBase allows you to embed AI capabilities seamlessly into your interfaces, workflows, and data context, making AI truly useful in real business scenarios.
53
+
54
+ - Define AI employees for roles such as translator, analyst, researcher, or assistant
55
+ - Seamless AI–human collaboration in interfaces and workflows
56
+ - Ensure AI usage is secure, transparent, and customizable for your business needs
57
+
58
+ ![AI-employee](https://static-docs.nocobase.com/ai-employee-home.png)
59
+
60
+ ### 3. What you see is what you get, incredibly easy to use
61
+
62
+ While enabling the development of complex business systems, NocoBase keeps the experience simple and intuitive.
63
+
64
+ - One-click switch between usage mode and configuration mode
65
+ - Pages serve as a canvas to arrange blocks and actions, similar to Notion
66
+ - Configuration mode is designed for ordinary users, not just programmers
67
+
68
+ ![wysiwyg](https://static-docs.nocobase.com/wysiwyg.gif)
69
+
70
+ ### 4. Everything is a plugin, designed for extension
71
+ Adding more no-code features will never cover every business case. NocoBase is built for extension through its plugin-based microkernel architecture.
72
+
73
+ - All functionalities are plugins, similar to WordPress
74
+ - Plugins are ready to use upon installation
75
+ - Pages, blocks, actions, APIs, and data sources can all be extended through custom plugins
76
+
77
+ ![plugins](https://static-docs.nocobase.com/plugins.png)
78
+
79
+ ## Installation
80
+
81
+ NocoBase supports three installation methods:
82
+
83
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/docker-compose">Installing With Docker (👍Recommended)</a>
84
+
85
+ Suitable for no-code scenarios, no code to write. When upgrading, just download the latest image and reboot.
86
+
87
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/create-nocobase-app">Installing from create-nocobase-app CLI</a>
88
+
89
+ The business code of the project is completely independent and supports low-code development.
90
+
91
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/git-clone">Installing from Git source code</a>
92
+
93
+ If you want to experience the latest unreleased version, or want to participate in the contribution, you need to make changes and debug on the source code, it is recommended to choose this installation method, which requires a high level of development skills, and if the code has been updated, you can git pull the latest code.
94
+
95
+ ## How NocoBase works
96
+
97
+ <video width="100%" controls>
98
+ <source src="https://github.com/user-attachments/assets/8d183b44-9bb5-4792-b08f-bc08fe8dfaaf" type="video/mp4">
99
+ </video>
@@ -18,6 +18,32 @@ export declare class BlockModel<T = DefaultStructure> extends FlowModel<T> {
18
18
  customModelClasses: any;
19
19
  collectionRequired: boolean;
20
20
  private ObservedRenderComponent;
21
+ /**
22
+ * 记录各筛选来源是否活跃(有有效筛选值)
23
+ * key: filterId (筛选器 uid), value: boolean (是否有有效筛选)
24
+ */
25
+ private activeFilterSources;
26
+ /**
27
+ * 设置指定筛选来源的活跃状态
28
+ * @param filterId 筛选器 uid
29
+ * @param active 是否有有效筛选值
30
+ */
31
+ setFilterActive(filterId: string, active: boolean): void;
32
+ /**
33
+ * 检查是否有任何活跃的筛选来源
34
+ * @returns boolean
35
+ */
36
+ hasActiveFilters(): boolean;
37
+ /**
38
+ * 移除指定筛选来源
39
+ * @param filterId 筛选器 uid
40
+ */
41
+ removeFilterSource(filterId: string): void;
42
+ /**
43
+ * 获取数据加载模式
44
+ * @returns 'auto' | 'manual'
45
+ */
46
+ getDataLoadingMode(): 'auto' | 'manual';
21
47
  static _getScene(): BlockSceneType[];
22
48
  static _isScene(scene: BlockSceneType): boolean;
23
49
  getModelClassName(className: string): any;
@@ -21,11 +21,6 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
21
21
  private previousBeforeRenderHash;
22
22
  private lastSeenDirtyVersion;
23
23
  private dirtyRefreshing;
24
- /**
25
- * 记录各筛选来源是否活跃(有有效筛选值)
26
- * key: filterId (筛选器 uid), value: boolean (是否有有效筛选)
27
- */
28
- private activeFilterSources;
29
24
  protected onMount(): void;
30
25
  onActive(): void;
31
26
  /**
@@ -61,27 +56,6 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
61
56
  }[]>;
62
57
  getResourceSettingsInitParams(): ResourceSettingsInitParams;
63
58
  onInit(options: any): void;
64
- /**
65
- * 获取数据加载模式
66
- * @returns 'auto' | 'manual'
67
- */
68
- getDataLoadingMode(): 'auto' | 'manual';
69
- /**
70
- * 设置指定筛选来源的活跃状态
71
- * @param filterId 筛选器 uid
72
- * @param active 是否有有效筛选值
73
- */
74
- setFilterActive(filterId: string, active: boolean): void;
75
- /**
76
- * 检查是否有任何活跃的筛选来源
77
- * @returns boolean
78
- */
79
- hasActiveFilters(): boolean;
80
- /**
81
- * 移除指定筛选来源
82
- * @param filterId 筛选器 uid
83
- */
84
- removeFilterSource(filterId: string): void;
85
59
  createResource(ctx: any, params: any): SingleRecordResource | MultiRecordResource;
86
60
  refresh(): Promise<void>;
87
61
  protected defaultBlockTitle(): string;
@@ -62,29 +62,7 @@ export declare class TableBlockModel extends CollectionBlockModel<TableBlockMode
62
62
  };
63
63
  renderCell: (checked: any, record: any, index: any, originNode: any) => any;
64
64
  renderConfigureActions(): React.JSX.Element;
65
- pagination(): {
66
- current: number;
67
- pageSize: number;
68
- total: any;
69
- showTotal: (total: any) => any;
70
- showSizeChanger: boolean;
71
- simple?: undefined;
72
- showTitle?: undefined;
73
- hideOnSinglePage?: undefined;
74
- className?: undefined;
75
- itemRender?: undefined;
76
- } | {
77
- simple: boolean;
78
- showTitle: boolean;
79
- showSizeChanger: boolean;
80
- hideOnSinglePage: boolean;
81
- pageSize: number;
82
- total: number;
83
- className: string;
84
- itemRender: (_: any, type: any, originalElement: any) => any;
85
- current?: undefined;
86
- showTotal?: undefined;
87
- };
65
+ pagination(): import("antd").PaginationProps;
88
66
  renderComponent(): React.JSX.Element;
89
67
  }
90
68
  export {};
@@ -8,3 +8,4 @@
8
8
  */
9
9
  export * from './blockUtils';
10
10
  export * from './dispatchEventDeep';
11
+ export * from './pagination';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { PaginationProps } from 'antd';
10
+ /**
11
+ * 计算未知总数场景下的 Pagination total:
12
+ * - 本页不足 pageSize 或 hasNext=false,说明到末页
13
+ * - 否则用 +1 触发“还有下一页”
14
+ */
15
+ export declare const getUnknownCountPaginationTotal: (options: {
16
+ dataLength?: number;
17
+ pageSize?: number;
18
+ current?: number;
19
+ hasNext?: boolean;
20
+ }) => number;
21
+ export declare const getSimpleModePaginationClassName: (withLineHeight?: boolean) => string;
22
+ export declare const getMobileCompactPaginationClassName: () => string;
23
+ export declare const mergePaginationClassName: (...classNames: Array<string | undefined | false>) => string;
24
+ export declare const createCompactSimpleItemRender: (options: {
25
+ current?: number;
26
+ controlHeight?: number;
27
+ currentTextMarginLeft?: number;
28
+ }) => PaginationProps['itemRender'];
29
+ export declare const applyMobilePaginationProps: <T extends PaginationProps>(pagination: T, isMobileLayout: boolean) => PaginationProps;
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.1", 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.3", 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.1", 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.1",
9966
- "@nocobase/flow-engine": "2.0.1",
9967
- "@nocobase/sdk": "2.0.1",
9968
- "@nocobase/utils": "2.0.1",
9983
+ "@nocobase/evaluators": "2.0.3",
9984
+ "@nocobase/flow-engine": "2.0.3",
9985
+ "@nocobase/sdk": "2.0.3",
9986
+ "@nocobase/utils": "2.0.3",
9969
9987
  "@tanstack/react-table": "^8.21.3",
9970
9988
  "@types/tabulator-tables": "^6.2.6",
9971
9989
  "acorn-jsx": "^5.3.2",
@@ -72205,6 +72223,47 @@ class BlockModel extends FlowModel {
72205
72223
  R(this, "customModelClasses", {});
72206
72224
  R(this, "collectionRequired", !1);
72207
72225
  R(this, "ObservedRenderComponent", null);
72226
+ /**
72227
+ * 记录各筛选来源是否活跃(有有效筛选值)
72228
+ * key: filterId (筛选器 uid), value: boolean (是否有有效筛选)
72229
+ */
72230
+ R(this, "activeFilterSources", /* @__PURE__ */ new Map());
72231
+ }
72232
+ /**
72233
+ * 设置指定筛选来源的活跃状态
72234
+ * @param filterId 筛选器 uid
72235
+ * @param active 是否有有效筛选值
72236
+ */
72237
+ setFilterActive(o, n) {
72238
+ this.activeFilterSources.set(o, n);
72239
+ }
72240
+ /**
72241
+ * 检查是否有任何活跃的筛选来源
72242
+ * @returns boolean
72243
+ */
72244
+ hasActiveFilters() {
72245
+ const o = this.resource;
72246
+ if (o && o.filter && Object.keys(o.filter).length > 0)
72247
+ return !0;
72248
+ for (const [, n] of this.activeFilterSources)
72249
+ if (n)
72250
+ return !0;
72251
+ return !1;
72252
+ }
72253
+ /**
72254
+ * 移除指定筛选来源
72255
+ * @param filterId 筛选器 uid
72256
+ */
72257
+ removeFilterSource(o) {
72258
+ this.activeFilterSources.delete(o);
72259
+ }
72260
+ /**
72261
+ * 获取数据加载模式
72262
+ * @returns 'auto' | 'manual'
72263
+ */
72264
+ getDataLoadingMode() {
72265
+ var o;
72266
+ return ((o = this.getStepParams("dataLoadingModeSettings")) == null ? void 0 : o.mode) || "auto";
72208
72267
  }
72209
72268
  static _getScene() {
72210
72269
  return _.castArray(this.scene || []);
@@ -72355,11 +72414,6 @@ class CollectionBlockModel extends DataBlockModel {
72355
72414
  // qs 变化后为了防止区块依赖qs, 因此重跑beforeRender, task-1357
72356
72415
  R(this, "lastSeenDirtyVersion", null);
72357
72416
  R(this, "dirtyRefreshing", !1);
72358
- /**
72359
- * 记录各筛选来源是否活跃(有有效筛选值)
72360
- * key: filterId (筛选器 uid), value: boolean (是否有有效筛选)
72361
- */
72362
- R(this, "activeFilterSources", /* @__PURE__ */ new Map());
72363
72417
  }
72364
72418
  onMount() {
72365
72419
  super.onMount(), this.previousBeforeRenderHash = this.context.location.search;
@@ -72642,42 +72696,6 @@ class CollectionBlockModel extends DataBlockModel {
72642
72696
  }
72643
72697
  });
72644
72698
  }
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
72699
  createResource(o, n) {
72682
72700
  throw new Error("createResource method must be implemented in subclasses of CollectionBlockModel");
72683
72701
  }
@@ -72996,8 +73014,9 @@ class PageModel extends FlowModel {
72996
73014
  ) });
72997
73015
  }
72998
73016
  render() {
72999
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
73000
- this.props.displayTitle && /* @__PURE__ */ jsx(PageHeader, { title: this.props.title, style: this.props.headerStyle }),
73017
+ const o = this.context.themeToken, n = x({}, this.props.headerStyle);
73018
+ return o && (n.paddingBlock = o.paddingSM, n.paddingInline = o.paddingLG), this.props.enableTabs && (n.paddingBottom = 0), /* @__PURE__ */ jsxs(Fragment$1, { children: [
73019
+ this.props.displayTitle && /* @__PURE__ */ jsx(PageHeader, { title: this.props.title, style: n }),
73001
73020
  this.props.enableTabs ? this.renderTabs() : this.renderFirstTab()
73002
73021
  ] });
73003
73022
  }
@@ -73057,24 +73076,25 @@ PageModel.registerFlow({
73057
73076
  },
73058
73077
  handler(e, t) {
73059
73078
  return V(this, null, function* () {
73060
- var o, n;
73079
+ var r, i, a;
73080
+ const o = e.themeToken, n = (r = o == null ? void 0 : o.paddingLG) != null ? r : 16;
73061
73081
  if (e.model.setProps("displayTitle", t.displayTitle), e.model.context.closable)
73062
73082
  e.model.setProps("title", e.t(t.title, { ns: "lm-desktop-routes" }));
73063
73083
  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" }));
73084
+ const l = (a = (i = e.model.context) == null ? void 0 : i.currentRoute) == null ? void 0 : a.title;
73085
+ e.model.setProps("title", e.t(t.title || l, { ns: "lm-desktop-routes" }));
73066
73086
  }
73067
73087
  e.model.setProps("enableTabs", t.enableTabs), e.view.type === "embed" ? (e.model.setProps("headerStyle", {
73068
73088
  backgroundColor: "var(--colorBgContainer)"
73069
73089
  }), e.model.setProps("tabBarStyle", {
73070
73090
  backgroundColor: "var(--colorBgContainer)",
73071
- paddingInline: 16,
73091
+ paddingInline: n,
73072
73092
  marginBottom: 0
73073
73093
  })) : (e.model.setProps("headerStyle", {
73074
73094
  backgroundColor: "var(--colorBgLayout)"
73075
73095
  }), e.model.setProps("tabBarStyle", {
73076
73096
  backgroundColor: "var(--colorBgLayout)",
73077
- paddingInline: 16,
73097
+ paddingInline: n,
73078
73098
  marginBottom: 0
73079
73099
  })), e.model.updateDocumentTitle();
73080
73100
  });
@@ -79069,6 +79089,47 @@ function dispatchEventDeep(e, t, o, n, r) {
79069
79089
  yield Promise.all(u);
79070
79090
  });
79071
79091
  }
79092
+ const getUnknownCountPaginationTotal = (e) => {
79093
+ const t = e.dataLength || 0, o = e.pageSize || 10, n = e.current || 1;
79094
+ return t < o || !e.hasNext ? o * n : o * n + 1;
79095
+ }, getSimpleModePaginationClassName = (e = !1) => css`
79096
+ .ant-pagination-simple-pager {
79097
+ display: none !important;
79098
+ }
79099
+ ${e ? `
79100
+ li {
79101
+ line-height: 32px !important;
79102
+ }
79103
+ ` : ""}
79104
+ `, mobileCompactPaginationClassName = css`
79105
+ justify-content: flex-end !important;
79106
+ .ant-pagination-total-text,
79107
+ .ant-pagination-options,
79108
+ .ant-pagination-jump-prev,
79109
+ .ant-pagination-jump-next {
79110
+ display: none !important;
79111
+ }
79112
+ `, getMobileCompactPaginationClassName = () => mobileCompactPaginationClassName, mergePaginationClassName = (...e) => cx(...e.filter(Boolean)), createCompactSimpleItemRender = (e) => {
79113
+ const t = e.current || 1, o = e.controlHeight || 32, n = e.currentTextMarginLeft ? { marginLeft: `${e.currentTextMarginLeft}px` } : void 0;
79114
+ return (r, i, a) => i === "prev" ? React.createElement(
79115
+ "div",
79116
+ {
79117
+ style: { display: "flex" },
79118
+ className: css`
79119
+ .ant-pagination-item-link {
79120
+ min-width: ${o}px;
79121
+ }
79122
+ `
79123
+ },
79124
+ a,
79125
+ React.createElement("div", { style: n }, t)
79126
+ ) : a;
79127
+ }, applyMobilePaginationProps = (e, t) => t ? A(x({}, e), {
79128
+ showTotal: !1,
79129
+ showSizeChanger: !1,
79130
+ showLessItems: !0,
79131
+ className: mergePaginationClassName(e.className, getMobileCompactPaginationClassName())
79132
+ }) : e;
79072
79133
  class EditFormModel extends FormBlockModel {
79073
79134
  constructor() {
79074
79135
  super(...arguments);
@@ -90827,43 +90888,37 @@ class TableBlockModel extends CollectionBlockModel {
90827
90888
  );
90828
90889
  }
90829
90890
  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
- };
90891
+ 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;
90892
+ if (o)
90893
+ return applyMobilePaginationProps({
90894
+ current: i,
90895
+ pageSize: n,
90896
+ total: o,
90897
+ showTotal: (u) => this.translate("Total {{count}} items", { count: u }),
90898
+ showSizeChanger: !0
90899
+ }, l);
90900
+ {
90901
+ const c = n || 10, u = i || 1, d = {
90902
+ // showTotal: false,
90903
+ simple: !0,
90904
+ showTitle: !1,
90905
+ showSizeChanger: !0,
90906
+ hideOnSinglePage: !1,
90907
+ pageSize: c,
90908
+ total: getUnknownCountPaginationTotal({
90909
+ dataLength: a == null ? void 0 : a.length,
90910
+ pageSize: c,
90911
+ current: u,
90912
+ hasNext: r
90913
+ }),
90914
+ className: mergePaginationClassName(getSimpleModePaginationClassName(), void 0),
90915
+ itemRender: createCompactSimpleItemRender({
90916
+ current: u,
90917
+ controlHeight: this.context.themeToken.controlHeight
90918
+ })
90919
+ };
90920
+ return applyMobilePaginationProps(d, l);
90921
+ }
90867
90922
  }
90868
90923
  renderComponent() {
90869
90924
  const o = this.props.highlightedRowKey, n = !!this.context.flowSettingsEnabled, { heightMode: r, height: i } = this.decoratorProps;
@@ -101318,7 +101373,7 @@ const SettingsMenu = () => {
101318
101373
  label: /* @__PURE__ */ jsx(
101319
101374
  "a",
101320
101375
  {
101321
- href: n ? "https://docs-cn.nocobase.com/handbook" : "https://docs.nocobase.com/handbook",
101376
+ href: n ? "https://v2.docs.nocobase.com/cn/guide/" : "https://v2.docs.nocobase.com/guide/",
101322
101377
  target: "_blank",
101323
101378
  rel: "noreferrer",
101324
101379
  children: e("Handbook")
@@ -107518,6 +107573,7 @@ export {
107518
107573
  actionSettingsItems,
107519
107574
  allowAddNew,
107520
107575
  appendQueryStringToUrl,
107576
+ applyMobilePaginationProps,
107521
107577
  attachmentFileTypes,
107522
107578
  autoFill,
107523
107579
  autoIncrement,
@@ -107535,6 +107591,7 @@ export {
107535
107591
  confirm$1 as confirm,
107536
107592
  connectFields,
107537
107593
  constraintsProps,
107594
+ createCompactSimpleItemRender,
107538
107595
  createCreateFormBlockUISchema,
107539
107596
  createDefaultCollectionBlockTitle,
107540
107597
  createDesignable,
@@ -107624,11 +107681,13 @@ export {
107624
107681
  getIdsWithChildren$1 as getIdsWithChildren,
107625
107682
  getLabelFormatValue,
107626
107683
  getLabelWithTooltip,
107684
+ getMobileCompactPaginationClassName,
107627
107685
  getPageMenuSchema,
107628
107686
  getPageSchema,
107629
107687
  getPopupPathFromParams,
107630
107688
  getRenderContent,
107631
107689
  getShouldChange,
107690
+ getSimpleModePaginationClassName,
107632
107691
  getStoredPopupContext,
107633
107692
  getSupportFieldsByAssociation,
107634
107693
  getSupportFieldsByForeignKey,
@@ -107636,6 +107695,7 @@ export {
107636
107695
  getURLSearchParams,
107637
107696
  getURLSearchParamsChildren,
107638
107697
  getUniqueKeyFromCollection,
107698
+ getUnknownCountPaginationTotal,
107639
107699
  getValueWithIndex,
107640
107700
  getVariableComponentWithScope,
107641
107701
  getVariableValue,
@@ -107686,6 +107746,7 @@ export {
107686
107746
  markCascadeHydrationDone,
107687
107747
  matchMimetype,
107688
107748
  mergeFilter,
107749
+ mergePaginationClassName,
107689
107750
  mockAPIClient,
107690
107751
  moment2str,
107691
107752
  navigateToTab,