@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,131 @@
|
|
|
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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));
|
|
13
|
+
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
16
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
+
|
|
18
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
+
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
+
|
|
22
|
+
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
+
|
|
24
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
25
|
+
|
|
26
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
27
|
+
|
|
28
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
+
|
|
30
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
31
|
+
|
|
32
|
+
var _velocityReact = require("velocity-react");
|
|
33
|
+
|
|
34
|
+
var _uniqBy = _interopRequireDefault(require("lodash/uniqBy"));
|
|
35
|
+
|
|
36
|
+
var _Toast = _interopRequireDefault(require("../../Toast"));
|
|
37
|
+
|
|
38
|
+
var defaultTimeout = 3000;
|
|
39
|
+
|
|
40
|
+
var ToastWrapper =
|
|
41
|
+
/*#__PURE__*/
|
|
42
|
+
function (_Component) {
|
|
43
|
+
(0, _inherits2["default"])(ToastWrapper, _Component);
|
|
44
|
+
|
|
45
|
+
function ToastWrapper() {
|
|
46
|
+
var _getPrototypeOf2;
|
|
47
|
+
|
|
48
|
+
var _this;
|
|
49
|
+
|
|
50
|
+
(0, _classCallCheck2["default"])(this, ToastWrapper);
|
|
51
|
+
|
|
52
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
53
|
+
args[_key] = arguments[_key];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(ToastWrapper)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
57
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
58
|
+
toasts: [],
|
|
59
|
+
timeouts: {}
|
|
60
|
+
});
|
|
61
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "timeouts", {});
|
|
62
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRemoveClick", function (id) {
|
|
63
|
+
var timeouts = _this.state.timeouts;
|
|
64
|
+
var handleRemove = _this.props.handleRemove;
|
|
65
|
+
|
|
66
|
+
if (timeouts[id]) {
|
|
67
|
+
clearTimeout(timeouts[id]);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
handleRemove(id);
|
|
71
|
+
});
|
|
72
|
+
return _this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
(0, _createClass2["default"])(ToastWrapper, [{
|
|
76
|
+
key: "render",
|
|
77
|
+
value: function render() {
|
|
78
|
+
var _this2 = this;
|
|
79
|
+
|
|
80
|
+
var toasts = this.state.toasts;
|
|
81
|
+
return _react["default"].createElement("div", {
|
|
82
|
+
className: "toasts-wrapper"
|
|
83
|
+
}, _react["default"].createElement(_velocityReact.VelocityTransitionGroup, {
|
|
84
|
+
enter: {
|
|
85
|
+
animation: {
|
|
86
|
+
opacity: 1,
|
|
87
|
+
translateX: 0
|
|
88
|
+
},
|
|
89
|
+
duration: 300
|
|
90
|
+
},
|
|
91
|
+
leave: {
|
|
92
|
+
animation: {
|
|
93
|
+
opacity: 0,
|
|
94
|
+
translateX: '-4px'
|
|
95
|
+
},
|
|
96
|
+
duration: 0
|
|
97
|
+
}
|
|
98
|
+
}, toasts.map(function (toast) {
|
|
99
|
+
return _react["default"].createElement("div", {
|
|
100
|
+
key: toast.id,
|
|
101
|
+
className: "toast-wrapper"
|
|
102
|
+
}, _react["default"].createElement(_Toast["default"], (0, _extends2["default"])({
|
|
103
|
+
onRemove: function onRemove() {
|
|
104
|
+
return _this2.onRemoveClick(toast.id);
|
|
105
|
+
}
|
|
106
|
+
}, toast)));
|
|
107
|
+
})));
|
|
108
|
+
}
|
|
109
|
+
}], [{
|
|
110
|
+
key: "getDerivedStateFromProps",
|
|
111
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
112
|
+
var uniqToasts = (0, _uniqBy["default"])(props.toasts, 'id');
|
|
113
|
+
var timeouts = (0, _objectSpread2["default"])({}, state.timeouts);
|
|
114
|
+
uniqToasts.forEach(function (toast) {
|
|
115
|
+
if (toast.timeout !== 'never') {
|
|
116
|
+
timeouts[toast.id] = setTimeout(function () {
|
|
117
|
+
props.handleRemove(toast.id);
|
|
118
|
+
}, typeof toast.timeout === 'number' ? toast.timeout : defaultTimeout);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
toasts: uniqToasts,
|
|
123
|
+
timeouts: timeouts
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}]);
|
|
127
|
+
return ToastWrapper;
|
|
128
|
+
}(_react.Component);
|
|
129
|
+
|
|
130
|
+
exports["default"] = ToastWrapper;
|
|
131
|
+
//# sourceMappingURL=ToastWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Toast/components/ToastWrapper/ToastWrapper.tsx"],"names":["defaultTimeout","ToastWrapper","toasts","timeouts","id","state","handleRemove","props","clearTimeout","animation","opacity","translateX","duration","map","toast","onRemoveClick","uniqToasts","forEach","timeout","setTimeout","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAgBA,IAAMA,cAAc,GAAG,IAAvB;;IAEqBC,Y;;;;;;;;;;;;;;;;;8FAIe;AAClCC,MAAAA,MAAM,EAAE,EAD0B;AAElCC,MAAAA,QAAQ,EAAE;AAFwB,K;iGAKjB,E;sGAqBK,UAACC,EAAD,EAAyB;AAAA,UACvCD,QADuC,GAC1B,MAAKE,KADqB,CACvCF,QADuC;AAAA,UAEvCG,YAFuC,GAEtB,MAAKC,KAFiB,CAEvCD,YAFuC;;AAG/C,UAAIH,QAAQ,CAACC,EAAD,CAAZ,EAAkB;AACjBI,QAAAA,YAAY,CAACL,QAAQ,CAACC,EAAD,CAAT,CAAZ;AACA;;AACDE,MAAAA,YAAY,CAACF,EAAD,CAAZ;AACA,K;;;;;;6BAEmC;AAAA;;AAAA,UAC3BF,MAD2B,GAChB,KAAKG,KADW,CAC3BH,MAD2B;AAGnC,aACC;AAAK,QAAA,SAAS,EAAC;AAAf,SACC,gCAAC,sCAAD;AACC,QAAA,KAAK,EAAE;AACNO,UAAAA,SAAS,EAAE;AACVC,YAAAA,OAAO,EAAE,CADC;AAEVC,YAAAA,UAAU,EAAE;AAFF,WADL;AAKNC,UAAAA,QAAQ,EAAE;AALJ,SADR;AAQC,QAAA,KAAK,EAAE;AACNH,UAAAA,SAAS,EAAE;AACVC,YAAAA,OAAO,EAAE,CADC;AAEVC,YAAAA,UAAU,EAAE;AAFF,WADL;AAKNC,UAAAA,QAAQ,EAAE;AALJ;AARR,SAgBEV,MAAM,CAACW,GAAP,CAAW,UAAAC,KAAK;AAAA,eAChB;AAAK,UAAA,GAAG,EAAEA,KAAK,CAACV,EAAhB;AAAoB,UAAA,SAAS,EAAC;AAA9B,WACC,gCAAC,iBAAD;AAAO,UAAA,QAAQ,EAAE;AAAA,mBAAM,MAAI,CAACW,aAAL,CAAmBD,KAAK,CAACV,EAAzB,CAAN;AAAA;AAAjB,WAAyDU,KAAzD,EADD,CADgB;AAAA,OAAhB,CAhBF,CADD,CADD;AA0BA;;;6CAxDAP,K,EACAF,K,EAC6C;AAC7C,UAAMW,UAAU,GAAG,wBAAOT,KAAK,CAACL,MAAb,EAAqB,IAArB,CAAnB;AACA,UAAMC,QAAQ,sCAAQE,KAAK,CAACF,QAAd,CAAd;AACAa,MAAAA,UAAU,CAACC,OAAX,CAAmB,UAAAH,KAAK,EAAI;AAC3B,YAAIA,KAAK,CAACI,OAAN,KAAkB,OAAtB,EAA+B;AAC9Bf,UAAAA,QAAQ,CAACW,KAAK,CAACV,EAAP,CAAR,GAAqBe,UAAU,CAC9B,YAAM;AACLZ,YAAAA,KAAK,CAACD,YAAN,CAAmBQ,KAAK,CAACV,EAAzB;AACA,WAH6B,EAI9B,OAAOU,KAAK,CAACI,OAAb,KAAyB,QAAzB,GAAoCJ,KAAK,CAACI,OAA1C,GAAoDlB,cAJtB,CAA/B;AAMA;AACD,OATD;AAUA,aAAO;AAAEE,QAAAA,MAAM,EAAEc,UAAV;AAAsBb,QAAAA,QAAQ,EAARA;AAAtB,OAAP;AACA;;;EA5BwCiB,gB","sourcesContent":["import React, { Component } from 'react'\nimport { VelocityTransitionGroup } from 'velocity-react'\nimport uniqBy from 'lodash/uniqBy'\nimport Toast from '../../Toast'\nimport { IToastProps } from '../../Toast'\n\nexport interface IToastWrapperProps {\n\t/** The toasts */\n\ttoasts: IToastProps[]\n\n\t/** Handle toast removal */\n\thandleRemove: Function\n}\n\ninterface IToastWrapperState {\n\ttoasts: IToastProps[]\n\ttimeouts: any\n}\n\nconst defaultTimeout = 3000\n\nexport default class ToastWrapper extends Component<\n\tIToastWrapperProps,\n\tIToastWrapperState\n> {\n\tpublic state: IToastWrapperState = {\n\t\ttoasts: [],\n\t\ttimeouts: {}\n\t}\n\n\tpublic timeouts = {}\n\n\tpublic static getDerivedStateFromProps(\n\t\tprops: IToastWrapperProps,\n\t\tstate: IToastWrapperState\n\t): { toasts: IToastProps[]; timeouts: any[] } {\n\t\tconst uniqToasts = uniqBy(props.toasts, 'id')\n\t\tconst timeouts = { ...state.timeouts }\n\t\tuniqToasts.forEach(toast => {\n\t\t\tif (toast.timeout !== 'never') {\n\t\t\t\ttimeouts[toast.id] = setTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tprops.handleRemove(toast.id)\n\t\t\t\t\t},\n\t\t\t\t\ttypeof toast.timeout === 'number' ? toast.timeout : defaultTimeout\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t\treturn { toasts: uniqToasts, timeouts }\n\t}\n\n\tpublic onRemoveClick = (id: string | number) => {\n\t\tconst { timeouts } = this.state\n\t\tconst { handleRemove } = this.props\n\t\tif (timeouts[id]) {\n\t\t\tclearTimeout(timeouts[id])\n\t\t}\n\t\thandleRemove(id)\n\t}\n\n\tpublic render(): React.ReactElement {\n\t\tconst { toasts } = this.state\n\n\t\treturn (\n\t\t\t<div className=\"toasts-wrapper\">\n\t\t\t\t<VelocityTransitionGroup\n\t\t\t\t\tenter={{\n\t\t\t\t\t\tanimation: {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttranslateX: 0\n\t\t\t\t\t\t},\n\t\t\t\t\t\tduration: 300\n\t\t\t\t\t}}\n\t\t\t\t\tleave={{\n\t\t\t\t\t\tanimation: {\n\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\ttranslateX: '-4px'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tduration: 0\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{toasts.map(toast => (\n\t\t\t\t\t\t<div key={toast.id} className=\"toast-wrapper\">\n\t\t\t\t\t\t\t<Toast onRemove={() => this.onRemoveClick(toast.id)} {...toast} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</VelocityTransitionGroup>\n\t\t\t</div>\n\t\t)\n\t}\n}\n"],"file":"ToastWrapper.js"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
8
|
+
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
|
|
13
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
+
|
|
15
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
|
+
|
|
17
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
18
|
+
|
|
19
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
20
|
+
|
|
21
|
+
var _react2 = require("@storybook/react");
|
|
22
|
+
|
|
23
|
+
var _tableData = require("../../../.storybook/data/tableData");
|
|
24
|
+
|
|
25
|
+
var _lodash = require("lodash");
|
|
26
|
+
|
|
27
|
+
var _react3 = require("@storybook/addon-knobs/react");
|
|
28
|
+
|
|
29
|
+
var _people = require("../../../.storybook/data/people");
|
|
30
|
+
|
|
31
|
+
var _Card = _interopRequireWildcard(require("../Card"));
|
|
32
|
+
|
|
33
|
+
var _TruncatedList = _interopRequireDefault(require("./TruncatedList"));
|
|
34
|
+
|
|
35
|
+
var stories = (0, _react2.storiesOf)('TruncatedList', module); // stories.addDecorator(
|
|
36
|
+
// withKnobsOptions({
|
|
37
|
+
// escapeHTML: false
|
|
38
|
+
// })
|
|
39
|
+
// )
|
|
40
|
+
|
|
41
|
+
stories.addDecorator(_react3.withKnobs);
|
|
42
|
+
|
|
43
|
+
var TruncatedListExample =
|
|
44
|
+
/*#__PURE__*/
|
|
45
|
+
function (_Component) {
|
|
46
|
+
(0, _inherits2["default"])(TruncatedListExample, _Component);
|
|
47
|
+
|
|
48
|
+
function TruncatedListExample(props) {
|
|
49
|
+
var _this;
|
|
50
|
+
|
|
51
|
+
(0, _classCallCheck2["default"])(this, TruncatedListExample);
|
|
52
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TruncatedListExample).call(this, props));
|
|
53
|
+
var selectedIds = props.recordSelectionListItems.map(function (loc) {
|
|
54
|
+
return loc.id;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (props.canSelect === 'one') {
|
|
58
|
+
selectedIds = (0, _lodash.sampleSize)(selectedIds, 1);
|
|
59
|
+
} else {
|
|
60
|
+
selectedIds = (0, _lodash.sampleSize)(selectedIds, Math.floor(selectedIds.length / 2));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var unselectedIds = props.recordSelectionListItems.map(function (loc) {
|
|
64
|
+
return loc.id;
|
|
65
|
+
}).filter(function (locationId) {
|
|
66
|
+
return selectedIds.indexOf(locationId) === -1;
|
|
67
|
+
});
|
|
68
|
+
var unselectableIds = props.canSelect ? (0, _lodash.sampleSize)(unselectedIds, unselectedIds.length / 2) : [];
|
|
69
|
+
_this.state = {
|
|
70
|
+
selectedIds: selectedIds,
|
|
71
|
+
loadedRecordSelectionListItems: (0, _lodash.cloneDeep)(props.recordSelectionListItems),
|
|
72
|
+
unselectableIds: unselectableIds
|
|
73
|
+
};
|
|
74
|
+
return _this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
(0, _createClass2["default"])(TruncatedListExample, [{
|
|
78
|
+
key: "render",
|
|
79
|
+
value: function render() {
|
|
80
|
+
var _this2 = this;
|
|
81
|
+
|
|
82
|
+
var _this$props = this.props,
|
|
83
|
+
header = _this$props.header,
|
|
84
|
+
canSelect = _this$props.canSelect,
|
|
85
|
+
canRemove = _this$props.canRemove,
|
|
86
|
+
noItemsText = _this$props.noItemsText,
|
|
87
|
+
truncatedActionItemType = _this$props.truncatedActionItemType;
|
|
88
|
+
var _this$state = this.state,
|
|
89
|
+
selectedIds = _this$state.selectedIds,
|
|
90
|
+
loadedRecordSelectionListItems = _this$state.loadedRecordSelectionListItems,
|
|
91
|
+
unselectableIds = _this$state.unselectableIds;
|
|
92
|
+
return _react["default"].createElement(_TruncatedList["default"], {
|
|
93
|
+
header: header,
|
|
94
|
+
noItemsText: noItemsText,
|
|
95
|
+
selectedIds: selectedIds,
|
|
96
|
+
unselectableIds: unselectableIds,
|
|
97
|
+
recordSelectionListItems: loadedRecordSelectionListItems.slice(0, 5),
|
|
98
|
+
isTruncated: loadedRecordSelectionListItems.length > 5,
|
|
99
|
+
canSelect: canSelect,
|
|
100
|
+
canRemove: canRemove,
|
|
101
|
+
onSelect: function onSelect(id) {
|
|
102
|
+
// Typically you'd want "many" or "one", so you'd only need one side
|
|
103
|
+
// of this conditional.
|
|
104
|
+
if (canSelect === 'many') {
|
|
105
|
+
if (selectedIds.indexOf(id) >= 0) {
|
|
106
|
+
_this2.setState({
|
|
107
|
+
selectedIds: selectedIds.filter(function (selectedId) {
|
|
108
|
+
return selectedId !== id;
|
|
109
|
+
})
|
|
110
|
+
});
|
|
111
|
+
} else {
|
|
112
|
+
_this2.setState({
|
|
113
|
+
selectedIds: [].concat((0, _toConsumableArray2["default"])(selectedIds), [id])
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
} else if (canSelect === 'one') {
|
|
117
|
+
_this2.setState({
|
|
118
|
+
selectedIds: [id]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
onRemove: function onRemove(id) {
|
|
123
|
+
// The component maintains state of the records it has loaded, but
|
|
124
|
+
// it's up to you to remove them from your list in your local state.
|
|
125
|
+
// Also, if for some reason you want to have selection alongside deletion,
|
|
126
|
+
// you should be sure to clear out the selection at the same time.
|
|
127
|
+
_this2.setState({
|
|
128
|
+
selectedIds: selectedIds.filter(function (selectedId) {
|
|
129
|
+
return selectedId !== id;
|
|
130
|
+
}),
|
|
131
|
+
loadedRecordSelectionListItems: loadedRecordSelectionListItems.filter(function (locationItem) {
|
|
132
|
+
return locationItem.id !== id;
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
truncatedActionText: "See all".concat(truncatedActionItemType ? " ".concat(loadedRecordSelectionListItems.length, " ").concat(truncatedActionItemType) : ''),
|
|
137
|
+
onClickTruncatedAction: function onClickTruncatedAction() {
|
|
138
|
+
return console.log('Clicked truncated list action!');
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}]);
|
|
143
|
+
return TruncatedListExample;
|
|
144
|
+
}(_react.Component);
|
|
145
|
+
|
|
146
|
+
stories.add('Truncated List - Single', function () {
|
|
147
|
+
return _react["default"].createElement("div", {
|
|
148
|
+
style: {
|
|
149
|
+
width: '320px',
|
|
150
|
+
padding: '8px'
|
|
151
|
+
}
|
|
152
|
+
}, _react["default"].createElement(_Card["default"], {
|
|
153
|
+
isSmall: true
|
|
154
|
+
}, _react["default"].createElement(_Card.CardHeader, {
|
|
155
|
+
title: "Locations",
|
|
156
|
+
actions: (0, _react3.object)('actions', [{
|
|
157
|
+
text: 'Add a location',
|
|
158
|
+
kind: 'simple'
|
|
159
|
+
}])
|
|
160
|
+
}), _react["default"].createElement(_Card.CardBody, null, _react["default"].createElement(TruncatedListExample, {
|
|
161
|
+
noItemsText: (0, _react3.text)('noItemsText', 'No locations selected'),
|
|
162
|
+
truncatedActionItemType: 'locations',
|
|
163
|
+
canSelect: (0, _react3.select)('Can Select', [null, 'many', 'one'], null),
|
|
164
|
+
canRemove: (0, _react3["boolean"])('Can Remove', true),
|
|
165
|
+
recordSelectionListItems: (0, _lodash.map)((0, _tableData.generateLocations)({
|
|
166
|
+
amount: 10
|
|
167
|
+
}), function (location) {
|
|
168
|
+
return {
|
|
169
|
+
id: location.id,
|
|
170
|
+
title: location.publicName,
|
|
171
|
+
subtitle: location.address
|
|
172
|
+
};
|
|
173
|
+
})
|
|
174
|
+
}))));
|
|
175
|
+
}).add('Truncated List - Multiple', function () {
|
|
176
|
+
return _react["default"].createElement("div", {
|
|
177
|
+
style: {
|
|
178
|
+
width: '320px',
|
|
179
|
+
padding: '8px'
|
|
180
|
+
}
|
|
181
|
+
}, _react["default"].createElement(_Card["default"], {
|
|
182
|
+
isSmall: true
|
|
183
|
+
}, _react["default"].createElement(_Card.CardHeader, {
|
|
184
|
+
title: "Manager Access",
|
|
185
|
+
actions: (0, _react3.object)('actions', [{
|
|
186
|
+
text: 'Add managers',
|
|
187
|
+
kind: 'simple'
|
|
188
|
+
}])
|
|
189
|
+
}), _react["default"].createElement(_Card.CardBody, {
|
|
190
|
+
isSectioned: false,
|
|
191
|
+
areSectionSeparatorsVisible: true
|
|
192
|
+
}, _react["default"].createElement(_Card.CardSection, null, _react["default"].createElement(TruncatedListExample, {
|
|
193
|
+
header: (0, _react3.text)('header', 'Managers'),
|
|
194
|
+
noItemsText: (0, _react3.text)('noItemsText', 'No managers selected'),
|
|
195
|
+
truncatedActionItemType: 'managers',
|
|
196
|
+
canSelect: (0, _react3.select)('Can Select', [null, 'many', 'one'], null),
|
|
197
|
+
canRemove: (0, _react3["boolean"])('Can Remove', true),
|
|
198
|
+
recordSelectionListItems: (0, _lodash.map)([].concat((0, _toConsumableArray2["default"])(_people.userList), (0, _toConsumableArray2["default"])(_people.userList02)), function (user) {
|
|
199
|
+
return {
|
|
200
|
+
id: user.id,
|
|
201
|
+
avatar: user.avatar,
|
|
202
|
+
title: user.title,
|
|
203
|
+
subtitle: 'Manager'
|
|
204
|
+
};
|
|
205
|
+
})
|
|
206
|
+
})), _react["default"].createElement(_Card.CardSection, null, _react["default"].createElement(TruncatedListExample, {
|
|
207
|
+
header: (0, _react3.text)('header', 'Group Managers'),
|
|
208
|
+
noItemsText: (0, _react3.text)('noItemsText', 'No managers selected'),
|
|
209
|
+
truncatedActionItemType: 'group managers',
|
|
210
|
+
canSelect: (0, _react3.select)('Can Select', [null, 'many', 'one'], null),
|
|
211
|
+
canRemove: (0, _react3["boolean"])('Can Remove', true),
|
|
212
|
+
recordSelectionListItems: (0, _lodash.map)([].concat((0, _toConsumableArray2["default"])(_people.userList), (0, _toConsumableArray2["default"])(_people.userList02)), function (user) {
|
|
213
|
+
return {
|
|
214
|
+
id: user.id,
|
|
215
|
+
avatar: user.avatar,
|
|
216
|
+
title: user.title,
|
|
217
|
+
subtitle: 'Group Manager'
|
|
218
|
+
};
|
|
219
|
+
})
|
|
220
|
+
})))));
|
|
221
|
+
});
|
|
222
|
+
//# sourceMappingURL=TruncatedList-story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TruncatedList/TruncatedList-story.js"],"names":["stories","module","addDecorator","withKnobs","TruncatedListExample","props","selectedIds","recordSelectionListItems","map","loc","id","canSelect","Math","floor","length","unselectedIds","filter","locationId","indexOf","unselectableIds","state","loadedRecordSelectionListItems","header","canRemove","noItemsText","truncatedActionItemType","slice","setState","selectedId","locationItem","console","log","Component","add","width","padding","text","kind","amount","location","title","publicName","subtitle","address","userList","userList02","user","avatar"],"mappings":"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","sourcesContent":["// @flow\nimport React, { Component } from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { generateLocations } from '../../../.storybook/data/tableData'\nimport { map, sampleSize, cloneDeep } from 'lodash'\nimport {\n\twithKnobs,\n\t// withKnobsOptions,\n\ttext,\n\tboolean,\n\tobject,\n\tselect\n} from '@storybook/addon-knobs/react'\nimport { userList, userList02 } from '../../../.storybook/data/people'\n\nimport Card, { CardHeader, CardBody, CardSection } from '../Card'\nimport TruncatedList from './TruncatedList'\n\nconst stories = storiesOf('TruncatedList', module)\n\n// stories.addDecorator(\n// \twithKnobsOptions({\n// \t\tescapeHTML: false\n// \t})\n// )\n\nstories.addDecorator(withKnobs)\n\ntype TruncatedListExampleProps = {\n\theader?: string,\n\tcanSelect?: 'many' | 'one',\n\tcanRemove: boolean,\n\trecordSelectionListItems: Array<Object>,\n\tmaxItemsVisible: number,\n\tnoItemsText?: string,\n\ttruncatedActionItemType?: string\n}\n\ntype TruncatedListExampleState = {\n\tselectedIds: Array<string>,\n\tunselectableIds: Array<string>,\n\tloadedRecordSelectionListItems: Array<Object>\n}\n\nclass TruncatedListExample extends Component<\n\tTruncatedListExampleProps,\n\tTruncatedListExampleState\n> {\n\tconstructor(props) {\n\t\tsuper(props)\n\n\t\tlet selectedIds = props.recordSelectionListItems.map(loc => loc.id)\n\n\t\tif (props.canSelect === 'one') {\n\t\t\tselectedIds = sampleSize(selectedIds, 1)\n\t\t} else {\n\t\t\tselectedIds = sampleSize(selectedIds, Math.floor(selectedIds.length / 2))\n\t\t}\n\n\t\tconst unselectedIds = props.recordSelectionListItems\n\t\t\t.map(loc => loc.id)\n\t\t\t.filter(locationId => selectedIds.indexOf(locationId) === -1)\n\n\t\tconst unselectableIds = props.canSelect\n\t\t\t? sampleSize(unselectedIds, unselectedIds.length / 2)\n\t\t\t: []\n\n\t\tthis.state = {\n\t\t\tselectedIds,\n\t\t\tloadedRecordSelectionListItems: cloneDeep(props.recordSelectionListItems),\n\t\t\tunselectableIds\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\theader,\n\t\t\tcanSelect,\n\t\t\tcanRemove,\n\t\t\tnoItemsText,\n\t\t\ttruncatedActionItemType\n\t\t} = this.props\n\t\tconst {\n\t\t\tselectedIds,\n\t\t\tloadedRecordSelectionListItems,\n\t\t\tunselectableIds\n\t\t} = this.state\n\n\t\treturn (\n\t\t\t<TruncatedList\n\t\t\t\theader={header}\n\t\t\t\tnoItemsText={noItemsText}\n\t\t\t\tselectedIds={selectedIds}\n\t\t\t\tunselectableIds={unselectableIds}\n\t\t\t\trecordSelectionListItems={loadedRecordSelectionListItems.slice(0, 5)}\n\t\t\t\tisTruncated={loadedRecordSelectionListItems.length > 5}\n\t\t\t\tcanSelect={canSelect}\n\t\t\t\tcanRemove={canRemove}\n\t\t\t\tonSelect={id => {\n\t\t\t\t\t// Typically you'd want \"many\" or \"one\", so you'd only need one side\n\t\t\t\t\t// of this conditional.\n\t\t\t\t\tif (canSelect === 'many') {\n\t\t\t\t\t\tif (selectedIds.indexOf(id) >= 0) {\n\t\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\t\tselectedIds: selectedIds.filter(selectedId => selectedId !== id)\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.setState({ selectedIds: [...selectedIds, id] })\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (canSelect === 'one') {\n\t\t\t\t\t\tthis.setState({ selectedIds: [id] })\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\tonRemove={id => {\n\t\t\t\t\t// The component maintains state of the records it has loaded, but\n\t\t\t\t\t// it's up to you to remove them from your list in your local state.\n\t\t\t\t\t// Also, if for some reason you want to have selection alongside deletion,\n\t\t\t\t\t// you should be sure to clear out the selection at the same time.\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tselectedIds: selectedIds.filter(selectedId => selectedId !== id),\n\t\t\t\t\t\tloadedRecordSelectionListItems: loadedRecordSelectionListItems.filter(\n\t\t\t\t\t\t\tlocationItem => locationItem.id !== id\n\t\t\t\t\t\t)\n\t\t\t\t\t})\n\t\t\t\t}}\n\t\t\t\ttruncatedActionText={`See all${\n\t\t\t\t\ttruncatedActionItemType\n\t\t\t\t\t\t? ` ${\n\t\t\t\t\t\t\t\tloadedRecordSelectionListItems.length\n\t\t\t\t\t\t } ${truncatedActionItemType}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}`}\n\t\t\t\tonClickTruncatedAction={() =>\n\t\t\t\t\tconsole.log('Clicked truncated list action!')\n\t\t\t\t}\n\t\t\t/>\n\t\t)\n\t}\n}\n\nstories\n\t.add('Truncated List - Single', () => {\n\t\treturn (\n\t\t\t<div style={{ width: '320px', padding: '8px' }}>\n\t\t\t\t<Card isSmall>\n\t\t\t\t\t<CardHeader\n\t\t\t\t\t\ttitle=\"Locations\"\n\t\t\t\t\t\tactions={object('actions', [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: 'Add a location',\n\t\t\t\t\t\t\t\tkind: 'simple'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t])}\n\t\t\t\t\t/>\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<TruncatedListExample\n\t\t\t\t\t\t\tnoItemsText={text('noItemsText', 'No locations selected')}\n\t\t\t\t\t\t\ttruncatedActionItemType={'locations'}\n\t\t\t\t\t\t\tcanSelect={select('Can Select', [null, 'many', 'one'], null)}\n\t\t\t\t\t\t\tcanRemove={boolean('Can Remove', true)}\n\t\t\t\t\t\t\trecordSelectionListItems={map(\n\t\t\t\t\t\t\t\tgenerateLocations({ amount: 10 }),\n\t\t\t\t\t\t\t\tlocation => ({\n\t\t\t\t\t\t\t\t\tid: location.id,\n\t\t\t\t\t\t\t\t\ttitle: location.publicName,\n\t\t\t\t\t\t\t\t\tsubtitle: location.address\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</Card>\n\t\t\t</div>\n\t\t)\n\t})\n\t.add('Truncated List - Multiple', () => {\n\t\treturn (\n\t\t\t<div style={{ width: '320px', padding: '8px' }}>\n\t\t\t\t<Card isSmall>\n\t\t\t\t\t<CardHeader\n\t\t\t\t\t\ttitle=\"Manager Access\"\n\t\t\t\t\t\tactions={object('actions', [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: 'Add managers',\n\t\t\t\t\t\t\t\tkind: 'simple'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t])}\n\t\t\t\t\t/>\n\t\t\t\t\t<CardBody isSectioned={false} areSectionSeparatorsVisible={true}>\n\t\t\t\t\t\t<CardSection>\n\t\t\t\t\t\t\t<TruncatedListExample\n\t\t\t\t\t\t\t\theader={text('header', 'Managers')}\n\t\t\t\t\t\t\t\tnoItemsText={text('noItemsText', 'No managers selected')}\n\t\t\t\t\t\t\t\ttruncatedActionItemType={'managers'}\n\t\t\t\t\t\t\t\tcanSelect={select('Can Select', [null, 'many', 'one'], null)}\n\t\t\t\t\t\t\t\tcanRemove={boolean('Can Remove', true)}\n\t\t\t\t\t\t\t\trecordSelectionListItems={map(\n\t\t\t\t\t\t\t\t\t[...userList, ...userList02],\n\t\t\t\t\t\t\t\t\tuser => ({\n\t\t\t\t\t\t\t\t\t\tid: user.id,\n\t\t\t\t\t\t\t\t\t\tavatar: user.avatar,\n\t\t\t\t\t\t\t\t\t\ttitle: user.title,\n\t\t\t\t\t\t\t\t\t\tsubtitle: 'Manager'\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</CardSection>\n\t\t\t\t\t\t<CardSection>\n\t\t\t\t\t\t\t<TruncatedListExample\n\t\t\t\t\t\t\t\theader={text('header', 'Group Managers')}\n\t\t\t\t\t\t\t\tnoItemsText={text('noItemsText', 'No managers selected')}\n\t\t\t\t\t\t\t\ttruncatedActionItemType={'group managers'}\n\t\t\t\t\t\t\t\tcanSelect={select('Can Select', [null, 'many', 'one'], null)}\n\t\t\t\t\t\t\t\tcanRemove={boolean('Can Remove', true)}\n\t\t\t\t\t\t\t\trecordSelectionListItems={map(\n\t\t\t\t\t\t\t\t\t[...userList, ...userList02],\n\t\t\t\t\t\t\t\t\tuser => ({\n\t\t\t\t\t\t\t\t\t\tid: user.id,\n\t\t\t\t\t\t\t\t\t\tavatar: user.avatar,\n\t\t\t\t\t\t\t\t\t\ttitle: user.title,\n\t\t\t\t\t\t\t\t\t\tsubtitle: 'Group Manager'\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</CardSection>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</Card>\n\t\t\t</div>\n\t\t)\n\t})\n"],"file":"TruncatedList-story.js"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Component, ReactElement } from 'react';
|
|
2
|
+
import { IRecordSelectionListItemProps } from '../RecordSelectionList/RecordSelectionList';
|
|
3
|
+
interface ITruncatedListProps {
|
|
4
|
+
/** Optional class name for the component */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Optional text header for the list */
|
|
7
|
+
header?: string;
|
|
8
|
+
/** When true, will display the truncated action button */
|
|
9
|
+
isTruncated: boolean;
|
|
10
|
+
/** Optional truncated action button text - defaults to 'See All' */
|
|
11
|
+
truncatedActionText?: string;
|
|
12
|
+
/** Method called when truncated action is clicked */
|
|
13
|
+
onClickTruncatedAction?: Function;
|
|
14
|
+
/** RecordSelectionListItems to be displayed in the list */
|
|
15
|
+
recordSelectionListItems: IRecordSelectionListItemProps[];
|
|
16
|
+
/** Optional selectedIds passed to RecordSelectionList */
|
|
17
|
+
selectedIds?: string[];
|
|
18
|
+
/** Optional unselectableIds passed to RecordSelectionList */
|
|
19
|
+
unselectableIds?: string[];
|
|
20
|
+
/** Can the user select many or one records in this list? */
|
|
21
|
+
canSelect?: 'many' | 'one';
|
|
22
|
+
/** Can the user remove records from this list? */
|
|
23
|
+
canRemove?: boolean;
|
|
24
|
+
/** Set to false to hide "# selected" text - defaults to true */
|
|
25
|
+
showSelectedCount?: boolean;
|
|
26
|
+
/** Callback for selection of a record */
|
|
27
|
+
onSelect?: (RecordId: string, Record: Record<string, any>) => void;
|
|
28
|
+
/** Callback for when user requests to remove a record from the list. */
|
|
29
|
+
onRemove?: Function;
|
|
30
|
+
/** Text displayed when the list is empty */
|
|
31
|
+
noItemsText?: string;
|
|
32
|
+
}
|
|
33
|
+
interface ITruncatedListState {
|
|
34
|
+
recordListItems: IRecordSelectionListItemProps[];
|
|
35
|
+
}
|
|
36
|
+
export default class TruncatedList extends Component<ITruncatedListProps, ITruncatedListState> {
|
|
37
|
+
static defaultProps: {
|
|
38
|
+
isTruncated: boolean;
|
|
39
|
+
canRemove: boolean;
|
|
40
|
+
recordSelectionListItems: never[];
|
|
41
|
+
noItemsText: string;
|
|
42
|
+
};
|
|
43
|
+
private recordSelectionListRef;
|
|
44
|
+
constructor(props: ITruncatedListProps);
|
|
45
|
+
reset: () => Promise<void>;
|
|
46
|
+
render(): ReactElement;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=TruncatedList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TruncatedList.d.ts","sourceRoot":"","sources":["../../../src/components/TruncatedList/TruncatedList.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAY,YAAY,EAAE,MAAM,OAAO,CAAA;AAOhE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAA;AAE1F,UAAU,mBAAmB;IAC5B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,0DAA0D;IAC1D,WAAW,EAAE,OAAO,CAAA;IAEpB,oEAAoE;IACpE,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B,qDAAqD;IACrD,sBAAsB,CAAC,EAAE,QAAQ,CAAA;IAEjC,2DAA2D;IAC3D,wBAAwB,EAAE,6BAA6B,EAAE,CAAA;IAEzD,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IAEtB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAE1B,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAE3B,yCAAyC;IACzC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IAElE,wEAAwE;IACxE,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,mBAAmB;IAC5B,eAAe,EAAE,6BAA6B,EAAE,CAAA;CAChD;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,SAAS,CACnD,mBAAmB,EACnB,mBAAmB,CACnB;IACA,OAAc,YAAY;;;;;MAKzB;IAED,OAAO,CAAC,sBAAsB,CAAsC;gBAEjD,KAAK,EAAE,mBAAmB;IAMtC,KAAK,sBAIX;IAEM,MAAM,IAAI,YAAY;CA6D7B"}
|
|
@@ -0,0 +1,188 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
+
|
|
14
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
+
|
|
16
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
+
|
|
18
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
+
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
+
|
|
22
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
+
|
|
24
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
25
|
+
|
|
26
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
27
|
+
|
|
28
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
+
|
|
30
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
31
|
+
|
|
32
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
33
|
+
|
|
34
|
+
var _Button = _interopRequireWildcard(require("../Button/Button"));
|
|
35
|
+
|
|
36
|
+
var _EmptyState = _interopRequireDefault(require("../EmptyState/EmptyState"));
|
|
37
|
+
|
|
38
|
+
var _RecordSelectionList = _interopRequireDefault(require("../RecordSelectionList/RecordSelectionList"));
|
|
39
|
+
|
|
40
|
+
var TruncatedList =
|
|
41
|
+
/*#__PURE__*/
|
|
42
|
+
function (_Component) {
|
|
43
|
+
(0, _inherits2["default"])(TruncatedList, _Component);
|
|
44
|
+
|
|
45
|
+
function TruncatedList(props) {
|
|
46
|
+
var _this;
|
|
47
|
+
|
|
48
|
+
(0, _classCallCheck2["default"])(this, TruncatedList);
|
|
49
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(TruncatedList).call(this, props));
|
|
50
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "reset",
|
|
51
|
+
/*#__PURE__*/
|
|
52
|
+
(0, _asyncToGenerator2["default"])(
|
|
53
|
+
/*#__PURE__*/
|
|
54
|
+
_regenerator["default"].mark(function _callee() {
|
|
55
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
56
|
+
while (1) {
|
|
57
|
+
switch (_context.prev = _context.next) {
|
|
58
|
+
case 0:
|
|
59
|
+
if (_this.recordSelectionListRef.current) {
|
|
60
|
+
_this.recordSelectionListRef.current.reset();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
case 1:
|
|
64
|
+
case "end":
|
|
65
|
+
return _context.stop();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, _callee);
|
|
69
|
+
})));
|
|
70
|
+
_this.recordSelectionListRef = _react["default"].createRef();
|
|
71
|
+
return _this;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
(0, _createClass2["default"])(TruncatedList, [{
|
|
75
|
+
key: "render",
|
|
76
|
+
value: function render() {
|
|
77
|
+
var _this2 = this;
|
|
78
|
+
|
|
79
|
+
var _this$props = this.props,
|
|
80
|
+
className = _this$props.className,
|
|
81
|
+
header = _this$props.header,
|
|
82
|
+
isTruncated = _this$props.isTruncated,
|
|
83
|
+
truncatedActionText = _this$props.truncatedActionText,
|
|
84
|
+
onClickTruncatedAction = _this$props.onClickTruncatedAction,
|
|
85
|
+
recordSelectionListItems = _this$props.recordSelectionListItems,
|
|
86
|
+
selectedIds = _this$props.selectedIds,
|
|
87
|
+
unselectableIds = _this$props.unselectableIds,
|
|
88
|
+
canSelect = _this$props.canSelect,
|
|
89
|
+
canRemove = _this$props.canRemove,
|
|
90
|
+
showSelectedCount = _this$props.showSelectedCount,
|
|
91
|
+
onSelect = _this$props.onSelect,
|
|
92
|
+
onRemove = _this$props.onRemove,
|
|
93
|
+
noItemsText = _this$props.noItemsText;
|
|
94
|
+
var parentClass = (0, _classnames["default"])('truncated-list', className);
|
|
95
|
+
return _react["default"].createElement("div", {
|
|
96
|
+
className: parentClass
|
|
97
|
+
}, !recordSelectionListItems || recordSelectionListItems.length === 0 ? _react["default"].createElement(_EmptyState["default"], {
|
|
98
|
+
headline: "",
|
|
99
|
+
subheadline: noItemsText
|
|
100
|
+
}) : _react["default"].createElement(_react.Fragment, null, header && _react["default"].createElement("h3", {
|
|
101
|
+
className: "truncated-list__header"
|
|
102
|
+
}, header), _react["default"].createElement(_RecordSelectionList["default"], {
|
|
103
|
+
ref: this.recordSelectionListRef,
|
|
104
|
+
loadRecordListItems:
|
|
105
|
+
/*#__PURE__*/
|
|
106
|
+
(0, _asyncToGenerator2["default"])(
|
|
107
|
+
/*#__PURE__*/
|
|
108
|
+
_regenerator["default"].mark(function _callee2() {
|
|
109
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
110
|
+
while (1) {
|
|
111
|
+
switch (_context2.prev = _context2.next) {
|
|
112
|
+
case 0:
|
|
113
|
+
_context2.next = 2;
|
|
114
|
+
return recordSelectionListItems;
|
|
115
|
+
|
|
116
|
+
case 2:
|
|
117
|
+
return _context2.abrupt("return", _context2.sent);
|
|
118
|
+
|
|
119
|
+
case 3:
|
|
120
|
+
case "end":
|
|
121
|
+
return _context2.stop();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, _callee2);
|
|
125
|
+
})),
|
|
126
|
+
selectedIds: selectedIds,
|
|
127
|
+
unselectableIds: unselectableIds,
|
|
128
|
+
canSelect: canSelect,
|
|
129
|
+
canRemove: canRemove,
|
|
130
|
+
showSelectedCount: showSelectedCount,
|
|
131
|
+
onSelect: onSelect,
|
|
132
|
+
onRemove:
|
|
133
|
+
/*#__PURE__*/
|
|
134
|
+
function () {
|
|
135
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(
|
|
136
|
+
/*#__PURE__*/
|
|
137
|
+
_regenerator["default"].mark(function _callee3(id) {
|
|
138
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
139
|
+
while (1) {
|
|
140
|
+
switch (_context3.prev = _context3.next) {
|
|
141
|
+
case 0:
|
|
142
|
+
if (!onRemove) {
|
|
143
|
+
_context3.next = 4;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
_context3.next = 3;
|
|
148
|
+
return onRemove(id);
|
|
149
|
+
|
|
150
|
+
case 3:
|
|
151
|
+
if (_this2.recordSelectionListRef.current) {
|
|
152
|
+
_this2.recordSelectionListRef.current.reset();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
case 4:
|
|
156
|
+
case "end":
|
|
157
|
+
return _context3.stop();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, _callee3);
|
|
161
|
+
}));
|
|
162
|
+
|
|
163
|
+
return function (_x) {
|
|
164
|
+
return _ref3.apply(this, arguments);
|
|
165
|
+
};
|
|
166
|
+
}()
|
|
167
|
+
}), isTruncated ? _react["default"].createElement("div", {
|
|
168
|
+
className: "truncated-list__action-btn-wrapper"
|
|
169
|
+
}, _react["default"].createElement(_Button["default"], {
|
|
170
|
+
kind: _Button.ButtonKinds.Simple,
|
|
171
|
+
className: "truncated-list__action-btn",
|
|
172
|
+
isSmall: true,
|
|
173
|
+
text: truncatedActionText || 'See all',
|
|
174
|
+
onClick: onClickTruncatedAction
|
|
175
|
+
})) : null));
|
|
176
|
+
}
|
|
177
|
+
}]);
|
|
178
|
+
return TruncatedList;
|
|
179
|
+
}(_react.Component);
|
|
180
|
+
|
|
181
|
+
exports["default"] = TruncatedList;
|
|
182
|
+
(0, _defineProperty2["default"])(TruncatedList, "defaultProps", {
|
|
183
|
+
isTruncated: false,
|
|
184
|
+
canRemove: false,
|
|
185
|
+
recordSelectionListItems: [],
|
|
186
|
+
noItemsText: 'Nothing to see here.'
|
|
187
|
+
});
|
|
188
|
+
//# sourceMappingURL=TruncatedList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TruncatedList/TruncatedList.tsx"],"names":["TruncatedList","props","recordSelectionListRef","current","reset","React","createRef","className","header","isTruncated","truncatedActionText","onClickTruncatedAction","recordSelectionListItems","selectedIds","unselectableIds","canSelect","canRemove","showSelectedCount","onSelect","onRemove","noItemsText","parentClass","length","id","ButtonKinds","Simple","Component"],"mappings":"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","sourcesContent":["import React, { Component, Fragment, ReactElement } from 'react'\nimport cx from 'classnames'\n\nimport Button, { ButtonKinds } from '../Button/Button'\nimport EmptyState from '../EmptyState/EmptyState'\nimport RecordSelectionList from '../RecordSelectionList/RecordSelectionList'\n\nimport { IRecordSelectionListItemProps } from '../RecordSelectionList/RecordSelectionList'\n\ninterface ITruncatedListProps {\n\t/** Optional class name for the component */\n\tclassName?: string\n\n\t/** Optional text header for the list */\n\theader?: string\n\n\t/** When true, will display the truncated action button */\n\tisTruncated: boolean\n\n\t/** Optional truncated action button text - defaults to 'See All' */\n\ttruncatedActionText?: string\n\n\t/** Method called when truncated action is clicked */\n\tonClickTruncatedAction?: Function\n\n\t/** RecordSelectionListItems to be displayed in the list */\n\trecordSelectionListItems: IRecordSelectionListItemProps[]\n\n\t/** Optional selectedIds passed to RecordSelectionList */\n\tselectedIds?: string[]\n\n\t/** Optional unselectableIds passed to RecordSelectionList */\n\tunselectableIds?: string[]\n\n\t/** Can the user select many or one records in this list? */\n\tcanSelect?: 'many' | 'one'\n\n\t/** Can the user remove records from this list? */\n\tcanRemove?: boolean\n\n\t/** Set to false to hide \"# selected\" text - defaults to true */\n\tshowSelectedCount?: boolean\n\n\t/** Callback for selection of a record */\n\tonSelect?: (RecordId: string, Record: Record<string, any>) => void\n\n\t/** Callback for when user requests to remove a record from the list. */\n\tonRemove?: Function\n\n\t/** Text displayed when the list is empty */\n\tnoItemsText?: string\n}\n\ninterface ITruncatedListState {\n\trecordListItems: IRecordSelectionListItemProps[]\n}\n\nexport default class TruncatedList extends Component<\n\tITruncatedListProps,\n\tITruncatedListState\n> {\n\tpublic static defaultProps = {\n\t\tisTruncated: false,\n\t\tcanRemove: false,\n\t\trecordSelectionListItems: [],\n\t\tnoItemsText: 'Nothing to see here.'\n\t}\n\n\tprivate recordSelectionListRef: React.RefObject<RecordSelectionList>\n\n\tpublic constructor(props: ITruncatedListProps) {\n\t\tsuper(props)\n\n\t\tthis.recordSelectionListRef = React.createRef()\n\t}\n\n\tpublic reset = async (): Promise<void> => {\n\t\tif (this.recordSelectionListRef.current) {\n\t\t\tthis.recordSelectionListRef.current.reset()\n\t\t}\n\t}\n\n\tpublic render(): ReactElement {\n\t\tconst {\n\t\t\tclassName,\n\t\t\theader,\n\t\t\tisTruncated,\n\t\t\ttruncatedActionText,\n\t\t\tonClickTruncatedAction,\n\t\t\trecordSelectionListItems,\n\t\t\tselectedIds,\n\t\t\tunselectableIds,\n\t\t\tcanSelect,\n\t\t\tcanRemove,\n\t\t\tshowSelectedCount,\n\t\t\tonSelect,\n\t\t\tonRemove,\n\t\t\tnoItemsText\n\t\t} = this.props\n\t\tconst parentClass = cx('truncated-list', className)\n\t\treturn (\n\t\t\t<div className={parentClass}>\n\t\t\t\t{!recordSelectionListItems || recordSelectionListItems.length === 0 ? (\n\t\t\t\t\t<EmptyState headline=\"\" subheadline={noItemsText} />\n\t\t\t\t) : (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{header && <h3 className=\"truncated-list__header\">{header}</h3>}\n\t\t\t\t\t\t<RecordSelectionList\n\t\t\t\t\t\t\tref={this.recordSelectionListRef}\n\t\t\t\t\t\t\tloadRecordListItems={async () => {\n\t\t\t\t\t\t\t\treturn await recordSelectionListItems\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tselectedIds={selectedIds}\n\t\t\t\t\t\t\tunselectableIds={unselectableIds}\n\t\t\t\t\t\t\tcanSelect={canSelect}\n\t\t\t\t\t\t\tcanRemove={canRemove}\n\t\t\t\t\t\t\tshowSelectedCount={showSelectedCount}\n\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\tonRemove={async id => {\n\t\t\t\t\t\t\t\tif (onRemove) {\n\t\t\t\t\t\t\t\t\tawait onRemove(id)\n\t\t\t\t\t\t\t\t\tif (this.recordSelectionListRef.current) {\n\t\t\t\t\t\t\t\t\t\tthis.recordSelectionListRef.current.reset()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{isTruncated ? (\n\t\t\t\t\t\t\t<div className=\"truncated-list__action-btn-wrapper\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tkind={ButtonKinds.Simple}\n\t\t\t\t\t\t\t\t\tclassName=\"truncated-list__action-btn\"\n\t\t\t\t\t\t\t\t\tisSmall={true}\n\t\t\t\t\t\t\t\t\ttext={truncatedActionText || 'See all'}\n\t\t\t\t\t\t\t\t\tonClick={onClickTruncatedAction}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t</Fragment>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t)\n\t}\n}\n"],"file":"TruncatedList.js"}
|