react-luminus-components 1.3.33 → 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 (165) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +64 -64
  3. package/dist/{FromToDatePickerDropdownToggle-BcOIaLyQ.cjs → FromToDatePickerDropdownToggle-DhzBIJXw.cjs} +1 -1
  4. package/dist/{FromToDatePickerDropdownToggle-CGnDN_zs.js → FromToDatePickerDropdownToggle-Dk7MFcJp.js} +59 -59
  5. package/dist/{PrimaryButton-B6qFyVVD.js → PrimaryButton-Bbl06m-g.js} +1 -1
  6. package/dist/{PrimaryButton-Dow_5lBe.cjs → PrimaryButton-D33g-RWP.cjs} +1 -1
  7. package/dist/{SimpleTooltip-CpLiAgNs.cjs → SimpleTooltip-Bz22xxXa.cjs} +1 -1
  8. package/dist/{SimpleTooltip-B0I1MS-L.js → SimpleTooltip-C32Faxrc.js} +1 -1
  9. package/dist/components/BnfTableValueFormats/UserAvatarValueFormat/UserAvatarValueFormat.d.ts +2 -1
  10. package/dist/components/Buttons/FloatingSubmit/FloatingFormSubmit.d.ts +1 -0
  11. package/dist/components/Dropdown/Dropdown.d.ts +1 -0
  12. package/dist/components/Dropdown/comps/DropdownDivider/DropdownDivider.d.ts +2 -1
  13. package/dist/components/Dropdown/comps/DropdownToggle/DropdownToggle.d.ts +1 -0
  14. package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +2 -1
  15. package/dist/components/Dropdown/comps/UserAvatarToggle/UserAvatarToggle.d.ts +2 -1
  16. package/dist/components/Form/CheckInput/CheckInput.d.ts +2 -1
  17. package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +2 -1
  18. package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +2 -1
  19. package/dist/components/Form/SelectInput/SelectInput.d.ts +2 -1
  20. package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +2 -1
  21. package/dist/components/Form/TextInput/TextInput.d.ts +2 -1
  22. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +2 -1
  23. package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +2 -1
  24. package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +3 -2
  25. package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +2 -1
  26. package/dist/components/HookForm/FloatingSubmit/HookFormFloatingSubmit.d.ts +1 -0
  27. package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +2 -1
  28. package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +2 -1
  29. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +2 -1
  30. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +2 -1
  31. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +2 -1
  32. package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +2 -2
  33. package/dist/components/InputContainers/InputAnchorContainer/InputAnchorContainer.d.ts +2 -1
  34. package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +2 -2
  35. package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +2 -2
  36. package/dist/components/Layout/MessageBoard/MessageBoard.d.ts +2 -1
  37. package/dist/components/Layout/MessageBoard/components/MessageList/MessageList.d.ts +2 -1
  38. package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageItem/MessageItem.d.ts +2 -1
  39. package/dist/components/NewTabs/Tab/Tab.d.ts +1 -0
  40. package/dist/components/NewTabs/Tabs/Tabs.d.ts +2 -1
  41. package/dist/components/Tabs/Tabs.d.ts +1 -0
  42. package/dist/components/Tabs/comps/Tab/Tab.d.ts +1 -0
  43. package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +1 -0
  44. package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +1 -0
  45. package/dist/components/common/Alert/Alert.d.ts +1 -0
  46. package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +2 -1
  47. package/dist/components/common/AppSearch/AppSearch.d.ts +2 -1
  48. package/dist/components/common/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +2 -1
  49. package/dist/components/common/AppSearch/comps/TypeSelector/TypeSelector.d.ts +3 -2
  50. package/dist/components/common/AppSearch/hooks/useSearchItems.d.ts +2 -1
  51. package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +2 -1
  52. package/dist/components/common/ErrorBoundary/ErrorBoundary.d.ts +2 -1
  53. package/dist/components/common/FromToDatePicker/FromToDatePicker.d.ts +3 -2
  54. package/dist/components/common/FromToDatePicker/components/FromToDatePickerDropdownToggle/FromToDatePickerDropdownToggle.d.ts +2 -1
  55. package/dist/components/common/FromToDatePicker/hooks/useFromToDatePicker.d.ts +2 -1
  56. package/dist/components/common/FromToDatePicker/utils/utilsFromToDatePicker.d.ts +1 -0
  57. package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +3 -2
  58. package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +2 -1
  59. package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +2 -1
  60. package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +2 -1
  61. package/dist/components/common/ImgApi/ImgApi.d.ts +2 -1
  62. package/dist/components/common/ImgApi/hooks/useGetImgData.d.ts +2 -1
  63. package/dist/components/common/ImgDirect/ImgDirect.d.ts +2 -1
  64. package/dist/components/common/Loading/LoadingBlock.d.ts +1 -0
  65. package/dist/components/common/MonthPicker/MonthPicker.d.ts +1 -0
  66. package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +2 -1
  67. package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +2 -1
  68. package/dist/components/common/SimplePicker/SimplePicker.d.ts +2 -1
  69. package/dist/components/common/Timeline/Timeline.d.ts +2 -1
  70. package/dist/components/common/Widget/WidgetCard.d.ts +1 -0
  71. package/dist/components/common/Widget/WidgetWrapper.d.ts +1 -0
  72. package/dist/contexts/auth/AuthContext.d.ts +3 -2
  73. package/dist/contexts/auth/AuthProvider.d.ts +2 -1
  74. package/dist/contexts/confirm/ConfirmContext.d.ts +1 -1
  75. package/dist/contexts/delegation/DelegationContext.d.ts +3 -2
  76. package/dist/contexts/loading/LoadingContext.d.ts +1 -1
  77. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +3 -2
  78. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +3 -2
  79. package/dist/contexts/prompt/PromptContext.d.ts +3 -2
  80. package/dist/contexts/prompt/PromptProvider.d.ts +1 -0
  81. package/dist/contexts/user/UserContext.d.ts +4 -3
  82. package/dist/contexts.cjs.js +1 -1
  83. package/dist/contexts.d.ts +1 -240
  84. package/dist/contexts.es.js +9 -9
  85. package/dist/{dateUtils-Bc53BdYm.js → dateUtils-B9-rf1Eh.js} +1 -1
  86. package/dist/{dateUtils-Y_XPaYyg.cjs → dateUtils-Bs39Qj7k.cjs} +1 -1
  87. package/dist/hooks/useAxios/useAxios.d.ts +2 -1
  88. package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -0
  89. package/dist/hooks/useGetApiData/useGetApiData.d.ts +3 -2
  90. package/dist/hooks/useLocalStorageState/useLocalStorageState.d.ts +1 -1
  91. package/dist/hooks/usePrompt/usePrompt.d.ts +2 -1
  92. package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +2 -1
  93. package/dist/hooks.cjs.js +1 -1
  94. package/dist/hooks.d.ts +1 -160
  95. package/dist/hooks.es.js +6 -6
  96. package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +2 -1
  97. package/dist/layout/MainContainer/MainContainer.d.ts +2 -1
  98. package/dist/layout/PageTitle/PageTitle.d.ts +1 -0
  99. package/dist/layout/SideContentBar/SideContentBar.d.ts +1 -0
  100. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +2 -1
  101. package/dist/layout/SideMenu/SideMenu.d.ts +2 -1
  102. package/dist/layout.cjs.js +1 -1
  103. package/dist/layout.d.ts +1 -54
  104. package/dist/layout.es.js +3 -3
  105. package/dist/main.cjs.js +1 -1
  106. package/dist/main.d.ts +1 -1
  107. package/dist/main.es.js +1467 -1467
  108. package/dist/models/luminus-context-types/ILocalizationContext.d.ts +1 -0
  109. package/dist/models/prop-types/ContainerProps.d.ts +1 -0
  110. package/dist/models/prop-types/DashboardWidgetCommonProps.d.ts +1 -0
  111. package/dist/models/prop-types/FormInputProps/FormCheckInputProps.d.ts +2 -1
  112. package/dist/models/prop-types/FormInputProps/FormFileInputProps.d.ts +2 -1
  113. package/dist/models/prop-types/FormInputProps/FormNumericStepperInputProps.d.ts +2 -1
  114. package/dist/models/prop-types/FormInputProps/FormRadioInputProps.d.ts +2 -1
  115. package/dist/models/prop-types/FormInputProps/FormSelectInputProps.d.ts +2 -1
  116. package/dist/models/prop-types/FormInputProps/FormTextAreaInputProps.d.ts +2 -1
  117. package/dist/models/prop-types/FormInputProps/FormTextInputProps.d.ts +2 -1
  118. package/dist/models/prop-types/HookFormInputProps/HookFormCheckInputProps.d.ts +3 -2
  119. package/dist/models/prop-types/HookFormInputProps/HookFormDropdownPickerProps.d.ts +3 -2
  120. package/dist/models/prop-types/HookFormInputProps/HookFormFileInputProps.d.ts +3 -2
  121. package/dist/models/prop-types/HookFormInputProps/HookFormInputBaseProps.d.ts +2 -1
  122. package/dist/models/prop-types/HookFormInputProps/HookFormInputProps.d.ts +2 -1
  123. package/dist/models/prop-types/HookFormInputProps/HookFormNumericStepperInputProps.d.ts +3 -2
  124. package/dist/models/prop-types/HookFormInputProps/HookFormRadioInputProps.d.ts +3 -2
  125. package/dist/models/prop-types/HookFormInputProps/HookFormSelectInputProps.d.ts +3 -2
  126. package/dist/models/prop-types/HookFormInputProps/HookFormTextAreaInputProps.d.ts +3 -2
  127. package/dist/models/prop-types/HookFormInputProps/HookFormTextInputProps.d.ts +3 -2
  128. package/dist/models/prop-types/ImgProps.d.ts +1 -0
  129. package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +2 -1
  130. package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +5 -4
  131. package/dist/models/prop-types/InputProps/FileInputProps.d.ts +2 -1
  132. package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +2 -1
  133. package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +2 -1
  134. package/dist/models/prop-types/InputProps/RadioInputProps.d.ts +3 -2
  135. package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +3 -2
  136. package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +2 -1
  137. package/dist/models/prop-types/InputProps/TextInputProps.d.ts +2 -1
  138. package/dist/models/texts/ComponentsContextTexts.d.ts +12 -11
  139. package/dist/models/texts/ErrorBoundaryTexts.d.ts +1 -0
  140. package/dist/models/types/ApiErrorResult.d.ts +2 -1
  141. package/dist/models/types/DashboardConfig.d.ts +2 -1
  142. package/dist/models/types/DashboardWidget.d.ts +2 -1
  143. package/dist/models/types/DropdownPickerOption.d.ts +2 -1
  144. package/dist/models/types/HookFormInputProps.d.ts +2 -1
  145. package/dist/models/types/MenuItemTypeExtended.d.ts +2 -1
  146. package/dist/models/types/SearchResultGroupModel.d.ts +3 -2
  147. package/dist/models/types/SearchResultModel.d.ts +2 -1
  148. package/dist/models/types/TimelineStep.d.ts +2 -1
  149. package/dist/models/types/UserLoginState.d.ts +3 -2
  150. package/dist/models/types/UserModel.d.ts +2 -1
  151. package/dist/{searchUtils-kismAHZM.js → searchUtils-BCxOKHVq.js} +1 -1
  152. package/dist/{searchUtils-qxu0IgEU.cjs → searchUtils-CxNriHg_.cjs} +1 -1
  153. package/dist/style.css +1 -1
  154. package/dist/{useFormControlType-BAFqxupC.js → useFormControlType-oJGqgThz.js} +3 -3
  155. package/dist/{useLocalStorageState-BxKcArKF.cjs → useLocalStorageState-3ebV2Hf5.cjs} +1 -1
  156. package/dist/{useLocalStorageState-HYmARj_B.js → useLocalStorageState-Cs1tOpr1.js} +1 -1
  157. package/dist/{usePermissions-yx-0zHae.cjs → usePermissions-BZPN1OT2.cjs} +1 -1
  158. package/dist/{usePermissions-Dl5tlwwt.js → usePermissions-CfJgVLTi.js} +3 -3
  159. package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +2 -1
  160. package/dist/utils/hookForm/hookFormUtils.d.ts +2 -1
  161. package/dist/utils.cjs.js +1 -1
  162. package/dist/utils.d.ts +1 -151
  163. package/dist/utils.es.js +6 -6
  164. package/dist/variables.scss +171 -171
  165. package/package.json +106 -106
package/dist/hooks.d.ts CHANGED
@@ -1,160 +1 @@
1
- import { AxiosInstance } from 'axios';
2
- import { CancelTokenStatic } from 'axios';
3
- import { Dispatch } from 'react';
4
- import { GenericAbortSignal } from 'axios';
5
- import { RefObject } from 'react';
6
- import { SetStateAction } from 'react';
7
- import { z } from 'zod';
8
-
9
- export declare const cancelToken: CancelTokenStatic;
10
-
11
- declare type Config = {
12
- authenticated?: boolean;
13
- differentBaseUrl?: string;
14
- silent?: boolean;
15
- customToken?: string;
16
- };
17
-
18
- declare type CustomTypeProps = {
19
- useCoerce?: boolean;
20
- };
21
-
22
- declare type NumberTypeProps = CustomTypeProps & {
23
- min?: number;
24
- max?: number;
25
- };
26
-
27
- declare type PromptOptions = {
28
- required?: boolean;
29
- input?: 'input' | 'textarea';
30
- type?: 'text' | 'date' | 'number';
31
- defaultValue?: string;
32
- };
33
-
34
- export declare const useAuth: () => {
35
- isAuthenticated: () => boolean;
36
- isAuthenticating: () => boolean;
37
- getToken: (() => string | null) | (() => Promise<string | null>);
38
- login: (kid: string, password: string) => Promise<string | null>;
39
- logout: () => void;
40
- };
41
-
42
- export declare const useAxios: (useAxiosConfig?: Config) => AxiosInstance;
43
-
44
- export declare const useClickOutside: (refs: RefObject<HTMLElement>[], callback: () => void) => void;
45
-
46
- export declare const useConfirm: () => {
47
- confirm: (t: string) => Promise<unknown>;
48
- onConfirm: () => void;
49
- onCancel: () => void;
50
- show: boolean;
51
- text: string;
52
- };
53
-
54
- export declare const useFormControlType: (type: "number" | "text" | "password" | "date" | "datetime-local", currentValue: string | null, isFocused: boolean) => "number" | "text" | "password" | "date" | "datetime-local";
55
-
56
- export declare const useGetApiData: <T>(uri: string, { loadOnInit, enabled, silent, nullStateBeforeLoad, nullStateOnFail, customApiUrl, customBearerToken, }?: UseGetApiDataOptions) => {
57
- data: T | null;
58
- setData: Dispatch<SetStateAction<T | null>>;
59
- reloadData: (signal?: GenericAbortSignal, loadCallCount?: number) => Promise<void>;
60
- };
61
-
62
- declare type UseGetApiDataOptions = {
63
- silent?: boolean;
64
- loadOnInit?: boolean;
65
- enabled?: boolean;
66
- nullStateBeforeLoad?: boolean;
67
- nullStateOnFail?: boolean;
68
- customApiUrl?: string;
69
- customBearerToken?: string;
70
- };
71
-
72
- export declare function useGetDataBound<T>(url: string): T | null;
73
-
74
- export declare const useKeyPress: (handleKeyPress: (e: KeyboardEvent) => void) => void;
75
-
76
- export declare const useLocalStorageState: <T>(key: string, initialValue: T) => readonly [T, Dispatch<SetStateAction<T>>, () => void];
77
-
78
- export declare const useNotifications: () => {
79
- addNotification: (message: string, type: "success" | "info" | "danger" | "warning" | "prompt") => void;
80
- };
81
-
82
- export declare const usePermissions: () => {
83
- checkUserHasPermissions: (permissions: string[]) => boolean;
84
- };
85
-
86
- export declare const usePrompt: () => {
87
- isShown: boolean;
88
- text: string;
89
- prompt: (t: string, options?: PromptOptions) => Promise<string | null>;
90
- onFinish: (userResponse: string | null) => void;
91
- };
92
-
93
- export declare const useZodSchemaTypes: () => {
94
- zString: (props?: CustomTypeProps) => z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>, string | null, string | null | undefined>;
95
- zStringRequired: (props?: CustomTypeProps) => z.ZodEffects<z.ZodString, string, string>;
96
- zNumber: (props?: NumberTypeProps) => z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, number, number>>>, number | null, number | null | undefined>;
97
- zNumberRequired: (props?: NumberTypeProps) => z.ZodEffects<z.ZodNumber, number, number>;
98
- zBool: (props?: CustomTypeProps) => z.ZodEffects<z.ZodBoolean, boolean, boolean>;
99
- zDate: (props?: CustomTypeProps) => z.ZodEffects<z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>, string | null, string | null>;
100
- zDateRequired: (props?: CustomTypeProps) => z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
101
- zEnum: (options: [string, ...string[]], props?: CustomTypeProps) => z.ZodEffects<z.ZodNullable<z.ZodEffects<z.ZodEnum<[string, ...string[]]>, string, string>>, string | null, string | null>;
102
- zEnumRequired: (options: [string, ...string[]], _props?: CustomTypeProps) => z.ZodEffects<z.ZodEnum<[string, ...string[]]>, string, string>;
103
- zObjectIdInt: (_props?: CustomTypeProps) => z.ZodEffects<z.ZodNullable<z.ZodObject<{
104
- id: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, number, number>>>, number | null, number | null | undefined>;
105
- }, "strip", z.ZodTypeAny, {
106
- id: number | null;
107
- }, {
108
- id?: number | null | undefined;
109
- }>>, {
110
- id: number | null;
111
- } | null, {
112
- id?: number | null | undefined;
113
- } | null>;
114
- zObjectIdIntRequired: (_props?: CustomTypeProps) => z.ZodEffects<z.ZodObject<{
115
- id: z.ZodEffects<z.ZodNumber, number, number>;
116
- }, "strip", z.ZodTypeAny, {
117
- id: number;
118
- }, {
119
- id: number;
120
- }>, {
121
- id: number;
122
- }, {
123
- id: number;
124
- }>;
125
- zObjectIdStr: (_props?: CustomTypeProps) => z.ZodEffects<z.ZodNullable<z.ZodObject<{
126
- id: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>, string | null, string | null | undefined>;
127
- }, "strip", z.ZodTypeAny, {
128
- id: string | null;
129
- }, {
130
- id?: string | null | undefined;
131
- }>>, {
132
- id: string | null;
133
- } | null, {
134
- id?: string | null | undefined;
135
- } | null>;
136
- zObjectIdStrRequired: (_props?: CustomTypeProps) => z.ZodEffects<z.ZodObject<{
137
- id: z.ZodEffects<z.ZodString, string, string>;
138
- }, "strip", z.ZodTypeAny, {
139
- id: string;
140
- }, {
141
- id: string;
142
- }>, {
143
- id: string;
144
- }, {
145
- id: string;
146
- }>;
147
- zFile: <T extends ZFileProps>({ required, multiple, maxFileSize }: T) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodAny, File[], any>, File[], any>, File[], any>, File[], any>, (T extends {
148
- multiple: true;
149
- } ? File[] : File) | (T extends {
150
- required: false;
151
- } ? null : never), any>;
152
- };
153
-
154
- declare type ZFileProps = {
155
- required: boolean;
156
- multiple: boolean;
157
- maxFileSize: number;
158
- };
159
-
160
- export { }
1
+ export * from './hooks/index'
package/dist/hooks.es.js CHANGED
@@ -1,15 +1,15 @@
1
- import { U as q, aD as z, a5 as _ } from "./FromToDatePickerDropdownToggle-CGnDN_zs.js";
2
- import { aF as U, aa as V, aE as K } from "./FromToDatePickerDropdownToggle-CGnDN_zs.js";
3
- import { c as Z, b as $, a as H, u as J } from "./useLocalStorageState-HYmARj_B.js";
1
+ import { U as q, aD as z, a4 as _ } from "./FromToDatePickerDropdownToggle-Dk7MFcJp.js";
2
+ import { aF as U, ae as V, aE as K } from "./FromToDatePickerDropdownToggle-Dk7MFcJp.js";
3
+ import { c as Z, b as $, a as H, u as J } from "./useLocalStorageState-Cs1tOpr1.js";
4
4
  import { useContext as g, useState as I, useEffect as S } from "react";
5
5
  import { z as s } from "zod";
6
- import { i as j } from "./dateUtils-Bc53BdYm.js";
6
+ import { i as j } from "./dateUtils-B9-rf1Eh.js";
7
7
  import "@azure/msal-browser";
8
8
  import "@azure/msal-react";
9
9
  import "react-router-dom";
10
10
  import "react-hook-form";
11
- import { a as X, b as Y, u as p } from "./useFormControlType-BAFqxupC.js";
12
- import { u as re } from "./usePermissions-Dl5tlwwt.js";
11
+ import { b as X, u as Y, a as p } from "./useFormControlType-oJGqgThz.js";
12
+ import { u as re } from "./usePermissions-CfJgVLTi.js";
13
13
  const B = () => {
14
14
  const { texts: { formValidation: n } } = g(q), u = (e) => (e != null && e.useCoerce ? s.coerce : s).string({
15
15
  invalid_type_error: n.required,
@@ -1,3 +1,4 @@
1
- import { ContainerProps } from '@models/index';
1
+ import { ContainerProps } from '../../models/index';
2
+
2
3
  declare const FullScreenContainer: ({ title, children, sideContent, sideContentWidth, noPadding, className, }: ContainerProps) => import("react").JSX.Element;
3
4
  export default FullScreenContainer;
@@ -1,3 +1,4 @@
1
- import { ContainerProps } from '@models/index';
1
+ import { ContainerProps } from '../../models/index';
2
+
2
3
  declare const MainContainer: ({ title, children, sideContent, sideContentWidth, noPadding, className, }: ContainerProps) => import("react").JSX.Element;
3
4
  export default MainContainer;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+
2
3
  type Props = {
3
4
  title: string | ReactNode;
4
5
  };
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+
2
3
  type Props = {
3
4
  width: number;
4
5
  children?: ReactNode;
@@ -1,4 +1,5 @@
1
- import { MenuItemTypeExtended } from '@models/index';
1
+ import { MenuItemTypeExtended } from '../../../models/index';
2
+
2
3
  type Props = {
3
4
  item: MenuItemTypeExtended;
4
5
  menuExpanded: boolean;
@@ -1,4 +1,5 @@
1
- import { MenuItemType } from '@models/index';
1
+ import { MenuItemType } from '../../models/index';
2
+
2
3
  type Props = {
3
4
  headerItem: React.ReactNode;
4
5
  mainItems: MenuItemType[];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FromToDatePickerDropdownToggle-BcOIaLyQ.cjs"),j=require("react"),b=require("react-router-dom");require("react-hook-form");require("@azure/msal-browser");require("@azure/msal-react");require("zod");const M=require("./usePermissions-yx-0zHae.cjs"),B=require("./SimpleTooltip-CpLiAgNs.cjs"),k="_side-menu-item_6vbwa_1",C="_disabled_6vbwa_5",g="_nav-button_6vbwa_9",P="_child_6vbwa_17",S="_text_6vbwa_21",T="_icon_6vbwa_28",f="_collapse-icon_6vbwa_34",y="_collapsed_6vbwa_44",I="_expanded_6vbwa_51",q="_children-container_6vbwa_57",$="_visible_6vbwa_65",H="_children_6vbwa_57",i={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:k,disabled:C,"nav-button":"_nav-button_6vbwa_9",navButton:g,child:P,text:S,icon:T,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:f,collapsed:y,expanded:I,"children-container":"_children-container_6vbwa_57",childrenContainer:q,visible:$,children:H},F=({item:s,menuExpanded:n,children:t})=>s.tooltip&&!n?e.jsxRuntimeExports.jsx(B.SimpleTooltip,{text:s.tooltip,placement:"right",children:t}):t,R=({item:s,menuExpanded:n,collapsed:t,onCollapse:r,currentPath:c})=>{var v,h;const[d,x]=j.useState(!1),[m]=c.split("?"),u=s.linkTo===m||((v=s.children)==null?void 0:v.some(o=>o.linkTo===m));return e.jsxRuntimeExports.jsxs("li",{className:e.classNames("luminus-side-menu-item",i.sideMenuItem,{[i.expanded]:n},{active:d||u},{open:t&&s.children},{[i.disabled]:s.disabled||s.notPermitted},{disabled:s.disabled||s.notPermitted}),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[e.jsxRuntimeExports.jsx(F,{item:s,menuExpanded:n,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",i.navButton),onClick:()=>r(),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",i.icon),children:s.icon}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:s.title}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",i.collapseIcon,{[i.collapsed]:t}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(b.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",i.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",i.icon),children:s.icon}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",i.childrenContainer,{[i.visible]:t}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",i.children),children:(h=s.children)==null?void 0:h.map(o=>e.jsxRuntimeExports.jsx(b.Link,{to:o.disabled||o.notPermitted?"/":o.linkTo??"/",className:e.classNames("nav-link child rounded",i.navButton,i.child,{[i.disabled]:o.disabled||o.notPermitted},{disabled:o.disabled||o.notPermitted}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:o.title})},o.linkTo))})})]})},L="_side-menu_n1hvm_1",D="_sidebar-header_n1hvm_13",A="_side-menu-content_n1hvm_18",K="_expand_n1hvm_22",U="_divider_n1hvm_26",_={"side-menu":"_side-menu_n1hvm_1",sideMenu:L,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:D,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:A,expand:K,divider:U},z=({headerItem:s,mainItems:n,secondaryItems:t,expanded:r,setExpanded:c,currentPath:d})=>{const[x,m]=j.useState(-1),{checkUserHasPermissions:u}=M.usePermissions(),v=j.useMemo(()=>n.map(a=>{var l;return{...a,notPermitted:!u(a.permissions??[]),children:(l=a.children)==null?void 0:l.map(p=>({...p,notPermitted:!u(p.permissions??[]),disabled:a.disabled||p.disabled}))}}),[n,u]),h=j.useMemo(()=>t.map(a=>{var l;return{...a,notPermitted:!u(a.permissions??[]),children:(l=a.children)==null?void 0:l.map(p=>({...p,notPermitted:!u(p.permissions??[])}))}}),[t,u]),o=a=>{m(a===x?-1:a)};return j.useEffect(()=>{r||m(-1)},[r]),e.jsxRuntimeExports.jsxs("section",{className:e.classNames("luminus-side-menu shadow",_.sideMenu,{[_.expand]:r},{expand:r}),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",_.sidebarHeader),children:s}),e.jsxRuntimeExports.jsxs("ul",{className:_.sideMenuContent,children:[v.map((a,l)=>e.jsxRuntimeExports.jsx(R,{item:a,menuExpanded:r,collapsed:l===x,onCollapse:()=>o(l),currentPath:d},a.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",_.divider)}),h.map((a,l)=>e.jsxRuntimeExports.jsx(R,{item:a,menuExpanded:r,collapsed:l===x,onCollapse:()=>o(l),currentPath:d},a.title))]})]})},G="_top-bar_1lk80_1",J="_top-bar-brand_1lk80_14",E={"top-bar":"_top-bar_1lk80_1",topBar:G,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:J},O=({appName:s,leftOffset:n,centerContent:t,rightContent:r})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow",E.topBar),style:{width:n?`calc(100% - ${n}px)`:void 0,left:n?`${n}px`:void 0},children:[e.jsxRuntimeExports.jsx(b.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",E.topBarBrand),children:s}),t&&e.jsxRuntimeExports.jsx("div",{children:t}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:r??null})]}),Q="_side-content-bar_17kwd_1",V={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:Q},N=({width:s,children:n})=>e.jsxRuntimeExports.jsx("section",{className:e.classNames("luminus-side-content-bar shadow",V.sideContentBar),style:{width:`${s}px`},children:n}),w=({title:s})=>e.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof s=="string"?e.jsxRuntimeExports.jsx(e.Typography,{variant:"h3",children:s}):s}),X=({title:s,children:n,sideContent:t,sideContentWidth:r=250,noPadding:c,className:d})=>e.jsxRuntimeExports.jsxs("div",{className:e.classNames("container-fluid",c?"p-0":"p-3",d),children:[e.jsxRuntimeExports.jsxs("div",{style:{paddingRight:t?`${r}px`:void 0},children:[s?e.jsxRuntimeExports.jsx(w,{title:s}):null,n]}),t&&e.jsxRuntimeExports.jsx(N,{width:r,children:t})]}),Y="_full-screen-container_1rm4r_1",Z={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:Y},W=({title:s,children:n,sideContent:t,sideContentWidth:r=250,noPadding:c,className:d})=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:e.classNames("overflow-hidden luminus-full-screen-container",c?"p-0":"p-3",d,Z.fullScreenContainer),style:{width:t?`calc(100% - ${r}px)`:"100%"},children:[s?e.jsxRuntimeExports.jsx(w,{title:s}):null,n]}),t&&e.jsxRuntimeExports.jsx(N,{width:r,children:t})]});exports.FullScreenContainer=W;exports.MainContainer=X;exports.SideContentBar=N;exports.SideMenu=z;exports.TopBar=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FromToDatePickerDropdownToggle-DhzBIJXw.cjs"),j=require("react"),b=require("react-router-dom");require("react-hook-form");require("@azure/msal-browser");require("@azure/msal-react");require("zod");const M=require("./usePermissions-BZPN1OT2.cjs"),B=require("./SimpleTooltip-Bz22xxXa.cjs"),k="_side-menu-item_6vbwa_1",C="_disabled_6vbwa_5",g="_nav-button_6vbwa_9",P="_child_6vbwa_17",S="_text_6vbwa_21",T="_icon_6vbwa_28",f="_collapse-icon_6vbwa_34",y="_collapsed_6vbwa_44",I="_expanded_6vbwa_51",q="_children-container_6vbwa_57",$="_visible_6vbwa_65",H="_children_6vbwa_57",i={"side-menu-item":"_side-menu-item_6vbwa_1",sideMenuItem:k,disabled:C,"nav-button":"_nav-button_6vbwa_9",navButton:g,child:P,text:S,icon:T,"collapse-icon":"_collapse-icon_6vbwa_34",collapseIcon:f,collapsed:y,expanded:I,"children-container":"_children-container_6vbwa_57",childrenContainer:q,visible:$,children:H},F=({item:s,menuExpanded:n,children:t})=>s.tooltip&&!n?e.jsxRuntimeExports.jsx(B.SimpleTooltip,{text:s.tooltip,placement:"right",children:t}):t,R=({item:s,menuExpanded:n,collapsed:t,onCollapse:r,currentPath:c})=>{var v,h;const[d,x]=j.useState(!1),[m]=c.split("?"),u=s.linkTo===m||((v=s.children)==null?void 0:v.some(o=>o.linkTo===m));return e.jsxRuntimeExports.jsxs("li",{className:e.classNames("luminus-side-menu-item",i.sideMenuItem,{[i.expanded]:n},{active:d||u},{open:t&&s.children},{[i.disabled]:s.disabled||s.notPermitted},{disabled:s.disabled||s.notPermitted}),onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[e.jsxRuntimeExports.jsx(F,{item:s,menuExpanded:n,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",i.navButton),onClick:()=>r(),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",i.icon),children:s.icon}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:s.title}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",i.collapseIcon,{[i.collapsed]:t}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(b.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",i.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",i.icon),children:s.icon}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",i.childrenContainer,{[i.visible]:t}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",i.children),children:(h=s.children)==null?void 0:h.map(o=>e.jsxRuntimeExports.jsx(b.Link,{to:o.disabled||o.notPermitted?"/":o.linkTo??"/",className:e.classNames("nav-link child rounded",i.navButton,i.child,{[i.disabled]:o.disabled||o.notPermitted},{disabled:o.disabled||o.notPermitted}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",i.text,"text-nowrap"),children:o.title})},o.linkTo))})})]})},L="_side-menu_n1hvm_1",D="_sidebar-header_n1hvm_13",A="_side-menu-content_n1hvm_18",K="_expand_n1hvm_22",U="_divider_n1hvm_26",_={"side-menu":"_side-menu_n1hvm_1",sideMenu:L,"sidebar-header":"_sidebar-header_n1hvm_13",sidebarHeader:D,"side-menu-content":"_side-menu-content_n1hvm_18",sideMenuContent:A,expand:K,divider:U},z=({headerItem:s,mainItems:n,secondaryItems:t,expanded:r,setExpanded:c,currentPath:d})=>{const[x,m]=j.useState(-1),{checkUserHasPermissions:u}=M.usePermissions(),v=j.useMemo(()=>n.map(a=>{var l;return{...a,notPermitted:!u(a.permissions??[]),children:(l=a.children)==null?void 0:l.map(p=>({...p,notPermitted:!u(p.permissions??[]),disabled:a.disabled||p.disabled}))}}),[n,u]),h=j.useMemo(()=>t.map(a=>{var l;return{...a,notPermitted:!u(a.permissions??[]),children:(l=a.children)==null?void 0:l.map(p=>({...p,notPermitted:!u(p.permissions??[])}))}}),[t,u]),o=a=>{m(a===x?-1:a)};return j.useEffect(()=>{r||m(-1)},[r]),e.jsxRuntimeExports.jsxs("section",{className:e.classNames("luminus-side-menu shadow",_.sideMenu,{[_.expand]:r},{expand:r}),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",_.sidebarHeader),children:s}),e.jsxRuntimeExports.jsxs("ul",{className:_.sideMenuContent,children:[v.map((a,l)=>e.jsxRuntimeExports.jsx(R,{item:a,menuExpanded:r,collapsed:l===x,onCollapse:()=>o(l),currentPath:d},a.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",_.divider)}),h.map((a,l)=>e.jsxRuntimeExports.jsx(R,{item:a,menuExpanded:r,collapsed:l===x,onCollapse:()=>o(l),currentPath:d},a.title))]})]})},G="_top-bar_1lk80_1",J="_top-bar-brand_1lk80_14",E={"top-bar":"_top-bar_1lk80_1",topBar:G,"top-bar-brand":"_top-bar-brand_1lk80_14",topBarBrand:J},O=({appName:s,leftOffset:n,centerContent:t,rightContent:r})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow",E.topBar),style:{width:n?`calc(100% - ${n}px)`:void 0,left:n?`${n}px`:void 0},children:[e.jsxRuntimeExports.jsx(b.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",E.topBarBrand),children:s}),t&&e.jsxRuntimeExports.jsx("div",{children:t}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center gap-2",children:r??null})]}),Q="_side-content-bar_17kwd_1",V={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:Q},N=({width:s,children:n})=>e.jsxRuntimeExports.jsx("section",{className:e.classNames("luminus-side-content-bar shadow",V.sideContentBar),style:{width:`${s}px`},children:n}),w=({title:s})=>e.jsxRuntimeExports.jsx("div",{className:"mb-3",children:typeof s=="string"?e.jsxRuntimeExports.jsx(e.Typography,{variant:"h3",children:s}):s}),X=({title:s,children:n,sideContent:t,sideContentWidth:r=250,noPadding:c,className:d})=>e.jsxRuntimeExports.jsxs("div",{className:e.classNames("container-fluid",c?"p-0":"p-3",d),children:[e.jsxRuntimeExports.jsxs("div",{style:{paddingRight:t?`${r}px`:void 0},children:[s?e.jsxRuntimeExports.jsx(w,{title:s}):null,n]}),t&&e.jsxRuntimeExports.jsx(N,{width:r,children:t})]}),Y="_full-screen-container_1rm4r_1",Z={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:Y},W=({title:s,children:n,sideContent:t,sideContentWidth:r=250,noPadding:c,className:d})=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:e.classNames("overflow-hidden luminus-full-screen-container",c?"p-0":"p-3",d,Z.fullScreenContainer),style:{width:t?`calc(100% - ${r}px)`:"100%"},children:[s?e.jsxRuntimeExports.jsx(w,{title:s}):null,n]}),t&&e.jsxRuntimeExports.jsx(N,{width:r,children:t})]});exports.FullScreenContainer=W;exports.MainContainer=X;exports.SideContentBar=N;exports.SideMenu=z;exports.TopBar=O;
package/dist/layout.d.ts CHANGED
@@ -1,54 +1 @@
1
- import { JSX as JSX_2 } from 'react';
2
- import { ReactNode } from 'react';
3
-
4
- declare type ContainerProps = {
5
- title?: string | ReactNode;
6
- children?: ReactNode;
7
- sideContent?: React.ReactNode;
8
- sideContentWidth?: number;
9
- noPadding?: boolean;
10
- className?: string;
11
- };
12
-
13
- export declare const FullScreenContainer: ({ title, children, sideContent, sideContentWidth, noPadding, className, }: ContainerProps) => JSX_2.Element;
14
-
15
- export declare const MainContainer: ({ title, children, sideContent, sideContentWidth, noPadding, className, }: ContainerProps) => JSX_2.Element;
16
-
17
- declare type MenuItemType = {
18
- title: string;
19
- tooltip?: string;
20
- linkTo?: string;
21
- icon?: React.ReactNode;
22
- permissions?: string[];
23
- disabled?: boolean;
24
- children?: MenuItemType[];
25
- };
26
-
27
- declare type Props = {
28
- headerItem: React.ReactNode;
29
- mainItems: MenuItemType[];
30
- secondaryItems: MenuItemType[];
31
- expanded: boolean;
32
- setExpanded: (expanded: boolean) => void;
33
- currentPath: string;
34
- };
35
-
36
- declare type Props_2 = {
37
- appName: string;
38
- leftOffset?: number;
39
- centerContent?: React.ReactNode;
40
- rightContent?: React.ReactNode;
41
- };
42
-
43
- declare type Props_3 = {
44
- width: number;
45
- children?: ReactNode;
46
- };
47
-
48
- export declare const SideContentBar: ({ width, children }: Props_3) => JSX_2.Element;
49
-
50
- export declare const SideMenu: ({ headerItem, mainItems, secondaryItems, expanded, setExpanded, currentPath, }: Props) => JSX_2.Element;
51
-
52
- export declare const TopBar: ({ appName, leftOffset, centerContent, rightContent }: Props_2) => JSX_2.Element;
53
-
54
- export { }
1
+ export * from './layout/index'
package/dist/layout.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { j as e, c as t, Z as C, S as I } from "./FromToDatePickerDropdownToggle-CGnDN_zs.js";
1
+ import { j as e, c as t, Z as C, S as I } from "./FromToDatePickerDropdownToggle-Dk7MFcJp.js";
2
2
  import { useState as M, useMemo as w, useEffect as P } from "react";
3
3
  import { Link as j } from "react-router-dom";
4
4
  import "react-hook-form";
5
5
  import "@azure/msal-browser";
6
6
  import "@azure/msal-react";
7
7
  import "zod";
8
- import { u as g } from "./usePermissions-Dl5tlwwt.js";
9
- import { S as y } from "./SimpleTooltip-B0I1MS-L.js";
8
+ import { u as g } from "./usePermissions-CfJgVLTi.js";
9
+ import { S as y } from "./SimpleTooltip-C32Faxrc.js";
10
10
  const S = "_side-menu-item_6vbwa_1", T = "_disabled_6vbwa_5", $ = "_nav-button_6vbwa_9", H = "_child_6vbwa_17", E = "_text_6vbwa_21", F = "_icon_6vbwa_28", L = "_collapse-icon_6vbwa_34", R = "_collapsed_6vbwa_44", A = "_expanded_6vbwa_51", K = "_children-container_6vbwa_57", U = "_visible_6vbwa_65", Z = "_children_6vbwa_57", i = {
11
11
  "side-menu-item": "_side-menu-item_6vbwa_1",
12
12
  sideMenuItem: S,