@fctc/interface-logic 4.5.4 → 4.5.6

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 (45) hide show
  1. package/dist/chunk-CI6PEZ77.mjs +1 -0
  2. package/dist/chunk-KPELPP6F.mjs +1 -0
  3. package/dist/chunk-LCUY2BJU.mjs +1 -0
  4. package/dist/chunk-LYD7QJQX.mjs +2 -0
  5. package/dist/chunk-Y5QM3Y5X.mjs +1 -0
  6. package/dist/chunk-Y65DQP66.mjs +5 -0
  7. package/dist/configs.mjs +1 -2544
  8. package/dist/constants.mjs +1 -293
  9. package/dist/environment.d.mts +1 -1
  10. package/dist/environment.mjs +1 -2669
  11. package/dist/hooks.d.mts +1 -7
  12. package/dist/hooks.mjs +1 -8792
  13. package/dist/{local-storage-BPvoMGYJ.d.mts → local-storage-AbiOQTLK.d.mts} +1 -1
  14. package/dist/models.mjs +1 -120
  15. package/dist/provider.d.mts +103 -52
  16. package/dist/provider.mjs +1 -9487
  17. package/dist/services.mjs +1 -6912
  18. package/dist/utils.d.mts +33 -61
  19. package/dist/utils.mjs +1 -3030
  20. package/package.json +78 -92
  21. package/dist/base-model-type-DD8uZnDP.d.ts +0 -8
  22. package/dist/configs.d.ts +0 -12
  23. package/dist/configs.js +0 -2581
  24. package/dist/constants.d.ts +0 -235
  25. package/dist/constants.js +0 -335
  26. package/dist/environment.d.ts +0 -56
  27. package/dist/environment.js +0 -2708
  28. package/dist/hooks.d.ts +0 -828
  29. package/dist/hooks.js +0 -8949
  30. package/dist/local-storage-BPvoMGYJ.d.ts +0 -10
  31. package/dist/models.d.ts +0 -14
  32. package/dist/models.js +0 -147
  33. package/dist/provider.d.ts +0 -214
  34. package/dist/provider.js +0 -9533
  35. package/dist/services.d.ts +0 -700
  36. package/dist/services.js +0 -6959
  37. package/dist/store.d.mts +0 -382
  38. package/dist/store.d.ts +0 -382
  39. package/dist/store.js +0 -823
  40. package/dist/store.mjs +0 -717
  41. package/dist/types.d.ts +0 -19
  42. package/dist/types.js +0 -18
  43. package/dist/utils.d.ts +0 -112
  44. package/dist/utils.js +0 -3099
  45. package/dist/view-type-CfcWWR0w.d.ts +0 -137
package/dist/utils.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ export { L as LocalStorageUtilsType, l as localStorageUtils } from './local-storage-AbiOQTLK.mjs';
2
+
1
3
  declare const sessionStorageUtils: {
2
4
  getMenuFocus: () => IMenu;
3
5
  setMenuFocus: (menuTree: IMenu) => void;
@@ -14,21 +16,28 @@ interface IMenu {
14
16
  service: string;
15
17
  }
16
18
 
17
- declare class WesapError extends Error {
18
- code: number;
19
- constructor(message: string, code: number);
19
+ interface Context {
20
+ [key: string]: any;
20
21
  }
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;
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;
32
41
 
33
42
  type AST = {
34
43
  type: number;
@@ -37,6 +46,8 @@ type AST = {
37
46
  type Condition = [string | 0 | 1, string, any];
38
47
  type DomainListRepr = ('&' | '|' | '!' | Condition)[];
39
48
  type DomainRepr = DomainListRepr | string | Domain;
49
+ declare class InvalidDomainError extends Error {
50
+ }
40
51
  declare class Domain {
41
52
  ast: AST;
42
53
  static TRUE: Domain;
@@ -52,61 +63,22 @@ declare class Domain {
52
63
  toList(context: Record<string, any>): DomainListRepr;
53
64
  toJson(): DomainListRepr | string;
54
65
  }
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;
55
69
 
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;
59
70
  declare const domainHelper: {
60
71
  checkDomain: (context: any, domain: any) => boolean;
61
72
  matchDomains: (context: any, domains: any) => boolean;
62
73
  Domain: typeof Domain;
63
74
  };
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;
64
78
  declare const toQueryString: (params: Record<string, string | number | boolean>) => string;
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>;
79
+ declare function cleanObject<T extends Record<string, any>>(obj: T): Partial<T>;
99
80
  declare const updateTokenParamInOriginalRequest: (originalRequest: {
100
81
  data?: any;
101
82
  }, 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;
111
83
 
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 };
84
+ export { Domain, InvalidDomainError, checkDomain, cleanObject, domainHelper, evalDomain, evalJSONContext, evalJSONDomain, evalPartialContext, formatSortingString, makeContext, matchDomains, sessionStorageUtils, toQueryString, updateTokenParamInOriginalRequest };