@gen-epix/ui-client-common 4.5.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +44 -44
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +13 -13
- package/dist/_chunks/CrudPage.js +300 -300
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/Notifications.js +51 -51
- package/dist/_chunks/OutageList.js +29 -29
- package/dist/_chunks/OutageUtil.js +1 -2
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +96 -388
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +518 -512
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +8 -16
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +14 -12
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +77 -77
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +210 -209
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +8 -8
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseGet.js +280 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +274 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +22 -299
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/last.js +13 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/omit.js +41 -40
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/tableStore.js +190 -183
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/uniq.js +44 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useMutation.js +22 -22
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +25 -8
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/classes/abstracts/FilterAbstract/index.js +3 -1
- 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 -15
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +4 -4
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/index.js +3 -2
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +16 -38
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js +9 -8
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/I18nService/index.js +11 -10
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +12 -12
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +39 -33
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NotificationService/index.js +8 -8
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js +13 -9
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +3 -6
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/components/app/App/App.d.ts +1 -1
- package/dist/components/app/App/index.js +34 -38
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +28 -28
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +47 -45
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +35 -35
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +19 -19
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +52 -50
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +21 -21
- package/dist/components/filters/BooleanFilterField/index.js +5 -5
- package/dist/components/filters/DateFilterField/index.js +3 -3
- package/dist/components/filters/GeoFilterField/index.js +4 -4
- package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
- package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
- package/dist/components/filters/TextFilterField/index.js +3 -3
- package/dist/components/ui/ApplicationBar/index.js +188 -188
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +29 -29
- package/dist/components/ui/LicensesDialog/index.js +38 -38
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +16 -16
- package/dist/components/ui/NavLink/index.js +6 -6
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +21 -21
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +24 -24
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/Sidebar/index.js +30 -30
- package/dist/components/ui/UserFeedbackDialog/index.js +12 -12
- package/dist/constants/config.constants.d.ts +0 -2
- package/dist/constants/config.constants.js +2 -2
- package/dist/constants/config.constants.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +14 -14
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +12 -12
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationsQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +10 -10
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/hooks/useConfig/index.js +2 -2
- package/dist/hooks/useConfig/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/index.js +12 -12
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +16 -9
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +48 -33
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useItemQuery/index.js +4 -4
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/locale/en.json +1 -0
- package/dist/locale/nl.json +1 -0
- package/dist/models/config.models.d.ts +1 -5
- package/dist/models/theme.models.d.ts +19 -16
- package/dist/pages/AcceptInvitationPage/index.js +25 -25
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +16 -16
- package/dist/pages/ChooseIdentityProviderPage/index.js +21 -21
- package/dist/pages/IdentifierIssuersAdminPage/index.js +5 -5
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +5 -5
- package/dist/pages/OrganizationContactsAdminPage/index.js +6 -6
- package/dist/pages/OrganizationSitesAdminPage/index.js +9 -9
- package/dist/pages/OrganizationsAdminPage/index.js +13 -13
- package/dist/pages/OutagesAdminPage/index.js +20 -20
- package/dist/pages/PostLoginPage/index.js +6 -6
- package/dist/pages/PostLogoutPage/index.js +8 -8
- package/dist/pages/UsersAdminPage/index.js +39 -39
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.js +11 -4
- package/dist/setup/setup.js.map +1 -1
- package/dist/theme/demoTheme/index.js +17 -15
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/DataHookUtil/index.js +1 -1
- 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 -15
- package/dist/utils/DependencyContainerUtil/index.js.map +1 -1
- package/dist/utils/MenuDataUtil/index.js +1 -1
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/StandardConfigUtil/index.js +0 -4
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TimeUtil/index.js +1 -1
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/package.json +10 -13
- 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
|
@@ -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
|
})) ?? []), {
|
|
@@ -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,16 @@
|
|
|
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
13
|
//#endregion
|
|
19
|
-
export {
|
|
14
|
+
export { r as DependencyContainerUtil };
|
|
20
15
|
|
|
21
16
|
//# 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,7 +1,7 @@
|
|
|
1
1
|
//#region 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",
|
|
@@ -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"}
|
|
@@ -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,
|
|
@@ -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"}
|
|
@@ -3,7 +3,7 @@ import { t as e } from "i18next";
|
|
|
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
|
|
@@ -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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gen-epix/ui-client-common",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
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"
|
|
@@ -510,18 +506,19 @@
|
|
|
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.4.
|
|
509
|
+
"@gen-epix/api-commondb": "^4.4.1",
|
|
514
510
|
"@gen-epix/eslint-config": "0.8.0",
|
|
515
511
|
"@gen-epix/translation-util": "0.5.0",
|
|
516
|
-
"@gen-epix/ui-core": "^3.9.
|
|
517
|
-
"@gen-epix/ui-core-components": "^4.5.
|
|
518
|
-
"@gen-epix/ui-core-form": "^4.4.
|
|
512
|
+
"@gen-epix/ui-core": "^3.9.2",
|
|
513
|
+
"@gen-epix/ui-core-components": "^4.5.1",
|
|
514
|
+
"@gen-epix/ui-core-form": "^4.4.2",
|
|
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",
|
|
521
|
+
"@testing-library/react": "^16.3.3",
|
|
525
522
|
"@types/lodash": "4.17.26",
|
|
526
523
|
"@types/node": "26.6.5",
|
|
527
524
|
"@types/react": "19.3.0",
|
|
@@ -560,10 +557,10 @@
|
|
|
560
557
|
"@emotion/cache": "*",
|
|
561
558
|
"@emotion/react": "*",
|
|
562
559
|
"@emotion/styled": "*",
|
|
563
|
-
"@gen-epix/api-commondb": "^4.4.
|
|
564
|
-
"@gen-epix/ui-core": "^3.9.
|
|
565
|
-
"@gen-epix/ui-core-components": "^4.5.
|
|
566
|
-
"@gen-epix/ui-core-form": "^4.4.
|
|
560
|
+
"@gen-epix/api-commondb": "^4.4.1",
|
|
561
|
+
"@gen-epix/ui-core": "^3.9.2",
|
|
562
|
+
"@gen-epix/ui-core-components": "^4.5.1",
|
|
563
|
+
"@gen-epix/ui-core-form": "^4.4.2",
|
|
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"}
|