@yelon/util 16.2.4 → 16.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,8 +5,8 @@ export const YZ_HEADER_KEY = '_yz_header';
5
5
  export const YZ_HEADER_TYPE_KEY = '_yz_header_type';
6
6
  export const YZ_DEFAULT_ROUTE_KEY = '_yz_default_route';
7
7
  export const YZ_TENANT_KEY = '_yz_tenant';
8
- export const YZ_LANGS_KEY = '_yz_langs';
9
- export const YZ_LANG_KEY = '_yz_lang';
8
+ // export const YZ_LANGS_KEY = '_yz_langs';
9
+ // export const YZ_LANG_KEY = '_yz_lang';
10
10
  function get(key) {
11
11
  if (key === YZ_HEADER_TYPE_KEY) {
12
12
  return localStorage.getItem(key);
@@ -56,14 +56,4 @@ export function useLocalStorageTenant() {
56
56
  const getFn = () => get(YZ_TENANT_KEY);
57
57
  return [setFn, getFn];
58
58
  }
59
- export function useLocalStorageLangs() {
60
- const setFn = data => set(YZ_LANGS_KEY, data);
61
- const getFn = () => get(YZ_LANGS_KEY);
62
- return [setFn, getFn];
63
- }
64
- export function useLocalStorageLang() {
65
- const setFn = (key, data) => set(`${YZ_LANG_KEY}_${key}`, data);
66
- const getFn = (key) => get(`${YZ_LANG_KEY}_${key}`);
67
- return [setFn, getFn];
68
- }
69
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxTdG9yYWdlVXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy91dGlsL21jYWNoZS9sb2NhbFN0b3JhZ2VVdGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLENBQUMsTUFBTSxXQUFXLEdBQUcsVUFBVSxDQUFDO0FBQ3RDLE1BQU0sQ0FBQyxNQUFNLG1CQUFtQixHQUFHLGtCQUFrQixDQUFDO0FBQ3RELE1BQU0sQ0FBQyxNQUFNLGNBQWMsR0FBRyxhQUFhLENBQUM7QU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LCBnZXRGbl07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiB1c2VMb2NhbFN0b3JhZ2VUZW5hbnQoKTogW3JldHVyblNldDxzdHJpbmc+LCByZXR1cm5HZXQ8c3RyaW5nPl0ge1xuICBjb25zdCBzZXRGbjogcmV0dXJuU2V0PHN0cmluZz4gPSBkYXRhID0+IHNldChZWl9URU5BTlRfS0VZLCBkYXRhKTtcbiAgY29uc3QgZ2V0Rm46IHJldHVybkdldDxzdHJpbmc+ID0gKCkgPT4gZ2V0PHN0cmluZz4oWVpfVEVOQU5UX0tFWSk7XG4gIHJldHVybiBbc2V0Rm4sIGdldEZuXTtcbn1cblxuIl19
@@ -5,8 +5,8 @@ const YZ_HEADER_KEY = '_yz_header';
5
5
  const YZ_HEADER_TYPE_KEY = '_yz_header_type';
6
6
  const YZ_DEFAULT_ROUTE_KEY = '_yz_default_route';
7
7
  const YZ_TENANT_KEY = '_yz_tenant';
8
- const YZ_LANGS_KEY = '_yz_langs';
9
- const YZ_LANG_KEY = '_yz_lang';
8
+ // export const YZ_LANGS_KEY = '_yz_langs';
9
+ // export const YZ_LANG_KEY = '_yz_lang';
10
10
  function get(key) {
11
11
  if (key === YZ_HEADER_TYPE_KEY) {
12
12
  return localStorage.getItem(key);
@@ -56,20 +56,10 @@ function useLocalStorageTenant() {
56
56
  const getFn = () => get(YZ_TENANT_KEY);
57
57
  return [setFn, getFn];
58
58
  }
59
- function useLocalStorageLangs() {
60
- const setFn = data => set(YZ_LANGS_KEY, data);
61
- const getFn = () => get(YZ_LANGS_KEY);
62
- return [setFn, getFn];
63
- }
64
- function useLocalStorageLang() {
65
- const setFn = (key, data) => set(`${YZ_LANG_KEY}_${key}`, data);
66
- const getFn = (key) => get(`${YZ_LANG_KEY}_${key}`);
67
- return [setFn, getFn];
68
- }
69
59
 
70
60
  /**
71
61
  * Generated bundle index. Do not edit.
72
62
  */
73
63
 
74
- export { YZ_CURRENT_KEY, YZ_DEFAULT_ROUTE_KEY, YZ_HEADER_KEY, YZ_HEADER_TYPE_KEY, YZ_LANGS_KEY, YZ_LANG_KEY, YZ_PROJECT_INFO_KEY, YZ_TENANT_KEY, YZ_USER_KEY, useLocalStorageCurrent, useLocalStorageDefaultRoute, useLocalStorageHeader, useLocalStorageHeaderType, useLocalStorageLang, useLocalStorageLangs, useLocalStorageProjectInfo, useLocalStorageTenant, useLocalStorageUser };
64
+ export { YZ_CURRENT_KEY, YZ_DEFAULT_ROUTE_KEY, YZ_HEADER_KEY, YZ_HEADER_TYPE_KEY, YZ_PROJECT_INFO_KEY, YZ_TENANT_KEY, YZ_USER_KEY, useLocalStorageCurrent, useLocalStorageDefaultRoute, useLocalStorageHeader, useLocalStorageHeaderType, useLocalStorageProjectInfo, useLocalStorageTenant, useLocalStorageUser };
75
65
  //# sourceMappingURL=mcache.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcache.mjs","sources":["../../../../packages/util/mcache/localStorageUtils.ts","../../../../packages/util/mcache/mcache.ts"],"sourcesContent":["import { LayoutBasicAside, NavType, YunzaiNavTopic, YunzaiProjectInfo, YunzaiUser } from '@yelon/util/mtypes';\n\nexport const YZ_USER_KEY = '_yz_user';\nexport const YZ_PROJECT_INFO_KEY = '_yz_project_info';\nexport const YZ_CURRENT_KEY = '_yz_current';\nexport const YZ_HEADER_KEY = '_yz_header';\nexport const YZ_HEADER_TYPE_KEY = '_yz_header_type';\nexport const YZ_DEFAULT_ROUTE_KEY = '_yz_default_route';\nexport const YZ_TENANT_KEY = '_yz_tenant';\nexport const YZ_LANGS_KEY = '_yz_langs';\nexport const YZ_LANG_KEY = '_yz_lang';\n\nfunction get<T>(key: string): T | null {\n if (key === YZ_HEADER_TYPE_KEY) {\n return localStorage.getItem(key) as any;\n }\n const item = localStorage.getItem(key);\n return item ? JSON.parse(item) : null;\n}\n\nfunction set<T>(key: string, data: T): void {\n if (key === YZ_HEADER_TYPE_KEY) {\n localStorage.setItem(YZ_HEADER_TYPE_KEY, data as string);\n return;\n }\n localStorage.setItem(key, JSON.stringify(data));\n}\n\ntype returnSet<T> = (data: T) => void;\ntype returnGet<T> = () => T | null;\n\nexport function useLocalStorageUser(): [returnSet<YunzaiUser>, returnGet<YunzaiUser>] {\n const setFn: returnSet<YunzaiUser> = user => set(YZ_USER_KEY, user);\n const getFn: returnGet<YunzaiUser> = () => get<YunzaiUser>(YZ_USER_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageProjectInfo(): [returnSet<YunzaiProjectInfo>, returnGet<YunzaiProjectInfo>] {\n const setFn: returnSet<YunzaiProjectInfo> = data => set(YZ_PROJECT_INFO_KEY, data);\n const getFn: returnGet<YunzaiProjectInfo> = () => get<YunzaiProjectInfo>(YZ_PROJECT_INFO_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageCurrent(): [returnSet<LayoutBasicAside>, returnGet<LayoutBasicAside>] {\n const setFn: returnSet<LayoutBasicAside> = data => set(YZ_CURRENT_KEY, data);\n const getFn: returnGet<LayoutBasicAside> = () => get<LayoutBasicAside>(YZ_CURRENT_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageHeaderType(): [returnSet<NavType>, returnGet<NavType>] {\n const setFn: returnSet<NavType> = data => set(YZ_HEADER_TYPE_KEY, data);\n const getFn: returnGet<NavType> = () => get<NavType>(YZ_HEADER_TYPE_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageHeader(): [returnSet<YunzaiNavTopic[]>, returnGet<YunzaiNavTopic[]>] {\n const setFn: returnSet<YunzaiNavTopic[]> = data => set(YZ_HEADER_KEY, data);\n const getFn: returnGet<YunzaiNavTopic[]> = () => get<YunzaiNavTopic[]>(YZ_HEADER_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageDefaultRoute(): [returnSet<string>, returnGet<string>] {\n const setFn: returnSet<string> = data => set(YZ_DEFAULT_ROUTE_KEY, data);\n const getFn: returnGet<string> = () => get<string>(YZ_DEFAULT_ROUTE_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageTenant(): [returnSet<string>, returnGet<string>] {\n const setFn: returnSet<string> = data => set(YZ_TENANT_KEY, data);\n const getFn: returnGet<string> = () => get<string>(YZ_TENANT_KEY);\n return [setFn, getFn];\n}\n\ninterface Y18NType {\n code: string;\n text: string;\n abbr: string;\n icon?: string;\n}\n\nexport function useLocalStorageLangs(): [returnSet<Y18NType[]>, returnGet<Y18NType[]>] {\n const setFn: returnSet<Y18NType[]> = data => set(YZ_LANGS_KEY, data);\n const getFn: returnGet<Y18NType[]> = () => get<Y18NType[]>(YZ_LANGS_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageLang(): [\n (key: string, data: Record<string, unknown>) => void,\n (key: string) => Record<string, unknown> | null\n] {\n const setFn = (key: string, data: Record<string, unknown>): void => set(`${YZ_LANG_KEY}_${key}`, data);\n const getFn = (key: string): Record<string, unknown> | null => get<Record<string, unknown>>(`${YZ_LANG_KEY}_${key}`);\n return [setFn, getFn];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEO,MAAM,WAAW,GAAG,WAAW;AAC/B,MAAM,mBAAmB,GAAG,mBAAmB;AAC/C,MAAM,cAAc,GAAG,cAAc;AACrC,MAAM,aAAa,GAAG,aAAa;AACnC,MAAM,kBAAkB,GAAG,kBAAkB;AAC7C,MAAM,oBAAoB,GAAG,oBAAoB;AACjD,MAAM,aAAa,GAAG,aAAa;AACnC,MAAM,YAAY,GAAG,YAAY;AACjC,MAAM,WAAW,GAAG,WAAW;AAEtC,SAAS,GAAG,CAAI,GAAW,EAAA;IACzB,IAAI,GAAG,KAAK,kBAAkB,EAAE;AAC9B,QAAA,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAQ,CAAC;AACzC,KAAA;IACD,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACvC,IAAA,OAAO,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG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CAAA,CAAE,CAAC,CAAC;AACrH,IAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxB;;AC7FA;;AAEG;;;;"}
1
+ {"version":3,"file":"mcache.mjs","sources":["../../../../packages/util/mcache/localStorageUtils.ts","../../../../packages/util/mcache/mcache.ts"],"sourcesContent":["import { LayoutBasicAside, NavType, YunzaiNavTopic, YunzaiProjectInfo, YunzaiUser } from '@yelon/util/mtypes';\n\nexport const YZ_USER_KEY = '_yz_user';\nexport const YZ_PROJECT_INFO_KEY = '_yz_project_info';\nexport const YZ_CURRENT_KEY = '_yz_current';\nexport const YZ_HEADER_KEY = '_yz_header';\nexport const YZ_HEADER_TYPE_KEY = '_yz_header_type';\nexport const YZ_DEFAULT_ROUTE_KEY = '_yz_default_route';\nexport const YZ_TENANT_KEY = '_yz_tenant';\n// export const YZ_LANGS_KEY = '_yz_langs';\n// export const YZ_LANG_KEY = '_yz_lang';\n\nfunction get<T>(key: string): T | null {\n if (key === YZ_HEADER_TYPE_KEY) {\n return localStorage.getItem(key) as any;\n }\n const item = localStorage.getItem(key);\n return item ? JSON.parse(item) : null;\n}\n\nfunction set<T>(key: string, data: T): void {\n if (key === YZ_HEADER_TYPE_KEY) {\n localStorage.setItem(YZ_HEADER_TYPE_KEY, data as string);\n return;\n }\n localStorage.setItem(key, JSON.stringify(data));\n}\n\ntype returnSet<T> = (data: T) => void;\ntype returnGet<T> = () => T | null;\n\nexport function useLocalStorageUser(): [returnSet<YunzaiUser>, returnGet<YunzaiUser>] {\n const setFn: returnSet<YunzaiUser> = user => set(YZ_USER_KEY, user);\n const getFn: returnGet<YunzaiUser> = () => get<YunzaiUser>(YZ_USER_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageProjectInfo(): [returnSet<YunzaiProjectInfo>, returnGet<YunzaiProjectInfo>] {\n const setFn: returnSet<YunzaiProjectInfo> = data => set(YZ_PROJECT_INFO_KEY, data);\n const getFn: returnGet<YunzaiProjectInfo> = () => get<YunzaiProjectInfo>(YZ_PROJECT_INFO_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageCurrent(): [returnSet<LayoutBasicAside>, returnGet<LayoutBasicAside>] {\n const setFn: returnSet<LayoutBasicAside> = data => set(YZ_CURRENT_KEY, data);\n const getFn: returnGet<LayoutBasicAside> = () => get<LayoutBasicAside>(YZ_CURRENT_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageHeaderType(): [returnSet<NavType>, returnGet<NavType>] {\n const setFn: returnSet<NavType> = data => set(YZ_HEADER_TYPE_KEY, data);\n const getFn: returnGet<NavType> = () => get<NavType>(YZ_HEADER_TYPE_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageHeader(): [returnSet<YunzaiNavTopic[]>, returnGet<YunzaiNavTopic[]>] {\n const setFn: returnSet<YunzaiNavTopic[]> = data => set(YZ_HEADER_KEY, data);\n const getFn: returnGet<YunzaiNavTopic[]> = () => get<YunzaiNavTopic[]>(YZ_HEADER_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageDefaultRoute(): [returnSet<string>, returnGet<string>] {\n const setFn: returnSet<string> = data => set(YZ_DEFAULT_ROUTE_KEY, data);\n const getFn: returnGet<string> = () => get<string>(YZ_DEFAULT_ROUTE_KEY);\n return [setFn, getFn];\n}\n\nexport function useLocalStorageTenant(): [returnSet<string>, returnGet<string>] {\n const setFn: returnSet<string> = data => set(YZ_TENANT_KEY, data);\n const getFn: returnGet<string> = () => get<string>(YZ_TENANT_KEY);\n return [setFn, getFn];\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEO,MAAM,WAAW,GAAG,WAAW;AAC/B,MAAM,mBAAmB,GAAG,mBAAmB;AAC/C,MAAM,cAAc,GAAG,cAAc;AACrC,MAAM,aAAa,GAAG,aAAa;AACnC,MAAM,kBAAkB,GAAG,kBAAkB;AAC7C,MAAM,oBAAoB,GAAG,oBAAoB;AACjD,MAAM,aAAa,GA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AG,CAAmB,cAAc,CAAC,CAAC;AACvF,IAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC;SAEe,yBAAyB,GAAA;AACvC,IAAA,MAAM,KAAK,GAAuB,IAAI,IAAI,GAAG,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACxE,MAAM,KAAK,GAAuB,MAAM,GAAG,CAAU,kBAAkB,CAAC,CAAC;AACzE,IAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC;SAEe,qBAAqB,GAAA;AACnC,IAAA,MAAM,KAAK,GAAgC,IAAI,IAAI,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAC5E,MAAM,KAAK,GAAgC,MAAM,GAAG,CAAmB,aAAa,CAAC,CAAC;AACtF,IAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC;SAEe,2BAA2B,GAAA;AACzC,IAAA,MAAM,KAAK,GAAsB,IAAI,IAAI,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IACzE,MAAM,KAAK,GAAsB,MAAM,GAAG,CAAS,oBAAoB,CAAC,CAAC;AACzE,IAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC;SAEe,qBAAqB,GAAA;AACnC,IAAA,MAAM,KAAK,GAAsB,IAAI,IAAI,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,KAAK,GAAsB,MAAM,GAAG,CAAS,aAAa,CAAC,CAAC;AAClE,IAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxB;;ACvEA;;AAEG;;;;"}
@@ -6,8 +6,6 @@ export declare const YZ_HEADER_KEY = "_yz_header";
6
6
  export declare const YZ_HEADER_TYPE_KEY = "_yz_header_type";
7
7
  export declare const YZ_DEFAULT_ROUTE_KEY = "_yz_default_route";
8
8
  export declare const YZ_TENANT_KEY = "_yz_tenant";
9
- export declare const YZ_LANGS_KEY = "_yz_langs";
10
- export declare const YZ_LANG_KEY = "_yz_lang";
11
9
  type returnSet<T> = (data: T) => void;
12
10
  type returnGet<T> = () => T | null;
13
11
  export declare function useLocalStorageUser(): [returnSet<YunzaiUser>, returnGet<YunzaiUser>];
@@ -17,15 +15,4 @@ export declare function useLocalStorageHeaderType(): [returnSet<NavType>, return
17
15
  export declare function useLocalStorageHeader(): [returnSet<YunzaiNavTopic[]>, returnGet<YunzaiNavTopic[]>];
18
16
  export declare function useLocalStorageDefaultRoute(): [returnSet<string>, returnGet<string>];
19
17
  export declare function useLocalStorageTenant(): [returnSet<string>, returnGet<string>];
20
- interface Y18NType {
21
- code: string;
22
- text: string;
23
- abbr: string;
24
- icon?: string;
25
- }
26
- export declare function useLocalStorageLangs(): [returnSet<Y18NType[]>, returnGet<Y18NType[]>];
27
- export declare function useLocalStorageLang(): [
28
- (key: string, data: Record<string, unknown>) => void,
29
- (key: string) => Record<string, unknown> | null
30
- ];
31
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yelon/util",
3
- "version": "16.2.4",
3
+ "version": "16.2.5",
4
4
  "author": "devcui<devcui@outlook.com>",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -47,6 +47,12 @@
47
47
  "esm": "./esm2022/array/array.mjs",
48
48
  "default": "./fesm2022/array.mjs"
49
49
  },
50
+ "./browser": {
51
+ "types": "./browser/index.d.ts",
52
+ "esm2022": "./esm2022/browser/browser.mjs",
53
+ "esm": "./esm2022/browser/browser.mjs",
54
+ "default": "./fesm2022/browser.mjs"
55
+ },
50
56
  "./config": {
51
57
  "types": "./config/index.d.ts",
52
58
  "esm2022": "./esm2022/config/config.mjs",
@@ -65,12 +71,6 @@
65
71
  "esm": "./esm2022/decorator/decorator.mjs",
66
72
  "default": "./fesm2022/decorator.mjs"
67
73
  },
68
- "./browser": {
69
- "types": "./browser/index.d.ts",
70
- "esm2022": "./esm2022/browser/browser.mjs",
71
- "esm": "./esm2022/browser/browser.mjs",
72
- "default": "./fesm2022/browser.mjs"
73
- },
74
74
  "./form": {
75
75
  "types": "./form/index.d.ts",
76
76
  "esm2022": "./esm2022/form/form.mjs",