@nocobase/client 1.6.6 → 1.6.7
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 +21 -11
- package/es/user/CurrentUserProvider.d.ts +1 -0
- package/lib/index.js +5 -5
- package/lib/locale/it-IT.js +269 -46
- package/package.json +5 -5
package/es/index.mjs
CHANGED
|
@@ -3777,6 +3777,9 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3777
3777
|
get useIsInSettingsPage() {
|
|
3778
3778
|
return useIsInSettingsPage;
|
|
3779
3779
|
},
|
|
3780
|
+
get useIsLoggedIn() {
|
|
3781
|
+
return useIsLoggedIn;
|
|
3782
|
+
},
|
|
3780
3783
|
get useIsSelectFieldMode() {
|
|
3781
3784
|
return useIsSelectFieldMode;
|
|
3782
3785
|
},
|
|
@@ -9158,7 +9161,7 @@ function addAppVersion(e, t) {
|
|
|
9158
9161
|
addAppVersion((o = e.properties) == null ? void 0 : o[n], t);
|
|
9159
9162
|
}), e;
|
|
9160
9163
|
}
|
|
9161
|
-
const name = "@nocobase/client", version = "1.6.
|
|
9164
|
+
const name = "@nocobase/client", version = "1.6.7", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
9162
9165
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
9163
9166
|
"@ant-design/cssinjs": "^1.11.1",
|
|
9164
9167
|
"@ant-design/icons": "^5.6.1",
|
|
@@ -9180,9 +9183,9 @@ const name = "@nocobase/client", version = "1.6.6", license = "AGPL-3.0", main =
|
|
|
9180
9183
|
"@formily/reactive-react": "^2.2.27",
|
|
9181
9184
|
"@formily/shared": "^2.2.27",
|
|
9182
9185
|
"@formily/validator": "^2.2.27",
|
|
9183
|
-
"@nocobase/evaluators": "1.6.
|
|
9184
|
-
"@nocobase/sdk": "1.6.
|
|
9185
|
-
"@nocobase/utils": "1.6.
|
|
9186
|
+
"@nocobase/evaluators": "1.6.7",
|
|
9187
|
+
"@nocobase/sdk": "1.6.7",
|
|
9188
|
+
"@nocobase/utils": "1.6.7",
|
|
9186
9189
|
ahooks: "^3.7.2",
|
|
9187
9190
|
antd: "5.12.8",
|
|
9188
9191
|
"antd-style": "3.7.1",
|
|
@@ -24329,9 +24332,7 @@ function useFormItemCollectionField() {
|
|
|
24329
24332
|
}
|
|
24330
24333
|
function useIsAssociationField() {
|
|
24331
24334
|
const e = useFormItemCollectionField();
|
|
24332
|
-
return
|
|
24333
|
-
e == null ? void 0 : e.interface
|
|
24334
|
-
);
|
|
24335
|
+
return e && ["hasOne", "hasMany", "belongsTo", "belongsToMany", "belongsToArray"].includes(e.type);
|
|
24335
24336
|
}
|
|
24336
24337
|
function useIsFileField() {
|
|
24337
24338
|
const e = useCollectionManager(), t = useFormItemCollectionField(), n = e.getCollection(t == null ? void 0 : t.target);
|
|
@@ -24378,7 +24379,11 @@ const SettingsMenuProvider = (e) => SelectWithTitle, DropdownVisibleContext = cr
|
|
|
24378
24379
|
DropdownVisibleContext.displayName = "DropdownVisibleContext";
|
|
24379
24380
|
const CurrentUserContext = createContext(null);
|
|
24380
24381
|
CurrentUserContext.displayName = "CurrentUserContext";
|
|
24381
|
-
const useCurrentUserContext = () => useContext(CurrentUserContext),
|
|
24382
|
+
const useCurrentUserContext = () => useContext(CurrentUserContext), useIsLoggedIn = () => {
|
|
24383
|
+
var t;
|
|
24384
|
+
const e = useContext(CurrentUserContext);
|
|
24385
|
+
return !!((t = e == null ? void 0 : e.data) != null && t.data);
|
|
24386
|
+
}, useCurrentRoles = () => {
|
|
24382
24387
|
var r;
|
|
24383
24388
|
const { allowAnonymous: e } = useACLRoleContext(), { data: t } = useCurrentUserContext(), n = useCompile();
|
|
24384
24389
|
return useMemo(() => {
|
|
@@ -24395,7 +24400,10 @@ const useCurrentUserContext = () => useContext(CurrentUserContext), useCurrentRo
|
|
|
24395
24400
|
url: "/auth:check",
|
|
24396
24401
|
skipNotify: !0,
|
|
24397
24402
|
skipAuth: !0
|
|
24398
|
-
}).then((r) => r == null ? void 0 : r.data)
|
|
24403
|
+
}).then((r) => r == null ? void 0 : r.data),
|
|
24404
|
+
{
|
|
24405
|
+
manual: !t.auth.token
|
|
24406
|
+
}
|
|
24399
24407
|
), { render: o } = useAppSpin();
|
|
24400
24408
|
return n.loading ? o() : /* @__PURE__ */ jsx(CurrentUserContext.Provider, { value: n, children: e.children });
|
|
24401
24409
|
}, CurrentUserSettingsMenuContext = createContext(null);
|
|
@@ -55387,9 +55395,9 @@ const ReadPretty$1 = (e) => {
|
|
|
55387
55395
|
return P(x({}, e), {
|
|
55388
55396
|
format: n,
|
|
55389
55397
|
inputReadOnly: !0,
|
|
55390
|
-
value: dayjsable(e.value,
|
|
55398
|
+
value: dayjsable(e.value, "HH:mm:ss"),
|
|
55391
55399
|
onChange: (r) => {
|
|
55392
|
-
o && o(formatDayjsValue(r,
|
|
55400
|
+
o && o(formatDayjsValue(r, "HH:mm:ss") || null);
|
|
55393
55401
|
}
|
|
55394
55402
|
});
|
|
55395
55403
|
};
|
|
@@ -62925,6 +62933,7 @@ const ACLProvider = (e) => /* @__PURE__ */ jsx(
|
|
|
62925
62933
|
url: "roles:check"
|
|
62926
62934
|
},
|
|
62927
62935
|
{
|
|
62936
|
+
manual: !o.auth.token,
|
|
62928
62937
|
onSuccess(a) {
|
|
62929
62938
|
var l, c, u, d;
|
|
62930
62939
|
(l = a == null ? void 0 : a.data) != null && l.snippets.includes("ui.*") || t(!1), ((c = a == null ? void 0 : a.data) == null ? void 0 : c.role) !== o.auth.role && o.auth.setRole((u = a == null ? void 0 : a.data) == null ? void 0 : u.role), r.pluginSettingsManager.setAclSnippets(((d = a == null ? void 0 : a.data) == null ? void 0 : d.snippets) || []);
|
|
@@ -65486,6 +65495,7 @@ export {
|
|
|
65486
65495
|
useIsFileField,
|
|
65487
65496
|
useIsFormReadPretty,
|
|
65488
65497
|
useIsInSettingsPage,
|
|
65498
|
+
useIsLoggedIn,
|
|
65489
65499
|
useIsSelectFieldMode,
|
|
65490
65500
|
useIsSubPageClosedByPageMenu,
|
|
65491
65501
|
useLabelUiSchema,
|
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
export declare const CurrentUserContext: React.Context<import("../api-client").UseRequestResult<any>>;
|
|
11
11
|
export declare const useCurrentUserContext: () => import("../api-client").UseRequestResult<any>;
|
|
12
|
+
export declare const useIsLoggedIn: () => boolean;
|
|
12
13
|
export declare const useCurrentRoles: () => any;
|
|
13
14
|
export declare const CurrentUserProvider: (props: any) => React.JSX.Element;
|