@qoretechnologies/reqore 0.78.6-pr.715.g3e70b13 → 0.78.6-pr.715.g4e6c5cf
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/.claude/CLAUDE.md +14 -0
- package/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +17 -12
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +293 -34
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Breadcrumbs/item.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/item.js +6 -2
- package/dist/components/Breadcrumbs/item.js.map +1 -1
- package/dist/components/Bubble/index.d.ts.map +1 -1
- package/dist/components/Bubble/index.js +10 -41
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +8 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +78 -14
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/ButtonRail/index.d.ts.map +1 -1
- package/dist/components/ButtonRail/index.js +3 -2
- package/dist/components/ButtonRail/index.js.map +1 -1
- package/dist/components/Callout/index.d.ts +4 -3
- package/dist/components/Callout/index.d.ts.map +1 -1
- package/dist/components/Callout/index.js +40 -8
- package/dist/components/Callout/index.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +11 -10
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Collapse/index.d.ts.map +1 -1
- package/dist/components/Collapse/index.js +7 -36
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/CollapsibleContent/index.d.ts.map +1 -1
- package/dist/components/CollapsibleContent/index.js +6 -38
- package/dist/components/CollapsibleContent/index.js.map +1 -1
- package/dist/components/Collection/index.js +3 -3
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js +3 -3
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Columns/column.d.ts.map +1 -1
- package/dist/components/Columns/column.js +6 -35
- package/dist/components/Columns/column.js.map +1 -1
- package/dist/components/Columns/index.d.ts.map +1 -1
- package/dist/components/Columns/index.js +3 -35
- package/dist/components/Columns/index.js.map +1 -1
- package/dist/components/Comment/index.js +8 -8
- package/dist/components/Comment/index.js.map +1 -1
- package/dist/components/CommentFeed/index.js +2 -2
- package/dist/components/CommentFeed/index.js.map +1 -1
- package/dist/components/Content/index.d.ts.map +1 -1
- package/dist/components/Content/index.js +3 -35
- package/dist/components/Content/index.js.map +1 -1
- package/dist/components/Content/wrapper.js +2 -2
- package/dist/components/Content/wrapper.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +8 -4
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/ControlGroup/item.d.ts.map +1 -1
- package/dist/components/ControlGroup/item.js +35 -6
- package/dist/components/ControlGroup/item.js.map +1 -1
- package/dist/components/DataView/index.d.ts +6 -0
- package/dist/components/DataView/index.d.ts.map +1 -1
- package/dist/components/DataView/index.js +39 -66
- package/dist/components/DataView/index.js.map +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +40 -8
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DescriptionList/index.d.ts.map +1 -1
- package/dist/components/DescriptionList/index.js +12 -40
- package/dist/components/DescriptionList/index.js.map +1 -1
- package/dist/components/Drawer/backdrop.d.ts.map +1 -1
- package/dist/components/Drawer/backdrop.js +35 -6
- package/dist/components/Drawer/backdrop.js.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +39 -44
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +3 -1
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +71 -5
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +12 -6
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EntityRow/index.d.ts +18 -1
- package/dist/components/EntityRow/index.d.ts.map +1 -1
- package/dist/components/EntityRow/index.js +57 -13
- package/dist/components/EntityRow/index.js.map +1 -1
- package/dist/components/FadeScroller/index.d.ts.map +1 -1
- package/dist/components/FadeScroller/index.js +12 -62
- package/dist/components/FadeScroller/index.js.map +1 -1
- package/dist/components/FeatureCard/index.d.ts +7 -1
- package/dist/components/FeatureCard/index.d.ts.map +1 -1
- package/dist/components/FeatureCard/index.js +33 -10
- package/dist/components/FeatureCard/index.js.map +1 -1
- package/dist/components/Header/index.js +2 -2
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +21 -6
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/IconPicker/index.js +2 -2
- package/dist/components/IconPicker/index.js.map +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +11 -10
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.js +35 -3
- package/dist/components/InputClearButton/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +37 -9
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyboardShortcut/index.d.ts.map +1 -1
- package/dist/components/KeyboardShortcut/index.js +6 -5
- package/dist/components/KeyboardShortcut/index.js.map +1 -1
- package/dist/components/Layout/content.js +2 -2
- package/dist/components/Layout/content.js.map +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +8 -36
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +13 -40
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/Menu/divider.d.ts.map +1 -1
- package/dist/components/Menu/divider.js +7 -4
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +17 -11
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/item.d.ts.map +1 -1
- package/dist/components/Menu/item.js +28 -0
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Menu/section.d.ts.map +1 -1
- package/dist/components/Menu/section.js +11 -6
- package/dist/components/Menu/section.js.map +1 -1
- package/dist/components/NavRail/index.d.ts.map +1 -1
- package/dist/components/NavRail/index.js +16 -6
- package/dist/components/NavRail/index.js.map +1 -1
- package/dist/components/Navbar/divider.d.ts.map +1 -1
- package/dist/components/Navbar/divider.js +35 -6
- package/dist/components/Navbar/divider.js.map +1 -1
- package/dist/components/Navbar/group.js +3 -3
- package/dist/components/Navbar/group.js.map +1 -1
- package/dist/components/Navbar/index.js +3 -3
- package/dist/components/Navbar/index.js.map +1 -1
- package/dist/components/Navbar/item.js +3 -3
- package/dist/components/Navbar/item.js.map +1 -1
- package/dist/components/Notifications/index.d.ts.map +1 -1
- package/dist/components/Notifications/index.js +6 -35
- package/dist/components/Notifications/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +23 -47
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.d.ts.map +1 -1
- package/dist/components/Notifications/styles.js +11 -10
- package/dist/components/Notifications/styles.js.map +1 -1
- package/dist/components/Paging/index.d.ts.map +1 -1
- package/dist/components/Paging/index.js +19 -19
- package/dist/components/Paging/index.js.map +1 -1
- package/dist/components/Panel/index.d.ts +12 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +321 -44
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Paragraph/index.d.ts +6 -0
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +60 -11
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Popover/index.d.ts +8 -0
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +166 -18
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +13 -44
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/Rating/index.d.ts.map +1 -1
- package/dist/components/Rating/index.js +13 -39
- package/dist/components/Rating/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +42 -7
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/RowActionsMenu/index.d.ts +69 -0
- package/dist/components/RowActionsMenu/index.d.ts.map +1 -0
- package/dist/components/RowActionsMenu/index.js +170 -0
- package/dist/components/RowActionsMenu/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.js +17 -46
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/Select/valuePreview.js +6 -3
- package/dist/components/Select/valuePreview.js.map +1 -1
- package/dist/components/SeverityRow/index.d.ts +19 -1
- package/dist/components/SeverityRow/index.d.ts.map +1 -1
- package/dist/components/SeverityRow/index.js +59 -15
- package/dist/components/SeverityRow/index.js.map +1 -1
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +6 -35
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Slider/index.js +9 -9
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Spacer/index.js +7 -7
- package/dist/components/Spacer/index.js.map +1 -1
- package/dist/components/Span/index.d.ts.map +1 -1
- package/dist/components/Span/index.js +38 -9
- package/dist/components/Span/index.js.map +1 -1
- package/dist/components/StackedBar/index.d.ts.map +1 -1
- package/dist/components/StackedBar/index.js +16 -39
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.d.ts +8 -1
- package/dist/components/Statistic/index.d.ts.map +1 -1
- package/dist/components/Statistic/index.js +12 -40
- package/dist/components/Statistic/index.js.map +1 -1
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +41 -41
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +32 -24
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/header.d.ts.map +1 -1
- package/dist/components/Table/header.js +13 -10
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +26 -52
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +37 -0
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +72 -1
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +57 -2
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +154 -59
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +3 -1
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +45 -14
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/scrollbar.js +3 -3
- package/dist/components/Table/scrollbar.js.map +1 -1
- package/dist/components/Tabs/content.js +2 -2
- package/dist/components/Tabs/content.js.map +1 -1
- package/dist/components/Tabs/index.js +3 -3
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/item.d.ts.map +1 -1
- package/dist/components/Tabs/item.js +7 -5
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.d.ts +4 -2
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +31 -19
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/group.d.ts.map +1 -1
- package/dist/components/Tag/group.js +3 -35
- package/dist/components/Tag/group.js.map +1 -1
- package/dist/components/Tag/index.d.ts +7 -0
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +91 -24
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Testimonial/index.d.ts +6 -1
- package/dist/components/Testimonial/index.d.ts.map +1 -1
- package/dist/components/Testimonial/index.js +29 -7
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +10 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +164 -18
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tier/group.d.ts.map +1 -1
- package/dist/components/Tier/group.js +9 -8
- package/dist/components/Tier/group.js.map +1 -1
- package/dist/components/Tier/index.d.ts +5 -0
- package/dist/components/Tier/index.d.ts.map +1 -1
- package/dist/components/Tier/index.js +15 -11
- package/dist/components/Tier/index.js.map +1 -1
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +21 -18
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/TooltipComponent/index.d.ts.map +1 -1
- package/dist/components/TooltipComponent/index.js +6 -7
- package/dist/components/TooltipComponent/index.js.map +1 -1
- package/dist/components/Tree/index.js +3 -3
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/components/Tree/modal.d.ts.map +1 -1
- package/dist/components/Tree/modal.js +3 -1
- package/dist/components/Tree/modal.js.map +1 -1
- package/dist/constants/sizes.d.ts +5 -0
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +6 -1
- package/dist/constants/sizes.js.map +1 -1
- package/dist/constants/theme.d.ts +44 -0
- package/dist/constants/theme.d.ts.map +1 -1
- package/dist/constants/theme.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +27 -13
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +8 -36
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/helpers/hoveringPointer.d.ts +54 -0
- package/dist/helpers/hoveringPointer.d.ts.map +1 -0
- package/dist/helpers/hoveringPointer.js +66 -0
- package/dist/helpers/hoveringPointer.js.map +1 -0
- package/dist/helpers/styled.d.ts +39 -26
- package/dist/helpers/styled.d.ts.map +1 -1
- package/dist/helpers/styled.js +156 -4
- package/dist/helpers/styled.js.map +1 -1
- package/dist/helpers/typeScale.d.ts +25 -0
- package/dist/helpers/typeScale.d.ts.map +1 -0
- package/dist/helpers/typeScale.js +28 -0
- package/dist/helpers/typeScale.js.map +1 -0
- package/dist/hooks/useCloneThroughFragments.d.ts.map +1 -1
- package/dist/hooks/useCloneThroughFragments.js +51 -18
- package/dist/hooks/useCloneThroughFragments.js.map +1 -1
- package/dist/hooks/useDragToScroll.d.ts +58 -0
- package/dist/hooks/useDragToScroll.d.ts.map +1 -0
- package/dist/hooks/useDragToScroll.js +262 -0
- package/dist/hooks/useDragToScroll.js.map +1 -0
- package/dist/hooks/useMarqueeOnHover.d.ts.map +1 -1
- package/dist/hooks/useMarqueeOnHover.js +10 -0
- package/dist/hooks/useMarqueeOnHover.js.map +1 -1
- package/dist/hooks/usePaging.d.ts +9 -4
- package/dist/hooks/usePaging.d.ts.map +1 -1
- package/dist/hooks/usePaging.js +21 -32
- package/dist/hooks/usePaging.js.map +1 -1
- package/dist/hooks/usePointerDrag.d.ts.map +1 -1
- package/dist/hooks/usePointerDrag.js +13 -3
- package/dist/hooks/usePointerDrag.js.map +1 -1
- package/dist/hooks/useReqoreMedia.d.ts +22 -7
- package/dist/hooks/useReqoreMedia.d.ts.map +1 -1
- package/dist/hooks/useReqoreMedia.js +33 -9
- package/dist/hooks/useReqoreMedia.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.js +6 -6
- package/dist/styles.js.map +1 -1
- package/docs/docs/guides/theming.mdx +15 -0
- package/package.json +2 -4
- package/vitest.config.ts +105 -31
|
@@ -14,39 +14,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
};
|
|
15
15
|
return __assign.apply(this, arguments);
|
|
16
16
|
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
-
var ownKeys = function(o) {
|
|
35
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
-
var ar = [];
|
|
37
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
return ownKeys(o);
|
|
41
|
-
};
|
|
42
|
-
return function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
})();
|
|
50
17
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
51
18
|
var t = {};
|
|
52
19
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -65,7 +32,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
65
32
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
66
33
|
var polished_1 = require("polished");
|
|
67
34
|
var react_1 = require("react");
|
|
68
|
-
var styled_components_1 =
|
|
35
|
+
var styled_components_1 = require("styled-components");
|
|
36
|
+
var styled_1 = __importDefault(require("../../helpers/styled"));
|
|
69
37
|
var sizes_1 = require("../../constants/sizes");
|
|
70
38
|
var colors_1 = require("../../helpers/colors");
|
|
71
39
|
var utils_1 = require("../../helpers/utils");
|
|
@@ -89,7 +57,7 @@ var TREND_DEFAULT_INTENTS = {
|
|
|
89
57
|
down: 'danger',
|
|
90
58
|
neutral: 'muted',
|
|
91
59
|
};
|
|
92
|
-
var StyledStatisticWrapper = (0,
|
|
60
|
+
var StyledStatisticWrapper = (0, styled_1.default)(Effect_1.StyledEffect)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n /* ---- Layout --------------------------------------------------------\n The Statistic is rendered as a real div (see the as=div on the JSX)\n rather than the default StyledEffect span. A span containing block\n children (the value row and the trend group are both divs) is the\n wrong content model and produced a box that did not establish a\n proper containment context, so overflow + min-width did not hold\n the inner text inside the tile. With a div root the wrapper can be\n a proper flex column container. */\n display: flex;\n flex-direction: column;\n align-items: ", ";\n justify-content: ", ";\n width: ", ";\n /* ---- Overflow safety ----------------------------------------------\n Statistic tiles are commonly laid out inside flex or grid parents\n (KPI strips, dashboards). Without bounding the tile intrinsic\n width to its column, the widest unbreakable token in the value,\n trend or label can push past the column edge and bleed into the\n neighbouring tile. min-width 0 lets a flex or grid row narrow the\n tile to its share - without it a tile is never narrower than the\n longest word of its label, and four tiles in a 320px row reached\n past it - max-width 100% caps the box at the column it lives in,\n and overflow clip clips any child that refuses to honour the cap.\n A tile with room keeps its label's words whole: they break only\n where one alone is wider than the tile (the label rule below). */\n min-width: 0;\n max-width: 100%;\n overflow: clip;\n & .reqore-statistic-content,\n & .reqore-statistic-label,\n & .reqore-statistic-value-row,\n & .reqore-statistic-trend {\n max-width: 100%;\n min-width: 0;\n }\n /* The trend slot is a ReqoreControlGroup which defaults to\n \"flex: 0 0 auto\" (ControlGroup/index.tsx). That kills flex-shrink\n so the group keeps its intrinsic content width and would push the\n tile past its grid track when the trend copy is long. Forcing the\n group to shrink lets the text-leaf wrap rules below take effect. */\n & .reqore-statistic-trend {\n flex: 0 1 auto;\n flex-wrap: wrap;\n }\n /* Wrap rather than ellipsis \u2014 KPI tiles benefit from the operator\n seeing the whole sub-line rather than a clipped fragment. A label\n is words: it wraps between them, and a word breaks only when it\n alone is wider than the tile (break-word; anywhere, or\n word-break: break-all, broke words that had room - \"DEPEND / ENCI /\n ES\" on a 120px tile). */\n /* A label that wraps is aligned as its tile is (centred by default): its box is centred by\n align-items, but its lines were left-aligned inside it, so a broken label sat to the left of\n its value and of the tiles beside it whose labels fit on one line. */\n & .reqore-statistic-label {\n white-space: normal;\n overflow-wrap: break-word;\n word-break: normal;\n max-width: 100%;\n text-align: ", ";\n }\n /* overflow-wrap anywhere covers identifiers, URLs and long codes\n with no natural break point. */\n & .reqore-statistic-value,\n & .reqore-statistic-prefix,\n & .reqore-statistic-suffix {\n white-space: normal;\n overflow-wrap: anywhere;\n word-break: break-word;\n max-width: 100%;\n }\n & .reqore-statistic-trend > span {\n white-space: normal;\n overflow-wrap: anywhere;\n word-break: break-word;\n min-width: 0;\n max-width: 100%;\n }\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"], ["\n /* ---- Layout --------------------------------------------------------\n The Statistic is rendered as a real div (see the as=div on the JSX)\n rather than the default StyledEffect span. A span containing block\n children (the value row and the trend group are both divs) is the\n wrong content model and produced a box that did not establish a\n proper containment context, so overflow + min-width did not hold\n the inner text inside the tile. With a div root the wrapper can be\n a proper flex column container. */\n display: flex;\n flex-direction: column;\n align-items: ", ";\n justify-content: ", ";\n width: ", ";\n /* ---- Overflow safety ----------------------------------------------\n Statistic tiles are commonly laid out inside flex or grid parents\n (KPI strips, dashboards). Without bounding the tile intrinsic\n width to its column, the widest unbreakable token in the value,\n trend or label can push past the column edge and bleed into the\n neighbouring tile. min-width 0 lets a flex or grid row narrow the\n tile to its share - without it a tile is never narrower than the\n longest word of its label, and four tiles in a 320px row reached\n past it - max-width 100% caps the box at the column it lives in,\n and overflow clip clips any child that refuses to honour the cap.\n A tile with room keeps its label's words whole: they break only\n where one alone is wider than the tile (the label rule below). */\n min-width: 0;\n max-width: 100%;\n overflow: clip;\n & .reqore-statistic-content,\n & .reqore-statistic-label,\n & .reqore-statistic-value-row,\n & .reqore-statistic-trend {\n max-width: 100%;\n min-width: 0;\n }\n /* The trend slot is a ReqoreControlGroup which defaults to\n \"flex: 0 0 auto\" (ControlGroup/index.tsx). That kills flex-shrink\n so the group keeps its intrinsic content width and would push the\n tile past its grid track when the trend copy is long. Forcing the\n group to shrink lets the text-leaf wrap rules below take effect. */\n & .reqore-statistic-trend {\n flex: 0 1 auto;\n flex-wrap: wrap;\n }\n /* Wrap rather than ellipsis \u2014 KPI tiles benefit from the operator\n seeing the whole sub-line rather than a clipped fragment. A label\n is words: it wraps between them, and a word breaks only when it\n alone is wider than the tile (break-word; anywhere, or\n word-break: break-all, broke words that had room - \"DEPEND / ENCI /\n ES\" on a 120px tile). */\n /* A label that wraps is aligned as its tile is (centred by default): its box is centred by\n align-items, but its lines were left-aligned inside it, so a broken label sat to the left of\n its value and of the tiles beside it whose labels fit on one line. */\n & .reqore-statistic-label {\n white-space: normal;\n overflow-wrap: break-word;\n word-break: normal;\n max-width: 100%;\n text-align: ", ";\n }\n /* overflow-wrap anywhere covers identifiers, URLs and long codes\n with no natural break point. */\n & .reqore-statistic-value,\n & .reqore-statistic-prefix,\n & .reqore-statistic-suffix {\n white-space: normal;\n overflow-wrap: anywhere;\n word-break: break-word;\n max-width: 100%;\n }\n & .reqore-statistic-trend > span {\n white-space: normal;\n overflow-wrap: anywhere;\n word-break: break-word;\n min-width: 0;\n max-width: 100%;\n }\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
93
61
|
var $align = _a.$align;
|
|
94
62
|
return $align === 'center'
|
|
95
63
|
? 'center'
|
|
@@ -102,6 +70,9 @@ var StyledStatisticWrapper = (0, styled_components_1.default)(Effect_1.StyledEff
|
|
|
102
70
|
}, function (_a) {
|
|
103
71
|
var $fluid = _a.$fluid;
|
|
104
72
|
return ($fluid ? '100%' : undefined);
|
|
73
|
+
}, function (_a) {
|
|
74
|
+
var $align = _a.$align;
|
|
75
|
+
return $align === 'center' ? 'center' : $align === 'flex-end' ? 'right' : 'left';
|
|
105
76
|
}, function (_a) {
|
|
106
77
|
var $hasBackground = _a.$hasBackground, theme = _a.theme, size = _a.size, rounded = _a.rounded, radiusSize = _a.radiusSize, flat = _a.flat, intent = _a.intent, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b, $padded = _a.$padded, $paddingSize = _a.$paddingSize;
|
|
107
78
|
return $hasBackground && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: ", "px;\n border: ", ";\n color: ", ";\n padding: ", ";\n "], ["\n background-color: ", ";\n border-radius: ", "px;\n border: ", ";\n color: ", ";\n padding: ", ";\n "])), (0, polished_1.rgba)((0, colors_1.getPanelBackgroundColor)(theme), opacity), rounded ? (0, sizes_1.resolveRadius)(size, radiusSize) : 0, flat
|
|
@@ -123,12 +94,12 @@ var StyledStatisticWrapper = (0, styled_components_1.default)(Effect_1.StyledEff
|
|
|
123
94
|
var disabled = _a.disabled;
|
|
124
95
|
return disabled && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n "], ["\n ", ";\n "])), styles_1.DisabledElement);
|
|
125
96
|
});
|
|
126
|
-
var StyledStatisticValueRow =
|
|
97
|
+
var StyledStatisticValueRow = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items: baseline;\n gap: 4px;\n flex-wrap: nowrap;\n\n /* valueAs: the row is the one element the value is written in. A heading or a paragraph\n brings the browser's margins, which the value never had; and the weight the headings\n used to bring is the row's to give where it is not a heading. */\n ", "\n"], ["\n display: flex;\n align-items: baseline;\n gap: 4px;\n flex-wrap: nowrap;\n\n /* valueAs: the row is the one element the value is written in. A heading or a paragraph\n brings the browser's margins, which the value never had; and the weight the headings\n used to bring is the row's to give where it is not a heading. */\n ", "\n"])), function (_a) {
|
|
127
98
|
var $element = _a.$element;
|
|
128
99
|
return $element && (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin: 0;\n padding: 0;\n font-size: inherit;\n ", "\n "], ["\n margin: 0;\n padding: 0;\n font-size: inherit;\n ", "\n "])), !HEADING_ELEMENTS.includes($element) && (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-weight: bold;\n "], ["\n font-weight: bold;\n "]))));
|
|
129
100
|
});
|
|
130
101
|
/** The value itself while it counts: there for screen readers, not on screen. */
|
|
131
|
-
var StyledStatisticValueFinal =
|
|
102
|
+
var StyledStatisticValueFinal = styled_1.default.span(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n"], ["\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n"])));
|
|
132
103
|
var PREFIX_SUFFIX_EFFECT = { opacity: 0.6 };
|
|
133
104
|
/**
|
|
134
105
|
* The prefix, the value or the suffix. Without `valueAs` each is its own heading, as it always
|
|
@@ -140,12 +111,12 @@ var StatisticValuePart = (0, react_1.memo)(function (_a) {
|
|
|
140
111
|
return as ? ((0, jsx_runtime_1.jsx)(Header_1.StyledHeader, { as: 'span', _size: sizes_1.HEADER_SIZE_TO_NUMBER[size], theme: theme, effect: effect, className: className, children: children })) : ((0, jsx_runtime_1.jsx)(Header_1.ReqoreHeading, { size: size, className: className, effect: effect, children: children }));
|
|
141
112
|
});
|
|
142
113
|
var ReqoreStatistic = (0, react_1.memo)((0, react_1.forwardRef)(function (_a, ref) {
|
|
143
|
-
var value = _a.value, label = _a.label, icon = _a.icon, iconColor = _a.iconColor, iconProps = _a.iconProps, prefix = _a.prefix, suffix = _a.suffix, trend = _a.trend, valueEffect = _a.valueEffect, valueAs = _a.valueAs, countUp = _a.countUp, labelEffect = _a.labelEffect, description = _a.description, descriptionEffect = _a.descriptionEffect, effect = _a.effect,
|
|
114
|
+
var value = _a.value, label = _a.label, _b = _a.labelPosition, labelPosition = _b === void 0 ? 'above' : _b, icon = _a.icon, iconColor = _a.iconColor, iconProps = _a.iconProps, prefix = _a.prefix, suffix = _a.suffix, trend = _a.trend, valueEffect = _a.valueEffect, valueAs = _a.valueAs, countUp = _a.countUp, labelEffect = _a.labelEffect, description = _a.description, descriptionEffect = _a.descriptionEffect, effect = _a.effect, _c = _a.align, align = _c === void 0 ? 'center' : _c, _d = _a.size, size = _d === void 0 ? 'normal' : _d, customTheme = _a.customTheme, inheritCustomTheme = _a.inheritCustomTheme, intent = _a.intent, fluid = _a.fluid, flat = _a.flat, disabled = _a.disabled, tooltip = _a.tooltip, rounded = _a.rounded, radiusSize = _a.radiusSize, transparent = _a.transparent, opacity = _a.opacity, raised = _a.raised, _e = _a.padded, padded = _e === void 0 ? true : _e, paddingSize = _a.paddingSize, className = _a.className, rest = __rest(_a, ["value", "label", "labelPosition", "icon", "iconColor", "iconProps", "prefix", "suffix", "trend", "valueEffect", "valueAs", "countUp", "labelEffect", "description", "descriptionEffect", "effect", "align", "size", "customTheme", "inheritCustomTheme", "intent", "fluid", "flat", "disabled", "tooltip", "rounded", "radiusSize", "transparent", "opacity", "raised", "padded", "paddingSize", "className"]);
|
|
144
115
|
var theme = (0, useTheme_1.useReqoreTheme)('main', customTheme, intent, undefined, inheritCustomTheme);
|
|
145
116
|
// What a ReqoreHeading resolves for itself: the value's text never takes the intent.
|
|
146
117
|
var valueTheme = (0, useTheme_1.useReqoreTheme)('main');
|
|
147
118
|
var valueRowRef = (0, react_1.useRef)(null);
|
|
148
|
-
var
|
|
119
|
+
var _f = (0, useCountUp_1.useCountUp)(value, countUp, valueRowRef), display = _f.display, final = _f.final, counting = _f.counting;
|
|
149
120
|
var secondarySize = (0, react_1.useMemo)(function () { return (0, utils_1.getOneLessSize)(size); }, [size]);
|
|
150
121
|
var valueSize = (0, react_1.useMemo)(function () { return (0, utils_1.getOneHigherSize)(size); }, [size]);
|
|
151
122
|
var flexAlign = (0, react_1.useMemo)(function () { return (0, utils_1.alignToFlexAlign)(align); }, [align]);
|
|
@@ -166,6 +137,7 @@ var ReqoreStatistic = (0, react_1.memo)((0, react_1.forwardRef)(function (_a, re
|
|
|
166
137
|
}
|
|
167
138
|
return newEffect;
|
|
168
139
|
}, [effect, intent, theme]);
|
|
140
|
+
var labelElement = ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, { size: secondarySize, className: 'reqore-statistic-label', effect: __assign({ opacity: 0.7, uppercase: theme.uppercaseLabels !== false, spaced: theme.uppercaseLabels !== false ? 1 : 0 }, labelEffect), children: label }));
|
|
169
141
|
return ((0, jsx_runtime_1.jsx)(TooltipComponent_1.ReqoreTooltipComponent, __assign({}, rest, {
|
|
170
142
|
// Render as a real block-level `<div>`. The base styled
|
|
171
143
|
// element (`StyledEffect`) is a `<span>`, which is wrong
|
|
@@ -176,7 +148,7 @@ var ReqoreStatistic = (0, react_1.memo)((0, react_1.forwardRef)(function (_a, re
|
|
|
176
148
|
// resulting box doesn't establish containment cleanly,
|
|
177
149
|
// which is why `overflow: hidden` + `min-width: 0` didn't
|
|
178
150
|
// hold their text inside the tile.
|
|
179
|
-
as: 'div', Component: StyledStatisticWrapper, tooltip: tooltip, ref: ref, theme: theme, size: size, "$fluid": fluid, disabled: disabled, "$hasBackground": hasBackground, "$interactive": interactive, "$align": flexAlign, rounded: rounded, radiusSize: radiusSize, flat: flat, intent: intent, opacity: transparent ? 0 : opacity, "$raised": raised, "$padded": padded, "$paddingSize": paddingSize !== null && paddingSize !== void 0 ? paddingSize : size, effect: transformedEffect, className: "".concat(className || '', " reqore-statistic"), children: (0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { vertical: true, horizontalAlign: flexAlign, className: 'reqore-statistic-content', children: [icon && ((0, jsx_runtime_1.jsx)(Icon_1.default, __assign({}, iconProps, { icon: icon, size: size, color: iconColor, intent: iconColor ? undefined : intent, className: 'reqore-statistic-icon' }))), label &&
|
|
151
|
+
as: 'div', Component: StyledStatisticWrapper, tooltip: tooltip, ref: ref, theme: theme, size: size, "$fluid": fluid, disabled: disabled, "$hasBackground": hasBackground, "$interactive": interactive, "$align": flexAlign, rounded: rounded, radiusSize: radiusSize, flat: flat, intent: intent, opacity: transparent ? 0 : opacity, "$raised": raised, "$padded": padded, "$paddingSize": paddingSize !== null && paddingSize !== void 0 ? paddingSize : size, effect: transformedEffect, className: "".concat(className || '', " reqore-statistic"), children: (0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { vertical: true, horizontalAlign: flexAlign, className: 'reqore-statistic-content', children: [icon && ((0, jsx_runtime_1.jsx)(Icon_1.default, __assign({}, iconProps, { icon: icon, size: size, color: iconColor, intent: iconColor ? undefined : intent, className: 'reqore-statistic-icon' }))), label && labelPosition !== 'below' ? labelElement : null, (0, jsx_runtime_1.jsxs)(StyledStatisticValueRow, { ref: valueRowRef, as: valueAs, "$element": valueAs, className: 'reqore-statistic-value-row', children: [prefix && ((0, jsx_runtime_1.jsx)(StatisticValuePart, { as: valueAs, size: valueSize, theme: valueTheme, className: 'reqore-statistic-prefix', effect: PREFIX_SUFFIX_EFFECT, children: prefix })), (0, jsx_runtime_1.jsx)(StatisticValuePart, { as: valueAs, size: valueSize, theme: valueTheme, className: 'reqore-statistic-value', effect: valueEffect, children: counting ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true', className: 'reqore-statistic-value-count', children: display }), (0, jsx_runtime_1.jsx)(StyledStatisticValueFinal, { className: 'reqore-statistic-value-final', children: final })] })) : (display) }), suffix && ((0, jsx_runtime_1.jsx)(StatisticValuePart, { as: valueAs, size: valueSize, theme: valueTheme, className: 'reqore-statistic-suffix', effect: PREFIX_SUFFIX_EFFECT, children: suffix }))] }), label && labelPosition === 'below' ? labelElement : null, trend && ((0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { gapSize: 'micro', verticalAlign: 'center', className: 'reqore-statistic-trend', children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { icon: trendIcon, size: secondarySize, intent: trendIntent }), trend.value !== undefined && ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, { size: secondarySize, intent: trendIntent, children: trend.value }))] })), description !== undefined && description !== null && description !== '' && ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, { size: secondarySize, className: 'reqore-statistic-description', effect: __assign({ opacity: 0.6 }, descriptionEffect), children: description }))] }) })));
|
|
180
152
|
}));
|
|
181
153
|
exports.default = ReqoreStatistic;
|
|
182
154
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Statistic/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Statistic/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAgC;AAChC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AC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/components/Table/body.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/components/Table/body.tsx"],"names":[],"mappings":"AAiBA,OAAuB,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAG/D,MAAM,WAAW,4BAA6B,SAAQ,sBAAsB;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC;;AAoYD,wBAAqC"}
|
|
@@ -14,39 +14,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
};
|
|
15
15
|
return __assign.apply(this, arguments);
|
|
16
16
|
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
-
var ownKeys = function(o) {
|
|
35
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
-
var ar = [];
|
|
37
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
return ownKeys(o);
|
|
41
|
-
};
|
|
42
|
-
return function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
})();
|
|
50
17
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
51
18
|
var t = {};
|
|
52
19
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -66,7 +33,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
66
33
|
var size_1 = __importDefault(require("lodash/size"));
|
|
67
34
|
var react_1 = require("react");
|
|
68
35
|
var react_window_1 = require("react-window");
|
|
69
|
-
var styled_components_1 =
|
|
36
|
+
var styled_components_1 = require("styled-components");
|
|
37
|
+
var styled_1 = __importDefault(require("../../helpers/styled"));
|
|
70
38
|
var sizes_1 = require("../../constants/sizes");
|
|
71
39
|
var useCombinedRefs_1 = require("../../hooks/useCombinedRefs");
|
|
72
40
|
var helpers_1 = require("./helpers");
|
|
@@ -81,19 +49,19 @@ var MIN_OVERSCAN_ROWS = 8;
|
|
|
81
49
|
// Wrapper that owns the overlay scrollbar's positioning context. The native
|
|
82
50
|
// scroll container (the react-window list / `StyledNonVirtualizedBody`) lives inside;
|
|
83
51
|
// the overlay thumb is absolutely positioned over its right edge.
|
|
84
|
-
var StyledBodyWrapper =
|
|
52
|
+
var StyledBodyWrapper = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n flex: 1 1 auto;\n min-height: 0;\n"], ["\n position: relative;\n flex: 1 1 auto;\n min-height: 0;\n"])));
|
|
85
53
|
// Hide the native scrollbar so the body's content area is always the full
|
|
86
54
|
// container width. The header and body therefore align by construction —
|
|
87
55
|
// nothing needs to measure the scrollbar at runtime. Scrolling still works
|
|
88
56
|
// natively (wheel, trackpad, touch, keyboard); the overlay thumb above is a
|
|
89
57
|
// purely visual cue + drag handle.
|
|
90
58
|
var hideNativeScrollbar = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n scrollbar-width: none;\n &::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n"], ["\n scrollbar-width: none;\n &::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n"])));
|
|
91
|
-
var StyledFixedList = (0,
|
|
59
|
+
var StyledFixedList = (0, styled_1.default)(react_window_1.FixedSizeList)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n box-sizing: border-box;\n ", "\n"], ["\n box-sizing: border-box;\n ", "\n"])), hideNativeScrollbar);
|
|
92
60
|
/* Used only when rows can expand. A panel's height is not knowable up front and
|
|
93
61
|
changes while it is open, so the list has to be told each item's size — and
|
|
94
62
|
re-told whenever a measurement lands. */
|
|
95
|
-
var StyledVariableList = (0,
|
|
96
|
-
var StyledNonVirtualizedBody =
|
|
63
|
+
var StyledVariableList = (0, styled_1.default)(react_window_1.VariableSizeList)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n box-sizing: border-box;\n ", "\n"], ["\n box-sizing: border-box;\n ", "\n"])), hideNativeScrollbar);
|
|
64
|
+
var StyledNonVirtualizedBody = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
97
65
|
var maxHeight = _a.maxHeight, minWidth = _a.minWidth;
|
|
98
66
|
return (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n box-sizing: border-box;\n overflow: auto;\n ", "\n ", "\n > * {\n min-width: ", "px;\n }\n "], ["\n box-sizing: border-box;\n overflow: auto;\n ", "\n ", "\n > * {\n min-width: ", "px;\n }\n "])), hideNativeScrollbar, maxHeight || maxHeight === 0
|
|
99
67
|
? (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n max-height: ", "px;\n "], ["\n max-height: ", "px;\n "])), maxHeight) : '', minWidth);
|
|
@@ -162,21 +130,53 @@ var ReqoreTableBody = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
162
130
|
itemDataRef.current = nextItemData;
|
|
163
131
|
}
|
|
164
132
|
var itemData = itemDataRef.current;
|
|
165
|
-
// Sync body horizontal scroll to the header
|
|
133
|
+
// Sync body horizontal scroll to the header, mark which pinned edges have
|
|
134
|
+
// columns hidden under them, and notify vertical scroll state
|
|
166
135
|
(0, react_1.useEffect)(function () {
|
|
167
136
|
var el = targetRef.current;
|
|
168
137
|
if (!el) {
|
|
169
138
|
return undefined;
|
|
170
139
|
}
|
|
140
|
+
// A pinned column's edge shadow says "there is more under here". It is
|
|
141
|
+
// only true while there is: content scrolled past the left edge, or
|
|
142
|
+
// content still to the right of the viewport. Written as an attribute
|
|
143
|
+
// on the two scroll containers rather than through React state, so a
|
|
144
|
+
// scroll never re-renders a row to move a shadow.
|
|
145
|
+
var markOverflow = function () {
|
|
146
|
+
var sides = [
|
|
147
|
+
el.scrollLeft > 0 ? 'left' : undefined,
|
|
148
|
+
el.scrollLeft + el.clientWidth < el.scrollWidth - 1 ? 'right' : undefined,
|
|
149
|
+
]
|
|
150
|
+
.filter(Boolean)
|
|
151
|
+
.join(' ');
|
|
152
|
+
for (var _i = 0, _a = [el, headerRef.current]; _i < _a.length; _i++) {
|
|
153
|
+
var target = _a[_i];
|
|
154
|
+
if (!target)
|
|
155
|
+
continue;
|
|
156
|
+
if (sides)
|
|
157
|
+
target.setAttribute(helpers_1.TABLE_OVERFLOW_ATTRIBUTE, sides);
|
|
158
|
+
else
|
|
159
|
+
target.removeAttribute(helpers_1.TABLE_OVERFLOW_ATTRIBUTE);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
171
162
|
var handleScroll = function () {
|
|
172
163
|
if (headerRef.current) {
|
|
173
164
|
headerRef.current.scrollLeft = el.scrollLeft;
|
|
174
165
|
}
|
|
166
|
+
markOverflow();
|
|
175
167
|
onScrollChange === null || onScrollChange === void 0 ? void 0 : onScrollChange(el.scrollTop > 0);
|
|
176
168
|
};
|
|
169
|
+
markOverflow();
|
|
177
170
|
el.addEventListener('scroll', handleScroll, { passive: true });
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
// The viewport changing width changes what is hidden, without a scroll.
|
|
172
|
+
var observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(markOverflow);
|
|
173
|
+
observer === null || observer === void 0 ? void 0 : observer.observe(el);
|
|
174
|
+
return function () {
|
|
175
|
+
el.removeEventListener('scroll', handleScroll);
|
|
176
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
177
|
+
};
|
|
178
|
+
// `totalColumnsWidth`: the columns changing width changes what is hidden too.
|
|
179
|
+
}, [headerRef, onScrollChange, targetRef, totalColumnsWidth]);
|
|
180
180
|
/**
|
|
181
181
|
* Measured heights of open detail panels, keyed by expansion id.
|
|
182
182
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/components/Table/body.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/components/Table/body.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAgC;AAChC,+BASe;AACf,6CAA+D;AAC/D,uDAAw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BAAiB,EAAE,SAAS,EAC5B,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAC,MAAM,YAEX,aAAc,GACI,EACrB,uBAAC,gCAAoB,IAAC,SAAS,EAAE,SAAS,GAAI,IAC5B,CACrB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,wBAAC,iBAAiB,eAChB,uBAAC,eAAe,IACd,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,cAAc,EACtB,SAAS,EAAC,mBAAmB,EAC7B,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAC,MAAM,YAEX,aAAc,GACC,EAClB,uBAAC,gCAAoB,IAAC,SAAS,EAAE,SAAS,GAAI,IAC5B,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAe,IAAA,YAAI,EAAC,eAAe,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../../src/components/Table/cell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../../src/components/Table/cell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAW/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAqB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAM7D,MAAM,WAAW,+BAAgC,SAAQ,yBAAyB;CAAG;AACrF,MAAM,WAAW,0BAA2B,SAAQ,KAAK,CAAC,EAAE,CAAC,+BAA+B,CAAC;CAAG;AAChG,MAAM,WAAW,yBACf,SAAQ,OAAO,CAAC,kBAAkB,CAAC,EACjC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,kBAAkB;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uBAAuB,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,eAAe,KAqS3B,CAAC;AAwBF,eAAO,MAAM,mBAAmB,gKA+E/B,CAAC"}
|
|
@@ -66,22 +66,22 @@ exports.ReqoreTableBodyCell = exports.StyledTableCell = void 0;
|
|
|
66
66
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
67
67
|
var polished_1 = require("polished");
|
|
68
68
|
var react_1 = require("react");
|
|
69
|
-
var styled_components_1 =
|
|
70
|
-
var
|
|
69
|
+
var styled_components_1 = require("styled-components");
|
|
70
|
+
var typeScale_1 = require("../../helpers/typeScale");
|
|
71
71
|
var colors_1 = require("../../helpers/colors");
|
|
72
|
-
var styled_1 = require("../../helpers/styled");
|
|
72
|
+
var styled_1 = __importStar(require("../../helpers/styled"));
|
|
73
73
|
var utils_1 = require("../../helpers/utils");
|
|
74
74
|
var Button_1 = __importDefault(require("../Button"));
|
|
75
|
+
var helpers_1 = require("./helpers");
|
|
75
76
|
var TooltipComponent_1 = require("../TooltipComponent");
|
|
76
|
-
exports.StyledTableCell =
|
|
77
|
+
exports.StyledTableCell = styled_1.default.div.withConfig({
|
|
77
78
|
// `wrap` drives the cell's white-space rule and `width` its CSS width; neither is a DOM
|
|
78
79
|
// attribute of a `div`.
|
|
79
80
|
shouldForwardProp: (0, styled_1.omitStyleProps)('wrap', 'width'),
|
|
80
|
-
})(
|
|
81
|
+
})(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), function (_a) {
|
|
81
82
|
var width = _a.width, minWidth = _a.minWidth, maxWidth = _a.maxWidth, grow = _a.grow;
|
|
82
83
|
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", "px;\n min-width: ", "px;\n max-width: ", "px;\n\n flex-grow: ", ";\n "], ["\n width: ", "px;\n min-width: ", "px;\n max-width: ", "px;\n\n flex-grow: ", ";\n "])), width, minWidth, maxWidth, grow || (width ? undefined : 1));
|
|
83
84
|
}, function (_a) {
|
|
84
|
-
var _b, _c;
|
|
85
85
|
var theme = _a.theme, align = _a.align, interactive = _a.interactive, interactiveCell = _a.interactiveCell, intent = _a.intent, size = _a.size, flat = _a.flat, striped = _a.striped, even = _a.even, selected = _a.selected, selectedIntent = _a.selectedIntent, disabled = _a.disabled, hovered = _a.hovered, padded = _a.padded, wrap = _a.wrap, pin = _a.pin, pinOffset = _a.pinOffset, pinEdge = _a.pinEdge, maxHeight = _a.maxHeight;
|
|
86
86
|
var getOriginalBackgroundColor = function () {
|
|
87
87
|
var color = theme.main;
|
|
@@ -110,9 +110,14 @@ exports.StyledTableCell = styled_components_1.default.div.withConfig({
|
|
|
110
110
|
if (hovered) {
|
|
111
111
|
opacity += 0.08;
|
|
112
112
|
}
|
|
113
|
-
//
|
|
113
|
+
// At rest a pinned cell is 'transparent' like any other: its opaque paint
|
|
114
|
+
// comes from `pinnedBackground` below, which lays the SAME surface the
|
|
115
|
+
// table sits on under it. It used to return `theme.main` here, which was
|
|
116
|
+
// then washed to 30% and layered over the panel surface — so every pinned
|
|
117
|
+
// column sat a step darker than its neighbours, at rest, for no reason a
|
|
118
|
+
// reader could see.
|
|
114
119
|
if (opacity === 0) {
|
|
115
|
-
return
|
|
120
|
+
return 'transparent';
|
|
116
121
|
}
|
|
117
122
|
return (0, colors_1.changeLightness)(color, opacity);
|
|
118
123
|
};
|
|
@@ -121,30 +126,33 @@ exports.StyledTableCell = styled_components_1.default.div.withConfig({
|
|
|
121
126
|
// surface and its line is the panel's hairline.
|
|
122
127
|
var themedPanel = (0, colors_1.getThemePanelSurface)(theme);
|
|
123
128
|
var displayedBackgroundColor = backgroundColor === 'transparent'
|
|
124
|
-
? (
|
|
129
|
+
? (0, colors_1.getPanelBackgroundColor)(theme)
|
|
125
130
|
: (0, polished_1.rgba)(backgroundColor, 0.3);
|
|
126
131
|
var cellBorderColor = backgroundColor === 'transparent' && (themedPanel === null || themedPanel === void 0 ? void 0 : themedPanel.border)
|
|
127
132
|
? themedPanel.border
|
|
128
133
|
: (0, colors_1.changeLightness)(displayedBackgroundColor, 0.1);
|
|
129
134
|
// Pinned cells need an opaque paint so non-pinned cells scrolling underneath don't show
|
|
130
|
-
// through. We layer the semi-transparent displayed color over a
|
|
135
|
+
// through. We layer the semi-transparent displayed color over the surface a table is
|
|
136
|
+
// drawn on — a panel's — so at rest a pinned cell is indistinguishable from its neighbours.
|
|
131
137
|
var pinnedBackground = pin
|
|
132
|
-
? "linear-gradient(".concat(displayedBackgroundColor, ", ").concat(displayedBackgroundColor, "), ").concat((
|
|
138
|
+
? "linear-gradient(".concat(displayedBackgroundColor, ", ").concat(displayedBackgroundColor, "), ").concat((0, colors_1.getPanelBackgroundColor)(theme))
|
|
133
139
|
: undefined;
|
|
134
|
-
return (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n box-sizing: border-box;\n display: flex;\n align-items: ", ";\n justify-content: ", ";\n flex-shrink: 0;\n align-self: stretch;\n border-bottom: ", ";\n\n ", "\n\n padding: ", "\n ", ";\n font-size: ", "px;\n background: ", ";\n color: ", ";\n border-color: ", ";\n transition: background-color 0.2s ease-out;\n opacity: ", ";\n pointer-events: ", ";\n cursor: ", ";\n\n ", "\n\n ", "\n\n /* ------------------------------------------------------------------\n A cell contains what it is given.\n\n These rules used to name p.reqore-table-text \u2014 the paragraph the\n table's own 'text' / 'number' / 'time-ago' cell renderers produce \u2014 so\n they reached exactly the content the table had written itself.\n Everything else got nothing: the 'title' renderer (a heading), the\n 'tag' renderer, and every element a caller's own cell content function\n returns, which is how a real table fills a cell. Those elements laid\n themselves out at their natural size, and since a body row is drawn at\n ONE height \u2014 decided before any of this is laid out, because a\n virtualised list has to know it up front \u2014 a paragraph of prose simply\n painted over the rows beneath it. Two and three descriptions\n overprinted each other and none of them could be read.\n\n So the rules are about the cell's content, whatever that content is:\n\n - min-width 0, because a flex item's automatic minimum size is its\n MIN-CONTENT width, which for one long unbreakable token (a URL, an\n id) is the whole token. That minimum beats max-width, which is why\n capping a link's width at the call site did not hold it: the address\n of one row printed across the next column's chips.\n - max-width and max-height of 100%, so the content is bounded by the\n box it is in, on both axes, whatever it is.\n - and, when the cell does not wrap, one line ending in an ellipsis.\n\n Wrapping is the other honest answer: wrap turns virtualisation off (see\n IReqoreTableProps), every row is then drawn at the height of its own\n content, and the whole value is on screen instead of a line of it. A\n wrapped cell still needs a break opportunity inside a long token, or it\n overflows sideways for the same reason as above. ----------------- */\n > * {\n min-width: 0;\n max-width: 100%;\n }\n\n ", "\n\n ", "\n\n p.reqore-table-text {\n margin: 0;\n padding: 0;\n }\n "], ["\n box-sizing: border-box;\n display: flex;\n align-items: ", ";\n justify-content: ", ";\n flex-shrink: 0;\n align-self: stretch;\n border-bottom: ", ";\n\n ", "\n\n padding: ", "\n ", ";\n font-size: ", "px;\n background: ", ";\n color: ", ";\n border-color: ", ";\n transition: background-color 0.2s ease-out;\n opacity: ", ";\n pointer-events: ", ";\n cursor: ", ";\n\n ", "\n\n ", "\n\n /* ------------------------------------------------------------------\n A cell contains what it is given.\n\n These rules used to name p.reqore-table-text \u2014 the paragraph the\n table's own 'text' / 'number' / 'time-ago' cell renderers produce \u2014 so\n they reached exactly the content the table had written itself.\n Everything else got nothing: the 'title' renderer (a heading), the\n 'tag' renderer, and every element a caller's own cell content function\n returns, which is how a real table fills a cell. Those elements laid\n themselves out at their natural size, and since a body row is drawn at\n ONE height \u2014 decided before any of this is laid out, because a\n virtualised list has to know it up front \u2014 a paragraph of prose simply\n painted over the rows beneath it. Two and three descriptions\n overprinted each other and none of them could be read.\n\n So the rules are about the cell's content, whatever that content is:\n\n - min-width 0, because a flex item's automatic minimum size is its\n MIN-CONTENT width, which for one long unbreakable token (a URL, an\n id) is the whole token. That minimum beats max-width, which is why\n capping a link's width at the call site did not hold it: the address\n of one row printed across the next column's chips.\n - max-width and max-height of 100%, so the content is bounded by the\n box it is in, on both axes, whatever it is.\n - and, when the cell does not wrap, one line ending in an ellipsis.\n\n Wrapping is the other honest answer: wrap turns virtualisation off (see\n IReqoreTableProps), every row is then drawn at the height of its own\n content, and the whole value is on screen instead of a line of it. A\n wrapped cell still needs a break opportunity inside a long token, or it\n overflows sideways for the same reason as above. ----------------- */\n > * {\n min-width: 0;\n max-width: 100%;\n }\n\n ", "\n\n ", "\n\n p.reqore-table-text {\n margin: 0;\n padding: 0;\n }\n "])), maxHeight ? 'flex-start' : 'center', align ? (0, utils_1.alignToFlexAlign)(align) : 'flex-start', !flat ? '1px solid ' : undefined, maxHeight && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n max-height: ", "px;\n overflow: hidden;\n "], ["\n position: relative;\n max-height: ", "px;\n overflow: hidden;\n "])), maxHeight), !padded || padded === 'both' || padded === 'vertical' ? (wrap ? '6px' : 0) : undefined, !padded || padded === 'both' || padded === 'horizontal' ? '10px' : undefined, sizes_1.TEXT_FROM_SIZE[size], pinnedBackground !== null && pinnedBackground !== void 0 ? pinnedBackground : (backgroundColor === 'transparent' ? 'transparent' : displayedBackgroundColor), (0, colors_1.getReadableColorFrom)(getOriginalBackgroundColor(), !hovered), cellBorderColor, disabled ? 0.2 : 1, disabled ? 'none' : undefined, interactive || interactiveCell ? 'pointer' : 'default', pin && (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: sticky;\n ", "\n z-index: 2;\n ", "\n "], ["\n position: sticky;\n ", "\n z-index: 2;\n ", "\n "])), pin === 'left' ? "left: ".concat(pinOffset || 0, "px;") : "right: ".concat(pinOffset || 0, "px;"), pinEdge && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /* Use a pseudo-element instead of box-shadow so the shadow is strictly bounded to\n the cell's height \u2014 a blurred box-shadow bleeds vertically and stacks across\n neighboring pinned cells, producing dark bands between rows. */\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n width: 12px;\n pointer-events: none;\n ", "\n background: linear-gradient(\n to ", ",\n rgba(0, 0, 0, 0.35),\n rgba(0, 0, 0, 0)\n );\n }\n "], ["\n /* Use a pseudo-element instead of box-shadow so the shadow is strictly bounded to\n the cell's height \u2014 a blurred box-shadow bleeds vertically and stacks across\n neighboring pinned cells, producing dark bands between rows. */\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n width: 12px;\n pointer-events: none;\n ", "\n background: linear-gradient(\n to ", ",\n rgba(0, 0, 0, 0.35),\n rgba(0, 0, 0, 0)\n );\n }\n "])), pin === 'left' ? 'right: -12px;' : 'left: -12px;', pin === 'left' ? 'right' : 'left')), interactiveCell && (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n &:hover {\n /* Pinned cells rely on the layered background shorthand for their opaque base \u2014\n overriding just background-color would lose theme.main and let the non-pinned\n cells scrolling underneath show through on hover. */\n ", "\n }\n "], ["\n &:hover {\n /* Pinned cells rely on the layered background shorthand for their opaque base \u2014\n overriding just background-color would lose theme.main and let the non-pinned\n cells scrolling underneath show through on hover. */\n ", "\n }\n "])), pin
|
|
135
|
-
? (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: linear-gradient(\n ", ",\n ", "\n ),\n ", ";\n "], ["\n background: linear-gradient(\n ", ",\n ", "\n ),\n ", ";\n "])), (0, polished_1.lighten)(0.1, displayedBackgroundColor), (0, polished_1.lighten)(0.1, displayedBackgroundColor),
|
|
136
|
-
? (0, styled_components_1.css)(
|
|
140
|
+
return (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n box-sizing: border-box;\n display: flex;\n align-items: ", ";\n justify-content: ", ";\n flex-shrink: 0;\n align-self: stretch;\n border-bottom: ", ";\n\n ", "\n\n /* Each side is a length, never `undefined`: `padding: undefined 10px` drops to\n `padding: 10px`, so a `padded: 'horizontal'` cell got 10px top and bottom too and\n clipped its text once the line was taller than the 12px left between them. */\n padding: ", "\n ", ";\n font-size: ", "px;\n background: ", ";\n color: ", ";\n border-color: ", ";\n transition: background-color 0.2s ease-out;\n opacity: ", ";\n pointer-events: ", ";\n cursor: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n /* ------------------------------------------------------------------\n A cell contains what it is given.\n\n These rules used to name p.reqore-table-text \u2014 the paragraph the\n table's own 'text' / 'number' / 'time-ago' cell renderers produce \u2014 so\n they reached exactly the content the table had written itself.\n Everything else got nothing: the 'title' renderer (a heading), the\n 'tag' renderer, and every element a caller's own cell content function\n returns, which is how a real table fills a cell. Those elements laid\n themselves out at their natural size, and since a body row is drawn at\n ONE height \u2014 decided before any of this is laid out, because a\n virtualised list has to know it up front \u2014 a paragraph of prose simply\n painted over the rows beneath it. Two and three descriptions\n overprinted each other and none of them could be read.\n\n So the rules are about the cell's content, whatever that content is:\n\n - min-width 0, because a flex item's automatic minimum size is its\n MIN-CONTENT width, which for one long unbreakable token (a URL, an\n id) is the whole token. That minimum beats max-width, which is why\n capping a link's width at the call site did not hold it: the address\n of one row printed across the next column's chips.\n - max-width and max-height of 100%, so the content is bounded by the\n box it is in, on both axes, whatever it is.\n - and, when the cell does not wrap, one line ending in an ellipsis.\n\n Wrapping is the other honest answer: wrap turns virtualisation off (see\n IReqoreTableProps), every row is then drawn at the height of its own\n content, and the whole value is on screen instead of a line of it. A\n wrapped cell still needs a break opportunity inside a long token, or it\n overflows sideways for the same reason as above. ----------------- */\n > * {\n min-width: 0;\n max-width: 100%;\n }\n\n ", "\n\n ", "\n\n p.reqore-table-text {\n margin: 0;\n padding: 0;\n }\n "], ["\n box-sizing: border-box;\n display: flex;\n align-items: ", ";\n justify-content: ", ";\n flex-shrink: 0;\n align-self: stretch;\n border-bottom: ", ";\n\n ", "\n\n /* Each side is a length, never \\`undefined\\`: \\`padding: undefined 10px\\` drops to\n \\`padding: 10px\\`, so a \\`padded: 'horizontal'\\` cell got 10px top and bottom too and\n clipped its text once the line was taller than the 12px left between them. */\n padding: ", "\n ", ";\n font-size: ", "px;\n background: ", ";\n color: ", ";\n border-color: ", ";\n transition: background-color 0.2s ease-out;\n opacity: ", ";\n pointer-events: ", ";\n cursor: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n /* ------------------------------------------------------------------\n A cell contains what it is given.\n\n These rules used to name p.reqore-table-text \u2014 the paragraph the\n table's own 'text' / 'number' / 'time-ago' cell renderers produce \u2014 so\n they reached exactly the content the table had written itself.\n Everything else got nothing: the 'title' renderer (a heading), the\n 'tag' renderer, and every element a caller's own cell content function\n returns, which is how a real table fills a cell. Those elements laid\n themselves out at their natural size, and since a body row is drawn at\n ONE height \u2014 decided before any of this is laid out, because a\n virtualised list has to know it up front \u2014 a paragraph of prose simply\n painted over the rows beneath it. Two and three descriptions\n overprinted each other and none of them could be read.\n\n So the rules are about the cell's content, whatever that content is:\n\n - min-width 0, because a flex item's automatic minimum size is its\n MIN-CONTENT width, which for one long unbreakable token (a URL, an\n id) is the whole token. That minimum beats max-width, which is why\n capping a link's width at the call site did not hold it: the address\n of one row printed across the next column's chips.\n - max-width and max-height of 100%, so the content is bounded by the\n box it is in, on both axes, whatever it is.\n - and, when the cell does not wrap, one line ending in an ellipsis.\n\n Wrapping is the other honest answer: wrap turns virtualisation off (see\n IReqoreTableProps), every row is then drawn at the height of its own\n content, and the whole value is on screen instead of a line of it. A\n wrapped cell still needs a break opportunity inside a long token, or it\n overflows sideways for the same reason as above. ----------------- */\n > * {\n min-width: 0;\n max-width: 100%;\n }\n\n ", "\n\n ", "\n\n p.reqore-table-text {\n margin: 0;\n padding: 0;\n }\n "])), maxHeight ? 'flex-start' : 'center', align ? (0, utils_1.alignToFlexAlign)(align) : 'flex-start', !flat ? '1px solid ' : undefined, maxHeight && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n max-height: ", "px;\n overflow: hidden;\n "], ["\n position: relative;\n max-height: ", "px;\n overflow: hidden;\n "])), maxHeight), !padded || padded === 'both' || padded === 'vertical' ? (wrap ? '6px' : '0') : '0', !padded || padded === 'both' || padded === 'horizontal' ? '10px' : '0', (0, typeScale_1.getTextSize)(theme, size), pinnedBackground !== null && pinnedBackground !== void 0 ? pinnedBackground : (backgroundColor === 'transparent' ? 'transparent' : displayedBackgroundColor), (0, colors_1.getReadableColorFrom)(getOriginalBackgroundColor(), !hovered), cellBorderColor, disabled ? 0.2 : 1, disabled ? 'none' : undefined, interactive || interactiveCell ? 'pointer' : 'default', pin && (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: sticky;\n ", "\n z-index: 2;\n ", "\n "], ["\n position: sticky;\n ", "\n z-index: 2;\n ", "\n "])), pin === 'left' ? "left: ".concat(pinOffset || 0, "px;") : "right: ".concat(pinOffset || 0, "px;"), pinEdge && (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /* Use a pseudo-element instead of box-shadow so the shadow is strictly bounded to\n the cell's height \u2014 a blurred box-shadow bleeds vertically and stacks across\n neighboring pinned cells, producing dark bands between rows.\n\n Drawn only while a column really is hidden under this edge (the body marks\n its scroll containers, see TABLE_OVERFLOW_ATTRIBUTE): a table whose columns\n all fit has nothing to announce, and a permanent dark band beside the\n actions column was the one thing that made a pinned column look different. */\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n width: 12px;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.12s ease;\n ", "\n background: linear-gradient(\n to ", ",\n rgba(0, 0, 0, 0.35),\n rgba(0, 0, 0, 0)\n );\n }\n ", " {\n opacity: 1;\n }\n "], ["\n /* Use a pseudo-element instead of box-shadow so the shadow is strictly bounded to\n the cell's height \u2014 a blurred box-shadow bleeds vertically and stacks across\n neighboring pinned cells, producing dark bands between rows.\n\n Drawn only while a column really is hidden under this edge (the body marks\n its scroll containers, see TABLE_OVERFLOW_ATTRIBUTE): a table whose columns\n all fit has nothing to announce, and a permanent dark band beside the\n actions column was the one thing that made a pinned column look different. */\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n width: 12px;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.12s ease;\n ", "\n background: linear-gradient(\n to ", ",\n rgba(0, 0, 0, 0.35),\n rgba(0, 0, 0, 0)\n );\n }\n ", " {\n opacity: 1;\n }\n "])), pin === 'left' ? 'right: -12px;' : 'left: -12px;', pin === 'left' ? 'right' : 'left', (0, helpers_1.pinnedEdgeShadowSelector)(pin))), interactive && (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n /* A row that does something on a click says so under the pointer: the whole row lights,\n the way a cell with its own click already did. Row hover was dropped with the row's\n hover STATE (a re-render per mouse move); it is plain CSS on the row now, free. */\n .reqore-table-row:hover > & {\n ", "\n }\n "], ["\n /* A row that does something on a click says so under the pointer: the whole row lights,\n the way a cell with its own click already did. Row hover was dropped with the row's\n hover STATE (a re-render per mouse move); it is plain CSS on the row now, free. */\n .reqore-table-row:hover > & {\n ", "\n }\n "])), pin
|
|
141
|
+
? (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: linear-gradient(\n ", ",\n ", "\n ),\n ", ";\n "], ["\n background: linear-gradient(\n ", ",\n ", "\n ),\n ", ";\n "])), (0, polished_1.lighten)(0.1, displayedBackgroundColor), (0, polished_1.lighten)(0.1, displayedBackgroundColor), (0, colors_1.getPanelBackgroundColor)(theme)) : (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), (0, polished_1.lighten)(0.1, displayedBackgroundColor))), interactiveCell && (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n &:hover {\n /* Pinned cells rely on the layered background shorthand for their opaque base \u2014\n overriding just background-color would lose theme.main and let the non-pinned\n cells scrolling underneath show through on hover. */\n ", "\n }\n "], ["\n &:hover {\n /* Pinned cells rely on the layered background shorthand for their opaque base \u2014\n overriding just background-color would lose theme.main and let the non-pinned\n cells scrolling underneath show through on hover. */\n ", "\n }\n "])), pin
|
|
142
|
+
? (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: linear-gradient(\n ", ",\n ", "\n ),\n ", ";\n "], ["\n background: linear-gradient(\n ", ",\n ", "\n ),\n ", ";\n "])), (0, polished_1.lighten)(0.1, displayedBackgroundColor), (0, polished_1.lighten)(0.1, displayedBackgroundColor), (0, colors_1.getPanelBackgroundColor)(theme)) : (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), (0, polished_1.lighten)(0.1, displayedBackgroundColor))), !maxHeight && (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n /* Bound the content to the cell's own height.\n\n Left to a cell that clips itself \u2014 the maxHeight clamp above \u2014 this\n would take its job away rather than help: that clamp shows a Show\n more button, and it knows to show it by asking whether its content is\n TALLER than it is. Content pre-shrunk to fit is content with nothing\n more to show, so the button never appeared and the rest of the value\n became unreachable.\n\n Everywhere else the bound is what holds a cell's content to its row.\n It is inert while wrapping does what it says, because the row is then\n as tall as its tallest cell and that cell's content is already\n exactly that tall. It bites where wrapping CANNOT make the row taller\n \u2014 wrap together with an explicit virtualized, which the table warns\n about \u2014 and in the ordinary case below, where it holds anything the\n ellipsis does not reach: a group of chips that wrapped, an image. */\n > * {\n max-height: 100%;\n overflow: hidden;\n }\n "], ["\n /* Bound the content to the cell's own height.\n\n Left to a cell that clips itself \u2014 the maxHeight clamp above \u2014 this\n would take its job away rather than help: that clamp shows a Show\n more button, and it knows to show it by asking whether its content is\n TALLER than it is. Content pre-shrunk to fit is content with nothing\n more to show, so the button never appeared and the rest of the value\n became unreachable.\n\n Everywhere else the bound is what holds a cell's content to its row.\n It is inert while wrapping does what it says, because the row is then\n as tall as its tallest cell and that cell's content is already\n exactly that tall. It bites where wrapping CANNOT make the row taller\n \u2014 wrap together with an explicit virtualized, which the table warns\n about \u2014 and in the ordinary case below, where it holds anything the\n ellipsis does not reach: a group of chips that wrapped, an image. */\n > * {\n max-height: 100%;\n overflow: hidden;\n }\n "]))), wrap
|
|
143
|
+
? (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n > * {\n word-break: break-word;\n overflow-wrap: anywhere;\n }\n\n p.reqore-table-text {\n white-space: normal;\n }\n "], ["\n > * {\n word-break: break-word;\n overflow-wrap: anywhere;\n }\n\n p.reqore-table-text {\n white-space: normal;\n }\n "]))) : (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n > * {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n "], ["\n > * {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n "]))));
|
|
137
144
|
});
|
|
138
|
-
var StyledCellExpandOverlay =
|
|
145
|
+
var StyledCellExpandOverlay = styled_1.default.div(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n padding: 4px 6px;\n pointer-events: none;\n z-index: 1;\n height: 36px;\n background: ", ";\n\n > * {\n pointer-events: auto;\n }\n"], ["\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n padding: 4px 6px;\n pointer-events: none;\n z-index: 1;\n height: 36px;\n background: ", ";\n\n > * {\n pointer-events: auto;\n }\n"])), function (_a) {
|
|
139
146
|
var theme = _a.theme;
|
|
140
147
|
return "linear-gradient(to bottom, ".concat((0, polished_1.rgba)(theme.main, 0), " 0%, ").concat(theme.main, " 80%)");
|
|
141
148
|
});
|
|
142
149
|
exports.ReqoreTableBodyCell = (0, react_1.memo)((0, react_1.forwardRef)(function (props, ref) {
|
|
143
150
|
var _a;
|
|
151
|
+
var _b;
|
|
144
152
|
var expandHeightButtonProps = props.expandHeightButtonProps, cellStyleProps = __rest(props, ["expandHeightButtonProps"]);
|
|
145
153
|
var maxHeight = cellStyleProps.maxHeight, children = cellStyleProps.children, size = cellStyleProps.size;
|
|
146
|
-
var
|
|
147
|
-
var
|
|
154
|
+
var _c = (0, react_1.useState)(false), expanded = _c[0], setExpanded = _c[1];
|
|
155
|
+
var _d = (0, react_1.useState)(false), isOverflowing = _d[0], setIsOverflowing = _d[1];
|
|
148
156
|
var localRef = (0, react_1.useRef)(null);
|
|
149
157
|
var setRefs = (0, react_1.useCallback)(function (el) {
|
|
150
158
|
localRef.current = el;
|
|
@@ -176,12 +184,12 @@ exports.ReqoreTableBodyCell = (0, react_1.memo)((0, react_1.forwardRef)(function
|
|
|
176
184
|
}, [maxHeight, expanded, children]);
|
|
177
185
|
var effectiveMaxHeight = expanded ? undefined : maxHeight;
|
|
178
186
|
var showOverlay = !!maxHeight && !expanded && isOverflowing;
|
|
179
|
-
return ((0, jsx_runtime_1.jsxs)(TooltipComponent_1.ReqoreTooltipComponent, __assign({ Component: exports.StyledTableCell }, cellStyleProps, { maxHeight
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
187
|
+
return ((0, jsx_runtime_1.jsxs)(TooltipComponent_1.ReqoreTooltipComponent, __assign({ Component: exports.StyledTableCell }, cellStyleProps, (_a = {}, _a[helpers_1.TABLE_PIN_ATTRIBUTE] = cellStyleProps.pin, _a.maxHeight = effectiveMaxHeight, _a.ref = setRefs, _a.children = [children, showOverlay && ((0, jsx_runtime_1.jsx)(StyledCellExpandOverlay, { className: 'reqore-table-cell-expand', onClick: function (e) { return e.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(Button_1.default, __assign({ compact: true, size: size === 'micro' || size === 'tiny' ? 'tiny' : 'small', rightIcon: 'ArrowDownSLine' }, expandHeightButtonProps, { onClick: function (e) {
|
|
188
|
+
var _a;
|
|
189
|
+
e.stopPropagation();
|
|
190
|
+
(_a = expandHeightButtonProps === null || expandHeightButtonProps === void 0 ? void 0 : expandHeightButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(expandHeightButtonProps, e);
|
|
191
|
+
setExpanded(true);
|
|
192
|
+
}, children: (_b = expandHeightButtonProps === null || expandHeightButtonProps === void 0 ? void 0 : expandHeightButtonProps.children) !== null && _b !== void 0 ? _b : 'Show more' })) }))], _a))));
|
|
185
193
|
}));
|
|
186
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
194
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16;
|
|
187
195
|
//# sourceMappingURL=cell.js.map
|