@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,523 @@
|
|
|
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 _Table = _interopRequireDefault(require("../Table/Table"));
|
|
39
|
+
|
|
40
|
+
var _TableSearch = _interopRequireDefault(require("../Table/components/TableSearch/TableSearch"));
|
|
41
|
+
|
|
42
|
+
var _Tabs = _interopRequireDefault(require("../Tabs/Tabs"));
|
|
43
|
+
|
|
44
|
+
var _Forms = require("../Forms");
|
|
45
|
+
|
|
46
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
47
|
+
|
|
48
|
+
var _EmptyState = _interopRequireDefault(require("../EmptyState/EmptyState"));
|
|
49
|
+
|
|
50
|
+
var _Loader = _interopRequireDefault(require("../Loader/Loader"));
|
|
51
|
+
|
|
52
|
+
var RECORD_TABLE_INITIAL_LIMIT = 50;
|
|
53
|
+
|
|
54
|
+
var RecordTable =
|
|
55
|
+
/*#__PURE__*/
|
|
56
|
+
function (_Component) {
|
|
57
|
+
(0, _inherits2["default"])(RecordTable, _Component);
|
|
58
|
+
|
|
59
|
+
function RecordTable(props) {
|
|
60
|
+
var _this;
|
|
61
|
+
|
|
62
|
+
(0, _classCallCheck2["default"])(this, RecordTable);
|
|
63
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(RecordTable).call(this, props));
|
|
64
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "refresh",
|
|
65
|
+
/*#__PURE__*/
|
|
66
|
+
(0, _asyncToGenerator2["default"])(
|
|
67
|
+
/*#__PURE__*/
|
|
68
|
+
_regenerator["default"].mark(function _callee() {
|
|
69
|
+
var _ref2, visibleRows, totalRows;
|
|
70
|
+
|
|
71
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
72
|
+
while (1) {
|
|
73
|
+
switch (_context.prev = _context.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
_this.setState({
|
|
76
|
+
loading: true
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
_context.next = 3;
|
|
80
|
+
return _this.fetchRecords({
|
|
81
|
+
page: _this.state.currentPage
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
case 3:
|
|
85
|
+
_ref2 = _context.sent;
|
|
86
|
+
visibleRows = _ref2.visibleRows;
|
|
87
|
+
totalRows = _ref2.totalRows;
|
|
88
|
+
|
|
89
|
+
_this.setState({
|
|
90
|
+
loading: false,
|
|
91
|
+
visibleRows: visibleRows,
|
|
92
|
+
totalRows: totalRows
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
case 7:
|
|
96
|
+
case "end":
|
|
97
|
+
return _context.stop();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, _callee);
|
|
101
|
+
})));
|
|
102
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "navigateToPage",
|
|
103
|
+
/*#__PURE__*/
|
|
104
|
+
function () {
|
|
105
|
+
var _ref4 = (0, _asyncToGenerator2["default"])(
|
|
106
|
+
/*#__PURE__*/
|
|
107
|
+
_regenerator["default"].mark(function _callee2(_ref3) {
|
|
108
|
+
var search, page, _this$props$onNavigat, onNavigateToPage, _ref5, visibleRows, totalRows;
|
|
109
|
+
|
|
110
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
111
|
+
while (1) {
|
|
112
|
+
switch (_context2.prev = _context2.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
search = _ref3.search, page = _ref3.page;
|
|
115
|
+
_this$props$onNavigat = _this.props.onNavigateToPage, onNavigateToPage = _this$props$onNavigat === void 0 ? function () {} : _this$props$onNavigat;
|
|
116
|
+
_context2.prev = 2;
|
|
117
|
+
_context2.next = 5;
|
|
118
|
+
return _this.fetchRecords({
|
|
119
|
+
search: search,
|
|
120
|
+
page: page
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
case 5:
|
|
124
|
+
_ref5 = _context2.sent;
|
|
125
|
+
visibleRows = _ref5.visibleRows;
|
|
126
|
+
totalRows = _ref5.totalRows;
|
|
127
|
+
onNavigateToPage({
|
|
128
|
+
currentPage: page
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
_this.setState({
|
|
132
|
+
currentPage: page,
|
|
133
|
+
visibleRows: visibleRows,
|
|
134
|
+
totalRows: totalRows,
|
|
135
|
+
expandedRows: {}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
_context2.next = 14;
|
|
139
|
+
break;
|
|
140
|
+
|
|
141
|
+
case 12:
|
|
142
|
+
_context2.prev = 12;
|
|
143
|
+
_context2.t0 = _context2["catch"](2);
|
|
144
|
+
|
|
145
|
+
case 14:
|
|
146
|
+
case "end":
|
|
147
|
+
return _context2.stop();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}, _callee2, null, [[2, 12]]);
|
|
151
|
+
}));
|
|
152
|
+
|
|
153
|
+
return function (_x) {
|
|
154
|
+
return _ref4.apply(this, arguments);
|
|
155
|
+
};
|
|
156
|
+
}());
|
|
157
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateFilter", function (filter) {
|
|
158
|
+
_this.setState({
|
|
159
|
+
currentPage: 0,
|
|
160
|
+
currentFilter: filter
|
|
161
|
+
}, function () {
|
|
162
|
+
_this.refresh();
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "componentDidMount", function () {
|
|
166
|
+
if (_this.props.fetchOnMount) {
|
|
167
|
+
_this.refresh();
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleClickTab", function (e, tab) {
|
|
171
|
+
var onClickTab = _this.props.onClickTab;
|
|
172
|
+
var cancel = false;
|
|
173
|
+
|
|
174
|
+
if (onClickTab) {
|
|
175
|
+
cancel = onClickTab(e, {
|
|
176
|
+
payload: tab.payload,
|
|
177
|
+
key: tab.key
|
|
178
|
+
}) === false;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (!cancel) {
|
|
182
|
+
_this.setState({
|
|
183
|
+
currentPage: 0,
|
|
184
|
+
selectedTab: tab.key,
|
|
185
|
+
expandedRows: {}
|
|
186
|
+
}, _this.refresh);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "fetchRecords",
|
|
190
|
+
/*#__PURE__*/
|
|
191
|
+
function () {
|
|
192
|
+
var _ref7 = (0, _asyncToGenerator2["default"])(
|
|
193
|
+
/*#__PURE__*/
|
|
194
|
+
_regenerator["default"].mark(function _callee3(_ref6) {
|
|
195
|
+
var search, page, _this$state, sortDirection, sortColumn, limit, selectedTab, currentFilter, offset, data;
|
|
196
|
+
|
|
197
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
198
|
+
while (1) {
|
|
199
|
+
switch (_context3.prev = _context3.next) {
|
|
200
|
+
case 0:
|
|
201
|
+
search = _ref6.search, page = _ref6.page;
|
|
202
|
+
_this$state = _this.state, sortDirection = _this$state.sortDirection, sortColumn = _this$state.sortColumn, limit = _this$state.limit, selectedTab = _this$state.selectedTab, currentFilter = _this$state.currentFilter;
|
|
203
|
+
offset = limit * page;
|
|
204
|
+
_context3.next = 5;
|
|
205
|
+
return _this.props.fetchRecords({
|
|
206
|
+
sortColumn: sortColumn,
|
|
207
|
+
sortDirection: sortDirection,
|
|
208
|
+
limit: limit,
|
|
209
|
+
offset: offset,
|
|
210
|
+
selectedTab: selectedTab,
|
|
211
|
+
search: search || currentFilter
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
case 5:
|
|
215
|
+
data = _context3.sent;
|
|
216
|
+
return _context3.abrupt("return", data);
|
|
217
|
+
|
|
218
|
+
case 7:
|
|
219
|
+
case "end":
|
|
220
|
+
return _context3.stop();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}, _callee3);
|
|
224
|
+
}));
|
|
225
|
+
|
|
226
|
+
return function (_x2) {
|
|
227
|
+
return _ref7.apply(this, arguments);
|
|
228
|
+
};
|
|
229
|
+
}());
|
|
230
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleSortChanged", function (sorted) {
|
|
231
|
+
var sort = {
|
|
232
|
+
sortColumn: sorted[0].id,
|
|
233
|
+
sortDirection: sorted[0].desc ? 'desc' : 'asc'
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
_this.setState(sort, _this.refresh);
|
|
237
|
+
});
|
|
238
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleSearchSuggestions",
|
|
239
|
+
/*#__PURE__*/
|
|
240
|
+
function () {
|
|
241
|
+
var _ref8 = (0, _asyncToGenerator2["default"])(
|
|
242
|
+
/*#__PURE__*/
|
|
243
|
+
_regenerator["default"].mark(function _callee4(value) {
|
|
244
|
+
var currentPage, _ref9, visibleRows, suggestions;
|
|
245
|
+
|
|
246
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
247
|
+
while (1) {
|
|
248
|
+
switch (_context4.prev = _context4.next) {
|
|
249
|
+
case 0:
|
|
250
|
+
currentPage = _this.state.currentPage;
|
|
251
|
+
_context4.next = 3;
|
|
252
|
+
return _this.fetchRecords({
|
|
253
|
+
page: currentPage,
|
|
254
|
+
search: value
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
case 3:
|
|
258
|
+
_ref9 = _context4.sent;
|
|
259
|
+
visibleRows = _ref9.visibleRows;
|
|
260
|
+
suggestions = visibleRows.length > 0 ? visibleRows.map(function (record) {
|
|
261
|
+
return {
|
|
262
|
+
text: record.name,
|
|
263
|
+
record: record
|
|
264
|
+
};
|
|
265
|
+
}) : [{
|
|
266
|
+
text: 'NO RESULTS',
|
|
267
|
+
isEmptyMessage: true,
|
|
268
|
+
value: value
|
|
269
|
+
}];
|
|
270
|
+
return _context4.abrupt("return", suggestions);
|
|
271
|
+
|
|
272
|
+
case 7:
|
|
273
|
+
case "end":
|
|
274
|
+
return _context4.stop();
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}, _callee4);
|
|
278
|
+
}));
|
|
279
|
+
|
|
280
|
+
return function (_x3) {
|
|
281
|
+
return _ref8.apply(this, arguments);
|
|
282
|
+
};
|
|
283
|
+
}());
|
|
284
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderSuggestion", function (suggestion) {
|
|
285
|
+
var _this$props$searchSug = _this.props.searchSuggestionAccessor,
|
|
286
|
+
searchSuggestionAccessor = _this$props$searchSug === void 0 ? function () {
|
|
287
|
+
return (
|
|
288
|
+
/* record */
|
|
289
|
+
_react["default"].createElement(_Button["default"], {
|
|
290
|
+
isSmall: true,
|
|
291
|
+
className: "autosuggest__list-item-inner",
|
|
292
|
+
text: suggestion.text
|
|
293
|
+
})
|
|
294
|
+
);
|
|
295
|
+
} : _this$props$searchSug;
|
|
296
|
+
|
|
297
|
+
if (suggestion.isEmptyMessage && suggestion.value) {
|
|
298
|
+
return _react["default"].createElement("div", {
|
|
299
|
+
className: "autosuggest__no-results"
|
|
300
|
+
}, _react["default"].createElement("p", {
|
|
301
|
+
className: "autosuggest__no-results-title"
|
|
302
|
+
}, "No matches found."), _react["default"].createElement("p", {
|
|
303
|
+
className: "autosuggest__no-results-subtitle"
|
|
304
|
+
}, "Please adjust your search and try again."));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (suggestion.isEmptyMessage && !suggestion.value) {
|
|
308
|
+
return _react["default"].createElement("div", {
|
|
309
|
+
className: "autosuggest__no-results"
|
|
310
|
+
}, _react["default"].createElement("p", {
|
|
311
|
+
className: "autosuggest__no-results-title"
|
|
312
|
+
}, "Type to search."), _react["default"].createElement("p", {
|
|
313
|
+
className: "autosuggest__no-results-subtitle"
|
|
314
|
+
}, "I'll find whataver I can as fast as I can."));
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return searchSuggestionAccessor(suggestion.record);
|
|
318
|
+
});
|
|
319
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "isFiltered", function () {
|
|
320
|
+
var enableFilter = _this.props.enableFilter;
|
|
321
|
+
var currentFilter = _this.state.currentFilter;
|
|
322
|
+
return currentFilter && currentFilter.length > 0 && enableFilter;
|
|
323
|
+
});
|
|
324
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getNoDataIcon", function () {
|
|
325
|
+
var _this$props = _this.props,
|
|
326
|
+
noDataIcon = _this$props.noDataIcon,
|
|
327
|
+
noFilteredMatchesIcon = _this$props.noFilteredMatchesIcon,
|
|
328
|
+
fetchError = _this$props.fetchError;
|
|
329
|
+
return fetchError ? 'caution' : _this.isFiltered() ? noFilteredMatchesIcon : noDataIcon;
|
|
330
|
+
});
|
|
331
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getNoDataHeadline", function () {
|
|
332
|
+
var _this$props2 = _this.props,
|
|
333
|
+
noDataHeadline = _this$props2.noDataHeadline,
|
|
334
|
+
noFilteredMatchesHeadline = _this$props2.noFilteredMatchesHeadline,
|
|
335
|
+
fetchError = _this$props2.fetchError;
|
|
336
|
+
return fetchError ? 'Data not available' : _this.isFiltered() ? noFilteredMatchesHeadline : noDataHeadline;
|
|
337
|
+
});
|
|
338
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getNoDataSubheadline", function () {
|
|
339
|
+
var _this$props3 = _this.props,
|
|
340
|
+
noDataSubheadline = _this$props3.noDataSubheadline,
|
|
341
|
+
noFilteredMatchesSubheadline = _this$props3.noFilteredMatchesSubheadline,
|
|
342
|
+
fetchError = _this$props3.fetchError;
|
|
343
|
+
return fetchError ? 'It looks like something went wrong.' : _this.isFiltered() ? noFilteredMatchesSubheadline : noDataSubheadline;
|
|
344
|
+
});
|
|
345
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getNoDataPrimaryAction", function () {
|
|
346
|
+
var _this$props4 = _this.props,
|
|
347
|
+
noDataPrimaryAction = _this$props4.noDataPrimaryAction,
|
|
348
|
+
noFilteredMatchesPrimaryActionText = _this$props4.noFilteredMatchesPrimaryActionText,
|
|
349
|
+
fetchError = _this$props4.fetchError;
|
|
350
|
+
return fetchError ? {
|
|
351
|
+
text: 'Try again',
|
|
352
|
+
onClick: function onClick() {
|
|
353
|
+
return window.location.reload();
|
|
354
|
+
}
|
|
355
|
+
} : _this.isFiltered() ? {
|
|
356
|
+
text: noFilteredMatchesPrimaryActionText,
|
|
357
|
+
onClick: function onClick() {
|
|
358
|
+
_this.updateFilter('');
|
|
359
|
+
},
|
|
360
|
+
type: 'submit'
|
|
361
|
+
} : noDataPrimaryAction;
|
|
362
|
+
});
|
|
363
|
+
_this.state = {
|
|
364
|
+
loading: false,
|
|
365
|
+
currentPage: 0,
|
|
366
|
+
limit: props.initialLimit || RECORD_TABLE_INITIAL_LIMIT,
|
|
367
|
+
selectedTab: props.initialSelectedTab,
|
|
368
|
+
sortColumn: props.initialSortColumn,
|
|
369
|
+
sortDirection: props.initialSortDirection || 'desc',
|
|
370
|
+
visibleRows: props.initialVisibleRows,
|
|
371
|
+
totalRows: props.totalRows,
|
|
372
|
+
currentFilter: '',
|
|
373
|
+
expandedRows: {}
|
|
374
|
+
};
|
|
375
|
+
return _this;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
(0, _createClass2["default"])(RecordTable, [{
|
|
379
|
+
key: "render",
|
|
380
|
+
value: function render() {
|
|
381
|
+
var _this2 = this;
|
|
382
|
+
|
|
383
|
+
var _this$props5 = this.props,
|
|
384
|
+
tabs = _this$props5.tabs,
|
|
385
|
+
columns = _this$props5.columns,
|
|
386
|
+
isSelectable = _this$props5.isSelectable,
|
|
387
|
+
handleClickRow = _this$props5.handleClickRow,
|
|
388
|
+
enableSearch = _this$props5.enableSearch,
|
|
389
|
+
enableFilter = _this$props5.enableFilter,
|
|
390
|
+
searchPlaceholder = _this$props5.searchPlaceholder,
|
|
391
|
+
noDataPrimaryActionButtonKind = _this$props5.noDataPrimaryActionButtonKind,
|
|
392
|
+
noDataPrimaryActionButtonIcon = _this$props5.noDataPrimaryActionButtonIcon,
|
|
393
|
+
tableSearchProps = _this$props5.tableSearchProps,
|
|
394
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props5, ["tabs", "columns", "isSelectable", "handleClickRow", "enableSearch", "enableFilter", "searchPlaceholder", "noDataPrimaryActionButtonKind", "noDataPrimaryActionButtonIcon", "tableSearchProps"]);
|
|
395
|
+
var _this$state2 = this.state,
|
|
396
|
+
currentPage = _this$state2.currentPage,
|
|
397
|
+
sortColumn = _this$state2.sortColumn,
|
|
398
|
+
loading = _this$state2.loading,
|
|
399
|
+
limit = _this$state2.limit,
|
|
400
|
+
selectedTab = _this$state2.selectedTab,
|
|
401
|
+
visibleRows = _this$state2.visibleRows,
|
|
402
|
+
totalRows = _this$state2.totalRows,
|
|
403
|
+
currentFilter = _this$state2.currentFilter,
|
|
404
|
+
expandedRows = _this$state2.expandedRows;
|
|
405
|
+
var defaultTableSearchProps = {
|
|
406
|
+
getSuggestionValue: function getSuggestionValue(value) {
|
|
407
|
+
return value.text;
|
|
408
|
+
},
|
|
409
|
+
getSuggestions: this.handleSearchSuggestions,
|
|
410
|
+
renderSuggestion: this.renderSuggestion,
|
|
411
|
+
onSuggestionSelected: function onSuggestionSelected() {},
|
|
412
|
+
id: ''
|
|
413
|
+
};
|
|
414
|
+
return _react["default"].createElement(_react.Fragment, null, tabs && _react["default"].createElement(_Tabs["default"], {
|
|
415
|
+
tabs: tabs.map(function (tab) {
|
|
416
|
+
return (0, _objectSpread2["default"])({}, tab, {
|
|
417
|
+
isCurrent: selectedTab === tab.key,
|
|
418
|
+
onClick: function onClick(e) {
|
|
419
|
+
_this2.handleClickTab(e, tab);
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}),
|
|
423
|
+
isPadded: true
|
|
424
|
+
}), enableSearch && _react["default"].createElement(_TableSearch["default"], (0, _extends2["default"])({
|
|
425
|
+
placeholder: searchPlaceholder
|
|
426
|
+
}, defaultTableSearchProps, tableSearchProps)), enableFilter && _react["default"].createElement("div", {
|
|
427
|
+
className: "table-search__wrapper"
|
|
428
|
+
}, _react["default"].createElement("div", {
|
|
429
|
+
className: "autosuggest__wrapper"
|
|
430
|
+
}, _react["default"].createElement(_Forms.TextInput, {
|
|
431
|
+
id: "record-table-filter",
|
|
432
|
+
value: currentFilter,
|
|
433
|
+
placeholder: searchPlaceholder,
|
|
434
|
+
onChange: function onChange(e) {
|
|
435
|
+
_this2.updateFilter(e.target.value);
|
|
436
|
+
},
|
|
437
|
+
isSmall: true
|
|
438
|
+
}), _react["default"].createElement(_Button["default"], {
|
|
439
|
+
isSmall: true,
|
|
440
|
+
className: "text-input__clear-btn",
|
|
441
|
+
icon: {
|
|
442
|
+
name: 'close'
|
|
443
|
+
},
|
|
444
|
+
onClick: function onClick() {
|
|
445
|
+
_this2.updateFilter('');
|
|
446
|
+
}
|
|
447
|
+
}))), _react["default"].createElement(_Table["default"], (0, _extends2["default"])({
|
|
448
|
+
className: "results-table",
|
|
449
|
+
isSelectable: isSelectable,
|
|
450
|
+
columns: columns,
|
|
451
|
+
defaultSorted: [{
|
|
452
|
+
id: sortColumn,
|
|
453
|
+
desc: false
|
|
454
|
+
}],
|
|
455
|
+
expanded: expandedRows,
|
|
456
|
+
onExpandedChange: function onExpandedChange(newExpanded) {
|
|
457
|
+
_this2.setState({
|
|
458
|
+
expandedRows: newExpanded
|
|
459
|
+
});
|
|
460
|
+
},
|
|
461
|
+
pageSize: Math.min(visibleRows.length, limit),
|
|
462
|
+
paginationProps: {
|
|
463
|
+
currentPage: currentPage,
|
|
464
|
+
showPages: Math.ceil(totalRows / limit) > 1,
|
|
465
|
+
onClickNext: function onClickNext() {
|
|
466
|
+
_this2.navigateToPage({
|
|
467
|
+
page: currentPage + 1
|
|
468
|
+
});
|
|
469
|
+
},
|
|
470
|
+
onClickBack: function onClickBack() {
|
|
471
|
+
_this2.navigateToPage({
|
|
472
|
+
page: currentPage - 1
|
|
473
|
+
});
|
|
474
|
+
},
|
|
475
|
+
onPageButtonClick: function onPageButtonClick(pageIdx) {
|
|
476
|
+
_this2.navigateToPage({
|
|
477
|
+
page: pageIdx
|
|
478
|
+
});
|
|
479
|
+
},
|
|
480
|
+
totalPages: Math.ceil(totalRows / limit)
|
|
481
|
+
},
|
|
482
|
+
manual: true,
|
|
483
|
+
loading: loading,
|
|
484
|
+
showPagination: totalRows >= limit,
|
|
485
|
+
data: visibleRows || [],
|
|
486
|
+
totalRows: totalRows,
|
|
487
|
+
onSortedChange: this.handleSortChanged,
|
|
488
|
+
onClickRow: handleClickRow,
|
|
489
|
+
key: "id",
|
|
490
|
+
NoDataComponent: loading && !currentFilter ? function () {
|
|
491
|
+
return _react["default"].createElement("div", {
|
|
492
|
+
className: "table__inner__loader"
|
|
493
|
+
}, _react["default"].createElement(_Loader["default"], null));
|
|
494
|
+
} : _EmptyState["default"],
|
|
495
|
+
getNoDataProps: function getNoDataProps() {
|
|
496
|
+
return {
|
|
497
|
+
icon: _this2.getNoDataIcon(),
|
|
498
|
+
headline: _this2.getNoDataHeadline(),
|
|
499
|
+
subheadline: _this2.getNoDataSubheadline(),
|
|
500
|
+
primaryAction: _this2.getNoDataPrimaryAction(),
|
|
501
|
+
primaryActionButtonKind: noDataPrimaryActionButtonKind,
|
|
502
|
+
primaryActionButtonIcon: noDataPrimaryActionButtonIcon
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
}, rest)));
|
|
506
|
+
} // TODO: Update the table based on the tab that was clicked
|
|
507
|
+
|
|
508
|
+
}]);
|
|
509
|
+
return RecordTable;
|
|
510
|
+
}(_react.Component);
|
|
511
|
+
|
|
512
|
+
(0, _defineProperty2["default"])(RecordTable, "defaultProps", {
|
|
513
|
+
enableFilter: false,
|
|
514
|
+
enableSearch: false,
|
|
515
|
+
initialLimit: RECORD_TABLE_INITIAL_LIMIT,
|
|
516
|
+
noFilteredMatchesHeadline: 'No matches found',
|
|
517
|
+
noFilteredMatchesIcon: 'no_matches',
|
|
518
|
+
noFilteredMatchesPrimaryActionText: 'Show All',
|
|
519
|
+
searchPlaceholder: 'Filter table...'
|
|
520
|
+
});
|
|
521
|
+
var _default = RecordTable;
|
|
522
|
+
exports["default"] = _default;
|
|
523
|
+
//# sourceMappingURL=RecordTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RecordTable/RecordTable.tsx"],"names":["RECORD_TABLE_INITIAL_LIMIT","RecordTable","props","setState","loading","fetchRecords","page","state","currentPage","visibleRows","totalRows","search","onNavigateToPage","expandedRows","filter","currentFilter","refresh","fetchOnMount","e","tab","onClickTab","cancel","payload","key","selectedTab","sortDirection","sortColumn","limit","offset","data","sorted","sort","id","desc","value","suggestions","length","map","record","text","name","isEmptyMessage","suggestion","searchSuggestionAccessor","enableFilter","noDataIcon","noFilteredMatchesIcon","fetchError","isFiltered","noDataHeadline","noFilteredMatchesHeadline","noDataSubheadline","noFilteredMatchesSubheadline","noDataPrimaryAction","noFilteredMatchesPrimaryActionText","onClick","window","location","reload","updateFilter","type","initialLimit","initialSelectedTab","initialSortColumn","initialSortDirection","initialVisibleRows","tabs","columns","isSelectable","handleClickRow","enableSearch","searchPlaceholder","noDataPrimaryActionButtonKind","noDataPrimaryActionButtonIcon","tableSearchProps","rest","defaultTableSearchProps","getSuggestionValue","getSuggestions","handleSearchSuggestions","renderSuggestion","onSuggestionSelected","isCurrent","handleClickTab","target","newExpanded","Math","min","showPages","ceil","onClickNext","navigateToPage","onClickBack","onPageButtonClick","pageIdx","totalPages","handleSortChanged","EmptyState","icon","getNoDataIcon","headline","getNoDataHeadline","subheadline","getNoDataSubheadline","primaryAction","getNoDataPrimaryAction","primaryActionButtonKind","primaryActionButtonIcon","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AAGA,IAAMA,0BAA0B,GAAG,EAAnC;;IAwIMC,W;;;;;AAWL,uBAAmBC,KAAnB,EAA6C;AAAA;;AAAA;AAC5C,uHAAMA,KAAN;AAD4C;AAAA;AAAA;AAAA;AAAA,iCAiB5B;AAAA;;AAAA;AAAA;AAAA;AAAA;AAChB,oBAAKC,QAAL,CAAc;AAAEC,gBAAAA,OAAO,EAAE;AAAX,eAAd;;AADgB;AAAA,qBAEyB,MAAKC,YAAL,CAAkB;AAC1DC,gBAAAA,IAAI,EAAE,MAAKC,KAAL,CAAWC;AADyC,eAAlB,CAFzB;;AAAA;AAAA;AAERC,cAAAA,WAFQ,SAERA,WAFQ;AAEKC,cAAAA,SAFL,SAEKA,SAFL;;AAKhB,oBAAKP,QAAL,CAAc;AAAEC,gBAAAA,OAAO,EAAE,KAAX;AAAkBK,gBAAAA,WAAW,EAAXA,WAAlB;AAA+BC,gBAAAA,SAAS,EAATA;AAA/B,eAAd;;AALgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAjB4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAyBrB;AAAA;;AAAA;AAAA;AAAA;AAAA;AACvBC,gBAAAA,MADuB,SACvBA,MADuB,EAEvBL,IAFuB,SAEvBA,IAFuB;AAAA,wCAOiB,MAAKJ,KAPtB,CAOfU,gBAPe,EAOfA,gBAPe,sCAOI,YAAM,CAAE,CAPZ;AAAA;AAAA;AAAA,uBAUmB,MAAKP,YAAL,CAAkB;AAC1DM,kBAAAA,M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AAA,cAAc,EAAE;AAAA,iBAAO;AACtBC,YAAAA,IAAI,EAAE,MAAI,CAACC,aAAL,EADgB;AAEtBC,YAAAA,QAAQ,EAAE,MAAI,CAACC,iBAAL,EAFY;AAGtBC,YAAAA,WAAW,EAAE,MAAI,CAACC,oBAAL,EAHS;AAItBC,YAAAA,aAAa,EAAE,MAAI,CAACC,sBAAL,EAJO;AAKtBC,YAAAA,uBAAuB,EAAElC,6BALH;AAMtBmC,YAAAA,uBAAuB,EAAElC;AANH,WAAP;AAAA;AAhDjB,SAwDKE,IAxDL,EAlDD,CADD;AA+GA,K,CAED;;;;EA1OyBiC,gB;;iCAApB3G,W,kBACoD;AACxD2C,EAAAA,YAAY,EAAE,KAD0C;AAExD0B,EAAAA,YAAY,EAAE,KAF0C;AAGxDT,EAAAA,YAAY,EAAE7D,0BAH0C;AAIxDkD,EAAAA,yBAAyB,EAAE,kBAJ6B;AAKxDJ,EAAAA,qBAAqB,EAAE,YALiC;AAMxDQ,EAAAA,kCAAkC,EAAE,UANoB;AAOxDiB,EAAAA,iBAAiB,EAAE;AAPqC,C;eAoa3CtE,W","sourcesContent":["import React, { Component, Fragment } from 'react'\nimport { default as Table, ITableProps } from '../Table/Table'\nimport {\n\tdefault as TableSearch,\n\tITableSearchProps\n} from '../Table/components/TableSearch/TableSearch'\nimport Tabs from '../Tabs/Tabs'\nimport { TextInput } from '../Forms'\nimport Button from '../Button/Button'\nimport EmptyState from '../EmptyState/EmptyState'\nimport Loader from '../Loader/Loader'\nimport { SortingRule } from 'react-table'\n\nconst RECORD_TABLE_INITIAL_LIMIT = 50\n\nexport interface IRecordTableFetchOptions {\n\tsortColumn: string\n\tsortDirection: 'asc' | 'desc'\n\toffset: number\n\tlimit: number\n\tsearch?: string\n\tselectedTab?: string\n}\n\nexport interface IRecordTableFetchResults {\n\tvisibleRows: Record<string, any>[]\n\ttotalRows: number\n}\n\nexport interface IRecordTableProps extends ITableProps {\n\t/** Singular noun describing the contents of this table */\n\tkind?: string\n\n\t/** Plural noun describing the contents of this table */\n\tpluralKind?: string\n\n\t/** for handling when a tab is selected, return false to stop tab form being set */\n\tonClickTab?: (\n\t\te: MouseEvent,\n\t\tdata: { idx?: number; key: string; payload?: Record<string, any> }\n\t) => boolean\n\n\t/** the tabs to render, passed to Tabs component. onClick is ignored */\n\ttabs?: any[]\n\n\t/** Should rows be selectable? */\n\tisSelectable?: boolean\n\n\t/** which tab to select at first */\n\tinitialSelectedTab?: string\n\n\t/** how to sort to start */\n\tinitialSortColumn: string\n\n\t/** direction to start (defaults to desc) */\n\tinitialSortDirection?: 'asc' | 'desc'\n\n\t/** starting limit, defaults to RECORD_TABLE_INITIAL_LIMIT */\n\tinitialLimit?: number\n\n\t/** The rows that should be visible when the table mounts */\n\tinitialVisibleRows: Record<string, any>[]\n\n\t/** The total possible number of rows this table may contain */\n\ttotalRows: number\n\n\t/** should we enable searching? */\n\tenableSearch?: boolean\n\n\t/** should we enable filtering? */\n\tenableFilter?: boolean\n\n\t/** placeholder to show for search */\n\tsearchPlaceholder?: string\n\n\t/** props to pass through to the table search component */\n\ttableSearchProps?: ITableSearchProps\n\n\t/** when rendering search results, this is how i'll know what to output */\n\tsearchSuggestionAccessor?: (suggestion: Record<string, any>) => any\n\n\t/** called anytime records need to be fetched */\n\tfetchRecords: (\n\t\toptions: IRecordTableFetchOptions\n\t) => Promise<IRecordTableFetchResults>\n\n\t/** table columns to be rendered TODO(TR) import Column interfaces */\n\tcolumns: Record<string, any>[]\n\n\t/** should I fetch all my data on mount? */\n\tfetchOnMount?: boolean\n\n\t/** Flag for error on fetching data */\n\tfetchError?: boolean\n\n\t/** passthrough to Table component */\n\thandleClickRow?: (\n\t\te: MouseEvent,\n\t\tmeta: { idx: number; item: Record<string, any> }\n\t) => void\n\n\t/** called when search suggestion is selected */\n\tonSelection?: (options: { selectedIds: (string | number)[] }) => void\n\n\t/** called when navigating to page */\n\tonNavigateToPage?: Function\n\n\t/** Icon to show if no results match the current filter */\n\tnoFilteredMatchesIcon?: string\n\t/** Headline to show if no results match the current filter */\n\tnoFilteredMatchesHeadline?: string\n\t/** Subhead to show if no results match the current filter */\n\tnoFilteredMatchesSubheadline?: string\n\t/** CTA Text to show if no results match the current filter */\n\tnoFilteredMatchesPrimaryActionText?: string\n\n\t/** Icon to show if no data is available to be loaded into the table */\n\tnoDataIcon?: string\n\t/** Headline to show if no data is available to be loaded into the table */\n\tnoDataHeadline?: string\n\t/** Subhead to show if no data is available to be loaded into the table */\n\tnoDataSubheadline?: string\n\t/** CTA Text to show if no data is available to be loaded into the table */\n\tnoDataPrimaryAction?: IPrimaryAction\n\t/** CTA Button kind to display if no data is available to be loaded into the table */\n\tnoDataPrimaryActionButtonKind?: string\n\t/** CTA Button Icon to display if no data is available to be loaded into the table */\n\tnoDataPrimaryActionButtonIcon?: string\n}\n\ninterface IPrimaryAction {\n\ttext: string\n\tonClick: (e: MouseEvent) => void\n\ttype: string\n}\n\ninterface IRecordTableState {\n\tselectedTab?: string\n\tcurrentPage: number\n\tlimit: number\n\tsortColumn: string\n\tsortDirection: 'asc' | 'desc'\n\tvisibleRows: Record<string, any>[]\n\ttotalRows: number\n\tloading: boolean\n\tcurrentFilter?: string\n\texpandedRows: Record<string, boolean>\n}\n\nclass RecordTable extends Component<IRecordTableProps, IRecordTableState> {\n\tpublic static defaultProps: Partial<IRecordTableProps> = {\n\t\tenableFilter: false,\n\t\tenableSearch: false,\n\t\tinitialLimit: RECORD_TABLE_INITIAL_LIMIT,\n\t\tnoFilteredMatchesHeadline: 'No matches found',\n\t\tnoFilteredMatchesIcon: 'no_matches',\n\t\tnoFilteredMatchesPrimaryActionText: 'Show All',\n\t\tsearchPlaceholder: 'Filter table...'\n\t}\n\n\tpublic constructor(props: IRecordTableProps) {\n\t\tsuper(props)\n\n\t\tthis.state = {\n\t\t\tloading: false,\n\t\t\tcurrentPage: 0,\n\t\t\tlimit: props.initialLimit || RECORD_TABLE_INITIAL_LIMIT,\n\t\t\tselectedTab: props.initialSelectedTab,\n\t\t\tsortColumn: props.initialSortColumn,\n\t\t\tsortDirection: props.initialSortDirection || 'desc',\n\t\t\tvisibleRows: props.initialVisibleRows,\n\t\t\ttotalRows: props.totalRows,\n\t\t\tcurrentFilter: '',\n\t\t\texpandedRows: {}\n\t\t}\n\t}\n\n\tpublic refresh = async () => {\n\t\tthis.setState({ loading: true })\n\t\tconst { visibleRows, totalRows } = await this.fetchRecords({\n\t\t\tpage: this.state.currentPage\n\t\t})\n\t\tthis.setState({ loading: false, visibleRows, totalRows })\n\t}\n\n\tpublic navigateToPage = async ({\n\t\tsearch,\n\t\tpage\n\t}: {\n\t\tsearch?: string\n\t\tpage: number\n\t}) => {\n\t\tconst { onNavigateToPage = () => {} } = this.props\n\n\t\ttry {\n\t\t\tconst { visibleRows, totalRows } = await this.fetchRecords({\n\t\t\t\tsearch,\n\t\t\t\tpage\n\t\t\t})\n\n\t\t\tonNavigateToPage({\n\t\t\t\tcurrentPage: page\n\t\t\t})\n\n\t\t\tthis.setState({\n\t\t\t\tcurrentPage: page,\n\t\t\t\tvisibleRows,\n\t\t\t\ttotalRows,\n\t\t\t\texpandedRows: {}\n\t\t\t})\n\t\t} catch (e) {\n\t\t\t// Nothing\n\t\t}\n\t}\n\n\tpublic updateFilter = (filter: string) => {\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tcurrentPage: 0,\n\t\t\t\tcurrentFilter: filter\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.refresh()\n\t\t\t}\n\t\t)\n\t}\n\n\tpublic componentDidMount = () => {\n\t\tif (this.props.fetchOnMount) {\n\t\t\tthis.refresh()\n\t\t}\n\t}\n\n\tpublic render(): React.ReactNode {\n\t\tconst {\n\t\t\ttabs,\n\t\t\tcolumns,\n\t\t\tisSelectable,\n\t\t\thandleClickRow,\n\t\t\tenableSearch,\n\t\t\tenableFilter,\n\t\t\tsearchPlaceholder,\n\t\t\tnoDataPrimaryActionButtonKind,\n\t\t\tnoDataPrimaryActionButtonIcon,\n\t\t\ttableSearchProps,\n\t\t\t...rest\n\t\t} = this.props\n\n\t\tconst {\n\t\t\tcurrentPage,\n\t\t\tsortColumn,\n\t\t\tloading,\n\t\t\tlimit,\n\t\t\tselectedTab,\n\t\t\tvisibleRows,\n\t\t\ttotalRows,\n\t\t\tcurrentFilter,\n\t\t\texpandedRows\n\t\t} = this.state\n\n\t\tconst defaultTableSearchProps: ITableSearchProps = {\n\t\t\tgetSuggestionValue(value) {\n\t\t\t\treturn value.text\n\t\t\t},\n\t\t\tgetSuggestions: this.handleSearchSuggestions,\n\t\t\trenderSuggestion: this.renderSuggestion,\n\t\t\tonSuggestionSelected: () => {},\n\t\t\tid: ''\n\t\t}\n\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t{tabs && (\n\t\t\t\t\t<Tabs\n\t\t\t\t\t\ttabs={tabs.map(tab => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...tab,\n\t\t\t\t\t\t\t\tisCurrent: selectedTab === tab.key,\n\t\t\t\t\t\t\t\tonClick: e => {\n\t\t\t\t\t\t\t\t\tthis.handleClickTab(e, tab)\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\tisPadded\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{enableSearch && (\n\t\t\t\t\t<TableSearch\n\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t\t{...defaultTableSearchProps}\n\t\t\t\t\t\t{...tableSearchProps}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{enableFilter && (\n\t\t\t\t\t<div className=\"table-search__wrapper\">\n\t\t\t\t\t\t<div className=\"autosuggest__wrapper\">\n\t\t\t\t\t\t\t<TextInput\n\t\t\t\t\t\t\t\tid=\"record-table-filter\"\n\t\t\t\t\t\t\t\tvalue={currentFilter}\n\t\t\t\t\t\t\t\tplaceholder={searchPlaceholder}\n\t\t\t\t\t\t\t\tonChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\t\t\t\t\t\t\tthis.updateFilter(e.target.value)\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\tclassName=\"text-input__clear-btn\"\n\t\t\t\t\t\t\t\ticon={{\n\t\t\t\t\t\t\t\t\tname: 'close'\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tthis.updateFilter('')\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t<Table\n\t\t\t\t\tclassName=\"results-table\"\n\t\t\t\t\tisSelectable={isSelectable}\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdefaultSorted={[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: sortColumn,\n\t\t\t\t\t\t\tdesc: false\n\t\t\t\t\t\t}\n\t\t\t\t\t]}\n\t\t\t\t\texpanded={expandedRows}\n\t\t\t\t\tonExpandedChange={newExpanded => {\n\t\t\t\t\t\tthis.setState({\n\t\t\t\t\t\t\texpandedRows: newExpanded\n\t\t\t\t\t\t})\n\t\t\t\t\t}}\n\t\t\t\t\tpageSize={Math.min(visibleRows.length, limit)}\n\t\t\t\t\tpaginationProps={{\n\t\t\t\t\t\tcurrentPage,\n\t\t\t\t\t\tshowPages: Math.ceil(totalRows / limit) > 1,\n\t\t\t\t\t\tonClickNext: () => {\n\t\t\t\t\t\t\tthis.navigateToPage({ page: currentPage + 1 })\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonClickBack: () => {\n\t\t\t\t\t\t\tthis.navigateToPage({ page: currentPage - 1 })\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonPageButtonClick: (pageIdx: number) => {\n\t\t\t\t\t\t\tthis.navigateToPage({ page: pageIdx })\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttotalPages: Math.ceil(totalRows / limit)\n\t\t\t\t\t}}\n\t\t\t\t\tmanual\n\t\t\t\t\tloading={loading}\n\t\t\t\t\tshowPagination={totalRows >= limit}\n\t\t\t\t\tdata={visibleRows || []}\n\t\t\t\t\ttotalRows={totalRows}\n\t\t\t\t\tonSortedChange={this.handleSortChanged}\n\t\t\t\t\tonClickRow={handleClickRow}\n\t\t\t\t\tkey=\"id\"\n\t\t\t\t\tNoDataComponent={\n\t\t\t\t\t\tloading && !currentFilter\n\t\t\t\t\t\t\t? () => (\n\t\t\t\t\t\t\t\t\t<div className=\"table__inner__loader\">\n\t\t\t\t\t\t\t\t\t\t<Loader />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: EmptyState\n\t\t\t\t\t}\n\t\t\t\t\tgetNoDataProps={() => ({\n\t\t\t\t\t\ticon: this.getNoDataIcon(),\n\t\t\t\t\t\theadline: this.getNoDataHeadline(),\n\t\t\t\t\t\tsubheadline: this.getNoDataSubheadline(),\n\t\t\t\t\t\tprimaryAction: this.getNoDataPrimaryAction(),\n\t\t\t\t\t\tprimaryActionButtonKind: noDataPrimaryActionButtonKind,\n\t\t\t\t\t\tprimaryActionButtonIcon: noDataPrimaryActionButtonIcon\n\t\t\t\t\t})}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</Fragment>\n\t\t)\n\t}\n\n\t// TODO: Update the table based on the tab that was clicked\n\tprivate handleClickTab = (e: MouseEvent, tab: any) => {\n\t\tconst { onClickTab } = this.props\n\t\tlet cancel = false\n\n\t\tif (onClickTab) {\n\t\t\tcancel =\n\t\t\t\tonClickTab(e, {\n\t\t\t\t\tpayload: tab.payload,\n\t\t\t\t\tkey: tab.key\n\t\t\t\t}) === false\n\t\t}\n\n\t\tif (!cancel) {\n\t\t\tthis.setState(\n\t\t\t\t{ currentPage: 0, selectedTab: tab.key, expandedRows: {} },\n\t\t\t\tthis.refresh\n\t\t\t)\n\t\t}\n\t}\n\n\tprivate fetchRecords = async ({\n\t\tsearch,\n\t\tpage\n\t}: {\n\t\tsearch?: string\n\t\tpage: number\n\t}) => {\n\t\tconst {\n\t\t\tsortDirection,\n\t\t\tsortColumn,\n\t\t\tlimit,\n\t\t\tselectedTab,\n\t\t\tcurrentFilter\n\t\t} = this.state\n\n\t\tconst offset = limit * page\n\n\t\tconst data = await this.props.fetchRecords({\n\t\t\tsortColumn,\n\t\t\tsortDirection,\n\t\t\tlimit,\n\t\t\toffset,\n\t\t\tselectedTab,\n\t\t\tsearch: search || currentFilter\n\t\t})\n\n\t\treturn data\n\t}\n\n\tprivate handleSortChanged = (sorted: SortingRule[]) => {\n\t\tconst sort: {\n\t\t\tsortColumn: string\n\t\t\tsortDirection: 'asc' | 'desc'\n\t\t} = {\n\t\t\tsortColumn: sorted[0].id,\n\t\t\tsortDirection: sorted[0].desc ? 'desc' : 'asc'\n\t\t}\n\n\t\tthis.setState(sort, this.refresh)\n\t}\n\n\tprivate handleSearchSuggestions = async (value: string) => {\n\t\tconst { currentPage } = this.state\n\t\tconst { visibleRows } = await this.fetchRecords({\n\t\t\tpage: currentPage,\n\t\t\tsearch: value\n\t\t})\n\n\t\tconst suggestions =\n\t\t\tvisibleRows.length > 0\n\t\t\t\t? visibleRows.map((record: Record<string, any>) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttext: record.name,\n\t\t\t\t\t\t\trecord\n\t\t\t\t\t\t}\n\t\t\t\t })\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: 'NO RESULTS',\n\t\t\t\t\t\t\tisEmptyMessage: true,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t}\n\t\t\t\t ]\n\n\t\treturn suggestions\n\t}\n\n\tprivate renderSuggestion = (suggestion: any) => {\n\t\tconst {\n\t\t\tsearchSuggestionAccessor = (/* record */) => (\n\t\t\t\t<Button\n\t\t\t\t\tisSmall\n\t\t\t\t\tclassName=\"autosuggest__list-item-inner\"\n\t\t\t\t\ttext={suggestion.text}\n\t\t\t\t/>\n\t\t\t)\n\t\t} = this.props\n\n\t\tif (suggestion.isEmptyMessage && suggestion.value) {\n\t\t\treturn (\n\t\t\t\t<div className=\"autosuggest__no-results\">\n\t\t\t\t\t<p className=\"autosuggest__no-results-title\">No matches found.</p>\n\t\t\t\t\t<p className=\"autosuggest__no-results-subtitle\">\n\t\t\t\t\t\tPlease adjust your search and try again.\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t)\n\t\t}\n\n\t\tif (suggestion.isEmptyMessage && !suggestion.value) {\n\t\t\treturn (\n\t\t\t\t<div className=\"autosuggest__no-results\">\n\t\t\t\t\t<p className=\"autosuggest__no-results-title\">Type to search.</p>\n\t\t\t\t\t<p className=\"autosuggest__no-results-subtitle\">\n\t\t\t\t\t\t{`I'll find whataver I can as fast as I can.`}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t)\n\t\t}\n\n\t\treturn searchSuggestionAccessor(suggestion.record)\n\t}\n\n\tprivate isFiltered = () => {\n\t\tconst { enableFilter } = this.props\n\t\tconst { currentFilter } = this.state\n\n\t\treturn currentFilter && currentFilter.length > 0 && enableFilter\n\t}\n\n\tprivate getNoDataIcon = () => {\n\t\tconst { noDataIcon, noFilteredMatchesIcon, fetchError } = this.props\n\n\t\treturn fetchError\n\t\t\t? 'caution'\n\t\t\t: this.isFiltered()\n\t\t\t? noFilteredMatchesIcon\n\t\t\t: noDataIcon\n\t}\n\n\tprivate getNoDataHeadline = () => {\n\t\tconst { noDataHeadline, noFilteredMatchesHeadline, fetchError } = this.props\n\n\t\treturn fetchError\n\t\t\t? 'Data not available'\n\t\t\t: this.isFiltered()\n\t\t\t? noFilteredMatchesHeadline\n\t\t\t: noDataHeadline\n\t}\n\n\tprivate getNoDataSubheadline = () => {\n\t\tconst {\n\t\t\tnoDataSubheadline,\n\t\t\tnoFilteredMatchesSubheadline,\n\t\t\tfetchError\n\t\t} = this.props\n\t\treturn fetchError\n\t\t\t? 'It looks like something went wrong.'\n\t\t\t: this.isFiltered()\n\t\t\t? noFilteredMatchesSubheadline\n\t\t\t: noDataSubheadline\n\t}\n\n\tprivate getNoDataPrimaryAction = () => {\n\t\tconst {\n\t\t\tnoDataPrimaryAction,\n\t\t\tnoFilteredMatchesPrimaryActionText,\n\t\t\tfetchError\n\t\t} = this.props\n\t\treturn fetchError\n\t\t\t? {\n\t\t\t\t\ttext: 'Try again',\n\t\t\t\t\tonClick: () => window.location.reload()\n\t\t\t }\n\t\t\t: this.isFiltered()\n\t\t\t? {\n\t\t\t\t\ttext: noFilteredMatchesPrimaryActionText,\n\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\tthis.updateFilter('')\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'submit'\n\t\t\t }\n\t\t\t: noDataPrimaryAction\n\t}\n}\n\nexport default RecordTable\n"],"file":"RecordTable.js"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@storybook/react");
|
|
8
|
+
|
|
9
|
+
var _react3 = require("@storybook/addon-knobs/react");
|
|
10
|
+
|
|
11
|
+
var _SplitButton = _interopRequireDefault(require("./SplitButton"));
|
|
12
|
+
|
|
13
|
+
var actions = [{
|
|
14
|
+
text: 'Another action',
|
|
15
|
+
onClick: function onClick() {
|
|
16
|
+
return console.log('CLICK');
|
|
17
|
+
}
|
|
18
|
+
}, {
|
|
19
|
+
text: 'Third action'
|
|
20
|
+
}, {
|
|
21
|
+
text: 'Yet another action'
|
|
22
|
+
}];
|
|
23
|
+
var stories = (0, _react2.storiesOf)('SplitButton', module);
|
|
24
|
+
stories.addDecorator(_react3.withKnobs);
|
|
25
|
+
stories.add('Primary', function () {
|
|
26
|
+
return _react["default"].createElement(_SplitButton["default"], {
|
|
27
|
+
defaultAction: {
|
|
28
|
+
text: (0, _react3.text)('defaultActionText', 'Do the default action')
|
|
29
|
+
},
|
|
30
|
+
actions: actions,
|
|
31
|
+
kind: "primary"
|
|
32
|
+
});
|
|
33
|
+
}).add('Primary Small', function () {
|
|
34
|
+
return _react["default"].createElement(_SplitButton["default"], {
|
|
35
|
+
defaultAction: {
|
|
36
|
+
text: (0, _react3.text)('defaultActionText', 'Do the default action')
|
|
37
|
+
},
|
|
38
|
+
actions: actions,
|
|
39
|
+
kind: "primary",
|
|
40
|
+
isSmall: true
|
|
41
|
+
});
|
|
42
|
+
}).add('Secondary', function () {
|
|
43
|
+
return _react["default"].createElement(_SplitButton["default"], {
|
|
44
|
+
defaultAction: {
|
|
45
|
+
text: (0, _react3.text)('defaultActionText', 'Do the default action')
|
|
46
|
+
},
|
|
47
|
+
actions: actions,
|
|
48
|
+
kind: "secondary"
|
|
49
|
+
});
|
|
50
|
+
}).add('Secondary Small', function () {
|
|
51
|
+
return _react["default"].createElement(_SplitButton["default"], {
|
|
52
|
+
defaultAction: {
|
|
53
|
+
text: (0, _react3.text)('defaultActionText', 'Do the default action')
|
|
54
|
+
},
|
|
55
|
+
actions: actions,
|
|
56
|
+
kind: "secondary",
|
|
57
|
+
isSmall: true
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=SplitButton-story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/SplitButton-story.js"],"names":["actions","text","onClick","console","log","stories","module","addDecorator","withKnobs","add"],"mappings":";;;;AAAA;;AACA;;AACA;;AAEA;;AAEA,IAAMA,OAAO,GAAG,CACf;AACCC,EAAAA,IAAI,EAAE,gBADP;AAECC,EAAAA,OAAO,EAAE;AAAA,WAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ,CAAN;AAAA;AAFV,CADe,EAKf;AACCH,EAAAA,IAAI,EAAE;AADP,CALe,EAQf;AACCA,EAAAA,IAAI,EAAE;AADP,CARe,CAAhB;AAaA,IAAMI,OAAO,GAAG,uBAAU,aAAV,EAAyBC,MAAzB,CAAhB;AAEAD,OAAO,CAACE,YAAR,CAAqBC,iBAArB;AAEAH,OAAO,CACLI,GADF,CACM,SADN,EACiB;AAAA,SACf,gCAAC,uBAAD;AACC,IAAA,aAAa,EAAE;AACdR,MAAAA,IAAI,EAAE,kBAAK,mBAAL,EAA0B,uBAA1B;AADQ,KADhB;AAIC,IAAA,OAAO,EAAED,OAJV;AAKC,IAAA,IAAI,EAAC;AALN,IADe;AAAA,CADjB,EAUES,GAVF,CAUM,eAVN,EAUuB;AAAA,SACrB,gCAAC,uBAAD;AACC,IAAA,aAAa,EAAE;AACdR,MAAAA,IAAI,EAAE,kBAAK,mBAAL,EAA0B,uBAA1B;AADQ,KADhB;AAIC,IAAA,OAAO,EAAED,OAJV;AAKC,IAAA,IAAI,EAAC,SALN;AAMC,IAAA,OAAO;AANR,IADqB;AAAA,CAVvB,EAoBES,GApBF,CAoBM,WApBN,EAoBmB;AAAA,SACjB,gCAAC,uBAAD;AACC,IAAA,aAAa,EAAE;AACdR,MAAAA,IAAI,EAAE,kBAAK,mBAAL,EAA0B,uBAA1B;AADQ,KADhB;AAIC,IAAA,OAAO,EAAED,OAJV;AAKC,IAAA,IAAI,EAAC;AALN,IADiB;AAAA,CApBnB,EA6BES,GA7BF,CA6BM,iBA7BN,EA6ByB;AAAA,SACvB,gCAAC,uBAAD;AACC,IAAA,aAAa,EAAE;AACdR,MAAAA,IAAI,EAAE,kBAAK,mBAAL,EAA0B,uBAA1B;AADQ,KADhB;AAIC,IAAA,OAAO,EAAED,OAJV;AAKC,IAAA,IAAI,EAAC,WALN;AAMC,IAAA,OAAO;AANR,IADuB;AAAA,CA7BzB","sourcesContent":["import React from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { withKnobs, text } from '@storybook/addon-knobs/react'\n\nimport SplitButton from './SplitButton'\n\nconst actions = [\n\t{\n\t\ttext: 'Another action',\n\t\tonClick: () => console.log('CLICK')\n\t},\n\t{\n\t\ttext: 'Third action'\n\t},\n\t{\n\t\ttext: 'Yet another action'\n\t}\n]\n\nconst stories = storiesOf('SplitButton', module)\n\nstories.addDecorator(withKnobs)\n\nstories\n\t.add('Primary', () => (\n\t\t<SplitButton\n\t\t\tdefaultAction={{\n\t\t\t\ttext: text('defaultActionText', 'Do the default action')\n\t\t\t}}\n\t\t\tactions={actions}\n\t\t\tkind=\"primary\"\n\t\t/>\n\t))\n\t.add('Primary Small', () => (\n\t\t<SplitButton\n\t\t\tdefaultAction={{\n\t\t\t\ttext: text('defaultActionText', 'Do the default action')\n\t\t\t}}\n\t\t\tactions={actions}\n\t\t\tkind=\"primary\"\n\t\t\tisSmall\n\t\t/>\n\t))\n\t.add('Secondary', () => (\n\t\t<SplitButton\n\t\t\tdefaultAction={{\n\t\t\t\ttext: text('defaultActionText', 'Do the default action')\n\t\t\t}}\n\t\t\tactions={actions}\n\t\t\tkind=\"secondary\"\n\t\t/>\n\t))\n\t.add('Secondary Small', () => (\n\t\t<SplitButton\n\t\t\tdefaultAction={{\n\t\t\t\ttext: text('defaultActionText', 'Do the default action')\n\t\t\t}}\n\t\t\tactions={actions}\n\t\t\tkind=\"secondary\"\n\t\t\tisSmall\n\t\t/>\n\t))\n"],"file":"SplitButton-story.js"}
|