@nocobase/plugin-mobile 1.6.0-alpha.2 → 1.6.0-alpha.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.
@@ -10,6 +10,8 @@ import React, { FC } from 'react';
10
10
  interface MobileAppContextProps {
11
11
  showTabBar?: boolean;
12
12
  setShowTabBar?: (showTabBar: boolean) => void;
13
+ showBackButton?: boolean;
14
+ setShowBackButton?: (showBackButton: boolean) => void;
13
15
  }
14
16
  export declare const MobileAppContext: React.Context<MobileAppContextProps>;
15
17
  export interface MobileAppProviderProps {
@@ -18,6 +18,9 @@ export interface MobileRouteItem {
18
18
  icon?: string;
19
19
  parentId?: number;
20
20
  children?: MobileRouteItem[];
21
+ hideInMenu?: boolean;
22
+ enableTabs?: boolean;
23
+ hidden?: boolean;
21
24
  }
22
25
  export declare const MobileRoutesContext: React.Context<MobileRoutesContextValue>;
23
26
  export interface MobileRoutesContextValue {
@@ -8,4 +8,11 @@
8
8
  */
9
9
  import React from 'react';
10
10
  declare const MobileDateTimePicker: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
11
- export { MobileDateTimePicker };
11
+ declare const MobileRangePicker: (props: any) => React.JSX.Element;
12
+ declare const MobileDateFilterWithPicker: (props: any) => React.JSX.Element;
13
+ type ComposedMobileTimePicker = React.FC<any> & {
14
+ RangePicker?: React.FC<any>;
15
+ ReadPretty?: React.FC<any>;
16
+ };
17
+ declare const MobileTimePicker: ComposedMobileTimePicker;
18
+ export { MobileDateTimePicker, MobileRangePicker, MobileDateFilterWithPicker, MobileTimePicker };
@@ -11,22 +11,23 @@ module.exports = {
11
11
  "@emotion/css": "11.13.4",
12
12
  "@formily/core": "2.3.0",
13
13
  "@formily/shared": "2.3.2",
14
- "@nocobase/client": "1.6.0-alpha.2",
15
- "@nocobase/plugin-acl": "1.6.0-alpha.2",
14
+ "@nocobase/client": "1.6.0-alpha.21",
15
+ "@nocobase/plugin-acl": "1.6.0-alpha.21",
16
16
  "ahooks": "3.7.8",
17
17
  "antd": "5.12.8",
18
18
  "lodash": "4.17.21",
19
19
  "react": "18.2.0",
20
20
  "react-i18next": "11.18.6",
21
21
  "react-router-dom": "6.21.0",
22
- "@nocobase/database": "1.6.0-alpha.2",
23
- "@nocobase/server": "1.6.0-alpha.2",
24
- "@nocobase/test": "1.6.0-alpha.2",
25
- "@nocobase/utils": "1.6.0-alpha.2",
22
+ "@nocobase/database": "1.6.0-alpha.21",
23
+ "@nocobase/server": "1.6.0-alpha.21",
24
+ "@nocobase/test": "1.6.0-alpha.21",
25
+ "@nocobase/utils": "1.6.0-alpha.21",
26
26
  "@formily/react": "2.3.0",
27
- "@nocobase/plugin-mobile": "1.6.0-alpha.2",
27
+ "@nocobase/plugin-mobile": "1.6.0-alpha.21",
28
28
  "@ant-design/icons": "5.2.6",
29
29
  "react-dom": "18.2.0",
30
- "@nocobase/sdk": "1.6.0-alpha.2",
30
+ "@nocobase/sdk": "1.6.0-alpha.21",
31
+ "dayjs": "1.11.10",
31
32
  "@formily/antd-v5": "1.1.9"
32
33
  };
@@ -23,6 +23,7 @@
23
23
  "Other desktop blocks": "Other desktop blocks",
24
24
  "Settings": "Settings",
25
25
  "Mobile menu": "Mobile menu",
26
+ "Mobile routes": "Mobile routes",
26
27
  "No accessible pages found": "No accessible pages found",
27
28
  "This might be due to permission configuration issues": "This might be due to permission configuration issues",
28
29
  "Select time":"Select time"
@@ -23,5 +23,6 @@
23
23
  "Other desktop blocks": "他のデスクトップブロック",
24
24
  "Settings": "設定",
25
25
  "Fill": "塗りつぶし",
26
- "Select time":"時間の選択"
27
- }
26
+ "Select time":"時間の選択",
27
+ "Mobile routes": "モバイルルート"
28
+ }
@@ -24,10 +24,12 @@
24
24
  "Other desktop blocks": "其他桌面端区块",
25
25
  "Settings": "设置",
26
26
  "Mobile menu": "移动端菜单",
27
+ "Mobile routes": "移动端路由",
27
28
  "No accessible pages found": "没有找到你可以访问的页面",
28
29
  "This might be due to permission configuration issues": "这可能是权限配置的问题",
29
30
  "Select time": "选择时间",
30
31
  "Clear": "清空",
31
32
  "Confirm": "确认",
32
- "Cancel": "取消"
33
+ "Cancel": "取消",
34
+ "Display < back button": "显示 < 返回按钮"
33
35
  }
@@ -33,6 +33,7 @@ var import_database = require("@nocobase/database");
33
33
  var mobileRoutes_default = (0, import_database.defineCollection)({
34
34
  name: "mobileRoutes",
35
35
  dumpRules: "required",
36
+ migrationRules: ["overwrite", "schema-only"],
36
37
  title: "mobileRoutes",
37
38
  inherit: false,
38
39
  hidden: false,
@@ -222,10 +223,11 @@ var mobileRoutes_default = (0, import_database.defineCollection)({
222
223
  collectionName: "mobileRoutes",
223
224
  parentKey: null,
224
225
  reverseKey: null,
226
+ translation: true,
225
227
  uiSchema: {
226
228
  type: "string",
227
229
  "x-component": "Input",
228
- title: "title"
230
+ title: '{{t("Title")}}'
229
231
  }
230
232
  },
231
233
  {
@@ -240,7 +242,7 @@ var mobileRoutes_default = (0, import_database.defineCollection)({
240
242
  uiSchema: {
241
243
  type: "string",
242
244
  "x-component": "Input",
243
- title: "icon"
245
+ title: '{{t("Icon")}}'
244
246
  }
245
247
  },
246
248
  {
@@ -255,7 +257,7 @@ var mobileRoutes_default = (0, import_database.defineCollection)({
255
257
  uiSchema: {
256
258
  type: "string",
257
259
  "x-component": "Input",
258
- title: "schemaUid"
260
+ title: '{{t("Schema UID")}}'
259
261
  }
260
262
  },
261
263
  {
@@ -270,7 +272,7 @@ var mobileRoutes_default = (0, import_database.defineCollection)({
270
272
  uiSchema: {
271
273
  type: "string",
272
274
  "x-component": "Input",
273
- title: "type"
275
+ title: '{{t("Type")}}'
274
276
  }
275
277
  },
276
278
  {
@@ -292,7 +294,7 @@ var mobileRoutes_default = (0, import_database.defineCollection)({
292
294
  }
293
295
  },
294
296
  default: null,
295
- title: "options"
297
+ title: '{{t("Options")}}'
296
298
  }
297
299
  },
298
300
  {
@@ -304,6 +306,7 @@ var mobileRoutes_default = (0, import_database.defineCollection)({
304
306
  collectionName: "mobileRoutes",
305
307
  parentKey: null,
306
308
  reverseKey: null,
309
+ scopeKey: "parentId",
307
310
  uiSchema: {
308
311
  type: "number",
309
312
  "x-component": "InputNumber",
@@ -312,7 +315,7 @@ var mobileRoutes_default = (0, import_database.defineCollection)({
312
315
  step: "1"
313
316
  },
314
317
  "x-validator": "integer",
315
- title: "sort"
318
+ title: '{{t("Sort")}}'
316
319
  }
317
320
  },
318
321
  {
@@ -321,6 +324,36 @@ var mobileRoutes_default = (0, import_database.defineCollection)({
321
324
  through: "rolesMobileRoutes",
322
325
  target: "roles",
323
326
  onDelete: "CASCADE"
327
+ },
328
+ {
329
+ type: "boolean",
330
+ name: "hideInMenu",
331
+ interface: "checkbox",
332
+ uiSchema: {
333
+ type: "boolean",
334
+ "x-component": "Checkbox",
335
+ title: '{{t("Hide in menu")}}'
336
+ }
337
+ },
338
+ {
339
+ type: "boolean",
340
+ name: "enableTabs",
341
+ interface: "checkbox",
342
+ uiSchema: {
343
+ type: "boolean",
344
+ "x-component": "Checkbox",
345
+ title: '{{t("Enable tabs")}}'
346
+ }
347
+ },
348
+ {
349
+ type: "boolean",
350
+ name: "hidden",
351
+ interface: "checkbox",
352
+ uiSchema: {
353
+ type: "boolean",
354
+ "x-component": "Checkbox",
355
+ title: '{{t("Hidden")}}'
356
+ }
324
357
  }
325
358
  ],
326
359
  category: [],
@@ -36,6 +36,20 @@ class PluginMobileServer extends import_server.Plugin {
36
36
  this.registerActionHandlers();
37
37
  this.bindNewMenuToRoles();
38
38
  this.setACL();
39
+ this.app.db.on("mobileRoutes.afterUpdate", async (instance, { transaction }) => {
40
+ if (instance.changed("enableTabs")) {
41
+ const repository = this.app.db.getRepository("mobileRoutes");
42
+ await repository.update({
43
+ filter: {
44
+ parentId: instance.id
45
+ },
46
+ values: {
47
+ hidden: !instance.enableTabs
48
+ },
49
+ transaction
50
+ });
51
+ }
52
+ });
39
53
  }
40
54
  setACL() {
41
55
  this.app.acl.registerSnippet({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-mobile",
3
- "version": "1.6.0-alpha.2",
3
+ "version": "1.6.0-alpha.21",
4
4
  "main": "dist/server/index.js",
5
5
  "homepage": "https://docs.nocobase.com/handbook/mobile",
6
6
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/mobile",
@@ -32,5 +32,5 @@
32
32
  "react-device-detect": "2.2.3",
33
33
  "react-i18next": "11.x"
34
34
  },
35
- "gitHead": "08bbc34c21727fc0ad0880f397a42bf7741091ee"
35
+ "gitHead": "873cbaec9554e684781b8dc6cfd4386bb5cfa5b0"
36
36
  }