@gnwebsoft/ui 4.0.3 → 4.0.4
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-HKO2FXDM.js +2232 -0
- package/dist/{chunk-M3NVOZ7L.cjs → chunk-IKHMJW5A.cjs} +1 -1
- package/dist/chunk-LUW7V5GI.cjs +1 -1
- package/dist/chunk-MVPLBJRK.cjs +1 -1
- package/dist/chunk-NMJ5V7FQ.js +2512 -0
- 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 +243 -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,11 @@
|
|
|
1
|
+
export { default as api } from "./api";
|
|
2
|
+
export { default as api2 } from "./api2";
|
|
3
|
+
export * from "./flattenObjectKeys";
|
|
4
|
+
export * from "./getTimezone";
|
|
5
|
+
export * from "./handleServerErrors";
|
|
6
|
+
export * from "./propertyExists";
|
|
7
|
+
export * from "./readValueAsDate";
|
|
8
|
+
export * from "./removeLeadingTrailingSlashes";
|
|
9
|
+
export * from "./schemaTools";
|
|
10
|
+
export * from "./typeGuards";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,eAAe,CAAC;AAE9B,cAAc,sBAAsB,CAAC;AAErC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,mBAAmB,CAAC;AAElC,cAAc,gCAAgC,CAAC;AAE/C,cAAc,eAAe,CAAC;AAM9B,cAAc,cAAc,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-safe property existence checker that acts as a type guard.
|
|
3
|
+
*
|
|
4
|
+
* Checks if a given property exists on an object and narrows the TypeScript type
|
|
5
|
+
* to include that property. This is useful for safely accessing properties on
|
|
6
|
+
* objects of unknown structure while maintaining type safety.
|
|
7
|
+
*
|
|
8
|
+
* @template X - The type of the object being checked
|
|
9
|
+
* @template Y - The type of the property key (extends PropertyKey)
|
|
10
|
+
*
|
|
11
|
+
* @param obj - The object to check for the property
|
|
12
|
+
* @param prop - The property key to check for existence
|
|
13
|
+
*
|
|
14
|
+
* @returns A type predicate indicating whether the property exists on the object.
|
|
15
|
+
* If true, the object type is narrowed to include the specified property.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const data: unknown = { name: "John", age: 30 };
|
|
20
|
+
*
|
|
21
|
+
* if (propertyExists(data, "name")) {
|
|
22
|
+
* // TypeScript now knows data has a 'name' property
|
|
23
|
+
* console.log(data.name); // Type-safe access
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* // Check for nested property existence
|
|
27
|
+
* if (propertyExists(obj, "user") && propertyExists(obj.user, "id")) {
|
|
28
|
+
* console.log(obj.user.id); // Safe nested access
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @since 2.18.45
|
|
33
|
+
*/
|
|
34
|
+
export declare function propertyExists<X, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
|
|
35
|
+
//# sourceMappingURL=propertyExists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propertyExists.d.ts","sourceRoot":"","sources":["../../src/utils/propertyExists.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,EACrD,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,CAAC,GACN,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAM/B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PickerValidDate } from "@mui/x-date-pickers";
|
|
2
|
+
import type { useLocalizationContext } from "@mui/x-date-pickers/internals";
|
|
3
|
+
export declare function readValueAsDate<TDate extends PickerValidDate>(adapter: ReturnType<typeof useLocalizationContext>, value: string | null | TDate): TDate | null;
|
|
4
|
+
//# sourceMappingURL=readValueAsDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readValueAsDate.d.ts","sourceRoot":"","sources":["../../src/utils/readValueAsDate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E,wBAAgB,eAAe,CAAC,KAAK,SAAS,eAAe,EAC3D,OAAO,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,EAClD,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,GAC3B,KAAK,GAAG,IAAI,CAUd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeLeadingTrailingSlashes.d.ts","sourceRoot":"","sources":["../../src/utils/removeLeadingTrailingSlashes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,GAAI,OAAO,MAAM,WAEzD,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const schemaTools: {
|
|
3
|
+
date: ({ message }?: {
|
|
4
|
+
message?: string;
|
|
5
|
+
}) => z.ZodPipe<z.ZodCoercedString<unknown>, z.ZodTransform<string | null, string>>;
|
|
6
|
+
nullableDate: ({ message }?: {
|
|
7
|
+
message?: string;
|
|
8
|
+
}) => z.ZodPipe<z.ZodPipe<z.ZodCoercedString<unknown>, z.ZodTransform<string | null, string>>, z.ZodTransform<string | null, string | null>>;
|
|
9
|
+
dateRange: ({ message }?: {
|
|
10
|
+
message?: string;
|
|
11
|
+
}) => z.ZodObject<{
|
|
12
|
+
start: z.ZodCoercedDate<unknown>;
|
|
13
|
+
end: z.ZodCoercedDate<unknown>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
requiredString: ({ message, min, max }?: {
|
|
16
|
+
message?: string;
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
}) => z.ZodString;
|
|
20
|
+
email: ({ message }?: {
|
|
21
|
+
message?: string;
|
|
22
|
+
}) => z.ZodString;
|
|
23
|
+
url: ({ message }?: {
|
|
24
|
+
message?: string;
|
|
25
|
+
}) => z.ZodString;
|
|
26
|
+
phone: ({ message }?: {
|
|
27
|
+
message?: string;
|
|
28
|
+
}) => z.ZodString;
|
|
29
|
+
alphanumeric: ({ message }?: {
|
|
30
|
+
message?: string;
|
|
31
|
+
}) => z.ZodString;
|
|
32
|
+
slug: ({ message }?: {
|
|
33
|
+
message?: string;
|
|
34
|
+
}) => z.ZodString;
|
|
35
|
+
positiveNumber: ({ message, min, max }?: {
|
|
36
|
+
message?: string;
|
|
37
|
+
min?: number;
|
|
38
|
+
max?: number;
|
|
39
|
+
}) => z.ZodNumber;
|
|
40
|
+
nonNegativeNumber: ({ message, max }?: {
|
|
41
|
+
message?: string;
|
|
42
|
+
max?: number;
|
|
43
|
+
}) => z.ZodNumber;
|
|
44
|
+
integer: ({ message, min, max }?: {
|
|
45
|
+
message?: string;
|
|
46
|
+
min?: number;
|
|
47
|
+
max?: number;
|
|
48
|
+
}) => z.ZodNumber;
|
|
49
|
+
percentage: ({ message }?: {
|
|
50
|
+
message?: string;
|
|
51
|
+
}) => z.ZodNumber;
|
|
52
|
+
nonEmptyArray: <T>(schema: z.ZodSchema<T>, { message }?: {
|
|
53
|
+
message?: string;
|
|
54
|
+
}) => z.ZodArray<z.ZodType<T, unknown, z.core.$ZodTypeInternals<T, unknown>>>;
|
|
55
|
+
uniqueArray: <T>(schema: z.ZodSchema<T>, { message }?: {
|
|
56
|
+
message?: string;
|
|
57
|
+
}) => z.ZodArray<z.ZodType<T, unknown, z.core.$ZodTypeInternals<T, unknown>>>;
|
|
58
|
+
requiredBoolean: ({ message }?: {
|
|
59
|
+
message?: string;
|
|
60
|
+
}) => z.ZodBoolean;
|
|
61
|
+
nonEmptyObject: <T extends Record<string, unknown>>(schema: z.ZodSchema<T>, { message }?: {
|
|
62
|
+
message?: string;
|
|
63
|
+
}) => z.ZodType<T, unknown, z.core.$ZodTypeInternals<T, unknown>>;
|
|
64
|
+
fileSize: ({ maxSize, message }: {
|
|
65
|
+
maxSize: number;
|
|
66
|
+
message?: string;
|
|
67
|
+
}) => z.ZodCustom<File, File>;
|
|
68
|
+
fileType: ({ allowedTypes, message }: {
|
|
69
|
+
allowedTypes: string[];
|
|
70
|
+
message?: string;
|
|
71
|
+
}) => z.ZodCustom<File, File>;
|
|
72
|
+
conditional: <T, U>(condition: (data: T) => boolean, trueSchema: z.ZodSchema<U>, falseSchema: z.ZodSchema<U>) => z.ZodUnion<readonly [z.ZodType<U, unknown, z.core.$ZodTypeInternals<U, unknown>>, z.ZodType<U, unknown, z.core.$ZodTypeInternals<U, unknown>>]>;
|
|
73
|
+
transform: {
|
|
74
|
+
toLowerCase: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
75
|
+
toUpperCase: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
76
|
+
trim: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
77
|
+
toNumber: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
78
|
+
toBoolean: z.ZodPipe<z.ZodString, z.ZodTransform<boolean, string>>;
|
|
79
|
+
parseJson: <T>(schema: z.ZodSchema<T>) => z.ZodPipe<z.ZodString, z.ZodTransform<Awaited<T>, string>>;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=schemaTools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaTools.d.ts","sourceRoot":"","sources":["../../src/utils/schemaTools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW;yBAEF;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;iCASZ;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;8BASvB;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;;;;6CASL;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE;0BAMnE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;wBAKtB;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;0BAIlB;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;iCAIb;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;yBAI5B;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;6CAKA;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE;2CAMlD;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE;sCAKvC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE;+BAMvD;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;oBAM9B,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAe;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;kBAI9D,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAe;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;oCAO3C;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;qBAMlC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAe;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;qCAM5E;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;0CAMhC;QAAE,YAAY,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;kBAOpE,CAAC,EAAE,CAAC,aACL,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,cACnB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eACb,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;;;;;;;oBAsBf,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;;CAwBxC,CAAC"}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard utilities for runtime type checking
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to check if a value is a non-null object (excluding arrays)
|
|
8
|
+
*
|
|
9
|
+
* @param value - The value to check
|
|
10
|
+
* @returns True if the value is a plain object
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* if (isRecord(value)) {
|
|
15
|
+
* // value is Record<string, unknown>
|
|
16
|
+
* const keys = Object.keys(value);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Type guard to check if an object has a specific property
|
|
25
|
+
*
|
|
26
|
+
* @param obj - The object to check
|
|
27
|
+
* @param key - The property key to look for
|
|
28
|
+
* @returns True if the object has the property
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* if (hasProperty(obj, 'name')) {
|
|
33
|
+
* // obj is Record<'name', unknown>
|
|
34
|
+
* console.log(obj.name);
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare function hasProperty<K extends PropertyKey>(obj: unknown, key: K): obj is Record<K, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Type guard to check if a value is a non-empty string
|
|
43
|
+
*
|
|
44
|
+
* @param value - The value to check
|
|
45
|
+
* @returns True if the value is a non-empty string
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* if (isNonEmptyString(value)) {
|
|
50
|
+
* // value is string with length > 0
|
|
51
|
+
* console.log(value.toUpperCase());
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
export declare function isNonEmptyString(value: unknown): value is string;
|
|
58
|
+
/**
|
|
59
|
+
* Type guard to check if a value is a valid array
|
|
60
|
+
*
|
|
61
|
+
* @param value - The value to check
|
|
62
|
+
* @returns True if the value is an array
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* if (isArray(value)) {
|
|
67
|
+
* // value is unknown[]
|
|
68
|
+
* value.forEach(item => console.log(item));
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export declare function isArray<T = unknown>(value: unknown): value is T[];
|
|
75
|
+
/**
|
|
76
|
+
* Type guard to check if a value is a non-empty array
|
|
77
|
+
*
|
|
78
|
+
* @param value - The value to check
|
|
79
|
+
* @returns True if the value is a non-empty array
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* if (isNonEmptyArray(items)) {
|
|
84
|
+
* // items is [T, ...T[]] - guaranteed to have at least one element
|
|
85
|
+
* const first = items[0]; // Safe access
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export declare function isNonEmptyArray<T>(value: unknown): value is [T, ...T[]];
|
|
92
|
+
/**
|
|
93
|
+
* Type guard to check if a value is a function
|
|
94
|
+
*
|
|
95
|
+
* @param value - The value to check
|
|
96
|
+
* @returns True if the value is a function
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* if (isFunction(callback)) {
|
|
101
|
+
* // callback is (...args: unknown[]) => unknown
|
|
102
|
+
* callback();
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
export declare function isFunction(value: unknown): value is (...args: readonly unknown[]) => unknown;
|
|
109
|
+
/**
|
|
110
|
+
* Type guard to check if a value is a string
|
|
111
|
+
*
|
|
112
|
+
* @param value - The value to check
|
|
113
|
+
* @returns True if the value is a string (including empty string)
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* if (isString(value)) {
|
|
118
|
+
* // value is string
|
|
119
|
+
* console.log(value.length);
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
export declare function isString(value: unknown): value is string;
|
|
126
|
+
/**
|
|
127
|
+
* Type guard to check if a value is a number (excluding NaN)
|
|
128
|
+
*
|
|
129
|
+
* @param value - The value to check
|
|
130
|
+
* @returns True if the value is a valid number
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* if (isNumber(value)) {
|
|
135
|
+
* // value is number (not NaN)
|
|
136
|
+
* const doubled = value * 2;
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @public
|
|
141
|
+
*/
|
|
142
|
+
export declare function isNumber(value: unknown): value is number;
|
|
143
|
+
/**
|
|
144
|
+
* Type guard to check if a value is a boolean
|
|
145
|
+
*
|
|
146
|
+
* @param value - The value to check
|
|
147
|
+
* @returns True if the value is a boolean
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* if (isBoolean(value)) {
|
|
152
|
+
* // value is boolean
|
|
153
|
+
* console.log(!value);
|
|
154
|
+
* }
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
159
|
+
export declare function isBoolean(value: unknown): value is boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Type guard to check if a value is null
|
|
162
|
+
*
|
|
163
|
+
* @param value - The value to check
|
|
164
|
+
* @returns True if the value is null
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* if (isNull(value)) {
|
|
169
|
+
* // value is null
|
|
170
|
+
* return defaultValue;
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
export declare function isNull(value: unknown): value is null;
|
|
177
|
+
/**
|
|
178
|
+
* Type guard to check if a value is undefined
|
|
179
|
+
*
|
|
180
|
+
* @param value - The value to check
|
|
181
|
+
* @returns True if the value is undefined
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* if (isUndefined(value)) {
|
|
186
|
+
* // value is undefined
|
|
187
|
+
* return defaultValue;
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
193
|
+
export declare function isUndefined(value: unknown): value is undefined;
|
|
194
|
+
/**
|
|
195
|
+
* Type guard to check if a value is null or undefined
|
|
196
|
+
*
|
|
197
|
+
* @param value - The value to check
|
|
198
|
+
* @returns True if the value is nullish
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* if (isNullish(value)) {
|
|
203
|
+
* // value is null | undefined
|
|
204
|
+
* return defaultValue;
|
|
205
|
+
* }
|
|
206
|
+
*
|
|
207
|
+
* if (!isNullish(value)) {
|
|
208
|
+
* // value is NonNullable<typeof value>
|
|
209
|
+
* console.log(value);
|
|
210
|
+
* }
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* @public
|
|
214
|
+
*/
|
|
215
|
+
export declare function isNullish(value: unknown): value is null | undefined;
|
|
216
|
+
/**
|
|
217
|
+
* Type guard to check if a value is defined (not null or undefined)
|
|
218
|
+
*
|
|
219
|
+
* @param value - The value to check
|
|
220
|
+
* @returns True if the value is not null or undefined
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```typescript
|
|
224
|
+
* const filtered = items.filter(isDefined);
|
|
225
|
+
* // filtered has type: NonNullable<T>[]
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
export declare function isDefined<T>(value: T): value is NonNullable<T>;
|
|
231
|
+
/**
|
|
232
|
+
* Type guard to check if a value is a Date object
|
|
233
|
+
*
|
|
234
|
+
* @param value - The value to check
|
|
235
|
+
* @returns True if the value is a Date
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* if (isDate(value)) {
|
|
240
|
+
* // value is Date
|
|
241
|
+
* console.log(value.toISOString());
|
|
242
|
+
* }
|
|
243
|
+
* ```
|
|
244
|
+
*
|
|
245
|
+
* @public
|
|
246
|
+
*/
|
|
247
|
+
export declare function isDate(value: unknown): value is Date;
|
|
248
|
+
/**
|
|
249
|
+
* Type guard to check if a value is a Promise
|
|
250
|
+
*
|
|
251
|
+
* @param value - The value to check
|
|
252
|
+
* @returns True if the value is a Promise
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```typescript
|
|
256
|
+
* if (isPromise(value)) {
|
|
257
|
+
* // value is Promise<unknown>
|
|
258
|
+
* const result = await value;
|
|
259
|
+
* }
|
|
260
|
+
* ```
|
|
261
|
+
*
|
|
262
|
+
* @public
|
|
263
|
+
*/
|
|
264
|
+
export declare function isPromise(value: unknown): value is Promise<unknown>;
|
|
265
|
+
/**
|
|
266
|
+
* Type guard to check if an error is an Error instance
|
|
267
|
+
*
|
|
268
|
+
* @param error - The error to check
|
|
269
|
+
* @returns True if the error is an Error instance
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```typescript
|
|
273
|
+
* try {
|
|
274
|
+
* // ...
|
|
275
|
+
* } catch (error) {
|
|
276
|
+
* if (isError(error)) {
|
|
277
|
+
* // error is Error
|
|
278
|
+
* console.error(error.message);
|
|
279
|
+
* }
|
|
280
|
+
* }
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* @public
|
|
284
|
+
*/
|
|
285
|
+
export declare function isError(error: unknown): error is Error;
|
|
286
|
+
/**
|
|
287
|
+
* Type guard to check if a value matches a specific type using a validator function
|
|
288
|
+
*
|
|
289
|
+
* @param value - The value to check
|
|
290
|
+
* @param validator - Function that returns true if value matches the type
|
|
291
|
+
* @returns True if the value matches the type
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```typescript
|
|
295
|
+
* interface User {
|
|
296
|
+
* id: string;
|
|
297
|
+
* name: string;
|
|
298
|
+
* }
|
|
299
|
+
*
|
|
300
|
+
* const isUser = (value: unknown): value is User =>
|
|
301
|
+
* isRecord(value) &&
|
|
302
|
+
* hasProperty(value, 'id') &&
|
|
303
|
+
* hasProperty(value, 'name') &&
|
|
304
|
+
* isString(value.id) &&
|
|
305
|
+
* isString(value.name);
|
|
306
|
+
*
|
|
307
|
+
* if (isUser(data)) {
|
|
308
|
+
* // data is User
|
|
309
|
+
* console.log(data.name);
|
|
310
|
+
* }
|
|
311
|
+
* ```
|
|
312
|
+
*
|
|
313
|
+
* @public
|
|
314
|
+
*/
|
|
315
|
+
export declare function matches<T>(value: unknown, validator: (value: unknown) => value is T): value is T;
|
|
316
|
+
//# sourceMappingURL=typeGuards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["../../src/utils/typeGuards.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,EAC/C,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,CAAC,GACL,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAE3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,EAAE,CAEjE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAEvE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,SAAS,OAAO,EAAE,KAAK,OAAO,CAEnD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE1D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,SAAS,CAEnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAE9D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAMnE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,GACxC,KAAK,IAAI,CAAC,CAEZ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Path, Control, PathValue, FieldValues, DeepPartialSkipArrayKey } from "react-hook-form";
|
|
2
|
+
/**
|
|
3
|
+
* Core watch functions for React Hook Form
|
|
4
|
+
* These are the primary building blocks for form watching
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Utility type to ensure array elements are all Path<T>
|
|
8
|
+
*/
|
|
9
|
+
export type PathArray<T extends FieldValues> = ReadonlyArray<Path<T>>;
|
|
10
|
+
/**
|
|
11
|
+
* Hook to watch entire form - returns all form values
|
|
12
|
+
*/
|
|
13
|
+
export declare const useWatchForm: <TFieldValues extends FieldValues>(control: Control<TFieldValues>) => DeepPartialSkipArrayKey<TFieldValues>;
|
|
14
|
+
/**
|
|
15
|
+
* Hook to watch single field by path - supports any nested path
|
|
16
|
+
*/
|
|
17
|
+
export declare const useWatchField: <TFieldValues extends FieldValues, TName extends Path<TFieldValues>>(control: Control<TFieldValues>, name: TName) => PathValue<TFieldValues, TName>;
|
|
18
|
+
/**
|
|
19
|
+
* Hook to watch multiple fields by paths - returns array of values
|
|
20
|
+
*/
|
|
21
|
+
export declare const useWatchFields: <TFieldValues extends FieldValues, TNames extends ReadonlyArray<Path<TFieldValues>>>(control: Control<TFieldValues>, names: TNames) => Array<PathValue<TFieldValues, TNames[number]>>;
|
|
22
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/utils/watch/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,OAAO,EACP,SAAS,EACT,WAAW,EACX,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAGzB;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,WAAW,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,YAAY,SAAS,WAAW,EAC3D,SAAS,OAAO,CAAC,YAAY,CAAC,KAC7B,uBAAuB,CAAC,YAAY,CAA0B,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,YAAY,SAAS,WAAW,EAChC,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,EAEhC,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,MAAM,KAAK,KACV,SAAS,CAAC,YAAY,EAAE,KAAK,CAAgC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,YAAY,SAAS,WAAW,EAChC,MAAM,SAAS,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAEhD,SAAS,OAAO,CAAC,YAAY,CAAC,EAC9B,OAAO,MAAM,KACZ,KAAK,CAAC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAyF,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;AAqP1E,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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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> & Record<string, unknown>;
|
|
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
|