@procore/core-react 11.22.1 → 11.23.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/babel.config.js +32 -15
- package/dist/@types/files.d.js +2 -0
- package/dist/@types/files.d.js.map +1 -0
- package/dist/@types/global.d.js +2 -0
- package/dist/@types/global.d.js.map +1 -0
- package/dist/Avatar/Avatar.js +91 -80
- package/dist/Avatar/Avatar.js.map +1 -1
- package/dist/Avatar/Avatar.styles.js +57 -29
- package/dist/Avatar/Avatar.styles.js.map +1 -1
- package/dist/Avatar/Avatar.types.js.map +1 -1
- package/dist/Avatar/index.js +1 -0
- package/dist/Avatar/index.js.map +1 -1
- package/dist/AvatarStack/AvatarStack.constants.js.map +1 -1
- package/dist/AvatarStack/AvatarStack.js +306 -171
- package/dist/AvatarStack/AvatarStack.js.map +1 -1
- package/dist/AvatarStack/AvatarStack.styles.js +30 -12
- package/dist/AvatarStack/AvatarStack.styles.js.map +1 -1
- package/dist/AvatarStack/AvatarStack.types.js.map +1 -1
- package/dist/AvatarStack/index.js +1 -0
- package/dist/AvatarStack/index.js.map +1 -1
- package/dist/Badge/Badge.js +10 -16
- package/dist/Badge/Badge.js.map +1 -1
- package/dist/Badge/Badge.styles.js +8 -7
- package/dist/Badge/Badge.styles.js.map +1 -1
- package/dist/Badge/Badge.types.js.map +1 -1
- package/dist/Badge/index.js +1 -0
- package/dist/Badge/index.js.map +1 -1
- package/dist/Banner/Banner.js +211 -110
- package/dist/Banner/Banner.js.map +1 -1
- package/dist/Banner/Banner.styles.js +85 -56
- package/dist/Banner/Banner.styles.js.map +1 -1
- package/dist/Banner/Banner.types.js.map +1 -1
- package/dist/Banner/index.js +2 -1
- package/dist/Banner/index.js.map +1 -1
- package/dist/Box/Box.js +85 -55
- package/dist/Box/Box.js.map +1 -1
- package/dist/Box/Box.styles.js +22 -24
- package/dist/Box/Box.styles.js.map +1 -1
- package/dist/Box/Box.types.js.map +1 -1
- package/dist/Box/index.js +1 -0
- package/dist/Box/index.js.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +67 -65
- package/dist/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +28 -21
- package/dist/Breadcrumbs/Breadcrumbs.styles.js.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.types.js +5 -5
- package/dist/Breadcrumbs/Breadcrumbs.types.js.map +1 -1
- package/dist/Breadcrumbs/index.js +1 -0
- package/dist/Breadcrumbs/index.js.map +1 -1
- package/dist/Button/Button.js +105 -63
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Button.styles.js +95 -81
- package/dist/Button/Button.styles.js.map +1 -1
- package/dist/Button/Button.types.js.map +1 -1
- package/dist/Button/index.js.map +1 -1
- package/dist/Calendar/Calendar.js +244 -125
- package/dist/Calendar/Calendar.js.map +1 -1
- package/dist/Calendar/Calendar.styles.js +52 -24
- package/dist/Calendar/Calendar.styles.js.map +1 -1
- package/dist/Calendar/Calendar.types.js.map +1 -1
- package/dist/Calendar/index.js +1 -0
- package/dist/Calendar/index.js.map +1 -1
- package/dist/Card/Card.js +22 -30
- package/dist/Card/Card.js.map +1 -1
- package/dist/Card/Card.styles.js +12 -12
- package/dist/Card/Card.styles.js.map +1 -1
- package/dist/Card/Card.types.js.map +1 -1
- package/dist/Card/index.js +1 -0
- package/dist/Card/index.js.map +1 -1
- package/dist/Changelog.mdx +6 -0
- package/dist/Checkbox/Checkbox.js +56 -33
- package/dist/Checkbox/Checkbox.js.map +1 -1
- package/dist/Checkbox/Checkbox.styles.js +103 -87
- package/dist/Checkbox/Checkbox.styles.js.map +1 -1
- package/dist/Checkbox/Checkbox.types.js.map +1 -1
- package/dist/Checkbox/index.js +1 -0
- package/dist/Checkbox/index.js.map +1 -1
- package/dist/CheckboxGroup/CheckboxGroup.js +24 -31
- package/dist/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/CheckboxGroup/CheckboxGroup.types.js.map +1 -1
- package/dist/CheckboxGroup/index.js +1 -0
- package/dist/CheckboxGroup/index.js.map +1 -1
- package/dist/ClickOutside/ClickOutside.js +38 -38
- package/dist/ClickOutside/ClickOutside.js.map +1 -1
- package/dist/ClickOutside/index.js.map +1 -1
- package/dist/ContactItem/ContactItem.js +56 -45
- package/dist/ContactItem/ContactItem.js.map +1 -1
- package/dist/ContactItem/ContactItem.styles.js +31 -21
- package/dist/ContactItem/ContactItem.styles.js.map +1 -1
- package/dist/ContactItem/ContactItem.types.js.map +1 -1
- package/dist/ContactItem/index.js +1 -0
- package/dist/ContactItem/index.js.map +1 -1
- package/dist/Content/Content.js +2 -13
- package/dist/Content/Content.js.map +1 -1
- package/dist/Content/Content.styles.js +9 -8
- package/dist/Content/Content.styles.js.map +1 -1
- package/dist/Content/index.js.map +1 -1
- package/dist/DateInput/DateInput.js +453 -347
- package/dist/DateInput/DateInput.js.map +1 -1
- package/dist/DateInput/DateInput.styles.js +42 -27
- package/dist/DateInput/DateInput.styles.js.map +1 -1
- package/dist/DateInput/DateInput.types.js.map +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/DateInput/index.js.map +1 -1
- package/dist/DateSelect/DateSelect.js +148 -107
- package/dist/DateSelect/DateSelect.js.map +1 -1
- package/dist/DateSelect/DateSelect.types.js.map +1 -1
- package/dist/DateSelect/index.js +1 -0
- package/dist/DateSelect/index.js.map +1 -1
- package/dist/DetailPage/DetailPage.constants.js +42 -42
- package/dist/DetailPage/DetailPage.constants.js.map +1 -1
- package/dist/DetailPage/DetailPage.js +66 -62
- package/dist/DetailPage/DetailPage.js.map +1 -1
- package/dist/DetailPage/DetailPage.styles.js +30 -14
- package/dist/DetailPage/DetailPage.styles.js.map +1 -1
- package/dist/DetailPage/DetailPage.types.js.map +1 -1
- package/dist/DetailPage/RankedHeading.js +8 -8
- package/dist/DetailPage/RankedHeading.js.map +1 -1
- package/dist/DetailPage/index.js +1 -0
- package/dist/DetailPage/index.js.map +1 -1
- package/dist/Dropdown/Dropdown.js +193 -99
- package/dist/Dropdown/Dropdown.js.map +1 -1
- package/dist/Dropdown/Dropdown.styles.js +21 -15
- package/dist/Dropdown/Dropdown.styles.js.map +1 -1
- package/dist/Dropdown/Dropdown.types.js.map +1 -1
- package/dist/Dropdown/index.js +1 -0
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.helpers.js +277 -239
- package/dist/DropdownFlyout/DropdownFlyout.helpers.js.map +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.js +234 -132
- package/dist/DropdownFlyout/DropdownFlyout.js.map +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +16 -9
- package/dist/DropdownFlyout/DropdownFlyout.styles.js.map +1 -1
- package/dist/DropdownFlyout/DropdownFlyout.types.js.map +1 -1
- package/dist/DropdownFlyout/index.js +1 -1
- package/dist/DropdownFlyout/index.js.map +1 -1
- package/dist/DropdownFlyout/useDropdownFlyoutOverlay.js +10 -11
- package/dist/DropdownFlyout/useDropdownFlyoutOverlay.js.map +1 -1
- package/dist/Dropzone/Dropzone.hooks.js +257 -211
- package/dist/Dropzone/Dropzone.hooks.js.map +1 -1
- package/dist/Dropzone/Dropzone.js +209 -156
- package/dist/Dropzone/Dropzone.js.map +1 -1
- package/dist/Dropzone/Dropzone.styles.js +54 -31
- package/dist/Dropzone/Dropzone.styles.js.map +1 -1
- package/dist/Dropzone/Dropzone.types.js +19 -11
- package/dist/Dropzone/Dropzone.types.js.map +1 -1
- package/dist/Dropzone/index.js +1 -0
- package/dist/Dropzone/index.js.map +1 -1
- package/dist/EmptyState/EmptyState.js +274 -116
- package/dist/EmptyState/EmptyState.js.map +1 -1
- package/dist/EmptyState/EmptyState.styles.js +33 -19
- package/dist/EmptyState/EmptyState.styles.js.map +1 -1
- package/dist/EmptyState/EmptyState.types.js.map +1 -1
- package/dist/EmptyState/index.js +1 -0
- package/dist/EmptyState/index.js.map +1 -1
- package/dist/Field/Field.js +26 -33
- package/dist/Field/Field.js.map +1 -1
- package/dist/Field/Field.styles.js +12 -8
- package/dist/Field/Field.styles.js.map +1 -1
- package/dist/Field/index.js.map +1 -1
- package/dist/FileList/FileList.js +83 -55
- package/dist/FileList/FileList.js.map +1 -1
- package/dist/FileList/FileList.styles.js +16 -9
- package/dist/FileList/FileList.styles.js.map +1 -1
- package/dist/FileList/FileList.types.js.map +1 -1
- package/dist/FileList/index.js +1 -0
- package/dist/FileList/index.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorer.js +69 -65
- package/dist/FileSelect/FileExplorer/FileExplorer.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +37 -16
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorer.types.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorerModal.js +23 -31
- package/dist/FileSelect/FileExplorer/FileExplorerModal.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.js +92 -63
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.js.map +1 -1
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +12 -8
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js.map +1 -1
- package/dist/FileSelect/FileExplorer/useSidebarNavigation.js +40 -51
- package/dist/FileSelect/FileExplorer/useSidebarNavigation.js.map +1 -1
- package/dist/FileSelect/FileSelect.js +465 -324
- package/dist/FileSelect/FileSelect.js.map +1 -1
- package/dist/FileSelect/FileSelect.styles.js +8 -7
- package/dist/FileSelect/FileSelect.styles.js.map +1 -1
- package/dist/FileSelect/FileSelect.types.js.map +1 -1
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.js +93 -47
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.js.map +1 -1
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +16 -14
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js.map +1 -1
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.types.js.map +1 -1
- package/dist/FileSelect/FileSelectDropzone/index.js +1 -0
- package/dist/FileSelect/FileSelectDropzone/index.js.map +1 -1
- package/dist/FileSelect/FileTokenList/FileToken.types.js.map +1 -1
- package/dist/FileSelect/FileTokenList/FileTokenList.js +112 -90
- package/dist/FileSelect/FileTokenList/FileTokenList.js.map +1 -1
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +8 -7
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js.map +1 -1
- package/dist/FileSelect/FileTokenList/index.js.map +1 -1
- package/dist/FileSelect/GridSource/GridSource.js +269 -222
- package/dist/FileSelect/GridSource/GridSource.js.map +1 -1
- package/dist/FileSelect/GridSource/GridSource.styles.js +32 -19
- package/dist/FileSelect/GridSource/GridSource.styles.js.map +1 -1
- package/dist/FileSelect/GridSource/GridSource.types.js.map +1 -1
- package/dist/FileSelect/GridSource/index.js +1 -0
- package/dist/FileSelect/GridSource/index.js.map +1 -1
- package/dist/FileSelect/LocalSource/LocalSource.js +401 -314
- package/dist/FileSelect/LocalSource/LocalSource.js.map +1 -1
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +18 -11
- package/dist/FileSelect/LocalSource/LocalSource.styles.js.map +1 -1
- package/dist/FileSelect/LocalSource/LocalSource.types.js.map +1 -1
- package/dist/FileSelect/LocalSource/index.js +1 -0
- package/dist/FileSelect/LocalSource/index.js.map +1 -1
- package/dist/FileSelect/ProgressAnnouncer/ProgressAnnouncer.js +91 -69
- package/dist/FileSelect/ProgressAnnouncer/ProgressAnnouncer.js.map +1 -1
- package/dist/FileSelect/ProgressAnnouncer/ProgressAnnouncer.types.js.map +1 -1
- package/dist/FileSelect/ProgressAnnouncer/index.js.map +1 -1
- package/dist/FileSelect/SourceItem/SourceItem.js +66 -54
- package/dist/FileSelect/SourceItem/SourceItem.js.map +1 -1
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +29 -24
- package/dist/FileSelect/SourceItem/SourceItem.styles.js.map +1 -1
- package/dist/FileSelect/SourceItem/SourceItem.test.js +53 -0
- package/dist/FileSelect/ThumbnailList/ThumbnailList.js +175 -110
- package/dist/FileSelect/ThumbnailList/ThumbnailList.js.map +1 -1
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +33 -23
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js.map +1 -1
- package/dist/FileSelect/ThumbnailList/ThumbnailList.types.js.map +1 -1
- package/dist/FileSelect/ThumbnailList/index.js.map +1 -1
- package/dist/FileSelect/TreeSource/TreeSource.js +173 -135
- package/dist/FileSelect/TreeSource/TreeSource.js.map +1 -1
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +4 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js.map +1 -1
- package/dist/FileSelect/TreeSource/TreeSource.types.js.map +1 -1
- package/dist/FileSelect/TreeSource/index.js +1 -0
- package/dist/FileSelect/TreeSource/index.js.map +1 -1
- package/dist/FileSelect/index.js +3 -1
- package/dist/FileSelect/index.js.map +1 -1
- package/dist/FileSelect/storyHelpers.js +301 -231
- package/dist/FileSelect/storyHelpers.js.map +1 -1
- package/dist/FileToken/FileToken.js +103 -80
- package/dist/FileToken/FileToken.js.map +1 -1
- package/dist/FileToken/FileToken.styles.js +29 -21
- package/dist/FileToken/FileToken.styles.js.map +1 -1
- package/dist/FileToken/FileToken.types.js.map +1 -1
- package/dist/FileToken/index.js.map +1 -1
- package/dist/FilterToken/FilterToken.js +44 -34
- package/dist/FilterToken/FilterToken.js.map +1 -1
- package/dist/FilterToken/FilterToken.styles.js +12 -10
- package/dist/FilterToken/FilterToken.styles.js.map +1 -1
- package/dist/FilterToken/FilterToken.types.js.map +1 -1
- package/dist/FilterToken/index.js.map +1 -1
- package/dist/Flex/Flex.js +33 -25
- package/dist/Flex/Flex.js.map +1 -1
- package/dist/Flex/Flex.types.js.map +1 -1
- package/dist/Flex/index.js +1 -0
- package/dist/Flex/index.js.map +1 -1
- package/dist/FlexList/FlexList.js +52 -47
- package/dist/FlexList/FlexList.js.map +1 -1
- package/dist/FlexList/FlexList.styles.js +9 -11
- package/dist/FlexList/FlexList.styles.js.map +1 -1
- package/dist/FlexList/FlexList.types.js.map +1 -1
- package/dist/FlexList/index.js +1 -0
- package/dist/FlexList/index.js.map +1 -1
- package/dist/Form/Form.js +1348 -711
- package/dist/Form/Form.js.map +1 -1
- package/dist/Form/Form.styles.js +92 -43
- package/dist/Form/Form.styles.js.map +1 -1
- package/dist/Form/Form.types.js.map +1 -1
- package/dist/Form/closeWithConfirm.js +38 -31
- package/dist/Form/closeWithConfirm.js.map +1 -1
- package/dist/Form/index.js +2 -1
- package/dist/Form/index.js.map +1 -1
- package/dist/Form/stories/util.js +480 -385
- package/dist/Form/stories/util.js.map +1 -1
- package/dist/Grid/Grid.constants.js +13 -20
- package/dist/Grid/Grid.constants.js.map +1 -1
- package/dist/Grid/Grid.js +50 -44
- package/dist/Grid/Grid.js.map +1 -1
- package/dist/Grid/Grid.styles.js +95 -88
- package/dist/Grid/Grid.styles.js.map +1 -1
- package/dist/Grid/Grid.types.js.map +1 -1
- package/dist/Grid/Grid.utils.js +17 -9
- package/dist/Grid/Grid.utils.js.map +1 -1
- package/dist/Grid/index.js +1 -0
- package/dist/Grid/index.js.map +1 -1
- package/dist/GroupSelect/GroupSelect.js +210 -146
- package/dist/GroupSelect/GroupSelect.js.map +1 -1
- package/dist/GroupSelect/GroupSelect.styles.js +6 -8
- package/dist/GroupSelect/GroupSelect.styles.js.map +1 -1
- package/dist/GroupSelect/GroupSelect.types.js.map +1 -1
- package/dist/GroupSelect/index.js +1 -0
- package/dist/GroupSelect/index.js.map +1 -1
- package/dist/Input/Input.js +10 -25
- package/dist/Input/Input.js.map +1 -1
- package/dist/Input/Input.styles.js +10 -11
- package/dist/Input/Input.styles.js.map +1 -1
- package/dist/Input/Input.types.js.map +1 -1
- package/dist/Input/index.js +1 -0
- package/dist/Input/index.js.map +1 -1
- package/dist/Link/Link.js +10 -25
- package/dist/Link/Link.js.map +1 -1
- package/dist/Link/Link.styles.js +16 -17
- package/dist/Link/Link.styles.js.map +1 -1
- package/dist/Link/Link.types.js.map +1 -1
- package/dist/Link/index.js +1 -0
- package/dist/Link/index.js.map +1 -1
- package/dist/ListPage/ListPage.js +69 -51
- package/dist/ListPage/ListPage.js.map +1 -1
- package/dist/ListPage/ListPage.styles.js +44 -25
- package/dist/ListPage/ListPage.styles.js.map +1 -1
- package/dist/ListPage/ListPage.types.js.map +1 -1
- package/dist/ListPage/index.js.map +1 -1
- package/dist/Loader/Loader.js +24 -31
- package/dist/Loader/Loader.js.map +1 -1
- package/dist/Loader/Loader.styles.js +11 -11
- package/dist/Loader/Loader.styles.js.map +1 -1
- package/dist/Loader/Loader.types.js.map +1 -1
- package/dist/Loader/index.js.map +1 -1
- package/dist/Menu/Menu.js +332 -237
- package/dist/Menu/Menu.js.map +1 -1
- package/dist/Menu/Menu.types.js.map +1 -1
- package/dist/Menu/index.js +1 -0
- package/dist/Menu/index.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.js +504 -311
- package/dist/MenuImperative/MenuImperative.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.styles.js +71 -46
- package/dist/MenuImperative/MenuImperative.styles.js.map +1 -1
- package/dist/MenuImperative/MenuImperative.types.js.map +1 -1
- package/dist/MenuImperative/index.js +1 -1
- package/dist/MenuImperative/index.js.map +1 -1
- package/dist/MenuImperative/sensors.js +232 -233
- package/dist/MenuImperative/sensors.js.map +1 -1
- package/dist/Modal/ChildRegistry.context.js +46 -33
- package/dist/Modal/ChildRegistry.context.js.map +1 -1
- package/dist/Modal/Modal.js +296 -193
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Modal/Modal.styles.js +76 -41
- package/dist/Modal/Modal.styles.js.map +1 -1
- package/dist/Modal/Modal.types.js.map +1 -1
- package/dist/Modal/index.js +1 -0
- package/dist/Modal/index.js.map +1 -1
- package/dist/Modal/storyHelpers.js +221 -149
- package/dist/Modal/storyHelpers.js.map +1 -1
- package/dist/Modal/useInitializeModalFocus.js +30 -29
- package/dist/Modal/useInitializeModalFocus.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.js +487 -324
- package/dist/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.styles.js +29 -16
- package/dist/MultiSelect/MultiSelect.styles.js.map +1 -1
- package/dist/MultiSelect/MultiSelect.test.js +250 -0
- package/dist/MultiSelect/MultiSelect.types.js.map +1 -1
- package/dist/MultiSelect/index.js.map +1 -1
- package/dist/NextMenu/NextMenu.js +121 -55
- package/dist/NextMenu/NextMenu.js.map +1 -1
- package/dist/NextMenu/NextMenu.styles.js +13 -9
- package/dist/NextMenu/NextMenu.styles.js.map +1 -1
- package/dist/NextMenu/NextMenu.types.js.map +1 -1
- package/dist/NextMenu/NextMenuItem.js +23 -29
- package/dist/NextMenu/NextMenuItem.js.map +1 -1
- package/dist/NextMenu/sampleData.js +469 -179
- package/dist/NextMenu/sampleData.js.map +1 -1
- package/dist/NextTile/NextTile.js +174 -101
- package/dist/NextTile/NextTile.js.map +1 -1
- package/dist/NextTile/NextTile.types.js.map +1 -1
- package/dist/Notation/Notation.js +26 -45
- package/dist/Notation/Notation.js.map +1 -1
- package/dist/Notation/Notation.types.js +4 -4
- package/dist/Notation/Notation.types.js.map +1 -1
- package/dist/Notation/index.js +1 -0
- package/dist/Notation/index.js.map +1 -1
- package/dist/NumberInput/NumberInput.constants.js.map +1 -1
- package/dist/NumberInput/NumberInput.hooks.js +47 -41
- package/dist/NumberInput/NumberInput.hooks.js.map +1 -1
- package/dist/NumberInput/NumberInput.js +440 -338
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/NumberInput/NumberInput.styles.js +34 -18
- package/dist/NumberInput/NumberInput.styles.js.map +1 -1
- package/dist/NumberInput/NumberInput.types.js.map +1 -1
- package/dist/NumberInput/NumberInput.utils.js +436 -455
- package/dist/NumberInput/NumberInput.utils.js.map +1 -1
- package/dist/NumberInput/index.js +1 -0
- package/dist/NumberInput/index.js.map +1 -1
- package/dist/Overlay/Overlay.js +36 -35
- package/dist/Overlay/Overlay.js.map +1 -1
- package/dist/Overlay/OverlayArrow.js +27 -21
- package/dist/Overlay/OverlayArrow.js.map +1 -1
- package/dist/Overlay/OverlayArrow.styles.js +4 -6
- package/dist/Overlay/OverlayArrow.styles.js.map +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Overlay/index.js.map +1 -1
- package/dist/Overlay/useOverlay.js +29 -21
- package/dist/Overlay/useOverlay.js.map +1 -1
- package/dist/OverlayTrigger/OverlayTrigger.js +297 -205
- package/dist/OverlayTrigger/OverlayTrigger.js.map +1 -1
- package/dist/OverlayTrigger/OverlayTrigger.test.js +483 -0
- package/dist/OverlayTrigger/OverlayTrigger.types.js.map +1 -1
- package/dist/OverlayTrigger/a11yPresets.js +248 -185
- package/dist/OverlayTrigger/a11yPresets.js.map +1 -1
- package/dist/OverlayTrigger/index.js +2 -1
- package/dist/OverlayTrigger/index.js.map +1 -1
- package/dist/PageLayout/PageLayout.constants.js.map +1 -1
- package/dist/PageLayout/PageLayout.js +324 -269
- package/dist/PageLayout/PageLayout.js.map +1 -1
- package/dist/PageLayout/PageLayout.styles.js +111 -71
- package/dist/PageLayout/PageLayout.styles.js.map +1 -1
- package/dist/PageLayout/PageLayout.types.js.map +1 -1
- package/dist/PageLayout/PageLayout.utils.js +37 -35
- package/dist/PageLayout/PageLayout.utils.js.map +1 -1
- package/dist/PageLayout/index.js +1 -0
- package/dist/PageLayout/index.js.map +1 -1
- package/dist/Pagination/Pagination.js +98 -65
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/Pagination/Pagination.styles.js +20 -10
- package/dist/Pagination/Pagination.styles.js.map +1 -1
- package/dist/Pagination/Pagination.types.js.map +1 -1
- package/dist/Pagination/PaginationSelect.js +126 -96
- package/dist/Pagination/PaginationSelect.js.map +1 -1
- package/dist/Pagination/index.js +1 -0
- package/dist/Pagination/index.js.map +1 -1
- package/dist/Panel/Panel.js +207 -127
- package/dist/Panel/Panel.js.map +1 -1
- package/dist/Panel/Panel.styles.js +61 -33
- package/dist/Panel/Panel.styles.js.map +1 -1
- package/dist/Panel/Panel.types.js.map +1 -1
- package/dist/Panel/index.js +1 -0
- package/dist/Panel/index.js.map +1 -1
- package/dist/Pill/Pill.colorPalette.js +40 -40
- package/dist/Pill/Pill.colorPalette.js.map +1 -1
- package/dist/Pill/Pill.js +32 -31
- package/dist/Pill/Pill.js.map +1 -1
- package/dist/Pill/Pill.styles.js +12 -11
- package/dist/Pill/Pill.styles.js.map +1 -1
- package/dist/Pill/Pill.types.js.map +1 -1
- package/dist/Pill/index.js +1 -0
- package/dist/Pill/index.js.map +1 -1
- package/dist/PillSelect/PillSelect.js +143 -77
- package/dist/PillSelect/PillSelect.js.map +1 -1
- package/dist/PillSelect/PillSelect.styles.js +18 -11
- package/dist/PillSelect/PillSelect.styles.js.map +1 -1
- package/dist/PillSelect/PillSelect.types.js.map +1 -1
- package/dist/PillSelect/index.js +1 -0
- package/dist/PillSelect/index.js.map +1 -1
- package/dist/Popover/Popover.js +57 -32
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/Popover/Popover.styles.js +12 -11
- package/dist/Popover/Popover.styles.js.map +1 -1
- package/dist/Popover/Popover.types.js.map +1 -1
- package/dist/Popover/index.js +1 -0
- package/dist/Popover/index.js.map +1 -1
- package/dist/Portal/Portal.js +14 -26
- package/dist/Portal/Portal.js.map +1 -1
- package/dist/Portal/Portal.styles.js +4 -6
- package/dist/Portal/Portal.styles.js.map +1 -1
- package/dist/Portal/Portal.types.js.map +1 -1
- package/dist/Portal/index.js.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +58 -50
- package/dist/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +18 -17
- package/dist/ProgressBar/ProgressBar.styles.js.map +1 -1
- package/dist/ProgressBar/ProgressBar.types.js.map +1 -1
- package/dist/ProgressBar/index.js +1 -0
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/RadioButton/RadioButton.js +21 -28
- package/dist/RadioButton/RadioButton.js.map +1 -1
- package/dist/RadioButton/RadioButton.styles.js +18 -14
- package/dist/RadioButton/RadioButton.styles.js.map +1 -1
- package/dist/RadioButton/RadioButton.types.js.map +1 -1
- package/dist/RadioButton/index.js +1 -0
- package/dist/RadioButton/index.js.map +1 -1
- package/dist/Required/Required.js +21 -32
- package/dist/Required/Required.js.map +1 -1
- package/dist/Required/Required.styles.js +18 -14
- package/dist/Required/Required.styles.js.map +1 -1
- package/dist/Required/Required.types.js.map +1 -1
- package/dist/Required/index.js +1 -0
- package/dist/Required/index.js.map +1 -1
- package/dist/Search/Search.hooks.js +59 -40
- package/dist/Search/Search.hooks.js.map +1 -1
- package/dist/Search/Search.js +60 -48
- package/dist/Search/Search.js.map +1 -1
- package/dist/Search/Search.styles.js +28 -11
- package/dist/Search/Search.styles.js.map +1 -1
- package/dist/Search/Search.types.js.map +1 -1
- package/dist/Search/index.js +1 -0
- package/dist/Search/index.js.map +1 -1
- package/dist/Section/Section.js +127 -102
- package/dist/Section/Section.js.map +1 -1
- package/dist/Section/Section.styles.js +34 -19
- package/dist/Section/Section.styles.js.map +1 -1
- package/dist/Section/Section.types.js.map +1 -1
- package/dist/Section/index.js.map +1 -1
- package/dist/SegmentedController/SegmentedController.js +135 -93
- package/dist/SegmentedController/SegmentedController.js.map +1 -1
- package/dist/SegmentedController/SegmentedController.styles.js +38 -29
- package/dist/SegmentedController/SegmentedController.styles.js.map +1 -1
- package/dist/SegmentedController/SegmentedController.types.js +3 -3
- package/dist/SegmentedController/SegmentedController.types.js.map +1 -1
- package/dist/SegmentedController/index.js +1 -0
- package/dist/SegmentedController/index.js.map +1 -1
- package/dist/Select/Select.js +302 -125
- package/dist/Select/Select.js.map +1 -1
- package/dist/Select/Select.styles.js +66 -46
- package/dist/Select/Select.styles.js.map +1 -1
- package/dist/Select/Select.types.js.map +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/Select/index.js.map +1 -1
- package/dist/Semantic/Semantic.js +63 -40
- package/dist/Semantic/Semantic.js.map +1 -1
- package/dist/Semantic/Semantic.styles.js +49 -34
- package/dist/Semantic/Semantic.styles.js.map +1 -1
- package/dist/Semantic/Semantic.types.js.map +1 -1
- package/dist/Semantic/index.js.map +1 -1
- package/dist/Sidebar/Sidebar.js +85 -68
- package/dist/Sidebar/Sidebar.js.map +1 -1
- package/dist/Sidebar/Sidebar.styles.js +32 -16
- package/dist/Sidebar/Sidebar.styles.js.map +1 -1
- package/dist/Sidebar/index.js.map +1 -1
- package/dist/Slider/Slider.js +120 -73
- package/dist/Slider/Slider.js.map +1 -1
- package/dist/Slider/Slider.styles.js +48 -22
- package/dist/Slider/Slider.styles.js.map +1 -1
- package/dist/Slider/Slider.types.js.map +1 -1
- package/dist/Slider/index.js +1 -0
- package/dist/Slider/index.js.map +1 -1
- package/dist/Spinner/Spinner.js +49 -42
- package/dist/Spinner/Spinner.js.map +1 -1
- package/dist/Spinner/Spinner.styles.js +64 -47
- package/dist/Spinner/Spinner.styles.js.map +1 -1
- package/dist/Spinner/Spinner.types.js.map +1 -1
- package/dist/Spinner/index.js +1 -0
- package/dist/Spinner/index.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.components.js +288 -210
- package/dist/SuperSelect/SuperSelect.components.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.constants.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.js +82 -56
- package/dist/SuperSelect/SuperSelect.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.presets.styles.js +4 -6
- package/dist/SuperSelect/SuperSelect.presets.styles.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +228 -117
- package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.utils.js +136 -129
- package/dist/SuperSelect/SuperSelect.utils.js.map +1 -1
- package/dist/SuperSelect/SuperSelect.utils.test.js +717 -0
- package/dist/SuperSelect/index.js +1 -1
- package/dist/SuperSelect/index.js.map +1 -1
- package/dist/SuperSelect/presets/contactsPreset.js +16 -31
- package/dist/SuperSelect/presets/contactsPreset.js.map +1 -1
- package/dist/SuperSelect/presets/filterPreset.js +55 -55
- package/dist/SuperSelect/presets/filterPreset.js.map +1 -1
- package/dist/SuperSelect/presets/index.js +4 -4
- package/dist/SuperSelect/presets/index.js.map +1 -1
- package/dist/SuperSelect/presets/pillPreset.js +39 -25
- package/dist/SuperSelect/presets/pillPreset.js.map +1 -1
- package/dist/SuperSelect/useSuperSelect.js +769 -636
- package/dist/SuperSelect/useSuperSelect.js.map +1 -1
- package/dist/SuperSelect/useSuperSelect.test.js +1284 -0
- package/dist/SuperSelect/useVirtuosoResizeErrorFix.js +15 -18
- package/dist/SuperSelect/useVirtuosoResizeErrorFix.js.map +1 -1
- package/dist/Switch/Switch.js +22 -32
- package/dist/Switch/Switch.js.map +1 -1
- package/dist/Switch/Switch.styles.js +26 -17
- package/dist/Switch/Switch.styles.js.map +1 -1
- package/dist/Switch/Switch.types.js.map +1 -1
- package/dist/Switch/index.js +1 -0
- package/dist/Switch/index.js.map +1 -1
- package/dist/Table/Table.js +372 -197
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/Table.styles.js +204 -127
- package/dist/Table/Table.styles.js.map +1 -1
- package/dist/Table/Table.types.js.map +1 -1
- package/dist/Table/index.js +1 -0
- package/dist/Table/index.js.map +1 -1
- package/dist/TableShelf/TableShelf.js +51 -47
- package/dist/TableShelf/TableShelf.js.map +1 -1
- package/dist/TableShelf/TableShelf.styles.js +20 -10
- package/dist/TableShelf/TableShelf.styles.js.map +1 -1
- package/dist/TableShelf/index.js.map +1 -1
- package/dist/Tabs/Tabs.js +237 -136
- package/dist/Tabs/Tabs.js.map +1 -1
- package/dist/Tabs/Tabs.styles.js +59 -40
- package/dist/Tabs/Tabs.styles.js.map +1 -1
- package/dist/Tabs/Tabs.types.js +6 -6
- package/dist/Tabs/Tabs.types.js.map +1 -1
- package/dist/Tabs/index.js +1 -0
- package/dist/Tabs/index.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.constants.js +2 -15
- package/dist/Tearsheet/Tearsheet.constants.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.js +228 -177
- package/dist/Tearsheet/Tearsheet.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.styles.js +106 -92
- package/dist/Tearsheet/Tearsheet.styles.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.types.js.map +1 -1
- package/dist/Tearsheet/Tearsheet.util.js +53 -49
- package/dist/Tearsheet/Tearsheet.util.js.map +1 -1
- package/dist/Tearsheet/index.js +1 -0
- package/dist/Tearsheet/index.js.map +1 -1
- package/dist/TextArea/TextArea.js +13 -25
- package/dist/TextArea/TextArea.js.map +1 -1
- package/dist/TextArea/TextArea.styles.js +7 -8
- package/dist/TextArea/TextArea.styles.js.map +1 -1
- package/dist/TextArea/TextArea.types.js.map +1 -1
- package/dist/TextArea/index.js +1 -0
- package/dist/TextArea/index.js.map +1 -1
- package/dist/TextEditor/TextEditor.js +110 -81
- package/dist/TextEditor/TextEditor.js.map +1 -1
- package/dist/TextEditor/TextEditor.styles.js +3 -8
- package/dist/TextEditor/TextEditor.styles.js.map +1 -1
- package/dist/TextEditor/TextEditor.types.js.map +1 -1
- package/dist/TextEditor/index.js +1 -0
- package/dist/TextEditor/index.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.js +29 -27
- package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +4 -6
- package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -1
- package/dist/TextEditorOutput/index.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.hooks.js +89 -57
- package/dist/Thumbnail/Thumbnail.hooks.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +394 -180
- package/dist/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.styles.js +151 -130
- package/dist/Thumbnail/Thumbnail.styles.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.types.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.utils.js +45 -55
- package/dist/Thumbnail/Thumbnail.utils.js.map +1 -1
- package/dist/Thumbnail/ThumbnailCaption.js +101 -54
- package/dist/Thumbnail/ThumbnailCaption.js.map +1 -1
- package/dist/Thumbnail/ThumbnailDocumentIcon.js +479 -156
- package/dist/Thumbnail/ThumbnailDocumentIcon.js.map +1 -1
- package/dist/Thumbnail/ThumbnailPreview.js +31 -20
- package/dist/Thumbnail/ThumbnailPreview.js.map +1 -1
- package/dist/Thumbnail/index.js +2 -0
- package/dist/Thumbnail/index.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.hooks.js +102 -81
- package/dist/ThumbnailGrid/ThumbnailGrid.hooks.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.js +536 -402
- package/dist/ThumbnailGrid/ThumbnailGrid.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +28 -14
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.types.js.map +1 -1
- package/dist/ThumbnailGrid/index.js +1 -0
- package/dist/ThumbnailGrid/index.js.map +1 -1
- package/dist/TieredDropdown/TieredDropdown.helpers.js +29 -25
- package/dist/TieredDropdown/TieredDropdown.helpers.js.map +1 -1
- package/dist/TieredDropdown/TieredDropdown.js +241 -145
- package/dist/TieredDropdown/TieredDropdown.js.map +1 -1
- package/dist/TieredDropdown/TieredDropdown.types.js.map +1 -1
- package/dist/TieredDropdown/index.js +1 -0
- package/dist/TieredDropdown/index.js.map +1 -1
- package/dist/TieredDropdown/useSearch.js +49 -39
- package/dist/TieredDropdown/useSearch.js.map +1 -1
- package/dist/TieredSelect/LeafSelectionTieredSelect.js +173 -117
- package/dist/TieredSelect/LeafSelectionTieredSelect.js.map +1 -1
- package/dist/TieredSelect/TierSelectionTieredSelect.js +486 -316
- package/dist/TieredSelect/TierSelectionTieredSelect.js.map +1 -1
- package/dist/TieredSelect/TieredSelect.js +149 -111
- package/dist/TieredSelect/TieredSelect.js.map +1 -1
- package/dist/TieredSelect/TieredSelect.styles.js +40 -18
- package/dist/TieredSelect/TieredSelect.styles.js.map +1 -1
- package/dist/TieredSelect/TieredSelect.types.js.map +1 -1
- package/dist/TieredSelect/TieredSelectMenu.js +390 -277
- package/dist/TieredSelect/TieredSelectMenu.js.map +1 -1
- package/dist/TieredSelect/index.js +1 -0
- package/dist/TieredSelect/index.js.map +1 -1
- package/dist/Tile/Tile.js +154 -90
- package/dist/Tile/Tile.js.map +1 -1
- package/dist/Tile/Tile.styles.js +81 -46
- package/dist/Tile/Tile.styles.js.map +1 -1
- package/dist/Tile/Tile.types.js.map +1 -1
- package/dist/Tile/index.js +1 -0
- package/dist/Tile/index.js.map +1 -1
- package/dist/Title/Title.js +64 -64
- package/dist/Title/Title.js.map +1 -1
- package/dist/Title/Title.styles.js +30 -14
- package/dist/Title/Title.styles.js.map +1 -1
- package/dist/Title/Title.types.js.map +1 -1
- package/dist/Title/index.js +1 -0
- package/dist/Title/index.js.map +1 -1
- package/dist/Toast/Toast.js +44 -40
- package/dist/Toast/Toast.js.map +1 -1
- package/dist/Toast/Toast.styles.js +18 -15
- package/dist/Toast/Toast.styles.js.map +1 -1
- package/dist/Toast/Toast.types.js.map +1 -1
- package/dist/Toast/index.js +1 -0
- package/dist/Toast/index.js.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +20 -25
- package/dist/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/ToggleButton/ToggleButton.styles.js +6 -8
- package/dist/ToggleButton/ToggleButton.styles.js.map +1 -1
- package/dist/ToggleButton/ToggleButton.types.js.map +1 -1
- package/dist/ToggleButton/index.js +1 -0
- package/dist/ToggleButton/index.js.map +1 -1
- package/dist/Token/Token.js +39 -34
- package/dist/Token/Token.js.map +1 -1
- package/dist/Token/Token.styles.js +25 -16
- package/dist/Token/Token.styles.js.map +1 -1
- package/dist/Token/Token.types.js.map +1 -1
- package/dist/Token/index.js +1 -0
- package/dist/Token/index.js.map +1 -1
- package/dist/ToolHeader/ActionIcon.js +45 -38
- package/dist/ToolHeader/ActionIcon.js.map +1 -1
- package/dist/ToolHeader/ActionIcon.types.example.js +58 -18
- package/dist/ToolHeader/ActionIcon.types.example.js.map +1 -1
- package/dist/ToolHeader/ActionIcon.types.js.map +1 -1
- package/dist/ToolHeader/ToolHeader.js +60 -47
- package/dist/ToolHeader/ToolHeader.js.map +1 -1
- package/dist/ToolHeader/ToolHeader.styles.js +30 -18
- package/dist/ToolHeader/ToolHeader.styles.js.map +1 -1
- package/dist/ToolHeader/ToolHeader.types.js.map +1 -1
- package/dist/ToolHeader/index.js.map +1 -1
- package/dist/Tooltip/Tooltip.js +43 -31
- package/dist/Tooltip/Tooltip.js.map +1 -1
- package/dist/Tooltip/Tooltip.styles.js +8 -7
- package/dist/Tooltip/Tooltip.styles.js.map +1 -1
- package/dist/Tooltip/Tooltip.types.js.map +1 -1
- package/dist/Tooltip/index.js +1 -0
- package/dist/Tooltip/index.js.map +1 -1
- package/dist/Tree/Tree.hooks.js +195 -190
- package/dist/Tree/Tree.hooks.js.map +1 -1
- package/dist/Tree/Tree.js +530 -324
- package/dist/Tree/Tree.js.map +1 -1
- package/dist/Tree/Tree.styles.js +49 -28
- package/dist/Tree/Tree.styles.js.map +1 -1
- package/dist/Tree/Tree.types.js.map +1 -1
- package/dist/Tree/index.js +1 -0
- package/dist/Tree/index.js.map +1 -1
- package/dist/Typeahead/Typeahead.js +77 -50
- package/dist/Typeahead/Typeahead.js.map +1 -1
- package/dist/Typeahead/Typeahead.styles.js +16 -8
- package/dist/Typeahead/Typeahead.styles.js.map +1 -1
- package/dist/Typeahead/Typeahead.types.js.map +1 -1
- package/dist/Typeahead/index.js +1 -0
- package/dist/Typeahead/index.js.map +1 -1
- package/dist/Typography/Typography.colors.story.js +282 -141
- package/dist/Typography/Typography.colors.story.js.map +1 -1
- package/dist/Typography/Typography.js +13 -25
- package/dist/Typography/Typography.js.map +1 -1
- package/dist/Typography/Typography.styles.js +42 -41
- package/dist/Typography/Typography.styles.js.map +1 -1
- package/dist/Typography/Typography.table.story.js +24 -45
- package/dist/Typography/Typography.table.story.js.map +1 -1
- package/dist/Typography/Typography.types.js.map +1 -1
- package/dist/Typography/index.js.map +1 -1
- package/dist/_hooks/Analytics.js +27 -18
- package/dist/_hooks/Analytics.js.map +1 -1
- package/dist/_hooks/Anchor.js +123 -84
- package/dist/_hooks/Anchor.js.map +1 -1
- package/dist/_hooks/Autofocus.js +53 -52
- package/dist/_hooks/Autofocus.js.map +1 -1
- package/dist/_hooks/BoundingRect.js +57 -41
- package/dist/_hooks/BoundingRect.js.map +1 -1
- package/dist/_hooks/Buffer.js +64 -39
- package/dist/_hooks/Buffer.js.map +1 -1
- package/dist/_hooks/ClickOutside.js +31 -20
- package/dist/_hooks/ClickOutside.js.map +1 -1
- package/dist/_hooks/DateTime/DateTime.js +235 -188
- package/dist/_hooks/DateTime/DateTime.js.map +1 -1
- package/dist/_hooks/DateTime/index.js +1 -1
- package/dist/_hooks/DateTime/index.js.map +1 -1
- package/dist/_hooks/DelayedCallback.js +41 -25
- package/dist/_hooks/DelayedCallback.js.map +1 -1
- package/dist/_hooks/DelayedToggle.js +98 -59
- package/dist/_hooks/DelayedToggle.js.map +1 -1
- package/dist/_hooks/Deprecation.js +11 -10
- package/dist/_hooks/Deprecation.js.map +1 -1
- package/dist/_hooks/Event.js +53 -28
- package/dist/_hooks/Event.js.map +1 -1
- package/dist/_hooks/EventListener.js +103 -59
- package/dist/_hooks/EventListener.js.map +1 -1
- package/dist/_hooks/EventRegistry.js +19 -14
- package/dist/_hooks/EventRegistry.js.map +1 -1
- package/dist/_hooks/Hotkey.js +35 -32
- package/dist/_hooks/Hotkey.js.map +1 -1
- package/dist/_hooks/I18n.js +54 -52
- package/dist/_hooks/I18n.js.map +1 -1
- package/dist/_hooks/InjectedScript.js +66 -45
- package/dist/_hooks/InjectedScript.js.map +1 -1
- package/dist/_hooks/IntersectionObserver/createIntersectionObserver.js +3 -3
- package/dist/_hooks/IntersectionObserver/createIntersectionObserver.js.map +1 -1
- package/dist/_hooks/IntersectionObserver/index.js.map +1 -1
- package/dist/_hooks/IntersectionObserver/useIntersectionObserver.js +23 -14
- package/dist/_hooks/IntersectionObserver/useIntersectionObserver.js.map +1 -1
- package/dist/_hooks/ListNavigation.js +114 -79
- package/dist/_hooks/ListNavigation.js.map +1 -1
- package/dist/_hooks/OverflowObserver/OverflowObserver.js +56 -32
- package/dist/_hooks/OverflowObserver/OverflowObserver.js.map +1 -1
- package/dist/_hooks/OverflowObserver/OverflowObserver.test.js +110 -0
- package/dist/_hooks/OverflowObserver/OverflowObserver.types.js.map +1 -1
- package/dist/_hooks/OverflowObserver/index.js.map +1 -1
- package/dist/_hooks/Resize.js +10 -4
- package/dist/_hooks/Resize.js.map +1 -1
- package/dist/_hooks/ResizeObserver.js +23 -14
- package/dist/_hooks/ResizeObserver.js.map +1 -1
- package/dist/_hooks/Scroll.js +16 -4
- package/dist/_hooks/Scroll.js.map +1 -1
- package/dist/_hooks/ScrollLock.js +15 -15
- package/dist/_hooks/ScrollLock.js.map +1 -1
- package/dist/_hooks/TextEntry.js +83 -46
- package/dist/_hooks/TextEntry.js.map +1 -1
- package/dist/_hooks/Timer.js +48 -29
- package/dist/_hooks/Timer.js.map +1 -1
- package/dist/_hooks/Trigger.js +120 -86
- package/dist/_hooks/Trigger.js.map +1 -1
- package/dist/_hooks/Visibility.js +82 -49
- package/dist/_hooks/Visibility.js.map +1 -1
- package/dist/_hooks/ZIndex.js +53 -34
- package/dist/_hooks/ZIndex.js.map +1 -1
- package/dist/_hooks/__tests__/Anchor.test.js +109 -0
- package/dist/_hooks/__tests__/BoundingRect.test.js +85 -0
- package/dist/_hooks/__tests__/Buffer.test.js +76 -0
- package/dist/_hooks/__tests__/DateTime.test.js +136 -0
- package/dist/_hooks/__tests__/DelayedCallback.test.js +119 -0
- package/dist/_hooks/__tests__/DelayedToggle.test.js +50 -0
- package/dist/_hooks/__tests__/Deprecation.test.js +58 -0
- package/dist/_hooks/__tests__/Event.test.js +46 -0
- package/dist/_hooks/__tests__/EventListener.test.js +78 -0
- package/dist/_hooks/__tests__/Hotkey.test.js +18 -0
- package/dist/_hooks/__tests__/InjectedScript.test.js +80 -0
- package/dist/_hooks/__tests__/ListNavigation.test.js +101 -0
- package/dist/_hooks/__tests__/TextEntry.test.js +92 -0
- package/dist/_hooks/__tests__/Timer.test.js +60 -0
- package/dist/_hooks/__tests__/Trigger.test.js +52 -0
- package/dist/_hooks/__tests__/Visibility.test.js +86 -0
- package/dist/_hooks/__tests__/ZIndex.test.js +76 -0
- package/dist/_hooks/useFileUploader.js +220 -220
- package/dist/_hooks/useFileUploader.js.map +1 -1
- package/dist/_hooks/useFocusWithin.js +27 -18
- package/dist/_hooks/useFocusWithin.js.map +1 -1
- package/dist/_hooks/useSet.js +71 -45
- package/dist/_hooks/useSet.js.map +1 -1
- package/dist/_hooks/useUpdateEffect.js +14 -13
- package/dist/_hooks/useUpdateEffect.js.map +1 -1
- package/dist/_locales/de-DE.json +354 -354
- package/dist/_locales/en-AU.json +354 -354
- package/dist/_locales/en-CA.json +354 -354
- package/dist/_locales/en-GB.json +354 -354
- package/dist/_locales/en-US.json +30 -30
- package/dist/_locales/en.json +353 -353
- package/dist/_locales/es-ES.json +354 -354
- package/dist/_locales/es.json +354 -354
- package/dist/_locales/fr-CA.json +354 -354
- package/dist/_locales/fr-FR.json +354 -354
- package/dist/_locales/is-IS.json +354 -354
- package/dist/_locales/pt-BR.json +354 -354
- package/dist/_locales/th-TH.json +354 -354
- package/dist/_locales/zh-SG.json +354 -354
- package/dist/_styles/arrows.js +4 -9
- package/dist/_styles/arrows.js.map +1 -1
- package/dist/_styles/borderRadius.js +4 -9
- package/dist/_styles/borderRadius.js.map +1 -1
- package/dist/_styles/colors.js +19 -18
- package/dist/_styles/colors.js.map +1 -1
- package/dist/_styles/media.js.map +1 -1
- package/dist/_styles/mixins.js +14 -16
- package/dist/_styles/mixins.js.map +1 -1
- package/dist/_styles/shadows.js +12 -17
- package/dist/_styles/shadows.js.map +1 -1
- package/dist/_styles/spacing.js +8 -8
- package/dist/_styles/spacing.js.map +1 -1
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +23 -23
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +11 -11
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +7 -7
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +4 -4
- package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
- package/dist/_typedoc/Dropzone/Dropzone.types.json +41 -41
- package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +698 -698
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +4 -4
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +41 -41
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +38 -38
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +30 -30
- package/dist/_typedoc/PageLayout/PageLayout.types.json +22 -22
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +27 -27
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +46 -46
- package/dist/_typedoc/Popover/Popover.types.json +14 -14
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +14 -14
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +20 -20
- package/dist/_typedoc/Select/Select.types.json +55 -55
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/Switch/Switch.types.json +3 -3
- package/dist/_typedoc/Table/Table.types.json +96 -96
- package/dist/_typedoc/Tabs/Tabs.types.json +17 -17
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +16 -16
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +30 -30
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +3 -3
- package/dist/_typedoc/Token/Token.types.json +4 -4
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +86 -86
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +8 -8
- package/dist/_typedoc/_utils/types.json +3 -3
- package/dist/_utils/CalendarHelpers.js +147 -129
- package/dist/_utils/CalendarHelpers.js.map +1 -1
- package/dist/_utils/TinyMCE.js +60 -109
- package/dist/_utils/TinyMCE.js.map +1 -1
- package/dist/_utils/__tests__/CalendarHelpers.test.js +64 -0
- package/dist/_utils/__tests__/filename.test.js +27 -0
- package/dist/_utils/__tests__/getAnchorPosition.test.js +250 -0
- package/dist/_utils/__tests__/mergeRefs.test.js +58 -0
- package/dist/_utils/__tests__/slotify.test.js +152 -0
- package/dist/_utils/addSubcomponents.js +5 -5
- package/dist/_utils/addSubcomponents.js.map +1 -1
- package/dist/_utils/dateTime.js +103 -85
- package/dist/_utils/dateTime.js.map +1 -1
- package/dist/_utils/dom.js +21 -25
- package/dist/_utils/dom.js.map +1 -1
- package/dist/_utils/filename.js +19 -11
- package/dist/_utils/filename.js.map +1 -1
- package/dist/_utils/genericAnalyticsClient.js +40 -26
- package/dist/_utils/genericAnalyticsClient.js.map +1 -1
- package/dist/_utils/getAnchorPosition.js +221 -127
- package/dist/_utils/getAnchorPosition.js.map +1 -1
- package/dist/_utils/i18n.js +19 -19
- package/dist/_utils/i18n.js.map +1 -1
- package/dist/_utils/isIE11.js +4 -4
- package/dist/_utils/isIE11.js.map +1 -1
- package/dist/_utils/isReactElement.js +1 -1
- package/dist/_utils/isReactElement.js.map +1 -1
- package/dist/_utils/mergeRefs.js +13 -13
- package/dist/_utils/mergeRefs.js.map +1 -1
- package/dist/_utils/partition.js +13 -5
- package/dist/_utils/partition.js.map +1 -1
- package/dist/_utils/placement.js +13 -13
- package/dist/_utils/placement.js.map +1 -1
- package/dist/_utils/polymorphic.js +6 -1
- package/dist/_utils/polymorphic.js.map +1 -1
- package/dist/_utils/props.js +1 -1
- package/dist/_utils/props.js.map +1 -1
- package/dist/_utils/propsTypedoc.js +14 -0
- package/dist/_utils/propsTypedoc.js.map +1 -1
- package/dist/_utils/runInQueue.js +39 -57
- package/dist/_utils/runInQueue.js.map +1 -1
- package/dist/_utils/scrollIntoView.js +17 -15
- package/dist/_utils/scrollIntoView.js.map +1 -1
- package/dist/_utils/slotify.js +45 -42
- package/dist/_utils/slotify.js.map +1 -1
- package/dist/_utils/triggerListeners.js +65 -53
- package/dist/_utils/triggerListeners.js.map +1 -1
- package/dist/_utils/types.js.map +1 -1
- package/dist/_utils/usingHookOrDefault.js +3 -5
- package/dist/_utils/usingHookOrDefault.js.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/dist/Link/Link.coverage.stories.js +0 -28
- package/dist/Link/Link.coverage.stories.js.map +0 -1
package/dist/Form/Form.js
CHANGED
|
@@ -1,37 +1,61 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
var _excluded = ["initialValues", "onSubmit", "disabled", "enableConfirmNavigation", "variant", "validationSchema", "view"],
|
|
2
|
+
_excluded2 = ["children", "className", "onKeyDown", "style"],
|
|
3
|
+
_excluded3 = ["as", "children", "colStart", "colWidth", "disabled", "error", "label", "name", "required", "tooltip", "validate", "view"],
|
|
4
|
+
_excluded4 = ["as", "children", "colWidth", "disabled", "error", "label", "name", "required", "tooltip", "validate", "view"],
|
|
5
|
+
_excluded5 = ["children"],
|
|
6
|
+
_excluded6 = ["children"],
|
|
7
|
+
_excluded7 = ["onBlur", "onChange", "field"],
|
|
8
|
+
_excluded8 = ["field"],
|
|
9
|
+
_excluded9 = ["onBlur", "onChange", "field"],
|
|
10
|
+
_excluded10 = ["decimalScale", "defaultValue", "field", "fillDecimalScale", "locale", "onChange", "prefix", "suffix"],
|
|
11
|
+
_excluded11 = ["onBlur", "onChange", "field"],
|
|
12
|
+
_excluded12 = ["currencyIsoCode", "currencyDisplay", "decimalScale", "suffix", "prefix"],
|
|
13
|
+
_excluded13 = ["onChange", "field"],
|
|
14
|
+
_excluded14 = ["onChange", "field"],
|
|
15
|
+
_excluded15 = ["field", "i18nScope", "onBlur", "onChange"],
|
|
16
|
+
_excluded16 = ["field", "i18nScope"],
|
|
17
|
+
_excluded17 = ["field", "onBlur", "onChange"],
|
|
18
|
+
_excluded18 = ["field"],
|
|
19
|
+
_excluded19 = ["onChange", "field"],
|
|
20
|
+
_excluded20 = ["field", "onBlur", "onChange", "onClick", "onContextMenu", "onCopy", "onCut", "onDrag", "onDragDrop", "onDragEnd", "onDragGesture", "onDragOver", "onDrop", "onFocus", "onKeyDown", "onKeyPress", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseOut", "onMouseOver", "onMouseUp", "onPaste", "onReset", "onSubmit"],
|
|
21
|
+
_excluded21 = ["field", "getId", "getLabel", "isDisabledOption", "options"],
|
|
22
|
+
_excluded22 = ["field", "getId", "getLabel", "options"],
|
|
23
|
+
_excluded23 = ["field", "getId", "getLabel", "isDisabledOption", "isIndeterminateOption", "options"],
|
|
24
|
+
_excluded24 = ["field", "getId", "getLabel", "isDisabledOption", "isIndeterminateOption", "options"],
|
|
25
|
+
_excluded25 = ["getId", "getLabel"],
|
|
26
|
+
_excluded26 = ["getId", "getLabel"],
|
|
27
|
+
_excluded27 = ["afterHide", "field", "getGroup", "getId", "getLabel", "groupGetId", "groupGetLabel", "groupHeaderRenderer", "isSuggestedOption", "onClear", "onSearch", "onSelect", "searchComparator", "options", "optgroups", "optionRenderer"],
|
|
28
|
+
_excluded28 = ["afterHide", "afterShow", "beforeHide", "beforeShow", "field", "footer", "getId", "getGroup", "getLabel", "groupGetId", "groupGetLabel", "groupHeaderRenderer", "i18nScope", "isSuggestedOption", "options", "optgroups", "optionRenderer", "searchComparator", "onBlur", "onClear", "onSearch", "onSelect"],
|
|
29
|
+
_excluded29 = ["field", "onBlur", "onClear", "onSelect", "getId", "getLabel"],
|
|
30
|
+
_excluded30 = ["afterHide", "afterShow", "beforeHide", "beforeShow", "color", "field", "footer", "getColor", "getGroup", "getLabel", "getSuggested", "groupGetId", "groupGetLabel", "i18nScope", "onClear", "onSearch", "onSelect", "options", "optgroups"],
|
|
31
|
+
_excluded31 = ["field", "onBlur", "onChange", "getId", "getLabel"],
|
|
32
|
+
_excluded32 = ["afterHide", "afterShow", "beforeHide", "beforeShow", "emptyMessage", "field", "getGroup", "getId", "getLabel", "groupHeaderRenderer", "isOptionDisabled", "onChange", "onSearch", "onScrollBottom", "options", "optgroups", "optionRenderer", "placement", "placeholder", "tokenRenderer", "qa"],
|
|
33
|
+
_excluded33 = ["field", "onBlur", "onChange", "getId", "getLabel"],
|
|
34
|
+
_excluded34 = ["afterHide", "afterShow", "beforeHide", "beforeShow", "emptyMessage", "field", "getGroup", "getId", "getLabel", "getOptGroup", "groupRenderer", "groups", "isOptionDisabled", "placeholder", "placement", "onChange", "onScrollBottom", "onSearch", "optgroups", "options", "optionRenderer", "optGroupRenderer", "tokenRenderer", "qa"],
|
|
35
|
+
_excluded35 = ["field", "onBlur", "onChange", "getId", "getLabel"],
|
|
36
|
+
_excluded36 = ["afterHide", "afterShow", "beforeHide", "beforeShow", "field", "getId", "getLabel", "getGroupId", "getNextGroupId", "getValueString", "i18nScope", "isLeaf", "isTierDisabled", "loadingMore", "onChange", "onClear", "onNavigate", "onScrollBottom", "onSearch", "onQuickCreate", "options", "selectableTiers"];
|
|
37
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
38
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
39
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
40
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
41
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
42
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
43
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
44
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
45
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
46
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
47
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
48
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
49
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
50
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
52
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
53
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
54
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
55
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
32
56
|
import { useId } from '@react-aria/utils';
|
|
33
57
|
import conditionalStrings from 'classnames';
|
|
34
|
-
import { Formik, useField as useFormikField, useFormikContext
|
|
58
|
+
import { Formik, useField as useFormikField, useFormikContext } from 'formik';
|
|
35
59
|
import { either, identity, is, isEmpty, prop, startsWith, toLower } from 'ramda';
|
|
36
60
|
import React from 'react';
|
|
37
61
|
import { Banner, ErrorBanner } from '../Banner';
|
|
@@ -41,15 +65,15 @@ import { DateSelect } from '../DateSelect';
|
|
|
41
65
|
import { GroupSelect } from '../GroupSelect';
|
|
42
66
|
import { Input } from '../Input';
|
|
43
67
|
import { MultiSelect } from '../MultiSelect';
|
|
44
|
-
import { CurrencyInput as BaseCurrencyInput, NumberInput as BaseNumberInput
|
|
68
|
+
import { CurrencyInput as BaseCurrencyInput, NumberInput as BaseNumberInput } from '../NumberInput';
|
|
45
69
|
import { getCurrencyProps } from '../NumberInput/NumberInput';
|
|
46
|
-
import { defaultCurrencyDecimalScale, defaultCurrencyFillDecimalScale, defaultCurrencyInputPrefix
|
|
70
|
+
import { defaultCurrencyDecimalScale, defaultCurrencyFillDecimalScale, defaultCurrencyInputPrefix } from '../NumberInput/NumberInput.constants';
|
|
47
71
|
import { useNumberFormat } from '../NumberInput/NumberInput.hooks';
|
|
48
72
|
import { defaultLocale } from '../NumberInput/NumberInput.utils';
|
|
49
73
|
import { Pill } from '../Pill';
|
|
50
74
|
import { defaultGetColor, PillSelect } from '../PillSelect/PillSelect';
|
|
51
75
|
import { RadioButton } from '../RadioButton';
|
|
52
|
-
import { Select
|
|
76
|
+
import { Select } from '../Select';
|
|
53
77
|
import { TextArea } from '../TextArea';
|
|
54
78
|
import { TextEditor } from '../TextEditor';
|
|
55
79
|
import { TextEditorOutput } from '../TextEditorOutput';
|
|
@@ -61,782 +85,1395 @@ import { useI18nContext } from '../_hooks/I18n';
|
|
|
61
85
|
import { addSubcomponents } from '../_utils/addSubcomponents';
|
|
62
86
|
import { formatMachineDate, toDate } from '../_utils/dateTime';
|
|
63
87
|
import { useCloseWithConfirmContext } from './closeWithConfirm';
|
|
64
|
-
import { StyledForm, StyledFormCheckboxInput, StyledFormFieldBanner, StyledFormFieldErrorIcon, StyledFormFieldHeader, StyledFormFieldMain, StyledFormFieldRequiredMark, StyledFormFieldTooltipIcon, StyledFormikForm, StyledFormOutputFiledset, StyledFormOutputTextArea, StyledFormRow, StyledLabel, StyledTraditionalFormColumn, StyledTraditionalFormLabel
|
|
88
|
+
import { StyledForm, StyledFormCheckboxInput, StyledFormFieldBanner, StyledFormFieldErrorIcon, StyledFormFieldHeader, StyledFormFieldMain, StyledFormFieldRequiredMark, StyledFormFieldTooltipIcon, StyledFormikForm, StyledFormOutputFiledset, StyledFormOutputTextArea, StyledFormRow, StyledLabel, StyledTraditionalFormColumn, StyledTraditionalFormLabel } from './Form.styles';
|
|
65
89
|
var emptyObject = {};
|
|
66
90
|
var emptyArray = [];
|
|
67
|
-
function noop() {
|
|
68
|
-
var isFunction = function (obj) {
|
|
91
|
+
function noop() {}
|
|
92
|
+
var isFunction = function isFunction(obj) {
|
|
93
|
+
return typeof obj === 'function';
|
|
94
|
+
};
|
|
69
95
|
function getValueComponent(view, asComponent) {
|
|
70
|
-
|
|
96
|
+
return asComponent[view] || asComponent || TextInput;
|
|
71
97
|
}
|
|
72
|
-
var SharedPropsContext = React.createContext(emptyObject);
|
|
73
|
-
export var FormContext = React.createContext({
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
98
|
+
var SharedPropsContext = /*#__PURE__*/React.createContext(emptyObject);
|
|
99
|
+
export var FormContext = /*#__PURE__*/React.createContext({
|
|
100
|
+
different: false,
|
|
101
|
+
disabled: false,
|
|
102
|
+
enableReinitialize: false,
|
|
103
|
+
setFieldDifferent: function setFieldDifferent(k, d) {},
|
|
104
|
+
variant: 'wxp',
|
|
105
|
+
view: 'create'
|
|
80
106
|
});
|
|
81
107
|
export function useFormContext() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
108
|
+
var formik = useFormikContext();
|
|
109
|
+
var formulaire = React.useContext(FormContext);
|
|
110
|
+
return _objectSpread(_objectSpread({}, formik), formulaire);
|
|
85
111
|
}
|
|
86
|
-
export function getPrimitiveValue(value
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
112
|
+
export function getPrimitiveValue(value) {
|
|
113
|
+
var getId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetId;
|
|
114
|
+
if (value === null || value === undefined) {
|
|
115
|
+
return '';
|
|
116
|
+
}
|
|
117
|
+
if (value instanceof Date) {
|
|
118
|
+
return value.toISOString();
|
|
119
|
+
}
|
|
120
|
+
if (is(Array, value)) {
|
|
121
|
+
return value.map(getId).join();
|
|
122
|
+
}
|
|
123
|
+
if (is(Object, value)) {
|
|
124
|
+
if (isEmpty(value)) {
|
|
125
|
+
return '';
|
|
90
126
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (is(Array, value)) {
|
|
95
|
-
return value.map(getId).join();
|
|
96
|
-
}
|
|
97
|
-
if (is(Object, value)) {
|
|
98
|
-
if (isEmpty(value)) {
|
|
99
|
-
return '';
|
|
100
|
-
}
|
|
101
|
-
return getId(value);
|
|
102
|
-
}
|
|
103
|
-
return value;
|
|
127
|
+
return getId(value);
|
|
128
|
+
}
|
|
129
|
+
return value;
|
|
104
130
|
}
|
|
105
|
-
export function useField(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
131
|
+
export function useField() {
|
|
132
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : emptyObject,
|
|
133
|
+
_disabled = _ref.disabled,
|
|
134
|
+
_ref$error = _ref.error,
|
|
135
|
+
_error = _ref$error === void 0 ? false : _ref$error,
|
|
136
|
+
getId = _ref.getId,
|
|
137
|
+
_ref$required = _ref.required,
|
|
138
|
+
_required = _ref$required === void 0 ? false : _ref$required,
|
|
139
|
+
name = _ref.name,
|
|
140
|
+
validate = _ref.validate,
|
|
141
|
+
_view = _ref.view;
|
|
142
|
+
var _useFormikField = useFormikField({
|
|
143
|
+
name: name,
|
|
144
|
+
validate: validate
|
|
145
|
+
}),
|
|
146
|
+
_useFormikField2 = _slicedToArray(_useFormikField, 3),
|
|
147
|
+
input = _useFormikField2[0],
|
|
148
|
+
meta = _useFormikField2[1],
|
|
149
|
+
helpers = _useFormikField2[2];
|
|
150
|
+
var _React$useContext = React.useContext(FormContext),
|
|
151
|
+
disabled = _React$useContext.disabled,
|
|
152
|
+
setFieldDifferent = _React$useContext.setFieldDifferent,
|
|
153
|
+
validationSchema = _React$useContext.validationSchema,
|
|
154
|
+
view = _React$useContext.view;
|
|
155
|
+
var _useFormikContext = useFormikContext(),
|
|
156
|
+
validateOnBlur = _useFormikContext.validateOnBlur,
|
|
157
|
+
validateOnChange = _useFormikContext.validateOnChange;
|
|
158
|
+
var requiredInSchema = React.useMemo(function () {
|
|
159
|
+
var fieldSchema = validationSchema === null || validationSchema === void 0 ? void 0 : validationSchema.describe().fields[name];
|
|
160
|
+
return (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.tests.findIndex(function (test) {
|
|
161
|
+
return test.name === 'required';
|
|
162
|
+
})) > -1;
|
|
163
|
+
}, [validationSchema, name]);
|
|
164
|
+
var initialPrimitiveValue = React.useMemo(function () {
|
|
165
|
+
return getPrimitiveValue(meta.initialValue, getId);
|
|
166
|
+
}, [meta.initialValue, getId]);
|
|
167
|
+
var onChange = React.useCallback(function (event) {
|
|
168
|
+
setFieldDifferent(name, initialPrimitiveValue !== getPrimitiveValue(event.target.value, getId));
|
|
169
|
+
input.onChange(event);
|
|
170
|
+
}, [initialPrimitiveValue, input.onChange, getPrimitiveValue, getId, setFieldDifferent]);
|
|
171
|
+
var setValue = React.useCallback(function (value, shouldValidate) {
|
|
172
|
+
var shouldMarkDifferent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
173
|
+
if (shouldMarkDifferent) {
|
|
174
|
+
setFieldDifferent(name, initialPrimitiveValue !== getPrimitiveValue(value, getId));
|
|
175
|
+
}
|
|
176
|
+
helpers.setValue(value, shouldValidate);
|
|
177
|
+
}, [initialPrimitiveValue, helpers.setValue, getPrimitiveValue, getId, setFieldDifferent]);
|
|
178
|
+
return {
|
|
179
|
+
input: _objectSpread(_objectSpread({}, input), {}, {
|
|
180
|
+
onChange: onChange
|
|
181
|
+
}),
|
|
182
|
+
helpers: _objectSpread(_objectSpread({}, helpers), {}, {
|
|
183
|
+
setValue: setValue
|
|
184
|
+
}),
|
|
185
|
+
messages: {
|
|
186
|
+
error: typeof _error === 'string' ? _error : meta.error
|
|
187
|
+
},
|
|
188
|
+
meta: _objectSpread(_objectSpread({}, meta), {}, {
|
|
189
|
+
error: validateOnBlur || validateOnChange ? meta.error && meta.touched || Boolean(_error) : Boolean(meta.error) || Boolean(_error),
|
|
190
|
+
disabled: _disabled !== null && _disabled !== void 0 ? _disabled : disabled,
|
|
191
|
+
required: requiredInSchema || _required,
|
|
192
|
+
view: _view || view
|
|
193
|
+
})
|
|
194
|
+
};
|
|
150
195
|
}
|
|
151
|
-
var onBeforeUnload = function (e) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
196
|
+
var onBeforeUnload = function onBeforeUnload(e) {
|
|
197
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
|
|
198
|
+
e.preventDefault();
|
|
199
|
+
e.returnValue = '';
|
|
155
200
|
};
|
|
156
|
-
var useDifferent = function () {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
var resetDifferent = function () { return setDifferentObject(emptyObject); };
|
|
171
|
-
var different = React.useMemo(function () {
|
|
172
|
-
return Object.values(differentObject).some(identity);
|
|
173
|
-
}, [differentObject]);
|
|
174
|
-
return { different: different, resetDifferent: resetDifferent, setFieldDifferent: setFieldDifferent };
|
|
175
|
-
};
|
|
176
|
-
function Form_(_a) {
|
|
177
|
-
var _b = _a.initialValues, initialValues = _b === void 0 ? emptyObject : _b, _c = _a.onSubmit, _onSubmit = _c === void 0 ? noop : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.enableConfirmNavigation, enableConfirmNavigation = _e === void 0 ? false : _e, _f = _a.variant, variant = _f === void 0 ? 'wxp' : _f, validationSchema = _a.validationSchema, _g = _a.view, view = _g === void 0 ? 'create' : _g, props = __rest(_a, ["initialValues", "onSubmit", "disabled", "enableConfirmNavigation", "variant", "validationSchema", "view"]);
|
|
178
|
-
var _h = useDifferent(), different = _h.different, resetDifferent = _h.resetDifferent, setFieldDifferent = _h.setFieldDifferent;
|
|
179
|
-
var setFormIsDifferent = useCloseWithConfirmContext().setFormIsDifferent;
|
|
180
|
-
React.useEffect(function () {
|
|
181
|
-
if (enableConfirmNavigation) {
|
|
182
|
-
if (different && (view === 'create' || view === 'update')) {
|
|
183
|
-
window.onbeforeunload = onBeforeUnload;
|
|
184
|
-
setFormIsDifferent(true);
|
|
185
|
-
}
|
|
186
|
-
else if (!different && (view === 'create' || view === 'update')) {
|
|
187
|
-
window.onbeforeunload = null;
|
|
188
|
-
setFormIsDifferent(false);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}, [enableConfirmNavigation, different, view]);
|
|
192
|
-
var reset = function () {
|
|
193
|
-
if (enableConfirmNavigation) {
|
|
194
|
-
window.onbeforeunload = null;
|
|
195
|
-
}
|
|
196
|
-
resetDifferent();
|
|
197
|
-
};
|
|
198
|
-
var onSubmit = function (values, actions) {
|
|
199
|
-
var promiseOrUndefined = _onSubmit(values, actions);
|
|
200
|
-
if (promiseOrUndefined === undefined) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
return promiseOrUndefined
|
|
204
|
-
.then(function (result) {
|
|
205
|
-
reset();
|
|
206
|
-
return result;
|
|
207
|
-
})
|
|
208
|
-
.catch(function (result) {
|
|
209
|
-
return result;
|
|
201
|
+
var useDifferent = function useDifferent() {
|
|
202
|
+
var _React$useState = React.useState(emptyObject),
|
|
203
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
204
|
+
differentObject = _React$useState2[0],
|
|
205
|
+
setDifferentObject = _React$useState2[1];
|
|
206
|
+
var setFieldDifferent = function setFieldDifferent(name, isDiff) {
|
|
207
|
+
if (isDiff !== differentObject[name]) {
|
|
208
|
+
// HACK: Do not change. setTimeout seemingly allows fields to update their
|
|
209
|
+
// state before causing context re-render. This is specific to TinyMCE behavior.
|
|
210
|
+
setTimeout(function () {
|
|
211
|
+
return setDifferentObject(function (prev) {
|
|
212
|
+
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, name, isDiff));
|
|
210
213
|
});
|
|
211
|
-
|
|
212
|
-
return (React.createElement(FormContext.Provider, { value: {
|
|
213
|
-
different: different,
|
|
214
|
-
disabled: disabled,
|
|
215
|
-
setFieldDifferent: setFieldDifferent,
|
|
216
|
-
validationSchema: validationSchema,
|
|
217
|
-
variant: variant,
|
|
218
|
-
view: view,
|
|
219
|
-
enableReinitialize: props.enableReinitialize,
|
|
220
|
-
} },
|
|
221
|
-
React.createElement(Formik, __assign({}, __assign({ initialValues: initialValues, onSubmit: onSubmit, validationSchema: validationSchema, validateOnBlur: false, validateOnChange: false }, props)), isFunction(props.children) ? props.children : React.createElement(React.Fragment, null, props.children))));
|
|
222
|
-
}
|
|
223
|
-
export function FormForm(_a) {
|
|
224
|
-
var children = _a.children, className = _a.className, onKeyDown = _a.onKeyDown, style = _a.style, props = __rest(_a, ["children", "className", "onKeyDown", "style"]);
|
|
225
|
-
var view = React.useContext(FormContext).view;
|
|
226
|
-
if (view === 'create' || view === 'update') {
|
|
227
|
-
var preventFormSubmission = function (e) {
|
|
228
|
-
if (e.key === 'Enter' &&
|
|
229
|
-
e.target instanceof Element &&
|
|
230
|
-
(e.target.tagName === 'INPUT' ||
|
|
231
|
-
e.target.tagName === 'DIV' ||
|
|
232
|
-
e.target.tagName === 'SPAN')) {
|
|
233
|
-
e.stopPropagation();
|
|
234
|
-
e.preventDefault();
|
|
235
|
-
}
|
|
236
|
-
onKeyDown && onKeyDown(e);
|
|
237
|
-
};
|
|
238
|
-
return (React.createElement(StyledFormikForm, __assign({ children: children, className: className, onKeyDown: preventFormSubmission, style: style }, props)));
|
|
214
|
+
});
|
|
239
215
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
216
|
+
};
|
|
217
|
+
var resetDifferent = function resetDifferent() {
|
|
218
|
+
return setDifferentObject(emptyObject);
|
|
219
|
+
};
|
|
220
|
+
var different = React.useMemo(function () {
|
|
221
|
+
return Object.values(differentObject).some(identity);
|
|
222
|
+
}, [differentObject]);
|
|
223
|
+
return {
|
|
224
|
+
different: different,
|
|
225
|
+
resetDifferent: resetDifferent,
|
|
226
|
+
setFieldDifferent: setFieldDifferent
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
function Form_(_ref2) {
|
|
230
|
+
var _ref2$initialValues = _ref2.initialValues,
|
|
231
|
+
initialValues = _ref2$initialValues === void 0 ? emptyObject : _ref2$initialValues,
|
|
232
|
+
_ref2$onSubmit = _ref2.onSubmit,
|
|
233
|
+
_onSubmit = _ref2$onSubmit === void 0 ? noop : _ref2$onSubmit,
|
|
234
|
+
_ref2$disabled = _ref2.disabled,
|
|
235
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
236
|
+
_ref2$enableConfirmNa = _ref2.enableConfirmNavigation,
|
|
237
|
+
enableConfirmNavigation = _ref2$enableConfirmNa === void 0 ? false : _ref2$enableConfirmNa,
|
|
238
|
+
_ref2$variant = _ref2.variant,
|
|
239
|
+
variant = _ref2$variant === void 0 ? 'wxp' : _ref2$variant,
|
|
240
|
+
validationSchema = _ref2.validationSchema,
|
|
241
|
+
_ref2$view = _ref2.view,
|
|
242
|
+
view = _ref2$view === void 0 ? 'create' : _ref2$view,
|
|
243
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
244
|
+
var _useDifferent = useDifferent(),
|
|
245
|
+
different = _useDifferent.different,
|
|
246
|
+
resetDifferent = _useDifferent.resetDifferent,
|
|
247
|
+
setFieldDifferent = _useDifferent.setFieldDifferent;
|
|
248
|
+
var _useCloseWithConfirmC = useCloseWithConfirmContext(),
|
|
249
|
+
setFormIsDifferent = _useCloseWithConfirmC.setFormIsDifferent;
|
|
250
|
+
React.useEffect(function () {
|
|
251
|
+
if (enableConfirmNavigation) {
|
|
252
|
+
if (different && (view === 'create' || view === 'update')) {
|
|
253
|
+
window.onbeforeunload = onBeforeUnload;
|
|
254
|
+
setFormIsDifferent(true);
|
|
255
|
+
} else if (!different && (view === 'create' || view === 'update')) {
|
|
256
|
+
window.onbeforeunload = null;
|
|
257
|
+
setFormIsDifferent(false);
|
|
258
|
+
}
|
|
256
259
|
}
|
|
257
|
-
|
|
260
|
+
}, [enableConfirmNavigation, different, view]);
|
|
261
|
+
var reset = function reset() {
|
|
262
|
+
if (enableConfirmNavigation) {
|
|
263
|
+
window.onbeforeunload = null;
|
|
264
|
+
}
|
|
265
|
+
resetDifferent();
|
|
266
|
+
};
|
|
267
|
+
var onSubmit = function onSubmit(values, actions) {
|
|
268
|
+
var promiseOrUndefined = _onSubmit(values, actions);
|
|
269
|
+
if (promiseOrUndefined === undefined) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
return promiseOrUndefined.then(function (result) {
|
|
273
|
+
reset();
|
|
274
|
+
return result;
|
|
275
|
+
})["catch"](function (result) {
|
|
276
|
+
return result;
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
return /*#__PURE__*/React.createElement(FormContext.Provider, {
|
|
280
|
+
value: {
|
|
281
|
+
different: different,
|
|
282
|
+
disabled: disabled,
|
|
283
|
+
setFieldDifferent: setFieldDifferent,
|
|
284
|
+
validationSchema: validationSchema,
|
|
285
|
+
variant: variant,
|
|
286
|
+
view: view,
|
|
287
|
+
enableReinitialize: props.enableReinitialize
|
|
288
|
+
}
|
|
289
|
+
}, /*#__PURE__*/React.createElement(Formik, _objectSpread({
|
|
290
|
+
initialValues: initialValues,
|
|
291
|
+
onSubmit: onSubmit,
|
|
292
|
+
validationSchema: validationSchema,
|
|
293
|
+
validateOnBlur: false,
|
|
294
|
+
validateOnChange: false
|
|
295
|
+
}, props), isFunction(props.children) ? props.children : /*#__PURE__*/React.createElement(React.Fragment, null, props.children)));
|
|
296
|
+
}
|
|
297
|
+
export function FormForm(_ref3) {
|
|
298
|
+
var children = _ref3.children,
|
|
299
|
+
className = _ref3.className,
|
|
300
|
+
onKeyDown = _ref3.onKeyDown,
|
|
301
|
+
style = _ref3.style,
|
|
302
|
+
props = _objectWithoutProperties(_ref3, _excluded2);
|
|
303
|
+
var _React$useContext2 = React.useContext(FormContext),
|
|
304
|
+
view = _React$useContext2.view;
|
|
305
|
+
if (view === 'create' || view === 'update') {
|
|
306
|
+
var preventFormSubmission = function preventFormSubmission(e) {
|
|
307
|
+
if (e.key === 'Enter' && e.target instanceof Element && (e.target.tagName === 'INPUT' || e.target.tagName === 'DIV' || e.target.tagName === 'SPAN')) {
|
|
308
|
+
e.stopPropagation();
|
|
309
|
+
e.preventDefault();
|
|
310
|
+
}
|
|
311
|
+
onKeyDown && onKeyDown(e);
|
|
312
|
+
};
|
|
313
|
+
return /*#__PURE__*/React.createElement(StyledFormikForm, _extends({
|
|
314
|
+
children: children,
|
|
315
|
+
className: className,
|
|
316
|
+
onKeyDown: preventFormSubmission,
|
|
317
|
+
style: style
|
|
318
|
+
}, props));
|
|
319
|
+
}
|
|
320
|
+
return /*#__PURE__*/React.createElement(StyledForm, {
|
|
321
|
+
children: children,
|
|
322
|
+
className: className,
|
|
323
|
+
style: style
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
export function FormErrorBanner(_ref4) {
|
|
327
|
+
var item = _ref4.item,
|
|
328
|
+
_ref4$i18nScope = _ref4.i18nScope,
|
|
329
|
+
i18nScope = _ref4$i18nScope === void 0 ? 'core.form.errorBanner' : _ref4$i18nScope;
|
|
330
|
+
var context = useFormContext();
|
|
331
|
+
var I18n = useI18nContext();
|
|
332
|
+
if ((context.view === 'create' || context.view === 'update') && !isEmpty(context.errors)) {
|
|
333
|
+
return /*#__PURE__*/React.createElement(ErrorBanner, {
|
|
334
|
+
role: "alert"
|
|
335
|
+
}, /*#__PURE__*/React.createElement(Banner.Content, null, /*#__PURE__*/React.createElement(Banner.Title, null, context.view === 'create' ? I18n.t('coundNotCreateItem', {
|
|
336
|
+
item: item,
|
|
337
|
+
scope: i18nScope
|
|
338
|
+
}) : I18n.t('couldNotUpdateItem', {
|
|
339
|
+
item: item,
|
|
340
|
+
scope: i18nScope
|
|
341
|
+
})), /*#__PURE__*/React.createElement(Banner.Body, null, context.view === 'create' ? I18n.t('fixErrorsToCreate', {
|
|
342
|
+
scope: i18nScope
|
|
343
|
+
}) : I18n.t('fixErrorsToUpdate', {
|
|
344
|
+
scope: i18nScope
|
|
345
|
+
}))));
|
|
346
|
+
}
|
|
347
|
+
return null;
|
|
258
348
|
}
|
|
259
349
|
export function isEmptyField(val) {
|
|
260
|
-
|
|
261
|
-
val === null ||
|
|
262
|
-
val.length === 0 ||
|
|
263
|
-
(is(Object, val) && isEmpty(val)));
|
|
350
|
+
return val === undefined || val === null || val.length === 0 || is(Object, val) && isEmpty(val);
|
|
264
351
|
}
|
|
265
|
-
export function WXPField(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
352
|
+
export function WXPField(_ref5) {
|
|
353
|
+
var AsComponent = _ref5.as,
|
|
354
|
+
children = _ref5.children,
|
|
355
|
+
_ref5$colStart = _ref5.colStart,
|
|
356
|
+
colStart = _ref5$colStart === void 0 ? 1 : _ref5$colStart,
|
|
357
|
+
_ref5$colWidth = _ref5.colWidth,
|
|
358
|
+
colWidth = _ref5$colWidth === void 0 ? 6 : _ref5$colWidth,
|
|
359
|
+
disabled = _ref5.disabled,
|
|
360
|
+
error = _ref5.error,
|
|
361
|
+
label = _ref5.label,
|
|
362
|
+
name = _ref5.name,
|
|
363
|
+
required = _ref5.required,
|
|
364
|
+
tooltip = _ref5.tooltip,
|
|
365
|
+
validate = _ref5.validate,
|
|
366
|
+
view = _ref5.view,
|
|
367
|
+
props = _objectWithoutProperties(_ref5, _excluded3);
|
|
368
|
+
var i18n = useI18nContext();
|
|
369
|
+
var field = useField({
|
|
370
|
+
disabled: disabled,
|
|
371
|
+
error: error,
|
|
372
|
+
getId: props.getId,
|
|
373
|
+
name: name,
|
|
374
|
+
required: required,
|
|
375
|
+
validate: validate,
|
|
376
|
+
view: view
|
|
377
|
+
});
|
|
378
|
+
var ValueComponent = getValueComponent(field.meta.view, AsComponent);
|
|
379
|
+
var labelId = useId();
|
|
380
|
+
var fieldErrorId = useId();
|
|
381
|
+
var hasRequiredMark = field.meta.required && (field.meta.view === 'create' || field.meta.view === 'update');
|
|
382
|
+
var valueComponentAriaProps = {
|
|
383
|
+
'aria-invalid': field.meta.error ? true : undefined,
|
|
384
|
+
'aria-labelledby': label ? labelId : undefined,
|
|
385
|
+
'aria-describedby': field.meta.error && field.messages.error ? fieldErrorId : undefined
|
|
386
|
+
};
|
|
387
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledFormFieldHeader, {
|
|
388
|
+
$colIeSpan: colWidth,
|
|
389
|
+
$colStart: colStart,
|
|
390
|
+
$colEnd: colStart + colWidth
|
|
391
|
+
}, label && /*#__PURE__*/React.createElement(StyledLabel, {
|
|
392
|
+
id: labelId,
|
|
393
|
+
htmlFor: name
|
|
394
|
+
}, label), hasRequiredMark && /*#__PURE__*/React.createElement(StyledFormFieldRequiredMark, null), tooltip && /*#__PURE__*/React.createElement(Tooltip, {
|
|
395
|
+
role: "tooltip",
|
|
396
|
+
overlay: tooltip,
|
|
397
|
+
trigger: ['hover', 'focus']
|
|
398
|
+
}, /*#__PURE__*/React.createElement(StyledFormFieldTooltipIcon, {
|
|
399
|
+
"aria-label": i18n.t('core.form.field.tooltipHelp'),
|
|
400
|
+
"aria-hidden": false,
|
|
401
|
+
size: "sm",
|
|
402
|
+
tabIndex: 0
|
|
403
|
+
}))), /*#__PURE__*/React.createElement(StyledFormFieldMain, {
|
|
404
|
+
$colIeSpan: colWidth,
|
|
405
|
+
$colStart: colStart,
|
|
406
|
+
$colEnd: colStart + colWidth,
|
|
407
|
+
$read: field.meta.view === 'read'
|
|
408
|
+
}, children ? isFunction(children) ? children(field) : children : /*#__PURE__*/React.createElement(ValueComponent, _extends({}, valueComponentAriaProps, props, {
|
|
409
|
+
field: field
|
|
410
|
+
})), /*#__PURE__*/React.createElement(StyledFormFieldBanner, null, field.meta.error && /*#__PURE__*/React.createElement(Box, {
|
|
411
|
+
marginRight: "xs"
|
|
412
|
+
}, /*#__PURE__*/React.createElement(StyledFormFieldErrorIcon, {
|
|
413
|
+
size: "sm"
|
|
414
|
+
})), field.meta.error && field.messages.error && /*#__PURE__*/React.createElement("span", {
|
|
415
|
+
id: fieldErrorId
|
|
416
|
+
}, field.messages.error))));
|
|
299
417
|
}
|
|
300
|
-
export function TraditionalField(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
418
|
+
export function TraditionalField(_ref6) {
|
|
419
|
+
var AsComponent = _ref6.as,
|
|
420
|
+
children = _ref6.children,
|
|
421
|
+
_ref6$colWidth = _ref6.colWidth,
|
|
422
|
+
colWidth = _ref6$colWidth === void 0 ? 6 : _ref6$colWidth,
|
|
423
|
+
disabled = _ref6.disabled,
|
|
424
|
+
error = _ref6.error,
|
|
425
|
+
label = _ref6.label,
|
|
426
|
+
name = _ref6.name,
|
|
427
|
+
required = _ref6.required,
|
|
428
|
+
tooltip = _ref6.tooltip,
|
|
429
|
+
validate = _ref6.validate,
|
|
430
|
+
view = _ref6.view,
|
|
431
|
+
props = _objectWithoutProperties(_ref6, _excluded4);
|
|
432
|
+
var field = useField({
|
|
433
|
+
disabled: disabled,
|
|
434
|
+
error: error,
|
|
435
|
+
getId: props.getId,
|
|
436
|
+
name: name,
|
|
437
|
+
required: required,
|
|
438
|
+
validate: validate,
|
|
439
|
+
view: view
|
|
440
|
+
});
|
|
441
|
+
var ValueComponent = getValueComponent(field.meta.view, AsComponent);
|
|
442
|
+
var labelId = useId();
|
|
443
|
+
var i18n = useI18nContext();
|
|
444
|
+
var valueComponentAriaProps = {
|
|
445
|
+
'aria-invalid': field.meta.error ? true : undefined,
|
|
446
|
+
'aria-labelledby': label ? labelId : undefined
|
|
447
|
+
};
|
|
448
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledTraditionalFormColumn, null, label && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledTraditionalFormLabel, {
|
|
449
|
+
$view: field.meta.view
|
|
450
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
451
|
+
id: labelId,
|
|
452
|
+
htmlFor: name
|
|
453
|
+
}, label, ":")), (field.meta.view === 'create' || field.meta.view === 'update') && field.meta.required && /*#__PURE__*/React.createElement(StyledFormFieldRequiredMark, null), tooltip && /*#__PURE__*/React.createElement(Tooltip, {
|
|
454
|
+
role: "tooltip",
|
|
455
|
+
overlay: tooltip,
|
|
456
|
+
placement: "right",
|
|
457
|
+
trigger: ['hover', 'focus']
|
|
458
|
+
}, /*#__PURE__*/React.createElement(StyledFormFieldTooltipIcon, {
|
|
459
|
+
"aria-label": i18n.t('core.form.field.tooltipHelp'),
|
|
460
|
+
"aria-hidden": false,
|
|
461
|
+
size: "sm",
|
|
462
|
+
tabIndex: 0
|
|
463
|
+
})))), /*#__PURE__*/React.createElement(StyledTraditionalFormColumn, {
|
|
464
|
+
$fullWidth: colWidth === 12,
|
|
465
|
+
$output: field.meta.view === 'read'
|
|
466
|
+
}, children ? isFunction(children) ? children(field) : children : /*#__PURE__*/React.createElement(ValueComponent, _extends({}, valueComponentAriaProps, props, {
|
|
467
|
+
field: field
|
|
468
|
+
}))));
|
|
329
469
|
}
|
|
330
|
-
export function Row(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
470
|
+
export function Row(_ref7) {
|
|
471
|
+
var children = _ref7.children,
|
|
472
|
+
props = _objectWithoutProperties(_ref7, _excluded5);
|
|
473
|
+
var _React$useContext3 = React.useContext(FormContext),
|
|
474
|
+
variant = _React$useContext3.variant,
|
|
475
|
+
view = _React$useContext3.view;
|
|
476
|
+
return /*#__PURE__*/React.createElement(StyledFormRow, _extends({
|
|
477
|
+
$traditional: variant === 'traditional',
|
|
478
|
+
$read: view === 'read'
|
|
479
|
+
}, props), children);
|
|
334
480
|
}
|
|
335
481
|
export function BaseField(props) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
482
|
+
var _React$useContext4 = React.useContext(FormContext),
|
|
483
|
+
variant = _React$useContext4.variant;
|
|
484
|
+
if (variant === 'traditional') {
|
|
485
|
+
return /*#__PURE__*/React.createElement(TraditionalField, props);
|
|
486
|
+
} else {
|
|
487
|
+
return /*#__PURE__*/React.createElement(WXPField, props);
|
|
488
|
+
}
|
|
343
489
|
}
|
|
490
|
+
|
|
344
491
|
// MAKE
|
|
492
|
+
|
|
345
493
|
function makeSharedField(viewAs) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
494
|
+
return function Field(_ref8) {
|
|
495
|
+
var children = _ref8.children,
|
|
496
|
+
props = _objectWithoutProperties(_ref8, _excluded6);
|
|
497
|
+
if (children) {
|
|
498
|
+
return /*#__PURE__*/React.createElement(SharedPropsContext.Provider, {
|
|
499
|
+
value: props
|
|
500
|
+
}, children);
|
|
501
|
+
}
|
|
502
|
+
return /*#__PURE__*/React.createElement(BaseField, _extends({
|
|
503
|
+
as: viewAs
|
|
504
|
+
}, props), children);
|
|
505
|
+
};
|
|
353
506
|
}
|
|
354
507
|
function makeViewField(viewAs, when) {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
508
|
+
return function FieldView(props) {
|
|
509
|
+
var _React$useContext5 = React.useContext(FormContext),
|
|
510
|
+
view = _React$useContext5.view;
|
|
511
|
+
var commonProps = React.useContext(SharedPropsContext);
|
|
512
|
+
if (when === view) {
|
|
513
|
+
return /*#__PURE__*/React.createElement(BaseField, _extends({
|
|
514
|
+
as: viewAs
|
|
515
|
+
}, commonProps, props));
|
|
516
|
+
}
|
|
517
|
+
return null;
|
|
518
|
+
};
|
|
363
519
|
}
|
|
364
520
|
export function makeField(editComponent, showComponent, options) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
Update: Update,
|
|
387
|
-
}, Field);
|
|
521
|
+
var views = {
|
|
522
|
+
create: editComponent,
|
|
523
|
+
read: options && !options.emptyState ? showComponent : withDefaultEmptyState(showComponent),
|
|
524
|
+
update: editComponent
|
|
525
|
+
};
|
|
526
|
+
// @ts-ignore
|
|
527
|
+
var Field = makeSharedField(views);
|
|
528
|
+
var Create = makeViewField(
|
|
529
|
+
// @ts-ignore
|
|
530
|
+
views, 'create');
|
|
531
|
+
var Read = makeViewField(
|
|
532
|
+
// @ts-ignore
|
|
533
|
+
views, 'read');
|
|
534
|
+
var Update = makeViewField(
|
|
535
|
+
// @ts-ignore
|
|
536
|
+
views, 'update');
|
|
537
|
+
return addSubcomponents({
|
|
538
|
+
Create: Create,
|
|
539
|
+
Read: Read,
|
|
540
|
+
Update: Update
|
|
541
|
+
}, Field);
|
|
388
542
|
}
|
|
543
|
+
|
|
389
544
|
/// FIELD TYPES
|
|
545
|
+
|
|
390
546
|
// @ts-ignore
|
|
391
547
|
var defaultGetLabel = either(prop('label'), prop('name'));
|
|
392
548
|
var defaultGetId = prop('id');
|
|
393
549
|
var defaultGetGroup = prop('groupId');
|
|
550
|
+
|
|
394
551
|
// EMPTY STATE
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
552
|
+
|
|
553
|
+
var EmptyState = function EmptyState(props) {
|
|
554
|
+
return /*#__PURE__*/React.createElement(Typography, {
|
|
555
|
+
"aria-describedby": props['aria-describedby'],
|
|
556
|
+
"aria-labelledby": props['aria-labelledby'],
|
|
557
|
+
intent: "body",
|
|
558
|
+
color: "gray45",
|
|
559
|
+
"data-qa": conditionalStrings(_defineProperty({}, "".concat(props['data-qa']), props['data-qa']), "core-form-field-empty")
|
|
560
|
+
}, "--");
|
|
400
561
|
};
|
|
401
562
|
export function withDefaultEmptyState(OutputComponent) {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
// @ts-ignore
|
|
408
|
-
return React.createElement(OutputComponent, __assign({ ref: ref }, props));
|
|
409
|
-
});
|
|
563
|
+
var WithDefaultEmptyState = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
564
|
+
if (isEmptyField(props.field.input.value)) {
|
|
565
|
+
return /*#__PURE__*/React.createElement(EmptyState, props);
|
|
566
|
+
}
|
|
567
|
+
// ComponentWithFieldProp's third type of generic function raises an issue with the component possibly being 'undefined'
|
|
410
568
|
// @ts-ignore
|
|
411
|
-
|
|
412
|
-
|
|
569
|
+
return /*#__PURE__*/React.createElement(OutputComponent, _extends({
|
|
570
|
+
ref: ref
|
|
571
|
+
}, props));
|
|
572
|
+
});
|
|
573
|
+
// @ts-ignore
|
|
574
|
+
WithDefaultEmptyState.displayName = "FieldWithEmptyState";
|
|
575
|
+
return WithDefaultEmptyState;
|
|
413
576
|
}
|
|
577
|
+
|
|
414
578
|
// TEXT
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
579
|
+
|
|
580
|
+
export var TextInput = /*#__PURE__*/React.forwardRef(function TextInput(_ref9, ref) {
|
|
581
|
+
var _onBlur = _ref9.onBlur,
|
|
582
|
+
_onChange = _ref9.onChange,
|
|
583
|
+
field = _ref9.field,
|
|
584
|
+
props = _objectWithoutProperties(_ref9, _excluded7);
|
|
585
|
+
var onBlur = function onBlur(e) {
|
|
586
|
+
field.input.onBlur(e);
|
|
587
|
+
_onBlur && _onBlur(e);
|
|
588
|
+
};
|
|
589
|
+
var onChange = function onChange(e) {
|
|
590
|
+
field.input.onChange(e);
|
|
591
|
+
_onChange && _onChange(e);
|
|
592
|
+
};
|
|
593
|
+
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
594
|
+
"aria-required": field.meta.required,
|
|
595
|
+
disabled: field.meta.disabled,
|
|
596
|
+
error: field.meta.error,
|
|
597
|
+
name: field.input.name,
|
|
598
|
+
onBlur: onBlur,
|
|
599
|
+
onChange: onChange,
|
|
600
|
+
ref: ref,
|
|
601
|
+
value: field.input.value || ''
|
|
602
|
+
}, props));
|
|
426
603
|
});
|
|
427
|
-
export var TextOutput = React.forwardRef(function TextOutput(
|
|
428
|
-
|
|
429
|
-
|
|
604
|
+
export var TextOutput = /*#__PURE__*/React.forwardRef(function TextOutput(_ref10, ref) {
|
|
605
|
+
var field = _ref10.field,
|
|
606
|
+
props = _objectWithoutProperties(_ref10, _excluded8);
|
|
607
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
608
|
+
ref: ref
|
|
609
|
+
}, props), field.input.value);
|
|
430
610
|
});
|
|
431
611
|
var FieldText = makeField(TextInput, TextOutput);
|
|
612
|
+
|
|
432
613
|
// NUMBER
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
614
|
+
|
|
615
|
+
export var NumberInput = /*#__PURE__*/React.forwardRef(function NumberInput(_ref11, ref) {
|
|
616
|
+
var onBlur_ = _ref11.onBlur,
|
|
617
|
+
onChange_ = _ref11.onChange,
|
|
618
|
+
field = _ref11.field,
|
|
619
|
+
props = _objectWithoutProperties(_ref11, _excluded9);
|
|
620
|
+
var onBlur = function onBlur(e) {
|
|
621
|
+
field.input.onBlur(e);
|
|
622
|
+
onBlur_ === null || onBlur_ === void 0 ? void 0 : onBlur_(e);
|
|
623
|
+
};
|
|
624
|
+
var onChange = React.useCallback(function (valueChange) {
|
|
625
|
+
// field.helpers.setValue always updates. Using field.input.onChange instead.
|
|
626
|
+
// setValue causes infinite loop with NumberInput changing locale logic
|
|
627
|
+
// helpers difference reference each update https://github.com/formium/formik/issues/2268
|
|
628
|
+
field.input.onChange({
|
|
629
|
+
target: {
|
|
630
|
+
name: field.input.name,
|
|
631
|
+
value: valueChange.parsedNumber
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
onChange_ === null || onChange_ === void 0 ? void 0 : onChange_(valueChange);
|
|
635
|
+
}, [onChange_, field.input.onChange]);
|
|
636
|
+
return /*#__PURE__*/React.createElement(BaseNumberInput, _extends({
|
|
637
|
+
"aria-required": field.meta.required,
|
|
638
|
+
disabled: field.meta.disabled,
|
|
639
|
+
error: field.meta.error,
|
|
640
|
+
name: field.input.name,
|
|
641
|
+
onBlur: onBlur,
|
|
642
|
+
onChange: onChange,
|
|
643
|
+
ref: ref,
|
|
644
|
+
value: field.input.value
|
|
645
|
+
}, props));
|
|
452
646
|
});
|
|
453
|
-
export var NumberOutput = React.forwardRef(function NumberOutput(
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
647
|
+
export var NumberOutput = /*#__PURE__*/React.forwardRef(function NumberOutput(_ref12, ref) {
|
|
648
|
+
var decimalScale = _ref12.decimalScale,
|
|
649
|
+
defaultValue = _ref12.defaultValue,
|
|
650
|
+
field = _ref12.field,
|
|
651
|
+
fillDecimalScale = _ref12.fillDecimalScale,
|
|
652
|
+
_locale = _ref12.locale,
|
|
653
|
+
onChange = _ref12.onChange,
|
|
654
|
+
prefix = _ref12.prefix,
|
|
655
|
+
suffix = _ref12.suffix,
|
|
656
|
+
props = _objectWithoutProperties(_ref12, _excluded10);
|
|
657
|
+
var I18n = useI18nContext();
|
|
658
|
+
var locale = _locale || I18n.locale || defaultLocale;
|
|
659
|
+
var _useNumberFormat = useNumberFormat({
|
|
660
|
+
decimalScale: decimalScale,
|
|
661
|
+
fillDecimalScale: fillDecimalScale === 'always' || fillDecimalScale === 'onBlur' ? 'always' : 'none',
|
|
662
|
+
locale: locale
|
|
663
|
+
}),
|
|
664
|
+
formatValue = _useNumberFormat.formatValue;
|
|
665
|
+
var value = formatValue(field.input.value);
|
|
666
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
667
|
+
ref: ref
|
|
668
|
+
}, props), value && prefix ? prefix : null, " ", value, ' ', value && suffix ? suffix : null);
|
|
471
669
|
});
|
|
472
670
|
var FieldNumber = makeField(NumberInput, NumberOutput);
|
|
671
|
+
|
|
473
672
|
// CURRENCY
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
673
|
+
|
|
674
|
+
export var CurrencyInput = /*#__PURE__*/React.forwardRef(function CurrencyInput(_ref13, ref) {
|
|
675
|
+
var onBlur_ = _ref13.onBlur,
|
|
676
|
+
onChange_ = _ref13.onChange,
|
|
677
|
+
field = _ref13.field,
|
|
678
|
+
props = _objectWithoutProperties(_ref13, _excluded11);
|
|
679
|
+
var onBlur = function onBlur(e) {
|
|
680
|
+
field.input.onBlur(e);
|
|
681
|
+
onBlur_ === null || onBlur_ === void 0 ? void 0 : onBlur_(e);
|
|
682
|
+
};
|
|
683
|
+
var onChange = React.useCallback(function (valueChange) {
|
|
684
|
+
// field.helpers.setValue always updates. Using field.input.onChange instead.
|
|
685
|
+
// setValue causes infinite loop with NumberInput changing locale logic
|
|
686
|
+
field.input.onChange({
|
|
687
|
+
target: {
|
|
688
|
+
name: field.input.name,
|
|
689
|
+
value: valueChange.parsedNumber
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
onChange_ === null || onChange_ === void 0 ? void 0 : onChange_(valueChange);
|
|
693
|
+
}, [onChange_, field.input.onChange]);
|
|
694
|
+
return /*#__PURE__*/React.createElement(BaseCurrencyInput, _extends({
|
|
695
|
+
"aria-required": field.meta.required,
|
|
696
|
+
disabled: field.meta.disabled,
|
|
697
|
+
error: field.meta.error,
|
|
698
|
+
name: field.input.name,
|
|
699
|
+
onBlur: onBlur,
|
|
700
|
+
onChange: onChange,
|
|
701
|
+
ref: ref,
|
|
702
|
+
value: field.input.value
|
|
703
|
+
}, props));
|
|
492
704
|
});
|
|
493
|
-
export var CurrencyOutput = React.forwardRef(function CurrencyOutput(
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
705
|
+
export var CurrencyOutput = /*#__PURE__*/React.forwardRef(function CurrencyOutput(_ref14, ref) {
|
|
706
|
+
var currencyIsoCode = _ref14.currencyIsoCode,
|
|
707
|
+
currencyDisplay = _ref14.currencyDisplay,
|
|
708
|
+
_ref14$decimalScale = _ref14.decimalScale,
|
|
709
|
+
decimalScale = _ref14$decimalScale === void 0 ? defaultCurrencyDecimalScale : _ref14$decimalScale,
|
|
710
|
+
suffix = _ref14.suffix,
|
|
711
|
+
_ref14$prefix = _ref14.prefix,
|
|
712
|
+
prefix = _ref14$prefix === void 0 ? defaultCurrencyInputPrefix : _ref14$prefix,
|
|
713
|
+
props = _objectWithoutProperties(_ref14, _excluded12);
|
|
714
|
+
var i18n = useI18nContext();
|
|
715
|
+
var locale = props.locale || i18n.locale || defaultLocale;
|
|
716
|
+
var numberProps = getCurrencyProps(locale, decimalScale, prefix || suffix, currencyIsoCode, currencyDisplay);
|
|
717
|
+
return /*#__PURE__*/React.createElement(NumberOutput, _extends({
|
|
718
|
+
fillDecimalScale: defaultCurrencyFillDecimalScale,
|
|
719
|
+
ref: ref
|
|
720
|
+
}, props, numberProps));
|
|
499
721
|
});
|
|
500
722
|
var FieldCurrency = makeField(CurrencyInput, CurrencyOutput);
|
|
723
|
+
|
|
501
724
|
// DATE
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
725
|
+
|
|
726
|
+
export var DateInput = /*#__PURE__*/React.forwardRef(function DateInput(_ref15, ref) {
|
|
727
|
+
var _onChange = _ref15.onChange,
|
|
728
|
+
field = _ref15.field,
|
|
729
|
+
props = _objectWithoutProperties(_ref15, _excluded13);
|
|
730
|
+
var value = field.input.value ? toDate(field.input.value, 'Form.DateSelect Create or Update Input') : undefined;
|
|
731
|
+
var onChange = function onChange(value) {
|
|
732
|
+
field.helpers.setValue(value);
|
|
733
|
+
field.helpers.setTouched(true);
|
|
734
|
+
_onChange && _onChange(value);
|
|
735
|
+
};
|
|
736
|
+
return /*#__PURE__*/React.createElement(DateSelect, _extends({
|
|
737
|
+
disabled: field.meta.disabled,
|
|
738
|
+
error: field.meta.error,
|
|
739
|
+
onChange: onChange,
|
|
740
|
+
ref: ref,
|
|
741
|
+
value: value
|
|
742
|
+
}, props));
|
|
513
743
|
});
|
|
514
|
-
export var DateOutput = React.forwardRef(function DateOutput(
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
744
|
+
export var DateOutput = /*#__PURE__*/React.forwardRef(function DateOutput(_ref16, ref) {
|
|
745
|
+
var onChange = _ref16.onChange,
|
|
746
|
+
field = _ref16.field,
|
|
747
|
+
props = _objectWithoutProperties(_ref16, _excluded14);
|
|
748
|
+
var dateTime = useDateTime();
|
|
749
|
+
var value = field.input.value ? dateTime.format(toDate(field.input.value, 'Form.DateSelect Read Output'), 'numeric-date') : undefined;
|
|
750
|
+
var machineValue = field.input.value ? formatMachineDate(dateTime.shiftUtcToZonedTime(toDate(field.input.value))) : undefined;
|
|
751
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
752
|
+
ref: ref
|
|
753
|
+
}, props), value && /*#__PURE__*/React.createElement("time", {
|
|
754
|
+
dateTime: machineValue
|
|
755
|
+
}, value));
|
|
524
756
|
});
|
|
525
757
|
var FieldDateSelect = makeField(DateInput, DateOutput);
|
|
758
|
+
|
|
526
759
|
// CHECKBOX
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
760
|
+
|
|
761
|
+
export var CheckboxInput = /*#__PURE__*/React.forwardRef(function CheckboxInput(_ref17, ref) {
|
|
762
|
+
var field = _ref17.field,
|
|
763
|
+
i18nScope = _ref17.i18nScope,
|
|
764
|
+
_onBlur = _ref17.onBlur,
|
|
765
|
+
_onChange = _ref17.onChange,
|
|
766
|
+
props = _objectWithoutProperties(_ref17, _excluded15);
|
|
767
|
+
var value = field.input.value || false;
|
|
768
|
+
var onBlur = function onBlur(e) {
|
|
769
|
+
field.input.onBlur(e);
|
|
770
|
+
_onBlur && _onBlur(e);
|
|
771
|
+
};
|
|
772
|
+
var onChange = function onChange(e) {
|
|
773
|
+
field.helpers.setValue(!value);
|
|
774
|
+
_onChange && _onChange(e);
|
|
775
|
+
};
|
|
776
|
+
return /*#__PURE__*/React.createElement(StyledFormCheckboxInput, _extends({
|
|
777
|
+
"aria-required": field.meta.required,
|
|
778
|
+
checked: value,
|
|
779
|
+
disabled: field.meta.disabled,
|
|
780
|
+
error: field.meta.error,
|
|
781
|
+
onBlur: onBlur,
|
|
782
|
+
onChange: onChange,
|
|
783
|
+
name: field.input.name,
|
|
784
|
+
ref: ref,
|
|
785
|
+
value: String(value)
|
|
786
|
+
}, props));
|
|
787
|
+
});
|
|
788
|
+
export var CheckboxOutput = /*#__PURE__*/React.forwardRef(function CheckboxOutput(_ref18, ref) {
|
|
789
|
+
var field = _ref18.field,
|
|
790
|
+
_ref18$i18nScope = _ref18.i18nScope,
|
|
791
|
+
i18nScope = _ref18$i18nScope === void 0 ? 'core.form.checkbox' : _ref18$i18nScope,
|
|
792
|
+
props = _objectWithoutProperties(_ref18, _excluded16);
|
|
793
|
+
var i18n = useI18nContext();
|
|
794
|
+
var yes = i18n.t('yes', {
|
|
795
|
+
scope: i18nScope
|
|
796
|
+
});
|
|
797
|
+
var no = i18n.t('no', {
|
|
798
|
+
scope: i18nScope
|
|
799
|
+
});
|
|
800
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
801
|
+
ref: ref
|
|
802
|
+
}, props), field.input.value ? yes : no);
|
|
539
803
|
});
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
var i18n = useI18nContext();
|
|
543
|
-
var yes = i18n.t('yes', { scope: i18nScope });
|
|
544
|
-
var no = i18n.t('no', { scope: i18nScope });
|
|
545
|
-
return (React.createElement("span", __assign({ ref: ref }, props), field.input.value ? yes : no));
|
|
804
|
+
var FieldCheckbox = makeField(CheckboxInput, CheckboxOutput, {
|
|
805
|
+
emptyState: false
|
|
546
806
|
});
|
|
547
|
-
|
|
807
|
+
|
|
548
808
|
// TEXTAREA
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
809
|
+
|
|
810
|
+
export var TextAreaInput = /*#__PURE__*/React.forwardRef(function TextAreaInput(_ref19, ref) {
|
|
811
|
+
var field = _ref19.field,
|
|
812
|
+
_onBlur = _ref19.onBlur,
|
|
813
|
+
_onChange = _ref19.onChange,
|
|
814
|
+
props = _objectWithoutProperties(_ref19, _excluded17);
|
|
815
|
+
var onBlur = function onBlur(e) {
|
|
816
|
+
field.input.onBlur(e);
|
|
817
|
+
_onBlur && _onBlur(e);
|
|
818
|
+
};
|
|
819
|
+
var onChange = function onChange(e) {
|
|
820
|
+
field.input.onChange(e);
|
|
821
|
+
_onChange && _onChange(e);
|
|
822
|
+
};
|
|
823
|
+
return /*#__PURE__*/React.createElement(TextArea, _extends({
|
|
824
|
+
"aria-required": field.meta.required,
|
|
825
|
+
disabled: field.meta.disabled,
|
|
826
|
+
error: field.meta.error,
|
|
827
|
+
name: field.input.name,
|
|
828
|
+
onBlur: onBlur,
|
|
829
|
+
onChange: onChange,
|
|
830
|
+
ref: ref,
|
|
831
|
+
value: field.input.value
|
|
832
|
+
}, props));
|
|
560
833
|
});
|
|
561
|
-
export var TextAreaOutput = React.forwardRef(function TextAreaOutput(
|
|
562
|
-
|
|
563
|
-
|
|
834
|
+
export var TextAreaOutput = /*#__PURE__*/React.forwardRef(function TextAreaOutput(_ref20, ref) {
|
|
835
|
+
var field = _ref20.field,
|
|
836
|
+
props = _objectWithoutProperties(_ref20, _excluded18);
|
|
837
|
+
return /*#__PURE__*/React.createElement(StyledFormOutputTextArea, _extends({
|
|
838
|
+
ref: ref
|
|
839
|
+
}, props), field.input.value);
|
|
564
840
|
});
|
|
565
841
|
var FieldTextArea = makeField(TextAreaInput, TextAreaOutput);
|
|
842
|
+
|
|
566
843
|
// RICHTEXT
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
844
|
+
|
|
845
|
+
export var RichTextInput = /*#__PURE__*/React.forwardRef(function RichTextInput(_ref21, ref) {
|
|
846
|
+
var _onChange = _ref21.onChange,
|
|
847
|
+
field = _ref21.field,
|
|
848
|
+
props = _objectWithoutProperties(_ref21, _excluded19);
|
|
849
|
+
var onChange = function onChange(value, isDirty) {
|
|
850
|
+
field.helpers.setValue(value, false, isDirty);
|
|
851
|
+
if (isDirty) {
|
|
852
|
+
field.helpers.setTouched(true);
|
|
853
|
+
}
|
|
854
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(value, isDirty);
|
|
855
|
+
};
|
|
856
|
+
return /*#__PURE__*/React.createElement(TextEditor, _extends({
|
|
857
|
+
disabled: field.meta.disabled,
|
|
858
|
+
error: field.meta.error,
|
|
859
|
+
value: field.input.value,
|
|
860
|
+
onChange: onChange
|
|
861
|
+
}, props));
|
|
577
862
|
});
|
|
578
|
-
export var RichTextOutput = React.forwardRef(function RichTextOutput(
|
|
579
|
-
|
|
580
|
-
|
|
863
|
+
export var RichTextOutput = /*#__PURE__*/React.forwardRef(function RichTextOutput(_ref22, ref) {
|
|
864
|
+
var field = _ref22.field,
|
|
865
|
+
onBlur = _ref22.onBlur,
|
|
866
|
+
onChange = _ref22.onChange,
|
|
867
|
+
onClick = _ref22.onClick,
|
|
868
|
+
onContextMenu = _ref22.onContextMenu,
|
|
869
|
+
onCopy = _ref22.onCopy,
|
|
870
|
+
onCut = _ref22.onCut,
|
|
871
|
+
onDrag = _ref22.onDrag,
|
|
872
|
+
onDragDrop = _ref22.onDragDrop,
|
|
873
|
+
onDragEnd = _ref22.onDragEnd,
|
|
874
|
+
onDragGesture = _ref22.onDragGesture,
|
|
875
|
+
onDragOver = _ref22.onDragOver,
|
|
876
|
+
onDrop = _ref22.onDrop,
|
|
877
|
+
onFocus = _ref22.onFocus,
|
|
878
|
+
onKeyDown = _ref22.onKeyDown,
|
|
879
|
+
onKeyPress = _ref22.onKeyPress,
|
|
880
|
+
onMouseDown = _ref22.onMouseDown,
|
|
881
|
+
onMouseEnter = _ref22.onMouseEnter,
|
|
882
|
+
onMouseLeave = _ref22.onMouseLeave,
|
|
883
|
+
onMouseMove = _ref22.onMouseMove,
|
|
884
|
+
onMouseOut = _ref22.onMouseOut,
|
|
885
|
+
onMouseOver = _ref22.onMouseOver,
|
|
886
|
+
onMouseUp = _ref22.onMouseUp,
|
|
887
|
+
onPaste = _ref22.onPaste,
|
|
888
|
+
onReset = _ref22.onReset,
|
|
889
|
+
onSubmit = _ref22.onSubmit,
|
|
890
|
+
props = _objectWithoutProperties(_ref22, _excluded20);
|
|
891
|
+
return /*#__PURE__*/React.createElement(TextEditorOutput, _extends({
|
|
892
|
+
value: field.input.value,
|
|
893
|
+
ref: ref
|
|
894
|
+
}, props));
|
|
581
895
|
});
|
|
582
896
|
var FieldRichText = makeField(RichTextInput, RichTextOutput);
|
|
897
|
+
|
|
583
898
|
// RADIO BUTTONS
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
899
|
+
|
|
900
|
+
export var RadioButtonsInput = /*#__PURE__*/React.forwardRef(function RadioButtonsInput(_ref23, ref) {
|
|
901
|
+
var field = _ref23.field,
|
|
902
|
+
_ref23$getId = _ref23.getId,
|
|
903
|
+
getId = _ref23$getId === void 0 ? defaultGetId : _ref23$getId,
|
|
904
|
+
_ref23$getLabel = _ref23.getLabel,
|
|
905
|
+
getLabel = _ref23$getLabel === void 0 ? defaultGetLabel : _ref23$getLabel,
|
|
906
|
+
isDisabledOption = _ref23.isDisabledOption,
|
|
907
|
+
options = _ref23.options,
|
|
908
|
+
props = _objectWithoutProperties(_ref23, _excluded21);
|
|
909
|
+
if (!options || options.length === 0) return null;
|
|
910
|
+
var onSelect = function onSelect(option) {
|
|
911
|
+
return function () {
|
|
912
|
+
field.helpers.setValue(option);
|
|
913
|
+
};
|
|
914
|
+
};
|
|
915
|
+
return /*#__PURE__*/React.createElement(StyledFormOutputFiledset, _extends({
|
|
916
|
+
ref: ref,
|
|
917
|
+
disabled: field.meta.disabled
|
|
918
|
+
}, props), options.map(function (option) {
|
|
919
|
+
return /*#__PURE__*/React.createElement(RadioButton, {
|
|
920
|
+
checked: getId(option) === getId(field.input.value),
|
|
921
|
+
disabled: isDisabledOption && isDisabledOption(option),
|
|
922
|
+
error: field.meta.error,
|
|
923
|
+
key: getId(option),
|
|
924
|
+
name: field.input.name,
|
|
925
|
+
onChange: onSelect(option),
|
|
926
|
+
value: getId(option)
|
|
927
|
+
}, getLabel(option));
|
|
928
|
+
}));
|
|
594
929
|
});
|
|
595
|
-
export var RadioButtonsOutput = React.forwardRef(function RadioButtonsOutput(
|
|
596
|
-
|
|
597
|
-
|
|
930
|
+
export var RadioButtonsOutput = /*#__PURE__*/React.forwardRef(function RadioButtonsOutput(_ref24, ref) {
|
|
931
|
+
var field = _ref24.field,
|
|
932
|
+
getId = _ref24.getId,
|
|
933
|
+
_ref24$getLabel = _ref24.getLabel,
|
|
934
|
+
getLabel = _ref24$getLabel === void 0 ? defaultGetLabel : _ref24$getLabel,
|
|
935
|
+
options = _ref24.options,
|
|
936
|
+
props = _objectWithoutProperties(_ref24, _excluded22);
|
|
937
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
938
|
+
ref: ref
|
|
939
|
+
}, props), getLabel(field.input.value));
|
|
598
940
|
});
|
|
599
941
|
var FieldRadioButtons = makeField(RadioButtonsInput, RadioButtonsOutput);
|
|
942
|
+
|
|
600
943
|
// CHECKBOXES
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
944
|
+
|
|
945
|
+
export var CheckboxesInput = /*#__PURE__*/React.forwardRef(function CheckboxesInput(_ref25, ref) {
|
|
946
|
+
var field = _ref25.field,
|
|
947
|
+
_ref25$getId = _ref25.getId,
|
|
948
|
+
getId = _ref25$getId === void 0 ? defaultGetId : _ref25$getId,
|
|
949
|
+
_ref25$getLabel = _ref25.getLabel,
|
|
950
|
+
getLabel = _ref25$getLabel === void 0 ? defaultGetLabel : _ref25$getLabel,
|
|
951
|
+
isDisabledOption = _ref25.isDisabledOption,
|
|
952
|
+
isIndeterminateOption = _ref25.isIndeterminateOption,
|
|
953
|
+
options = _ref25.options,
|
|
954
|
+
props = _objectWithoutProperties(_ref25, _excluded23);
|
|
955
|
+
if (!options || options.length === 0) return null;
|
|
956
|
+
var selectedIds = (field.input.value || emptyArray).map(getId);
|
|
957
|
+
var onSelect = function onSelect(changedOption) {
|
|
958
|
+
return function () {
|
|
959
|
+
if (selectedIds.includes(getId(changedOption))) {
|
|
960
|
+
field.helpers.setValue(field.input.value.filter(function (entry) {
|
|
961
|
+
return getId(entry) !== getId(changedOption);
|
|
962
|
+
}));
|
|
963
|
+
} else {
|
|
964
|
+
field.helpers.setValue((field.input.value || emptyArray).concat(changedOption));
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
};
|
|
968
|
+
return /*#__PURE__*/React.createElement(StyledFormOutputFiledset, _extends({
|
|
969
|
+
ref: ref,
|
|
970
|
+
disabled: field.meta.disabled
|
|
971
|
+
}, props), options.map(function (option) {
|
|
972
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
973
|
+
checked: selectedIds.includes(getId(option)),
|
|
974
|
+
disabled: isDisabledOption && isDisabledOption(option),
|
|
975
|
+
error: field.meta.error,
|
|
976
|
+
indeterminate: isIndeterminateOption && isIndeterminateOption(option),
|
|
977
|
+
key: getId(option),
|
|
978
|
+
name: field.input.name,
|
|
979
|
+
onChange: onSelect(option),
|
|
980
|
+
value: getId(option)
|
|
981
|
+
}, getLabel(option));
|
|
982
|
+
}));
|
|
617
983
|
});
|
|
618
|
-
export var CheckboxesOutput = React.forwardRef(function CheckboxesOutput(
|
|
619
|
-
|
|
620
|
-
|
|
984
|
+
export var CheckboxesOutput = /*#__PURE__*/React.forwardRef(function CheckboxesOutput(_ref26, ref) {
|
|
985
|
+
var field = _ref26.field,
|
|
986
|
+
getId = _ref26.getId,
|
|
987
|
+
_ref26$getLabel = _ref26.getLabel,
|
|
988
|
+
getLabel = _ref26$getLabel === void 0 ? defaultGetLabel : _ref26$getLabel,
|
|
989
|
+
isDisabledOption = _ref26.isDisabledOption,
|
|
990
|
+
isIndeterminateOption = _ref26.isIndeterminateOption,
|
|
991
|
+
options = _ref26.options,
|
|
992
|
+
props = _objectWithoutProperties(_ref26, _excluded24);
|
|
993
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
994
|
+
ref: ref
|
|
995
|
+
}, props), field.input.value && field.input.value.map(getLabel).join(', '));
|
|
621
996
|
});
|
|
622
997
|
var FieldCheckboxes = makeField(CheckboxesInput, CheckboxesOutput);
|
|
998
|
+
|
|
623
999
|
// SELECT
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
1000
|
+
|
|
1001
|
+
var lowerStartsWith = function lowerStartsWith(query) {
|
|
1002
|
+
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1003
|
+
return startsWith(toLower(query), toLower(value));
|
|
627
1004
|
};
|
|
628
|
-
export function useOptions(
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
1005
|
+
export function useOptions(_ref27) {
|
|
1006
|
+
var value = _ref27.value,
|
|
1007
|
+
optgroups = _ref27.optgroups,
|
|
1008
|
+
_ref27$options = _ref27.options,
|
|
1009
|
+
options = _ref27$options === void 0 ? emptyArray : _ref27$options,
|
|
1010
|
+
getLabel = _ref27.getLabel,
|
|
1011
|
+
getId = _ref27.getId,
|
|
1012
|
+
groupGetId = _ref27.groupGetId,
|
|
1013
|
+
_ref27$getGroup = _ref27.getGroup,
|
|
1014
|
+
getGroup = _ref27$getGroup === void 0 ? defaultGetGroup : _ref27$getGroup,
|
|
1015
|
+
_ref27$comparator = _ref27.comparator,
|
|
1016
|
+
comparator = _ref27$comparator === void 0 ? lowerStartsWith : _ref27$comparator;
|
|
1017
|
+
var _React$useState3 = React.useState(''),
|
|
1018
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
1019
|
+
query = _React$useState4[0],
|
|
1020
|
+
setQuery = _React$useState4[1];
|
|
1021
|
+
var search = function search(e) {
|
|
1022
|
+
return setQuery(e.target.value);
|
|
1023
|
+
};
|
|
1024
|
+
var filteredOptions = React.useMemo(function () {
|
|
1025
|
+
if (!query) {
|
|
1026
|
+
return options;
|
|
1027
|
+
}
|
|
1028
|
+
return options.filter(function (option) {
|
|
1029
|
+
return comparator(query, getLabel(option));
|
|
1030
|
+
});
|
|
1031
|
+
}, [comparator, query, options, getLabel]);
|
|
1032
|
+
var groupedOptions = React.useMemo(function () {
|
|
1033
|
+
if (!optgroups || !optgroups.length) {
|
|
1034
|
+
return filteredOptions;
|
|
1035
|
+
}
|
|
1036
|
+
var optionsByGroup = optgroups.reduce(function (acc, group) {
|
|
1037
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, groupGetId(group), []));
|
|
1038
|
+
}, {});
|
|
1039
|
+
var orphanOptions = [];
|
|
1040
|
+
filteredOptions.forEach(function (option) {
|
|
1041
|
+
var groupId = getGroup(option);
|
|
1042
|
+
var groupOptions = optionsByGroup[groupId];
|
|
1043
|
+
if (!groupId || !groupOptions) {
|
|
1044
|
+
orphanOptions.push(option);
|
|
1045
|
+
return;
|
|
1046
|
+
}
|
|
1047
|
+
optionsByGroup[groupId].push(option);
|
|
1048
|
+
});
|
|
1049
|
+
if (orphanOptions.length) {
|
|
1050
|
+
console.warn("Could not find option groups for the options below. Make sure that every option has a proper \"groupId\" field or if \"getGroup\" is implemented correctly.", orphanOptions);
|
|
1051
|
+
}
|
|
1052
|
+
return optgroups.flatMap(function (group) {
|
|
1053
|
+
var groupHeader = _objectSpread(_objectSpread({}, group), {}, {
|
|
1054
|
+
isGroupHeader: true
|
|
1055
|
+
});
|
|
1056
|
+
var groupOptions = optionsByGroup[groupGetId(group)];
|
|
1057
|
+
if (!groupOptions.length) {
|
|
1058
|
+
return [];
|
|
1059
|
+
}
|
|
1060
|
+
return [groupHeader].concat(_toConsumableArray(groupOptions));
|
|
1061
|
+
}, []);
|
|
1062
|
+
}, [filteredOptions, getGroup, groupGetId, optgroups]);
|
|
1063
|
+
var selected = options.find(function (option) {
|
|
1064
|
+
return value && getId(option) === getId(value);
|
|
1065
|
+
}) || value;
|
|
1066
|
+
return {
|
|
1067
|
+
list: groupedOptions,
|
|
1068
|
+
selected: selected,
|
|
1069
|
+
search: search
|
|
1070
|
+
};
|
|
672
1071
|
}
|
|
673
|
-
function defaultOptionRenderer(item,
|
|
674
|
-
|
|
675
|
-
|
|
1072
|
+
function defaultOptionRenderer(item, _ref28) {
|
|
1073
|
+
var getId = _ref28.getId,
|
|
1074
|
+
getLabel = _ref28.getLabel,
|
|
1075
|
+
props = _objectWithoutProperties(_ref28, _excluded25);
|
|
1076
|
+
return /*#__PURE__*/React.createElement(Select.Option, props, getLabel(item));
|
|
676
1077
|
}
|
|
677
|
-
function defaultGroupHeaderRenderer(group,
|
|
678
|
-
|
|
679
|
-
|
|
1078
|
+
function defaultGroupHeaderRenderer(group, _ref29) {
|
|
1079
|
+
var getId = _ref29.getId,
|
|
1080
|
+
getLabel = _ref29.getLabel,
|
|
1081
|
+
props = _objectWithoutProperties(_ref29, _excluded26);
|
|
1082
|
+
return /*#__PURE__*/React.createElement(Select.OptGroup, props, getLabel(group));
|
|
680
1083
|
}
|
|
681
|
-
export var SelectInput = React.forwardRef(function SelectInput(
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
1084
|
+
export var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(_ref30, ref) {
|
|
1085
|
+
var _afterHide = _ref30.afterHide,
|
|
1086
|
+
field = _ref30.field,
|
|
1087
|
+
_ref30$getGroup = _ref30.getGroup,
|
|
1088
|
+
getGroup = _ref30$getGroup === void 0 ? defaultGetGroup : _ref30$getGroup,
|
|
1089
|
+
_ref30$getId = _ref30.getId,
|
|
1090
|
+
getId = _ref30$getId === void 0 ? defaultGetId : _ref30$getId,
|
|
1091
|
+
_ref30$getLabel = _ref30.getLabel,
|
|
1092
|
+
getLabel = _ref30$getLabel === void 0 ? defaultGetLabel : _ref30$getLabel,
|
|
1093
|
+
_ref30$groupGetId = _ref30.groupGetId,
|
|
1094
|
+
groupGetId = _ref30$groupGetId === void 0 ? defaultGetId : _ref30$groupGetId,
|
|
1095
|
+
_ref30$groupGetLabel = _ref30.groupGetLabel,
|
|
1096
|
+
groupGetLabel = _ref30$groupGetLabel === void 0 ? defaultGetLabel : _ref30$groupGetLabel,
|
|
1097
|
+
_ref30$groupHeaderRen = _ref30.groupHeaderRenderer,
|
|
1098
|
+
groupHeaderRenderer = _ref30$groupHeaderRen === void 0 ? defaultGroupHeaderRenderer : _ref30$groupHeaderRen,
|
|
1099
|
+
isSuggestedOption = _ref30.isSuggestedOption,
|
|
1100
|
+
_onClear = _ref30.onClear,
|
|
1101
|
+
_onSearch = _ref30.onSearch,
|
|
1102
|
+
_onSelect = _ref30.onSelect,
|
|
1103
|
+
searchComparator = _ref30.searchComparator,
|
|
1104
|
+
options = _ref30.options,
|
|
1105
|
+
optgroups = _ref30.optgroups,
|
|
1106
|
+
_ref30$optionRenderer = _ref30.optionRenderer,
|
|
1107
|
+
optionRenderer = _ref30$optionRenderer === void 0 ? defaultOptionRenderer : _ref30$optionRenderer,
|
|
1108
|
+
props = _objectWithoutProperties(_ref30, _excluded27);
|
|
1109
|
+
var menu = useOptions({
|
|
1110
|
+
options: options,
|
|
1111
|
+
optgroups: optgroups,
|
|
1112
|
+
getGroup: getGroup,
|
|
1113
|
+
getId: getId,
|
|
1114
|
+
getLabel: getLabel,
|
|
1115
|
+
groupGetId: groupGetId,
|
|
1116
|
+
value: field.input.value,
|
|
1117
|
+
comparator: searchComparator
|
|
1118
|
+
});
|
|
1119
|
+
var label = menu.selected ? getLabel(menu.selected) : undefined;
|
|
1120
|
+
var afterHide = function afterHide() {
|
|
1121
|
+
field.helpers.setTouched(true);
|
|
1122
|
+
_afterHide && _afterHide();
|
|
1123
|
+
};
|
|
1124
|
+
var onSelect = function onSelect(selection) {
|
|
1125
|
+
field.helpers.setValue(selection.item);
|
|
1126
|
+
_onSelect && _onSelect(selection);
|
|
1127
|
+
};
|
|
1128
|
+
var onClear = function onClear(e) {
|
|
1129
|
+
field.helpers.setValue(null);
|
|
1130
|
+
if (typeof _onClear === 'function') {
|
|
1131
|
+
_onClear(e);
|
|
1132
|
+
}
|
|
1133
|
+
};
|
|
1134
|
+
var onSearch = function onSearch(e) {
|
|
1135
|
+
menu.search(e);
|
|
1136
|
+
if (typeof _onSearch === 'function') {
|
|
1137
|
+
_onSearch(e);
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
1141
|
+
afterHide: afterHide,
|
|
1142
|
+
block: true,
|
|
1143
|
+
disabled: field.meta.disabled,
|
|
1144
|
+
error: field.meta.error,
|
|
1145
|
+
label: label,
|
|
1146
|
+
onClear: _onClear || _onClear === undefined ? onClear : undefined,
|
|
1147
|
+
onSearch: _onSearch || _onSearch === undefined || searchComparator ? onSearch : undefined,
|
|
1148
|
+
onSelect: onSelect,
|
|
1149
|
+
ref: ref
|
|
1150
|
+
}, props), menu.list.map(function (option) {
|
|
1151
|
+
if (option.isGroupHeader) {
|
|
1152
|
+
return groupHeaderRenderer(option, {
|
|
1153
|
+
getId: groupGetId,
|
|
1154
|
+
getLabel: groupGetLabel,
|
|
1155
|
+
// @ts-ignore
|
|
1156
|
+
// This property is React specific, not a prop on the component renderer
|
|
1157
|
+
key: "group_".concat(groupGetId(option))
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
return optionRenderer(option, {
|
|
1161
|
+
getId: getId,
|
|
1162
|
+
getLabel: getLabel,
|
|
1163
|
+
// @ts-ignore
|
|
1164
|
+
// This property is React specific, not a prop on the component renderer
|
|
1165
|
+
// Object literal may only specify known properties, and 'key' does not exist in type 'OptionProps'.
|
|
1166
|
+
key: getId(option),
|
|
1167
|
+
selected: getId(menu.selected) === getId(option),
|
|
1168
|
+
suggested: isSuggestedOption && isSuggestedOption(option),
|
|
1169
|
+
value: option
|
|
692
1170
|
});
|
|
693
|
-
|
|
694
|
-
var afterHide = function () {
|
|
695
|
-
field.helpers.setTouched(true);
|
|
696
|
-
_afterHide && _afterHide();
|
|
697
|
-
};
|
|
698
|
-
var onSelect = function (selection) {
|
|
699
|
-
field.helpers.setValue(selection.item);
|
|
700
|
-
_onSelect && _onSelect(selection);
|
|
701
|
-
};
|
|
702
|
-
var onClear = function (e) {
|
|
703
|
-
field.helpers.setValue(null);
|
|
704
|
-
if (typeof _onClear === 'function') {
|
|
705
|
-
_onClear(e);
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
var onSearch = function (e) {
|
|
709
|
-
menu.search(e);
|
|
710
|
-
if (typeof _onSearch === 'function') {
|
|
711
|
-
_onSearch(e);
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
return (React.createElement(Select, __assign({ afterHide: afterHide, block: true, disabled: field.meta.disabled, error: field.meta.error, label: label, onClear: _onClear || _onClear === undefined ? onClear : undefined, onSearch: _onSearch || _onSearch === undefined || searchComparator
|
|
715
|
-
? onSearch
|
|
716
|
-
: undefined, onSelect: onSelect, ref: ref }, props), menu.list.map(function (option) {
|
|
717
|
-
if (option.isGroupHeader) {
|
|
718
|
-
return groupHeaderRenderer(option, {
|
|
719
|
-
getId: groupGetId,
|
|
720
|
-
getLabel: groupGetLabel,
|
|
721
|
-
// @ts-ignore
|
|
722
|
-
// This property is React specific, not a prop on the component renderer
|
|
723
|
-
key: "group_".concat(groupGetId(option)),
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
return optionRenderer(option, {
|
|
727
|
-
getId: getId,
|
|
728
|
-
getLabel: getLabel,
|
|
729
|
-
// @ts-ignore
|
|
730
|
-
// This property is React specific, not a prop on the component renderer
|
|
731
|
-
// Object literal may only specify known properties, and 'key' does not exist in type 'OptionProps'.
|
|
732
|
-
key: getId(option),
|
|
733
|
-
selected: getId(menu.selected) === getId(option),
|
|
734
|
-
suggested: isSuggestedOption && isSuggestedOption(option),
|
|
735
|
-
value: option,
|
|
736
|
-
});
|
|
737
|
-
})));
|
|
1171
|
+
}));
|
|
738
1172
|
});
|
|
739
|
-
export var SelectOutput = React.forwardRef(function SelectOutput(
|
|
740
|
-
|
|
741
|
-
|
|
1173
|
+
export var SelectOutput = /*#__PURE__*/React.forwardRef(function SelectOutput(_ref31, ref) {
|
|
1174
|
+
var afterHide = _ref31.afterHide,
|
|
1175
|
+
afterShow = _ref31.afterShow,
|
|
1176
|
+
beforeHide = _ref31.beforeHide,
|
|
1177
|
+
beforeShow = _ref31.beforeShow,
|
|
1178
|
+
field = _ref31.field,
|
|
1179
|
+
footer = _ref31.footer,
|
|
1180
|
+
getId = _ref31.getId,
|
|
1181
|
+
getGroup = _ref31.getGroup,
|
|
1182
|
+
_ref31$getLabel = _ref31.getLabel,
|
|
1183
|
+
getLabel = _ref31$getLabel === void 0 ? defaultGetLabel : _ref31$getLabel,
|
|
1184
|
+
groupGetId = _ref31.groupGetId,
|
|
1185
|
+
groupGetLabel = _ref31.groupGetLabel,
|
|
1186
|
+
groupHeaderRenderer = _ref31.groupHeaderRenderer,
|
|
1187
|
+
i18nScope = _ref31.i18nScope,
|
|
1188
|
+
isSuggestedOption = _ref31.isSuggestedOption,
|
|
1189
|
+
options = _ref31.options,
|
|
1190
|
+
optgroups = _ref31.optgroups,
|
|
1191
|
+
optionRenderer = _ref31.optionRenderer,
|
|
1192
|
+
searchComparator = _ref31.searchComparator,
|
|
1193
|
+
onBlur = _ref31.onBlur,
|
|
1194
|
+
onClear = _ref31.onClear,
|
|
1195
|
+
onSearch = _ref31.onSearch,
|
|
1196
|
+
onSelect = _ref31.onSelect,
|
|
1197
|
+
props = _objectWithoutProperties(_ref31, _excluded28);
|
|
1198
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
1199
|
+
ref: ref
|
|
1200
|
+
}, props), getLabel(field.input.value));
|
|
742
1201
|
});
|
|
743
1202
|
var FieldSelect = makeField(SelectInput, SelectOutput);
|
|
1203
|
+
|
|
744
1204
|
// PILL SELECT
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
1205
|
+
|
|
1206
|
+
export var PillSelectInput = /*#__PURE__*/React.forwardRef(function PillSelectInput(_ref32, ref) {
|
|
1207
|
+
var field = _ref32.field,
|
|
1208
|
+
_onBlur = _ref32.onBlur,
|
|
1209
|
+
_onClear = _ref32.onClear,
|
|
1210
|
+
_onSelect = _ref32.onSelect,
|
|
1211
|
+
_ref32$getId = _ref32.getId,
|
|
1212
|
+
getId = _ref32$getId === void 0 ? defaultGetId : _ref32$getId,
|
|
1213
|
+
_ref32$getLabel = _ref32.getLabel,
|
|
1214
|
+
getLabel = _ref32$getLabel === void 0 ? defaultGetLabel : _ref32$getLabel,
|
|
1215
|
+
props = _objectWithoutProperties(_ref32, _excluded29);
|
|
1216
|
+
var onBlur = function onBlur(e) {
|
|
1217
|
+
field.helpers.setTouched(true);
|
|
1218
|
+
_onBlur && _onBlur(e);
|
|
1219
|
+
};
|
|
1220
|
+
var onClear = function onClear(e) {
|
|
1221
|
+
field.helpers.setValue(null);
|
|
1222
|
+
_onClear && _onClear(e);
|
|
1223
|
+
};
|
|
1224
|
+
var onSelect = function onSelect(selection) {
|
|
1225
|
+
field.helpers.setValue(selection.item);
|
|
1226
|
+
_onSelect && _onSelect(selection);
|
|
1227
|
+
};
|
|
1228
|
+
return /*#__PURE__*/React.createElement(PillSelect, _extends({
|
|
1229
|
+
block: true,
|
|
1230
|
+
disabled: field.meta.disabled,
|
|
1231
|
+
error: field.meta.error,
|
|
1232
|
+
getId: getId,
|
|
1233
|
+
getLabel: getLabel,
|
|
1234
|
+
onBlur: onBlur,
|
|
1235
|
+
onClear: _onClear || _onClear === undefined ? onClear : undefined,
|
|
1236
|
+
onSelect: onSelect,
|
|
1237
|
+
ref: ref,
|
|
1238
|
+
value: field.input.value
|
|
1239
|
+
}, props));
|
|
760
1240
|
});
|
|
761
|
-
export var PillSelectOutput = React.forwardRef(function PillSelectOutput(
|
|
762
|
-
|
|
763
|
-
|
|
1241
|
+
export var PillSelectOutput = /*#__PURE__*/React.forwardRef(function PillSelectOutput(_ref33, ref) {
|
|
1242
|
+
var afterHide = _ref33.afterHide,
|
|
1243
|
+
afterShow = _ref33.afterShow,
|
|
1244
|
+
beforeHide = _ref33.beforeHide,
|
|
1245
|
+
beforeShow = _ref33.beforeShow,
|
|
1246
|
+
color = _ref33.color,
|
|
1247
|
+
field = _ref33.field,
|
|
1248
|
+
footer = _ref33.footer,
|
|
1249
|
+
_ref33$getColor = _ref33.getColor,
|
|
1250
|
+
getColor = _ref33$getColor === void 0 ? defaultGetColor : _ref33$getColor,
|
|
1251
|
+
getGroup = _ref33.getGroup,
|
|
1252
|
+
_ref33$getLabel = _ref33.getLabel,
|
|
1253
|
+
getLabel = _ref33$getLabel === void 0 ? defaultGetLabel : _ref33$getLabel,
|
|
1254
|
+
getSuggested = _ref33.getSuggested,
|
|
1255
|
+
groupGetId = _ref33.groupGetId,
|
|
1256
|
+
groupGetLabel = _ref33.groupGetLabel,
|
|
1257
|
+
i18nScope = _ref33.i18nScope,
|
|
1258
|
+
onClear = _ref33.onClear,
|
|
1259
|
+
onSearch = _ref33.onSearch,
|
|
1260
|
+
onSelect = _ref33.onSelect,
|
|
1261
|
+
options = _ref33.options,
|
|
1262
|
+
optgroups = _ref33.optgroups,
|
|
1263
|
+
props = _objectWithoutProperties(_ref33, _excluded30);
|
|
1264
|
+
return /*#__PURE__*/React.createElement(Pill, _extends({
|
|
1265
|
+
color: getColor(field.input.value)
|
|
1266
|
+
}, props), getLabel(field.input.value));
|
|
764
1267
|
});
|
|
765
1268
|
var FieldPillSelect = makeField(PillSelectInput, PillSelectOutput);
|
|
1269
|
+
|
|
766
1270
|
// MULTISELECT
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
1271
|
+
|
|
1272
|
+
export var MultiSelectInput = /*#__PURE__*/React.forwardRef(function MultiSelectInput(_ref34, ref) {
|
|
1273
|
+
var field = _ref34.field,
|
|
1274
|
+
_onBlur = _ref34.onBlur,
|
|
1275
|
+
_onChange = _ref34.onChange,
|
|
1276
|
+
_ref34$getId = _ref34.getId,
|
|
1277
|
+
getId = _ref34$getId === void 0 ? defaultGetId : _ref34$getId,
|
|
1278
|
+
_ref34$getLabel = _ref34.getLabel,
|
|
1279
|
+
getLabel = _ref34$getLabel === void 0 ? defaultGetLabel : _ref34$getLabel,
|
|
1280
|
+
props = _objectWithoutProperties(_ref34, _excluded31);
|
|
1281
|
+
var onBlur = function onBlur(e) {
|
|
1282
|
+
field.helpers.setTouched(true);
|
|
1283
|
+
_onBlur && _onBlur(e);
|
|
1284
|
+
};
|
|
1285
|
+
var onChange = function onChange(value, e) {
|
|
1286
|
+
field.helpers.setValue(value);
|
|
1287
|
+
_onChange && _onChange(value, e);
|
|
1288
|
+
};
|
|
1289
|
+
return /*#__PURE__*/React.createElement(MultiSelect, _extends({
|
|
1290
|
+
block: true,
|
|
1291
|
+
disabled: field.meta.disabled,
|
|
1292
|
+
error: field.meta.error,
|
|
1293
|
+
getId: getId,
|
|
1294
|
+
getLabel: getLabel,
|
|
1295
|
+
onBlur: onBlur,
|
|
1296
|
+
onChange: onChange,
|
|
1297
|
+
ref: ref,
|
|
1298
|
+
value: field.input.value
|
|
1299
|
+
}, props));
|
|
778
1300
|
});
|
|
779
|
-
export var MultiSelectOutput = React.forwardRef(function MultiSelectOutput(
|
|
780
|
-
|
|
781
|
-
|
|
1301
|
+
export var MultiSelectOutput = /*#__PURE__*/React.forwardRef(function MultiSelectOutput(_ref35, ref) {
|
|
1302
|
+
var afterHide = _ref35.afterHide,
|
|
1303
|
+
afterShow = _ref35.afterShow,
|
|
1304
|
+
beforeHide = _ref35.beforeHide,
|
|
1305
|
+
beforeShow = _ref35.beforeShow,
|
|
1306
|
+
emptyMessage = _ref35.emptyMessage,
|
|
1307
|
+
field = _ref35.field,
|
|
1308
|
+
getGroup = _ref35.getGroup,
|
|
1309
|
+
getId = _ref35.getId,
|
|
1310
|
+
_ref35$getLabel = _ref35.getLabel,
|
|
1311
|
+
getLabel = _ref35$getLabel === void 0 ? defaultGetLabel : _ref35$getLabel,
|
|
1312
|
+
groupHeaderRenderer = _ref35.groupHeaderRenderer,
|
|
1313
|
+
isOptionDisabled = _ref35.isOptionDisabled,
|
|
1314
|
+
onChange = _ref35.onChange,
|
|
1315
|
+
onSearch = _ref35.onSearch,
|
|
1316
|
+
onScrollBottom = _ref35.onScrollBottom,
|
|
1317
|
+
options = _ref35.options,
|
|
1318
|
+
optgroups = _ref35.optgroups,
|
|
1319
|
+
optionRenderer = _ref35.optionRenderer,
|
|
1320
|
+
placement = _ref35.placement,
|
|
1321
|
+
placeholder = _ref35.placeholder,
|
|
1322
|
+
tokenRenderer = _ref35.tokenRenderer,
|
|
1323
|
+
qa = _ref35.qa,
|
|
1324
|
+
props = _objectWithoutProperties(_ref35, _excluded32);
|
|
1325
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
1326
|
+
ref: ref
|
|
1327
|
+
}, props), field.input.value && field.input.value.map(getLabel).join(', '));
|
|
782
1328
|
});
|
|
783
1329
|
var FieldMultiSelect = makeField(MultiSelectInput, MultiSelectOutput);
|
|
1330
|
+
|
|
784
1331
|
// GROUP SELECT
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
1332
|
+
|
|
1333
|
+
export var GroupSelectInput = /*#__PURE__*/React.forwardRef(function GroupSelectInput(_ref36, ref) {
|
|
1334
|
+
var field = _ref36.field,
|
|
1335
|
+
_onBlur = _ref36.onBlur,
|
|
1336
|
+
_onChange = _ref36.onChange,
|
|
1337
|
+
_ref36$getId = _ref36.getId,
|
|
1338
|
+
getId = _ref36$getId === void 0 ? defaultGetId : _ref36$getId,
|
|
1339
|
+
_ref36$getLabel = _ref36.getLabel,
|
|
1340
|
+
getLabel = _ref36$getLabel === void 0 ? defaultGetLabel : _ref36$getLabel,
|
|
1341
|
+
props = _objectWithoutProperties(_ref36, _excluded33);
|
|
1342
|
+
var onBlur = function onBlur(e) {
|
|
1343
|
+
field.helpers.setTouched(true);
|
|
1344
|
+
_onBlur && _onBlur(e);
|
|
1345
|
+
};
|
|
1346
|
+
var onChange = function onChange(value, e) {
|
|
1347
|
+
field.helpers.setValue(value);
|
|
1348
|
+
_onChange && _onChange(value, e);
|
|
1349
|
+
};
|
|
1350
|
+
return /*#__PURE__*/React.createElement(GroupSelect, _extends({
|
|
1351
|
+
block: true,
|
|
1352
|
+
disabled: field.meta.disabled,
|
|
1353
|
+
error: field.meta.error,
|
|
1354
|
+
getId: getId,
|
|
1355
|
+
getLabel: getLabel,
|
|
1356
|
+
onBlur: onBlur,
|
|
1357
|
+
onChange: onChange,
|
|
1358
|
+
ref: ref,
|
|
1359
|
+
value: field.input.value
|
|
1360
|
+
}, props));
|
|
796
1361
|
});
|
|
797
|
-
export var GroupSelectOutput = React.forwardRef(function GroupSelectOutput(
|
|
798
|
-
|
|
799
|
-
|
|
1362
|
+
export var GroupSelectOutput = /*#__PURE__*/React.forwardRef(function GroupSelectOutput(_ref37, ref) {
|
|
1363
|
+
var afterHide = _ref37.afterHide,
|
|
1364
|
+
afterShow = _ref37.afterShow,
|
|
1365
|
+
beforeHide = _ref37.beforeHide,
|
|
1366
|
+
beforeShow = _ref37.beforeShow,
|
|
1367
|
+
emptyMessage = _ref37.emptyMessage,
|
|
1368
|
+
field = _ref37.field,
|
|
1369
|
+
getGroup = _ref37.getGroup,
|
|
1370
|
+
getId = _ref37.getId,
|
|
1371
|
+
_ref37$getLabel = _ref37.getLabel,
|
|
1372
|
+
getLabel = _ref37$getLabel === void 0 ? defaultGetLabel : _ref37$getLabel,
|
|
1373
|
+
getOptGroup = _ref37.getOptGroup,
|
|
1374
|
+
groupRenderer = _ref37.groupRenderer,
|
|
1375
|
+
groups = _ref37.groups,
|
|
1376
|
+
isOptionDisabled = _ref37.isOptionDisabled,
|
|
1377
|
+
placeholder = _ref37.placeholder,
|
|
1378
|
+
placement = _ref37.placement,
|
|
1379
|
+
onChange = _ref37.onChange,
|
|
1380
|
+
onScrollBottom = _ref37.onScrollBottom,
|
|
1381
|
+
onSearch = _ref37.onSearch,
|
|
1382
|
+
optgroups = _ref37.optgroups,
|
|
1383
|
+
options = _ref37.options,
|
|
1384
|
+
optionRenderer = _ref37.optionRenderer,
|
|
1385
|
+
optGroupRenderer = _ref37.optGroupRenderer,
|
|
1386
|
+
tokenRenderer = _ref37.tokenRenderer,
|
|
1387
|
+
qa = _ref37.qa,
|
|
1388
|
+
props = _objectWithoutProperties(_ref37, _excluded34);
|
|
1389
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
1390
|
+
ref: ref
|
|
1391
|
+
}, props), field.input.value && field.input.value.map(getLabel).join(', '));
|
|
800
1392
|
});
|
|
801
1393
|
var FieldGroupSelect = makeField(GroupSelectInput, GroupSelectOutput);
|
|
1394
|
+
|
|
802
1395
|
// TIERED SELECT
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1396
|
+
|
|
1397
|
+
export var TieredSelectInput = /*#__PURE__*/React.forwardRef(function TieredSelectInput(_ref38, ref) {
|
|
1398
|
+
var field = _ref38.field,
|
|
1399
|
+
_onBlur = _ref38.onBlur,
|
|
1400
|
+
_onChange = _ref38.onChange,
|
|
1401
|
+
_ref38$getId = _ref38.getId,
|
|
1402
|
+
getId = _ref38$getId === void 0 ? defaultGetId : _ref38$getId,
|
|
1403
|
+
_ref38$getLabel = _ref38.getLabel,
|
|
1404
|
+
getLabel = _ref38$getLabel === void 0 ? defaultGetLabel : _ref38$getLabel,
|
|
1405
|
+
props = _objectWithoutProperties(_ref38, _excluded35);
|
|
1406
|
+
var onBlur = function onBlur(e) {
|
|
1407
|
+
field.helpers.setTouched(true);
|
|
1408
|
+
_onBlur && _onBlur(e);
|
|
1409
|
+
};
|
|
1410
|
+
var onChange = function onChange(selection) {
|
|
1411
|
+
field.helpers.setValue(selection.value);
|
|
1412
|
+
_onChange && _onChange(selection);
|
|
1413
|
+
};
|
|
1414
|
+
return /*#__PURE__*/React.createElement(TieredSelect, _extends({
|
|
1415
|
+
block: true,
|
|
1416
|
+
disabled: field.meta.disabled,
|
|
1417
|
+
error: field.meta.error,
|
|
1418
|
+
getId: getId,
|
|
1419
|
+
getLabel: getLabel,
|
|
1420
|
+
onBlur: onBlur,
|
|
1421
|
+
onChange: onChange,
|
|
1422
|
+
ref: ref,
|
|
1423
|
+
value: field.input.value
|
|
1424
|
+
}, props));
|
|
814
1425
|
});
|
|
815
|
-
export var TieredSelectOutput = React.forwardRef(function TieredSelectOutput(
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
1426
|
+
export var TieredSelectOutput = /*#__PURE__*/React.forwardRef(function TieredSelectOutput(_ref39, ref) {
|
|
1427
|
+
var afterHide = _ref39.afterHide,
|
|
1428
|
+
afterShow = _ref39.afterShow,
|
|
1429
|
+
beforeHide = _ref39.beforeHide,
|
|
1430
|
+
beforeShow = _ref39.beforeShow,
|
|
1431
|
+
field = _ref39.field,
|
|
1432
|
+
getId = _ref39.getId,
|
|
1433
|
+
_ref39$getLabel = _ref39.getLabel,
|
|
1434
|
+
getLabel = _ref39$getLabel === void 0 ? defaultGetLabel : _ref39$getLabel,
|
|
1435
|
+
getGroupId = _ref39.getGroupId,
|
|
1436
|
+
getNextGroupId = _ref39.getNextGroupId,
|
|
1437
|
+
getValueString = _ref39.getValueString,
|
|
1438
|
+
i18nScope = _ref39.i18nScope,
|
|
1439
|
+
isLeaf = _ref39.isLeaf,
|
|
1440
|
+
isTierDisabled = _ref39.isTierDisabled,
|
|
1441
|
+
loadingMore = _ref39.loadingMore,
|
|
1442
|
+
onChange = _ref39.onChange,
|
|
1443
|
+
onClear = _ref39.onClear,
|
|
1444
|
+
onNavigate = _ref39.onNavigate,
|
|
1445
|
+
onScrollBottom = _ref39.onScrollBottom,
|
|
1446
|
+
onSearch = _ref39.onSearch,
|
|
1447
|
+
onQuickCreate = _ref39.onQuickCreate,
|
|
1448
|
+
options = _ref39.options,
|
|
1449
|
+
selectableTiers = _ref39.selectableTiers,
|
|
1450
|
+
props = _objectWithoutProperties(_ref39, _excluded36);
|
|
1451
|
+
return /*#__PURE__*/React.createElement("span", _extends({
|
|
1452
|
+
ref: ref
|
|
1453
|
+
}, props), field.input.value && field.input.value.map(function (tier) {
|
|
1454
|
+
return getLabel(tier);
|
|
1455
|
+
}).join(' > '));
|
|
819
1456
|
});
|
|
820
1457
|
var FieldTieredSelect = makeField(TieredSelectInput, TieredSelectOutput);
|
|
821
1458
|
var FieldAny = makeField(TextInput, TextOutput);
|
|
822
1459
|
export var Form = addSubcomponents({
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
1460
|
+
Checkboxes: FieldCheckboxes,
|
|
1461
|
+
Checkbox: FieldCheckbox,
|
|
1462
|
+
Currency: FieldCurrency,
|
|
1463
|
+
DateSelect: FieldDateSelect,
|
|
1464
|
+
ErrorBanner: FormErrorBanner,
|
|
1465
|
+
Field: FieldAny,
|
|
1466
|
+
Form: FormForm,
|
|
1467
|
+
GroupSelect: FieldGroupSelect,
|
|
1468
|
+
MultiSelect: FieldMultiSelect,
|
|
1469
|
+
Number: FieldNumber,
|
|
1470
|
+
PillSelect: FieldPillSelect,
|
|
1471
|
+
RadioButtons: FieldRadioButtons,
|
|
1472
|
+
RichText: FieldRichText,
|
|
1473
|
+
Row: Row,
|
|
1474
|
+
Select: FieldSelect,
|
|
1475
|
+
Text: FieldText,
|
|
1476
|
+
TextArea: FieldTextArea,
|
|
1477
|
+
TieredSelect: FieldTieredSelect
|
|
841
1478
|
}, Form_);
|
|
842
1479
|
//# sourceMappingURL=Form.js.map
|