@nocobase/plugin-mobile 1.7.0-alpha.1 → 1.7.0-alpha.2

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" | "middle" | "large" | "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" | "onTouchStart" | "onMouseUp" | "onTouchEnd"> & {
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,24 +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-alpha.1",
15
- "@nocobase/plugin-acl": "1.7.0-alpha.1",
14
+ "@nocobase/client": "1.7.0-alpha.2",
15
+ "@nocobase/plugin-acl": "1.7.0-alpha.2",
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",
21
22
  "react-router-dom": "6.28.1",
22
- "@nocobase/database": "1.7.0-alpha.1",
23
- "@nocobase/plugin-localization": "1.7.0-alpha.1",
24
- "@nocobase/server": "1.7.0-alpha.1",
25
- "@nocobase/utils": "1.7.0-alpha.1",
26
- "@nocobase/test": "1.7.0-alpha.1",
23
+ "@nocobase/database": "1.7.0-alpha.2",
24
+ "@nocobase/plugin-localization": "1.7.0-alpha.2",
25
+ "@nocobase/server": "1.7.0-alpha.2",
26
+ "@nocobase/utils": "1.7.0-alpha.2",
27
+ "@nocobase/test": "1.7.0-alpha.2",
27
28
  "@formily/react": "2.3.0",
28
- "@nocobase/plugin-mobile": "1.7.0-alpha.1",
29
+ "@nocobase/plugin-mobile": "1.7.0-alpha.2",
29
30
  "@ant-design/icons": "5.6.1",
30
31
  "react-dom": "18.2.0",
31
- "@nocobase/sdk": "1.7.0-alpha.1",
32
- "dayjs": "1.11.10",
33
- "@formily/antd-v5": "1.1.9"
32
+ "@nocobase/sdk": "1.7.0-alpha.2",
33
+ "@formily/reactive": "2.3.0",
34
+ "dayjs": "1.11.13",
35
+ "@formily/antd-v5": "1.2.3"
34
36
  };
@@ -0,0 +1,35 @@
1
+ {
2
+ "Fill": "Füllen",
3
+ "App settings": "App-Einstellungen",
4
+ "Page settings": "Seiteneinstellungen",
5
+ "Info": "Info",
6
+ "Back": "Zurück",
7
+ "Link": "Link",
8
+ "Remove": "Entfernen",
9
+ "Add page": "Seite hinzufügen",
10
+ "Title": "Titel",
11
+ "Icon": "Symbol",
12
+ "Selected icon": "Ausgewähltes Symbol",
13
+ "Add link": "Link hinzufügen",
14
+ "Display tab bar": "Tab-Leiste anzeigen",
15
+ "Display page header": "Seitenkopf anzeigen",
16
+ "Display navigation bar": "Navigationsleiste anzeigen",
17
+ "Display page title": "Seitentitel anzeigen",
18
+ "Display tabs": "Tabs anzeigen",
19
+ "Add tab": "Tab hinzufügen",
20
+ "Mobile": "Mobil",
21
+ "Title field is required": "Titelfeld ist erforderlich",
22
+ "Icon field is required": "Symbolfeld ist erforderlich",
23
+ "Desktop data blocks": "Desktop-Datenblöcke",
24
+ "Other desktop blocks": "Andere Desktop-Blöcke",
25
+ "Settings": "Einstellungen",
26
+ "Mobile menu": "Mobiles Menü",
27
+ "Mobile routes": "Mobile Routen",
28
+ "No accessible pages found": "Keine zugänglichen Seiten gefunden",
29
+ "This might be due to permission configuration issues": "Dies könnte auf Probleme mit der Berechtigungskonfiguration zurückzuführen sein",
30
+ "Select time": "Zeit auswählen",
31
+ "Clear": "Löschen",
32
+ "Confirm": "Bestätigen",
33
+ "Cancel": "Abbrechen",
34
+ "Display < back button": "< Zurück-Schaltfläche anzeigen"
35
+ }
@@ -26,4 +26,10 @@
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
28
  "Select time":"Seleziona orario"
29
+ "Fill": "Riempimento",
30
+ "Mobile routes": "Percorsi mobile",
31
+ "Clear": "Cancella",
32
+ "Confirm": "Conferma",
33
+ "Cancel": "Annulla",
34
+ "Display < back button": "Visualizza pulsante < indietro"
29
35
  }
@@ -0,0 +1,29 @@
1
+ {
2
+ "App settings": "App settings",
3
+ "Page settings": "Page settings",
4
+ "Info": "Info",
5
+ "Back": "Back",
6
+ "Link": "Link",
7
+ "Remove": "Remove",
8
+ "Add page": "Pagina toevoegen",
9
+ "Title": "Titel",
10
+ "Icon": "Icoon",
11
+ "Selected icon": "Selected icon",
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",
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",
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"
29
+ }
@@ -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-alpha.1",
3
+ "version": "1.7.0-alpha.2",
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": "e411c9728b4d1f16b0beac16e40dd3499352b052"
36
+ "gitHead": "01751fa626d5692137e3decdac3c66a742b8ea80"
37
37
  }