@gnwebsoft/ui 4.0.3 → 4.0.5
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-DKD73ADK.cjs → chunk-2QTXS736.cjs} +28 -77
- package/dist/{chunk-DS524L7W.cjs → chunk-3RZ4JNO3.cjs} +5 -5
- package/dist/chunk-3TYKVE3E.js +2514 -0
- package/dist/chunk-HKO2FXDM.js +2232 -0
- package/dist/chunk-LUW7V5GI.cjs +1 -1
- package/dist/chunk-MVPLBJRK.cjs +1 -1
- package/dist/{chunk-M3NVOZ7L.cjs → chunk-UBPAGZNC.cjs} +8 -6
- package/dist/chunk-XN3KVY4J.js +467 -0
- package/dist/chunk-XTPFOURJ.cjs +72 -0
- package/dist/chunk-Y3QTSDLJ.cjs +1 -1
- package/dist/core/api/ApiClient.d.ts +329 -0
- package/dist/core/api/ApiClient.d.ts.map +1 -0
- package/dist/core/api/CorrelationIdGenerator.d.ts +52 -0
- package/dist/core/api/CorrelationIdGenerator.d.ts.map +1 -0
- package/dist/core/api/Errors/ErrorNormalizer.d.ts +106 -0
- package/dist/core/api/Errors/ErrorNormalizer.d.ts.map +1 -0
- package/dist/core/api/Interceptors/InterceptorManager.d.ts +236 -0
- package/dist/core/api/Interceptors/InterceptorManager.d.ts.map +1 -0
- package/dist/core/api/Models/FilterModel.d.ts +22 -0
- package/dist/core/api/Models/FilterModel.d.ts.map +1 -0
- package/dist/core/api/Models/QueryParams.d.ts +13 -0
- package/dist/core/api/Models/QueryParams.d.ts.map +1 -0
- package/dist/core/api/Models/index.d.ts +3 -0
- package/dist/core/api/Models/index.d.ts.map +1 -0
- package/dist/core/api/RequestManager.d.ts +142 -0
- package/dist/core/api/RequestManager.d.ts.map +1 -0
- package/dist/core/api/Retry/RetryHandler.d.ts +100 -0
- package/dist/core/api/Retry/RetryHandler.d.ts.map +1 -0
- package/dist/core/api/Signals/SignalManager.d.ts +153 -0
- package/dist/core/api/Signals/SignalManager.d.ts.map +1 -0
- package/dist/core/api/Utils/ResponseParser.d.ts +105 -0
- package/dist/core/api/Utils/ResponseParser.d.ts.map +1 -0
- package/dist/core/api/Utils/UrlBuilder.d.ts +111 -0
- package/dist/core/api/Utils/UrlBuilder.d.ts.map +1 -0
- package/dist/core/api/createApiClient.d.ts +265 -0
- package/dist/core/api/createApiClient.d.ts.map +1 -0
- package/dist/core/api/index.d.ts +7 -0
- package/dist/core/api/index.d.ts.map +1 -0
- package/dist/core/api/types/ApiError.d.ts +17 -0
- package/dist/core/api/types/ApiError.d.ts.map +1 -0
- package/dist/core/api/types/ApiResponse.d.ts +76 -0
- package/dist/core/api/types/ApiResponse.d.ts.map +1 -0
- package/dist/core/api/types/CancelToken.d.ts +15 -0
- package/dist/core/api/types/CancelToken.d.ts.map +1 -0
- package/dist/core/api/types/ErrorInterceptor.d.ts +3 -0
- package/dist/core/api/types/ErrorInterceptor.d.ts.map +1 -0
- package/dist/core/api/types/ErrorResponseData.d.ts +68 -0
- package/dist/core/api/types/ErrorResponseData.d.ts.map +1 -0
- package/dist/core/api/types/RequestConfig.d.ts +21 -0
- package/dist/core/api/types/RequestConfig.d.ts.map +1 -0
- package/dist/core/api/types/RequestInterceptor.d.ts +3 -0
- package/dist/core/api/types/RequestInterceptor.d.ts.map +1 -0
- package/dist/core/api/types/ResponseInterceptor.d.ts +3 -0
- package/dist/core/api/types/ResponseInterceptor.d.ts.map +1 -0
- package/dist/core/api/types/ValidationErrors.d.ts +7 -0
- package/dist/core/api/types/ValidationErrors.d.ts.map +1 -0
- package/dist/core/api/types/index.d.ts +10 -0
- package/dist/core/api/types/index.d.ts.map +1 -0
- package/dist/core/api/useValidationErrors.d.ts +11 -0
- package/dist/core/api/useValidationErrors.d.ts.map +1 -0
- package/dist/core/components/AuthorizedView/AuthorizedView.d.ts +7 -0
- package/dist/core/components/AuthorizedView/AuthorizedView.d.ts.map +1 -0
- package/dist/core/components/AuthorizedView/index.d.ts +2 -0
- package/dist/core/components/AuthorizedView/index.d.ts.map +1 -0
- package/dist/core/components/CancelButton/CancelButton.d.ts +4 -0
- package/dist/core/components/CancelButton/CancelButton.d.ts.map +1 -0
- package/dist/core/components/CancelButton/index.d.ts +2 -0
- package/dist/core/components/CancelButton/index.d.ts.map +1 -0
- package/dist/core/components/ClearButton/ClearButton.d.ts +63 -0
- package/dist/core/components/ClearButton/ClearButton.d.ts.map +1 -0
- package/dist/core/components/ClearButton/index.d.ts +2 -0
- package/dist/core/components/ClearButton/index.d.ts.map +1 -0
- package/dist/core/components/Containers/SimpleContainer.d.ts +10 -0
- package/dist/core/components/Containers/SimpleContainer.d.ts.map +1 -0
- package/dist/core/components/Containers/index.d.ts +2 -0
- package/dist/core/components/Containers/index.d.ts.map +1 -0
- package/dist/core/components/FilterButton/FilterButton.d.ts +86 -0
- package/dist/core/components/FilterButton/FilterButton.d.ts.map +1 -0
- package/dist/core/components/FilterButton/index.d.ts +2 -0
- package/dist/core/components/FilterButton/index.d.ts.map +1 -0
- package/dist/core/components/FilterDisplay/FilterChip.d.ts +9 -0
- package/dist/core/components/FilterDisplay/FilterChip.d.ts.map +1 -0
- package/dist/core/components/FilterDisplay/FilterDisplay.d.ts +10 -0
- package/dist/core/components/FilterDisplay/FilterDisplay.d.ts.map +1 -0
- package/dist/core/components/FilterDisplay/index.d.ts +3 -0
- package/dist/core/components/FilterDisplay/index.d.ts.map +1 -0
- package/dist/core/components/FilterWrapper/FilterWrapper.d.ts +99 -0
- package/dist/core/components/FilterWrapper/FilterWrapper.d.ts.map +1 -0
- package/dist/core/components/FilterWrapper/index.d.ts +2 -0
- package/dist/core/components/FilterWrapper/index.d.ts.map +1 -0
- package/dist/core/components/Footer/Footer.d.ts +3 -0
- package/dist/core/components/Footer/Footer.d.ts.map +1 -0
- package/dist/core/components/Footer/index.d.ts +2 -0
- package/dist/core/components/Footer/index.d.ts.map +1 -0
- package/dist/core/components/LabelText/LabelText.d.ts +103 -0
- package/dist/core/components/LabelText/LabelText.d.ts.map +1 -0
- package/dist/core/components/LabelText/index.d.ts +2 -0
- package/dist/core/components/LabelText/index.d.ts.map +1 -0
- package/dist/core/components/RenderIf/RenderIf.d.ts +7 -0
- package/dist/core/components/RenderIf/RenderIf.d.ts.map +1 -0
- package/dist/core/components/RenderIf/index.d.ts +2 -0
- package/dist/core/components/RenderIf/index.d.ts.map +1 -0
- package/dist/core/components/SectionBox/SectionBox.d.ts +15 -0
- package/dist/core/components/SectionBox/SectionBox.d.ts.map +1 -0
- package/dist/core/components/SectionBox/index.d.ts +2 -0
- package/dist/core/components/SectionBox/index.d.ts.map +1 -0
- package/dist/core/components/SimpleTabs/SimpleTabs.d.ts +17 -0
- package/dist/core/components/SimpleTabs/SimpleTabs.d.ts.map +1 -0
- package/dist/core/components/SimpleTabs/index.d.ts +2 -0
- package/dist/core/components/SimpleTabs/index.d.ts.map +1 -0
- package/dist/core/components/SubmitButton/SubmitButton.d.ts +6 -0
- package/dist/core/components/SubmitButton/SubmitButton.d.ts.map +1 -0
- package/dist/core/components/SubmitButton/index.d.ts +2 -0
- package/dist/core/components/SubmitButton/index.d.ts.map +1 -0
- package/dist/core/components/WithRef/WithRef.d.ts +14 -0
- package/dist/core/components/WithRef/WithRef.d.ts.map +1 -0
- package/dist/core/components/WithRef/index.d.ts +2 -0
- package/dist/core/components/WithRef/index.d.ts.map +1 -0
- package/dist/core/components/index.d.ts +15 -0
- package/dist/core/components/index.d.ts.map +1 -0
- package/dist/core/config.d.ts +24 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/hooks/index.d.ts +3 -0
- package/dist/core/hooks/index.d.ts.map +1 -0
- package/dist/core/hooks/makeQuery.d.ts +12 -0
- package/dist/core/hooks/makeQuery.d.ts.map +1 -0
- package/dist/core/hooks/useApiClient.d.ts +3 -0
- package/dist/core/hooks/useApiClient.d.ts.map +1 -0
- package/dist/core/hooks/useFormErrorHandler.d.ts +35 -0
- package/dist/core/hooks/useFormErrorHandler.d.ts.map +1 -0
- package/dist/core/hooks/useListView.d.ts +20 -0
- package/dist/core/hooks/useListView.d.ts.map +1 -0
- package/dist/core/index.cjs +3 -3
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +1 -1
- package/dist/core/models.d.ts +5 -0
- package/dist/core/models.d.ts.map +1 -0
- package/dist/core/types/FilterLabel.d.ts +6 -0
- package/dist/core/types/FilterLabel.d.ts.map +1 -0
- package/dist/core/types/ListModels.d.ts +18 -0
- package/dist/core/types/ListModels.d.ts.map +1 -0
- package/dist/core/types/OptionsRequest.d.ts +4 -0
- package/dist/core/types/OptionsRequest.d.ts.map +1 -0
- package/dist/core/types/index.d.ts +4 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/utils/CacheUtility/index.d.ts +15 -0
- package/dist/core/utils/CacheUtility/index.d.ts.map +1 -0
- package/dist/core/utils/calculateFilterCount.d.ts +2 -0
- package/dist/core/utils/calculateFilterCount.d.ts.map +1 -0
- package/dist/core/utils/format-time.d.ts +79 -0
- package/dist/core/utils/format-time.d.ts.map +1 -0
- package/dist/core/utils/getEmptyObject.d.ts +7 -0
- package/dist/core/utils/getEmptyObject.d.ts.map +1 -0
- package/dist/core/utils/index.d.ts +7 -0
- package/dist/core/utils/index.d.ts.map +1 -0
- package/dist/core/utils/useStableRowCount.d.ts +9 -0
- package/dist/core/utils/useStableRowCount.d.ts.map +1 -0
- package/dist/core/utils/watch/core.d.ts +22 -0
- package/dist/core/utils/watch/core.d.ts.map +1 -0
- package/dist/core/utils/watch/index.d.ts +49 -0
- package/dist/core/utils/watch/index.d.ts.map +1 -0
- package/dist/core/utils/watch/utilities.d.ts +34 -0
- package/dist/core/utils/watch/utilities.d.ts.map +1 -0
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useTransform/enhanced.d.ts +133 -0
- package/dist/hooks/useTransform/enhanced.d.ts.map +1 -0
- package/dist/hooks/useTransform/index.d.ts +93 -0
- package/dist/hooks/useTransform/index.d.ts.map +1 -0
- package/dist/index.cjs +6 -24
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -22
- package/dist/types/AsyncSelectPayload.d.ts +9 -0
- package/dist/types/AsyncSelectPayload.d.ts.map +1 -0
- package/dist/types/OperationResponse.d.ts +5 -0
- package/dist/types/OperationResponse.d.ts.map +1 -0
- package/dist/types/OptionItem.d.ts +75 -0
- package/dist/types/OptionItem.d.ts.map +1 -0
- package/dist/types/api.d.ts +127 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/events.d.ts +74 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/index.cjs +3 -3
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -1
- package/dist/types/utilities.d.ts +458 -0
- package/dist/types/utilities.d.ts.map +1 -0
- package/dist/utils/api.d.ts +14 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/dist/utils/api2.d.ts +14 -0
- package/dist/utils/api2.d.ts.map +1 -0
- package/dist/utils/flattenObjectKeys.d.ts +63 -0
- package/dist/utils/flattenObjectKeys.d.ts.map +1 -0
- package/dist/utils/getTimezone.d.ts +4 -0
- package/dist/utils/getTimezone.d.ts.map +1 -0
- package/dist/utils/handleServerErrors.d.ts +70 -0
- package/dist/utils/handleServerErrors.d.ts.map +1 -0
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/propertyExists.d.ts +35 -0
- package/dist/utils/propertyExists.d.ts.map +1 -0
- package/dist/utils/readValueAsDate.d.ts +4 -0
- package/dist/utils/readValueAsDate.d.ts.map +1 -0
- package/dist/utils/removeLeadingTrailingSlashes.d.ts +2 -0
- package/dist/utils/removeLeadingTrailingSlashes.d.ts.map +1 -0
- package/dist/utils/schemaTools.d.ts +82 -0
- package/dist/utils/schemaTools.d.ts.map +1 -0
- package/dist/utils/typeGuards.d.ts +316 -0
- package/dist/utils/typeGuards.d.ts.map +1 -0
- package/dist/utils/watch/core.d.ts +22 -0
- package/dist/utils/watch/core.d.ts.map +1 -0
- package/dist/utils/watch/index.d.ts +49 -0
- package/dist/utils/watch/index.d.ts.map +1 -0
- package/dist/utils/watch/utilities.d.ts +34 -0
- package/dist/utils/watch/utilities.d.ts.map +1 -0
- package/dist/wrappers/AsyncMultiSelect/AsyncMultiSelect.d.ts +9 -0
- package/dist/wrappers/AsyncMultiSelect/AsyncMultiSelect.d.ts.map +1 -0
- package/dist/wrappers/AsyncMultiSelect/index.d.ts +3 -0
- package/dist/wrappers/AsyncMultiSelect/index.d.ts.map +1 -0
- package/dist/wrappers/AsyncMultiSelect/types.d.ts +19 -0
- package/dist/wrappers/AsyncMultiSelect/types.d.ts.map +1 -0
- package/dist/wrappers/AsyncMultiSelect2/AsyncMultiSelect2.d.ts +8 -0
- package/dist/wrappers/AsyncMultiSelect2/AsyncMultiSelect2.d.ts.map +1 -0
- package/dist/wrappers/AsyncMultiSelect2/index.d.ts +3 -0
- package/dist/wrappers/AsyncMultiSelect2/index.d.ts.map +1 -0
- package/dist/wrappers/AsyncMultiSelect2/types.d.ts +29 -0
- package/dist/wrappers/AsyncMultiSelect2/types.d.ts.map +1 -0
- package/dist/wrappers/AsyncSelect/index.d.ts +9 -0
- package/dist/wrappers/AsyncSelect/index.d.ts.map +1 -0
- package/dist/wrappers/AsyncSelect/types.d.ts +19 -0
- package/dist/wrappers/AsyncSelect/types.d.ts.map +1 -0
- package/dist/wrappers/Button.d.ts +49 -0
- package/dist/wrappers/Button.d.ts.map +1 -0
- package/dist/wrappers/CheckboxElement/CheckboxElement.d.ts +102 -0
- package/dist/wrappers/CheckboxElement/CheckboxElement.d.ts.map +1 -0
- package/dist/wrappers/CheckboxElement/index.d.ts +3 -0
- package/dist/wrappers/CheckboxElement/index.d.ts.map +1 -0
- package/dist/wrappers/CheckboxElement/types.d.ts +76 -0
- package/dist/wrappers/CheckboxElement/types.d.ts.map +1 -0
- package/dist/wrappers/CheckboxGroup/CheckboxGroup.d.ts +96 -0
- package/dist/wrappers/CheckboxGroup/CheckboxGroup.d.ts.map +1 -0
- package/dist/wrappers/CheckboxGroup/EnhancedCheckboxGroup.d.ts +49 -0
- package/dist/wrappers/CheckboxGroup/EnhancedCheckboxGroup.d.ts.map +1 -0
- package/dist/wrappers/CheckboxGroup/enhanced-types.d.ts +171 -0
- package/dist/wrappers/CheckboxGroup/enhanced-types.d.ts.map +1 -0
- package/dist/wrappers/CheckboxGroup/index.d.ts +3 -0
- package/dist/wrappers/CheckboxGroup/index.d.ts.map +1 -0
- package/dist/wrappers/CheckboxGroup/types.d.ts +106 -0
- package/dist/wrappers/CheckboxGroup/types.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/DatePickerElement.d.ts +131 -0
- package/dist/wrappers/DatePickerElement/DatePickerElement.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/DatePickerElementCore.d.ts +57 -0
- package/dist/wrappers/DatePickerElement/DatePickerElementCore.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/hooks/index.d.ts +24 -0
- package/dist/wrappers/DatePickerElement/hooks/index.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerStyles.d.ts +63 -0
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerStyles.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerValidation.d.ts +79 -0
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerValidation.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerValue.d.ts +73 -0
- package/dist/wrappers/DatePickerElement/hooks/useDatePickerValue.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/index.d.ts +47 -0
- package/dist/wrappers/DatePickerElement/index.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/types.d.ts +183 -0
- package/dist/wrappers/DatePickerElement/types.d.ts.map +1 -0
- package/dist/wrappers/DatePickerElement/utils.d.ts +89 -0
- package/dist/wrappers/DatePickerElement/utils.d.ts.map +1 -0
- package/dist/wrappers/DateTimePickerElement/index.d.ts +1 -0
- package/dist/wrappers/DateTimePickerElement/index.d.ts.map +1 -0
- package/dist/wrappers/DateTimePickerElement/types.d.ts +1 -0
- package/dist/wrappers/DateTimePickerElement/types.d.ts.map +1 -0
- package/dist/wrappers/Field/index.d.ts +42 -0
- package/dist/wrappers/Field/index.d.ts.map +1 -0
- package/dist/wrappers/NumberFieldElement/NumberFieldElement.d.ts +176 -0
- package/dist/wrappers/NumberFieldElement/NumberFieldElement.d.ts.map +1 -0
- package/dist/wrappers/NumberFieldElement/index.d.ts +3 -0
- package/dist/wrappers/NumberFieldElement/index.d.ts.map +1 -0
- package/dist/wrappers/OTPInputElement/HelperText.d.ts +8 -0
- package/dist/wrappers/OTPInputElement/HelperText.d.ts.map +1 -0
- package/dist/wrappers/OTPInputElement/OTPInputElement.d.ts +32 -0
- package/dist/wrappers/OTPInputElement/OTPInputElement.d.ts.map +1 -0
- package/dist/wrappers/OTPInputElement/index.d.ts +3 -0
- package/dist/wrappers/OTPInputElement/index.d.ts.map +1 -0
- package/dist/wrappers/PasswordElement/PasswordElement.d.ts +104 -0
- package/dist/wrappers/PasswordElement/PasswordElement.d.ts.map +1 -0
- package/dist/wrappers/PasswordElement/index.d.ts +2 -0
- package/dist/wrappers/PasswordElement/index.d.ts.map +1 -0
- package/dist/wrappers/RadioButtonGroup/RadioButtonGroup.d.ts +38 -0
- package/dist/wrappers/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -0
- package/dist/wrappers/RadioButtonGroup/index.d.ts +2 -0
- package/dist/wrappers/RadioButtonGroup/index.d.ts.map +1 -0
- package/dist/wrappers/SelectCascadeElement/SelectCascadeElement.d.ts +22 -0
- package/dist/wrappers/SelectCascadeElement/SelectCascadeElement.d.ts.map +1 -0
- package/dist/wrappers/SelectCascadeElement/index.d.ts +2 -0
- package/dist/wrappers/SelectCascadeElement/index.d.ts.map +1 -0
- package/dist/wrappers/SelectElement/SelectElement.d.ts +152 -0
- package/dist/wrappers/SelectElement/SelectElement.d.ts.map +1 -0
- package/dist/wrappers/SelectElement/index.d.ts +2 -0
- package/dist/wrappers/SelectElement/index.d.ts.map +1 -0
- package/dist/wrappers/SelectMultiElement/SelectMultiElement.d.ts +21 -0
- package/dist/wrappers/SelectMultiElement/SelectMultiElement.d.ts.map +1 -0
- package/dist/wrappers/SelectMultiElement/index.d.ts +2 -0
- package/dist/wrappers/SelectMultiElement/index.d.ts.map +1 -0
- package/dist/wrappers/TextFieldElement/TextFieldElement.d.ts +179 -0
- package/dist/wrappers/TextFieldElement/TextFieldElement.d.ts.map +1 -0
- package/dist/wrappers/TextFieldElement/index.d.ts +3 -0
- package/dist/wrappers/TextFieldElement/index.d.ts.map +1 -0
- package/dist/wrappers/TimePickerElement/TimePickerElement.d.ts +30 -0
- package/dist/wrappers/TimePickerElement/TimePickerElement.d.ts.map +1 -0
- package/dist/wrappers/TimePickerElement/index.d.ts +2 -0
- package/dist/wrappers/TimePickerElement/index.d.ts.map +1 -0
- package/dist/wrappers/index.cjs +3 -4
- package/dist/wrappers/index.d.ts +14 -0
- package/dist/wrappers/index.d.ts.map +1 -0
- package/dist/wrappers/index.js +1 -2
- package/dist/wrappers/types/common.d.ts +87 -0
- package/dist/wrappers/types/common.d.ts.map +1 -0
- package/dist/wrappers/types/index.d.ts +8 -0
- package/dist/wrappers/types/index.d.ts.map +1 -0
- package/package.json +4 -8
- package/dist/chunk-BXWPG6VW.js +0 -108
- package/dist/chunk-EOUSOGZ6.js +0 -2281
- package/dist/chunk-EYXPJMEF.cjs +0 -108
- package/dist/chunk-GHW77WIM.cjs +0 -72
- package/dist/chunk-PUQIPRL2.js +0 -467
- package/dist/chunk-YAYXHYKC.js +0 -2512
- package/dist/i18n/index.cjs +0 -21
- package/dist/i18n/index.js +0 -21
- /package/dist/{chunk-MULSVYFT.js → chunk-6GKAC3KH.js} +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type { CheckboxProps, FormControlLabelProps, GridProps, SxProps, Theme } from "@mui/material";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { Control, FieldError, FieldPath, FieldValues, PathValue } from "react-hook-form";
|
|
4
|
+
import type { EventOrValue } from "../../types/events";
|
|
5
|
+
/**
|
|
6
|
+
* Supported primitive value types for checkbox options
|
|
7
|
+
*/
|
|
8
|
+
export type CheckboxValue = string | number;
|
|
9
|
+
/**
|
|
10
|
+
* Base constraint for option objects with flexible key structure
|
|
11
|
+
*
|
|
12
|
+
* @template TValue - The type of values (string | number)
|
|
13
|
+
* @template TValueKey - Key for accessing the value property
|
|
14
|
+
* @template TLabelKey - Key for accessing the label property
|
|
15
|
+
* @template TDisabledKey - Key for accessing the disabled property
|
|
16
|
+
*/
|
|
17
|
+
export type OptionConstraint<TValue extends CheckboxValue = CheckboxValue, TValueKey extends string = string, TLabelKey extends string = string, TDisabledKey extends string = string> = Record<TValueKey, TValue> & Record<TLabelKey, string> & Partial<Record<TDisabledKey, boolean>> & Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Utility type to extract the value type from an option array
|
|
20
|
+
* This ensures the field value array type matches the option value type
|
|
21
|
+
*/
|
|
22
|
+
export type ExtractOptionValue<TOption extends OptionConstraint<CheckboxValue, TValueKey>, TValueKey extends keyof TOption & string> = TOption[TValueKey];
|
|
23
|
+
/**
|
|
24
|
+
* Utility type to create the expected array type for the form field
|
|
25
|
+
* This creates TValue[] where TValue matches the option value type
|
|
26
|
+
*/
|
|
27
|
+
export type CheckboxGroupValue<TOption extends OptionConstraint<CheckboxValue, TValueKey>, TValueKey extends keyof TOption & string> = Array<ExtractOptionValue<TOption, TValueKey>>;
|
|
28
|
+
/**
|
|
29
|
+
* Enhanced CheckboxGroup props with full type safety and inference
|
|
30
|
+
*
|
|
31
|
+
* @template TFieldValues - The form values type
|
|
32
|
+
* @template TName - The field name type
|
|
33
|
+
* @template TOption - The option object type (constrained to have value of string | number)
|
|
34
|
+
* @template TValueKey - The key for option values (must exist on TOption)
|
|
35
|
+
* @template TLabelKey - The key for option labels (must exist on TOption)
|
|
36
|
+
* @template TDisabledKey - The key for option disabled state (must exist on TOption)
|
|
37
|
+
*
|
|
38
|
+
* Key insight: TOption[TValueKey] must extend CheckboxValue (string | number)
|
|
39
|
+
* and PathValue<TFieldValues, TName> must be assignable from TOption[TValueKey][]
|
|
40
|
+
*/
|
|
41
|
+
export interface EnhancedCheckboxGroupProps<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"> extends Omit<CheckboxProps, "name" | "checked" | "value" | "onChange"> {
|
|
42
|
+
/**
|
|
43
|
+
* The field name in the form
|
|
44
|
+
* The field value must be compatible with Array<TOption[TValueKey]>
|
|
45
|
+
*/
|
|
46
|
+
name: TName;
|
|
47
|
+
/**
|
|
48
|
+
* Form control instance
|
|
49
|
+
*/
|
|
50
|
+
control?: Control<TFieldValues>;
|
|
51
|
+
/**
|
|
52
|
+
* Array of options - the value type is automatically inferred
|
|
53
|
+
* Each option must have TValueKey property of type string | number
|
|
54
|
+
*/
|
|
55
|
+
options: readonly TOption[];
|
|
56
|
+
/**
|
|
57
|
+
* Key for accessing option values (must exist on TOption)
|
|
58
|
+
* @default "value"
|
|
59
|
+
*/
|
|
60
|
+
valueField?: TValueKey;
|
|
61
|
+
/**
|
|
62
|
+
* Key for accessing option labels (must exist on TOption)
|
|
63
|
+
* @default "label"
|
|
64
|
+
*/
|
|
65
|
+
labelField?: TLabelKey;
|
|
66
|
+
/**
|
|
67
|
+
* Key for accessing option disabled state (must exist on TOption)
|
|
68
|
+
* @default "disabled"
|
|
69
|
+
*/
|
|
70
|
+
disabledKey?: TDisabledKey;
|
|
71
|
+
/**
|
|
72
|
+
* Label for the entire checkbox group
|
|
73
|
+
*/
|
|
74
|
+
label?: ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Helper text displayed below the group
|
|
77
|
+
*/
|
|
78
|
+
helperText?: ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* Display checkboxes in a row layout
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
row?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Custom error parser
|
|
86
|
+
*/
|
|
87
|
+
parseError?: (error: FieldError) => ReactNode;
|
|
88
|
+
/**
|
|
89
|
+
* Props for individual FormControlLabel components
|
|
90
|
+
*/
|
|
91
|
+
labelProps?: Omit<FormControlLabelProps, "label" | "control">;
|
|
92
|
+
/**
|
|
93
|
+
* Grid wrapper properties
|
|
94
|
+
*/
|
|
95
|
+
gridProps?: GridProps;
|
|
96
|
+
/**
|
|
97
|
+
* Value transformation functions with proper type constraints
|
|
98
|
+
* Input/output types are automatically inferred from TOption[TValueKey]
|
|
99
|
+
*/
|
|
100
|
+
transform?: {
|
|
101
|
+
/**
|
|
102
|
+
* Transform field value to display format
|
|
103
|
+
* Input: PathValue<TFieldValues, TName>
|
|
104
|
+
* Output: Array<TOption[TValueKey]>
|
|
105
|
+
*/
|
|
106
|
+
input?: (value: PathValue<TFieldValues, TName>) => Array<ExtractOptionValue<TOption, TValueKey>>;
|
|
107
|
+
/**
|
|
108
|
+
* Transform selected values back to field format
|
|
109
|
+
* Input: Array<TOption[TValueKey]>
|
|
110
|
+
* Output: PathValue<TFieldValues, TName>
|
|
111
|
+
*/
|
|
112
|
+
output?: (eventOrValue: EventOrValue<PathValue<TFieldValues, TName>>, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Change handler with properly typed parameters
|
|
116
|
+
* Both selected values and full option objects are provided
|
|
117
|
+
*/
|
|
118
|
+
onChange?: (selectedValues: Array<ExtractOptionValue<TOption, TValueKey>>, selectedOptions: readonly TOption[]) => void;
|
|
119
|
+
/**
|
|
120
|
+
* Custom styling
|
|
121
|
+
*/
|
|
122
|
+
sx?: SxProps<Theme>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Type-safe helper function for creating checkbox group options
|
|
126
|
+
* This provides better IDE experience and catches type mismatches early
|
|
127
|
+
*/
|
|
128
|
+
export declare function createCheckboxOption<TValue extends CheckboxValue, TValueKey extends string = "value", TLabelKey extends string = "label", TDisabledKey extends string = "disabled">(value: TValue, label: string, options?: {
|
|
129
|
+
disabled?: boolean;
|
|
130
|
+
valueField?: TValueKey;
|
|
131
|
+
labelField?: TLabelKey;
|
|
132
|
+
disabledKey?: TDisabledKey;
|
|
133
|
+
}): Record<TValueKey, TValue> & Record<TLabelKey, string> & Partial<Record<TDisabledKey, boolean>> & Record<string, unknown>;
|
|
134
|
+
/**
|
|
135
|
+
* Type-safe helper function for creating arrays of checkbox options
|
|
136
|
+
* Provides excellent IDE intellisense and type checking
|
|
137
|
+
*/
|
|
138
|
+
export declare function createCheckboxOptions<TValue extends CheckboxValue, TValueKey extends string = "value", TLabelKey extends string = "label", TDisabledKey extends string = "disabled">(items: Array<{
|
|
139
|
+
value: TValue;
|
|
140
|
+
label: string;
|
|
141
|
+
disabled?: boolean;
|
|
142
|
+
}>, keys?: {
|
|
143
|
+
valueField?: TValueKey;
|
|
144
|
+
labelField?: TLabelKey;
|
|
145
|
+
disabledKey?: TDisabledKey;
|
|
146
|
+
}): Array<Record<TValueKey, TValue> & Record<TLabelKey, string> & Partial<Record<TDisabledKey, boolean>> & Record<string, unknown>>;
|
|
147
|
+
/**
|
|
148
|
+
* Example: String-based options
|
|
149
|
+
*/
|
|
150
|
+
export interface StringOption {
|
|
151
|
+
id: string;
|
|
152
|
+
name: string;
|
|
153
|
+
disabled?: boolean;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Example: Number-based options
|
|
157
|
+
*/
|
|
158
|
+
export interface NumberOption {
|
|
159
|
+
value: number;
|
|
160
|
+
label: string;
|
|
161
|
+
disabled?: boolean;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Example: Mixed usage with proper type constraints
|
|
165
|
+
*/
|
|
166
|
+
export interface ExampleFormData {
|
|
167
|
+
categories: string[];
|
|
168
|
+
priorities: number[];
|
|
169
|
+
tags: Array<string | number>;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=enhanced-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhanced-types.d.ts","sourceRoot":"","sources":["../../../src/wrappers/CheckboxGroup/enhanced-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,SAAS,EACT,OAAO,EACP,KAAK,EACN,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,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,CAC1B,MAAM,SAAS,aAAa,GAAG,aAAa,EAC5C,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,YAAY,SAAS,MAAM,GAAG,MAAM,IAClC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GAC3B,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GACzB,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,GACtC,MAAM,CAAC,M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,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wrappers/CheckboxGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
type PrimitiveValue = string | number | boolean;
|
|
5
|
+
export type OptionObject<TValueKey extends string = string, TLabelKey extends string = string, TDisabledKey extends string = string> = Record<TValueKey, PrimitiveValue> & Record<TLabelKey, string> & Partial<Record<TDisabledKey, boolean>> & Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Props for the CheckboxGroup component.
|
|
8
|
+
*
|
|
9
|
+
* @template TFieldValues - The form values type
|
|
10
|
+
* @template TName - The field name type
|
|
11
|
+
* @template TOption - The option object type
|
|
12
|
+
* @template TValueKey - The key for option values
|
|
13
|
+
* @template TLabelKey - The key for option labels
|
|
14
|
+
* @template TDisabledKey - The key for option disabled state
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export interface CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TOption extends OptionObject<TValueKey, TLabelKey, TDisabledKey> = OptionObject, TValueKey extends keyof TOption & string = "Value", TLabelKey extends keyof TOption & string = "Label", TDisabledKey extends keyof TOption & string = "disabled"> extends Omit<CheckboxProps, "name" | "checked" | "value" | "onChange"> {
|
|
19
|
+
/**
|
|
20
|
+
* The field name in the form
|
|
21
|
+
* @example "selectedItems" | "user.preferences"
|
|
22
|
+
*/
|
|
23
|
+
name: TName;
|
|
24
|
+
/**
|
|
25
|
+
* The form control instance from react-hook-form
|
|
26
|
+
*/
|
|
27
|
+
control?: Control<TFieldValues>;
|
|
28
|
+
/**
|
|
29
|
+
* Array of options to display as checkboxes
|
|
30
|
+
*/
|
|
31
|
+
options: TOption[];
|
|
32
|
+
/**
|
|
33
|
+
* Label text to display above the checkbox group
|
|
34
|
+
* @example "Select your preferences"
|
|
35
|
+
*/
|
|
36
|
+
label?: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Additional props for each FormControlLabel component
|
|
39
|
+
*/
|
|
40
|
+
labelProps?: Omit<FormControlLabelProps, "label" | "control">;
|
|
41
|
+
/**
|
|
42
|
+
* Grid layout props for the wrapper Grid component
|
|
43
|
+
* @defaultValue { size: { xs: 12, sm: 12, md: 12, lg: 12, xl: 12 } }
|
|
44
|
+
*/
|
|
45
|
+
gridProps?: GridProps;
|
|
46
|
+
/**
|
|
47
|
+
* Helper text to display below the checkbox group
|
|
48
|
+
*/
|
|
49
|
+
helperText?: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Custom error parser function
|
|
52
|
+
* @param error - The field error from react-hook-form
|
|
53
|
+
* @returns Formatted error message
|
|
54
|
+
*/
|
|
55
|
+
parseError?: (error: FieldError) => ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Key in the option object that contains the value
|
|
58
|
+
* @defaultValue "Value"
|
|
59
|
+
*/
|
|
60
|
+
valueField?: TValueKey;
|
|
61
|
+
/**
|
|
62
|
+
* Key in the option object that contains the label
|
|
63
|
+
* @defaultValue "Label"
|
|
64
|
+
*/
|
|
65
|
+
labelField?: TLabelKey;
|
|
66
|
+
/**
|
|
67
|
+
* Key in the option object that contains the disabled state
|
|
68
|
+
* @defaultValue "disabled"
|
|
69
|
+
*/
|
|
70
|
+
disabledKey?: TDisabledKey;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to display checkboxes in a single row
|
|
73
|
+
* @defaultValue false
|
|
74
|
+
*/
|
|
75
|
+
row?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Value transformation functions for custom data handling
|
|
78
|
+
* Supports arrays of string, boolean, or number values
|
|
79
|
+
*/
|
|
80
|
+
transform?: {
|
|
81
|
+
/**
|
|
82
|
+
* Transform the field value for display in the checkboxes
|
|
83
|
+
* @param value - The current field value (array of values)
|
|
84
|
+
* @returns The transformed value to display
|
|
85
|
+
*/
|
|
86
|
+
input?: (value: PathValue<TFieldValues, TName>) => Array<TOption[TValueKey]>;
|
|
87
|
+
/**
|
|
88
|
+
* Transform the checkbox selections back to the field value
|
|
89
|
+
* @param selectedValues - Array of selected option values
|
|
90
|
+
* @returns The transformed value to store in the form
|
|
91
|
+
*/
|
|
92
|
+
output?: (eventOrValue: PathValue<TFieldValues, TName> | {
|
|
93
|
+
target: {
|
|
94
|
+
value: PathValue<TFieldValues, TName>;
|
|
95
|
+
};
|
|
96
|
+
}, value?: PathValue<TFieldValues, TName>) => PathValue<TFieldValues, TName>;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Custom onChange handler that works alongside the form controller
|
|
100
|
+
* @param selectedValues - Array of selected option values
|
|
101
|
+
* @param selectedOptions - Array of selected option objects
|
|
102
|
+
*/
|
|
103
|
+
onChange?: (selectedValues: Array<TOption[TValueKey]>, selectedOptions: TOption[]) => void;
|
|
104
|
+
}
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/wrappers/Che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C;CACX"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DatePickerElementProps } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* A fully-featured, type-safe DatePickerElement component for react-hook-form integration.
|
|
5
|
+
*
|
|
6
|
+
* This component combines the core date picker functionality with optional Grid layout wrapping,
|
|
7
|
+
* providing a complete solution for form-based date selection with comprehensive TypeScript support.
|
|
8
|
+
*
|
|
9
|
+
* Key Features:
|
|
10
|
+
* - 🎯 **Type Safety**: Full TypeScript inference for form field types and date values
|
|
11
|
+
* - 🔧 **React Hook Form Integration**: Seamless integration with react-hook-form validation
|
|
12
|
+
* - 🎨 **Theming**: Automatic adaptation to MUI theme with customizable styles
|
|
13
|
+
* - ♿ **Accessibility**: WCAG-compliant with proper ARIA attributes and keyboard navigation
|
|
14
|
+
* - 🚀 **Performance**: Optimized with memoization and efficient re-rendering
|
|
15
|
+
* - 📱 **Responsive**: Built-in Grid layout with configurable breakpoints
|
|
16
|
+
* - 🛡️ **Validation**: Comprehensive validation with custom error messages
|
|
17
|
+
* - 🔄 **Transformation**: Flexible value transformation between form and picker formats
|
|
18
|
+
* - 📚 **Developer Experience**: Rich TypeScript IntelliSense and comprehensive documentation
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* Basic usage with automatic Grid wrapper:
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { useForm } from 'react-hook-form';
|
|
24
|
+
* import { DatePickerElement } from '@gnwebsoft/ui/wrappers';
|
|
25
|
+
*
|
|
26
|
+
* function MyForm() {
|
|
27
|
+
* const { control } = useForm<{ birthDate: string }>();
|
|
28
|
+
*
|
|
29
|
+
* return (
|
|
30
|
+
* <DatePickerElement
|
|
31
|
+
* name="birthDate"
|
|
32
|
+
* control={control}
|
|
33
|
+
* label="Date of Birth"
|
|
34
|
+
* required
|
|
35
|
+
* />
|
|
36
|
+
* );
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* Advanced usage with custom transformation and validation:
|
|
42
|
+
* ```tsx
|
|
43
|
+
* function AdvancedForm() {
|
|
44
|
+
* const { control } = useForm<{ startDate: Date }>();
|
|
45
|
+
*
|
|
46
|
+
* return (
|
|
47
|
+
* <DatePickerElement
|
|
48
|
+
* name="startDate"
|
|
49
|
+
* control={control}
|
|
50
|
+
* label="Project Start Date"
|
|
51
|
+
* transform={{
|
|
52
|
+
* input: (dateString) => dateString ? new Date(dateString) : null,
|
|
53
|
+
* output: (date) => date ? date.toISOString() : null
|
|
54
|
+
* }}
|
|
55
|
+
* validation={{
|
|
56
|
+
* minDate: new Date(),
|
|
57
|
+
* maxDate: addYears(new Date(), 2),
|
|
58
|
+
* errorMessages: {
|
|
59
|
+
* minDate: 'Start date must be today or later',
|
|
60
|
+
* maxDate: 'Start date cannot be more than 2 years in the future'
|
|
61
|
+
* }
|
|
62
|
+
* }}
|
|
63
|
+
* gridProps={{ size: { xs: 12, md: 6 } }}
|
|
64
|
+
* sx={{
|
|
65
|
+
* '& .MuiInputLabel-root': {
|
|
66
|
+
* fontWeight: 'bold'
|
|
67
|
+
* }
|
|
68
|
+
* }}
|
|
69
|
+
* />
|
|
70
|
+
* );
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* Without Grid wrapper for custom layouts:
|
|
76
|
+
* ```tsx
|
|
77
|
+
* function CustomLayout() {
|
|
78
|
+
* const { control } = useForm<{ eventDate: string }>();
|
|
79
|
+
*
|
|
80
|
+
* return (
|
|
81
|
+
* <Box display="flex" gap={2}>
|
|
82
|
+
* <DatePickerElement
|
|
83
|
+
* name="eventDate"
|
|
84
|
+
* control={control}
|
|
85
|
+
* label="Event Date"
|
|
86
|
+
* gridProps={false} // Disables Grid wrapper
|
|
87
|
+
* />
|
|
88
|
+
* <Button type="submit">Submit</Button>
|
|
89
|
+
* </Box>
|
|
90
|
+
* );
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* With loading state and custom error handling:
|
|
96
|
+
* ```tsx
|
|
97
|
+
* function LoadingForm() {
|
|
98
|
+
* const { control } = useForm();
|
|
99
|
+
* const [isValidating, setIsValidating] = useState(false);
|
|
100
|
+
*
|
|
101
|
+
* return (
|
|
102
|
+
* <DatePickerElement
|
|
103
|
+
* name="appointmentDate"
|
|
104
|
+
* control={control}
|
|
105
|
+
* label="Appointment Date"
|
|
106
|
+
* loading={isValidating}
|
|
107
|
+
* LoadingComponent={() => <CircularProgress size={20} />}
|
|
108
|
+
* parseError={(error) => {
|
|
109
|
+
* if (typeof error === 'object' && error?.type === 'custom') {
|
|
110
|
+
* return 'This date conflicts with another appointment';
|
|
111
|
+
* }
|
|
112
|
+
* return error.message || 'Please select a valid date';
|
|
113
|
+
* }}
|
|
114
|
+
* />
|
|
115
|
+
* );
|
|
116
|
+
* }
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @template TFieldValues - The form values type (inferred from control)
|
|
120
|
+
* @template TName - The field name type (inferred from name prop)
|
|
121
|
+
* @template TValue - The transformed value type (inferred from transform functions)
|
|
122
|
+
* @template TEnableAccessibleFieldDOMStructure - Whether accessible field DOM structure is enabled
|
|
123
|
+
*
|
|
124
|
+
* @param props - Component props with full TypeScript inference
|
|
125
|
+
* @param ref - Forward ref for the root element (Grid or DatePicker container)
|
|
126
|
+
* @returns Rendered DatePickerElement component with optional Grid wrapper
|
|
127
|
+
*/
|
|
128
|
+
declare const DatePickerElement: React.ForwardRefExoticComponent<DatePickerElementProps<any, any, any, any> & React.RefAttributes<HTMLDivElement>>;
|
|
129
|
+
export { DatePickerElement };
|
|
130
|
+
export default DatePickerElement;
|
|
131
|
+
//# sourceMappingURL=DatePickerElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePickerElement.d.ts","sourceRoot":"","sources":["../../../src/wrappers/DatePickerElement/DatePickerElement.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4HG;AACH,QAAA,MAAM,iBAAiB,mHAsCrB,CAAC;AAKH,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DatePickerElementCoreProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The core DatePickerElement component without Grid wrapper.
|
|
5
|
+
*
|
|
6
|
+
* This is a lightweight, performant date picker component that integrates seamlessly
|
|
7
|
+
* with react-hook-form while providing comprehensive TypeScript support and
|
|
8
|
+
* accessibility features.
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Full TypeScript inference for form field types
|
|
12
|
+
* - Automatic value transformation between form and picker formats
|
|
13
|
+
* - Comprehensive validation with custom error messages
|
|
14
|
+
* - Theme-aware styling with accessibility support
|
|
15
|
+
* - Performance optimized with proper memoization
|
|
16
|
+
* - Forward ref support for advanced use cases
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* Basic usage:
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DatePickerElementCore
|
|
22
|
+
* name="birthDate"
|
|
23
|
+
* control={control}
|
|
24
|
+
* label="Date of Birth"
|
|
25
|
+
* required
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* With custom transformation:
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <DatePickerElementCore
|
|
33
|
+
* name="startDate"
|
|
34
|
+
* control={control}
|
|
35
|
+
* label="Start Date"
|
|
36
|
+
* transform={{
|
|
37
|
+
* input: (dateString) => dateString ? new Date(dateString) : null,
|
|
38
|
+
* output: (date) => date ? date.toISOString() : null
|
|
39
|
+
* }}
|
|
40
|
+
* validation={{
|
|
41
|
+
* minDate: new Date(),
|
|
42
|
+
* errorMessages: {
|
|
43
|
+
* minDate: 'Start date must be today or later'
|
|
44
|
+
* }
|
|
45
|
+
* }}
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @template TFieldValues - The form values type
|
|
50
|
+
* @template TName - The field name type
|
|
51
|
+
* @template TValue - The transformed value type
|
|
52
|
+
* @template TEnableAccessibleFieldDOMStructure - Whether accessible field DOM structure is enabled
|
|
53
|
+
*/
|
|
54
|
+
declare const DatePickerElementCore: React.ForwardRefExoticComponent<DatePickerElementCoreProps<any, any, any, any> & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
export { DatePickerElementCore };
|
|
56
|
+
export default DatePickerElementCore;
|
|
57
|
+
//# sourceMappingURL=DatePickerElementCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePickerElementCore.d.ts","sourceRoot":"","sources":["../../../src/wrappers/DatePickerElement/DatePickerElementCore.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAShE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,QAAA,MAAM,qBAAqB,uHAoM1B,CAAC;AAKF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel export for DatePickerElement hooks
|
|
3
|
+
*
|
|
4
|
+
* This module provides reusable hooks for date picker functionality:
|
|
5
|
+
* - `useDatePickerValue`: Value transformation and management
|
|
6
|
+
* - `useDatePickerValidation`: Comprehensive validation handling
|
|
7
|
+
* - `useDatePickerStyles`: Theme-aware styling and visual states
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import {
|
|
12
|
+
* useDatePickerValue,
|
|
13
|
+
* useDatePickerValidation,
|
|
14
|
+
* useDatePickerStyles
|
|
15
|
+
* } from './hooks';
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export { useDatePickerValue, readDatePickerValueAsDate, type UseDatePickerValueOptions, type UseDatePickerValueReturn, } from "./useDatePickerValue";
|
|
19
|
+
export { useDatePickerValidation, type UseDatePickerValidationOptions, type UseDatePickerValidationReturn, } from "./useDatePickerValidation";
|
|
20
|
+
export { useDatePickerStyles, type UseDatePickerStylesOptions, type UseDatePickerStylesReturn, } from "./useDatePickerStyles";
|
|
21
|
+
export { default as useDatePickerValueDefault } from "./useDatePickerValue";
|
|
22
|
+
export { default as useDatePickerValidationDefault } from "./useDatePickerValidation";
|
|
23
|
+
export { default as useDatePickerStylesDefault } from "./useDatePickerStyles";
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/wrappers/DatePickerElement/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,GACnC,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAEtF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { SxProps, Theme } from "@mui/material";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the useDatePickerStyles hook
|
|
4
|
+
*/
|
|
5
|
+
export interface UseDatePickerStylesOptions {
|
|
6
|
+
/** Whether the component is disabled */
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Whether the component has a validation error */
|
|
9
|
+
hasError?: boolean;
|
|
10
|
+
/** Whether the component is in loading state */
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/** Whether the text input is read-only */
|
|
13
|
+
textReadOnly?: boolean;
|
|
14
|
+
/** Custom styles to merge with defaults */
|
|
15
|
+
sx?: SxProps<Theme>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Return type for the useDatePickerStyles hook
|
|
19
|
+
*/
|
|
20
|
+
export interface UseDatePickerStylesReturn {
|
|
21
|
+
/** Computed styles for the date picker component */
|
|
22
|
+
sx: SxProps<Theme>;
|
|
23
|
+
/** Additional class names for styling */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Hook for managing theme-aware date picker styles with consistent design system integration
|
|
28
|
+
*
|
|
29
|
+
* This hook provides optimized, memoized styles for date picker components that automatically
|
|
30
|
+
* adapt to the current MUI theme and component state (disabled, error, loading, etc.).
|
|
31
|
+
* It ensures consistent styling across all date picker instances while allowing customization.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* Basic usage:
|
|
35
|
+
* ```tsx
|
|
36
|
+
* const { sx } = useDatePickerStyles({
|
|
37
|
+
* disabled: isDisabled,
|
|
38
|
+
* hasError: !!error,
|
|
39
|
+
* loading: isLoading
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* return <DatePicker sx={sx} ... />;
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* With custom styles:
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const { sx } = useDatePickerStyles({
|
|
49
|
+
* hasError: !!error,
|
|
50
|
+
* sx: {
|
|
51
|
+
* '& .MuiInputLabel-root': {
|
|
52
|
+
* color: 'primary.main'
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @param options - Style configuration options
|
|
59
|
+
* @returns Computed styles and class names
|
|
60
|
+
*/
|
|
61
|
+
export declare function useDatePickerStyles(options?: UseDatePickerStylesOptions): UseDatePickerStylesReturn;
|
|
62
|
+
export default useDatePickerStyles;
|
|
63
|
+
//# sourceMappingURL=useDatePickerStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDatePickerStyles.d.ts","sourceRoot":"","sources":["../../../../src/wrappers/DatePickerElement/hooks/useDatePickerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAIpD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2CAA2C;IAC3C,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,oDAAoD;IACpD,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACnB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAA+B,GACvC,yBAAyB,CA6I3B;AAED,eAAe,mBAAmB,CAAC"}
|