@fctc/interface-logic 1.8.0 → 1.8.1
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/index.d.mts +1681 -0
- package/dist/index.d.ts +1681 -0
- package/dist/{hooks.js → index.js} +1437 -203
- package/dist/index.js.map +1 -0
- package/dist/{hooks.mjs → index.mjs} +1251 -157
- package/dist/index.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/configs.d.mts +0 -12
- package/dist/configs.d.ts +0 -12
- package/dist/configs.js +0 -2386
- package/dist/configs.mjs +0 -2349
- package/dist/constants.d.mts +0 -131
- package/dist/constants.d.ts +0 -131
- package/dist/constants.js +0 -205
- package/dist/constants.mjs +0 -166
- package/dist/environment.d.mts +0 -53
- package/dist/environment.d.ts +0 -53
- package/dist/environment.js +0 -3080
- package/dist/environment.mjs +0 -3042
- package/dist/hooks.d.mts +0 -359
- package/dist/hooks.d.ts +0 -359
- package/dist/provider.d.mts +0 -16
- package/dist/provider.d.ts +0 -16
- package/dist/provider.js +0 -3595
- package/dist/provider.mjs +0 -3556
- package/dist/services.d.mts +0 -255
- package/dist/services.d.ts +0 -255
- package/dist/services.js +0 -4653
- package/dist/services.mjs +0 -4608
- package/dist/store.d.mts +0 -377
- package/dist/store.d.ts +0 -377
- package/dist/store.js +0 -814
- package/dist/store.mjs +0 -709
- package/dist/types.d.mts +0 -17
- package/dist/types.d.ts +0 -17
- package/dist/types.js +0 -18
- package/dist/types.mjs +0 -0
- package/dist/utils.d.mts +0 -93
- package/dist/utils.d.ts +0 -93
- package/dist/utils.js +0 -2962
- package/dist/utils.mjs +0 -2896
- package/dist/view-type-D8ukwj_2.d.mts +0 -113
- package/dist/view-type-D8ukwj_2.d.ts +0 -113
|
@@ -27,9 +27,145 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// src/
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
ActionService: () => action_service_default,
|
|
34
|
+
AuthService: () => auth_service_default,
|
|
35
|
+
CompanyService: () => company_service_default,
|
|
36
|
+
ComponentType: () => ComponentType,
|
|
37
|
+
EnvStore: () => EnvStore,
|
|
38
|
+
ExcelService: () => excel_service_default,
|
|
39
|
+
FieldTypeConstants: () => FieldTypeConstants,
|
|
40
|
+
FormService: () => form_service_default,
|
|
41
|
+
KanbanService: () => kanban_service_default,
|
|
42
|
+
KeyConstants: () => KeyConstants,
|
|
43
|
+
MainProvider: () => MainProvider,
|
|
44
|
+
MethodConstants: () => MethodConstants,
|
|
45
|
+
MethodType: () => MethodType,
|
|
46
|
+
ModelConstants: () => ModelConstants,
|
|
47
|
+
ModelService: () => model_service_default,
|
|
48
|
+
ReactQueryProvider: () => ReactQueryProvider,
|
|
49
|
+
SearchType: () => SearchType,
|
|
50
|
+
UriConstants: () => UriConstants,
|
|
51
|
+
UserService: () => user_service_default,
|
|
52
|
+
VersionGate: () => VersionGate,
|
|
53
|
+
ViewService: () => view_service_default,
|
|
54
|
+
WIDGETAVATAR: () => WIDGETAVATAR,
|
|
55
|
+
WIDGETCOLOR: () => WIDGETCOLOR,
|
|
56
|
+
WIDGETCURRENCY: () => WIDGETCURRENCY,
|
|
57
|
+
WIDGETNOSTRING: () => WIDGETNOSTRING,
|
|
58
|
+
WIDGETSTATUS: () => WIDGETSTATUS,
|
|
59
|
+
WesapError: () => WesapError,
|
|
60
|
+
axiosClient: () => axiosClient,
|
|
61
|
+
breadcrumbsSlice: () => breadcrumbsSlice,
|
|
62
|
+
checkIsImageLink: () => checkIsImageLink,
|
|
63
|
+
clearSearchMap: () => clearSearchMap,
|
|
64
|
+
convertFloatToTime: () => convertFloatToTime,
|
|
65
|
+
convertTimeToFloat: () => convertTimeToFloat,
|
|
66
|
+
copyTextToClipboard: () => copyTextToClipboard,
|
|
67
|
+
domainHelper: () => domainHelper,
|
|
68
|
+
env: () => env,
|
|
69
|
+
envSlice: () => envSlice,
|
|
70
|
+
envStore: () => envStore,
|
|
71
|
+
evalJSONContext: () => evalJSONContext,
|
|
72
|
+
evalJSONDomain: () => evalJSONDomain,
|
|
73
|
+
excelSlice: () => excelSlice,
|
|
74
|
+
filterFieldDirty: () => filterFieldDirty,
|
|
75
|
+
formSlice: () => formSlice,
|
|
76
|
+
formatCurrency: () => formatCurrency,
|
|
77
|
+
formatDate: () => formatDate,
|
|
78
|
+
formatFileSize: () => formatFileSize,
|
|
79
|
+
formatSortingString: () => formatSortingString,
|
|
80
|
+
formatUrlPath: () => formatUrlPath,
|
|
81
|
+
getEnv: () => getEnv,
|
|
82
|
+
getFieldsOnChange: () => getFieldsOnChange,
|
|
83
|
+
getOffSet: () => getOffSet,
|
|
84
|
+
getSubdomain: () => getSubdomain,
|
|
85
|
+
handleError: () => handleError,
|
|
86
|
+
headerSlice: () => headerSlice,
|
|
87
|
+
initEnv: () => initEnv,
|
|
88
|
+
isBase64File: () => isBase64File,
|
|
89
|
+
isBase64Image: () => isBase64Image,
|
|
90
|
+
isObjectEmpty: () => isObjectEmpty,
|
|
91
|
+
listSlice: () => listSlice,
|
|
92
|
+
loginSlice: () => loginSlice,
|
|
93
|
+
mergeObjects: () => mergeObjects,
|
|
94
|
+
navbarSlice: () => navbarSlice,
|
|
95
|
+
profileSlice: () => profileSlice,
|
|
96
|
+
removeKeyFromSearchMap: () => removeKeyFromSearchMap,
|
|
97
|
+
removeUndefinedFields: () => removeUndefinedFields,
|
|
98
|
+
resequence: () => resequence,
|
|
99
|
+
searchSlice: () => searchSlice,
|
|
100
|
+
selectBreadCrumbs: () => selectBreadCrumbs,
|
|
101
|
+
selectEnv: () => selectEnv,
|
|
102
|
+
selectExcel: () => selectExcel,
|
|
103
|
+
selectForm: () => selectForm,
|
|
104
|
+
selectHeader: () => selectHeader,
|
|
105
|
+
selectList: () => selectList,
|
|
106
|
+
selectLogin: () => selectLogin,
|
|
107
|
+
selectNavbar: () => selectNavbar,
|
|
108
|
+
selectProfile: () => selectProfile,
|
|
109
|
+
selectSearch: () => selectSearch,
|
|
110
|
+
selectSearchMap: () => selectSearchMap,
|
|
111
|
+
setAllowCompanies: () => setAllowCompanies,
|
|
112
|
+
setAllowedCompanyIds: () => setAllowedCompanyIds,
|
|
113
|
+
setBreadCrumbs: () => setBreadCrumbs,
|
|
114
|
+
setCompanies: () => setCompanies,
|
|
115
|
+
setConfig: () => setConfig,
|
|
116
|
+
setDataParse: () => setDataParse,
|
|
117
|
+
setDataUser: () => setDataUser,
|
|
118
|
+
setDb: () => setDb,
|
|
119
|
+
setDefaultCompany: () => setDefaultCompany,
|
|
120
|
+
setDomainTable: () => setDomainTable,
|
|
121
|
+
setEnv: () => setEnv,
|
|
122
|
+
setEnvFile: () => setEnvFile,
|
|
123
|
+
setErrorData: () => setErrorData,
|
|
124
|
+
setFieldTranslate: () => setFieldTranslate,
|
|
125
|
+
setFields: () => setFields,
|
|
126
|
+
setFilterBy: () => setFilterBy,
|
|
127
|
+
setFirstDomain: () => setFirstDomain,
|
|
128
|
+
setForgotPasswordUrl: () => setForgotPasswordUrl,
|
|
129
|
+
setFormSubmitComponent: () => setFormSubmitComponent,
|
|
130
|
+
setGroupBy: () => setGroupBy,
|
|
131
|
+
setGroupByDomain: () => setGroupByDomain,
|
|
132
|
+
setHeader: () => setHeader,
|
|
133
|
+
setHoveredIndexSearchList: () => setHoveredIndexSearchList,
|
|
134
|
+
setIdFile: () => setIdFile,
|
|
135
|
+
setIndexRowTableModal: () => setIndexRowTableModal,
|
|
136
|
+
setIsFileLoaded: () => setIsFileLoaded,
|
|
137
|
+
setIsShowModalTranslate: () => setIsShowModalTranslate,
|
|
138
|
+
setIsShowingModalDetail: () => setIsShowingModalDetail,
|
|
139
|
+
setIsUpdateTableModal: () => setIsUpdateTableModal,
|
|
140
|
+
setLang: () => setLang,
|
|
141
|
+
setListSubject: () => setListSubject,
|
|
142
|
+
setLoadingImport: () => setLoadingImport,
|
|
143
|
+
setMenuFocus: () => setMenuFocus,
|
|
144
|
+
setMenuFocusAction: () => setMenuFocusAction,
|
|
145
|
+
setMenuList: () => setMenuList,
|
|
146
|
+
setNavbarWidth: () => setNavbarWidth,
|
|
147
|
+
setOrder: () => setOrder,
|
|
148
|
+
setPage: () => setPage,
|
|
149
|
+
setPageLimit: () => setPageLimit,
|
|
150
|
+
setProfile: () => setProfile,
|
|
151
|
+
setRedirectTo: () => setRedirectTo,
|
|
152
|
+
setSearchBy: () => setSearchBy,
|
|
153
|
+
setSearchMap: () => setSearchMap,
|
|
154
|
+
setSearchString: () => setSearchString,
|
|
155
|
+
setSelectedFile: () => setSelectedFile,
|
|
156
|
+
setSelectedRadioKey: () => setSelectedRadioKey,
|
|
157
|
+
setSelectedRowKeys: () => setSelectedRowKeys,
|
|
158
|
+
setSelectedTags: () => setSelectedTags,
|
|
159
|
+
setTransferDetail: () => setTransferDetail,
|
|
160
|
+
setUid: () => setUid,
|
|
161
|
+
setUser: () => setUser,
|
|
162
|
+
setViewDataStore: () => setViewDataStore,
|
|
163
|
+
stringToColor: () => stringToColor,
|
|
164
|
+
toQueryString: () => toQueryString,
|
|
165
|
+
updateSearchMap: () => updateSearchMap,
|
|
166
|
+
updateTokenParamInOriginalRequest: () => updateTokenParamInOriginalRequest,
|
|
167
|
+
useAppDispatch: () => useAppDispatch,
|
|
168
|
+
useAppSelector: () => useAppSelector,
|
|
33
169
|
useButton: () => use_button_default,
|
|
34
170
|
useChangeStatus: () => use_change_status_default,
|
|
35
171
|
useDelete: () => use_delete_default,
|
|
@@ -37,6 +173,7 @@ __export(hooks_exports, {
|
|
|
37
173
|
useDuplicateRecord: () => use_duplicate_record_default,
|
|
38
174
|
useExecuteImport: () => uss_execute_import_default,
|
|
39
175
|
useExportExcel: () => use_export_excel_default,
|
|
176
|
+
useField: () => useField,
|
|
40
177
|
useForgotPassword: () => use_forgot_password_default,
|
|
41
178
|
useForgotPasswordSSO: () => use_forgotpassword_sso_default,
|
|
42
179
|
useGet2FAMethods: () => uset_get_2FA_method_default,
|
|
@@ -92,17 +229,49 @@ __export(hooks_exports, {
|
|
|
92
229
|
useSettingsWebRead2fa: () => use_settings_web_read_2fa_default,
|
|
93
230
|
useSignInSSO: () => use_signin_sso_default,
|
|
94
231
|
useSwitchLocale: () => use_switch_locale_default,
|
|
232
|
+
useTabModel: () => useTabModel,
|
|
95
233
|
useUpdatePassword: () => use_update_password_default,
|
|
96
234
|
useUploadFile: () => use_upload_file_default,
|
|
97
235
|
useUploadIdFile: () => use_upload_id_file_default,
|
|
98
236
|
useUploadImage: () => use_upload_image_default,
|
|
237
|
+
useValidateActionToken: () => use_validate_action_token_default,
|
|
99
238
|
useVerify2FA: () => use_verify_2FA_default,
|
|
100
|
-
useVerifyTotp: () => use_verify_totp_default
|
|
239
|
+
useVerifyTotp: () => use_verify_totp_default,
|
|
240
|
+
validateAndParseDate: () => validateAndParseDate
|
|
101
241
|
});
|
|
102
|
-
module.exports = __toCommonJS(
|
|
242
|
+
module.exports = __toCommonJS(index_exports);
|
|
103
243
|
|
|
104
|
-
// src/
|
|
105
|
-
var
|
|
244
|
+
// src/configs/axios-client.ts
|
|
245
|
+
var import_axios = __toESM(require("axios"));
|
|
246
|
+
|
|
247
|
+
// src/constants/api/key-constant.ts
|
|
248
|
+
var KeyConstants = /* @__PURE__ */ ((KeyConstants2) => {
|
|
249
|
+
KeyConstants2["PROFILE"] = "userinfo";
|
|
250
|
+
KeyConstants2["CURRENT_COMPANY"] = "current_company";
|
|
251
|
+
KeyConstants2["LIST_COMPANY"] = "list_company";
|
|
252
|
+
KeyConstants2["COMPANY_INFO"] = "company_info";
|
|
253
|
+
KeyConstants2["MENU"] = "menus";
|
|
254
|
+
KeyConstants2["GET_VIEW_BY_ACTION"] = "get_view_by_action";
|
|
255
|
+
KeyConstants2["ACTION_DETAIL"] = "action_detail";
|
|
256
|
+
KeyConstants2["GET_DATA_SELECTION"] = "get_data_select";
|
|
257
|
+
KeyConstants2["WEB_SAVE"] = "web_save";
|
|
258
|
+
KeyConstants2["WEB_READ"] = "web_read";
|
|
259
|
+
KeyConstants2["GET_PROVIDER"] = "get_provider";
|
|
260
|
+
return KeyConstants2;
|
|
261
|
+
})(KeyConstants || {});
|
|
262
|
+
|
|
263
|
+
// src/constants/api/method-constant.ts
|
|
264
|
+
var MethodConstants = /* @__PURE__ */ ((MethodConstants2) => {
|
|
265
|
+
MethodConstants2["WEB_SEARCH_READ"] = "web_search_read";
|
|
266
|
+
MethodConstants2["WEB_READ_GROUP"] = "web_read_group";
|
|
267
|
+
MethodConstants2["WEB_READ"] = "web_read";
|
|
268
|
+
MethodConstants2["WEB_SAVE"] = "web_save";
|
|
269
|
+
MethodConstants2["UNLINK"] = "unlink";
|
|
270
|
+
MethodConstants2["ONCHANGE"] = "onchange";
|
|
271
|
+
MethodConstants2["GET_ONCHANGE_FIELDS"] = "get_fields_onchange";
|
|
272
|
+
MethodConstants2["GET_FIELD_VIEW"] = "get_fields_view_v2";
|
|
273
|
+
return MethodConstants2;
|
|
274
|
+
})(MethodConstants || {});
|
|
106
275
|
|
|
107
276
|
// src/constants/api/uri-constant.ts
|
|
108
277
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -134,11 +303,380 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
134
303
|
return UriConstants2;
|
|
135
304
|
})(UriConstants || {});
|
|
136
305
|
|
|
137
|
-
// src/
|
|
138
|
-
var
|
|
306
|
+
// src/utils/error-handler.ts
|
|
307
|
+
var WesapError = class extends Error {
|
|
308
|
+
code;
|
|
309
|
+
constructor(message, code) {
|
|
310
|
+
super(message);
|
|
311
|
+
this.code = code;
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
function handleError(error, env2) {
|
|
315
|
+
if (error instanceof WesapError) {
|
|
316
|
+
env2.services.notification.error(error.message);
|
|
317
|
+
} else {
|
|
318
|
+
env2.services.notification.error("An unexpected error occurred");
|
|
319
|
+
}
|
|
320
|
+
}
|
|
139
321
|
|
|
140
322
|
// src/utils/format.ts
|
|
141
323
|
var import_moment = __toESM(require("moment"));
|
|
324
|
+
var formatCurrency = (amount, currency = "USD") => {
|
|
325
|
+
const formatter = new Intl.NumberFormat("vi-VN", {
|
|
326
|
+
style: "currency",
|
|
327
|
+
currency,
|
|
328
|
+
minimumFractionDigits: 0
|
|
329
|
+
});
|
|
330
|
+
return formatter.format(amount).replaceAll(".", ",");
|
|
331
|
+
};
|
|
332
|
+
var formatDate = (date, locale = "en-US") => {
|
|
333
|
+
return new Intl.DateTimeFormat(locale).format(new Date(date));
|
|
334
|
+
};
|
|
335
|
+
var validateAndParseDate = (input, isDateTime = false) => {
|
|
336
|
+
if (!input || typeof input !== "string") return null;
|
|
337
|
+
const cleanInput = input.replace(/[^0-9-\/:\s]/g, "");
|
|
338
|
+
const dateFormat = "YYYY-MM-DD";
|
|
339
|
+
const dateTimeFormat = "YYYY-MM-DD HH:mm:ss";
|
|
340
|
+
const currentDay = (0, import_moment.default)().format("DD");
|
|
341
|
+
const currentMonth = (0, import_moment.default)().format("MM");
|
|
342
|
+
const currentYear = (0, import_moment.default)().format("YYYY");
|
|
343
|
+
const defaultTime = "00:00:00";
|
|
344
|
+
const maxYear = parseInt(currentYear) + 10;
|
|
345
|
+
const isValidDate = (day, month, year) => {
|
|
346
|
+
const date = (0, import_moment.default)(`${day}-${month}-${year}`, "DD-MM-YYYY", true);
|
|
347
|
+
return date.isValid();
|
|
348
|
+
};
|
|
349
|
+
const isValidTime = (hour, minute = "00", second = "00") => {
|
|
350
|
+
const h = parseInt(hour, 10);
|
|
351
|
+
const m = parseInt(minute, 10);
|
|
352
|
+
const s = parseInt(second, 10);
|
|
353
|
+
return h >= 0 && h <= 23 && m >= 0 && m <= 59 && s >= 0 && s <= 59;
|
|
354
|
+
};
|
|
355
|
+
const formatOutput = (day, month, year, time = defaultTime) => {
|
|
356
|
+
let result = (0, import_moment.default)(
|
|
357
|
+
`${day}-${month}-${year} ${time}`,
|
|
358
|
+
"DD-MM-YYYY HH:mm:ss"
|
|
359
|
+
);
|
|
360
|
+
if (!result.isValid()) return null;
|
|
361
|
+
if (isDateTime) {
|
|
362
|
+
result = result.subtract(7, "hours");
|
|
363
|
+
return result.format(dateTimeFormat);
|
|
364
|
+
}
|
|
365
|
+
return result.format(dateFormat);
|
|
366
|
+
};
|
|
367
|
+
if (isDateTime && input.match(
|
|
368
|
+
/^\d{1,2}[\/-]\d{1,2}[\/-]\d{2,4}\s+\d{1,2}(:\d{1,2}(:\d{1,2})?)?$/
|
|
369
|
+
)) {
|
|
370
|
+
const [datePart, timePart] = input.split(/\s+/);
|
|
371
|
+
const dateParts = datePart.split(/[\/-]/);
|
|
372
|
+
const timeParts = timePart.split(":");
|
|
373
|
+
const day = dateParts[0].padStart(2, "0");
|
|
374
|
+
const month = dateParts[1].padStart(2, "0");
|
|
375
|
+
const year = dateParts[2].length <= 2 ? `20${dateParts[2].padStart(2, "0")}` : dateParts[2].padStart(4, "0");
|
|
376
|
+
const hour = timeParts[0].padStart(2, "0");
|
|
377
|
+
const minute = timeParts[1] ? timeParts[1].padStart(2, "0") : "00";
|
|
378
|
+
const second = timeParts[2] ? timeParts[2].padStart(2, "0") : "00";
|
|
379
|
+
if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
|
|
380
|
+
let result = (0, import_moment.default)(
|
|
381
|
+
`${day}-${month}-${year} ${hour}:${minute}:${second}`,
|
|
382
|
+
"DD-MM-YYYY HH:mm:ss"
|
|
383
|
+
);
|
|
384
|
+
if (!result.isValid()) return null;
|
|
385
|
+
result = result.subtract(7, "hours");
|
|
386
|
+
return result.format(dateTimeFormat);
|
|
387
|
+
}
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
if (cleanInput.match(/^\d{4}-\d{2}-\d{2}$/)) {
|
|
391
|
+
const [year, month, day] = cleanInput.split("-");
|
|
392
|
+
if (isValidDate(day, month, year)) {
|
|
393
|
+
return formatOutput(day, month, year);
|
|
394
|
+
}
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
if (cleanInput.match(/^\d{1,2}\/\d{1,2}\/\d{2,4}$/)) {
|
|
398
|
+
const [day, month, year] = cleanInput.split("/");
|
|
399
|
+
const paddedDay = day.padStart(2, "0");
|
|
400
|
+
const paddedMonth = month.padStart(2, "0");
|
|
401
|
+
const fullYear = year.length <= 2 ? `20${year.padStart(2, "0")}` : year.padStart(4, "0");
|
|
402
|
+
if (isValidDate(paddedDay, paddedMonth, fullYear)) {
|
|
403
|
+
return formatOutput(paddedDay, paddedMonth, fullYear);
|
|
404
|
+
}
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
if (cleanInput.match(/^\d{1,2}-\d{1,2}-\d{2,4}$/)) {
|
|
408
|
+
const [day, month, year] = cleanInput.split("-");
|
|
409
|
+
const paddedDay = day.padStart(2, "0");
|
|
410
|
+
const paddedMonth = month.padStart(2, "0");
|
|
411
|
+
const fullYear = year.length <= 2 ? `20${year.padStart(2, "0")}` : year.padStart(4, "0");
|
|
412
|
+
if (isValidDate(paddedDay, paddedMonth, fullYear)) {
|
|
413
|
+
return formatOutput(paddedDay, paddedMonth, fullYear);
|
|
414
|
+
}
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
if (cleanInput.match(/^\d{1,2}[\/-]\d{1,2}$/)) {
|
|
418
|
+
const [day, month] = cleanInput.split(/[\/-]/);
|
|
419
|
+
const paddedDay = day.padStart(2, "0");
|
|
420
|
+
const paddedMonth = month.padStart(2, "0");
|
|
421
|
+
if (isValidDate(paddedDay, paddedMonth, currentYear)) {
|
|
422
|
+
return formatOutput(paddedDay, paddedMonth, currentYear);
|
|
423
|
+
}
|
|
424
|
+
return null;
|
|
425
|
+
}
|
|
426
|
+
if (cleanInput.match(/^\d{4}$/)) {
|
|
427
|
+
const num = parseInt(cleanInput, 10);
|
|
428
|
+
if (num >= 2e3 && num <= maxYear) {
|
|
429
|
+
if (isValidDate(currentDay, currentMonth, num.toString())) {
|
|
430
|
+
return formatOutput(currentDay, currentMonth, num.toString());
|
|
431
|
+
}
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
const day = cleanInput.slice(0, 2);
|
|
435
|
+
const month = cleanInput.slice(2, 4);
|
|
436
|
+
if (isValidDate(day, month, currentYear)) {
|
|
437
|
+
return formatOutput(day, month, currentYear);
|
|
438
|
+
}
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
if (cleanInput.startsWith("-") && /^\-\d+$/.test(cleanInput)) {
|
|
442
|
+
const daysToSubtract = Math.abs(parseInt(cleanInput, 10));
|
|
443
|
+
let result = (0, import_moment.default)().subtract(daysToSubtract, "days");
|
|
444
|
+
if (isDateTime) {
|
|
445
|
+
result = result.subtract(7, "hours");
|
|
446
|
+
}
|
|
447
|
+
if (result.isValid()) {
|
|
448
|
+
return isDateTime ? result.format(dateTimeFormat) : result.format(dateFormat);
|
|
449
|
+
}
|
|
450
|
+
return null;
|
|
451
|
+
}
|
|
452
|
+
if (input.match(/^\d{1,2}[^0-9-\/]+\d{1,2}[^0-9-\/]+\d{2,4}.*$/)) {
|
|
453
|
+
const parts = input.split(/[^0-9-\/]+/).filter(Boolean);
|
|
454
|
+
const day = parts[0].padStart(2, "0");
|
|
455
|
+
const month = parts[1].padStart(2, "0");
|
|
456
|
+
let year = parts[2];
|
|
457
|
+
year = year.length === 2 ? `20${year}` : year.padStart(4, "0");
|
|
458
|
+
if (isValidDate(day, month, year)) {
|
|
459
|
+
return formatOutput(day, month, year);
|
|
460
|
+
}
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
if (isDateTime) {
|
|
464
|
+
if (cleanInput.length === 9) {
|
|
465
|
+
const day = cleanInput.slice(0, 2);
|
|
466
|
+
const month = cleanInput.slice(2, 4);
|
|
467
|
+
const year = cleanInput.slice(4, 8);
|
|
468
|
+
const hour = cleanInput.slice(8, 9).padStart(2, "0");
|
|
469
|
+
if (isValidDate(day, month, year) && isValidTime(hour)) {
|
|
470
|
+
let result = (0, import_moment.default)(
|
|
471
|
+
`${day}-${month}-${year} ${hour}:00:00`,
|
|
472
|
+
"DD-MM-YYYY HH:mm:ss"
|
|
473
|
+
);
|
|
474
|
+
if (!result.isValid()) return null;
|
|
475
|
+
result = result.subtract(7, "hours");
|
|
476
|
+
return result.format(dateTimeFormat);
|
|
477
|
+
}
|
|
478
|
+
return null;
|
|
479
|
+
}
|
|
480
|
+
if (cleanInput.length === 10) {
|
|
481
|
+
const day = cleanInput.slice(0, 2);
|
|
482
|
+
const month = cleanInput.slice(2, 4);
|
|
483
|
+
const year = cleanInput.slice(4, 8);
|
|
484
|
+
const hour = cleanInput.slice(8, 10);
|
|
485
|
+
if (isValidDate(day, month, year) && isValidTime(hour)) {
|
|
486
|
+
let result = (0, import_moment.default)(
|
|
487
|
+
`${day}-${month}-${year} ${hour}:00:00`,
|
|
488
|
+
"DD-MM-YYYY HH:mm:ss"
|
|
489
|
+
);
|
|
490
|
+
if (!result.isValid()) return null;
|
|
491
|
+
result = result.subtract(7, "hours");
|
|
492
|
+
return result.format(dateTimeFormat);
|
|
493
|
+
}
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
if (cleanInput.length === 11) {
|
|
497
|
+
const day = cleanInput.slice(0, 2);
|
|
498
|
+
const month = cleanInput.slice(2, 4);
|
|
499
|
+
const year = cleanInput.slice(4, 8);
|
|
500
|
+
const hour = cleanInput.slice(8, 10);
|
|
501
|
+
const minute = cleanInput.slice(10, 11).padStart(2, "0");
|
|
502
|
+
if (isValidDate(day, month, year) && isValidTime(hour, minute)) {
|
|
503
|
+
let result = (0, import_moment.default)(
|
|
504
|
+
`${day}-${month}-${year} ${hour}:${minute}:00`,
|
|
505
|
+
"DD-MM-YYYY HH:mm:ss"
|
|
506
|
+
);
|
|
507
|
+
if (!result.isValid()) return null;
|
|
508
|
+
result = result.subtract(7, "hours");
|
|
509
|
+
return result.format(dateTimeFormat);
|
|
510
|
+
}
|
|
511
|
+
return null;
|
|
512
|
+
}
|
|
513
|
+
if (cleanInput.length === 12) {
|
|
514
|
+
const day = cleanInput.slice(0, 2);
|
|
515
|
+
const month = cleanInput.slice(2, 4);
|
|
516
|
+
const year = cleanInput.slice(4, 8);
|
|
517
|
+
const hour = cleanInput.slice(8, 10);
|
|
518
|
+
const minute = cleanInput.slice(10, 12);
|
|
519
|
+
if (isValidDate(day, month, year) && isValidTime(hour, minute)) {
|
|
520
|
+
let result = (0, import_moment.default)(
|
|
521
|
+
`${day}-${month}-${year} ${hour}:${minute}:00`,
|
|
522
|
+
"DD-MM-YYYY HH:mm:ss"
|
|
523
|
+
);
|
|
524
|
+
if (!result.isValid()) return null;
|
|
525
|
+
result = result.subtract(7, "hours");
|
|
526
|
+
return result.format(dateTimeFormat);
|
|
527
|
+
}
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
if (cleanInput.length === 13) {
|
|
531
|
+
const day = cleanInput.slice(0, 2);
|
|
532
|
+
const month = cleanInput.slice(2, 4);
|
|
533
|
+
const year = cleanInput.slice(4, 8);
|
|
534
|
+
const hour = cleanInput.slice(8, 10);
|
|
535
|
+
const minute = cleanInput.slice(10, 12);
|
|
536
|
+
const second = cleanInput.slice(12, 13).padStart(2, "0");
|
|
537
|
+
if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
|
|
538
|
+
let result = (0, import_moment.default)(
|
|
539
|
+
`${day}-${month}-${year} ${hour}:${minute}:${second}`,
|
|
540
|
+
"DD-MM-YYYY HH:mm:ss"
|
|
541
|
+
);
|
|
542
|
+
if (!result.isValid()) return null;
|
|
543
|
+
result = result.subtract(7, "hours");
|
|
544
|
+
return result.format(dateTimeFormat);
|
|
545
|
+
}
|
|
546
|
+
return null;
|
|
547
|
+
}
|
|
548
|
+
if (cleanInput.length === 14) {
|
|
549
|
+
const day = cleanInput.slice(0, 2);
|
|
550
|
+
const month = cleanInput.slice(2, 4);
|
|
551
|
+
const year = cleanInput.slice(4, 8);
|
|
552
|
+
const hour = cleanInput.slice(8, 10);
|
|
553
|
+
const minute = cleanInput.slice(10, 12);
|
|
554
|
+
const second = cleanInput.slice(12, 14);
|
|
555
|
+
if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
|
|
556
|
+
let result = (0, import_moment.default)(
|
|
557
|
+
`${day}-${month}-${year} ${hour}:${minute}:${second}`,
|
|
558
|
+
"DD-MM-YYYY HH:mm:ss"
|
|
559
|
+
);
|
|
560
|
+
if (!result.isValid()) return null;
|
|
561
|
+
result = result.subtract(7, "hours");
|
|
562
|
+
return result.format(dateTimeFormat);
|
|
563
|
+
}
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
const len = cleanInput.length;
|
|
568
|
+
if (len === 1 || len === 2) {
|
|
569
|
+
const paddedDay = cleanInput.padStart(2, "0");
|
|
570
|
+
if (isValidDate(paddedDay, currentMonth, currentYear)) {
|
|
571
|
+
return formatOutput(paddedDay, currentMonth, currentYear);
|
|
572
|
+
}
|
|
573
|
+
return null;
|
|
574
|
+
}
|
|
575
|
+
if (len === 3) {
|
|
576
|
+
const day = cleanInput.slice(0, 2);
|
|
577
|
+
const month = cleanInput.slice(2, 3).padStart(2, "0");
|
|
578
|
+
if (isValidDate(day, month, currentYear)) {
|
|
579
|
+
return formatOutput(day, month, currentYear);
|
|
580
|
+
}
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
583
|
+
if (len === 6) {
|
|
584
|
+
const day = cleanInput.slice(0, 2);
|
|
585
|
+
const month = cleanInput.slice(2, 4);
|
|
586
|
+
let year = cleanInput.slice(4, 6);
|
|
587
|
+
year = `20${year}`;
|
|
588
|
+
if (parseInt(month) > 12) {
|
|
589
|
+
if (isValidDate(day, currentMonth, currentYear)) {
|
|
590
|
+
return formatOutput(day, currentMonth, currentYear);
|
|
591
|
+
}
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
if (isValidDate(day, month, year)) {
|
|
595
|
+
return formatOutput(day, month, year);
|
|
596
|
+
}
|
|
597
|
+
return null;
|
|
598
|
+
}
|
|
599
|
+
if (len === 7) {
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
if (len === 8) {
|
|
603
|
+
const day = cleanInput.slice(0, 2);
|
|
604
|
+
const month = cleanInput.slice(2, 4);
|
|
605
|
+
const year = cleanInput.slice(4, 8);
|
|
606
|
+
if (isValidDate(day, month, year)) {
|
|
607
|
+
return formatOutput(day, month, year);
|
|
608
|
+
}
|
|
609
|
+
return null;
|
|
610
|
+
}
|
|
611
|
+
if (len > 8 && !isDateTime) {
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
return null;
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
// src/constants/field/field-type-constant.ts
|
|
618
|
+
var FieldTypeConstants = /* @__PURE__ */ ((FieldTypeConstants2) => {
|
|
619
|
+
FieldTypeConstants2["CHAR"] = "char";
|
|
620
|
+
FieldTypeConstants2["TEXT"] = "text";
|
|
621
|
+
FieldTypeConstants2["INTEGER"] = "integer";
|
|
622
|
+
FieldTypeConstants2["FLOAT"] = "float";
|
|
623
|
+
FieldTypeConstants2["BOOLEAN"] = "boolean";
|
|
624
|
+
FieldTypeConstants2["DATE"] = "date";
|
|
625
|
+
FieldTypeConstants2["DATETIME"] = "datetime";
|
|
626
|
+
FieldTypeConstants2["BINARY"] = "binary";
|
|
627
|
+
FieldTypeConstants2["SELECTION"] = "selection";
|
|
628
|
+
FieldTypeConstants2["HTML"] = "html";
|
|
629
|
+
FieldTypeConstants2["MANY2ONE"] = "many2one";
|
|
630
|
+
FieldTypeConstants2["ONE2MANY"] = "one2many";
|
|
631
|
+
FieldTypeConstants2["MANY2MANY"] = "many2many";
|
|
632
|
+
FieldTypeConstants2["MONETARY"] = "monetary";
|
|
633
|
+
FieldTypeConstants2["REFERENCE"] = "reference";
|
|
634
|
+
FieldTypeConstants2["FUNCTION"] = "function";
|
|
635
|
+
FieldTypeConstants2["PROPERTY"] = "property";
|
|
636
|
+
return FieldTypeConstants2;
|
|
637
|
+
})(FieldTypeConstants || {});
|
|
638
|
+
|
|
639
|
+
// src/constants/method/method-type-constant.ts
|
|
640
|
+
var MethodType = /* @__PURE__ */ ((MethodType2) => {
|
|
641
|
+
MethodType2[MethodType2["CREATE"] = 0] = "CREATE";
|
|
642
|
+
MethodType2[MethodType2["UPDATE"] = 1] = "UPDATE";
|
|
643
|
+
MethodType2[MethodType2["DELETE"] = 2] = "DELETE";
|
|
644
|
+
MethodType2[MethodType2["UNLINK"] = 3] = "UNLINK";
|
|
645
|
+
MethodType2[MethodType2["NO_CHANGE"] = 4] = "NO_CHANGE";
|
|
646
|
+
return MethodType2;
|
|
647
|
+
})(MethodType || {});
|
|
648
|
+
|
|
649
|
+
// src/constants/model/model-constant.ts
|
|
650
|
+
var ModelConstants = /* @__PURE__ */ ((ModelConstants2) => {
|
|
651
|
+
ModelConstants2["MENU"] = "ir.ui.menu";
|
|
652
|
+
ModelConstants2["USER"] = "res.users";
|
|
653
|
+
ModelConstants2["COMPANY"] = "res.company";
|
|
654
|
+
ModelConstants2["WINDOW_ACTION"] = "ir.actions.act_window";
|
|
655
|
+
ModelConstants2["BASE_IMPORT"] = "base_import.import";
|
|
656
|
+
ModelConstants2["GET_IMPORT"] = "get_import_templates";
|
|
657
|
+
return ModelConstants2;
|
|
658
|
+
})(ModelConstants || {});
|
|
659
|
+
|
|
660
|
+
// src/constants/type/index.ts
|
|
661
|
+
var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
|
|
662
|
+
ComponentType2["GROUP"] = "group";
|
|
663
|
+
ComponentType2["FIELD"] = "field";
|
|
664
|
+
ComponentType2["TREE"] = "tree";
|
|
665
|
+
ComponentType2["DIV"] = "div";
|
|
666
|
+
ComponentType2["LIST"] = "list";
|
|
667
|
+
ComponentType2["FORM"] = "form";
|
|
668
|
+
ComponentType2["SETTINGS"] = "setting";
|
|
669
|
+
ComponentType2["SPAN"] = "span";
|
|
670
|
+
ComponentType2["KANBAN"] = "kanban";
|
|
671
|
+
ComponentType2["CALENDAR"] = "calendar";
|
|
672
|
+
ComponentType2["TYPE"] = "view-type";
|
|
673
|
+
return ComponentType2;
|
|
674
|
+
})(ComponentType || {});
|
|
675
|
+
var SearchType = {
|
|
676
|
+
FILTER: "filter_by",
|
|
677
|
+
SEARCH: "search_by",
|
|
678
|
+
GROUP: "group_by"
|
|
679
|
+
};
|
|
142
680
|
|
|
143
681
|
// src/constants/widget/widget-avatar-constant.ts
|
|
144
682
|
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
@@ -146,6 +684,28 @@ var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
|
146
684
|
WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
|
|
147
685
|
return WIDGETAVATAR2;
|
|
148
686
|
})(WIDGETAVATAR || {});
|
|
687
|
+
var WIDGETCURRENCY = /* @__PURE__ */ ((WIDGETCURRENCY2) => {
|
|
688
|
+
WIDGETCURRENCY2["many2one_avatar_user"] = "many2one_avatar_user";
|
|
689
|
+
WIDGETCURRENCY2["many2many_avatar_user"] = "many2many_avatar_user";
|
|
690
|
+
return WIDGETCURRENCY2;
|
|
691
|
+
})(WIDGETCURRENCY || {});
|
|
692
|
+
|
|
693
|
+
// src/constants/widget/widget-color-constant.ts
|
|
694
|
+
var WIDGETCOLOR = /* @__PURE__ */ ((WIDGETCOLOR2) => {
|
|
695
|
+
WIDGETCOLOR2["many2many_tags"] = "many2many_tags";
|
|
696
|
+
WIDGETCOLOR2["helpdesk_sla_many2many_tags"] = "helpdesk_sla_many2many_tags";
|
|
697
|
+
return WIDGETCOLOR2;
|
|
698
|
+
})(WIDGETCOLOR || {});
|
|
699
|
+
|
|
700
|
+
// src/constants/widget/widget-status-constant.ts
|
|
701
|
+
var WIDGETSTATUS = /* @__PURE__ */ ((WIDGETSTATUS2) => {
|
|
702
|
+
WIDGETSTATUS2["sla_status_ids"] = "sla_status_ids";
|
|
703
|
+
return WIDGETSTATUS2;
|
|
704
|
+
})(WIDGETSTATUS || {});
|
|
705
|
+
var WIDGETNOSTRING = /* @__PURE__ */ ((WIDGETNOSTRING2) => {
|
|
706
|
+
WIDGETNOSTRING2["sla_status_ids"] = "sla_status_ids";
|
|
707
|
+
return WIDGETNOSTRING2;
|
|
708
|
+
})(WIDGETNOSTRING || {});
|
|
149
709
|
|
|
150
710
|
// src/utils/domain/py_tokenizer.ts
|
|
151
711
|
var TokenizerError = class extends Error {
|
|
@@ -1914,6 +2474,48 @@ function parseExpr(expr) {
|
|
|
1914
2474
|
const tokens = tokenize(expr);
|
|
1915
2475
|
return parse(tokens);
|
|
1916
2476
|
}
|
|
2477
|
+
function evaluateExpr(expr, context = {}) {
|
|
2478
|
+
let ast;
|
|
2479
|
+
try {
|
|
2480
|
+
ast = parseExpr(expr);
|
|
2481
|
+
} catch (error) {
|
|
2482
|
+
throw new EvalError(
|
|
2483
|
+
`Can not parse python expression: (${expr})
|
|
2484
|
+
Error: ${error.message}`
|
|
2485
|
+
);
|
|
2486
|
+
}
|
|
2487
|
+
try {
|
|
2488
|
+
return evaluate(ast, context);
|
|
2489
|
+
} catch (error) {
|
|
2490
|
+
throw new EvalError(
|
|
2491
|
+
`Can not evaluate python expression: (${expr})
|
|
2492
|
+
Error: ${error.message}`
|
|
2493
|
+
);
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
function evaluateBooleanExpr(expr, context = {}) {
|
|
2497
|
+
if (!expr || expr === "False" || expr === "0") {
|
|
2498
|
+
return false;
|
|
2499
|
+
}
|
|
2500
|
+
if (expr === "True" || expr === "1") {
|
|
2501
|
+
return true;
|
|
2502
|
+
}
|
|
2503
|
+
return evaluateExpr(`bool(${expr})`, context);
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
// src/utils/domain/context.ts
|
|
2507
|
+
function evalPartialContext(_context, evaluationContext = {}) {
|
|
2508
|
+
const ast = parseExpr(_context);
|
|
2509
|
+
const context = {};
|
|
2510
|
+
for (const key in ast.value) {
|
|
2511
|
+
const value = ast.value[key];
|
|
2512
|
+
try {
|
|
2513
|
+
context[key] = evaluate(value, evaluationContext);
|
|
2514
|
+
} catch {
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
return context;
|
|
2518
|
+
}
|
|
1917
2519
|
|
|
1918
2520
|
// src/utils/domain/objects.ts
|
|
1919
2521
|
function shallowEqual(obj1, obj2, comparisonFn = (a, b) => a === b) {
|
|
@@ -2252,14 +2854,280 @@ function matchDomain(record, domain) {
|
|
|
2252
2854
|
}
|
|
2253
2855
|
return matchCondition(record, condStack.pop());
|
|
2254
2856
|
}
|
|
2857
|
+
var checkDomain = (context, domain) => {
|
|
2858
|
+
try {
|
|
2859
|
+
if (domain === void 0 || domain === "0" || domain === "False" || domain === false) {
|
|
2860
|
+
return false;
|
|
2861
|
+
} else if (domain === "1" || domain === "True" || domain === true) {
|
|
2862
|
+
return true;
|
|
2863
|
+
}
|
|
2864
|
+
try {
|
|
2865
|
+
if (context && domain) {
|
|
2866
|
+
const d = new Domain(domain);
|
|
2867
|
+
return d.contains(context);
|
|
2868
|
+
}
|
|
2869
|
+
} catch (error) {
|
|
2870
|
+
if (context && domain) {
|
|
2871
|
+
const domainEval = evaluateBooleanExpr(domain, context);
|
|
2872
|
+
return domainEval;
|
|
2873
|
+
}
|
|
2874
|
+
return false;
|
|
2875
|
+
}
|
|
2876
|
+
return false;
|
|
2877
|
+
} catch (e) {
|
|
2878
|
+
return false;
|
|
2879
|
+
}
|
|
2880
|
+
};
|
|
2881
|
+
var matchDomains = (context, domains) => {
|
|
2882
|
+
if (Array.isArray(domains)) {
|
|
2883
|
+
if (domains?.length > 0) {
|
|
2884
|
+
return domains && domains.some((domain) => checkDomain(context, domain));
|
|
2885
|
+
}
|
|
2886
|
+
} else return checkDomain(context, domains);
|
|
2887
|
+
return false;
|
|
2888
|
+
};
|
|
2255
2889
|
|
|
2256
2890
|
// src/utils/function.ts
|
|
2257
2891
|
var import_react = require("react");
|
|
2892
|
+
var evalJSONContext = (_context, context = {}) => {
|
|
2893
|
+
try {
|
|
2894
|
+
return evalPartialContext(_context, context);
|
|
2895
|
+
} catch (err) {
|
|
2896
|
+
return null;
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2899
|
+
var evalJSONDomain = (domain, context) => {
|
|
2900
|
+
try {
|
|
2901
|
+
if (context) {
|
|
2902
|
+
Object.keys(context)?.forEach((key) => {
|
|
2903
|
+
if (Array.isArray(context[key])) {
|
|
2904
|
+
const isTypeObject = context[key]?.every(
|
|
2905
|
+
(item) => typeof item === "object" && item !== null && item?.id !== void 0
|
|
2906
|
+
);
|
|
2907
|
+
if (isTypeObject) {
|
|
2908
|
+
context[key] = context[key]?.map((item) => item?.id);
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
});
|
|
2912
|
+
}
|
|
2913
|
+
const value = evaluateExpr(domain, context);
|
|
2914
|
+
return value;
|
|
2915
|
+
} catch (err) {
|
|
2916
|
+
try {
|
|
2917
|
+
const domainObject = new Domain(domain).toList(context);
|
|
2918
|
+
return domainObject;
|
|
2919
|
+
} catch (err2) {
|
|
2920
|
+
return [];
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
};
|
|
2924
|
+
var formatSortingString = (input) => {
|
|
2925
|
+
if (!input) return null;
|
|
2926
|
+
return input.split(",").map((field) => {
|
|
2927
|
+
const [key, order] = field.trim().split(/\s+/);
|
|
2928
|
+
const sortOrder = order?.toUpperCase() === "DESC" ? "DESC" : "ASC";
|
|
2929
|
+
return `${key} ${sortOrder}`;
|
|
2930
|
+
}).join(", ");
|
|
2931
|
+
};
|
|
2932
|
+
var domainHelper = {
|
|
2933
|
+
checkDomain,
|
|
2934
|
+
matchDomains,
|
|
2935
|
+
Domain
|
|
2936
|
+
};
|
|
2258
2937
|
var toQueryString = (params) => {
|
|
2259
2938
|
return Object.keys(params).map(
|
|
2260
2939
|
(key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
|
|
2261
2940
|
).join("&");
|
|
2262
2941
|
};
|
|
2942
|
+
var convertFloatToTime = (floatValue) => {
|
|
2943
|
+
const hours = Math.floor(floatValue);
|
|
2944
|
+
const minutes = Math.round((floatValue - hours) * 60);
|
|
2945
|
+
const formattedHours = String(hours).padStart(2, "0");
|
|
2946
|
+
const formattedMinutes = String(minutes).padStart(2, "0");
|
|
2947
|
+
return `${formattedHours}:${formattedMinutes}`;
|
|
2948
|
+
};
|
|
2949
|
+
var convertTimeToFloat = (timeString) => {
|
|
2950
|
+
const [hours, minutes] = timeString.split(":").map(Number);
|
|
2951
|
+
return hours + minutes / 60;
|
|
2952
|
+
};
|
|
2953
|
+
var stringToColor = (name, id) => {
|
|
2954
|
+
const combined = name + id / 2;
|
|
2955
|
+
let hash = 0;
|
|
2956
|
+
for (let i = 0; i < combined.length; i++) {
|
|
2957
|
+
hash = combined.charCodeAt(i) + ((hash << 5) - hash);
|
|
2958
|
+
}
|
|
2959
|
+
const r = hash >> 16 & 255;
|
|
2960
|
+
const g = hash >> 8 & 255;
|
|
2961
|
+
const b = hash & 255;
|
|
2962
|
+
const adjustedR = 120 + r % 61;
|
|
2963
|
+
const adjustedG = 120 + g % 61;
|
|
2964
|
+
const adjustedB = 120 + b % 61;
|
|
2965
|
+
return `#${adjustedR.toString(16).padStart(2, "0")}${adjustedG.toString(16).padStart(2, "0")}${adjustedB.toString(16).padStart(2, "0")}`;
|
|
2966
|
+
};
|
|
2967
|
+
var getFieldsOnChange = (fields) => {
|
|
2968
|
+
const result = [];
|
|
2969
|
+
function traverse(items) {
|
|
2970
|
+
for (const item of items) {
|
|
2971
|
+
if (item) {
|
|
2972
|
+
if (item?.type_co === "field" && matchDomains(fields, item?.on_change)) {
|
|
2973
|
+
result.push(item.name);
|
|
2974
|
+
}
|
|
2975
|
+
if (item?.fields && Array.isArray(item?.fields)) {
|
|
2976
|
+
traverse(item?.fields);
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
traverse(fields);
|
|
2982
|
+
return result;
|
|
2983
|
+
};
|
|
2984
|
+
var filterFieldDirty = ({
|
|
2985
|
+
id,
|
|
2986
|
+
viewData,
|
|
2987
|
+
formValues,
|
|
2988
|
+
dirtyFields,
|
|
2989
|
+
model,
|
|
2990
|
+
defaultData
|
|
2991
|
+
}) => {
|
|
2992
|
+
const data = id ? { ...dirtyFields } : { ...formValues };
|
|
2993
|
+
for (const key in data) {
|
|
2994
|
+
if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */) {
|
|
2995
|
+
const lineData = [];
|
|
2996
|
+
(formValues[key] ?? []).forEach((itemData, index) => {
|
|
2997
|
+
if (typeof itemData?.id === "string" && itemData?.id.includes("virtual")) {
|
|
2998
|
+
delete itemData?.id;
|
|
2999
|
+
}
|
|
3000
|
+
if (!itemData?.id) {
|
|
3001
|
+
lineData.push([
|
|
3002
|
+
0 /* CREATE */,
|
|
3003
|
+
`virtual_${index}`,
|
|
3004
|
+
filterFieldDirty({
|
|
3005
|
+
id: itemData?.id,
|
|
3006
|
+
viewData,
|
|
3007
|
+
formValues: itemData,
|
|
3008
|
+
dirtyFields: {},
|
|
3009
|
+
model: viewData?.models?.[model]?.[key]?.relation,
|
|
3010
|
+
defaultData
|
|
3011
|
+
})
|
|
3012
|
+
]);
|
|
3013
|
+
} else if (dirtyFields[key]?.length) {
|
|
3014
|
+
dirtyFields[key].forEach((itemDirty, indexDirty) => {
|
|
3015
|
+
if (Object.values(itemDirty).includes(true) && indexDirty === index) {
|
|
3016
|
+
lineData.push([
|
|
3017
|
+
1 /* UPDATE */,
|
|
3018
|
+
itemData?.id,
|
|
3019
|
+
filterFieldDirty({
|
|
3020
|
+
id: itemData?.id,
|
|
3021
|
+
viewData,
|
|
3022
|
+
formValues: itemData,
|
|
3023
|
+
dirtyFields: itemDirty,
|
|
3024
|
+
model: viewData?.models?.[model]?.[key]?.relation,
|
|
3025
|
+
defaultData: {}
|
|
3026
|
+
})
|
|
3027
|
+
]);
|
|
3028
|
+
}
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
});
|
|
3032
|
+
(defaultData[key] ?? []).forEach((item) => {
|
|
3033
|
+
if (!(formValues[key] ?? []).find(
|
|
3034
|
+
(itemData) => itemData?.id === item?.id
|
|
3035
|
+
)) {
|
|
3036
|
+
lineData.push([2 /* DELETE */, item?.id, item]);
|
|
3037
|
+
}
|
|
3038
|
+
});
|
|
3039
|
+
data[key] = lineData;
|
|
3040
|
+
} else if (viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
|
|
3041
|
+
const lineData = [];
|
|
3042
|
+
(formValues[key] || []).forEach((itemData) => {
|
|
3043
|
+
if (itemData?.id) {
|
|
3044
|
+
lineData.push([4 /* NO_CHANGE */, itemData?.id]);
|
|
3045
|
+
}
|
|
3046
|
+
});
|
|
3047
|
+
(defaultData[key] ?? []).forEach((item) => {
|
|
3048
|
+
if (!(formValues[key] ?? []).find(
|
|
3049
|
+
(itemData) => itemData?.id === item?.id
|
|
3050
|
+
)) {
|
|
3051
|
+
lineData.push([3 /* UNLINK */, item?.id]);
|
|
3052
|
+
}
|
|
3053
|
+
});
|
|
3054
|
+
data[key] = lineData;
|
|
3055
|
+
} else {
|
|
3056
|
+
if (id && (typeof dirtyFields?.[key] === "object" && !dirtyFields?.[key]?.id || typeof dirtyFields[key] !== "object" && !dirtyFields[key])) {
|
|
3057
|
+
delete data[key];
|
|
3058
|
+
} else {
|
|
3059
|
+
if (!data[key]) {
|
|
3060
|
+
delete data[key];
|
|
3061
|
+
} else {
|
|
3062
|
+
data[key] = formValues?.[key]?.display_name ? formValues?.[key]?.id : formValues?.[key];
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
return data;
|
|
3068
|
+
};
|
|
3069
|
+
var mergeObjects = (object1, object2) => {
|
|
3070
|
+
if (!object1 || !object2) return void 0;
|
|
3071
|
+
const mergedObject = { ...object2 };
|
|
3072
|
+
Object.keys(object1).forEach((key) => {
|
|
3073
|
+
if (Array.isArray(object1[key]) && Array.isArray(object2[key])) {
|
|
3074
|
+
mergedObject[key] = object2[key].map((item, index) => {
|
|
3075
|
+
if (object1[key][index]) {
|
|
3076
|
+
return {
|
|
3077
|
+
...item,
|
|
3078
|
+
...object1[key][index]
|
|
3079
|
+
};
|
|
3080
|
+
}
|
|
3081
|
+
return item;
|
|
3082
|
+
});
|
|
3083
|
+
} else if (typeof object1[key] === "object" && typeof object2[key] === "object" && object1[key] !== null && object2[key] !== null) {
|
|
3084
|
+
mergedObject[key] = mergeObjects(object1[key], object2[key]);
|
|
3085
|
+
} else {
|
|
3086
|
+
mergedObject[key] = object1[key] !== void 0 ? object1[key] : object2[key];
|
|
3087
|
+
}
|
|
3088
|
+
});
|
|
3089
|
+
if (object2) {
|
|
3090
|
+
Object.keys(object2).forEach((key) => {
|
|
3091
|
+
if (!mergedObject.hasOwnProperty(key)) {
|
|
3092
|
+
mergedObject[key] = object2[key];
|
|
3093
|
+
}
|
|
3094
|
+
});
|
|
3095
|
+
}
|
|
3096
|
+
return mergedObject;
|
|
3097
|
+
};
|
|
3098
|
+
var formatUrlPath = ({
|
|
3099
|
+
viewType,
|
|
3100
|
+
aid,
|
|
3101
|
+
model,
|
|
3102
|
+
id,
|
|
3103
|
+
actionPath
|
|
3104
|
+
}) => {
|
|
3105
|
+
let _url = `/${viewType}/${actionPath}?aid=${aid}&model=${model}`;
|
|
3106
|
+
if (id) {
|
|
3107
|
+
_url += `&id=${id}`;
|
|
3108
|
+
}
|
|
3109
|
+
return _url;
|
|
3110
|
+
};
|
|
3111
|
+
var removeUndefinedFields = (obj) => {
|
|
3112
|
+
const newObj = {};
|
|
3113
|
+
for (const key in obj) {
|
|
3114
|
+
if (obj[key] !== void 0) {
|
|
3115
|
+
newObj[key] = obj[key];
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
return newObj;
|
|
3119
|
+
};
|
|
3120
|
+
var useTabModel = (viewData, onchangeData) => {
|
|
3121
|
+
const tabsData = viewData?.views?.form?.tabs?.filter((val) => {
|
|
3122
|
+
if (!val) return null;
|
|
3123
|
+
const hide = checkDomain(onchangeData, val.invisible);
|
|
3124
|
+
if (!hide) {
|
|
3125
|
+
return val;
|
|
3126
|
+
}
|
|
3127
|
+
return false;
|
|
3128
|
+
}) || [];
|
|
3129
|
+
return tabsData;
|
|
3130
|
+
};
|
|
2263
3131
|
var isBase64File = (str) => {
|
|
2264
3132
|
try {
|
|
2265
3133
|
const dataUriPattern = /^data:([a-zA-Z]+\/[a-zA-Z0-9-.+]+)?;base64,/;
|
|
@@ -2275,6 +3143,69 @@ var isBase64File = (str) => {
|
|
|
2275
3143
|
return false;
|
|
2276
3144
|
}
|
|
2277
3145
|
};
|
|
3146
|
+
var isBase64Image = (str) => {
|
|
3147
|
+
const base64Regex = /^data:image\/(png|jpeg|jpg|gif|webp);base64,/;
|
|
3148
|
+
if (!base64Regex.test(str)) {
|
|
3149
|
+
return false;
|
|
3150
|
+
}
|
|
3151
|
+
try {
|
|
3152
|
+
const base64Data = str.split(",")[1];
|
|
3153
|
+
return !!base64Data && atob(base64Data).length > 0;
|
|
3154
|
+
} catch (error) {
|
|
3155
|
+
return false;
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
var checkIsImageLink = (url) => {
|
|
3159
|
+
const imageExtensions = /\.(jpg|jpeg|png|gif|bmp|webp|svg|tiff|ico)$/i;
|
|
3160
|
+
return imageExtensions.test(url) || isBase64Image(url);
|
|
3161
|
+
};
|
|
3162
|
+
var formatFileSize = (size) => {
|
|
3163
|
+
if (size < 1024) return `${size} B`;
|
|
3164
|
+
const i = Math.floor(Math.log(size) / Math.log(1024));
|
|
3165
|
+
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
|
3166
|
+
return `${(size / Math.pow(1024, i)).toFixed(2)} ${sizes[i]}`;
|
|
3167
|
+
};
|
|
3168
|
+
var getSubdomain = (url = window.location.href) => {
|
|
3169
|
+
const parts = url?.split(".");
|
|
3170
|
+
if (parts.length > 2) {
|
|
3171
|
+
return parts[0].replace("https://", "").replace("http://", "");
|
|
3172
|
+
}
|
|
3173
|
+
return null;
|
|
3174
|
+
};
|
|
3175
|
+
var resequence = (arr, start, end) => {
|
|
3176
|
+
if (start < 0 || start >= arr.length || end < 0 || end >= arr.length) {
|
|
3177
|
+
return [];
|
|
3178
|
+
}
|
|
3179
|
+
const [element] = arr.splice(start, 1);
|
|
3180
|
+
arr.splice(end, 0, element);
|
|
3181
|
+
return arr.slice(Math.min(start, end), Math.max(start, end) + 1);
|
|
3182
|
+
};
|
|
3183
|
+
var getOffSet = (arr, start, end) => {
|
|
3184
|
+
if (start < 0 || start >= arr.length || end < 0 || end >= arr.length) {
|
|
3185
|
+
return 0;
|
|
3186
|
+
}
|
|
3187
|
+
if (start > end) {
|
|
3188
|
+
return end;
|
|
3189
|
+
}
|
|
3190
|
+
return arr.slice(0, start).length;
|
|
3191
|
+
};
|
|
3192
|
+
var copyTextToClipboard = async (text) => {
|
|
3193
|
+
if ("clipboard" in navigator) {
|
|
3194
|
+
return await navigator.clipboard.writeText(text);
|
|
3195
|
+
} else {
|
|
3196
|
+
const textArea = document.createElement("textarea");
|
|
3197
|
+
textArea.value = text;
|
|
3198
|
+
textArea.style.position = "fixed";
|
|
3199
|
+
document.body.appendChild(textArea);
|
|
3200
|
+
textArea.focus();
|
|
3201
|
+
textArea.select();
|
|
3202
|
+
try {
|
|
3203
|
+
document.execCommand("copy");
|
|
3204
|
+
} finally {
|
|
3205
|
+
document.body.removeChild(textArea);
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
};
|
|
2278
3209
|
var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
2279
3210
|
if (!originalRequest.data) return originalRequest.data;
|
|
2280
3211
|
if (typeof originalRequest.data === "string") {
|
|
@@ -2294,6 +3225,41 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
2294
3225
|
}
|
|
2295
3226
|
return originalRequest.data;
|
|
2296
3227
|
};
|
|
3228
|
+
var isObjectEmpty = (obj) => {
|
|
3229
|
+
return Object.keys(obj).length === 0;
|
|
3230
|
+
};
|
|
3231
|
+
var useField = (props) => {
|
|
3232
|
+
const [invisible, setInvisible] = (0, import_react.useState)(true);
|
|
3233
|
+
const [required, setRequired] = (0, import_react.useState)(false);
|
|
3234
|
+
const [readonly, setReadOnly] = (0, import_react.useState)(false);
|
|
3235
|
+
const {
|
|
3236
|
+
invisible: inv,
|
|
3237
|
+
required: req,
|
|
3238
|
+
readonly: rea,
|
|
3239
|
+
onchangeData,
|
|
3240
|
+
rootField,
|
|
3241
|
+
index,
|
|
3242
|
+
name
|
|
3243
|
+
} = props;
|
|
3244
|
+
const nameField = rootField ? `${rootField?.name}.${index}.${name}` : null;
|
|
3245
|
+
(0, import_react.useEffect)(() => {
|
|
3246
|
+
if (onchangeData && Object.keys(onchangeData).length > 0) {
|
|
3247
|
+
setRequired(
|
|
3248
|
+
typeof req === "object" ? matchDomains(onchangeData, req) : checkDomain(onchangeData, req)
|
|
3249
|
+
);
|
|
3250
|
+
setInvisible(matchDomains(onchangeData, inv));
|
|
3251
|
+
setReadOnly(
|
|
3252
|
+
typeof req === "object" ? matchDomains(onchangeData, rea) : checkDomain(onchangeData, rea)
|
|
3253
|
+
);
|
|
3254
|
+
}
|
|
3255
|
+
}, [onchangeData]);
|
|
3256
|
+
return {
|
|
3257
|
+
invisible,
|
|
3258
|
+
required,
|
|
3259
|
+
readonly,
|
|
3260
|
+
nameField
|
|
3261
|
+
};
|
|
3262
|
+
};
|
|
2297
3263
|
|
|
2298
3264
|
// src/utils/storage/local-storage.ts
|
|
2299
3265
|
var localStorageUtils = () => {
|
|
@@ -2335,9 +3301,9 @@ var sessionStorageUtils = () => {
|
|
|
2335
3301
|
// src/configs/axios-client.ts
|
|
2336
3302
|
var axiosClient = {
|
|
2337
3303
|
init(config) {
|
|
2338
|
-
const localStorage2 = config
|
|
2339
|
-
const sessionStorage2 = config
|
|
2340
|
-
const db = config
|
|
3304
|
+
const localStorage2 = config.localStorageUtils ?? localStorageUtils();
|
|
3305
|
+
const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
|
|
3306
|
+
const db = config.db;
|
|
2341
3307
|
let isRefreshing = false;
|
|
2342
3308
|
let failedQueue = [];
|
|
2343
3309
|
const processQueue = (error, token = null) => {
|
|
@@ -2356,19 +3322,16 @@ var axiosClient = {
|
|
|
2356
3322
|
timeout: 5e4,
|
|
2357
3323
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2358
3324
|
});
|
|
2359
|
-
instance.interceptors.request.use(
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
Promise.reject(error);
|
|
2370
|
-
}
|
|
2371
|
-
);
|
|
3325
|
+
instance.interceptors.request.use(async (config2) => {
|
|
3326
|
+
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
3327
|
+
if (useActionToken && actionToken) {
|
|
3328
|
+
config2.headers["Action-Token"] = actionToken;
|
|
3329
|
+
}
|
|
3330
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
3331
|
+
const token = await getToken?.();
|
|
3332
|
+
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
3333
|
+
return config2;
|
|
3334
|
+
}, Promise.reject);
|
|
2372
3335
|
instance.interceptors.response.use(
|
|
2373
3336
|
(response) => {
|
|
2374
3337
|
return handleResponse(response);
|
|
@@ -2526,6 +3489,7 @@ var breadcrumbsSlice = (0, import_toolkit.createSlice)({
|
|
|
2526
3489
|
}
|
|
2527
3490
|
});
|
|
2528
3491
|
var { setBreadCrumbs } = breadcrumbsSlice.actions;
|
|
3492
|
+
var selectBreadCrumbs = (state) => state.breadcrumbs;
|
|
2529
3493
|
var breadcrums_slice_default = breadcrumbsSlice.reducer;
|
|
2530
3494
|
|
|
2531
3495
|
// src/store/reducers/env-slice/index.ts
|
|
@@ -2594,6 +3558,7 @@ var {
|
|
|
2594
3558
|
setConfig,
|
|
2595
3559
|
setEnvFile
|
|
2596
3560
|
} = envSlice.actions;
|
|
3561
|
+
var selectEnv = (state) => state.env;
|
|
2597
3562
|
var env_slice_default = envSlice.reducer;
|
|
2598
3563
|
|
|
2599
3564
|
// src/store/reducers/excel-slice/index.ts
|
|
@@ -2638,6 +3603,7 @@ var {
|
|
|
2638
3603
|
setSelectedFile,
|
|
2639
3604
|
setErrorData
|
|
2640
3605
|
} = excelSlice.actions;
|
|
3606
|
+
var selectExcel = (state) => state.excel;
|
|
2641
3607
|
var excel_slice_default = excelSlice.reducer;
|
|
2642
3608
|
|
|
2643
3609
|
// src/store/reducers/form-slice/index.ts
|
|
@@ -2687,6 +3653,7 @@ var {
|
|
|
2687
3653
|
setListSubject,
|
|
2688
3654
|
setDataUser
|
|
2689
3655
|
} = formSlice.actions;
|
|
3656
|
+
var selectForm = (state) => state.form;
|
|
2690
3657
|
var form_slice_default = formSlice.reducer;
|
|
2691
3658
|
|
|
2692
3659
|
// src/store/reducers/header-slice/index.ts
|
|
@@ -2706,6 +3673,7 @@ var headerSlice = (0, import_toolkit5.createSlice)({
|
|
|
2706
3673
|
}
|
|
2707
3674
|
});
|
|
2708
3675
|
var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
|
|
3676
|
+
var selectHeader = (state) => state.header;
|
|
2709
3677
|
var header_slice_default = headerSlice.reducer;
|
|
2710
3678
|
|
|
2711
3679
|
// src/store/reducers/list-slice/index.ts
|
|
@@ -2771,6 +3739,7 @@ var {
|
|
|
2771
3739
|
setTransferDetail,
|
|
2772
3740
|
setDomainTable
|
|
2773
3741
|
} = listSlice.actions;
|
|
3742
|
+
var selectList = (state) => state.list;
|
|
2774
3743
|
var list_slice_default = listSlice.reducer;
|
|
2775
3744
|
|
|
2776
3745
|
// src/store/reducers/login-slice/index.ts
|
|
@@ -2796,6 +3765,7 @@ var loginSlice = (0, import_toolkit7.createSlice)({
|
|
|
2796
3765
|
}
|
|
2797
3766
|
});
|
|
2798
3767
|
var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
|
|
3768
|
+
var selectLogin = (state) => state.login;
|
|
2799
3769
|
var login_slice_default = loginSlice.reducer;
|
|
2800
3770
|
|
|
2801
3771
|
// src/store/reducers/navbar-slice/index.ts
|
|
@@ -2825,6 +3795,7 @@ var navbarSlice = (0, import_toolkit8.createSlice)({
|
|
|
2825
3795
|
}
|
|
2826
3796
|
});
|
|
2827
3797
|
var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSlice.actions;
|
|
3798
|
+
var selectNavbar = (state) => state.navbar;
|
|
2828
3799
|
var navbar_slice_default = navbarSlice.reducer;
|
|
2829
3800
|
|
|
2830
3801
|
// src/store/reducers/profile-slice/index.ts
|
|
@@ -2842,6 +3813,7 @@ var profileSlice = (0, import_toolkit9.createSlice)({
|
|
|
2842
3813
|
}
|
|
2843
3814
|
});
|
|
2844
3815
|
var { setProfile } = profileSlice.actions;
|
|
3816
|
+
var selectProfile = (state) => state.profile;
|
|
2845
3817
|
var profile_slice_default = profileSlice.reducer;
|
|
2846
3818
|
|
|
2847
3819
|
// src/store/reducers/search-slice/index.ts
|
|
@@ -2928,6 +3900,8 @@ var {
|
|
|
2928
3900
|
setGroupBy,
|
|
2929
3901
|
clearSearchMap
|
|
2930
3902
|
} = searchSlice.actions;
|
|
3903
|
+
var selectSearch = (state) => state.search;
|
|
3904
|
+
var selectSearchMap = (state) => state.search.searchMap;
|
|
2931
3905
|
var search_slice_default = searchSlice.reducer;
|
|
2932
3906
|
|
|
2933
3907
|
// src/store/store.ts
|
|
@@ -3122,78 +4096,102 @@ var envStore = (0, import_toolkit11.configureStore)({
|
|
|
3122
4096
|
})
|
|
3123
4097
|
});
|
|
3124
4098
|
|
|
4099
|
+
// src/store/index.ts
|
|
4100
|
+
var useAppDispatch = import_react_redux.useDispatch;
|
|
4101
|
+
var useAppSelector = import_react_redux.useSelector;
|
|
4102
|
+
|
|
3125
4103
|
// src/environment/EnvStore.ts
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
4104
|
+
var EnvStore = class {
|
|
4105
|
+
envStore;
|
|
4106
|
+
baseUrl;
|
|
4107
|
+
requests;
|
|
4108
|
+
context;
|
|
4109
|
+
defaultCompany;
|
|
4110
|
+
config;
|
|
4111
|
+
companies;
|
|
4112
|
+
user;
|
|
4113
|
+
db;
|
|
4114
|
+
localStorageUtils;
|
|
4115
|
+
sessionStorageUtils;
|
|
4116
|
+
refreshTokenEndpoint;
|
|
4117
|
+
constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
|
|
4118
|
+
this.envStore = envStore2;
|
|
4119
|
+
this.localStorageUtils = localStorageUtils2;
|
|
4120
|
+
this.sessionStorageUtils = sessionStorageUtils2;
|
|
4121
|
+
this.setup();
|
|
4122
|
+
}
|
|
4123
|
+
setup() {
|
|
4124
|
+
const env2 = this.envStore.getState().env;
|
|
4125
|
+
this.baseUrl = env2?.baseUrl;
|
|
4126
|
+
this.requests = env2?.requests;
|
|
4127
|
+
this.context = env2?.context;
|
|
4128
|
+
this.defaultCompany = env2?.defaultCompany;
|
|
4129
|
+
this.config = env2?.config;
|
|
4130
|
+
this.companies = env2?.companies || [];
|
|
4131
|
+
this.user = env2?.user;
|
|
4132
|
+
this.db = env2?.db;
|
|
4133
|
+
this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
|
|
4134
|
+
}
|
|
4135
|
+
setupEnv(envConfig) {
|
|
4136
|
+
const dispatch = this.envStore.dispatch;
|
|
4137
|
+
const env2 = {
|
|
3145
4138
|
...envConfig,
|
|
3146
|
-
localStorageUtils:
|
|
3147
|
-
sessionStorageUtils:
|
|
4139
|
+
localStorageUtils: this.localStorageUtils,
|
|
4140
|
+
sessionStorageUtils: this.sessionStorageUtils
|
|
3148
4141
|
};
|
|
3149
|
-
const requests = axiosClient.init(
|
|
3150
|
-
dispatch(setEnv({ ...
|
|
3151
|
-
|
|
3152
|
-
}
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
}
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
setDefaultCompany: setupDefaultCompany,
|
|
3185
|
-
setUserInfo
|
|
3186
|
-
};
|
|
3187
|
-
}
|
|
4142
|
+
const requests = axiosClient.init(env2);
|
|
4143
|
+
dispatch(setEnv({ ...env2, requests }));
|
|
4144
|
+
this.setup();
|
|
4145
|
+
}
|
|
4146
|
+
setUid(uid) {
|
|
4147
|
+
const dispatch = this.envStore.dispatch;
|
|
4148
|
+
dispatch(setUid(uid));
|
|
4149
|
+
this.setup();
|
|
4150
|
+
}
|
|
4151
|
+
setLang(lang) {
|
|
4152
|
+
const dispatch = this.envStore.dispatch;
|
|
4153
|
+
dispatch(setLang(lang));
|
|
4154
|
+
this.setup();
|
|
4155
|
+
}
|
|
4156
|
+
setAllowCompanies(allowCompanies) {
|
|
4157
|
+
const dispatch = this.envStore.dispatch;
|
|
4158
|
+
dispatch(setAllowCompanies(allowCompanies));
|
|
4159
|
+
this.setup();
|
|
4160
|
+
}
|
|
4161
|
+
setCompanies(companies) {
|
|
4162
|
+
const dispatch = this.envStore.dispatch;
|
|
4163
|
+
dispatch(setCompanies(companies));
|
|
4164
|
+
this.setup();
|
|
4165
|
+
}
|
|
4166
|
+
setDefaultCompany(company) {
|
|
4167
|
+
const dispatch = this.envStore.dispatch;
|
|
4168
|
+
dispatch(setDefaultCompany(company));
|
|
4169
|
+
this.setup();
|
|
4170
|
+
}
|
|
4171
|
+
setUserInfo(userInfo) {
|
|
4172
|
+
const dispatch = this.envStore.dispatch;
|
|
4173
|
+
dispatch(setUser(userInfo));
|
|
4174
|
+
this.setup();
|
|
4175
|
+
}
|
|
4176
|
+
};
|
|
3188
4177
|
var env = null;
|
|
4178
|
+
function initEnv({
|
|
4179
|
+
localStorageUtils: localStorageUtils2,
|
|
4180
|
+
sessionStorageUtils: sessionStorageUtils2
|
|
4181
|
+
}) {
|
|
4182
|
+
env = new EnvStore(envStore, localStorageUtils2, sessionStorageUtils2);
|
|
4183
|
+
return env;
|
|
4184
|
+
}
|
|
3189
4185
|
function getEnv() {
|
|
3190
|
-
if (!env)
|
|
3191
|
-
env =
|
|
3192
|
-
}
|
|
4186
|
+
if (!env)
|
|
4187
|
+
env = new EnvStore(envStore, localStorageUtils(), sessionStorageUtils());
|
|
3193
4188
|
return env;
|
|
3194
4189
|
}
|
|
3195
4190
|
|
|
3196
|
-
// src/
|
|
4191
|
+
// src/hooks/auth/use-forgot-password.ts
|
|
4192
|
+
var import_react_query = require("@tanstack/react-query");
|
|
4193
|
+
|
|
4194
|
+
// src/services/action-service/index.ts
|
|
3197
4195
|
var ActionService = {
|
|
3198
4196
|
// Load Action
|
|
3199
4197
|
async loadAction({
|
|
@@ -3455,6 +4453,20 @@ var AuthService = {
|
|
|
3455
4453
|
}
|
|
3456
4454
|
});
|
|
3457
4455
|
},
|
|
4456
|
+
async isValidActionToken(actionToken, path) {
|
|
4457
|
+
const env2 = getEnv();
|
|
4458
|
+
return env2?.requests?.post(
|
|
4459
|
+
path,
|
|
4460
|
+
{},
|
|
4461
|
+
{
|
|
4462
|
+
headers: {
|
|
4463
|
+
"Content-Type": "application/json"
|
|
4464
|
+
},
|
|
4465
|
+
useActionToken: true,
|
|
4466
|
+
actionToken
|
|
4467
|
+
}
|
|
4468
|
+
);
|
|
4469
|
+
},
|
|
3458
4470
|
async loginSocial({
|
|
3459
4471
|
db,
|
|
3460
4472
|
state,
|
|
@@ -4219,7 +5231,7 @@ var model_service_default = ModelService;
|
|
|
4219
5231
|
var UserService = {
|
|
4220
5232
|
async getProfile(path) {
|
|
4221
5233
|
const env2 = getEnv();
|
|
4222
|
-
return env2
|
|
5234
|
+
return env2?.requests?.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
4223
5235
|
headers: {
|
|
4224
5236
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
4225
5237
|
}
|
|
@@ -4538,8 +5550,7 @@ var ViewService = {
|
|
|
4538
5550
|
},
|
|
4539
5551
|
async getVersion() {
|
|
4540
5552
|
const env2 = getEnv();
|
|
4541
|
-
|
|
4542
|
-
return env2?.requests?.get("", {
|
|
5553
|
+
return env2?.requests.get("", {
|
|
4543
5554
|
headers: {
|
|
4544
5555
|
"Content-Type": "application/json"
|
|
4545
5556
|
}
|
|
@@ -4856,26 +5867,40 @@ var useGetAccessByCode = () => {
|
|
|
4856
5867
|
};
|
|
4857
5868
|
var use_get_access_by_code_default = useGetAccessByCode;
|
|
4858
5869
|
|
|
4859
|
-
// src/hooks/
|
|
5870
|
+
// src/hooks/auth/use-validate-action-token.ts
|
|
4860
5871
|
var import_react_query12 = require("@tanstack/react-query");
|
|
4861
|
-
var
|
|
5872
|
+
var useValidateActionToken = () => {
|
|
4862
5873
|
return (0, import_react_query12.useMutation)({
|
|
5874
|
+
mutationFn: ({
|
|
5875
|
+
actionToken,
|
|
5876
|
+
path
|
|
5877
|
+
}) => {
|
|
5878
|
+
return auth_service_default.isValidActionToken(actionToken, path);
|
|
5879
|
+
}
|
|
5880
|
+
});
|
|
5881
|
+
};
|
|
5882
|
+
var use_validate_action_token_default = useValidateActionToken;
|
|
5883
|
+
|
|
5884
|
+
// src/hooks/company/use-get-company-info.ts
|
|
5885
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
5886
|
+
var useGetCompanyInfo = () => {
|
|
5887
|
+
return (0, import_react_query13.useMutation)({
|
|
4863
5888
|
mutationFn: (id) => company_service_default.getInfoCompany(id)
|
|
4864
5889
|
});
|
|
4865
5890
|
};
|
|
4866
5891
|
var use_get_company_info_default = useGetCompanyInfo;
|
|
4867
5892
|
|
|
4868
5893
|
// src/hooks/company/use-get-current-company.ts
|
|
4869
|
-
var
|
|
5894
|
+
var import_react_query14 = require("@tanstack/react-query");
|
|
4870
5895
|
var useGetCurrentCompany = () => {
|
|
4871
|
-
return (0,
|
|
5896
|
+
return (0, import_react_query14.useMutation)({
|
|
4872
5897
|
mutationFn: () => company_service_default.getCurrentCompany()
|
|
4873
5898
|
});
|
|
4874
5899
|
};
|
|
4875
5900
|
var use_get_current_company_default = useGetCurrentCompany;
|
|
4876
5901
|
|
|
4877
5902
|
// src/hooks/company/use-get-list-company.ts
|
|
4878
|
-
var
|
|
5903
|
+
var import_react_query15 = require("@tanstack/react-query");
|
|
4879
5904
|
var useGetListCompany = (companyIDs = []) => {
|
|
4880
5905
|
const companySpec = {
|
|
4881
5906
|
id: {},
|
|
@@ -4886,7 +5911,7 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4886
5911
|
ids: companyIDs,
|
|
4887
5912
|
specification: companySpec
|
|
4888
5913
|
};
|
|
4889
|
-
return (0,
|
|
5914
|
+
return (0, import_react_query15.useQuery)({
|
|
4890
5915
|
queryKey: ["list_company" /* LIST_COMPANY */, companyIDs],
|
|
4891
5916
|
queryFn: () => model_service_default.getList(getListParams),
|
|
4892
5917
|
refetchOnWindowFocus: false
|
|
@@ -4895,9 +5920,9 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4895
5920
|
var use_get_list_company_default = useGetListCompany;
|
|
4896
5921
|
|
|
4897
5922
|
// src/hooks/excel/use-export-excel.ts
|
|
4898
|
-
var
|
|
5923
|
+
var import_react_query16 = require("@tanstack/react-query");
|
|
4899
5924
|
var useExportExcel = () => {
|
|
4900
|
-
return (0,
|
|
5925
|
+
return (0, import_react_query16.useMutation)({
|
|
4901
5926
|
mutationFn: ({
|
|
4902
5927
|
model,
|
|
4903
5928
|
domain,
|
|
@@ -4922,9 +5947,9 @@ var useExportExcel = () => {
|
|
|
4922
5947
|
var use_export_excel_default = useExportExcel;
|
|
4923
5948
|
|
|
4924
5949
|
// src/hooks/excel/use-get-field-export.ts
|
|
4925
|
-
var
|
|
5950
|
+
var import_react_query17 = require("@tanstack/react-query");
|
|
4926
5951
|
var useGetFieldExport = () => {
|
|
4927
|
-
return (0,
|
|
5952
|
+
return (0, import_react_query17.useMutation)({
|
|
4928
5953
|
mutationFn: ({
|
|
4929
5954
|
ids,
|
|
4930
5955
|
model,
|
|
@@ -4953,9 +5978,9 @@ var useGetFieldExport = () => {
|
|
|
4953
5978
|
var use_get_field_export_default = useGetFieldExport;
|
|
4954
5979
|
|
|
4955
5980
|
// src/hooks/excel/use-get-file-excel.ts
|
|
4956
|
-
var
|
|
5981
|
+
var import_react_query18 = require("@tanstack/react-query");
|
|
4957
5982
|
var useGetFileExcel = ({ model }) => {
|
|
4958
|
-
return (0,
|
|
5983
|
+
return (0, import_react_query18.useQuery)({
|
|
4959
5984
|
queryKey: [],
|
|
4960
5985
|
queryFn: () => excel_service_default.getFileExcel({
|
|
4961
5986
|
model
|
|
@@ -4971,9 +5996,9 @@ var useGetFileExcel = ({ model }) => {
|
|
|
4971
5996
|
var use_get_file_excel_default = useGetFileExcel;
|
|
4972
5997
|
|
|
4973
5998
|
// src/hooks/excel/use-parse-preview.ts
|
|
4974
|
-
var
|
|
5999
|
+
var import_react_query19 = require("@tanstack/react-query");
|
|
4975
6000
|
var useParsePreview = () => {
|
|
4976
|
-
return (0,
|
|
6001
|
+
return (0, import_react_query19.useMutation)({
|
|
4977
6002
|
mutationFn: ({
|
|
4978
6003
|
id,
|
|
4979
6004
|
selectedSheet,
|
|
@@ -4990,9 +6015,9 @@ var useParsePreview = () => {
|
|
|
4990
6015
|
var use_parse_preview_default = useParsePreview;
|
|
4991
6016
|
|
|
4992
6017
|
// src/hooks/excel/use-upload-file.ts
|
|
4993
|
-
var
|
|
6018
|
+
var import_react_query20 = require("@tanstack/react-query");
|
|
4994
6019
|
var useUploadFile = () => {
|
|
4995
|
-
return (0,
|
|
6020
|
+
return (0, import_react_query20.useMutation)({
|
|
4996
6021
|
mutationFn: ({ formData }) => excel_service_default.uploadFile({
|
|
4997
6022
|
formData
|
|
4998
6023
|
})
|
|
@@ -5001,9 +6026,9 @@ var useUploadFile = () => {
|
|
|
5001
6026
|
var use_upload_file_default = useUploadFile;
|
|
5002
6027
|
|
|
5003
6028
|
// src/hooks/excel/use-upload-id-file.ts
|
|
5004
|
-
var
|
|
6029
|
+
var import_react_query21 = require("@tanstack/react-query");
|
|
5005
6030
|
var useUploadIdFile = () => {
|
|
5006
|
-
return (0,
|
|
6031
|
+
return (0, import_react_query21.useMutation)({
|
|
5007
6032
|
mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
|
|
5008
6033
|
formData
|
|
5009
6034
|
})
|
|
@@ -5012,9 +6037,9 @@ var useUploadIdFile = () => {
|
|
|
5012
6037
|
var use_upload_id_file_default = useUploadIdFile;
|
|
5013
6038
|
|
|
5014
6039
|
// src/hooks/excel/uss-execute-import.ts
|
|
5015
|
-
var
|
|
6040
|
+
var import_react_query22 = require("@tanstack/react-query");
|
|
5016
6041
|
var useExecuteImport = () => {
|
|
5017
|
-
return (0,
|
|
6042
|
+
return (0, import_react_query22.useMutation)({
|
|
5018
6043
|
mutationFn: ({
|
|
5019
6044
|
fields,
|
|
5020
6045
|
columns,
|
|
@@ -5035,9 +6060,9 @@ var useExecuteImport = () => {
|
|
|
5035
6060
|
var uss_execute_import_default = useExecuteImport;
|
|
5036
6061
|
|
|
5037
6062
|
// src/hooks/form/use-change-status.ts
|
|
5038
|
-
var
|
|
6063
|
+
var import_react_query23 = require("@tanstack/react-query");
|
|
5039
6064
|
var useChangeStatus = () => {
|
|
5040
|
-
return (0,
|
|
6065
|
+
return (0, import_react_query23.useMutation)({
|
|
5041
6066
|
mutationFn: ({ data }) => {
|
|
5042
6067
|
return form_service_default.changeStatus({
|
|
5043
6068
|
data
|
|
@@ -5048,9 +6073,9 @@ var useChangeStatus = () => {
|
|
|
5048
6073
|
var use_change_status_default = useChangeStatus;
|
|
5049
6074
|
|
|
5050
6075
|
// src/hooks/form/use-delete-comment.ts
|
|
5051
|
-
var
|
|
6076
|
+
var import_react_query24 = require("@tanstack/react-query");
|
|
5052
6077
|
var useDeleteComment = () => {
|
|
5053
|
-
return (0,
|
|
6078
|
+
return (0, import_react_query24.useMutation)({
|
|
5054
6079
|
mutationFn: ({ data }) => form_service_default.deleteComment({
|
|
5055
6080
|
data
|
|
5056
6081
|
})
|
|
@@ -5059,9 +6084,9 @@ var useDeleteComment = () => {
|
|
|
5059
6084
|
var use_delete_comment_default = useDeleteComment;
|
|
5060
6085
|
|
|
5061
6086
|
// src/hooks/form/use-get-comment.ts
|
|
5062
|
-
var
|
|
6087
|
+
var import_react_query25 = require("@tanstack/react-query");
|
|
5063
6088
|
var useGetComment = ({ data, queryKey }) => {
|
|
5064
|
-
return (0,
|
|
6089
|
+
return (0, import_react_query25.useQuery)({
|
|
5065
6090
|
queryKey,
|
|
5066
6091
|
queryFn: () => form_service_default.getComment({ data }).then((res) => {
|
|
5067
6092
|
if (res) {
|
|
@@ -5075,13 +6100,13 @@ var useGetComment = ({ data, queryKey }) => {
|
|
|
5075
6100
|
var use_get_comment_default = useGetComment;
|
|
5076
6101
|
|
|
5077
6102
|
// src/hooks/form/use-get-form-view.ts
|
|
5078
|
-
var
|
|
6103
|
+
var import_react_query26 = require("@tanstack/react-query");
|
|
5079
6104
|
var useGetFormView = ({
|
|
5080
6105
|
data,
|
|
5081
6106
|
queryKey,
|
|
5082
6107
|
enabled
|
|
5083
6108
|
}) => {
|
|
5084
|
-
return (0,
|
|
6109
|
+
return (0, import_react_query26.useQuery)({
|
|
5085
6110
|
queryKey,
|
|
5086
6111
|
queryFn: () => form_service_default.getFormView({ data }).then((res) => {
|
|
5087
6112
|
if (res) {
|
|
@@ -5095,13 +6120,13 @@ var useGetFormView = ({
|
|
|
5095
6120
|
var use_get_form_view_default = useGetFormView;
|
|
5096
6121
|
|
|
5097
6122
|
// src/hooks/form/use-get-image.ts
|
|
5098
|
-
var
|
|
6123
|
+
var import_react_query27 = require("@tanstack/react-query");
|
|
5099
6124
|
var useGetImage = ({
|
|
5100
6125
|
data,
|
|
5101
6126
|
queryKey,
|
|
5102
6127
|
src
|
|
5103
6128
|
}) => {
|
|
5104
|
-
return (0,
|
|
6129
|
+
return (0, import_react_query27.useQuery)({
|
|
5105
6130
|
queryKey,
|
|
5106
6131
|
queryFn: () => form_service_default.getImage({ data }).then((res) => {
|
|
5107
6132
|
if (res) {
|
|
@@ -5115,9 +6140,9 @@ var useGetImage = ({
|
|
|
5115
6140
|
var use_get_image_default = useGetImage;
|
|
5116
6141
|
|
|
5117
6142
|
// src/hooks/form/use-send-comment.ts
|
|
5118
|
-
var
|
|
6143
|
+
var import_react_query28 = require("@tanstack/react-query");
|
|
5119
6144
|
var useSendComment = () => {
|
|
5120
|
-
return (0,
|
|
6145
|
+
return (0, import_react_query28.useMutation)({
|
|
5121
6146
|
mutationFn: ({ data }) => form_service_default.sentComment({
|
|
5122
6147
|
data
|
|
5123
6148
|
})
|
|
@@ -5126,9 +6151,9 @@ var useSendComment = () => {
|
|
|
5126
6151
|
var use_send_comment_default = useSendComment;
|
|
5127
6152
|
|
|
5128
6153
|
// src/hooks/form/use-upload-image.ts
|
|
5129
|
-
var
|
|
6154
|
+
var import_react_query29 = require("@tanstack/react-query");
|
|
5130
6155
|
var useUploadImage = () => {
|
|
5131
|
-
return (0,
|
|
6156
|
+
return (0, import_react_query29.useMutation)({
|
|
5132
6157
|
mutationFn: ({ data }) => form_service_default.uploadImage({
|
|
5133
6158
|
data
|
|
5134
6159
|
})
|
|
@@ -5137,18 +6162,18 @@ var useUploadImage = () => {
|
|
|
5137
6162
|
var use_upload_image_default = useUploadImage;
|
|
5138
6163
|
|
|
5139
6164
|
// src/hooks/model/use-delete.ts
|
|
5140
|
-
var
|
|
6165
|
+
var import_react_query30 = require("@tanstack/react-query");
|
|
5141
6166
|
var useDelete = () => {
|
|
5142
|
-
return (0,
|
|
6167
|
+
return (0, import_react_query30.useMutation)({
|
|
5143
6168
|
mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
|
|
5144
6169
|
});
|
|
5145
6170
|
};
|
|
5146
6171
|
var use_delete_default = useDelete;
|
|
5147
6172
|
|
|
5148
6173
|
// src/hooks/model/use-get-all.ts
|
|
5149
|
-
var
|
|
6174
|
+
var import_react_query31 = require("@tanstack/react-query");
|
|
5150
6175
|
var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
5151
|
-
return (0,
|
|
6176
|
+
return (0, import_react_query31.useQuery)({
|
|
5152
6177
|
queryKey,
|
|
5153
6178
|
queryFn: () => model_service_default.getAll({ data }).then((res) => {
|
|
5154
6179
|
if (res) {
|
|
@@ -5163,9 +6188,9 @@ var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
|
5163
6188
|
var use_get_all_default = useGetAll;
|
|
5164
6189
|
|
|
5165
6190
|
// src/hooks/model/use-get-conversion-rate.ts
|
|
5166
|
-
var
|
|
6191
|
+
var import_react_query32 = require("@tanstack/react-query");
|
|
5167
6192
|
var useGetConversionRate = () => {
|
|
5168
|
-
return (0,
|
|
6193
|
+
return (0, import_react_query32.useQuery)({
|
|
5169
6194
|
queryKey: ["currency-rate"],
|
|
5170
6195
|
queryFn: () => model_service_default.getConversionRate().then((res) => {
|
|
5171
6196
|
if (res) {
|
|
@@ -5178,9 +6203,9 @@ var useGetConversionRate = () => {
|
|
|
5178
6203
|
var use_get_conversion_rate_default = useGetConversionRate;
|
|
5179
6204
|
|
|
5180
6205
|
// src/hooks/model/use-get-currency.ts
|
|
5181
|
-
var
|
|
6206
|
+
var import_react_query33 = require("@tanstack/react-query");
|
|
5182
6207
|
var useGetCurrency = () => {
|
|
5183
|
-
return (0,
|
|
6208
|
+
return (0, import_react_query33.useQuery)({
|
|
5184
6209
|
queryKey: ["currency"],
|
|
5185
6210
|
queryFn: () => model_service_default.getCurrency().then((res) => {
|
|
5186
6211
|
if (res) {
|
|
@@ -5193,9 +6218,9 @@ var useGetCurrency = () => {
|
|
|
5193
6218
|
var use_get_currency_default = useGetCurrency;
|
|
5194
6219
|
|
|
5195
6220
|
// src/hooks/model/use-get-detail.ts
|
|
5196
|
-
var
|
|
6221
|
+
var import_react_query34 = require("@tanstack/react-query");
|
|
5197
6222
|
var useGetDetail = () => {
|
|
5198
|
-
return (0,
|
|
6223
|
+
return (0, import_react_query34.useMutation)({
|
|
5199
6224
|
mutationFn: ({
|
|
5200
6225
|
model,
|
|
5201
6226
|
ids,
|
|
@@ -5212,9 +6237,9 @@ var useGetDetail = () => {
|
|
|
5212
6237
|
var use_get_detail_default = useGetDetail;
|
|
5213
6238
|
|
|
5214
6239
|
// src/hooks/model/use-get-field-onchange.ts
|
|
5215
|
-
var
|
|
6240
|
+
var import_react_query35 = require("@tanstack/react-query");
|
|
5216
6241
|
var useGetFieldOnChange = ({ model }) => {
|
|
5217
|
-
return (0,
|
|
6242
|
+
return (0, import_react_query35.useQuery)({
|
|
5218
6243
|
queryKey: [`field-onchange-${model}`, model],
|
|
5219
6244
|
queryFn: () => model_service_default.getListFieldsOnchange({
|
|
5220
6245
|
model
|
|
@@ -5230,13 +6255,13 @@ var useGetFieldOnChange = ({ model }) => {
|
|
|
5230
6255
|
var use_get_field_onchange_default = useGetFieldOnChange;
|
|
5231
6256
|
|
|
5232
6257
|
// src/hooks/model/use-get-list-my-bank-account.ts
|
|
5233
|
-
var
|
|
6258
|
+
var import_react_query36 = require("@tanstack/react-query");
|
|
5234
6259
|
var useGetListMyBankAccount = ({
|
|
5235
6260
|
domain,
|
|
5236
6261
|
spectification,
|
|
5237
6262
|
model
|
|
5238
6263
|
}) => {
|
|
5239
|
-
return (0,
|
|
6264
|
+
return (0, import_react_query36.useQuery)({
|
|
5240
6265
|
queryKey: ["bank-account", model, domain],
|
|
5241
6266
|
queryFn: () => model_service_default.getListMyBankAccount({
|
|
5242
6267
|
domain,
|
|
@@ -5388,9 +6413,9 @@ var useOdooDataTransform = () => {
|
|
|
5388
6413
|
var use_odoo_data_transform_default = useOdooDataTransform;
|
|
5389
6414
|
|
|
5390
6415
|
// src/hooks/model/use-onchange-form.ts
|
|
5391
|
-
var
|
|
6416
|
+
var import_react_query37 = require("@tanstack/react-query");
|
|
5392
6417
|
var useOnChangeForm = () => {
|
|
5393
|
-
return (0,
|
|
6418
|
+
return (0, import_react_query37.useMutation)({
|
|
5394
6419
|
mutationFn: ({
|
|
5395
6420
|
ids,
|
|
5396
6421
|
model,
|
|
@@ -5411,9 +6436,9 @@ var useOnChangeForm = () => {
|
|
|
5411
6436
|
var use_onchange_form_default = useOnChangeForm;
|
|
5412
6437
|
|
|
5413
6438
|
// src/hooks/model/use-save.ts
|
|
5414
|
-
var
|
|
6439
|
+
var import_react_query38 = require("@tanstack/react-query");
|
|
5415
6440
|
var useSave = () => {
|
|
5416
|
-
return (0,
|
|
6441
|
+
return (0, import_react_query38.useMutation)({
|
|
5417
6442
|
mutationFn: ({
|
|
5418
6443
|
ids,
|
|
5419
6444
|
model,
|
|
@@ -5427,18 +6452,18 @@ var useSave = () => {
|
|
|
5427
6452
|
var use_save_default = useSave;
|
|
5428
6453
|
|
|
5429
6454
|
// src/hooks/user/use-get-profile.ts
|
|
5430
|
-
var
|
|
6455
|
+
var import_react_query39 = require("@tanstack/react-query");
|
|
5431
6456
|
var useGetProfile = (path) => {
|
|
5432
|
-
return (0,
|
|
6457
|
+
return (0, import_react_query39.useMutation)({
|
|
5433
6458
|
mutationFn: () => user_service_default.getProfile(path)
|
|
5434
6459
|
});
|
|
5435
6460
|
};
|
|
5436
6461
|
var use_get_profile_default = useGetProfile;
|
|
5437
6462
|
|
|
5438
6463
|
// src/hooks/user/use-get-user.ts
|
|
5439
|
-
var
|
|
6464
|
+
var import_react_query40 = require("@tanstack/react-query");
|
|
5440
6465
|
var useGetUser = () => {
|
|
5441
|
-
return (0,
|
|
6466
|
+
return (0, import_react_query40.useMutation)({
|
|
5442
6467
|
mutationFn: ({ id, context }) => user_service_default.getUser({
|
|
5443
6468
|
id,
|
|
5444
6469
|
context
|
|
@@ -5448,9 +6473,9 @@ var useGetUser = () => {
|
|
|
5448
6473
|
var use_get_user_default = useGetUser;
|
|
5449
6474
|
|
|
5450
6475
|
// src/hooks/user/use-switch-locale.ts
|
|
5451
|
-
var
|
|
6476
|
+
var import_react_query41 = require("@tanstack/react-query");
|
|
5452
6477
|
var useSwitchLocale = () => {
|
|
5453
|
-
return (0,
|
|
6478
|
+
return (0, import_react_query41.useMutation)({
|
|
5454
6479
|
mutationFn: ({ data }) => {
|
|
5455
6480
|
return user_service_default.switchUserLocale({
|
|
5456
6481
|
id: data.id,
|
|
@@ -5462,9 +6487,9 @@ var useSwitchLocale = () => {
|
|
|
5462
6487
|
var use_switch_locale_default = useSwitchLocale;
|
|
5463
6488
|
|
|
5464
6489
|
// src/hooks/view/use-button.ts
|
|
5465
|
-
var
|
|
6490
|
+
var import_react_query42 = require("@tanstack/react-query");
|
|
5466
6491
|
var useButton = () => {
|
|
5467
|
-
return (0,
|
|
6492
|
+
return (0, import_react_query42.useMutation)({
|
|
5468
6493
|
mutationFn: ({
|
|
5469
6494
|
model,
|
|
5470
6495
|
ids,
|
|
@@ -5484,9 +6509,9 @@ var useButton = () => {
|
|
|
5484
6509
|
var use_button_default = useButton;
|
|
5485
6510
|
|
|
5486
6511
|
// src/hooks/view/use-duplicate-record.ts
|
|
5487
|
-
var
|
|
6512
|
+
var import_react_query43 = require("@tanstack/react-query");
|
|
5488
6513
|
var useDuplicateRecord = () => {
|
|
5489
|
-
return (0,
|
|
6514
|
+
return (0, import_react_query43.useMutation)({
|
|
5490
6515
|
mutationFn: ({
|
|
5491
6516
|
id,
|
|
5492
6517
|
model,
|
|
@@ -5501,7 +6526,7 @@ var useDuplicateRecord = () => {
|
|
|
5501
6526
|
var use_duplicate_record_default = useDuplicateRecord;
|
|
5502
6527
|
|
|
5503
6528
|
// src/hooks/view/use-get-action-detail.ts
|
|
5504
|
-
var
|
|
6529
|
+
var import_react_query44 = require("@tanstack/react-query");
|
|
5505
6530
|
var useGetActionDetail = ({
|
|
5506
6531
|
aid,
|
|
5507
6532
|
context,
|
|
@@ -5515,7 +6540,7 @@ var useGetActionDetail = ({
|
|
|
5515
6540
|
model: model ?? "",
|
|
5516
6541
|
context
|
|
5517
6542
|
};
|
|
5518
|
-
return (0,
|
|
6543
|
+
return (0, import_react_query44.useQuery)({
|
|
5519
6544
|
queryKey,
|
|
5520
6545
|
queryFn: async () => {
|
|
5521
6546
|
if (aid) {
|
|
@@ -5536,9 +6561,9 @@ var useGetActionDetail = ({
|
|
|
5536
6561
|
var use_get_action_detail_default = useGetActionDetail;
|
|
5537
6562
|
|
|
5538
6563
|
// src/hooks/view/use-get-calendar.ts
|
|
5539
|
-
var
|
|
6564
|
+
var import_react_query45 = require("@tanstack/react-query");
|
|
5540
6565
|
var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
5541
|
-
return (0,
|
|
6566
|
+
return (0, import_react_query45.useQuery)({
|
|
5542
6567
|
queryKey,
|
|
5543
6568
|
queryFn: () => model_service_default.getListCalendar({ data: listDataProps }).then((res) => {
|
|
5544
6569
|
if (res) {
|
|
@@ -5554,12 +6579,12 @@ var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
|
5554
6579
|
var use_get_calendar_default = useGetCalendar;
|
|
5555
6580
|
|
|
5556
6581
|
// src/hooks/view/use-get-groups.ts
|
|
5557
|
-
var
|
|
6582
|
+
var import_react_query46 = require("@tanstack/react-query");
|
|
5558
6583
|
var useGetGroups = ({
|
|
5559
6584
|
model,
|
|
5560
6585
|
width_context
|
|
5561
6586
|
}) => {
|
|
5562
|
-
return (0,
|
|
6587
|
+
return (0, import_react_query46.useQuery)({
|
|
5563
6588
|
queryKey: [model, width_context],
|
|
5564
6589
|
queryFn: () => kanban_service_default.getGroups({
|
|
5565
6590
|
model,
|
|
@@ -5576,9 +6601,9 @@ var useGetGroups = ({
|
|
|
5576
6601
|
var use_get_groups_default = useGetGroups;
|
|
5577
6602
|
|
|
5578
6603
|
// src/hooks/view/use-get-list-data.ts
|
|
5579
|
-
var
|
|
6604
|
+
var import_react_query47 = require("@tanstack/react-query");
|
|
5580
6605
|
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
5581
|
-
return (0,
|
|
6606
|
+
return (0, import_react_query47.useQuery)({
|
|
5582
6607
|
queryKey,
|
|
5583
6608
|
queryFn: () => model_service_default.getAll({ data: listDataProps }).then((res) => {
|
|
5584
6609
|
if (res) {
|
|
@@ -5594,9 +6619,9 @@ var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
|
5594
6619
|
var use_get_list_data_default = useGetListData;
|
|
5595
6620
|
|
|
5596
6621
|
// src/hooks/view/use-get-menu.ts
|
|
5597
|
-
var
|
|
6622
|
+
var import_react_query48 = require("@tanstack/react-query");
|
|
5598
6623
|
var useGetMenu = (context, enabled) => {
|
|
5599
|
-
return (0,
|
|
6624
|
+
return (0, import_react_query48.useQuery)({
|
|
5600
6625
|
queryKey: ["menus" /* MENU */, context],
|
|
5601
6626
|
queryFn: () => view_service_default.getMenu(context).then((res) => {
|
|
5602
6627
|
if (res && res?.records && res?.records?.length > 0) {
|
|
@@ -5612,9 +6637,9 @@ var useGetMenu = (context, enabled) => {
|
|
|
5612
6637
|
var use_get_menu_default = useGetMenu;
|
|
5613
6638
|
|
|
5614
6639
|
// src/hooks/view/use-get-print-report.ts
|
|
5615
|
-
var
|
|
6640
|
+
var import_react_query49 = require("@tanstack/react-query");
|
|
5616
6641
|
var useGetPrintReport = () => {
|
|
5617
|
-
return (0,
|
|
6642
|
+
return (0, import_react_query49.useMutation)({
|
|
5618
6643
|
mutationFn: ({ id }) => action_service_default.getPrintReportName({
|
|
5619
6644
|
id
|
|
5620
6645
|
})
|
|
@@ -5623,14 +6648,14 @@ var useGetPrintReport = () => {
|
|
|
5623
6648
|
var use_get_print_report_default = useGetPrintReport;
|
|
5624
6649
|
|
|
5625
6650
|
// src/hooks/view/use-get-progress-bar.ts
|
|
5626
|
-
var
|
|
6651
|
+
var import_react_query50 = require("@tanstack/react-query");
|
|
5627
6652
|
var useGetProGressBar = ({
|
|
5628
6653
|
field,
|
|
5629
6654
|
color,
|
|
5630
6655
|
model,
|
|
5631
6656
|
width_context
|
|
5632
6657
|
}) => {
|
|
5633
|
-
return (0,
|
|
6658
|
+
return (0, import_react_query50.useQuery)({
|
|
5634
6659
|
queryKey: [],
|
|
5635
6660
|
queryFn: () => kanban_service_default.getProgressBar({
|
|
5636
6661
|
field,
|
|
@@ -5649,13 +6674,13 @@ var useGetProGressBar = ({
|
|
|
5649
6674
|
var use_get_progress_bar_default = useGetProGressBar;
|
|
5650
6675
|
|
|
5651
6676
|
// src/hooks/view/use-get-selection.ts
|
|
5652
|
-
var
|
|
6677
|
+
var import_react_query51 = require("@tanstack/react-query");
|
|
5653
6678
|
var useGetSelection = ({
|
|
5654
6679
|
data,
|
|
5655
6680
|
queryKey,
|
|
5656
6681
|
enabled
|
|
5657
6682
|
}) => {
|
|
5658
|
-
return (0,
|
|
6683
|
+
return (0, import_react_query51.useQuery)({
|
|
5659
6684
|
queryKey,
|
|
5660
6685
|
queryFn: () => view_service_default.getSelectionItem({ data }),
|
|
5661
6686
|
enabled,
|
|
@@ -5665,9 +6690,9 @@ var useGetSelection = ({
|
|
|
5665
6690
|
var use_get_selection_default = useGetSelection;
|
|
5666
6691
|
|
|
5667
6692
|
// src/hooks/view/use-get-view.ts
|
|
5668
|
-
var
|
|
6693
|
+
var import_react_query52 = require("@tanstack/react-query");
|
|
5669
6694
|
var useGetView = (viewParams, actData) => {
|
|
5670
|
-
return (0,
|
|
6695
|
+
return (0, import_react_query52.useQuery)({
|
|
5671
6696
|
queryKey: ["get_view_by_action" /* GET_VIEW_BY_ACTION */, viewParams],
|
|
5672
6697
|
queryFn: () => view_service_default.getView(viewParams),
|
|
5673
6698
|
enabled: !!actData,
|
|
@@ -5678,9 +6703,9 @@ var useGetView = (viewParams, actData) => {
|
|
|
5678
6703
|
var use_get_view_default = useGetView;
|
|
5679
6704
|
|
|
5680
6705
|
// src/hooks/view/use-load-action.ts
|
|
5681
|
-
var
|
|
6706
|
+
var import_react_query53 = require("@tanstack/react-query");
|
|
5682
6707
|
var useLoadAction = () => {
|
|
5683
|
-
return (0,
|
|
6708
|
+
return (0, import_react_query53.useMutation)({
|
|
5684
6709
|
mutationFn: ({
|
|
5685
6710
|
idAction,
|
|
5686
6711
|
context
|
|
@@ -5695,9 +6720,9 @@ var useLoadAction = () => {
|
|
|
5695
6720
|
var use_load_action_default = useLoadAction;
|
|
5696
6721
|
|
|
5697
6722
|
// src/hooks/view/use-load-message.ts
|
|
5698
|
-
var
|
|
6723
|
+
var import_react_query54 = require("@tanstack/react-query");
|
|
5699
6724
|
var useLoadMessage = () => {
|
|
5700
|
-
return (0,
|
|
6725
|
+
return (0, import_react_query54.useQuery)({
|
|
5701
6726
|
queryKey: [`load-message-failure`],
|
|
5702
6727
|
queryFn: () => view_service_default.loadMessages(),
|
|
5703
6728
|
refetchOnWindowFocus: false
|
|
@@ -5706,9 +6731,9 @@ var useLoadMessage = () => {
|
|
|
5706
6731
|
var use_load_message_default = useLoadMessage;
|
|
5707
6732
|
|
|
5708
6733
|
// src/hooks/view/use-print.ts
|
|
5709
|
-
var
|
|
6734
|
+
var import_react_query55 = require("@tanstack/react-query");
|
|
5710
6735
|
var usePrint = () => {
|
|
5711
|
-
return (0,
|
|
6736
|
+
return (0, import_react_query55.useMutation)({
|
|
5712
6737
|
mutationFn: ({ id, report, db }) => action_service_default.print({
|
|
5713
6738
|
id,
|
|
5714
6739
|
report,
|
|
@@ -5719,9 +6744,9 @@ var usePrint = () => {
|
|
|
5719
6744
|
var use_print_default = usePrint;
|
|
5720
6745
|
|
|
5721
6746
|
// src/hooks/view/use-remove-row.ts
|
|
5722
|
-
var
|
|
6747
|
+
var import_react_query56 = require("@tanstack/react-query");
|
|
5723
6748
|
var useRemoveRow = () => {
|
|
5724
|
-
return (0,
|
|
6749
|
+
return (0, import_react_query56.useMutation)({
|
|
5725
6750
|
mutationFn: ({
|
|
5726
6751
|
model,
|
|
5727
6752
|
ids,
|
|
@@ -5736,9 +6761,9 @@ var useRemoveRow = () => {
|
|
|
5736
6761
|
var use_remove_row_default = useRemoveRow;
|
|
5737
6762
|
|
|
5738
6763
|
// src/hooks/view/use-resequence.ts
|
|
5739
|
-
var
|
|
6764
|
+
var import_react_query57 = require("@tanstack/react-query");
|
|
5740
6765
|
var useGetResequence = (model, resIds, context, offset) => {
|
|
5741
|
-
return (0,
|
|
6766
|
+
return (0, import_react_query57.useQuery)({
|
|
5742
6767
|
queryKey: [],
|
|
5743
6768
|
queryFn: () => view_service_default.getResequence({
|
|
5744
6769
|
model,
|
|
@@ -5753,9 +6778,9 @@ var useGetResequence = (model, resIds, context, offset) => {
|
|
|
5753
6778
|
var use_resequence_default = useGetResequence;
|
|
5754
6779
|
|
|
5755
6780
|
// src/hooks/view/use-run-action.ts
|
|
5756
|
-
var
|
|
6781
|
+
var import_react_query58 = require("@tanstack/react-query");
|
|
5757
6782
|
var useRunAction = () => {
|
|
5758
|
-
return (0,
|
|
6783
|
+
return (0, import_react_query58.useMutation)({
|
|
5759
6784
|
mutationFn: ({
|
|
5760
6785
|
idAction,
|
|
5761
6786
|
context
|
|
@@ -5768,9 +6793,9 @@ var useRunAction = () => {
|
|
|
5768
6793
|
var use_run_action_default = useRunAction;
|
|
5769
6794
|
|
|
5770
6795
|
// src/hooks/view/use-signin-sso.ts
|
|
5771
|
-
var
|
|
6796
|
+
var import_react_query59 = require("@tanstack/react-query");
|
|
5772
6797
|
var useSignInSSO = () => {
|
|
5773
|
-
return (0,
|
|
6798
|
+
return (0, import_react_query59.useMutation)({
|
|
5774
6799
|
mutationFn: ({
|
|
5775
6800
|
redirect_uri,
|
|
5776
6801
|
state,
|
|
@@ -5791,9 +6816,9 @@ var useSignInSSO = () => {
|
|
|
5791
6816
|
var use_signin_sso_default = useSignInSSO;
|
|
5792
6817
|
|
|
5793
6818
|
// src/hooks/view/use-verify-2FA.ts
|
|
5794
|
-
var
|
|
6819
|
+
var import_react_query60 = require("@tanstack/react-query");
|
|
5795
6820
|
var useVerify2FA = () => {
|
|
5796
|
-
return (0,
|
|
6821
|
+
return (0, import_react_query60.useMutation)({
|
|
5797
6822
|
mutationFn: ({
|
|
5798
6823
|
method,
|
|
5799
6824
|
with_context,
|
|
@@ -5814,9 +6839,9 @@ var useVerify2FA = () => {
|
|
|
5814
6839
|
var use_verify_2FA_default = useVerify2FA;
|
|
5815
6840
|
|
|
5816
6841
|
// src/hooks/view/uset-get-2FA-method.ts
|
|
5817
|
-
var
|
|
6842
|
+
var import_react_query61 = require("@tanstack/react-query");
|
|
5818
6843
|
var useGet2FAMethods = () => {
|
|
5819
|
-
return (0,
|
|
6844
|
+
return (0, import_react_query61.useMutation)({
|
|
5820
6845
|
mutationFn: ({
|
|
5821
6846
|
method,
|
|
5822
6847
|
with_context
|
|
@@ -5831,9 +6856,9 @@ var useGet2FAMethods = () => {
|
|
|
5831
6856
|
var uset_get_2FA_method_default = useGet2FAMethods;
|
|
5832
6857
|
|
|
5833
6858
|
// src/hooks/view/use-get-fields-view-security.ts
|
|
5834
|
-
var
|
|
6859
|
+
var import_react_query62 = require("@tanstack/react-query");
|
|
5835
6860
|
var useGetFieldsViewSecurity = () => {
|
|
5836
|
-
return (0,
|
|
6861
|
+
return (0, import_react_query62.useMutation)({
|
|
5837
6862
|
mutationFn: ({
|
|
5838
6863
|
method,
|
|
5839
6864
|
token,
|
|
@@ -5850,9 +6875,9 @@ var useGetFieldsViewSecurity = () => {
|
|
|
5850
6875
|
var use_get_fields_view_security_default = useGetFieldsViewSecurity;
|
|
5851
6876
|
|
|
5852
6877
|
// src/hooks/view/use-grant-access.ts
|
|
5853
|
-
var
|
|
6878
|
+
var import_react_query63 = require("@tanstack/react-query");
|
|
5854
6879
|
var useGrantAccess = () => {
|
|
5855
|
-
return (0,
|
|
6880
|
+
return (0, import_react_query63.useMutation)({
|
|
5856
6881
|
mutationFn: ({
|
|
5857
6882
|
redirect_uri,
|
|
5858
6883
|
state,
|
|
@@ -5871,9 +6896,9 @@ var useGrantAccess = () => {
|
|
|
5871
6896
|
var use_grant_access_default = useGrantAccess;
|
|
5872
6897
|
|
|
5873
6898
|
// src/hooks/view/use-remove-totp-setup.ts
|
|
5874
|
-
var
|
|
6899
|
+
var import_react_query64 = require("@tanstack/react-query");
|
|
5875
6900
|
var useRemoveTotpSetup = () => {
|
|
5876
|
-
return (0,
|
|
6901
|
+
return (0, import_react_query64.useMutation)({
|
|
5877
6902
|
mutationFn: ({ method, token }) => {
|
|
5878
6903
|
return view_service_default.removeTotpSetUp({
|
|
5879
6904
|
method,
|
|
@@ -5885,9 +6910,9 @@ var useRemoveTotpSetup = () => {
|
|
|
5885
6910
|
var use_remove_totp_setup_default = useRemoveTotpSetup;
|
|
5886
6911
|
|
|
5887
6912
|
// src/hooks/view/use-request-setup-totp.ts
|
|
5888
|
-
var
|
|
6913
|
+
var import_react_query65 = require("@tanstack/react-query");
|
|
5889
6914
|
var useRequestSetupTotp = () => {
|
|
5890
|
-
return (0,
|
|
6915
|
+
return (0, import_react_query65.useMutation)({
|
|
5891
6916
|
mutationFn: ({ method, token }) => {
|
|
5892
6917
|
return view_service_default.requestSetupTotp({
|
|
5893
6918
|
method,
|
|
@@ -5899,9 +6924,9 @@ var useRequestSetupTotp = () => {
|
|
|
5899
6924
|
var use_request_setup_totp_default = useRequestSetupTotp;
|
|
5900
6925
|
|
|
5901
6926
|
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
5902
|
-
var
|
|
6927
|
+
var import_react_query66 = require("@tanstack/react-query");
|
|
5903
6928
|
var useSettingsWebRead2fa = () => {
|
|
5904
|
-
return (0,
|
|
6929
|
+
return (0, import_react_query66.useMutation)({
|
|
5905
6930
|
mutationFn: ({
|
|
5906
6931
|
method,
|
|
5907
6932
|
token,
|
|
@@ -5920,9 +6945,9 @@ var useSettingsWebRead2fa = () => {
|
|
|
5920
6945
|
var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
|
|
5921
6946
|
|
|
5922
6947
|
// src/hooks/view/use-verify-totp.ts
|
|
5923
|
-
var
|
|
6948
|
+
var import_react_query67 = require("@tanstack/react-query");
|
|
5924
6949
|
var useVerifyTotp = () => {
|
|
5925
|
-
return (0,
|
|
6950
|
+
return (0, import_react_query67.useMutation)({
|
|
5926
6951
|
mutationFn: ({
|
|
5927
6952
|
method,
|
|
5928
6953
|
action_token,
|
|
@@ -5937,8 +6962,212 @@ var useVerifyTotp = () => {
|
|
|
5937
6962
|
});
|
|
5938
6963
|
};
|
|
5939
6964
|
var use_verify_totp_default = useVerifyTotp;
|
|
6965
|
+
|
|
6966
|
+
// src/provider/react-query-provider.tsx
|
|
6967
|
+
var import_react_query68 = require("@tanstack/react-query");
|
|
6968
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
6969
|
+
var ReactQueryProvider = ({ children }) => {
|
|
6970
|
+
const queryClient = new import_react_query68.QueryClient({
|
|
6971
|
+
defaultOptions: {
|
|
6972
|
+
queries: {
|
|
6973
|
+
// placeholderData: keepPreviousData,
|
|
6974
|
+
refetchOnWindowFocus: false,
|
|
6975
|
+
refetchOnMount: false,
|
|
6976
|
+
refetchOnReconnect: false,
|
|
6977
|
+
retry: false
|
|
6978
|
+
}
|
|
6979
|
+
}
|
|
6980
|
+
});
|
|
6981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query68.QueryClientProvider, { client: queryClient, children });
|
|
6982
|
+
};
|
|
6983
|
+
|
|
6984
|
+
// src/provider/redux-provider.tsx
|
|
6985
|
+
var import_react_redux2 = require("react-redux");
|
|
6986
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
6987
|
+
var ReduxProvider = ({ children }) => {
|
|
6988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_redux2.Provider, { store: envStore, children });
|
|
6989
|
+
};
|
|
6990
|
+
|
|
6991
|
+
// src/provider/main-provider.tsx
|
|
6992
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
6993
|
+
var MainProvider = ({ children }) => {
|
|
6994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReduxProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReactQueryProvider, { children }) });
|
|
6995
|
+
};
|
|
6996
|
+
|
|
6997
|
+
// src/provider/version-gate-provider.tsx
|
|
6998
|
+
var import_react2 = require("react");
|
|
6999
|
+
var import_react_query69 = require("@tanstack/react-query");
|
|
7000
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
7001
|
+
var VersionGate = ({ children }) => {
|
|
7002
|
+
const queryClient = (0, import_react_query69.useQueryClient)();
|
|
7003
|
+
const [ready, setReady] = (0, import_react2.useState)(false);
|
|
7004
|
+
(0, import_react2.useEffect)(() => {
|
|
7005
|
+
const clearVersion = () => {
|
|
7006
|
+
queryClient.clear();
|
|
7007
|
+
localStorage.removeItem("__api_version__");
|
|
7008
|
+
};
|
|
7009
|
+
const validateVersion = async () => {
|
|
7010
|
+
const serverVersion = await view_service_default.getVersion();
|
|
7011
|
+
const cached = localStorage.getItem("__api_version__");
|
|
7012
|
+
if (cached !== serverVersion?.api_version) {
|
|
7013
|
+
clearVersion();
|
|
7014
|
+
localStorage.setItem("__api_version__", serverVersion?.api_version);
|
|
7015
|
+
} else {
|
|
7016
|
+
console.log("Api version:", serverVersion?.api_version);
|
|
7017
|
+
}
|
|
7018
|
+
setReady(true);
|
|
7019
|
+
};
|
|
7020
|
+
validateVersion();
|
|
7021
|
+
if (typeof window !== "undefined") {
|
|
7022
|
+
const onKey = (e) => {
|
|
7023
|
+
const key = e.key.toLowerCase();
|
|
7024
|
+
const isHardRefresh = (key === "f5" || key === "r") && e.ctrlKey && (key !== "r" || e.shiftKey) || key === "r" && e.metaKey && e.shiftKey || key === "r" && e.metaKey && e.altKey;
|
|
7025
|
+
if (isHardRefresh) clearVersion();
|
|
7026
|
+
};
|
|
7027
|
+
window.addEventListener("keydown", onKey);
|
|
7028
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
7029
|
+
}
|
|
7030
|
+
}, [queryClient]);
|
|
7031
|
+
return ready ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children }) : null;
|
|
7032
|
+
};
|
|
5940
7033
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5941
7034
|
0 && (module.exports = {
|
|
7035
|
+
ActionService,
|
|
7036
|
+
AuthService,
|
|
7037
|
+
CompanyService,
|
|
7038
|
+
ComponentType,
|
|
7039
|
+
EnvStore,
|
|
7040
|
+
ExcelService,
|
|
7041
|
+
FieldTypeConstants,
|
|
7042
|
+
FormService,
|
|
7043
|
+
KanbanService,
|
|
7044
|
+
KeyConstants,
|
|
7045
|
+
MainProvider,
|
|
7046
|
+
MethodConstants,
|
|
7047
|
+
MethodType,
|
|
7048
|
+
ModelConstants,
|
|
7049
|
+
ModelService,
|
|
7050
|
+
ReactQueryProvider,
|
|
7051
|
+
SearchType,
|
|
7052
|
+
UriConstants,
|
|
7053
|
+
UserService,
|
|
7054
|
+
VersionGate,
|
|
7055
|
+
ViewService,
|
|
7056
|
+
WIDGETAVATAR,
|
|
7057
|
+
WIDGETCOLOR,
|
|
7058
|
+
WIDGETCURRENCY,
|
|
7059
|
+
WIDGETNOSTRING,
|
|
7060
|
+
WIDGETSTATUS,
|
|
7061
|
+
WesapError,
|
|
7062
|
+
axiosClient,
|
|
7063
|
+
breadcrumbsSlice,
|
|
7064
|
+
checkIsImageLink,
|
|
7065
|
+
clearSearchMap,
|
|
7066
|
+
convertFloatToTime,
|
|
7067
|
+
convertTimeToFloat,
|
|
7068
|
+
copyTextToClipboard,
|
|
7069
|
+
domainHelper,
|
|
7070
|
+
env,
|
|
7071
|
+
envSlice,
|
|
7072
|
+
envStore,
|
|
7073
|
+
evalJSONContext,
|
|
7074
|
+
evalJSONDomain,
|
|
7075
|
+
excelSlice,
|
|
7076
|
+
filterFieldDirty,
|
|
7077
|
+
formSlice,
|
|
7078
|
+
formatCurrency,
|
|
7079
|
+
formatDate,
|
|
7080
|
+
formatFileSize,
|
|
7081
|
+
formatSortingString,
|
|
7082
|
+
formatUrlPath,
|
|
7083
|
+
getEnv,
|
|
7084
|
+
getFieldsOnChange,
|
|
7085
|
+
getOffSet,
|
|
7086
|
+
getSubdomain,
|
|
7087
|
+
handleError,
|
|
7088
|
+
headerSlice,
|
|
7089
|
+
initEnv,
|
|
7090
|
+
isBase64File,
|
|
7091
|
+
isBase64Image,
|
|
7092
|
+
isObjectEmpty,
|
|
7093
|
+
listSlice,
|
|
7094
|
+
loginSlice,
|
|
7095
|
+
mergeObjects,
|
|
7096
|
+
navbarSlice,
|
|
7097
|
+
profileSlice,
|
|
7098
|
+
removeKeyFromSearchMap,
|
|
7099
|
+
removeUndefinedFields,
|
|
7100
|
+
resequence,
|
|
7101
|
+
searchSlice,
|
|
7102
|
+
selectBreadCrumbs,
|
|
7103
|
+
selectEnv,
|
|
7104
|
+
selectExcel,
|
|
7105
|
+
selectForm,
|
|
7106
|
+
selectHeader,
|
|
7107
|
+
selectList,
|
|
7108
|
+
selectLogin,
|
|
7109
|
+
selectNavbar,
|
|
7110
|
+
selectProfile,
|
|
7111
|
+
selectSearch,
|
|
7112
|
+
selectSearchMap,
|
|
7113
|
+
setAllowCompanies,
|
|
7114
|
+
setAllowedCompanyIds,
|
|
7115
|
+
setBreadCrumbs,
|
|
7116
|
+
setCompanies,
|
|
7117
|
+
setConfig,
|
|
7118
|
+
setDataParse,
|
|
7119
|
+
setDataUser,
|
|
7120
|
+
setDb,
|
|
7121
|
+
setDefaultCompany,
|
|
7122
|
+
setDomainTable,
|
|
7123
|
+
setEnv,
|
|
7124
|
+
setEnvFile,
|
|
7125
|
+
setErrorData,
|
|
7126
|
+
setFieldTranslate,
|
|
7127
|
+
setFields,
|
|
7128
|
+
setFilterBy,
|
|
7129
|
+
setFirstDomain,
|
|
7130
|
+
setForgotPasswordUrl,
|
|
7131
|
+
setFormSubmitComponent,
|
|
7132
|
+
setGroupBy,
|
|
7133
|
+
setGroupByDomain,
|
|
7134
|
+
setHeader,
|
|
7135
|
+
setHoveredIndexSearchList,
|
|
7136
|
+
setIdFile,
|
|
7137
|
+
setIndexRowTableModal,
|
|
7138
|
+
setIsFileLoaded,
|
|
7139
|
+
setIsShowModalTranslate,
|
|
7140
|
+
setIsShowingModalDetail,
|
|
7141
|
+
setIsUpdateTableModal,
|
|
7142
|
+
setLang,
|
|
7143
|
+
setListSubject,
|
|
7144
|
+
setLoadingImport,
|
|
7145
|
+
setMenuFocus,
|
|
7146
|
+
setMenuFocusAction,
|
|
7147
|
+
setMenuList,
|
|
7148
|
+
setNavbarWidth,
|
|
7149
|
+
setOrder,
|
|
7150
|
+
setPage,
|
|
7151
|
+
setPageLimit,
|
|
7152
|
+
setProfile,
|
|
7153
|
+
setRedirectTo,
|
|
7154
|
+
setSearchBy,
|
|
7155
|
+
setSearchMap,
|
|
7156
|
+
setSearchString,
|
|
7157
|
+
setSelectedFile,
|
|
7158
|
+
setSelectedRadioKey,
|
|
7159
|
+
setSelectedRowKeys,
|
|
7160
|
+
setSelectedTags,
|
|
7161
|
+
setTransferDetail,
|
|
7162
|
+
setUid,
|
|
7163
|
+
setUser,
|
|
7164
|
+
setViewDataStore,
|
|
7165
|
+
stringToColor,
|
|
7166
|
+
toQueryString,
|
|
7167
|
+
updateSearchMap,
|
|
7168
|
+
updateTokenParamInOriginalRequest,
|
|
7169
|
+
useAppDispatch,
|
|
7170
|
+
useAppSelector,
|
|
5942
7171
|
useButton,
|
|
5943
7172
|
useChangeStatus,
|
|
5944
7173
|
useDelete,
|
|
@@ -5946,6 +7175,7 @@ var use_verify_totp_default = useVerifyTotp;
|
|
|
5946
7175
|
useDuplicateRecord,
|
|
5947
7176
|
useExecuteImport,
|
|
5948
7177
|
useExportExcel,
|
|
7178
|
+
useField,
|
|
5949
7179
|
useForgotPassword,
|
|
5950
7180
|
useForgotPasswordSSO,
|
|
5951
7181
|
useGet2FAMethods,
|
|
@@ -6001,10 +7231,14 @@ var use_verify_totp_default = useVerifyTotp;
|
|
|
6001
7231
|
useSettingsWebRead2fa,
|
|
6002
7232
|
useSignInSSO,
|
|
6003
7233
|
useSwitchLocale,
|
|
7234
|
+
useTabModel,
|
|
6004
7235
|
useUpdatePassword,
|
|
6005
7236
|
useUploadFile,
|
|
6006
7237
|
useUploadIdFile,
|
|
6007
7238
|
useUploadImage,
|
|
7239
|
+
useValidateActionToken,
|
|
6008
7240
|
useVerify2FA,
|
|
6009
|
-
useVerifyTotp
|
|
7241
|
+
useVerifyTotp,
|
|
7242
|
+
validateAndParseDate
|
|
6010
7243
|
});
|
|
7244
|
+
//# sourceMappingURL=index.js.map
|