@fctc/interface-logic 1.8.2 → 1.8.4
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/configs.d.mts +12 -0
- package/dist/configs.d.ts +12 -0
- package/dist/configs.js +2386 -0
- package/dist/configs.mjs +2349 -0
- package/dist/constants.d.mts +131 -0
- package/dist/constants.d.ts +131 -0
- package/dist/constants.js +205 -0
- package/dist/constants.mjs +166 -0
- package/dist/environment.d.mts +53 -0
- package/dist/environment.d.ts +53 -0
- package/dist/environment.js +3080 -0
- package/dist/environment.mjs +3042 -0
- package/dist/hooks.d.mts +359 -0
- package/dist/hooks.d.ts +359 -0
- package/dist/{index.js → hooks.js} +203 -1435
- package/dist/{index.mjs → hooks.mjs} +159 -1251
- package/dist/provider.d.mts +16 -0
- package/dist/provider.d.ts +16 -0
- package/dist/provider.js +3600 -0
- package/dist/provider.mjs +3561 -0
- package/dist/services.d.mts +255 -0
- package/dist/services.d.ts +255 -0
- package/dist/services.js +4653 -0
- package/dist/services.mjs +4608 -0
- package/dist/store.d.mts +377 -0
- package/dist/store.d.ts +377 -0
- package/dist/store.js +814 -0
- package/dist/store.mjs +709 -0
- package/dist/types.d.mts +17 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.js +18 -0
- package/dist/types.mjs +0 -0
- package/dist/utils.d.mts +93 -0
- package/dist/utils.d.ts +93 -0
- package/dist/utils.js +2962 -0
- package/dist/utils.mjs +2896 -0
- package/dist/view-type-D8ukwj_2.d.mts +113 -0
- package/dist/view-type-D8ukwj_2.d.ts +113 -0
- package/package.json +1 -1
- package/dist/index.d.mts +0 -1681
- package/dist/index.d.ts +0 -1681
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -27,145 +27,9 @@ 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(
|
|
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,
|
|
30
|
+
// src/hooks.ts
|
|
31
|
+
var hooks_exports = {};
|
|
32
|
+
__export(hooks_exports, {
|
|
169
33
|
useButton: () => use_button_default,
|
|
170
34
|
useChangeStatus: () => use_change_status_default,
|
|
171
35
|
useDelete: () => use_delete_default,
|
|
@@ -173,7 +37,6 @@ __export(index_exports, {
|
|
|
173
37
|
useDuplicateRecord: () => use_duplicate_record_default,
|
|
174
38
|
useExecuteImport: () => uss_execute_import_default,
|
|
175
39
|
useExportExcel: () => use_export_excel_default,
|
|
176
|
-
useField: () => useField,
|
|
177
40
|
useForgotPassword: () => use_forgot_password_default,
|
|
178
41
|
useForgotPasswordSSO: () => use_forgotpassword_sso_default,
|
|
179
42
|
useGet2FAMethods: () => uset_get_2FA_method_default,
|
|
@@ -229,49 +92,17 @@ __export(index_exports, {
|
|
|
229
92
|
useSettingsWebRead2fa: () => use_settings_web_read_2fa_default,
|
|
230
93
|
useSignInSSO: () => use_signin_sso_default,
|
|
231
94
|
useSwitchLocale: () => use_switch_locale_default,
|
|
232
|
-
useTabModel: () => useTabModel,
|
|
233
95
|
useUpdatePassword: () => use_update_password_default,
|
|
234
96
|
useUploadFile: () => use_upload_file_default,
|
|
235
97
|
useUploadIdFile: () => use_upload_id_file_default,
|
|
236
98
|
useUploadImage: () => use_upload_image_default,
|
|
237
|
-
useValidateActionToken: () => use_validate_action_token_default,
|
|
238
99
|
useVerify2FA: () => use_verify_2FA_default,
|
|
239
|
-
useVerifyTotp: () => use_verify_totp_default
|
|
240
|
-
validateAndParseDate: () => validateAndParseDate
|
|
100
|
+
useVerifyTotp: () => use_verify_totp_default
|
|
241
101
|
});
|
|
242
|
-
module.exports = __toCommonJS(
|
|
102
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
243
103
|
|
|
244
|
-
// src/
|
|
245
|
-
var
|
|
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 || {});
|
|
104
|
+
// src/hooks/auth/use-forgot-password.ts
|
|
105
|
+
var import_react_query = require("@tanstack/react-query");
|
|
275
106
|
|
|
276
107
|
// src/constants/api/uri-constant.ts
|
|
277
108
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -303,380 +134,11 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
303
134
|
return UriConstants2;
|
|
304
135
|
})(UriConstants || {});
|
|
305
136
|
|
|
306
|
-
// src/
|
|
307
|
-
var
|
|
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
|
-
}
|
|
137
|
+
// src/configs/axios-client.ts
|
|
138
|
+
var import_axios = __toESM(require("axios"));
|
|
321
139
|
|
|
322
140
|
// src/utils/format.ts
|
|
323
141
|
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
|
-
};
|
|
680
142
|
|
|
681
143
|
// src/constants/widget/widget-avatar-constant.ts
|
|
682
144
|
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
@@ -684,28 +146,6 @@ var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
|
684
146
|
WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
|
|
685
147
|
return WIDGETAVATAR2;
|
|
686
148
|
})(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 || {});
|
|
709
149
|
|
|
710
150
|
// src/utils/domain/py_tokenizer.ts
|
|
711
151
|
var TokenizerError = class extends Error {
|
|
@@ -2474,48 +1914,6 @@ function parseExpr(expr) {
|
|
|
2474
1914
|
const tokens = tokenize(expr);
|
|
2475
1915
|
return parse(tokens);
|
|
2476
1916
|
}
|
|
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
|
-
}
|
|
2519
1917
|
|
|
2520
1918
|
// src/utils/domain/objects.ts
|
|
2521
1919
|
function shallowEqual(obj1, obj2, comparisonFn = (a, b) => a === b) {
|
|
@@ -2854,280 +2252,14 @@ function matchDomain(record, domain) {
|
|
|
2854
2252
|
}
|
|
2855
2253
|
return matchCondition(record, condStack.pop());
|
|
2856
2254
|
}
|
|
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
|
-
};
|
|
2889
2255
|
|
|
2890
2256
|
// src/utils/function.ts
|
|
2891
2257
|
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
|
-
};
|
|
2937
2258
|
var toQueryString = (params) => {
|
|
2938
2259
|
return Object.keys(params).map(
|
|
2939
2260
|
(key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
|
|
2940
2261
|
).join("&");
|
|
2941
2262
|
};
|
|
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
|
-
};
|
|
3131
2263
|
var isBase64File = (str) => {
|
|
3132
2264
|
try {
|
|
3133
2265
|
const dataUriPattern = /^data:([a-zA-Z]+\/[a-zA-Z0-9-.+]+)?;base64,/;
|
|
@@ -3143,69 +2275,6 @@ var isBase64File = (str) => {
|
|
|
3143
2275
|
return false;
|
|
3144
2276
|
}
|
|
3145
2277
|
};
|
|
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
|
-
};
|
|
3209
2278
|
var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
3210
2279
|
if (!originalRequest.data) return originalRequest.data;
|
|
3211
2280
|
if (typeof originalRequest.data === "string") {
|
|
@@ -3225,41 +2294,6 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
|
3225
2294
|
}
|
|
3226
2295
|
return originalRequest.data;
|
|
3227
2296
|
};
|
|
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
|
-
};
|
|
3263
2297
|
|
|
3264
2298
|
// src/utils/storage/local-storage.ts
|
|
3265
2299
|
var localStorageUtils = () => {
|
|
@@ -3301,9 +2335,9 @@ var sessionStorageUtils = () => {
|
|
|
3301
2335
|
// src/configs/axios-client.ts
|
|
3302
2336
|
var axiosClient = {
|
|
3303
2337
|
init(config) {
|
|
3304
|
-
const localStorage2 = config
|
|
3305
|
-
const sessionStorage2 = config
|
|
3306
|
-
const db = config
|
|
2338
|
+
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2339
|
+
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
2340
|
+
const db = config?.db;
|
|
3307
2341
|
let isRefreshing = false;
|
|
3308
2342
|
let failedQueue = [];
|
|
3309
2343
|
const processQueue = (error, token = null) => {
|
|
@@ -3322,16 +2356,19 @@ var axiosClient = {
|
|
|
3322
2356
|
timeout: 5e4,
|
|
3323
2357
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
3324
2358
|
});
|
|
3325
|
-
instance.interceptors.request.use(
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
2359
|
+
instance.interceptors.request.use(
|
|
2360
|
+
async (config2) => {
|
|
2361
|
+
const useRefreshToken = config2.useRefreshToken;
|
|
2362
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2363
|
+
if (token) {
|
|
2364
|
+
config2.headers["Authorization"] = "Bearer " + token;
|
|
2365
|
+
}
|
|
2366
|
+
return config2;
|
|
2367
|
+
},
|
|
2368
|
+
(error) => {
|
|
2369
|
+
Promise.reject(error);
|
|
2370
|
+
}
|
|
2371
|
+
);
|
|
3335
2372
|
instance.interceptors.response.use(
|
|
3336
2373
|
(response) => {
|
|
3337
2374
|
return handleResponse(response);
|
|
@@ -3489,7 +2526,6 @@ var breadcrumbsSlice = (0, import_toolkit.createSlice)({
|
|
|
3489
2526
|
}
|
|
3490
2527
|
});
|
|
3491
2528
|
var { setBreadCrumbs } = breadcrumbsSlice.actions;
|
|
3492
|
-
var selectBreadCrumbs = (state) => state.breadcrumbs;
|
|
3493
2529
|
var breadcrums_slice_default = breadcrumbsSlice.reducer;
|
|
3494
2530
|
|
|
3495
2531
|
// src/store/reducers/env-slice/index.ts
|
|
@@ -3558,7 +2594,6 @@ var {
|
|
|
3558
2594
|
setConfig,
|
|
3559
2595
|
setEnvFile
|
|
3560
2596
|
} = envSlice.actions;
|
|
3561
|
-
var selectEnv = (state) => state.env;
|
|
3562
2597
|
var env_slice_default = envSlice.reducer;
|
|
3563
2598
|
|
|
3564
2599
|
// src/store/reducers/excel-slice/index.ts
|
|
@@ -3603,7 +2638,6 @@ var {
|
|
|
3603
2638
|
setSelectedFile,
|
|
3604
2639
|
setErrorData
|
|
3605
2640
|
} = excelSlice.actions;
|
|
3606
|
-
var selectExcel = (state) => state.excel;
|
|
3607
2641
|
var excel_slice_default = excelSlice.reducer;
|
|
3608
2642
|
|
|
3609
2643
|
// src/store/reducers/form-slice/index.ts
|
|
@@ -3653,7 +2687,6 @@ var {
|
|
|
3653
2687
|
setListSubject,
|
|
3654
2688
|
setDataUser
|
|
3655
2689
|
} = formSlice.actions;
|
|
3656
|
-
var selectForm = (state) => state.form;
|
|
3657
2690
|
var form_slice_default = formSlice.reducer;
|
|
3658
2691
|
|
|
3659
2692
|
// src/store/reducers/header-slice/index.ts
|
|
@@ -3673,7 +2706,6 @@ var headerSlice = (0, import_toolkit5.createSlice)({
|
|
|
3673
2706
|
}
|
|
3674
2707
|
});
|
|
3675
2708
|
var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
|
|
3676
|
-
var selectHeader = (state) => state.header;
|
|
3677
2709
|
var header_slice_default = headerSlice.reducer;
|
|
3678
2710
|
|
|
3679
2711
|
// src/store/reducers/list-slice/index.ts
|
|
@@ -3739,7 +2771,6 @@ var {
|
|
|
3739
2771
|
setTransferDetail,
|
|
3740
2772
|
setDomainTable
|
|
3741
2773
|
} = listSlice.actions;
|
|
3742
|
-
var selectList = (state) => state.list;
|
|
3743
2774
|
var list_slice_default = listSlice.reducer;
|
|
3744
2775
|
|
|
3745
2776
|
// src/store/reducers/login-slice/index.ts
|
|
@@ -3765,7 +2796,6 @@ var loginSlice = (0, import_toolkit7.createSlice)({
|
|
|
3765
2796
|
}
|
|
3766
2797
|
});
|
|
3767
2798
|
var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
|
|
3768
|
-
var selectLogin = (state) => state.login;
|
|
3769
2799
|
var login_slice_default = loginSlice.reducer;
|
|
3770
2800
|
|
|
3771
2801
|
// src/store/reducers/navbar-slice/index.ts
|
|
@@ -3795,7 +2825,6 @@ var navbarSlice = (0, import_toolkit8.createSlice)({
|
|
|
3795
2825
|
}
|
|
3796
2826
|
});
|
|
3797
2827
|
var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSlice.actions;
|
|
3798
|
-
var selectNavbar = (state) => state.navbar;
|
|
3799
2828
|
var navbar_slice_default = navbarSlice.reducer;
|
|
3800
2829
|
|
|
3801
2830
|
// src/store/reducers/profile-slice/index.ts
|
|
@@ -3813,7 +2842,6 @@ var profileSlice = (0, import_toolkit9.createSlice)({
|
|
|
3813
2842
|
}
|
|
3814
2843
|
});
|
|
3815
2844
|
var { setProfile } = profileSlice.actions;
|
|
3816
|
-
var selectProfile = (state) => state.profile;
|
|
3817
2845
|
var profile_slice_default = profileSlice.reducer;
|
|
3818
2846
|
|
|
3819
2847
|
// src/store/reducers/search-slice/index.ts
|
|
@@ -3900,8 +2928,6 @@ var {
|
|
|
3900
2928
|
setGroupBy,
|
|
3901
2929
|
clearSearchMap
|
|
3902
2930
|
} = searchSlice.actions;
|
|
3903
|
-
var selectSearch = (state) => state.search;
|
|
3904
|
-
var selectSearchMap = (state) => state.search.searchMap;
|
|
3905
2931
|
var search_slice_default = searchSlice.reducer;
|
|
3906
2932
|
|
|
3907
2933
|
// src/store/store.ts
|
|
@@ -4096,101 +3122,77 @@ var envStore = (0, import_toolkit11.configureStore)({
|
|
|
4096
3122
|
})
|
|
4097
3123
|
});
|
|
4098
3124
|
|
|
4099
|
-
// src/store/index.ts
|
|
4100
|
-
var useAppDispatch = import_react_redux.useDispatch;
|
|
4101
|
-
var useAppSelector = import_react_redux.useSelector;
|
|
4102
|
-
|
|
4103
3125
|
// src/environment/EnvStore.ts
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
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 = {
|
|
3126
|
+
function createEnvStore(store, localStorageUtil, sessionStorageUtil) {
|
|
3127
|
+
const getEnvState = () => store.getState().env;
|
|
3128
|
+
const setupEnvConfig = () => {
|
|
3129
|
+
const env2 = getEnvState();
|
|
3130
|
+
return {
|
|
3131
|
+
baseUrl: env2?.baseUrl,
|
|
3132
|
+
requests: env2?.requests,
|
|
3133
|
+
context: env2?.context,
|
|
3134
|
+
defaultCompany: env2?.defaultCompany,
|
|
3135
|
+
config: env2?.config,
|
|
3136
|
+
companies: env2?.companies || [],
|
|
3137
|
+
user: env2?.user,
|
|
3138
|
+
db: env2?.db,
|
|
3139
|
+
refreshTokenEndpoint: env2?.refreshTokenEndpoint
|
|
3140
|
+
};
|
|
3141
|
+
};
|
|
3142
|
+
const setupEnv = (envConfig) => {
|
|
3143
|
+
const dispatch = store.dispatch;
|
|
3144
|
+
const updatedEnv = {
|
|
4138
3145
|
...envConfig,
|
|
4139
|
-
localStorageUtils:
|
|
4140
|
-
sessionStorageUtils:
|
|
3146
|
+
localStorageUtils: localStorageUtil,
|
|
3147
|
+
sessionStorageUtils: sessionStorageUtil
|
|
4141
3148
|
};
|
|
4142
|
-
const requests = axiosClient.init(
|
|
4143
|
-
dispatch(setEnv({ ...
|
|
4144
|
-
|
|
4145
|
-
}
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
dispatch(
|
|
4164
|
-
|
|
4165
|
-
}
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
sessionStorageUtils: sessionStorageUtils2
|
|
4181
|
-
}) {
|
|
4182
|
-
env = new EnvStore(envStore, localStorageUtils2, sessionStorageUtils2);
|
|
4183
|
-
return env;
|
|
3149
|
+
const requests = axiosClient.init(updatedEnv);
|
|
3150
|
+
dispatch(setEnv({ ...updatedEnv, requests }));
|
|
3151
|
+
return setupEnvConfig();
|
|
3152
|
+
};
|
|
3153
|
+
const setupUid = (uid) => {
|
|
3154
|
+
store.dispatch(setUid(uid));
|
|
3155
|
+
return setupEnvConfig();
|
|
3156
|
+
};
|
|
3157
|
+
const setupLang = (lang) => {
|
|
3158
|
+
store.dispatch(setLang(lang));
|
|
3159
|
+
return setupEnvConfig();
|
|
3160
|
+
};
|
|
3161
|
+
const setupAllowCompanies = (allowCompanies) => {
|
|
3162
|
+
store.dispatch(setAllowCompanies(allowCompanies));
|
|
3163
|
+
return setupEnvConfig();
|
|
3164
|
+
};
|
|
3165
|
+
const setupCompanies = (companies) => {
|
|
3166
|
+
store.dispatch(setCompanies(companies));
|
|
3167
|
+
return setupEnvConfig();
|
|
3168
|
+
};
|
|
3169
|
+
const setupDefaultCompany = (company) => {
|
|
3170
|
+
store.dispatch(setDefaultCompany(company));
|
|
3171
|
+
return setupEnvConfig();
|
|
3172
|
+
};
|
|
3173
|
+
const setUserInfo = (userInfo) => {
|
|
3174
|
+
store.dispatch(setUser(userInfo));
|
|
3175
|
+
return setupEnvConfig();
|
|
3176
|
+
};
|
|
3177
|
+
return {
|
|
3178
|
+
getEnvConfig: setupEnvConfig,
|
|
3179
|
+
setupEnv,
|
|
3180
|
+
setUid: setupUid,
|
|
3181
|
+
setLang: setupLang,
|
|
3182
|
+
setAllowCompanies: setupAllowCompanies,
|
|
3183
|
+
setCompanies: setupCompanies,
|
|
3184
|
+
setDefaultCompany: setupDefaultCompany,
|
|
3185
|
+
setUserInfo
|
|
3186
|
+
};
|
|
4184
3187
|
}
|
|
3188
|
+
var env = null;
|
|
4185
3189
|
function getEnv() {
|
|
4186
|
-
if (!env)
|
|
4187
|
-
env =
|
|
3190
|
+
if (!env) {
|
|
3191
|
+
env = createEnvStore(envStore, localStorageUtils(), sessionStorageUtils());
|
|
3192
|
+
}
|
|
4188
3193
|
return env;
|
|
4189
3194
|
}
|
|
4190
3195
|
|
|
4191
|
-
// src/hooks/auth/use-forgot-password.ts
|
|
4192
|
-
var import_react_query = require("@tanstack/react-query");
|
|
4193
|
-
|
|
4194
3196
|
// src/services/action-service/index.ts
|
|
4195
3197
|
var ActionService = {
|
|
4196
3198
|
// Load Action
|
|
@@ -4453,20 +3455,6 @@ var AuthService = {
|
|
|
4453
3455
|
}
|
|
4454
3456
|
});
|
|
4455
3457
|
},
|
|
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
|
-
},
|
|
4470
3458
|
async loginSocial({
|
|
4471
3459
|
db,
|
|
4472
3460
|
state,
|
|
@@ -5231,7 +4219,7 @@ var model_service_default = ModelService;
|
|
|
5231
4219
|
var UserService = {
|
|
5232
4220
|
async getProfile(path) {
|
|
5233
4221
|
const env2 = getEnv();
|
|
5234
|
-
return env2
|
|
4222
|
+
return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
5235
4223
|
headers: {
|
|
5236
4224
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
5237
4225
|
}
|
|
@@ -5550,8 +4538,8 @@ var ViewService = {
|
|
|
5550
4538
|
},
|
|
5551
4539
|
async getVersion() {
|
|
5552
4540
|
const env2 = getEnv();
|
|
5553
|
-
console.log("env", env2);
|
|
5554
|
-
return env2?.requests
|
|
4541
|
+
console.log("env?.requests", env2, env2?.requests);
|
|
4542
|
+
return env2?.requests?.get("", {
|
|
5555
4543
|
headers: {
|
|
5556
4544
|
"Content-Type": "application/json"
|
|
5557
4545
|
}
|
|
@@ -5868,40 +4856,26 @@ var useGetAccessByCode = () => {
|
|
|
5868
4856
|
};
|
|
5869
4857
|
var use_get_access_by_code_default = useGetAccessByCode;
|
|
5870
4858
|
|
|
5871
|
-
// src/hooks/auth/use-validate-action-token.ts
|
|
5872
|
-
var import_react_query12 = require("@tanstack/react-query");
|
|
5873
|
-
var useValidateActionToken = () => {
|
|
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
4859
|
// src/hooks/company/use-get-company-info.ts
|
|
5886
|
-
var
|
|
4860
|
+
var import_react_query12 = require("@tanstack/react-query");
|
|
5887
4861
|
var useGetCompanyInfo = () => {
|
|
5888
|
-
return (0,
|
|
4862
|
+
return (0, import_react_query12.useMutation)({
|
|
5889
4863
|
mutationFn: (id) => company_service_default.getInfoCompany(id)
|
|
5890
4864
|
});
|
|
5891
4865
|
};
|
|
5892
4866
|
var use_get_company_info_default = useGetCompanyInfo;
|
|
5893
4867
|
|
|
5894
4868
|
// src/hooks/company/use-get-current-company.ts
|
|
5895
|
-
var
|
|
4869
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
5896
4870
|
var useGetCurrentCompany = () => {
|
|
5897
|
-
return (0,
|
|
4871
|
+
return (0, import_react_query13.useMutation)({
|
|
5898
4872
|
mutationFn: () => company_service_default.getCurrentCompany()
|
|
5899
4873
|
});
|
|
5900
4874
|
};
|
|
5901
4875
|
var use_get_current_company_default = useGetCurrentCompany;
|
|
5902
4876
|
|
|
5903
4877
|
// src/hooks/company/use-get-list-company.ts
|
|
5904
|
-
var
|
|
4878
|
+
var import_react_query14 = require("@tanstack/react-query");
|
|
5905
4879
|
var useGetListCompany = (companyIDs = []) => {
|
|
5906
4880
|
const companySpec = {
|
|
5907
4881
|
id: {},
|
|
@@ -5912,7 +4886,7 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
5912
4886
|
ids: companyIDs,
|
|
5913
4887
|
specification: companySpec
|
|
5914
4888
|
};
|
|
5915
|
-
return (0,
|
|
4889
|
+
return (0, import_react_query14.useQuery)({
|
|
5916
4890
|
queryKey: ["list_company" /* LIST_COMPANY */, companyIDs],
|
|
5917
4891
|
queryFn: () => model_service_default.getList(getListParams),
|
|
5918
4892
|
refetchOnWindowFocus: false
|
|
@@ -5921,9 +4895,9 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
5921
4895
|
var use_get_list_company_default = useGetListCompany;
|
|
5922
4896
|
|
|
5923
4897
|
// src/hooks/excel/use-export-excel.ts
|
|
5924
|
-
var
|
|
4898
|
+
var import_react_query15 = require("@tanstack/react-query");
|
|
5925
4899
|
var useExportExcel = () => {
|
|
5926
|
-
return (0,
|
|
4900
|
+
return (0, import_react_query15.useMutation)({
|
|
5927
4901
|
mutationFn: ({
|
|
5928
4902
|
model,
|
|
5929
4903
|
domain,
|
|
@@ -5948,9 +4922,9 @@ var useExportExcel = () => {
|
|
|
5948
4922
|
var use_export_excel_default = useExportExcel;
|
|
5949
4923
|
|
|
5950
4924
|
// src/hooks/excel/use-get-field-export.ts
|
|
5951
|
-
var
|
|
4925
|
+
var import_react_query16 = require("@tanstack/react-query");
|
|
5952
4926
|
var useGetFieldExport = () => {
|
|
5953
|
-
return (0,
|
|
4927
|
+
return (0, import_react_query16.useMutation)({
|
|
5954
4928
|
mutationFn: ({
|
|
5955
4929
|
ids,
|
|
5956
4930
|
model,
|
|
@@ -5979,9 +4953,9 @@ var useGetFieldExport = () => {
|
|
|
5979
4953
|
var use_get_field_export_default = useGetFieldExport;
|
|
5980
4954
|
|
|
5981
4955
|
// src/hooks/excel/use-get-file-excel.ts
|
|
5982
|
-
var
|
|
4956
|
+
var import_react_query17 = require("@tanstack/react-query");
|
|
5983
4957
|
var useGetFileExcel = ({ model }) => {
|
|
5984
|
-
return (0,
|
|
4958
|
+
return (0, import_react_query17.useQuery)({
|
|
5985
4959
|
queryKey: [],
|
|
5986
4960
|
queryFn: () => excel_service_default.getFileExcel({
|
|
5987
4961
|
model
|
|
@@ -5997,9 +4971,9 @@ var useGetFileExcel = ({ model }) => {
|
|
|
5997
4971
|
var use_get_file_excel_default = useGetFileExcel;
|
|
5998
4972
|
|
|
5999
4973
|
// src/hooks/excel/use-parse-preview.ts
|
|
6000
|
-
var
|
|
4974
|
+
var import_react_query18 = require("@tanstack/react-query");
|
|
6001
4975
|
var useParsePreview = () => {
|
|
6002
|
-
return (0,
|
|
4976
|
+
return (0, import_react_query18.useMutation)({
|
|
6003
4977
|
mutationFn: ({
|
|
6004
4978
|
id,
|
|
6005
4979
|
selectedSheet,
|
|
@@ -6016,9 +4990,9 @@ var useParsePreview = () => {
|
|
|
6016
4990
|
var use_parse_preview_default = useParsePreview;
|
|
6017
4991
|
|
|
6018
4992
|
// src/hooks/excel/use-upload-file.ts
|
|
6019
|
-
var
|
|
4993
|
+
var import_react_query19 = require("@tanstack/react-query");
|
|
6020
4994
|
var useUploadFile = () => {
|
|
6021
|
-
return (0,
|
|
4995
|
+
return (0, import_react_query19.useMutation)({
|
|
6022
4996
|
mutationFn: ({ formData }) => excel_service_default.uploadFile({
|
|
6023
4997
|
formData
|
|
6024
4998
|
})
|
|
@@ -6027,9 +5001,9 @@ var useUploadFile = () => {
|
|
|
6027
5001
|
var use_upload_file_default = useUploadFile;
|
|
6028
5002
|
|
|
6029
5003
|
// src/hooks/excel/use-upload-id-file.ts
|
|
6030
|
-
var
|
|
5004
|
+
var import_react_query20 = require("@tanstack/react-query");
|
|
6031
5005
|
var useUploadIdFile = () => {
|
|
6032
|
-
return (0,
|
|
5006
|
+
return (0, import_react_query20.useMutation)({
|
|
6033
5007
|
mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
|
|
6034
5008
|
formData
|
|
6035
5009
|
})
|
|
@@ -6038,9 +5012,9 @@ var useUploadIdFile = () => {
|
|
|
6038
5012
|
var use_upload_id_file_default = useUploadIdFile;
|
|
6039
5013
|
|
|
6040
5014
|
// src/hooks/excel/uss-execute-import.ts
|
|
6041
|
-
var
|
|
5015
|
+
var import_react_query21 = require("@tanstack/react-query");
|
|
6042
5016
|
var useExecuteImport = () => {
|
|
6043
|
-
return (0,
|
|
5017
|
+
return (0, import_react_query21.useMutation)({
|
|
6044
5018
|
mutationFn: ({
|
|
6045
5019
|
fields,
|
|
6046
5020
|
columns,
|
|
@@ -6061,9 +5035,9 @@ var useExecuteImport = () => {
|
|
|
6061
5035
|
var uss_execute_import_default = useExecuteImport;
|
|
6062
5036
|
|
|
6063
5037
|
// src/hooks/form/use-change-status.ts
|
|
6064
|
-
var
|
|
5038
|
+
var import_react_query22 = require("@tanstack/react-query");
|
|
6065
5039
|
var useChangeStatus = () => {
|
|
6066
|
-
return (0,
|
|
5040
|
+
return (0, import_react_query22.useMutation)({
|
|
6067
5041
|
mutationFn: ({ data }) => {
|
|
6068
5042
|
return form_service_default.changeStatus({
|
|
6069
5043
|
data
|
|
@@ -6074,9 +5048,9 @@ var useChangeStatus = () => {
|
|
|
6074
5048
|
var use_change_status_default = useChangeStatus;
|
|
6075
5049
|
|
|
6076
5050
|
// src/hooks/form/use-delete-comment.ts
|
|
6077
|
-
var
|
|
5051
|
+
var import_react_query23 = require("@tanstack/react-query");
|
|
6078
5052
|
var useDeleteComment = () => {
|
|
6079
|
-
return (0,
|
|
5053
|
+
return (0, import_react_query23.useMutation)({
|
|
6080
5054
|
mutationFn: ({ data }) => form_service_default.deleteComment({
|
|
6081
5055
|
data
|
|
6082
5056
|
})
|
|
@@ -6085,9 +5059,9 @@ var useDeleteComment = () => {
|
|
|
6085
5059
|
var use_delete_comment_default = useDeleteComment;
|
|
6086
5060
|
|
|
6087
5061
|
// src/hooks/form/use-get-comment.ts
|
|
6088
|
-
var
|
|
5062
|
+
var import_react_query24 = require("@tanstack/react-query");
|
|
6089
5063
|
var useGetComment = ({ data, queryKey }) => {
|
|
6090
|
-
return (0,
|
|
5064
|
+
return (0, import_react_query24.useQuery)({
|
|
6091
5065
|
queryKey,
|
|
6092
5066
|
queryFn: () => form_service_default.getComment({ data }).then((res) => {
|
|
6093
5067
|
if (res) {
|
|
@@ -6101,13 +5075,13 @@ var useGetComment = ({ data, queryKey }) => {
|
|
|
6101
5075
|
var use_get_comment_default = useGetComment;
|
|
6102
5076
|
|
|
6103
5077
|
// src/hooks/form/use-get-form-view.ts
|
|
6104
|
-
var
|
|
5078
|
+
var import_react_query25 = require("@tanstack/react-query");
|
|
6105
5079
|
var useGetFormView = ({
|
|
6106
5080
|
data,
|
|
6107
5081
|
queryKey,
|
|
6108
5082
|
enabled
|
|
6109
5083
|
}) => {
|
|
6110
|
-
return (0,
|
|
5084
|
+
return (0, import_react_query25.useQuery)({
|
|
6111
5085
|
queryKey,
|
|
6112
5086
|
queryFn: () => form_service_default.getFormView({ data }).then((res) => {
|
|
6113
5087
|
if (res) {
|
|
@@ -6121,13 +5095,13 @@ var useGetFormView = ({
|
|
|
6121
5095
|
var use_get_form_view_default = useGetFormView;
|
|
6122
5096
|
|
|
6123
5097
|
// src/hooks/form/use-get-image.ts
|
|
6124
|
-
var
|
|
5098
|
+
var import_react_query26 = require("@tanstack/react-query");
|
|
6125
5099
|
var useGetImage = ({
|
|
6126
5100
|
data,
|
|
6127
5101
|
queryKey,
|
|
6128
5102
|
src
|
|
6129
5103
|
}) => {
|
|
6130
|
-
return (0,
|
|
5104
|
+
return (0, import_react_query26.useQuery)({
|
|
6131
5105
|
queryKey,
|
|
6132
5106
|
queryFn: () => form_service_default.getImage({ data }).then((res) => {
|
|
6133
5107
|
if (res) {
|
|
@@ -6141,9 +5115,9 @@ var useGetImage = ({
|
|
|
6141
5115
|
var use_get_image_default = useGetImage;
|
|
6142
5116
|
|
|
6143
5117
|
// src/hooks/form/use-send-comment.ts
|
|
6144
|
-
var
|
|
5118
|
+
var import_react_query27 = require("@tanstack/react-query");
|
|
6145
5119
|
var useSendComment = () => {
|
|
6146
|
-
return (0,
|
|
5120
|
+
return (0, import_react_query27.useMutation)({
|
|
6147
5121
|
mutationFn: ({ data }) => form_service_default.sentComment({
|
|
6148
5122
|
data
|
|
6149
5123
|
})
|
|
@@ -6152,9 +5126,9 @@ var useSendComment = () => {
|
|
|
6152
5126
|
var use_send_comment_default = useSendComment;
|
|
6153
5127
|
|
|
6154
5128
|
// src/hooks/form/use-upload-image.ts
|
|
6155
|
-
var
|
|
5129
|
+
var import_react_query28 = require("@tanstack/react-query");
|
|
6156
5130
|
var useUploadImage = () => {
|
|
6157
|
-
return (0,
|
|
5131
|
+
return (0, import_react_query28.useMutation)({
|
|
6158
5132
|
mutationFn: ({ data }) => form_service_default.uploadImage({
|
|
6159
5133
|
data
|
|
6160
5134
|
})
|
|
@@ -6163,18 +5137,18 @@ var useUploadImage = () => {
|
|
|
6163
5137
|
var use_upload_image_default = useUploadImage;
|
|
6164
5138
|
|
|
6165
5139
|
// src/hooks/model/use-delete.ts
|
|
6166
|
-
var
|
|
5140
|
+
var import_react_query29 = require("@tanstack/react-query");
|
|
6167
5141
|
var useDelete = () => {
|
|
6168
|
-
return (0,
|
|
5142
|
+
return (0, import_react_query29.useMutation)({
|
|
6169
5143
|
mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
|
|
6170
5144
|
});
|
|
6171
5145
|
};
|
|
6172
5146
|
var use_delete_default = useDelete;
|
|
6173
5147
|
|
|
6174
5148
|
// src/hooks/model/use-get-all.ts
|
|
6175
|
-
var
|
|
5149
|
+
var import_react_query30 = require("@tanstack/react-query");
|
|
6176
5150
|
var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
6177
|
-
return (0,
|
|
5151
|
+
return (0, import_react_query30.useQuery)({
|
|
6178
5152
|
queryKey,
|
|
6179
5153
|
queryFn: () => model_service_default.getAll({ data }).then((res) => {
|
|
6180
5154
|
if (res) {
|
|
@@ -6189,9 +5163,9 @@ var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
|
6189
5163
|
var use_get_all_default = useGetAll;
|
|
6190
5164
|
|
|
6191
5165
|
// src/hooks/model/use-get-conversion-rate.ts
|
|
6192
|
-
var
|
|
5166
|
+
var import_react_query31 = require("@tanstack/react-query");
|
|
6193
5167
|
var useGetConversionRate = () => {
|
|
6194
|
-
return (0,
|
|
5168
|
+
return (0, import_react_query31.useQuery)({
|
|
6195
5169
|
queryKey: ["currency-rate"],
|
|
6196
5170
|
queryFn: () => model_service_default.getConversionRate().then((res) => {
|
|
6197
5171
|
if (res) {
|
|
@@ -6204,9 +5178,9 @@ var useGetConversionRate = () => {
|
|
|
6204
5178
|
var use_get_conversion_rate_default = useGetConversionRate;
|
|
6205
5179
|
|
|
6206
5180
|
// src/hooks/model/use-get-currency.ts
|
|
6207
|
-
var
|
|
5181
|
+
var import_react_query32 = require("@tanstack/react-query");
|
|
6208
5182
|
var useGetCurrency = () => {
|
|
6209
|
-
return (0,
|
|
5183
|
+
return (0, import_react_query32.useQuery)({
|
|
6210
5184
|
queryKey: ["currency"],
|
|
6211
5185
|
queryFn: () => model_service_default.getCurrency().then((res) => {
|
|
6212
5186
|
if (res) {
|
|
@@ -6219,9 +5193,9 @@ var useGetCurrency = () => {
|
|
|
6219
5193
|
var use_get_currency_default = useGetCurrency;
|
|
6220
5194
|
|
|
6221
5195
|
// src/hooks/model/use-get-detail.ts
|
|
6222
|
-
var
|
|
5196
|
+
var import_react_query33 = require("@tanstack/react-query");
|
|
6223
5197
|
var useGetDetail = () => {
|
|
6224
|
-
return (0,
|
|
5198
|
+
return (0, import_react_query33.useMutation)({
|
|
6225
5199
|
mutationFn: ({
|
|
6226
5200
|
model,
|
|
6227
5201
|
ids,
|
|
@@ -6238,9 +5212,9 @@ var useGetDetail = () => {
|
|
|
6238
5212
|
var use_get_detail_default = useGetDetail;
|
|
6239
5213
|
|
|
6240
5214
|
// src/hooks/model/use-get-field-onchange.ts
|
|
6241
|
-
var
|
|
5215
|
+
var import_react_query34 = require("@tanstack/react-query");
|
|
6242
5216
|
var useGetFieldOnChange = ({ model }) => {
|
|
6243
|
-
return (0,
|
|
5217
|
+
return (0, import_react_query34.useQuery)({
|
|
6244
5218
|
queryKey: [`field-onchange-${model}`, model],
|
|
6245
5219
|
queryFn: () => model_service_default.getListFieldsOnchange({
|
|
6246
5220
|
model
|
|
@@ -6256,13 +5230,13 @@ var useGetFieldOnChange = ({ model }) => {
|
|
|
6256
5230
|
var use_get_field_onchange_default = useGetFieldOnChange;
|
|
6257
5231
|
|
|
6258
5232
|
// src/hooks/model/use-get-list-my-bank-account.ts
|
|
6259
|
-
var
|
|
5233
|
+
var import_react_query35 = require("@tanstack/react-query");
|
|
6260
5234
|
var useGetListMyBankAccount = ({
|
|
6261
5235
|
domain,
|
|
6262
5236
|
spectification,
|
|
6263
5237
|
model
|
|
6264
5238
|
}) => {
|
|
6265
|
-
return (0,
|
|
5239
|
+
return (0, import_react_query35.useQuery)({
|
|
6266
5240
|
queryKey: ["bank-account", model, domain],
|
|
6267
5241
|
queryFn: () => model_service_default.getListMyBankAccount({
|
|
6268
5242
|
domain,
|
|
@@ -6414,9 +5388,9 @@ var useOdooDataTransform = () => {
|
|
|
6414
5388
|
var use_odoo_data_transform_default = useOdooDataTransform;
|
|
6415
5389
|
|
|
6416
5390
|
// src/hooks/model/use-onchange-form.ts
|
|
6417
|
-
var
|
|
5391
|
+
var import_react_query36 = require("@tanstack/react-query");
|
|
6418
5392
|
var useOnChangeForm = () => {
|
|
6419
|
-
return (0,
|
|
5393
|
+
return (0, import_react_query36.useMutation)({
|
|
6420
5394
|
mutationFn: ({
|
|
6421
5395
|
ids,
|
|
6422
5396
|
model,
|
|
@@ -6437,9 +5411,9 @@ var useOnChangeForm = () => {
|
|
|
6437
5411
|
var use_onchange_form_default = useOnChangeForm;
|
|
6438
5412
|
|
|
6439
5413
|
// src/hooks/model/use-save.ts
|
|
6440
|
-
var
|
|
5414
|
+
var import_react_query37 = require("@tanstack/react-query");
|
|
6441
5415
|
var useSave = () => {
|
|
6442
|
-
return (0,
|
|
5416
|
+
return (0, import_react_query37.useMutation)({
|
|
6443
5417
|
mutationFn: ({
|
|
6444
5418
|
ids,
|
|
6445
5419
|
model,
|
|
@@ -6453,18 +5427,18 @@ var useSave = () => {
|
|
|
6453
5427
|
var use_save_default = useSave;
|
|
6454
5428
|
|
|
6455
5429
|
// src/hooks/user/use-get-profile.ts
|
|
6456
|
-
var
|
|
5430
|
+
var import_react_query38 = require("@tanstack/react-query");
|
|
6457
5431
|
var useGetProfile = (path) => {
|
|
6458
|
-
return (0,
|
|
5432
|
+
return (0, import_react_query38.useMutation)({
|
|
6459
5433
|
mutationFn: () => user_service_default.getProfile(path)
|
|
6460
5434
|
});
|
|
6461
5435
|
};
|
|
6462
5436
|
var use_get_profile_default = useGetProfile;
|
|
6463
5437
|
|
|
6464
5438
|
// src/hooks/user/use-get-user.ts
|
|
6465
|
-
var
|
|
5439
|
+
var import_react_query39 = require("@tanstack/react-query");
|
|
6466
5440
|
var useGetUser = () => {
|
|
6467
|
-
return (0,
|
|
5441
|
+
return (0, import_react_query39.useMutation)({
|
|
6468
5442
|
mutationFn: ({ id, context }) => user_service_default.getUser({
|
|
6469
5443
|
id,
|
|
6470
5444
|
context
|
|
@@ -6474,9 +5448,9 @@ var useGetUser = () => {
|
|
|
6474
5448
|
var use_get_user_default = useGetUser;
|
|
6475
5449
|
|
|
6476
5450
|
// src/hooks/user/use-switch-locale.ts
|
|
6477
|
-
var
|
|
5451
|
+
var import_react_query40 = require("@tanstack/react-query");
|
|
6478
5452
|
var useSwitchLocale = () => {
|
|
6479
|
-
return (0,
|
|
5453
|
+
return (0, import_react_query40.useMutation)({
|
|
6480
5454
|
mutationFn: ({ data }) => {
|
|
6481
5455
|
return user_service_default.switchUserLocale({
|
|
6482
5456
|
id: data.id,
|
|
@@ -6488,9 +5462,9 @@ var useSwitchLocale = () => {
|
|
|
6488
5462
|
var use_switch_locale_default = useSwitchLocale;
|
|
6489
5463
|
|
|
6490
5464
|
// src/hooks/view/use-button.ts
|
|
6491
|
-
var
|
|
5465
|
+
var import_react_query41 = require("@tanstack/react-query");
|
|
6492
5466
|
var useButton = () => {
|
|
6493
|
-
return (0,
|
|
5467
|
+
return (0, import_react_query41.useMutation)({
|
|
6494
5468
|
mutationFn: ({
|
|
6495
5469
|
model,
|
|
6496
5470
|
ids,
|
|
@@ -6510,9 +5484,9 @@ var useButton = () => {
|
|
|
6510
5484
|
var use_button_default = useButton;
|
|
6511
5485
|
|
|
6512
5486
|
// src/hooks/view/use-duplicate-record.ts
|
|
6513
|
-
var
|
|
5487
|
+
var import_react_query42 = require("@tanstack/react-query");
|
|
6514
5488
|
var useDuplicateRecord = () => {
|
|
6515
|
-
return (0,
|
|
5489
|
+
return (0, import_react_query42.useMutation)({
|
|
6516
5490
|
mutationFn: ({
|
|
6517
5491
|
id,
|
|
6518
5492
|
model,
|
|
@@ -6527,7 +5501,7 @@ var useDuplicateRecord = () => {
|
|
|
6527
5501
|
var use_duplicate_record_default = useDuplicateRecord;
|
|
6528
5502
|
|
|
6529
5503
|
// src/hooks/view/use-get-action-detail.ts
|
|
6530
|
-
var
|
|
5504
|
+
var import_react_query43 = require("@tanstack/react-query");
|
|
6531
5505
|
var useGetActionDetail = ({
|
|
6532
5506
|
aid,
|
|
6533
5507
|
context,
|
|
@@ -6541,7 +5515,7 @@ var useGetActionDetail = ({
|
|
|
6541
5515
|
model: model ?? "",
|
|
6542
5516
|
context
|
|
6543
5517
|
};
|
|
6544
|
-
return (0,
|
|
5518
|
+
return (0, import_react_query43.useQuery)({
|
|
6545
5519
|
queryKey,
|
|
6546
5520
|
queryFn: async () => {
|
|
6547
5521
|
if (aid) {
|
|
@@ -6562,9 +5536,9 @@ var useGetActionDetail = ({
|
|
|
6562
5536
|
var use_get_action_detail_default = useGetActionDetail;
|
|
6563
5537
|
|
|
6564
5538
|
// src/hooks/view/use-get-calendar.ts
|
|
6565
|
-
var
|
|
5539
|
+
var import_react_query44 = require("@tanstack/react-query");
|
|
6566
5540
|
var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
6567
|
-
return (0,
|
|
5541
|
+
return (0, import_react_query44.useQuery)({
|
|
6568
5542
|
queryKey,
|
|
6569
5543
|
queryFn: () => model_service_default.getListCalendar({ data: listDataProps }).then((res) => {
|
|
6570
5544
|
if (res) {
|
|
@@ -6580,12 +5554,12 @@ var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
|
6580
5554
|
var use_get_calendar_default = useGetCalendar;
|
|
6581
5555
|
|
|
6582
5556
|
// src/hooks/view/use-get-groups.ts
|
|
6583
|
-
var
|
|
5557
|
+
var import_react_query45 = require("@tanstack/react-query");
|
|
6584
5558
|
var useGetGroups = ({
|
|
6585
5559
|
model,
|
|
6586
5560
|
width_context
|
|
6587
5561
|
}) => {
|
|
6588
|
-
return (0,
|
|
5562
|
+
return (0, import_react_query45.useQuery)({
|
|
6589
5563
|
queryKey: [model, width_context],
|
|
6590
5564
|
queryFn: () => kanban_service_default.getGroups({
|
|
6591
5565
|
model,
|
|
@@ -6602,9 +5576,9 @@ var useGetGroups = ({
|
|
|
6602
5576
|
var use_get_groups_default = useGetGroups;
|
|
6603
5577
|
|
|
6604
5578
|
// src/hooks/view/use-get-list-data.ts
|
|
6605
|
-
var
|
|
5579
|
+
var import_react_query46 = require("@tanstack/react-query");
|
|
6606
5580
|
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
6607
|
-
return (0,
|
|
5581
|
+
return (0, import_react_query46.useQuery)({
|
|
6608
5582
|
queryKey,
|
|
6609
5583
|
queryFn: () => model_service_default.getAll({ data: listDataProps }).then((res) => {
|
|
6610
5584
|
if (res) {
|
|
@@ -6620,9 +5594,9 @@ var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
|
6620
5594
|
var use_get_list_data_default = useGetListData;
|
|
6621
5595
|
|
|
6622
5596
|
// src/hooks/view/use-get-menu.ts
|
|
6623
|
-
var
|
|
5597
|
+
var import_react_query47 = require("@tanstack/react-query");
|
|
6624
5598
|
var useGetMenu = (context, enabled) => {
|
|
6625
|
-
return (0,
|
|
5599
|
+
return (0, import_react_query47.useQuery)({
|
|
6626
5600
|
queryKey: ["menus" /* MENU */, context],
|
|
6627
5601
|
queryFn: () => view_service_default.getMenu(context).then((res) => {
|
|
6628
5602
|
if (res && res?.records && res?.records?.length > 0) {
|
|
@@ -6638,9 +5612,9 @@ var useGetMenu = (context, enabled) => {
|
|
|
6638
5612
|
var use_get_menu_default = useGetMenu;
|
|
6639
5613
|
|
|
6640
5614
|
// src/hooks/view/use-get-print-report.ts
|
|
6641
|
-
var
|
|
5615
|
+
var import_react_query48 = require("@tanstack/react-query");
|
|
6642
5616
|
var useGetPrintReport = () => {
|
|
6643
|
-
return (0,
|
|
5617
|
+
return (0, import_react_query48.useMutation)({
|
|
6644
5618
|
mutationFn: ({ id }) => action_service_default.getPrintReportName({
|
|
6645
5619
|
id
|
|
6646
5620
|
})
|
|
@@ -6649,14 +5623,14 @@ var useGetPrintReport = () => {
|
|
|
6649
5623
|
var use_get_print_report_default = useGetPrintReport;
|
|
6650
5624
|
|
|
6651
5625
|
// src/hooks/view/use-get-progress-bar.ts
|
|
6652
|
-
var
|
|
5626
|
+
var import_react_query49 = require("@tanstack/react-query");
|
|
6653
5627
|
var useGetProGressBar = ({
|
|
6654
5628
|
field,
|
|
6655
5629
|
color,
|
|
6656
5630
|
model,
|
|
6657
5631
|
width_context
|
|
6658
5632
|
}) => {
|
|
6659
|
-
return (0,
|
|
5633
|
+
return (0, import_react_query49.useQuery)({
|
|
6660
5634
|
queryKey: [],
|
|
6661
5635
|
queryFn: () => kanban_service_default.getProgressBar({
|
|
6662
5636
|
field,
|
|
@@ -6675,13 +5649,13 @@ var useGetProGressBar = ({
|
|
|
6675
5649
|
var use_get_progress_bar_default = useGetProGressBar;
|
|
6676
5650
|
|
|
6677
5651
|
// src/hooks/view/use-get-selection.ts
|
|
6678
|
-
var
|
|
5652
|
+
var import_react_query50 = require("@tanstack/react-query");
|
|
6679
5653
|
var useGetSelection = ({
|
|
6680
5654
|
data,
|
|
6681
5655
|
queryKey,
|
|
6682
5656
|
enabled
|
|
6683
5657
|
}) => {
|
|
6684
|
-
return (0,
|
|
5658
|
+
return (0, import_react_query50.useQuery)({
|
|
6685
5659
|
queryKey,
|
|
6686
5660
|
queryFn: () => view_service_default.getSelectionItem({ data }),
|
|
6687
5661
|
enabled,
|
|
@@ -6691,9 +5665,9 @@ var useGetSelection = ({
|
|
|
6691
5665
|
var use_get_selection_default = useGetSelection;
|
|
6692
5666
|
|
|
6693
5667
|
// src/hooks/view/use-get-view.ts
|
|
6694
|
-
var
|
|
5668
|
+
var import_react_query51 = require("@tanstack/react-query");
|
|
6695
5669
|
var useGetView = (viewParams, actData) => {
|
|
6696
|
-
return (0,
|
|
5670
|
+
return (0, import_react_query51.useQuery)({
|
|
6697
5671
|
queryKey: ["get_view_by_action" /* GET_VIEW_BY_ACTION */, viewParams],
|
|
6698
5672
|
queryFn: () => view_service_default.getView(viewParams),
|
|
6699
5673
|
enabled: !!actData,
|
|
@@ -6704,9 +5678,9 @@ var useGetView = (viewParams, actData) => {
|
|
|
6704
5678
|
var use_get_view_default = useGetView;
|
|
6705
5679
|
|
|
6706
5680
|
// src/hooks/view/use-load-action.ts
|
|
6707
|
-
var
|
|
5681
|
+
var import_react_query52 = require("@tanstack/react-query");
|
|
6708
5682
|
var useLoadAction = () => {
|
|
6709
|
-
return (0,
|
|
5683
|
+
return (0, import_react_query52.useMutation)({
|
|
6710
5684
|
mutationFn: ({
|
|
6711
5685
|
idAction,
|
|
6712
5686
|
context
|
|
@@ -6721,9 +5695,9 @@ var useLoadAction = () => {
|
|
|
6721
5695
|
var use_load_action_default = useLoadAction;
|
|
6722
5696
|
|
|
6723
5697
|
// src/hooks/view/use-load-message.ts
|
|
6724
|
-
var
|
|
5698
|
+
var import_react_query53 = require("@tanstack/react-query");
|
|
6725
5699
|
var useLoadMessage = () => {
|
|
6726
|
-
return (0,
|
|
5700
|
+
return (0, import_react_query53.useQuery)({
|
|
6727
5701
|
queryKey: [`load-message-failure`],
|
|
6728
5702
|
queryFn: () => view_service_default.loadMessages(),
|
|
6729
5703
|
refetchOnWindowFocus: false
|
|
@@ -6732,9 +5706,9 @@ var useLoadMessage = () => {
|
|
|
6732
5706
|
var use_load_message_default = useLoadMessage;
|
|
6733
5707
|
|
|
6734
5708
|
// src/hooks/view/use-print.ts
|
|
6735
|
-
var
|
|
5709
|
+
var import_react_query54 = require("@tanstack/react-query");
|
|
6736
5710
|
var usePrint = () => {
|
|
6737
|
-
return (0,
|
|
5711
|
+
return (0, import_react_query54.useMutation)({
|
|
6738
5712
|
mutationFn: ({ id, report, db }) => action_service_default.print({
|
|
6739
5713
|
id,
|
|
6740
5714
|
report,
|
|
@@ -6745,9 +5719,9 @@ var usePrint = () => {
|
|
|
6745
5719
|
var use_print_default = usePrint;
|
|
6746
5720
|
|
|
6747
5721
|
// src/hooks/view/use-remove-row.ts
|
|
6748
|
-
var
|
|
5722
|
+
var import_react_query55 = require("@tanstack/react-query");
|
|
6749
5723
|
var useRemoveRow = () => {
|
|
6750
|
-
return (0,
|
|
5724
|
+
return (0, import_react_query55.useMutation)({
|
|
6751
5725
|
mutationFn: ({
|
|
6752
5726
|
model,
|
|
6753
5727
|
ids,
|
|
@@ -6762,9 +5736,9 @@ var useRemoveRow = () => {
|
|
|
6762
5736
|
var use_remove_row_default = useRemoveRow;
|
|
6763
5737
|
|
|
6764
5738
|
// src/hooks/view/use-resequence.ts
|
|
6765
|
-
var
|
|
5739
|
+
var import_react_query56 = require("@tanstack/react-query");
|
|
6766
5740
|
var useGetResequence = (model, resIds, context, offset) => {
|
|
6767
|
-
return (0,
|
|
5741
|
+
return (0, import_react_query56.useQuery)({
|
|
6768
5742
|
queryKey: [],
|
|
6769
5743
|
queryFn: () => view_service_default.getResequence({
|
|
6770
5744
|
model,
|
|
@@ -6779,9 +5753,9 @@ var useGetResequence = (model, resIds, context, offset) => {
|
|
|
6779
5753
|
var use_resequence_default = useGetResequence;
|
|
6780
5754
|
|
|
6781
5755
|
// src/hooks/view/use-run-action.ts
|
|
6782
|
-
var
|
|
5756
|
+
var import_react_query57 = require("@tanstack/react-query");
|
|
6783
5757
|
var useRunAction = () => {
|
|
6784
|
-
return (0,
|
|
5758
|
+
return (0, import_react_query57.useMutation)({
|
|
6785
5759
|
mutationFn: ({
|
|
6786
5760
|
idAction,
|
|
6787
5761
|
context
|
|
@@ -6794,9 +5768,9 @@ var useRunAction = () => {
|
|
|
6794
5768
|
var use_run_action_default = useRunAction;
|
|
6795
5769
|
|
|
6796
5770
|
// src/hooks/view/use-signin-sso.ts
|
|
6797
|
-
var
|
|
5771
|
+
var import_react_query58 = require("@tanstack/react-query");
|
|
6798
5772
|
var useSignInSSO = () => {
|
|
6799
|
-
return (0,
|
|
5773
|
+
return (0, import_react_query58.useMutation)({
|
|
6800
5774
|
mutationFn: ({
|
|
6801
5775
|
redirect_uri,
|
|
6802
5776
|
state,
|
|
@@ -6817,9 +5791,9 @@ var useSignInSSO = () => {
|
|
|
6817
5791
|
var use_signin_sso_default = useSignInSSO;
|
|
6818
5792
|
|
|
6819
5793
|
// src/hooks/view/use-verify-2FA.ts
|
|
6820
|
-
var
|
|
5794
|
+
var import_react_query59 = require("@tanstack/react-query");
|
|
6821
5795
|
var useVerify2FA = () => {
|
|
6822
|
-
return (0,
|
|
5796
|
+
return (0, import_react_query59.useMutation)({
|
|
6823
5797
|
mutationFn: ({
|
|
6824
5798
|
method,
|
|
6825
5799
|
with_context,
|
|
@@ -6840,9 +5814,9 @@ var useVerify2FA = () => {
|
|
|
6840
5814
|
var use_verify_2FA_default = useVerify2FA;
|
|
6841
5815
|
|
|
6842
5816
|
// src/hooks/view/uset-get-2FA-method.ts
|
|
6843
|
-
var
|
|
5817
|
+
var import_react_query60 = require("@tanstack/react-query");
|
|
6844
5818
|
var useGet2FAMethods = () => {
|
|
6845
|
-
return (0,
|
|
5819
|
+
return (0, import_react_query60.useMutation)({
|
|
6846
5820
|
mutationFn: ({
|
|
6847
5821
|
method,
|
|
6848
5822
|
with_context
|
|
@@ -6857,9 +5831,9 @@ var useGet2FAMethods = () => {
|
|
|
6857
5831
|
var uset_get_2FA_method_default = useGet2FAMethods;
|
|
6858
5832
|
|
|
6859
5833
|
// src/hooks/view/use-get-fields-view-security.ts
|
|
6860
|
-
var
|
|
5834
|
+
var import_react_query61 = require("@tanstack/react-query");
|
|
6861
5835
|
var useGetFieldsViewSecurity = () => {
|
|
6862
|
-
return (0,
|
|
5836
|
+
return (0, import_react_query61.useMutation)({
|
|
6863
5837
|
mutationFn: ({
|
|
6864
5838
|
method,
|
|
6865
5839
|
token,
|
|
@@ -6876,9 +5850,9 @@ var useGetFieldsViewSecurity = () => {
|
|
|
6876
5850
|
var use_get_fields_view_security_default = useGetFieldsViewSecurity;
|
|
6877
5851
|
|
|
6878
5852
|
// src/hooks/view/use-grant-access.ts
|
|
6879
|
-
var
|
|
5853
|
+
var import_react_query62 = require("@tanstack/react-query");
|
|
6880
5854
|
var useGrantAccess = () => {
|
|
6881
|
-
return (0,
|
|
5855
|
+
return (0, import_react_query62.useMutation)({
|
|
6882
5856
|
mutationFn: ({
|
|
6883
5857
|
redirect_uri,
|
|
6884
5858
|
state,
|
|
@@ -6897,9 +5871,9 @@ var useGrantAccess = () => {
|
|
|
6897
5871
|
var use_grant_access_default = useGrantAccess;
|
|
6898
5872
|
|
|
6899
5873
|
// src/hooks/view/use-remove-totp-setup.ts
|
|
6900
|
-
var
|
|
5874
|
+
var import_react_query63 = require("@tanstack/react-query");
|
|
6901
5875
|
var useRemoveTotpSetup = () => {
|
|
6902
|
-
return (0,
|
|
5876
|
+
return (0, import_react_query63.useMutation)({
|
|
6903
5877
|
mutationFn: ({ method, token }) => {
|
|
6904
5878
|
return view_service_default.removeTotpSetUp({
|
|
6905
5879
|
method,
|
|
@@ -6911,9 +5885,9 @@ var useRemoveTotpSetup = () => {
|
|
|
6911
5885
|
var use_remove_totp_setup_default = useRemoveTotpSetup;
|
|
6912
5886
|
|
|
6913
5887
|
// src/hooks/view/use-request-setup-totp.ts
|
|
6914
|
-
var
|
|
5888
|
+
var import_react_query64 = require("@tanstack/react-query");
|
|
6915
5889
|
var useRequestSetupTotp = () => {
|
|
6916
|
-
return (0,
|
|
5890
|
+
return (0, import_react_query64.useMutation)({
|
|
6917
5891
|
mutationFn: ({ method, token }) => {
|
|
6918
5892
|
return view_service_default.requestSetupTotp({
|
|
6919
5893
|
method,
|
|
@@ -6925,9 +5899,9 @@ var useRequestSetupTotp = () => {
|
|
|
6925
5899
|
var use_request_setup_totp_default = useRequestSetupTotp;
|
|
6926
5900
|
|
|
6927
5901
|
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
6928
|
-
var
|
|
5902
|
+
var import_react_query65 = require("@tanstack/react-query");
|
|
6929
5903
|
var useSettingsWebRead2fa = () => {
|
|
6930
|
-
return (0,
|
|
5904
|
+
return (0, import_react_query65.useMutation)({
|
|
6931
5905
|
mutationFn: ({
|
|
6932
5906
|
method,
|
|
6933
5907
|
token,
|
|
@@ -6946,9 +5920,9 @@ var useSettingsWebRead2fa = () => {
|
|
|
6946
5920
|
var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
|
|
6947
5921
|
|
|
6948
5922
|
// src/hooks/view/use-verify-totp.ts
|
|
6949
|
-
var
|
|
5923
|
+
var import_react_query66 = require("@tanstack/react-query");
|
|
6950
5924
|
var useVerifyTotp = () => {
|
|
6951
|
-
return (0,
|
|
5925
|
+
return (0, import_react_query66.useMutation)({
|
|
6952
5926
|
mutationFn: ({
|
|
6953
5927
|
method,
|
|
6954
5928
|
action_token,
|
|
@@ -6964,211 +5938,10 @@ var useVerifyTotp = () => {
|
|
|
6964
5938
|
};
|
|
6965
5939
|
var use_verify_totp_default = useVerifyTotp;
|
|
6966
5940
|
|
|
6967
|
-
// src/
|
|
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
|
|
5941
|
+
// src/hooks/env.ts
|
|
6999
5942
|
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
|
-
};
|
|
7034
5943
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7035
5944
|
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,
|
|
7172
5945
|
useButton,
|
|
7173
5946
|
useChangeStatus,
|
|
7174
5947
|
useDelete,
|
|
@@ -7176,7 +5949,6 @@ var VersionGate = ({ children }) => {
|
|
|
7176
5949
|
useDuplicateRecord,
|
|
7177
5950
|
useExecuteImport,
|
|
7178
5951
|
useExportExcel,
|
|
7179
|
-
useField,
|
|
7180
5952
|
useForgotPassword,
|
|
7181
5953
|
useForgotPasswordSSO,
|
|
7182
5954
|
useGet2FAMethods,
|
|
@@ -7232,14 +6004,10 @@ var VersionGate = ({ children }) => {
|
|
|
7232
6004
|
useSettingsWebRead2fa,
|
|
7233
6005
|
useSignInSSO,
|
|
7234
6006
|
useSwitchLocale,
|
|
7235
|
-
useTabModel,
|
|
7236
6007
|
useUpdatePassword,
|
|
7237
6008
|
useUploadFile,
|
|
7238
6009
|
useUploadIdFile,
|
|
7239
6010
|
useUploadImage,
|
|
7240
|
-
useValidateActionToken,
|
|
7241
6011
|
useVerify2FA,
|
|
7242
|
-
useVerifyTotp
|
|
7243
|
-
validateAndParseDate
|
|
6012
|
+
useVerifyTotp
|
|
7244
6013
|
});
|
|
7245
|
-
//# sourceMappingURL=index.js.map
|