@fctc/interface-logic 5.2.6 → 5.2.8

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.
Files changed (55) hide show
  1. package/dist/{chunk-F2VAAEVB.mjs → chunk-6ARYI77N.mjs} +3 -12
  2. package/dist/chunk-6LSKTACC.js +687 -0
  3. package/dist/{chunk-ZDXEWQQD.mjs → chunk-ACSPOGTI.mjs} +7 -14
  4. package/dist/chunk-B432GFRR.mjs +606 -0
  5. package/dist/{chunk-HQVNK2EW.mjs → chunk-BPJZ3QRN.mjs} +770 -128
  6. package/dist/{chunk-FWBYTZIV.js → chunk-C5QQGBN4.js} +18 -23
  7. package/dist/chunk-COC7NGXP.js +19 -19
  8. package/dist/chunk-GGNOJ77I.js +2 -1
  9. package/dist/{chunk-F4RE57FT.mjs → chunk-ICDQN2GL.mjs} +539 -1393
  10. package/dist/{chunk-U4Q3MW45.js → chunk-JDXUTKMX.js} +852 -170
  11. package/dist/chunk-Q3Y6RCJ4.mjs +1 -18
  12. package/dist/{chunk-CCTDGAMA.js → chunk-Q5YXX4OR.js} +51 -52
  13. package/dist/{chunk-U2COUTK5.js → chunk-TX2WZCYM.js} +931 -1610
  14. package/dist/chunk-VBVNP77T.mjs +2 -6
  15. package/dist/chunk-WAXGOBY2.mjs +1 -0
  16. package/dist/chunk-WTPKTZQC.js +31 -33
  17. package/dist/configs.js +9 -4
  18. package/dist/configs.mjs +3 -7
  19. package/dist/constants.js +70 -36
  20. package/dist/constants.mjs +1 -36
  21. package/dist/environment.d.mts +1 -1
  22. package/dist/environment.d.ts +1 -1
  23. package/dist/environment.js +17 -8
  24. package/dist/environment.mjs +4 -12
  25. package/dist/hooks.d.mts +9 -3
  26. package/dist/hooks.d.ts +9 -3
  27. package/dist/hooks.js +617 -306
  28. package/dist/hooks.mjs +6 -312
  29. package/dist/index.d.mts +10 -4
  30. package/dist/index.d.ts +10 -4
  31. package/dist/index.js +1245 -433
  32. package/dist/index.mjs +8 -433
  33. package/dist/{local-storage-AbiOQTLK.d.mts → local-storage-BPvoMGYJ.d.mts} +1 -1
  34. package/dist/{local-storage-AbiOQTLK.d.ts → local-storage-BPvoMGYJ.d.ts} +1 -1
  35. package/dist/models.js +7 -3
  36. package/dist/models.mjs +2 -7
  37. package/dist/provider.d.mts +8 -3
  38. package/dist/provider.d.ts +8 -3
  39. package/dist/provider.js +45 -20
  40. package/dist/provider.mjs +6 -26
  41. package/dist/services.d.mts +2 -2
  42. package/dist/services.d.ts +2 -2
  43. package/dist/services.js +49 -24
  44. package/dist/services.mjs +6 -30
  45. package/dist/store.d.mts +382 -0
  46. package/dist/store.d.ts +382 -0
  47. package/dist/store.js +326 -0
  48. package/dist/store.mjs +1 -0
  49. package/dist/types.js +4 -1
  50. package/dist/types.mjs +1 -1
  51. package/dist/utils.d.mts +61 -33
  52. package/dist/utils.d.ts +61 -33
  53. package/dist/utils.js +139 -36
  54. package/dist/utils.mjs +2 -36
  55. package/package.json +93 -79
package/dist/store.js ADDED
@@ -0,0 +1,326 @@
1
+ 'use strict';
2
+
3
+ var chunk6LSKTACC_js = require('./chunk-6LSKTACC.js');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "breadcrumbsSlice", {
8
+ enumerable: true,
9
+ get: function () { return chunk6LSKTACC_js.breadcrumbsSlice; }
10
+ });
11
+ Object.defineProperty(exports, "clearSearchMap", {
12
+ enumerable: true,
13
+ get: function () { return chunk6LSKTACC_js.clearSearchMap; }
14
+ });
15
+ Object.defineProperty(exports, "envSlice", {
16
+ enumerable: true,
17
+ get: function () { return chunk6LSKTACC_js.envSlice; }
18
+ });
19
+ Object.defineProperty(exports, "envStore", {
20
+ enumerable: true,
21
+ get: function () { return chunk6LSKTACC_js.envStore; }
22
+ });
23
+ Object.defineProperty(exports, "excelSlice", {
24
+ enumerable: true,
25
+ get: function () { return chunk6LSKTACC_js.excelSlice; }
26
+ });
27
+ Object.defineProperty(exports, "formSlice", {
28
+ enumerable: true,
29
+ get: function () { return chunk6LSKTACC_js.formSlice; }
30
+ });
31
+ Object.defineProperty(exports, "headerSlice", {
32
+ enumerable: true,
33
+ get: function () { return chunk6LSKTACC_js.headerSlice; }
34
+ });
35
+ Object.defineProperty(exports, "listSlice", {
36
+ enumerable: true,
37
+ get: function () { return chunk6LSKTACC_js.listSlice; }
38
+ });
39
+ Object.defineProperty(exports, "loginSlice", {
40
+ enumerable: true,
41
+ get: function () { return chunk6LSKTACC_js.loginSlice; }
42
+ });
43
+ Object.defineProperty(exports, "navbarSlice", {
44
+ enumerable: true,
45
+ get: function () { return chunk6LSKTACC_js.navbarSlice; }
46
+ });
47
+ Object.defineProperty(exports, "profileSlice", {
48
+ enumerable: true,
49
+ get: function () { return chunk6LSKTACC_js.profileSlice; }
50
+ });
51
+ Object.defineProperty(exports, "removeKeyFromSearchMap", {
52
+ enumerable: true,
53
+ get: function () { return chunk6LSKTACC_js.removeKeyFromSearchMap; }
54
+ });
55
+ Object.defineProperty(exports, "searchSlice", {
56
+ enumerable: true,
57
+ get: function () { return chunk6LSKTACC_js.searchSlice; }
58
+ });
59
+ Object.defineProperty(exports, "selectBreadCrumbs", {
60
+ enumerable: true,
61
+ get: function () { return chunk6LSKTACC_js.selectBreadCrumbs; }
62
+ });
63
+ Object.defineProperty(exports, "selectEnv", {
64
+ enumerable: true,
65
+ get: function () { return chunk6LSKTACC_js.selectEnv; }
66
+ });
67
+ Object.defineProperty(exports, "selectExcel", {
68
+ enumerable: true,
69
+ get: function () { return chunk6LSKTACC_js.selectExcel; }
70
+ });
71
+ Object.defineProperty(exports, "selectForm", {
72
+ enumerable: true,
73
+ get: function () { return chunk6LSKTACC_js.selectForm; }
74
+ });
75
+ Object.defineProperty(exports, "selectHeader", {
76
+ enumerable: true,
77
+ get: function () { return chunk6LSKTACC_js.selectHeader; }
78
+ });
79
+ Object.defineProperty(exports, "selectList", {
80
+ enumerable: true,
81
+ get: function () { return chunk6LSKTACC_js.selectList; }
82
+ });
83
+ Object.defineProperty(exports, "selectLogin", {
84
+ enumerable: true,
85
+ get: function () { return chunk6LSKTACC_js.selectLogin; }
86
+ });
87
+ Object.defineProperty(exports, "selectNavbar", {
88
+ enumerable: true,
89
+ get: function () { return chunk6LSKTACC_js.selectNavbar; }
90
+ });
91
+ Object.defineProperty(exports, "selectProfile", {
92
+ enumerable: true,
93
+ get: function () { return chunk6LSKTACC_js.selectProfile; }
94
+ });
95
+ Object.defineProperty(exports, "selectSearch", {
96
+ enumerable: true,
97
+ get: function () { return chunk6LSKTACC_js.selectSearch; }
98
+ });
99
+ Object.defineProperty(exports, "selectSearchMap", {
100
+ enumerable: true,
101
+ get: function () { return chunk6LSKTACC_js.selectSearchMap; }
102
+ });
103
+ Object.defineProperty(exports, "setAllowCompanies", {
104
+ enumerable: true,
105
+ get: function () { return chunk6LSKTACC_js.setAllowCompanies; }
106
+ });
107
+ Object.defineProperty(exports, "setAllowedCompanyIds", {
108
+ enumerable: true,
109
+ get: function () { return chunk6LSKTACC_js.setAllowedCompanyIds; }
110
+ });
111
+ Object.defineProperty(exports, "setBaseUrl", {
112
+ enumerable: true,
113
+ get: function () { return chunk6LSKTACC_js.setBaseUrl; }
114
+ });
115
+ Object.defineProperty(exports, "setBreadCrumbs", {
116
+ enumerable: true,
117
+ get: function () { return chunk6LSKTACC_js.setBreadCrumbs; }
118
+ });
119
+ Object.defineProperty(exports, "setCompanies", {
120
+ enumerable: true,
121
+ get: function () { return chunk6LSKTACC_js.setCompanies; }
122
+ });
123
+ Object.defineProperty(exports, "setConfig", {
124
+ enumerable: true,
125
+ get: function () { return chunk6LSKTACC_js.setConfig; }
126
+ });
127
+ Object.defineProperty(exports, "setDataParse", {
128
+ enumerable: true,
129
+ get: function () { return chunk6LSKTACC_js.setDataParse; }
130
+ });
131
+ Object.defineProperty(exports, "setDataUser", {
132
+ enumerable: true,
133
+ get: function () { return chunk6LSKTACC_js.setDataUser; }
134
+ });
135
+ Object.defineProperty(exports, "setDb", {
136
+ enumerable: true,
137
+ get: function () { return chunk6LSKTACC_js.setDb; }
138
+ });
139
+ Object.defineProperty(exports, "setDefaultCompany", {
140
+ enumerable: true,
141
+ get: function () { return chunk6LSKTACC_js.setDefaultCompany; }
142
+ });
143
+ Object.defineProperty(exports, "setDomainTable", {
144
+ enumerable: true,
145
+ get: function () { return chunk6LSKTACC_js.setDomainTable; }
146
+ });
147
+ Object.defineProperty(exports, "setEnv", {
148
+ enumerable: true,
149
+ get: function () { return chunk6LSKTACC_js.setEnv; }
150
+ });
151
+ Object.defineProperty(exports, "setEnvFile", {
152
+ enumerable: true,
153
+ get: function () { return chunk6LSKTACC_js.setEnvFile; }
154
+ });
155
+ Object.defineProperty(exports, "setErrorData", {
156
+ enumerable: true,
157
+ get: function () { return chunk6LSKTACC_js.setErrorData; }
158
+ });
159
+ Object.defineProperty(exports, "setFieldTranslate", {
160
+ enumerable: true,
161
+ get: function () { return chunk6LSKTACC_js.setFieldTranslate; }
162
+ });
163
+ Object.defineProperty(exports, "setFields", {
164
+ enumerable: true,
165
+ get: function () { return chunk6LSKTACC_js.setFields; }
166
+ });
167
+ Object.defineProperty(exports, "setFilterBy", {
168
+ enumerable: true,
169
+ get: function () { return chunk6LSKTACC_js.setFilterBy; }
170
+ });
171
+ Object.defineProperty(exports, "setFirstDomain", {
172
+ enumerable: true,
173
+ get: function () { return chunk6LSKTACC_js.setFirstDomain; }
174
+ });
175
+ Object.defineProperty(exports, "setForgotPasswordUrl", {
176
+ enumerable: true,
177
+ get: function () { return chunk6LSKTACC_js.setForgotPasswordUrl; }
178
+ });
179
+ Object.defineProperty(exports, "setFormSubmitComponent", {
180
+ enumerable: true,
181
+ get: function () { return chunk6LSKTACC_js.setFormSubmitComponent; }
182
+ });
183
+ Object.defineProperty(exports, "setGroupBy", {
184
+ enumerable: true,
185
+ get: function () { return chunk6LSKTACC_js.setGroupBy; }
186
+ });
187
+ Object.defineProperty(exports, "setGroupByDomain", {
188
+ enumerable: true,
189
+ get: function () { return chunk6LSKTACC_js.setGroupByDomain; }
190
+ });
191
+ Object.defineProperty(exports, "setHeader", {
192
+ enumerable: true,
193
+ get: function () { return chunk6LSKTACC_js.setHeader; }
194
+ });
195
+ Object.defineProperty(exports, "setHoveredIndexSearchList", {
196
+ enumerable: true,
197
+ get: function () { return chunk6LSKTACC_js.setHoveredIndexSearchList; }
198
+ });
199
+ Object.defineProperty(exports, "setIdFile", {
200
+ enumerable: true,
201
+ get: function () { return chunk6LSKTACC_js.setIdFile; }
202
+ });
203
+ Object.defineProperty(exports, "setIndexRowTableModal", {
204
+ enumerable: true,
205
+ get: function () { return chunk6LSKTACC_js.setIndexRowTableModal; }
206
+ });
207
+ Object.defineProperty(exports, "setIsFileLoaded", {
208
+ enumerable: true,
209
+ get: function () { return chunk6LSKTACC_js.setIsFileLoaded; }
210
+ });
211
+ Object.defineProperty(exports, "setIsShowModalTranslate", {
212
+ enumerable: true,
213
+ get: function () { return chunk6LSKTACC_js.setIsShowModalTranslate; }
214
+ });
215
+ Object.defineProperty(exports, "setIsShowingModalDetail", {
216
+ enumerable: true,
217
+ get: function () { return chunk6LSKTACC_js.setIsShowingModalDetail; }
218
+ });
219
+ Object.defineProperty(exports, "setIsUpdateTableModal", {
220
+ enumerable: true,
221
+ get: function () { return chunk6LSKTACC_js.setIsUpdateTableModal; }
222
+ });
223
+ Object.defineProperty(exports, "setLang", {
224
+ enumerable: true,
225
+ get: function () { return chunk6LSKTACC_js.setLang; }
226
+ });
227
+ Object.defineProperty(exports, "setListSubject", {
228
+ enumerable: true,
229
+ get: function () { return chunk6LSKTACC_js.setListSubject; }
230
+ });
231
+ Object.defineProperty(exports, "setLoadingImport", {
232
+ enumerable: true,
233
+ get: function () { return chunk6LSKTACC_js.setLoadingImport; }
234
+ });
235
+ Object.defineProperty(exports, "setMenuFocus", {
236
+ enumerable: true,
237
+ get: function () { return chunk6LSKTACC_js.setMenuFocus; }
238
+ });
239
+ Object.defineProperty(exports, "setMenuFocusAction", {
240
+ enumerable: true,
241
+ get: function () { return chunk6LSKTACC_js.setMenuFocusAction; }
242
+ });
243
+ Object.defineProperty(exports, "setMenuList", {
244
+ enumerable: true,
245
+ get: function () { return chunk6LSKTACC_js.setMenuList; }
246
+ });
247
+ Object.defineProperty(exports, "setNavbarWidth", {
248
+ enumerable: true,
249
+ get: function () { return chunk6LSKTACC_js.setNavbarWidth; }
250
+ });
251
+ Object.defineProperty(exports, "setOrder", {
252
+ enumerable: true,
253
+ get: function () { return chunk6LSKTACC_js.setOrder; }
254
+ });
255
+ Object.defineProperty(exports, "setPage", {
256
+ enumerable: true,
257
+ get: function () { return chunk6LSKTACC_js.setPage; }
258
+ });
259
+ Object.defineProperty(exports, "setPageLimit", {
260
+ enumerable: true,
261
+ get: function () { return chunk6LSKTACC_js.setPageLimit; }
262
+ });
263
+ Object.defineProperty(exports, "setProfile", {
264
+ enumerable: true,
265
+ get: function () { return chunk6LSKTACC_js.setProfile; }
266
+ });
267
+ Object.defineProperty(exports, "setRedirectTo", {
268
+ enumerable: true,
269
+ get: function () { return chunk6LSKTACC_js.setRedirectTo; }
270
+ });
271
+ Object.defineProperty(exports, "setSearchBy", {
272
+ enumerable: true,
273
+ get: function () { return chunk6LSKTACC_js.setSearchBy; }
274
+ });
275
+ Object.defineProperty(exports, "setSearchMap", {
276
+ enumerable: true,
277
+ get: function () { return chunk6LSKTACC_js.setSearchMap; }
278
+ });
279
+ Object.defineProperty(exports, "setSearchString", {
280
+ enumerable: true,
281
+ get: function () { return chunk6LSKTACC_js.setSearchString; }
282
+ });
283
+ Object.defineProperty(exports, "setSelectedFile", {
284
+ enumerable: true,
285
+ get: function () { return chunk6LSKTACC_js.setSelectedFile; }
286
+ });
287
+ Object.defineProperty(exports, "setSelectedRadioKey", {
288
+ enumerable: true,
289
+ get: function () { return chunk6LSKTACC_js.setSelectedRadioKey; }
290
+ });
291
+ Object.defineProperty(exports, "setSelectedRowKeys", {
292
+ enumerable: true,
293
+ get: function () { return chunk6LSKTACC_js.setSelectedRowKeys; }
294
+ });
295
+ Object.defineProperty(exports, "setSelectedTags", {
296
+ enumerable: true,
297
+ get: function () { return chunk6LSKTACC_js.setSelectedTags; }
298
+ });
299
+ Object.defineProperty(exports, "setTransferDetail", {
300
+ enumerable: true,
301
+ get: function () { return chunk6LSKTACC_js.setTransferDetail; }
302
+ });
303
+ Object.defineProperty(exports, "setUid", {
304
+ enumerable: true,
305
+ get: function () { return chunk6LSKTACC_js.setUid; }
306
+ });
307
+ Object.defineProperty(exports, "setUser", {
308
+ enumerable: true,
309
+ get: function () { return chunk6LSKTACC_js.setUser; }
310
+ });
311
+ Object.defineProperty(exports, "setViewDataStore", {
312
+ enumerable: true,
313
+ get: function () { return chunk6LSKTACC_js.setViewDataStore; }
314
+ });
315
+ Object.defineProperty(exports, "updateSearchMap", {
316
+ enumerable: true,
317
+ get: function () { return chunk6LSKTACC_js.updateSearchMap; }
318
+ });
319
+ Object.defineProperty(exports, "useAppDispatch", {
320
+ enumerable: true,
321
+ get: function () { return chunk6LSKTACC_js.useAppDispatch; }
322
+ });
323
+ Object.defineProperty(exports, "useAppSelector", {
324
+ enumerable: true,
325
+ get: function () { return chunk6LSKTACC_js.useAppSelector; }
326
+ });
package/dist/store.mjs ADDED
@@ -0,0 +1 @@
1
+ export { breadcrumbsSlice, clearSearchMap, envSlice, envStore, excelSlice, formSlice, headerSlice, listSlice, loginSlice, navbarSlice, profileSlice, removeKeyFromSearchMap, searchSlice, selectBreadCrumbs, selectEnv, selectExcel, selectForm, selectHeader, selectList, selectLogin, selectNavbar, selectProfile, selectSearch, selectSearchMap, setAllowCompanies, setAllowedCompanyIds, setBaseUrl, setBreadCrumbs, setCompanies, setConfig, setDataParse, setDataUser, setDb, setDefaultCompany, setDomainTable, setEnv, setEnvFile, setErrorData, setFieldTranslate, setFields, setFilterBy, setFirstDomain, setForgotPasswordUrl, setFormSubmitComponent, setGroupBy, setGroupByDomain, setHeader, setHoveredIndexSearchList, setIdFile, setIndexRowTableModal, setIsFileLoaded, setIsShowModalTranslate, setIsShowingModalDetail, setIsUpdateTableModal, setLang, setListSubject, setLoadingImport, setMenuFocus, setMenuFocusAction, setMenuList, setNavbarWidth, setOrder, setPage, setPageLimit, setProfile, setRedirectTo, setSearchBy, setSearchMap, setSearchString, setSelectedFile, setSelectedRadioKey, setSelectedRowKeys, setSelectedTags, setTransferDetail, setUid, setUser, setViewDataStore, updateSearchMap, useAppDispatch, useAppSelector } from './chunk-B432GFRR.mjs';
package/dist/types.js CHANGED
@@ -1 +1,4 @@
1
- "use strict";require('./chunk-GGNOJ77I.js');
1
+ 'use strict';
2
+
3
+ require('./chunk-GGNOJ77I.js');
4
+
package/dist/types.mjs CHANGED
@@ -1 +1 @@
1
- import "./chunk-WAXGOBY2.mjs";
1
+ import './chunk-WAXGOBY2.mjs';
package/dist/utils.d.mts CHANGED
@@ -1,5 +1,3 @@
1
- export { L as LocalStorageUtilsType, l as localStorageUtils } from './local-storage-AbiOQTLK.mjs';
2
-
3
1
  declare const sessionStorageUtils: {
4
2
  getMenuFocus: () => IMenu;
5
3
  setMenuFocus: (menuTree: IMenu) => void;
@@ -16,28 +14,21 @@ interface IMenu {
16
14
  service: string;
17
15
  }
18
16
 
19
- interface Context {
20
- [key: string]: any;
17
+ declare class WesapError extends Error {
18
+ code: number;
19
+ constructor(message: string, code: number);
21
20
  }
22
- type ContextDescription = Context | string | undefined;
23
- /**
24
- * Create an evaluated context from an arbitrary list of context representations.
25
- * The evaluated context in construction is used along the way to evaluate further parts.
26
- *
27
- * @param contexts - Danh sách các context representations
28
- * @param initialEvaluationContext - Context ban đầu để bắt đầu đánh giá (tùy chọn)
29
- * @returns Context đã được đánh giá
30
- */
31
- declare function makeContext(contexts: ContextDescription[], initialEvaluationContext?: Context): Context;
32
- /**
33
- * Allow to evaluate a context with an incomplete evaluation context. The evaluated context only
34
- * contains keys whose values are static or can be evaluated with the given evaluation context.
35
- *
36
- * @param context - Chuỗi context cần đánh giá
37
- * @param evaluationContext - Context dùng để đánh giá (mặc định là rỗng)
38
- * @returns Context đã được đánh giá một phần
39
- */
40
- declare function evalPartialContext(_context: string, evaluationContext?: Context): Context;
21
+ declare function handleError(error: Error, env: {
22
+ services: {
23
+ notification: {
24
+ error: (message: string) => void;
25
+ };
26
+ };
27
+ }): void;
28
+
29
+ declare const formatCurrency: (amount: number, currency?: string) => string;
30
+ declare const formatDate: (date: string | Date, locale?: string) => string;
31
+ declare const validateAndParseDate: (input: string, isDateTime?: boolean) => string | null;
41
32
 
42
33
  type AST = {
43
34
  type: number;
@@ -46,8 +37,6 @@ type AST = {
46
37
  type Condition = [string | 0 | 1, string, any];
47
38
  type DomainListRepr = ('&' | '|' | '!' | Condition)[];
48
39
  type DomainRepr = DomainListRepr | string | Domain;
49
- declare class InvalidDomainError extends Error {
50
- }
51
40
  declare class Domain {
52
41
  ast: AST;
53
42
  static TRUE: Domain;
@@ -63,22 +52,61 @@ declare class Domain {
63
52
  toList(context: Record<string, any>): DomainListRepr;
64
53
  toJson(): DomainListRepr | string;
65
54
  }
66
- declare function evalDomain(modifier: any[] | boolean, evalContext: Record<string, any>): boolean;
67
- declare const checkDomain: (context: any, domain: any) => boolean;
68
- declare const matchDomains: (context: any, domains: any) => boolean;
69
55
 
56
+ declare const evalJSONContext: (_context: any, context?: {}) => any;
57
+ declare const evalJSONDomain: (domain: any, context: any) => any;
58
+ declare const formatSortingString: (input: string | null | undefined) => string | null;
70
59
  declare const domainHelper: {
71
60
  checkDomain: (context: any, domain: any) => boolean;
72
61
  matchDomains: (context: any, domains: any) => boolean;
73
62
  Domain: typeof Domain;
74
63
  };
75
- declare const evalJSONContext: (_context: any, context?: {}) => any;
76
- declare const evalJSONDomain: (domain: any, context: any) => any;
77
- declare const formatSortingString: (input: string | null | undefined) => string | null;
78
64
  declare const toQueryString: (params: Record<string, string | number | boolean>) => string;
79
- declare function cleanObject<T extends Record<string, any>>(obj: T): Partial<T>;
65
+ declare const convertFloatToTime: (floatValue: number) => string;
66
+ declare const convertTimeToFloat: (timeString: string) => number;
67
+ declare const stringToColor: (name: string, id: number) => string;
68
+ declare const getFieldsOnChange: (fields: any) => any;
69
+ declare const filterFieldDirty: ({ id, viewData, formValues, dirtyFields, model, defaultData, keepZeroValue, }: {
70
+ id?: any;
71
+ viewData?: any;
72
+ formValues?: any;
73
+ dirtyFields?: any;
74
+ model?: any;
75
+ defaultData?: any;
76
+ keepZeroValue?: boolean;
77
+ }) => any;
78
+ type MergeableObject = {
79
+ [key: string]: any;
80
+ } | null | undefined;
81
+ declare const mergeObjects: <T extends MergeableObject, U extends MergeableObject>(object1: T, object2: U) => (T & U) | undefined;
82
+ declare const formatUrlPath: ({ viewType, aid, model, id, actionPath, }: {
83
+ viewType: "list" | "form" | "kanban" | any;
84
+ actionPath: string;
85
+ aid: string | number;
86
+ model: string;
87
+ id?: string | number;
88
+ }) => string;
89
+ declare const removeUndefinedFields: <T extends Record<string, any>>(obj: T) => Partial<T>;
90
+ declare const useTabModel: (viewData: any, onchangeData: any) => any;
91
+ declare const isBase64File: (str: any) => boolean;
92
+ declare const isBase64Image: (str: any) => boolean;
93
+ declare const checkIsImageLink: (url: any) => boolean;
94
+ declare const formatFileSize: (size: any) => string;
95
+ declare const getSubdomain: (url?: string) => string | null;
96
+ declare const resequence: (arr: any, start: any, end: any) => any;
97
+ declare const getOffSet: (arr: any, start: any, end: any) => any;
98
+ declare const copyTextToClipboard: (text: string) => Promise<void>;
80
99
  declare const updateTokenParamInOriginalRequest: (originalRequest: {
81
100
  data?: any;
82
101
  }, newAccessToken: string) => any;
102
+ declare const isObjectEmpty: (obj: object) => boolean;
103
+ declare const useField: (props: any) => {
104
+ invisible: boolean;
105
+ required: boolean;
106
+ readonly: boolean;
107
+ nameField: string | null;
108
+ };
109
+ declare const downloadFile: (url: string, filename?: string) => Promise<void>;
110
+ declare const extractIdFromDomain: (domain?: [string, string, any][]) => number | null;
83
111
 
84
- export { Domain, InvalidDomainError, checkDomain, cleanObject, domainHelper, evalDomain, evalJSONContext, evalJSONDomain, evalPartialContext, formatSortingString, makeContext, matchDomains, sessionStorageUtils, toQueryString, updateTokenParamInOriginalRequest };
112
+ export { WesapError, checkIsImageLink, convertFloatToTime, convertTimeToFloat, copyTextToClipboard, domainHelper, downloadFile, evalJSONContext, evalJSONDomain, extractIdFromDomain, filterFieldDirty, formatCurrency, formatDate, formatFileSize, formatSortingString, formatUrlPath, getFieldsOnChange, getOffSet, getSubdomain, handleError, isBase64File, isBase64Image, isObjectEmpty, mergeObjects, removeUndefinedFields, resequence, sessionStorageUtils, stringToColor, toQueryString, updateTokenParamInOriginalRequest, useField, useTabModel, validateAndParseDate };
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export { L as LocalStorageUtilsType, l as localStorageUtils } from './local-storage-AbiOQTLK.js';
2
-
3
1
  declare const sessionStorageUtils: {
4
2
  getMenuFocus: () => IMenu;
5
3
  setMenuFocus: (menuTree: IMenu) => void;
@@ -16,28 +14,21 @@ interface IMenu {
16
14
  service: string;
17
15
  }
18
16
 
19
- interface Context {
20
- [key: string]: any;
17
+ declare class WesapError extends Error {
18
+ code: number;
19
+ constructor(message: string, code: number);
21
20
  }
22
- type ContextDescription = Context | string | undefined;
23
- /**
24
- * Create an evaluated context from an arbitrary list of context representations.
25
- * The evaluated context in construction is used along the way to evaluate further parts.
26
- *
27
- * @param contexts - Danh sách các context representations
28
- * @param initialEvaluationContext - Context ban đầu để bắt đầu đánh giá (tùy chọn)
29
- * @returns Context đã được đánh giá
30
- */
31
- declare function makeContext(contexts: ContextDescription[], initialEvaluationContext?: Context): Context;
32
- /**
33
- * Allow to evaluate a context with an incomplete evaluation context. The evaluated context only
34
- * contains keys whose values are static or can be evaluated with the given evaluation context.
35
- *
36
- * @param context - Chuỗi context cần đánh giá
37
- * @param evaluationContext - Context dùng để đánh giá (mặc định là rỗng)
38
- * @returns Context đã được đánh giá một phần
39
- */
40
- declare function evalPartialContext(_context: string, evaluationContext?: Context): Context;
21
+ declare function handleError(error: Error, env: {
22
+ services: {
23
+ notification: {
24
+ error: (message: string) => void;
25
+ };
26
+ };
27
+ }): void;
28
+
29
+ declare const formatCurrency: (amount: number, currency?: string) => string;
30
+ declare const formatDate: (date: string | Date, locale?: string) => string;
31
+ declare const validateAndParseDate: (input: string, isDateTime?: boolean) => string | null;
41
32
 
42
33
  type AST = {
43
34
  type: number;
@@ -46,8 +37,6 @@ type AST = {
46
37
  type Condition = [string | 0 | 1, string, any];
47
38
  type DomainListRepr = ('&' | '|' | '!' | Condition)[];
48
39
  type DomainRepr = DomainListRepr | string | Domain;
49
- declare class InvalidDomainError extends Error {
50
- }
51
40
  declare class Domain {
52
41
  ast: AST;
53
42
  static TRUE: Domain;
@@ -63,22 +52,61 @@ declare class Domain {
63
52
  toList(context: Record<string, any>): DomainListRepr;
64
53
  toJson(): DomainListRepr | string;
65
54
  }
66
- declare function evalDomain(modifier: any[] | boolean, evalContext: Record<string, any>): boolean;
67
- declare const checkDomain: (context: any, domain: any) => boolean;
68
- declare const matchDomains: (context: any, domains: any) => boolean;
69
55
 
56
+ declare const evalJSONContext: (_context: any, context?: {}) => any;
57
+ declare const evalJSONDomain: (domain: any, context: any) => any;
58
+ declare const formatSortingString: (input: string | null | undefined) => string | null;
70
59
  declare const domainHelper: {
71
60
  checkDomain: (context: any, domain: any) => boolean;
72
61
  matchDomains: (context: any, domains: any) => boolean;
73
62
  Domain: typeof Domain;
74
63
  };
75
- declare const evalJSONContext: (_context: any, context?: {}) => any;
76
- declare const evalJSONDomain: (domain: any, context: any) => any;
77
- declare const formatSortingString: (input: string | null | undefined) => string | null;
78
64
  declare const toQueryString: (params: Record<string, string | number | boolean>) => string;
79
- declare function cleanObject<T extends Record<string, any>>(obj: T): Partial<T>;
65
+ declare const convertFloatToTime: (floatValue: number) => string;
66
+ declare const convertTimeToFloat: (timeString: string) => number;
67
+ declare const stringToColor: (name: string, id: number) => string;
68
+ declare const getFieldsOnChange: (fields: any) => any;
69
+ declare const filterFieldDirty: ({ id, viewData, formValues, dirtyFields, model, defaultData, keepZeroValue, }: {
70
+ id?: any;
71
+ viewData?: any;
72
+ formValues?: any;
73
+ dirtyFields?: any;
74
+ model?: any;
75
+ defaultData?: any;
76
+ keepZeroValue?: boolean;
77
+ }) => any;
78
+ type MergeableObject = {
79
+ [key: string]: any;
80
+ } | null | undefined;
81
+ declare const mergeObjects: <T extends MergeableObject, U extends MergeableObject>(object1: T, object2: U) => (T & U) | undefined;
82
+ declare const formatUrlPath: ({ viewType, aid, model, id, actionPath, }: {
83
+ viewType: "list" | "form" | "kanban" | any;
84
+ actionPath: string;
85
+ aid: string | number;
86
+ model: string;
87
+ id?: string | number;
88
+ }) => string;
89
+ declare const removeUndefinedFields: <T extends Record<string, any>>(obj: T) => Partial<T>;
90
+ declare const useTabModel: (viewData: any, onchangeData: any) => any;
91
+ declare const isBase64File: (str: any) => boolean;
92
+ declare const isBase64Image: (str: any) => boolean;
93
+ declare const checkIsImageLink: (url: any) => boolean;
94
+ declare const formatFileSize: (size: any) => string;
95
+ declare const getSubdomain: (url?: string) => string | null;
96
+ declare const resequence: (arr: any, start: any, end: any) => any;
97
+ declare const getOffSet: (arr: any, start: any, end: any) => any;
98
+ declare const copyTextToClipboard: (text: string) => Promise<void>;
80
99
  declare const updateTokenParamInOriginalRequest: (originalRequest: {
81
100
  data?: any;
82
101
  }, newAccessToken: string) => any;
102
+ declare const isObjectEmpty: (obj: object) => boolean;
103
+ declare const useField: (props: any) => {
104
+ invisible: boolean;
105
+ required: boolean;
106
+ readonly: boolean;
107
+ nameField: string | null;
108
+ };
109
+ declare const downloadFile: (url: string, filename?: string) => Promise<void>;
110
+ declare const extractIdFromDomain: (domain?: [string, string, any][]) => number | null;
83
111
 
84
- export { Domain, InvalidDomainError, checkDomain, cleanObject, domainHelper, evalDomain, evalJSONContext, evalJSONDomain, evalPartialContext, formatSortingString, makeContext, matchDomains, sessionStorageUtils, toQueryString, updateTokenParamInOriginalRequest };
112
+ export { WesapError, checkIsImageLink, convertFloatToTime, convertTimeToFloat, copyTextToClipboard, domainHelper, downloadFile, evalJSONContext, evalJSONDomain, extractIdFromDomain, filterFieldDirty, formatCurrency, formatDate, formatFileSize, formatSortingString, formatUrlPath, getFieldsOnChange, getOffSet, getSubdomain, handleError, isBase64File, isBase64Image, isObjectEmpty, mergeObjects, removeUndefinedFields, resequence, sessionStorageUtils, stringToColor, toQueryString, updateTokenParamInOriginalRequest, useField, useTabModel, validateAndParseDate };