@nocobase/plugin-mobile 1.7.0-beta.2 → 1.7.0-beta.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.
@@ -7,4 +7,52 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
+ export declare const mobileComponents: {
11
+ Button: React.ForwardRefExoticComponent<{
12
+ color?: "default" | "warning" | "success" | "primary" | "danger";
13
+ fill?: "outline" | "none" | "solid";
14
+ size?: "small" | "large" | "middle" | "mini";
15
+ block?: boolean;
16
+ loading?: boolean | "auto";
17
+ loadingText?: string;
18
+ loadingIcon?: React.ReactNode;
19
+ disabled?: boolean;
20
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void>;
21
+ type?: "button" | "submit" | "reset";
22
+ shape?: "default" | "rounded" | "rectangular";
23
+ children?: React.ReactNode;
24
+ } & Pick<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & {
25
+ className?: string;
26
+ style?: React.CSSProperties & Partial<Record<"--border-radius" | "--text-color" | "--background-color" | "--border-width" | "--border-style" | "--border-color", string>>;
27
+ tabIndex?: number;
28
+ } & React.AriaAttributes & React.RefAttributes<import("antd-mobile").ButtonRef>>;
29
+ Select: (props: any) => React.JSX.Element;
30
+ DatePicker: {
31
+ (props: any): React.JSX.Element;
32
+ FilterWithPicker(props: any): React.JSX.Element;
33
+ RangePicker: {
34
+ (props: any): React.JSX.Element;
35
+ displayName: string;
36
+ };
37
+ };
38
+ UnixTimestamp: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
39
+ Modal: React.FC<import("antd-mobile").DialogProps> & {
40
+ show: typeof import("antd-mobile/es/components/dialog/show").show;
41
+ alert: typeof import("antd-mobile/es/components/dialog/alert").alert;
42
+ confirm: typeof import("antd-mobile/es/components/dialog/confirm").confirm;
43
+ clear: typeof import("antd-mobile/es/components/dialog/clear").clear;
44
+ };
45
+ AssociationField: {
46
+ (props: any): React.JSX.Element;
47
+ SubTable: any;
48
+ Nester: any;
49
+ AddNewer: any;
50
+ Selector: any;
51
+ Viewer: any;
52
+ InternalSelect: any;
53
+ ReadPretty: any;
54
+ FileSelector: any;
55
+ };
56
+ TimePicker: (props: any) => React.JSX.Element;
57
+ };
10
58
  export declare const MobilePage: () => React.JSX.Element;
@@ -8,8 +8,14 @@
8
8
  */
9
9
  import React from 'react';
10
10
  declare const MobileDateTimePicker: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
11
- declare const MobileRangePicker: (props: any) => React.JSX.Element;
12
- declare const MobileDateFilterWithPicker: (props: any) => React.JSX.Element;
11
+ declare const MobileRangePicker: {
12
+ (props: any): React.JSX.Element;
13
+ displayName: string;
14
+ };
15
+ declare const MobileDateFilterWithPicker: {
16
+ (props: any): React.JSX.Element;
17
+ displayName: string;
18
+ };
13
19
  type ComposedMobileTimePicker = React.FC<any> & {
14
20
  RangePicker?: React.FC<any>;
15
21
  ReadPretty?: React.FC<any>;
@@ -11,25 +11,26 @@ 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.7.0-beta.2",
15
- "@nocobase/plugin-acl": "1.7.0-beta.2",
14
+ "@nocobase/client": "1.7.0-beta.21",
15
+ "@nocobase/plugin-acl": "1.7.0-beta.21",
16
16
  "ahooks": "3.7.8",
17
- "antd": "5.12.8",
17
+ "antd": "5.24.2",
18
18
  "lodash": "4.17.21",
19
19
  "react": "18.2.0",
20
20
  "react-i18next": "11.18.6",
21
+ "antd-style": "3.7.1",
22
+ "@ant-design/icons": "5.6.1",
21
23
  "react-router-dom": "6.28.1",
22
- "@nocobase/database": "1.7.0-beta.2",
23
- "@nocobase/plugin-localization": "1.7.0-beta.2",
24
- "@nocobase/server": "1.7.0-beta.2",
25
- "@nocobase/utils": "1.7.0-beta.2",
26
- "@nocobase/test": "1.7.0-beta.2",
24
+ "@nocobase/database": "1.7.0-beta.21",
25
+ "@nocobase/plugin-localization": "1.7.0-beta.21",
26
+ "@nocobase/server": "1.7.0-beta.21",
27
+ "@nocobase/utils": "1.7.0-beta.21",
28
+ "@nocobase/test": "1.7.0-beta.21",
27
29
  "@formily/react": "2.3.0",
28
- "@nocobase/plugin-mobile": "1.7.0-beta.2",
29
- "@ant-design/icons": "5.6.1",
30
+ "@nocobase/plugin-mobile": "1.7.0-beta.21",
30
31
  "react-dom": "18.2.0",
31
- "@nocobase/sdk": "1.7.0-beta.2",
32
+ "@nocobase/sdk": "1.7.0-beta.21",
32
33
  "@formily/reactive": "2.3.0",
33
- "dayjs": "1.11.10",
34
- "@formily/antd-v5": "1.1.9"
34
+ "dayjs": "1.11.13",
35
+ "@formily/antd-v5": "1.2.3"
35
36
  };
@@ -25,7 +25,7 @@
25
25
  "Mobile menu": "Menu mobile",
26
26
  "No accessible pages found": "Nessuna pagina accessibile trovata",
27
27
  "This might be due to permission configuration issues": "Questo potrebbe essere dovuto a problemi di configurazione dei permessi",
28
- "Select time":"Seleziona orario"
28
+ "Select time":"Seleziona orario",
29
29
  "Fill": "Riempimento",
30
30
  "Mobile routes": "Percorsi mobile",
31
31
  "Clear": "Cancella",
@@ -1,29 +1,35 @@
1
1
  {
2
- "App settings": "App settings",
3
- "Page settings": "Page settings",
2
+ "App settings": "App instellingen",
3
+ "Page settings": "Pagina instellingen",
4
4
  "Info": "Info",
5
- "Back": "Back",
5
+ "Back": "Terug",
6
6
  "Link": "Link",
7
- "Remove": "Remove",
7
+ "Remove": "Verwijderen",
8
8
  "Add page": "Pagina toevoegen",
9
9
  "Title": "Titel",
10
10
  "Icon": "Icoon",
11
- "Selected icon": "Selected icon",
11
+ "Selected icon": "Geselecteerd icoon",
12
12
  "Add link": "Link toevoegen",
13
- "Display tab bar": "Display tab bar",
14
- "Display page header": "Display page header",
15
- "Display navigation bar": "Display navigation bar",
16
- "Display page title": "Display page title",
17
- "Display tabs": "Display tabs",
13
+ "Display tab bar": "Tabbladbalk weergeven",
14
+ "Display page header": "Paginakoptekst weergeven",
15
+ "Display navigation bar": "Navigatiebalk weergeven",
16
+ "Display page title": "Paginatitel weergeven",
17
+ "Display tabs": "Tabbladen weergeven",
18
18
  "Add tab": "Voeg tabblad toe",
19
- "Mobile": "Mobile",
20
- "Title field is required": "Title field is required",
21
- "Icon field is required": "Icon field is required",
22
- "Desktop data blocks": "Desktop data blocks",
23
- "Other desktop blocks": "Other desktop blocks",
19
+ "Mobile": "Mobiel",
20
+ "Title field is required": "Titelveld is verplicht",
21
+ "Icon field is required": "Icoonveld is verplicht",
22
+ "Desktop data blocks": "Desktop data blokken",
23
+ "Other desktop blocks": "Andere desktop blokken",
24
24
  "Settings": "Instellingen",
25
- "Mobile menu": "Mobile menu",
26
- "No accessible pages found": "No accessible pages found",
27
- "This might be due to permission configuration issues": "This might be due to permission configuration issues",
28
- "Select time": "Select time"
25
+ "Mobile menu": "Mobiel menu",
26
+ "No accessible pages found": "Geen toegankelijke pagina's gevonden",
27
+ "This might be due to permission configuration issues": "Dit kan te wijten zijn aan machtigingsconfiguratieproblemen",
28
+ "Select time": "Selecteer tijd",
29
+ "Fill": "Vullen",
30
+ "Mobile routes": "Mobiele routes",
31
+ "Clear": "Wissen",
32
+ "Confirm": "Bevestigen",
33
+ "Cancel": "Annuleren",
34
+ "Display < back button": "Weergave < terug knop"
29
35
  }
@@ -138,18 +138,18 @@ class PluginMobileServer extends import_server.Plugin {
138
138
  this.app.resourceManager.registerActionHandler("mobileRoutes:listAccessible", async (ctx, next) => {
139
139
  const mobileRoutesRepository = ctx.db.getRepository("mobileRoutes");
140
140
  const rolesRepository = ctx.db.getRepository("roles");
141
- if (ctx.state.currentRole === "root") {
141
+ if (ctx.state.currentRoles.includes("root")) {
142
142
  ctx.body = await mobileRoutesRepository.find({
143
143
  tree: true,
144
144
  ...ctx.query
145
145
  });
146
146
  return await next();
147
147
  }
148
- const role = await rolesRepository.findOne({
149
- filterByTk: ctx.state.currentRole,
148
+ const roles = await rolesRepository.find({
149
+ filterByTk: ctx.state.currentRoles,
150
150
  appends: ["mobileRoutes"]
151
151
  });
152
- const mobileRoutesId = role.get("mobileRoutes").map((item) => item.id);
152
+ const mobileRoutesId = roles.flatMap((x) => x.get("mobileRoutes").map((x2) => x2.id));
153
153
  ctx.body = await mobileRoutesRepository.find({
154
154
  tree: true,
155
155
  ...ctx.query,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-mobile",
3
- "version": "1.7.0-beta.2",
3
+ "version": "1.7.0-beta.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",
@@ -33,5 +33,5 @@
33
33
  "react-device-detect": "2.2.3",
34
34
  "react-i18next": "11.x"
35
35
  },
36
- "gitHead": "58b206bdfca521e79a69989ca55dd19075dca523"
36
+ "gitHead": "845f6124b170717387ba9d7ebf3cc2df7a861bc3"
37
37
  }