@gen-epix/ui-client-common 4.5.0 → 4.6.0
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/README.md +5 -4
- package/dist/@types/mui.d.ts +13 -5
- package/dist/@types/ui-client-common.d.ts +1 -0
- package/dist/_chunks/ApplicationFooter.js +45 -46
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +14 -15
- package/dist/_chunks/CrudPage.js +301 -302
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +1 -2
- package/dist/_chunks/GeoFilter.js.map +1 -1
- package/dist/_chunks/Notifications.js +52 -53
- package/dist/_chunks/OutageList.js +30 -31
- package/dist/_chunks/OutageList.js.map +1 -1
- package/dist/_chunks/OutageUtil.js +4 -8
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -2
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +101 -395
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Reflect.js +1 -2
- package/dist/_chunks/Table.js +523 -522
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +10 -20
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +18 -20
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +78 -79
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +212 -213
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseAssignValue.js +1 -2
- package/dist/_chunks/_baseFlatten.js +9 -10
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseGet.js +279 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +273 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +22 -300
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/_cacheHas.js +1 -2
- package/dist/_chunks/_setToString.js +1 -2
- package/dist/_chunks/decorate.js +1 -2
- package/dist/_chunks/decorateParam.js +1 -2
- package/dist/_chunks/format.js +27 -54
- package/dist/_chunks/format.js.map +1 -1
- package/dist/_chunks/isArrayLike.js +1 -2
- package/dist/_chunks/isObject.js +1 -2
- package/dist/_chunks/isSymbol.js +1 -2
- package/dist/_chunks/last.js +12 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/middleware.js +2 -3
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +42 -42
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +8 -15
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +2 -3
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/rolldown-runtime.js +2 -3
- package/dist/_chunks/tableStore.js +231 -224
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/toDate.js +8 -14
- package/dist/_chunks/toDate.js.map +1 -1
- package/dist/_chunks/uniq.js +43 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useColumnsMenu.js +3 -6
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +24 -26
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +33 -22
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -2
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -4
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/TableEventBus/index.js +1 -2
- package/dist/classes/abstracts/FilterAbstract/index.js +4 -3
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/index.js +15 -16
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +5 -6
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/index.js +4 -4
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +16 -39
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js +10 -10
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/FeatureFlagsService/index.js +1 -2
- package/dist/classes/services/I18nService/index.js +12 -12
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +13 -14
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +40 -35
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NavigationHistoryService/index.js +1 -2
- package/dist/classes/services/NotificationService/index.js +9 -10
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js +14 -11
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +4 -8
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/classes/services/UserSettingsService/index.js +1 -2
- package/dist/components/app/App/App.d.ts +1 -1
- package/dist/components/app/App/index.js +35 -40
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +29 -30
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +48 -47
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +36 -37
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +20 -21
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +53 -52
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +22 -23
- package/dist/components/filters/BooleanFilterField/index.js +6 -7
- package/dist/components/filters/DateFilterField/index.js +4 -5
- package/dist/components/filters/GeoFilterField/index.js +5 -6
- package/dist/components/filters/MultiSelectFilterField/index.js +5 -6
- package/dist/components/filters/NumberRangeFilterField/index.js +4 -5
- package/dist/components/filters/TextFilterField/index.js +4 -5
- package/dist/components/ui/ApplicationBar/index.js +189 -190
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/ConsentDialog/index.js +1 -2
- package/dist/components/ui/GenericErrorMessage/index.js +30 -31
- package/dist/components/ui/LicensesDialog/index.js +39 -40
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +17 -18
- package/dist/components/ui/NavLink/index.js +7 -8
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +22 -23
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/OutagesDialog/index.js +1 -2
- package/dist/components/ui/PageContainer/index.js +25 -26
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/ResponseHandler/index.js +1 -2
- package/dist/components/ui/Sidebar/index.js +31 -32
- package/dist/components/ui/UserFeedbackDialog/index.js +13 -14
- package/dist/components/ui/UserInactivityConfirmation/index.js +1 -2
- package/dist/constants/api.constants.js +1 -2
- package/dist/constants/config.constants.d.ts +0 -2
- package/dist/constants/config.constants.js +3 -4
- package/dist/constants/config.constants.js.map +1 -1
- package/dist/constants/query.constants.js +1 -2
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +13 -14
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +15 -16
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +13 -14
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +14 -15
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +5 -6
- package/dist/dataHooks/useOrganizationsQuery/index.js +14 -15
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +11 -12
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/hoc/withPermissions/index.js +1 -2
- package/dist/hooks/useConfig/index.js +3 -4
- package/dist/hooks/useConfig/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/index.js +13 -14
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +17 -11
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +49 -35
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useInitializeTableStore/index.js +1 -2
- package/dist/hooks/useItemQuery/index.js +5 -6
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/hooks/useUpdateBreadcrumb/index.js +1 -2
- package/dist/hooks/useUpdateDocumentTitle/index.js +1 -2
- package/dist/locale/en.json +1 -0
- package/dist/locale/nl.json +1 -0
- package/dist/models/admin.models.js +1 -2
- package/dist/models/admin.models.js.map +1 -1
- package/dist/models/config.models.d.ts +1 -5
- package/dist/models/table.models.js +1 -2
- package/dist/models/table.models.js.map +1 -1
- package/dist/models/theme.models.d.ts +19 -16
- package/dist/pages/AcceptInvitationPage/index.js +26 -27
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +17 -18
- package/dist/pages/ChooseIdentityProviderPage/index.js +22 -23
- package/dist/pages/ErrorPage/index.js +1 -2
- package/dist/pages/IdentifierIssuersAdminPage/index.js +6 -7
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +6 -7
- package/dist/pages/OrganizationContactsAdminPage/index.js +7 -8
- package/dist/pages/OrganizationSitesAdminPage/index.js +10 -11
- package/dist/pages/OrganizationsAdminPage/index.js +14 -15
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +21 -22
- package/dist/pages/PostLoginPage/index.js +8 -9
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js +9 -10
- package/dist/pages/RouterErrorPage/index.js +1 -2
- package/dist/pages/UsersAdminPage/index.js +40 -41
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/routes/index.js +1 -2
- package/dist/setup/setup.js +12 -6
- package/dist/setup/setup.js.map +1 -1
- package/dist/stores/oidcStore/index.js +1 -2
- package/dist/stores/outagesStore/index.js +1 -2
- package/dist/theme/demoTheme/index.js +18 -17
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/AxiosUtil/index.js +1 -2
- package/dist/utils/DataHookUtil/index.js +2 -3
- package/dist/utils/DataHookUtil/index.js.map +1 -1
- package/dist/utils/DependencyContainerUtil/DependencyContainerUtil.d.ts +2 -3
- package/dist/utils/DependencyContainerUtil/index.js +10 -16
- package/dist/utils/DependencyContainerUtil/index.js.map +1 -1
- package/dist/utils/LoadableUtil/index.js +1 -2
- package/dist/utils/MenuDataUtil/index.js +2 -3
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/NotificationUtil/index.js +1 -2
- package/dist/utils/StandardConfigUtil/index.js +1 -6
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TimeUtil/index.js +2 -3
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/dist/utils/UserUtil/index.js +1 -2
- package/package.json +26 -29
- package/dist/context/ClientCommonConfigContext/ClientCommonConfigContext.d.ts +0 -9
- package/dist/context/ClientCommonConfigContext/ClientCommonConfigContextProvider.d.ts +0 -6
- package/dist/context/ClientCommonConfigContext/index.d.ts +0 -3
- package/dist/context/ClientCommonConfigContext/index.js +0 -34
- package/dist/context/ClientCommonConfigContext/index.js.map +0 -1
- package/dist/context/ClientCommonConfigContext/useClientCommonConfigContext.d.ts +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CanceledError as e, isAxiosError as t } from "axios";
|
|
2
|
-
|
|
2
|
+
// src/utils/AxiosUtil/AxiosUtil.ts
|
|
3
3
|
var n = class n {
|
|
4
4
|
static isAxiosBadRequestError(e) {
|
|
5
5
|
return n.isAxiosRequestErrorWithCode(e, 400);
|
|
@@ -32,7 +32,6 @@ var n = class n {
|
|
|
32
32
|
return n.isAxiosRequestErrorWithCode(e, 422);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
//#endregion
|
|
36
35
|
export { n as AxiosUtil };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LoadableUtil as e } from "../LoadableUtil/index.js";
|
|
2
2
|
import { StringUtil as t } from "@gen-epix/ui-core/utils/StringUtil";
|
|
3
|
-
|
|
3
|
+
// src/utils/DataHookUtil/DataHookUtil.ts
|
|
4
4
|
var n = class n {
|
|
5
5
|
static createUseMapDataHook(t, r, i = []) {
|
|
6
6
|
let a = [...n.isResponse(t) ? [t] : [], ...Array.isArray(i) ? i : []], o = e.isSomeLoading(a), s = e.isSomeFetching(a), c = e.isSomePending(a), l = e.isAllEnabled(a), u = e.findFirstError(a);
|
|
@@ -55,7 +55,7 @@ var n = class n {
|
|
|
55
55
|
options: []
|
|
56
56
|
};
|
|
57
57
|
let m = s ?? ((e, n) => t.sortComperator(a(e), a(n))), h = [];
|
|
58
|
-
return l || (h = (n.isResponse(r) ? r.data : r)?.sort(m).map((e) => ({
|
|
58
|
+
return l || (h = (n.isResponse(r) ? r.data : r)?.slice().sort(m).map((e) => ({
|
|
59
59
|
label: a(e),
|
|
60
60
|
value: i(e)
|
|
61
61
|
})) ?? []), {
|
|
@@ -71,7 +71,6 @@ var n = class n {
|
|
|
71
71
|
return !(!e || typeof e != "object" || !("isLoading" in e) || !("isFetching" in e) || !("isPending" in e) || !("isEnabled" in e) || !("error" in e));
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
//#endregion
|
|
75
74
|
export { n as DataHookUtil };
|
|
76
75
|
|
|
77
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DataHookUtil","loadablesAndResponse","response","loadables","isLoading","LoadableUtil","isFetching","isPending","isEnabled","error","map","items","getId","item","getName","sort","sortComperator","StringUtil","createLabel","a","b","options"],"sources":["../../../src/utils/DataHookUtil/DataHookUtil.ts"],"sourcesContent":["import type { UseQueryResult } from '@tanstack/react-query';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport type {\n Loadable,\n UseMap,\n UseNameFactory,\n UseOptions,\n} from '../../models/data-hooks.models';\nimport { LoadableUtil } from '../LoadableUtil';\n\nexport class DataHookUtil {\n public static createUseMapDataHook<TValue>(\n response: TValue[] | UseQueryResult<TValue[]>,\n getId: (item: TValue) => string,\n loadables: Loadable[] = [],\n ): UseMap<TValue> {\n const loadablesAndResponse: Loadable[] = [...(DataHookUtil.isResponse(response) ? [response] : []), ...(Array.isArray(loadables) ? loadables : [])];\n\n const isLoading = LoadableUtil.isSomeLoading(loadablesAndResponse);\n const isFetching = LoadableUtil.isSomeFetching(loadablesAndResponse);\n const isPending = LoadableUtil.isSomePending(loadablesAndResponse);\n const isEnabled = LoadableUtil.isAllEnabled(loadablesAndResponse);\n const error = LoadableUtil.findFirstError(loadablesAndResponse);\n\n if (error) {\n return {\n error,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n map: new Map(),\n };\n }\n\n let map: Map<string, TValue> = new Map();\n if (!isLoading) {\n const items = DataHookUtil.isResponse(response) ? response.data : response;\n map = new Map(items?.map(item => [getId(item), item]));\n }\n\n return {\n error: null,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n map,\n };\n }\n\n public static createUseNameFactoryHook<TValue>(\n getName: (item: TValue) => string,\n loadables?: Loadable[],\n ): UseNameFactory<TValue> {\n const isLoading = Array.isArray(loadables) ? LoadableUtil.isSomeLoading(loadables) : false;\n const isFetching = Array.isArray(loadables) ? LoadableUtil.isSomeFetching(loadables) : false;\n const isPending = Array.isArray(loadables) ? LoadableUtil.isSomePending(loadables) : false;\n const isEnabled = Array.isArray(loadables) ? LoadableUtil.isAllEnabled(loadables) : false;\n const error = Array.isArray(loadables) ? LoadableUtil.findFirstError(loadables) : null;\n\n if (error) {\n return {\n error,\n getName,\n isEnabled: true,\n isFetching: false,\n isLoading: false,\n isPending: false,\n };\n }\n\n return {\n error,\n getName: isLoading ? () => '' : getName,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n };\n\n }\n\n public static createUseOptionsDataHook<TItem>(\n response: TItem[] | UseQueryResult<TItem[]>,\n getId: (item: TItem) => string,\n createLabel: (item: TItem) => string,\n loadables?: Loadable[],\n sortComperator?: (a: TItem, b: TItem) => number,\n ): UseOptions<string> {\n const loadablesAndResponse: Loadable[] = [...(DataHookUtil.isResponse(response) ? [response] : []), ...(Array.isArray(loadables) ? loadables : [])];\n\n const isLoading = LoadableUtil.isSomeLoading(loadablesAndResponse);\n const isFetching = LoadableUtil.isSomeFetching(loadablesAndResponse);\n const isPending = LoadableUtil.isSomePending(loadablesAndResponse);\n const isEnabled = LoadableUtil.isAllEnabled(loadablesAndResponse);\n const error = LoadableUtil.findFirstError(loadablesAndResponse);\n\n if (error) {\n return {\n error,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n options: [],\n };\n }\n\n const sort = sortComperator ?? ((a: TItem, b: TItem) => StringUtil.sortComperator(createLabel(a), createLabel(b)));\n\n let options: {\n label: string;\n value: string;\n }[] = [];\n if (!isLoading) {\n const items = DataHookUtil.isResponse(response) ? response.data : response;\n options = items?.sort(sort).map(item => ({ label: createLabel(item), value: getId(item) })) ?? [];\n }\n\n return {\n error,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n options,\n };\n }\n\n private static isResponse<TValue>(response: unknown): response is UseQueryResult<TValue> {\n if (!response) {\n return false;\n }\n if (typeof response !== 'object') {\n return false;\n }\n if (!('isLoading' in response) || !('isFetching' in response) || !('isPending' in response) || !('isEnabled' in response) || !('error' in response)) {\n return false;\n }\n return true;\n }\n}\n"],"mappings":";;;AAWA,IAAaA,IAAb,MAAaA,EAAa;CACxB,OAAc,qBACZ,GACA,GACA,IAAwB,CAAC,GACT;EAChB,IAAMC,IAAmC,CAAC,GAAID,EAAa,WAAWE,CAAQ,IAAI,CAACA,CAAQ,IAAI,CAAC,GAAI,GAAI,MAAM,QAAQC,CAAS,IAAIA,IAAY,CAAC,CAAE,GAE5IC,IAAYC,EAAa,cAAcJ,CAAoB,GAC3DK,IAAaD,EAAa,eAAeJ,CAAoB,GAC7DM,IAAYF,EAAa,cAAcJ,CAAoB,GAC3DO,IAAYH,EAAa,aAAaJ,CAAoB,GAC1DQ,IAAQJ,EAAa,eAAeJ,CAAoB;EAE9D,IAAIQ,GACF,OAAO;GACL;GACA;GACA;GACA;GACA;GACA,qBAAK,IAAI,IAAI;EACf;EAGF,IAAIC,oBAA2B,IAAI,IAAI;EACvC,IAAI,CAACN,GAAW;GACd,IAAMO,IAAQX,EAAa,WAAWE,CAAQ,IAAIA,EAAS,OAAOA;GAClE,IAAM,IAAI,IAAIS,GAAO,KAAI,MAAQ,CAACC,EAAMC,CAAI,GAAGA,CAAI,CAAC,CAAC;EACvD;EAEA,OAAO;GACL,OAAO;GACP;GACA;GACA;GACA;GACA;EACF;CACF;CAEA,OAAc,yBACZ,GACA,GACwB;EACxB,IAAMT,IAAY,MAAM,QAAQD,CAAS,IAAIE,EAAa,cAAcF,CAAS,IAAI,IAC/EG,IAAa,MAAM,QAAQH,CAAS,IAAIE,EAAa,eAAeF,CAAS,IAAI,IACjFI,IAAY,MAAM,QAAQJ,CAAS,IAAIE,EAAa,cAAcF,CAAS,IAAI,IAC/EK,IAAY,MAAM,QAAQL,CAAS,IAAIE,EAAa,aAAaF,CAAS,IAAI,IAC9EM,IAAQ,MAAM,QAAQN,CAAS,IAAIE,EAAa,eAAeF,CAAS,IAAI;EAalF,OAXIM,IACK;GACL;GACA;GACA,WAAW;GACX,YAAY;GACZ,WAAW;GACX,WAAW;EACb,IAGK;GACL;GACA,SAASL,UAAkB,KAAKU;GAChC;GACA;GACA;GACA;EACF;CAEF;CAEA,OAAc,yBACZ,GACA,GACA,GACA,GACA,GACoB;EACpB,IAAMb,IAAmC,CAAC,GAAID,EAAa,WAAWE,CAAQ,IAAI,CAACA,CAAQ,IAAI,CAAC,GAAI,GAAI,MAAM,QAAQC,CAAS,IAAIA,IAAY,CAAC,CAAE,GAE5IC,IAAYC,EAAa,cAAcJ,CAAoB,GAC3DK,IAAaD,EAAa,eAAeJ,CAAoB,GAC7DM,IAAYF,EAAa,cAAcJ,CAAoB,GAC3DO,IAAYH,EAAa,aAAaJ,CAAoB,GAC1DQ,IAAQJ,EAAa,eAAeJ,CAAoB;EAE9D,IAAIQ,GACF,OAAO;GACL;GACA;GACA;GACA;GACA;GACA,SAAS,CAAC;EACZ;EAGF,IAAMM,IAAOC,OAAoB,GAAU,MAAaC,EAAW,eAAeC,EAAYC,CAAC,GAAGD,EAAYE,CAAC,CAAC,IAE5GC,IAGE,CAAC;EAMP,OALKjB,MAEH,KADcJ,EAAa,WAAWE,CAAQ,IAAIA,EAAS,OAAOA,EAAA,EACjD,KAAKa,CAAI,CAAC,CAAC,KAAI,OAAS;GAAE,OAAOG,EAAYL,CAAI;GAAG,OAAOD,EAAMC,CAAI;EAAE,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","names":["DataHookUtil","loadablesAndResponse","response","loadables","isLoading","LoadableUtil","isFetching","isPending","isEnabled","error","map","items","getId","item","getName","sort","sortComperator","StringUtil","createLabel","a","b","options"],"sources":["../../../src/utils/DataHookUtil/DataHookUtil.ts"],"sourcesContent":["import type { UseQueryResult } from '@tanstack/react-query';\nimport { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\n\nimport type {\n Loadable,\n UseMap,\n UseNameFactory,\n UseOptions,\n} from '../../models/data-hooks.models';\nimport { LoadableUtil } from '../LoadableUtil';\n\nexport class DataHookUtil {\n public static createUseMapDataHook<TValue>(\n response: TValue[] | UseQueryResult<TValue[]>,\n getId: (item: TValue) => string,\n loadables: Loadable[] = [],\n ): UseMap<TValue> {\n const loadablesAndResponse: Loadable[] = [...(DataHookUtil.isResponse(response) ? [response] : []), ...(Array.isArray(loadables) ? loadables : [])];\n\n const isLoading = LoadableUtil.isSomeLoading(loadablesAndResponse);\n const isFetching = LoadableUtil.isSomeFetching(loadablesAndResponse);\n const isPending = LoadableUtil.isSomePending(loadablesAndResponse);\n const isEnabled = LoadableUtil.isAllEnabled(loadablesAndResponse);\n const error = LoadableUtil.findFirstError(loadablesAndResponse);\n\n if (error) {\n return {\n error,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n map: new Map(),\n };\n }\n\n let map: Map<string, TValue> = new Map();\n if (!isLoading) {\n const items = DataHookUtil.isResponse(response) ? response.data : response;\n map = new Map(items?.map(item => [getId(item), item]));\n }\n\n return {\n error: null,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n map,\n };\n }\n\n public static createUseNameFactoryHook<TValue>(\n getName: (item: TValue) => string,\n loadables?: Loadable[],\n ): UseNameFactory<TValue> {\n const isLoading = Array.isArray(loadables) ? LoadableUtil.isSomeLoading(loadables) : false;\n const isFetching = Array.isArray(loadables) ? LoadableUtil.isSomeFetching(loadables) : false;\n const isPending = Array.isArray(loadables) ? LoadableUtil.isSomePending(loadables) : false;\n const isEnabled = Array.isArray(loadables) ? LoadableUtil.isAllEnabled(loadables) : false;\n const error = Array.isArray(loadables) ? LoadableUtil.findFirstError(loadables) : null;\n\n if (error) {\n return {\n error,\n getName,\n isEnabled: true,\n isFetching: false,\n isLoading: false,\n isPending: false,\n };\n }\n\n return {\n error,\n getName: isLoading ? () => '' : getName,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n };\n\n }\n\n public static createUseOptionsDataHook<TItem>(\n response: TItem[] | UseQueryResult<TItem[]>,\n getId: (item: TItem) => string,\n createLabel: (item: TItem) => string,\n loadables?: Loadable[],\n sortComperator?: (a: TItem, b: TItem) => number,\n ): UseOptions<string> {\n const loadablesAndResponse: Loadable[] = [...(DataHookUtil.isResponse(response) ? [response] : []), ...(Array.isArray(loadables) ? loadables : [])];\n\n const isLoading = LoadableUtil.isSomeLoading(loadablesAndResponse);\n const isFetching = LoadableUtil.isSomeFetching(loadablesAndResponse);\n const isPending = LoadableUtil.isSomePending(loadablesAndResponse);\n const isEnabled = LoadableUtil.isAllEnabled(loadablesAndResponse);\n const error = LoadableUtil.findFirstError(loadablesAndResponse);\n\n if (error) {\n return {\n error,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n options: [],\n };\n }\n\n const sort = sortComperator ?? ((a: TItem, b: TItem) => StringUtil.sortComperator(createLabel(a), createLabel(b)));\n\n let options: {\n label: string;\n value: string;\n }[] = [];\n if (!isLoading) {\n const items = DataHookUtil.isResponse(response) ? response.data : response;\n options = items?.slice().sort(sort).map(item => ({ label: createLabel(item), value: getId(item) })) ?? [];\n }\n\n return {\n error,\n isEnabled,\n isFetching,\n isLoading,\n isPending,\n options,\n };\n }\n\n private static isResponse<TValue>(response: unknown): response is UseQueryResult<TValue> {\n if (!response) {\n return false;\n }\n if (typeof response !== 'object') {\n return false;\n }\n if (!('isLoading' in response) || !('isFetching' in response) || !('isPending' in response) || !('isEnabled' in response) || !('error' in response)) {\n return false;\n }\n return true;\n }\n}\n"],"mappings":";;;AAWA,IAAaA,IAAb,MAAaA,EAAa;CACxB,OAAc,qBACZ,GACA,GACA,IAAwB,CAAC,GACT;EAChB,IAAMC,IAAmC,CAAC,GAAID,EAAa,WAAWE,CAAQ,IAAI,CAACA,CAAQ,IAAI,CAAC,GAAI,GAAI,MAAM,QAAQC,CAAS,IAAIA,IAAY,CAAC,CAAE,GAE5IC,IAAYC,EAAa,cAAcJ,CAAoB,GAC3DK,IAAaD,EAAa,eAAeJ,CAAoB,GAC7DM,IAAYF,EAAa,cAAcJ,CAAoB,GAC3DO,IAAYH,EAAa,aAAaJ,CAAoB,GAC1DQ,IAAQJ,EAAa,eAAeJ,CAAoB;EAE9D,IAAIQ,GACF,OAAO;GACL;GACA;GACA;GACA;GACA;GACA,qBAAK,IAAI,IAAI;EACf;EAGF,IAAIC,oBAA2B,IAAI,IAAI;EACvC,IAAI,CAACN,GAAW;GACd,IAAMO,IAAQX,EAAa,WAAWE,CAAQ,IAAIA,EAAS,OAAOA;GAClE,IAAM,IAAI,IAAIS,GAAO,KAAI,MAAQ,CAACC,EAAMC,CAAI,GAAGA,CAAI,CAAC,CAAC;EACvD;EAEA,OAAO;GACL,OAAO;GACP;GACA;GACA;GACA;GACA;EACF;CACF;CAEA,OAAc,yBACZ,GACA,GACwB;EACxB,IAAMT,IAAY,MAAM,QAAQD,CAAS,IAAIE,EAAa,cAAcF,CAAS,IAAI,IAC/EG,IAAa,MAAM,QAAQH,CAAS,IAAIE,EAAa,eAAeF,CAAS,IAAI,IACjFI,IAAY,MAAM,QAAQJ,CAAS,IAAIE,EAAa,cAAcF,CAAS,IAAI,IAC/EK,IAAY,MAAM,QAAQL,CAAS,IAAIE,EAAa,aAAaF,CAAS,IAAI,IAC9EM,IAAQ,MAAM,QAAQN,CAAS,IAAIE,EAAa,eAAeF,CAAS,IAAI;EAalF,OAXIM,IACK;GACL;GACA;GACA,WAAW;GACX,YAAY;GACZ,WAAW;GACX,WAAW;EACb,IAGK;GACL;GACA,SAASL,UAAkB,KAAKU;GAChC;GACA;GACA;GACA;EACF;CAEF;CAEA,OAAc,yBACZ,GACA,GACA,GACA,GACA,GACoB;EACpB,IAAMb,IAAmC,CAAC,GAAID,EAAa,WAAWE,CAAQ,IAAI,CAACA,CAAQ,IAAI,CAAC,GAAI,GAAI,MAAM,QAAQC,CAAS,IAAIA,IAAY,CAAC,CAAE,GAE5IC,IAAYC,EAAa,cAAcJ,CAAoB,GAC3DK,IAAaD,EAAa,eAAeJ,CAAoB,GAC7DM,IAAYF,EAAa,cAAcJ,CAAoB,GAC3DO,IAAYH,EAAa,aAAaJ,CAAoB,GAC1DQ,IAAQJ,EAAa,eAAeJ,CAAoB;EAE9D,IAAIQ,GACF,OAAO;GACL;GACA;GACA;GACA;GACA;GACA,SAAS,CAAC;EACZ;EAGF,IAAMM,IAAOC,OAAoB,GAAU,MAAaC,EAAW,eAAeC,EAAYC,CAAC,GAAGD,EAAYE,CAAC,CAAC,IAE5GC,IAGE,CAAC;EAMP,OALKjB,MAEH,KADcJ,EAAa,WAAWE,CAAQ,IAAIA,EAAS,OAAOA,EAAA,EACjD,MAAM,CAAC,CAAC,KAAKa,CAAI,CAAC,CAAC,KAAI,OAAS;GAAE,OAAOG,EAAYL,CAAI;GAAG,OAAOD,EAAMC,CAAI;EAAE,EAAE,KAAK,CAAC,IAGnG;GACL;GACA;GACA;GACA;GACA;GACA;EACF;CACF;CAEA,OAAe,WAAmB,GAAuD;EAUvF,OAHA,EANI,CAACX,KAGD,OAAOA,KAAa,YAGpB,EAAE,eAAeA,MAAa,EAAE,gBAAgBA,MAAa,EAAE,eAAeA,MAAa,EAAE,eAAeA,MAAa,EAAE,WAAWA;CAI5I;AACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { DependencyContainer } from 'tsyringe';
|
|
2
1
|
import { ConfigBase } from '../../models/config.models';
|
|
3
2
|
export declare class DependencyContainerUtil {
|
|
4
|
-
static
|
|
5
|
-
static resolveConfig<TConfig extends ConfigBase = ConfigBase>(
|
|
3
|
+
static registerConfig<TConfig extends ConfigBase>(config: TConfig): void;
|
|
4
|
+
static resolveConfig<TConfig extends ConfigBase = ConfigBase>(): TConfig;
|
|
6
5
|
}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import { t as e } from "../../_chunks/
|
|
2
|
-
import { t } from "../../
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
static createContainer(t) {
|
|
9
|
-
return a.register(n, { useValue: t }), a.registerInstance(r, i.getInstance()), a.register(e, { useFactory: () => new e({
|
|
10
|
-
config: t,
|
|
11
|
-
queryKeyDependencies: []
|
|
12
|
-
}) }), a;
|
|
1
|
+
import { t as e } from "../../_chunks/Reflect.js";
|
|
2
|
+
import { CONFIG_TOKEN as t } from "../../constants/config.constants.js";
|
|
3
|
+
import { container as n } from "tsyringe";
|
|
4
|
+
e();
|
|
5
|
+
var r = class {
|
|
6
|
+
static registerConfig(e) {
|
|
7
|
+
n.register(t, { useValue: e });
|
|
13
8
|
}
|
|
14
|
-
static resolveConfig(
|
|
15
|
-
return
|
|
9
|
+
static resolveConfig() {
|
|
10
|
+
return n.resolve(t);
|
|
16
11
|
}
|
|
17
12
|
};
|
|
18
|
-
|
|
19
|
-
export { o as DependencyContainerUtil };
|
|
13
|
+
export { r as DependencyContainerUtil };
|
|
20
14
|
|
|
21
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["require_Reflect","DependencyContainerUtil","CONFIG_TOKEN","config","container"],"sources":["../../../src/utils/DependencyContainerUtil/DependencyContainerUtil.ts"],"sourcesContent":["import 'reflect-metadata';\nimport { container } from 'tsyringe';\n\nimport { CONFIG_TOKEN } from '../../constants/config.constants';\nimport type { ConfigBase } from '../../models/config.models';\n\nexport class DependencyContainerUtil {\n public static registerConfig<TConfig extends ConfigBase>(config: TConfig): void {\n container.register(CONFIG_TOKEN, { useValue: config });\n }\n\n public static resolveConfig<TConfig extends ConfigBase = ConfigBase>(): TConfig {\n return container.resolve(CONFIG_TOKEN) as TConfig;\n }\n}\n"],"mappings":";;;;AAMA,IAAaC,IAAb,MAAqC;CACnC,OAAc,eAA2C,GAAuB;EAC9E,EAAU,SAASC,GAAc,EAAE,UAAUC,EAAO,CAAC;CACvD;CAEA,OAAc,gBAAkE;EAC9E,OAAOC,EAAU,QAAQF,CAAY;CACvC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/LoadableUtil/LoadableUtil.ts
|
|
2
2
|
var e = class {
|
|
3
3
|
static findFirstError(e) {
|
|
4
4
|
return e.find((e) => e.isEnabled && e.error)?.error;
|
|
@@ -19,7 +19,6 @@ var e = class {
|
|
|
19
19
|
return e.some((e) => e.isEnabled && e.isPending);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { e as LoadableUtil };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/MenuDataUtil/MenuDataUtil.ts
|
|
2
2
|
var e = class e {
|
|
3
3
|
static isMenuItemData(t) {
|
|
4
|
-
if (typeof t != "object" || !t) return !1;
|
|
4
|
+
if (typeof t != "object" || !t || Array.isArray(t)) return !1;
|
|
5
5
|
let n = t;
|
|
6
6
|
return !(n.uid !== void 0 && typeof n.uid != "string" || n.label !== void 0 && typeof n.label != "string" || n.callback !== void 0 && typeof n.callback != "function" || n.items !== void 0 && (!Array.isArray(n.items) || !n.items.every(e.isMenuItemData)) || n.disabled !== void 0 && typeof n.disabled != "boolean" || n.divider !== void 0 && typeof n.divider != "boolean" || n.autoCloseDisabled !== void 0 && typeof n.autoCloseDisabled != "boolean" || n.active !== void 0 && typeof n.active != "boolean" || n.checked !== void 0 && ![
|
|
7
7
|
"false",
|
|
@@ -13,7 +13,6 @@ var e = class e {
|
|
|
13
13
|
return Array.isArray(t) && t.every(e.isMenuItemData);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { e as MenuDataUtil };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MenuDataUtil","value","item"],"sources":["../../../src/utils/MenuDataUtil/MenuDataUtil.ts"],"sourcesContent":["import type { MenuItemData } from '@gen-epix/ui-core-components/models/nested-menu.models';\n\nexport class MenuDataUtil {\n\n public static isMenuItemData(value: unknown): value is MenuItemData {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const item = value as Record<string, unknown>;\n\n if (item.uid !== undefined && typeof item.uid !== 'string') {\n return false;\n }\n\n if (item.label !== undefined && typeof item.label !== 'string') {\n return false;\n }\n\n if (item.callback !== undefined && typeof item.callback !== 'function') {\n return false;\n }\n\n if (item.items !== undefined && (!Array.isArray(item.items) || !item.items.every(MenuDataUtil.isMenuItemData))) {\n return false;\n }\n\n if (item.disabled !== undefined && typeof item.disabled !== 'boolean') {\n return false;\n }\n\n if (item.divider !== undefined && typeof item.divider !== 'boolean') {\n return false;\n }\n\n if (item.autoCloseDisabled !== undefined && typeof item.autoCloseDisabled !== 'boolean') {\n return false;\n }\n\n if (item.active !== undefined && typeof item.active !== 'boolean') {\n return false;\n }\n\n if (item.checked !== undefined && !['false', 'mixed', 'true'].includes(item.checked as string)) {\n return false;\n }\n\n return true;\n }\n\n public static isMenuItemDataArray(value: unknown): value is MenuItemData[] {\n return Array.isArray(value) && value.every(MenuDataUtil.isMenuItemData);\n }\n}\n"],"mappings":";AAEA,IAAaA,IAAb,MAAaA,EAAa;CAExB,OAAc,eAAe,GAAuC;EAClE,IAAI,OAAOC,KAAU,aAAYA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["MenuDataUtil","value","item"],"sources":["../../../src/utils/MenuDataUtil/MenuDataUtil.ts"],"sourcesContent":["import type { MenuItemData } from '@gen-epix/ui-core-components/models/nested-menu.models';\n\nexport class MenuDataUtil {\n\n public static isMenuItemData(value: unknown): value is MenuItemData {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n return false;\n }\n\n const item = value as Record<string, unknown>;\n\n if (item.uid !== undefined && typeof item.uid !== 'string') {\n return false;\n }\n\n if (item.label !== undefined && typeof item.label !== 'string') {\n return false;\n }\n\n if (item.callback !== undefined && typeof item.callback !== 'function') {\n return false;\n }\n\n if (item.items !== undefined && (!Array.isArray(item.items) || !item.items.every(MenuDataUtil.isMenuItemData))) {\n return false;\n }\n\n if (item.disabled !== undefined && typeof item.disabled !== 'boolean') {\n return false;\n }\n\n if (item.divider !== undefined && typeof item.divider !== 'boolean') {\n return false;\n }\n\n if (item.autoCloseDisabled !== undefined && typeof item.autoCloseDisabled !== 'boolean') {\n return false;\n }\n\n if (item.active !== undefined && typeof item.active !== 'boolean') {\n return false;\n }\n\n if (item.checked !== undefined && !['false', 'mixed', 'true'].includes(item.checked as string)) {\n return false;\n }\n\n return true;\n }\n\n public static isMenuItemDataArray(value: unknown): value is MenuItemData[] {\n return Array.isArray(value) && value.every(MenuDataUtil.isMenuItemData);\n }\n}\n"],"mappings":";AAEA,IAAaA,IAAb,MAAaA,EAAa;CAExB,OAAc,eAAe,GAAuC;EAClE,IAAI,OAAOC,KAAU,aAAYA,KAAkB,MAAM,QAAQA,CAAK,GACpE,OAAO;EAGT,IAAMC,IAAOD;EAsCb,OAJA,EAhCIC,EAAK,QAAQ,KAAA,KAAa,OAAOA,EAAK,OAAQ,YAI9CA,EAAK,UAAU,KAAA,KAAa,OAAOA,EAAK,SAAU,YAIlDA,EAAK,aAAa,KAAA,KAAa,OAAOA,EAAK,YAAa,cAIxDA,EAAK,UAAU,KAAA,MAAc,CAAC,MAAM,QAAQA,EAAK,KAAK,KAAK,CAACA,EAAK,MAAM,MAAMF,EAAa,cAAc,MAIxGE,EAAK,aAAa,KAAA,KAAa,OAAOA,EAAK,YAAa,aAIxDA,EAAK,YAAY,KAAA,KAAa,OAAOA,EAAK,WAAY,aAItDA,EAAK,sBAAsB,KAAA,KAAa,OAAOA,EAAK,qBAAsB,aAI1EA,EAAK,WAAW,KAAA,KAAa,OAAOA,EAAK,UAAW,aAIpDA,EAAK,YAAY,KAAA,KAAa,CAAC;GAAC;GAAS;GAAS;EAAM,CAAC,CAAC,SAASA,EAAK,OAAiB;CAK/F;CAEA,OAAc,oBAAoB,GAAyC;EACzE,OAAO,MAAM,QAAQD,CAAK,KAAKA,EAAM,MAAMD,EAAa,cAAc;CACxE;AACF"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { AxiosUtil as e } from "../AxiosUtil/index.js";
|
|
2
2
|
import { t } from "i18next";
|
|
3
|
-
|
|
3
|
+
// src/utils/NotificationUtil/NotificationUtil.ts
|
|
4
4
|
var n = class {
|
|
5
5
|
static wrapErrorNotificationMessage(n, r) {
|
|
6
6
|
return e.isAxiosForbiddenError(r) && (n = t("{{message}} - You do not have permission to perform this action.", { message: n })), e.isAxiosUnauthorizedError(r) && (n = t("{{message}} - You are not logged in.", { message: n })), e.isAxiosNotFoundError(r) && (n = t("{{message}} - The item does not exist.", { message: n })), e.isAxiosBadRequestError(r) && (n = t("{{message}} - Bad request. The input data was not correct.", { message: n })), e.isAxiosConflictError(r) && (n = t("{{message}} - Conflict. The request could not be completed due to a conflict with the current state of the resource.", { message: n })), e.isAxiosInternalServerError(r) && (n = t("{{message}} - Internal Server Error. Please try again later.", { message: n })), n;
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n as NotificationUtil };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosUtil as e } from "../AxiosUtil/index.js";
|
|
2
|
-
|
|
2
|
+
// src/utils/StandardConfigUtil/StandardConfigUtil.ts
|
|
3
3
|
var t = () => null, n = () => null, r = () => null, i = () => null, a = class {
|
|
4
4
|
static createConfig() {
|
|
5
5
|
return {
|
|
@@ -53,10 +53,6 @@ var t = () => null, n = () => null, r = () => null, i = () => null, a = class {
|
|
|
53
53
|
retry: (t, n) => e.isAxiosInternalServerError(n) || e.isAxiosTimeoutError(n) ? t < 3 : !1,
|
|
54
54
|
retryDelay: (e) => Math.min(e > 1 ? 2 ** e * 3e3 : 3e3, 3e4)
|
|
55
55
|
},
|
|
56
|
-
spinner: {
|
|
57
|
-
DEFAULT_CIRCULAR_PROGRESS_SIZE: 40,
|
|
58
|
-
DEFAULT_TAKING_LONGER_TIMEOUT_MS: 8e3
|
|
59
|
-
},
|
|
60
56
|
table: {
|
|
61
57
|
CONDENSED_WIDTH_PX: 150,
|
|
62
58
|
DEFAULT_OVERSCAN_MAIN: 10,
|
|
@@ -70,7 +66,6 @@ var t = () => null, n = () => null, r = () => null, i = () => null, a = class {
|
|
|
70
66
|
};
|
|
71
67
|
}
|
|
72
68
|
};
|
|
73
|
-
//#endregion
|
|
74
69
|
export { a as StandardConfigUtil };
|
|
75
70
|
|
|
76
71
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ApplicationHeader","ConsentDialogContent","HomePageIntroduction","LicenseInformation","StandardConfigUtil","AxiosUtil","error","failureCount","attempt"],"sources":["../../../src/utils/StandardConfigUtil/StandardConfigUtil.ts"],"sourcesContent":["import type { ConfigBase } from '../../models/config.models';\nimport { AxiosUtil } from '../AxiosUtil';\n\nconst ApplicationHeader = (): ReturnType<ConfigBase['ApplicationHeader']> => null;\nconst ConsentDialogContent = (): ReturnType<ConfigBase['consentDialog']['Content']> => null;\nconst HomePageIntroduction = (): ReturnType<ConfigBase['HomePageIntroduction']> => null;\nconst LicenseInformation = (): ReturnType<ConfigBase['LicenseInformation']> => null;\n\nexport class StandardConfigUtil {\n public static createConfig(): Omit<ConfigBase, 'theme'> {\n const config: Omit<ConfigBase, 'theme'> = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ApplicationHeader,\n applicationName: 'Gen-EpiX',\n consentDialog: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Content: ConsentDialogContent,\n getButtonLabel: () => 'I consent',\n getShouldShow: () => !import.meta.env.DEV,\n getTitle: () => 'Consent',\n },\n\n createFooter: () => ({\n sections: [\n {\n header: 'Contact',\n items: [\n {\n href: 'mailto:ids-bioinformatics@rivm.nl',\n label: 'ids-bioinformatics@rivm.nl',\n },\n ],\n },\n {\n header: 'About',\n items: [\n {\n href: 'https://github.com/RIVM-bioinformatics/gen-epix',\n label: 'Copyright',\n },\n ],\n },\n {\n header: 'Languages',\n items: [\n {\n label: 'English',\n onClick: () => null,\n },\n ],\n },\n ],\n }),\n defaultRequestTimeout: 30000,\n enablePageEvents: true,\n getAPIBaseUrl: () => {\n return 'development';\n },\n getEnvironmentMessage: () => {\n return 'development';\n },\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n getSoftwareVersion: () => 'development',\n getTouchIconUrl: () => {\n return '/touch-icon.png';\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HomePageIntroduction,\n layout: {\n MAIN_CONTENT_ID: 'main-content',\n SIDEBAR_MENU_WIDTH: 4,\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n LicenseInformation,\n log: {\n LOG_INTERVAL_MS: 30000,\n },\n notifications: {\n autoHideAfterMs: 5000,\n },\n outages: {\n NUM_HOURS_TO_SHOW_SOON_ACTIVE_OUTAGES: 8,\n },\n queryClient: {\n retry: (import.meta.env.DEV)\n ? () => false\n : (failureCount: number, error: unknown) => {\n if (AxiosUtil.isAxiosInternalServerError(error) || AxiosUtil.isAxiosTimeoutError(error)) {\n return failureCount < 3;\n }\n return false;\n },\n retryDelay: attempt => Math.min(attempt > 1 ? 2 ** attempt * 3000 : 3000, 30 * 1000),\n },\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["ApplicationHeader","ConsentDialogContent","HomePageIntroduction","LicenseInformation","StandardConfigUtil","AxiosUtil","error","failureCount","attempt"],"sources":["../../../src/utils/StandardConfigUtil/StandardConfigUtil.ts"],"sourcesContent":["import type { ConfigBase } from '../../models/config.models';\nimport { AxiosUtil } from '../AxiosUtil';\n\nconst ApplicationHeader = (): ReturnType<ConfigBase['ApplicationHeader']> => null;\nconst ConsentDialogContent = (): ReturnType<ConfigBase['consentDialog']['Content']> => null;\nconst HomePageIntroduction = (): ReturnType<ConfigBase['HomePageIntroduction']> => null;\nconst LicenseInformation = (): ReturnType<ConfigBase['LicenseInformation']> => null;\n\nexport class StandardConfigUtil {\n public static createConfig(): Omit<ConfigBase, 'theme'> {\n const config: Omit<ConfigBase, 'theme'> = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ApplicationHeader,\n applicationName: 'Gen-EpiX',\n consentDialog: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Content: ConsentDialogContent,\n getButtonLabel: () => 'I consent',\n getShouldShow: () => !import.meta.env.DEV,\n getTitle: () => 'Consent',\n },\n\n createFooter: () => ({\n sections: [\n {\n header: 'Contact',\n items: [\n {\n href: 'mailto:ids-bioinformatics@rivm.nl',\n label: 'ids-bioinformatics@rivm.nl',\n },\n ],\n },\n {\n header: 'About',\n items: [\n {\n href: 'https://github.com/RIVM-bioinformatics/gen-epix',\n label: 'Copyright',\n },\n ],\n },\n {\n header: 'Languages',\n items: [\n {\n label: 'English',\n onClick: () => null,\n },\n ],\n },\n ],\n }),\n defaultRequestTimeout: 30000,\n enablePageEvents: true,\n getAPIBaseUrl: () => {\n return 'development';\n },\n getEnvironmentMessage: () => {\n return 'development';\n },\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n getSoftwareVersion: () => 'development',\n getTouchIconUrl: () => {\n return '/touch-icon.png';\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HomePageIntroduction,\n layout: {\n MAIN_CONTENT_ID: 'main-content',\n SIDEBAR_MENU_WIDTH: 4,\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n LicenseInformation,\n log: {\n LOG_INTERVAL_MS: 30000,\n },\n notifications: {\n autoHideAfterMs: 5000,\n },\n outages: {\n NUM_HOURS_TO_SHOW_SOON_ACTIVE_OUTAGES: 8,\n },\n queryClient: {\n retry: (import.meta.env.DEV)\n ? () => false\n : (failureCount: number, error: unknown) => {\n if (AxiosUtil.isAxiosInternalServerError(error) || AxiosUtil.isAxiosTimeoutError(error)) {\n return failureCount < 3;\n }\n return false;\n },\n retryDelay: attempt => Math.min(attempt > 1 ? 2 ** attempt * 3000 : 3000, 30 * 1000),\n },\n table: {\n CONDENSED_WIDTH_PX: 150,\n DEFAULT_OVERSCAN_MAIN: 10,\n DEFAULT_OVERSCAN_REVERSE: 10,\n },\n userFeedback: {\n SHOW_USER_FEEDBACK_TOOLTIP_AFTER_MS: 2 * 60 * 1000, // 2 minutes\n },\n userInactivityConfirmation: {\n ALLOWED_IDLE_TIME_MS: 25 * 60 * 1000, // 25 minutes\n NOTIFICATION_TIME_MS: 5 * 60 * 1000, // 5 minutes\n },\n };\n return config;\n }\n}\n"],"mappings":";;AAGA,IAAMA,UAAuE,MACvEC,UAAiF,MACjFC,UAA6E,MAC7EC,UAAyE,MAElEC,IAAb,MAAgC;CAC9B,OAAc,eAA0C;EAmGtD,OAAO;GAhGL;GACA,iBAAiB;GACjB,eAAe;IAEb,SAASH;IACT,sBAAsB;IACtB,qBAAqB;IACrB,gBAAgB;GAClB;GAEA,qBAAqB,EACnB,UAAU;IACR;KACE,QAAQ;KACR,OAAO,CACL;MACE,MAAM;MACN,OAAO;KACT,CACF;IACF;IACA;KACE,QAAQ;KACR,OAAO,CACL;MACE,MAAM;MACN,OAAO;KACT,CACF;IACF;IACA;KACE,QAAQ;KACR,OAAO,CACL;MACE,OAAO;MACP,eAAe;KACjB,CACF;IACF;GACF,EACF;GACA,uBAAuB;GACvB,kBAAkB;GAClB,qBACS;GAET,6BACS;GAIT,0BAA0B;GAC1B,uBACS;GAGT;GACA,QAAQ;IACN,iBAAiB;IACjB,oBAAoB;GACtB;GAEA;GACA,KAAK,EACH,iBAAiB,IACnB;GACA,eAAe,EACb,iBAAiB,IACnB;GACA,SAAS,EACP,uCAAuC,EACzC;GACA,aAAa;IACX,QAEK,GAAsB,MACnBI,EAAU,2BAA2BC,CAAK,KAAKD,EAAU,oBAAoBC,CAAK,IAC7EC,IAAe,IAEjB;IAEX,aAAY,MAAW,KAAK,IAAIC,IAAU,IAAI,KAAKA,IAAU,MAAO,KAAM,GAAS;GACrF;GACA,OAAO;IACL,oBAAoB;IACpB,uBAAuB;IACvB,0BAA0B;GAC5B;GACA,cAAc,EACZ,qCAAqC,KACvC;GACA,4BAA4B;IAC1B,sBAAsB;IACtB,sBAAsB;GACxB;EAEK;CACT;AACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "i18next";
|
|
2
|
-
|
|
2
|
+
// src/utils/TimeUtil/TimeUtil.ts
|
|
3
3
|
var t = class {
|
|
4
4
|
static getReadableTimeRemaining(t, n = !1) {
|
|
5
5
|
if (t < 1e3) return e("less than a second");
|
|
6
|
-
let r = Math.floor(t / 36e5), i = Math.round(t / 1e3), a = Math.floor(i / 60), o = i % 60;
|
|
6
|
+
let r = Math.floor(t / 36e5), i = Math.round(t / 1e3), a = Math.floor(i / 60) % 60, o = i % 60;
|
|
7
7
|
return r > 0 ? n ? e("more than {{hours}} hours", { hours: r }) : e("{{hours}} hours and {{minutes}} minutes", {
|
|
8
8
|
hours: r,
|
|
9
9
|
minutes: a
|
|
@@ -13,7 +13,6 @@ var t = class {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { t as TimeUtil };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TimeUtil","milliseconds","t","hours","seconds","minutes","remainingSeconds","round"],"sources":["../../../src/utils/TimeUtil/TimeUtil.ts"],"sourcesContent":["import { t } from 'i18next';\n\nexport class TimeUtil {\n public static getReadableTimeRemaining(milliseconds: number, round = false): string {\n\n if (milliseconds < 1000) {\n return t('less than a second');\n }\n\n const hours = Math.floor(milliseconds / 3600000);\n const seconds = Math.round(milliseconds / 1000);\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n\n if (hours > 0) {\n if (round) {\n return t('more than {{hours}} hours', { hours });\n }\n return t('{{hours}} hours and {{minutes}} minutes', { hours, minutes });\n }\n\n if (minutes === 0) {\n if (remainingSeconds < 10 && round) {\n return t('a few seconds');\n }\n if (remainingSeconds >= 10 && round) {\n return t('less than a minute');\n }\n return t('{{seconds}} seconds', { seconds: remainingSeconds });\n }\n\n if (remainingSeconds === 0 || round) {\n return t('{{minutes}} minutes', { minutes });\n }\n\n return t('{{minutes}} minutes and {{seconds}} seconds', { minutes, seconds: remainingSeconds });\n }\n}\n"],"mappings":";;AAEA,IAAaA,IAAb,MAAsB;CACpB,OAAc,yBAAyB,GAAsB,IAAQ,IAAe;EAElF,IAAIC,IAAe,KACjB,OAAOC,EAAE,oBAAoB;EAG/B,IAAMC,IAAQ,KAAK,MAAMF,IAAe,IAAO,GACzCG,IAAU,KAAK,MAAMH,IAAe,GAAI,GACxCI,IAAU,KAAK,MAAMD,IAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","names":["TimeUtil","milliseconds","t","hours","seconds","minutes","remainingSeconds","round"],"sources":["../../../src/utils/TimeUtil/TimeUtil.ts"],"sourcesContent":["import { t } from 'i18next';\n\nexport class TimeUtil {\n public static getReadableTimeRemaining(milliseconds: number, round = false): string {\n\n if (milliseconds < 1000) {\n return t('less than a second');\n }\n\n const hours = Math.floor(milliseconds / 3600000);\n const seconds = Math.round(milliseconds / 1000);\n const minutes = Math.floor(seconds / 60) % 60;\n const remainingSeconds = seconds % 60;\n\n if (hours > 0) {\n if (round) {\n return t('more than {{hours}} hours', { hours });\n }\n return t('{{hours}} hours and {{minutes}} minutes', { hours, minutes });\n }\n\n if (minutes === 0) {\n if (remainingSeconds < 10 && round) {\n return t('a few seconds');\n }\n if (remainingSeconds >= 10 && round) {\n return t('less than a minute');\n }\n return t('{{seconds}} seconds', { seconds: remainingSeconds });\n }\n\n if (remainingSeconds === 0 || round) {\n return t('{{minutes}} minutes', { minutes });\n }\n\n return t('{{minutes}} minutes and {{seconds}} seconds', { minutes, seconds: remainingSeconds });\n }\n}\n"],"mappings":";;AAEA,IAAaA,IAAb,MAAsB;CACpB,OAAc,yBAAyB,GAAsB,IAAQ,IAAe;EAElF,IAAIC,IAAe,KACjB,OAAOC,EAAE,oBAAoB;EAG/B,IAAMC,IAAQ,KAAK,MAAMF,IAAe,IAAO,GACzCG,IAAU,KAAK,MAAMH,IAAe,GAAI,GACxCI,IAAU,KAAK,MAAMD,IAAU,EAAE,IAAI,IACrCE,IAAmBF,IAAU;EAuBnC,OArBID,IAAQ,IACNI,IACKL,EAAE,6BAA6B,EAAE,SAAM,CAAC,IAE1CA,EAAE,2CAA2C;GAAE;GAAO;EAAQ,CAAC,IAGpEG,MAAY,IACVC,IAAmB,MAAMC,IACpBL,EAAE,eAAe,IAEtBI,KAAoB,MAAMC,IACrBL,EAAE,oBAAoB,IAExBA,EAAE,uBAAuB,EAAE,SAASI,EAAiB,CAAC,IAG3DA,MAAqB,KAAKC,IACrBL,EAAE,uBAAuB,EAAE,WAAQ,CAAC,IAGtCA,EAAE,+CAA+C;GAAE;GAAS,SAASI;EAAiB,CAAC;CAChG;AACF"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/UserUtil/UserUtil.ts
|
|
2
2
|
var e = class {
|
|
3
3
|
static getUserDisplayValue(e, t) {
|
|
4
4
|
return e ? `${e.name} (${e.key})` : t`Unknown user`;
|
|
5
5
|
}
|
|
6
6
|
};
|
|
7
|
-
//#endregion
|
|
8
7
|
export { e as UserUtil };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gen-epix/ui-client-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"homepage": "https://github.com/RIVM-bioinformatics/gen-epix",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -222,10 +222,6 @@
|
|
|
222
222
|
"types": "./dist/constants/query.constants.d.ts",
|
|
223
223
|
"import": "./dist/constants/query.constants.js"
|
|
224
224
|
},
|
|
225
|
-
"./context/ClientCommonConfigContext": {
|
|
226
|
-
"types": "./dist/context/ClientCommonConfigContext/index.d.ts",
|
|
227
|
-
"import": "./dist/context/ClientCommonConfigContext/index.js"
|
|
228
|
-
},
|
|
229
225
|
"./dataHooks/useIdentifierIssuerOwnOrganizationQuery": {
|
|
230
226
|
"types": "./dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.d.ts",
|
|
231
227
|
"import": "./dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js"
|
|
@@ -490,18 +486,18 @@
|
|
|
490
486
|
"last 2 Chrome versions"
|
|
491
487
|
],
|
|
492
488
|
"dependencies": {
|
|
493
|
-
"@hookform/resolvers": "
|
|
494
|
-
"@tanstack/react-query": "5.
|
|
489
|
+
"@hookform/resolvers": "6.0.1",
|
|
490
|
+
"@tanstack/react-query": "5.105.0",
|
|
495
491
|
"classnames": "2.5.1",
|
|
496
492
|
"clsx": "2.1.1",
|
|
497
493
|
"date-fns": "4.4.0",
|
|
498
|
-
"immer": "11.
|
|
494
|
+
"immer": "11.2.9",
|
|
499
495
|
"lodash": "4.18.1",
|
|
500
496
|
"oidc-client-ts": "3.5.0",
|
|
501
497
|
"reflect-metadata": "0.2.2",
|
|
502
498
|
"use-debounce": "10.1.1",
|
|
503
499
|
"uuid": "14.0.3",
|
|
504
|
-
"zustand": "5.0.
|
|
500
|
+
"zustand": "5.0.16"
|
|
505
501
|
},
|
|
506
502
|
"devDependencies": {
|
|
507
503
|
"@dnd-kit/core": "6.3.1",
|
|
@@ -510,46 +506,47 @@
|
|
|
510
506
|
"@emotion/cache": "11.14.0",
|
|
511
507
|
"@emotion/react": "11.14.0",
|
|
512
508
|
"@emotion/styled": "11.14.1",
|
|
513
|
-
"@gen-epix/api-commondb": "^4.
|
|
509
|
+
"@gen-epix/api-commondb": "^4.5.0",
|
|
514
510
|
"@gen-epix/eslint-config": "0.8.0",
|
|
515
511
|
"@gen-epix/translation-util": "0.5.0",
|
|
516
|
-
"@gen-epix/ui-core": "^3.
|
|
517
|
-
"@gen-epix/ui-core-components": "^4.
|
|
518
|
-
"@gen-epix/ui-core-form": "^4.
|
|
512
|
+
"@gen-epix/ui-core": "^3.10.0",
|
|
513
|
+
"@gen-epix/ui-core-components": "^4.6.0",
|
|
514
|
+
"@gen-epix/ui-core-form": "^4.5.0",
|
|
519
515
|
"@microsoft/api-extractor": "7.59.4",
|
|
520
516
|
"@mui/icons-material": "9.5.0",
|
|
521
517
|
"@mui/material": "9.5.0",
|
|
522
518
|
"@mui/styled-engine": "9.5.0",
|
|
523
519
|
"@mui/system": "9.5.0",
|
|
524
520
|
"@mui/utils": "9.5.0",
|
|
525
|
-
"@
|
|
521
|
+
"@testing-library/react": "^16.3.3",
|
|
522
|
+
"@types/lodash": "4.17.27",
|
|
526
523
|
"@types/node": "26.6.5",
|
|
527
524
|
"@types/react": "19.3.0",
|
|
528
525
|
"@vitejs/plugin-react": "6.1.2",
|
|
529
|
-
"@vitest/browser-playwright": "5.0.
|
|
530
|
-
"@vitest/coverage-v8": "5.0.
|
|
531
|
-
"axios": "1.
|
|
532
|
-
"eslint": "10.
|
|
533
|
-
"i18next": "26.
|
|
534
|
-
"jsdom": "30.1.
|
|
526
|
+
"@vitest/browser-playwright": "5.0.5",
|
|
527
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
528
|
+
"axios": "1.21.0",
|
|
529
|
+
"eslint": "10.13.0",
|
|
530
|
+
"i18next": "26.5.11",
|
|
531
|
+
"jsdom": "30.1.3",
|
|
535
532
|
"playwright": "1.64.1",
|
|
536
533
|
"react": "19.3.1",
|
|
537
534
|
"react-dom": "19.3.1",
|
|
538
535
|
"react-error-boundary": "6.1.6",
|
|
539
|
-
"react-hook-form": "7.
|
|
540
|
-
"react-i18next": "17.
|
|
536
|
+
"react-hook-form": "7.91.0",
|
|
537
|
+
"react-i18next": "17.1.9",
|
|
541
538
|
"react-oidc-context": "3.3.1",
|
|
542
|
-
"react-router": "8.
|
|
539
|
+
"react-router": "8.5.0",
|
|
543
540
|
"react-router-dom": "7.18.4",
|
|
544
541
|
"react-virtuoso": "4.18.19",
|
|
545
542
|
"tsyringe": "4.10.0",
|
|
546
543
|
"typescript": "6.0.3",
|
|
547
|
-
"vite": "8.3.
|
|
544
|
+
"vite": "8.3.5",
|
|
548
545
|
"vite-plugin-dts": "5.1.2",
|
|
549
546
|
"vite-plugin-lib-inject-css": "2.2.2",
|
|
550
547
|
"vite-plugin-static-copy": "4.1.1",
|
|
551
548
|
"vite-plugin-svgr": "5.2.0",
|
|
552
|
-
"vitest": "5.0.
|
|
549
|
+
"vitest": "5.0.5",
|
|
553
550
|
"vitest-browser-react": "2.3.0",
|
|
554
551
|
"yup": "1.7.1"
|
|
555
552
|
},
|
|
@@ -560,10 +557,10 @@
|
|
|
560
557
|
"@emotion/cache": "*",
|
|
561
558
|
"@emotion/react": "*",
|
|
562
559
|
"@emotion/styled": "*",
|
|
563
|
-
"@gen-epix/api-commondb": "^4.
|
|
564
|
-
"@gen-epix/ui-core": "^3.
|
|
565
|
-
"@gen-epix/ui-core-components": "^4.
|
|
566
|
-
"@gen-epix/ui-core-form": "^4.
|
|
560
|
+
"@gen-epix/api-commondb": "^4.5.0",
|
|
561
|
+
"@gen-epix/ui-core": "^3.10.0",
|
|
562
|
+
"@gen-epix/ui-core-components": "^4.6.0",
|
|
563
|
+
"@gen-epix/ui-core-form": "^4.5.0",
|
|
567
564
|
"@mui/icons-material": "*",
|
|
568
565
|
"@mui/material": "*",
|
|
569
566
|
"@mui/styled-engine": "*",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CoreComponentsConfig } from '@gen-epix/ui-core-components/context/CoreComponentsConfigContext';
|
|
2
|
-
import { DependencyContainer } from 'tsyringe';
|
|
3
|
-
import { ConfigBase } from '../../models/config.models';
|
|
4
|
-
export type ClientCommonConfig<TConfig extends ConfigBase = ConfigBase> = {
|
|
5
|
-
config: TConfig;
|
|
6
|
-
container: DependencyContainer;
|
|
7
|
-
coreComponentsConfig: CoreComponentsConfig;
|
|
8
|
-
};
|
|
9
|
-
export declare const ClientCommonConfigContext: import('react').Context<ClientCommonConfig<ConfigBase>>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { DependencyContainer } from 'tsyringe';
|
|
3
|
-
export type ClientCommonConfigContextProviderProps = PropsWithChildren<{
|
|
4
|
-
readonly container: DependencyContainer;
|
|
5
|
-
}>;
|
|
6
|
-
export declare const ClientCommonConfigContextProvider: (props: ClientCommonConfigContextProviderProps) => import('react').JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { DependencyContainerUtil as e } from "../../utils/DependencyContainerUtil/index.js";
|
|
2
|
-
import { createContext as t, use as n, useMemo as r } from "react";
|
|
3
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
-
import { CoreComponentsConfigContext as a } from "@gen-epix/ui-core-components/context/CoreComponentsConfigContext";
|
|
5
|
-
//#region src/context/ClientCommonConfigContext/ClientCommonConfigContext.tsx
|
|
6
|
-
var o = t(null), s = (t) => {
|
|
7
|
-
let { children: n, container: s } = t, c = e.resolveConfig(s), l = r(() => ({ spinner: {
|
|
8
|
-
defaultCircularProgressSize: c.spinner.DEFAULT_CIRCULAR_PROGRESS_SIZE,
|
|
9
|
-
defaultTakingLongerTimeoutMs: c.spinner.DEFAULT_TAKING_LONGER_TIMEOUT_MS
|
|
10
|
-
} }), [c.spinner]), u = r(() => ({
|
|
11
|
-
config: c,
|
|
12
|
-
container: s,
|
|
13
|
-
coreComponentsConfig: l
|
|
14
|
-
}), [
|
|
15
|
-
c,
|
|
16
|
-
s,
|
|
17
|
-
l
|
|
18
|
-
]);
|
|
19
|
-
return /* @__PURE__ */ i(a, {
|
|
20
|
-
value: l,
|
|
21
|
-
children: /* @__PURE__ */ i(o, {
|
|
22
|
-
value: u,
|
|
23
|
-
children: n
|
|
24
|
-
})
|
|
25
|
-
});
|
|
26
|
-
}, c = () => {
|
|
27
|
-
let e = n(o);
|
|
28
|
-
if (!e) throw Error("ClientCommonConfigContext is not available");
|
|
29
|
-
return e;
|
|
30
|
-
};
|
|
31
|
-
//#endregion
|
|
32
|
-
export { o as ClientCommonConfigContext, s as ClientCommonConfigContextProvider, c as useClientCommonConfigContext };
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ClientCommonConfigContext","createContext","ClientCommonConfigContextProvider","props","config","DependencyContainerUtil","container","coreComponentsConfig","useMemo","uiClientCommonConfig","CoreComponentsConfigContext","useClientCommonConfigContext","use"],"sources":["../../../src/context/ClientCommonConfigContext/ClientCommonConfigContext.tsx","../../../src/context/ClientCommonConfigContext/ClientCommonConfigContextProvider.tsx","../../../src/context/ClientCommonConfigContext/useClientCommonConfigContext.tsx"],"sourcesContent":["import type { CoreComponentsConfig } from '@gen-epix/ui-core-components/context/CoreComponentsConfigContext';\nimport { createContext } from 'react';\nimport type { DependencyContainer } from 'tsyringe';\n\nimport type { ConfigBase } from '../../models/config.models';\n\nexport type ClientCommonConfig<TConfig extends ConfigBase = ConfigBase> = {\n config: TConfig;\n container: DependencyContainer;\n coreComponentsConfig: CoreComponentsConfig;\n};\n\nexport const ClientCommonConfigContext = createContext<ClientCommonConfig>(null);\n","import { useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport { CoreComponentsConfigContext } from '@gen-epix/ui-core-components/context/CoreComponentsConfigContext';\nimport type { DependencyContainer } from 'tsyringe';\n\nimport { DependencyContainerUtil } from '../../utils/DependencyContainerUtil';\nimport type { ConfigBase } from '../../models/config.models';\n\nimport type { ClientCommonConfig } from './ClientCommonConfigContext';\nimport { ClientCommonConfigContext } from './ClientCommonConfigContext';\n\n\nexport type ClientCommonConfigContextProviderProps = PropsWithChildren<{\n readonly container: DependencyContainer;\n}>;\n\nexport const ClientCommonConfigContextProvider = (\n props: ClientCommonConfigContextProviderProps,\n) => {\n const { children, container } = props;\n const config = DependencyContainerUtil.resolveConfig<ConfigBase>(container);\n const coreComponentsConfig = useMemo<ClientCommonConfig['coreComponentsConfig']>(() => ({\n spinner: {\n defaultCircularProgressSize: config.spinner.DEFAULT_CIRCULAR_PROGRESS_SIZE,\n defaultTakingLongerTimeoutMs: config.spinner.DEFAULT_TAKING_LONGER_TIMEOUT_MS,\n },\n }), [config.spinner]);\n const uiClientCommonConfig = useMemo(() => ({ config, container, coreComponentsConfig }), [config, container, coreComponentsConfig]);\n\n return (\n <CoreComponentsConfigContext value={coreComponentsConfig}>\n <ClientCommonConfigContext value={uiClientCommonConfig}>\n {children}\n </ClientCommonConfigContext>\n </CoreComponentsConfigContext>\n );\n};\n","import { use } from 'react';\n\nimport type { ConfigBase } from '../../models/config.models';\n\nimport type { ClientCommonConfig } from './ClientCommonConfigContext';\nimport { ClientCommonConfigContext } from './ClientCommonConfigContext';\n\nexport const useClientCommonConfigContext = <TConfig extends ConfigBase = ConfigBase>(): ClientCommonConfig<TConfig> => {\n const config = use(ClientCommonConfigContext);\n if (!config) {\n throw new Error('ClientCommonConfigContext is not available');\n }\n return config as ClientCommonConfig<TConfig>;\n};\n"],"mappings":";;;;;AAYA,IAAaA,IAA4BC,EAAkC,IAAI,GCIlEC,KACX,MACG;CACH,IAAM,EAAE,aAAU,iBAAcC,GAC1BC,IAASC,EAAwB,cAA0BC,CAAS,GACpEC,IAAuBC,SAA2D,EACtF,SAAS;EACP,6BAA6BJ,EAAO,QAAQ;EAC5C,8BAA8BA,EAAO,QAAQ;CAC/C,EACF,IAAI,CAACA,EAAO,OAAO,CAAC,GACdK,IAAuBD,SAAe;EAAE;EAAQ;EAAW;CAAqB,IAAI;EAACJ;EAAQE;EAAWC;CAAoB,CAAC;CAEnI,OACE,kBAACG,GAAD;EAA6B,OAAOH;EAClC,UAAA,kBAACP,GAAD;GAA2B,OAAOS;GAC/B;EACwB,CAAA;CACA,CAAA;AAEjC,GC7BaE,UAA2G;CACtH,IAAMP,IAASQ,EAAIZ,CAAyB;CAC5C,IAAI,CAACI,GACH,MAAU,MAAM,4CAA4C;CAE9D,OAAOA;AACT"}
|