@bwg-ui/core 1.1.15 → 1.1.17
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/dist/chunks/{BwgLargeUploader-Nx2-wiD8.js → BwgLargeUploader-CBwGaHh6.js} +69 -70
- package/dist/chunks/BwgLargeUploader-CBwGaHh6.js.map +1 -0
- package/dist/chunks/BwgLargeUploader-CVdp_rxx.cjs +3 -0
- package/dist/chunks/BwgLargeUploader-CVdp_rxx.cjs.map +1 -0
- package/dist/chunks/{SSOHandler-DrKRTb6h.js → SSOHandler-BfRH51hZ.js} +250 -249
- package/dist/chunks/SSOHandler-BfRH51hZ.js.map +1 -0
- package/dist/chunks/{SSOHandler-DZeC8Xgh.cjs → SSOHandler-DoidypM2.cjs} +43 -43
- package/dist/chunks/SSOHandler-DoidypM2.cjs.map +1 -0
- package/dist/chunks/{SearchBoxContext-Cpr9xa1S.cjs → SearchBoxContext-CNoEc4uu.cjs} +2 -2
- package/dist/chunks/{SearchBoxContext-Cpr9xa1S.cjs.map → SearchBoxContext-CNoEc4uu.cjs.map} +1 -1
- package/dist/chunks/{SearchBoxContext-BxtHF9BO.js → SearchBoxContext-CjdCL1e9.js} +10 -10
- package/dist/chunks/{SearchBoxContext-BxtHF9BO.js.map → SearchBoxContext-CjdCL1e9.js.map} +1 -1
- package/dist/chunks/ViewContainer-DUjKBgcl.cjs +36 -0
- package/dist/chunks/ViewContainer-DUjKBgcl.cjs.map +1 -0
- package/dist/chunks/{ViewContainer-v1V83KBq.js → ViewContainer-Du3IzFYo.js} +93 -60
- package/dist/chunks/ViewContainer-Du3IzFYo.js.map +1 -0
- package/dist/chunks/apiUtils-DlsnkCO4.cjs +3 -0
- package/dist/chunks/apiUtils-DlsnkCO4.cjs.map +1 -0
- package/dist/chunks/apiUtils-IzgDPO-1.js +1277 -0
- package/dist/chunks/apiUtils-IzgDPO-1.js.map +1 -0
- package/dist/chunks/{codeStore-BzT5wSd9.js → codeStore-Dsjc4uXs.js} +2 -2
- package/dist/chunks/{codeStore-BzT5wSd9.js.map → codeStore-Dsjc4uXs.js.map} +1 -1
- package/dist/chunks/{codeStore-BGLhSpAM.cjs → codeStore-HfLmmkAL.cjs} +2 -2
- package/dist/chunks/{codeStore-BGLhSpAM.cjs.map → codeStore-HfLmmkAL.cjs.map} +1 -1
- package/dist/chunks/envUtils-C4Yv5Nfg.cjs +2 -0
- package/dist/chunks/{envUtils-CduTHoHu.cjs.map → envUtils-C4Yv5Nfg.cjs.map} +1 -1
- package/dist/chunks/envUtils-Ck_DT0s_.js +43 -0
- package/dist/chunks/{envUtils-C9Gf5aek.js.map → envUtils-Ck_DT0s_.js.map} +1 -1
- package/dist/chunks/{favoriteStore-C9utQ6sm.js → favoriteStore-C0o6Sj55.js} +6 -6
- package/dist/chunks/favoriteStore-C0o6Sj55.js.map +1 -0
- package/dist/chunks/{favoriteStore-3YceyayF.cjs → favoriteStore-DOz2rAJu.cjs} +2 -2
- package/dist/chunks/favoriteStore-DOz2rAJu.cjs.map +1 -0
- package/dist/chunks/popupStore-Cm5utmtA.cjs +2 -0
- package/dist/chunks/popupStore-Cm5utmtA.cjs.map +1 -0
- package/dist/chunks/popupStore-D6b6b5-T.js +92 -0
- package/dist/chunks/popupStore-D6b6b5-T.js.map +1 -0
- package/dist/chunks/usePopup-BG24CocH.cjs +2 -0
- package/dist/chunks/usePopup-BG24CocH.cjs.map +1 -0
- package/dist/chunks/usePopup-Dm-UyUbV.js +109 -0
- package/dist/chunks/usePopup-Dm-UyUbV.js.map +1 -0
- package/dist/components/common/BwgButtonGroup.d.ts.map +1 -1
- package/dist/components/common/BwgGrid.d.ts +5 -1
- package/dist/components/common/BwgGrid.d.ts.map +1 -1
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgDatePicker.d.ts.map +1 -1
- package/dist/components/core/BwgLargeUploader.d.ts.map +1 -1
- package/dist/components/core/BwgMaskedInput.d.ts +1 -1
- package/dist/components/core/BwgMaskedInput.d.ts.map +1 -1
- package/dist/components/core/BwgMaskedPicker.d.ts +1 -1
- package/dist/components/core/BwgMaskedPicker.d.ts.map +1 -1
- package/dist/components/core/BwgNumber.d.ts +0 -1
- package/dist/components/core/BwgNumber.d.ts.map +1 -1
- package/dist/components/core/BwgUploader.d.ts.map +1 -1
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +1 -1
- package/dist/components/layout/PrivateProtectedOverlay.d.ts +2 -1
- package/dist/components/layout/PrivateProtectedOverlay.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +7 -6
- package/dist/index.cjs +1 -1
- package/dist/index.js +218 -313
- package/dist/index.js.map +1 -1
- package/dist/provider/contexts/index.d.ts +0 -1
- package/dist/provider/contexts/index.d.ts.map +1 -1
- package/dist/provider/index.cjs +1 -1
- package/dist/provider/index.js +24 -31
- package/dist/stores/favoriteStore.d.ts.map +1 -1
- package/dist/stores/index.cjs +1 -1
- package/dist/stores/index.js +8 -8
- package/dist/utils/commonUtils.d.ts +236 -37
- package/dist/utils/commonUtils.d.ts.map +1 -1
- package/dist/utils/{FileUtils.d.ts → fileUtils.d.ts} +9 -1
- package/dist/utils/fileUtils.d.ts.map +1 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +381 -15
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +215 -208
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/notificationUtils.d.ts +5 -5
- package/dist/utils/notificationUtils.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/chunks/BwgLargeUploader-CgrJUwFW.cjs +0 -3
- package/dist/chunks/BwgLargeUploader-CgrJUwFW.cjs.map +0 -1
- package/dist/chunks/BwgLargeUploader-Nx2-wiD8.js.map +0 -1
- package/dist/chunks/FileUtils-Bbz3AvQn.js +0 -141
- package/dist/chunks/FileUtils-Bbz3AvQn.js.map +0 -1
- package/dist/chunks/FileUtils-D73GVmB8.cjs +0 -2
- package/dist/chunks/FileUtils-D73GVmB8.cjs.map +0 -1
- package/dist/chunks/SSOHandler-DZeC8Xgh.cjs.map +0 -1
- package/dist/chunks/SSOHandler-DrKRTb6h.js.map +0 -1
- package/dist/chunks/ViewContainer-DQl7Mb0U.cjs +0 -36
- package/dist/chunks/ViewContainer-DQl7Mb0U.cjs.map +0 -1
- package/dist/chunks/ViewContainer-v1V83KBq.js.map +0 -1
- package/dist/chunks/_commonjsHelpers-DKOUU3wS.cjs +0 -2
- package/dist/chunks/_commonjsHelpers-DKOUU3wS.cjs.map +0 -1
- package/dist/chunks/_commonjsHelpers-DaMA6jEr.js +0 -9
- package/dist/chunks/_commonjsHelpers-DaMA6jEr.js.map +0 -1
- package/dist/chunks/apiUtils-C45AWfu-.js +0 -957
- package/dist/chunks/apiUtils-C45AWfu-.js.map +0 -1
- package/dist/chunks/apiUtils-Cbg6NQLv.cjs +0 -4
- package/dist/chunks/apiUtils-Cbg6NQLv.cjs.map +0 -1
- package/dist/chunks/commonUtils-BH6QwGUb.cjs +0 -2
- package/dist/chunks/commonUtils-BH6QwGUb.cjs.map +0 -1
- package/dist/chunks/commonUtils-Bb16Yqjk.js +0 -629
- package/dist/chunks/commonUtils-Bb16Yqjk.js.map +0 -1
- package/dist/chunks/envUtils-C9Gf5aek.js +0 -30
- package/dist/chunks/envUtils-CduTHoHu.cjs +0 -2
- package/dist/chunks/favoriteStore-3YceyayF.cjs.map +0 -1
- package/dist/chunks/favoriteStore-C9utQ6sm.js.map +0 -1
- package/dist/chunks/popupStore-DmFbkkjd.js +0 -98
- package/dist/chunks/popupStore-DmFbkkjd.js.map +0 -1
- package/dist/chunks/popupStore-DnWLaQ70.cjs +0 -2
- package/dist/chunks/popupStore-DnWLaQ70.cjs.map +0 -1
- package/dist/chunks/usePopup-C8FrbrDD.cjs +0 -2
- package/dist/chunks/usePopup-C8FrbrDD.cjs.map +0 -1
- package/dist/chunks/usePopup-pfh-ajfP.js +0 -241
- package/dist/chunks/usePopup-pfh-ajfP.js.map +0 -1
- package/dist/provider/contexts/UtilsContext.d.ts +0 -195
- package/dist/provider/contexts/UtilsContext.d.ts.map +0 -1
- package/dist/utils/FileUtils.d.ts.map +0 -1
- package/dist/utils/arrayUtils.d.ts +0 -35
- package/dist/utils/arrayUtils.d.ts.map +0 -1
- package/dist/utils/cookieUtils.d.ts +0 -5
- package/dist/utils/cookieUtils.d.ts.map +0 -1
- package/dist/utils/dateUtils.d.ts +0 -27
- package/dist/utils/dateUtils.d.ts.map +0 -1
- package/dist/utils/imageUtils.d.ts +0 -32
- package/dist/utils/imageUtils.d.ts.map +0 -1
- package/dist/utils/objectUtils.d.ts +0 -28
- package/dist/utils/objectUtils.d.ts.map +0 -1
- package/dist/utils/stringUtils.d.ts +0 -143
- package/dist/utils/stringUtils.d.ts.map +0 -1
package/dist/stores/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chunks/codeStore-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chunks/codeStore-HfLmmkAL.cjs"),e=require("../chunks/apiUtils-DlsnkCO4.cjs"),o=require("../chunks/popupStore-Cm5utmtA.cjs"),u=require("../chunks/favoriteStore-DOz2rAJu.cjs"),s=()=>t.useCodeStore.getState(),r=()=>o.usePopupStore.getState(),S=()=>e.useUserStore.getState(),n=()=>u.useFavoriteStore.getState(),i=()=>e.useMenuModelStore.getState(),a=()=>e.useMenuViewStore.getState();exports.useCodeStore=t.useCodeStore;exports.useColorStore=t.useColorStore;exports.useOptionStore=t.useOptionStore;exports.useLoadingStore=e.useLoadingStore;exports.useMenuModelStore=e.useMenuModelStore;exports.useMenuViewStore=e.useMenuViewStore;exports.useUserStore=e.useUserStore;exports.usePopupStore=o.usePopupStore;exports.useFavoriteStore=u.useFavoriteStore;exports.useCode=s;exports.useFavorite=n;exports.useMenuModel=i;exports.useMenuView=a;exports.usePopupState=r;exports.useUser=S;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/stores/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { u as e } from "../chunks/codeStore-
|
|
2
|
-
import { b as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { u as r } from "../chunks/popupStore-
|
|
6
|
-
import { u as a } from "../chunks/favoriteStore-
|
|
1
|
+
import { u as e } from "../chunks/codeStore-Dsjc4uXs.js";
|
|
2
|
+
import { b as l, a as x } from "../chunks/codeStore-Dsjc4uXs.js";
|
|
3
|
+
import { aC as t, aA as o, aB as s } from "../chunks/apiUtils-IzgDPO-1.js";
|
|
4
|
+
import { az as w } from "../chunks/apiUtils-IzgDPO-1.js";
|
|
5
|
+
import { u as r } from "../chunks/popupStore-D6b6b5-T.js";
|
|
6
|
+
import { u as a } from "../chunks/favoriteStore-C0o6Sj55.js";
|
|
7
7
|
const i = () => e.getState(), m = () => r.getState(), g = () => t.getState(), c = () => a.getState(), f = () => o.getState(), M = () => s.getState();
|
|
8
8
|
export {
|
|
9
9
|
i as useCode,
|
|
10
10
|
e as useCodeStore,
|
|
11
|
-
|
|
11
|
+
l as useColorStore,
|
|
12
12
|
c as useFavorite,
|
|
13
13
|
a as useFavoriteStore,
|
|
14
14
|
w as useLoadingStore,
|
|
@@ -16,7 +16,7 @@ export {
|
|
|
16
16
|
o as useMenuModelStore,
|
|
17
17
|
M as useMenuView,
|
|
18
18
|
s as useMenuViewStore,
|
|
19
|
-
|
|
19
|
+
x as useOptionStore,
|
|
20
20
|
m as usePopupState,
|
|
21
21
|
r as usePopupStore,
|
|
22
22
|
g as useUser,
|
|
@@ -1,55 +1,254 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* 테마 관련 쿠키 상수
|
|
4
|
+
*/
|
|
5
|
+
export declare const THEME_COOKIE_NAME = "ui_theme";
|
|
6
|
+
/**
|
|
7
|
+
* String 타입 가드 함수
|
|
8
|
+
* @param value
|
|
9
|
+
* @returns
|
|
3
10
|
*/
|
|
4
11
|
export declare const isString: (value: any) => value is string;
|
|
12
|
+
/**
|
|
13
|
+
* Number 타입 가드 함수
|
|
14
|
+
* @param value
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
5
17
|
export declare const isNumber: (value: any) => value is number;
|
|
18
|
+
/**
|
|
19
|
+
* Boolean 타입 가드 함수
|
|
20
|
+
* @param value
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
6
23
|
export declare const isBoolean: (value: any) => value is boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Function 타입 가드 함수
|
|
26
|
+
* @param value
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
7
29
|
export declare const isFunction: (value: any) => value is Function;
|
|
30
|
+
/**
|
|
31
|
+
* Object 타입 가드 함수
|
|
32
|
+
* @param value
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
8
35
|
export declare const isObject: (value: any) => value is object;
|
|
36
|
+
/**
|
|
37
|
+
* Array 타입 가드 함수
|
|
38
|
+
* @param value
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
9
41
|
export declare const isArray: (value: any) => value is any[];
|
|
42
|
+
/**
|
|
43
|
+
* Null 타입 가드 함수
|
|
44
|
+
* @param value
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
10
47
|
export declare const isNull: (value: any) => value is null;
|
|
48
|
+
/**
|
|
49
|
+
* Undefined 타입 가드 함수
|
|
50
|
+
* @param value
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
11
53
|
export declare const isUndefined: (value: any) => value is undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Null 또는 Undefined 타입 가드 함수
|
|
56
|
+
* @param value
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
12
59
|
export declare const isNullOrUndefined: (value: any) => value is null | undefined;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export declare const randomChoice: <T>(array: T[]) => T | undefined;
|
|
21
|
-
export declare const debounce: <T extends (...args: any[]) => any>(func: T, delay: number) => ((...args: Parameters<T>) => void);
|
|
60
|
+
/**
|
|
61
|
+
* 쓰로틀 함수
|
|
62
|
+
* : 일정 시간 간격으로 함수를 호출한다.
|
|
63
|
+
* @param func
|
|
64
|
+
* @param delay
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
22
67
|
export declare const throttle: <T extends (...args: any[]) => any>(func: T, delay: number) => ((...args: Parameters<T>) => void);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export declare const getFileExtension: (filename: string) => string;
|
|
37
|
-
export declare const isValidFileType: (file: File, allowedTypes: string[]) => boolean;
|
|
38
|
-
export declare const isValidFileSize: (file: File, maxSize: number) => boolean;
|
|
39
|
-
export declare const hexToRgb: (hex: string) => {
|
|
40
|
-
r: number;
|
|
41
|
-
g: number;
|
|
42
|
-
b: number;
|
|
43
|
-
} | null;
|
|
44
|
-
export declare const rgbToHex: (r: number, g: number, b: number) => string;
|
|
45
|
-
export declare const generateRandomColor: () => string;
|
|
68
|
+
/**
|
|
69
|
+
* 디바운스 함수
|
|
70
|
+
* : 마지막 호출 후 일정 시간 간격으로 함수를 호출한다.
|
|
71
|
+
* @param func
|
|
72
|
+
* @param delay
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
export declare const debounce: <T extends (...args: any[]) => any>(func: T, delay: number) => ((...args: Parameters<T>) => void);
|
|
76
|
+
/**
|
|
77
|
+
* 클립보드 복사 함수
|
|
78
|
+
* @param text
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
46
81
|
export declare const copyToClipboard: (text: string) => Promise<boolean>;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
82
|
+
/**
|
|
83
|
+
* 디바이스 타입 가져오기
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
51
86
|
export declare const getDeviceType: () => "mobile" | "tablet" | "desktop";
|
|
87
|
+
/**
|
|
88
|
+
* 모바일 타입 가드 함수
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
52
91
|
export declare const isMobile: () => boolean;
|
|
92
|
+
/**
|
|
93
|
+
* 태블릿 타입 가드 함수
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
53
96
|
export declare const isTablet: () => boolean;
|
|
97
|
+
/**
|
|
98
|
+
* 데스크탑 타입 가드 함수
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
54
101
|
export declare const isDesktop: () => boolean;
|
|
102
|
+
/**
|
|
103
|
+
* 랜덤 색상 생성 함수
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
export declare const generateRandomColor: () => string;
|
|
107
|
+
/**
|
|
108
|
+
* 배열이 비어있는지 확인
|
|
109
|
+
* @param arr
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
export declare const isEmptyArray: <T>(arr: T[]) => boolean;
|
|
113
|
+
/**
|
|
114
|
+
* 배열 중복 제거
|
|
115
|
+
* @param arr
|
|
116
|
+
* @returns
|
|
117
|
+
*/
|
|
118
|
+
export declare const arrUnique: <T>(arr: T[]) => T[];
|
|
119
|
+
/**
|
|
120
|
+
* 배열에서 최대값 찾기
|
|
121
|
+
* @param arr
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
export declare const arrMax: (arr: number[]) => number | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* 배열에서 최소값 찾기
|
|
127
|
+
* @param arr
|
|
128
|
+
* @returns
|
|
129
|
+
*/
|
|
130
|
+
export declare const arrMin: (arr: number[]) => number | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* 배열 평균 계산
|
|
133
|
+
* @param arr
|
|
134
|
+
* @returns
|
|
135
|
+
*/
|
|
136
|
+
export declare const arrAverage: (arr: number[]) => number | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* 배열 합계 계산
|
|
139
|
+
* @param arr
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
export declare const arrSum: (arr: number[]) => number;
|
|
143
|
+
/**
|
|
144
|
+
* 배열에서 특정 조건을 만족하는 요소 개수 세기
|
|
145
|
+
* @param arr
|
|
146
|
+
* @param predicate
|
|
147
|
+
* @returns
|
|
148
|
+
*/
|
|
149
|
+
export declare const arrCount: <T>(arr: T[], predicate: (item: T) => boolean) => number;
|
|
150
|
+
/**
|
|
151
|
+
* 배열을 뒤집기
|
|
152
|
+
* @param arr
|
|
153
|
+
* @returns
|
|
154
|
+
*/
|
|
155
|
+
export declare const arrReverse: <T>(arr: T[]) => T[];
|
|
156
|
+
/**
|
|
157
|
+
* 배열에서 중복 요소들 찾기
|
|
158
|
+
* @param arr
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
161
|
+
export declare const duplicates: <T>(arr: T[]) => T[];
|
|
162
|
+
/**
|
|
163
|
+
* 랜덤 관련
|
|
164
|
+
* @param min
|
|
165
|
+
* @param max
|
|
166
|
+
* @returns
|
|
167
|
+
*/
|
|
168
|
+
export declare const random: (min: number, max: number) => number;
|
|
169
|
+
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
170
|
+
export declare const round: (value: number, decimals?: number) => number;
|
|
171
|
+
/**
|
|
172
|
+
* 세션 스토리지 설정
|
|
173
|
+
* @param key
|
|
174
|
+
* @param value
|
|
175
|
+
* @returns
|
|
176
|
+
*/
|
|
177
|
+
export declare const setSessionStorage: (key: string, value: any) => void;
|
|
178
|
+
/**
|
|
179
|
+
* 세션 스토리지 가져오기
|
|
180
|
+
* @param key
|
|
181
|
+
* @param defaultValue
|
|
182
|
+
* @returns
|
|
183
|
+
*/
|
|
184
|
+
export declare const getSessionStorage: <T>(key: string, defaultValue?: T) => T | null;
|
|
185
|
+
/**
|
|
186
|
+
* 세션 스토리지 삭제
|
|
187
|
+
* @param key
|
|
188
|
+
* @returns
|
|
189
|
+
*/
|
|
190
|
+
export declare const removeSessionStorage: (key: string) => void;
|
|
191
|
+
/**
|
|
192
|
+
* 세션 스토리지 초기화
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
export declare const clearSessionStorage: () => void;
|
|
196
|
+
/**
|
|
197
|
+
* 쿠키 설정
|
|
198
|
+
* @param name
|
|
199
|
+
* @param value
|
|
200
|
+
* @param days
|
|
201
|
+
* @returns
|
|
202
|
+
*/
|
|
203
|
+
export declare const setCookie: (name: string, value: string, days?: number) => void;
|
|
204
|
+
/**
|
|
205
|
+
* 쿠키 가져오기
|
|
206
|
+
* @param name
|
|
207
|
+
* @returns
|
|
208
|
+
*/
|
|
209
|
+
export declare const getCookie: (name: string) => string | null;
|
|
210
|
+
/**
|
|
211
|
+
* 쿠키 삭제
|
|
212
|
+
* @param name
|
|
213
|
+
* @returns
|
|
214
|
+
*/
|
|
215
|
+
export declare const deleteCookie: (name: string) => void;
|
|
216
|
+
export declare const isEmpty: (str: any) => boolean;
|
|
217
|
+
/**
|
|
218
|
+
* 문자열이 비어있는지 확인하고, 비어있으면 defaultValue를 반환
|
|
219
|
+
* @param str - 문자열
|
|
220
|
+
* @param defaultValue - 비어있을 때 반환할 기본값
|
|
221
|
+
* @returns 문자열이 비어있으면 defaultValue, 아니면 str
|
|
222
|
+
*/
|
|
223
|
+
export declare const isSafeEmpty: (str: string | null | undefined, defaultValue: string) => string;
|
|
224
|
+
export declare const toCamelCase: (str: string) => string;
|
|
225
|
+
export declare const isValidEmail: (email: string) => boolean;
|
|
226
|
+
export declare const isValidUrl: (url: string) => boolean;
|
|
227
|
+
export declare const padLeft: (str: string, length: number, char?: string) => string;
|
|
228
|
+
export declare const padRight: (str: string, length: number, char?: string) => string;
|
|
229
|
+
export declare const generateRandomString: (length: number, chars?: string) => string;
|
|
230
|
+
/**
|
|
231
|
+
* Random UID 생성 (하이픈 제거)
|
|
232
|
+
* @param length - UID 길이 (기본값: 32)
|
|
233
|
+
* @returns 하이픈이 제거된 UID 문자열
|
|
234
|
+
*/
|
|
235
|
+
export declare const generateUID: (length?: number) => string;
|
|
236
|
+
/**
|
|
237
|
+
* SHA256 단방향 암호화
|
|
238
|
+
* @param data
|
|
239
|
+
* @returns
|
|
240
|
+
|
|
241
|
+
*/
|
|
242
|
+
export declare function encryptSha256(input: string): Promise<string>;
|
|
243
|
+
/**
|
|
244
|
+
* 현재 날짜/시간 가져오기
|
|
245
|
+
* @returns
|
|
246
|
+
*/
|
|
247
|
+
export declare const getCurrentDate: () => Dayjs;
|
|
248
|
+
/**
|
|
249
|
+
* 현재 날짜/시간 가져오기
|
|
250
|
+
* @param format
|
|
251
|
+
* @returns
|
|
252
|
+
*/
|
|
253
|
+
export declare const getCurrentDateString: (format?: string) => string;
|
|
55
254
|
//# sourceMappingURL=commonUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../src/utils/commonUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../src/utils/commonUtils.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAG5C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI,MAAmC,CAAA;AAClF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI,MAAoD,CAAA;AACnG;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,GAA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AAQ,GACnB,KAAK,MAAM,EACX,QAAQ,MAAM,EACd,OAAM,MAAY,KACjB,MAEF,CAAC;AAGJ,eAAO,MAAM,oBAAoB,GAC7B,QAAQ,MAAM,EACd,QAAO,MAAyE,KAC/E,MAMF,CAAC;AAaJ;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,SAAQ,MAAW,KAAG,MAUjD,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQlE;AAGD,OAAc,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,iBAAiB,CAAC;AAWzB;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,KAAgB,CAAA;AAClD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAQ,MAAqB,KAAG,MAAgC,CAAA"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 파일 다운로드
|
|
3
|
+
* @param data
|
|
4
|
+
* @param filename
|
|
5
|
+
* @param type
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const downloadFile: (data: string, filename: string, type?: string) => void;
|
|
1
9
|
/**
|
|
2
10
|
* 파일 키를 사용하여 파일 상세 정보를 조회하고, 해당 정보를 바탕으로 다운로드를 시작하는 유틸리티 함수입니다.
|
|
3
11
|
*
|
|
@@ -5,4 +13,4 @@
|
|
|
5
13
|
* @returns API 호출 결과 또는 오류
|
|
6
14
|
*/
|
|
7
15
|
export declare function downloadByFileKey(fileKey: string): Promise<any>;
|
|
8
|
-
//# sourceMappingURL=
|
|
16
|
+
//# sourceMappingURL=fileUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileUtils.d.ts","sourceRoot":"","sources":["../../src/utils/fileUtils.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,EAAE,OAAM,MAAqB,KAAG,IAU1F,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAqCrE"}
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/apiUtils-DlsnkCO4.cjs"),r=require("../chunks/envUtils-C4Yv5Nfg.cjs"),n=require("antd"),d=require("../chunks/realFormat-Cha7OTd9.cjs"),u=(o,t,i="text/plain")=>{const s=new Blob([o],{type:i}),c=URL.createObjectURL(s),a=document.createElement("a");a.href=c,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(c)};async function p(o){try{return await e.callService("SCMFILE00101",{crprCd:e.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileKey:o}).then(i=>{let s;if(i.sub&&(s=i.sub[0]),console.log(i),console.log(s),!s.lgclFileNm)throw console.error("논리파일명이 없습니다."),new Error("논리 파일명 누락");if(!s.filePath)throw console.error("파일 경로가 없습니다."),new Error("파일 경로 누락");const c=`api/download?filePath=${encodeURIComponent(s.filePath)}&logicalName=${encodeURIComponent(s.lgclFileNm)}`;return window.open(c,"_blank"),{success:!0,message:"파일 다운로드 요청 성공"}})}catch(t){throw console.error("downloadByFileKey 함수 실행 중 오류 발생:",t),t}}const m=Object.freeze(Object.defineProperty({__proto__:null,downloadByFileKey:p,downloadFile:u},Symbol.toStringTag,{value:"Module"})),g=(o,t=3)=>{n.message.success({content:o,duration:t})},l=(o,t=5)=>{n.message.error({content:o,duration:t})},S=(o,t=4)=>{n.message.warning({content:o,duration:t})},U=(o,t=3)=>{n.message.info({content:o,duration:t})},f=(o="처리중...")=>n.message.loading({content:o,duration:0}),C=o=>{n.message.destroy(o)},v=()=>{n.message.destroy()},h=(o,t="처리 중 오류가 발생했습니다.")=>{const i=o?.response?.data?.message||o?.message||t;l(i)},w=(o="저장")=>{g(`${o}이 완료되었습니다.`)},y=(o="저장")=>{l(`${o} 중 오류가 발생했습니다.`)},E=o=>{l(`이미 사용중인 ${o}입니다.`)},M=o=>{l(`${o}을(를) 입력해주세요.`)},b=Object.freeze(Object.defineProperty({__proto__:null,closeAllMessages:v,closeMessage:C,showApiError:h,showDuplicateError:E,showError:l,showInfo:U,showLoading:f,showRequiredError:M,showSaveError:y,showSaveSuccess:w,showSuccess:g,showWarning:S},Symbol.toStringTag,{value:"Module"})),I=e.apiUtilsModule,R=e.commonUtilsModule,N=r.envUtilsModule,A=m,_=b,O=e.notificationUtilsModule,P=e.serviceConfigModule,F=e.userUtilsModule,D={...e.apiUtilsModule,...e.commonUtilsModule,...r.envUtilsModule,...m,...b,...e.notificationUtilsModule,...e.serviceConfigModule,...e.userUtilsModule,realFormat:d.realFormat};exports.ApiError=e.ApiError;exports.THEME_COOKIE_NAME=e.THEME_COOKIE_NAME;exports.apiDelete=e.apiDelete;exports.apiGet=e.apiGet;exports.apiPatch=e.apiPatch;exports.apiPost=e.apiPost;exports.apiPut=e.apiPut;exports.arrAverage=e.arrAverage;exports.arrCount=e.arrCount;exports.arrMax=e.arrMax;exports.arrMin=e.arrMin;exports.arrReverse=e.arrReverse;exports.arrSum=e.arrSum;exports.arrUnique=e.arrUnique;exports.callService=e.callService;exports.clamp=e.clamp;exports.clearSessionStorage=e.clearSessionStorage;exports.closeNotification=e.closeNotification;exports.copyToClipboard=e.copyToClipboard;exports.debounce=e.debounce;exports.deleteCookie=e.deleteCookie;exports.destroyNotifications=e.destroyNotifications;exports.duplicates=e.duplicates;exports.encryptSha256=e.encryptSha256;exports.generateRandomColor=e.generateRandomColor;exports.generateRandomString=e.generateRandomString;exports.generateUID=e.generateUID;exports.getAllServiceCodes=e.getAllServiceCodes;exports.getClientIp=e.getClientIp;exports.getCookie=e.getCookie;exports.getCrprCd=e.getCrprCd;exports.getCurrentDate=e.getCurrentDate;exports.getCurrentDateString=e.getCurrentDateString;exports.getDepartmentInfo=e.getDepartmentInfo;exports.getDeviceType=e.getDeviceType;exports.getDisplayName=e.getDisplayName;exports.getDprtCd=e.getDprtCd;exports.getDprtNm=e.getDprtNm;exports.getEmplNo=e.getEmplNo;exports.getGuid=e.getGuid;exports.getPermissionService=e.getPermissionService;exports.getRoleList=e.getRoleList;exports.getServiceCode=e.getServiceCode;exports.getSessionStorage=e.getSessionStorage;exports.getUserDvsn=e.getUserDvsn;exports.getUserId=e.getUserId;exports.getUserInfo=e.getUserInfo;exports.getUserNm=e.getUserNm;exports.hasAllRoles=e.hasAllRoles;exports.hasAnyRole=e.hasAnyRole;exports.hasRole=e.hasRole;exports.hasUserInfo=e.hasUserInfo;exports.isArray=e.isArray;exports.isBoolean=e.isBoolean;exports.isDesktop=e.isDesktop;exports.isEmpty=e.isEmpty;exports.isEmptyArray=e.isEmptyArray;exports.isFunction=e.isFunction;exports.isLoggedIn=e.isLoggedIn;exports.isMobile=e.isMobile;exports.isNull=e.isNull;exports.isNullOrUndefined=e.isNullOrUndefined;exports.isNumber=e.isNumber;exports.isObject=e.isObject;exports.isSafeEmpty=e.isSafeEmpty;exports.isString=e.isString;exports.isTablet=e.isTablet;exports.isUndefined=e.isUndefined;exports.isValidEmail=e.isValidEmail;exports.isValidUrl=e.isValidUrl;exports.logServiceCodeConfig=e.logServiceCodeConfig;exports.notiBwgError=e.notiBwgError;exports.notiError=e.notiError;exports.notiInfo=e.notiInfo;exports.notiSuccess=e.notiSuccess;exports.notiWarning=e.notiWarning;exports.notificationService=e.notificationService;exports.padLeft=e.padLeft;exports.padRight=e.padRight;exports.random=e.random;exports.removeSessionStorage=e.removeSessionStorage;exports.round=e.round;exports.setClientIp=e.setClientIp;exports.setCookie=e.setCookie;exports.setServiceCodeOverrides=e.setServiceCodeOverrides;exports.setSessionStorage=e.setSessionStorage;exports.throttle=e.throttle;exports.toCamelCase=e.toCamelCase;exports.verifyClientIp=e.verifyClientIp;exports.configureEnvUtils=r.configureEnvUtils;exports.getEnvCode=r.getEnvCode;exports.isDev=r.isDev;exports.isLocal=r.isLocal;exports.isProd=r.isProd;exports.realFormat=d.realFormat;exports.apiUtils=I;exports.bwgUtils=D;exports.closeAllMessages=v;exports.closeMessage=C;exports.commonUtils=R;exports.default=D;exports.downloadByFileKey=p;exports.downloadFile=u;exports.envUtils=N;exports.fileUtils=A;exports.messageUtils=_;exports.notificationUtils=O;exports.serviceUtils=P;exports.showApiError=h;exports.showDuplicateError=E;exports.showError=l;exports.showInfo=U;exports.showLoading=f;exports.showRequiredError=M;exports.showSaveError=y;exports.showSaveSuccess=w;exports.showSuccess=g;exports.showWarning=S;exports.userUtils=F;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/utils/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/utils/fileUtils.ts","../../src/utils/messageUtils.ts","../../src/utils/index.ts"],"sourcesContent":["import { callService } from \"./apiUtils\";\r\nimport { getUserInfo } from \"./userUtils\";\r\n\r\n/**\r\n * 파일 다운로드\r\n * @param data \r\n * @param filename \r\n * @param type \r\n * @returns \r\n */\r\nexport const downloadFile = (data: string, filename: string, type: string = 'text/plain'): void => {\r\n const blob = new Blob([data], { type })\r\n const url = URL.createObjectURL(blob)\r\n const link = document.createElement('a')\r\n link.href = url\r\n link.download = filename\r\n document.body.appendChild(link)\r\n link.click()\r\n document.body.removeChild(link)\r\n URL.revokeObjectURL(url)\r\n}\r\n\r\n/**\r\n * 파일 키를 사용하여 파일 상세 정보를 조회하고, 해당 정보를 바탕으로 다운로드를 시작하는 유틸리티 함수입니다.\r\n *\r\n * @param fileKey - 조회할 파일의 키 (fileGrpKey)\r\n * @returns API 호출 결과 또는 오류\r\n */\r\nexport async function downloadByFileKey(fileKey: string): Promise<any> {\r\n try {\r\n // 1. fileKey를 매개변수로 파일 상세 정보 조회 서비스 호출\r\n const fileDetailsResponse = await callService(\"SCMFILE00101\", {\r\n crprCd: getUserInfo()?.crprCd,\r\n sysCd: __SYS_CD__,\r\n fileKey,\r\n }).then((res) => {\r\n let response;\r\n if (res.sub) {\r\n response = res.sub[0];\r\n }\r\n console.log(res);\r\n console.log(response);\r\n if (!response.lgclFileNm) {\r\n console.error(\"논리파일명이 없습니다.\");\r\n throw new Error(\"논리 파일명 누락\");\r\n }\r\n if (!response.filePath) {\r\n console.error(\"파일 경로가 없습니다.\");\r\n throw new Error(\"파일 경로 누락\");\r\n }\r\n\r\n // download api 호출\r\n const downloadUrl = `api/download?filePath=${encodeURIComponent(\r\n response.filePath\r\n )}&logicalName=${encodeURIComponent(response.lgclFileNm)}`;\r\n window.open(downloadUrl, \"_blank\"); // 새 탭에서 열어 다운로드 트리거\r\n\r\n return { success: true, message: \"파일 다운로드 요청 성공\" }; // 다운로드 요청 성공을 나타내는 객체 반환\r\n });\r\n\r\n return fileDetailsResponse; // .then() 블록의 결과 반환\r\n } catch (error) {\r\n console.error(\"downloadByFileKey 함수 실행 중 오류 발생:\", error);\r\n throw error;\r\n }\r\n}\r\n","import { message } from 'antd';\r\n\r\n/**\r\n * 성공 메시지 표시\r\n * @param content 메시지 내용\r\n * @param duration 표시 시간 (초)\r\n */\r\nexport const showSuccess = (content: string, duration: number = 3) => {\r\n message.success({\r\n content,\r\n duration,\r\n });\r\n};\r\n\r\n/**\r\n * 오류 메시지 표시\r\n * @param content 메시지 내용\r\n * @param duration 표시 시간 (초)\r\n */\r\nexport const showError = (content: string, duration: number = 5) => {\r\n message.error({\r\n content,\r\n duration,\r\n });\r\n};\r\n\r\n/**\r\n * 경고 메시지 표시\r\n * @param content 메시지 내용\r\n * @param duration 표시 시간 (초)\r\n */\r\nexport const showWarning = (content: string, duration: number = 4) => {\r\n message.warning({\r\n content,\r\n duration,\r\n });\r\n};\r\n\r\n/**\r\n * 정보 메시지 표시\r\n * @param content 메시지 내용\r\n * @param duration 표시 시간 (초)\r\n */\r\nexport const showInfo = (content: string, duration: number = 3) => {\r\n message.info({\r\n content,\r\n duration,\r\n });\r\n};\r\n\r\n/**\r\n * 로딩 메시지 표시\r\n * @param content 메시지 내용\r\n * @returns 메시지 키 (닫을 때 사용)\r\n */\r\nexport const showLoading = (content: string = '처리중...') => {\r\n return message.loading({\r\n content,\r\n duration: 0, // 수동으로 닫을 때까지 유지\r\n });\r\n};\r\n\r\n/**\r\n * 메시지 닫기\r\n * @param key 메시지 키\r\n */\r\nexport const closeMessage = (key: string) => {\r\n message.destroy(key);\r\n};\r\n\r\n/**\r\n * 모든 메시지 닫기\r\n */\r\nexport const closeAllMessages = () => {\r\n message.destroy();\r\n};\r\n\r\n/**\r\n * API 오류 메시지 표시 (공통)\r\n * @param error 오류 객체\r\n * @param defaultMessage 기본 오류 메시지\r\n */\r\nexport const showApiError = (\r\n error: any,\r\n defaultMessage: string = '처리 중 오류가 발생했습니다.'\r\n) => {\r\n const errorMessage =\r\n error?.response?.data?.message || error?.message || defaultMessage;\r\n showError(errorMessage);\r\n};\r\n\r\n/**\r\n * 저장 성공 메시지 표시\r\n * @param type 저장 타입 ('등록', '수정', '삭제' 등)\r\n */\r\nexport const showSaveSuccess = (type: string = '저장') => {\r\n showSuccess(`${type}이 완료되었습니다.`);\r\n};\r\n\r\n/**\r\n * 저장 실패 메시지 표시\r\n * @param type 저장 타입 ('등록', '수정', '삭제' 등)\r\n */\r\nexport const showSaveError = (type: string = '저장') => {\r\n showError(`${type} 중 오류가 발생했습니다.`);\r\n};\r\n\r\n/**\r\n * 중복 체크 실패 메시지 표시\r\n * @param fieldName 필드명\r\n */\r\nexport const showDuplicateError = (fieldName: string) => {\r\n showError(`이미 사용중인 ${fieldName}입니다.`);\r\n};\r\n\r\n/**\r\n * 필수 입력 항목 메시지 표시\r\n * @param fieldName 필드명\r\n */\r\nexport const showRequiredError = (fieldName: string) => {\r\n showError(`${fieldName}을(를) 입력해주세요.`);\r\n};\r\n","// 기존 방식: 개별 함수들을 직접 export\r\nexport * from './apiUtils';\r\nexport * from './commonUtils';\r\nexport * from './envUtils';\r\nexport * from './fileUtils';\r\nexport * from './messageUtils';\r\nexport * from './notificationUtils';\r\nexport { default as realFormat } from './realFormat';\r\nexport * from './serviceConfig';\r\nexport * from './userUtils';\r\n\r\n// 네임스페이스 객체들도 함께 제공\r\nimport * as apiUtilsModule from './apiUtils';\r\nimport * as commonUtilsModule from './commonUtils';\r\nimport * as envUtilsModule from './envUtils';\r\nimport * as fileUtilsModule from './fileUtils';\r\nimport * as messageUtilsModule from './messageUtils';\r\nimport * as notificationUtilsModule from './notificationUtils';\r\nimport { default as realFormat } from './realFormat';\r\nimport * as serviceConfigModule from './serviceConfig';\r\nimport * as userUtilsModule from './userUtils';\r\n\r\n// 개별 네임스페이스 객체들\r\nexport const apiUtils = apiUtilsModule;\r\nexport const commonUtils = commonUtilsModule;\r\nexport const envUtils = envUtilsModule;\r\nexport const fileUtils = fileUtilsModule;\r\nexport const messageUtils = messageUtilsModule;\r\nexport const notificationUtils = notificationUtilsModule;\r\nexport const serviceUtils = serviceConfigModule;\r\nexport const userUtils = userUtilsModule;\r\n\r\n// 통합 bwgUtils 객체 (모든 유틸리티를 하나로)\r\nexport const bwgUtils = {\r\n ...apiUtilsModule,\r\n ...commonUtilsModule,\r\n ...envUtilsModule,\r\n ...fileUtilsModule,\r\n ...messageUtilsModule,\r\n ...notificationUtilsModule,\r\n ...serviceConfigModule,\r\n ...userUtilsModule,\r\n realFormat,\r\n};\r\n\r\n// 기본 export로 bwgUtils 제공\r\nexport default bwgUtils;"],"names":["downloadFile","data","filename","type","blob","url","link","downloadByFileKey","fileKey","callService","getUserInfo","res","response","downloadUrl","error","showSuccess","content","duration","message","showError","showWarning","showInfo","showLoading","closeMessage","key","closeAllMessages","showApiError","defaultMessage","errorMessage","showSaveSuccess","showSaveError","showDuplicateError","fieldName","showRequiredError","apiUtils","apiUtilsModule","commonUtils","commonUtilsModule","envUtils","envUtilsModule","fileUtils","fileUtilsModule","messageUtils","messageUtilsModule","notificationUtils","notificationUtilsModule","serviceUtils","serviceConfigModule","userUtils","userUtilsModule","bwgUtils","realFormat"],"mappings":"6QAUaA,EAAe,CAACC,EAAcC,EAAkBC,EAAe,eAAuB,CACjG,MAAMC,EAAO,IAAI,KAAK,CAACH,CAAI,EAAG,CAAE,KAAAE,EAAM,EAChCE,EAAM,IAAI,gBAAgBD,CAAI,EAC9BE,EAAO,SAAS,cAAc,GAAG,EACvCA,EAAK,KAAOD,EACZC,EAAK,SAAWJ,EAChB,SAAS,KAAK,YAAYI,CAAI,EAC9BA,EAAK,MAAA,EACL,SAAS,KAAK,YAAYA,CAAI,EAC9B,IAAI,gBAAgBD,CAAG,CACzB,EAQA,eAAsBE,EAAkBC,EAA+B,CACrE,GAAI,CA+BF,OA7B4B,MAAMC,EAAAA,YAAY,eAAgB,CAC5D,OAAQC,EAAAA,eAAe,OACvB,MAAO,WACP,QAAAF,CAAA,CACD,EAAE,KAAMG,GAAQ,CACf,IAAIC,EAMJ,GALID,EAAI,MACNC,EAAWD,EAAI,IAAI,CAAC,GAEtB,QAAQ,IAAIA,CAAG,EACf,QAAQ,IAAIC,CAAQ,EAChB,CAACA,EAAS,WACZ,cAAQ,MAAM,cAAc,EACtB,IAAI,MAAM,WAAW,EAE7B,GAAI,CAACA,EAAS,SACZ,cAAQ,MAAM,cAAc,EACtB,IAAI,MAAM,UAAU,EAI5B,MAAMC,EAAc,yBAAyB,mBAC3CD,EAAS,QAAA,CACV,gBAAgB,mBAAmBA,EAAS,UAAU,CAAC,GACxD,cAAO,KAAKC,EAAa,QAAQ,EAE1B,CAAE,QAAS,GAAM,QAAS,eAAA,CACnC,CAAC,CAGH,OAASC,EAAO,CACd,cAAQ,MAAM,mCAAoCA,CAAK,EACjDA,CACR,CACF,uIC1DaC,EAAc,CAACC,EAAiBC,EAAmB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