@gnwebsoft/ui 4.0.21 → 4.0.23
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/package.json +1 -1
- package/dist/chunk-BWEFHFD4.js +0 -2399
- package/dist/chunk-FMN47XRJ.cjs +0 -72
- package/dist/chunk-FYU2OIMD.js +0 -15
- package/dist/chunk-HDL5E7XD.js +0 -523
- package/dist/chunk-LUW7V5GI.cjs +0 -15
- package/dist/chunk-PW777IOX.js +0 -140
- package/dist/chunk-QYHJIPSZ.cjs +0 -140
- package/dist/chunk-RVGPXTBE.js +0 -2535
- package/dist/chunk-T5H5X3VR.js +0 -72
- package/dist/chunk-TQQUGQTW.cjs +0 -2535
- package/dist/chunk-UZ2KNGOF.cjs +0 -523
- package/dist/chunk-W5EM6HLW.cjs +0 -2399
- package/dist/core/api/ApiClient.d.ts +0 -329
- package/dist/core/api/ApiClient.d.ts.map +0 -1
- package/dist/core/api/CorrelationIdGenerator.d.ts +0 -52
- package/dist/core/api/CorrelationIdGenerator.d.ts.map +0 -1
- package/dist/core/api/Errors/ErrorNormalizer.d.ts +0 -106
- package/dist/core/api/Errors/ErrorNormalizer.d.ts.map +0 -1
- package/dist/core/api/Interceptors/InterceptorManager.d.ts +0 -236
- package/dist/core/api/Interceptors/InterceptorManager.d.ts.map +0 -1
- package/dist/core/api/Models/FilterModel.d.ts +0 -22
- package/dist/core/api/Models/FilterModel.d.ts.map +0 -1
- package/dist/core/api/Models/QueryParams.d.ts +0 -13
- package/dist/core/api/Models/QueryParams.d.ts.map +0 -1
- package/dist/core/api/Models/index.d.ts +0 -3
- package/dist/core/api/Models/index.d.ts.map +0 -1
- package/dist/core/api/RequestManager.d.ts +0 -142
- package/dist/core/api/RequestManager.d.ts.map +0 -1
- package/dist/core/api/Retry/RetryHandler.d.ts +0 -100
- package/dist/core/api/Retry/RetryHandler.d.ts.map +0 -1
- package/dist/core/api/Signals/SignalManager.d.ts +0 -153
- package/dist/core/api/Signals/SignalManager.d.ts.map +0 -1
- package/dist/core/api/Utils/ResponseParser.d.ts +0 -105
- package/dist/core/api/Utils/ResponseParser.d.ts.map +0 -1
- package/dist/core/api/Utils/UrlBuilder.d.ts +0 -111
- package/dist/core/api/Utils/UrlBuilder.d.ts.map +0 -1
- package/dist/core/api/createApiClient.d.ts +0 -247
- package/dist/core/api/createApiClient.d.ts.map +0 -1
- package/dist/core/api/index.d.ts +0 -7
- package/dist/core/api/index.d.ts.map +0 -1
- package/dist/core/api/types/ApiError.d.ts +0 -17
- package/dist/core/api/types/ApiError.d.ts.map +0 -1
- package/dist/core/api/types/ApiResponse.d.ts +0 -76
- package/dist/core/api/types/ApiResponse.d.ts.map +0 -1
- package/dist/core/api/types/CancelToken.d.ts +0 -15
- package/dist/core/api/types/CancelToken.d.ts.map +0 -1
- package/dist/core/api/types/ErrorInterceptor.d.ts +0 -3
- package/dist/core/api/types/ErrorInterceptor.d.ts.map +0 -1
- package/dist/core/api/types/ErrorResponseData.d.ts +0 -68
- package/dist/core/api/types/ErrorResponseData.d.ts.map +0 -1
- package/dist/core/api/types/RequestConfig.d.ts +0 -21
- package/dist/core/api/types/RequestConfig.d.ts.map +0 -1
- package/dist/core/api/types/RequestInterceptor.d.ts +0 -3
- package/dist/core/api/types/RequestInterceptor.d.ts.map +0 -1
- package/dist/core/api/types/ResponseInterceptor.d.ts +0 -3
- package/dist/core/api/types/ResponseInterceptor.d.ts.map +0 -1
- package/dist/core/api/types/ValidationErrors.d.ts +0 -7
- package/dist/core/api/types/ValidationErrors.d.ts.map +0 -1
- package/dist/core/api/types/index.d.ts +0 -10
- package/dist/core/api/types/index.d.ts.map +0 -1
- package/dist/core/api/useValidationErrors.d.ts +0 -11
- package/dist/core/api/useValidationErrors.d.ts.map +0 -1
- package/dist/core/components/AuthorizedView/AuthorizedView.d.ts +0 -7
- package/dist/core/components/AuthorizedView/AuthorizedView.d.ts.map +0 -1
- package/dist/core/components/AuthorizedView/index.d.ts +0 -2
- package/dist/core/components/AuthorizedView/index.d.ts.map +0 -1
- package/dist/core/components/CancelButton/CancelButton.d.ts +0 -4
- package/dist/core/components/CancelButton/CancelButton.d.ts.map +0 -1
- package/dist/core/components/CancelButton/index.d.ts +0 -2
- package/dist/core/components/CancelButton/index.d.ts.map +0 -1
- package/dist/core/components/ClearButton/ClearButton.d.ts +0 -63
- package/dist/core/components/ClearButton/ClearButton.d.ts.map +0 -1
- package/dist/core/components/ClearButton/index.d.ts +0 -2
- package/dist/core/components/ClearButton/index.d.ts.map +0 -1
- package/dist/core/components/Containers/SimpleContainer.d.ts +0 -10
- package/dist/core/components/Containers/SimpleContainer.d.ts.map +0 -1
- package/dist/core/components/Containers/index.d.ts +0 -2
- package/dist/core/components/Containers/index.d.ts.map +0 -1
- package/dist/core/components/FilterButton/FilterButton.d.ts +0 -86
- package/dist/core/components/FilterButton/FilterButton.d.ts.map +0 -1
- package/dist/core/components/FilterButton/index.d.ts +0 -2
- package/dist/core/components/FilterButton/index.d.ts.map +0 -1
- package/dist/core/components/FilterDisplay/FilterChip.d.ts +0 -9
- package/dist/core/components/FilterDisplay/FilterChip.d.ts.map +0 -1
- package/dist/core/components/FilterDisplay/FilterDisplay.d.ts +0 -10
- package/dist/core/components/FilterDisplay/FilterDisplay.d.ts.map +0 -1
- package/dist/core/components/FilterDisplay/index.d.ts +0 -3
- package/dist/core/components/FilterDisplay/index.d.ts.map +0 -1
- package/dist/core/components/FilterWrapper/FilterWrapper.d.ts +0 -99
- package/dist/core/components/FilterWrapper/FilterWrapper.d.ts.map +0 -1
- package/dist/core/components/FilterWrapper/index.d.ts +0 -2
- package/dist/core/components/FilterWrapper/index.d.ts.map +0 -1
- package/dist/core/components/Footer/Footer.d.ts +0 -3
- package/dist/core/components/Footer/Footer.d.ts.map +0 -1
- package/dist/core/components/Footer/index.d.ts +0 -2
- package/dist/core/components/Footer/index.d.ts.map +0 -1
- package/dist/core/components/LabelText/LabelText.d.ts +0 -103
- package/dist/core/components/LabelText/LabelText.d.ts.map +0 -1
- package/dist/core/components/LabelText/index.d.ts +0 -2
- package/dist/core/components/LabelText/index.d.ts.map +0 -1
- package/dist/core/components/RenderIf/RenderIf.d.ts +0 -7
- package/dist/core/components/RenderIf/RenderIf.d.ts.map +0 -1
- package/dist/core/components/RenderIf/index.d.ts +0 -2
- package/dist/core/components/RenderIf/index.d.ts.map +0 -1
- package/dist/core/components/SectionBox/SectionBox.d.ts +0 -15
- package/dist/core/components/SectionBox/SectionBox.d.ts.map +0 -1
- package/dist/core/components/SectionBox/index.d.ts +0 -2
- package/dist/core/components/SectionBox/index.d.ts.map +0 -1
- package/dist/core/components/SimpleTabs/SimpleTabs.d.ts +0 -17
- package/dist/core/components/SimpleTabs/SimpleTabs.d.ts.map +0 -1
- package/dist/core/components/SimpleTabs/index.d.ts +0 -2
- package/dist/core/components/SimpleTabs/index.d.ts.map +0 -1
- package/dist/core/components/SubmitButton/SubmitButton.d.ts +0 -6
- package/dist/core/components/SubmitButton/SubmitButton.d.ts.map +0 -1
- package/dist/core/components/SubmitButton/index.d.ts +0 -2
- package/dist/core/components/SubmitButton/index.d.ts.map +0 -1
- package/dist/core/components/WithRef/WithRef.d.ts +0 -14
- package/dist/core/components/WithRef/WithRef.d.ts.map +0 -1
- package/dist/core/components/WithRef/index.d.ts +0 -2
- package/dist/core/components/WithRef/index.d.ts.map +0 -1
- package/dist/core/components/index.d.ts +0 -15
- package/dist/core/components/index.d.ts.map +0 -1
- package/dist/core/config.d.ts +0 -24
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/hooks/index.d.ts +0 -3
- package/dist/core/hooks/index.d.ts.map +0 -1
- package/dist/core/hooks/makeQuery.d.ts +0 -12
- package/dist/core/hooks/makeQuery.d.ts.map +0 -1
- package/dist/core/hooks/useApiClient.d.ts +0 -3
- package/dist/core/hooks/useApiClient.d.ts.map +0 -1
- package/dist/core/hooks/useFormErrorHandler.d.ts +0 -35
- package/dist/core/hooks/useFormErrorHandler.d.ts.map +0 -1
- package/dist/core/hooks/useListView.d.ts +0 -20
- package/dist/core/hooks/useListView.d.ts.map +0 -1
- package/dist/core/index.cjs +0 -123
- package/dist/core/index.d.ts +0 -8
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -123
- package/dist/core/models.d.ts +0 -5
- package/dist/core/models.d.ts.map +0 -1
- package/dist/core/types/FilterLabel.d.ts +0 -6
- package/dist/core/types/FilterLabel.d.ts.map +0 -1
- package/dist/core/types/ListModels.d.ts +0 -18
- package/dist/core/types/ListModels.d.ts.map +0 -1
- package/dist/core/types/OptionsRequest.d.ts +0 -4
- package/dist/core/types/OptionsRequest.d.ts.map +0 -1
- package/dist/core/types/index.d.ts +0 -4
- package/dist/core/types/index.d.ts.map +0 -1
- package/dist/core/utils/CacheUtility/index.d.ts +0 -15
- package/dist/core/utils/CacheUtility/index.d.ts.map +0 -1
- package/dist/core/utils/calculateFilterCount.d.ts +0 -2
- package/dist/core/utils/calculateFilterCount.d.ts.map +0 -1
- package/dist/core/utils/format-time.d.ts +0 -79
- package/dist/core/utils/format-time.d.ts.map +0 -1
- package/dist/core/utils/getEmptyObject.d.ts +0 -7
- package/dist/core/utils/getEmptyObject.d.ts.map +0 -1
- package/dist/core/utils/index.d.ts +0 -7
- package/dist/core/utils/index.d.ts.map +0 -1
- package/dist/core/utils/useStableRowCount.d.ts +0 -9
- package/dist/core/utils/useStableRowCount.d.ts.map +0 -1
- package/dist/core/utils/watch/core.d.ts +0 -22
- package/dist/core/utils/watch/core.d.ts.map +0 -1
- package/dist/core/utils/watch/index.d.ts +0 -49
- package/dist/core/utils/watch/index.d.ts.map +0 -1
- package/dist/core/utils/watch/utilities.d.ts +0 -34
- package/dist/core/utils/watch/utilities.d.ts.map +0 -1
- package/dist/hooks/index.cjs +0 -11
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -11
- package/dist/hooks/useTransform/enhanced.d.ts +0 -133
- package/dist/hooks/useTransform/enhanced.d.ts.map +0 -1
- package/dist/hooks/useTransform/index.d.ts +0 -93
- package/dist/hooks/useTransform/index.d.ts.map +0 -1
- package/dist/index.cjs +0 -265
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -265
- package/dist/types/AsyncMultiSelectPayload.d.ts +0 -5
- package/dist/types/AsyncMultiSelectPayload.d.ts.map +0 -1
- package/dist/types/AsyncSelectPayload.d.ts +0 -5
- package/dist/types/AsyncSelectPayload.d.ts.map +0 -1
- package/dist/types/OperationResponse.d.ts +0 -5
- package/dist/types/OperationResponse.d.ts.map +0 -1
- package/dist/types/OptionItem.d.ts +0 -66
- package/dist/types/OptionItem.d.ts.map +0 -1
- package/dist/types/api.d.ts +0 -127
- package/dist/types/api.d.ts.map +0 -1
- package/dist/types/events.d.ts +0 -74
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/index.cjs +0 -31
- package/dist/types/index.d.ts +0 -14
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -31
- package/dist/types/utilities.d.ts +0 -458
- package/dist/types/utilities.d.ts.map +0 -1
- package/dist/utils/flattenObjectKeys.d.ts +0 -63
- package/dist/utils/flattenObjectKeys.d.ts.map +0 -1
- package/dist/utils/getTimezone.d.ts +0 -4
- package/dist/utils/getTimezone.d.ts.map +0 -1
- package/dist/utils/handleServerErrors.d.ts +0 -70
- package/dist/utils/handleServerErrors.d.ts.map +0 -1
- package/dist/utils/index.cjs +0 -55
- package/dist/utils/index.d.ts +0 -9
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -55
- package/dist/utils/propertyExists.d.ts +0 -35
- package/dist/utils/propertyExists.d.ts.map +0 -1
- package/dist/utils/readValueAsDate.d.ts +0 -4
- package/dist/utils/readValueAsDate.d.ts.map +0 -1
- package/dist/utils/removeLeadingTrailingSlashes.d.ts +0 -2
- package/dist/utils/removeLeadingTrailingSlashes.d.ts.map +0 -1
- package/dist/utils/schemaTools.d.ts +0 -209
- package/dist/utils/schemaTools.d.ts.map +0 -1
- package/dist/utils/typeGuards.d.ts +0 -316
- package/dist/utils/typeGuards.d.ts.map +0 -1
- package/dist/utils/watch/core.d.ts +0 -22
- package/dist/utils/watch/core.d.ts.map +0 -1
- package/dist/utils/watch/index.d.ts +0 -49
- package/dist/utils/watch/index.d.ts.map +0 -1
- package/dist/utils/watch/utilities.d.ts +0 -34
- package/dist/utils/watch/utilities.d.ts.map +0 -1
- package/dist/wrappers/AsyncMultiSelect/AsyncMultiSelect.d.ts +0 -9
- package/dist/wrappers/AsyncMultiSelect/AsyncMultiSelect.d.ts.map +0 -1
- package/dist/wrappers/AsyncMultiSelect/index.d.ts +0 -3
- package/dist/wrappers/AsyncMultiSelect/index.d.ts.map +0 -1
- package/dist/wrappers/AsyncMultiSelect/types.d.ts +0 -19
- package/dist/wrappers/AsyncMultiSelect/types.d.ts.map +0 -1
- package/dist/wrappers/AsyncSelect/index.d.ts +0 -9
- package/dist/wrappers/AsyncSelect/index.d.ts.map +0 -1
- package/dist/wrappers/AsyncSelect/types.d.ts +0 -20
- package/dist/wrappers/AsyncSelect/types.d.ts.map +0 -1
- package/dist/wrappers/Button.d.ts +0 -49
- package/dist/wrappers/Button.d.ts.map +0 -1
- package/dist/wrappers/CheckboxElement/CheckboxElement.d.ts +0 -102
- package/dist/wrappers/CheckboxElement/CheckboxElement.d.ts.map +0 -1
- package/dist/wrappers/CheckboxElement/index.d.ts +0 -3
- package/dist/wrappers/CheckboxElement/index.d.ts.map +0 -1
- package/dist/wrappers/CheckboxElement/types.d.ts +0 -76
- package/dist/wrappers/CheckboxElement/types.d.ts.map +0 -1
- package/dist/wrappers/CheckboxGroup/CheckboxGroup.d.ts +0 -98
- package/dist/wrappers/CheckboxGroup/CheckboxGroup.d.ts.map +0 -1
- package/dist/wrappers/CheckboxGroup/EnhancedCheckboxGroup.d.ts +0 -49
- package/dist/wrappers/CheckboxGroup/EnhancedCheckboxGroup.d.ts.map +0 -1
- package/dist/wrappers/CheckboxGroup/enhanced-types.d.ts +0 -171
- package/dist/wrappers/CheckboxGroup/enhanced-types.d.ts.map +0 -1
- package/dist/wrappers/CheckboxGroup/index.d.ts +0 -3
- package/dist/wrappers/CheckboxGroup/index.d.ts.map +0 -1
- package/dist/wrappers/CheckboxGroup/types.d.ts +0 -106
- package/dist/wrappers/CheckboxGroup/types.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/DatePickerElement.d.ts +0 -131
- package/dist/wrappers/DatePickerElement/DatePickerElement.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/DatePickerElementCore.d.ts +0 -57
- package/dist/wrappers/DatePickerElement/DatePickerElementCore.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/hooks/index.d.ts +0 -24
- package/dist/wrappers/DatePickerElement/hooks/index.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerStyles.d.ts +0 -63
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerStyles.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerValidation.d.ts +0 -79
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerValidation.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerValue.d.ts +0 -73
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerValue.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/index.d.ts +0 -47
- package/dist/wrappers/DatePickerElement/index.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/types.d.ts +0 -183
- package/dist/wrappers/DatePickerElement/types.d.ts.map +0 -1
- package/dist/wrappers/DatePickerElement/utils.d.ts +0 -89
- package/dist/wrappers/DatePickerElement/utils.d.ts.map +0 -1
- package/dist/wrappers/DateTimePickerElement/index.d.ts +0 -1
- package/dist/wrappers/DateTimePickerElement/index.d.ts.map +0 -1
- package/dist/wrappers/DateTimePickerElement/types.d.ts +0 -1
- package/dist/wrappers/DateTimePickerElement/types.d.ts.map +0 -1
- package/dist/wrappers/Field/index.d.ts +0 -42
- package/dist/wrappers/Field/index.d.ts.map +0 -1
- package/dist/wrappers/NumberFieldElement/NumberFieldElement.d.ts +0 -177
- package/dist/wrappers/NumberFieldElement/NumberFieldElement.d.ts.map +0 -1
- package/dist/wrappers/NumberFieldElement/index.d.ts +0 -3
- package/dist/wrappers/NumberFieldElement/index.d.ts.map +0 -1
- package/dist/wrappers/OTPInputElement/HelperText.d.ts +0 -8
- package/dist/wrappers/OTPInputElement/HelperText.d.ts.map +0 -1
- package/dist/wrappers/OTPInputElement/OTPInputElement.d.ts +0 -32
- package/dist/wrappers/OTPInputElement/OTPInputElement.d.ts.map +0 -1
- package/dist/wrappers/OTPInputElement/index.d.ts +0 -3
- package/dist/wrappers/OTPInputElement/index.d.ts.map +0 -1
- package/dist/wrappers/PasswordElement/PasswordElement.d.ts +0 -104
- package/dist/wrappers/PasswordElement/PasswordElement.d.ts.map +0 -1
- package/dist/wrappers/PasswordElement/index.d.ts +0 -2
- package/dist/wrappers/PasswordElement/index.d.ts.map +0 -1
- package/dist/wrappers/RadioButtonGroup/RadioButtonGroup.d.ts +0 -38
- package/dist/wrappers/RadioButtonGroup/RadioButtonGroup.d.ts.map +0 -1
- package/dist/wrappers/RadioButtonGroup/index.d.ts +0 -2
- package/dist/wrappers/RadioButtonGroup/index.d.ts.map +0 -1
- package/dist/wrappers/SelectCascadeElement/SelectCascadeElement.d.ts +0 -22
- package/dist/wrappers/SelectCascadeElement/SelectCascadeElement.d.ts.map +0 -1
- package/dist/wrappers/SelectCascadeElement/index.d.ts +0 -2
- package/dist/wrappers/SelectCascadeElement/index.d.ts.map +0 -1
- package/dist/wrappers/SelectElement/SelectElement.d.ts +0 -93
- package/dist/wrappers/SelectElement/SelectElement.d.ts.map +0 -1
- package/dist/wrappers/SelectElement/index.d.ts +0 -2
- package/dist/wrappers/SelectElement/index.d.ts.map +0 -1
- package/dist/wrappers/SelectMultiElement/SelectMultiElement.d.ts +0 -21
- package/dist/wrappers/SelectMultiElement/SelectMultiElement.d.ts.map +0 -1
- package/dist/wrappers/SelectMultiElement/index.d.ts +0 -2
- package/dist/wrappers/SelectMultiElement/index.d.ts.map +0 -1
- package/dist/wrappers/TextFieldElement/TextFieldElement.d.ts +0 -179
- package/dist/wrappers/TextFieldElement/TextFieldElement.d.ts.map +0 -1
- package/dist/wrappers/TextFieldElement/index.d.ts +0 -3
- package/dist/wrappers/TextFieldElement/index.d.ts.map +0 -1
- package/dist/wrappers/TimePickerElement/TimePickerElement.d.ts +0 -30
- package/dist/wrappers/TimePickerElement/TimePickerElement.d.ts.map +0 -1
- package/dist/wrappers/TimePickerElement/index.d.ts +0 -2
- package/dist/wrappers/TimePickerElement/index.d.ts.map +0 -1
- package/dist/wrappers/index.cjs +0 -59
- package/dist/wrappers/index.d.ts +0 -15
- package/dist/wrappers/index.d.ts.map +0 -1
- package/dist/wrappers/index.js +0 -59
- package/dist/wrappers/types/common.d.ts +0 -87
- package/dist/wrappers/types/common.d.ts.map +0 -1
- package/dist/wrappers/types/index.d.ts +0 -8
- package/dist/wrappers/types/index.d.ts.map +0 -1
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enhanced TypeScript utilities for React Hook Form's useWatch
|
|
3
|
-
*
|
|
4
|
-
* This module provides a comprehensive set of type-safe watch functions
|
|
5
|
-
* with better ergonomics and additional functionality.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { useWatchField, useWatchBoolean, typedWatch } from 'src/utils/watch';
|
|
10
|
-
*
|
|
11
|
-
* // Direct usage (inside React components)
|
|
12
|
-
* const email = useWatchField(control, 'user.email');
|
|
13
|
-
* const isAdmin = useWatchBoolean(control, 'user.isAdmin');
|
|
14
|
-
*
|
|
15
|
-
* // Object-based usage (inside React components)
|
|
16
|
-
* const email = typedWatch.field(control, 'user.email');
|
|
17
|
-
* const isAdmin = typedWatch.boolean(control, 'user.isAdmin');
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export { useWatchForm, useWatchField, useWatchFields } from './core';
|
|
21
|
-
export { useWatchBatch, useWatchDefault, useWatchBoolean, useWatchSelector, useWatchTransform, useWatchDebounced, useWatchConditional, } from './utilities';
|
|
22
|
-
export type { PathArray } from './core';
|
|
23
|
-
/**
|
|
24
|
-
* Organized utilities by use case
|
|
25
|
-
* Provides a convenient object-based API for all watch functions
|
|
26
|
-
*/
|
|
27
|
-
export declare const typedWatch: {
|
|
28
|
-
/** Watch entire form */
|
|
29
|
-
readonly form: <TFieldValues extends import("react-hook-form").FieldValues>(control: import("react-hook-form").Control<TFieldValues>) => import("react-hook-form").DeepPartialSkipArrayKey<TFieldValues>;
|
|
30
|
-
/** Watch single field */
|
|
31
|
-
readonly field: <TFieldValues extends import("react-hook-form").FieldValues, TName extends import("react-hook-form").Path<TFieldValues>>(control: import("react-hook-form").Control<TFieldValues>, name: TName) => import("react-hook-form").PathValue<TFieldValues, TName>;
|
|
32
|
-
/** Watch multiple fields */
|
|
33
|
-
readonly fields: <TFieldValues extends import("react-hook-form").FieldValues, TNames extends ReadonlyArray<import("react-hook-form").Path<TFieldValues>>>(control: import("react-hook-form").Control<TFieldValues>, names: TNames) => Array<import("react-hook-form").PathValue<TFieldValues, TNames[number]>>;
|
|
34
|
-
/** Watch with transformation */
|
|
35
|
-
readonly transform: <TFieldValues extends import("react-hook-form").FieldValues, TName extends import("react-hook-form").Path<TFieldValues>, TOutput>(control: import("react-hook-form").Control<TFieldValues>, name: TName, transform: (value: import("react-hook-form").PathValue<TFieldValues, TName>) => TOutput) => TOutput;
|
|
36
|
-
/** Watch with default value */
|
|
37
|
-
readonly withDefault: <TFieldValues extends import("react-hook-form").FieldValues, TName extends import("react-hook-form").Path<TFieldValues>>(control: import("react-hook-form").Control<TFieldValues>, name: TName, defaultValue: import("react-hook-form").PathValue<TFieldValues, TName>) => import("react-hook-form").PathValue<TFieldValues, TName>;
|
|
38
|
-
/** Watch as boolean */
|
|
39
|
-
readonly boolean: <TFieldValues extends import("react-hook-form").FieldValues, TName extends import("react-hook-form").Path<TFieldValues>>(control: import("react-hook-form").Control<TFieldValues>, name: TName, defaultValue?: boolean) => boolean;
|
|
40
|
-
/** Watch multiple with custom keys */
|
|
41
|
-
readonly batch: <TFieldValues extends import("react-hook-form").FieldValues, TFields extends ReadonlyArray<import("react-hook-form").Path<TFieldValues>>>(control: import("react-hook-form").Control<TFieldValues>, fields: TFields) => { [K in TFields[number]]: import("react-hook-form").PathValue<TFieldValues, K>; };
|
|
42
|
-
/** Watch conditionally */
|
|
43
|
-
readonly conditional: <TFieldValues extends import("react-hook-form").FieldValues, TName extends import("react-hook-form").Path<TFieldValues>>(control: import("react-hook-form").Control<TFieldValues>, name: TName, shouldWatch: boolean, fallback?: import("react-hook-form").PathValue<TFieldValues, TName>) => import("react-hook-form").PathValue<TFieldValues, TName> | undefined;
|
|
44
|
-
/** Watch with debouncing */
|
|
45
|
-
readonly debounced: <TFieldValues extends import("react-hook-form").FieldValues, TName extends import("react-hook-form").Path<TFieldValues>>(control: import("react-hook-form").Control<TFieldValues>, name: TName, delay?: number) => import("react-hook-form").PathValue<TFieldValues, TName>;
|
|
46
|
-
/** Watch with selector */
|
|
47
|
-
readonly selector: <TFieldValues extends import("react-hook-form").FieldValues, TName extends import("react-hook-form").Path<TFieldValues>, TOutput>(control: import("react-hook-form").Control<TFieldValues>, name: TName, selector: (value: import("react-hook-form").PathValue<TFieldValues, TName>) => TOutput, deps?: React.DependencyList) => TOutput;
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/watch/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGrE,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAcxC;;;GAGG;AACH,eAAO,MAAM,UAAU;IAErB,wBAAwB;;IAExB,yBAAyB;;IAEzB,4BAA4B;;IAI5B,gCAAgC;;IAEhC,+BAA+B;;IAE/B,uBAAuB;;IAEvB,sCAAsC;;IAEtC,0BAA0B;;IAE1B,4BAA4B;;IAE5B,0BAA0B;;CAElB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Path, Control, PathValue, FieldValues } from "react-hook-form";
|
|
2
|
-
/**
|
|
3
|
-
* Utility watch functions for React Hook Form
|
|
4
|
-
* Enhanced functionality for specific use cases
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Watch field with transformation/selector
|
|
8
|
-
*/
|
|
9
|
-
export declare const useWatchTransform: <TFieldValues extends FieldValues, TName extends Path<TFieldValues>, TOutput>(control: Control<TFieldValues>, name: TName, transform: (value: PathValue<TFieldValues, TName>) => TOutput) => TOutput;
|
|
10
|
-
/**
|
|
11
|
-
* Watch field with default fallback value
|
|
12
|
-
*/
|
|
13
|
-
export declare const useWatchDefault: <TFieldValues extends FieldValues, TName extends Path<TFieldValues>>(control: Control<TFieldValues>, name: TName, defaultValue: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
14
|
-
/**
|
|
15
|
-
* Watch field as boolean with guaranteed boolean return
|
|
16
|
-
*/
|
|
17
|
-
export declare const useWatchBoolean: <TFieldValues extends FieldValues, TName extends Path<TFieldValues>>(control: Control<TFieldValues>, name: TName, defaultValue?: boolean) => boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Watch multiple fields and return an object with field paths as keys
|
|
20
|
-
*/
|
|
21
|
-
export declare const useWatchBatch: <TFieldValues extends FieldValues, TFields extends ReadonlyArray<Path<TFieldValues>>>(control: Control<TFieldValues>, fields: TFields) => { [K in TFields[number]]: PathValue<TFieldValues, K>; };
|
|
22
|
-
/**
|
|
23
|
-
* Watch field conditionally based on boolean flag
|
|
24
|
-
*/
|
|
25
|
-
export declare const useWatchConditional: <TFieldValues extends FieldValues, TName extends Path<TFieldValues>>(control: Control<TFieldValues>, name: TName, shouldWatch: boolean, fallback?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName> | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Watch field with debounced updates
|
|
28
|
-
*/
|
|
29
|
-
export declare const useWatchDebounced: <TFieldValues extends FieldValues, TName extends Path<TFieldValues>>(control: Control<TFieldValues>, name: TName, delay?: number) => PathValue<TFieldValues, TName>;
|
|
30
|
-
/**
|
|
31
|
-
* Watch field with memoized selector function
|
|
32
|
-
*/
|
|
33
|
-
export declare const useWatchSelector: <TFieldValues extends FieldValues, TName extends Path<TFieldValues>, TOutput>(control: Control<TFieldValues>, name: TName, selector: (value: PathValue<TFieldValues, TName>) => TOutput, deps?: React.DependencyList) => TOutput;
|
|
34
|
-
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../src/utils/watch/utilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EACJ,OAAO,EACP,SAAS,EACT,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAGzB;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,SAAS,WAAW,EAChC,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,EAChC,OAAO,EAEP,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,MAAM,KAAK,EACX,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,KAAK,OAAO,KAC5D,OAIF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,YAAY,SAAS,WAAW,EAChC,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,EAEhC,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,MAAM,KAAK,EACX,cAAc,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,KAC3C,SAAS,CAAC,YAAY,EAAE,KAAK,CAI/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,YAAY,SAAS,WAAW,EAChC,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,EAEhC,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,MAAM,KAAK,EACX,sBAAoB,KACnB,OAIF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,YAAY,SAAS,WAAW,EAChC,OAAO,SAAS,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAEjD,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,QAAQ,OAAO,KACd,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC,GAYtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,YAAY,SAAS,WAAW,EAChC,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,EAEhC,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,MAAM,KAAK,EACX,aAAa,OAAO,EACpB,WAAW,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,KACxC,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,SAQnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,SAAS,WAAW,EAChC,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,EAEhC,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,MAAM,KAAK,EACX,cAAW,KACV,SAAS,CAAC,YAAY,EAAE,KAAK,CAa/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,YAAY,SAAS,WAAW,EAChC,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,EAChC,OAAO,EAEP,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,MAAM,KAAK,EACX,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,KAAK,OAAO,EAC5D,OAAM,KAAK,CAAC,cAAmB,KAC9B,OAOF,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
-
import type { AsyncMultiSelectElementProps, OptionObject } from './types';
|
|
4
|
-
declare const AsyncSelectMultiElement: {
|
|
5
|
-
<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValueKey extends string = "Value", TLabelKey extends string = "Label", TOption extends OptionObject<TValueKey, TLabelKey> = OptionObject<TValueKey, TLabelKey>>({ gridProps, ...props }: AsyncMultiSelectElementProps<TFieldValues, TName, TValueKey, TLabelKey, TOption>): React.ReactElement;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export { AsyncSelectMultiElement };
|
|
9
|
-
//# sourceMappingURL=AsyncMultiSelect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncMultiSelect.d.ts","sourceRoot":"","sources":["../../../src/wrappers/AsyncMultiSelect/AsyncMultiSelect.tsx"],"names":[],"mappings":"AAUA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA8T1E,QAAA,MAAM,uBAAuB;KAC3B,YAAY,SAAS,WAAW,gBAChC,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,4BACrC,SAAS,SAAS,MAAM,YACxB,SAAS,SAAS,MAAM,YACxB,OAAO,SAAS,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,gEAOjD,4BAA4B,CAC7B,YAAY,EACZ,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,CACR,GAAG,KAAK,CAAC,YAAY;;CAgBrB,CAAC;AAIF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wrappers/AsyncMultiSelect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,YAAY,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AutocompleteProps, ChipTypeMap, GridProps, TextFieldVariants } from '@mui/material';
|
|
2
|
-
import type { Control, FieldPath, FieldValues, Path } from 'react-hook-form';
|
|
3
|
-
import type { AsyncMultiSelectPayload } from '@/types';
|
|
4
|
-
type PrimitiveValue = string | number | boolean;
|
|
5
|
-
export type OptionObject<TValueKey extends string = string, TLabelKey extends string = string> = Record<TValueKey, PrimitiveValue> & Record<TLabelKey, string>;
|
|
6
|
-
export type AsyncMultiSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = Path<TFieldValues>, TValueKey extends string = 'Value', TLabelKey extends string = 'Label', TOption extends OptionObject<TValueKey, TLabelKey> = OptionObject<TValueKey, TLabelKey>, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent']> = Omit<AutocompleteProps<TOption, true, DisableClearable, FreeSolo, ChipComponent>, 'name' | 'control' | 'ref' | 'multiple' | 'loading' | 'getOptionLabel' | 'getOptionKey' | 'isOptionEqualToValue' | 'options' | 'value' | 'filterSelectedOptions' | 'filterOptions' | 'onChange' | 'onInputChange' | 'renderInput'> & {
|
|
7
|
-
name: TName;
|
|
8
|
-
control?: Control<TFieldValues>;
|
|
9
|
-
gridProps?: GridProps;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
initialValues?: Array<TOption[TValueKey]> | null;
|
|
13
|
-
queryFn: (data: AsyncMultiSelectPayload) => Promise<TOption[] | undefined>;
|
|
14
|
-
variant?: TextFieldVariants;
|
|
15
|
-
labelField?: TLabelKey;
|
|
16
|
-
valueField?: TValueKey;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/wrappers/AsyncMultiSelect/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAGvD,KAAK,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAGhD,MAAM,MAAM,YAAY,CACtB,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,SAAS,SAAS,MAAM,GAAG,MAAM,IAC/B,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,4BAA4B,CACtC,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,EAC1D,SAAS,SAAS,MAAM,GAAG,OAAO,EAClC,SAAS,SAAS,MAAM,GAAG,OAAO,EAClC,OAAO,SAAS,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,YAAY,CAC/D,SAAS,EACT,SAAS,CACV,EACD,gBAAgB,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EAC5C,aAAa,SAAS,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,kBAAkB,CAAC,IACvE,IAAI,CACN,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,CAAC,EACzE,MAAM,GACN,SAAS,GACT,KAAK,GACL,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,sBAAsB,GACtB,SAAS,GACT,OAAO,GACP,uBAAuB,GACvB,eAAe,GACf,UAAU,GACV,eAAe,GACf,aAAa,CAChB,GAAG;IACF,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC;IACjD,OAAO,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC;IAC3E,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type FieldPath, type FieldValues } from 'react-hook-form';
|
|
3
|
-
import type { AsyncSelectElementProps, OptionObject } from './types';
|
|
4
|
-
declare const AsyncSelectElement: {
|
|
5
|
-
<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValueKey extends string = "Value", TLabelKey extends string = "Label", TOption extends OptionObject<TValueKey, TLabelKey> = OptionObject<TValueKey, TLabelKey>>({ gridProps, ...props }: AsyncSelectElementProps<TFieldValues, TName, TValueKey, TLabelKey, TOption>): React.ReactElement;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export { AsyncSelectElement };
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wrappers/AsyncSelect/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAwSrE,QAAA,MAAM,kBAAkB;KACtB,YAAY,SAAS,WAAW,gBAChC,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,4BACrC,SAAS,SAAS,MAAM,YACxB,SAAS,SAAS,MAAM,YACxB,OAAO,SAAS,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,gEAOjD,uBAAuB,CACxB,YAAY,EACZ,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,CACR,GAAG,KAAK,CAAC,YAAY;;CAQrB,CAAC;AAIF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { GridProps, ChipTypeMap, AutocompleteProps, TextFieldVariants } from '@mui/material';
|
|
2
|
-
import type { Path, Control, FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
-
import type { AsyncSelectPayload } from '@/types';
|
|
4
|
-
type PrimitiveValue = string | number | boolean;
|
|
5
|
-
export type OptionObject<TValueKey extends string = string, TLabelKey extends string = string> = Record<TValueKey, PrimitiveValue> & Record<TLabelKey, string>;
|
|
6
|
-
export type AsyncSelectElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = Path<TFieldValues>, TValueKey extends string = 'Value', TLabelKey extends string = 'Label', TOption extends OptionObject<TValueKey, TLabelKey> = OptionObject<TValueKey, TLabelKey>, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent']> = Omit<AutocompleteProps<TOption, Multiple, DisableClearable, FreeSolo, ChipComponent>, 'name' | 'control' | 'ref' | 'multiple' | 'loading' | 'getOptionLabel' | 'getOptionKey' | 'isOptionEqualToValue' | 'options' | 'value' | 'filterSelectedOptions' | 'filterOptions' | 'onChange' | 'onInputChange' | 'renderInput'> & {
|
|
7
|
-
name: TName;
|
|
8
|
-
control?: Control<TFieldValues>;
|
|
9
|
-
gridProps?: GridProps;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
initialValue?: TOption[TValueKey] | null;
|
|
13
|
-
queryFn: (data: AsyncSelectPayload) => Promise<TOption[] | undefined>;
|
|
14
|
-
isNullable?: boolean;
|
|
15
|
-
variant?: TextFieldVariants;
|
|
16
|
-
labelField?: TLabelKey;
|
|
17
|
-
valueField?: TValueKey;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/wrappers/AsyncSelect/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,KAAK,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAGhD,MAAM,MAAM,YAAY,CACtB,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,SAAS,SAAS,MAAM,GAAG,MAAM,IAC/B,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,uBAAuB,CACjC,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,EAC1D,SAAS,SAAS,MAAM,GAAG,OAAO,EAClC,SAAS,SAAS,MAAM,GAAG,OAAO,EAClC,OAAO,SAAS,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,YAAY,CAC/D,SAAS,EACT,SAAS,CACV,EACD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EAC5C,gBAAgB,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,KAAK,EAC5C,aAAa,SAAS,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,kBAAkB,CAAC,IACvE,IAAI,CACN,iBAAiB,CACf,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,aAAa,CACd,EACC,MAAM,GACN,SAAS,GACT,KAAK,GACL,UAAU,GACV,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,sBAAsB,GACtB,SAAS,GACT,OAAO,GACP,uBAAuB,GACvB,eAAe,GACf,UAAU,GACV,eAAe,GACf,aAAa,CAChB,GAAG;IACF,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACzC,OAAO,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ButtonTypeMap } from "@mui/material";
|
|
2
|
-
import type { OverrideProps } from "@mui/material/OverridableComponent";
|
|
3
|
-
/**
|
|
4
|
-
* Props for the SimpleButton component
|
|
5
|
-
*
|
|
6
|
-
* @template RootComponent - The root component type
|
|
7
|
-
* @template AdditionalProps - Additional props type
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export type SimpleButtonProps<RootComponent extends React.ElementType = ButtonTypeMap["defaultComponent"], AdditionalProps = Record<string, never>> = OverrideProps<ButtonTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
|
12
|
-
/**
|
|
13
|
-
* Custom component to render instead of button
|
|
14
|
-
*/
|
|
15
|
-
component?: React.ElementType;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to show the button
|
|
18
|
-
* @defaultValue true
|
|
19
|
-
*/
|
|
20
|
-
show?: boolean;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* A simple wrapper around MUI Button with conditional rendering support
|
|
24
|
-
*
|
|
25
|
-
* This component extends MUI's Button with an optional `show` prop for conditional rendering.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* Basic usage:
|
|
29
|
-
* ```tsx
|
|
30
|
-
* <SimpleButton variant="contained" color="primary">
|
|
31
|
-
* Click Me
|
|
32
|
-
* </SimpleButton>
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* Conditional rendering:
|
|
37
|
-
* ```tsx
|
|
38
|
-
* <SimpleButton show={hasPermission} variant="contained" onClick={handleSave}>
|
|
39
|
-
* Save
|
|
40
|
-
* </SimpleButton>
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @param props - Button props
|
|
44
|
-
* @returns MUI Button component or null if show is false
|
|
45
|
-
*
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
48
|
-
export declare const SimpleButton: (props: SimpleButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
49
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/wrappers/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,CAC3B,aAAa,SAAS,KAAK,CAAC,WAAW,GAAG,aAAa,CAAC,kBAAkB,CAAC,EAC3E,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IACrC,aAAa,CACf,aAAa,CAAC,eAAe,EAAE,aAAa,CAAC,EAC7C,aAAa,CACd,GAAG;IACF;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,YAAY,GAAyB,OAAO,iBAAiB,mDAQzE,CAAC"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
2
|
-
import type { CheckboxElementProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* A react-hook-form integrated Checkbox component with automatic validation and grid layout.
|
|
5
|
-
*
|
|
6
|
-
* This component provides a fully integrated checkbox input that works seamlessly with react-hook-form,
|
|
7
|
-
* including automatic validation, error handling, value transformation, and optional Grid wrapper for responsive layouts.
|
|
8
|
-
*
|
|
9
|
-
* Features:
|
|
10
|
-
* - Full react-hook-form integration with useController
|
|
11
|
-
* - Automatic error display with custom parsing support
|
|
12
|
-
* - Value transformation with useTransform hook for boolean values
|
|
13
|
-
* - Customizable label and positioning
|
|
14
|
-
* - Grid layout wrapper with responsive design
|
|
15
|
-
* - TypeScript type safety with generic constraints
|
|
16
|
-
* - Disabled state support with proper theming
|
|
17
|
-
* - Helper text support for additional context
|
|
18
|
-
* - Custom error parsing for internationalization
|
|
19
|
-
* - Simple boolean value handling with optional custom transforms
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* Basic usage:
|
|
23
|
-
* ```tsx
|
|
24
|
-
* <CheckboxElement
|
|
25
|
-
* control={control}
|
|
26
|
-
* name="acceptTerms"
|
|
27
|
-
* label="I agree to the terms and conditions"
|
|
28
|
-
* />
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* With validation and helper text:
|
|
33
|
-
* ```tsx
|
|
34
|
-
* <CheckboxElement
|
|
35
|
-
* control={control}
|
|
36
|
-
* name="newsletter"
|
|
37
|
-
* label="Subscribe to newsletter"
|
|
38
|
-
* helperText="You can unsubscribe at any time"
|
|
39
|
-
* rules={{ required: 'Please accept to continue' }}
|
|
40
|
-
* />
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* Custom grid layout and styling:
|
|
45
|
-
* ```tsx
|
|
46
|
-
* <CheckboxElement
|
|
47
|
-
* control={control}
|
|
48
|
-
* name="isPublic"
|
|
49
|
-
* label="Make this public"
|
|
50
|
-
* gridProps={{ size: { xs: 12, md: 6 } }}
|
|
51
|
-
* labelProps={{ sx: { fontWeight: 'bold' } }}
|
|
52
|
-
* sx={{ color: 'primary.main' }}
|
|
53
|
-
* />
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* With value transformation (string to boolean):
|
|
58
|
-
* ```tsx
|
|
59
|
-
* <CheckboxElement
|
|
60
|
-
* control={control}
|
|
61
|
-
* name="status"
|
|
62
|
-
* label="Active"
|
|
63
|
-
* transform={{
|
|
64
|
-
* input: (value) => value === 'active',
|
|
65
|
-
* output: (checked) => checked ? 'active' : 'inactive'
|
|
66
|
-
* }}
|
|
67
|
-
* />
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* Simple boolean field:
|
|
72
|
-
* ```tsx
|
|
73
|
-
* <CheckboxElement
|
|
74
|
-
* control={control}
|
|
75
|
-
* name="isEnabled"
|
|
76
|
-
* label="Enable feature"
|
|
77
|
-
* />
|
|
78
|
-
* ```
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* Custom error parsing for internationalization:
|
|
82
|
-
* ```tsx
|
|
83
|
-
* <CheckboxElement
|
|
84
|
-
* control={control}
|
|
85
|
-
* name="terms"
|
|
86
|
-
* label="Accept Terms"
|
|
87
|
-
* parseError={(error) => t(`validation.${error.type}`, { field: 'Terms' })}
|
|
88
|
-
* />
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* @template TFieldValues - The form values type
|
|
92
|
-
* @template TName - The field name type
|
|
93
|
-
*
|
|
94
|
-
* @param props - Component props
|
|
95
|
-
* @returns React element with optional Grid wrapper
|
|
96
|
-
*
|
|
97
|
-
* @public
|
|
98
|
-
*/
|
|
99
|
-
declare const CheckboxElement: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ gridProps, ...props }: CheckboxElementProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
100
|
-
export { CheckboxElement };
|
|
101
|
-
export type { CheckboxElementProps } from './types';
|
|
102
|
-
//# sourceMappingURL=CheckboxElement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxElement.d.ts","sourceRoot":"","sources":["../../../src/wrappers/CheckboxElement/CheckboxElement.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAa,MAAM,iBAAiB,CAAC;AAKzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAyGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,QAAA,MAAM,eAAe,GACnB,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,yBAGC,oBAAoB,CAAC,YAAY,EAAE,KAAK,CAAC,4CAM3C,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wrappers/CheckboxElement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { CheckboxProps, FormControlLabelProps, GridProps } from "@mui/material";
|
|
2
|
-
import type { ReactNode } from "react";
|
|
3
|
-
import type { Control, FieldError, FieldPath, FieldValues, PathValue } from "react-hook-form";
|
|
4
|
-
/**
|
|
5
|
-
* Props for the CheckboxElement component.
|
|
6
|
-
*
|
|
7
|
-
* @template TFieldValues - The form values type
|
|
8
|
-
* @template TName - The field name type
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export interface CheckboxElementProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<CheckboxProps, "name" | "checked" | "value" | "onChange"> {
|
|
13
|
-
/**
|
|
14
|
-
* The field name in the form
|
|
15
|
-
* @example "acceptTerms" | "user.isActive"
|
|
16
|
-
*/
|
|
17
|
-
name: TName;
|
|
18
|
-
/**
|
|
19
|
-
* The form control instance from react-hook-form
|
|
20
|
-
*/
|
|
21
|
-
control?: Control<TFieldValues>;
|
|
22
|
-
/**
|
|
23
|
-
* Label text to display next to the checkbox
|
|
24
|
-
* @example "I agree to the terms and conditions"
|
|
25
|
-
*/
|
|
26
|
-
label?: FormControlLabelProps["label"];
|
|
27
|
-
/**
|
|
28
|
-
* Additional props for the FormControlLabel component
|
|
29
|
-
*/
|
|
30
|
-
labelProps?: Omit<FormControlLabelProps, "label" | "control">;
|
|
31
|
-
/**
|
|
32
|
-
* Grid layout props for the wrapper Grid component
|
|
33
|
-
* @defaultValue { size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 } }
|
|
34
|
-
*/
|
|
35
|
-
gridProps?: GridProps;
|
|
36
|
-
/**
|
|
37
|
-
* Helper text to display below the checkbox
|
|
38
|
-
*/
|
|
39
|
-
helperText?: ReactNode;
|
|
40
|
-
/**
|
|
41
|
-
* Custom error parser function
|
|
42
|
-
* @param error - The field error from react-hook-form
|
|
43
|
-
* @returns Formatted error message
|
|
44
|
-
*/
|
|
45
|
-
parseError?: (error: FieldError) => ReactNode;
|
|
46
|
-
/**
|
|
47
|
-
* Value transformation functions for custom data handling.
|
|
48
|
-
*
|
|
49
|
-
* The component expects boolean values by default.
|
|
50
|
-
* Use transform functions for custom conversion logic when working with non-boolean form data.
|
|
51
|
-
*/
|
|
52
|
-
transform?: {
|
|
53
|
-
/**
|
|
54
|
-
* Transform the field value for display in the checkbox.
|
|
55
|
-
* If not provided, the value is converted to boolean using !!value.
|
|
56
|
-
* @param value - The current field value
|
|
57
|
-
* @returns The transformed boolean value for checkbox display
|
|
58
|
-
*/
|
|
59
|
-
input?: (value: PathValue<TFieldValues, TName>) => boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Transform the checkbox change event back to the desired field value.
|
|
62
|
-
* If not provided, the boolean checked state is used directly.
|
|
63
|
-
* @param event - The checkbox change event
|
|
64
|
-
* @param checked - The new checked state
|
|
65
|
-
* @returns The transformed value to store in the form
|
|
66
|
-
*/
|
|
67
|
-
output?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => PathValue<TFieldValues, TName>;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Custom onChange handler that works alongside the form controller
|
|
71
|
-
* @param event - The checkbox change event
|
|
72
|
-
* @param checked - The new checked state
|
|
73
|
-
*/
|
|
74
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/wrappers/CheckboxElement/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,SAAS,EACV,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACV,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB,CACnC,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,CAC/D,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IACtE;;;OAGG;IACH,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAEhC;;;OAGG;IACH,KAAK,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC;IAE9D;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC;IAE9C;;;;;OAKG;IACH,SAAS,CAAC,EAAE;QACV;;;;;WAKG;QACH,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,KAAK,OAAO,CAAC;QAC3D;;;;;;WAMG;QACH,MAAM,CAAC,EAAE,CACP,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAC1C,OAAO,EAAE,OAAO,KACb,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;KACrC,CAAC;IAEF;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAEnF"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { CheckboxProps, FormControlLabelProps, FormLabelProps, GridProps } from '@mui/material';
|
|
2
|
-
import type { Control, FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
-
/**
|
|
4
|
-
* Props for the CheckboxGroup component
|
|
5
|
-
*
|
|
6
|
-
* @template TFieldValues - The form values type
|
|
7
|
-
* @template TName - The field name type
|
|
8
|
-
* @template TValue - The value array type
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
type PrimitiveValue = string | number | boolean;
|
|
13
|
-
type OptionObject<TValueKey extends string = string, TLabelKey extends string = string, TDisabledKey extends string = string> = Record<TValueKey, PrimitiveValue> & Record<TLabelKey, string> & Partial<Record<TDisabledKey, boolean>>;
|
|
14
|
-
export type CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject<TValueKey, TLabelKey, TDisabledKey> = OptionObject, TValueKey extends string = 'Value', TLabelKey extends string = 'Label', TDisabledKey extends string = 'disabled'> = Omit<CheckboxProps, 'name'> & {
|
|
15
|
-
/**
|
|
16
|
-
* The field name in the form
|
|
17
|
-
*/
|
|
18
|
-
name: TName;
|
|
19
|
-
/**
|
|
20
|
-
* The form control instance from react-hook-form
|
|
21
|
-
*/
|
|
22
|
-
control?: Control<TFieldValues>;
|
|
23
|
-
/**
|
|
24
|
-
* Label for the checkbox group
|
|
25
|
-
*/
|
|
26
|
-
label?: FormControlLabelProps['label'];
|
|
27
|
-
/**
|
|
28
|
-
* Additional props for FormControlLabel
|
|
29
|
-
*/
|
|
30
|
-
labelProps?: Omit<FormControlLabelProps, 'label' | 'control'>;
|
|
31
|
-
/**
|
|
32
|
-
* Grid layout props for the wrapper
|
|
33
|
-
* @defaultValue { size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 } }
|
|
34
|
-
*/
|
|
35
|
-
gridProps?: GridProps;
|
|
36
|
-
options: TOption[];
|
|
37
|
-
required?: boolean;
|
|
38
|
-
formLabelProps?: Omit<FormLabelProps, 'required' | 'error'>;
|
|
39
|
-
labelKey?: TLabelKey;
|
|
40
|
-
valueKey?: TValueKey;
|
|
41
|
-
disabledKey?: TDisabledKey;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* A react-hook-form integrated CheckboxGroup component for multiple checkbox selection.
|
|
45
|
-
*
|
|
46
|
-
* This component provides a group of checkboxes that work seamlessly with react-hook-form,
|
|
47
|
-
* managing an array of selected values with automatic validation and error handling.
|
|
48
|
-
*
|
|
49
|
-
* Features:
|
|
50
|
-
* - Full react-hook-form integration
|
|
51
|
-
* - Multiple checkbox selection with array value management
|
|
52
|
-
* - Automatic error display
|
|
53
|
-
* - Grid layout wrapper
|
|
54
|
-
* - TypeScript type safety
|
|
55
|
-
* - Disabled state support
|
|
56
|
-
* - NaN validation for numeric values
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* Basic usage:
|
|
60
|
-
* ```tsx
|
|
61
|
-
* <CheckboxGroup
|
|
62
|
-
* control={control}
|
|
63
|
-
* name="selectedCategories"
|
|
64
|
-
* options={[
|
|
65
|
-
* { Value: 1, Label: 'Category 1' },
|
|
66
|
-
* { Value: 2, Label: 'Category 2' },
|
|
67
|
-
* { Value: 3, Label: 'Category 3' },
|
|
68
|
-
* ]}
|
|
69
|
-
* />
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* With custom grid layout:
|
|
74
|
-
* ```tsx
|
|
75
|
-
* <CheckboxGroup
|
|
76
|
-
* control={control}
|
|
77
|
-
* name="permissions"
|
|
78
|
-
* options={permissionOptions}
|
|
79
|
-
* gridProps={{ size: { xs: 12, md: 6 } }}
|
|
80
|
-
* disabled={!hasEditPermission}
|
|
81
|
-
* />
|
|
82
|
-
* ```
|
|
83
|
-
*
|
|
84
|
-
* @template TFieldValues - The form values type
|
|
85
|
-
* @template TName - The field name type
|
|
86
|
-
* @template TValue - The value array type
|
|
87
|
-
*
|
|
88
|
-
* @param props - Component props
|
|
89
|
-
* @returns React element with optional Grid wrapper
|
|
90
|
-
*
|
|
91
|
-
* @public
|
|
92
|
-
*/
|
|
93
|
-
declare const CheckboxGroupElement: {
|
|
94
|
-
<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject<TValueKey, TLabelKey, TDisabledKey> = OptionObject<string, string, string>, TValueKey extends string = "Value", TLabelKey extends string = "Label", TDisabledKey extends string = "disabled">({ gridProps, ...props }: CheckboxGroupProps<TFieldValues, TName, TOption, TValueKey, TLabelKey, TDisabledKey>): import("react/jsx-runtime").JSX.Element;
|
|
95
|
-
displayName: string;
|
|
96
|
-
};
|
|
97
|
-
export { CheckboxGroupElement };
|
|
98
|
-
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../src/wrappers/CheckboxGroup/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,SAAS,EACV,MAAM,eAAe,CAAC;AAYvB,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGvE;;;;;;;;GAQG;AAGH,KAAK,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAGhD,KAAK,YAAY,CACf,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,YAAY,SAAS,MAAM,GAAG,MAAM,IAClC,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,GACnC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GACzB,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;AAEzC,MAAM,MAAM,kBAAkB,CAC5B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,OAAO,SAAS,YAAY,CAC1B,SAAS,EACT,SAAS,EACT,YAAY,CACb,GAAG,YAAY,EAChB,SAAS,SAAS,MAAM,GAAG,OAAO,EAClC,SAAS,SAAS,MAAM,GAAG,OAAO,EAClC,YAAY,SAAS,MAAM,GAAG,UAAU,IACtC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG;IAChC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAEhC;;OAEG;IACH,KAAK,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAEvC;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC;IAE9D;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;IAE5D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,WAAW,CAAC,EAAE,YAAY,CAAC;CAC5B,CAAC;AA6GF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,QAAA,MAAM,oBAAoB;KACxB,YAAY,SAAS,WAAW,gBAChC,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,4BACrC,OAAO,SAAS,YAAY,CAC1B,SAAS,EACT,SAAS,EACT,YAAY,CACb,yCACD,SAAS,SAAS,MAAM,YACxB,SAAS,SAAS,MAAM,YACxB,YAAY,SAAS,MAAM,wCAI1B,kBAAkB,CACnB,YAAY,EACZ,KAAK,EACL,OAAO,EACP,SAAS,EACT,SAAS,EACT,YAAY,CACb;;CAMA,CAAC;AAIF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { FieldPath, FieldValues } from "react-hook-form";
|
|
2
|
-
import type { EnhancedCheckboxGroupProps, CheckboxValue, OptionConstraint } from "./enhanced-types";
|
|
3
|
-
/**
|
|
4
|
-
* Enhanced CheckboxGroup with maximum type safety and IDE intellisense.
|
|
5
|
-
*
|
|
6
|
-
* Key features:
|
|
7
|
-
* - Full type inference from option array
|
|
8
|
-
* - Constrains field value type to match option value types
|
|
9
|
-
* - Supports both string and number option values
|
|
10
|
-
* - Excellent IDE autocomplete and error detection
|
|
11
|
-
* - Maintains runtime type safety
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* String values:
|
|
15
|
-
* ```tsx
|
|
16
|
-
* const options = [
|
|
17
|
-
* { id: "react", name: "React" },
|
|
18
|
-
* { id: "vue", name: "Vue" },
|
|
19
|
-
* { id: "angular", name: "Angular" }
|
|
20
|
-
* ];
|
|
21
|
-
*
|
|
22
|
-
* <EnhancedCheckboxGroup
|
|
23
|
-
* name="frameworks" // field must be string[]
|
|
24
|
-
* options={options}
|
|
25
|
-
* valueField="id"
|
|
26
|
-
* labelField="name"
|
|
27
|
-
* />
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* Number values:
|
|
32
|
-
* ```tsx
|
|
33
|
-
* const priorities = [
|
|
34
|
-
* { value: 1, label: "High" },
|
|
35
|
-
* { value: 2, label: "Medium" },
|
|
36
|
-
* { value: 3, label: "Low" }
|
|
37
|
-
* ];
|
|
38
|
-
*
|
|
39
|
-
* <EnhancedCheckboxGroup
|
|
40
|
-
* name="priorities" // field must be number[]
|
|
41
|
-
* options={priorities}
|
|
42
|
-
* />
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare const EnhancedCheckboxGroup: {
|
|
46
|
-
<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionConstraint<CheckboxValue, TValueKey, TLabelKey, TDisabledKey> = OptionConstraint, TValueKey extends keyof TOption & string = "value", TLabelKey extends keyof TOption & string = "label", TDisabledKey extends keyof TOption & string = "disabled">({ gridProps, ...props }: EnhancedCheckboxGroupProps<TFieldValues, TName, TOption, TValueKey, TLabelKey, TDisabledKey>): import("react/jsx-runtime").JSX.Element;
|
|
47
|
-
displayName: string;
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=EnhancedCheckboxGroup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancedCheckboxGroup.d.ts","sourceRoot":"","sources":["../../../src/wrappers/CheckboxGroup/EnhancedCheckboxGroup.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AAOzB,OAAO,KAAK,EACV,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAsL1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,qBAAqB;KAChC,YAAY,SAAS,WAAW,gBAChC,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,4BACrC,OAAO,SAAS,gBAAgB,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,qBACnF,SAAS,SAAS,MAAM,OAAO,GAAG,MAAM,YACxC,SAAS,SAAS,MAAM,OAAO,GAAG,MAAM,YACxC,YAAY,SAAS,MAAM,OAAO,GAAG,MAAM,wCAI1C,0BAA0B,CAAC,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC;;CAkB9F,CAAC"}
|