@ohos-ports/sprucelabs-react-heartwood-components 9.1.0-beta.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/LICENSE +21 -0
- package/README.md +59 -0
- package/lib/__mocks__/stubs/events.js +166 -0
- package/lib/__mocks__/stubs/events.js.map +1 -0
- package/lib/__mocks__/stubs/location.js +34 -0
- package/lib/__mocks__/stubs/location.js.map +1 -0
- package/lib/__mocks__/stubs/users.js +225 -0
- package/lib/__mocks__/stubs/users.js.map +1 -0
- package/lib/__tests__/components/Pagination/Pagination.test.js +127 -0
- package/lib/__tests__/components/Pagination/Pagination.test.js.map +1 -0
- package/lib/components/Avatar/Avatar-story.js +34 -0
- package/lib/components/Avatar/Avatar-story.js.map +1 -0
- package/lib/components/Avatar/Avatar.d.ts +40 -0
- package/lib/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/components/Avatar/Avatar.js +91 -0
- package/lib/components/Avatar/Avatar.js.map +1 -0
- package/lib/components/Avatar/UserAvatar.js +45 -0
- package/lib/components/Avatar/UserAvatar.js.map +1 -0
- package/lib/components/BotText/BotText-story.d.ts +2 -0
- package/lib/components/BotText/BotText-story.d.ts.map +1 -0
- package/lib/components/BotText/BotText-story.js +21 -0
- package/lib/components/BotText/BotText-story.js.map +1 -0
- package/lib/components/BotText/BotText.d.ts +12 -0
- package/lib/components/BotText/BotText.d.ts.map +1 -0
- package/lib/components/BotText/BotText.js +52 -0
- package/lib/components/BotText/BotText.js.map +1 -0
- package/lib/components/Button/Button-story.js +109 -0
- package/lib/components/Button/Button-story.js.map +1 -0
- package/lib/components/Button/Button.d.ts +47 -0
- package/lib/components/Button/Button.d.ts.map +1 -0
- package/lib/components/Button/Button.js +155 -0
- package/lib/components/Button/Button.js.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup-story.js +27 -0
- package/lib/components/ButtonGroup/ButtonGroup-story.js.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup.d.ts +19 -0
- package/lib/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup.js +64 -0
- package/lib/components/ButtonGroup/ButtonGroup.js.map +1 -0
- package/lib/components/Card/Card-story.d.ts +2 -0
- package/lib/components/Card/Card-story.d.ts.map +1 -0
- package/lib/components/Card/Card-story.js +389 -0
- package/lib/components/Card/Card-story.js.map +1 -0
- package/lib/components/Card/Card.d.ts +69 -0
- package/lib/components/Card/Card.d.ts.map +1 -0
- package/lib/components/Card/Card.js +113 -0
- package/lib/components/Card/Card.js.map +1 -0
- package/lib/components/Card/components/CardBody.d.ts +27 -0
- package/lib/components/Card/components/CardBody.d.ts.map +1 -0
- package/lib/components/Card/components/CardBody.js +45 -0
- package/lib/components/Card/components/CardBody.js.map +1 -0
- package/lib/components/Card/components/CardBuilder.d.ts +50 -0
- package/lib/components/Card/components/CardBuilder.d.ts.map +1 -0
- package/lib/components/Card/components/CardBuilder.js +139 -0
- package/lib/components/Card/components/CardBuilder.js.map +1 -0
- package/lib/components/Card/components/CardFooter.d.ts +11 -0
- package/lib/components/Card/components/CardFooter.d.ts.map +1 -0
- package/lib/components/Card/components/CardFooter.js +22 -0
- package/lib/components/Card/components/CardFooter.js.map +1 -0
- package/lib/components/Card/components/CardHeader.d.ts +28 -0
- package/lib/components/Card/components/CardHeader.d.ts.map +1 -0
- package/lib/components/Card/components/CardHeader.js +70 -0
- package/lib/components/Card/components/CardHeader.js.map +1 -0
- package/lib/components/Card/components/CardSection.d.ts +10 -0
- package/lib/components/Card/components/CardSection.d.ts.map +1 -0
- package/lib/components/Card/components/CardSection.js +27 -0
- package/lib/components/Card/components/CardSection.js.map +1 -0
- package/lib/components/Card/components/OnboardingCard.d.ts +27 -0
- package/lib/components/Card/components/OnboardingCard.d.ts.map +1 -0
- package/lib/components/Card/components/OnboardingCard.js +129 -0
- package/lib/components/Card/components/OnboardingCard.js.map +1 -0
- package/lib/components/Card/components/Scores.d.ts +15 -0
- package/lib/components/Card/components/Scores.d.ts.map +1 -0
- package/lib/components/Card/components/Scores.js +39 -0
- package/lib/components/Card/components/Scores.js.map +1 -0
- package/lib/components/Card/index.d.ts +11 -0
- package/lib/components/Card/index.d.ts.map +1 -0
- package/lib/components/Card/index.js +120 -0
- package/lib/components/Card/index.js.map +1 -0
- package/lib/components/CircleLoader/CircleLoader-story.d.ts +2 -0
- package/lib/components/CircleLoader/CircleLoader-story.d.ts.map +1 -0
- package/lib/components/CircleLoader/CircleLoader-story.js +20 -0
- package/lib/components/CircleLoader/CircleLoader-story.js.map +1 -0
- package/lib/components/CircleLoader/CircleLoader.d.ts +13 -0
- package/lib/components/CircleLoader/CircleLoader.d.ts.map +1 -0
- package/lib/components/CircleLoader/CircleLoader.js +28 -0
- package/lib/components/CircleLoader/CircleLoader.js.map +1 -0
- package/lib/components/ContextMenu/ContextMenu-story.js +31 -0
- package/lib/components/ContextMenu/ContextMenu-story.js.map +1 -0
- package/lib/components/ContextMenu/ContextMenu.d.ts +70 -0
- package/lib/components/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/lib/components/ContextMenu/ContextMenu.js +315 -0
- package/lib/components/ContextMenu/ContextMenu.js.map +1 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder-story.js +101 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder-story.js.map +1 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder.js +290 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/FooterPrimary.js +20 -0
- package/lib/components/Core/components/FooterPrimary/FooterPrimary.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/components/HelpButton/HelpButton.js +52 -0
- package/lib/components/Core/components/FooterPrimary/components/HelpButton/HelpButton.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/components/Legal/Legal.js +38 -0
- package/lib/components/Core/components/FooterPrimary/components/Legal/Legal.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/index.js +30 -0
- package/lib/components/Core/components/FooterPrimary/index.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary-story.js +134 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary-story.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary.js +238 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/DefaultLockup/DefaultLockup.js +32 -0
- package/lib/components/Core/components/HeaderPrimary/components/DefaultLockup/DefaultLockup.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/Hamburger/Hamburger.js +58 -0
- package/lib/components/Core/components/HeaderPrimary/components/Hamburger/Hamburger.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/LocationMenu/LocationMenu.js +169 -0
- package/lib/components/Core/components/HeaderPrimary/components/LocationMenu/LocationMenu.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/UserMenu/UserMenu.js +56 -0
- package/lib/components/Core/components/HeaderPrimary/components/UserMenu/UserMenu.js.map +1 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary-story.js +26 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary-story.js.map +1 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary.js +46 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary.js.map +1 -0
- package/lib/components/Core/components/SaveBar/SaveBar-story.js +68 -0
- package/lib/components/Core/components/SaveBar/SaveBar-story.js.map +1 -0
- package/lib/components/Core/components/SaveBar/SaveBar.js +127 -0
- package/lib/components/Core/components/SaveBar/SaveBar.js.map +1 -0
- package/lib/components/Core/components/Sidebar/Sidebar-story.js +204 -0
- package/lib/components/Core/components/Sidebar/Sidebar-story.js.map +1 -0
- package/lib/components/Core/components/Sidebar/Sidebar.js +87 -0
- package/lib/components/Core/components/Sidebar/Sidebar.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarExpander/SidebarExpander.js +48 -0
- package/lib/components/Core/components/Sidebar/components/SidebarExpander/SidebarExpander.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarFooter/SidebarFooter.js +25 -0
- package/lib/components/Core/components/Sidebar/components/SidebarFooter/SidebarFooter.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.d.ts +12 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.d.ts.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.js +47 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarItem/SidebarItem.js +115 -0
- package/lib/components/Core/components/Sidebar/components/SidebarItem/SidebarItem.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarSection/SidebarSection.js +38 -0
- package/lib/components/Core/components/Sidebar/components/SidebarSection/SidebarSection.js.map +1 -0
- package/lib/components/Core/index.js +80 -0
- package/lib/components/Core/index.js.map +1 -0
- package/lib/components/Dropzone/Dropzone-story.js +119 -0
- package/lib/components/Dropzone/Dropzone-story.js.map +1 -0
- package/lib/components/Dropzone/Dropzone.js +317 -0
- package/lib/components/Dropzone/Dropzone.js.map +1 -0
- package/lib/components/EmptyState/EmptyState-story.d.ts +2 -0
- package/lib/components/EmptyState/EmptyState-story.d.ts.map +1 -0
- package/lib/components/EmptyState/EmptyState-story.js +60 -0
- package/lib/components/EmptyState/EmptyState-story.js.map +1 -0
- package/lib/components/EmptyState/EmptyState.d.ts +28 -0
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/components/EmptyState/EmptyState.js +54 -0
- package/lib/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/components/EventDetails/EventDetails-story.d.ts +2 -0
- package/lib/components/EventDetails/EventDetails-story.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetails-story.js +112 -0
- package/lib/components/EventDetails/EventDetails-story.js.map +1 -0
- package/lib/components/EventDetails/EventDetails.d.ts +18 -0
- package/lib/components/EventDetails/EventDetails.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetails.js +75 -0
- package/lib/components/EventDetails/EventDetails.js.map +1 -0
- package/lib/components/EventDetails/EventDetailsUtilities.d.ts +11 -0
- package/lib/components/EventDetails/EventDetailsUtilities.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetailsUtilities.js +56 -0
- package/lib/components/EventDetails/EventDetailsUtilities.js.map +1 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.d.ts +18 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.d.ts.map +1 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.js +111 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.js.map +1 -0
- package/lib/components/EventDetails/eventDetailsMock.d.ts +10 -0
- package/lib/components/EventDetails/eventDetailsMock.d.ts.map +1 -0
- package/lib/components/EventDetails/eventDetailsMock.js +840 -0
- package/lib/components/EventDetails/eventDetailsMock.js.map +1 -0
- package/lib/components/FontLoader/FontLoader-story.js +16 -0
- package/lib/components/FontLoader/FontLoader-story.js.map +1 -0
- package/lib/components/FontLoader/FontLoader.js +148 -0
- package/lib/components/FontLoader/FontLoader.js.map +1 -0
- package/lib/components/Forms/FormPartials.js +70 -0
- package/lib/components/Forms/FormPartials.js.map +1 -0
- package/lib/components/Forms/Forms-story.js +297 -0
- package/lib/components/Forms/Forms-story.js.map +1 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.d.ts +71 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.d.ts.map +1 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.js +372 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.js.map +1 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.d.ts +23 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.js +162 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/components/Forms/components/DatePicker/DatePicker.js +236 -0
- package/lib/components/Forms/components/DatePicker/DatePicker.js.map +1 -0
- package/lib/components/Forms/components/DomainInput/DomainInput.js +29 -0
- package/lib/components/Forms/components/DomainInput/DomainInput.js.map +1 -0
- package/lib/components/Forms/components/DurationInput/DurationInput.js +270 -0
- package/lib/components/Forms/components/DurationInput/DurationInput.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder-story.js +357 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder-story.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder.js +121 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/components/FormInner/FormInner.js +201 -0
- package/lib/components/Forms/components/FormBuilder/components/FormInner/FormInner.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/FormLayout.js +35 -0
- package/lib/components/Forms/components/FormLayout/FormLayout.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js +30 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js +32 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/index.js +32 -0
- package/lib/components/Forms/components/FormLayout/index.js.map +1 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.d.ts +30 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.d.ts.map +1 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.js +119 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.js.map +1 -0
- package/lib/components/Forms/components/Radio/Radio.d.ts +15 -0
- package/lib/components/Forms/components/Radio/Radio.d.ts.map +1 -0
- package/lib/components/Forms/components/Radio/Radio.js +92 -0
- package/lib/components/Forms/components/Radio/Radio.js.map +1 -0
- package/lib/components/Forms/components/Search/Search.js +96 -0
- package/lib/components/Forms/components/Search/Search.js.map +1 -0
- package/lib/components/Forms/components/Select/Select.js +95 -0
- package/lib/components/Forms/components/Select/Select.js.map +1 -0
- package/lib/components/Forms/components/Slider/Slider.js +100 -0
- package/lib/components/Forms/components/Slider/Slider.js.map +1 -0
- package/lib/components/Forms/components/Stars/Stars.js +101 -0
- package/lib/components/Forms/components/Stars/Stars.js.map +1 -0
- package/lib/components/Forms/components/Tag/Tag.js +60 -0
- package/lib/components/Forms/components/Tag/Tag.js.map +1 -0
- package/lib/components/Forms/components/TextArea/TextArea.js +55 -0
- package/lib/components/Forms/components/TextArea/TextArea.js.map +1 -0
- package/lib/components/Forms/components/TextInput/TextInput.d.ts +28 -0
- package/lib/components/Forms/components/TextInput/TextInput.d.ts.map +1 -0
- package/lib/components/Forms/components/TextInput/TextInput.js +57 -0
- package/lib/components/Forms/components/TextInput/TextInput.js.map +1 -0
- package/lib/components/Forms/components/Toggle/Toggle.d.ts +9 -0
- package/lib/components/Forms/components/Toggle/Toggle.d.ts.map +1 -0
- package/lib/components/Forms/components/Toggle/Toggle.js +43 -0
- package/lib/components/Forms/components/Toggle/Toggle.js.map +1 -0
- package/lib/components/Forms/index.d.ts +18 -0
- package/lib/components/Forms/index.d.ts.map +1 -0
- package/lib/components/Forms/index.js +182 -0
- package/lib/components/Forms/index.js.map +1 -0
- package/lib/components/Heading/Heading-story.js +18 -0
- package/lib/components/Heading/Heading-story.js.map +1 -0
- package/lib/components/Heading/Heading.d.ts +13 -0
- package/lib/components/Heading/Heading.d.ts.map +1 -0
- package/lib/components/Heading/Heading.js +32 -0
- package/lib/components/Heading/Heading.js.map +1 -0
- package/lib/components/Icon/Icon-story.d.ts +2 -0
- package/lib/components/Icon/Icon-story.d.ts.map +1 -0
- package/lib/components/Icon/Icon-story.js +44 -0
- package/lib/components/Icon/Icon-story.js.map +1 -0
- package/lib/components/Icon/Icon.d.ts +13 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -0
- package/lib/components/Icon/Icon.js +52 -0
- package/lib/components/Icon/Icon.js.map +1 -0
- package/lib/components/Image/Image.d.ts +11 -0
- package/lib/components/Image/Image.d.ts.map +1 -0
- package/lib/components/Image/Image.js +32 -0
- package/lib/components/Image/Image.js.map +1 -0
- package/lib/components/ImageCropper/ImageCropper-story.js +219 -0
- package/lib/components/ImageCropper/ImageCropper-story.js.map +1 -0
- package/lib/components/ImageCropper/ImageCropper.js +256 -0
- package/lib/components/ImageCropper/ImageCropper.js.map +1 -0
- package/lib/components/ImageSSR/ImageSSR.js +32 -0
- package/lib/components/ImageSSR/ImageSSR.js.map +1 -0
- package/lib/components/Layout/Layout-story.js +128 -0
- package/lib/components/Layout/Layout-story.js.map +1 -0
- package/lib/components/Layout/Layout.js +43 -0
- package/lib/components/Layout/Layout.js.map +1 -0
- package/lib/components/Layout/components/LayoutSection/LayoutSection.js +38 -0
- package/lib/components/Layout/components/LayoutSection/LayoutSection.js.map +1 -0
- package/lib/components/Layout/index.js +24 -0
- package/lib/components/Layout/index.js.map +1 -0
- package/lib/components/List/List-story.d.ts +2 -0
- package/lib/components/List/List-story.d.ts.map +1 -0
- package/lib/components/List/List-story.js +241 -0
- package/lib/components/List/List-story.js.map +1 -0
- package/lib/components/List/List.d.ts +34 -0
- package/lib/components/List/List.d.ts.map +1 -0
- package/lib/components/List/List.js +83 -0
- package/lib/components/List/List.js.map +1 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.d.ts +27 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.d.ts.map +1 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.js +93 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.js.map +1 -0
- package/lib/components/List/components/ListHeader/ListHeader.d.ts +16 -0
- package/lib/components/List/components/ListHeader/ListHeader.d.ts.map +1 -0
- package/lib/components/List/components/ListHeader/ListHeader.js +51 -0
- package/lib/components/List/components/ListHeader/ListHeader.js.map +1 -0
- package/lib/components/List/components/ListItem/ListItem.d.ts +67 -0
- package/lib/components/List/components/ListItem/ListItem.d.ts.map +1 -0
- package/lib/components/List/components/ListItem/ListItem.js +206 -0
- package/lib/components/List/components/ListItem/ListItem.js.map +1 -0
- package/lib/components/List/components/SortableList/SortableList.d.ts +35 -0
- package/lib/components/List/components/SortableList/SortableList.d.ts.map +1 -0
- package/lib/components/List/components/SortableList/SortableList.js +180 -0
- package/lib/components/List/components/SortableList/SortableList.js.map +1 -0
- package/lib/components/List/index.d.ts +6 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +74 -0
- package/lib/components/List/index.js.map +1 -0
- package/lib/components/Loader/Loader-story.js +30 -0
- package/lib/components/Loader/Loader-story.js.map +1 -0
- package/lib/components/Loader/Loader.js +36 -0
- package/lib/components/Loader/Loader.js.map +1 -0
- package/lib/components/Loader/Loader.test.js +17 -0
- package/lib/components/Loader/Loader.test.js.map +1 -0
- package/lib/components/MarkdownText/MarkdownText.d.ts +8 -0
- package/lib/components/MarkdownText/MarkdownText.d.ts.map +1 -0
- package/lib/components/MarkdownText/MarkdownText.js +26 -0
- package/lib/components/MarkdownText/MarkdownText.js.map +1 -0
- package/lib/components/Message/Message-story.js +135 -0
- package/lib/components/Message/Message-story.js.map +1 -0
- package/lib/components/Message/Message.js +147 -0
- package/lib/components/Message/Message.js.map +1 -0
- package/lib/components/Message/components/MessageBuilder.js +132 -0
- package/lib/components/Message/components/MessageBuilder.js.map +1 -0
- package/lib/components/Message/index.js +24 -0
- package/lib/components/Message/index.js.map +1 -0
- package/lib/components/Modal/Modal-story.js +239 -0
- package/lib/components/Modal/Modal-story.js.map +1 -0
- package/lib/components/Modal/Modal.js +86 -0
- package/lib/components/Modal/Modal.js.map +1 -0
- package/lib/components/Modal/components/ModalBody/ModalBody.js +30 -0
- package/lib/components/Modal/components/ModalBody/ModalBody.js.map +1 -0
- package/lib/components/Modal/components/ModalFooter/ModalFooter.js +31 -0
- package/lib/components/Modal/components/ModalFooter/ModalFooter.js.map +1 -0
- package/lib/components/Modal/components/ModalHeader/ModalHeader.js +84 -0
- package/lib/components/Modal/components/ModalHeader/ModalHeader.js.map +1 -0
- package/lib/components/Page/Page-story.js +115 -0
- package/lib/components/Page/Page-story.js.map +1 -0
- package/lib/components/Page/Page.js +55 -0
- package/lib/components/Page/Page.js.map +1 -0
- package/lib/components/Page/components/PageContent/PageContent.js +22 -0
- package/lib/components/Page/components/PageContent/PageContent.js.map +1 -0
- package/lib/components/Page/components/PageHeader/PageHeader.js +127 -0
- package/lib/components/Page/components/PageHeader/PageHeader.js.map +1 -0
- package/lib/components/Page/index.js +32 -0
- package/lib/components/Page/index.js.map +1 -0
- package/lib/components/PagedModal/PagedModal-story.js +121 -0
- package/lib/components/PagedModal/PagedModal-story.js.map +1 -0
- package/lib/components/PagedModal/PagedModal.js +84 -0
- package/lib/components/PagedModal/PagedModal.js.map +1 -0
- package/lib/components/Pagination/Pagination-story.js +35 -0
- package/lib/components/Pagination/Pagination-story.js.map +1 -0
- package/lib/components/Pagination/Pagination.js +157 -0
- package/lib/components/Pagination/Pagination.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectList-story.js +491 -0
- package/lib/components/RecordSelectionList/RecordSelectList-story.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.d.ts +112 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.d.ts.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.js +702 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.d.ts +5 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.d.ts.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.js +20 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.js.map +1 -0
- package/lib/components/RecordTable/RecordTable-story.d.ts +2 -0
- package/lib/components/RecordTable/RecordTable-story.d.ts.map +1 -0
- package/lib/components/RecordTable/RecordTable-story.js +242 -0
- package/lib/components/RecordTable/RecordTable-story.js.map +1 -0
- package/lib/components/RecordTable/RecordTable.d.ts +133 -0
- package/lib/components/RecordTable/RecordTable.d.ts.map +1 -0
- package/lib/components/RecordTable/RecordTable.js +523 -0
- package/lib/components/RecordTable/RecordTable.js.map +1 -0
- package/lib/components/SplitButton/SplitButton-story.js +60 -0
- package/lib/components/SplitButton/SplitButton-story.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.d.ts +47 -0
- package/lib/components/SplitButton/SplitButton.d.ts.map +1 -0
- package/lib/components/SplitButton/SplitButton.js +296 -0
- package/lib/components/SplitButton/SplitButton.js.map +1 -0
- package/lib/components/Subheading/Subheading-story.js +18 -0
- package/lib/components/Subheading/Subheading-story.js.map +1 -0
- package/lib/components/Subheading/Subheading.js +40 -0
- package/lib/components/Subheading/Subheading.js.map +1 -0
- package/lib/components/Table/Table-story.js +428 -0
- package/lib/components/Table/Table-story.js.map +1 -0
- package/lib/components/Table/Table.d.ts +63 -0
- package/lib/components/Table/Table.d.ts.map +1 -0
- package/lib/components/Table/Table.js +395 -0
- package/lib/components/Table/Table.js.map +1 -0
- package/lib/components/Table/components/TableFilters/TableFilters.js +31 -0
- package/lib/components/Table/components/TableFilters/TableFilters.js.map +1 -0
- package/lib/components/Table/components/TableSearch/TableSearch.d.ts +7 -0
- package/lib/components/Table/components/TableSearch/TableSearch.d.ts.map +1 -0
- package/lib/components/Table/components/TableSearch/TableSearch.js +30 -0
- package/lib/components/Table/components/TableSearch/TableSearch.js.map +1 -0
- package/lib/components/Table/index.d.ts +4 -0
- package/lib/components/Table/index.d.ts.map +1 -0
- package/lib/components/Table/index.js +40 -0
- package/lib/components/Table/index.js.map +1 -0
- package/lib/components/Tabs/Tabs-story.d.ts +2 -0
- package/lib/components/Tabs/Tabs-story.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs-story.js +36 -0
- package/lib/components/Tabs/Tabs-story.js.map +1 -0
- package/lib/components/Tabs/Tabs.d.ts +40 -0
- package/lib/components/Tabs/Tabs.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs.js +244 -0
- package/lib/components/Tabs/Tabs.js.map +1 -0
- package/lib/components/Tabs/components/Tab/Tab.d.ts +26 -0
- package/lib/components/Tabs/components/Tab/Tab.d.ts.map +1 -0
- package/lib/components/Tabs/components/Tab/Tab.js +46 -0
- package/lib/components/Tabs/components/Tab/Tab.js.map +1 -0
- package/lib/components/Text/Text-story.d.ts +2 -0
- package/lib/components/Text/Text-story.d.ts.map +1 -0
- package/lib/components/Text/Text-story.js +51 -0
- package/lib/components/Text/Text-story.js.map +1 -0
- package/lib/components/Text/Text.d.ts +18 -0
- package/lib/components/Text/Text.d.ts.map +1 -0
- package/lib/components/Text/Text.js +123 -0
- package/lib/components/Text/Text.js.map +1 -0
- package/lib/components/TextContainer/TextContainer-story.js +32 -0
- package/lib/components/TextContainer/TextContainer-story.js.map +1 -0
- package/lib/components/TextContainer/TextContainer.js +33 -0
- package/lib/components/TextContainer/TextContainer.js.map +1 -0
- package/lib/components/TextStyle/TextStyle-story.js +28 -0
- package/lib/components/TextStyle/TextStyle-story.js.map +1 -0
- package/lib/components/TextStyle/TextStyle.js +41 -0
- package/lib/components/TextStyle/TextStyle.js.map +1 -0
- package/lib/components/Toast/Toast-story.d.ts +2 -0
- package/lib/components/Toast/Toast-story.d.ts.map +1 -0
- package/lib/components/Toast/Toast-story.js +210 -0
- package/lib/components/Toast/Toast-story.js.map +1 -0
- package/lib/components/Toast/Toast.d.ts +24 -0
- package/lib/components/Toast/Toast.d.ts.map +1 -0
- package/lib/components/Toast/Toast.js +76 -0
- package/lib/components/Toast/Toast.js.map +1 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.d.ts +24 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.d.ts.map +1 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.js +131 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.js.map +1 -0
- package/lib/components/TruncatedList/TruncatedList-story.js +222 -0
- package/lib/components/TruncatedList/TruncatedList-story.js.map +1 -0
- package/lib/components/TruncatedList/TruncatedList.d.ts +49 -0
- package/lib/components/TruncatedList/TruncatedList.d.ts.map +1 -0
- package/lib/components/TruncatedList/TruncatedList.js +188 -0
- package/lib/components/TruncatedList/TruncatedList.js.map +1 -0
- package/lib/components/View/View-story.js +485 -0
- package/lib/components/View/View-story.js.map +1 -0
- package/lib/components/View/View.d.ts +26 -0
- package/lib/components/View/View.d.ts.map +1 -0
- package/lib/components/View/View.js +91 -0
- package/lib/components/View/View.js.map +1 -0
- package/lib/components/_utilities/Anchor.js +28 -0
- package/lib/components/_utilities/Anchor.js.map +1 -0
- package/lib/custom-types.d.js +2 -0
- package/lib/custom-types.d.js.map +1 -0
- package/lib/icons.js +3328 -0
- package/lib/icons.js.map +1 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +707 -0
- package/lib/index.js.map +1 -0
- package/lib/stubs/events.js +166 -0
- package/lib/stubs/events.js.map +1 -0
- package/lib/stubs/location.js +34 -0
- package/lib/stubs/location.js.map +1 -0
- package/lib/stubs/users.js +225 -0
- package/lib/stubs/users.js.map +1 -0
- package/lib/utilities.js +23 -0
- package/lib/utilities.js.map +1 -0
- package/package.json +174 -0
- package/static/android-chrome-192x192.png +0 -0
- package/static/android-chrome-256x256.png +0 -0
- package/static/apple-touch-icon.png +0 -0
- package/static/assets/bg.jpeg +0 -0
- package/static/assets/icons/Design/Rotate/rotate-back.svg +9 -0
- package/static/assets/icons/Design/Rotate/rotate-forward.svg +9 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle--16w.svg +3 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle--56w.svg +5 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle.svg +3 -0
- package/static/assets/icons/Interface-Essential/Dashboard/gauge-dashboard-1.svg +11 -0
- package/static/assets/icons/Interface-Essential/Date/Calendar/calendar-3.svg +12 -0
- package/static/assets/icons/Interface-Essential/Date/Calendar/calendar-date.svg +9 -0
- package/static/assets/icons/Interface-Essential/Delete/bin.svg +7 -0
- package/static/assets/icons/Interface-Essential/Edit/pencil-write.svg +5 -0
- package/static/assets/icons/Interface-Essential/Form-Edition/paper-write.svg +8 -0
- package/static/assets/icons/Interface-Essential/Form-Validation/check-circle-1.svg +4 -0
- package/static/assets/icons/Interface-Essential/Help/question-help-square--16w.svg +5 -0
- package/static/assets/icons/Interface-Essential/Help/question-help-square.svg +5 -0
- package/static/assets/icons/Interface-Essential/Home/house-1--16w.svg +4 -0
- package/static/assets/icons/Interface-Essential/Home/house-1.svg +4 -0
- package/static/assets/icons/Interface-Essential/Lists/list-bullets-1.svg +8 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/Lock/Unlock-4.svg +5 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/lock-6--16w.svg +3 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/lock-6.svg +5 -0
- package/static/assets/icons/Interface-Essential/Login/Logout/logout.svg +5 -0
- package/static/assets/icons/Interface-Essential/Menu/navigation-menu-horizontal.svg +5 -0
- package/static/assets/icons/Interface-Essential/Select/cursor-select-4.svg +14 -0
- package/static/assets/icons/Interface-Essential/Time/stopwatch.svg +8 -0
- package/static/assets/icons/Interface-Essential/Time-Files/time-clock-file-check.svg +7 -0
- package/static/assets/icons/Interface-Essential/Time-Files/time-clock-file-upload.svg +9 -0
- package/static/assets/icons/Maps-Navigation/Pins/pin-2.svg +4 -0
- package/static/assets/icons/Maps-Navigation/Pins/pin.svg +4 -0
- package/static/assets/icons/Messages-Chat-Smileys/Conversation/conversation-text--16w.svg +8 -0
- package/static/assets/icons/Messages-Chat-Smileys/Conversation/conversation-text.svg +8 -0
- package/static/assets/icons/Messages-Chat-Smileys/Messages-Speech-Bubbles/messages-bubble-square-text.svg +5 -0
- package/static/assets/icons/Phones-Mobile-Devices/Phone/phone-retro-1.svg +7 -0
- package/static/assets/icons/Programming-Apps-Websites/Plugins/Modules/module-puzzle.svg +3 -0
- package/static/assets/icons/Shopping-E-Commerce/Shops/shop-1--56w.svg +6 -0
- package/static/assets/icons/Shopping-E-Commerce/Shops/shop-1.svg +7 -0
- package/static/assets/icons/Social-Medias-Rewards-Rating/Rating/rating-star-1-1.svg +3 -0
- package/static/assets/icons/Social-Medias-Rewards-Rating/Rating/rating-star-1.svg +3 -0
- package/static/assets/icons/Transportation/Aircraft/aircraft-military-plane.svg +18 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Actions-Neutral/single-neutral-actions-image--56w.svg +7 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Actions-Neutral/single-neutral-actions-up-down.svg +8 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Neutral/single-neutral-id-card-3.svg +8 -0
- package/static/assets/icons/Users/Geometric-Full-Body-Multiple-Users/multiple-users-1.svg +8 -0
- package/static/assets/icons/Work-Office-Companies/Human-Resources/human-resources-search-team--16w.svg +8 -0
- package/static/assets/icons/Work-Office-Companies/Human-Resources/human-resources-search-team.svg +8 -0
- package/static/assets/icons/ic_add.svg +5 -0
- package/static/assets/icons/ic_add_circle_outline.svg +3 -0
- package/static/assets/icons/ic_arrow_back.svg +3 -0
- package/static/assets/icons/ic_arrow_drop_down.svg +3 -0
- package/static/assets/icons/ic_arrow_forward.svg +3 -0
- package/static/assets/icons/ic_button.svg +3 -0
- package/static/assets/icons/ic_calendar.svg +12 -0
- package/static/assets/icons/ic_cancel.svg +8 -0
- package/static/assets/icons/ic_caution.svg +3 -0
- package/static/assets/icons/ic_caution_light_large.svg +5 -0
- package/static/assets/icons/ic_check_box.svg +3 -0
- package/static/assets/icons/ic_check_box_outline_blank.svg +3 -0
- package/static/assets/icons/ic_check_circle.svg +3 -0
- package/static/assets/icons/ic_close.svg +3 -0
- package/static/assets/icons/ic_colors.svg +8 -0
- package/static/assets/icons/ic_complete.svg +4 -0
- package/static/assets/icons/ic_css.svg +7 -0
- package/static/assets/icons/ic_dashboard.svg +11 -0
- package/static/assets/icons/ic_date.svg +9 -0
- package/static/assets/icons/ic_date_disable.svg +8 -0
- package/static/assets/icons/ic_delete.svg +7 -0
- package/static/assets/icons/ic_disable.svg +3 -0
- package/static/assets/icons/ic_drag_handle.svg +3 -0
- package/static/assets/icons/ic_drop_light_large.svg +14 -0
- package/static/assets/icons/ic_edit.svg +5 -0
- package/static/assets/icons/ic_email.svg +6 -0
- package/static/assets/icons/ic_fonts.svg +6 -0
- package/static/assets/icons/ic_fullscreen.svg +3 -0
- package/static/assets/icons/ic_fullscreen_exit.svg +3 -0
- package/static/assets/icons/ic_guests.svg +8 -0
- package/static/assets/icons/ic_help.svg +5 -0
- package/static/assets/icons/ic_home.svg +4 -0
- package/static/assets/icons/ic_indeterminate_check_box.svg +3 -0
- package/static/assets/icons/ic_keyboard_arrow_left.svg +3 -0
- package/static/assets/icons/ic_keyboard_arrow_right.svg +3 -0
- package/static/assets/icons/ic_late.svg +5 -0
- package/static/assets/icons/ic_launch.svg +18 -0
- package/static/assets/icons/ic_location.svg +4 -0
- package/static/assets/icons/ic_logout.svg +5 -0
- package/static/assets/icons/ic_menu.svg +3 -0
- package/static/assets/icons/ic_message.svg +5 -0
- package/static/assets/icons/ic_message_failed.svg +7 -0
- package/static/assets/icons/ic_messages.svg +8 -0
- package/static/assets/icons/ic_more.svg +5 -0
- package/static/assets/icons/ic_new_tab.svg +3 -0
- package/static/assets/icons/ic_note.svg +8 -0
- package/static/assets/icons/ic_payment_failed_solid.svg +5 -0
- package/static/assets/icons/ic_payment_success_solid.svg +5 -0
- package/static/assets/icons/ic_phone.svg +7 -0
- package/static/assets/icons/ic_pin.svg +4 -0
- package/static/assets/icons/ic_pin_outline.svg +4 -0
- package/static/assets/icons/ic_power.svg +4 -0
- package/static/assets/icons/ic_private.svg +5 -0
- package/static/assets/icons/ic_profile_image_light_large.svg +7 -0
- package/static/assets/icons/ic_public.svg +5 -0
- package/static/assets/icons/ic_radio_button_checked.svg +3 -0
- package/static/assets/icons/ic_radio_button_unchecked.svg +3 -0
- package/static/assets/icons/ic_rotate_left.svg +9 -0
- package/static/assets/icons/ic_rotate_right.svg +9 -0
- package/static/assets/icons/ic_search.svg +3 -0
- package/static/assets/icons/ic_settings.svg +4 -0
- package/static/assets/icons/ic_shop_light_large.svg +6 -0
- package/static/assets/icons/ic_show.svg +4 -0
- package/static/assets/icons/ic_skill.svg +3 -0
- package/static/assets/icons/ic_star_outline.svg +3 -0
- package/static/assets/icons/ic_star_solid.svg +3 -0
- package/static/assets/icons/ic_status.svg +8 -0
- package/static/assets/icons/ic_store.svg +7 -0
- package/static/assets/icons/ic_switch_users.svg +8 -0
- package/static/assets/icons/ic_team.svg +8 -0
- package/static/assets/icons/ic_teammates.svg +8 -0
- package/static/assets/icons/ic_unordered_list.svg +8 -0
- package/static/assets/icons/ic_upload.svg +8 -0
- package/static/assets/icons/ic_upload_file_light_large.svg +9 -0
- package/static/assets/icons/ic_upload_file_success_light_large.svg +7 -0
- package/static/assets/icons/ic_user_avatar.svg +3 -0
- package/static/assets/icons/ic_wifi.svg +9 -0
- package/static/assets/icons/s-ic_spruce-logo-02.svg +3 -0
- package/static/assets/icons/s-ic_spruce-logo.svg +3 -0
- package/static/assets/logo.png +0 -0
- package/static/assets/users/user-01--96w.png +0 -0
- package/static/assets/users/user-01.png +0 -0
- package/static/assets/users/user-02--96w.png +0 -0
- package/static/assets/users/user-03--96w.png +0 -0
- package/static/assets/users/user-04--96w.png +0 -0
- package/static/assets/users/user-04.png +0 -0
- package/static/assets/users/user-05--96w.png +0 -0
- package/static/assets/users/user-05.png +0 -0
- package/static/assets/users/user-06--96w.png +0 -0
- package/static/assets/users/user-06.png +0 -0
- package/static/assets/users/user-07--96w.png +0 -0
- package/static/assets/users/user-07.png +0 -0
- package/static/assets/users/user-08--96w.png +0 -0
- package/static/assets/users/user-08.png +0 -0
- package/static/assets/users/user-09--96w.png +0 -0
- package/static/assets/users/user-09.png +0 -0
- package/static/assets/users/user-placeholder--96w.png +0 -0
- package/static/assets/users/user-placeholder.png +0 -0
- package/static/browserconfig.xml +9 -0
- package/static/favicon-16x16.png +0 -0
- package/static/favicon-32x32.png +0 -0
- package/static/favicon.ico +0 -0
- package/static/mstile-150x150.png +0 -0
- package/static/safari-pinned-tab.svg +26 -0
- package/static/site.webmanifest +19 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));
|
|
15
|
+
|
|
16
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
+
|
|
18
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
19
|
+
|
|
20
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
21
|
+
|
|
22
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
23
|
+
|
|
24
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
25
|
+
|
|
26
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
|
+
|
|
28
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
|
+
|
|
30
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
31
|
+
|
|
32
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
33
|
+
|
|
34
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
35
|
+
|
|
36
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
37
|
+
|
|
38
|
+
var _reactDom = require("react-dom");
|
|
39
|
+
|
|
40
|
+
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
41
|
+
|
|
42
|
+
var _reactAutosuggest = _interopRequireDefault(require("react-autosuggest"));
|
|
43
|
+
|
|
44
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
45
|
+
|
|
46
|
+
var _Button = _interopRequireDefault(require("../../../Button/Button"));
|
|
47
|
+
|
|
48
|
+
var _Icon = _interopRequireDefault(require("../../../Icon/Icon"));
|
|
49
|
+
|
|
50
|
+
var _FormPartials = require("../../FormPartials");
|
|
51
|
+
|
|
52
|
+
var ClearIcon = function ClearIcon(props) {
|
|
53
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("mask", {
|
|
54
|
+
id: "a",
|
|
55
|
+
maskUnits: "userSpaceOnUse",
|
|
56
|
+
x: "2",
|
|
57
|
+
y: "2",
|
|
58
|
+
width: "20",
|
|
59
|
+
height: "20"
|
|
60
|
+
}, _react["default"].createElement("path", {
|
|
61
|
+
fillRule: "evenodd",
|
|
62
|
+
clipRule: "evenodd",
|
|
63
|
+
d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"
|
|
64
|
+
})), _react["default"].createElement("g", {
|
|
65
|
+
mask: "url(#a)"
|
|
66
|
+
}, _react["default"].createElement("path", {
|
|
67
|
+
fillRule: "evenodd",
|
|
68
|
+
clipRule: "evenodd",
|
|
69
|
+
d: "M0 0h24v24H0V0z"
|
|
70
|
+
})));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
ClearIcon.defaultProps = {
|
|
74
|
+
width: "24",
|
|
75
|
+
height: "24",
|
|
76
|
+
viewBox: "0 0 24 24",
|
|
77
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var theme = function theme(props) {
|
|
81
|
+
return {
|
|
82
|
+
container: (0, _classnames["default"])('text-input', {
|
|
83
|
+
'text-input-small': props.isSmall
|
|
84
|
+
}),
|
|
85
|
+
input: (0, _classnames["default"])('text-input__inner text-input__input', {
|
|
86
|
+
'text-input__inner--has-icon': props.hasIcon
|
|
87
|
+
}),
|
|
88
|
+
suggestionsContainer: 'autosuggest',
|
|
89
|
+
suggestionsContainerOpen: 'autosuggest--show-suggestions',
|
|
90
|
+
suggestionsList: 'autosuggest__list',
|
|
91
|
+
suggestion: 'autosuggest__list-item'
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
var Autosuggest =
|
|
96
|
+
/*#__PURE__*/
|
|
97
|
+
function (_Component) {
|
|
98
|
+
(0, _inherits2["default"])(Autosuggest, _Component);
|
|
99
|
+
|
|
100
|
+
function Autosuggest(props) {
|
|
101
|
+
var _this;
|
|
102
|
+
|
|
103
|
+
(0, _classCallCheck2["default"])(this, Autosuggest);
|
|
104
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Autosuggest).call(this, props));
|
|
105
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "debouncedResize", (0, _debounce["default"])(function () {
|
|
106
|
+
return _this.handleWindowResize();
|
|
107
|
+
}, 500));
|
|
108
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "componentDidMount", function () {
|
|
109
|
+
_this.getContainerPlacement();
|
|
110
|
+
|
|
111
|
+
if (typeof window !== 'undefined') {
|
|
112
|
+
window.addEventListener('resize', _this.debouncedResize, false);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "componentWillUnmount", function () {
|
|
116
|
+
if (typeof window !== 'undefined') {
|
|
117
|
+
window.removeEventListener('resize', _this.debouncedResize, false);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getContainerPlacement", function () {
|
|
121
|
+
var input = _this.autosuggestRef && _this.autosuggestRef.current && _this.autosuggestRef.current.input;
|
|
122
|
+
|
|
123
|
+
if (typeof document === 'undefined') {
|
|
124
|
+
return;
|
|
125
|
+
} // For scrollX and scrollY cross-browser compatibility
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
var docEl = document.scrollingElement || document.documentElement;
|
|
129
|
+
var scrollX = (typeof docEl.scrollLeft === 'number' ? docEl : document.body).scrollLeft;
|
|
130
|
+
var scrollY = (typeof docEl.scrollTop === 'number' ? docEl : document.body).scrollTop;
|
|
131
|
+
|
|
132
|
+
if (!input) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var inputPosition = input.getBoundingClientRect();
|
|
137
|
+
|
|
138
|
+
_this.setState({
|
|
139
|
+
containerPlacement: {
|
|
140
|
+
top: inputPosition.y + inputPosition.height + scrollY,
|
|
141
|
+
left: inputPosition.x + scrollX,
|
|
142
|
+
width: inputPosition.width
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleWindowResize", function () {
|
|
147
|
+
_this.getContainerPlacement();
|
|
148
|
+
});
|
|
149
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChange", function (event, _ref) {
|
|
150
|
+
var newValue = _ref.newValue;
|
|
151
|
+
|
|
152
|
+
_this.setState({
|
|
153
|
+
value: newValue
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onBlur", function () {
|
|
157
|
+
_this.setState(function (prevState) {
|
|
158
|
+
return {
|
|
159
|
+
showClearButton: prevState.value && prevState.value.length > 0 ? true : false
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSuggestionsFetchRequested",
|
|
164
|
+
/*#__PURE__*/
|
|
165
|
+
function () {
|
|
166
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(
|
|
167
|
+
/*#__PURE__*/
|
|
168
|
+
_regenerator["default"].mark(function _callee(_ref2) {
|
|
169
|
+
var value, getSuggestions, suggestions;
|
|
170
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
171
|
+
while (1) {
|
|
172
|
+
switch (_context.prev = _context.next) {
|
|
173
|
+
case 0:
|
|
174
|
+
value = _ref2.value;
|
|
175
|
+
// Do some stuff to get suggestions
|
|
176
|
+
// May be async/passed by parent
|
|
177
|
+
getSuggestions = _this.props.getSuggestions;
|
|
178
|
+
_context.next = 4;
|
|
179
|
+
return getSuggestions(value);
|
|
180
|
+
|
|
181
|
+
case 4:
|
|
182
|
+
suggestions = _context.sent;
|
|
183
|
+
_context.next = 7;
|
|
184
|
+
return _this.setState({
|
|
185
|
+
suggestions: suggestions || []
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
case 7:
|
|
189
|
+
_this.getContainerPlacement();
|
|
190
|
+
|
|
191
|
+
_this.scrollParentIfNeeded();
|
|
192
|
+
|
|
193
|
+
case 9:
|
|
194
|
+
case "end":
|
|
195
|
+
return _context.stop();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}, _callee);
|
|
199
|
+
}));
|
|
200
|
+
|
|
201
|
+
return function (_x) {
|
|
202
|
+
return _ref3.apply(this, arguments);
|
|
203
|
+
};
|
|
204
|
+
}());
|
|
205
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSuggestionsClearRequested", function () {
|
|
206
|
+
var defaultSuggestions = _this.props.defaultSuggestions;
|
|
207
|
+
|
|
208
|
+
_this.setState({
|
|
209
|
+
suggestions: defaultSuggestions
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "scrollParentIfNeeded", function () {
|
|
213
|
+
var autosuggestRef = _this.autosuggestRef && _this.autosuggestRef.current;
|
|
214
|
+
var suggestionsContainer = autosuggestRef && autosuggestRef.suggestionsContainer;
|
|
215
|
+
var autosuggestInput = autosuggestRef && autosuggestRef.autowhatever && autosuggestRef.autowhatever.input;
|
|
216
|
+
|
|
217
|
+
if (suggestionsContainer && autosuggestInput && _this.domNodeRef && _this.domNodeRef.current) {
|
|
218
|
+
var overflowParent = _this.findOverflowParent(_this.domNodeRef.current) || document.body;
|
|
219
|
+
var overflowBox = overflowParent.getBoundingClientRect();
|
|
220
|
+
var overflowBoxBottom = overflowBox.top + overflowBox.height;
|
|
221
|
+
var suggestionsBox = suggestionsContainer.getBoundingClientRect();
|
|
222
|
+
var suggestionsBottom = suggestionsBox.top + suggestionsBox.height;
|
|
223
|
+
var isSmoothScrollSupported = 'scrollBehavior' in document.documentElement.style;
|
|
224
|
+
|
|
225
|
+
if (suggestionsBottom > overflowBoxBottom) {
|
|
226
|
+
var inputTop = autosuggestInput.getBoundingClientRect().top;
|
|
227
|
+
var scrollNode = overflowParent === document.body ? window : overflowParent;
|
|
228
|
+
|
|
229
|
+
if (isSmoothScrollSupported) {
|
|
230
|
+
scrollNode.scrollTo({
|
|
231
|
+
top: inputTop,
|
|
232
|
+
behavior: 'smooth'
|
|
233
|
+
});
|
|
234
|
+
} else {
|
|
235
|
+
scrollNode.scrollTo(0, inputTop);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "findOverflowParent", function (node) {
|
|
241
|
+
if (node == null || typeof node === 'undefined' || node.nodeType !== 1) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
var computedStyle = window.getComputedStyle(node);
|
|
246
|
+
|
|
247
|
+
if (computedStyle.overflow !== 'visible') {
|
|
248
|
+
return node;
|
|
249
|
+
} else {
|
|
250
|
+
return _this.findOverflowParent(node.parentNode);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClearInput", function () {
|
|
254
|
+
_this.setState({
|
|
255
|
+
value: '',
|
|
256
|
+
showClearButton: false
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
_this.domNodeRef = _react["default"].createRef();
|
|
260
|
+
_this.autosuggestRef = _react["default"].createRef();
|
|
261
|
+
_this.state = {
|
|
262
|
+
value: props.defaultValue || '',
|
|
263
|
+
suggestions: _this.props.defaultSuggestions || [],
|
|
264
|
+
showClearButton: false,
|
|
265
|
+
containerPlacement: {
|
|
266
|
+
top: 0,
|
|
267
|
+
left: 0,
|
|
268
|
+
width: 0
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
return _this;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
(0, _createClass2["default"])(Autosuggest, [{
|
|
275
|
+
key: "render",
|
|
276
|
+
value: function render() {
|
|
277
|
+
var _this$state = this.state,
|
|
278
|
+
value = _this$state.value,
|
|
279
|
+
suggestions = _this$state.suggestions,
|
|
280
|
+
showClearButton = _this$state.showClearButton,
|
|
281
|
+
containerPlacement = _this$state.containerPlacement;
|
|
282
|
+
var _this$props = this.props,
|
|
283
|
+
getSuggestionValue = _this$props.getSuggestionValue,
|
|
284
|
+
renderSuggestion = _this$props.renderSuggestion,
|
|
285
|
+
onSuggestionSelected = _this$props.onSuggestionSelected,
|
|
286
|
+
placeholder = _this$props.placeholder,
|
|
287
|
+
label = _this$props.label,
|
|
288
|
+
error = _this$props.error,
|
|
289
|
+
helper = _this$props.helper,
|
|
290
|
+
isSmall = _this$props.isSmall,
|
|
291
|
+
id = _this$props.id,
|
|
292
|
+
postLabel = _this$props.postLabel,
|
|
293
|
+
wrapperClassName = _this$props.wrapperClassName,
|
|
294
|
+
_this$props$inputProp = _this$props.inputProps,
|
|
295
|
+
originalInputProps = _this$props$inputProp === void 0 ? {} : _this$props$inputProp,
|
|
296
|
+
className = _this$props.className,
|
|
297
|
+
disabled = _this$props.disabled,
|
|
298
|
+
icon = _this$props.icon,
|
|
299
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props, ["getSuggestionValue", "renderSuggestion", "onSuggestionSelected", "placeholder", "label", "error", "helper", "isSmall", "id", "postLabel", "wrapperClassName", "inputProps", "className", "disabled", "icon"]);
|
|
300
|
+
var inputProps = (0, _objectSpread2["default"])({}, originalInputProps, {
|
|
301
|
+
placeholder: originalInputProps.placeholder || placeholder || '',
|
|
302
|
+
value: originalInputProps.value || value,
|
|
303
|
+
onChange: originalInputProps.onChange || this.onChange,
|
|
304
|
+
onBlur: originalInputProps.onBlur || this.onBlur,
|
|
305
|
+
disabled: disabled
|
|
306
|
+
});
|
|
307
|
+
var parentClass = (0, _classnames["default"])('text-input', {
|
|
308
|
+
className: className,
|
|
309
|
+
'text-input--has-error': error
|
|
310
|
+
});
|
|
311
|
+
return _react["default"].createElement("div", {
|
|
312
|
+
className: parentClass,
|
|
313
|
+
ref: this.domNodeRef
|
|
314
|
+
}, label && _react["default"].createElement(_FormPartials.InputPre, {
|
|
315
|
+
label: label,
|
|
316
|
+
id: id,
|
|
317
|
+
postLabel: postLabel
|
|
318
|
+
}), _react["default"].createElement("div", {
|
|
319
|
+
className: (0, _classnames["default"])('autosuggest__wrapper', wrapperClassName)
|
|
320
|
+
}, _react["default"].createElement(_reactAutosuggest["default"], (0, _extends2["default"])({
|
|
321
|
+
ref: this.autosuggestRef,
|
|
322
|
+
suggestions: suggestions,
|
|
323
|
+
onSuggestionsFetchRequested: this.onSuggestionsFetchRequested,
|
|
324
|
+
onSuggestionsClearRequested: this.onSuggestionsClearRequested,
|
|
325
|
+
getSuggestionValue: getSuggestionValue,
|
|
326
|
+
renderSuggestion: renderSuggestion,
|
|
327
|
+
renderSuggestionsContainer: function renderSuggestionsContainer(_ref4) {
|
|
328
|
+
var containerProps = _ref4.containerProps,
|
|
329
|
+
children = _ref4.children;
|
|
330
|
+
|
|
331
|
+
if (typeof document === 'undefined') {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return (0, _reactDom.createPortal)(_react["default"].createElement("div", (0, _extends2["default"])({
|
|
336
|
+
style: {
|
|
337
|
+
top: "".concat(containerPlacement.top + 8, "px"),
|
|
338
|
+
left: "".concat(containerPlacement.left, "px"),
|
|
339
|
+
width: "".concat(containerPlacement.width, "px")
|
|
340
|
+
}
|
|
341
|
+
}, containerProps), children), document.body);
|
|
342
|
+
},
|
|
343
|
+
onSuggestionSelected: onSuggestionSelected,
|
|
344
|
+
inputProps: inputProps,
|
|
345
|
+
theme: theme({
|
|
346
|
+
isSmall: isSmall,
|
|
347
|
+
hasIcon: icon ? true : false
|
|
348
|
+
})
|
|
349
|
+
}, rest)), showClearButton && _react["default"].createElement(_Button["default"], {
|
|
350
|
+
isSmall: true,
|
|
351
|
+
className: "text-input__clear-btn",
|
|
352
|
+
icon: {
|
|
353
|
+
customIcon: ClearIcon,
|
|
354
|
+
name: 'clear_icon'
|
|
355
|
+
},
|
|
356
|
+
onClick: this.handleClearInput
|
|
357
|
+
}), icon && _react["default"].createElement(_Icon["default"], (0, _extends2["default"])({}, icon, {
|
|
358
|
+
className: "text-input__icon-pre"
|
|
359
|
+
}))), (helper || error) && _react["default"].createElement(_FormPartials.InputHelper, {
|
|
360
|
+
helper: helper,
|
|
361
|
+
error: error
|
|
362
|
+
}));
|
|
363
|
+
}
|
|
364
|
+
}]);
|
|
365
|
+
return Autosuggest;
|
|
366
|
+
}(_react.Component);
|
|
367
|
+
|
|
368
|
+
exports["default"] = Autosuggest;
|
|
369
|
+
(0, _defineProperty2["default"])(Autosuggest, "defaultProps", {
|
|
370
|
+
defaultSuggestions: []
|
|
371
|
+
});
|
|
372
|
+
//# sourceMappingURL=Autosuggest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Forms/components/Autosuggest/Autosuggest.tsx"],"names":["ClearIcon","theme","props","container","isSmall","input","hasIcon","suggestionsContainer","suggestionsContainerOpen","suggestionsList","suggestion","Autosuggest","handleWindowResize","getContainerPlacement","window","addEventListener","debouncedResize","removeEventListener","autosuggestRef","current","document","docEl","scrollingElement","documentElement","scrollX","scrollLeft","body","scrollY","scrollTop","inputPosition","getBoundingClientRect","setState","containerPlacement","top","y","height","left","x","width","event","newValue","value","prevState","showClearButton","length","getSuggestions","suggestions","scrollParentIfNeeded","defaultSuggestions","autosuggestInput","autowhatever","domNodeRef","overflowParent","findOverflowParent","overflowBox","overflowBoxBottom","suggestionsBox","suggestionsBottom","isSmoothScrollSupported","style","inputTop","scrollNode","scrollTo","behavior","node","nodeType","computedStyle","getComputedStyle","overflow","parentNode","React","createRef","state","defaultValue","getSuggestionValue","renderSuggestion","onSuggestionSelected","placeholder","label","error","helper","id","postLabel","wrapperClassName","inputProps","originalInputProps","className","disabled","icon","rest","onChange","onBlur","parentClass","onSuggestionsFetchRequested","onSuggestionsClearRequested","containerProps","children","customIcon","name","handleClearInput","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;IACOA,S,YAAAA,S;;;;;;;;;;;;;;;;;;;;;AAAAA,S;;;;;;;AA0EP,IAAMC,KAAK,GAAG,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xB,OAFE;AAGNE,cAAAA,KAAK,YAAKN,kBAAkB,CAACM,KAAxB;AAHC;AADR,aAMKyD,cANL,GAQEC,QARF,CADM,EAWN5E,QAAQ,CAACM,IAXH,CAAP;AAaA,SAzBF;AA0BC,QAAA,oBAAoB,EAAEkD,oBA1BvB;AA2BC,QAAA,UAAU,EAAEQ,UA3Bb;AA4BC,QAAA,KAAK,EAAEnF,KAAK,CAAC;AAAEG,UAAAA,OAAO,EAAPA,OAAF;AAAWE,UAAAA,OAAO,EAAEkF,IAAI,GAAG,IAAH,GAAU;AAAlC,SAAD;AA5Bb,SA6BKC,IA7BL,EADD,EAgCE9C,eAAe,IACf,gCAAC,kBAAD;AACC,QAAA,OAAO,MADR;AAEC,QAAA,SAAS,EAAC,uBAFX;AAGC,QAAA,IAAI,EAAE;AACLsD,UAAAA,UAAU,EAAEjG,SADP;AAELkG,UAAAA,IAAI,EAAE;AAFD,SAHP;AAOC,QAAA,OAAO,EAAE,KAAKC;AAPf,QAjCF,EA2CEX,IAAI,IAAI,gCAAC,gBAAD,gCAAUA,IAAV;AAAgB,QAAA,SAAS,EAAC;AAA1B,SA3CV,CAFD,EA+CE,CAACR,MAAM,IAAID,KAAX,KAAqB,gCAAC,yBAAD;AAAa,QAAA,MAAM,EAAEC,MAArB;AAA6B,QAAA,KAAK,EAAED;AAApC,QA/CvB,CADD;AAmDA;;;EAxIuCqB,gB;;;iCAApBzF,W,kBAIU;AAC7BqC,EAAAA,kBAAkB,EAAE;AADS,C","sourcesContent":["import React, { Component } from 'react'\nimport { createPortal } from 'react-dom'\nimport debounce from 'lodash/debounce'\nimport { default as ReactAutosuggest } from 'react-autosuggest'\nimport cx from 'classnames'\nimport Button from '../../../Button/Button'\nimport Icon, { IIconProps } from '../../../Icon/Icon'\nimport { InputPre, InputHelper } from '../../FormPartials'\nimport ClearIcon from '../../../../../static/assets/icons/ic_cancel.svg'\n\nexport interface IAutosuggestInterfaceProps {\n\t/** Unique identifier */\n\tid: string\n\n\t/** Teach Autosuggest how to calculate suggestions for any given input value. */\n\tgetSuggestions: (value: string) => Promise<Record<string, any>[]> | null\n\n\t/** Implement it to teach Autosuggest what should be the input value when suggestion is clicked. */\n\tgetSuggestionValue: Function\n\n\t/** Defines how suggestions will be rendered */\n\trenderSuggestion: Function\n\n\t/** Will be called every time suggestion is selected via mouse or keyboard. */\n\tonSuggestionSelected: Function\n\n\t/** Supply default suggestions that can be shown without input */\n\tdefaultSuggestions?: any[]\n\n\t/** Placeholder for the input */\n\tplaceholder?: string\n\n\t/** optionally pass a default value for this input */\n\tdefaultValue?: string\n\n\t/** optional label */\n\tlabel?: string\n\n\t/** Text after label */\n\tpostLabel?: string | React.ReactNode\n\n\t/** Error text */\n\terror?: string\n\n\t/** Helper text */\n\thelper?: string | React.ReactNode\n\n\t/** Set true to make the input less tall */\n\tisSmall?: boolean\n\n\t/** Adds a class to the Autosuggest's wrapper */\n\twrapperClassName?: string\n\n\t/** passed through to react autosuggest */\n\tinputProps?: Record<string, any>\n\n\t/** optional class name for wrapper */\n\tclassName?: string\n\n\t/** disable this input */\n\tdisabled?: boolean\n\n\t/** Optional; adds an icon to the beginning of the text input */\n\ticon?: IIconProps\n}\n\ninterface IAutosuggestInterfaceState {\n\tvalue: string\n\tsuggestions?: any[]\n\tshowClearButton: boolean\n\tcontainerPlacement: {\n\t\ttop: number\n\t\tleft: number\n\t\twidth: number\n\t}\n}\n\ninterface IThemeProps {\n\tisSmall?: boolean\n\thasIcon?: boolean\n}\n\nconst theme = (props: IThemeProps): any => ({\n\tcontainer: cx('text-input', {\n\t\t'text-input-small': props.isSmall\n\t}),\n\tinput: cx('text-input__inner text-input__input', {\n\t\t'text-input__inner--has-icon': props.hasIcon\n\t}),\n\tsuggestionsContainer: 'autosuggest',\n\tsuggestionsContainerOpen: 'autosuggest--show-suggestions',\n\tsuggestionsList: 'autosuggest__list',\n\tsuggestion: 'autosuggest__list-item'\n})\n\nexport default class Autosuggest extends Component<\n\tIAutosuggestInterfaceProps,\n\tIAutosuggestInterfaceState\n> {\n\tprivate static defaultProps = {\n\t\tdefaultSuggestions: []\n\t}\n\n\tprivate domNodeRef: React.RefObject<HTMLDivElement>\n\tprivate autosuggestRef: React.RefObject<ReactAutosuggest>\n\n\tprivate debouncedResize = debounce(() => this.handleWindowResize(), 500)\n\n\tpublic constructor(props: IAutosuggestInterfaceProps) {\n\t\tsuper(props)\n\n\t\tthis.domNodeRef = React.createRef()\n\t\tthis.autosuggestRef = React.createRef()\n\n\t\tthis.state = {\n\t\t\tvalue: props.defaultValue || '',\n\t\t\tsuggestions: this.props.defaultSuggestions || [],\n\t\t\tshowClearButton: false,\n\t\t\tcontainerPlacement: {\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\twidth: 0\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic componentDidMount = () => {\n\t\tthis.getContainerPlacement()\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.addEventListener('resize', this.debouncedResize, false)\n\t\t}\n\t}\n\n\tpublic componentWillUnmount = () => {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('resize', this.debouncedResize, false)\n\t\t}\n\t}\n\n\tpublic render(): React.ReactElement {\n\t\tconst {\n\t\t\tvalue,\n\t\t\tsuggestions,\n\t\t\tshowClearButton,\n\t\t\tcontainerPlacement\n\t\t} = this.state\n\n\t\tconst {\n\t\t\tgetSuggestionValue,\n\t\t\trenderSuggestion,\n\t\t\tonSuggestionSelected,\n\t\t\tplaceholder,\n\t\t\tlabel,\n\t\t\terror,\n\t\t\thelper,\n\t\t\tisSmall,\n\t\t\tid,\n\t\t\tpostLabel,\n\t\t\twrapperClassName,\n\t\t\tinputProps: originalInputProps = {},\n\t\t\tclassName,\n\t\t\tdisabled,\n\t\t\ticon,\n\t\t\t...rest\n\t\t} = this.props\n\n\t\tconst inputProps = {\n\t\t\t...originalInputProps,\n\t\t\tplaceholder: originalInputProps.placeholder || placeholder || '',\n\t\t\tvalue: originalInputProps.value || value,\n\t\t\tonChange: originalInputProps.onChange || this.onChange,\n\t\t\tonBlur: originalInputProps.onBlur || this.onBlur,\n\t\t\tdisabled\n\t\t}\n\n\t\tconst parentClass = cx('text-input', {\n\t\t\tclassName,\n\t\t\t'text-input--has-error': error\n\t\t})\n\n\t\treturn (\n\t\t\t<div className={parentClass} ref={this.domNodeRef}>\n\t\t\t\t{label && <InputPre label={label} id={id} postLabel={postLabel} />}\n\t\t\t\t<div className={cx('autosuggest__wrapper', wrapperClassName)}>\n\t\t\t\t\t<ReactAutosuggest\n\t\t\t\t\t\tref={this.autosuggestRef}\n\t\t\t\t\t\tsuggestions={suggestions}\n\t\t\t\t\t\tonSuggestionsFetchRequested={this.onSuggestionsFetchRequested}\n\t\t\t\t\t\tonSuggestionsClearRequested={this.onSuggestionsClearRequested}\n\t\t\t\t\t\tgetSuggestionValue={getSuggestionValue}\n\t\t\t\t\t\trenderSuggestion={renderSuggestion}\n\t\t\t\t\t\trenderSuggestionsContainer={({ containerProps, children }) => {\n\t\t\t\t\t\t\tif (typeof document === 'undefined') {\n\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn createPortal(\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\ttop: `${containerPlacement.top + 8}px`,\n\t\t\t\t\t\t\t\t\t\tleft: `${containerPlacement.left}px`,\n\t\t\t\t\t\t\t\t\t\twidth: `${containerPlacement.width}px`\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t{...containerProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t</div>,\n\t\t\t\t\t\t\t\tdocument.body\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonSuggestionSelected={onSuggestionSelected}\n\t\t\t\t\t\tinputProps={inputProps}\n\t\t\t\t\t\ttheme={theme({ isSmall, hasIcon: icon ? true : false })}\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t/>\n\t\t\t\t\t{showClearButton && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tclassName=\"text-input__clear-btn\"\n\t\t\t\t\t\t\ticon={{\n\t\t\t\t\t\t\t\tcustomIcon: ClearIcon,\n\t\t\t\t\t\t\t\tname: 'clear_icon'\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonClick={this.handleClearInput}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{icon && <Icon {...icon} className=\"text-input__icon-pre\" />}\n\t\t\t\t</div>\n\t\t\t\t{(helper || error) && <InputHelper helper={helper} error={error} />}\n\t\t\t</div>\n\t\t)\n\t}\n\n\tprivate getContainerPlacement = () => {\n\t\tconst input =\n\t\t\tthis.autosuggestRef &&\n\t\t\tthis.autosuggestRef.current &&\n\t\t\tthis.autosuggestRef.current.input\n\n\t\tif (typeof document === 'undefined') {\n\t\t\treturn\n\t\t}\n\n\t\t// For scrollX and scrollY cross-browser compatibility\n\t\tconst docEl = document.scrollingElement || document.documentElement\n\n\t\tconst scrollX = (typeof docEl.scrollLeft === 'number'\n\t\t\t? docEl\n\t\t\t: document.body\n\t\t).scrollLeft\n\n\t\tconst scrollY = (typeof docEl.scrollTop === 'number'\n\t\t\t? docEl\n\t\t\t: document.body\n\t\t).scrollTop\n\n\t\tif (!input) {\n\t\t\treturn\n\t\t}\n\n\t\tconst inputPosition = input.getBoundingClientRect()\n\n\t\tthis.setState({\n\t\t\tcontainerPlacement: {\n\t\t\t\ttop: inputPosition.y + inputPosition.height + scrollY,\n\t\t\t\tleft: inputPosition.x + scrollX,\n\t\t\t\twidth: inputPosition.width\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate handleWindowResize = () => {\n\t\tthis.getContainerPlacement()\n\t}\n\n\tprivate onChange = (event: any, { newValue }: any) => {\n\t\tthis.setState({\n\t\t\tvalue: newValue\n\t\t})\n\t}\n\n\tprivate onBlur = () => {\n\t\tthis.setState(prevState => ({\n\t\t\tshowClearButton:\n\t\t\t\tprevState.value && prevState.value.length > 0 ? true : false\n\t\t}))\n\t}\n\n\tprivate onSuggestionsFetchRequested = async ({ value }: any) => {\n\t\t// Do some stuff to get suggestions\n\t\t// May be async/passed by parent\n\t\tconst { getSuggestions } = this.props\n\t\tconst suggestions = await getSuggestions(value)\n\t\tawait this.setState({\n\t\t\tsuggestions: suggestions || []\n\t\t})\n\n\t\tthis.getContainerPlacement()\n\t\tthis.scrollParentIfNeeded()\n\t}\n\n\tprivate onSuggestionsClearRequested = () => {\n\t\tconst { defaultSuggestions } = this.props\n\t\tthis.setState({\n\t\t\tsuggestions: defaultSuggestions\n\t\t})\n\t}\n\n\tprivate scrollParentIfNeeded = () => {\n\t\tconst autosuggestRef = this.autosuggestRef && this.autosuggestRef.current\n\t\tconst suggestionsContainer =\n\t\t\tautosuggestRef && autosuggestRef.suggestionsContainer\n\n\t\tconst autosuggestInput =\n\t\t\tautosuggestRef &&\n\t\t\tautosuggestRef.autowhatever &&\n\t\t\tautosuggestRef.autowhatever.input\n\n\t\tif (\n\t\t\tsuggestionsContainer &&\n\t\t\tautosuggestInput &&\n\t\t\tthis.domNodeRef &&\n\t\t\tthis.domNodeRef.current\n\t\t) {\n\t\t\tconst overflowParent =\n\t\t\t\tthis.findOverflowParent(this.domNodeRef.current) || document.body\n\t\t\tconst overflowBox = overflowParent.getBoundingClientRect()\n\t\t\tconst overflowBoxBottom = overflowBox.top + overflowBox.height\n\t\t\tconst suggestionsBox = suggestionsContainer.getBoundingClientRect()\n\t\t\tconst suggestionsBottom = suggestionsBox.top + suggestionsBox.height\n\n\t\t\tconst isSmoothScrollSupported =\n\t\t\t\t'scrollBehavior' in document.documentElement.style\n\n\t\t\tif (suggestionsBottom > overflowBoxBottom) {\n\t\t\t\tconst inputTop = autosuggestInput.getBoundingClientRect().top\n\t\t\t\tconst scrollNode =\n\t\t\t\t\toverflowParent === document.body ? window : overflowParent\n\t\t\t\tif (isSmoothScrollSupported) {\n\t\t\t\t\tscrollNode.scrollTo({\n\t\t\t\t\t\ttop: inputTop,\n\t\t\t\t\t\tbehavior: 'smooth'\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tscrollNode.scrollTo(0, inputTop)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate findOverflowParent = node => {\n\t\tif (node == null || typeof node === 'undefined' || node.nodeType !== 1) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst computedStyle = window.getComputedStyle(node)\n\n\t\tif (computedStyle.overflow !== 'visible') {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn this.findOverflowParent(node.parentNode)\n\t\t}\n\t}\n\n\tprivate handleClearInput = () => {\n\t\tthis.setState({\n\t\t\tvalue: '',\n\t\t\tshowClearButton: false\n\t\t})\n\t}\n}\n"],"file":"Autosuggest.js"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IHWAction, IHWCheckbox } from '@sprucelabs/spruce-types';
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
export interface ICheckboxProps extends Omit<IHWCheckbox, 'isIndeterminate'> {
|
|
4
|
+
/** Class for the checkbox wrapper */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** triggered on change */
|
|
7
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
/** Is this 3 states, on, off, or half */
|
|
9
|
+
isIndeterminate?: boolean;
|
|
10
|
+
/** optional, provide a handler for Actions */
|
|
11
|
+
onAction?: (action: IHWAction) => any;
|
|
12
|
+
}
|
|
13
|
+
interface ICheckboxState {
|
|
14
|
+
}
|
|
15
|
+
export default class Checkbox extends Component<ICheckboxProps, ICheckboxState> {
|
|
16
|
+
private checkboxRef;
|
|
17
|
+
constructor(props: ICheckboxProps);
|
|
18
|
+
componentDidMount: () => void;
|
|
19
|
+
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
|
+
render(): React.ReactElement;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/Forms/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,EAAE,EAAe,SAAS,EAAE,MAAM,OAAO,CAAA;AAKrD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAC3E,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAE3D,yCAAyC;IACzC,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,GAAG,CAAA;CACrC;AAED,UAAU,cAAc;CAAG;AAE3B,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,SAAS,CAC9C,cAAc,EACd,cAAc,CACd;IACA,OAAO,CAAC,WAAW,CAAmC;gBAEnC,KAAK,EAAE,cAAc;IAKjC,iBAAiB,aAIvB;IAEM,YAAY,mDAUlB;IAEM,MAAM,IAAI,KAAK,CAAC,YAAY;CAgDnC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
17
|
+
|
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
|
+
|
|
20
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
21
|
+
|
|
22
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
+
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
26
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
27
|
+
|
|
28
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
29
|
+
|
|
30
|
+
var CheckIconYes = function CheckIconYes(props) {
|
|
31
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
32
|
+
fillRule: "evenodd",
|
|
33
|
+
clipRule: "evenodd",
|
|
34
|
+
d: "M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
CheckIconYes.defaultProps = {
|
|
39
|
+
width: "24",
|
|
40
|
+
height: "24",
|
|
41
|
+
viewBox: "0 0 24 24",
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var CheckIconNo = function CheckIconNo(props) {
|
|
46
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
47
|
+
fillRule: "evenodd",
|
|
48
|
+
clipRule: "evenodd",
|
|
49
|
+
d: "M19 5v14H5V5h14zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
|
50
|
+
}));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
CheckIconNo.defaultProps = {
|
|
54
|
+
width: "24",
|
|
55
|
+
height: "24",
|
|
56
|
+
viewBox: "0 0 24 24",
|
|
57
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var CheckIconMaybe = function CheckIconMaybe(props) {
|
|
61
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
62
|
+
fillRule: "evenodd",
|
|
63
|
+
clipRule: "evenodd",
|
|
64
|
+
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
|
|
65
|
+
}));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
CheckIconMaybe.defaultProps = {
|
|
69
|
+
width: "24",
|
|
70
|
+
height: "24",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var Checkbox =
|
|
76
|
+
/*#__PURE__*/
|
|
77
|
+
function (_Component) {
|
|
78
|
+
(0, _inherits2["default"])(Checkbox, _Component);
|
|
79
|
+
|
|
80
|
+
function Checkbox(props) {
|
|
81
|
+
var _this;
|
|
82
|
+
|
|
83
|
+
(0, _classCallCheck2["default"])(this, Checkbox);
|
|
84
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Checkbox).call(this, props));
|
|
85
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "componentDidMount", function () {
|
|
86
|
+
if (_this.checkboxRef.current) {
|
|
87
|
+
_this.checkboxRef.current.indeterminate = !!_this.props.isIndeterminate;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleChange", function (e) {
|
|
91
|
+
var onChange = _this.props.onChange;
|
|
92
|
+
|
|
93
|
+
if (_this.checkboxRef.current) {
|
|
94
|
+
_this.checkboxRef.current.indeterminate = false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (onChange) {
|
|
98
|
+
onChange(e);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
_this.checkboxRef = _react["default"].createRef();
|
|
102
|
+
return _this;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
(0, _createClass2["default"])(Checkbox, [{
|
|
106
|
+
key: "render",
|
|
107
|
+
value: function render() {
|
|
108
|
+
var _this2 = this;
|
|
109
|
+
|
|
110
|
+
var _this$props = this.props,
|
|
111
|
+
action = _this$props.action,
|
|
112
|
+
className = _this$props.className,
|
|
113
|
+
id = _this$props.id,
|
|
114
|
+
isChecked = _this$props.isChecked,
|
|
115
|
+
isDisabled = _this$props.isDisabled,
|
|
116
|
+
label = _this$props.label,
|
|
117
|
+
name = _this$props.name,
|
|
118
|
+
onAction = _this$props.onAction,
|
|
119
|
+
postText = _this$props.postText;
|
|
120
|
+
var parentClass = (0, _classnames["default"])('checkbox-item', className);
|
|
121
|
+
return _react["default"].createElement("div", {
|
|
122
|
+
className: parentClass
|
|
123
|
+
}, _react["default"].createElement("div", {
|
|
124
|
+
className: "checkbox-item__inner"
|
|
125
|
+
}, _react["default"].createElement("input", {
|
|
126
|
+
checked: isChecked || false,
|
|
127
|
+
name: name || undefined,
|
|
128
|
+
ref: this.checkboxRef,
|
|
129
|
+
autoComplete: 'off',
|
|
130
|
+
className: "checkbox-item__input",
|
|
131
|
+
disabled: isDisabled || false,
|
|
132
|
+
id: id // Always use internal change handler
|
|
133
|
+
,
|
|
134
|
+
onChange: function onChange() {
|
|
135
|
+
_this2.handleChange.apply(_this2, arguments);
|
|
136
|
+
|
|
137
|
+
if (onAction && action) {
|
|
138
|
+
onAction(action);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
type: "checkbox"
|
|
142
|
+
}), _react["default"].createElement("label", {
|
|
143
|
+
className: "checkbox-item__label",
|
|
144
|
+
htmlFor: id
|
|
145
|
+
}, label), _react["default"].createElement("div", {
|
|
146
|
+
className: "checkbox-item__icons"
|
|
147
|
+
}, _react["default"].createElement(CheckIconYes, {
|
|
148
|
+
className: "checkbox-item__icon checkbox-item__icon-yes"
|
|
149
|
+
}), _react["default"].createElement(CheckIconNo, {
|
|
150
|
+
className: "checkbox-item__icon checkbox-item__icon-no"
|
|
151
|
+
}), _react["default"].createElement(CheckIconMaybe, {
|
|
152
|
+
className: "checkbox-item__icon checkbox-item__icon-maybe"
|
|
153
|
+
}))), postText && _react["default"].createElement("p", {
|
|
154
|
+
className: "checkbox-item__post-text"
|
|
155
|
+
}, postText));
|
|
156
|
+
}
|
|
157
|
+
}]);
|
|
158
|
+
return Checkbox;
|
|
159
|
+
}(_react.Component);
|
|
160
|
+
|
|
161
|
+
exports["default"] = Checkbox;
|
|
162
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Forms/components/Checkbox/Checkbox.tsx"],"names":["CheckIconYes","CheckIconNo","CheckIconMaybe","Checkbox","props","checkboxRef","current","indeterminate","isIndeterminate","e","onChange","React","createRef","action","className","id","isChecked","isDisabled","label","name","onAction","postText","parentClass","undefined","handleChange","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;IACOA,Y,YAAAA,Y;;;;;;;;AAAAA,Y;;;;;;;IACAC,W,YAAAA,W;;;;;;;;AAAAA,W;;;;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AAI,EAAEG,IAAI,IAAII,SAFf;AAGC,QAAA,GAAG,EAAE,KAAKlB,WAHX;AAIC,QAAA,YAAY,EAAE,KAJf;AAKC,QAAA,SAAS,EAAC,sBALX;AAMC,QAAA,QAAQ,EAAEY,UAAU,IAAI,KANzB;AAOC,QAAA,EAAE,EAAEF,EAPL,CAQC;AARD;AASC,QAAA,QAAQ,EAAE,oBAAa;AACtB,UAAA,MAAI,CAACS,YAAL,OAAA,MAAI,YAAJ;;AAEA,cAAIJ,QAAQ,IAAIP,MAAhB,EAAwB;AACvBO,YAAAA,QAAQ,CAACP,MAAD,CAAR;AACA;AACD,SAfF;AAgBC,QAAA,IAAI,EAAC;AAhBN,QADD,EAmBC;AAAO,QAAA,SAAS,EAAC,sBAAjB;AAAwC,QAAA,OAAO,EAAEE;AAAjD,SACEG,KADF,CAnBD,EAsBC;AAAK,QAAA,SAAS,EAAC;AAAf,SACC,gCAAC,YAAD;AAAc,QAAA,SAAS,EAAC;AAAxB,QADD,EAEC,gCAAC,WAAD;AAAa,QAAA,SAAS,EAAC;AAAvB,QAFD,EAGC,gCAAC,cAAD;AAAgB,QAAA,SAAS,EAAC;AAA1B,QAHD,CAtBD,CADD,EA6BEG,QAAQ,IAAI;AAAG,QAAA,SAAS,EAAC;AAAb,SAAyCA,QAAzC,CA7Bd,CADD;AAiCA;;;EA5EoCI,gB","sourcesContent":["import { IHWAction, IHWCheckbox } from '@sprucelabs/spruce-types'\nimport cx from 'classnames'\nimport React, { ChangeEvent, Component } from 'react'\nimport CheckIconYes from '../../../../../static/assets/icons/ic_check_box.svg'\nimport CheckIconNo from '../../../../../static/assets/icons/ic_check_box_outline_blank.svg'\nimport CheckIconMaybe from '../../../../../static/assets/icons/ic_indeterminate_check_box.svg'\n\nexport interface ICheckboxProps extends Omit<IHWCheckbox, 'isIndeterminate'> {\n\t/** Class for the checkbox wrapper */\n\tclassName?: string\n\n\t/** triggered on change */\n\tonChange?: (e: React.ChangeEvent<HTMLInputElement>) => void\n\n\t/** Is this 3 states, on, off, or half */\n\tisIndeterminate?: boolean\n\n\t/** optional, provide a handler for Actions */\n\tonAction?: (action: IHWAction) => any\n}\n\ninterface ICheckboxState {}\n\nexport default class Checkbox extends Component<\n\tICheckboxProps,\n\tICheckboxState\n> {\n\tprivate checkboxRef: React.RefObject<HTMLInputElement>\n\n\tpublic constructor(props: ICheckboxProps) {\n\t\tsuper(props)\n\t\tthis.checkboxRef = React.createRef()\n\t}\n\n\tpublic componentDidMount = () => {\n\t\tif (this.checkboxRef.current) {\n\t\t\tthis.checkboxRef.current.indeterminate = !!this.props.isIndeterminate\n\t\t}\n\t}\n\n\tpublic handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n\t\tconst { onChange } = this.props\n\n\t\tif (this.checkboxRef.current) {\n\t\t\tthis.checkboxRef.current.indeterminate = false\n\t\t}\n\n\t\tif (onChange) {\n\t\t\tonChange(e)\n\t\t}\n\t}\n\n\tpublic render(): React.ReactElement {\n\t\tconst {\n\t\t\taction,\n\t\t\tclassName,\n\t\t\tid,\n\t\t\tisChecked,\n\t\t\tisDisabled,\n\t\t\tlabel,\n\t\t\tname,\n\t\t\tonAction,\n\t\t\tpostText\n\t\t} = this.props\n\t\tconst parentClass = cx('checkbox-item', className)\n\n\t\treturn (\n\t\t\t<div className={parentClass}>\n\t\t\t\t<div className=\"checkbox-item__inner\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tchecked={isChecked || false}\n\t\t\t\t\t\tname={name || undefined}\n\t\t\t\t\t\tref={this.checkboxRef}\n\t\t\t\t\t\tautoComplete={'off'}\n\t\t\t\t\t\tclassName=\"checkbox-item__input\"\n\t\t\t\t\t\tdisabled={isDisabled || false}\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t// Always use internal change handler\n\t\t\t\t\t\tonChange={(...args) => {\n\t\t\t\t\t\t\tthis.handleChange(...args)\n\n\t\t\t\t\t\t\tif (onAction && action) {\n\t\t\t\t\t\t\t\tonAction(action)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t/>\n\t\t\t\t\t<label className=\"checkbox-item__label\" htmlFor={id}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</label>\n\t\t\t\t\t<div className=\"checkbox-item__icons\">\n\t\t\t\t\t\t<CheckIconYes className=\"checkbox-item__icon checkbox-item__icon-yes\" />\n\t\t\t\t\t\t<CheckIconNo className=\"checkbox-item__icon checkbox-item__icon-no\" />\n\t\t\t\t\t\t<CheckIconMaybe className=\"checkbox-item__icon checkbox-item__icon-maybe\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{postText && <p className=\"checkbox-item__post-text\">{postText}</p>}\n\t\t\t</div>\n\t\t)\n\t}\n}\n"],"file":"Checkbox.js"}
|