@fctc/interface-logic 1.8.0 → 1.8.2
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} +1438 -203
- package/dist/index.js.map +1 -0
- package/dist/{hooks.mjs → index.mjs} +1252 -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,8 @@ var ViewService = {
|
|
|
4538
5550
|
},
|
|
4539
5551
|
async getVersion() {
|
|
4540
5552
|
const env2 = getEnv();
|
|
4541
|
-
console.log("env
|
|
4542
|
-
return env2?.requests
|
|
5553
|
+
console.log("env", env2);
|
|
5554
|
+
return env2?.requests.get("", {
|
|
4543
5555
|
headers: {
|
|
4544
5556
|
"Content-Type": "application/json"
|
|
4545
5557
|
}
|
|
@@ -4856,26 +5868,40 @@ var useGetAccessByCode = () => {
|
|
|
4856
5868
|
};
|
|
4857
5869
|
var use_get_access_by_code_default = useGetAccessByCode;
|
|
4858
5870
|
|
|
4859
|
-
// src/hooks/
|
|
5871
|
+
// src/hooks/auth/use-validate-action-token.ts
|
|
4860
5872
|
var import_react_query12 = require("@tanstack/react-query");
|
|
4861
|
-
var
|
|
5873
|
+
var useValidateActionToken = () => {
|
|
4862
5874
|
return (0, import_react_query12.useMutation)({
|
|
5875
|
+
mutationFn: ({
|
|
5876
|
+
actionToken,
|
|
5877
|
+
path
|
|
5878
|
+
}) => {
|
|
5879
|
+
return auth_service_default.isValidActionToken(actionToken, path);
|
|
5880
|
+
}
|
|
5881
|
+
});
|
|
5882
|
+
};
|
|
5883
|
+
var use_validate_action_token_default = useValidateActionToken;
|
|
5884
|
+
|
|
5885
|
+
// src/hooks/company/use-get-company-info.ts
|
|
5886
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
5887
|
+
var useGetCompanyInfo = () => {
|
|
5888
|
+
return (0, import_react_query13.useMutation)({
|
|
4863
5889
|
mutationFn: (id) => company_service_default.getInfoCompany(id)
|
|
4864
5890
|
});
|
|
4865
5891
|
};
|
|
4866
5892
|
var use_get_company_info_default = useGetCompanyInfo;
|
|
4867
5893
|
|
|
4868
5894
|
// src/hooks/company/use-get-current-company.ts
|
|
4869
|
-
var
|
|
5895
|
+
var import_react_query14 = require("@tanstack/react-query");
|
|
4870
5896
|
var useGetCurrentCompany = () => {
|
|
4871
|
-
return (0,
|
|
5897
|
+
return (0, import_react_query14.useMutation)({
|
|
4872
5898
|
mutationFn: () => company_service_default.getCurrentCompany()
|
|
4873
5899
|
});
|
|
4874
5900
|
};
|
|
4875
5901
|
var use_get_current_company_default = useGetCurrentCompany;
|
|
4876
5902
|
|
|
4877
5903
|
// src/hooks/company/use-get-list-company.ts
|
|
4878
|
-
var
|
|
5904
|
+
var import_react_query15 = require("@tanstack/react-query");
|
|
4879
5905
|
var useGetListCompany = (companyIDs = []) => {
|
|
4880
5906
|
const companySpec = {
|
|
4881
5907
|
id: {},
|
|
@@ -4886,7 +5912,7 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4886
5912
|
ids: companyIDs,
|
|
4887
5913
|
specification: companySpec
|
|
4888
5914
|
};
|
|
4889
|
-
return (0,
|
|
5915
|
+
return (0, import_react_query15.useQuery)({
|
|
4890
5916
|
queryKey: ["list_company" /* LIST_COMPANY */, companyIDs],
|
|
4891
5917
|
queryFn: () => model_service_default.getList(getListParams),
|
|
4892
5918
|
refetchOnWindowFocus: false
|
|
@@ -4895,9 +5921,9 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4895
5921
|
var use_get_list_company_default = useGetListCompany;
|
|
4896
5922
|
|
|
4897
5923
|
// src/hooks/excel/use-export-excel.ts
|
|
4898
|
-
var
|
|
5924
|
+
var import_react_query16 = require("@tanstack/react-query");
|
|
4899
5925
|
var useExportExcel = () => {
|
|
4900
|
-
return (0,
|
|
5926
|
+
return (0, import_react_query16.useMutation)({
|
|
4901
5927
|
mutationFn: ({
|
|
4902
5928
|
model,
|
|
4903
5929
|
domain,
|
|
@@ -4922,9 +5948,9 @@ var useExportExcel = () => {
|
|
|
4922
5948
|
var use_export_excel_default = useExportExcel;
|
|
4923
5949
|
|
|
4924
5950
|
// src/hooks/excel/use-get-field-export.ts
|
|
4925
|
-
var
|
|
5951
|
+
var import_react_query17 = require("@tanstack/react-query");
|
|
4926
5952
|
var useGetFieldExport = () => {
|
|
4927
|
-
return (0,
|
|
5953
|
+
return (0, import_react_query17.useMutation)({
|
|
4928
5954
|
mutationFn: ({
|
|
4929
5955
|
ids,
|
|
4930
5956
|
model,
|
|
@@ -4953,9 +5979,9 @@ var useGetFieldExport = () => {
|
|
|
4953
5979
|
var use_get_field_export_default = useGetFieldExport;
|
|
4954
5980
|
|
|
4955
5981
|
// src/hooks/excel/use-get-file-excel.ts
|
|
4956
|
-
var
|
|
5982
|
+
var import_react_query18 = require("@tanstack/react-query");
|
|
4957
5983
|
var useGetFileExcel = ({ model }) => {
|
|
4958
|
-
return (0,
|
|
5984
|
+
return (0, import_react_query18.useQuery)({
|
|
4959
5985
|
queryKey: [],
|
|
4960
5986
|
queryFn: () => excel_service_default.getFileExcel({
|
|
4961
5987
|
model
|
|
@@ -4971,9 +5997,9 @@ var useGetFileExcel = ({ model }) => {
|
|
|
4971
5997
|
var use_get_file_excel_default = useGetFileExcel;
|
|
4972
5998
|
|
|
4973
5999
|
// src/hooks/excel/use-parse-preview.ts
|
|
4974
|
-
var
|
|
6000
|
+
var import_react_query19 = require("@tanstack/react-query");
|
|
4975
6001
|
var useParsePreview = () => {
|
|
4976
|
-
return (0,
|
|
6002
|
+
return (0, import_react_query19.useMutation)({
|
|
4977
6003
|
mutationFn: ({
|
|
4978
6004
|
id,
|
|
4979
6005
|
selectedSheet,
|
|
@@ -4990,9 +6016,9 @@ var useParsePreview = () => {
|
|
|
4990
6016
|
var use_parse_preview_default = useParsePreview;
|
|
4991
6017
|
|
|
4992
6018
|
// src/hooks/excel/use-upload-file.ts
|
|
4993
|
-
var
|
|
6019
|
+
var import_react_query20 = require("@tanstack/react-query");
|
|
4994
6020
|
var useUploadFile = () => {
|
|
4995
|
-
return (0,
|
|
6021
|
+
return (0, import_react_query20.useMutation)({
|
|
4996
6022
|
mutationFn: ({ formData }) => excel_service_default.uploadFile({
|
|
4997
6023
|
formData
|
|
4998
6024
|
})
|
|
@@ -5001,9 +6027,9 @@ var useUploadFile = () => {
|
|
|
5001
6027
|
var use_upload_file_default = useUploadFile;
|
|
5002
6028
|
|
|
5003
6029
|
// src/hooks/excel/use-upload-id-file.ts
|
|
5004
|
-
var
|
|
6030
|
+
var import_react_query21 = require("@tanstack/react-query");
|
|
5005
6031
|
var useUploadIdFile = () => {
|
|
5006
|
-
return (0,
|
|
6032
|
+
return (0, import_react_query21.useMutation)({
|
|
5007
6033
|
mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
|
|
5008
6034
|
formData
|
|
5009
6035
|
})
|
|
@@ -5012,9 +6038,9 @@ var useUploadIdFile = () => {
|
|
|
5012
6038
|
var use_upload_id_file_default = useUploadIdFile;
|
|
5013
6039
|
|
|
5014
6040
|
// src/hooks/excel/uss-execute-import.ts
|
|
5015
|
-
var
|
|
6041
|
+
var import_react_query22 = require("@tanstack/react-query");
|
|
5016
6042
|
var useExecuteImport = () => {
|
|
5017
|
-
return (0,
|
|
6043
|
+
return (0, import_react_query22.useMutation)({
|
|
5018
6044
|
mutationFn: ({
|
|
5019
6045
|
fields,
|
|
5020
6046
|
columns,
|
|
@@ -5035,9 +6061,9 @@ var useExecuteImport = () => {
|
|
|
5035
6061
|
var uss_execute_import_default = useExecuteImport;
|
|
5036
6062
|
|
|
5037
6063
|
// src/hooks/form/use-change-status.ts
|
|
5038
|
-
var
|
|
6064
|
+
var import_react_query23 = require("@tanstack/react-query");
|
|
5039
6065
|
var useChangeStatus = () => {
|
|
5040
|
-
return (0,
|
|
6066
|
+
return (0, import_react_query23.useMutation)({
|
|
5041
6067
|
mutationFn: ({ data }) => {
|
|
5042
6068
|
return form_service_default.changeStatus({
|
|
5043
6069
|
data
|
|
@@ -5048,9 +6074,9 @@ var useChangeStatus = () => {
|
|
|
5048
6074
|
var use_change_status_default = useChangeStatus;
|
|
5049
6075
|
|
|
5050
6076
|
// src/hooks/form/use-delete-comment.ts
|
|
5051
|
-
var
|
|
6077
|
+
var import_react_query24 = require("@tanstack/react-query");
|
|
5052
6078
|
var useDeleteComment = () => {
|
|
5053
|
-
return (0,
|
|
6079
|
+
return (0, import_react_query24.useMutation)({
|
|
5054
6080
|
mutationFn: ({ data }) => form_service_default.deleteComment({
|
|
5055
6081
|
data
|
|
5056
6082
|
})
|
|
@@ -5059,9 +6085,9 @@ var useDeleteComment = () => {
|
|
|
5059
6085
|
var use_delete_comment_default = useDeleteComment;
|
|
5060
6086
|
|
|
5061
6087
|
// src/hooks/form/use-get-comment.ts
|
|
5062
|
-
var
|
|
6088
|
+
var import_react_query25 = require("@tanstack/react-query");
|
|
5063
6089
|
var useGetComment = ({ data, queryKey }) => {
|
|
5064
|
-
return (0,
|
|
6090
|
+
return (0, import_react_query25.useQuery)({
|
|
5065
6091
|
queryKey,
|
|
5066
6092
|
queryFn: () => form_service_default.getComment({ data }).then((res) => {
|
|
5067
6093
|
if (res) {
|
|
@@ -5075,13 +6101,13 @@ var useGetComment = ({ data, queryKey }) => {
|
|
|
5075
6101
|
var use_get_comment_default = useGetComment;
|
|
5076
6102
|
|
|
5077
6103
|
// src/hooks/form/use-get-form-view.ts
|
|
5078
|
-
var
|
|
6104
|
+
var import_react_query26 = require("@tanstack/react-query");
|
|
5079
6105
|
var useGetFormView = ({
|
|
5080
6106
|
data,
|
|
5081
6107
|
queryKey,
|
|
5082
6108
|
enabled
|
|
5083
6109
|
}) => {
|
|
5084
|
-
return (0,
|
|
6110
|
+
return (0, import_react_query26.useQuery)({
|
|
5085
6111
|
queryKey,
|
|
5086
6112
|
queryFn: () => form_service_default.getFormView({ data }).then((res) => {
|
|
5087
6113
|
if (res) {
|
|
@@ -5095,13 +6121,13 @@ var useGetFormView = ({
|
|
|
5095
6121
|
var use_get_form_view_default = useGetFormView;
|
|
5096
6122
|
|
|
5097
6123
|
// src/hooks/form/use-get-image.ts
|
|
5098
|
-
var
|
|
6124
|
+
var import_react_query27 = require("@tanstack/react-query");
|
|
5099
6125
|
var useGetImage = ({
|
|
5100
6126
|
data,
|
|
5101
6127
|
queryKey,
|
|
5102
6128
|
src
|
|
5103
6129
|
}) => {
|
|
5104
|
-
return (0,
|
|
6130
|
+
return (0, import_react_query27.useQuery)({
|
|
5105
6131
|
queryKey,
|
|
5106
6132
|
queryFn: () => form_service_default.getImage({ data }).then((res) => {
|
|
5107
6133
|
if (res) {
|
|
@@ -5115,9 +6141,9 @@ var useGetImage = ({
|
|
|
5115
6141
|
var use_get_image_default = useGetImage;
|
|
5116
6142
|
|
|
5117
6143
|
// src/hooks/form/use-send-comment.ts
|
|
5118
|
-
var
|
|
6144
|
+
var import_react_query28 = require("@tanstack/react-query");
|
|
5119
6145
|
var useSendComment = () => {
|
|
5120
|
-
return (0,
|
|
6146
|
+
return (0, import_react_query28.useMutation)({
|
|
5121
6147
|
mutationFn: ({ data }) => form_service_default.sentComment({
|
|
5122
6148
|
data
|
|
5123
6149
|
})
|
|
@@ -5126,9 +6152,9 @@ var useSendComment = () => {
|
|
|
5126
6152
|
var use_send_comment_default = useSendComment;
|
|
5127
6153
|
|
|
5128
6154
|
// src/hooks/form/use-upload-image.ts
|
|
5129
|
-
var
|
|
6155
|
+
var import_react_query29 = require("@tanstack/react-query");
|
|
5130
6156
|
var useUploadImage = () => {
|
|
5131
|
-
return (0,
|
|
6157
|
+
return (0, import_react_query29.useMutation)({
|
|
5132
6158
|
mutationFn: ({ data }) => form_service_default.uploadImage({
|
|
5133
6159
|
data
|
|
5134
6160
|
})
|
|
@@ -5137,18 +6163,18 @@ var useUploadImage = () => {
|
|
|
5137
6163
|
var use_upload_image_default = useUploadImage;
|
|
5138
6164
|
|
|
5139
6165
|
// src/hooks/model/use-delete.ts
|
|
5140
|
-
var
|
|
6166
|
+
var import_react_query30 = require("@tanstack/react-query");
|
|
5141
6167
|
var useDelete = () => {
|
|
5142
|
-
return (0,
|
|
6168
|
+
return (0, import_react_query30.useMutation)({
|
|
5143
6169
|
mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
|
|
5144
6170
|
});
|
|
5145
6171
|
};
|
|
5146
6172
|
var use_delete_default = useDelete;
|
|
5147
6173
|
|
|
5148
6174
|
// src/hooks/model/use-get-all.ts
|
|
5149
|
-
var
|
|
6175
|
+
var import_react_query31 = require("@tanstack/react-query");
|
|
5150
6176
|
var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
5151
|
-
return (0,
|
|
6177
|
+
return (0, import_react_query31.useQuery)({
|
|
5152
6178
|
queryKey,
|
|
5153
6179
|
queryFn: () => model_service_default.getAll({ data }).then((res) => {
|
|
5154
6180
|
if (res) {
|
|
@@ -5163,9 +6189,9 @@ var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
|
5163
6189
|
var use_get_all_default = useGetAll;
|
|
5164
6190
|
|
|
5165
6191
|
// src/hooks/model/use-get-conversion-rate.ts
|
|
5166
|
-
var
|
|
6192
|
+
var import_react_query32 = require("@tanstack/react-query");
|
|
5167
6193
|
var useGetConversionRate = () => {
|
|
5168
|
-
return (0,
|
|
6194
|
+
return (0, import_react_query32.useQuery)({
|
|
5169
6195
|
queryKey: ["currency-rate"],
|
|
5170
6196
|
queryFn: () => model_service_default.getConversionRate().then((res) => {
|
|
5171
6197
|
if (res) {
|
|
@@ -5178,9 +6204,9 @@ var useGetConversionRate = () => {
|
|
|
5178
6204
|
var use_get_conversion_rate_default = useGetConversionRate;
|
|
5179
6205
|
|
|
5180
6206
|
// src/hooks/model/use-get-currency.ts
|
|
5181
|
-
var
|
|
6207
|
+
var import_react_query33 = require("@tanstack/react-query");
|
|
5182
6208
|
var useGetCurrency = () => {
|
|
5183
|
-
return (0,
|
|
6209
|
+
return (0, import_react_query33.useQuery)({
|
|
5184
6210
|
queryKey: ["currency"],
|
|
5185
6211
|
queryFn: () => model_service_default.getCurrency().then((res) => {
|
|
5186
6212
|
if (res) {
|
|
@@ -5193,9 +6219,9 @@ var useGetCurrency = () => {
|
|
|
5193
6219
|
var use_get_currency_default = useGetCurrency;
|
|
5194
6220
|
|
|
5195
6221
|
// src/hooks/model/use-get-detail.ts
|
|
5196
|
-
var
|
|
6222
|
+
var import_react_query34 = require("@tanstack/react-query");
|
|
5197
6223
|
var useGetDetail = () => {
|
|
5198
|
-
return (0,
|
|
6224
|
+
return (0, import_react_query34.useMutation)({
|
|
5199
6225
|
mutationFn: ({
|
|
5200
6226
|
model,
|
|
5201
6227
|
ids,
|
|
@@ -5212,9 +6238,9 @@ var useGetDetail = () => {
|
|
|
5212
6238
|
var use_get_detail_default = useGetDetail;
|
|
5213
6239
|
|
|
5214
6240
|
// src/hooks/model/use-get-field-onchange.ts
|
|
5215
|
-
var
|
|
6241
|
+
var import_react_query35 = require("@tanstack/react-query");
|
|
5216
6242
|
var useGetFieldOnChange = ({ model }) => {
|
|
5217
|
-
return (0,
|
|
6243
|
+
return (0, import_react_query35.useQuery)({
|
|
5218
6244
|
queryKey: [`field-onchange-${model}`, model],
|
|
5219
6245
|
queryFn: () => model_service_default.getListFieldsOnchange({
|
|
5220
6246
|
model
|
|
@@ -5230,13 +6256,13 @@ var useGetFieldOnChange = ({ model }) => {
|
|
|
5230
6256
|
var use_get_field_onchange_default = useGetFieldOnChange;
|
|
5231
6257
|
|
|
5232
6258
|
// src/hooks/model/use-get-list-my-bank-account.ts
|
|
5233
|
-
var
|
|
6259
|
+
var import_react_query36 = require("@tanstack/react-query");
|
|
5234
6260
|
var useGetListMyBankAccount = ({
|
|
5235
6261
|
domain,
|
|
5236
6262
|
spectification,
|
|
5237
6263
|
model
|
|
5238
6264
|
}) => {
|
|
5239
|
-
return (0,
|
|
6265
|
+
return (0, import_react_query36.useQuery)({
|
|
5240
6266
|
queryKey: ["bank-account", model, domain],
|
|
5241
6267
|
queryFn: () => model_service_default.getListMyBankAccount({
|
|
5242
6268
|
domain,
|
|
@@ -5388,9 +6414,9 @@ var useOdooDataTransform = () => {
|
|
|
5388
6414
|
var use_odoo_data_transform_default = useOdooDataTransform;
|
|
5389
6415
|
|
|
5390
6416
|
// src/hooks/model/use-onchange-form.ts
|
|
5391
|
-
var
|
|
6417
|
+
var import_react_query37 = require("@tanstack/react-query");
|
|
5392
6418
|
var useOnChangeForm = () => {
|
|
5393
|
-
return (0,
|
|
6419
|
+
return (0, import_react_query37.useMutation)({
|
|
5394
6420
|
mutationFn: ({
|
|
5395
6421
|
ids,
|
|
5396
6422
|
model,
|
|
@@ -5411,9 +6437,9 @@ var useOnChangeForm = () => {
|
|
|
5411
6437
|
var use_onchange_form_default = useOnChangeForm;
|
|
5412
6438
|
|
|
5413
6439
|
// src/hooks/model/use-save.ts
|
|
5414
|
-
var
|
|
6440
|
+
var import_react_query38 = require("@tanstack/react-query");
|
|
5415
6441
|
var useSave = () => {
|
|
5416
|
-
return (0,
|
|
6442
|
+
return (0, import_react_query38.useMutation)({
|
|
5417
6443
|
mutationFn: ({
|
|
5418
6444
|
ids,
|
|
5419
6445
|
model,
|
|
@@ -5427,18 +6453,18 @@ var useSave = () => {
|
|
|
5427
6453
|
var use_save_default = useSave;
|
|
5428
6454
|
|
|
5429
6455
|
// src/hooks/user/use-get-profile.ts
|
|
5430
|
-
var
|
|
6456
|
+
var import_react_query39 = require("@tanstack/react-query");
|
|
5431
6457
|
var useGetProfile = (path) => {
|
|
5432
|
-
return (0,
|
|
6458
|
+
return (0, import_react_query39.useMutation)({
|
|
5433
6459
|
mutationFn: () => user_service_default.getProfile(path)
|
|
5434
6460
|
});
|
|
5435
6461
|
};
|
|
5436
6462
|
var use_get_profile_default = useGetProfile;
|
|
5437
6463
|
|
|
5438
6464
|
// src/hooks/user/use-get-user.ts
|
|
5439
|
-
var
|
|
6465
|
+
var import_react_query40 = require("@tanstack/react-query");
|
|
5440
6466
|
var useGetUser = () => {
|
|
5441
|
-
return (0,
|
|
6467
|
+
return (0, import_react_query40.useMutation)({
|
|
5442
6468
|
mutationFn: ({ id, context }) => user_service_default.getUser({
|
|
5443
6469
|
id,
|
|
5444
6470
|
context
|
|
@@ -5448,9 +6474,9 @@ var useGetUser = () => {
|
|
|
5448
6474
|
var use_get_user_default = useGetUser;
|
|
5449
6475
|
|
|
5450
6476
|
// src/hooks/user/use-switch-locale.ts
|
|
5451
|
-
var
|
|
6477
|
+
var import_react_query41 = require("@tanstack/react-query");
|
|
5452
6478
|
var useSwitchLocale = () => {
|
|
5453
|
-
return (0,
|
|
6479
|
+
return (0, import_react_query41.useMutation)({
|
|
5454
6480
|
mutationFn: ({ data }) => {
|
|
5455
6481
|
return user_service_default.switchUserLocale({
|
|
5456
6482
|
id: data.id,
|
|
@@ -5462,9 +6488,9 @@ var useSwitchLocale = () => {
|
|
|
5462
6488
|
var use_switch_locale_default = useSwitchLocale;
|
|
5463
6489
|
|
|
5464
6490
|
// src/hooks/view/use-button.ts
|
|
5465
|
-
var
|
|
6491
|
+
var import_react_query42 = require("@tanstack/react-query");
|
|
5466
6492
|
var useButton = () => {
|
|
5467
|
-
return (0,
|
|
6493
|
+
return (0, import_react_query42.useMutation)({
|
|
5468
6494
|
mutationFn: ({
|
|
5469
6495
|
model,
|
|
5470
6496
|
ids,
|
|
@@ -5484,9 +6510,9 @@ var useButton = () => {
|
|
|
5484
6510
|
var use_button_default = useButton;
|
|
5485
6511
|
|
|
5486
6512
|
// src/hooks/view/use-duplicate-record.ts
|
|
5487
|
-
var
|
|
6513
|
+
var import_react_query43 = require("@tanstack/react-query");
|
|
5488
6514
|
var useDuplicateRecord = () => {
|
|
5489
|
-
return (0,
|
|
6515
|
+
return (0, import_react_query43.useMutation)({
|
|
5490
6516
|
mutationFn: ({
|
|
5491
6517
|
id,
|
|
5492
6518
|
model,
|
|
@@ -5501,7 +6527,7 @@ var useDuplicateRecord = () => {
|
|
|
5501
6527
|
var use_duplicate_record_default = useDuplicateRecord;
|
|
5502
6528
|
|
|
5503
6529
|
// src/hooks/view/use-get-action-detail.ts
|
|
5504
|
-
var
|
|
6530
|
+
var import_react_query44 = require("@tanstack/react-query");
|
|
5505
6531
|
var useGetActionDetail = ({
|
|
5506
6532
|
aid,
|
|
5507
6533
|
context,
|
|
@@ -5515,7 +6541,7 @@ var useGetActionDetail = ({
|
|
|
5515
6541
|
model: model ?? "",
|
|
5516
6542
|
context
|
|
5517
6543
|
};
|
|
5518
|
-
return (0,
|
|
6544
|
+
return (0, import_react_query44.useQuery)({
|
|
5519
6545
|
queryKey,
|
|
5520
6546
|
queryFn: async () => {
|
|
5521
6547
|
if (aid) {
|
|
@@ -5536,9 +6562,9 @@ var useGetActionDetail = ({
|
|
|
5536
6562
|
var use_get_action_detail_default = useGetActionDetail;
|
|
5537
6563
|
|
|
5538
6564
|
// src/hooks/view/use-get-calendar.ts
|
|
5539
|
-
var
|
|
6565
|
+
var import_react_query45 = require("@tanstack/react-query");
|
|
5540
6566
|
var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
5541
|
-
return (0,
|
|
6567
|
+
return (0, import_react_query45.useQuery)({
|
|
5542
6568
|
queryKey,
|
|
5543
6569
|
queryFn: () => model_service_default.getListCalendar({ data: listDataProps }).then((res) => {
|
|
5544
6570
|
if (res) {
|
|
@@ -5554,12 +6580,12 @@ var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
|
5554
6580
|
var use_get_calendar_default = useGetCalendar;
|
|
5555
6581
|
|
|
5556
6582
|
// src/hooks/view/use-get-groups.ts
|
|
5557
|
-
var
|
|
6583
|
+
var import_react_query46 = require("@tanstack/react-query");
|
|
5558
6584
|
var useGetGroups = ({
|
|
5559
6585
|
model,
|
|
5560
6586
|
width_context
|
|
5561
6587
|
}) => {
|
|
5562
|
-
return (0,
|
|
6588
|
+
return (0, import_react_query46.useQuery)({
|
|
5563
6589
|
queryKey: [model, width_context],
|
|
5564
6590
|
queryFn: () => kanban_service_default.getGroups({
|
|
5565
6591
|
model,
|
|
@@ -5576,9 +6602,9 @@ var useGetGroups = ({
|
|
|
5576
6602
|
var use_get_groups_default = useGetGroups;
|
|
5577
6603
|
|
|
5578
6604
|
// src/hooks/view/use-get-list-data.ts
|
|
5579
|
-
var
|
|
6605
|
+
var import_react_query47 = require("@tanstack/react-query");
|
|
5580
6606
|
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
5581
|
-
return (0,
|
|
6607
|
+
return (0, import_react_query47.useQuery)({
|
|
5582
6608
|
queryKey,
|
|
5583
6609
|
queryFn: () => model_service_default.getAll({ data: listDataProps }).then((res) => {
|
|
5584
6610
|
if (res) {
|
|
@@ -5594,9 +6620,9 @@ var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
|
5594
6620
|
var use_get_list_data_default = useGetListData;
|
|
5595
6621
|
|
|
5596
6622
|
// src/hooks/view/use-get-menu.ts
|
|
5597
|
-
var
|
|
6623
|
+
var import_react_query48 = require("@tanstack/react-query");
|
|
5598
6624
|
var useGetMenu = (context, enabled) => {
|
|
5599
|
-
return (0,
|
|
6625
|
+
return (0, import_react_query48.useQuery)({
|
|
5600
6626
|
queryKey: ["menus" /* MENU */, context],
|
|
5601
6627
|
queryFn: () => view_service_default.getMenu(context).then((res) => {
|
|
5602
6628
|
if (res && res?.records && res?.records?.length > 0) {
|
|
@@ -5612,9 +6638,9 @@ var useGetMenu = (context, enabled) => {
|
|
|
5612
6638
|
var use_get_menu_default = useGetMenu;
|
|
5613
6639
|
|
|
5614
6640
|
// src/hooks/view/use-get-print-report.ts
|
|
5615
|
-
var
|
|
6641
|
+
var import_react_query49 = require("@tanstack/react-query");
|
|
5616
6642
|
var useGetPrintReport = () => {
|
|
5617
|
-
return (0,
|
|
6643
|
+
return (0, import_react_query49.useMutation)({
|
|
5618
6644
|
mutationFn: ({ id }) => action_service_default.getPrintReportName({
|
|
5619
6645
|
id
|
|
5620
6646
|
})
|
|
@@ -5623,14 +6649,14 @@ var useGetPrintReport = () => {
|
|
|
5623
6649
|
var use_get_print_report_default = useGetPrintReport;
|
|
5624
6650
|
|
|
5625
6651
|
// src/hooks/view/use-get-progress-bar.ts
|
|
5626
|
-
var
|
|
6652
|
+
var import_react_query50 = require("@tanstack/react-query");
|
|
5627
6653
|
var useGetProGressBar = ({
|
|
5628
6654
|
field,
|
|
5629
6655
|
color,
|
|
5630
6656
|
model,
|
|
5631
6657
|
width_context
|
|
5632
6658
|
}) => {
|
|
5633
|
-
return (0,
|
|
6659
|
+
return (0, import_react_query50.useQuery)({
|
|
5634
6660
|
queryKey: [],
|
|
5635
6661
|
queryFn: () => kanban_service_default.getProgressBar({
|
|
5636
6662
|
field,
|
|
@@ -5649,13 +6675,13 @@ var useGetProGressBar = ({
|
|
|
5649
6675
|
var use_get_progress_bar_default = useGetProGressBar;
|
|
5650
6676
|
|
|
5651
6677
|
// src/hooks/view/use-get-selection.ts
|
|
5652
|
-
var
|
|
6678
|
+
var import_react_query51 = require("@tanstack/react-query");
|
|
5653
6679
|
var useGetSelection = ({
|
|
5654
6680
|
data,
|
|
5655
6681
|
queryKey,
|
|
5656
6682
|
enabled
|
|
5657
6683
|
}) => {
|
|
5658
|
-
return (0,
|
|
6684
|
+
return (0, import_react_query51.useQuery)({
|
|
5659
6685
|
queryKey,
|
|
5660
6686
|
queryFn: () => view_service_default.getSelectionItem({ data }),
|
|
5661
6687
|
enabled,
|
|
@@ -5665,9 +6691,9 @@ var useGetSelection = ({
|
|
|
5665
6691
|
var use_get_selection_default = useGetSelection;
|
|
5666
6692
|
|
|
5667
6693
|
// src/hooks/view/use-get-view.ts
|
|
5668
|
-
var
|
|
6694
|
+
var import_react_query52 = require("@tanstack/react-query");
|
|
5669
6695
|
var useGetView = (viewParams, actData) => {
|
|
5670
|
-
return (0,
|
|
6696
|
+
return (0, import_react_query52.useQuery)({
|
|
5671
6697
|
queryKey: ["get_view_by_action" /* GET_VIEW_BY_ACTION */, viewParams],
|
|
5672
6698
|
queryFn: () => view_service_default.getView(viewParams),
|
|
5673
6699
|
enabled: !!actData,
|
|
@@ -5678,9 +6704,9 @@ var useGetView = (viewParams, actData) => {
|
|
|
5678
6704
|
var use_get_view_default = useGetView;
|
|
5679
6705
|
|
|
5680
6706
|
// src/hooks/view/use-load-action.ts
|
|
5681
|
-
var
|
|
6707
|
+
var import_react_query53 = require("@tanstack/react-query");
|
|
5682
6708
|
var useLoadAction = () => {
|
|
5683
|
-
return (0,
|
|
6709
|
+
return (0, import_react_query53.useMutation)({
|
|
5684
6710
|
mutationFn: ({
|
|
5685
6711
|
idAction,
|
|
5686
6712
|
context
|
|
@@ -5695,9 +6721,9 @@ var useLoadAction = () => {
|
|
|
5695
6721
|
var use_load_action_default = useLoadAction;
|
|
5696
6722
|
|
|
5697
6723
|
// src/hooks/view/use-load-message.ts
|
|
5698
|
-
var
|
|
6724
|
+
var import_react_query54 = require("@tanstack/react-query");
|
|
5699
6725
|
var useLoadMessage = () => {
|
|
5700
|
-
return (0,
|
|
6726
|
+
return (0, import_react_query54.useQuery)({
|
|
5701
6727
|
queryKey: [`load-message-failure`],
|
|
5702
6728
|
queryFn: () => view_service_default.loadMessages(),
|
|
5703
6729
|
refetchOnWindowFocus: false
|
|
@@ -5706,9 +6732,9 @@ var useLoadMessage = () => {
|
|
|
5706
6732
|
var use_load_message_default = useLoadMessage;
|
|
5707
6733
|
|
|
5708
6734
|
// src/hooks/view/use-print.ts
|
|
5709
|
-
var
|
|
6735
|
+
var import_react_query55 = require("@tanstack/react-query");
|
|
5710
6736
|
var usePrint = () => {
|
|
5711
|
-
return (0,
|
|
6737
|
+
return (0, import_react_query55.useMutation)({
|
|
5712
6738
|
mutationFn: ({ id, report, db }) => action_service_default.print({
|
|
5713
6739
|
id,
|
|
5714
6740
|
report,
|
|
@@ -5719,9 +6745,9 @@ var usePrint = () => {
|
|
|
5719
6745
|
var use_print_default = usePrint;
|
|
5720
6746
|
|
|
5721
6747
|
// src/hooks/view/use-remove-row.ts
|
|
5722
|
-
var
|
|
6748
|
+
var import_react_query56 = require("@tanstack/react-query");
|
|
5723
6749
|
var useRemoveRow = () => {
|
|
5724
|
-
return (0,
|
|
6750
|
+
return (0, import_react_query56.useMutation)({
|
|
5725
6751
|
mutationFn: ({
|
|
5726
6752
|
model,
|
|
5727
6753
|
ids,
|
|
@@ -5736,9 +6762,9 @@ var useRemoveRow = () => {
|
|
|
5736
6762
|
var use_remove_row_default = useRemoveRow;
|
|
5737
6763
|
|
|
5738
6764
|
// src/hooks/view/use-resequence.ts
|
|
5739
|
-
var
|
|
6765
|
+
var import_react_query57 = require("@tanstack/react-query");
|
|
5740
6766
|
var useGetResequence = (model, resIds, context, offset) => {
|
|
5741
|
-
return (0,
|
|
6767
|
+
return (0, import_react_query57.useQuery)({
|
|
5742
6768
|
queryKey: [],
|
|
5743
6769
|
queryFn: () => view_service_default.getResequence({
|
|
5744
6770
|
model,
|
|
@@ -5753,9 +6779,9 @@ var useGetResequence = (model, resIds, context, offset) => {
|
|
|
5753
6779
|
var use_resequence_default = useGetResequence;
|
|
5754
6780
|
|
|
5755
6781
|
// src/hooks/view/use-run-action.ts
|
|
5756
|
-
var
|
|
6782
|
+
var import_react_query58 = require("@tanstack/react-query");
|
|
5757
6783
|
var useRunAction = () => {
|
|
5758
|
-
return (0,
|
|
6784
|
+
return (0, import_react_query58.useMutation)({
|
|
5759
6785
|
mutationFn: ({
|
|
5760
6786
|
idAction,
|
|
5761
6787
|
context
|
|
@@ -5768,9 +6794,9 @@ var useRunAction = () => {
|
|
|
5768
6794
|
var use_run_action_default = useRunAction;
|
|
5769
6795
|
|
|
5770
6796
|
// src/hooks/view/use-signin-sso.ts
|
|
5771
|
-
var
|
|
6797
|
+
var import_react_query59 = require("@tanstack/react-query");
|
|
5772
6798
|
var useSignInSSO = () => {
|
|
5773
|
-
return (0,
|
|
6799
|
+
return (0, import_react_query59.useMutation)({
|
|
5774
6800
|
mutationFn: ({
|
|
5775
6801
|
redirect_uri,
|
|
5776
6802
|
state,
|
|
@@ -5791,9 +6817,9 @@ var useSignInSSO = () => {
|
|
|
5791
6817
|
var use_signin_sso_default = useSignInSSO;
|
|
5792
6818
|
|
|
5793
6819
|
// src/hooks/view/use-verify-2FA.ts
|
|
5794
|
-
var
|
|
6820
|
+
var import_react_query60 = require("@tanstack/react-query");
|
|
5795
6821
|
var useVerify2FA = () => {
|
|
5796
|
-
return (0,
|
|
6822
|
+
return (0, import_react_query60.useMutation)({
|
|
5797
6823
|
mutationFn: ({
|
|
5798
6824
|
method,
|
|
5799
6825
|
with_context,
|
|
@@ -5814,9 +6840,9 @@ var useVerify2FA = () => {
|
|
|
5814
6840
|
var use_verify_2FA_default = useVerify2FA;
|
|
5815
6841
|
|
|
5816
6842
|
// src/hooks/view/uset-get-2FA-method.ts
|
|
5817
|
-
var
|
|
6843
|
+
var import_react_query61 = require("@tanstack/react-query");
|
|
5818
6844
|
var useGet2FAMethods = () => {
|
|
5819
|
-
return (0,
|
|
6845
|
+
return (0, import_react_query61.useMutation)({
|
|
5820
6846
|
mutationFn: ({
|
|
5821
6847
|
method,
|
|
5822
6848
|
with_context
|
|
@@ -5831,9 +6857,9 @@ var useGet2FAMethods = () => {
|
|
|
5831
6857
|
var uset_get_2FA_method_default = useGet2FAMethods;
|
|
5832
6858
|
|
|
5833
6859
|
// src/hooks/view/use-get-fields-view-security.ts
|
|
5834
|
-
var
|
|
6860
|
+
var import_react_query62 = require("@tanstack/react-query");
|
|
5835
6861
|
var useGetFieldsViewSecurity = () => {
|
|
5836
|
-
return (0,
|
|
6862
|
+
return (0, import_react_query62.useMutation)({
|
|
5837
6863
|
mutationFn: ({
|
|
5838
6864
|
method,
|
|
5839
6865
|
token,
|
|
@@ -5850,9 +6876,9 @@ var useGetFieldsViewSecurity = () => {
|
|
|
5850
6876
|
var use_get_fields_view_security_default = useGetFieldsViewSecurity;
|
|
5851
6877
|
|
|
5852
6878
|
// src/hooks/view/use-grant-access.ts
|
|
5853
|
-
var
|
|
6879
|
+
var import_react_query63 = require("@tanstack/react-query");
|
|
5854
6880
|
var useGrantAccess = () => {
|
|
5855
|
-
return (0,
|
|
6881
|
+
return (0, import_react_query63.useMutation)({
|
|
5856
6882
|
mutationFn: ({
|
|
5857
6883
|
redirect_uri,
|
|
5858
6884
|
state,
|
|
@@ -5871,9 +6897,9 @@ var useGrantAccess = () => {
|
|
|
5871
6897
|
var use_grant_access_default = useGrantAccess;
|
|
5872
6898
|
|
|
5873
6899
|
// src/hooks/view/use-remove-totp-setup.ts
|
|
5874
|
-
var
|
|
6900
|
+
var import_react_query64 = require("@tanstack/react-query");
|
|
5875
6901
|
var useRemoveTotpSetup = () => {
|
|
5876
|
-
return (0,
|
|
6902
|
+
return (0, import_react_query64.useMutation)({
|
|
5877
6903
|
mutationFn: ({ method, token }) => {
|
|
5878
6904
|
return view_service_default.removeTotpSetUp({
|
|
5879
6905
|
method,
|
|
@@ -5885,9 +6911,9 @@ var useRemoveTotpSetup = () => {
|
|
|
5885
6911
|
var use_remove_totp_setup_default = useRemoveTotpSetup;
|
|
5886
6912
|
|
|
5887
6913
|
// src/hooks/view/use-request-setup-totp.ts
|
|
5888
|
-
var
|
|
6914
|
+
var import_react_query65 = require("@tanstack/react-query");
|
|
5889
6915
|
var useRequestSetupTotp = () => {
|
|
5890
|
-
return (0,
|
|
6916
|
+
return (0, import_react_query65.useMutation)({
|
|
5891
6917
|
mutationFn: ({ method, token }) => {
|
|
5892
6918
|
return view_service_default.requestSetupTotp({
|
|
5893
6919
|
method,
|
|
@@ -5899,9 +6925,9 @@ var useRequestSetupTotp = () => {
|
|
|
5899
6925
|
var use_request_setup_totp_default = useRequestSetupTotp;
|
|
5900
6926
|
|
|
5901
6927
|
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
5902
|
-
var
|
|
6928
|
+
var import_react_query66 = require("@tanstack/react-query");
|
|
5903
6929
|
var useSettingsWebRead2fa = () => {
|
|
5904
|
-
return (0,
|
|
6930
|
+
return (0, import_react_query66.useMutation)({
|
|
5905
6931
|
mutationFn: ({
|
|
5906
6932
|
method,
|
|
5907
6933
|
token,
|
|
@@ -5920,9 +6946,9 @@ var useSettingsWebRead2fa = () => {
|
|
|
5920
6946
|
var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
|
|
5921
6947
|
|
|
5922
6948
|
// src/hooks/view/use-verify-totp.ts
|
|
5923
|
-
var
|
|
6949
|
+
var import_react_query67 = require("@tanstack/react-query");
|
|
5924
6950
|
var useVerifyTotp = () => {
|
|
5925
|
-
return (0,
|
|
6951
|
+
return (0, import_react_query67.useMutation)({
|
|
5926
6952
|
mutationFn: ({
|
|
5927
6953
|
method,
|
|
5928
6954
|
action_token,
|
|
@@ -5937,8 +6963,212 @@ var useVerifyTotp = () => {
|
|
|
5937
6963
|
});
|
|
5938
6964
|
};
|
|
5939
6965
|
var use_verify_totp_default = useVerifyTotp;
|
|
6966
|
+
|
|
6967
|
+
// src/provider/react-query-provider.tsx
|
|
6968
|
+
var import_react_query68 = require("@tanstack/react-query");
|
|
6969
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
6970
|
+
var ReactQueryProvider = ({ children }) => {
|
|
6971
|
+
const queryClient = new import_react_query68.QueryClient({
|
|
6972
|
+
defaultOptions: {
|
|
6973
|
+
queries: {
|
|
6974
|
+
// placeholderData: keepPreviousData,
|
|
6975
|
+
refetchOnWindowFocus: false,
|
|
6976
|
+
refetchOnMount: false,
|
|
6977
|
+
refetchOnReconnect: false,
|
|
6978
|
+
retry: false
|
|
6979
|
+
}
|
|
6980
|
+
}
|
|
6981
|
+
});
|
|
6982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query68.QueryClientProvider, { client: queryClient, children });
|
|
6983
|
+
};
|
|
6984
|
+
|
|
6985
|
+
// src/provider/redux-provider.tsx
|
|
6986
|
+
var import_react_redux2 = require("react-redux");
|
|
6987
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
6988
|
+
var ReduxProvider = ({ children }) => {
|
|
6989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_redux2.Provider, { store: envStore, children });
|
|
6990
|
+
};
|
|
6991
|
+
|
|
6992
|
+
// src/provider/main-provider.tsx
|
|
6993
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
6994
|
+
var MainProvider = ({ children }) => {
|
|
6995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReduxProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ReactQueryProvider, { children }) });
|
|
6996
|
+
};
|
|
6997
|
+
|
|
6998
|
+
// src/provider/version-gate-provider.tsx
|
|
6999
|
+
var import_react2 = require("react");
|
|
7000
|
+
var import_react_query69 = require("@tanstack/react-query");
|
|
7001
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
7002
|
+
var VersionGate = ({ children }) => {
|
|
7003
|
+
const queryClient = (0, import_react_query69.useQueryClient)();
|
|
7004
|
+
const [ready, setReady] = (0, import_react2.useState)(false);
|
|
7005
|
+
(0, import_react2.useEffect)(() => {
|
|
7006
|
+
const clearVersion = () => {
|
|
7007
|
+
queryClient.clear();
|
|
7008
|
+
localStorage.removeItem("__api_version__");
|
|
7009
|
+
};
|
|
7010
|
+
const validateVersion = async () => {
|
|
7011
|
+
const serverVersion = await view_service_default.getVersion();
|
|
7012
|
+
const cached = localStorage.getItem("__api_version__");
|
|
7013
|
+
if (cached !== serverVersion?.api_version) {
|
|
7014
|
+
clearVersion();
|
|
7015
|
+
localStorage.setItem("__api_version__", serverVersion?.api_version);
|
|
7016
|
+
} else {
|
|
7017
|
+
console.log("Api version:", serverVersion?.api_version);
|
|
7018
|
+
}
|
|
7019
|
+
setReady(true);
|
|
7020
|
+
};
|
|
7021
|
+
validateVersion();
|
|
7022
|
+
if (typeof window !== "undefined") {
|
|
7023
|
+
const onKey = (e) => {
|
|
7024
|
+
const key = e.key.toLowerCase();
|
|
7025
|
+
const isHardRefresh = (key === "f5" || key === "r") && e.ctrlKey && (key !== "r" || e.shiftKey) || key === "r" && e.metaKey && e.shiftKey || key === "r" && e.metaKey && e.altKey;
|
|
7026
|
+
if (isHardRefresh) clearVersion();
|
|
7027
|
+
};
|
|
7028
|
+
window.addEventListener("keydown", onKey);
|
|
7029
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
7030
|
+
}
|
|
7031
|
+
}, [queryClient]);
|
|
7032
|
+
return ready ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children }) : null;
|
|
7033
|
+
};
|
|
5940
7034
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5941
7035
|
0 && (module.exports = {
|
|
7036
|
+
ActionService,
|
|
7037
|
+
AuthService,
|
|
7038
|
+
CompanyService,
|
|
7039
|
+
ComponentType,
|
|
7040
|
+
EnvStore,
|
|
7041
|
+
ExcelService,
|
|
7042
|
+
FieldTypeConstants,
|
|
7043
|
+
FormService,
|
|
7044
|
+
KanbanService,
|
|
7045
|
+
KeyConstants,
|
|
7046
|
+
MainProvider,
|
|
7047
|
+
MethodConstants,
|
|
7048
|
+
MethodType,
|
|
7049
|
+
ModelConstants,
|
|
7050
|
+
ModelService,
|
|
7051
|
+
ReactQueryProvider,
|
|
7052
|
+
SearchType,
|
|
7053
|
+
UriConstants,
|
|
7054
|
+
UserService,
|
|
7055
|
+
VersionGate,
|
|
7056
|
+
ViewService,
|
|
7057
|
+
WIDGETAVATAR,
|
|
7058
|
+
WIDGETCOLOR,
|
|
7059
|
+
WIDGETCURRENCY,
|
|
7060
|
+
WIDGETNOSTRING,
|
|
7061
|
+
WIDGETSTATUS,
|
|
7062
|
+
WesapError,
|
|
7063
|
+
axiosClient,
|
|
7064
|
+
breadcrumbsSlice,
|
|
7065
|
+
checkIsImageLink,
|
|
7066
|
+
clearSearchMap,
|
|
7067
|
+
convertFloatToTime,
|
|
7068
|
+
convertTimeToFloat,
|
|
7069
|
+
copyTextToClipboard,
|
|
7070
|
+
domainHelper,
|
|
7071
|
+
env,
|
|
7072
|
+
envSlice,
|
|
7073
|
+
envStore,
|
|
7074
|
+
evalJSONContext,
|
|
7075
|
+
evalJSONDomain,
|
|
7076
|
+
excelSlice,
|
|
7077
|
+
filterFieldDirty,
|
|
7078
|
+
formSlice,
|
|
7079
|
+
formatCurrency,
|
|
7080
|
+
formatDate,
|
|
7081
|
+
formatFileSize,
|
|
7082
|
+
formatSortingString,
|
|
7083
|
+
formatUrlPath,
|
|
7084
|
+
getEnv,
|
|
7085
|
+
getFieldsOnChange,
|
|
7086
|
+
getOffSet,
|
|
7087
|
+
getSubdomain,
|
|
7088
|
+
handleError,
|
|
7089
|
+
headerSlice,
|
|
7090
|
+
initEnv,
|
|
7091
|
+
isBase64File,
|
|
7092
|
+
isBase64Image,
|
|
7093
|
+
isObjectEmpty,
|
|
7094
|
+
listSlice,
|
|
7095
|
+
loginSlice,
|
|
7096
|
+
mergeObjects,
|
|
7097
|
+
navbarSlice,
|
|
7098
|
+
profileSlice,
|
|
7099
|
+
removeKeyFromSearchMap,
|
|
7100
|
+
removeUndefinedFields,
|
|
7101
|
+
resequence,
|
|
7102
|
+
searchSlice,
|
|
7103
|
+
selectBreadCrumbs,
|
|
7104
|
+
selectEnv,
|
|
7105
|
+
selectExcel,
|
|
7106
|
+
selectForm,
|
|
7107
|
+
selectHeader,
|
|
7108
|
+
selectList,
|
|
7109
|
+
selectLogin,
|
|
7110
|
+
selectNavbar,
|
|
7111
|
+
selectProfile,
|
|
7112
|
+
selectSearch,
|
|
7113
|
+
selectSearchMap,
|
|
7114
|
+
setAllowCompanies,
|
|
7115
|
+
setAllowedCompanyIds,
|
|
7116
|
+
setBreadCrumbs,
|
|
7117
|
+
setCompanies,
|
|
7118
|
+
setConfig,
|
|
7119
|
+
setDataParse,
|
|
7120
|
+
setDataUser,
|
|
7121
|
+
setDb,
|
|
7122
|
+
setDefaultCompany,
|
|
7123
|
+
setDomainTable,
|
|
7124
|
+
setEnv,
|
|
7125
|
+
setEnvFile,
|
|
7126
|
+
setErrorData,
|
|
7127
|
+
setFieldTranslate,
|
|
7128
|
+
setFields,
|
|
7129
|
+
setFilterBy,
|
|
7130
|
+
setFirstDomain,
|
|
7131
|
+
setForgotPasswordUrl,
|
|
7132
|
+
setFormSubmitComponent,
|
|
7133
|
+
setGroupBy,
|
|
7134
|
+
setGroupByDomain,
|
|
7135
|
+
setHeader,
|
|
7136
|
+
setHoveredIndexSearchList,
|
|
7137
|
+
setIdFile,
|
|
7138
|
+
setIndexRowTableModal,
|
|
7139
|
+
setIsFileLoaded,
|
|
7140
|
+
setIsShowModalTranslate,
|
|
7141
|
+
setIsShowingModalDetail,
|
|
7142
|
+
setIsUpdateTableModal,
|
|
7143
|
+
setLang,
|
|
7144
|
+
setListSubject,
|
|
7145
|
+
setLoadingImport,
|
|
7146
|
+
setMenuFocus,
|
|
7147
|
+
setMenuFocusAction,
|
|
7148
|
+
setMenuList,
|
|
7149
|
+
setNavbarWidth,
|
|
7150
|
+
setOrder,
|
|
7151
|
+
setPage,
|
|
7152
|
+
setPageLimit,
|
|
7153
|
+
setProfile,
|
|
7154
|
+
setRedirectTo,
|
|
7155
|
+
setSearchBy,
|
|
7156
|
+
setSearchMap,
|
|
7157
|
+
setSearchString,
|
|
7158
|
+
setSelectedFile,
|
|
7159
|
+
setSelectedRadioKey,
|
|
7160
|
+
setSelectedRowKeys,
|
|
7161
|
+
setSelectedTags,
|
|
7162
|
+
setTransferDetail,
|
|
7163
|
+
setUid,
|
|
7164
|
+
setUser,
|
|
7165
|
+
setViewDataStore,
|
|
7166
|
+
stringToColor,
|
|
7167
|
+
toQueryString,
|
|
7168
|
+
updateSearchMap,
|
|
7169
|
+
updateTokenParamInOriginalRequest,
|
|
7170
|
+
useAppDispatch,
|
|
7171
|
+
useAppSelector,
|
|
5942
7172
|
useButton,
|
|
5943
7173
|
useChangeStatus,
|
|
5944
7174
|
useDelete,
|
|
@@ -5946,6 +7176,7 @@ var use_verify_totp_default = useVerifyTotp;
|
|
|
5946
7176
|
useDuplicateRecord,
|
|
5947
7177
|
useExecuteImport,
|
|
5948
7178
|
useExportExcel,
|
|
7179
|
+
useField,
|
|
5949
7180
|
useForgotPassword,
|
|
5950
7181
|
useForgotPasswordSSO,
|
|
5951
7182
|
useGet2FAMethods,
|
|
@@ -6001,10 +7232,14 @@ var use_verify_totp_default = useVerifyTotp;
|
|
|
6001
7232
|
useSettingsWebRead2fa,
|
|
6002
7233
|
useSignInSSO,
|
|
6003
7234
|
useSwitchLocale,
|
|
7235
|
+
useTabModel,
|
|
6004
7236
|
useUpdatePassword,
|
|
6005
7237
|
useUploadFile,
|
|
6006
7238
|
useUploadIdFile,
|
|
6007
7239
|
useUploadImage,
|
|
7240
|
+
useValidateActionToken,
|
|
6008
7241
|
useVerify2FA,
|
|
6009
|
-
useVerifyTotp
|
|
7242
|
+
useVerifyTotp,
|
|
7243
|
+
validateAndParseDate
|
|
6010
7244
|
});
|
|
7245
|
+
//# sourceMappingURL=index.js.map
|