@geotab/zenith 3.4.0 → 3.4.1
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/README.md +7 -0
- package/dist/chart/plugins/linePlugin/linePlugin.js +3 -4
- package/dist/dataFeed/dataFeed.d.ts +2 -2
- package/dist/dataFeed/dataFeed.js +7 -5
- package/dist/pillExpandable/pillContent.d.ts +1 -0
- package/dist/pillExpandable/pillContent.js +2 -2
- package/dist/pillExpandable/pillExpandable.js +9 -4
- package/dist/pillExpandable/pillExpandableSimple.d.ts +2 -1
- package/dist/pillExpandable/pillExpandableSimple.js +2 -2
- package/dist/table/children/useTableChildren.js +5 -2
- package/esm/chart/plugins/linePlugin/linePlugin.js +3 -4
- package/esm/dataFeed/dataFeed.d.ts +2 -2
- package/esm/dataFeed/dataFeed.js +2 -2
- package/esm/pillExpandable/pillContent.d.ts +1 -0
- package/esm/pillExpandable/pillContent.js +2 -2
- package/esm/pillExpandable/pillExpandable.js +9 -4
- package/esm/pillExpandable/pillExpandableSimple.d.ts +2 -1
- package/esm/pillExpandable/pillExpandableSimple.js +2 -2
- package/esm/table/children/useTableChildren.js +6 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,13 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
40
40
|
|
|
41
41
|
## Change log
|
|
42
42
|
|
|
43
|
+
|
|
44
|
+
### 3.4.1
|
|
45
|
+
|
|
46
|
+
* Fix positioning line chart tooltip with scroll
|
|
47
|
+
* Fix empty list in mobile table
|
|
48
|
+
* Fix screen reader not announcing description when pill is expanded
|
|
49
|
+
|
|
43
50
|
### 3.4.0
|
|
44
51
|
|
|
45
52
|
* Integrate Tooltip with Zenith components
|
|
@@ -5,7 +5,6 @@ const formatValue_1 = require("../legend/formatValue");
|
|
|
5
5
|
const renderTooltip_1 = require("../tooltip/renderTooltip");
|
|
6
6
|
const getInterpolatedValue_1 = require("./getInterpolatedValue");
|
|
7
7
|
const drawLine_1 = require("./drawLine");
|
|
8
|
-
const getScrollableParent_1 = require("../../../utils/getScrollableParent");
|
|
9
8
|
const LinePlugin = (containerId, options, isDark) => ({
|
|
10
9
|
id: "verticalLine",
|
|
11
10
|
afterInit: (chart) => {
|
|
@@ -44,6 +43,7 @@ const LinePlugin = (containerId, options, isDark) => ({
|
|
|
44
43
|
canvas.addEventListener("mouseout", chart.verticalLine.mouseOut);
|
|
45
44
|
},
|
|
46
45
|
afterDraw: (chart) => {
|
|
46
|
+
var _a, _b;
|
|
47
47
|
if (options === false) {
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -93,9 +93,8 @@ const LinePlugin = (containerId, options, isDark) => ({
|
|
|
93
93
|
const chartRect = chart.canvas.getBoundingClientRect();
|
|
94
94
|
const top = chartRect.top + (lowestValueY || y);
|
|
95
95
|
const left = chartRect.left + x;
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
const scrollLeft = scrollableParent ? scrollableParent.scrollLeft : 0;
|
|
96
|
+
const scrollTop = document.body.scrollTop + (((_a = document.body.parentElement) === null || _a === void 0 ? void 0 : _a.scrollTop) || 0);
|
|
97
|
+
const scrollLeft = document.body.scrollLeft + (((_b = document.body.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) || 0);
|
|
99
98
|
let elementIdx = undefined;
|
|
100
99
|
const elementIds = new Set(chart.getActiveElements().map(el => el.index));
|
|
101
100
|
if (elementIds.size === 1) {
|
|
@@ -28,8 +28,8 @@ export interface IDataFeed<T, N = T> extends IDataGrid<T, N> {
|
|
|
28
28
|
activePage?: number;
|
|
29
29
|
onClick?: (id: string) => void;
|
|
30
30
|
}
|
|
31
|
-
declare const EmptyList: FC<PropsWithChildren>;
|
|
32
|
-
declare const Footer: FC<PropsWithChildren>;
|
|
31
|
+
export declare const EmptyList: FC<PropsWithChildren>;
|
|
32
|
+
export declare const Footer: FC<PropsWithChildren>;
|
|
33
33
|
declare const DataFeedInner: <T extends IRowEntity<N>, N extends IEntityWithId>({ entities, columns, feedWrappers, className, expanded, options, description, children, actions, actionsAsync, primaryActions, itemsPerPage, rowClassName, expandedRows, onExpandedChange, activePage, onClick }: IDataFeed<T, N>, ref: ForwardedRef<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
export interface IDataFeedStaticProps {
|
|
35
35
|
EmptyList: typeof EmptyList;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DataFeed = void 0;
|
|
3
|
+
exports.DataFeed = exports.Footer = exports.EmptyList = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
@@ -10,7 +10,9 @@ const useResize_1 = require("../commonHelpers/hooks/useResize");
|
|
|
10
10
|
const dataFeedColumnsItems_1 = require("./dataFeedColumnsItems");
|
|
11
11
|
const getRowClassName_1 = require("../dataGrid/getRowClassName");
|
|
12
12
|
const EmptyList = ({ children }) => (0, jsx_runtime_1.jsx)("div", { className: "zen-data-feed__empty", children: children });
|
|
13
|
+
exports.EmptyList = EmptyList;
|
|
13
14
|
const Footer = ({ children }) => (0, jsx_runtime_1.jsx)("div", { className: "zen-data-feed__footer", children: children });
|
|
15
|
+
exports.Footer = Footer;
|
|
14
16
|
const endOfFeedThreshold = 100;
|
|
15
17
|
const checkCloseToTheEnd = (feedContainerElt) => {
|
|
16
18
|
const feedElt = feedContainerElt === null || feedContainerElt === void 0 ? void 0 : feedContainerElt.querySelector(".zen-data-feed");
|
|
@@ -43,8 +45,8 @@ const DataFeedInner = ({ entities, columns, feedWrappers, className, expanded, o
|
|
|
43
45
|
(0, react_1.useImperativeHandle)(ref, () => feedRef.current, []);
|
|
44
46
|
const columnsList = (0, react_1.useMemo)(() => columns.map(toBasicColumn_1.toBasicColumn), [columns]);
|
|
45
47
|
const itemsMap = (0, react_1.useMemo)(() => new Map(data.map(entity => [entity.id, entity])), [data]);
|
|
46
|
-
const emptyList = (0, react_1.useMemo)(() => react_1.Children.toArray(children).find(child => child.type === EmptyList), [children]);
|
|
47
|
-
const footer = (0, react_1.useMemo)(() => react_1.Children.toArray(children).find(child => child.type === Footer), [children]);
|
|
48
|
+
const emptyList = (0, react_1.useMemo)(() => react_1.Children.toArray(children).find(child => child.type === exports.EmptyList), [children]);
|
|
49
|
+
const footer = (0, react_1.useMemo)(() => react_1.Children.toArray(children).find(child => child.type === exports.Footer), [children]);
|
|
48
50
|
const getVisibleItems = () => {
|
|
49
51
|
if (!feedRef.current) {
|
|
50
52
|
return [];
|
|
@@ -118,5 +120,5 @@ const DataFeedInner = ({ entities, columns, feedWrappers, className, expanded, o
|
|
|
118
120
|
};
|
|
119
121
|
const DataFeed = (0, react_1.forwardRef)(DataFeedInner);
|
|
120
122
|
exports.DataFeed = DataFeed;
|
|
121
|
-
DataFeed.EmptyList = EmptyList;
|
|
122
|
-
DataFeed.Footer = Footer;
|
|
123
|
+
DataFeed.EmptyList = exports.EmptyList;
|
|
124
|
+
DataFeed.Footer = exports.Footer;
|
|
@@ -7,7 +7,7 @@ const button_1 = require("../button/button");
|
|
|
7
7
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
8
8
|
const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
|
|
9
9
|
const lazyContent_1 = require("../skeleton/lazyContent");
|
|
10
|
-
const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction, onActionClick, isVisible = true, errorHandler }) => {
|
|
10
|
+
const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction, onActionClick, isVisible = true, errorHandler, descriptionId }) => {
|
|
11
11
|
const headerDriveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-status-pill-popup__header-text");
|
|
12
12
|
const descriptionDriveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-status-pill-popup__description");
|
|
13
13
|
const mainActionClick = (0, react_1.useCallback)((onClick) => () => {
|
|
@@ -20,7 +20,7 @@ const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction
|
|
|
20
20
|
}, [onActionClick]);
|
|
21
21
|
const renderMainButton = (0, react_1.useCallback)((data) => (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ link: data.link }, data.linkOptions, { onClick: data.onClick ? mainActionClick(data.onClick) : undefined, type: "primary", children: data.text })), [mainActionClick]);
|
|
22
22
|
const renderSecondaryButton = (0, react_1.useCallback)((data) => (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ link: data.link }, data.linkOptions, { onClick: data.onClick ? secondaryActionClick(data.onClick) : undefined, type: "tertiary", children: data.text })), [secondaryActionClick]);
|
|
23
|
-
const renderDescription = (0, react_1.useCallback)(data => (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-status-pill-popup__description", descriptionDriveClassName || ""]), children: data }), [descriptionDriveClassName]);
|
|
23
|
+
const renderDescription = (0, react_1.useCallback)(data => (0, jsx_runtime_1.jsx)("div", { id: descriptionId, className: (0, classNames_1.classNames)(["zen-status-pill-popup__description", descriptionDriveClassName || ""]), children: data }), [descriptionDriveClassName, descriptionId]);
|
|
24
24
|
const renderCount = (0, react_1.useCallback)((data) => data ? (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-status-pill-popup__header-text zen-status-pill-popup__header-text--left", headerDriveClassName || ""]), children: data }) : null, [headerDriveClassName]);
|
|
25
25
|
const renderDate = (0, react_1.useCallback)((data) => data ? (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-status-pill-popup__header-text", headerDriveClassName || ""]), children: data }) : null, [headerDriveClassName]);
|
|
26
26
|
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(date || count) && isVisible && (0, jsx_runtime_1.jsxs)("div", { className: "zen-status-pill-popup__content-header", children: [date && (0, jsx_runtime_1.jsx)(lazyContent_1.LazyContent, { width: 80, type: "text", content: date, isVisible: isVisible, errorHandler: errorHandler, render: renderDate }), count && (0, jsx_runtime_1.jsx)(lazyContent_1.LazyContent, { width: 80, type: "text", content: count, isVisible: isVisible, errorHandler: errorHandler, render: renderCount })] }), descriptionText &&
|
|
@@ -160,6 +160,7 @@ const PillExpandableBase = ({
|
|
|
160
160
|
}) => {
|
|
161
161
|
const popupId = (0, react_1.useId)();
|
|
162
162
|
const pillId = (0, react_1.useId)();
|
|
163
|
+
const descriptionId = (0, react_1.useId)();
|
|
163
164
|
const {
|
|
164
165
|
translate
|
|
165
166
|
} = (0, useLanguage_1.useLanguage)();
|
|
@@ -304,7 +305,8 @@ const PillExpandableBase = ({
|
|
|
304
305
|
onExpand: handleChildToggle,
|
|
305
306
|
expandAriaText: translate("Expand"),
|
|
306
307
|
type: type,
|
|
307
|
-
errorHandler: errorHandler
|
|
308
|
+
errorHandler: errorHandler,
|
|
309
|
+
descriptionId: descriptionId
|
|
308
310
|
}), (0, jsx_runtime_1.jsx)(pillContent_1.PillContent, {
|
|
309
311
|
onActionClick: handleChildToggle,
|
|
310
312
|
descriptionText: content.description,
|
|
@@ -313,7 +315,8 @@ const PillExpandableBase = ({
|
|
|
313
315
|
mainAction: content.mainAction,
|
|
314
316
|
secondaryAction: content.secondaryAction,
|
|
315
317
|
isVisible: isExpanded,
|
|
316
|
-
errorHandler: errorHandler
|
|
318
|
+
errorHandler: errorHandler,
|
|
319
|
+
descriptionId: descriptionId
|
|
317
320
|
})]
|
|
318
321
|
});
|
|
319
322
|
}
|
|
@@ -374,7 +377,8 @@ const PillExpandableBase = ({
|
|
|
374
377
|
expandAriaText: translate("Expand"),
|
|
375
378
|
type: type,
|
|
376
379
|
errorHandler: errorHandler,
|
|
377
|
-
isBeta: isBeta
|
|
380
|
+
isBeta: isBeta,
|
|
381
|
+
descriptionId: descriptionId
|
|
378
382
|
})
|
|
379
383
|
}), (0, jsx_runtime_1.jsx)(pillContent_1.PillContent, {
|
|
380
384
|
onActionClick: handlePopupToggle,
|
|
@@ -383,7 +387,8 @@ const PillExpandableBase = ({
|
|
|
383
387
|
count: content.count,
|
|
384
388
|
mainAction: content.mainAction,
|
|
385
389
|
secondaryAction: content.secondaryAction,
|
|
386
|
-
errorHandler: errorHandler
|
|
390
|
+
errorHandler: errorHandler,
|
|
391
|
+
descriptionId: descriptionId
|
|
387
392
|
}), childToDisplay, moreCounter && viewMoreAction && childCount > MAX_PILLS_TO_DISPLAY_IN_POPUP && (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
|
|
388
393
|
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
389
394
|
className: "zen-status-pill-popup__divider"
|
|
@@ -9,9 +9,10 @@ interface IPillExpandableSimple extends IPillExpandable {
|
|
|
9
9
|
icon?: FC<IIcon> | false;
|
|
10
10
|
isBeta?: boolean;
|
|
11
11
|
ref?: RefObject<HTMLButtonElement | null>;
|
|
12
|
+
descriptionId?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare const PillExpandableSimple: {
|
|
14
|
-
({ onExpand, expandAriaText, text, expanded, includeExpandIcon, type, icon, isBeta, ref }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
({ onExpand, expandAriaText, text, expanded, includeExpandIcon, type, icon, isBeta, ref, descriptionId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
displayName: string;
|
|
16
17
|
};
|
|
17
18
|
export {};
|
|
@@ -8,7 +8,7 @@ const iconChevronTop_1 = require("../icons/iconChevronTop");
|
|
|
8
8
|
const iconChevronBottom_1 = require("../icons/iconChevronBottom");
|
|
9
9
|
const iconException_1 = require("../icons/iconException");
|
|
10
10
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
11
|
-
const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includeExpandIcon = true, type = "warning", icon = iconException_1.IconException, isBeta, ref }) => {
|
|
11
|
+
const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includeExpandIcon = true, type = "warning", icon = iconException_1.IconException, isBeta, ref, descriptionId }) => {
|
|
12
12
|
const iconDriveClassName = (0, useDriveClassName_1.useDriveClassName)("icon");
|
|
13
13
|
const containerDriveClassName = (0, useDriveClassName_1.useDriveClassName)("zen-status-pill__container");
|
|
14
14
|
const onExpandHandler = (0, react_1.useCallback)(() => {
|
|
@@ -20,7 +20,7 @@ const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includ
|
|
|
20
20
|
const hasText = (text || "").trim().length > 0;
|
|
21
21
|
return (0, jsx_runtime_1.jsxs)("button", { type: "button", className: (0, classNames_1.classNames)([
|
|
22
22
|
"zen-status-pill__container", `zen-status-pill__container--${type}`, containerDriveClassName || "", "zen-ellipsis"
|
|
23
|
-
]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, children: [icon !== false && (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)([
|
|
23
|
+
]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, "aria-describedby": descriptionId, children: [icon !== false && (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)([
|
|
24
24
|
"zen-status-pill__icon",
|
|
25
25
|
`zen-status-pill__icon--${type}`,
|
|
26
26
|
hasText ? "" : "zen-status-pill__icon--standalone"
|
|
@@ -14,6 +14,7 @@ const fullscreenButton_1 = require("../../dataGrid/entitiesListActions/actions/f
|
|
|
14
14
|
const tableEmpty_1 = require("./tableEmpty");
|
|
15
15
|
const emptySearchList_1 = require("../../dataGrid/emptySearchList/emptySearchList");
|
|
16
16
|
const dataGrid_1 = require("../../dataGrid/dataGrid");
|
|
17
|
+
const dataFeed_1 = require("../../dataFeed/dataFeed");
|
|
17
18
|
const tableFooter_1 = require("./tableFooter");
|
|
18
19
|
const tableDetailPanel_1 = require("./tableDetailPanel");
|
|
19
20
|
const detailPanel_1 = require("../detailPanel/detailPanel");
|
|
@@ -67,7 +68,8 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
|
|
|
67
68
|
}
|
|
68
69
|
if (isChildElement(child, tableEmpty_1.TableEmpty.displayName)) {
|
|
69
70
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
70
|
-
|
|
71
|
+
const EmptyListComponent = isMobile ? dataFeed_1.EmptyList : dataGrid_1.EmptyList;
|
|
72
|
+
emptyList = (0, react_1.createElement)(EmptyListComponent, {}, (0, react_1.createElement)(emptySearchList_1.EmptySearchList, {
|
|
71
73
|
description: child.props.description,
|
|
72
74
|
image: child.props.image,
|
|
73
75
|
className: child.props.className
|
|
@@ -86,7 +88,8 @@ const useTableChildren = (children, isMobile, selected, allSelected, clearSelect
|
|
|
86
88
|
return;
|
|
87
89
|
}
|
|
88
90
|
if (isChildElement(child, tableFooter_1.TableFooter.displayName)) {
|
|
89
|
-
|
|
91
|
+
const FooterComponent = isMobile ? dataFeed_1.Footer : dataGrid_1.Footer;
|
|
92
|
+
footer = (0, react_1.createElement)(FooterComponent, {}, child.props.children);
|
|
90
93
|
return;
|
|
91
94
|
}
|
|
92
95
|
other.push(child);
|
|
@@ -2,7 +2,6 @@ import { formatValue } from "../legend/formatValue";
|
|
|
2
2
|
import { destroyTooltip, hideTooltip, renderTooltip } from "../tooltip/renderTooltip";
|
|
3
3
|
import { getInterpolatedValue } from "./getInterpolatedValue";
|
|
4
4
|
import { drawLine } from "./drawLine";
|
|
5
|
-
import { getScrollableParent } from "../../../utils/getScrollableParent";
|
|
6
5
|
export const LinePlugin = (containerId, options, isDark) => ({
|
|
7
6
|
id: "verticalLine",
|
|
8
7
|
afterInit: (chart) => {
|
|
@@ -41,6 +40,7 @@ export const LinePlugin = (containerId, options, isDark) => ({
|
|
|
41
40
|
canvas.addEventListener("mouseout", chart.verticalLine.mouseOut);
|
|
42
41
|
},
|
|
43
42
|
afterDraw: (chart) => {
|
|
43
|
+
var _a, _b;
|
|
44
44
|
if (options === false) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
@@ -90,9 +90,8 @@ export const LinePlugin = (containerId, options, isDark) => ({
|
|
|
90
90
|
const chartRect = chart.canvas.getBoundingClientRect();
|
|
91
91
|
const top = chartRect.top + (lowestValueY || y);
|
|
92
92
|
const left = chartRect.left + x;
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
const scrollLeft = scrollableParent ? scrollableParent.scrollLeft : 0;
|
|
93
|
+
const scrollTop = document.body.scrollTop + (((_a = document.body.parentElement) === null || _a === void 0 ? void 0 : _a.scrollTop) || 0);
|
|
94
|
+
const scrollLeft = document.body.scrollLeft + (((_b = document.body.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) || 0);
|
|
96
95
|
let elementIdx = undefined;
|
|
97
96
|
const elementIds = new Set(chart.getActiveElements().map(el => el.index));
|
|
98
97
|
if (elementIds.size === 1) {
|
|
@@ -28,8 +28,8 @@ export interface IDataFeed<T, N = T> extends IDataGrid<T, N> {
|
|
|
28
28
|
activePage?: number;
|
|
29
29
|
onClick?: (id: string) => void;
|
|
30
30
|
}
|
|
31
|
-
declare const EmptyList: FC<PropsWithChildren>;
|
|
32
|
-
declare const Footer: FC<PropsWithChildren>;
|
|
31
|
+
export declare const EmptyList: FC<PropsWithChildren>;
|
|
32
|
+
export declare const Footer: FC<PropsWithChildren>;
|
|
33
33
|
declare const DataFeedInner: <T extends IRowEntity<N>, N extends IEntityWithId>({ entities, columns, feedWrappers, className, expanded, options, description, children, actions, actionsAsync, primaryActions, itemsPerPage, rowClassName, expandedRows, onExpandedChange, activePage, onClick }: IDataFeed<T, N>, ref: ForwardedRef<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
export interface IDataFeedStaticProps {
|
|
35
35
|
EmptyList: typeof EmptyList;
|
package/esm/dataFeed/dataFeed.js
CHANGED
|
@@ -6,8 +6,8 @@ import { toBasicColumn } from "../dataGrid/extensions/toBasicColumn";
|
|
|
6
6
|
import { useResize } from "../commonHelpers/hooks/useResize";
|
|
7
7
|
import { FeedItem } from "./dataFeedColumnsItems";
|
|
8
8
|
import { getRowClassName } from "../dataGrid/getRowClassName";
|
|
9
|
-
const EmptyList = ({ children }) => _jsx("div", { className: "zen-data-feed__empty", children: children });
|
|
10
|
-
const Footer = ({ children }) => _jsx("div", { className: "zen-data-feed__footer", children: children });
|
|
9
|
+
export const EmptyList = ({ children }) => _jsx("div", { className: "zen-data-feed__empty", children: children });
|
|
10
|
+
export const Footer = ({ children }) => _jsx("div", { className: "zen-data-feed__footer", children: children });
|
|
11
11
|
const endOfFeedThreshold = 100;
|
|
12
12
|
const checkCloseToTheEnd = (feedContainerElt) => {
|
|
13
13
|
const feedElt = feedContainerElt === null || feedContainerElt === void 0 ? void 0 : feedContainerElt.querySelector(".zen-data-feed");
|
|
@@ -4,7 +4,7 @@ import { Button } from "../button/button";
|
|
|
4
4
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
5
5
|
import { useDriveClassName } from "../utils/theme/useDriveClassName";
|
|
6
6
|
import { LazyContent } from "../skeleton/lazyContent";
|
|
7
|
-
export const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction, onActionClick, isVisible = true, errorHandler }) => {
|
|
7
|
+
export const PillContent = ({ date, count, descriptionText, mainAction, secondaryAction, onActionClick, isVisible = true, errorHandler, descriptionId }) => {
|
|
8
8
|
const headerDriveClassName = useDriveClassName("zen-status-pill-popup__header-text");
|
|
9
9
|
const descriptionDriveClassName = useDriveClassName("zen-status-pill-popup__description");
|
|
10
10
|
const mainActionClick = useCallback((onClick) => () => {
|
|
@@ -17,7 +17,7 @@ export const PillContent = ({ date, count, descriptionText, mainAction, secondar
|
|
|
17
17
|
}, [onActionClick]);
|
|
18
18
|
const renderMainButton = useCallback((data) => _jsx(Button, Object.assign({ link: data.link }, data.linkOptions, { onClick: data.onClick ? mainActionClick(data.onClick) : undefined, type: "primary", children: data.text })), [mainActionClick]);
|
|
19
19
|
const renderSecondaryButton = useCallback((data) => _jsx(Button, Object.assign({ link: data.link }, data.linkOptions, { onClick: data.onClick ? secondaryActionClick(data.onClick) : undefined, type: "tertiary", children: data.text })), [secondaryActionClick]);
|
|
20
|
-
const renderDescription = useCallback(data => _jsx("div", { className: classNames(["zen-status-pill-popup__description", descriptionDriveClassName || ""]), children: data }), [descriptionDriveClassName]);
|
|
20
|
+
const renderDescription = useCallback(data => _jsx("div", { id: descriptionId, className: classNames(["zen-status-pill-popup__description", descriptionDriveClassName || ""]), children: data }), [descriptionDriveClassName, descriptionId]);
|
|
21
21
|
const renderCount = useCallback((data) => data ? _jsx("div", { className: classNames(["zen-status-pill-popup__header-text zen-status-pill-popup__header-text--left", headerDriveClassName || ""]), children: data }) : null, [headerDriveClassName]);
|
|
22
22
|
const renderDate = useCallback((data) => data ? _jsx("div", { className: classNames(["zen-status-pill-popup__header-text", headerDriveClassName || ""]), children: data }) : null, [headerDriveClassName]);
|
|
23
23
|
return _jsxs(_Fragment, { children: [(date || count) && isVisible && _jsxs("div", { className: "zen-status-pill-popup__content-header", children: [date && _jsx(LazyContent, { width: 80, type: "text", content: date, isVisible: isVisible, errorHandler: errorHandler, render: renderDate }), count && _jsx(LazyContent, { width: 80, type: "text", content: count, isVisible: isVisible, errorHandler: errorHandler, render: renderCount })] }), descriptionText &&
|
|
@@ -152,6 +152,7 @@ const PillExpandableBase = ({
|
|
|
152
152
|
}) => {
|
|
153
153
|
const popupId = useId();
|
|
154
154
|
const pillId = useId();
|
|
155
|
+
const descriptionId = useId();
|
|
155
156
|
const {
|
|
156
157
|
translate
|
|
157
158
|
} = useLanguage();
|
|
@@ -296,7 +297,8 @@ const PillExpandableBase = ({
|
|
|
296
297
|
onExpand: handleChildToggle,
|
|
297
298
|
expandAriaText: translate("Expand"),
|
|
298
299
|
type: type,
|
|
299
|
-
errorHandler: errorHandler
|
|
300
|
+
errorHandler: errorHandler,
|
|
301
|
+
descriptionId: descriptionId
|
|
300
302
|
}), _jsx(PillContent, {
|
|
301
303
|
onActionClick: handleChildToggle,
|
|
302
304
|
descriptionText: content.description,
|
|
@@ -305,7 +307,8 @@ const PillExpandableBase = ({
|
|
|
305
307
|
mainAction: content.mainAction,
|
|
306
308
|
secondaryAction: content.secondaryAction,
|
|
307
309
|
isVisible: isExpanded,
|
|
308
|
-
errorHandler: errorHandler
|
|
310
|
+
errorHandler: errorHandler,
|
|
311
|
+
descriptionId: descriptionId
|
|
309
312
|
})]
|
|
310
313
|
});
|
|
311
314
|
}
|
|
@@ -366,7 +369,8 @@ const PillExpandableBase = ({
|
|
|
366
369
|
expandAriaText: translate("Expand"),
|
|
367
370
|
type: type,
|
|
368
371
|
errorHandler: errorHandler,
|
|
369
|
-
isBeta: isBeta
|
|
372
|
+
isBeta: isBeta,
|
|
373
|
+
descriptionId: descriptionId
|
|
370
374
|
})
|
|
371
375
|
}), _jsx(PillContent, {
|
|
372
376
|
onActionClick: handlePopupToggle,
|
|
@@ -375,7 +379,8 @@ const PillExpandableBase = ({
|
|
|
375
379
|
count: content.count,
|
|
376
380
|
mainAction: content.mainAction,
|
|
377
381
|
secondaryAction: content.secondaryAction,
|
|
378
|
-
errorHandler: errorHandler
|
|
382
|
+
errorHandler: errorHandler,
|
|
383
|
+
descriptionId: descriptionId
|
|
379
384
|
}), childToDisplay, moreCounter && viewMoreAction && childCount > MAX_PILLS_TO_DISPLAY_IN_POPUP && _jsxs(_Fragment, {
|
|
380
385
|
children: [_jsx("div", {
|
|
381
386
|
className: "zen-status-pill-popup__divider"
|
|
@@ -9,9 +9,10 @@ interface IPillExpandableSimple extends IPillExpandable {
|
|
|
9
9
|
icon?: FC<IIcon> | false;
|
|
10
10
|
isBeta?: boolean;
|
|
11
11
|
ref?: RefObject<HTMLButtonElement | null>;
|
|
12
|
+
descriptionId?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare const PillExpandableSimple: {
|
|
14
|
-
({ onExpand, expandAriaText, text, expanded, includeExpandIcon, type, icon, isBeta, ref }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
({ onExpand, expandAriaText, text, expanded, includeExpandIcon, type, icon, isBeta, ref, descriptionId }: IPillExpandableSimple): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
displayName: string;
|
|
16
17
|
};
|
|
17
18
|
export {};
|
|
@@ -5,7 +5,7 @@ import { IconChevronTop } from "../icons/iconChevronTop";
|
|
|
5
5
|
import { IconChevronBottom } from "../icons/iconChevronBottom";
|
|
6
6
|
import { IconException } from "../icons/iconException";
|
|
7
7
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
8
|
-
export const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includeExpandIcon = true, type = "warning", icon = IconException, isBeta, ref }) => {
|
|
8
|
+
export const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded, includeExpandIcon = true, type = "warning", icon = IconException, isBeta, ref, descriptionId }) => {
|
|
9
9
|
const iconDriveClassName = useDriveClassName("icon");
|
|
10
10
|
const containerDriveClassName = useDriveClassName("zen-status-pill__container");
|
|
11
11
|
const onExpandHandler = useCallback(() => {
|
|
@@ -17,7 +17,7 @@ export const PillExpandableSimple = ({ onExpand, expandAriaText, text, expanded,
|
|
|
17
17
|
const hasText = (text || "").trim().length > 0;
|
|
18
18
|
return _jsxs("button", { type: "button", className: classNames([
|
|
19
19
|
"zen-status-pill__container", `zen-status-pill__container--${type}`, containerDriveClassName || "", "zen-ellipsis"
|
|
20
|
-
]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, children: [icon !== false && _jsx("div", { className: classNames([
|
|
20
|
+
]), ref: ref, onClick: onExpandHandler, tabIndex: !includeExpandIcon ? -1 : undefined, "aria-describedby": descriptionId, children: [icon !== false && _jsx("div", { className: classNames([
|
|
21
21
|
"zen-status-pill__icon",
|
|
22
22
|
`zen-status-pill__icon--${type}`,
|
|
23
23
|
hasText ? "" : "zen-status-pill__icon--standalone"
|
|
@@ -10,7 +10,8 @@ import { TableFullscreen } from "./tableFullscreen";
|
|
|
10
10
|
import { FullScreenButton } from "../../dataGrid/entitiesListActions/actions/fullscreenButton";
|
|
11
11
|
import { TableEmpty } from "./tableEmpty";
|
|
12
12
|
import { EmptySearchList } from "../../dataGrid/emptySearchList/emptySearchList";
|
|
13
|
-
import { EmptyList, Footer } from "../../dataGrid/dataGrid";
|
|
13
|
+
import { EmptyList as DataGridEmptyList, Footer as DataGridFooter } from "../../dataGrid/dataGrid";
|
|
14
|
+
import { EmptyList as DataFeedEmptyList, Footer as DataFeedFooter } from "../../dataFeed/dataFeed";
|
|
14
15
|
import { TableFooter } from "./tableFooter";
|
|
15
16
|
import { TableDetailPanel } from "./tableDetailPanel";
|
|
16
17
|
import { DetailPanel } from "../detailPanel/detailPanel";
|
|
@@ -64,7 +65,8 @@ export const useTableChildren = (children, isMobile, selected, allSelected, clea
|
|
|
64
65
|
}
|
|
65
66
|
if (isChildElement(child, TableEmpty.displayName)) {
|
|
66
67
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
67
|
-
|
|
68
|
+
const EmptyListComponent = isMobile ? DataFeedEmptyList : DataGridEmptyList;
|
|
69
|
+
emptyList = createElement(EmptyListComponent, {}, createElement(EmptySearchList, {
|
|
68
70
|
description: child.props.description,
|
|
69
71
|
image: child.props.image,
|
|
70
72
|
className: child.props.className
|
|
@@ -83,7 +85,8 @@ export const useTableChildren = (children, isMobile, selected, allSelected, clea
|
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
85
87
|
if (isChildElement(child, TableFooter.displayName)) {
|
|
86
|
-
|
|
88
|
+
const FooterComponent = isMobile ? DataFeedFooter : DataGridFooter;
|
|
89
|
+
footer = createElement(FooterComponent, {}, child.props.children);
|
|
87
90
|
return;
|
|
88
91
|
}
|
|
89
92
|
other.push(child);
|