react-luminus-components 1.3.32 → 1.3.34

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.
Files changed (197) hide show
  1. package/README.md +0 -6
  2. package/dist/.vite/manifest.json +60 -60
  3. package/dist/FromToDatePickerDropdownToggle-DhzBIJXw.cjs +253 -0
  4. package/dist/{FromToDatePickerDropdownToggle-DDOxJCc2.js → FromToDatePickerDropdownToggle-Dk7MFcJp.js} +2761 -2615
  5. package/dist/{PrimaryButton-B64e5vBv.js → PrimaryButton-Bbl06m-g.js} +135 -145
  6. package/dist/PrimaryButton-D33g-RWP.cjs +1 -0
  7. package/dist/{SimpleTooltip-DIqIPx0H.cjs → SimpleTooltip-Bz22xxXa.cjs} +1 -1
  8. package/dist/{SimpleTooltip-BgRjtr0d.js → SimpleTooltip-C32Faxrc.js} +1 -1
  9. package/dist/components/BnfTableValueFormats/UserAvatarValueFormat/UserAvatarValueFormat.d.ts +2 -1
  10. package/dist/components/Buttons/ContextButton/ContextButton.d.ts +0 -1
  11. package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +0 -1
  12. package/dist/components/Buttons/FloatingSubmit/FloatingFormSubmit.d.ts +1 -0
  13. package/dist/components/Buttons/IconButton/IconButton.d.ts +0 -1
  14. package/dist/components/Buttons/PrimaryButton/PrimaryButton.d.ts +0 -1
  15. package/dist/components/Dropdown/Dropdown.d.ts +1 -1
  16. package/dist/components/Dropdown/comps/DropdownDivider/DropdownDivider.d.ts +2 -1
  17. package/dist/components/Dropdown/comps/DropdownItem/DropdownItem.d.ts +0 -1
  18. package/dist/components/Dropdown/comps/DropdownItem/FileUploadDropdownItem.d.ts +0 -1
  19. package/dist/components/Dropdown/comps/DropdownToggle/DropdownToggle.d.ts +1 -1
  20. package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +5 -4
  21. package/dist/components/Dropdown/comps/UserAvatarToggle/UserAvatarToggle.d.ts +2 -1
  22. package/dist/components/Form/CheckInput/CheckInput.d.ts +2 -2
  23. package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +2 -2
  24. package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +2 -2
  25. package/dist/components/Form/SelectInput/SelectInput.d.ts +2 -2
  26. package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +2 -2
  27. package/dist/components/Form/TextInput/TextInput.d.ts +2 -2
  28. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +2 -2
  29. package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +2 -2
  30. package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +3 -2
  31. package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +2 -2
  32. package/dist/components/HookForm/FloatingSubmit/HookFormFloatingSubmit.d.ts +1 -0
  33. package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +2 -2
  34. package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +2 -2
  35. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +2 -2
  36. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +2 -2
  37. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +2 -2
  38. package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +22 -23
  39. package/dist/components/InputContainers/InputAnchorContainer/InputAnchorContainer.d.ts +2 -2
  40. package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +22 -23
  41. package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +22 -23
  42. package/dist/components/Layout/MessageBoard/MessageBoard.d.ts +2 -1
  43. package/dist/components/Layout/MessageBoard/components/MessageList/MessageList.d.ts +2 -2
  44. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageFilters/MessageFilters.d.ts +0 -1
  45. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageItem/MessageItem.d.ts +2 -2
  46. package/dist/components/NewTabs/Tab/Tab.d.ts +1 -0
  47. package/dist/components/NewTabs/TabPanel/TabPanel.d.ts +0 -1
  48. package/dist/components/NewTabs/Tabs/Tabs.d.ts +2 -2
  49. package/dist/components/Tabs/Tabs.d.ts +1 -1
  50. package/dist/components/Tabs/comps/Tab/Tab.d.ts +1 -1
  51. package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +1 -0
  52. package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +1 -0
  53. package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +0 -1
  54. package/dist/components/common/Alert/Alert.d.ts +1 -1
  55. package/dist/components/common/AlertItem/AlertItem.d.ts +0 -1
  56. package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +2 -1
  57. package/dist/components/common/AppSearch/AppSearch.d.ts +2 -2
  58. package/dist/components/common/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +2 -2
  59. package/dist/components/common/AppSearch/comps/TypeSelector/TypeSelector.d.ts +3 -2
  60. package/dist/components/common/AppSearch/hooks/useSearchItems.d.ts +2 -1
  61. package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +2 -1
  62. package/dist/components/common/Backdrop/Backdrop.d.ts +0 -1
  63. package/dist/components/common/Badge/Badge.d.ts +0 -1
  64. package/dist/components/common/Card/Card.d.ts +0 -1
  65. package/dist/components/common/Collapse/Collapse.d.ts +0 -1
  66. package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +0 -1
  67. package/dist/components/common/ErrorBoundary/ErrorBoundary.d.ts +2 -1
  68. package/dist/components/common/FloatingActionContainer/FloatingActionContainer.d.ts +0 -1
  69. package/dist/components/common/FromToDatePicker/FromToDatePicker.d.ts +3 -2
  70. package/dist/components/common/FromToDatePicker/components/FromToDatePickerDropdownToggle/FromToDatePickerDropdownToggle.d.ts +2 -1
  71. package/dist/components/common/FromToDatePicker/hooks/useFromToDatePicker.d.ts +2 -1
  72. package/dist/components/common/FromToDatePicker/utils/utilsFromToDatePicker.d.ts +1 -0
  73. package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +3 -3
  74. package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +2 -2
  75. package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +2 -2
  76. package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +2 -1
  77. package/dist/components/common/ImgApi/ImgApi.d.ts +2 -2
  78. package/dist/components/common/ImgApi/hooks/useGetImgData.d.ts +2 -2
  79. package/dist/components/common/ImgDirect/ImgDirect.d.ts +2 -2
  80. package/dist/components/common/InvalidFeedback/InvalidFeedback.d.ts +0 -1
  81. package/dist/components/common/Loading/Loading.d.ts +0 -1
  82. package/dist/components/common/Loading/LoadingBlock.d.ts +1 -0
  83. package/dist/components/common/MonthPicker/MonthPicker.d.ts +1 -1
  84. package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +2 -2
  85. package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +2 -2
  86. package/dist/components/common/PromptDialog/PromptDialog.d.ts +0 -1
  87. package/dist/components/common/SimplePicker/SimplePicker.d.ts +2 -1
  88. package/dist/components/common/Timeline/Timeline.d.ts +2 -2
  89. package/dist/components/common/Typography/Typography.d.ts +0 -1
  90. package/dist/components/common/VersionInfo/VersionInfo.d.ts +0 -1
  91. package/dist/components/common/Widget/WidgetCard.d.ts +1 -0
  92. package/dist/components/common/Widget/WidgetWrapper.d.ts +1 -0
  93. package/dist/components/common/YearPicker/YearPicker.d.ts +0 -1
  94. package/dist/contexts/auth/AuthContext.d.ts +3 -3
  95. package/dist/contexts/auth/AuthProvider.d.ts +2 -2
  96. package/dist/contexts/confirm/ConfirmContext.d.ts +1 -2
  97. package/dist/contexts/confirm/ConfirmProvider.d.ts +0 -1
  98. package/dist/contexts/delegation/DelegationContext.d.ts +3 -2
  99. package/dist/contexts/delegation/DelegationProvider.d.ts +0 -1
  100. package/dist/contexts/loading/LoadingContext.d.ts +1 -2
  101. package/dist/contexts/loading/LoadingProvider.d.ts +0 -1
  102. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +3 -16
  103. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +4 -17
  104. package/dist/contexts/prompt/PromptContext.d.ts +3 -3
  105. package/dist/contexts/prompt/PromptProvider.d.ts +1 -0
  106. package/dist/contexts/user/UserContext.d.ts +4 -4
  107. package/dist/contexts/user/UserProvider.d.ts +0 -1
  108. package/dist/contexts.cjs.js +1 -1
  109. package/dist/contexts.d.ts +1 -257
  110. package/dist/contexts.es.js +129 -158
  111. package/dist/{dateUtils-C8trxO28.js → dateUtils-B9-rf1Eh.js} +11 -21
  112. package/dist/{dateUtils-ChS-y8JY.cjs → dateUtils-Bs39Qj7k.cjs} +1 -1
  113. package/dist/hooks/useAxios/useAxios.d.ts +2 -1
  114. package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -0
  115. package/dist/hooks/useFormControlType/useFormControlType.d.ts +1 -1
  116. package/dist/hooks/useGetApiData/useGetApiData.d.ts +3 -3
  117. package/dist/hooks/useLocalStorageState/useLocalStorageState.d.ts +1 -2
  118. package/dist/hooks/useNotifications/useNotifications.d.ts +1 -1
  119. package/dist/hooks/usePrompt/usePrompt.d.ts +2 -1
  120. package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +2 -1
  121. package/dist/hooks.cjs.js +1 -1
  122. package/dist/hooks.d.ts +1 -162
  123. package/dist/hooks.es.js +22 -22
  124. package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +2 -2
  125. package/dist/layout/MainContainer/MainContainer.d.ts +2 -2
  126. package/dist/layout/PageTitle/PageTitle.d.ts +1 -0
  127. package/dist/layout/SideContentBar/SideContentBar.d.ts +1 -0
  128. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +2 -2
  129. package/dist/layout/SideMenu/SideMenu.d.ts +2 -2
  130. package/dist/layout/TopBar/TopBar.d.ts +0 -1
  131. package/dist/layout.cjs.js +1 -1
  132. package/dist/layout.d.ts +1 -56
  133. package/dist/layout.es.js +92 -95
  134. package/dist/main.cjs.js +1 -1
  135. package/dist/main.d.ts +1 -1
  136. package/dist/main.es.js +1149 -1171
  137. package/dist/models/luminus-context-types/ILocalizationContext.d.ts +1 -0
  138. package/dist/models/prop-types/ContainerProps.d.ts +1 -0
  139. package/dist/models/prop-types/DashboardWidgetCommonProps.d.ts +1 -0
  140. package/dist/models/prop-types/FormInputProps/FormCheckInputProps.d.ts +2 -1
  141. package/dist/models/prop-types/FormInputProps/FormFileInputProps.d.ts +2 -1
  142. package/dist/models/prop-types/FormInputProps/FormNumericStepperInputProps.d.ts +2 -1
  143. package/dist/models/prop-types/FormInputProps/FormRadioInputProps.d.ts +2 -1
  144. package/dist/models/prop-types/FormInputProps/FormSelectInputProps.d.ts +2 -1
  145. package/dist/models/prop-types/FormInputProps/FormTextAreaInputProps.d.ts +2 -1
  146. package/dist/models/prop-types/FormInputProps/FormTextInputProps.d.ts +2 -1
  147. package/dist/models/prop-types/HookFormInputProps/HookFormCheckInputProps.d.ts +3 -2
  148. package/dist/models/prop-types/HookFormInputProps/HookFormDropdownPickerProps.d.ts +3 -2
  149. package/dist/models/prop-types/HookFormInputProps/HookFormFileInputProps.d.ts +3 -2
  150. package/dist/models/prop-types/HookFormInputProps/HookFormInputBaseProps.d.ts +2 -1
  151. package/dist/models/prop-types/HookFormInputProps/HookFormInputProps.d.ts +2 -1
  152. package/dist/models/prop-types/HookFormInputProps/HookFormNumericStepperInputProps.d.ts +3 -2
  153. package/dist/models/prop-types/HookFormInputProps/HookFormRadioInputProps.d.ts +3 -2
  154. package/dist/models/prop-types/HookFormInputProps/HookFormSelectInputProps.d.ts +3 -2
  155. package/dist/models/prop-types/HookFormInputProps/HookFormTextAreaInputProps.d.ts +3 -2
  156. package/dist/models/prop-types/HookFormInputProps/HookFormTextInputProps.d.ts +3 -2
  157. package/dist/models/prop-types/ImgProps.d.ts +1 -0
  158. package/dist/models/prop-types/InputContainerProps.d.ts +0 -1
  159. package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +2 -1
  160. package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +5 -5
  161. package/dist/models/prop-types/InputProps/FileInputProps.d.ts +2 -1
  162. package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +2 -1
  163. package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +2 -1
  164. package/dist/models/prop-types/InputProps/RadioInputProps.d.ts +3 -2
  165. package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +3 -2
  166. package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +2 -1
  167. package/dist/models/prop-types/InputProps/TextInputProps.d.ts +2 -2
  168. package/dist/models/texts/ComponentsContextTexts.d.ts +21 -2
  169. package/dist/models/texts/ErrorBoundaryTexts.d.ts +1 -0
  170. package/dist/models/types/ApiErrorResult.d.ts +2 -1
  171. package/dist/models/types/DashboardConfig.d.ts +2 -1
  172. package/dist/models/types/DashboardWidget.d.ts +2 -1
  173. package/dist/models/types/DropdownPickerOption.d.ts +2 -1
  174. package/dist/models/types/HookFormInputProps.d.ts +2 -1
  175. package/dist/models/types/MenuItemType.d.ts +0 -1
  176. package/dist/models/types/MenuItemTypeExtended.d.ts +2 -1
  177. package/dist/models/types/PhotoAction.d.ts +0 -1
  178. package/dist/models/types/SearchResultGroupModel.d.ts +3 -2
  179. package/dist/models/types/SearchResultModel.d.ts +2 -1
  180. package/dist/models/types/TimelineStep.d.ts +2 -2
  181. package/dist/models/types/UserLoginState.d.ts +3 -2
  182. package/dist/models/types/UserModel.d.ts +2 -1
  183. package/dist/{searchUtils-C38WM_G8.js → searchUtils-BCxOKHVq.js} +1 -1
  184. package/dist/{searchUtils-BdYnxcy0.cjs → searchUtils-CxNriHg_.cjs} +1 -1
  185. package/dist/{useLocalStorageState-asgEpnUg.cjs → useLocalStorageState-3ebV2Hf5.cjs} +1 -1
  186. package/dist/{useLocalStorageState-CFe9QRz0.js → useLocalStorageState-Cs1tOpr1.js} +3 -3
  187. package/dist/{usePermissions-Ce0AAKj1.cjs → usePermissions-BZPN1OT2.cjs} +1 -1
  188. package/dist/{usePermissions-55of2QBH.js → usePermissions-CfJgVLTi.js} +3 -3
  189. package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +2 -1
  190. package/dist/utils/bnfValueFormat/bnfValueFormat.d.ts +0 -1
  191. package/dist/utils/hookForm/hookFormUtils.d.ts +2 -1
  192. package/dist/utils.cjs.js +1 -1
  193. package/dist/utils.d.ts +1 -153
  194. package/dist/utils.es.js +7 -7
  195. package/package.json +2 -2
  196. package/dist/FromToDatePickerDropdownToggle-BPfviPUU.cjs +0 -253
  197. package/dist/PrimaryButton-BnrFH2PB.cjs +0 -1
@@ -1,257 +1 @@
1
- /// <reference types="react" />
2
-
3
- import { Context } from 'react';
4
- import { CreateAxiosDefaults } from 'axios';
5
- import { Dispatch } from 'react';
6
- import { GenericAbortSignal } from 'axios';
7
- import { IconBaseProps } from 'react-icons';
8
- import { JSX as JSX_2 } from 'react';
9
- import { LinkProps } from 'react-router-dom';
10
- import { Locale } from 'date-fns';
11
- import { NavigateProps } from 'react-router-dom';
12
- import { PublicClientApplication } from '@azure/msal-browser';
13
- import { ReactNode } from 'react';
14
- import { SetStateAction } from 'react';
15
-
16
- declare type AppSearchTexts = {
17
- searchPlaceholder: string;
18
- amountFrom: string;
19
- };
20
-
21
- export declare const AuthContext: Context<IAuthContext>;
22
-
23
- export declare const AuthProvider: ({ ...props }: Props_4) => JSX_2.Element;
24
-
25
- declare type AxiosTexts = {
26
- validationError: string;
27
- networkError: string;
28
- unexpectedError: string;
29
- forbiddenError: string;
30
- permissionError: string;
31
- };
32
-
33
- declare type BaseProps = {
34
- children: React.ReactNode;
35
- };
36
-
37
- declare type CommonLuminusIcons = 'edit' | 'delete' | 'info' | 'warning' | 'check' | 'danger' | 'chevron-left' | 'chevron-right';
38
-
39
- declare type ComponentsContextTexts = {
40
- messageBoard: MessageBoardTexts;
41
- date: DateTexts;
42
- };
43
-
44
- declare type ConfirmTexts = {
45
- yes: string;
46
- no: string;
47
- cancel: string;
48
- confirm: string;
49
- };
50
-
51
- declare type CustomSelectTexts = {
52
- searchPlaceholder: string;
53
- clearSelection: string;
54
- };
55
-
56
- declare type DateTexts = {
57
- year: string;
58
- month: string;
59
- week: string;
60
- day: string;
61
- custom: string;
62
- };
63
-
64
- export declare const DelegationContext: Context<IDelegationContext>;
65
-
66
- export declare const DelegationProvider: ({ children, relativeEndpoint }: Props_5) => JSX_2.Element;
67
-
68
- declare interface EmployeeSmallModel {
69
- id: number;
70
- name: string | null;
71
- kid: string | null;
72
- driverTrainingDate: string | null;
73
- }
74
-
75
- declare type ErrorBoundaryTexts = {
76
- reloadButtonContent: ReactNode;
77
- };
78
-
79
- declare type FormSubmitTexts = {
80
- storno: string;
81
- };
82
-
83
- declare type FormValidationTexts = {
84
- required: string;
85
- invalidDate: string;
86
- };
87
-
88
- declare type HomeDashboardTexts = {
89
- dashboardEdit: string;
90
- dashboardEditDone: string;
91
- pickWidgetToAdd: string;
92
- };
93
-
94
- declare interface IAuthContext {
95
- useMsal: boolean;
96
- msalInstance: PublicClientApplication | null;
97
- msalScopes: string[];
98
- }
99
-
100
- declare type IconComponentType = (props: {
101
- icon: CommonLuminusIcons;
102
- className?: string;
103
- iconProps?: IconBaseProps;
104
- }) => ReactNode;
105
-
106
- export declare interface IDelegationContext {
107
- delegation: NameIdIntModel | null;
108
- setDelegation: Dispatch<SetStateAction<NameIdIntModel | null>>;
109
- availableDelegations: UserDelegationModel[] | null;
110
- setAvailableDelegations: React.Dispatch<React.SetStateAction<UserDelegationModel[] | null>>;
111
- refreshAvailableDelegations: (signal?: GenericAbortSignal, loadCallCount?: number) => Promise<void>;
112
- }
113
-
114
- declare interface ILoadingContext {
115
- isLoading: boolean;
116
- startLoading: (key: string) => void;
117
- stopLoading: (key: string) => void;
118
- }
119
-
120
- declare interface ILocalizationContext {
121
- language: string;
122
- setLanguage: (lng: string) => void;
123
- dateFnsLocale: Locale;
124
- }
125
-
126
- export declare interface ILuminusComponentsContext {
127
- cookieDomain: string;
128
- axiosOptions: CreateAxiosDefaults;
129
- LinkComponent: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
130
- NavigateComponent: (props: NavigateProps) => null;
131
- localizationContext: Context<ILocalizationContext>;
132
- language: string;
133
- axiosTexts: AxiosTexts;
134
- confirmTexts: ConfirmTexts;
135
- formValidationTexts: FormValidationTexts;
136
- homeDashboardTexts: HomeDashboardTexts;
137
- formSubmitTexts: FormSubmitTexts;
138
- appSearchTexts: AppSearchTexts;
139
- customSelectTexts: CustomSelectTexts;
140
- errorBoundaryTexts: ErrorBoundaryTexts;
141
- widgetTexts: WidgetTexts;
142
- texts: ComponentsContextTexts;
143
- ProjectIconComponent: IconComponentType;
144
- }
145
-
146
- declare interface IUserContext {
147
- user: UserModel | null;
148
- userLoginState: UserLoginState;
149
- loginUser: (token?: string) => Promise<boolean>;
150
- logoutUser: () => void;
151
- }
152
-
153
- export declare const LoadingContext: Context<ILoadingContext>;
154
-
155
- export declare const LoadingProvider: ({ children }: Props_2) => JSX_2.Element;
156
-
157
- declare enum LoginState {
158
- LOGGING_IN = 0,
159
- LOGGED_IN = 1,
160
- LOGGED_OUT = 2,
161
- LOGIN_FAILED = 3
162
- }
163
-
164
- export declare const LuminusComponentsContext: Context<ILuminusComponentsContext>;
165
-
166
- export declare const LuminusComponentsProvider: ({ cookieDomain, axiosOptions, LinkComponent, NavigateComponent, language, axiosTexts, confirmTexts, formValidationTexts, homeDashboardTexts, formSubmitTexts, appSearchTexts, customSelectTexts, errorBoundaryTexts, widgetTexts, texts, ProjectIconComponent, localizationContext, children, }: Props) => JSX_2.Element;
167
-
168
- declare type MessageBoardTexts = {
169
- noMessages: string;
170
- };
171
-
172
- declare type MsalProps = {
173
- msalInstance: PublicClientApplication;
174
- msalScopes: string[];
175
- };
176
-
177
- declare type NameIdIntModel = {
178
- id: number;
179
- name: string | null;
180
- };
181
-
182
- declare type NameIdStringModel = {
183
- id: string;
184
- name: string | null;
185
- };
186
-
187
- declare type Props = {
188
- cookieDomain: string;
189
- axiosOptions: CreateAxiosDefaults;
190
- LinkComponent: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
191
- NavigateComponent: (props: NavigateProps) => null;
192
- language: string;
193
- axiosTexts: AxiosTexts;
194
- confirmTexts: ConfirmTexts;
195
- formValidationTexts: FormValidationTexts;
196
- homeDashboardTexts: HomeDashboardTexts;
197
- formSubmitTexts: FormSubmitTexts;
198
- appSearchTexts: AppSearchTexts;
199
- customSelectTexts: CustomSelectTexts;
200
- children: React.ReactNode;
201
- errorBoundaryTexts: ErrorBoundaryTexts;
202
- widgetTexts: WidgetTexts;
203
- texts: ComponentsContextTexts;
204
- ProjectIconComponent: IconComponentType;
205
- localizationContext: Context<ILocalizationContext>;
206
- };
207
-
208
- declare type Props_2 = {
209
- children: React.ReactNode;
210
- };
211
-
212
- declare type Props_3 = {
213
- children: React.ReactNode;
214
- };
215
-
216
- declare type Props_4 = BaseProps & ({
217
- useMsal?: false;
218
- } | (MsalProps & {
219
- useMsal: true;
220
- }));
221
-
222
- declare type Props_5 = {
223
- children: React.ReactNode;
224
- relativeEndpoint: string;
225
- };
226
-
227
- export declare const UserContext: Context<IUserContext>;
228
-
229
- declare interface UserDelegationModel {
230
- id: number;
231
- employee: EmployeeSmallModel;
232
- from: string | null;
233
- to: string | null;
234
- }
235
-
236
- declare type UserLoginState = {
237
- state: LoginState;
238
- user: UserModel | null;
239
- };
240
-
241
- declare type UserModel = {
242
- personalNumber: number;
243
- kid: string | null;
244
- name: string | null;
245
- photoId: number | null;
246
- permissions: string[] | null;
247
- orgUnit: NameIdStringModel;
248
- cafmToken: string | null;
249
- };
250
-
251
- export declare const UserProvider: ({ children }: Props_3) => JSX_2.Element;
252
-
253
- declare type WidgetTexts = {
254
- fallbackError: string;
255
- };
256
-
257
- export { }
1
+ export * from './contexts/index'
@@ -1,214 +1,185 @@
1
- import { j as n, al as R, U as A, am as G, an as z, ao as F, a4 as q, ad as O, ap as T, ae as B, ag as I, af as H, aq as J } from "./FromToDatePickerDropdownToggle-DDOxJCc2.js";
2
- import { useState as h, useCallback as f, useMemo as g, useContext as p, useEffect as w, useRef as M } from "react";
3
- import { EventType as k } from "@azure/msal-browser";
4
- import { MsalProvider as V } from "@azure/msal-react";
1
+ import { j as n, al as R, U as L, am as U, an as z, ao as F, a4 as B, ad as G, ap as O, ae as q, ag as S, af as H, aq as V } from "./FromToDatePickerDropdownToggle-Dk7MFcJp.js";
2
+ import { useState as h, useCallback as d, useMemo as g, useContext as j, useEffect as C, useRef as M } from "react";
3
+ import { EventType as N } from "@azure/msal-browser";
4
+ import { MsalProvider as J } from "@azure/msal-react";
5
5
  import "zod";
6
- import "react-hook-form";
7
6
  import "react-router-dom";
8
- import { u as K, a as Q, b as $, c as W } from "./useLocalStorageState-CFe9QRz0.js";
9
- import { f as v, b as X, P as b, L as Y } from "./PrimaryButton-B64e5vBv.js";
10
- import { m as Z } from "./dateUtils-C8trxO28.js";
7
+ import "react-hook-form";
8
+ import { u as K, a as Q, b as $, c as W } from "./useLocalStorageState-Cs1tOpr1.js";
9
+ import { f as v, b as X, P as I, L as Y } from "./PrimaryButton-Bbl06m-g.js";
10
+ import { m as Z } from "./dateUtils-B9-rf1Eh.js";
11
11
  const ee = ({ children: e }) => {
12
- const [r, a] = h(!1), [o, t] = h(""), s = f((i) => {
13
- a(!0), t(i);
14
- }, []), c = f(() => {
12
+ const [r, a] = h(!1), [o, t] = h(""), s = d((u) => {
13
+ a(!0), t(u);
14
+ }, []), i = d(() => {
15
15
  a(!1);
16
- }, []), l = g(() => ({ show: r, text: o, showConfirm: s, hideConfirm: c }), [r, o, s, c]);
16
+ }, []), l = g(() => ({ show: r, text: o, showConfirm: s, hideConfirm: i }), [r, o, s, i]);
17
17
  return /* @__PURE__ */ n.jsxs(R.Provider, { value: l, children: [
18
18
  /* @__PURE__ */ n.jsx(ne, {}),
19
19
  e
20
20
  ] });
21
21
  }, te = () => {
22
- const { confirmTexts: e } = p(A), { isShown: r, text: a, onFinish: o } = K(), { options: t } = p(G), [s, c] = h(t.defaultValue ?? ""), l = f(() => {
22
+ const { texts: { confirm: e } } = j(L), { isShown: r, text: a, onFinish: o } = K(), { options: t } = j(U), [s, i] = h(t.defaultValue ?? ""), l = d(() => {
23
23
  o(null);
24
- }, [o]), i = f((u) => {
25
- u.preventDefault(), !(t.required && !s) && o(s);
24
+ }, [o]), u = d((m) => {
25
+ m.preventDefault(), !(t.required && !s) && o(s);
26
26
  }, [o, t.required, s]);
27
- w(() => {
28
- r === !0 && c(t.defaultValue ?? "");
27
+ C(() => {
28
+ r === !0 && i(t.defaultValue ?? "");
29
29
  }, [r, t.defaultValue]);
30
- const m = g(() => ({
30
+ const x = g(() => ({
31
31
  value: s,
32
- onChange: (u) => c(u.currentTarget.value),
32
+ onChange: (m) => i(m.currentTarget.value),
33
33
  className: "w-100",
34
34
  autoFocus: !0,
35
35
  tabIndex: 0
36
36
  }), [s]);
37
37
  return /* @__PURE__ */ n.jsxs(v, { show: r, size: "sm", centered: !0, onHide: l, children: [
38
38
  /* @__PURE__ */ n.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ n.jsx(v.Title, { children: a }) }),
39
- /* @__PURE__ */ n.jsxs("form", { onSubmit: i, children: [
39
+ /* @__PURE__ */ n.jsxs("form", { onSubmit: u, children: [
40
40
  /* @__PURE__ */ n.jsxs(v.Body, { children: [
41
- t.input === "textarea" ? /* @__PURE__ */ n.jsx("textarea", { ...m, rows: 5 }) : void 0,
42
- t.input === "input" ? /* @__PURE__ */ n.jsx(X, { ...m, type: t.type }) : void 0
41
+ t.input === "textarea" ? /* @__PURE__ */ n.jsx("textarea", { ...x, rows: 5 }) : void 0,
42
+ t.input === "input" ? /* @__PURE__ */ n.jsx(X, { ...x, type: t.type }) : void 0
43
43
  ] }),
44
44
  /* @__PURE__ */ n.jsxs(v.Footer, { className: "w-100 d-flex gap-5", children: [
45
- /* @__PURE__ */ n.jsx(b, { variant: "outlined", color: "secondary", onClick: l, className: "flex-grow-1", children: e.cancel }),
46
- /* @__PURE__ */ n.jsx(b, { color: "primary", disabled: t.required && !s, type: "submit", className: "flex-grow-1", children: e.confirm })
45
+ /* @__PURE__ */ n.jsx(I, { variant: "outlined", color: "secondary", onClick: l, className: "flex-grow-1", children: e.cancel }),
46
+ /* @__PURE__ */ n.jsx(I, { color: "primary", disabled: t.required && !s, type: "submit", className: "flex-grow-1", children: e.confirm })
47
47
  ] })
48
48
  ] })
49
49
  ] });
50
50
  }, se = ({ children: e }) => {
51
- const [r, a] = h(!1), [o, t] = h(""), [s, c] = h({ input: "textarea", type: "text" }), l = M(() => {
52
- }), i = f((L) => {
53
- t(L), a(!0);
54
- }, []), m = f(() => {
51
+ const [r, a] = h(!1), [o, t] = h(""), [s, i] = h({ input: "textarea", type: "text" }), l = M(() => {
52
+ }), u = d((b) => {
53
+ t(b), a(!0);
54
+ }, []), x = d(() => {
55
55
  a(!1);
56
- }, []), u = g(() => ({
56
+ }, []), m = g(() => ({
57
57
  isShown: r,
58
58
  text: o,
59
- showPrompt: i,
60
- hidePrompt: m,
59
+ showPrompt: u,
60
+ hidePrompt: x,
61
61
  resolveRef: l,
62
62
  options: s,
63
- setOptions: c
64
- }), [r, o, i, m, s]);
65
- return /* @__PURE__ */ n.jsxs(G.Provider, { value: u, children: [
63
+ setOptions: i
64
+ }), [r, o, u, x, s]);
65
+ return /* @__PURE__ */ n.jsxs(U.Provider, { value: m, children: [
66
66
  e,
67
67
  /* @__PURE__ */ n.jsx(te, {})
68
68
  ] });
69
- }, xe = ({ cookieDomain: e, axiosOptions: r, LinkComponent: a, NavigateComponent: o, language: t, axiosTexts: s, confirmTexts: c, formValidationTexts: l, homeDashboardTexts: i, formSubmitTexts: m, appSearchTexts: u, customSelectTexts: L, errorBoundaryTexts: P, widgetTexts: y, texts: C, ProjectIconComponent: N, localizationContext: D, children: j }) => {
70
- const S = g(() => ({
69
+ }, fe = ({ cookieDomain: e, axiosOptions: r, language: a, texts: o, ProjectIconComponent: t, localizationContext: s, children: i }) => {
70
+ const l = g(() => ({
71
71
  axiosOptions: r,
72
72
  cookieDomain: e,
73
- LinkComponent: a,
74
- NavigateComponent: o,
75
- language: t,
76
- axiosTexts: s,
77
- confirmTexts: c,
78
- formValidationTexts: l,
79
- homeDashboardTexts: i,
80
- formSubmitTexts: m,
81
- appSearchTexts: u,
82
- customSelectTexts: L,
83
- errorBoundaryTexts: P,
84
- widgetTexts: y,
85
- texts: C,
86
- ProjectIconComponent: N,
87
- localizationContext: D
88
- }), [
89
- r,
90
- e,
91
- a,
92
- o,
93
- t,
94
- s,
95
- c,
96
- l,
97
- i,
98
- m,
99
- u,
100
- L,
101
- P,
102
- y,
103
- N,
104
- D,
105
- C
106
- ]);
107
- return /* @__PURE__ */ n.jsx(A.Provider, { value: S, children: /* @__PURE__ */ n.jsx(ee, { children: /* @__PURE__ */ n.jsxs(se, { children: [
73
+ language: a,
74
+ texts: o,
75
+ ProjectIconComponent: t,
76
+ localizationContext: s
77
+ }), [r, e, a, t, s, o]);
78
+ return /* @__PURE__ */ n.jsx(L.Provider, { value: l, children: /* @__PURE__ */ n.jsx(ee, { children: /* @__PURE__ */ n.jsxs(se, { children: [
108
79
  /* @__PURE__ */ n.jsx(z, {}),
109
- j
80
+ i
110
81
  ] }) }) });
111
82
  }, he = ({ children: e }) => {
112
- const [r, a] = h(!1), [o] = h(/* @__PURE__ */ new Set()), t = f((l) => {
83
+ const [r, a] = h(!1), [o] = h(/* @__PURE__ */ new Set()), t = d((l) => {
113
84
  o.add(l), a(!0);
114
- }, [o]), s = f((l) => {
85
+ }, [o]), s = d((l) => {
115
86
  o.delete(l), o.size === 0 && a(!1);
116
- }, [o]), c = g(() => ({ isLoading: r, startLoading: t, stopLoading: s }), [r, t, s]);
117
- return /* @__PURE__ */ n.jsxs(F.Provider, { value: c, children: [
87
+ }, [o]), i = g(() => ({ isLoading: r, startLoading: t, stopLoading: s }), [r, t, s]);
88
+ return /* @__PURE__ */ n.jsxs(F.Provider, { value: i, children: [
118
89
  r && /* @__PURE__ */ n.jsx(Y, {}),
119
90
  e
120
91
  ] });
121
92
  }, ve = ({ children: e }) => {
122
- const r = q(), { msalInstance: a } = p(O), { delegation: o, setDelegation: t, setAvailableDelegations: s, refreshAvailableDelegations: c } = p(T), { getToken: l } = B(), [i, m] = h(null), u = f(async () => {
123
- const d = await l();
124
- d && m(d);
93
+ const r = B(), { msalInstance: a } = j(G), { delegation: o, setDelegation: t, setAvailableDelegations: s, refreshAvailableDelegations: i } = j(O), { getToken: l } = q(), [u, x] = h(null), m = d(async () => {
94
+ const c = await l();
95
+ c && x(c);
125
96
  }, [l]);
126
- w(() => {
127
- u();
128
- }, [u]);
129
- const P = f(() => {
130
- const d = localStorage.getItem("user") ?? null;
131
- return d ? JSON.parse(d ?? "") : null;
132
- }, [])(), [y, C] = h({
133
- state: P ? I.LOGGED_IN : I.LOGGING_IN,
134
- user: P
135
- }), N = f(async (d) => {
136
- let x = null;
137
- return await r.get("/user/detail", d ? { headers: { Authorization: `Bearer ${d}` } } : void 0).then((E) => {
138
- x = E.data;
97
+ C(() => {
98
+ m();
99
+ }, [m]);
100
+ const D = d(() => {
101
+ const c = localStorage.getItem("user") ?? null;
102
+ return c ? JSON.parse(c ?? "") : null;
103
+ }, [])(), [P, y] = h({
104
+ state: D ? S.LOGGED_IN : S.LOGGING_IN,
105
+ user: D
106
+ }), k = d(async (c) => {
107
+ let f = null;
108
+ return await r.get("/user/detail", c ? { headers: { Authorization: `Bearer ${c}` } } : void 0).then((T) => {
109
+ f = T.data;
139
110
  }).catch(() => {
140
- x = null;
141
- }), x;
142
- }, [r]), D = f(() => {
143
- localStorage.removeItem("user"), C({
144
- state: I.LOGGED_OUT,
111
+ f = null;
112
+ }), f;
113
+ }, [r]), A = d(() => {
114
+ localStorage.removeItem("user"), y({
115
+ state: S.LOGGED_OUT,
145
116
  user: null
146
117
  }), t(null), s(null);
147
- }, [s, t]), j = f(async (d) => {
148
- C({
149
- state: I.LOGGING_IN,
118
+ }, [s, t]), w = d(async (c) => {
119
+ y({
120
+ state: S.LOGGING_IN,
150
121
  user: null
151
122
  });
152
- const x = await N(d);
153
- return x ? (C({
154
- state: I.LOGGED_IN,
155
- user: x
156
- }), localStorage.setItem("user", JSON.stringify(x)), await c(), !0) : (C({
157
- state: I.LOGIN_FAILED,
123
+ const f = await k(c);
124
+ return f ? (y({
125
+ state: S.LOGGED_IN,
126
+ user: f
127
+ }), localStorage.setItem("user", JSON.stringify(f)), await i(), !0) : (y({
128
+ state: S.LOGIN_FAILED,
158
129
  user: null
159
130
  }), !1);
160
- }, [N, c]), S = f(() => {
161
- D();
162
- }, [D]);
163
- w(() => {
131
+ }, [k, i]), p = d(() => {
132
+ A();
133
+ }, [A]);
134
+ C(() => {
164
135
  if (a) {
165
- const d = a.addEventCallback((x) => {
166
- if (x.eventType === k.LOGIN_SUCCESS && x.payload) {
167
- const E = x.payload;
168
- m(E.accessToken);
136
+ const c = a.addEventCallback((f) => {
137
+ if (f.eventType === N.LOGIN_SUCCESS && f.payload) {
138
+ const T = f.payload;
139
+ x(T.accessToken);
169
140
  }
170
141
  });
171
142
  return () => {
172
- d && a.removeEventCallback(d);
143
+ c && a.removeEventCallback(c);
173
144
  };
174
145
  }
175
146
  return () => {
176
147
  };
177
- }, [a, j, S]);
178
- const U = f(async (d) => {
179
- d && await j(d).catch(() => {
180
- S(), t(null);
148
+ }, [a, w, p]);
149
+ const E = d(async (c) => {
150
+ c && await w(c).catch(() => {
151
+ p(), t(null);
181
152
  });
182
- }, [j, S, t]);
183
- w(() => {
184
- U(i);
185
- }, [i, o == null ? void 0 : o.id, U]);
153
+ }, [w, p, t]);
154
+ C(() => {
155
+ E(u);
156
+ }, [u, o == null ? void 0 : o.id, E]);
186
157
  const _ = g(() => ({
187
- user: y.user,
188
- userLoginState: y,
189
- loginUser: j,
190
- logoutUser: S
191
- }), [y, j, S]);
158
+ user: P.user,
159
+ userLoginState: P,
160
+ loginUser: w,
161
+ logoutUser: p
162
+ }), [P, w, p]);
192
163
  return /* @__PURE__ */ n.jsx(H.Provider, { value: _, children: e });
193
164
  }, ge = ({ ...e }) => {
194
- const { cookieDomain: r } = p(A), [, a] = J(["Authorization"]), o = g(() => ({
165
+ const { cookieDomain: r } = j(L), [, a] = V(["Authorization"]), o = g(() => ({
195
166
  useMsal: e.useMsal ?? !1,
196
167
  msalInstance: e.useMsal ? e.msalInstance ?? null : null,
197
168
  msalScopes: e.useMsal ? e.msalScopes ?? [] : []
198
169
  }), [e]);
199
- return w(() => {
170
+ return C(() => {
200
171
  if (e.useMsal) {
201
172
  const t = e.msalInstance.addEventCallback((s) => {
202
- if (s.eventType === k.LOGIN_SUCCESS || s.eventType === k.ACQUIRE_TOKEN_SUCCESS && s.payload) {
203
- const c = s.payload, l = c.account;
173
+ if (s.eventType === N.LOGIN_SUCCESS || s.eventType === N.ACQUIRE_TOKEN_SUCCESS && s.payload) {
174
+ const i = s.payload, l = i.account;
204
175
  e.msalInstance.setActiveAccount(l);
205
- const i = c.accessToken, m = c.expiresOn;
206
- a("Authorization", i, {
176
+ const u = i.accessToken, x = i.expiresOn;
177
+ a("Authorization", u, {
207
178
  path: "/",
208
179
  secure: !0,
209
180
  sameSite: "none",
210
181
  domain: r,
211
- expires: m ?? void 0
182
+ expires: x ?? void 0
212
183
  });
213
184
  }
214
185
  s.error && console.error("AuthProvider MSAL Error", s);
@@ -219,60 +190,60 @@ const ee = ({ children: e }) => {
219
190
  }
220
191
  return () => {
221
192
  };
222
- }, [e, a, r]), /* @__PURE__ */ n.jsx(O.Provider, { value: o, children: e.useMsal ? /* @__PURE__ */ n.jsx(V, { instance: e.msalInstance, children: e.children }) : e.children });
193
+ }, [e, a, r]), /* @__PURE__ */ n.jsx(G.Provider, { value: o, children: e.useMsal ? /* @__PURE__ */ n.jsx(J, { instance: e.msalInstance, children: e.children }) : e.children });
223
194
  }, Ce = ({ children: e, relativeEndpoint: r }) => {
224
- const [a, o, t] = Q("user-delegation", null), { data: s, setData: c, reloadData: l } = $(r, {
195
+ const [a, o, t] = Q("user-delegation", null), { data: s, setData: i, reloadData: l } = $(r, {
225
196
  nullStateBeforeLoad: !1,
226
197
  nullStateOnFail: !0
227
- }), i = M(null);
228
- w(() => {
229
- const u = () => {
230
- l(), i.current = window.setTimeout(u, Z() + 5e3);
198
+ }), u = M(null);
199
+ C(() => {
200
+ const m = () => {
201
+ l(), u.current = window.setTimeout(m, Z() + 5e3);
231
202
  };
232
- return u(), () => {
233
- i.current !== null && window.clearTimeout(i.current);
203
+ return m(), () => {
204
+ u.current !== null && window.clearTimeout(u.current);
234
205
  };
235
- }, [l]), w(() => {
236
- const u = () => {
206
+ }, [l]), C(() => {
207
+ const m = () => {
237
208
  t();
238
209
  };
239
- return window.addEventListener("focus", u), () => {
240
- window.removeEventListener("focus", u);
210
+ return window.addEventListener("focus", m), () => {
211
+ window.removeEventListener("focus", m);
241
212
  };
242
213
  }, [t, l]);
243
- const m = g(() => ({
214
+ const x = g(() => ({
244
215
  delegation: a,
245
216
  setDelegation: o,
246
217
  availableDelegations: s,
247
- setAvailableDelegations: c,
218
+ setAvailableDelegations: i,
248
219
  refreshAvailableDelegations: l
249
220
  }), [
250
221
  a,
251
222
  o,
252
223
  s,
253
- c,
224
+ i,
254
225
  l
255
226
  ]);
256
- return /* @__PURE__ */ n.jsx(T.Provider, { value: m, children: e });
227
+ return /* @__PURE__ */ n.jsx(O.Provider, { value: x, children: e });
257
228
  }, ne = () => {
258
- const { confirmTexts: e } = p(A), { onConfirm: r, onCancel: a, text: o, show: t } = W();
229
+ const { texts: { confirm: e } } = j(L), { onConfirm: r, onCancel: a, text: o, show: t } = W();
259
230
  return /* @__PURE__ */ n.jsxs(v, { show: t, size: "sm", centered: !0, onHide: a, children: [
260
231
  /* @__PURE__ */ n.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ n.jsx(v.Title, { children: o }) }),
261
232
  /* @__PURE__ */ n.jsx(v.Body, { children: /* @__PURE__ */ n.jsxs("div", { className: "w-100 d-flex gap-5", children: [
262
- /* @__PURE__ */ n.jsx(b, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: a, children: e.no }),
263
- /* @__PURE__ */ n.jsx(b, { type: "button", color: "primary", onClick: r, className: "w-100 ml", children: e.yes })
233
+ /* @__PURE__ */ n.jsx(I, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: a, children: e.no }),
234
+ /* @__PURE__ */ n.jsx(I, { type: "button", color: "primary", onClick: r, className: "w-100 ml", children: e.yes })
264
235
  ] }) })
265
236
  ] });
266
237
  };
267
238
  export {
268
- O as AuthContext,
239
+ G as AuthContext,
269
240
  ge as AuthProvider,
270
- T as DelegationContext,
241
+ O as DelegationContext,
271
242
  Ce as DelegationProvider,
272
243
  F as LoadingContext,
273
244
  he as LoadingProvider,
274
- A as LuminusComponentsContext,
275
- xe as LuminusComponentsProvider,
245
+ L as LuminusComponentsContext,
246
+ fe as LuminusComponentsProvider,
276
247
  H as UserContext,
277
248
  ve as UserProvider
278
249
  };