@viasat/beam-react 2.49.1 → 2.50.0
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/CHANGELOG.md +10 -0
- package/chunks/{ActionList.Group.CsXcqrHE.js → ActionList.Group.B8krXDRr.js} +2 -2
- package/chunks/{ActionList.Group.BJLwm1y8.js → ActionList.Group.bDvNGHXt.js} +1 -1
- package/chunks/{ActionList.Item.SCmR5B7U.js → ActionList.Item.D36mdR8z.js} +2 -2
- package/chunks/{ActionList.Item.CuSuiBb9.js → ActionList.Item.D7UqN7UZ.js} +1 -1
- package/chunks/{Avatar.vskLO63E.js → Avatar.CLp1vcIw.js} +1 -1
- package/chunks/{Avatar.aPIu1j1C.js → Avatar.Cz2QnJYw.js} +1 -1
- package/chunks/{BreadcrumbsItem.DX3YrRLr.js → BreadcrumbsItem.BU74Md4d.js} +1 -1
- package/chunks/{BreadcrumbsItem.BnAUmm-M.js → BreadcrumbsItem.DC3CIyBO.js} +1 -1
- package/chunks/{DateField.Segment.ZcYoijpc.js → DateField.Segment.CqFLhMYA.js} +1 -1
- package/chunks/{DateField.Segment.CtHATxv0.js → DateField.Segment.CwhRnhtq.js} +1 -1
- package/chunks/{FloatingUI.arrow.BVP4jp8w.js → FloatingUI.arrow.CB6wbxoe.js} +1 -1
- package/chunks/{FloatingUI.arrow.D94RYHjd.js → FloatingUI.arrow.Rt_-JWqi.js} +1 -1
- package/chunks/{Search.Results.Bnw2OhV0.js → Search.Results.Bi9yeba5.js} +1 -1
- package/chunks/{Search.Results.Cgaa0bVk.js → Search.Results.BpCZFXhm.js} +1 -1
- package/chunks/{SpinnerWrap.D1la2z5e.js → SpinnerWrap.DRkg-idE.js} +1 -1
- package/chunks/{SpinnerWrap.ildr7CH1.js → SpinnerWrap.TzpkcQZt.js} +1 -1
- package/chunks/{classNames.B-9Vv1IR.js → classNames.BFQUGnCN.js} +1 -1
- package/chunks/{classNames.DDPjBhjA.js → classNames.CA_0DokS.js} +1 -1
- package/chunks/{dataTable.CrCD_4ro.js → dataTable.BeVtkYp6.js} +1 -1
- package/chunks/{dataTable.Dkn26NSq.js → dataTable.DQQX95em.js} +1 -1
- package/chunks/{form.context.B3XMEqme.js → form.context.BDYA2JQs.js} +1 -1
- package/chunks/{form.context.BfZzYt36.js → form.context.CkC0TwMb.js} +1 -1
- package/chunks/{helpers.B4xpu88P.js → helpers.BIckGIbP.js} +1 -1
- package/chunks/{helpers.DnurYbTL.js → helpers.CiQfGwdc.js} +25 -23
- package/chunks/useFormValidator.hook.BM-e4j8b.js +184 -0
- package/chunks/useFormValidator.hook.CbrwDKcG.js +1 -0
- package/index.cjs.js +1 -1
- package/index.es.js +3 -3
- package/lib/Accordion/Accordion.cjs.js +1 -1
- package/lib/Accordion/Accordion.es.js +1 -1
- package/lib/Accordion/AccordionGroup.cjs.js +1 -1
- package/lib/Accordion/AccordionGroup.es.js +1 -1
- package/lib/ActionList/ActionList.Group.cjs.js +1 -1
- package/lib/ActionList/ActionList.Group.es.js +3 -3
- package/lib/ActionList/ActionList.IconButton.cjs.js +1 -1
- package/lib/ActionList/ActionList.IconButton.es.js +2 -2
- package/lib/ActionList/ActionList.Item.cjs.js +1 -1
- package/lib/ActionList/ActionList.Item.es.js +3 -3
- package/lib/ActionList/ActionList.cjs.js +1 -1
- package/lib/ActionList/ActionList.es.js +4 -4
- package/lib/ActionList/useActionListChildren.cjs.js +1 -1
- package/lib/ActionList/useActionListChildren.es.js +2 -2
- package/lib/Alert/Alert.cjs.js +1 -1
- package/lib/Alert/Alert.es.js +2 -2
- package/lib/Autocomplete/Autocomplete.cjs.js +1 -1
- package/lib/Autocomplete/Autocomplete.es.js +2 -2
- package/lib/Autocomplete/AutocompleteDropdown.cjs.js +1 -1
- package/lib/Autocomplete/AutocompleteDropdown.es.js +3 -3
- package/lib/Autocomplete/AutocompleteField.cjs.js +1 -1
- package/lib/Autocomplete/AutocompleteField.es.js +1 -1
- package/lib/Autocomplete/useAutocompleteA11y.cjs.js +1 -1
- package/lib/Autocomplete/useAutocompleteA11y.es.js +16 -15
- package/lib/Avatar/Avatar.cjs.js +1 -1
- package/lib/Avatar/Avatar.es.js +1 -1
- package/lib/Avatar/AvatarGroup.cjs.js +1 -1
- package/lib/Avatar/AvatarGroup.es.js +1 -1
- package/lib/Avatar/index.cjs.js +1 -1
- package/lib/Avatar/index.es.js +1 -1
- package/lib/Badge/Badge.cjs.js +1 -1
- package/lib/Badge/Badge.es.js +1 -1
- package/lib/BadgeDot/BadgeDot.cjs.js +1 -1
- package/lib/BadgeDot/BadgeDot.es.js +1 -1
- package/lib/Box/Box.cjs.js +1 -1
- package/lib/Box/Box.es.js +1 -1
- package/lib/Breadcrumbs/Breadcrumbs.cjs.js +1 -1
- package/lib/Breadcrumbs/Breadcrumbs.es.js +2 -2
- package/lib/Breadcrumbs/BreadcrumbsItem.cjs.js +1 -1
- package/lib/Breadcrumbs/BreadcrumbsItem.es.js +2 -2
- package/lib/Breadcrumbs/index.cjs.js +1 -1
- package/lib/Breadcrumbs/index.es.js +1 -1
- package/lib/Button/Button.cjs.js +1 -1
- package/lib/Button/Button.es.js +2 -2
- package/lib/Card/AspectRatio.cjs.js +1 -1
- package/lib/Card/AspectRatio.es.js +1 -1
- package/lib/Card/Card.Body.cjs.js +1 -1
- package/lib/Card/Card.Body.es.js +1 -1
- package/lib/Card/Card.Content.cjs.js +1 -1
- package/lib/Card/Card.Content.es.js +1 -1
- package/lib/Card/Card.Footer.cjs.js +1 -1
- package/lib/Card/Card.Footer.es.js +1 -1
- package/lib/Card/Card.Header.cjs.js +1 -1
- package/lib/Card/Card.Header.es.js +1 -1
- package/lib/Card/Card.Media.cjs.js +1 -1
- package/lib/Card/Card.Media.es.js +1 -1
- package/lib/Card/Card.cjs.js +1 -1
- package/lib/Card/Card.es.js +2 -2
- package/lib/Card/CardGroup.cjs.js +1 -1
- package/lib/Card/CardGroup.es.js +2 -2
- package/lib/Checkbox/Checkbox.cjs.js +1 -1
- package/lib/Checkbox/Checkbox.es.js +2 -2
- package/lib/Chips/Chip.cjs.js +1 -1
- package/lib/Chips/Chip.es.js +1 -1
- package/lib/Chips/ChipGroup.cjs.js +1 -1
- package/lib/Chips/ChipGroup.es.js +1 -1
- package/lib/CloseButton/CloseButton.cjs.js +1 -1
- package/lib/CloseButton/CloseButton.es.js +1 -1
- package/lib/Dialog/Dialog.Body.cjs.js +1 -1
- package/lib/Dialog/Dialog.Body.es.js +1 -1
- package/lib/Dialog/Dialog.Content.cjs.js +1 -1
- package/lib/Dialog/Dialog.Content.es.js +1 -1
- package/lib/Dialog/Dialog.Footer.cjs.js +1 -1
- package/lib/Dialog/Dialog.Footer.es.js +1 -1
- package/lib/Dialog/Dialog.Header.cjs.js +1 -1
- package/lib/Dialog/Dialog.Header.es.js +1 -1
- package/lib/Divider/Divider.cjs.js +1 -1
- package/lib/Divider/Divider.es.js +1 -1
- package/lib/EmptyState/EmptyState.cjs.js +1 -1
- package/lib/EmptyState/EmptyState.es.js +2 -2
- package/lib/FileUpload/FileUpload.Button.cjs.js +1 -1
- package/lib/FileUpload/FileUpload.Button.es.js +1 -1
- package/lib/FileUpload/FileUpload.Dropzone.cjs.js +1 -1
- package/lib/FileUpload/FileUpload.Dropzone.es.js +1 -1
- package/lib/FileUpload/FileUpload.List.Item.cjs.js +1 -1
- package/lib/FileUpload/FileUpload.List.Item.es.js +2 -2
- package/lib/FileUpload/FileUpload.List.cjs.js +1 -1
- package/lib/FileUpload/FileUpload.List.es.js +1 -1
- package/lib/FileUpload/FileUpload.cjs.js +1 -1
- package/lib/FileUpload/FileUpload.es.js +2 -2
- package/lib/Flag/Flag.cjs.js +1 -1
- package/lib/Flag/Flag.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.arrow.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.arrow.es.js +2 -2
- package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.d.ts +2 -2
- package/lib/FloatingUI/FloatingUI.content.es.js +2 -2
- package/lib/Form/Form.cjs.js +1 -1
- package/lib/Form/Form.es.js +3 -3
- package/lib/Form/contexts/form.context.cjs.js +1 -1
- package/lib/Form/contexts/form.context.es.js +1 -1
- package/lib/Form/contexts/index.cjs.js +1 -1
- package/lib/Form/contexts/index.es.js +1 -1
- package/lib/Form/hooks/index.cjs.js +1 -1
- package/lib/Form/hooks/index.es.js +2 -2
- package/lib/Form/hooks/useFieldValidator.hook.cjs.js +1 -1
- package/lib/Form/hooks/useFieldValidator.hook.es.js +1 -1
- package/lib/Form/hooks/useFormValidator.hook.cjs.js +1 -1
- package/lib/Form/hooks/useFormValidator.hook.es.js +1 -1
- package/lib/Form/index.cjs.js +1 -1
- package/lib/Form/index.es.js +1 -1
- package/lib/Header/Header.cjs.js +1 -1
- package/lib/Header/Header.es.js +1 -1
- package/lib/Header/HeaderActionGroup.cjs.js +1 -1
- package/lib/Header/HeaderActionGroup.es.js +1 -1
- package/lib/Header/HeaderMasthead.cjs.js +1 -1
- package/lib/Header/HeaderMasthead.es.js +1 -1
- package/lib/Header/HeaderSideNavTrigger.cjs.js +1 -1
- package/lib/Header/HeaderSideNavTrigger.es.js +1 -1
- package/lib/HelperText/HelperText.cjs.js +1 -1
- package/lib/HelperText/HelperText.es.js +2 -2
- package/lib/HelperText/index.cjs.js +1 -1
- package/lib/HelperText/index.es.js +1 -1
- package/lib/Icon/Icon.cjs.js +1 -1
- package/lib/Icon/Icon.es.js +1 -1
- package/lib/InputChoiceGroup/InputChoiceGroup.cjs.js +1 -1
- package/lib/InputChoiceGroup/InputChoiceGroup.es.js +10 -10
- package/lib/Label/Label.cjs.js +1 -1
- package/lib/Label/Label.es.js +2 -2
- package/lib/Link/Link.cjs.js +1 -1
- package/lib/Link/Link.es.js +1 -1
- package/lib/List/List.Item.cjs.js +1 -1
- package/lib/List/List.Item.es.js +1 -1
- package/lib/List/List.cjs.js +1 -1
- package/lib/List/List.es.js +1 -1
- package/lib/Logo/Logo.cjs.js +1 -1
- package/lib/Logo/Logo.es.js +1 -1
- package/lib/Menu/Menu.PopoverContent.cjs.js +1 -1
- package/lib/Menu/Menu.PopoverContent.es.js +1 -1
- package/lib/NativeSelect/NativeSelect.cjs.js +1 -1
- package/lib/NativeSelect/NativeSelect.es.js +18 -18
- package/lib/PageHeader/PageHeader.cjs.js +1 -1
- package/lib/PageHeader/PageHeader.es.js +1 -1
- package/lib/PageLayout/PageLayout.cjs.js +1 -1
- package/lib/PageLayout/PageLayout.es.js +1 -1
- package/lib/PageLayout/PageLayoutAside.cjs.js +1 -1
- package/lib/PageLayout/PageLayoutAside.es.js +1 -1
- package/lib/PageLayout/PageLayoutHeader.cjs.js +1 -1
- package/lib/PageLayout/PageLayoutHeader.es.js +1 -1
- package/lib/PageLayout/PageLayoutMain.cjs.js +1 -1
- package/lib/PageLayout/PageLayoutMain.es.js +1 -1
- package/lib/Pagination/PageButton.cjs.js +1 -1
- package/lib/Pagination/PageButton.es.js +1 -1
- package/lib/Pagination/Pagination.cjs.js +1 -1
- package/lib/Pagination/Pagination.es.js +1 -1
- package/lib/Pagination/PaginationControls.cjs.js +1 -1
- package/lib/Pagination/PaginationControls.es.js +1 -1
- package/lib/Pagination/Truncation.cjs.js +1 -1
- package/lib/Pagination/Truncation.es.js +1 -1
- package/lib/Panel/Footer/Panel.Footer.Actions.cjs.js +1 -1
- package/lib/Panel/Footer/Panel.Footer.Actions.es.js +1 -1
- package/lib/Panel/Footer/Panel.Footer.cjs.js +1 -1
- package/lib/Panel/Footer/Panel.Footer.es.js +1 -1
- package/lib/Panel/Header/Panel.Header.ContentAfter.cjs.js +1 -1
- package/lib/Panel/Header/Panel.Header.ContentAfter.es.js +1 -1
- package/lib/Panel/Header/Panel.Header.ContentBefore.cjs.js +1 -1
- package/lib/Panel/Header/Panel.Header.ContentBefore.es.js +1 -1
- package/lib/Panel/Header/Panel.Header.Description.cjs.js +1 -1
- package/lib/Panel/Header/Panel.Header.Description.es.js +1 -1
- package/lib/Panel/Header/Panel.Header.Heading.cjs.js +1 -1
- package/lib/Panel/Header/Panel.Header.Heading.es.js +1 -1
- package/lib/Panel/Header/Panel.Header.Row.cjs.js +1 -1
- package/lib/Panel/Header/Panel.Header.Row.es.js +1 -1
- package/lib/Panel/Header/Panel.Header.Subheader.cjs.js +1 -1
- package/lib/Panel/Header/Panel.Header.Subheader.es.js +1 -1
- package/lib/Panel/Header/Panel.Header.cjs.js +1 -1
- package/lib/Panel/Header/Panel.Header.es.js +1 -1
- package/lib/Panel/Panel.Body.cjs.js +1 -1
- package/lib/Panel/Panel.Body.es.js +1 -1
- package/lib/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/Panel/Panel.Inline.es.js +1 -1
- package/lib/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/Panel/Panel.Overlay.es.js +1 -1
- package/lib/Panel/Panel.ResizeHandle.cjs.js +1 -1
- package/lib/Panel/Panel.ResizeHandle.es.js +1 -1
- package/lib/Panel/Panel.cjs.js +1 -1
- package/lib/Panel/Panel.es.js +1 -1
- package/lib/Popover/Popover.cjs.js +1 -1
- package/lib/Popover/Popover.content.cjs.js +1 -1
- package/lib/Popover/Popover.content.es.js +1 -1
- package/lib/Popover/Popover.es.js +1 -1
- package/lib/ProgressBar/ProgressBar.cjs.js +1 -1
- package/lib/ProgressBar/ProgressBar.es.js +2 -2
- package/lib/RadioButton/RadioButton.cjs.js +1 -1
- package/lib/RadioButton/RadioButton.es.js +2 -2
- package/lib/Search/Search.Results.ViewAll.cjs.js +1 -1
- package/lib/Search/Search.Results.ViewAll.es.js +2 -2
- package/lib/Search/Search.Results.cjs.js +1 -1
- package/lib/Search/Search.Results.es.js +2 -2
- package/lib/Search/Search.cjs.js +1 -1
- package/lib/Search/Search.es.js +3 -3
- package/lib/Search/SearchDropdown.cjs.js +1 -1
- package/lib/Search/SearchDropdown.es.js +3 -3
- package/lib/SegmentedControl/SegmentedControl.Item.cjs.js +1 -1
- package/lib/SegmentedControl/SegmentedControl.Item.es.js +1 -1
- package/lib/SegmentedControl/SegmentedControl.List.cjs.js +1 -1
- package/lib/SegmentedControl/SegmentedControl.List.es.js +1 -1
- package/lib/SegmentedControl/SegmentedControl.Panel.cjs.js +1 -1
- package/lib/SegmentedControl/SegmentedControl.Panel.es.js +1 -1
- package/lib/SegmentedControl/SegmentedControl.cjs.js +1 -1
- package/lib/SegmentedControl/SegmentedControl.es.js +1 -1
- package/lib/Select/Select.cjs.js +1 -1
- package/lib/Select/Select.es.js +2 -2
- package/lib/Select/SelectDropdown.cjs.js +1 -1
- package/lib/Select/SelectDropdown.es.js +3 -3
- package/lib/Select/SelectField.cjs.js +1 -1
- package/lib/Select/SelectField.es.js +1 -1
- package/lib/Select/useSelectA11y.cjs.js +1 -1
- package/lib/Select/useSelectA11y.es.js +13 -12
- package/lib/SideNav/SideNav.cjs.js +1 -1
- package/lib/SideNav/SideNav.es.js +1 -1
- package/lib/SideNav/SideNavActionListGroup.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListGroup.es.js +2 -2
- package/lib/SideNav/SideNavActionListGroupHeading.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListGroupHeading.es.js +1 -1
- package/lib/SideNav/SideNavActionListItem.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItem.es.js +2 -2
- package/lib/SideNav/SideNavActionListItemExpandable.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItemExpandable.es.js +2 -2
- package/lib/SideNav/SideNavActionListItemFlyout.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItemFlyout.es.js +1 -1
- package/lib/SideNav/SideNavBody.cjs.js +1 -1
- package/lib/SideNav/SideNavBody.es.js +2 -2
- package/lib/SideNav/SideNavContext.cjs.js +1 -1
- package/lib/SideNav/SideNavContext.es.js +1 -1
- package/lib/SideNav/SideNavFooter.cjs.js +1 -1
- package/lib/SideNav/SideNavFooter.es.js +1 -1
- package/lib/SideNav/SideNavHeader.cjs.js +1 -1
- package/lib/SideNav/SideNavHeader.es.js +1 -1
- package/lib/Slider/DualSlider.cjs.js +1 -1
- package/lib/Slider/DualSlider.es.js +1 -1
- package/lib/Slider/SingleSlider.cjs.js +1 -1
- package/lib/Slider/SingleSlider.es.js +1 -1
- package/lib/Slider/Slider.Error.cjs.js +1 -1
- package/lib/Slider/Slider.Error.es.js +2 -2
- package/lib/Slider/Slider.TextField.cjs.js +1 -1
- package/lib/Slider/Slider.TextField.es.js +1 -1
- package/lib/Slider/Slider.Thumb.cjs.js +1 -1
- package/lib/Slider/Slider.Thumb.es.js +2 -2
- package/lib/Slider/Slider.TickMarks.cjs.js +1 -1
- package/lib/Slider/Slider.TickMarks.es.js +1 -1
- package/lib/Slider/Slider.ValueAxisLabels.cjs.js +1 -1
- package/lib/Slider/Slider.ValueAxisLabels.es.js +1 -1
- package/lib/Slider/hooks/useSliderBase.cjs.js +1 -1
- package/lib/Slider/hooks/useSliderBase.es.js +5 -4
- package/lib/Spinner/Spinner.cjs.js +1 -1
- package/lib/Spinner/Spinner.es.js +1 -1
- package/lib/Spinner/SpinnerWrap.cjs.js +1 -1
- package/lib/Spinner/SpinnerWrap.es.js +1 -1
- package/lib/StateLayer/StateLayer.cjs.js +1 -1
- package/lib/StateLayer/StateLayer.es.js +1 -1
- package/lib/Stepper/Stepper.Body.cjs.js +1 -1
- package/lib/Stepper/Stepper.Body.es.js +1 -1
- package/lib/Stepper/Stepper.Heading.cjs.js +1 -1
- package/lib/Stepper/Stepper.Heading.es.js +1 -1
- package/lib/Stepper/Stepper.Marker.cjs.js +1 -1
- package/lib/Stepper/Stepper.Marker.es.js +1 -1
- package/lib/Stepper/Stepper.Step.cjs.js +1 -1
- package/lib/Stepper/Stepper.Step.es.js +1 -1
- package/lib/Stepper/Stepper.cjs.js +1 -1
- package/lib/Stepper/Stepper.es.js +1 -1
- package/lib/Switch/Switch.cjs.js +1 -1
- package/lib/Switch/Switch.es.js +2 -2
- package/lib/Tabs/Tabs.Group.cjs.js +1 -1
- package/lib/Tabs/Tabs.Group.es.js +2 -2
- package/lib/Tabs/Tabs.Item.cjs.js +1 -1
- package/lib/Tabs/Tabs.Item.es.js +1 -1
- package/lib/Tabs/Tabs.Panel.cjs.js +1 -1
- package/lib/Tabs/Tabs.Panel.es.js +1 -1
- package/lib/Tabs/Tabs.cjs.js +1 -1
- package/lib/Tabs/Tabs.es.js +1 -1
- package/lib/Text/Text.cjs.js +1 -1
- package/lib/Text/Text.es.js +1 -1
- package/lib/TextArea/TextArea.cjs.js +1 -1
- package/lib/TextArea/TextArea.es.js +2 -2
- package/lib/TextField/TextField.cjs.js +1 -1
- package/lib/TextField/TextField.es.js +2 -2
- package/lib/Toasts/Toast.cjs.js +1 -1
- package/lib/Toasts/Toast.es.js +2 -2
- package/lib/Toasts/ToastContainer.cjs.js +1 -1
- package/lib/Toasts/ToastContainer.es.js +2 -2
- package/lib/Tooltip/Tooltip.cjs.js +1 -1
- package/lib/Tooltip/Tooltip.es.js +1 -1
- package/lib/_Navigation/classes.cjs.js +1 -1
- package/lib/_Navigation/classes.es.js +1 -1
- package/lib/_Options/OptionChips.cjs.js +1 -1
- package/lib/_Options/OptionChips.es.js +1 -1
- package/lib/_Options/useSelectValue.cjs.js +1 -1
- package/lib/_Options/useSelectValue.es.js +1 -1
- package/lib/index.cjs.js +1 -1
- package/lib/index.es.js +3 -3
- package/lib/wip/DataTable/DataTable.Body.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.Body.es.js +1 -1
- package/lib/wip/DataTable/DataTable.Cell.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.Cell.es.js +1 -1
- package/lib/wip/DataTable/DataTable.ColumnHeader.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.ColumnHeader.es.js +1 -1
- package/lib/wip/DataTable/DataTable.Footer.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.Footer.es.js +1 -1
- package/lib/wip/DataTable/DataTable.Head.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.Head.es.js +1 -1
- package/lib/wip/DataTable/DataTable.Header.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.Header.es.js +1 -1
- package/lib/wip/DataTable/DataTable.Row.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.Row.es.js +1 -1
- package/lib/wip/DataTable/DataTable.Toolbar.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.Toolbar.es.js +1 -1
- package/lib/wip/DataTable/DataTable.cjs.js +1 -1
- package/lib/wip/DataTable/DataTable.es.js +1 -1
- package/lib/wip/DateField/DateField.Segment.cjs.js +1 -1
- package/lib/wip/DateField/DateField.Segment.es.js +1 -1
- package/lib/wip/DateField/DateField.Segments.cjs.js +1 -1
- package/lib/wip/DateField/DateField.Segments.es.js +1 -1
- package/lib/wip/DateField/DateField.cjs.js +1 -1
- package/lib/wip/DateField/DateField.es.js +3 -3
- package/lib/wip/DateField/DateField.utils.cjs.js +1 -1
- package/lib/wip/DateField/DateField.utils.es.js +39 -37
- package/lib/wip/DateField/useDateFieldForm.cjs.js +1 -1
- package/lib/wip/DateField/useDateFieldForm.es.js +4 -3
- package/package.json +7 -7
- package/utils/hooks/index.cjs.js +1 -1
- package/utils/hooks/index.es.js +1 -1
- package/utils/hooks/useLocalStorage.cjs.js +1 -1
- package/utils/hooks/useLocalStorage.es.js +1 -1
- package/utils/spacing.cjs.js +1 -1
- package/utils/spacing.es.js +1 -1
- package/chunks/useFormValidator.hook.BtP4A6XY.js +0 -1
- package/chunks/useFormValidator.hook.CSmddwEt.js +0 -171
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import "../../../chunks/constants.Cruz2A1w.js";
|
|
2
|
+
import { a as d } from "../../../chunks/helpers.CiQfGwdc.js";
|
|
1
3
|
import { SEGMENT_MAX_LENGTH as u } from "./DateField.validation.es.js";
|
|
2
|
-
const
|
|
4
|
+
const y = new Intl.DateTimeFormat("en-US", { month: "long" }), R = (e) => y.format(new Date(2e3, e - 1, 1)), c = 31, s = 12, f = 1, m = 9999, S = (e, t, n) => Math.min(n, Math.max(t, e)), M = (e, t) => ((e - 1) % t + t) % t + 1, h = 2024, Y = (e, t) => t == null ? 31 : new Date(e ?? h, t, 0).getDate(), E = () => {
|
|
3
5
|
const e = /* @__PURE__ */ new Date();
|
|
4
6
|
return { day: e.getDate(), month: e.getMonth() + 1, year: e.getFullYear() };
|
|
5
|
-
}, o = (e) => e instanceof Date && !Number.isNaN(e.getTime()),
|
|
7
|
+
}, o = (e) => e instanceof Date && !Number.isNaN(e.getTime()), _ = (e, t, n, r) => {
|
|
6
8
|
if (n === "min") return e === "year" ? null : 1;
|
|
7
9
|
if (n === "max")
|
|
8
10
|
return e === "year" ? null : e === "day" ? r.daysInMonth : s;
|
|
@@ -11,48 +13,48 @@ const d = new Intl.DateTimeFormat("en-US", { month: "long" }), A = (e) => d.form
|
|
|
11
13
|
const g = e === "day" ? c : s;
|
|
12
14
|
return n > 0 ? 1 : g;
|
|
13
15
|
}
|
|
14
|
-
if (e === "year") return S(t + n,
|
|
16
|
+
if (e === "year") return S(t + n, f, m);
|
|
15
17
|
const l = e === "day" ? c : s;
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
+
return M(t + n, l);
|
|
19
|
+
}, N = { day: "", month: "", year: "" }, T = (e) => {
|
|
18
20
|
const { day: t, month: n, year: r } = e;
|
|
19
21
|
if (t == null || n == null || r == null) return null;
|
|
20
22
|
const l = new Date(r, n - 1, t);
|
|
21
23
|
return l.setFullYear(r), Number.isNaN(l.getTime()) || l.getFullYear() !== r || l.getMonth() !== n - 1 || l.getDate() !== t ? null : l;
|
|
22
|
-
},
|
|
24
|
+
}, D = (e, t) => e == null && t == null ? !0 : e == null || t == null ? !1 : e.getTime() === t.getTime(), a = d, I = (e) => o(e) ? a(e) : null, V = (e, t, n) => {
|
|
23
25
|
const r = a(e);
|
|
24
26
|
return !(o(t) && r < a(t) || o(n) && r > a(n));
|
|
25
|
-
},
|
|
26
|
-
if (
|
|
27
|
+
}, p = (e, t) => o(e) && o(t) && a(e) > a(t), O = (e, t, n) => {
|
|
28
|
+
if (p(t, n)) return e;
|
|
27
29
|
const r = a(e);
|
|
28
30
|
return o(t) && r < a(t) ? new Date(t.getFullYear(), t.getMonth(), t.getDate()) : o(n) && r > a(n) ? new Date(n.getFullYear(), n.getMonth(), n.getDate()) : e;
|
|
29
|
-
},
|
|
31
|
+
}, P = (e) => {
|
|
30
32
|
if (!o(e)) return "";
|
|
31
33
|
const t = String(e.getFullYear()).padStart(4, "0"), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
32
34
|
return `${t}-${n}-${r}`;
|
|
33
|
-
},
|
|
35
|
+
}, X = (e) => e.filter(
|
|
34
36
|
(t) => t.type !== "literal"
|
|
35
|
-
).map((t) => t.type),
|
|
37
|
+
).map((t) => t.type), C = (e) => o(e) ? {
|
|
36
38
|
day: String(e.getDate()).padStart(2, "0"),
|
|
37
39
|
month: String(e.getMonth() + 1).padStart(2, "0"),
|
|
38
40
|
year: String(e.getFullYear()).padStart(4, "0")
|
|
39
|
-
} :
|
|
41
|
+
} : N, i = (e, t) => {
|
|
40
42
|
if (t === "" || e === "year" && t.length < u.year) return null;
|
|
41
43
|
const n = parseInt(t, 10);
|
|
42
44
|
return Number.isNaN(n) || n === 0 ? null : n;
|
|
43
|
-
},
|
|
45
|
+
}, K = (e) => T({
|
|
44
46
|
day: i("day", e.day),
|
|
45
47
|
month: i("month", e.month),
|
|
46
48
|
year: i("year", e.year)
|
|
47
|
-
}),
|
|
49
|
+
}), L = (e, t) => t === "" ? "" : t.padStart(u[e], "0"), H = (e, t, n) => t === "" ? { displayValue: n, isPlaceholder: !0 } : {
|
|
48
50
|
displayValue: t.padStart(u[e], "0"),
|
|
49
51
|
isPlaceholder: !1
|
|
50
|
-
},
|
|
52
|
+
}, $ = (e) => {
|
|
51
53
|
const t = window.getSelection();
|
|
52
54
|
if (!t) return;
|
|
53
55
|
const n = document.createRange();
|
|
54
56
|
n.selectNodeContents(e), t.removeAllRanges(), t.addRange(n);
|
|
55
|
-
},
|
|
57
|
+
}, b = (e) => {
|
|
56
58
|
var n;
|
|
57
59
|
if (!e) return;
|
|
58
60
|
const t = (n = window.getSelection) == null ? void 0 : n.call(window);
|
|
@@ -61,27 +63,27 @@ const d = new Intl.DateTimeFormat("en-US", { month: "long" }), A = (e) => d.form
|
|
|
61
63
|
export {
|
|
62
64
|
c as DAY_SPIN_MAX,
|
|
63
65
|
s as MONTH_MAX,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
m as YEAR_MAX,
|
|
67
|
+
f as YEAR_MIN,
|
|
68
|
+
_ as adjustSegmentValue,
|
|
67
69
|
S as clamp,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
O as clampDateToRange,
|
|
71
|
+
b as clearSelectionWithin,
|
|
72
|
+
I as dateKeyOrNull,
|
|
73
|
+
T as deriveValue,
|
|
74
|
+
K as deriveValueFromText,
|
|
75
|
+
Y as getDaysInMonth,
|
|
76
|
+
R as getMonthName,
|
|
77
|
+
H as getSegmentDisplay,
|
|
78
|
+
X as getSegmentOrder,
|
|
79
|
+
V as isDateInRange,
|
|
80
|
+
p as isMinMaxMisconfigured,
|
|
81
|
+
D as isSameDateValue,
|
|
82
|
+
L as normalizeSegmentText,
|
|
81
83
|
i as segmentNumber,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
C as segmentTextFromValue,
|
|
85
|
+
$ as selectElementContents,
|
|
86
|
+
P as toISODateString,
|
|
87
|
+
E as todayParts,
|
|
88
|
+
M as wrapInRange
|
|
87
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("clsx"),T=require("react"),u=require("../../../chunks/form.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("clsx"),T=require("react"),u=require("../../../chunks/form.context.CkC0TwMb.js");require("../../Form/contexts/label.context.cjs.js");require("../../Form/contexts/helperText.context.cjs.js");const s=require("../../Form/hooks/useAccessibleId.hook.cjs.js");require("../../../chunks/constants.CgMu0_1M.js");require("react/jsx-runtime");function L({name:i,disabled:b=!1,readOnly:q=!1,required:y=!1,defaultValue:I,error:e,hasHelperText:p,hasLabel:h,validationRules:F=[],ariaDescribedBy:f,ariaLabelledBy:m}){const{showErrors:v,isInvalid:x,errorShown:g,disabled:B,readOnly:_,required:A}=u.useFormField({name:i,validationRules:F,disabledProp:b,readOnlyProp:q,requiredProp:y}),{ctxInitialValues:D}=T.useContext(u.FormContext),{id:r}=s.useAccessibleId(),{id:d}=s.useAccessibleId(),{id:l}=s.useAccessibleId(),{id:o}=s.useAccessibleId(),t=!!(e!=null&&e.length),P=!!e||x,O=I??D[i],a=n(p&&d,t&&r,g&&l,f),c=n(h&&o,m);return{disabled:B,readOnly:_,required:A,invalid:P,errorMessageProvided:t,defaultValue:O,errorId:r,helperTextId:d,validationErrorsId:l,labelId:o,ariaDescribedBy:a.length>0?a:void 0,ariaLabelledBy:c.length>0?c:void 0,showErrors:v}}exports.useDateFieldForm=L;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import c from "clsx";
|
|
2
2
|
import { useContext as V } from "react";
|
|
3
|
-
import { b as w, F as C } from "../../../chunks/form.context.
|
|
3
|
+
import { b as w, F as C } from "../../../chunks/form.context.BDYA2JQs.js";
|
|
4
4
|
import "../../Form/contexts/label.context.es.js";
|
|
5
5
|
import "../../Form/contexts/helperText.context.es.js";
|
|
6
6
|
import { useAccessibleId as o } from "../../Form/hooks/useAccessibleId.hook.es.js";
|
|
7
|
+
import "../../../chunks/constants.Cruz2A1w.js";
|
|
7
8
|
import "react/jsx-runtime";
|
|
8
|
-
function
|
|
9
|
+
function G({
|
|
9
10
|
name: d,
|
|
10
11
|
disabled: m = !1,
|
|
11
12
|
readOnly: p = !1,
|
|
@@ -47,5 +48,5 @@ function z({
|
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
G as useDateFieldForm
|
|
51
52
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.50.0",
|
|
4
4
|
"description": "React component library for the Beam design system",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Viasat",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@viasat/beam-fonts": "2.
|
|
64
|
-
"@viasat/beam-shared": "2.
|
|
65
|
-
"@viasat/beam-styles": "2.
|
|
66
|
-
"@viasat/beam-tokens": "2.
|
|
67
|
-
"@viasat/beam-icons": "2.
|
|
68
|
-
"@viasat/beam-react-claude-plugin": "2.
|
|
63
|
+
"@viasat/beam-fonts": "2.50.0",
|
|
64
|
+
"@viasat/beam-shared": "2.50.0",
|
|
65
|
+
"@viasat/beam-styles": "2.50.0",
|
|
66
|
+
"@viasat/beam-tokens": "2.50.0",
|
|
67
|
+
"@viasat/beam-icons": "2.50.0",
|
|
68
|
+
"@viasat/beam-react-claude-plugin": "2.50.0",
|
|
69
69
|
"clsx": "^1.2.1",
|
|
70
70
|
"@floating-ui/react": "^0.26.18",
|
|
71
71
|
"@stepperize/react": "^5.1.5",
|
package/utils/hooks/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),d=require("../../chunks/constants.CgMu0_1M.js"),p=require("../../chunks/helpers.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),d=require("../../chunks/constants.CgMu0_1M.js"),p=require("../../chunks/helpers.BIckGIbP.js"),a=require("../../chunks/CSSLookup.k3ewV3rr.js"),w=require("./useId.cjs.js"),f=require("./usePrevious.cjs.js"),g=require("./useInteractiveProps.cjs.js");function h(e,t=window.getComputedStyle(e)){return parseInt(t.getPropertyValue("-webkit-line-clamp"),10)>=1&&t.getPropertyValue("display")==="-webkit-box"&&t.getPropertyValue("overflow")==="hidden"}function v(e,t=window.getComputedStyle(e)){return t.getPropertyValue("text-overflow")==="ellipsis"&&t.getPropertyValue("white-space")==="nowrap"&&t.getPropertyValue("overflow")==="hidden"&&e.scrollWidth>e.clientWidth}function S(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}function b(e){if(!e)return!1;if(S(e))return!0;const t=window.getComputedStyle(e);return h(e,t)||v(e,t)}const m=e=>{if(!e)return!1;const t=e.cloneNode(!0);t.style.position="absolute",t.style.whiteSpace="nowrap",t.style.width="auto",t.style.height="auto",t.style.visibility="hidden",document.body.appendChild(t);const n=t.offsetWidth>e.offsetWidth;return document.body.removeChild(t),n},l=(e,t=d.FPS_120,n=[])=>{const r=s.useRef(null);return s.useLayoutEffect(()=>{const{current:i}=r;if(!i)return;e();const u=p.debounce(()=>{e()},t),c=new ResizeObserver(u);return c.observe(i),()=>{c.disconnect(),u.cancel()}},[r,e,t,n]),{ref:r}},y=()=>{const[e,t]=s.useState(!1),n=()=>{r.current&&t(b(r.current))},{ref:r}=l(n);return{ref:r,isOverFlowing:e}},C=e=>{const[t,n]=s.useState(!1),r=()=>{i.current&&n(m(i.current))},{ref:i}=l(r,200);return{ref:i,isTextWrapping:t}},W=e=>{const[t,n]=s.useState(()=>a.CSSManager.findVar(e)??"");return s.useEffect(()=>{const r=i=>{n(i)};return a.CSSManager.findVar(e,r),()=>{a.CSSManager.unsubscribe(e,r)}},[e]),t};function P(e){const[t,n]=s.useState(!1);return s.useLayoutEffect(()=>{if(typeof window>"u")return;const r=o=>o?getComputedStyle(o).direction:"ltr",i=()=>{const o=e.current;return o?r(o)==="rtl"||!!o.closest('[dir="rtl"]')||r(document.documentElement)==="rtl":!1};n(i());const u=new MutationObserver(()=>n(i()));u.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","class"],subtree:!0});const c=requestAnimationFrame(function o(){n(i()),requestAnimationFrame(o)});return()=>{u.disconnect(),cancelAnimationFrame(c)}},[e]),t}const I=()=>{const[e,t]=s.useState(!1);return s.useEffect(()=>{if(typeof window>"u")return;const n=()=>{const r="ontouchstart"in window||navigator.maxTouchPoints>0,i=window.innerHeight>window.innerWidth,u=i?window.innerWidth:window.innerHeight,c=i?window.innerHeight:window.innerWidth,o=u<1024||c<768;t(r&&o)};return n(),window.addEventListener("resize",n,{passive:!0}),window.addEventListener("orientationchange",n,{passive:!0}),()=>{window.removeEventListener("resize",n),window.removeEventListener("orientationchange",n)}},[]),e};exports.useId=w.useId;exports.usePrevious=f.usePrevious;exports.useInteractiveProps=g.useInteractiveProps;exports.useCSSLookup=W;exports.useIsOverFlowing=y;exports.useIsTextWrapping=C;exports.useMobileDetection=I;exports.useRTLDirection=P;exports.useResizeObserver=l;
|
package/utils/hooks/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as u, useEffect as d, useRef as f, useLayoutEffect as l } from "react";
|
|
2
2
|
import { a as w } from "../../chunks/constants.Cruz2A1w.js";
|
|
3
|
-
import { d as m } from "../../chunks/helpers.
|
|
3
|
+
import { d as m } from "../../chunks/helpers.CiQfGwdc.js";
|
|
4
4
|
import { C as a } from "../../chunks/CSSLookup.kaPTyL5S.js";
|
|
5
5
|
import { useId as V } from "./useId.es.js";
|
|
6
6
|
import { usePrevious as M } from "./usePrevious.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../chunks/constants.CgMu0_1M.js"),l=require("../../chunks/helpers.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../chunks/constants.CgMu0_1M.js"),l=require("../../chunks/helpers.BIckGIbP.js"),u=require("react");function f(e,t){typeof window>"u"||!window.localStorage||window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}const c=l.debounce((e,t)=>{if(typeof window>"u"||!window.localStorage)return;const r=JSON.stringify(t);window.localStorage.setItem(e,r),f(e,r)},d.FPS_60),w=e=>{typeof window>"u"||!window.localStorage||(window.localStorage.removeItem(e),f(e,null))},S=e=>typeof window>"u"||!window.localStorage?null:window.localStorage.getItem(e);function g(e,t,r=!0){const[i,s]=u.useState(()=>{if(!r)return t??null;const o=S(e);return o!==null?o:typeof t<"u"?(c(e,t),JSON.stringify(t)):null}),a=u.useCallback(o=>{try{if(!r)return;const n=typeof o=="function"?o(i?JSON.parse(i):null):o;n==null?(w(e),s(null)):(c(e,n),s(JSON.stringify(n)))}catch(n){console.error(n)}},[e,i,r]);return u.useEffect(()=>{if(!r||typeof window>"u")return;const o=n=>{n.key===e&&s(n.newValue)};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)},[e,r]),[i?JSON.parse(i):t,a]}exports.useLocalStorage=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as a } from "../../chunks/constants.Cruz2A1w.js";
|
|
2
|
-
import { d as w } from "../../chunks/helpers.
|
|
2
|
+
import { d as w } from "../../chunks/helpers.CiQfGwdc.js";
|
|
3
3
|
import s from "react";
|
|
4
4
|
function c(t, e) {
|
|
5
5
|
typeof window > "u" || !window.localStorage || window.dispatchEvent(new StorageEvent("storage", { key: t, newValue: e }));
|
package/utils/spacing.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../chunks/helpers.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../chunks/helpers.BIckGIbP.js"),P=["m","mx","my","mTop","mBottom","mBefore","mAfter"],t=["p","px","py","pTop","pBottom","pBefore","pAfter"],o=["gap"],p=[...P,...t,...o],_=(r,e=p)=>A.partitionProps(r,e);exports.MARGIN_PROP_NAMES=P;exports.OTHER_SPACING_PROP_NAMES=o;exports.PADDING_PROP_NAMES=t;exports.SPACING_PROP_NAMES=p;exports.partitionSpacingProps=_;
|
package/utils/spacing.es.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const p=require("react");function f(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const h=f(p),v=async(t,r)=>(await Promise.all(r.map(async o=>{const{validator:n}=o;return n(t)}))).reduce((o,n)=>{const{error:s,message:c}=n;return s?[...o,c]:o},[]),x=t=>{const{target:r,relatedTarget:e}=t||{};if(!e)return{groupBlur:!!e};const{name:o}=r,{name:n}=e,{control:s}=e,{name:c}=s||{};return{groupBlur:o===n||o===c}},m=t=>{const{type:r,checked:e}=t,o=r==="checkbox";if(o)return{isCheckBoxGroup:o,selectedBoxes:e?[t]:[]};const n=Array.from(t),s=n.every(l=>{const{type:i}=l;return i==="checkbox"}),c=!!n.length&&s;if(!c)return{isCheckBoxGroup:c,selectedBoxes:[]};const a=n.filter(({checked:l})=>l);return{isCheckBoxGroup:c,selectedBoxes:a}},g=t=>{const{type:r,multiple:e,options:o}=t,n=r==="select-multiple"&&e;if(!n)return{isMultiSelect:n,selectedOptions:[]};const s=[].filter.call(o,({selected:c})=>c);return{isMultiSelect:n,selectedOptions:s}},B=new RegExp(["(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:","\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:","[-\b\v\f-!#-[]-]",'|\\\\[- \v\f-])*")@(?:(?:',"[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:","[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|","[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:","(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?","[0-9])|[a-z0-9-]*[a-z0-9]:(?:","[-\b\v\f-!-ZS-]|\\\\[-"," \v\f-])+)\\])"].join("")),y=t=>({name:"min",validator:r=>{const{value:e,message:o}=t,{value:n}=r;return{error:!!n&&Number(n)<e,message:o}}}),O=t=>({name:"max",validator:r=>{const{value:e,message:o}=t,{value:n}=r;return{error:!!n&&Number(n)>e,message:o}}}),V=t=>({name:"email",validator:r=>{const{message:e}=t||{},{value:o}=r;return{error:!!o&&!B.test(o),message:e}}}),b=t=>({name:"pattern",validator:r=>{const{pattern:e,message:o}=t,{value:n}=r;return{error:!!n&&!n.match(e),message:o}}}),k=t=>({name:"required",validator:r=>{const{message:e}=t||{},{value:o}=r,{isCheckBoxGroup:n,selectedBoxes:{length:s}}=m(r);if(n)return{error:!s,message:e};const{isMultiSelect:c,selectedOptions:{length:a}}=g(r);return c?{error:!a,message:e}:{error:!o,message:e}}}),E=t=>({name:"minLength",validator:r=>{const{length:e,message:o}=t,{value:n}=r,s=!!n&&n.length<e,{isCheckBoxGroup:c,selectedBoxes:{length:a}}=m(r);if(c)return{error:!!a&&a<e,message:o};const{isMultiSelect:l,selectedOptions:{length:i}}=g(r);return l?{error:!!i&&i<e,message:o}:{error:s,message:o}}}),z=t=>({name:"maxLength",validator:r=>{const{length:e,message:o}=t,{value:n}=r,s=!!n&&n.length>e,{isCheckBoxGroup:c,selectedBoxes:{length:a}}=m(r);if(c)return{error:!!a&&a>e,message:o};const{isMultiSelect:l,selectedOptions:{length:i}}=g(r);return l?{error:!!i&&i>e,message:o}:{error:s,message:o}}}),L=t=>({name:"define",validator:r=>t(r)}),j={min:y,max:O,email:V,define:L,pattern:b,required:k,minLength:E,maxLength:z},C=()=>{const t=h.useRef({}),r=s=>{const{current:c}=t;if(s){const{errorSetter:a}=c[s]||{};return a==null?void 0:a([])}Object.keys(c).forEach(a=>{const{errorSetter:l}=c[a]||{};l==null||l([])})},e=async(s,c)=>{const a=c[s],{current:l}=t,{validators:i,errorSetter:u}=l[s]||{};if(!a||!(i!=null&&i.length)||!u)return[];const d=await v(a,i);return u(d),d};return{register:(s,c,a)=>{const{length:l}=c||{},{current:i}=t||{};s&&l&&Object.assign(i,{[s]:{validators:c,errorSetter:a}})},validateField:e,validateForm:async s=>{const{current:c}=t,l=Object.keys(c).map(async d=>await e(d,s));return{fail:(await Promise.all(l)).some(d=>!!d.length)}},reset:r}};exports.isGroupBlurEvent=x;exports.useFormValidator=C;exports.validators=j;
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import * as p from "react";
|
|
2
|
-
const h = async (s, o) => (await Promise.all(
|
|
3
|
-
o.map(
|
|
4
|
-
async (t) => {
|
|
5
|
-
const { validator: r } = t;
|
|
6
|
-
return r(s);
|
|
7
|
-
}
|
|
8
|
-
)
|
|
9
|
-
)).reduce(
|
|
10
|
-
(t, r) => {
|
|
11
|
-
const { error: n, message: a } = r;
|
|
12
|
-
return n ? [...t, a] : t;
|
|
13
|
-
},
|
|
14
|
-
[]
|
|
15
|
-
), O = (s) => {
|
|
16
|
-
const { target: o, relatedTarget: e } = s || {};
|
|
17
|
-
if (!e) return { groupBlur: !!e };
|
|
18
|
-
const { name: t } = o, { name: r } = e, { control: n } = e, { name: a } = n || {};
|
|
19
|
-
return { groupBlur: t === r || t === a };
|
|
20
|
-
}, d = (s) => {
|
|
21
|
-
const { type: o, checked: e } = s, t = o === "checkbox";
|
|
22
|
-
if (t)
|
|
23
|
-
return {
|
|
24
|
-
isCheckBoxGroup: t,
|
|
25
|
-
selectedBoxes: e ? [s] : []
|
|
26
|
-
};
|
|
27
|
-
const r = Array.from(s), n = r.every((l) => {
|
|
28
|
-
const { type: i } = l;
|
|
29
|
-
return i === "checkbox";
|
|
30
|
-
}), a = !!r.length && n;
|
|
31
|
-
if (!a) return { isCheckBoxGroup: a, selectedBoxes: [] };
|
|
32
|
-
const c = r.filter(
|
|
33
|
-
({ checked: l }) => l
|
|
34
|
-
);
|
|
35
|
-
return { isCheckBoxGroup: a, selectedBoxes: c };
|
|
36
|
-
}, g = (s) => {
|
|
37
|
-
const { type: o, multiple: e, options: t } = s, r = o === "select-multiple" && e;
|
|
38
|
-
if (!r) return { isMultiSelect: r, selectedOptions: [] };
|
|
39
|
-
const n = [].filter.call(
|
|
40
|
-
t,
|
|
41
|
-
({ selected: a }) => a
|
|
42
|
-
);
|
|
43
|
-
return { isMultiSelect: r, selectedOptions: n };
|
|
44
|
-
}, f = new RegExp(
|
|
45
|
-
[
|
|
46
|
-
"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:",
|
|
47
|
-
"\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:",
|
|
48
|
-
"[-\b\v\f-!#-[]-]",
|
|
49
|
-
'|\\\\[- \v\f-])*")@(?:(?:',
|
|
50
|
-
"[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:",
|
|
51
|
-
"[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|",
|
|
52
|
-
"[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:",
|
|
53
|
-
"(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?",
|
|
54
|
-
"[0-9])|[a-z0-9-]*[a-z0-9]:(?:",
|
|
55
|
-
"[-\b\v\f-!-ZS-]|\\\\[-",
|
|
56
|
-
" \v\f-])+)\\])"
|
|
57
|
-
].join("")
|
|
58
|
-
), v = (s) => ({
|
|
59
|
-
name: "min",
|
|
60
|
-
validator: (o) => {
|
|
61
|
-
const { value: e, message: t } = s, { value: r } = o;
|
|
62
|
-
return { error: !!r && Number(r) < e, message: t };
|
|
63
|
-
}
|
|
64
|
-
}), x = (s) => ({
|
|
65
|
-
name: "max",
|
|
66
|
-
validator: (o) => {
|
|
67
|
-
const { value: e, message: t } = s, { value: r } = o;
|
|
68
|
-
return { error: !!r && Number(r) > e, message: t };
|
|
69
|
-
}
|
|
70
|
-
}), B = (s) => ({
|
|
71
|
-
name: "email",
|
|
72
|
-
validator: (o) => {
|
|
73
|
-
const { message: e } = s || {}, { value: t } = o;
|
|
74
|
-
return { error: !!t && !f.test(t), message: e };
|
|
75
|
-
}
|
|
76
|
-
}), y = (s) => ({
|
|
77
|
-
name: "pattern",
|
|
78
|
-
validator: (o) => {
|
|
79
|
-
const { pattern: e, message: t } = s, { value: r } = o;
|
|
80
|
-
return { error: !!r && !r.match(e), message: t };
|
|
81
|
-
}
|
|
82
|
-
}), V = (s) => ({
|
|
83
|
-
name: "required",
|
|
84
|
-
validator: (o) => {
|
|
85
|
-
const { message: e } = s || {}, { value: t } = o, {
|
|
86
|
-
isCheckBoxGroup: r,
|
|
87
|
-
selectedBoxes: { length: n }
|
|
88
|
-
} = d(o);
|
|
89
|
-
if (r) return { error: !n, message: e };
|
|
90
|
-
const {
|
|
91
|
-
isMultiSelect: a,
|
|
92
|
-
selectedOptions: { length: c }
|
|
93
|
-
} = g(o);
|
|
94
|
-
return a ? { error: !c, message: e } : { error: !t, message: e };
|
|
95
|
-
}
|
|
96
|
-
}), k = (s) => ({
|
|
97
|
-
name: "minLength",
|
|
98
|
-
validator: (o) => {
|
|
99
|
-
const { length: e, message: t } = s, { value: r } = o, n = !!r && r.length < e, {
|
|
100
|
-
isCheckBoxGroup: a,
|
|
101
|
-
selectedBoxes: { length: c }
|
|
102
|
-
} = d(o);
|
|
103
|
-
if (a)
|
|
104
|
-
return { error: !!c && c < e, message: t };
|
|
105
|
-
const {
|
|
106
|
-
isMultiSelect: l,
|
|
107
|
-
selectedOptions: { length: i }
|
|
108
|
-
} = g(o);
|
|
109
|
-
return l ? { error: !!i && i < e, message: t } : { error: n, message: t };
|
|
110
|
-
}
|
|
111
|
-
}), E = (s) => ({
|
|
112
|
-
name: "maxLength",
|
|
113
|
-
validator: (o) => {
|
|
114
|
-
const { length: e, message: t } = s, { value: r } = o, n = !!r && r.length > e, {
|
|
115
|
-
isCheckBoxGroup: a,
|
|
116
|
-
selectedBoxes: { length: c }
|
|
117
|
-
} = d(o);
|
|
118
|
-
if (a)
|
|
119
|
-
return { error: !!c && c > e, message: t };
|
|
120
|
-
const {
|
|
121
|
-
isMultiSelect: l,
|
|
122
|
-
selectedOptions: { length: i }
|
|
123
|
-
} = g(o);
|
|
124
|
-
return l ? { error: !!i && i > e, message: t } : { error: n, message: t };
|
|
125
|
-
}
|
|
126
|
-
}), L = (s) => ({
|
|
127
|
-
name: "define",
|
|
128
|
-
validator: (o) => s(o)
|
|
129
|
-
}), z = {
|
|
130
|
-
min: v,
|
|
131
|
-
max: x,
|
|
132
|
-
email: B,
|
|
133
|
-
define: L,
|
|
134
|
-
pattern: y,
|
|
135
|
-
required: V,
|
|
136
|
-
minLength: k,
|
|
137
|
-
maxLength: E
|
|
138
|
-
}, b = () => {
|
|
139
|
-
const s = p.useRef({}), o = (n) => {
|
|
140
|
-
const { current: a } = s;
|
|
141
|
-
if (n) {
|
|
142
|
-
const { errorSetter: c } = a[n] || {};
|
|
143
|
-
return c == null ? void 0 : c([]);
|
|
144
|
-
}
|
|
145
|
-
Object.keys(a).forEach((c) => {
|
|
146
|
-
const { errorSetter: l } = a[c] || {};
|
|
147
|
-
l == null || l([]);
|
|
148
|
-
});
|
|
149
|
-
}, e = async (n, a) => {
|
|
150
|
-
const c = a[n], { current: l } = s, { validators: i, errorSetter: u } = l[n] || {};
|
|
151
|
-
if (!c || !(i != null && i.length) || !u) return [];
|
|
152
|
-
const m = await h(c, i);
|
|
153
|
-
return u(m), m;
|
|
154
|
-
};
|
|
155
|
-
return { register: (n, a, c) => {
|
|
156
|
-
const { length: l } = a || {}, { current: i } = s || {};
|
|
157
|
-
n && l && Object.assign(i, {
|
|
158
|
-
[n]: { validators: a, errorSetter: c }
|
|
159
|
-
});
|
|
160
|
-
}, validateField: e, validateForm: async (n) => {
|
|
161
|
-
const { current: a } = s, l = Object.keys(a).map(
|
|
162
|
-
async (m) => await e(m, n)
|
|
163
|
-
);
|
|
164
|
-
return { fail: (await Promise.all(l)).some((m) => !!m.length) };
|
|
165
|
-
}, reset: o };
|
|
166
|
-
};
|
|
167
|
-
export {
|
|
168
|
-
O as i,
|
|
169
|
-
b as u,
|
|
170
|
-
z as v
|
|
171
|
-
};
|