react-luminus-components 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +3 -0
  2. package/dist/.vite/manifest.json +133 -0
  3. package/dist/Modal-JLnYbEat.js +1 -0
  4. package/dist/Modal-_FnSEPRk.mjs +623 -0
  5. package/dist/SimpleTooltip-BjlbHsKC.mjs +1767 -0
  6. package/dist/SimpleTooltip-D9shMl1R.js +1 -0
  7. package/dist/components/EmployeePicker/EmployeeSearch/EmployeeSearch.d.ts +7 -0
  8. package/dist/components/EmployeePicker/EmployeeSearchModal/EmployeeSearchModal.d.ts +9 -0
  9. package/dist/components/EmployeePicker/comps/EmployeeSearchItem/EmployeeSearchItem.d.ts +7 -0
  10. package/dist/components/EmployeePicker/comps/index.d.ts +1 -0
  11. package/dist/components/EmployeePicker/index.d.ts +2 -0
  12. package/dist/components/Form/CheckInput/CheckInput.d.ts +11 -0
  13. package/dist/components/Form/Container/InputContainer.d.ts +8 -0
  14. package/dist/components/Form/EmployeePicker/EmployeePicker.d.ts +12 -0
  15. package/dist/components/Form/SelectInput/SelectInput.d.ts +17 -0
  16. package/dist/components/Form/TextInput/TextInput.d.ts +16 -0
  17. package/dist/components/Form/index.d.ts +4 -0
  18. package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +9 -0
  19. package/dist/components/HookForm/EmployeePicker/HookFormEmployeePicker.d.ts +9 -0
  20. package/dist/components/HookForm/FloatingSubmit/FloatingFormSubmit.d.ts +6 -0
  21. package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +9 -0
  22. package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +9 -0
  23. package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +9 -0
  24. package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +9 -0
  25. package/dist/components/HookForm/index.d.ts +7 -0
  26. package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +10 -0
  27. package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +8 -0
  28. package/dist/components/Tooltip/index.d.ts +2 -0
  29. package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +8 -0
  30. package/dist/components/UserAvatar/UserAvatarDropdown/UserAvatarDropdown.d.ts +7 -0
  31. package/dist/components/UserAvatar/UserAvatarToggle/UserAvatarToggle.d.ts +8 -0
  32. package/dist/components/UserAvatar/index.d.ts +2 -0
  33. package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +9 -0
  34. package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +3 -0
  35. package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +9 -0
  36. package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +6 -0
  37. package/dist/components/common/HomeDashboard/comps/index.d.ts +1 -0
  38. package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +6 -0
  39. package/dist/components/common/Loading/Loading.d.ts +3 -0
  40. package/dist/components/common/MonthPicker/MonthPicker.d.ts +9 -0
  41. package/dist/components/common/Typography/Typography.d.ts +9 -0
  42. package/dist/components/common/index.d.ts +6 -0
  43. package/dist/constants-CT2hnPeO.js +1 -0
  44. package/dist/constants-CzNy5yO3.mjs +7 -0
  45. package/dist/contexts/confirm/ConfirmContext.d.ts +9 -0
  46. package/dist/contexts/confirm/ConfirmProvider.d.ts +6 -0
  47. package/dist/contexts/index.d.ts +6 -0
  48. package/dist/contexts/loading/LoadingContext.d.ts +8 -0
  49. package/dist/contexts/loading/LoadingProvider.d.ts +6 -0
  50. package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +15 -0
  51. package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +16 -0
  52. package/dist/contexts/user/UserContext.d.ts +9 -0
  53. package/dist/contexts/user/UserProvider.d.ts +6 -0
  54. package/dist/contexts.cjs.js +1 -0
  55. package/dist/contexts.d.ts +1 -0
  56. package/dist/contexts.es.js +86 -0
  57. package/dist/hasClass-3JW9Qluf.mjs +1482 -0
  58. package/dist/hasClass-6m1Qq_DA.js +20 -0
  59. package/dist/hooks/index.d.ts +5 -0
  60. package/dist/hooks/useAuth/useAuth.d.ts +7 -0
  61. package/dist/hooks/useAxios/useAxios.d.ts +3 -0
  62. package/dist/hooks/useConfirm/useConfirm.d.ts +8 -0
  63. package/dist/hooks/useNotifications/useNotifications.d.ts +4 -0
  64. package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +44 -0
  65. package/dist/hooks.cjs.js +1 -0
  66. package/dist/hooks.d.ts +1 -0
  67. package/dist/hooks.es.js +2781 -0
  68. package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +4 -0
  69. package/dist/layout/MainContainer/MainContainer.d.ts +4 -0
  70. package/dist/layout/SideContentBar/SideContentBar.d.ts +7 -0
  71. package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +10 -0
  72. package/dist/layout/SideMenu/SideMenu.d.ts +10 -0
  73. package/dist/layout/TopBar/TopBar.d.ts +7 -0
  74. package/dist/layout/index.d.ts +5 -0
  75. package/dist/layout.cjs.js +1 -0
  76. package/dist/layout.d.ts +1 -0
  77. package/dist/layout.es.js +164 -0
  78. package/dist/main.cjs.js +1 -0
  79. package/dist/main.d.ts +11 -0
  80. package/dist/main.es.js +2788 -0
  81. package/dist/models/index.d.ts +23 -0
  82. package/dist/models/prop-types/ContainerProps.d.ts +6 -0
  83. package/dist/models/prop-types/HookFormCheckInputProps.d.ts +7 -0
  84. package/dist/models/prop-types/HookFormEmployeePickerProps.d.ts +9 -0
  85. package/dist/models/prop-types/HookFormInputProps.d.ts +9 -0
  86. package/dist/models/prop-types/HookFormRadioInputProps.d.ts +7 -0
  87. package/dist/models/prop-types/HookFormSelectInputProps.d.ts +12 -0
  88. package/dist/models/prop-types/HookFormTextAreaInputProps.d.ts +9 -0
  89. package/dist/models/prop-types/HookFormTextInputProps.d.ts +11 -0
  90. package/dist/models/texts/AxiosTexts.d.ts +6 -0
  91. package/dist/models/texts/ConfirmTexts.d.ts +5 -0
  92. package/dist/models/texts/EmployeeSearchModalTexts.d.ts +6 -0
  93. package/dist/models/texts/FormValidationTexts.d.ts +5 -0
  94. package/dist/models/texts/HomeDashboardTexts.d.ts +5 -0
  95. package/dist/models/types/ApiErrorResult.d.ts +7 -0
  96. package/dist/models/types/DashboardConfig.d.ts +5 -0
  97. package/dist/models/types/DashboardWidget.d.ts +7 -0
  98. package/dist/models/types/DashboardWidgetConfig.d.ts +5 -0
  99. package/dist/models/types/EmployeeIndexModel.d.ts +14 -0
  100. package/dist/models/types/ErrorField.d.ts +5 -0
  101. package/dist/models/types/FormSelectOption.d.ts +5 -0
  102. package/dist/models/types/HookFormInputProps.d.ts +9 -0
  103. package/dist/models/types/MenuItemType.d.ts +9 -0
  104. package/dist/models/types/NameIdIntModel.d.ts +5 -0
  105. package/dist/models/types/NameIdStringModel.d.ts +5 -0
  106. package/dist/models/types/UserModel.d.ts +13 -0
  107. package/dist/style.css +1 -0
  108. package/dist/textUtils-9KFqOvA8.mjs +27 -0
  109. package/dist/textUtils-C0nqWp3S.js +1 -0
  110. package/dist/useAxios-BU-BqYrK.mjs +2663 -0
  111. package/dist/useAxios-ZEhq7C_H.js +212 -0
  112. package/dist/useConfirm-BazFQNRI.js +1 -0
  113. package/dist/useConfirm-DH9Pmz_w.mjs +18 -0
  114. package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +4 -0
  115. package/dist/utils/date/dateUtils.d.ts +1 -0
  116. package/dist/utils/index.d.ts +4 -0
  117. package/dist/utils/object/objectUtils.d.ts +2 -0
  118. package/dist/utils/text/textUtils.d.ts +1 -0
  119. package/dist/utils.cjs.js +1 -0
  120. package/dist/utils.d.ts +1 -0
  121. package/dist/utils.es.js +137 -0
  122. package/package.json +94 -0
@@ -0,0 +1,23 @@
1
+ export type { default as HookFormCheckInputProps } from './prop-types/HookFormCheckInputProps';
2
+ export type { default as HookFormEmployeePickerProps } from './prop-types/HookFormEmployeePickerProps';
3
+ export type { default as HookFormRadioInputProps } from './prop-types/HookFormRadioInputProps';
4
+ export type { default as HookFormSelectInputProps } from './prop-types/HookFormSelectInputProps';
5
+ export type { default as HookFormTextAreaInputProps } from './prop-types/HookFormTextAreaInputProps';
6
+ export type { default as HookFormTextInputProps } from './prop-types/HookFormTextInputProps';
7
+ export type { default as HookFormInputProps } from './prop-types/HookFormInputProps';
8
+ export type { default as ContainerProps } from './prop-types/ContainerProps';
9
+ export type { default as NameIdStringModel } from './types/NameIdStringModel';
10
+ export type { default as NameIdIntModel } from './types/NameIdIntModel';
11
+ export type { default as EmployeeIndexModel } from './types/EmployeeIndexModel';
12
+ export type { default as DashboardConfig } from './types/DashboardConfig';
13
+ export type { default as DashboardWidget } from './types/DashboardWidget';
14
+ export type { default as DashboardWidgetConfig } from './types/DashboardWidgetConfig';
15
+ export type { default as FormSelectOption } from './types/FormSelectOption';
16
+ export type { default as MenuItemType } from './types/MenuItemType';
17
+ export type { default as ErrorField } from './types/ErrorField';
18
+ export type { default as ApiErrorResult } from './types/ApiErrorResult';
19
+ export type { default as AxiosTexts } from './texts/AxiosTexts';
20
+ export type { default as HomeDashboardTexts } from './texts/HomeDashboardTexts';
21
+ export type { default as EmployeeSearchModalTexts } from './texts/EmployeeSearchModalTexts';
22
+ export type { default as ConfirmTexts } from './texts/ConfirmTexts';
23
+ export type { default as FormValidationTexts } from './texts/FormValidationTexts';
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ type ContainerProps = {
3
+ children?: ReactNode;
4
+ sideContent?: React.ReactNode;
5
+ };
6
+ export default ContainerProps;
@@ -0,0 +1,7 @@
1
+ type HookFormCheckInputProps = {
2
+ formField: string;
3
+ label: string;
4
+ resetsFields?: string[];
5
+ type?: 'switch' | 'checkbox';
6
+ };
7
+ export default HookFormCheckInputProps;
@@ -0,0 +1,9 @@
1
+ import NameIdIntModel from '../types/NameIdIntModel';
2
+ type HookFormEmployeePickerProps = {
3
+ formField: string;
4
+ label: string;
5
+ defaultSelection: NameIdIntModel | null;
6
+ size?: 'sm' | 'lg';
7
+ resetsFields?: string[];
8
+ };
9
+ export default HookFormEmployeePickerProps;
@@ -0,0 +1,9 @@
1
+ import { FieldValues, FormState, UseFormGetValues, UseFormRegister, UseFormSetValue, UseFormWatch } from 'react-hook-form';
2
+ type HookFormInputProps = {
3
+ register: UseFormRegister<FieldValues>;
4
+ formState: FormState<FieldValues>;
5
+ getValues: UseFormGetValues<FieldValues>;
6
+ setValue: UseFormSetValue<FieldValues>;
7
+ watch: UseFormWatch<FieldValues>;
8
+ };
9
+ export default HookFormInputProps;
@@ -0,0 +1,7 @@
1
+ import NameIdStringModel from '../types/NameIdStringModel';
2
+ type HookFormRadioInputProps = {
3
+ formField: string;
4
+ options: NameIdStringModel[];
5
+ resetsFields?: string[];
6
+ };
7
+ export default HookFormRadioInputProps;
@@ -0,0 +1,12 @@
1
+ import FormSelectOption from '../types/FormSelectOption';
2
+ type HookFormSelectInputProps = {
3
+ formField: string;
4
+ label: string;
5
+ options: FormSelectOption[];
6
+ isNumber?: boolean;
7
+ size?: 'sm' | 'lg';
8
+ resetsFields?: string[];
9
+ showClearIcon?: boolean;
10
+ clearValue?: string | number;
11
+ };
12
+ export default HookFormSelectInputProps;
@@ -0,0 +1,9 @@
1
+ type HookFormTextAreaInputProps = {
2
+ formField: string;
3
+ label: string;
4
+ size?: 'sm' | 'lg';
5
+ resetsFields?: string[];
6
+ showClearIcon?: boolean;
7
+ clearValue?: string | number;
8
+ };
9
+ export default HookFormTextAreaInputProps;
@@ -0,0 +1,11 @@
1
+ type HookFormTextInputProps = {
2
+ formField: string;
3
+ type: 'text' | 'number' | 'password' | 'date' | 'datetime-local';
4
+ label: string;
5
+ placeholder?: string;
6
+ size?: 'sm' | 'lg';
7
+ resetsFields?: string[];
8
+ showClearIcon?: boolean;
9
+ clearValue?: string | number;
10
+ };
11
+ export default HookFormTextInputProps;
@@ -0,0 +1,6 @@
1
+ type AxiosTexts = {
2
+ validationError: string;
3
+ networkError: string;
4
+ unexpectedError: string;
5
+ };
6
+ export default AxiosTexts;
@@ -0,0 +1,5 @@
1
+ type ConfirmTexts = {
2
+ yes: string;
3
+ no: string;
4
+ };
5
+ export default ConfirmTexts;
@@ -0,0 +1,6 @@
1
+ type EmployeeSearchModalTexts = {
2
+ modalHeader: string;
3
+ searchPlaceholder: string;
4
+ noResultsMessage: string;
5
+ };
6
+ export default EmployeeSearchModalTexts;
@@ -0,0 +1,5 @@
1
+ type FormValidationTexts = {
2
+ required: string;
3
+ invalidDate: string;
4
+ };
5
+ export default FormValidationTexts;
@@ -0,0 +1,5 @@
1
+ type HomeDashboardTexts = {
2
+ dashboardEdit: string;
3
+ dashboardEditDone: string;
4
+ };
5
+ export default HomeDashboardTexts;
@@ -0,0 +1,7 @@
1
+ import ErrorField from './ErrorField';
2
+ type ApiErrorResult = {
3
+ message: string;
4
+ statusCode: number;
5
+ errorFields: ErrorField[];
6
+ };
7
+ export default ApiErrorResult;
@@ -0,0 +1,5 @@
1
+ import DashboardWidgetConfig from './DashboardWidgetConfig';
2
+ type DashboardConfig = {
3
+ widgets: DashboardWidgetConfig[];
4
+ };
5
+ export default DashboardConfig;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ type DashboardWidget = {
3
+ id: number;
4
+ name: string;
5
+ render: ReactNode;
6
+ };
7
+ export default DashboardWidget;
@@ -0,0 +1,5 @@
1
+ type DashboardWidgetConfig = {
2
+ widgetId: number;
3
+ fullWidth: boolean;
4
+ };
5
+ export default DashboardWidgetConfig;
@@ -0,0 +1,14 @@
1
+ type EmployeeIndexModel = {
2
+ id: number;
3
+ firstName: string | null;
4
+ lastName: string | null;
5
+ fullName: string | null;
6
+ kid: string | null;
7
+ email: string | null;
8
+ phoneNumber: string | null;
9
+ profession: string | null;
10
+ department: string | null;
11
+ orgUnitId: string | null;
12
+ orgUnitName: string | null;
13
+ };
14
+ export default EmployeeIndexModel;
@@ -0,0 +1,5 @@
1
+ type ErrorField = {
2
+ name: string;
3
+ errors: string;
4
+ };
5
+ export default ErrorField;
@@ -0,0 +1,5 @@
1
+ type FormSelectOption = {
2
+ id: number | string | null;
3
+ name: string | null;
4
+ };
5
+ export default FormSelectOption;
@@ -0,0 +1,9 @@
1
+ import { FieldValues, FormState, UseFormGetValues, UseFormRegister, UseFormSetValue, UseFormWatch } from 'react-hook-form';
2
+ type HookFormInputProps = {
3
+ register: UseFormRegister<FieldValues>;
4
+ formState: FormState<FieldValues>;
5
+ getValues: UseFormGetValues<FieldValues>;
6
+ setValue: UseFormSetValue<FieldValues>;
7
+ watch: UseFormWatch<FieldValues>;
8
+ };
9
+ export default HookFormInputProps;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type MenuItemType = {
3
+ title: string;
4
+ tooltip?: string;
5
+ linkTo?: string;
6
+ icon?: React.ReactNode;
7
+ children?: MenuItemType[];
8
+ };
9
+ export default MenuItemType;
@@ -0,0 +1,5 @@
1
+ type NameIdIntModel = {
2
+ id: number;
3
+ name: string | null;
4
+ };
5
+ export default NameIdIntModel;
@@ -0,0 +1,5 @@
1
+ type NameIdStringModel = {
2
+ id: string;
3
+ name: string | null;
4
+ };
5
+ export default NameIdStringModel;
@@ -0,0 +1,13 @@
1
+ import NameIdStringModel from './NameIdStringModel';
2
+ type UserModel = {
3
+ personalNumber: number;
4
+ kid: string | null;
5
+ name: string | null;
6
+ photoId: number | null;
7
+ permissions: UserPermissionModel;
8
+ orgUnit: NameIdStringModel;
9
+ };
10
+ interface UserPermissionModel {
11
+ carsAccess: boolean;
12
+ }
13
+ export default UserModel;
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ ._loading_14qfh_1{position:fixed;display:flex;align-items:center;justify-content:center;height:100vh;width:100vw;gap:8px}._loading_14qfh_1 ._spinner-grow_14qfh_10{width:40px;height:40px}._loading_14qfh_1 ._spinner-grow_14qfh_10._second_14qfh_14{animation-delay:.1s}._loading_14qfh_1 ._spinner-grow_14qfh_10._third_14qfh_17{animation-delay:.2s}._h1_8gr7h_1{font-size:32px;font-weight:400;margin:0;padding:0}._h3_8gr7h_8{font-size:24px;font-weight:400;margin:0;padding:0}._h6_8gr7h_15{font-size:20px;font-weight:400;margin:0;padding:0}._subtitle_8gr7h_22,._body_8gr7h_29{font-size:16px;font-weight:400;margin:0;padding:0}._body2_8gr7h_36{font-size:14px;font-weight:400;margin:0;padding:0}._caption_8gr7h_43{font-size:12px;font-weight:400;margin:0;padding:0}._widget_1sdw8_1{height:320px;display:flex;justify-content:center;align-items:center}._dashboard_1ikl9_1 ._widgets-grid_1ikl9_1{display:grid;grid-template-columns:repeat(2,1fr);column-gap:16px;row-gap:16px}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7{position:relative;height:320px;width:100%}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7._full-width_1ikl9_12{grid-column:span 2}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7._widget-edit_1ikl9_15{border:2px dashed gray}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._remove-icon_1ikl9_18{z-index:2;position:absolute;right:-16px;top:-16px;background-color:#fff}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._full-width-icon_1ikl9_25{z-index:2;position:absolute;right:-16px;top:calc(50% - 15px);background-color:#fff}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._full-width-icon_1ikl9_25 svg{rotate:90deg}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._widget-edit-overlay_1ikl9_35{position:absolute;left:0;top:0;height:100%;width:100%;background-color:#80808080;opacity:.6}._side-menu-item_8j1cd_1{width:100%}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4{width:100%;display:flex;align-items:center;justify-content:center;padding:8px 16px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4._child_8j1cd_11{padding:4px 8px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4._child_8j1cd_11 ._text_8j1cd_14{font-size:14px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._icon_8j1cd_17{display:flex;justify-content:center;align-items:center;font-size:22px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23{width:100%;display:flex;justify-content:end;align-items:center;font-size:20px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23 svg{transition:.2s ease}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23._collapsed_8j1cd_33 svg{rotate:180deg}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._text_8j1cd_14{font-size:16px;margin-left:32px}._side-menu-item_8j1cd_1._expanded_8j1cd_40 ._nav-button_8j1cd_4,._side-menu-item_8j1cd_1._expanded_8j1cd_40 ._nav-button_8j1cd_4 ._icon_8j1cd_17{justify-content:flex-start}._side-menu_1gibf_1{position:fixed;top:0;left:0;height:100%;background-color:#fff;transition:.3s ease;overflow-x:hidden;scrollbar-width:none}._side-menu_1gibf_1::state(webkit-scrollbar){display:none}._side-menu_1gibf_1 ._sidebar-header_1gibf_14{display:flex;justify-content:center;align-items:center}._side-menu_1gibf_1 ._side-menu-content_1gibf_19{margin-top:8px;padding:0}._side-menu_1gibf_1._expand_1gibf_23 ._sidebar-header_1gibf_14{padding:0 12px;justify-content:end}._top-bar_84c1d_1{padding:0 24px;display:flex;align-items:center;grid-gap:24px;position:sticky;top:0;left:0}._top-bar_84c1d_1 ._top-bar-brand_84c1d_10{text-decoration:none;font-size:20px}._side-content-bar_17kwd_1{position:fixed;top:0;right:0;height:100%;background-color:#fff;overflow-x:hidden;scrollbar-width:none}._side-content-bar_17kwd_1::state(webkit-scrollbar){display:none}._full-screen-container_1c9bu_1{width:100%;display:flex;flex-direction:column}.luminus-input-remove-icon{position:absolute;top:0;right:16px;height:100%;display:flex;align-items:center;justify-content:center}.luminus-input-remove-icon.inset{right:40px}.luminus-input-remove-icon .icon-button{padding:0;margin:0;font-size:16px;height:20px;width:20px;display:flex;align-items:center}._avatar-icon_1axl6_1{height:36px;width:36px;display:flex;align-items:center;justify-content:center;border-radius:100%;color:#fff;font-size:16px}._modal_18hh3_1 ._modal-content_18hh3_1{height:100%;max-height:90vh}._modal_18hh3_1 ._modal-body_18hh3_5{height:100%;display:flex;flex-direction:column;overflow:hidden}._form-submit_1wjhr_1{position:fixed;width:160px;bottom:40px;left:calc(50% - 80px)}
@@ -0,0 +1,27 @@
1
+ const n = (r) => r == null ? !0 : !(typeof r == "object" || typeof r == "function"), i = (r) => {
2
+ n(r) || Object.keys(r).forEach((s) => {
3
+ const t = r[s];
4
+ if (n(t))
5
+ return;
6
+ const e = Object.keys(t);
7
+ e.includes("id") && e.length === 1 && t.id === null ? r[s] = null : i(t);
8
+ });
9
+ }, a = (r) => {
10
+ var t;
11
+ const s = (t = r.response) == null ? void 0 : t.data;
12
+ return s && s.errorFields && s.errorFields.length > 0 ? s.errorFields.map((e) => ({
13
+ name: e.name.split(".").map((o) => `${o.charAt(0).toLowerCase()}${o.slice(1)}`).join("."),
14
+ errors: e.errors
15
+ })) : [];
16
+ }, l = (r, s) => {
17
+ a(s).forEach((e) => {
18
+ r.setError(e.name, { message: e.errors, type: "server" }, { shouldFocus: !0 }), n(r.getValues(e.name)) || r.setError(`${e.name}.id`, { message: e.errors, type: "server" }, { shouldFocus: !0 });
19
+ });
20
+ }, c = (r) => r.length < 300 ? r : r.substring(0, 300) + "...";
21
+ export {
22
+ a as e,
23
+ i as f,
24
+ l as h,
25
+ n as i,
26
+ c as t
27
+ };
@@ -0,0 +1 @@
1
+ "use strict";const o=r=>r==null?!0:!(typeof r=="object"||typeof r=="function"),i=r=>{o(r)||Object.keys(r).forEach(s=>{const t=r[s];if(o(t))return;const e=Object.keys(t);e.includes("id")&&e.length===1&&t.id===null?r[s]=null:i(t)})},u=r=>{var t;const s=(t=r.response)==null?void 0:t.data;return s&&s.errorFields&&s.errorFields.length>0?s.errorFields.map(e=>({name:e.name.split(".").map(n=>`${n.charAt(0).toLowerCase()}${n.slice(1)}`).join("."),errors:e.errors})):[]},a=(r,s)=>{u(s).forEach(e=>{r.setError(e.name,{message:e.errors,type:"server"},{shouldFocus:!0}),o(r.getValues(e.name))||r.setError(`${e.name}.id`,{message:e.errors,type:"server"},{shouldFocus:!0})})},c=r=>r.length<300?r:r.substring(0,300)+"...";exports.extractErrorsFromResponse=u;exports.fixNameIdNulls=i;exports.hookFormSetServerErrors=a;exports.isPrimitive=o;exports.truncateText=c;