@zydon/common 2.2.48 → 2.2.50
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/chunk-23GJSDGU.js +10 -0
- package/dist/chunk-2MVQI7NJ.js +8 -0
- package/dist/chunk-3APKMSVD.js +5 -0
- package/dist/chunk-3E5A45HM.js +3 -0
- package/dist/chunk-4CNAGEPZ.js +13 -0
- package/dist/chunk-4INDXVIX.js +5 -0
- package/dist/chunk-56NARAT6.js +11 -0
- package/dist/chunk-5YJTSVA2.js +6 -0
- package/dist/chunk-7F56LFN2.js +17 -0
- package/dist/chunk-7KZ2UT76.js +8 -0
- package/dist/chunk-ANAHA3L6.js +3 -0
- package/dist/chunk-BA43A7R3.js +18 -0
- package/dist/chunk-BUYQKDFG.js +13 -0
- package/dist/chunk-BYAPKKGB.js +7 -0
- package/dist/chunk-CFVUZ4S5.js +5 -0
- package/dist/chunk-CFYNJQGN.js +43 -0
- package/dist/chunk-CQDKXUUX.js +3 -0
- package/dist/chunk-D27ND54J.js +16 -0
- package/dist/chunk-D2VRQ2K3.js +10 -0
- package/dist/chunk-DZ7YW2X6.js +18 -0
- package/dist/chunk-E5MGOPPQ.js +8 -0
- package/dist/chunk-EBTRMUBS.js +7 -0
- package/dist/chunk-EFUFJKJD.js +7 -0
- package/dist/chunk-F7CW3DXN.js +14 -0
- package/dist/chunk-GA4A5P3S.js +6 -0
- package/dist/chunk-GOC7PC2S.js +6 -0
- package/dist/chunk-ILHUUK4X.js +6 -0
- package/dist/chunk-KFZEM7KS.js +5 -0
- package/dist/chunk-KORVZU6L.js +17 -0
- package/dist/chunk-M6QHAL4V.js +7 -0
- package/dist/chunk-MCT77MRN.js +8 -0
- package/dist/chunk-NF42ENKE.js +9 -0
- package/dist/chunk-NHQNAQTD.js +7 -0
- package/dist/chunk-NQ32QBBI.js +7 -0
- package/dist/chunk-ORYAES3Q.js +5 -0
- package/dist/chunk-PMPALWRO.js +9 -0
- package/dist/chunk-QHVL5QNM.js +13 -0
- package/dist/chunk-QNAXGE5H.js +8 -0
- package/dist/chunk-QQB3DGHT.js +3 -0
- package/dist/chunk-RLMWIJKJ.js +10 -0
- package/dist/chunk-SEVJABAI.js +7 -0
- package/dist/chunk-T7I256S6.js +8 -0
- package/dist/chunk-TRI6XGH4.js +7 -0
- package/dist/chunk-TWGGHTU5.js +5 -0
- package/dist/chunk-UGH5FWZQ.js +13 -0
- package/dist/chunk-VTHBHXM2.js +7 -0
- package/dist/chunk-VVMQMROT.js +5 -0
- package/dist/chunk-W3MYAMTH.js +5 -0
- package/dist/chunk-WKD3OXUA.js +6 -0
- package/dist/chunk-YWEB6IAI.js +6 -0
- package/dist/chunk-YYKIC4EK.js +28 -0
- package/dist/chunk-Z2TDWMRU.js +6 -0
- package/dist/chunk-ZDHXW74M.js +5 -0
- package/dist/chunk-ZHP7IRS6.js +7 -0
- package/dist/chunk-ZODC2MGF.js +10 -0
- package/dist/components/ActionButton/index.js +3 -35
- package/dist/components/Autocomplete/index.js +3 -141
- package/dist/components/AutocompleteDetailed/index.js +3 -142
- package/dist/components/BuilderLayout/index.js +12 -26
- package/dist/components/BuilderSidebar/index.js +10 -20
- package/dist/components/ColorPickerInput/index.js +2 -101
- package/dist/components/ColoredLabel/index.js +7 -44
- package/dist/components/Common/index.js +22 -31
- package/dist/components/Confirm/index.js +11 -51
- package/dist/components/CustomAvatar/index.js +1 -62
- package/dist/components/CustomAvatarGroup/index.js +7 -76
- package/dist/components/DashedDivider/index.js +1 -10
- package/dist/components/DataCards/index.js +20 -60
- package/dist/components/DataGrid/index.js +15 -81
- package/dist/components/DatePicker/index.js +7 -42
- package/dist/components/DateRangePicker/index.js +7 -50
- package/dist/components/DateTimePicker/index.js +7 -40
- package/dist/components/Delayed/index.js +5 -17
- package/dist/components/Drawer/index.js +12 -39
- package/dist/components/EmptyContent/index.js +3 -80
- package/dist/components/EmptyView/index.js +2 -34
- package/dist/components/Error/index.js +10 -46
- package/dist/components/ExpandableGroup/index.js +13 -33
- package/dist/components/FixedProgressBar/index.js +1 -22
- package/dist/components/FrameSkeleton/index.js +16 -108
- package/dist/components/HelpButton/index.js +3 -22
- package/dist/components/Icon/index.js +2 -670
- package/dist/components/ImageCrop/index.js +1 -51
- package/dist/components/ImageCropModal/index.js +5 -130
- package/dist/components/Incrementer/index.js +5 -161
- package/dist/components/Label/index.js +9 -74
- package/dist/components/LoadingScreen/index.js +8 -11
- package/dist/components/MaskedInput/index.js +1 -55
- package/dist/components/MenuItem/index.js +11 -24
- package/dist/components/MenuPopover/index.js +1 -48
- package/dist/components/Modal/index.js +3 -33
- package/dist/components/ModalActions/index.js +6 -11
- package/dist/components/MoreMenu/index.js +11 -18
- package/dist/components/NumberInput/index.js +1 -109
- package/dist/components/PasswordRules/index.js +11 -78
- package/dist/components/PopoverSelect/index.js +13 -50
- package/dist/components/Portal/index.js +1 -28
- package/dist/components/Result/index.js +1 -28
- package/dist/components/SavedChanges/index.js +7 -42
- package/dist/components/Scrollbar/index.js +1 -45
- package/dist/components/SearchInput/index.js +3 -73
- package/dist/components/SelectableCards/index.js +8 -144
- package/dist/components/SeoPreview/index.js +13 -167
- package/dist/components/SplashScreen/index.js +8 -107
- package/dist/components/Steps/index.js +14 -71
- package/dist/components/StyledTab/index.js +10 -90
- package/dist/components/StyledTabs/index.js +7 -27
- package/dist/components/Summary/index.js +8 -15
- package/dist/components/SwapList/index.js +22 -249
- package/dist/components/TabPanel/index.js +6 -34
- package/dist/components/TextMaxLine/index.js +2 -49
- package/dist/components/TimePicker/index.js +7 -42
- package/dist/components/ToggleButtonGroup/index.js +7 -10
- package/dist/components/Tooltip/index.js +6 -8
- package/dist/components/WhiteBox/index.js +1 -8
- package/dist/components/animate/index.js +2 -16
- package/dist/components/carousel/index.js +16 -10
- package/dist/components/form/Address/index.js +15 -199
- package/dist/components/form/Autocomplete/index.js +4 -42
- package/dist/components/form/AutocompleteDetailed/index.js +9 -42
- package/dist/components/form/Checkbox/index.js +9 -51
- package/dist/components/form/Codes/index.js +11 -87
- package/dist/components/form/ColorPicker/index.js +8 -52
- package/dist/components/form/DatePicker/index.js +8 -63
- package/dist/components/form/DateRangePicker/index.js +10 -77
- package/dist/components/form/DateTimePicker/index.js +8 -61
- package/dist/components/form/Field/index.js +1 -49
- package/dist/components/form/Form/index.js +7 -29
- package/dist/components/form/Incrementer/index.js +11 -38
- package/dist/components/form/InputTags/index.js +9 -69
- package/dist/components/form/MaskedInput/index.js +2 -45
- package/dist/components/form/MultiCheckbox/index.js +12 -93
- package/dist/components/form/MultiChipField/index.js +8 -49
- package/dist/components/form/NumberInput/index.js +7 -43
- package/dist/components/form/Password/index.js +13 -91
- package/dist/components/form/RadioGroup/index.js +13 -127
- package/dist/components/form/SelectableCards/index.js +14 -22
- package/dist/components/form/Switch/index.js +9 -71
- package/dist/components/form/TimePicker/index.js +8 -64
- package/dist/components/form/UploadAvatarWithCrop/index.js +20 -59
- package/dist/components/form/UploadWithCrop/index.js +23 -59
- package/dist/components/form/Webhook/index.js +19 -146
- package/dist/components/lightbox/index.js +16 -3
- package/dist/components/table/index.js +21 -19
- package/dist/components/upload/index.js +23 -14
- package/dist/hooks/useActiveElement.js +5 -27
- package/dist/hooks/useApiMessage.js +5 -33
- package/dist/hooks/useAutocomplete.js +6 -61
- package/dist/hooks/useCopyToClipboard.js +5 -22
- package/dist/hooks/useDatagrid.js +6 -45
- package/dist/hooks/useDebounceValue.js +5 -18
- package/dist/hooks/useDeepCompareEffect.js +6 -16
- package/dist/hooks/useEventCallback.js +2 -17
- package/dist/hooks/useEventListener.js +1 -24
- package/dist/hooks/useIsMounting.js +5 -13
- package/dist/hooks/useIsomorphicLayoutEffect.js +1 -6
- package/dist/hooks/useLocalStorage.js +8 -88
- package/dist/hooks/useMount.js +5 -9
- package/dist/hooks/useOnClickOutside.js +5 -15
- package/dist/hooks/usePagination.js +5 -40
- package/dist/hooks/usePopover.js +1 -24
- package/dist/hooks/useResponsive.js +1 -35
- package/dist/hooks/useScrollOffSetTop.js +6 -32
- package/dist/hooks/useSnackbar.js +1 -13
- package/dist/hooks/useTabs.js +5 -16
- package/dist/hooks/useToggle.js +1 -11
- package/dist/hooks/useUpload.js +1 -57
- package/dist/hooks/useUploadImage.js +2 -79
- package/dist/index.css +10 -0
- package/dist/index.js +3 -6
- package/dist/locales/all-langs.js +1 -39
- package/dist/theme/core/index.js +3 -6
- package/dist/theme/styles/index.d.ts +1 -1
- package/dist/theme/styles/index.js +1 -3
- package/dist/theme/theme-provider.js +7 -45
- package/dist/theme/with-settings/index.js +4 -2
- package/dist/types/addressProps.js +1 -1
- package/dist/types/api.js +1 -1
- package/dist/types/autoComplete.js +1 -1
- package/dist/types/autoCompleteProps.js +1 -1
- package/dist/types/baseField.js +1 -1
- package/dist/types/dataGridProps.js +1 -1
- package/dist/types/datagrid.js +1 -1
- package/dist/types/datePickerProps.js +1 -1
- package/dist/types/dateRangePickerProps.js +1 -1
- package/dist/types/dateTimePickerProps.js +1 -1
- package/dist/types/fieldProps.js +1 -1
- package/dist/types/icon.js +1 -331
- package/dist/types/iconProps.js +1 -1
- package/dist/types/incrementerProps.js +1 -1
- package/dist/types/item.js +1 -1
- package/dist/types/multiCheckboxProps.js +1 -1
- package/dist/types/numberInputProps.js +1 -1
- package/dist/types/option.js +1 -1
- package/dist/types/radioGroupProps.js +1 -1
- package/dist/types/searchInputProps.js +1 -1
- package/dist/types/sectionProps.js +1 -1
- package/dist/types/switchProps.js +1 -1
- package/dist/types/timePickerProps.js +1 -1
- package/dist/types/upload.js +1 -1
- package/dist/types/webhook.js +3 -51
- package/dist/utils/color.js +1 -6
- package/dist/utils/compare.js +1 -6
- package/dist/utils/date.js +6 -23
- package/dist/utils/formatNumber.js +1 -94
- package/dist/utils/formatTime.js +1 -169
- package/dist/utils/loadable.js +7 -14
- package/dist/utils/mask.js +3 -44
- package/dist/utils/number.js +1 -15
- package/dist/utils/sort.js +3 -24
- package/dist/utils/uuidv4.js +3 -10
- package/dist/utils/validators.js +1 -86
- package/package.json +1 -1
- package/dist/components/ActionButton/index.js.map +0 -1
- package/dist/components/Autocomplete/index.js.map +0 -1
- package/dist/components/AutocompleteDetailed/index.js.map +0 -1
- package/dist/components/BuilderLayout/index.js.map +0 -1
- package/dist/components/BuilderSidebar/index.js.map +0 -1
- package/dist/components/ColorPickerInput/index.js.map +0 -1
- package/dist/components/ColoredLabel/index.js.map +0 -1
- package/dist/components/Common/index.js.map +0 -1
- package/dist/components/Confirm/index.js.map +0 -1
- package/dist/components/CustomAvatar/index.js.map +0 -1
- package/dist/components/CustomAvatarGroup/index.js.map +0 -1
- package/dist/components/DashedDivider/index.js.map +0 -1
- package/dist/components/DataCards/index.js.map +0 -1
- package/dist/components/DataGrid/index.js.map +0 -1
- package/dist/components/DatePicker/index.js.map +0 -1
- package/dist/components/DateRangePicker/index.js.map +0 -1
- package/dist/components/DateTimePicker/index.js.map +0 -1
- package/dist/components/Delayed/index.js.map +0 -1
- package/dist/components/Drawer/index.js.map +0 -1
- package/dist/components/EmptyContent/index.js.map +0 -1
- package/dist/components/EmptyView/index.js.map +0 -1
- package/dist/components/Error/index.js.map +0 -1
- package/dist/components/ExpandableGroup/index.js.map +0 -1
- package/dist/components/FixedProgressBar/index.js.map +0 -1
- package/dist/components/FrameSkeleton/index.js.map +0 -1
- package/dist/components/HelpButton/index.js.map +0 -1
- package/dist/components/Icon/index.js.map +0 -1
- package/dist/components/ImageCrop/index.js.map +0 -1
- package/dist/components/ImageCropModal/index.js.map +0 -1
- package/dist/components/Incrementer/index.js.map +0 -1
- package/dist/components/Label/index.js.map +0 -1
- package/dist/components/LoadingScreen/index.js.map +0 -1
- package/dist/components/MaskedInput/index.js.map +0 -1
- package/dist/components/MenuItem/index.js.map +0 -1
- package/dist/components/MenuPopover/index.js.map +0 -1
- package/dist/components/Modal/index.js.map +0 -1
- package/dist/components/ModalActions/index.js.map +0 -1
- package/dist/components/MoreMenu/index.js.map +0 -1
- package/dist/components/NumberInput/index.js.map +0 -1
- package/dist/components/PasswordRules/index.js.map +0 -1
- package/dist/components/PopoverSelect/index.js.map +0 -1
- package/dist/components/Portal/index.js.map +0 -1
- package/dist/components/Result/index.js.map +0 -1
- package/dist/components/SavedChanges/index.js.map +0 -1
- package/dist/components/Scrollbar/index.js.map +0 -1
- package/dist/components/SearchInput/index.js.map +0 -1
- package/dist/components/SelectableCards/index.js.map +0 -1
- package/dist/components/SeoPreview/index.js.map +0 -1
- package/dist/components/SplashScreen/index.js.map +0 -1
- package/dist/components/Steps/index.js.map +0 -1
- package/dist/components/StyledTab/index.js.map +0 -1
- package/dist/components/StyledTabs/index.js.map +0 -1
- package/dist/components/Summary/index.js.map +0 -1
- package/dist/components/SwapList/index.js.map +0 -1
- package/dist/components/TabPanel/index.js.map +0 -1
- package/dist/components/TextMaxLine/index.js.map +0 -1
- package/dist/components/TimePicker/index.js.map +0 -1
- package/dist/components/ToggleButtonGroup/index.js.map +0 -1
- package/dist/components/Tooltip/index.js.map +0 -1
- package/dist/components/WhiteBox/index.js.map +0 -1
- package/dist/components/animate/index.js.map +0 -1
- package/dist/components/carousel/index.js.map +0 -1
- package/dist/components/form/Address/index.js.map +0 -1
- package/dist/components/form/Autocomplete/index.js.map +0 -1
- package/dist/components/form/AutocompleteDetailed/index.js.map +0 -1
- package/dist/components/form/Checkbox/index.js.map +0 -1
- package/dist/components/form/Codes/index.js.map +0 -1
- package/dist/components/form/ColorPicker/index.js.map +0 -1
- package/dist/components/form/DatePicker/index.js.map +0 -1
- package/dist/components/form/DateRangePicker/index.js.map +0 -1
- package/dist/components/form/DateTimePicker/index.js.map +0 -1
- package/dist/components/form/Field/index.js.map +0 -1
- package/dist/components/form/Form/index.js.map +0 -1
- package/dist/components/form/Incrementer/index.js.map +0 -1
- package/dist/components/form/InputTags/index.js.map +0 -1
- package/dist/components/form/MaskedInput/index.js.map +0 -1
- package/dist/components/form/MultiCheckbox/index.js.map +0 -1
- package/dist/components/form/MultiChipField/index.js.map +0 -1
- package/dist/components/form/NumberInput/index.js.map +0 -1
- package/dist/components/form/Password/index.js.map +0 -1
- package/dist/components/form/RadioGroup/index.js.map +0 -1
- package/dist/components/form/SelectableCards/index.js.map +0 -1
- package/dist/components/form/Switch/index.js.map +0 -1
- package/dist/components/form/TimePicker/index.js.map +0 -1
- package/dist/components/form/UploadAvatarWithCrop/index.js.map +0 -1
- package/dist/components/form/UploadWithCrop/index.js.map +0 -1
- package/dist/components/form/Webhook/index.js.map +0 -1
- package/dist/components/lightbox/index.js.map +0 -1
- package/dist/components/table/index.js.map +0 -1
- package/dist/components/upload/index.js.map +0 -1
- package/dist/hooks/useActiveElement.js.map +0 -1
- package/dist/hooks/useApiMessage.js.map +0 -1
- package/dist/hooks/useAutocomplete.js.map +0 -1
- package/dist/hooks/useCopyToClipboard.js.map +0 -1
- package/dist/hooks/useDatagrid.js.map +0 -1
- package/dist/hooks/useDebounceValue.js.map +0 -1
- package/dist/hooks/useDeepCompareEffect.js.map +0 -1
- package/dist/hooks/useEventCallback.js.map +0 -1
- package/dist/hooks/useEventListener.js.map +0 -1
- package/dist/hooks/useIsMounting.js.map +0 -1
- package/dist/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/dist/hooks/useLocalStorage.js.map +0 -1
- package/dist/hooks/useMount.js.map +0 -1
- package/dist/hooks/useOnClickOutside.js.map +0 -1
- package/dist/hooks/usePagination.js.map +0 -1
- package/dist/hooks/usePopover.js.map +0 -1
- package/dist/hooks/useResponsive.js.map +0 -1
- package/dist/hooks/useScrollOffSetTop.js.map +0 -1
- package/dist/hooks/useSnackbar.js.map +0 -1
- package/dist/hooks/useTabs.js.map +0 -1
- package/dist/hooks/useToggle.js.map +0 -1
- package/dist/hooks/useUpload.js.map +0 -1
- package/dist/hooks/useUploadImage.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/locales/all-langs.js.map +0 -1
- package/dist/theme/core/index.js.map +0 -1
- package/dist/theme/styles/index.js.map +0 -1
- package/dist/theme/theme-provider.js.map +0 -1
- package/dist/theme/with-settings/index.js.map +0 -1
- package/dist/types/addressProps.js.map +0 -1
- package/dist/types/api.js.map +0 -1
- package/dist/types/autoComplete.js.map +0 -1
- package/dist/types/autoCompleteProps.js.map +0 -1
- package/dist/types/baseField.js.map +0 -1
- package/dist/types/dataGridProps.js.map +0 -1
- package/dist/types/datagrid.js.map +0 -1
- package/dist/types/datePickerProps.js.map +0 -1
- package/dist/types/dateRangePickerProps.js.map +0 -1
- package/dist/types/dateTimePickerProps.js.map +0 -1
- package/dist/types/fieldProps.js.map +0 -1
- package/dist/types/icon.js.map +0 -1
- package/dist/types/iconProps.js.map +0 -1
- package/dist/types/incrementerProps.js.map +0 -1
- package/dist/types/item.js.map +0 -1
- package/dist/types/multiCheckboxProps.js.map +0 -1
- package/dist/types/numberInputProps.js.map +0 -1
- package/dist/types/option.js.map +0 -1
- package/dist/types/radioGroupProps.js.map +0 -1
- package/dist/types/searchInputProps.js.map +0 -1
- package/dist/types/sectionProps.js.map +0 -1
- package/dist/types/switchProps.js.map +0 -1
- package/dist/types/timePickerProps.js.map +0 -1
- package/dist/types/upload.js.map +0 -1
- package/dist/types/webhook.js.map +0 -1
- package/dist/utils/color.js.map +0 -1
- package/dist/utils/compare.js.map +0 -1
- package/dist/utils/date.js.map +0 -1
- package/dist/utils/formatNumber.js.map +0 -1
- package/dist/utils/formatTime.js.map +0 -1
- package/dist/utils/loadable.js.map +0 -1
- package/dist/utils/mask.js.map +0 -1
- package/dist/utils/number.js.map +0 -1
- package/dist/utils/sort.js.map +0 -1
- package/dist/utils/uuidv4.js.map +0 -1
- package/dist/utils/validators.js.map +0 -1
|
@@ -1,91 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
specialCharacter,
|
|
15
|
-
upperCaseChar,
|
|
16
|
-
numberChar,
|
|
17
|
-
showErrorMessage,
|
|
18
|
-
match,
|
|
19
|
-
...other
|
|
20
|
-
}) => {
|
|
21
|
-
const { watch } = useFormContext();
|
|
22
|
-
const password = watch(name);
|
|
23
|
-
const [showPassword, setShowPassword] = useState(false);
|
|
24
|
-
const {
|
|
25
|
-
hasNumberChar,
|
|
26
|
-
hasSpecialCharacter,
|
|
27
|
-
hasUpperCaseChar,
|
|
28
|
-
isLengthValid
|
|
29
|
-
} = validatePassword(
|
|
30
|
-
password,
|
|
31
|
-
passwordSize,
|
|
32
|
-
numberChar,
|
|
33
|
-
specialCharacter,
|
|
34
|
-
upperCaseChar
|
|
35
|
-
);
|
|
36
|
-
return /* @__PURE__ */ jsx(
|
|
37
|
-
Field,
|
|
38
|
-
{
|
|
39
|
-
"data-intercom-target": name,
|
|
40
|
-
...other,
|
|
41
|
-
name,
|
|
42
|
-
type: showPassword ? "text" : "password",
|
|
43
|
-
InputProps: {
|
|
44
|
-
endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(
|
|
45
|
-
IconButton,
|
|
46
|
-
{
|
|
47
|
-
onClick: () => setShowPassword(!showPassword),
|
|
48
|
-
edge: "end",
|
|
49
|
-
"aria-label": "Mostrar/Ocultar senha",
|
|
50
|
-
tabIndex: -1,
|
|
51
|
-
children: /* @__PURE__ */ jsx(Icon, { icon: showPassword ? "VIEW_ON" : "VIEW_OFF" })
|
|
52
|
-
}
|
|
53
|
-
) })
|
|
54
|
-
},
|
|
55
|
-
rules: {
|
|
56
|
-
...rules,
|
|
57
|
-
validate: {
|
|
58
|
-
...rules?.validate,
|
|
59
|
-
validationPassword: (v) => {
|
|
60
|
-
const validation = validatePassword(
|
|
61
|
-
v,
|
|
62
|
-
passwordSize,
|
|
63
|
-
numberChar,
|
|
64
|
-
specialCharacter,
|
|
65
|
-
upperCaseChar
|
|
66
|
-
);
|
|
67
|
-
if (!validation.hasNumberChar || !validation.hasSpecialCharacter || !validation.hasUpperCaseChar || !validation.isLengthValid)
|
|
68
|
-
return "Senha inv\xE1lida";
|
|
69
|
-
if (match && match.fieldPassword) {
|
|
70
|
-
const passwordValue = watch(match.fieldPassword);
|
|
71
|
-
if (passwordValue !== v)
|
|
72
|
-
return "As senhas devem ser iguais";
|
|
73
|
-
}
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
sx: {
|
|
79
|
-
...sx,
|
|
80
|
-
"& .MuiFormHelperText-root": {
|
|
81
|
-
display: (!hasSpecialCharacter || !hasUpperCaseChar || !isLengthValid || !hasNumberChar) && !showErrorMessage ? "none" : void 0
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
var Password_default = Password;
|
|
88
|
-
export {
|
|
89
|
-
Password_default as default
|
|
90
|
-
};
|
|
91
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { a } from '../../../chunk-VTHBHXM2.js';
|
|
2
|
+
import { d } from '../../../chunk-CQDKXUUX.js';
|
|
3
|
+
import { a as a$1 } from '../../../chunk-PMPALWRO.js';
|
|
4
|
+
import '../../../chunk-3E5A45HM.js';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { useFormContext } from 'react-hook-form';
|
|
7
|
+
import S from '@mui/material/IconButton';
|
|
8
|
+
import b from '@mui/material/InputAdornment';
|
|
9
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var N=({name:s,sx:w,rules:n,passwordSize:i,specialCharacter:d$1,upperCaseChar:p,numberChar:l,showErrorMessage:c,match:t,...P})=>{let{watch:m}=useFormContext(),I=m(s),[a$2,g]=useState(!1),{hasNumberChar:v,hasSpecialCharacter:C,hasUpperCaseChar:V,isLengthValid:x}=d(I,i,l,d$1,p);return jsx(a,{"data-intercom-target":s,...P,name:s,type:a$2?"text":"password",InputProps:{endAdornment:jsx(b,{position:"end",children:jsx(S,{onClick:()=>g(!a$2),edge:"end","aria-label":"Mostrar/Ocultar senha",tabIndex:-1,children:jsx(a$1,{icon:a$2?"VIEW_ON":"VIEW_OFF"})})})},rules:{...n,validate:{...n?.validate,validationPassword:u=>{let o=d(u,i,l,d$1,p);return !o.hasNumberChar||!o.hasSpecialCharacter||!o.hasUpperCaseChar||!o.isLengthValid?"Senha inv\xE1lida":t&&t.fieldPassword&&m(t.fieldPassword)!==u?"As senhas devem ser iguais":!0}}},sx:{...w,"& .MuiFormHelperText-root":{display:(!C||!V||!x||!v)&&!c?"none":void 0}}})},_=N;
|
|
12
|
+
|
|
13
|
+
export { _ as default };
|
|
@@ -1,127 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
label,
|
|
15
|
-
options,
|
|
16
|
-
spacing,
|
|
17
|
-
helperText,
|
|
18
|
-
decorated,
|
|
19
|
-
onChange,
|
|
20
|
-
tabIndex,
|
|
21
|
-
required,
|
|
22
|
-
disabled,
|
|
23
|
-
...other
|
|
24
|
-
}) => {
|
|
25
|
-
const { control } = useFormContext();
|
|
26
|
-
const labelledby = label ? `${name}-${label}` : "";
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
-
Controller,
|
|
29
|
-
{
|
|
30
|
-
name,
|
|
31
|
-
control,
|
|
32
|
-
rules,
|
|
33
|
-
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsxs(
|
|
34
|
-
FormControl,
|
|
35
|
-
{
|
|
36
|
-
component: "fieldset",
|
|
37
|
-
sx: {
|
|
38
|
-
...decorated && {
|
|
39
|
-
paddingLeft: 1.5
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"data-intercom-target": name,
|
|
43
|
-
children: [
|
|
44
|
-
label && /* @__PURE__ */ jsx(
|
|
45
|
-
FormLabel,
|
|
46
|
-
{
|
|
47
|
-
component: "legend",
|
|
48
|
-
id: labelledby,
|
|
49
|
-
sx: { typography: "body2" },
|
|
50
|
-
required,
|
|
51
|
-
children: label
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
/* @__PURE__ */ jsx(
|
|
55
|
-
MuiRadioGroup,
|
|
56
|
-
{
|
|
57
|
-
...other,
|
|
58
|
-
...field,
|
|
59
|
-
onChange: (event, value) => {
|
|
60
|
-
field.onChange(event);
|
|
61
|
-
if (onChange)
|
|
62
|
-
onChange(event, value);
|
|
63
|
-
},
|
|
64
|
-
"aria-labelledby": labelledby,
|
|
65
|
-
row,
|
|
66
|
-
children: options.map((option) => /* @__PURE__ */ jsx(
|
|
67
|
-
FormControlLabel,
|
|
68
|
-
{
|
|
69
|
-
value: option.value,
|
|
70
|
-
control: /* @__PURE__ */ jsx(
|
|
71
|
-
Radio,
|
|
72
|
-
{
|
|
73
|
-
inputProps: { tabIndex },
|
|
74
|
-
disabled,
|
|
75
|
-
checked: option.value === field.value,
|
|
76
|
-
icon: option.icon,
|
|
77
|
-
checkedIcon: option.icon
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
label: option.label,
|
|
81
|
-
sx: ({ palette }) => ({
|
|
82
|
-
"&:not(:last-of-type)": {
|
|
83
|
-
mb: spacing || 0
|
|
84
|
-
},
|
|
85
|
-
...row && {
|
|
86
|
-
mr: 0,
|
|
87
|
-
"&:not(:last-of-type)": {
|
|
88
|
-
mr: spacing || 2
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
...decorated && {
|
|
92
|
-
border: `1px solid ${alpha(palette.grey[500], 0.32)}`,
|
|
93
|
-
borderRadius: 1,
|
|
94
|
-
padding: 0.25,
|
|
95
|
-
paddingRight: (spacing || 0) / 2 || 1,
|
|
96
|
-
...field.value === option.value && {
|
|
97
|
-
borderColor: "primary.main",
|
|
98
|
-
backgroundColor: alpha(palette.primary.main, 0.05)
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
},
|
|
103
|
-
option.value
|
|
104
|
-
))
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
(!!error || helperText) && /* @__PURE__ */ jsx(
|
|
108
|
-
FormHelperText,
|
|
109
|
-
{
|
|
110
|
-
error: !!error,
|
|
111
|
-
sx: (theme) => ({
|
|
112
|
-
color: disabled ? theme.palette.grey[500] : void 0
|
|
113
|
-
}),
|
|
114
|
-
children: error ? error?.message : helperText
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
|
-
);
|
|
122
|
-
};
|
|
123
|
-
var RadioGroup_default = RadioGroup;
|
|
124
|
-
export {
|
|
125
|
-
RadioGroup_default as default
|
|
126
|
-
};
|
|
127
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
+
import h from '@mui/material/FormControl';
|
|
3
|
+
import G from '@mui/material/FormControlLabel';
|
|
4
|
+
import k from '@mui/material/FormHelperText';
|
|
5
|
+
import L from '@mui/material/FormLabel';
|
|
6
|
+
import P from '@mui/material/Radio';
|
|
7
|
+
import $ from '@mui/material/RadioGroup';
|
|
8
|
+
import { alpha } from '@mui/material/styles';
|
|
9
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var H=({name:l,rules:b,row:i,label:e,options:y,spacing:d,helperText:p,decorated:n,onChange:u,tabIndex:g,required:C,disabled:s,...F})=>{let{control:R}=useFormContext(),c=e?`${l}-${e}`:"";return jsx(Controller,{name:l,control:R,rules:b,render:({field:a,fieldState:{error:m}})=>jsxs(h,{component:"fieldset",sx:{...n&&{paddingLeft:1.5}},"data-intercom-target":l,children:[e&&jsx(L,{component:"legend",id:c,sx:{typography:"body2"},required:C,children:e}),jsx($,{...F,...a,onChange:(o,t)=>{a.onChange(o),u&&u(o,t);},"aria-labelledby":c,row:i,children:y.map(o=>jsx(G,{value:o.value,control:jsx(P,{inputProps:{tabIndex:g},disabled:s,checked:o.value===a.value,icon:o.icon,checkedIcon:o.icon}),label:o.label,sx:({palette:t})=>({"&:not(:last-of-type)":{mb:d||0},...i&&{mr:0,"&:not(:last-of-type)":{mr:d||2}},...n&&{border:`1px solid ${alpha(t.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(d||0)/2||1,...a.value===o.value&&{borderColor:"primary.main",backgroundColor:alpha(t.primary.main,.05)}}})},o.value))}),(!!m||p)&&jsx(k,{error:!!m,sx:o=>({color:s?o.palette.grey[500]:void 0}),children:m?m?.message:p})]})})},D=H;
|
|
12
|
+
|
|
13
|
+
export { D as default };
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
var SelectableCards_default = SelectableCards;
|
|
19
|
-
export {
|
|
20
|
-
SelectableCards_default as default
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { a } from '../../../chunk-DZ7YW2X6.js';
|
|
2
|
+
import '../../../chunk-D2VRQ2K3.js';
|
|
3
|
+
import '../../../chunk-TWGGHTU5.js';
|
|
4
|
+
import '../../../chunk-E5MGOPPQ.js';
|
|
5
|
+
import '../../../chunk-2MVQI7NJ.js';
|
|
6
|
+
import '../../../chunk-ZDHXW74M.js';
|
|
7
|
+
import '../../../chunk-PMPALWRO.js';
|
|
8
|
+
import '../../../chunk-3E5A45HM.js';
|
|
9
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
10
|
+
import { jsx } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var c=({name:o,rules:t,...l})=>{let{control:n}=useFormContext();return jsx(Controller,{name:o,control:n,rules:t,render:({field:a$1})=>jsx(a,{...a$1,...l})})},d=c;
|
|
13
|
+
|
|
14
|
+
export { d as default };
|
|
@@ -1,71 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
name,
|
|
11
|
-
helperText,
|
|
12
|
-
onChange,
|
|
13
|
-
tabIndex,
|
|
14
|
-
size,
|
|
15
|
-
label,
|
|
16
|
-
sx,
|
|
17
|
-
...other
|
|
18
|
-
}) => {
|
|
19
|
-
const { control } = useFormContext();
|
|
20
|
-
const renderSwitch = (field) => {
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
-
MuiSwitch,
|
|
23
|
-
{
|
|
24
|
-
...field,
|
|
25
|
-
checked: field.value,
|
|
26
|
-
onChange: (e, v) => {
|
|
27
|
-
field.onChange(e);
|
|
28
|
-
if (onChange)
|
|
29
|
-
onChange(e, v);
|
|
30
|
-
},
|
|
31
|
-
inputProps: { tabIndex },
|
|
32
|
-
size,
|
|
33
|
-
sx
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
-
Controller,
|
|
39
|
-
{
|
|
40
|
-
name,
|
|
41
|
-
control,
|
|
42
|
-
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsxs("div", { children: [
|
|
43
|
-
label ? /* @__PURE__ */ jsx(
|
|
44
|
-
FormControlLabel,
|
|
45
|
-
{
|
|
46
|
-
label,
|
|
47
|
-
control: renderSwitch(field),
|
|
48
|
-
"data-intercom-target": name,
|
|
49
|
-
...other
|
|
50
|
-
}
|
|
51
|
-
) : renderSwitch(field),
|
|
52
|
-
(!!error || helperText) && /* @__PURE__ */ jsx(
|
|
53
|
-
FormHelperText,
|
|
54
|
-
{
|
|
55
|
-
error: !!error,
|
|
56
|
-
sx: (theme) => ({
|
|
57
|
-
mx: "14px",
|
|
58
|
-
color: other.disabled ? theme.palette.grey[500] : void 0
|
|
59
|
-
}),
|
|
60
|
-
children: error ? error?.message : helperText
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
] })
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
var Switch_default = Switch;
|
|
68
|
-
export {
|
|
69
|
-
Switch_default as default
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
+
import C from '@mui/material/FormControlLabel';
|
|
3
|
+
import F from '@mui/material/FormHelperText';
|
|
4
|
+
import S from '@mui/material/Switch';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var g=({name:n,helperText:i,onChange:l,tabIndex:c,size:d,label:s,sx:a,...m})=>{let{control:u}=useFormContext(),p=r=>jsx(S,{...r,checked:r.value,onChange:(o,e)=>{r.onChange(o),l&&l(o,e);},inputProps:{tabIndex:c},size:d,sx:a});return jsx(Controller,{name:n,control:u,render:({field:r,fieldState:{error:o}})=>jsxs("div",{children:[s?jsx(C,{label:s,control:p(r),"data-intercom-target":n,...m}):p(r),(!!o||i)&&jsx(F,{error:!!o,sx:e=>({mx:"14px",color:m.disabled?e.palette.grey[500]:void 0}),children:o?o?.message:i})]})})},V=g;
|
|
8
|
+
|
|
9
|
+
export { V as default };
|
|
@@ -1,64 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
helperText,
|
|
10
|
-
required,
|
|
11
|
-
...other
|
|
12
|
-
}) => {
|
|
13
|
-
const { control } = useFormContext();
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
Controller,
|
|
16
|
-
{
|
|
17
|
-
name,
|
|
18
|
-
control,
|
|
19
|
-
rules,
|
|
20
|
-
render: ({
|
|
21
|
-
field: { ref, onChange, ...field },
|
|
22
|
-
fieldState: { error }
|
|
23
|
-
}) => /* @__PURE__ */ jsx(
|
|
24
|
-
MuiTimePicker,
|
|
25
|
-
{
|
|
26
|
-
ampm: false,
|
|
27
|
-
format: "HH:mm",
|
|
28
|
-
inputRef: ref,
|
|
29
|
-
...field,
|
|
30
|
-
"data-intercom-target": name,
|
|
31
|
-
...other,
|
|
32
|
-
value: field.value ? dayjs(field.value) : null,
|
|
33
|
-
onChange: (v) => {
|
|
34
|
-
const newValue = v ? v.toDate() : null;
|
|
35
|
-
onChange(newValue);
|
|
36
|
-
other.onChange && other.onChange(newValue);
|
|
37
|
-
},
|
|
38
|
-
slotProps: {
|
|
39
|
-
textField: {
|
|
40
|
-
...other.slotProps?.textField,
|
|
41
|
-
error: !!error,
|
|
42
|
-
required,
|
|
43
|
-
helperText: error?.message || helperText,
|
|
44
|
-
autoComplete: "off",
|
|
45
|
-
spellCheck: "false",
|
|
46
|
-
fullWidth: true,
|
|
47
|
-
inputProps: {
|
|
48
|
-
tabIndex
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
openPickerButton: {
|
|
52
|
-
tabIndex
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
var TimePicker_default = TimePicker;
|
|
61
|
-
export {
|
|
62
|
-
TimePicker_default as default
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
+
import { TimePicker } from '@mui/x-date-pickers-pro';
|
|
3
|
+
import d from 'dayjs';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var T=({name:t,rules:a,tabIndex:r,helperText:s,required:p,...e})=>{let{control:u}=useFormContext();return jsx(Controller,{name:t,control:u,rules:a,render:({field:{ref:c,onChange:f,...o},fieldState:{error:l}})=>jsx(TimePicker,{ampm:!1,format:"HH:mm",inputRef:c,...o,"data-intercom-target":t,...e,value:o.value?d(o.value):null,onChange:i=>{let m=i?i.toDate():null;f(m),e.onChange&&e.onChange(m);},slotProps:{textField:{...e.slotProps?.textField,error:!!l,required:p,helperText:l?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:r}},openPickerButton:{tabIndex:r}}})})},F=T;
|
|
7
|
+
|
|
8
|
+
export { F as default };
|
|
@@ -1,59 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Controller,
|
|
22
|
-
{
|
|
23
|
-
name,
|
|
24
|
-
control,
|
|
25
|
-
rules,
|
|
26
|
-
render: ({ field: { value }, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
27
|
-
UploadAvatarWithCropComponent,
|
|
28
|
-
{
|
|
29
|
-
accept: { "image/*": [] },
|
|
30
|
-
file: value ? file : void 0,
|
|
31
|
-
onFileCropped: (v) => {
|
|
32
|
-
uploadFile(v);
|
|
33
|
-
if (onFileCropped)
|
|
34
|
-
onFileCropped(v);
|
|
35
|
-
},
|
|
36
|
-
onImageUploaded,
|
|
37
|
-
onCancel: () => {
|
|
38
|
-
setFileValue(void 0);
|
|
39
|
-
if (onCancel)
|
|
40
|
-
onCancel();
|
|
41
|
-
},
|
|
42
|
-
error: !!error,
|
|
43
|
-
disableMultiple: true,
|
|
44
|
-
helperText: (!!error || helperText) && /* @__PURE__ */ jsx(FormHelperText, { error: !!error, sx: { px: 2 }, children: error ? error?.message : helperText }),
|
|
45
|
-
aspect,
|
|
46
|
-
label,
|
|
47
|
-
image,
|
|
48
|
-
"data-intercom-target": name,
|
|
49
|
-
...other
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
var UploadAvatarWithCrop_default = UploadAvatarWithCrop;
|
|
56
|
-
export {
|
|
57
|
-
UploadAvatarWithCrop_default as default
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { b } from '../../../chunk-BA43A7R3.js';
|
|
2
|
+
import '../../../chunk-4CNAGEPZ.js';
|
|
3
|
+
import '../../../chunk-F7CW3DXN.js';
|
|
4
|
+
import '../../../chunk-QHVL5QNM.js';
|
|
5
|
+
import '../../../chunk-T7I256S6.js';
|
|
6
|
+
import '../../../chunk-ANAHA3L6.js';
|
|
7
|
+
import '../../../chunk-D27ND54J.js';
|
|
8
|
+
import '../../../chunk-PMPALWRO.js';
|
|
9
|
+
import '../../../chunk-3E5A45HM.js';
|
|
10
|
+
import '../../../chunk-KFZEM7KS.js';
|
|
11
|
+
import { a } from '../../../chunk-GA4A5P3S.js';
|
|
12
|
+
import '../../../chunk-M6QHAL4V.js';
|
|
13
|
+
import '../../../chunk-W3MYAMTH.js';
|
|
14
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
15
|
+
import W from '@mui/material/FormHelperText';
|
|
16
|
+
import { jsx } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
var v=({name:e,rules:m,helperText:r,aspect:n,label:f,image:s,onFileCropped:a$1,onImageUploaded:u,onCancel:l,...c})=>{let{control:C}=useFormContext(),{uploadFile:U,file:g,setFileValue:x}=a(e);return jsx(Controller,{name:e,control:C,rules:m,render:({field:{value:F},fieldState:{error:o}})=>jsx(b,{accept:{"image/*":[]},file:F?g:void 0,onFileCropped:p=>{U(p),a$1&&a$1(p);},onImageUploaded:u,onCancel:()=>{x(void 0),l&&l();},error:!!o,disableMultiple:!0,helperText:(!!o||r)&&jsx(W,{error:!!o,sx:{px:2},children:o?o?.message:r}),aspect:n,label:f,image:s,"data-intercom-target":e,...c})})},I=v;
|
|
19
|
+
|
|
20
|
+
export { I as default };
|
|
@@ -1,59 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
control,
|
|
25
|
-
rules,
|
|
26
|
-
render: ({ field: { value }, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
27
|
-
UploadWithCropComponent,
|
|
28
|
-
{
|
|
29
|
-
accept: { "image/*": [] },
|
|
30
|
-
file: value ? file : void 0,
|
|
31
|
-
onFileCropped: (v) => {
|
|
32
|
-
uploadFile(v);
|
|
33
|
-
if (onFileCropped)
|
|
34
|
-
onFileCropped(v);
|
|
35
|
-
},
|
|
36
|
-
onImageUploaded,
|
|
37
|
-
onCancel: () => {
|
|
38
|
-
setFileValue(void 0);
|
|
39
|
-
if (onCancel)
|
|
40
|
-
onCancel();
|
|
41
|
-
},
|
|
42
|
-
error: !!error,
|
|
43
|
-
disableMultiple: true,
|
|
44
|
-
helperText: (!!error || helperText) && /* @__PURE__ */ jsx(FormHelperText, { error: !!error, sx: { px: 2 }, children: error ? error?.message : helperText }),
|
|
45
|
-
aspect,
|
|
46
|
-
label,
|
|
47
|
-
image,
|
|
48
|
-
"data-intercom-target": name,
|
|
49
|
-
...other
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
var UploadWithCrop_default = UploadWithCrop;
|
|
56
|
-
export {
|
|
57
|
-
UploadWithCrop_default as default
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { e } from '../../../chunk-YYKIC4EK.js';
|
|
2
|
+
import '../../../chunk-4CNAGEPZ.js';
|
|
3
|
+
import '../../../chunk-F7CW3DXN.js';
|
|
4
|
+
import '../../../chunk-QHVL5QNM.js';
|
|
5
|
+
import '../../../chunk-T7I256S6.js';
|
|
6
|
+
import '../../../chunk-ANAHA3L6.js';
|
|
7
|
+
import '../../../chunk-YWEB6IAI.js';
|
|
8
|
+
import '../../../chunk-23GJSDGU.js';
|
|
9
|
+
import '../../../chunk-D27ND54J.js';
|
|
10
|
+
import '../../../chunk-PMPALWRO.js';
|
|
11
|
+
import '../../../chunk-3E5A45HM.js';
|
|
12
|
+
import '../../../chunk-ILHUUK4X.js';
|
|
13
|
+
import '../../../chunk-KFZEM7KS.js';
|
|
14
|
+
import { a } from '../../../chunk-GA4A5P3S.js';
|
|
15
|
+
import '../../../chunk-M6QHAL4V.js';
|
|
16
|
+
import '../../../chunk-W3MYAMTH.js';
|
|
17
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
18
|
+
import b from '@mui/material/FormHelperText';
|
|
19
|
+
import { jsx } from 'react/jsx-runtime';
|
|
20
|
+
|
|
21
|
+
var H=({name:e$1,rules:m,helperText:l,aspect:n,label:f,image:s,onFileCropped:p,onImageUploaded:u,onCancel:r,...c})=>{let{control:C}=useFormContext(),{uploadFile:U,file:g,setFileValue:x}=a(e$1);return jsx(Controller,{name:e$1,control:C,rules:m,render:({field:{value:F},fieldState:{error:o}})=>jsx(e,{accept:{"image/*":[]},file:F?g:void 0,onFileCropped:i=>{U(i),p&&p(i);},onImageUploaded:u,onCancel:()=>{x(void 0),r&&r();},error:!!o,disableMultiple:!0,helperText:(!!o||l)&&jsx(b,{error:!!o,sx:{px:2},children:o?o?.message:l}),aspect:n,label:f,image:s,"data-intercom-target":e$1,...c})})},S=H;
|
|
22
|
+
|
|
23
|
+
export { S as default };
|