@qoretechnologies/reqore 0.20.1 → 0.20.2
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/dist/src/components/Breadcrumbs/index.d.ts +33 -0
- package/dist/src/components/Breadcrumbs/index.d.ts.map +1 -0
- package/dist/src/components/Breadcrumbs/index.js +167 -0
- package/dist/src/components/Breadcrumbs/index.js.map +1 -0
- package/dist/src/components/Breadcrumbs/item.d.ts +14 -0
- package/dist/src/components/Breadcrumbs/item.d.ts.map +1 -0
- package/dist/src/components/Breadcrumbs/item.js +84 -0
- package/dist/src/components/Breadcrumbs/item.js.map +1 -0
- package/dist/src/components/Button/index.d.ts +33 -0
- package/dist/src/components/Button/index.d.ts.map +1 -0
- package/dist/src/components/Button/index.js +154 -0
- package/dist/src/components/Button/index.js.map +1 -0
- package/dist/src/components/Checkbox/index.d.ts +26 -0
- package/dist/src/components/Checkbox/index.d.ts.map +1 -0
- package/dist/src/components/Checkbox/index.js +108 -0
- package/dist/src/components/Checkbox/index.js.map +1 -0
- package/dist/src/components/Columns/column.d.ts +5 -0
- package/dist/src/components/Columns/column.d.ts.map +1 -0
- package/dist/src/components/Columns/column.js +37 -0
- package/dist/src/components/Columns/column.js.map +1 -0
- package/dist/src/components/Columns/index.d.ts +17 -0
- package/dist/src/components/Columns/index.d.ts.map +1 -0
- package/dist/src/components/Columns/index.js +69 -0
- package/dist/src/components/Columns/index.js.map +1 -0
- package/dist/src/components/Comment/index.d.ts +24 -0
- package/dist/src/components/Comment/index.d.ts.map +1 -0
- package/dist/src/components/Comment/index.js +71 -0
- package/dist/src/components/Comment/index.js.map +1 -0
- package/dist/src/components/CommentFeed/index.d.ts +7 -0
- package/dist/src/components/CommentFeed/index.d.ts.map +1 -0
- package/dist/src/components/CommentFeed/index.js +49 -0
- package/dist/src/components/CommentFeed/index.js.map +1 -0
- package/dist/src/components/Content/index.d.ts +11 -0
- package/dist/src/components/Content/index.d.ts.map +1 -0
- package/dist/src/components/Content/index.js +70 -0
- package/dist/src/components/Content/index.js.map +1 -0
- package/dist/src/components/Content/wrapper.d.ts +11 -0
- package/dist/src/components/Content/wrapper.d.ts.map +1 -0
- package/dist/src/components/Content/wrapper.js +43 -0
- package/dist/src/components/Content/wrapper.js.map +1 -0
- package/dist/src/components/ControlGroup/index.d.ts +17 -0
- package/dist/src/components/ControlGroup/index.d.ts.map +1 -0
- package/dist/src/components/ControlGroup/index.js +90 -0
- package/dist/src/components/ControlGroup/index.js.map +1 -0
- package/dist/src/components/Drawer/index.d.ts +36 -0
- package/dist/src/components/Drawer/index.d.ts.map +1 -0
- package/dist/src/components/Drawer/index.js +251 -0
- package/dist/src/components/Drawer/index.js.map +1 -0
- package/dist/src/components/Dropdown/index.d.ts +24 -0
- package/dist/src/components/Dropdown/index.d.ts.map +1 -0
- package/dist/src/components/Dropdown/index.js +38 -0
- package/dist/src/components/Dropdown/index.js.map +1 -0
- package/dist/src/components/Dropdown/item.d.ts +10 -0
- package/dist/src/components/Dropdown/item.d.ts.map +1 -0
- package/dist/src/components/Dropdown/item.js +35 -0
- package/dist/src/components/Dropdown/item.js.map +1 -0
- package/dist/src/components/Dropdown/list.d.ts +14 -0
- package/dist/src/components/Dropdown/list.d.ts.map +1 -0
- package/dist/src/components/Dropdown/list.js +47 -0
- package/dist/src/components/Dropdown/list.js.map +1 -0
- package/dist/src/components/Header/index.d.ts +13 -0
- package/dist/src/components/Header/index.d.ts.map +1 -0
- package/dist/src/components/Header/index.js +44 -0
- package/dist/src/components/Header/index.js.map +1 -0
- package/dist/src/components/Icon/index.d.ts +16 -0
- package/dist/src/components/Icon/index.d.ts.map +1 -0
- package/dist/src/components/Icon/index.js +81 -0
- package/dist/src/components/Icon/index.js.map +1 -0
- package/dist/src/components/Input/index.d.ts +33 -0
- package/dist/src/components/Input/index.d.ts.map +1 -0
- package/dist/src/components/Input/index.js +115 -0
- package/dist/src/components/Input/index.js.map +1 -0
- package/dist/src/components/InputClearButton/index.d.ts +10 -0
- package/dist/src/components/InputClearButton/index.d.ts.map +1 -0
- package/dist/src/components/InputClearButton/index.js +49 -0
- package/dist/src/components/InputClearButton/index.js.map +1 -0
- package/dist/src/components/InternalPopover/index.d.ts +7 -0
- package/dist/src/components/InternalPopover/index.d.ts.map +1 -0
- package/dist/src/components/InternalPopover/index.js +132 -0
- package/dist/src/components/InternalPopover/index.js.map +1 -0
- package/dist/src/components/Layout/content.d.ts +8 -0
- package/dist/src/components/Layout/content.d.ts.map +1 -0
- package/dist/src/components/Layout/content.js +41 -0
- package/dist/src/components/Layout/content.js.map +1 -0
- package/dist/src/components/Layout/index.d.ts +8 -0
- package/dist/src/components/Layout/index.d.ts.map +1 -0
- package/dist/src/components/Layout/index.js +69 -0
- package/dist/src/components/Layout/index.js.map +1 -0
- package/dist/src/components/Menu/divider.d.ts +7 -0
- package/dist/src/components/Menu/divider.d.ts.map +1 -0
- package/dist/src/components/Menu/divider.js +49 -0
- package/dist/src/components/Menu/divider.js.map +1 -0
- package/dist/src/components/Menu/index.d.ts +17 -0
- package/dist/src/components/Menu/index.d.ts.map +1 -0
- package/dist/src/components/Menu/index.js +89 -0
- package/dist/src/components/Menu/index.js.map +1 -0
- package/dist/src/components/Menu/item.d.ts +31 -0
- package/dist/src/components/Menu/item.d.ts.map +1 -0
- package/dist/src/components/Menu/item.js +121 -0
- package/dist/src/components/Menu/item.js.map +1 -0
- package/dist/src/components/Message/index.d.ts +25 -0
- package/dist/src/components/Message/index.d.ts.map +1 -0
- package/dist/src/components/Message/index.js +54 -0
- package/dist/src/components/Message/index.js.map +1 -0
- package/dist/src/components/Modal/actions.d.ts +6 -0
- package/dist/src/components/Modal/actions.d.ts.map +1 -0
- package/dist/src/components/Modal/actions.js +49 -0
- package/dist/src/components/Modal/actions.js.map +1 -0
- package/dist/src/components/Modal/content.d.ts +6 -0
- package/dist/src/components/Modal/content.d.ts.map +1 -0
- package/dist/src/components/Modal/content.js +25 -0
- package/dist/src/components/Modal/content.js.map +1 -0
- package/dist/src/components/Modal/index.d.ts +14 -0
- package/dist/src/components/Modal/index.d.ts.map +1 -0
- package/dist/src/components/Modal/index.js +33 -0
- package/dist/src/components/Modal/index.js.map +1 -0
- package/dist/src/components/Navbar/divider.d.ts +9 -0
- package/dist/src/components/Navbar/divider.d.ts.map +1 -0
- package/dist/src/components/Navbar/divider.js +47 -0
- package/dist/src/components/Navbar/divider.js.map +1 -0
- package/dist/src/components/Navbar/group.d.ts +15 -0
- package/dist/src/components/Navbar/group.d.ts.map +1 -0
- package/dist/src/components/Navbar/group.js +75 -0
- package/dist/src/components/Navbar/group.js.map +1 -0
- package/dist/src/components/Navbar/index.d.ts +16 -0
- package/dist/src/components/Navbar/index.d.ts.map +1 -0
- package/dist/src/components/Navbar/index.js +86 -0
- package/dist/src/components/Navbar/index.js.map +1 -0
- package/dist/src/components/Navbar/item.d.ts +16 -0
- package/dist/src/components/Navbar/item.d.ts.map +1 -0
- package/dist/src/components/Navbar/item.js +81 -0
- package/dist/src/components/Navbar/item.js.map +1 -0
- package/dist/src/components/Notifications/index.d.ts +12 -0
- package/dist/src/components/Notifications/index.d.ts.map +1 -0
- package/dist/src/components/Notifications/index.js +60 -0
- package/dist/src/components/Notifications/index.js.map +1 -0
- package/dist/src/components/Notifications/notification.d.ts +43 -0
- package/dist/src/components/Notifications/notification.d.ts.map +1 -0
- package/dist/src/components/Notifications/notification.js +140 -0
- package/dist/src/components/Notifications/notification.js.map +1 -0
- package/dist/src/components/Panel/index.d.ts +49 -0
- package/dist/src/components/Panel/index.d.ts.map +1 -0
- package/dist/src/components/Panel/index.js +172 -0
- package/dist/src/components/Panel/index.js.map +1 -0
- package/dist/src/components/Panel/panel.screenshot.d.ts +3 -0
- package/dist/src/components/Panel/panel.screenshot.d.ts.map +1 -0
- package/dist/src/components/Panel/panel.screenshot.js +30 -0
- package/dist/src/components/Panel/panel.screenshot.js.map +1 -0
- package/dist/src/components/Paragraph/index.d.ts +8 -0
- package/dist/src/components/Paragraph/index.d.ts.map +1 -0
- package/dist/src/components/Paragraph/index.js +64 -0
- package/dist/src/components/Paragraph/index.js.map +1 -0
- package/dist/src/components/Popover/index.d.ts +16 -0
- package/dist/src/components/Popover/index.d.ts.map +1 -0
- package/dist/src/components/Popover/index.js +55 -0
- package/dist/src/components/Popover/index.js.map +1 -0
- package/dist/src/components/RadioGroup/index.d.ts +17 -0
- package/dist/src/components/RadioGroup/index.d.ts.map +1 -0
- package/dist/src/components/RadioGroup/index.js +48 -0
- package/dist/src/components/RadioGroup/index.js.map +1 -0
- package/dist/src/components/Sidebar/index.d.ts +60 -0
- package/dist/src/components/Sidebar/index.d.ts.map +1 -0
- package/dist/src/components/Sidebar/index.js +265 -0
- package/dist/src/components/Sidebar/index.js.map +1 -0
- package/dist/src/components/Sidebar/item.d.ts +36 -0
- package/dist/src/components/Sidebar/item.d.ts.map +1 -0
- package/dist/src/components/Sidebar/item.js +106 -0
- package/dist/src/components/Sidebar/item.js.map +1 -0
- package/dist/src/components/Table/body.d.ts +10 -0
- package/dist/src/components/Table/body.d.ts.map +1 -0
- package/dist/src/components/Table/body.js +44 -0
- package/dist/src/components/Table/body.js.map +1 -0
- package/dist/src/components/Table/header.d.ts +29 -0
- package/dist/src/components/Table/header.d.ts.map +1 -0
- package/dist/src/components/Table/header.js +106 -0
- package/dist/src/components/Table/header.js.map +1 -0
- package/dist/src/components/Table/headerCell.d.ts +18 -0
- package/dist/src/components/Table/headerCell.d.ts.map +1 -0
- package/dist/src/components/Table/headerCell.js +92 -0
- package/dist/src/components/Table/headerCell.js.map +1 -0
- package/dist/src/components/Table/helpers.d.ts +8 -0
- package/dist/src/components/Table/helpers.d.ts.map +1 -0
- package/dist/src/components/Table/helpers.js +41 -0
- package/dist/src/components/Table/helpers.js.map +1 -0
- package/dist/src/components/Table/index.d.ts +75 -0
- package/dist/src/components/Table/index.d.ts.map +1 -0
- package/dist/src/components/Table/index.js +165 -0
- package/dist/src/components/Table/index.js.map +1 -0
- package/dist/src/components/Table/row.d.ts +58 -0
- package/dist/src/components/Table/row.d.ts.map +1 -0
- package/dist/src/components/Table/row.js +204 -0
- package/dist/src/components/Table/row.js.map +1 -0
- package/dist/src/components/Tabs/content.d.ts +8 -0
- package/dist/src/components/Tabs/content.d.ts.map +1 -0
- package/dist/src/components/Tabs/content.js +41 -0
- package/dist/src/components/Tabs/content.js.map +1 -0
- package/dist/src/components/Tabs/index.d.ts +39 -0
- package/dist/src/components/Tabs/index.d.ts.map +1 -0
- package/dist/src/components/Tabs/index.js +83 -0
- package/dist/src/components/Tabs/index.js.map +1 -0
- package/dist/src/components/Tabs/item.d.ts +23 -0
- package/dist/src/components/Tabs/item.d.ts.map +1 -0
- package/dist/src/components/Tabs/item.js +71 -0
- package/dist/src/components/Tabs/item.js.map +1 -0
- package/dist/src/components/Tabs/list.d.ts +17 -0
- package/dist/src/components/Tabs/list.d.ts.map +1 -0
- package/dist/src/components/Tabs/list.js +189 -0
- package/dist/src/components/Tabs/list.js.map +1 -0
- package/dist/src/components/Tag/group.d.ts +10 -0
- package/dist/src/components/Tag/group.d.ts.map +1 -0
- package/dist/src/components/Tag/group.js +50 -0
- package/dist/src/components/Tag/group.js.map +1 -0
- package/dist/src/components/Tag/index.d.ts +36 -0
- package/dist/src/components/Tag/index.d.ts.map +1 -0
- package/dist/src/components/Tag/index.js +136 -0
- package/dist/src/components/Tag/index.js.map +1 -0
- package/dist/src/components/Textarea/index.d.ts +26 -0
- package/dist/src/components/Textarea/index.d.ts.map +1 -0
- package/dist/src/components/Textarea/index.js +85 -0
- package/dist/src/components/Textarea/index.js.map +1 -0
- package/dist/src/components/TimeAgo/index.d.ts +4 -0
- package/dist/src/components/TimeAgo/index.d.ts.map +1 -0
- package/dist/src/components/TimeAgo/index.js +21 -0
- package/dist/src/components/TimeAgo/index.js.map +1 -0
- package/dist/src/components/Tree/index.d.ts +16 -0
- package/dist/src/components/Tree/index.d.ts.map +1 -0
- package/dist/src/components/Tree/index.js +155 -0
- package/dist/src/components/Tree/index.js.map +1 -0
- package/dist/src/constants/animations.d.ts +5 -0
- package/dist/src/constants/animations.d.ts.map +1 -0
- package/dist/src/constants/animations.js +8 -0
- package/dist/src/constants/animations.js.map +1 -0
- package/dist/src/constants/colors.d.ts +10 -0
- package/dist/src/constants/colors.d.ts.map +1 -0
- package/dist/src/constants/colors.js +13 -0
- package/dist/src/constants/colors.js.map +1 -0
- package/dist/src/constants/sizes.d.ts +59 -0
- package/dist/src/constants/sizes.d.ts.map +1 -0
- package/dist/src/constants/sizes.js +60 -0
- package/dist/src/constants/sizes.js.map +1 -0
- package/dist/src/constants/theme.d.ts +81 -0
- package/dist/src/constants/theme.d.ts.map +1 -0
- package/dist/src/constants/theme.js +20 -0
- package/dist/src/constants/theme.js.map +1 -0
- package/dist/src/containers/PopoverProvider.d.ts +13 -0
- package/dist/src/containers/PopoverProvider.d.ts.map +1 -0
- package/dist/src/containers/PopoverProvider.js +81 -0
- package/dist/src/containers/PopoverProvider.js.map +1 -0
- package/dist/src/containers/ReqoreProvider.d.ts +40 -0
- package/dist/src/containers/ReqoreProvider.d.ts.map +1 -0
- package/dist/src/containers/ReqoreProvider.js +125 -0
- package/dist/src/containers/ReqoreProvider.js.map +1 -0
- package/dist/src/containers/ThemeProvider.d.ts +8 -0
- package/dist/src/containers/ThemeProvider.d.ts.map +1 -0
- package/dist/src/containers/ThemeProvider.js +27 -0
- package/dist/src/containers/ThemeProvider.js.map +1 -0
- package/dist/src/containers/UIProvider.d.ts +13 -0
- package/dist/src/containers/UIProvider.d.ts.map +1 -0
- package/dist/src/containers/UIProvider.js +43 -0
- package/dist/src/containers/UIProvider.js.map +1 -0
- package/dist/src/context/PopoverContext.d.ts +11 -0
- package/dist/src/context/PopoverContext.d.ts.map +1 -0
- package/dist/src/context/PopoverContext.js +5 -0
- package/dist/src/context/PopoverContext.js.map +1 -0
- package/dist/src/context/ReqoreContext.d.ts +15 -0
- package/dist/src/context/ReqoreContext.d.ts.map +1 -0
- package/dist/src/context/ReqoreContext.js +10 -0
- package/dist/src/context/ReqoreContext.js.map +1 -0
- package/dist/src/context/ThemeContext.d.ts +5 -0
- package/dist/src/context/ThemeContext.d.ts.map +1 -0
- package/dist/src/context/ThemeContext.js +6 -0
- package/dist/src/context/ThemeContext.js.map +1 -0
- package/dist/src/helpers/animations.d.ts +2 -0
- package/dist/src/helpers/animations.d.ts.map +1 -0
- package/dist/src/helpers/animations.js +11 -0
- package/dist/src/helpers/animations.js.map +1 -0
- package/dist/src/helpers/colors.d.ts +14 -0
- package/dist/src/helpers/colors.d.ts.map +1 -0
- package/dist/src/helpers/colors.js +108 -0
- package/dist/src/helpers/colors.js.map +1 -0
- package/dist/src/helpers/sidebar.d.ts +4 -0
- package/dist/src/helpers/sidebar.d.ts.map +1 -0
- package/dist/src/helpers/sidebar.js +90 -0
- package/dist/src/helpers/sidebar.js.map +1 -0
- package/dist/src/helpers/time.d.ts +8 -0
- package/dist/src/helpers/time.d.ts.map +1 -0
- package/dist/src/helpers/time.js +25 -0
- package/dist/src/helpers/time.js.map +1 -0
- package/dist/src/helpers/utils.d.ts +5 -0
- package/dist/src/helpers/utils.d.ts.map +1 -0
- package/dist/src/helpers/utils.js +103 -0
- package/dist/src/helpers/utils.js.map +1 -0
- package/dist/src/hooks/useCombinedRefs.d.ts +3 -0
- package/dist/src/hooks/useCombinedRefs.d.ts.map +1 -0
- package/dist/src/hooks/useCombinedRefs.js +29 -0
- package/dist/src/hooks/useCombinedRefs.js.map +1 -0
- package/dist/src/hooks/useLatestZIndex.d.ts +3 -0
- package/dist/src/hooks/useLatestZIndex.d.ts.map +1 -0
- package/dist/src/hooks/useLatestZIndex.js +11 -0
- package/dist/src/hooks/useLatestZIndex.js.map +1 -0
- package/dist/src/hooks/useOutsideClick.d.ts +4 -0
- package/dist/src/hooks/useOutsideClick.d.ts.map +1 -0
- package/dist/src/hooks/useOutsideClick.js +19 -0
- package/dist/src/hooks/useOutsideClick.js.map +1 -0
- package/dist/src/hooks/usePopover.d.ts +19 -0
- package/dist/src/hooks/usePopover.d.ts.map +1 -0
- package/dist/src/hooks/usePopover.js +86 -0
- package/dist/src/hooks/usePopover.js.map +1 -0
- package/dist/src/hooks/useShareForwardedRef.d.ts +3 -0
- package/dist/src/hooks/useShareForwardedRef.d.ts.map +1 -0
- package/dist/src/hooks/useShareForwardedRef.js +25 -0
- package/dist/src/hooks/useShareForwardedRef.js.map +1 -0
- package/dist/src/hooks/useTheme.d.ts +3 -0
- package/dist/src/hooks/useTheme.d.ts.map +1 -0
- package/dist/src/hooks/useTheme.js +21 -0
- package/dist/src/hooks/useTheme.js.map +1 -0
- package/dist/src/hooks/useTooltip.d.ts +3 -0
- package/dist/src/hooks/useTooltip.d.ts.map +1 -0
- package/dist/src/hooks/useTooltip.js +24 -0
- package/dist/src/hooks/useTooltip.js.map +1 -0
- package/dist/src/icons.json +2295 -0
- package/dist/src/index.d.ts +52 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +127 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mock/breadcrumbs.d.ts +5 -0
- package/dist/src/mock/breadcrumbs.d.ts.map +1 -0
- package/dist/src/mock/breadcrumbs.js +94 -0
- package/dist/src/mock/breadcrumbs.js.map +1 -0
- package/dist/src/mock/icons.d.ts +5 -0
- package/dist/src/mock/icons.d.ts.map +1 -0
- package/dist/src/mock/icons.js +34 -0
- package/dist/src/mock/icons.js.map +1 -0
- package/dist/src/mock/menu.d.ts +3 -0
- package/dist/src/mock/menu.d.ts.map +1 -0
- package/dist/src/mock/menu.js +97 -0
- package/dist/src/mock/menu.js.map +1 -0
- package/dist/src/mock/object.json +317 -0
- package/dist/src/mock/tableData.d.ts +8 -0
- package/dist/src/mock/tableData.d.ts.map +1 -0
- package/dist/src/mock/tableData.js +53 -0
- package/dist/src/mock/tableData.js.map +1 -0
- package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.d.ts +10 -0
- package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -0
- package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.js +72 -0
- package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.js.map +1 -0
- package/dist/src/stories/Button/Button.stories.d.ts +12 -0
- package/dist/src/stories/Button/Button.stories.d.ts.map +1 -0
- package/dist/src/stories/Button/Button.stories.js +57 -0
- package/dist/src/stories/Button/Button.stories.js.map +1 -0
- package/dist/src/stories/Checkbox/Checkbox.stories.d.ts +7 -0
- package/dist/src/stories/Checkbox/Checkbox.stories.d.ts.map +1 -0
- package/dist/src/stories/Checkbox/Checkbox.stories.js +29 -0
- package/dist/src/stories/Checkbox/Checkbox.stories.js.map +1 -0
- package/dist/src/stories/Columns/Columns.stories.d.ts +10 -0
- package/dist/src/stories/Columns/Columns.stories.d.ts.map +1 -0
- package/dist/src/stories/Columns/Columns.stories.js +49 -0
- package/dist/src/stories/Columns/Columns.stories.js.map +1 -0
- package/dist/src/stories/Comment/Comment.stories.d.ts +7 -0
- package/dist/src/stories/Comment/Comment.stories.d.ts.map +1 -0
- package/dist/src/stories/Comment/Comment.stories.js +43 -0
- package/dist/src/stories/Comment/Comment.stories.js.map +1 -0
- package/dist/src/stories/ControlGroup/ControlGroup.stories.d.ts +8 -0
- package/dist/src/stories/ControlGroup/ControlGroup.stories.d.ts.map +1 -0
- package/dist/src/stories/ControlGroup/ControlGroup.stories.js +44 -0
- package/dist/src/stories/ControlGroup/ControlGroup.stories.js.map +1 -0
- package/dist/src/stories/Drawer/Drawer.stories.d.ts +8 -0
- package/dist/src/stories/Drawer/Drawer.stories.d.ts.map +1 -0
- package/dist/src/stories/Drawer/Drawer.stories.js +97 -0
- package/dist/src/stories/Drawer/Drawer.stories.js.map +1 -0
- package/dist/src/stories/Dropdown/Dropdown.stories.d.ts +8 -0
- package/dist/src/stories/Dropdown/Dropdown.stories.d.ts.map +1 -0
- package/dist/src/stories/Dropdown/Dropdown.stories.js +141 -0
- package/dist/src/stories/Dropdown/Dropdown.stories.js.map +1 -0
- package/dist/src/stories/Icon/Icon.stories.d.ts +6 -0
- package/dist/src/stories/Icon/Icon.stories.d.ts.map +1 -0
- package/dist/src/stories/Icon/Icon.stories.js +13 -0
- package/dist/src/stories/Icon/Icon.stories.js.map +1 -0
- package/dist/src/stories/Input/Input.stories.d.ts +6 -0
- package/dist/src/stories/Input/Input.stories.d.ts.map +1 -0
- package/dist/src/stories/Input/Input.stories.js +38 -0
- package/dist/src/stories/Input/Input.stories.js.map +1 -0
- package/dist/src/stories/Menu/Menu.stories.d.ts +6 -0
- package/dist/src/stories/Menu/Menu.stories.d.ts.map +1 -0
- package/dist/src/stories/Menu/Menu.stories.js +48 -0
- package/dist/src/stories/Menu/Menu.stories.js.map +1 -0
- package/dist/src/stories/Message/Message.stories.d.ts +8 -0
- package/dist/src/stories/Message/Message.stories.d.ts.map +1 -0
- package/dist/src/stories/Message/Message.stories.js +50 -0
- package/dist/src/stories/Message/Message.stories.js.map +1 -0
- package/dist/src/stories/Modal/Modal.stories.d.ts +7 -0
- package/dist/src/stories/Modal/Modal.stories.d.ts.map +1 -0
- package/dist/src/stories/Modal/Modal.stories.js +77 -0
- package/dist/src/stories/Modal/Modal.stories.js.map +1 -0
- package/dist/src/stories/Navbar/Navbar.stories.d.ts +6 -0
- package/dist/src/stories/Navbar/Navbar.stories.d.ts.map +1 -0
- package/dist/src/stories/Navbar/Navbar.stories.js +33 -0
- package/dist/src/stories/Navbar/Navbar.stories.js.map +1 -0
- package/dist/src/stories/Notifications/Interactive.stories.d.ts +9 -0
- package/dist/src/stories/Notifications/Interactive.stories.d.ts.map +1 -0
- package/dist/src/stories/Notifications/Interactive.stories.js +100 -0
- package/dist/src/stories/Notifications/Interactive.stories.js.map +1 -0
- package/dist/src/stories/Notifications/Notification.stories.d.ts +9 -0
- package/dist/src/stories/Notifications/Notification.stories.d.ts.map +1 -0
- package/dist/src/stories/Notifications/Notification.stories.js +96 -0
- package/dist/src/stories/Notifications/Notification.stories.js.map +1 -0
- package/dist/src/stories/Notifications/Notifications.stories.d.ts +10 -0
- package/dist/src/stories/Notifications/Notifications.stories.d.ts.map +1 -0
- package/dist/src/stories/Notifications/Notifications.stories.js +63 -0
- package/dist/src/stories/Notifications/Notifications.stories.js.map +1 -0
- package/dist/src/stories/Panel/Panel.stories.d.ts +9 -0
- package/dist/src/stories/Panel/Panel.stories.d.ts.map +1 -0
- package/dist/src/stories/Panel/Panel.stories.js +79 -0
- package/dist/src/stories/Panel/Panel.stories.js.map +1 -0
- package/dist/src/stories/Popover/Popover.stories.d.ts +6 -0
- package/dist/src/stories/Popover/Popover.stories.d.ts.map +1 -0
- package/dist/src/stories/Popover/Popover.stories.js +46 -0
- package/dist/src/stories/Popover/Popover.stories.js.map +1 -0
- package/dist/src/stories/RadioGroup/RadioGroup.stories.d.ts +7 -0
- package/dist/src/stories/RadioGroup/RadioGroup.stories.d.ts.map +1 -0
- package/dist/src/stories/RadioGroup/RadioGroup.stories.js +54 -0
- package/dist/src/stories/RadioGroup/RadioGroup.stories.js.map +1 -0
- package/dist/src/stories/Sidebar/Sidebar.stories.d.ts +6 -0
- package/dist/src/stories/Sidebar/Sidebar.stories.d.ts.map +1 -0
- package/dist/src/stories/Sidebar/Sidebar.stories.js +65 -0
- package/dist/src/stories/Sidebar/Sidebar.stories.js.map +1 -0
- package/dist/src/stories/Table/Table.stories.d.ts +10 -0
- package/dist/src/stories/Table/Table.stories.d.ts.map +1 -0
- package/dist/src/stories/Table/Table.stories.js +157 -0
- package/dist/src/stories/Table/Table.stories.js.map +1 -0
- package/dist/src/stories/Tabs/Tabs.stories.d.ts +12 -0
- package/dist/src/stories/Tabs/Tabs.stories.d.ts.map +1 -0
- package/dist/src/stories/Tabs/Tabs.stories.js +127 -0
- package/dist/src/stories/Tabs/Tabs.stories.js.map +1 -0
- package/dist/src/stories/Tag/Tag.stories.d.ts +8 -0
- package/dist/src/stories/Tag/Tag.stories.d.ts.map +1 -0
- package/dist/src/stories/Tag/Tag.stories.js +79 -0
- package/dist/src/stories/Tag/Tag.stories.js.map +1 -0
- package/dist/src/stories/TextArea/TextArea.stories.d.ts +8 -0
- package/dist/src/stories/TextArea/TextArea.stories.d.ts.map +1 -0
- package/dist/src/stories/TextArea/TextArea.stories.js +65 -0
- package/dist/src/stories/TextArea/TextArea.stories.js.map +1 -0
- package/dist/src/stories/Tree/Tree.stories.d.ts +7 -0
- package/dist/src/stories/Tree/Tree.stories.d.ts.map +1 -0
- package/dist/src/stories/Tree/Tree.stories.js +52 -0
- package/dist/src/stories/Tree/Tree.stories.js.map +1 -0
- package/dist/src/stories/Wrapper.d.ts +4 -0
- package/dist/src/stories/Wrapper.d.ts.map +1 -0
- package/dist/src/stories/Wrapper.js +38 -0
- package/dist/src/stories/Wrapper.js.map +1 -0
- package/dist/src/stories/utils/args.d.ts +61 -0
- package/dist/src/stories/utils/args.d.ts.map +1 -0
- package/dist/src/stories/utils/args.js +120 -0
- package/dist/src/stories/utils/args.js.map +1 -0
- package/dist/src/stories/utils.d.ts +11 -0
- package/dist/src/stories/utils.d.ts.map +1 -0
- package/dist/src/stories/utils.js +17 -0
- package/dist/src/stories/utils.js.map +1 -0
- package/dist/src/styles.d.ts +5 -0
- package/dist/src/styles.d.ts.map +1 -0
- package/dist/src/styles.js +16 -0
- package/dist/src/styles.js.map +1 -0
- package/dist/src/types/global.d.ts +9 -0
- package/dist/src/types/global.d.ts.map +1 -0
- package/dist/src/types/global.js +3 -0
- package/dist/src/types/global.js.map +1 -0
- package/dist/src/types/icons.d.ts +2 -0
- package/dist/src/types/icons.d.ts.map +1 -0
- package/dist/src/types/icons.js +3 -0
- package/dist/src/types/icons.js.map +1 -0
- package/dist/src/types/icons____.d.ts +2 -0
- package/dist/src/types/icons____.d.ts.map +1 -0
- package/dist/src/types/icons____.js +5 -0
- package/dist/src/types/icons____.js.map +1 -0
- package/dist/tests.json +1 -1
- package/package.json +1 -1
- package/src/components/Breadcrumbs/index.tsx +286 -0
- package/src/components/Breadcrumbs/item.tsx +162 -0
- package/src/components/Button/index.tsx +270 -0
- package/src/components/Checkbox/index.tsx +161 -0
- package/src/components/Columns/column.tsx +26 -0
- package/src/components/Columns/index.tsx +40 -0
- package/src/components/Comment/index.tsx +139 -0
- package/src/components/CommentFeed/index.tsx +34 -0
- package/src/components/Content/index.tsx +39 -0
- package/src/components/Content/wrapper.tsx +37 -0
- package/src/components/ControlGroup/index.tsx +81 -0
- package/src/components/Drawer/index.tsx +387 -0
- package/src/components/Dropdown/index.tsx +81 -0
- package/src/components/Dropdown/item.tsx +20 -0
- package/src/components/Dropdown/list.tsx +76 -0
- package/src/components/Header/index.tsx +38 -0
- package/src/components/Icon/index.tsx +83 -0
- package/src/components/Input/index.tsx +185 -0
- package/src/components/InputClearButton/index.tsx +34 -0
- package/src/components/InternalPopover/index.tsx +185 -0
- package/src/components/Layout/content.tsx +31 -0
- package/src/components/Layout/index.tsx +55 -0
- package/src/components/Menu/divider.tsx +36 -0
- package/src/components/Menu/index.tsx +64 -0
- package/src/components/Menu/item.tsx +219 -0
- package/src/components/Message/index.tsx +136 -0
- package/src/components/Modal/actions.tsx +26 -0
- package/src/components/Modal/content.tsx +11 -0
- package/src/components/Modal/index.tsx +26 -0
- package/src/components/Navbar/divider.tsx +51 -0
- package/src/components/Navbar/group.tsx +57 -0
- package/src/components/Navbar/index.tsx +81 -0
- package/src/components/Navbar/item.tsx +75 -0
- package/src/components/Notifications/index.tsx +56 -0
- package/src/components/Notifications/notification.tsx +288 -0
- package/src/components/Panel/__screenshots__/linux/panel-SomePanel.png +0 -0
- package/src/components/Panel/index.tsx +333 -0
- package/src/components/Panel/panel.screenshot.tsx +29 -0
- package/src/components/Paragraph/index.tsx +25 -0
- package/src/components/Popover/index.tsx +65 -0
- package/src/components/RadioGroup/index.tsx +52 -0
- package/src/components/Sidebar/index.tsx +526 -0
- package/src/components/Sidebar/item.tsx +269 -0
- package/src/components/Table/body.tsx +46 -0
- package/src/components/Table/header.tsx +173 -0
- package/src/components/Table/headerCell.tsx +117 -0
- package/src/components/Table/helpers.ts +19 -0
- package/src/components/Table/index.tsx +265 -0
- package/src/components/Table/row.tsx +355 -0
- package/src/components/Tabs/content.tsx +23 -0
- package/src/components/Tabs/index.tsx +117 -0
- package/src/components/Tabs/item.tsx +151 -0
- package/src/components/Tabs/list.tsx +281 -0
- package/src/components/Tag/group.tsx +32 -0
- package/src/components/Tag/index.tsx +237 -0
- package/src/components/Textarea/index.tsx +121 -0
- package/src/components/TimeAgo/index.tsx +15 -0
- package/src/components/Tree/index.tsx +255 -0
- package/src/constants/animations.ts +4 -0
- package/src/constants/colors.ts +9 -0
- package/src/constants/sizes.ts +66 -0
- package/src/constants/theme.ts +102 -0
- package/src/containers/PopoverProvider.tsx +85 -0
- package/src/containers/ReqoreProvider.tsx +194 -0
- package/src/containers/ThemeProvider.tsx +22 -0
- package/src/containers/UIProvider.tsx +54 -0
- package/src/context/PopoverContext.tsx +10 -0
- package/src/context/ReqoreContext.tsx +20 -0
- package/src/context/ThemeContext.tsx +4 -0
- package/src/helpers/animations.ts +13 -0
- package/src/helpers/colors.ts +127 -0
- package/src/helpers/sidebar.ts +105 -0
- package/src/helpers/time.ts +21 -0
- package/src/helpers/utils.ts +75 -0
- package/src/hooks/useCombinedRefs.ts +19 -0
- package/src/hooks/useLatestZIndex.ts +11 -0
- package/src/hooks/useOutsideClick.ts +29 -0
- package/src/hooks/usePopover.tsx +118 -0
- package/src/hooks/useShareForwardedRef.ts +23 -0
- package/src/hooks/useTheme.ts +20 -0
- package/src/hooks/useTooltip.ts +15 -0
- package/src/icons.json +2295 -0
- package/src/index.tsx +51 -0
- package/src/mock/breadcrumbs.ts +93 -0
- package/src/mock/icons.ts +32 -0
- package/src/mock/menu.ts +95 -0
- package/src/mock/object.json +317 -0
- package/src/mock/styleMock.js +1 -0
- package/src/mock/tableData.ts +40 -0
- package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +38 -0
- package/src/stories/Button/Button.stories.tsx +69 -0
- package/src/stories/Checkbox/Checkbox.stories.tsx +26 -0
- package/src/stories/Columns/Columns.stories.tsx +71 -0
- package/src/stories/Comment/Comment.stories.tsx +127 -0
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +43 -0
- package/src/stories/Drawer/Drawer.stories.tsx +181 -0
- package/src/stories/Dropdown/Dropdown.stories.tsx +160 -0
- package/src/stories/Icon/Icon.stories.tsx +35 -0
- package/src/stories/Input/Input.stories.tsx +77 -0
- package/src/stories/Menu/Menu.stories.tsx +94 -0
- package/src/stories/Message/Message.stories.tsx +52 -0
- package/src/stories/Modal/Modal.stories.tsx +148 -0
- package/src/stories/Navbar/Navbar.stories.tsx +109 -0
- package/src/stories/Notifications/Interactive.stories.tsx +105 -0
- package/src/stories/Notifications/Notification.stories.tsx +200 -0
- package/src/stories/Notifications/Notifications.stories.tsx +65 -0
- package/src/stories/Panel/Panel.stories.tsx +107 -0
- package/src/stories/Popover/Popover.stories.tsx +54 -0
- package/src/stories/RadioGroup/RadioGroup.stories.tsx +51 -0
- package/src/stories/Sidebar/Sidebar.stories.tsx +78 -0
- package/src/stories/Table/Table.stories.tsx +151 -0
- package/src/stories/Tabs/Tabs.stories.tsx +233 -0
- package/src/stories/Tag/Tag.stories.tsx +72 -0
- package/src/stories/TextArea/TextArea.stories.tsx +74 -0
- package/src/stories/Tree/Tree.stories.tsx +43 -0
- package/src/stories/Wrapper.tsx +13 -0
- package/src/stories/utils/args.ts +138 -0
- package/src/stories/utils.ts +17 -0
- package/src/styles.ts +38 -0
- package/src/types/global.ts +9 -0
- package/src/types/icons.ts +2272 -0
- package/src/types/icons____.ts +5 -0
- package/tests.json +1 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
import { size as count } from 'lodash';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { useUpdateEffect } from 'react-use';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import { TABLE_SIZE_TO_PX, TSizes } from '../../constants/sizes';
|
|
7
|
+
import { IReqoreIntent, IReqoreTheme } from '../../constants/theme';
|
|
8
|
+
import ReqoreThemeProvider from '../../containers/ThemeProvider';
|
|
9
|
+
import { changeLightness, getReadableColor } from '../../helpers/colors';
|
|
10
|
+
import { useReqoreTheme } from '../../hooks/useTheme';
|
|
11
|
+
import { IReqoreIconName } from '../../types/icons';
|
|
12
|
+
import ReqoreTableBody from './body';
|
|
13
|
+
import ReqoreTableHeader, { StyledColumnGroupHeader } from './header';
|
|
14
|
+
import { IReqoreTableHeaderStyle, StyledTableHeader } from './headerCell';
|
|
15
|
+
import { fixSort, flipSortDirection, sortTableData } from './helpers';
|
|
16
|
+
|
|
17
|
+
export type TReqoreTableColumnContent =
|
|
18
|
+
| React.FC<{ [key: string]: any; _selectId?: string }>
|
|
19
|
+
| 'time-ago'
|
|
20
|
+
| 'tag'
|
|
21
|
+
| `tag:${IReqoreIntent}`
|
|
22
|
+
| `tag:#${string}`
|
|
23
|
+
| 'title'
|
|
24
|
+
| `title:${IReqoreIntent}`
|
|
25
|
+
| 'text'
|
|
26
|
+
| `text:${IReqoreIntent}`;
|
|
27
|
+
|
|
28
|
+
export interface IReqoreTableColumn {
|
|
29
|
+
dataId: string;
|
|
30
|
+
header?: string | JSX.Element;
|
|
31
|
+
grow?: 1 | 2 | 3 | 4;
|
|
32
|
+
width?: number;
|
|
33
|
+
content?: TReqoreTableColumnContent;
|
|
34
|
+
props?: React.HTMLAttributes<HTMLDivElement>;
|
|
35
|
+
align?: 'center' | 'left' | 'right';
|
|
36
|
+
columns?: IReqoreTableColumn[];
|
|
37
|
+
sortable?: boolean;
|
|
38
|
+
icon?: IReqoreIconName;
|
|
39
|
+
iconSize?: string;
|
|
40
|
+
tooltip?: string;
|
|
41
|
+
intent?: IReqoreIntent;
|
|
42
|
+
cellTooltip?: (data: { [key: string]: any; _selectId?: string }) => string | JSX.Element;
|
|
43
|
+
onCellClick?: (data: { [key: string]: any; _selectId?: string }) => void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IReqoreTableRowData {
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
_selectId?: string;
|
|
49
|
+
_intent?: IReqoreIntent;
|
|
50
|
+
_disabled?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type IReqoreTableRowClick = (data: IReqoreTableRowData) => void;
|
|
54
|
+
export type IReqoreTableData = IReqoreTableRowData[];
|
|
55
|
+
|
|
56
|
+
export interface IReqoreTableProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
57
|
+
columns: IReqoreTableColumn[];
|
|
58
|
+
data?: IReqoreTableData;
|
|
59
|
+
className?: string;
|
|
60
|
+
width?: number;
|
|
61
|
+
height?: number;
|
|
62
|
+
sort?: IReqoreTableSort;
|
|
63
|
+
striped?: boolean;
|
|
64
|
+
selectable?: boolean;
|
|
65
|
+
selected?: string[];
|
|
66
|
+
selectedRowIntent?: IReqoreIntent;
|
|
67
|
+
onSortChange?: (sort?: IReqoreTableSort) => void;
|
|
68
|
+
onSelectedChange?: (selected?: any[]) => void;
|
|
69
|
+
selectToggleTooltip?: string;
|
|
70
|
+
onRowClick?: IReqoreTableRowClick;
|
|
71
|
+
customTheme?: IReqoreTheme;
|
|
72
|
+
intent?: IReqoreIntent;
|
|
73
|
+
rounded?: boolean;
|
|
74
|
+
flat?: boolean;
|
|
75
|
+
size?: TSizes;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface IReqoreTableStyle {
|
|
79
|
+
theme: IReqoreTheme;
|
|
80
|
+
width?: number;
|
|
81
|
+
striped?: boolean;
|
|
82
|
+
selectable?: boolean;
|
|
83
|
+
rounded?: boolean;
|
|
84
|
+
flat?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface IReqoreTableSort {
|
|
88
|
+
by?: string;
|
|
89
|
+
direction?: 'asc' | 'desc';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const StyledTableWrapper = styled.div<IReqoreTableStyle>`
|
|
93
|
+
${({ theme, width, rounded, flat }: IReqoreTableStyle) => css`
|
|
94
|
+
width: ${width ? `${width}px` : '100%'};
|
|
95
|
+
|
|
96
|
+
position: relative;
|
|
97
|
+
clear: both;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
z-index: 1;
|
|
100
|
+
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-flow: column;
|
|
103
|
+
|
|
104
|
+
border-radius: ${rounded ? '10px' : undefined};
|
|
105
|
+
|
|
106
|
+
background-color: ${theme.main};
|
|
107
|
+
color: ${getReadableColor(theme, undefined, undefined, true)};
|
|
108
|
+
|
|
109
|
+
${!flat &&
|
|
110
|
+
css`
|
|
111
|
+
${StyledTableHeader}, ${StyledColumnGroupHeader} {
|
|
112
|
+
${({ theme }: IReqoreTableHeaderStyle) => css`
|
|
113
|
+
border-bottom: 1px solid ${changeLightness(theme.main, 0.07)};
|
|
114
|
+
`}
|
|
115
|
+
}
|
|
116
|
+
`}
|
|
117
|
+
`}
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
const ReqoreTable = ({
|
|
121
|
+
className,
|
|
122
|
+
height = 300,
|
|
123
|
+
width,
|
|
124
|
+
columns,
|
|
125
|
+
data = [],
|
|
126
|
+
sort,
|
|
127
|
+
onSortChange,
|
|
128
|
+
selectable,
|
|
129
|
+
selected,
|
|
130
|
+
onSelectedChange,
|
|
131
|
+
selectToggleTooltip,
|
|
132
|
+
customTheme,
|
|
133
|
+
rounded,
|
|
134
|
+
onRowClick,
|
|
135
|
+
striped,
|
|
136
|
+
selectedRowIntent,
|
|
137
|
+
size,
|
|
138
|
+
intent,
|
|
139
|
+
...rest
|
|
140
|
+
}: IReqoreTableProps) => {
|
|
141
|
+
const [leftScroll, setLeftScroll] = useState<number>(0);
|
|
142
|
+
const [_data, setData] = useState<IReqoreTableData>(data || []);
|
|
143
|
+
const [_sort, setSort] = useState<IReqoreTableSort>(fixSort(sort));
|
|
144
|
+
const [_selected, setSelected] = useState<string[]>([]);
|
|
145
|
+
const [_selectedQuant, setSelectedQuant] = useState<'all' | 'none' | 'some'>('none');
|
|
146
|
+
const theme = useReqoreTheme('main', customTheme, intent);
|
|
147
|
+
|
|
148
|
+
useUpdateEffect(() => {
|
|
149
|
+
if (onSortChange) {
|
|
150
|
+
onSortChange(_sort);
|
|
151
|
+
}
|
|
152
|
+
}, [_sort]);
|
|
153
|
+
|
|
154
|
+
useUpdateEffect(() => {
|
|
155
|
+
setData(data);
|
|
156
|
+
}, [data]);
|
|
157
|
+
|
|
158
|
+
useUpdateEffect(() => {
|
|
159
|
+
if (selectable) {
|
|
160
|
+
setSelected(selected);
|
|
161
|
+
}
|
|
162
|
+
}, [selected]);
|
|
163
|
+
|
|
164
|
+
useUpdateEffect(() => {
|
|
165
|
+
if (onSelectedChange) {
|
|
166
|
+
onSelectedChange(_selected);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const selectableData: IReqoreTableData = _data.filter((datum) => datum._selectId ?? false);
|
|
170
|
+
|
|
171
|
+
if (count(_selected)) {
|
|
172
|
+
if (count(_selected) === count(selectableData)) {
|
|
173
|
+
setSelectedQuant('all');
|
|
174
|
+
} else {
|
|
175
|
+
setSelectedQuant('some');
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
setSelectedQuant('none');
|
|
179
|
+
}
|
|
180
|
+
}, [_selected]);
|
|
181
|
+
|
|
182
|
+
const handleSortChange = (by?: string) => {
|
|
183
|
+
setSort((currentSort: IReqoreTableSort) => {
|
|
184
|
+
const newSort: IReqoreTableSort = { ...currentSort };
|
|
185
|
+
|
|
186
|
+
newSort.by = by;
|
|
187
|
+
newSort.direction =
|
|
188
|
+
currentSort.by === by ? flipSortDirection(currentSort.direction) : currentSort.direction;
|
|
189
|
+
|
|
190
|
+
return newSort;
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const handleSelectClick = (selectId: string) => {
|
|
195
|
+
setSelected((current) => {
|
|
196
|
+
let newSelected = [...current];
|
|
197
|
+
const isSelected = newSelected.find((selected) => selectId === selected);
|
|
198
|
+
|
|
199
|
+
if (isSelected) {
|
|
200
|
+
newSelected = newSelected.filter((selected) => selected !== selectId);
|
|
201
|
+
} else {
|
|
202
|
+
newSelected = [...newSelected, selectId];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return newSelected;
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const handleToggleSelectClick = () => {
|
|
210
|
+
switch (_selectedQuant) {
|
|
211
|
+
case 'none':
|
|
212
|
+
case 'some': {
|
|
213
|
+
const selectableData: string[] = _data
|
|
214
|
+
.filter((datum) => datum._selectId ?? false)
|
|
215
|
+
.map((datum) => datum._selectId);
|
|
216
|
+
|
|
217
|
+
setSelected(selectableData);
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
default: {
|
|
221
|
+
setSelected([]);
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
<ReqoreThemeProvider theme={theme}>
|
|
229
|
+
<StyledTableWrapper
|
|
230
|
+
{...rest}
|
|
231
|
+
className={`${className || ''} reqore-table`}
|
|
232
|
+
rounded={rounded}
|
|
233
|
+
width={width}
|
|
234
|
+
>
|
|
235
|
+
<ReqoreTableHeader
|
|
236
|
+
columns={columns}
|
|
237
|
+
leftScroll={leftScroll}
|
|
238
|
+
onSortChange={handleSortChange}
|
|
239
|
+
sortData={_sort}
|
|
240
|
+
selectable={selectable}
|
|
241
|
+
selectedQuant={_selectedQuant}
|
|
242
|
+
onToggleSelectClick={handleToggleSelectClick}
|
|
243
|
+
hasVerticalScroll={count(_data) * TABLE_SIZE_TO_PX[size] > height}
|
|
244
|
+
selectToggleTooltip={selectToggleTooltip}
|
|
245
|
+
/>
|
|
246
|
+
<ReqoreTableBody
|
|
247
|
+
data={_sort ? sortTableData(_data, _sort) : _data}
|
|
248
|
+
columns={columns}
|
|
249
|
+
setLeftScroll={setLeftScroll}
|
|
250
|
+
height={height}
|
|
251
|
+
selectable={selectable}
|
|
252
|
+
onSelectClick={handleSelectClick}
|
|
253
|
+
onRowClick={onRowClick}
|
|
254
|
+
selected={_selected}
|
|
255
|
+
selectedRowIntent={selectedRowIntent}
|
|
256
|
+
size={size}
|
|
257
|
+
striped={striped}
|
|
258
|
+
flat={rest.flat}
|
|
259
|
+
/>
|
|
260
|
+
</StyledTableWrapper>
|
|
261
|
+
</ReqoreThemeProvider>
|
|
262
|
+
);
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
export default ReqoreTable;
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
import { isFunction, isString } from 'lodash';
|
|
3
|
+
import { lighten, rgba } from 'polished';
|
|
4
|
+
import React, { ReactElement, useState } from 'react';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import {
|
|
7
|
+
IReqoreTableColumn,
|
|
8
|
+
IReqoreTableData,
|
|
9
|
+
IReqoreTableRowClick,
|
|
10
|
+
TReqoreTableColumnContent,
|
|
11
|
+
} from '.';
|
|
12
|
+
import { ReqorePopover } from '../..';
|
|
13
|
+
import { SIZE_TO_PX, TEXT_FROM_SIZE, TSizes } from '../../constants/sizes';
|
|
14
|
+
import { IReqoreIntent, IReqoreTheme } from '../../constants/theme';
|
|
15
|
+
import { changeLightness, getReadableColorFrom } from '../../helpers/colors';
|
|
16
|
+
import { ReqoreH4 } from '../Header';
|
|
17
|
+
import ReqoreIcon from '../Icon';
|
|
18
|
+
import { ReqoreP } from '../Paragraph';
|
|
19
|
+
import ReqoreTag from '../Tag';
|
|
20
|
+
import { TimeAgo } from '../TimeAgo';
|
|
21
|
+
|
|
22
|
+
export interface IReqoreTableRowOptions {
|
|
23
|
+
columns: IReqoreTableColumn[];
|
|
24
|
+
data?: IReqoreTableData;
|
|
25
|
+
selectable?: boolean;
|
|
26
|
+
onSelectClick?: (selectId: string) => void;
|
|
27
|
+
selected?: string[];
|
|
28
|
+
onRowClick?: IReqoreTableRowClick;
|
|
29
|
+
striped?: boolean;
|
|
30
|
+
selectedRowIntent?: IReqoreIntent;
|
|
31
|
+
size?: TSizes;
|
|
32
|
+
flat?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IReqoreTableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
36
|
+
data: IReqoreTableRowOptions;
|
|
37
|
+
style: React.StyleHTMLAttributes<HTMLDivElement>;
|
|
38
|
+
index: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IReqoreTableRowStyle {
|
|
42
|
+
theme: IReqoreTheme;
|
|
43
|
+
interactive?: boolean;
|
|
44
|
+
intent?: IReqoreIntent;
|
|
45
|
+
selected?: boolean;
|
|
46
|
+
selectedIntent?: IReqoreIntent;
|
|
47
|
+
flat?: boolean;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
hovered?: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const StyledTableRow = styled.div<IReqoreTableRowStyle>`
|
|
53
|
+
${({ size }) => css`
|
|
54
|
+
display: flex;
|
|
55
|
+
height: ${SIZE_TO_PX[size]}px;
|
|
56
|
+
`}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
export interface IReqoreTableCellStyle {
|
|
60
|
+
width?: number;
|
|
61
|
+
grow?: number;
|
|
62
|
+
theme?: IReqoreTheme;
|
|
63
|
+
align?: 'center' | 'left' | 'right';
|
|
64
|
+
intent?: IReqoreIntent;
|
|
65
|
+
interactive?: boolean;
|
|
66
|
+
interactiveCell?: boolean;
|
|
67
|
+
size?: TSizes;
|
|
68
|
+
flat?: boolean;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
selected?: boolean;
|
|
71
|
+
hovered?: boolean;
|
|
72
|
+
selectedIntent?: IReqoreIntent;
|
|
73
|
+
even?: boolean;
|
|
74
|
+
striped?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const alignToFlex = {
|
|
78
|
+
center: 'center',
|
|
79
|
+
left: 'flex-start',
|
|
80
|
+
right: 'flex-end',
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const StyledTableCell = styled.div<IReqoreTableCellStyle>`
|
|
84
|
+
${({ width, grow }) =>
|
|
85
|
+
css`
|
|
86
|
+
width: ${!width || width < 80 ? 80 : width}px;
|
|
87
|
+
flex-grow: ${grow || (width ? undefined : 1)};
|
|
88
|
+
`}
|
|
89
|
+
|
|
90
|
+
${({
|
|
91
|
+
theme,
|
|
92
|
+
align,
|
|
93
|
+
interactive,
|
|
94
|
+
interactiveCell,
|
|
95
|
+
intent,
|
|
96
|
+
size,
|
|
97
|
+
flat,
|
|
98
|
+
striped,
|
|
99
|
+
even,
|
|
100
|
+
selected,
|
|
101
|
+
selectedIntent,
|
|
102
|
+
disabled,
|
|
103
|
+
hovered,
|
|
104
|
+
}: IReqoreTableCellStyle) => {
|
|
105
|
+
const getBackgroundColor = () => {
|
|
106
|
+
let color = theme.main;
|
|
107
|
+
let opacity = 0;
|
|
108
|
+
// Is there any intent
|
|
109
|
+
if (intent || (selected && selectedIntent)) {
|
|
110
|
+
color = theme.intents[intent || selectedIntent];
|
|
111
|
+
opacity += 0.02;
|
|
112
|
+
}
|
|
113
|
+
// Is the table striped and this row odd
|
|
114
|
+
if (striped && !even) {
|
|
115
|
+
opacity += 0.05;
|
|
116
|
+
}
|
|
117
|
+
// Is this row selected
|
|
118
|
+
if (selected) {
|
|
119
|
+
opacity += 0.02;
|
|
120
|
+
}
|
|
121
|
+
// Is this row hovered
|
|
122
|
+
if (hovered) {
|
|
123
|
+
opacity += 0.08;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Set the color as transparent if opacity is 0
|
|
127
|
+
if (opacity === 0) {
|
|
128
|
+
return 'transparent';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return changeLightness(color, opacity);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const backgroundColor = getBackgroundColor();
|
|
135
|
+
|
|
136
|
+
return css`
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: ${align ? alignToFlex[align] : 'flex-start'};
|
|
140
|
+
flex-shrink: 0;
|
|
141
|
+
border-bottom: ${!flat ? '1px solid ' : undefined};
|
|
142
|
+
|
|
143
|
+
height: 100%;
|
|
144
|
+
padding: 0 10px;
|
|
145
|
+
font-size: ${TEXT_FROM_SIZE[size]}px;
|
|
146
|
+
background-color: ${backgroundColor === 'transparent'
|
|
147
|
+
? 'transparent'
|
|
148
|
+
: rgba(getBackgroundColor(), 0.8)};
|
|
149
|
+
color: ${getReadableColorFrom(
|
|
150
|
+
backgroundColor === 'transparent' ? theme.main : getBackgroundColor(),
|
|
151
|
+
!hovered
|
|
152
|
+
)};
|
|
153
|
+
border-color: ${changeLightness(
|
|
154
|
+
backgroundColor === 'transparent' ? theme.main : getBackgroundColor(),
|
|
155
|
+
0.1
|
|
156
|
+
)};
|
|
157
|
+
transition: background-color 0.2s ease-out;
|
|
158
|
+
opacity: ${disabled ? 0.2 : 1};
|
|
159
|
+
pointer-events: ${disabled ? 'none' : undefined};
|
|
160
|
+
cursor: ${interactive || interactiveCell ? 'pointer' : 'default'};
|
|
161
|
+
|
|
162
|
+
${interactiveCell &&
|
|
163
|
+
css`
|
|
164
|
+
&:hover {
|
|
165
|
+
background-color: ${lighten(0.2, getBackgroundColor())};
|
|
166
|
+
}
|
|
167
|
+
`}
|
|
168
|
+
|
|
169
|
+
p.reqore-table-text {
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
white-space: nowrap;
|
|
172
|
+
text-overflow: ellipsis;
|
|
173
|
+
margin: 0;
|
|
174
|
+
padding: 0;
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
}}
|
|
178
|
+
`;
|
|
179
|
+
|
|
180
|
+
const ReqoreTableRow = ({
|
|
181
|
+
data: {
|
|
182
|
+
data,
|
|
183
|
+
columns,
|
|
184
|
+
selectable,
|
|
185
|
+
onSelectClick,
|
|
186
|
+
selected,
|
|
187
|
+
onRowClick,
|
|
188
|
+
striped,
|
|
189
|
+
size,
|
|
190
|
+
selectedRowIntent = 'info',
|
|
191
|
+
flat,
|
|
192
|
+
},
|
|
193
|
+
style,
|
|
194
|
+
index,
|
|
195
|
+
}: IReqoreTableRowProps) => {
|
|
196
|
+
const [isHovered, setIsHovered] = useState<boolean>(false);
|
|
197
|
+
const isSelected = selected.find((selectId) => selectId === data[index]._selectId);
|
|
198
|
+
|
|
199
|
+
const renderContent = (
|
|
200
|
+
content: TReqoreTableColumnContent,
|
|
201
|
+
data: any,
|
|
202
|
+
dataId: string
|
|
203
|
+
): ReactElement<any, any> => {
|
|
204
|
+
if (isFunction(content)) {
|
|
205
|
+
const Content = content;
|
|
206
|
+
|
|
207
|
+
return <Content {...data} />;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (isString(content)) {
|
|
211
|
+
// Separate the content string by colon
|
|
212
|
+
let [type, intentOrColor] = content.split(':');
|
|
213
|
+
// Check if the intent starts with hash for tags
|
|
214
|
+
let intent: IReqoreIntent = intentOrColor?.startsWith('#')
|
|
215
|
+
? undefined
|
|
216
|
+
: (intentOrColor as IReqoreIntent);
|
|
217
|
+
let color: string =
|
|
218
|
+
intentOrColor?.startsWith('#') && type === 'tag' ? intentOrColor : undefined;
|
|
219
|
+
// Render content based on the type
|
|
220
|
+
switch (type) {
|
|
221
|
+
case 'time-ago':
|
|
222
|
+
return <TimeAgo time={data[dataId]} />;
|
|
223
|
+
case 'tag':
|
|
224
|
+
return (
|
|
225
|
+
<ReqoreTag
|
|
226
|
+
label={data[dataId]}
|
|
227
|
+
size={size}
|
|
228
|
+
intent={intent as IReqoreIntent}
|
|
229
|
+
color={color}
|
|
230
|
+
/>
|
|
231
|
+
);
|
|
232
|
+
case 'title':
|
|
233
|
+
return <ReqoreH4 intent={intent as IReqoreIntent}>{data[dataId]}</ReqoreH4>;
|
|
234
|
+
case 'text':
|
|
235
|
+
return (
|
|
236
|
+
<ReqoreP className='reqore-table-text' intent={intent as IReqoreIntent}>
|
|
237
|
+
{data[dataId]}
|
|
238
|
+
</ReqoreP>
|
|
239
|
+
);
|
|
240
|
+
default:
|
|
241
|
+
return <ReqoreP className='reqore-table-text'>{data[dataId]}</ReqoreP>;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return <ReqoreP className='reqore-table-text'>{data[dataId]}</ReqoreP>;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const renderCells = (columns: IReqoreTableColumn[], data: IReqoreTableData) =>
|
|
249
|
+
columns.map(
|
|
250
|
+
({ width, grow, dataId, content, columns, align, onCellClick, cellTooltip, intent }) =>
|
|
251
|
+
columns ? (
|
|
252
|
+
renderCells(columns, data)
|
|
253
|
+
) : (
|
|
254
|
+
<ReqorePopover
|
|
255
|
+
key={dataId}
|
|
256
|
+
component={StyledTableCell}
|
|
257
|
+
isReqoreComponent
|
|
258
|
+
componentProps={
|
|
259
|
+
{
|
|
260
|
+
width,
|
|
261
|
+
grow,
|
|
262
|
+
align,
|
|
263
|
+
size,
|
|
264
|
+
striped,
|
|
265
|
+
disabled: data[index]._disabled,
|
|
266
|
+
selected: !!isSelected,
|
|
267
|
+
selectedIntent: selectedRowIntent,
|
|
268
|
+
flat,
|
|
269
|
+
even: index % 2 === 0 ? true : false,
|
|
270
|
+
intent: intent || data[index]._intent,
|
|
271
|
+
hovered: isHovered,
|
|
272
|
+
interactive: !!onCellClick || !!onRowClick,
|
|
273
|
+
interactiveCell: !!onCellClick,
|
|
274
|
+
onClick: (e: React.MouseEvent<HTMLDivElement>) => {
|
|
275
|
+
if (onCellClick) {
|
|
276
|
+
e.stopPropagation();
|
|
277
|
+
onCellClick?.(data[index]);
|
|
278
|
+
} else if (onRowClick) {
|
|
279
|
+
e.stopPropagation();
|
|
280
|
+
onRowClick?.(data[index]);
|
|
281
|
+
} else if (selectable && data[index]._selectId) {
|
|
282
|
+
// Otherwise select the row if selectable
|
|
283
|
+
onSelectClick(data[index]._selectId);
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
className: 'reqore-table-cell',
|
|
287
|
+
} as IReqoreTableCellStyle
|
|
288
|
+
}
|
|
289
|
+
content={cellTooltip ? cellTooltip(data[index]) : undefined}
|
|
290
|
+
>
|
|
291
|
+
{renderContent(content, data[index], dataId)}
|
|
292
|
+
</ReqorePopover>
|
|
293
|
+
)
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
return (
|
|
297
|
+
<StyledTableRow
|
|
298
|
+
style={style}
|
|
299
|
+
className='reqore-table-row'
|
|
300
|
+
interactive={!!onRowClick}
|
|
301
|
+
onMouseEnter={() => {
|
|
302
|
+
// Set hovered is this row is interactive
|
|
303
|
+
if (onRowClick || (selectable && data[index]._selectId && !data[index]._disabled)) {
|
|
304
|
+
setIsHovered(true);
|
|
305
|
+
}
|
|
306
|
+
}}
|
|
307
|
+
onMouseLeave={() => {
|
|
308
|
+
setIsHovered(false);
|
|
309
|
+
}}
|
|
310
|
+
>
|
|
311
|
+
{selectable && (
|
|
312
|
+
<StyledTableCell
|
|
313
|
+
align='center'
|
|
314
|
+
width={60}
|
|
315
|
+
className='reqore-table-cell'
|
|
316
|
+
{...{
|
|
317
|
+
size,
|
|
318
|
+
striped,
|
|
319
|
+
disabled: data[index]._disabled,
|
|
320
|
+
selected: !!isSelected,
|
|
321
|
+
selectedIntent: selectedRowIntent,
|
|
322
|
+
flat,
|
|
323
|
+
even: index % 2 === 0 ? true : false,
|
|
324
|
+
intent: data[index]._intent,
|
|
325
|
+
hovered: isHovered,
|
|
326
|
+
interactiveCell: data[index]._selectId,
|
|
327
|
+
}}
|
|
328
|
+
onClick={
|
|
329
|
+
data[index]._selectId
|
|
330
|
+
? (e: React.MouseEvent<HTMLDivElement>) => {
|
|
331
|
+
e.stopPropagation();
|
|
332
|
+
onSelectClick(data[index]._selectId);
|
|
333
|
+
}
|
|
334
|
+
: undefined
|
|
335
|
+
}
|
|
336
|
+
>
|
|
337
|
+
<ReqoreIcon
|
|
338
|
+
icon={
|
|
339
|
+
!data[index]._selectId
|
|
340
|
+
? 'Forbid2Line'
|
|
341
|
+
: isSelected
|
|
342
|
+
? 'CheckboxCircleLine'
|
|
343
|
+
: 'CheckboxBlankCircleLine'
|
|
344
|
+
}
|
|
345
|
+
size={`${TEXT_FROM_SIZE[size]}px`}
|
|
346
|
+
style={{ opacity: !data[index]._selectId || !isSelected ? 0.4 : 1 }}
|
|
347
|
+
/>
|
|
348
|
+
</StyledTableCell>
|
|
349
|
+
)}
|
|
350
|
+
{renderCells(columns, data)}
|
|
351
|
+
</StyledTableRow>
|
|
352
|
+
);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export default ReqoreTableRow;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export interface IReqoreTabsContent extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
children?: any;
|
|
6
|
+
tabId: string | number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const StyledTabsContent = styled.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-flow: column;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
flex: 1;
|
|
14
|
+
padding: 10px;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
const ReqoreTabsContent = ({ children, className, ...rest }: IReqoreTabsContent) => (
|
|
18
|
+
<StyledTabsContent {...rest} className={`${className || ''} reqore-tabs-content`}>
|
|
19
|
+
{children}
|
|
20
|
+
</StyledTabsContent>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default ReqoreTabsContent;
|