react-luminus-components 1.1.28 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +43 -43
- package/dist/{DataKey-CuZpR5t0.cjs → DataKey-CLYT9XGM.cjs} +1 -1
- package/dist/{DataKey-C3jtX0q4.js → DataKey-CPc1_-be.js} +1 -1
- package/dist/{SimpleTooltip-BMSn8Fqk.js → SimpleTooltip-EPgkOstR.js} +1 -1
- package/dist/{SimpleTooltip-XmxUVlDH.cjs → SimpleTooltip-rgKvGQAh.cjs} +1 -1
- package/dist/{Typography-CHpY2hUz.cjs → Typography-C9GM_GzV.cjs} +1 -1
- package/dist/{Typography-DUoLZCdX.js → Typography-PSv7V5A1.js} +9 -9
- package/dist/{UserAvatarToggle-I_MgjXhA.js → UserAvatarToggle-CIQXhmcN.js} +67 -63
- package/dist/{UserAvatarToggle-DP4YFoNZ.cjs → UserAvatarToggle-DmBqBnvE.cjs} +41 -41
- package/dist/components/Buttons/ContextButton/ContextButton.d.ts +1 -1
- package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +1 -1
- package/dist/components/Form/CheckInput/CheckInput.d.ts +2 -10
- package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +2 -17
- package/dist/components/Form/SelectInput/SelectInput.d.ts +2 -17
- package/dist/components/Form/TextInput/TextInput.d.ts +2 -16
- package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +2 -2
- package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +2 -10
- package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +2 -13
- package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +2 -2
- package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +2 -2
- package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +2 -2
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +2 -2
- package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +4 -0
- package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +4 -0
- package/dist/components/InputContainers/index.d.ts +2 -0
- package/dist/components/common/Card/Card.d.ts +28 -0
- package/dist/components/common/InvalidFeedback/InvalidFeedback.d.ts +1 -2
- package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +10 -0
- package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +13 -0
- package/dist/components/common/index.d.ts +3 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +4 -4
- package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +6 -2
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +652 -652
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +3 -3
- package/dist/main.cjs.js +1 -1
- package/dist/main.d.ts +5 -2
- package/dist/main.es.js +2109 -1952
- package/dist/models/index.d.ts +26 -7
- package/dist/models/prop-types/FormInputProps/FormCheckInputProps.d.ts +6 -0
- package/dist/models/prop-types/FormInputProps/FormFileInputProps.d.ts +11 -0
- package/dist/models/prop-types/FormInputProps/FormRadioInputProps.d.ts +6 -0
- package/dist/models/prop-types/FormInputProps/FormSelectInputProps.d.ts +6 -0
- package/dist/models/prop-types/FormInputProps/FormTextAreaInputProps.d.ts +6 -0
- package/dist/models/prop-types/FormInputProps/FormTextInputProps.d.ts +6 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormCheckInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormDropdownPickerProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormFileInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormInputBaseProps.d.ts +7 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormRadioInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormSelectInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormTextAreaInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormTextInputProps.d.ts +4 -0
- package/dist/models/prop-types/InputContainerProps.d.ts +23 -0
- package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +5 -0
- package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +14 -0
- package/dist/models/prop-types/InputProps/FileInputProps.d.ts +6 -0
- package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +15 -0
- package/dist/models/prop-types/InputProps/RadioInputProps.d.ts +6 -0
- package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +8 -0
- package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +6 -0
- package/dist/models/prop-types/InputProps/TextInputProps.d.ts +6 -0
- package/dist/models/types/PhotoAction.d.ts +9 -0
- package/dist/models/types/PhotoLibraryItemModel.d.ts +7 -0
- package/dist/style.css +1 -1
- package/dist/{useConfirm-BGatkLkP.js → useConfirm-C_gZ96ka.js} +1 -1
- package/dist/{useConfirm-D677YHtT.cjs → useConfirm-CrF2KHR-.cjs} +1 -1
- package/package.json +1 -1
- package/dist/components/common/InputContainer/InputContainer.d.ts +0 -10
- package/dist/models/prop-types/HookFormCheckInputProps.d.ts +0 -10
- package/dist/models/prop-types/HookFormDropdownPickerProps.d.ts +0 -13
- package/dist/models/prop-types/HookFormRadioInputProps.d.ts +0 -10
- package/dist/models/prop-types/HookFormSelectInputProps.d.ts +0 -16
- package/dist/models/prop-types/HookFormTextAreaInputProps.d.ts +0 -13
- package/dist/models/prop-types/HookFormTextInputProps.d.ts +0 -14
- /package/dist/models/prop-types/{HookFormInputProps.d.ts → HookFormInputProps/HookFormInputProps.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const SimpleDropdownToggle: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
3
|
onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
4
|
-
color?: "
|
|
4
|
+
color?: "primary" | "success" | "danger" | "warning" | undefined;
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
6
|
text?: string | undefined;
|
|
7
7
|
className?: string | undefined;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
onChange?: (value: boolean) => void;
|
|
5
|
-
label?: string;
|
|
6
|
-
hidden?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
className?: string;
|
|
9
|
-
type?: 'switch' | 'checkbox';
|
|
10
|
-
};
|
|
11
|
-
declare const CheckInput: ({ label, value, onChange, hidden, disabled, className, type }: Props) => import("react").JSX.Element;
|
|
2
|
+
import { FormCheckInputProps } from '@models/index';
|
|
3
|
+
declare const CheckInput: ({ InputContainer, label, value, onChange, hidden, disabled, className, type, }: FormCheckInputProps) => import("react").JSX.Element;
|
|
12
4
|
export default CheckInput;
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
items: FormSelectOption[];
|
|
5
|
-
defaultSelection: FormSelectOption | null;
|
|
6
|
-
onClickSelectedItem: (item: FormSelectOption) => void;
|
|
7
|
-
onSearchQueryChange: (query: string) => void;
|
|
8
|
-
texts: DropdownPickerTexts;
|
|
9
|
-
isLoading?: boolean;
|
|
10
|
-
isNumber?: boolean;
|
|
11
|
-
onSelect?: (item: FormSelectOption | null) => void;
|
|
12
|
-
label?: string;
|
|
13
|
-
withoutLabel?: boolean;
|
|
14
|
-
size?: 'sm' | 'lg';
|
|
15
|
-
hidden?: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
};
|
|
18
|
-
declare const DropdownPicker: ({ items, defaultSelection, onClickSelectedItem, onSearchQueryChange, texts, isLoading, isNumber, onSelect, label, withoutLabel, size, hidden, disabled, }: Props) => import("react").JSX.Element;
|
|
2
|
+
import { DropdownPickerProps } from '@models/index';
|
|
3
|
+
declare const DropdownPicker: ({ InputContainer, items, defaultSelection, onClickSelectedItem, onSearchQueryChange, texts, isLoading, isNumber, onSelect, label, withoutLabel, size, hidden, disabled, }: DropdownPickerProps) => import("react").JSX.Element;
|
|
19
4
|
export default DropdownPicker;
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
value: string | number | null;
|
|
5
|
-
options?: FormSelectOption[];
|
|
6
|
-
onChange?: (value: string | number | null) => void;
|
|
7
|
-
label?: string;
|
|
8
|
-
withoutLabel?: boolean;
|
|
9
|
-
isNumber?: boolean;
|
|
10
|
-
size?: 'sm' | 'lg';
|
|
11
|
-
hidden?: boolean;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
showClearIcon?: boolean;
|
|
14
|
-
clearValue?: string | number;
|
|
15
|
-
noSortOptions?: boolean;
|
|
16
|
-
className?: string;
|
|
17
|
-
};
|
|
18
|
-
declare const SelectInput: ({ value, options, onChange, label, withoutLabel, isNumber, size, hidden, disabled, showClearIcon, clearValue, noSortOptions, className, }: Props) => import("react").JSX.Element;
|
|
2
|
+
import { FormSelectInputProps } from '@models/index';
|
|
3
|
+
declare const SelectInput: ({ InputContainer, value, options, onChange, label, withoutLabel, isNumber, size, hidden, disabled, showClearIcon, clearValue, noSortOptions, className, }: FormSelectInputProps) => import("react").JSX.Element;
|
|
19
4
|
export default SelectInput;
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: string | number | null;
|
|
5
|
-
onChange?: (value: string | number | null) => void;
|
|
6
|
-
debounceMs?: number;
|
|
7
|
-
label?: string;
|
|
8
|
-
withoutLabel?: boolean;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
size?: 'sm' | 'lg';
|
|
11
|
-
hidden?: boolean;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
showClearIcon?: boolean;
|
|
14
|
-
clearValue?: string | number;
|
|
15
|
-
className?: string;
|
|
16
|
-
};
|
|
17
|
-
declare const TextInput: ({ type, value, onChange, debounceMs, label, withoutLabel, placeholder, size, hidden, disabled, showClearIcon, clearValue, className, }: Props) => import("react").JSX.Element;
|
|
2
|
+
import { FormTextInputProps } from '@models/index';
|
|
3
|
+
declare const TextInput: ({ InputContainer, type, value, onChange, debounceMs, label, withoutLabel, placeholder, size, hidden, disabled, showClearIcon, clearValue, className, }: FormTextInputProps) => import("react").JSX.Element;
|
|
18
4
|
export default TextInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import HookFormCheckInputProps from '@models/prop-types/HookFormCheckInputProps';
|
|
3
|
-
declare const HookFormCheckInput: ({ formField, label, resetsFields, type, required, hidden, disabled, }: HookFormCheckInputProps) => import("react").JSX.Element;
|
|
2
|
+
import HookFormCheckInputProps from '@models/prop-types/HookFormInputProps/HookFormCheckInputProps';
|
|
3
|
+
declare const HookFormCheckInput: ({ InputContainer, formField, label, resetsFields, type, required, hidden, disabled, }: HookFormCheckInputProps) => import("react").JSX.Element;
|
|
4
4
|
export default HookFormCheckInput;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import HookFormDropdownPickerProps from '@models/prop-types/HookFormDropdownPickerProps';
|
|
3
|
-
|
|
4
|
-
type Props = HookFormDropdownPickerProps & {
|
|
5
|
-
items: FormSelectOption[];
|
|
6
|
-
onSearchQueryChange: (query: string) => void;
|
|
7
|
-
onClickSelectedItem: (item: FormSelectOption) => void;
|
|
8
|
-
texts: DropdownPickerTexts;
|
|
9
|
-
isLoading?: boolean;
|
|
10
|
-
};
|
|
11
|
-
declare const HookFormDropdownPicker: ({ formField, label, size, defaultSelection, resetsFields, isNumber, required, hidden, disabled, items, onSearchQueryChange, onClickSelectedItem, texts, isLoading, }: Props) => import("react").JSX.Element;
|
|
2
|
+
import HookFormDropdownPickerProps from '@models/prop-types/HookFormInputProps/HookFormDropdownPickerProps';
|
|
3
|
+
declare const HookFormDropdownPicker: ({ InputContainer, formField, label, size, defaultSelection, resetsFields, isNumber, required, hidden, disabled, items, onSearchQueryChange, onClickSelectedItem, texts, isLoading, }: HookFormDropdownPickerProps) => import("react").JSX.Element;
|
|
12
4
|
export default HookFormDropdownPicker;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
formField: string;
|
|
5
|
-
hidden?: boolean;
|
|
6
|
-
required?: boolean;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
showClearIcon?: boolean;
|
|
10
|
-
resetsFields?: string[];
|
|
11
|
-
multiple?: boolean;
|
|
12
|
-
accept: string[];
|
|
13
|
-
};
|
|
14
|
-
declare const HookFormFileInput: ({ label, formField, hidden, required, placeholder, disabled, showClearIcon, resetsFields, multiple, accept, }: HookFormFileInputProps) => import("react").JSX.Element;
|
|
2
|
+
import { HookFormFileInputProps } from '@models/index';
|
|
3
|
+
declare const HookFormFileInput: ({ InputContainer, label, formField, hidden, required, placeholder, disabled, showClearIcon, resetsFields, multiple, accept, }: HookFormFileInputProps) => import("react").JSX.Element;
|
|
15
4
|
export default HookFormFileInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import HookFormRadioInputProps from '@models/prop-types/HookFormRadioInputProps';
|
|
3
|
-
declare const HookFormRadioInput: ({ formField, options, resetsFields, required, disabled, hidden, }: HookFormRadioInputProps) => import("react").JSX.Element;
|
|
2
|
+
import HookFormRadioInputProps from '@models/prop-types/HookFormInputProps/HookFormRadioInputProps';
|
|
3
|
+
declare const HookFormRadioInput: ({ InputContainer, label, formField, options, resetsFields, required, disabled, hidden, }: HookFormRadioInputProps) => import("react").JSX.Element;
|
|
4
4
|
export default HookFormRadioInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import HookFormSelectInputProps from '@models/prop-types/HookFormSelectInputProps';
|
|
3
|
-
declare const HookFormSelectInput: ({ formField, label, resetsFields, options, isNumber, size, showClearIcon, clearValue, noSortOptions, required, hidden, disabled, }: HookFormSelectInputProps) => import("react").JSX.Element;
|
|
2
|
+
import HookFormSelectInputProps from '@models/prop-types/HookFormInputProps/HookFormSelectInputProps';
|
|
3
|
+
declare const HookFormSelectInput: ({ InputContainer, formField, label, resetsFields, options, isNumber, size, showClearIcon, clearValue, noSortOptions, required, hidden, disabled, }: HookFormSelectInputProps) => import("react").JSX.Element;
|
|
4
4
|
export default HookFormSelectInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import HookFormTextAreaInputProps from '@models/prop-types/HookFormTextAreaInputProps';
|
|
3
|
-
declare const HookFormTextAreaInput: ({ formField, label, resetsFields, size, showClearIcon, clearValue, required, hidden, disabled, height, }: HookFormTextAreaInputProps) => import("react").JSX.Element;
|
|
2
|
+
import HookFormTextAreaInputProps from '@models/prop-types/HookFormInputProps/HookFormTextAreaInputProps';
|
|
3
|
+
declare const HookFormTextAreaInput: ({ InputContainer, formField, label, resetsFields, size, showClearIcon, clearValue, required, hidden, disabled, height, rows, }: HookFormTextAreaInputProps) => import("react").JSX.Element;
|
|
4
4
|
export default HookFormTextAreaInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import HookFormTextInputProps from '@models/prop-types/HookFormTextInputProps';
|
|
3
|
-
declare const HookFormTextInput: ({ type, formField, label, placeholder, size, resetsFields, showClearIcon, clearValue, required, hidden, disabled, }: HookFormTextInputProps) => import("react").JSX.Element;
|
|
2
|
+
import HookFormTextInputProps from '@models/prop-types/HookFormInputProps/HookFormTextInputProps';
|
|
3
|
+
declare const HookFormTextInput: ({ InputContainer, type, formField, label, placeholder, size, resetsFields, showClearIcon, clearValue, required, hidden, disabled, }: HookFormTextInputProps) => import("react").JSX.Element;
|
|
4
4
|
export default HookFormTextInput;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import InputContainerProps from '@models/prop-types/InputContainerProps';
|
|
3
|
+
declare const FloatingLabelInput: ({ hidden, children, isForCheckInput, className, inputContainerClassName, ...props }: InputContainerProps) => import("react").JSX.Element;
|
|
4
|
+
export default FloatingLabelInput;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import InputContainerProps from '@models/prop-types/InputContainerProps';
|
|
3
|
+
declare const RowLabelInput: ({ hidden, children, className, isInvalid, isForRadioInput, inputContainerClassName, ...props }: InputContainerProps) => import("react").JSX.Element;
|
|
4
|
+
export default RowLabelInput;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type BaseProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
headerContent?: React.ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
headerClassName?: string;
|
|
8
|
+
contentClassName?: string;
|
|
9
|
+
};
|
|
10
|
+
type UncontrolledCollapseProps = {
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type ControlledCollapseProps = {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
onToggle: (open: boolean) => void;
|
|
16
|
+
};
|
|
17
|
+
type CollapsibleProps = {
|
|
18
|
+
collapsible: true;
|
|
19
|
+
} & ((UncontrolledCollapseProps & {
|
|
20
|
+
controlled?: false;
|
|
21
|
+
}) | (ControlledCollapseProps & {
|
|
22
|
+
controlled: true;
|
|
23
|
+
}));
|
|
24
|
+
type Props = BaseProps & (CollapsibleProps | {
|
|
25
|
+
collapsible?: false;
|
|
26
|
+
});
|
|
27
|
+
declare const Card: ({ title, headerContent, children, className, headerClassName, contentClassName, ...props }: Props) => import("react").JSX.Element;
|
|
28
|
+
export default Card;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type Props = {
|
|
3
3
|
message: string;
|
|
4
|
-
forFloating?: boolean;
|
|
5
4
|
};
|
|
6
|
-
declare const InvalidFeedback: ({ message
|
|
5
|
+
declare const InvalidFeedback: ({ message }: Props) => import("react").JSX.Element;
|
|
7
6
|
export default InvalidFeedback;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PhotoAction, PhotoLibraryItemModel } from '@models/index';
|
|
3
|
+
type Props = {
|
|
4
|
+
photos: PhotoLibraryItemModel[];
|
|
5
|
+
uploadPhotosText?: string;
|
|
6
|
+
onUploadPhotos?: (files: File[]) => void;
|
|
7
|
+
photoActions?: PhotoAction[];
|
|
8
|
+
};
|
|
9
|
+
declare const PhotoLibrary: ({ photos, onUploadPhotos, uploadPhotosText, photoActions }: Props) => import("react").JSX.Element | null;
|
|
10
|
+
export default PhotoLibrary;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PhotoAction, PhotoLibraryItemModel } from '@models/index';
|
|
3
|
+
type Props = {
|
|
4
|
+
show: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
photos: PhotoLibraryItemModel[];
|
|
7
|
+
defaultIndex: number;
|
|
8
|
+
uploadPhotosText?: string;
|
|
9
|
+
onUploadPhotos?: (files: File[]) => void;
|
|
10
|
+
photoActions?: PhotoAction[];
|
|
11
|
+
};
|
|
12
|
+
declare const PhotoLightbox: ({ show, onClose, photos, defaultIndex, uploadPhotosText, onUploadPhotos, photoActions, }: Props) => import("react").JSX.Element | null;
|
|
13
|
+
export default PhotoLightbox;
|
|
@@ -7,7 +7,9 @@ export { default as HomeDashboard } from './HomeDashboard/HomeDashboard';
|
|
|
7
7
|
export { default as ConfirmDialog } from './ConfirmDialog/ConfirmDialog';
|
|
8
8
|
export { default as Badge } from './Badge/Badge';
|
|
9
9
|
export { default as Collapse } from './Collapse/Collapse';
|
|
10
|
-
export { default as InputContainer } from './InputContainer/InputContainer';
|
|
11
10
|
export { default as InvalidFeedback } from './InvalidFeedback/InvalidFeedback';
|
|
12
11
|
export { default as SimplePicker } from './SimplePicker/SimplePicker';
|
|
13
12
|
export { default as AppSearch } from './AppSearch/AppSearch';
|
|
13
|
+
export { default as Card } from './Card/Card';
|
|
14
|
+
export { default as PhotoLightbox } from './PhotoLightbox/PhotoLightbox';
|
|
15
|
+
export { default as PhotoLibrary } from './PhotoLibrary/PhotoLibrary';
|
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./UserAvatarToggle-DP4YFoNZ.cjs"),a=require("react"),ve=require("./useConfirm-D677YHtT.cjs"),Fe=require("./Typography-CHpY2hUz.cjs"),v=require("./DataKey-CuZpR5t0.cjs"),Ie=require("react-dom");function Pe(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>s[n]})}}return t.default=s,Object.freeze(t)}const g=Pe(a),Ue=s=>g.forwardRef((t,n)=>e.jsxRuntimeExports.jsx("div",{...t,ref:n,className:e.classNames(t.className,s)})),We={"aria-label":e.PropTypes.string,onClick:e.PropTypes.func,variant:e.PropTypes.oneOf(["white"])},me=g.forwardRef(({className:s,variant:t,"aria-label":n="Close",...o},r)=>e.jsxRuntimeExports.jsx("button",{ref:r,type:"button",className:e.classNames("btn-close",t&&`btn-close-${t}`,s),"aria-label":n,...o}));me.displayName="CloseButton";me.propTypes=We;const $e=me;var J;function he(s){if((!J&&J!==0||s)&&e.canUseDOM){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),J=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return J}function ce(s){s===void 0&&(s=e.ownerDocument());try{var t=s.activeElement;return!t||!t.nodeName?null:t}catch{return s.body}}function He(s=document){const t=s.defaultView;return Math.abs(t.innerWidth-s.documentElement.clientWidth)}const ge=v.dataAttr("modal-open");class _e{constructor({ownerDocument:t,handleContainerOverflow:n=!0,isRTL:o=!1}={}){this.handleContainerOverflow=n,this.isRTL=o,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return He(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const n={overflow:"hidden"},o=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();t.style={overflow:r.style.overflow,[o]:r.style[o]},t.scrollBarWidth&&(n[o]=`${parseInt(e.style(r,o)||"0",10)+t.scrollBarWidth}px`),r.setAttribute(ge,""),e.style(r,n)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const n=this.getElement();n.removeAttribute(ge),Object.assign(n.style,t.style)}add(t){let n=this.modals.indexOf(t);return n!==-1||(n=this.modals.length,this.modals.push(t),this.setModalAttributes(t),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(t){const n=this.modals.indexOf(t);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const fe=_e,qe=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Ke(s,t){if(s==null)return{};var n={},o=Object.keys(s),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=s[r]);return n}let ue;function ze(s){return ue||(ue=new fe({ownerDocument:s==null?void 0:s.document})),ue}function Ge(s){const t=e.useWindow(),n=s||ze(t),o=a.useRef({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:a.useCallback(r=>{o.current.dialog=r},[]),setBackdropRef:a.useCallback(r=>{o.current.backdrop=r},[])})}const je=a.forwardRef((s,t)=>{let{show:n=!1,role:o="dialog",className:r,style:i,children:m,backdrop:c=!0,keyboard:f=!0,onBackdropClick:p,onEscapeKeyDown:u,transition:h,runTransition:R,backdropTransition:w,runBackdropTransition:Q,autoFocus:W=!0,enforceFocus:Z=!0,restoreFocus:M=!0,restoreFocusOptions:ee,renderDialog:$,renderBackdrop:te=d=>e.jsxRuntimeExports.jsx("div",Object.assign({},d)),manager:se,container:ne,onShow:H,onHide:A=()=>{},onExit:oe,onExited:D,onExiting:_,onEnter:q,onEntering:K,onEntered:z}=s,re=Ke(s,qe);const j=e.useWindow(),N=e.useWaitForDOMRef(ne),x=Ge(se),ae=e.useMounted(),G=v.usePrevious(n),[y,T]=a.useState(!n),E=a.useRef(null);a.useImperativeHandle(t,()=>x,[x]),e.canUseDOM&&!G&&n&&(E.current=ce(j==null?void 0:j.document)),n&&y&&T(!1);const C=e.useEventCallback(()=>{if(x.add(),k.current=e.listen(document,"keydown",le),I.current=e.listen(document,"focus",()=>setTimeout(ie),!0),H&&H(),W){var d,Y;const U=ce((d=(Y=x.dialog)==null?void 0:Y.ownerDocument)!=null?d:j==null?void 0:j.document);x.dialog&&U&&!e.contains(x.dialog,U)&&(E.current=U,x.dialog.focus())}}),F=e.useEventCallback(()=>{if(x.remove(),k.current==null||k.current(),I.current==null||I.current(),M){var d;(d=E.current)==null||d.focus==null||d.focus(ee),E.current=null}});a.useEffect(()=>{!n||!N||C()},[n,N,C]),a.useEffect(()=>{y&&F()},[y,F]),e.useWillUnmount(()=>{F()});const ie=e.useEventCallback(()=>{if(!Z||!ae()||!x.isTopModal())return;const d=ce(j==null?void 0:j.document);x.dialog&&d&&!e.contains(x.dialog,d)&&x.dialog.focus()}),V=e.useEventCallback(d=>{d.target===d.currentTarget&&(p==null||p(d),c===!0&&A())}),le=e.useEventCallback(d=>{f&&e.isEscKey(d)&&x.isTopModal()&&(u==null||u(d),d.defaultPrevented||A())}),I=a.useRef(),k=a.useRef(),X=(...d)=>{T(!0),D==null||D(...d)};if(!N)return null;const S=Object.assign({role:o,ref:x.setDialogRef,"aria-modal":o==="dialog"?!0:void 0},re,{style:i,className:r,tabIndex:-1});let P=$?$(S):e.jsxRuntimeExports.jsx("div",Object.assign({},S,{children:g.cloneElement(m,{role:"document"})}));P=e.renderTransition(h,R,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:oe,onExiting:_,onExited:X,onEnter:q,onEntering:K,onEntered:z,children:P});let O=null;return c&&(O=te({ref:x.setBackdropRef,onClick:V}),O=e.renderTransition(w,Q,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:O})),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Ie.createPortal(e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[O,P]}),N)})});je.displayName="Modal";const Ve=Object.assign(je,{Manager:fe});function Xe(s,t){s.classList?s.classList.add(t):e.hasClass(s,t)||(typeof s.className=="string"?s.className=s.className+" "+t:s.setAttribute("class",(s.className&&s.className.baseVal||"")+" "+t))}function Ee(s,t){return s.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Ye(s,t){s.classList?s.classList.remove(t):typeof s.className=="string"?s.className=Ee(s.className,t):s.setAttribute("class",Ee(s.className&&s.className.baseVal||"",t))}const L={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class Je extends fe{adjustAndStore(t,n,o){const r=n.style[t];n.dataset[t]=r,e.style(n,{[t]:`${parseFloat(e.style(n,t))+o}px`})}restore(t,n){const o=n.dataset[t];o!==void 0&&(delete n.dataset[t],e.style(n,{[t]:o}))}setContainerStyle(t){super.setContainerStyle(t);const n=this.getElement();if(Xe(n,"modal-open"),!t.scrollBarWidth)return;const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v.qsa(n,L.FIXED_CONTENT).forEach(i=>this.adjustAndStore(o,i,t.scrollBarWidth)),v.qsa(n,L.STICKY_CONTENT).forEach(i=>this.adjustAndStore(r,i,-t.scrollBarWidth)),v.qsa(n,L.NAVBAR_TOGGLER).forEach(i=>this.adjustAndStore(r,i,t.scrollBarWidth))}removeContainerStyle(t){super.removeContainerStyle(t);const n=this.getElement();Ye(n,"modal-open");const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v.qsa(n,L.FIXED_CONTENT).forEach(i=>this.restore(o,i)),v.qsa(n,L.STICKY_CONTENT).forEach(i=>this.restore(r,i)),v.qsa(n,L.NAVBAR_TOGGLER).forEach(i=>this.restore(r,i))}}let de;function Qe(s){return de||(de=new Je(s)),de}const Ce=g.forwardRef(({className:s,bsPrefix:t,as:n="div",...o},r)=>(t=e.useBootstrapPrefix(t,"modal-body"),e.jsxRuntimeExports.jsx(n,{ref:r,className:e.classNames(s,t),...o})));Ce.displayName="ModalBody";const Ze=Ce,et=g.createContext({onHide(){}}),Re=et,ye=g.forwardRef(({bsPrefix:s,className:t,contentClassName:n,centered:o,size:r,fullscreen:i,children:m,scrollable:c,...f},p)=>{s=e.useBootstrapPrefix(s,"modal");const u=`${s}-dialog`,h=typeof i=="string"?`${s}-fullscreen-${i}`:`${s}-fullscreen`;return e.jsxRuntimeExports.jsx("div",{...f,ref:p,className:e.classNames(u,t,r&&`${s}-${r}`,o&&`${u}-centered`,c&&`${u}-scrollable`,i&&h),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames(`${s}-content`,n),children:m})})});ye.displayName="ModalDialog";const be=ye,we=g.forwardRef(({className:s,bsPrefix:t,as:n="div",...o},r)=>(t=e.useBootstrapPrefix(t,"modal-footer"),e.jsxRuntimeExports.jsx(n,{ref:r,className:e.classNames(s,t),...o})));we.displayName="ModalFooter";const tt=we,st=g.forwardRef(({closeLabel:s="Close",closeVariant:t,closeButton:n=!1,onHide:o,children:r,...i},m)=>{const c=a.useContext(Re),f=e.useEventCallback(()=>{c==null||c.onHide(),o==null||o()});return e.jsxRuntimeExports.jsxs("div",{ref:m,...i,children:[r,n&&e.jsxRuntimeExports.jsx($e,{"aria-label":s,variant:t,onClick:f})]})}),nt=st,Me=g.forwardRef(({bsPrefix:s,className:t,closeLabel:n="Close",closeButton:o=!1,...r},i)=>(s=e.useBootstrapPrefix(s,"modal-header"),e.jsxRuntimeExports.jsx(nt,{ref:i,...r,className:e.classNames(t,s),closeLabel:n,closeButton:o})));Me.displayName="ModalHeader";const ot=Me,rt=Ue("h4"),Ne=g.forwardRef(({className:s,bsPrefix:t,as:n=rt,...o},r)=>(t=e.useBootstrapPrefix(t,"modal-title"),e.jsxRuntimeExports.jsx(n,{ref:r,className:e.classNames(s,t),...o})));Ne.displayName="ModalTitle";const at=Ne;function it(s){return e.jsxRuntimeExports.jsx(e.Fade,{...s,timeout:null})}function lt(s){return e.jsxRuntimeExports.jsx(e.Fade,{...s,timeout:null})}const Te=g.forwardRef(({bsPrefix:s,className:t,style:n,dialogClassName:o,contentClassName:r,children:i,dialogAs:m=be,"data-bs-theme":c,"aria-labelledby":f,"aria-describedby":p,"aria-label":u,show:h=!1,animation:R=!0,backdrop:w=!0,keyboard:Q=!0,onEscapeKeyDown:W,onShow:Z,onHide:M,container:ee,autoFocus:$=!0,enforceFocus:te=!0,restoreFocus:se=!0,restoreFocusOptions:ne,onEntered:H,onExit:A,onExiting:oe,onEnter:D,onEntering:_,onExited:q,backdropClassName:K,manager:z,...re},j)=>{const[N,x]=a.useState({}),[ae,G]=a.useState(!1),y=a.useRef(!1),T=a.useRef(!1),E=a.useRef(null),[C,F]=e.useCallbackRef(),ie=e.useMergedRefs(j,F),V=e.useEventCallback(M),le=e.useIsRTL();s=e.useBootstrapPrefix(s,"modal");const I=a.useMemo(()=>({onHide:V}),[V]);function k(){return z||Qe({isRTL:le})}function X(l){if(!e.canUseDOM)return;const B=k().getScrollbarWidth()>0,xe=l.scrollHeight>e.ownerDocument(l).documentElement.clientHeight;x({paddingRight:B&&!xe?he():void 0,paddingLeft:!B&&xe?he():void 0})}const S=e.useEventCallback(()=>{C&&X(C.dialog)});e.useWillUnmount(()=>{e.removeEventListener(window,"resize",S),E.current==null||E.current()});const P=()=>{y.current=!0},O=l=>{y.current&&C&&l.target===C.dialog&&(T.current=!0),y.current=!1},d=()=>{G(!0),E.current=e.transitionEnd(C.dialog,()=>{G(!1)})},Y=l=>{l.target===l.currentTarget&&d()},U=l=>{if(w==="static"){Y(l);return}if(T.current||l.target!==l.currentTarget){T.current=!1;return}M==null||M()},ke=l=>{Q?W==null||W(l):(l.preventDefault(),w==="static"&&d())},Se=(l,B)=>{l&&X(l),D==null||D(l,B)},Oe=l=>{E.current==null||E.current(),A==null||A(l)},Be=(l,B)=>{_==null||_(l,B),e.addEventListener(window,"resize",S)},Le=l=>{l&&(l.style.display=""),q==null||q(l),e.removeEventListener(window,"resize",S)},Ae=a.useCallback(l=>e.jsxRuntimeExports.jsx("div",{...l,className:e.classNames(`${s}-backdrop`,K,!R&&"show")}),[R,K,s]),pe={...n,...N};pe.display="block";const De=l=>e.jsxRuntimeExports.jsx("div",{role:"dialog",...l,style:pe,className:e.classNames(t,s,ae&&`${s}-static`,!R&&"show"),onClick:w?U:void 0,onMouseUp:O,"data-bs-theme":c,"aria-label":u,"aria-labelledby":f,"aria-describedby":p,children:e.jsxRuntimeExports.jsx(m,{...re,onMouseDown:P,className:o,contentClassName:r,children:i})});return e.jsxRuntimeExports.jsx(Re.Provider,{value:I,children:e.jsxRuntimeExports.jsx(Ve,{show:h,ref:ie,backdrop:w,container:ee,keyboard:!0,autoFocus:$,enforceFocus:te,restoreFocus:se,restoreFocusOptions:ne,onEscapeKeyDown:ke,onShow:Z,onHide:M,onEnter:Se,onEntering:Be,onEntered:H,onExit:Oe,onExiting:oe,onExited:Le,manager:k(),transition:R?it:void 0,backdropTransition:R?lt:void 0,renderBackdrop:Ae,renderDialog:De})})});Te.displayName="Modal";const b=Object.assign(Te,{Body:Ze,Header:ot,Title:at,Footer:tt,Dialog:be,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),ct=()=>{const{confirmTexts:s}=a.useContext(e.LuminusComponentsContext),{isShown:t,text:n,onFinish:o}=ve.usePrompt(),{options:r}=a.useContext(e.PromptContext),[i,m]=a.useState(""),c=a.useCallback(()=>{o(null)},[o]),f=a.useCallback(()=>{o(i)},[o,i]);a.useEffect(()=>{t===!0&&m("")},[t]);const p=a.useMemo(()=>({value:i,onChange:u=>m(u.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[i]);return e.jsxRuntimeExports.jsxs(b,{show:t,size:"sm",centered:!0,onHide:c,children:[e.jsxRuntimeExports.jsx(b.Header,{children:e.jsxRuntimeExports.jsx(b.Title,{children:n})}),e.jsxRuntimeExports.jsxs(b.Body,{children:[r.input==="textarea"?e.jsxRuntimeExports.jsx("textarea",{...p,rows:5}):void 0,r.input==="input"?e.jsxRuntimeExports.jsx("input",{...p,type:r.type}):void 0]}),e.jsxRuntimeExports.jsxs(b.Footer,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary",onClick:c,children:s.cancel}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary ml",onClick:f,disabled:r.required&&!i,children:s.confirm})]})]})},ut=({children:s})=>{const[t,n]=a.useState(!1),[o,r]=a.useState(""),[i,m]=a.useState({input:"textarea",type:"text"}),c=a.useRef(()=>{}),f=a.useCallback(h=>{r(h),n(!0),console.log("showprompt")},[]),p=a.useCallback(()=>{n(!1)},[]),u=a.useMemo(()=>({isShown:t,text:o,showPrompt:f,hidePrompt:p,resolveRef:c,options:i,setOptions:m}),[t,o,f,p,i]);return e.jsxRuntimeExports.jsxs(e.PromptContext.Provider,{value:u,children:[s,e.jsxRuntimeExports.jsx(ct,{})]})},dt=({children:s})=>{const[t,n]=a.useState(!1),[o,r]=a.useState(""),i=a.useCallback(f=>{n(!0),r(f)},[]),m=a.useCallback(()=>{n(!1)},[]),c=a.useMemo(()=>({show:t,text:o,showConfirm:i,hideConfirm:m}),[t,o,i,m]);return e.jsxRuntimeExports.jsxs(e.ConfirmContext.Provider,{value:c,children:[e.jsxRuntimeExports.jsx(xt,{}),s]})},mt=({cookieDomain:s,axiosInstance:t,LinkComponent:n,language:o,axiosTexts:r,confirmTexts:i,formValidationTexts:m,homeDashboardTexts:c,formSubmitTexts:f,appSearchTexts:p,children:u})=>{const h=a.useMemo(()=>({axiosInstance:t,cookieDomain:s,LinkComponent:n,language:o,axiosTexts:r,confirmTexts:i,formValidationTexts:m,homeDashboardTexts:c,formSubmitTexts:f,appSearchTexts:p}),[t,s,n,o,r,i,m,c,f,p]);return e.jsxRuntimeExports.jsx(e.LuminusComponentsContext.Provider,{value:h,children:e.jsxRuntimeExports.jsx(dt,{children:e.jsxRuntimeExports.jsxs(ut,{children:[e.jsxRuntimeExports.jsx(e.Ie,{}),u]})})})},ft=({children:s})=>{const[t,n]=a.useState(!1),[o]=a.useState(new Set),r=a.useCallback(c=>{o.add(c),n(!0)},[o]),i=a.useCallback(c=>{o.delete(c),o.size===0&&n(!1)},[o]),m=a.useMemo(()=>({isLoading:t,startLoading:r,stopLoading:i}),[t,r,i]);return e.jsxRuntimeExports.jsxs(e.LoadingContext.Provider,{value:m,children:[t&&e.jsxRuntimeExports.jsx(v.Loading,{}),s]})},pt=({children:s})=>{const t=e.useAxios(),n=a.useCallback(()=>{const u=localStorage.getItem("user")??null;return u?JSON.parse(u):null},[]),[o,r]=a.useState(n()),i=a.useCallback(async()=>{let u=null;return await t.get("/user/detail").then(h=>{u=h.data}).catch(()=>{u=null}),localStorage.setItem("user",JSON.stringify(u)),u},[t]),m=a.useCallback(()=>{localStorage.removeItem("user")},[]),c=a.useCallback(async()=>{const u=await i();return u?(r(u),!0):!1},[i]),f=a.useCallback(()=>{m(),r(null)},[m]),p=a.useMemo(()=>({user:o,loginUser:c,logoutUser:f}),[o,c,f]);return a.useEffect(()=>{r(n())},[n]),e.jsxRuntimeExports.jsx(e.UserContext.Provider,{value:p,children:s})},xt=()=>{const{confirmTexts:s}=a.useContext(e.LuminusComponentsContext),{onConfirm:t,onCancel:n,text:o,show:r}=ve.useConfirm();return e.jsxRuntimeExports.jsx(b,{show:r,size:"sm",centered:!0,onHide:n,children:e.jsxRuntimeExports.jsxs(b.Body,{children:[e.jsxRuntimeExports.jsx("div",{className:"mb-5 text-center",children:e.jsxRuntimeExports.jsx(Fe.Typography,{variant:"h6",children:o})}),e.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary w-100",onClick:n,children:s.no}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary w-100 ml",onClick:t,children:s.yes})]})]})})};exports.LoadingContext=e.LoadingContext;exports.LuminusComponentsContext=e.LuminusComponentsContext;exports.UserContext=e.UserContext;exports.LoadingProvider=ft;exports.LuminusComponentsProvider=mt;exports.UserProvider=pt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./UserAvatarToggle-DmBqBnvE.cjs"),a=require("react"),ve=require("./useConfirm-CrF2KHR-.cjs"),Fe=require("./Typography-C9GM_GzV.cjs"),v=require("./DataKey-CLYT9XGM.cjs"),Ie=require("react-dom");function Pe(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>s[n]})}}return t.default=s,Object.freeze(t)}const g=Pe(a),Ue=s=>g.forwardRef((t,n)=>e.jsxRuntimeExports.jsx("div",{...t,ref:n,className:e.classNames(t.className,s)})),We={"aria-label":e.PropTypes.string,onClick:e.PropTypes.func,variant:e.PropTypes.oneOf(["white"])},me=g.forwardRef(({className:s,variant:t,"aria-label":n="Close",...o},r)=>e.jsxRuntimeExports.jsx("button",{ref:r,type:"button",className:e.classNames("btn-close",t&&`btn-close-${t}`,s),"aria-label":n,...o}));me.displayName="CloseButton";me.propTypes=We;const $e=me;var J;function he(s){if((!J&&J!==0||s)&&e.canUseDOM){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),J=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return J}function ce(s){s===void 0&&(s=e.ownerDocument());try{var t=s.activeElement;return!t||!t.nodeName?null:t}catch{return s.body}}function He(s=document){const t=s.defaultView;return Math.abs(t.innerWidth-s.documentElement.clientWidth)}const ge=v.dataAttr("modal-open");class _e{constructor({ownerDocument:t,handleContainerOverflow:n=!0,isRTL:o=!1}={}){this.handleContainerOverflow=n,this.isRTL=o,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return He(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const n={overflow:"hidden"},o=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();t.style={overflow:r.style.overflow,[o]:r.style[o]},t.scrollBarWidth&&(n[o]=`${parseInt(e.style(r,o)||"0",10)+t.scrollBarWidth}px`),r.setAttribute(ge,""),e.style(r,n)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const n=this.getElement();n.removeAttribute(ge),Object.assign(n.style,t.style)}add(t){let n=this.modals.indexOf(t);return n!==-1||(n=this.modals.length,this.modals.push(t),this.setModalAttributes(t),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(t){const n=this.modals.indexOf(t);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const fe=_e,qe=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Ke(s,t){if(s==null)return{};var n={},o=Object.keys(s),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=s[r]);return n}let ue;function ze(s){return ue||(ue=new fe({ownerDocument:s==null?void 0:s.document})),ue}function Ge(s){const t=e.useWindow(),n=s||ze(t),o=a.useRef({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:a.useCallback(r=>{o.current.dialog=r},[]),setBackdropRef:a.useCallback(r=>{o.current.backdrop=r},[])})}const je=a.forwardRef((s,t)=>{let{show:n=!1,role:o="dialog",className:r,style:i,children:m,backdrop:c=!0,keyboard:f=!0,onBackdropClick:p,onEscapeKeyDown:u,transition:h,runTransition:R,backdropTransition:w,runBackdropTransition:Q,autoFocus:W=!0,enforceFocus:Z=!0,restoreFocus:M=!0,restoreFocusOptions:ee,renderDialog:$,renderBackdrop:te=d=>e.jsxRuntimeExports.jsx("div",Object.assign({},d)),manager:se,container:ne,onShow:H,onHide:A=()=>{},onExit:oe,onExited:D,onExiting:_,onEnter:q,onEntering:K,onEntered:z}=s,re=Ke(s,qe);const j=e.useWindow(),N=e.useWaitForDOMRef(ne),x=Ge(se),ae=e.useMounted(),G=v.usePrevious(n),[y,T]=a.useState(!n),E=a.useRef(null);a.useImperativeHandle(t,()=>x,[x]),e.canUseDOM&&!G&&n&&(E.current=ce(j==null?void 0:j.document)),n&&y&&T(!1);const C=e.useEventCallback(()=>{if(x.add(),k.current=e.listen(document,"keydown",le),I.current=e.listen(document,"focus",()=>setTimeout(ie),!0),H&&H(),W){var d,Y;const U=ce((d=(Y=x.dialog)==null?void 0:Y.ownerDocument)!=null?d:j==null?void 0:j.document);x.dialog&&U&&!e.contains(x.dialog,U)&&(E.current=U,x.dialog.focus())}}),F=e.useEventCallback(()=>{if(x.remove(),k.current==null||k.current(),I.current==null||I.current(),M){var d;(d=E.current)==null||d.focus==null||d.focus(ee),E.current=null}});a.useEffect(()=>{!n||!N||C()},[n,N,C]),a.useEffect(()=>{y&&F()},[y,F]),e.useWillUnmount(()=>{F()});const ie=e.useEventCallback(()=>{if(!Z||!ae()||!x.isTopModal())return;const d=ce(j==null?void 0:j.document);x.dialog&&d&&!e.contains(x.dialog,d)&&x.dialog.focus()}),V=e.useEventCallback(d=>{d.target===d.currentTarget&&(p==null||p(d),c===!0&&A())}),le=e.useEventCallback(d=>{f&&e.isEscKey(d)&&x.isTopModal()&&(u==null||u(d),d.defaultPrevented||A())}),I=a.useRef(),k=a.useRef(),X=(...d)=>{T(!0),D==null||D(...d)};if(!N)return null;const S=Object.assign({role:o,ref:x.setDialogRef,"aria-modal":o==="dialog"?!0:void 0},re,{style:i,className:r,tabIndex:-1});let P=$?$(S):e.jsxRuntimeExports.jsx("div",Object.assign({},S,{children:g.cloneElement(m,{role:"document"})}));P=e.renderTransition(h,R,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:oe,onExiting:_,onExited:X,onEnter:q,onEntering:K,onEntered:z,children:P});let O=null;return c&&(O=te({ref:x.setBackdropRef,onClick:V}),O=e.renderTransition(w,Q,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:O})),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Ie.createPortal(e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[O,P]}),N)})});je.displayName="Modal";const Ve=Object.assign(je,{Manager:fe});function Xe(s,t){s.classList?s.classList.add(t):e.hasClass(s,t)||(typeof s.className=="string"?s.className=s.className+" "+t:s.setAttribute("class",(s.className&&s.className.baseVal||"")+" "+t))}function Ee(s,t){return s.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Ye(s,t){s.classList?s.classList.remove(t):typeof s.className=="string"?s.className=Ee(s.className,t):s.setAttribute("class",Ee(s.className&&s.className.baseVal||"",t))}const L={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class Je extends fe{adjustAndStore(t,n,o){const r=n.style[t];n.dataset[t]=r,e.style(n,{[t]:`${parseFloat(e.style(n,t))+o}px`})}restore(t,n){const o=n.dataset[t];o!==void 0&&(delete n.dataset[t],e.style(n,{[t]:o}))}setContainerStyle(t){super.setContainerStyle(t);const n=this.getElement();if(Xe(n,"modal-open"),!t.scrollBarWidth)return;const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v.qsa(n,L.FIXED_CONTENT).forEach(i=>this.adjustAndStore(o,i,t.scrollBarWidth)),v.qsa(n,L.STICKY_CONTENT).forEach(i=>this.adjustAndStore(r,i,-t.scrollBarWidth)),v.qsa(n,L.NAVBAR_TOGGLER).forEach(i=>this.adjustAndStore(r,i,t.scrollBarWidth))}removeContainerStyle(t){super.removeContainerStyle(t);const n=this.getElement();Ye(n,"modal-open");const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v.qsa(n,L.FIXED_CONTENT).forEach(i=>this.restore(o,i)),v.qsa(n,L.STICKY_CONTENT).forEach(i=>this.restore(r,i)),v.qsa(n,L.NAVBAR_TOGGLER).forEach(i=>this.restore(r,i))}}let de;function Qe(s){return de||(de=new Je(s)),de}const Ce=g.forwardRef(({className:s,bsPrefix:t,as:n="div",...o},r)=>(t=e.useBootstrapPrefix(t,"modal-body"),e.jsxRuntimeExports.jsx(n,{ref:r,className:e.classNames(s,t),...o})));Ce.displayName="ModalBody";const Ze=Ce,et=g.createContext({onHide(){}}),Re=et,ye=g.forwardRef(({bsPrefix:s,className:t,contentClassName:n,centered:o,size:r,fullscreen:i,children:m,scrollable:c,...f},p)=>{s=e.useBootstrapPrefix(s,"modal");const u=`${s}-dialog`,h=typeof i=="string"?`${s}-fullscreen-${i}`:`${s}-fullscreen`;return e.jsxRuntimeExports.jsx("div",{...f,ref:p,className:e.classNames(u,t,r&&`${s}-${r}`,o&&`${u}-centered`,c&&`${u}-scrollable`,i&&h),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames(`${s}-content`,n),children:m})})});ye.displayName="ModalDialog";const be=ye,we=g.forwardRef(({className:s,bsPrefix:t,as:n="div",...o},r)=>(t=e.useBootstrapPrefix(t,"modal-footer"),e.jsxRuntimeExports.jsx(n,{ref:r,className:e.classNames(s,t),...o})));we.displayName="ModalFooter";const tt=we,st=g.forwardRef(({closeLabel:s="Close",closeVariant:t,closeButton:n=!1,onHide:o,children:r,...i},m)=>{const c=a.useContext(Re),f=e.useEventCallback(()=>{c==null||c.onHide(),o==null||o()});return e.jsxRuntimeExports.jsxs("div",{ref:m,...i,children:[r,n&&e.jsxRuntimeExports.jsx($e,{"aria-label":s,variant:t,onClick:f})]})}),nt=st,Me=g.forwardRef(({bsPrefix:s,className:t,closeLabel:n="Close",closeButton:o=!1,...r},i)=>(s=e.useBootstrapPrefix(s,"modal-header"),e.jsxRuntimeExports.jsx(nt,{ref:i,...r,className:e.classNames(t,s),closeLabel:n,closeButton:o})));Me.displayName="ModalHeader";const ot=Me,rt=Ue("h4"),Ne=g.forwardRef(({className:s,bsPrefix:t,as:n=rt,...o},r)=>(t=e.useBootstrapPrefix(t,"modal-title"),e.jsxRuntimeExports.jsx(n,{ref:r,className:e.classNames(s,t),...o})));Ne.displayName="ModalTitle";const at=Ne;function it(s){return e.jsxRuntimeExports.jsx(e.Fade,{...s,timeout:null})}function lt(s){return e.jsxRuntimeExports.jsx(e.Fade,{...s,timeout:null})}const Te=g.forwardRef(({bsPrefix:s,className:t,style:n,dialogClassName:o,contentClassName:r,children:i,dialogAs:m=be,"data-bs-theme":c,"aria-labelledby":f,"aria-describedby":p,"aria-label":u,show:h=!1,animation:R=!0,backdrop:w=!0,keyboard:Q=!0,onEscapeKeyDown:W,onShow:Z,onHide:M,container:ee,autoFocus:$=!0,enforceFocus:te=!0,restoreFocus:se=!0,restoreFocusOptions:ne,onEntered:H,onExit:A,onExiting:oe,onEnter:D,onEntering:_,onExited:q,backdropClassName:K,manager:z,...re},j)=>{const[N,x]=a.useState({}),[ae,G]=a.useState(!1),y=a.useRef(!1),T=a.useRef(!1),E=a.useRef(null),[C,F]=e.useCallbackRef(),ie=e.useMergedRefs(j,F),V=e.useEventCallback(M),le=e.useIsRTL();s=e.useBootstrapPrefix(s,"modal");const I=a.useMemo(()=>({onHide:V}),[V]);function k(){return z||Qe({isRTL:le})}function X(l){if(!e.canUseDOM)return;const B=k().getScrollbarWidth()>0,xe=l.scrollHeight>e.ownerDocument(l).documentElement.clientHeight;x({paddingRight:B&&!xe?he():void 0,paddingLeft:!B&&xe?he():void 0})}const S=e.useEventCallback(()=>{C&&X(C.dialog)});e.useWillUnmount(()=>{e.removeEventListener(window,"resize",S),E.current==null||E.current()});const P=()=>{y.current=!0},O=l=>{y.current&&C&&l.target===C.dialog&&(T.current=!0),y.current=!1},d=()=>{G(!0),E.current=e.transitionEnd(C.dialog,()=>{G(!1)})},Y=l=>{l.target===l.currentTarget&&d()},U=l=>{if(w==="static"){Y(l);return}if(T.current||l.target!==l.currentTarget){T.current=!1;return}M==null||M()},ke=l=>{Q?W==null||W(l):(l.preventDefault(),w==="static"&&d())},Se=(l,B)=>{l&&X(l),D==null||D(l,B)},Oe=l=>{E.current==null||E.current(),A==null||A(l)},Be=(l,B)=>{_==null||_(l,B),e.addEventListener(window,"resize",S)},Le=l=>{l&&(l.style.display=""),q==null||q(l),e.removeEventListener(window,"resize",S)},Ae=a.useCallback(l=>e.jsxRuntimeExports.jsx("div",{...l,className:e.classNames(`${s}-backdrop`,K,!R&&"show")}),[R,K,s]),pe={...n,...N};pe.display="block";const De=l=>e.jsxRuntimeExports.jsx("div",{role:"dialog",...l,style:pe,className:e.classNames(t,s,ae&&`${s}-static`,!R&&"show"),onClick:w?U:void 0,onMouseUp:O,"data-bs-theme":c,"aria-label":u,"aria-labelledby":f,"aria-describedby":p,children:e.jsxRuntimeExports.jsx(m,{...re,onMouseDown:P,className:o,contentClassName:r,children:i})});return e.jsxRuntimeExports.jsx(Re.Provider,{value:I,children:e.jsxRuntimeExports.jsx(Ve,{show:h,ref:ie,backdrop:w,container:ee,keyboard:!0,autoFocus:$,enforceFocus:te,restoreFocus:se,restoreFocusOptions:ne,onEscapeKeyDown:ke,onShow:Z,onHide:M,onEnter:Se,onEntering:Be,onEntered:H,onExit:Oe,onExiting:oe,onExited:Le,manager:k(),transition:R?it:void 0,backdropTransition:R?lt:void 0,renderBackdrop:Ae,renderDialog:De})})});Te.displayName="Modal";const b=Object.assign(Te,{Body:Ze,Header:ot,Title:at,Footer:tt,Dialog:be,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),ct=()=>{const{confirmTexts:s}=a.useContext(e.LuminusComponentsContext),{isShown:t,text:n,onFinish:o}=ve.usePrompt(),{options:r}=a.useContext(e.PromptContext),[i,m]=a.useState(""),c=a.useCallback(()=>{o(null)},[o]),f=a.useCallback(()=>{o(i)},[o,i]);a.useEffect(()=>{t===!0&&m("")},[t]);const p=a.useMemo(()=>({value:i,onChange:u=>m(u.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[i]);return e.jsxRuntimeExports.jsxs(b,{show:t,size:"sm",centered:!0,onHide:c,children:[e.jsxRuntimeExports.jsx(b.Header,{children:e.jsxRuntimeExports.jsx(b.Title,{children:n})}),e.jsxRuntimeExports.jsxs(b.Body,{children:[r.input==="textarea"?e.jsxRuntimeExports.jsx("textarea",{...p,rows:5}):void 0,r.input==="input"?e.jsxRuntimeExports.jsx("input",{...p,type:r.type}):void 0]}),e.jsxRuntimeExports.jsxs(b.Footer,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary",onClick:c,children:s.cancel}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary ml",onClick:f,disabled:r.required&&!i,children:s.confirm})]})]})},ut=({children:s})=>{const[t,n]=a.useState(!1),[o,r]=a.useState(""),[i,m]=a.useState({input:"textarea",type:"text"}),c=a.useRef(()=>{}),f=a.useCallback(h=>{r(h),n(!0),console.log("showprompt")},[]),p=a.useCallback(()=>{n(!1)},[]),u=a.useMemo(()=>({isShown:t,text:o,showPrompt:f,hidePrompt:p,resolveRef:c,options:i,setOptions:m}),[t,o,f,p,i]);return e.jsxRuntimeExports.jsxs(e.PromptContext.Provider,{value:u,children:[s,e.jsxRuntimeExports.jsx(ct,{})]})},dt=({children:s})=>{const[t,n]=a.useState(!1),[o,r]=a.useState(""),i=a.useCallback(f=>{n(!0),r(f)},[]),m=a.useCallback(()=>{n(!1)},[]),c=a.useMemo(()=>({show:t,text:o,showConfirm:i,hideConfirm:m}),[t,o,i,m]);return e.jsxRuntimeExports.jsxs(e.ConfirmContext.Provider,{value:c,children:[e.jsxRuntimeExports.jsx(xt,{}),s]})},mt=({cookieDomain:s,axiosInstance:t,LinkComponent:n,language:o,axiosTexts:r,confirmTexts:i,formValidationTexts:m,homeDashboardTexts:c,formSubmitTexts:f,appSearchTexts:p,children:u})=>{const h=a.useMemo(()=>({axiosInstance:t,cookieDomain:s,LinkComponent:n,language:o,axiosTexts:r,confirmTexts:i,formValidationTexts:m,homeDashboardTexts:c,formSubmitTexts:f,appSearchTexts:p}),[t,s,n,o,r,i,m,c,f,p]);return e.jsxRuntimeExports.jsx(e.LuminusComponentsContext.Provider,{value:h,children:e.jsxRuntimeExports.jsx(dt,{children:e.jsxRuntimeExports.jsxs(ut,{children:[e.jsxRuntimeExports.jsx(e.Ie,{}),u]})})})},ft=({children:s})=>{const[t,n]=a.useState(!1),[o]=a.useState(new Set),r=a.useCallback(c=>{o.add(c),n(!0)},[o]),i=a.useCallback(c=>{o.delete(c),o.size===0&&n(!1)},[o]),m=a.useMemo(()=>({isLoading:t,startLoading:r,stopLoading:i}),[t,r,i]);return e.jsxRuntimeExports.jsxs(e.LoadingContext.Provider,{value:m,children:[t&&e.jsxRuntimeExports.jsx(v.Loading,{}),s]})},pt=({children:s})=>{const t=e.useAxios(),n=a.useCallback(()=>{const u=localStorage.getItem("user")??null;return u?JSON.parse(u):null},[]),[o,r]=a.useState(n()),i=a.useCallback(async()=>{let u=null;return await t.get("/user/detail").then(h=>{u=h.data}).catch(()=>{u=null}),localStorage.setItem("user",JSON.stringify(u)),u},[t]),m=a.useCallback(()=>{localStorage.removeItem("user")},[]),c=a.useCallback(async()=>{const u=await i();return u?(r(u),!0):!1},[i]),f=a.useCallback(()=>{m(),r(null)},[m]),p=a.useMemo(()=>({user:o,loginUser:c,logoutUser:f}),[o,c,f]);return a.useEffect(()=>{r(n())},[n]),e.jsxRuntimeExports.jsx(e.UserContext.Provider,{value:p,children:s})},xt=()=>{const{confirmTexts:s}=a.useContext(e.LuminusComponentsContext),{onConfirm:t,onCancel:n,text:o,show:r}=ve.useConfirm();return e.jsxRuntimeExports.jsx(b,{show:r,size:"sm",centered:!0,onHide:n,children:e.jsxRuntimeExports.jsxs(b.Body,{children:[e.jsxRuntimeExports.jsx("div",{className:"mb-5 text-center",children:e.jsxRuntimeExports.jsx(Fe.Typography,{variant:"h6",children:o})}),e.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary w-100",onClick:n,children:s.no}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary w-100 ml",onClick:t,children:s.yes})]})]})})};exports.LoadingContext=e.LoadingContext;exports.LuminusComponentsContext=e.LuminusComponentsContext;exports.UserContext=e.UserContext;exports.LoadingProvider=ft;exports.LuminusComponentsProvider=mt;exports.UserProvider=pt;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { j as r, c as w, e as ye, f as be, o as Fe, s as G, g as Ie, h as nt, i as ot, k as E, l as Re, m as ke, n as De, p as st, r as Oe, q as rt, t as W, v as at, w as it, x as lt, y as Se, F as $e, z as dt, A as ct, L as Ee, P as We, C as ut, I as ft, B as ht, b as mt, U as gt } from "./UserAvatarToggle-
|
|
1
|
+
import { j as r, c as w, e as ye, f as be, o as Fe, s as G, g as Ie, h as nt, i as ot, k as E, l as Re, m as ke, n as De, p as st, r as Oe, q as rt, t as W, v as at, w as it, x as lt, y as Se, F as $e, z as dt, A as ct, L as Ee, P as We, C as ut, I as ft, B as ht, b as mt, U as gt } from "./UserAvatarToggle-CIQXhmcN.js";
|
|
2
2
|
import * as y from "react";
|
|
3
3
|
import { forwardRef as pt, useState as p, useRef as M, useImperativeHandle as vt, useEffect as re, useCallback as g, useContext as ae, useMemo as R } from "react";
|
|
4
|
-
import { a as yt, u as xt } from "./useConfirm-
|
|
5
|
-
import { T as wt } from "./Typography-
|
|
6
|
-
import { d as Ct, u as bt, q as D, L as Et } from "./DataKey-
|
|
4
|
+
import { a as yt, u as xt } from "./useConfirm-C_gZ96ka.js";
|
|
5
|
+
import { T as wt } from "./Typography-PSv7V5A1.js";
|
|
6
|
+
import { d as Ct, u as bt, q as D, L as Et } from "./DataKey-CPc1_-be.js";
|
|
7
7
|
import Mt from "react-dom";
|
|
8
8
|
const Tt = (t) => /* @__PURE__ */ y.forwardRef((e, n) => /* @__PURE__ */ r.jsx("div", {
|
|
9
9
|
...e,
|
|
@@ -2,6 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
type CustomTypeProps = {
|
|
3
3
|
useCoerce?: boolean;
|
|
4
4
|
};
|
|
5
|
+
type NumberTypeProps = CustomTypeProps & {
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
};
|
|
5
9
|
type ZFileProps = {
|
|
6
10
|
required: boolean;
|
|
7
11
|
multiple: boolean;
|
|
@@ -10,8 +14,8 @@ type ZFileProps = {
|
|
|
10
14
|
declare const useZodSchemaTypes: () => {
|
|
11
15
|
zString: (props?: CustomTypeProps) => z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>, string | null, string | null | undefined>;
|
|
12
16
|
zStringRequired: (props?: CustomTypeProps) => z.ZodEffects<z.ZodString, string, string>;
|
|
13
|
-
zNumber: (props?:
|
|
14
|
-
zNumberRequired: (props?:
|
|
17
|
+
zNumber: (props?: NumberTypeProps) => z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, number, number>>>, number | null, number | null | undefined>;
|
|
18
|
+
zNumberRequired: (props?: NumberTypeProps) => z.ZodEffects<z.ZodNumber, number, number>;
|
|
15
19
|
zBool: (props?: CustomTypeProps) => z.ZodEffects<z.ZodBoolean, boolean, boolean>;
|
|
16
20
|
zDate: (props?: CustomTypeProps) => z.ZodEffects<z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>, string | null, string | null>;
|
|
17
21
|
zDateRequired: (props?: CustomTypeProps) => z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|