@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,428 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
+
|
|
15
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
+
|
|
17
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
18
|
+
|
|
19
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
20
|
+
|
|
21
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
22
|
+
|
|
23
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
24
|
+
|
|
25
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
26
|
+
|
|
27
|
+
var _react2 = require("@storybook/react");
|
|
28
|
+
|
|
29
|
+
var _react3 = require("@storybook/addon-knobs/react");
|
|
30
|
+
|
|
31
|
+
var _tableData = require("../../../.storybook/data/tableData");
|
|
32
|
+
|
|
33
|
+
var _formik = require("formik");
|
|
34
|
+
|
|
35
|
+
var _index = _interopRequireWildcard(require("./index"));
|
|
36
|
+
|
|
37
|
+
var _Layout = _interopRequireWildcard(require("../Layout"));
|
|
38
|
+
|
|
39
|
+
var _Card = _interopRequireWildcard(require("../Card"));
|
|
40
|
+
|
|
41
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
42
|
+
|
|
43
|
+
var _Tabs = _interopRequireDefault(require("../Tabs/Tabs"));
|
|
44
|
+
|
|
45
|
+
var _Forms = require("../Forms");
|
|
46
|
+
|
|
47
|
+
var stories = (0, _react2.storiesOf)('Table', module);
|
|
48
|
+
stories.addDecorator(_react3.withKnobs);
|
|
49
|
+
var staticLocations = (0, _tableData.generateLocations)({
|
|
50
|
+
amount: 149
|
|
51
|
+
});
|
|
52
|
+
var columns = [{
|
|
53
|
+
Header: 'Public Name',
|
|
54
|
+
accessor: 'publicName',
|
|
55
|
+
// NOTE: It looks like with has to be passed here to override built-in inline styles
|
|
56
|
+
minWidth: 300,
|
|
57
|
+
maxWidth: 400,
|
|
58
|
+
Cell: function PublicNameCell(row) {
|
|
59
|
+
return _react["default"].createElement("a", {
|
|
60
|
+
href: "#"
|
|
61
|
+
}, row.value);
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
Header: 'Store',
|
|
65
|
+
accessor: 'storeNumber',
|
|
66
|
+
minWidth: 80,
|
|
67
|
+
maxWidth: 100
|
|
68
|
+
}, {
|
|
69
|
+
Header: 'Status',
|
|
70
|
+
accessor: 'status',
|
|
71
|
+
minWidth: 80,
|
|
72
|
+
maxWidth: 100
|
|
73
|
+
}, {
|
|
74
|
+
Header: 'Address',
|
|
75
|
+
accessor: 'address',
|
|
76
|
+
minWidth: 420,
|
|
77
|
+
maxWidth: 500
|
|
78
|
+
}];
|
|
79
|
+
|
|
80
|
+
var ExpandableEditableTable =
|
|
81
|
+
/*#__PURE__*/
|
|
82
|
+
function (_React$Component) {
|
|
83
|
+
(0, _inherits2["default"])(ExpandableEditableTable, _React$Component);
|
|
84
|
+
|
|
85
|
+
function ExpandableEditableTable(props) {
|
|
86
|
+
var _this;
|
|
87
|
+
|
|
88
|
+
(0, _classCallCheck2["default"])(this, ExpandableEditableTable);
|
|
89
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(ExpandableEditableTable).call(this, props));
|
|
90
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleChangeHours", function (e, location, dayId) {
|
|
91
|
+
var locations = _this.state.locations;
|
|
92
|
+
locations.forEach(function (l) {
|
|
93
|
+
if (l.id === location.id) {
|
|
94
|
+
var updatedSchedule = l.schedule.map(function (day) {
|
|
95
|
+
var updatedDay = day;
|
|
96
|
+
|
|
97
|
+
if (day.id === dayId) {
|
|
98
|
+
l.isDirty = true;
|
|
99
|
+
updatedDay.hours = e.target.value;
|
|
100
|
+
updatedDay.isDirty = true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return updatedDay;
|
|
104
|
+
});
|
|
105
|
+
l.schedule = updatedSchedule;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
_this.setState({
|
|
110
|
+
locations: locations
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleValidation",
|
|
114
|
+
/*#__PURE__*/
|
|
115
|
+
function () {
|
|
116
|
+
var _ref = (0, _asyncToGenerator2["default"])(
|
|
117
|
+
/*#__PURE__*/
|
|
118
|
+
_regenerator["default"].mark(function _callee(location, dayId) {
|
|
119
|
+
var errors, locations, updatedLocation, updatedScheduleDay;
|
|
120
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
121
|
+
while (1) {
|
|
122
|
+
switch (_context.prev = _context.next) {
|
|
123
|
+
case 0:
|
|
124
|
+
errors = {};
|
|
125
|
+
locations = _this.state.locations;
|
|
126
|
+
updatedLocation = locations.find(function (l) {
|
|
127
|
+
return l.id === location.id;
|
|
128
|
+
});
|
|
129
|
+
updatedScheduleDay = updatedLocation && updatedLocation.schedule.find(function (day) {
|
|
130
|
+
return day.id === dayId;
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
if (updatedLocation && updatedScheduleDay && !updatedScheduleDay.isDirty) {
|
|
134
|
+
updatedLocation.isDirty = true;
|
|
135
|
+
updatedScheduleDay.isDirty = true;
|
|
136
|
+
|
|
137
|
+
_this.setState({
|
|
138
|
+
locations: locations
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return _context.abrupt("return", errors);
|
|
143
|
+
|
|
144
|
+
case 6:
|
|
145
|
+
case "end":
|
|
146
|
+
return _context.stop();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, _callee);
|
|
150
|
+
}));
|
|
151
|
+
|
|
152
|
+
return function (_x, _x2) {
|
|
153
|
+
return _ref.apply(this, arguments);
|
|
154
|
+
};
|
|
155
|
+
}());
|
|
156
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleSaveHours",
|
|
157
|
+
/*#__PURE__*/
|
|
158
|
+
function () {
|
|
159
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(
|
|
160
|
+
/*#__PURE__*/
|
|
161
|
+
_regenerator["default"].mark(function _callee2(location, dayId, values) {
|
|
162
|
+
var locations, updatedLocation, updatedScheduleDay;
|
|
163
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
164
|
+
while (1) {
|
|
165
|
+
switch (_context2.prev = _context2.next) {
|
|
166
|
+
case 0:
|
|
167
|
+
locations = _this.state.locations;
|
|
168
|
+
updatedLocation = locations.find(function (l) {
|
|
169
|
+
return l.id === location.id;
|
|
170
|
+
});
|
|
171
|
+
updatedScheduleDay = updatedLocation && updatedLocation.schedule.find(function (day) {
|
|
172
|
+
return day.id === dayId;
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
if (updatedLocation && updatedScheduleDay) {
|
|
176
|
+
updatedScheduleDay.hours = values.hours || '';
|
|
177
|
+
updatedLocation.isDirty = false;
|
|
178
|
+
updatedScheduleDay.isDirty = false;
|
|
179
|
+
|
|
180
|
+
_this.setState({
|
|
181
|
+
locations: locations
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
case 4:
|
|
186
|
+
case "end":
|
|
187
|
+
return _context2.stop();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}, _callee2);
|
|
191
|
+
}));
|
|
192
|
+
|
|
193
|
+
return function (_x3, _x4, _x5) {
|
|
194
|
+
return _ref2.apply(this, arguments);
|
|
195
|
+
};
|
|
196
|
+
}());
|
|
197
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderStoreScheduleForRow", function (row) {
|
|
198
|
+
var location = _this.state.locations[row.index];
|
|
199
|
+
var schedule = location && location.schedule;
|
|
200
|
+
return schedule ? _react["default"].createElement(_react.Fragment, null, _react["default"].createElement(_Card.CardHeader, {
|
|
201
|
+
title: 'Store Schedule'
|
|
202
|
+
}), _react["default"].createElement(_index["default"], {
|
|
203
|
+
isSelectable: true,
|
|
204
|
+
className: "store-schedule-table",
|
|
205
|
+
data: schedule,
|
|
206
|
+
columns: [{
|
|
207
|
+
Header: 'Day',
|
|
208
|
+
accessor: 'day',
|
|
209
|
+
minWidth: 100,
|
|
210
|
+
maxWidth: 300
|
|
211
|
+
}, {
|
|
212
|
+
Header: 'Hours',
|
|
213
|
+
accessor: 'hours',
|
|
214
|
+
minWidth: 100,
|
|
215
|
+
maxWidth: 500
|
|
216
|
+
}],
|
|
217
|
+
collapseOnDataChange: false,
|
|
218
|
+
loading: false,
|
|
219
|
+
pageSize: schedule.length,
|
|
220
|
+
showPagination: false,
|
|
221
|
+
subComponentForRow: function subComponentForRow(row) {
|
|
222
|
+
return _react["default"].createElement(_Card.CardBody, null, _react["default"].createElement(_formik.Formik, {
|
|
223
|
+
initialValues: row.original,
|
|
224
|
+
validate: function validate(values) {
|
|
225
|
+
return _this.handleValidation(location, row.original.id, values);
|
|
226
|
+
},
|
|
227
|
+
render: function render(formikProps) {
|
|
228
|
+
var handleChange = formikProps.handleChange,
|
|
229
|
+
values = formikProps.values;
|
|
230
|
+
return _react["default"].createElement("form", {
|
|
231
|
+
onSubmit: formikProps.handleSubmit
|
|
232
|
+
}, _react["default"].createElement(_Forms.FormLayout, null, _react["default"].createElement(_Forms.FormLayoutGroup, null, _react["default"].createElement(_Forms.FormLayoutItem, null, _react["default"].createElement(_Forms.TextInput, {
|
|
233
|
+
label: "".concat(row.original.day, " Store Hours"),
|
|
234
|
+
onChange: handleChange,
|
|
235
|
+
name: "hours",
|
|
236
|
+
value: values.hours || ''
|
|
237
|
+
})), _react["default"].createElement(_Forms.FormLayoutItem, {
|
|
238
|
+
spacerTop: true
|
|
239
|
+
}, _react["default"].createElement(_Button["default"], {
|
|
240
|
+
kind: "primary",
|
|
241
|
+
onClick: function onClick() {
|
|
242
|
+
return _this.handleSaveHours(location, row.original.id, values);
|
|
243
|
+
},
|
|
244
|
+
disabled: !row.original.isDirty,
|
|
245
|
+
text: "Save"
|
|
246
|
+
})))));
|
|
247
|
+
}
|
|
248
|
+
}));
|
|
249
|
+
},
|
|
250
|
+
rowIsDirty: function rowIsDirty(row) {
|
|
251
|
+
return row.original.isDirty;
|
|
252
|
+
},
|
|
253
|
+
keyField: "id"
|
|
254
|
+
})) : null;
|
|
255
|
+
});
|
|
256
|
+
_this.state = {
|
|
257
|
+
locations: (0, _tableData.generateLocations)({
|
|
258
|
+
amount: 149
|
|
259
|
+
})
|
|
260
|
+
};
|
|
261
|
+
return _this;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
(0, _createClass2["default"])(ExpandableEditableTable, [{
|
|
265
|
+
key: "render",
|
|
266
|
+
value: function render() {
|
|
267
|
+
var locations = this.state.locations;
|
|
268
|
+
return _react["default"].createElement(_index["default"], {
|
|
269
|
+
className: "store-locations-table",
|
|
270
|
+
data: locations,
|
|
271
|
+
columns: columns,
|
|
272
|
+
sortable: true,
|
|
273
|
+
defaultPageSize: 50,
|
|
274
|
+
defaultSorted: [{
|
|
275
|
+
id: 'publicName',
|
|
276
|
+
desc: false
|
|
277
|
+
}],
|
|
278
|
+
loading: false,
|
|
279
|
+
collapseOnDataChange: false,
|
|
280
|
+
paginationProps: {
|
|
281
|
+
showPages: true,
|
|
282
|
+
onPageButtonClick: function onPageButtonClick() {
|
|
283
|
+
return console.log('onPageButtonClick');
|
|
284
|
+
},
|
|
285
|
+
totalPages: Math.ceil(locations.length / 50),
|
|
286
|
+
currentPage: 0
|
|
287
|
+
},
|
|
288
|
+
rowIsDirty: function rowIsDirty(row) {
|
|
289
|
+
return row.original.isDirty;
|
|
290
|
+
},
|
|
291
|
+
subComponentForRow: this.renderStoreScheduleForRow,
|
|
292
|
+
keyField: "id"
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}]);
|
|
296
|
+
return ExpandableEditableTable;
|
|
297
|
+
}(_react["default"].Component);
|
|
298
|
+
|
|
299
|
+
stories.add('Table', function () {
|
|
300
|
+
return _react["default"].createElement(_Layout["default"], {
|
|
301
|
+
width: "full-width"
|
|
302
|
+
}, _react["default"].createElement(_Layout.LayoutSection, null, _react["default"].createElement(_Card["default"], null, (0, _react3["boolean"])('Show Title', false) && _react["default"].createElement(_Card.CardHeader, {
|
|
303
|
+
title: (0, _react3.text)('Title', 'Locations')
|
|
304
|
+
}), (0, _react3["boolean"])('Show Tabs', false) && _react["default"].createElement(_Tabs["default"], {
|
|
305
|
+
tabs: [{
|
|
306
|
+
text: 'All locations',
|
|
307
|
+
isCurrent: true
|
|
308
|
+
}, {
|
|
309
|
+
text: 'Midwest'
|
|
310
|
+
}, {
|
|
311
|
+
text: 'Northeast'
|
|
312
|
+
}],
|
|
313
|
+
isPadded: true
|
|
314
|
+
}), _react["default"].createElement(_index.TableSearch, {
|
|
315
|
+
placeholder: "Search locations\u2026"
|
|
316
|
+
}), (0, _react3["boolean"])('Is Filtered', false) && _react["default"].createElement(_index.TableFilters, {
|
|
317
|
+
filters: [{
|
|
318
|
+
text: 'State: IL'
|
|
319
|
+
}, {
|
|
320
|
+
text: 'Status: Published'
|
|
321
|
+
}, {
|
|
322
|
+
text: 'City: Bolingbrook'
|
|
323
|
+
}, {
|
|
324
|
+
text: 'City: Chicago'
|
|
325
|
+
}, {
|
|
326
|
+
text: 'Chimera Hair Salon'
|
|
327
|
+
}]
|
|
328
|
+
}), _react["default"].createElement(_index["default"], {
|
|
329
|
+
className: "services-table",
|
|
330
|
+
data: staticLocations,
|
|
331
|
+
columns: columns,
|
|
332
|
+
sortable: true,
|
|
333
|
+
defaultPageSize: 50,
|
|
334
|
+
defaultSorted: [{
|
|
335
|
+
id: 'publicName',
|
|
336
|
+
desc: false
|
|
337
|
+
}],
|
|
338
|
+
loading: false,
|
|
339
|
+
paginationProps: {
|
|
340
|
+
showPages: true,
|
|
341
|
+
onPageButtonClick: function onPageButtonClick() {
|
|
342
|
+
return console.log('onPageButtonClick');
|
|
343
|
+
},
|
|
344
|
+
totalPages: Math.ceil(staticLocations.length / 50),
|
|
345
|
+
currentPage: 0
|
|
346
|
+
},
|
|
347
|
+
keyField: "id"
|
|
348
|
+
}))));
|
|
349
|
+
}).add('Expandable Table', function () {
|
|
350
|
+
return _react["default"].createElement(_Layout["default"], {
|
|
351
|
+
width: "full-width"
|
|
352
|
+
}, _react["default"].createElement(_Layout.LayoutSection, null, _react["default"].createElement(_Card["default"], null, _react["default"].createElement(ExpandableEditableTable, null))));
|
|
353
|
+
}).add('Selectable Table', function () {
|
|
354
|
+
return _react["default"].createElement(_Layout["default"], {
|
|
355
|
+
width: "full-width"
|
|
356
|
+
}, _react["default"].createElement(_Layout.LayoutSection, null, _react["default"].createElement(_Card["default"], null, (0, _react3["boolean"])('Show Title', false) && _react["default"].createElement(_Card.CardHeader, {
|
|
357
|
+
title: (0, _react3.text)('Title', 'Locations')
|
|
358
|
+
}), (0, _react3["boolean"])('Show Tabs', false) && _react["default"].createElement(_Tabs["default"], {
|
|
359
|
+
tabs: [{
|
|
360
|
+
text: 'All locations',
|
|
361
|
+
isCurrent: true
|
|
362
|
+
}, {
|
|
363
|
+
text: 'Midwest'
|
|
364
|
+
}, {
|
|
365
|
+
text: 'Northeast'
|
|
366
|
+
}],
|
|
367
|
+
isPadded: true
|
|
368
|
+
}), _react["default"].createElement(_index.TableSearch, {
|
|
369
|
+
placeholder: "Search locations\u2026"
|
|
370
|
+
}), (0, _react3["boolean"])('Is Filtered', false) && _react["default"].createElement(_index.TableFilters, {
|
|
371
|
+
filters: [{
|
|
372
|
+
text: 'State: IL'
|
|
373
|
+
}, {
|
|
374
|
+
text: 'Status: Published'
|
|
375
|
+
}, {
|
|
376
|
+
text: 'City: Bolingbrook'
|
|
377
|
+
}, {
|
|
378
|
+
text: 'City: Chicago'
|
|
379
|
+
}, {
|
|
380
|
+
text: 'Chimera Hair Salon'
|
|
381
|
+
}]
|
|
382
|
+
}), _react["default"].createElement(_index["default"], {
|
|
383
|
+
className: "services-table-selectable",
|
|
384
|
+
data: staticLocations,
|
|
385
|
+
columns: columns,
|
|
386
|
+
sortable: true,
|
|
387
|
+
defaultPageSize: 50,
|
|
388
|
+
defaultSorted: [{
|
|
389
|
+
id: 'publicName',
|
|
390
|
+
desc: false
|
|
391
|
+
}],
|
|
392
|
+
loading: false,
|
|
393
|
+
paginationProps: {
|
|
394
|
+
showPages: true,
|
|
395
|
+
onPageButtonClick: function onPageButtonClick() {
|
|
396
|
+
return console.log('onPageButtonClick');
|
|
397
|
+
},
|
|
398
|
+
totalPages: Math.ceil(staticLocations.length / 50),
|
|
399
|
+
currentPage: 0
|
|
400
|
+
},
|
|
401
|
+
isSelectable: true,
|
|
402
|
+
kind: "location",
|
|
403
|
+
selectType: "checkbox",
|
|
404
|
+
bulkActions: [{
|
|
405
|
+
text: 'Add to location group',
|
|
406
|
+
onClick: function onClick() {
|
|
407
|
+
return console.log('Click');
|
|
408
|
+
}
|
|
409
|
+
}, {
|
|
410
|
+
text: 'Make locations live',
|
|
411
|
+
onClick: function onClick() {
|
|
412
|
+
return console.log('Click');
|
|
413
|
+
}
|
|
414
|
+
}, {
|
|
415
|
+
text: 'Hide locations',
|
|
416
|
+
onClick: function onClick() {
|
|
417
|
+
return console.log('Click');
|
|
418
|
+
}
|
|
419
|
+
}, {
|
|
420
|
+
text: 'Delete locations',
|
|
421
|
+
onClick: function onClick() {
|
|
422
|
+
return console.log('Click');
|
|
423
|
+
}
|
|
424
|
+
}],
|
|
425
|
+
keyField: "id"
|
|
426
|
+
}))));
|
|
427
|
+
});
|
|
428
|
+
//# sourceMappingURL=Table-story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Table/Table-story.js"],"names":["stories","module","addDecorator","withKnobs","staticLocations","amount","columns","Header","accessor","minWidth","maxWidth","Cell","PublicNameCell","row","value","ExpandableEditableTable","props","e","location","dayId","locations","state","forEach","l","id","updatedSchedule","schedule","map","day","updatedDay","isDirty","hours","target","setState","errors","updatedLocation","find","updatedScheduleDay","values","index","length","original","handleValidation","formikProps","handleChange","handleSubmit","handleSaveHours","desc","showPages","onPageButtonClick","console","log","totalPages","Math","ceil","currentPage","renderStoreScheduleForRow","React","Component","add","text","isCurrent","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAOA,IAAMA,OAAO,GAAG,uBAAU,OAAV,EAAmBC,MAAnB,CAAhB;AAEAD,OAAO,CAACE,YAAR,CAAqBC,iBAArB;AAEA,IAAMC,eAAe,GAAG,kCAAkB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BC,IAAA,IAAI,EAAC,UApBN;AAqBC,IAAA,UAAU,EAAC,UArBZ;AAsBC,IAAA,WAAW,EAAE,CACZ;AACCK,MAAAA,IAAI,EAAE,uBADP;AAECE,MAAAA,OAAO,EAAE;AAAA,eAAMZ,OAAO,CAACC,GAAR,CAAY,OAAZ,CAAN;AAAA;AAFV,KADY,EAKZ;AACCS,MAAAA,IAAI,EAAE,qBADP;AAECE,MAAAA,OAAO,EAAE;AAAA,eAAMZ,OAAO,CAACC,GAAR,CAAY,OAAZ,CAAN;AAAA;AAFV,KALY,EASZ;AACCS,MAAAA,IAAI,EAAE,gBADP;AAECE,MAAAA,OAAO,EAAE;AAAA,eAAMZ,OAAO,CAACC,GAAR,CAAY,OAAZ,CAAN;AAAA;AAFV,KATY,EAaZ;AACCS,MAAAA,IAAI,EAAE,kBADP;AAECE,MAAAA,OAAO,EAAE;AAAA,eAAMZ,OAAO,CAACC,GAAR,CAAY,OAAZ,CAAN;AAAA;AAFV,KAbY,CAtBd;AAwCC,IAAA,QAAQ,EAAC;AAxCV,IA5BD,CADD,CADD,CADwB;AAAA,CAtE1B","sourcesContent":["// @flow\nimport React, { Fragment } from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { withKnobs, text, boolean } from '@storybook/addon-knobs/react'\nimport { generateLocations } from '../../../.storybook/data/tableData'\nimport { Formik } from 'formik'\nimport Table, { TableSearch, TableFilters } from './index'\nimport Layout, { LayoutSection } from '../Layout'\nimport Card, { CardHeader, CardBody } from '../Card'\nimport Button from '../Button/Button'\nimport Tabs from '../Tabs/Tabs'\nimport {\n\tTextInput,\n\tFormLayout,\n\tFormLayoutGroup,\n\tFormLayoutItem\n} from '../Forms'\n\nconst stories = storiesOf('Table', module)\n\nstories.addDecorator(withKnobs)\n\nconst staticLocations = generateLocations({ amount: 149 })\n\nconst columns = [\n\t{\n\t\tHeader: 'Public Name',\n\t\taccessor: 'publicName',\n\t\t// NOTE: It looks like with has to be passed here to override built-in inline styles\n\t\tminWidth: 300,\n\t\tmaxWidth: 400,\n\t\tCell: function PublicNameCell(row) {\n\t\t\treturn <a href=\"#\">{row.value}</a>\n\t\t}\n\t},\n\t{\n\t\tHeader: 'Store',\n\t\taccessor: 'storeNumber',\n\t\tminWidth: 80,\n\t\tmaxWidth: 100\n\t},\n\t{\n\t\tHeader: 'Status',\n\t\taccessor: 'status',\n\t\tminWidth: 80,\n\t\tmaxWidth: 100\n\t},\n\t{\n\t\tHeader: 'Address',\n\t\taccessor: 'address',\n\t\tminWidth: 420,\n\t\tmaxWidth: 500\n\t}\n]\n\ntype State = {\n\tlocations: Array<Object>\n}\n\ntype Props = {}\n\nclass ExpandableEditableTable extends React.Component<Props, State> {\n\tconstructor(props) {\n\t\tsuper(props)\n\t\tthis.state = {\n\t\t\tlocations: generateLocations({ amount: 149 })\n\t\t}\n\t}\n\n\thandleChangeHours = (e, location, dayId) => {\n\t\tconst { locations } = this.state\n\n\t\tlocations.forEach(l => {\n\t\t\tif (l.id === location.id) {\n\t\t\t\tconst updatedSchedule = l.schedule.map(day => {\n\t\t\t\t\tconst updatedDay = day\n\t\t\t\t\tif (day.id === dayId) {\n\t\t\t\t\t\tl.isDirty = true\n\t\t\t\t\t\tupdatedDay.hours = e.target.value\n\t\t\t\t\t\tupdatedDay.isDirty = true\n\t\t\t\t\t}\n\t\t\t\t\treturn updatedDay\n\t\t\t\t})\n\n\t\t\t\tl.schedule = updatedSchedule\n\t\t\t}\n\t\t})\n\n\t\tthis.setState({ locations })\n\t}\n\n\thandleValidation = async (location: Object, dayId) => {\n\t\tlet errors = {}\n\n\t\tconst { locations } = this.state\n\n\t\tconst updatedLocation = locations.find(l => l.id === location.id)\n\t\tconst updatedScheduleDay =\n\t\t\tupdatedLocation && updatedLocation.schedule.find(day => day.id === dayId)\n\n\t\tif (updatedLocation && updatedScheduleDay && !updatedScheduleDay.isDirty) {\n\t\t\tupdatedLocation.isDirty = true\n\t\t\tupdatedScheduleDay.isDirty = true\n\t\t\tthis.setState({ locations })\n\t\t}\n\n\t\treturn errors\n\t}\n\n\thandleSaveHours = async (location: Object, dayId, values) => {\n\t\tconst { locations } = this.state\n\n\t\tconst updatedLocation = locations.find(l => l.id === location.id)\n\t\tconst updatedScheduleDay =\n\t\t\tupdatedLocation && updatedLocation.schedule.find(day => day.id === dayId)\n\n\t\tif (updatedLocation && updatedScheduleDay) {\n\t\t\tupdatedScheduleDay.hours = values.hours || ''\n\t\t\tupdatedLocation.isDirty = false\n\t\t\tupdatedScheduleDay.isDirty = false\n\t\t\tthis.setState({ locations })\n\t\t}\n\t}\n\n\trenderStoreScheduleForRow = (row: Object) => {\n\t\tconst location = this.state.locations[row.index]\n\t\tconst schedule = location && location.schedule\n\t\treturn schedule ? (\n\t\t\t<Fragment>\n\t\t\t\t<CardHeader title={'Store Schedule'} />\n\t\t\t\t<Table\n\t\t\t\t\tisSelectable\n\t\t\t\t\tclassName=\"store-schedule-table\"\n\t\t\t\t\tdata={schedule}\n\t\t\t\t\tcolumns={[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tHeader: 'Day',\n\t\t\t\t\t\t\taccessor: 'day',\n\t\t\t\t\t\t\tminWidth: 100,\n\t\t\t\t\t\t\tmaxWidth: 300\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tHeader: 'Hours',\n\t\t\t\t\t\t\taccessor: 'hours',\n\t\t\t\t\t\t\tminWidth: 100,\n\t\t\t\t\t\t\tmaxWidth: 500\n\t\t\t\t\t\t}\n\t\t\t\t\t]}\n\t\t\t\t\tcollapseOnDataChange={false}\n\t\t\t\t\tloading={false}\n\t\t\t\t\tpageSize={schedule.length}\n\t\t\t\t\tshowPagination={false}\n\t\t\t\t\tsubComponentForRow={row => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t\t<Formik\n\t\t\t\t\t\t\t\t\tinitialValues={row.original}\n\t\t\t\t\t\t\t\t\tvalidate={values =>\n\t\t\t\t\t\t\t\t\t\tthis.handleValidation(location, row.original.id, values)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\trender={(formikProps: Object) => {\n\t\t\t\t\t\t\t\t\t\tconst { handleChange, values } = formikProps\n\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<form onSubmit={formikProps.handleSubmit}>\n\t\t\t\t\t\t\t\t\t\t\t\t<FormLayout>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<FormLayoutGroup>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<FormLayoutItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<TextInput\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={`${row.original.day} Store Hours`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname=\"hours\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={values.hours || ''}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</FormLayoutItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<FormLayoutItem spacerTop={true}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind=\"primary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.handleSaveHours(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocation,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trow.original.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!row.original.isDirty}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttext=\"Save\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</FormLayoutItem>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</FormLayoutGroup>\n\t\t\t\t\t\t\t\t\t\t\t\t</FormLayout>\n\t\t\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t\t)\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</CardBody>\n\t\t\t\t\t\t)\n\t\t\t\t\t}}\n\t\t\t\t\trowIsDirty={row => {\n\t\t\t\t\t\treturn row.original.isDirty\n\t\t\t\t\t}}\n\t\t\t\t\tkeyField=\"id\"\n\t\t\t\t/>\n\t\t\t</Fragment>\n\t\t) : null\n\t}\n\n\trender() {\n\t\tconst { locations } = this.state\n\n\t\treturn (\n\t\t\t<Table\n\t\t\t\tclassName=\"store-locations-table\"\n\t\t\t\tdata={locations}\n\t\t\t\tcolumns={columns}\n\t\t\t\tsortable={true}\n\t\t\t\tdefaultPageSize={50}\n\t\t\t\tdefaultSorted={[\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'publicName',\n\t\t\t\t\t\tdesc: false\n\t\t\t\t\t}\n\t\t\t\t]}\n\t\t\t\tloading={false}\n\t\t\t\tcollapseOnDataChange={false}\n\t\t\t\tpaginationProps={{\n\t\t\t\t\tshowPages: true,\n\t\t\t\t\tonPageButtonClick: () => console.log('onPageButtonClick'),\n\t\t\t\t\ttotalPages: Math.ceil(locations.length / 50),\n\t\t\t\t\tcurrentPage: 0\n\t\t\t\t}}\n\t\t\t\trowIsDirty={row => {\n\t\t\t\t\treturn row.original.isDirty\n\t\t\t\t}}\n\t\t\t\tsubComponentForRow={this.renderStoreScheduleForRow}\n\t\t\t\tkeyField=\"id\"\n\t\t\t/>\n\t\t)\n\t}\n}\n\nstories\n\t.add('Table', () => {\n\t\treturn (\n\t\t\t<Layout width=\"full-width\">\n\t\t\t\t<LayoutSection>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t{boolean('Show Title', false) && (\n\t\t\t\t\t\t\t<CardHeader title={text('Title', 'Locations')} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{boolean('Show Tabs', false) && (\n\t\t\t\t\t\t\t<Tabs\n\t\t\t\t\t\t\t\ttabs={[\n\t\t\t\t\t\t\t\t\t{ text: 'All locations', isCurrent: true },\n\t\t\t\t\t\t\t\t\t{ text: 'Midwest' },\n\t\t\t\t\t\t\t\t\t{ text: 'Northeast' }\n\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\tisPadded\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<TableSearch placeholder=\"Search locations…\" />\n\t\t\t\t\t\t{boolean('Is Filtered', false) && (\n\t\t\t\t\t\t\t<TableFilters\n\t\t\t\t\t\t\t\tfilters={[\n\t\t\t\t\t\t\t\t\t{ text: 'State: IL' },\n\t\t\t\t\t\t\t\t\t{ text: 'Status: Published' },\n\t\t\t\t\t\t\t\t\t{ text: 'City: Bolingbrook' },\n\t\t\t\t\t\t\t\t\t{ text: 'City: Chicago' },\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttext: 'Chimera Hair Salon'\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<Table\n\t\t\t\t\t\t\tclassName=\"services-table\"\n\t\t\t\t\t\t\tdata={staticLocations}\n\t\t\t\t\t\t\tcolumns={columns}\n\t\t\t\t\t\t\tsortable={true}\n\t\t\t\t\t\t\tdefaultPageSize={50}\n\t\t\t\t\t\t\tdefaultSorted={[\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tid: 'publicName',\n\t\t\t\t\t\t\t\t\tdesc: false\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\tloading={false}\n\t\t\t\t\t\t\tpaginationProps={{\n\t\t\t\t\t\t\t\tshowPages: true,\n\t\t\t\t\t\t\t\tonPageButtonClick: () => console.log('onPageButtonClick'),\n\t\t\t\t\t\t\t\ttotalPages: Math.ceil(staticLocations.length / 50),\n\t\t\t\t\t\t\t\tcurrentPage: 0\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tkeyField=\"id\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Card>\n\t\t\t\t</LayoutSection>\n\t\t\t</Layout>\n\t\t)\n\t})\n\t.add('Expandable Table', () => {\n\t\treturn (\n\t\t\t<Layout width=\"full-width\">\n\t\t\t\t<LayoutSection>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<ExpandableEditableTable />\n\t\t\t\t\t</Card>\n\t\t\t\t</LayoutSection>\n\t\t\t</Layout>\n\t\t)\n\t})\n\t.add('Selectable Table', () => (\n\t\t<Layout width=\"full-width\">\n\t\t\t<LayoutSection>\n\t\t\t\t<Card>\n\t\t\t\t\t{boolean('Show Title', false) && (\n\t\t\t\t\t\t<CardHeader title={text('Title', 'Locations')} />\n\t\t\t\t\t)}\n\t\t\t\t\t{boolean('Show Tabs', false) && (\n\t\t\t\t\t\t<Tabs\n\t\t\t\t\t\t\ttabs={[\n\t\t\t\t\t\t\t\t{ text: 'All locations', isCurrent: true },\n\t\t\t\t\t\t\t\t{ text: 'Midwest' },\n\t\t\t\t\t\t\t\t{ text: 'Northeast' }\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\tisPadded\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<TableSearch placeholder=\"Search locations…\" />\n\t\t\t\t\t{boolean('Is Filtered', false) && (\n\t\t\t\t\t\t<TableFilters\n\t\t\t\t\t\t\tfilters={[\n\t\t\t\t\t\t\t\t{ text: 'State: IL' },\n\t\t\t\t\t\t\t\t{ text: 'Status: Published' },\n\t\t\t\t\t\t\t\t{ text: 'City: Bolingbrook' },\n\t\t\t\t\t\t\t\t{ text: 'City: Chicago' },\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttext: 'Chimera Hair Salon'\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)}\n\t\t\t\t\t<Table\n\t\t\t\t\t\tclassName=\"services-table-selectable\"\n\t\t\t\t\t\tdata={staticLocations}\n\t\t\t\t\t\tcolumns={columns}\n\t\t\t\t\t\tsortable={true}\n\t\t\t\t\t\tdefaultPageSize={50}\n\t\t\t\t\t\tdefaultSorted={[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: 'publicName',\n\t\t\t\t\t\t\t\tdesc: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]}\n\t\t\t\t\t\tloading={false}\n\t\t\t\t\t\tpaginationProps={{\n\t\t\t\t\t\t\tshowPages: true,\n\t\t\t\t\t\t\tonPageButtonClick: () => console.log('onPageButtonClick'),\n\t\t\t\t\t\t\ttotalPages: Math.ceil(staticLocations.length / 50),\n\t\t\t\t\t\t\tcurrentPage: 0\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tisSelectable\n\t\t\t\t\t\tkind=\"location\"\n\t\t\t\t\t\tselectType=\"checkbox\"\n\t\t\t\t\t\tbulkActions={[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: 'Add to location group',\n\t\t\t\t\t\t\t\tonClick: () => console.log('Click')\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: 'Make locations live',\n\t\t\t\t\t\t\t\tonClick: () => console.log('Click')\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: 'Hide locations',\n\t\t\t\t\t\t\t\tonClick: () => console.log('Click')\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: 'Delete locations',\n\t\t\t\t\t\t\t\tonClick: () => console.log('Click')\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]}\n\t\t\t\t\t\tkeyField=\"id\"\n\t\t\t\t\t/>\n\t\t\t\t</Card>\n\t\t\t</LayoutSection>\n\t\t</Layout>\n\t))\n"],"file":"Table-story.js"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Component, ReactElement } from 'react';
|
|
2
|
+
import { TableProps } from 'react-table';
|
|
3
|
+
import { IButtonProps } from '../Button/Button';
|
|
4
|
+
export interface ITableProps extends Partial<TableProps> {
|
|
5
|
+
/** Table data */
|
|
6
|
+
data: Record<string, any>[];
|
|
7
|
+
/** The total number of rows which this table can access */
|
|
8
|
+
totalRows: number;
|
|
9
|
+
/** Columns of the table */
|
|
10
|
+
columns: Record<string, any>[];
|
|
11
|
+
/** Set true if the table rows can be selected */
|
|
12
|
+
isSelectable?: boolean;
|
|
13
|
+
/** any Id's that are selected by default when the page loads */
|
|
14
|
+
initialSelectedIds?: (string | number)[];
|
|
15
|
+
/** The kind of data this table displays. This will affect the text shown when at least one row is selected. */
|
|
16
|
+
kind?: string;
|
|
17
|
+
/** Optional text for pluralization when multiple rows are selected */
|
|
18
|
+
pluralKind?: string;
|
|
19
|
+
/** Pagination component props */
|
|
20
|
+
paginationProps?: any;
|
|
21
|
+
/** Enable bulk actions for selectable tables */
|
|
22
|
+
bulkActions?: IButtonProps[];
|
|
23
|
+
/** Handle clicking on a row */
|
|
24
|
+
onClickRow?: (e: MouseEvent, meta: {
|
|
25
|
+
idx: number;
|
|
26
|
+
item: Record<string, any>;
|
|
27
|
+
}) => void;
|
|
28
|
+
/** Callback when selection changes */
|
|
29
|
+
onSelection?: (options: {
|
|
30
|
+
selectedIds: (string | number)[];
|
|
31
|
+
}) => void;
|
|
32
|
+
/** No data available */
|
|
33
|
+
noDataIcon?: string;
|
|
34
|
+
noDataHeadline?: string;
|
|
35
|
+
noDataSubheadline?: string;
|
|
36
|
+
noDataPrimaryAction?: IPrimaryAction;
|
|
37
|
+
noDataPrimaryActionButtonKind?: string;
|
|
38
|
+
noDataPrimaryActionButtonIcon?: string;
|
|
39
|
+
/** Return a nested sub-component to be added as an expansion level for designated row. */
|
|
40
|
+
subComponentForRow?: (row: Record<string, any>) => any;
|
|
41
|
+
/** Called any time row props are updated. Return true if the given row should appear dirty. */
|
|
42
|
+
rowIsDirty?: (row: Record<string, any>) => boolean;
|
|
43
|
+
}
|
|
44
|
+
interface IPrimaryAction {
|
|
45
|
+
text: string;
|
|
46
|
+
onClick: (e: MouseEvent) => void;
|
|
47
|
+
type: string;
|
|
48
|
+
}
|
|
49
|
+
interface ITableState {
|
|
50
|
+
selectedIds: (string | number)[];
|
|
51
|
+
allRowsSelected: boolean;
|
|
52
|
+
}
|
|
53
|
+
export default class Table extends Component<ITableProps, ITableState> {
|
|
54
|
+
private static defaultProps;
|
|
55
|
+
private table;
|
|
56
|
+
constructor(props: ITableProps);
|
|
57
|
+
render(): ReactElement;
|
|
58
|
+
private handleChange;
|
|
59
|
+
private handleSelectAll;
|
|
60
|
+
private handleClickRow;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAY,YAAY,EAAE,MAAM,OAAO,CAAA;AAChE,OAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AASpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,UAAU,CAAC;IACvD,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;I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