hrm_ui_lib 3.1.81 → 3.1.82
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/consts/index.d.ts +1 -2
- package/consts/index.js +0 -1
- package/package.json +1 -1
- package/utils/helpers.d.ts +2 -1
- package/utils/helpers.js +6 -4
package/consts/index.d.ts
CHANGED
|
@@ -38,8 +38,7 @@ export declare enum STORE_KEYS {
|
|
|
38
38
|
isAuthenticated = "isAuthenticated",
|
|
39
39
|
personId = "personId",
|
|
40
40
|
isMobile = "isMobile",
|
|
41
|
-
staffListColumns = "staffListColumns"
|
|
42
|
-
themeMode = "themeMode"
|
|
41
|
+
staffListColumns = "staffListColumns"
|
|
43
42
|
}
|
|
44
43
|
export declare enum ThemeMode {
|
|
45
44
|
Light = "light",
|
package/consts/index.js
CHANGED
|
@@ -99,7 +99,6 @@ export var STORE_KEYS;
|
|
|
99
99
|
STORE_KEYS["personId"] = "personId";
|
|
100
100
|
STORE_KEYS["isMobile"] = "isMobile";
|
|
101
101
|
STORE_KEYS["staffListColumns"] = "staffListColumns";
|
|
102
|
-
STORE_KEYS["themeMode"] = "themeMode";
|
|
103
102
|
})(STORE_KEYS || (STORE_KEYS = {}));
|
|
104
103
|
export var ThemeMode;
|
|
105
104
|
(function (ThemeMode) {
|
package/package.json
CHANGED
package/utils/helpers.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { STORE_KEYS } from '../consts';
|
|
1
2
|
export declare const noop: () => void;
|
|
2
3
|
export declare const checkIsAllowedFileSize: (allowedSize: number, fileSize: number) => boolean;
|
|
3
4
|
export declare const openFileInNewWindow: ({ e, file, handleFileClick }: {
|
|
@@ -13,4 +14,4 @@ export declare const setTranslationValue: (translation: string, value: string |
|
|
|
13
14
|
export declare const getYearOptions: (startYear: number, lastYear: number) => TSelectOptions;
|
|
14
15
|
export declare const isSameDay: (date1?: Date, date2?: Date) => boolean;
|
|
15
16
|
export declare const generateDataTestId: (postfix: string, dataId?: string) => string;
|
|
16
|
-
export declare const clearStorage: () => void;
|
|
17
|
+
export declare const clearStorage: (preservedKeys?: STORE_KEYS[]) => void;
|
package/utils/helpers.js
CHANGED
|
@@ -74,8 +74,10 @@ export const generateDataTestId = (postfix, dataId) => {
|
|
|
74
74
|
}
|
|
75
75
|
return `${dataId}-${postfix}`;
|
|
76
76
|
};
|
|
77
|
-
export const clearStorage = () => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
export const clearStorage = (preservedKeys = [STORE_KEYS.theme]) => {
|
|
78
|
+
Object.values(STORE_KEYS).forEach((key) => {
|
|
79
|
+
if (!preservedKeys.includes(key)) {
|
|
80
|
+
localStorage.removeItem(key);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
81
83
|
};
|