@geotab/zenith 3.2.0 → 3.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/card/card.d.ts +3 -0
- package/dist/card/card.js +15 -5
- package/dist/card/components/cardToggle/cardToggle.d.ts +5 -0
- package/dist/card/components/cardToggle/cardToggle.js +7 -0
- package/dist/card/components/title.js +3 -3
- package/dist/cardContainer/cardContainer.d.ts +2 -1
- package/dist/cardContainer/cardContainer.js +4 -3
- package/dist/chart/barChart/getDefaultDatasetStyle.js +8 -6
- package/dist/chart/lineChart/getDatasetColor.js +8 -6
- package/dist/chart/lineChart/useSummary.js +1 -1
- package/dist/chart/pieChart/getDefaultDatasetStyle.js +8 -6
- package/dist/chart/plugins/linePlugin/getInterpolatedValue.js +1 -1
- package/dist/chart/plugins/linePlugin/linePlugin.js +16 -4
- package/dist/commonHelpers/hooks/useEscape.js +4 -0
- package/dist/commonHelpers/hooks/usePillSize.d.ts +2 -1
- package/dist/commonHelpers/hooks/usePillSize.js +6 -3
- package/dist/commonStyles/colors/colors.less +9 -0
- package/dist/dataFeed/dataFeed.d.ts +2 -1
- package/dist/dataFeed/dataFeed.js +18 -3
- package/dist/dataFeed/dataFeedColumnsItems.d.ts +2 -1
- package/dist/dataFeed/dataFeedColumnsItems.js +6 -4
- package/dist/dataGrid/cell/cell.d.ts +2 -1
- package/dist/dataGrid/cell/cell.js +2 -1
- package/dist/dataGrid/dataGrid.d.ts +3 -1
- package/dist/dataGrid/dataGrid.js +7 -2
- package/dist/dataGrid/row/row.d.ts +3 -1
- package/dist/dataGrid/row/row.js +3 -3
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +8 -4
- package/dist/divider/divider.d.ts +5 -5
- package/dist/divider/divider.js +6 -2
- package/dist/filtersBar/components/filtersBarPeriodPicker/filtersBarPeriodPicker.js +2 -2
- package/dist/footerButtons/footerButtons.d.ts +4 -0
- package/dist/footerButtons/footerButtons.js +4 -6
- package/dist/groupsFilterRaw/groupsFilterRaw.js +1 -0
- package/dist/index.css +478 -255
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20 -18
- package/dist/lineChart/utils.js +2 -9
- package/dist/list/listItem/listItem.js +26 -0
- package/dist/mobileSheet/components/mobileSheetFooter.d.ts +1 -0
- package/dist/mobileSheet/components/mobileSheetFooter.js +1 -1
- package/dist/mobileSheet/mobileSheet.js +1 -1
- package/dist/pill/components/pillActionable/pillActionable.js +5 -4
- package/dist/pill/components/pillNonActionable/pillNonActionable.js +11 -5
- package/dist/pill/interfaces/pillActionable.interface.d.ts +1 -0
- package/dist/pill/interfaces/pillNonActionable.interface.d.ts +1 -0
- package/dist/pillExpandable/pillExpandable.js +6 -6
- package/dist/rangeRaw/rangeRaw.js +1 -0
- package/dist/selectRaw/selectRaw.js +6 -3
- package/dist/sidePanel/sidePanel.d.ts +1 -1
- package/dist/sidePanel/sidePanel.js +7 -3
- package/dist/table/children/tableDetailPanel.d.ts +9 -0
- package/dist/table/children/tableDetailPanel.js +6 -0
- package/dist/table/children/useTableChildren.d.ts +2 -1
- package/dist/table/children/useTableChildren.js +17 -2
- package/dist/table/detailPanel/detailPanel.d.ts +4 -0
- package/dist/table/detailPanel/detailPanel.js +140 -0
- package/dist/table/detailPanel/detailPanelHeader.d.ts +4 -0
- package/dist/table/detailPanel/detailPanelHeader.js +105 -0
- package/dist/table/detailPanel/interfaces.d.ts +8 -0
- package/dist/table/detailPanel/interfaces.js +2 -0
- package/dist/table/table.d.ts +6 -1
- package/dist/table/table.js +248 -68
- package/dist/utils/localization/translations/cs.json +3 -1
- package/dist/utils/localization/translations/da-DK.json +3 -1
- package/dist/utils/localization/translations/de.json +3 -1
- package/dist/utils/localization/translations/en-json.d.ts +315 -0
- package/dist/utils/localization/translations/en-json.js +318 -0
- package/dist/utils/localization/translations/en.json +5 -1
- package/dist/utils/localization/translations/es.json +3 -1
- package/dist/utils/localization/translations/fi-FI.json +3 -1
- package/dist/utils/localization/translations/fr-FR.json +3 -1
- package/dist/utils/localization/translations/fr.json +3 -1
- package/dist/utils/localization/translations/hu-HU.json +3 -1
- package/dist/utils/localization/translations/id.json +3 -1
- package/dist/utils/localization/translations/it.json +3 -1
- package/dist/utils/localization/translations/ja.json +3 -1
- package/dist/utils/localization/translations/ko-KR.json +3 -1
- package/dist/utils/localization/translations/ms.json +3 -1
- package/dist/utils/localization/translations/nb-NO.json +3 -1
- package/dist/utils/localization/translations/nl.json +3 -1
- package/dist/utils/localization/translations/pl.json +3 -1
- package/dist/utils/localization/translations/pt-BR.json +3 -1
- package/dist/utils/localization/translations/sk-SK.json +3 -1
- package/dist/utils/localization/translations/sv.json +3 -1
- package/dist/utils/localization/translations/th.json +3 -1
- package/dist/utils/localization/translations/tr.json +3 -1
- package/dist/utils/localization/translations/zh-Hans.json +3 -1
- package/dist/utils/localization/translations/zh-TW.json +3 -1
- package/esm/card/card.d.ts +3 -0
- package/esm/card/card.js +15 -5
- package/esm/card/components/cardToggle/cardToggle.d.ts +5 -0
- package/esm/card/components/cardToggle/cardToggle.js +3 -0
- package/esm/card/components/title.js +3 -3
- package/esm/cardContainer/cardContainer.d.ts +2 -1
- package/esm/cardContainer/cardContainer.js +4 -3
- package/esm/chart/barChart/getDefaultDatasetStyle.js +8 -6
- package/esm/chart/lineChart/getDatasetColor.js +8 -6
- package/esm/chart/lineChart/useSummary.js +1 -1
- package/esm/chart/pieChart/getDefaultDatasetStyle.js +8 -6
- package/esm/chart/plugins/linePlugin/getInterpolatedValue.js +1 -1
- package/esm/chart/plugins/linePlugin/linePlugin.js +16 -4
- package/esm/commonHelpers/hooks/useEscape.js +4 -0
- package/esm/commonHelpers/hooks/usePillSize.d.ts +2 -1
- package/esm/commonHelpers/hooks/usePillSize.js +6 -3
- package/esm/commonStyles/colors/colorsConstant.d.ts +6 -0
- package/esm/commonStyles/colors/colorsConstant.js +50 -0
- package/esm/dataFeed/dataFeed.d.ts +2 -1
- package/esm/dataFeed/dataFeed.js +18 -3
- package/esm/dataFeed/dataFeedColumnsItems.d.ts +2 -1
- package/esm/dataFeed/dataFeedColumnsItems.js +6 -4
- package/esm/dataGrid/cell/cell.d.ts +2 -1
- package/esm/dataGrid/cell/cell.js +2 -1
- package/esm/dataGrid/dataGrid.d.ts +3 -1
- package/esm/dataGrid/dataGrid.js +7 -2
- package/esm/dataGrid/row/row.d.ts +3 -1
- package/esm/dataGrid/row/row.js +3 -3
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsSidePanel.js +8 -4
- package/esm/divider/divider.d.ts +5 -5
- package/esm/divider/divider.js +6 -2
- package/esm/filtersBar/components/filtersBarPeriodPicker/filtersBarPeriodPicker.js +2 -2
- package/esm/footerButtons/footerButtons.d.ts +4 -0
- package/esm/footerButtons/footerButtons.js +4 -6
- package/esm/groupsFilterRaw/groupsFilterRaw.js +1 -0
- package/esm/index.d.ts +3 -1
- package/esm/index.js +1 -0
- package/esm/lineChart/utils.js +2 -9
- package/esm/list/listItem/listItem.js +26 -0
- package/esm/mobileSheet/components/mobileSheetFooter.d.ts +1 -0
- package/esm/mobileSheet/components/mobileSheetFooter.js +1 -1
- package/esm/mobileSheet/mobileSheet.js +1 -1
- package/esm/pill/components/pillActionable/pillActionable.js +5 -4
- package/esm/pill/components/pillNonActionable/pillNonActionable.js +11 -5
- package/esm/pill/interfaces/pillActionable.interface.d.ts +1 -0
- package/esm/pill/interfaces/pillNonActionable.interface.d.ts +1 -0
- package/esm/pillExpandable/pillExpandable.js +6 -6
- package/esm/rangeRaw/rangeRaw.js +1 -0
- package/esm/selectRaw/selectRaw.js +6 -3
- package/esm/sidePanel/sidePanel.d.ts +1 -1
- package/esm/sidePanel/sidePanel.js +7 -3
- package/esm/table/children/tableDetailPanel.d.ts +9 -0
- package/esm/table/children/tableDetailPanel.js +2 -0
- package/esm/table/children/useTableChildren.d.ts +2 -1
- package/esm/table/children/useTableChildren.js +17 -2
- package/esm/table/detailPanel/detailPanel.d.ts +4 -0
- package/esm/table/detailPanel/detailPanel.js +131 -0
- package/esm/table/detailPanel/detailPanelHeader.d.ts +4 -0
- package/esm/table/detailPanel/detailPanelHeader.js +96 -0
- package/esm/table/detailPanel/interfaces.d.ts +8 -0
- package/esm/table/table.d.ts +6 -1
- package/esm/table/table.js +201 -61
- package/esm/utils/localization/translations/cs.json +3 -1
- package/esm/utils/localization/translations/da-DK.json +3 -1
- package/esm/utils/localization/translations/de.json +3 -1
- package/esm/utils/localization/translations/en-json.d.ts +315 -0
- package/esm/utils/localization/translations/en-json.js +315 -0
- package/esm/utils/localization/translations/en.json +5 -1
- package/esm/utils/localization/translations/es.json +3 -1
- package/esm/utils/localization/translations/fi-FI.json +3 -1
- package/esm/utils/localization/translations/fr-FR.json +3 -1
- package/esm/utils/localization/translations/fr.json +3 -1
- package/esm/utils/localization/translations/hu-HU.json +3 -1
- package/esm/utils/localization/translations/id.json +3 -1
- package/esm/utils/localization/translations/it.json +3 -1
- package/esm/utils/localization/translations/ja.json +3 -1
- package/esm/utils/localization/translations/ko-KR.json +3 -1
- package/esm/utils/localization/translations/ms.json +3 -1
- package/esm/utils/localization/translations/nb-NO.json +3 -1
- package/esm/utils/localization/translations/nl.json +3 -1
- package/esm/utils/localization/translations/pl.json +3 -1
- package/esm/utils/localization/translations/pt-BR.json +3 -1
- package/esm/utils/localization/translations/sk-SK.json +3 -1
- package/esm/utils/localization/translations/sv.json +3 -1
- package/esm/utils/localization/translations/th.json +3 -1
- package/esm/utils/localization/translations/tr.json +3 -1
- package/esm/utils/localization/translations/zh-Hans.json +3 -1
- package/esm/utils/localization/translations/zh-TW.json +3 -1
- package/package.json +7 -7
- package/dist/nav/storyHelpers/storyDecorator.d.ts +0 -35
- package/dist/nav/storyHelpers/storyDecorator.js +0 -79
- package/esm/nav/storyHelpers/storyDecorator.d.ts +0 -35
- package/esm/nav/storyHelpers/storyDecorator.js +0 -74
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/api/fetchEntities.d.ts +0 -3
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/api/fetchEntities.js +0 -32
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/api/gridModel.d.ts +0 -81
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/api/gridModel.js +0 -113
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/components/ColumnWaiting.d.ts +0 -4
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/components/ColumnWaiting.js +0 -4
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/components/EntitiesListAction.d.ts +0 -18
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/components/EntitiesListAction.js +0 -193
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/constants/index.d.ts +0 -1
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/constants/index.js +0 -1
- package/esm/storybookHelpers/dataGridWithDifferentCellOptions/interfaces/entity.d.ts +0 -7
- package/esm/storybookHelpers/fieldDelayRenderer.d.ts +0 -5
- package/esm/storybookHelpers/fieldDelayRenderer.js +0 -20
- package/esm/storybookHelpers/storyFeedbackProviderDecorator.d.ts +0 -2
- package/esm/storybookHelpers/storyFeedbackProviderDecorator.js +0 -16
- package/esm/storybookHelpers/storyGlobalWrapper.d.ts +0 -2
- package/esm/storybookHelpers/storyGlobalWrapper.js +0 -3
- package/esm/storybookHelpers/storyItem.d.ts +0 -8
- package/esm/storybookHelpers/storyItem.js +0 -17
- package/esm/storybookHelpers/storyLanguageDecorator.d.ts +0 -2
- package/esm/storybookHelpers/storyLanguageDecorator.js +0 -4
- package/esm/storybookHelpers/storyQueryClientProvider.d.ts +0 -2
- package/esm/storybookHelpers/storyQueryClientProvider.js +0 -15
- package/esm/storybookHelpers/storyThemeDecorator.d.ts +0 -2
- package/esm/storybookHelpers/storyThemeDecorator.js +0 -15
- package/esm/storybookHelpers/storyTopWindowDecorator.d.ts +0 -2
- package/esm/storybookHelpers/storyTopWindowDecorator.js +0 -4
- /package/esm/{storybookHelpers/dataGridWithDifferentCellOptions/interfaces/entity.js → table/detailPanel/interfaces.js} +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
injectString
|
|
5
|
+
} = require("../../utils/localization/translationsDictionary");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.DetailPanel = void 0;
|
|
10
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const useMobile_1 = require("../../commonHelpers/hooks/useMobile");
|
|
13
|
+
const detailPanelHeader_1 = require("./detailPanelHeader");
|
|
14
|
+
const useFadeComponent_1 = require("../../utils/useFadeComponent");
|
|
15
|
+
const classNames_1 = require("../../commonHelpers/classNames/classNames");
|
|
16
|
+
injectString("cs", "Details", "Podrobnosti");
|
|
17
|
+
injectString("da-DK", "Details", "Detaljer");
|
|
18
|
+
injectString("de", "Details", "Details");
|
|
19
|
+
injectString("en", "Details", "Details");
|
|
20
|
+
injectString("es", "Details", "Detalles");
|
|
21
|
+
injectString("fi-FI", "Details", "Tiedot");
|
|
22
|
+
injectString("fr", "Details", "D\xE9tails");
|
|
23
|
+
injectString("fr-FR", "Details", "D\xE9tails");
|
|
24
|
+
injectString("hu-HU", "Details", "R\xE9szletek");
|
|
25
|
+
injectString("id", "Details", "Detail");
|
|
26
|
+
injectString("it", "Details", "Dettagli");
|
|
27
|
+
injectString("ja", "Details", "\u8A73\u7D30");
|
|
28
|
+
injectString("ko-KR", "Details", "\uC138\uBD80");
|
|
29
|
+
injectString("ms", "Details", "Butiran");
|
|
30
|
+
injectString("nb-NO", "Details", "Detaljer");
|
|
31
|
+
injectString("nl", "Details", "Details");
|
|
32
|
+
injectString("pl", "Details", "Szczeg\xF3\u0142y");
|
|
33
|
+
injectString("pt-BR", "Details", "Detalhes");
|
|
34
|
+
injectString("sk-SK", "Details", "Detaily");
|
|
35
|
+
injectString("sv", "Details", "Detaljer");
|
|
36
|
+
injectString("th", "Details", "\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14");
|
|
37
|
+
injectString("tr", "Details", "Ayr\u0131nt\u0131lar");
|
|
38
|
+
injectString("zh-Hans", "Details", "\u8BE6\u7EC6\u4FE1\u606F");
|
|
39
|
+
injectString("zh-TW", "Details", "\u8A73\u7D30\u8CC7\u8A0A");
|
|
40
|
+
const mobileSheet_1 = require("../../mobileSheet/mobileSheet");
|
|
41
|
+
const useLanguage_1 = require("../../utils/localization/useLanguage");
|
|
42
|
+
const DetailPanel = ({
|
|
43
|
+
id,
|
|
44
|
+
children,
|
|
45
|
+
title,
|
|
46
|
+
details,
|
|
47
|
+
description,
|
|
48
|
+
footer,
|
|
49
|
+
onClose
|
|
50
|
+
}) => {
|
|
51
|
+
const isMobile = (0, useMobile_1.useMobile)();
|
|
52
|
+
const {
|
|
53
|
+
translate
|
|
54
|
+
} = (0, useLanguage_1.useLanguage)();
|
|
55
|
+
const {
|
|
56
|
+
renderComponent,
|
|
57
|
+
showContent,
|
|
58
|
+
handleTransitionEnd,
|
|
59
|
+
setIsOpen
|
|
60
|
+
} = (0, useFadeComponent_1.useFadeComponent)(false);
|
|
61
|
+
const persistedIdRef = (0, react_1.useRef)(id);
|
|
62
|
+
const persistedChildrenRef = (0, react_1.useRef)(children);
|
|
63
|
+
(0, react_1.useEffect)(() => {
|
|
64
|
+
if (id) {
|
|
65
|
+
persistedIdRef.current = id;
|
|
66
|
+
persistedChildrenRef.current = children;
|
|
67
|
+
}
|
|
68
|
+
}, [id, children]);
|
|
69
|
+
(0, react_1.useEffect)(() => {
|
|
70
|
+
setIsOpen(!!id);
|
|
71
|
+
}, [id, setIsOpen]);
|
|
72
|
+
(0, react_1.useEffect)(() => {
|
|
73
|
+
if (!renderComponent) {
|
|
74
|
+
persistedIdRef.current = undefined;
|
|
75
|
+
persistedChildrenRef.current = undefined;
|
|
76
|
+
}
|
|
77
|
+
}, [renderComponent]);
|
|
78
|
+
if (!renderComponent) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const currentId = id || persistedIdRef.current;
|
|
82
|
+
const currentChildren = id ? children : persistedChildrenRef.current;
|
|
83
|
+
if (!currentId) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const footerContent = typeof footer === "function" ? footer(currentId) || null : footer || null;
|
|
87
|
+
const detailPanelContent = (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
|
|
88
|
+
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
89
|
+
className: "zen-table__detail-panel-content",
|
|
90
|
+
children: react_1.Children.map(currentChildren, child => {
|
|
91
|
+
if ((0, react_1.isValidElement)(child)) {
|
|
92
|
+
return (0, react_1.cloneElement)(child, {
|
|
93
|
+
id: currentId
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return child;
|
|
97
|
+
})
|
|
98
|
+
}), footerContent && (0, jsx_runtime_1.jsx)("div", {
|
|
99
|
+
className: "zen-table__detail-panel-footer",
|
|
100
|
+
children: footerContent
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
103
|
+
if (isMobile) {
|
|
104
|
+
return (0, jsx_runtime_1.jsxs)(mobileSheet_1.MobileSheet, {
|
|
105
|
+
wrapperClassName: "zen-table__detail-panel-mobile",
|
|
106
|
+
label: translate("Details"),
|
|
107
|
+
isOpen: showContent,
|
|
108
|
+
onHidePanel: onClose || (() => {}),
|
|
109
|
+
onCloseClick: onClose,
|
|
110
|
+
children: [(0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Title, {
|
|
111
|
+
children: (0, jsx_runtime_1.jsx)(detailPanelHeader_1.DetailPanelHeader, {
|
|
112
|
+
id: currentId,
|
|
113
|
+
title: title,
|
|
114
|
+
details: details,
|
|
115
|
+
description: description
|
|
116
|
+
})
|
|
117
|
+
}), (0, jsx_runtime_1.jsx)(mobileSheet_1.MobileSheet.Content, {
|
|
118
|
+
className: "zen-table__detail-panel-content-mobile",
|
|
119
|
+
children: detailPanelContent
|
|
120
|
+
})]
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
const handleTransitionEndOnce = e => {
|
|
124
|
+
if (e.propertyName === "opacity") {
|
|
125
|
+
handleTransitionEnd();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
return (0, jsx_runtime_1.jsxs)("div", {
|
|
129
|
+
className: (0, classNames_1.classNames)(["zen-table__detail-panel", "zen-card-container", "zen-card-container--no-width-constraint", showContent ? "zen-table__detail-panel--shown" : ""]),
|
|
130
|
+
onTransitionEnd: handleTransitionEndOnce,
|
|
131
|
+
children: [(0, jsx_runtime_1.jsx)(detailPanelHeader_1.DetailPanelHeader, {
|
|
132
|
+
id: currentId,
|
|
133
|
+
title: title,
|
|
134
|
+
details: details,
|
|
135
|
+
description: description,
|
|
136
|
+
onClose: onClose
|
|
137
|
+
}), detailPanelContent]
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
exports.DetailPanel = DetailPanel;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
injectString
|
|
5
|
+
} = require("../../utils/localization/translationsDictionary");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.DetailPanelHeader = void 0;
|
|
10
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
|
+
const iconClose_1 = require("../../icons/iconClose");
|
|
12
|
+
const useLanguage_1 = require("../../utils/localization/useLanguage");
|
|
13
|
+
const buttonType_1 = require("../../button/buttonType");
|
|
14
|
+
const textIconButton_1 = require("../../textIconButton/textIconButton");
|
|
15
|
+
injectString("cs", "Details", "Podrobnosti");
|
|
16
|
+
injectString("da-DK", "Details", "Detaljer");
|
|
17
|
+
injectString("de", "Details", "Details");
|
|
18
|
+
injectString("en", "Details", "Details");
|
|
19
|
+
injectString("es", "Details", "Detalles");
|
|
20
|
+
injectString("fi-FI", "Details", "Tiedot");
|
|
21
|
+
injectString("fr", "Details", "D\xE9tails");
|
|
22
|
+
injectString("fr-FR", "Details", "D\xE9tails");
|
|
23
|
+
injectString("hu-HU", "Details", "R\xE9szletek");
|
|
24
|
+
injectString("id", "Details", "Detail");
|
|
25
|
+
injectString("it", "Details", "Dettagli");
|
|
26
|
+
injectString("ja", "Details", "\u8A73\u7D30");
|
|
27
|
+
injectString("ko-KR", "Details", "\uC138\uBD80");
|
|
28
|
+
injectString("ms", "Details", "Butiran");
|
|
29
|
+
injectString("nb-NO", "Details", "Detaljer");
|
|
30
|
+
injectString("nl", "Details", "Details");
|
|
31
|
+
injectString("pl", "Details", "Szczeg\xF3\u0142y");
|
|
32
|
+
injectString("pt-BR", "Details", "Detalhes");
|
|
33
|
+
injectString("sk-SK", "Details", "Detaily");
|
|
34
|
+
injectString("sv", "Details", "Detaljer");
|
|
35
|
+
injectString("th", "Details", "\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14");
|
|
36
|
+
injectString("tr", "Details", "Ayr\u0131nt\u0131lar");
|
|
37
|
+
injectString("zh-Hans", "Details", "\u8BE6\u7EC6\u4FE1\u606F");
|
|
38
|
+
injectString("zh-TW", "Details", "\u8A73\u7D30\u8CC7\u8A0A");
|
|
39
|
+
injectString("cs", "Close", "Zav\u0159\xEDt");
|
|
40
|
+
injectString("da-DK", "Close", "Luk");
|
|
41
|
+
injectString("de", "Close", "Schlie\xDFen");
|
|
42
|
+
injectString("en", "Close", "Close");
|
|
43
|
+
injectString("es", "Close", "Cerrar");
|
|
44
|
+
injectString("fi-FI", "Close", "Sulje");
|
|
45
|
+
injectString("fr", "Close", "Fermer");
|
|
46
|
+
injectString("fr-FR", "Close", "Fermer");
|
|
47
|
+
injectString("hu-HU", "Close", "Z\xE1rd be.");
|
|
48
|
+
injectString("id", "Close", "Tutup");
|
|
49
|
+
injectString("it", "Close", "Chiudere");
|
|
50
|
+
injectString("ja", "Close", "\u9589\u3058\u308B");
|
|
51
|
+
injectString("ko-KR", "Close", "\uB2EB\uAE30");
|
|
52
|
+
injectString("ms", "Close", "Tutup");
|
|
53
|
+
injectString("nb-NO", "Close", "Lukk");
|
|
54
|
+
injectString("nl", "Close", "Sluiten");
|
|
55
|
+
injectString("pl", "Close", "Zamknij");
|
|
56
|
+
injectString("pt-BR", "Close", "Fechar");
|
|
57
|
+
injectString("sk-SK", "Close", "Zatvor");
|
|
58
|
+
injectString("sv", "Close", "St\xE4ng");
|
|
59
|
+
injectString("th", "Close", "\u0E1B\u0E34\u0E14");
|
|
60
|
+
injectString("tr", "Close", "Kapat");
|
|
61
|
+
injectString("zh-Hans", "Close", "\u5173\u95ED");
|
|
62
|
+
injectString("zh-TW", "Close", "\u95DC\u9589");
|
|
63
|
+
const useMobile_1 = require("../../commonHelpers/hooks/useMobile");
|
|
64
|
+
const DetailPanelHeader = ({
|
|
65
|
+
id,
|
|
66
|
+
title,
|
|
67
|
+
details,
|
|
68
|
+
description,
|
|
69
|
+
onClose
|
|
70
|
+
}) => {
|
|
71
|
+
const {
|
|
72
|
+
translate
|
|
73
|
+
} = (0, useLanguage_1.useLanguage)();
|
|
74
|
+
const isMobile = (0, useMobile_1.useMobile)();
|
|
75
|
+
if (!id) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const titleText = title ? (typeof title === "function" ? title(id) : title) || translate("Details") : translate("Details");
|
|
79
|
+
const descriptionText = typeof description === "function" ? description(id) || null : description || null;
|
|
80
|
+
return (0, jsx_runtime_1.jsxs)("div", {
|
|
81
|
+
className: "zen-table__detail-panel--header",
|
|
82
|
+
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
83
|
+
className: "zen-table__detail-panel--header-content",
|
|
84
|
+
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
85
|
+
className: "zen-table__detail-panel--header-title",
|
|
86
|
+
children: titleText
|
|
87
|
+
}), details && (0, jsx_runtime_1.jsx)("div", {
|
|
88
|
+
className: "zen-table__detail-panel--header-details",
|
|
89
|
+
children: typeof details === "function" ? details(id) : details || null
|
|
90
|
+
}), !isMobile && (0, jsx_runtime_1.jsx)("div", {
|
|
91
|
+
className: "zen-table__detail-panel--header-actions",
|
|
92
|
+
children: (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, {
|
|
93
|
+
icon: iconClose_1.IconClose,
|
|
94
|
+
title: translate("Close"),
|
|
95
|
+
onClick: onClose,
|
|
96
|
+
type: buttonType_1.ButtonType.TertiaryBlack
|
|
97
|
+
})
|
|
98
|
+
})]
|
|
99
|
+
}), descriptionText && (0, jsx_runtime_1.jsx)("div", {
|
|
100
|
+
className: "zen-table__detail-panel--header-description",
|
|
101
|
+
children: descriptionText
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
exports.DetailPanelHeader = DetailPanelHeader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface IDetailPanelHeader {
|
|
3
|
+
id?: string | undefined;
|
|
4
|
+
title?: string | ((id: string) => string | React.JSX.Element | null);
|
|
5
|
+
details?: string | ((id: string) => string | React.JSX.Element | null);
|
|
6
|
+
description?: string | ((id: string) => string | React.JSX.Element | null);
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
}
|
package/dist/table/table.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ import { IBulkActionLink } from "../dataGrid/withSelectableRows/components/bulkA
|
|
|
23
23
|
import { TRowClassName } from "../dataGrid/getRowClassName";
|
|
24
24
|
import { IRowEntity } from "../dataGrid/row/row";
|
|
25
25
|
import { IEntityWithId } from "../commonHelpers/entity";
|
|
26
|
+
import "../cardContainer/cardContainer.less";
|
|
27
|
+
import { ITableDetailPanel } from "./children/tableDetailPanel";
|
|
26
28
|
export interface IListColumn<T extends IRowEntity<N>, N extends IEntityWithId = T> {
|
|
27
29
|
readonly id: string;
|
|
28
30
|
readonly title: string;
|
|
@@ -65,6 +67,8 @@ export interface ITable<T extends IRowEntity<N>, N extends IEntityWithId = T> ex
|
|
|
65
67
|
feedExpandable?: IFeedExpandable;
|
|
66
68
|
expandedRows?: string[];
|
|
67
69
|
onExpand?: (id: string, isExpanded: boolean) => void;
|
|
70
|
+
active?: string | undefined;
|
|
71
|
+
onClick?: (id: string | undefined) => void;
|
|
68
72
|
}
|
|
69
73
|
interface ITableComponents {
|
|
70
74
|
Empty: React.FC<ITableEmpty>;
|
|
@@ -74,6 +78,7 @@ interface ITableComponents {
|
|
|
74
78
|
BulkActions: React.FC<ITableBulkActions>;
|
|
75
79
|
BulkButton: React.FC<IBulkActionButton>;
|
|
76
80
|
BulkLink: React.FC<IBulkActionLink>;
|
|
81
|
+
DetailPanel: React.FC<ITableDetailPanel>;
|
|
77
82
|
}
|
|
78
|
-
declare const Table: (<T extends IRowEntity<N>, N extends IEntityWithId = T>({ entities, columns, selectable, sortable, flexible, isLoading, loading, children, className, height, onFeedEnd, rowClassName, feedExpandable, expandedRows, onExpand }: ITable<T, N>) => import("react/jsx-runtime").JSX.Element) & ITableComponents;
|
|
83
|
+
declare const Table: (<T extends IRowEntity<N>, N extends IEntityWithId = T>({ entities, columns, selectable, sortable, flexible, isLoading, loading, children, className, height, onFeedEnd, rowClassName, feedExpandable, expandedRows, onExpand, active, onClick }: ITable<T, N>) => import("react/jsx-runtime").JSX.Element) & ITableComponents;
|
|
79
84
|
export { type IListColumnWrapper, Table, getEmptySelection, ColumnSortDirection, getSortableValue, ActionsColumn, MainColumn, CheckboxColumn, ActionLinkColumn };
|
package/dist/table/table.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
injectString
|
|
5
|
+
} = require("../utils/localization/translationsDictionary");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
3
9
|
exports.ActionLinkColumn = exports.CheckboxColumn = exports.MainColumn = exports.ActionsColumn = exports.getSortableValue = exports.ColumnSortDirection = exports.getEmptySelection = exports.Table = void 0;
|
|
4
10
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
11
|
const react_1 = require("react");
|
|
@@ -21,20 +27,57 @@ const tableBulkActions_1 = require("./children/tableBulkActions");
|
|
|
21
27
|
const tablePagination_1 = require("./children/tablePagination");
|
|
22
28
|
const tableEmpty_1 = require("./children/tableEmpty");
|
|
23
29
|
const tableFooter_1 = require("./children/tableFooter");
|
|
30
|
+
injectString("en", "Selection panel", "Selection panel");
|
|
31
|
+
injectString("en", "Bulk select", "Bulk select");
|
|
24
32
|
const useSelectableRows_2 = require("./selectable/useSelectableRows");
|
|
25
|
-
Object.defineProperty(exports, "getEmptySelection", {
|
|
33
|
+
Object.defineProperty(exports, "getEmptySelection", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return useSelectableRows_2.getEmptySelection;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
26
39
|
const interfaces_1 = require("./sortable/interfaces");
|
|
27
|
-
Object.defineProperty(exports, "ColumnSortDirection", {
|
|
40
|
+
Object.defineProperty(exports, "ColumnSortDirection", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return interfaces_1.ColumnSortDirection;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
28
46
|
const useSortableColumns_2 = require("./sortable/useSortableColumns");
|
|
29
|
-
Object.defineProperty(exports, "getSortableValue", {
|
|
47
|
+
Object.defineProperty(exports, "getSortableValue", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () {
|
|
50
|
+
return useSortableColumns_2.getSortableValue;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
30
53
|
const actionsColumn_1 = require("../dataGrid/columns/actionsColumn/actionsColumn");
|
|
31
|
-
Object.defineProperty(exports, "ActionsColumn", {
|
|
54
|
+
Object.defineProperty(exports, "ActionsColumn", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return actionsColumn_1.ActionsColumn;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
32
60
|
const mainColumn_1 = require("../dataGrid/columns/mainColumn/mainColumn");
|
|
33
|
-
Object.defineProperty(exports, "MainColumn", {
|
|
61
|
+
Object.defineProperty(exports, "MainColumn", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () {
|
|
64
|
+
return mainColumn_1.MainColumn;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
34
67
|
const checkboxColumn_1 = require("../dataGrid/columns/checkboxColumn/checkboxColumn");
|
|
35
|
-
Object.defineProperty(exports, "CheckboxColumn", {
|
|
68
|
+
Object.defineProperty(exports, "CheckboxColumn", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return checkboxColumn_1.CheckboxColumn;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
36
74
|
const actionLinkColumn_1 = require("../dataGrid/columns/actionLinkColumn/actionLinkColumn");
|
|
37
|
-
Object.defineProperty(exports, "ActionLinkColumn", {
|
|
75
|
+
Object.defineProperty(exports, "ActionLinkColumn", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return actionLinkColumn_1.ActionLinkColumn;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
38
81
|
const bulkActionButton_1 = require("../dataGrid/withSelectableRows/components/bulkActions/bulkActionButton/bulkActionButton");
|
|
39
82
|
const bulkActionLink_1 = require("../dataGrid/withSelectableRows/components/bulkActions/bulkActionLink/bulkActionLink");
|
|
40
83
|
const layoutSizeProvider_1 = require("../layout/layoutSizeProvider");
|
|
@@ -44,66 +87,202 @@ const useFeedExpandable_1 = require("./expandable/useFeedExpandable");
|
|
|
44
87
|
const feedExpandControl_1 = require("../dataFeed/feedExpandControl/feedExpandControl");
|
|
45
88
|
const getGridClasses_1 = require("../gridLayout/utils/getGridClasses");
|
|
46
89
|
const useNestedRows_1 = require("./nested/useNestedRows");
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
90
|
+
const tableDetailPanel_1 = require("./children/tableDetailPanel");
|
|
91
|
+
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
92
|
+
const TableInner = ({
|
|
93
|
+
entities,
|
|
94
|
+
columns,
|
|
95
|
+
selectable,
|
|
96
|
+
sortable,
|
|
97
|
+
flexible,
|
|
98
|
+
isLoading,
|
|
99
|
+
loading,
|
|
100
|
+
children,
|
|
101
|
+
className,
|
|
102
|
+
height,
|
|
103
|
+
onFeedEnd,
|
|
104
|
+
rowClassName,
|
|
105
|
+
feedExpandable,
|
|
106
|
+
expandedRows,
|
|
107
|
+
onExpand,
|
|
108
|
+
active,
|
|
109
|
+
onClick
|
|
110
|
+
}) => {
|
|
111
|
+
var _a, _b, _c;
|
|
112
|
+
const isMobile = (0, useMobile_1.useMobile)();
|
|
113
|
+
const {
|
|
114
|
+
translate
|
|
115
|
+
} = (0, useLanguage_1.useLanguage)();
|
|
116
|
+
const gridRef = (0, react_1.useRef)(null);
|
|
117
|
+
const columnsPopupRef = (0, react_1.useRef)(null);
|
|
118
|
+
const [selectMode, setSelectMode] = (0, react_1.useState)((((_a = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _a === void 0 ? void 0 : _a.selected) || []).length > 0 || ((_b = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _b === void 0 ? void 0 : _b.all) || false);
|
|
119
|
+
const {
|
|
120
|
+
contentHeight
|
|
121
|
+
} = (0, layoutSizeProvider_1.useLayoutSize)();
|
|
122
|
+
const setMobileSelectMode = (0, react_1.useCallback)(value => {
|
|
123
|
+
if (isMobile) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
setSelectMode(value);
|
|
127
|
+
}, [isMobile, setSelectMode]);
|
|
128
|
+
const {
|
|
129
|
+
expanded,
|
|
130
|
+
onExpandedChange,
|
|
131
|
+
nestedColumns,
|
|
132
|
+
nestedFeedWrapper
|
|
133
|
+
} = (0, useNestedRows_1.useNestedRows)(expandedRows, onExpand, columns, isMobile);
|
|
134
|
+
const {
|
|
135
|
+
selectableColumns,
|
|
136
|
+
selectableFeedWrapper
|
|
137
|
+
} = (0, useSelectableRows_1.useSelectableRows)(nestedColumns, entities, isMobile, selectMode, setMobileSelectMode, isLoading ? undefined : selectable);
|
|
138
|
+
const {
|
|
139
|
+
sortableColumns,
|
|
140
|
+
feedSortControl
|
|
141
|
+
} = (0, useSortableColumns_1.useSortableColumns)(selectableColumns, sortable, isMobile);
|
|
142
|
+
const {
|
|
143
|
+
flexibleColumns,
|
|
144
|
+
columnsPopup
|
|
145
|
+
} = (0, useFlexibleColumns_1.useFlexibleColumns)(sortableColumns, flexible, gridRef, columnsPopupRef, isMobile);
|
|
146
|
+
const {
|
|
147
|
+
columnsWithActions,
|
|
148
|
+
actions,
|
|
149
|
+
actionsAsync,
|
|
150
|
+
primaryActions
|
|
151
|
+
} = (0, useActions_1.useActions)(flexibleColumns, isMobile);
|
|
152
|
+
const {
|
|
153
|
+
loadingColumns,
|
|
154
|
+
loadingEntities
|
|
155
|
+
} = (0, useLoading_1.useLoading)(columnsWithActions, entities, isLoading, loading);
|
|
156
|
+
const {
|
|
157
|
+
isFeedExpanded,
|
|
158
|
+
handleExpanded,
|
|
159
|
+
isFeedVisible,
|
|
160
|
+
visibleColumns
|
|
161
|
+
} = (0, useFeedExpandable_1.useFeedExpandable)(isMobile, feedExpandable);
|
|
162
|
+
const selectionQty = (0, react_1.useMemo)(() => {
|
|
163
|
+
var _a, _b;
|
|
164
|
+
if (!selectable) {
|
|
165
|
+
return 0;
|
|
166
|
+
}
|
|
167
|
+
return ((_a = selectable.selection) === null || _a === void 0 ? void 0 : _a.all) ? loadingEntities.length : ((_b = selectable.selection) === null || _b === void 0 ? void 0 : _b.selected.length) || 0;
|
|
168
|
+
}, [selectable, loadingEntities.length]);
|
|
169
|
+
const clearSelection = (0, react_1.useCallback)(() => {
|
|
170
|
+
setSelectMode(false);
|
|
171
|
+
selectable === null || selectable === void 0 ? void 0 : selectable.onSelect({
|
|
172
|
+
all: false,
|
|
173
|
+
selected: []
|
|
174
|
+
});
|
|
175
|
+
}, [selectable]);
|
|
176
|
+
const selectAll = (0, react_1.useCallback)(() => {
|
|
177
|
+
selectable === null || selectable === void 0 ? void 0 : selectable.onSelect({
|
|
178
|
+
all: true,
|
|
179
|
+
selected: []
|
|
180
|
+
});
|
|
181
|
+
}, [selectable]);
|
|
182
|
+
const [activeIdInternal, setActiveInternal] = (0, react_1.useState)(undefined);
|
|
183
|
+
const activeId = active !== undefined ? active : activeIdInternal;
|
|
184
|
+
const onClickInternal = (0, react_1.useCallback)(id => setActiveInternal(id === activeIdInternal ? undefined : id), [activeIdInternal, setActiveInternal]);
|
|
185
|
+
const onClickRow = onClick || onClickInternal;
|
|
186
|
+
const onCloseDetailPanel = (0, react_1.useCallback)(() => {
|
|
187
|
+
onClickRow(undefined);
|
|
188
|
+
}, [onClickRow]);
|
|
189
|
+
const {
|
|
190
|
+
bulkActions,
|
|
191
|
+
pagination,
|
|
192
|
+
activePage,
|
|
193
|
+
fullscreenButton,
|
|
194
|
+
emptyList,
|
|
195
|
+
detailPanel,
|
|
196
|
+
footer,
|
|
197
|
+
other
|
|
198
|
+
} = (0, useTableChildren_1.useTableChildren)(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, selectAll, selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll, activeId, gridRef, onCloseDetailPanel);
|
|
199
|
+
const hasDetailPanel = !!detailPanel;
|
|
200
|
+
const shouldEnableRowClick = hasDetailPanel || !!onClick;
|
|
201
|
+
const activeIdForRow = shouldEnableRowClick ? activeId : undefined;
|
|
202
|
+
const onClickForRow = shouldEnableRowClick ? onClickRow : undefined;
|
|
203
|
+
const handleOnHidePanel = (0, react_1.useCallback)(() => setSelectMode(false), []);
|
|
204
|
+
const handleOnTriggerClick = (0, react_1.useCallback)(() => setSelectMode(prev => !prev), []);
|
|
205
|
+
const hasPostActions = (0, react_1.useMemo)(() => columnsPopup || isMobile && selectable || !isMobile && fullscreenButton || isFeedVisible, [columnsPopup, fullscreenButton, isFeedVisible, isMobile, selectable]);
|
|
206
|
+
const hasToolbar = (0, react_1.useMemo)(() => bulkActions || feedSortControl || pagination && !isMobile || other.length || columnsPopup || !isMobile && fullscreenButton || isFeedVisible, [bulkActions, columnsPopup, feedSortControl, fullscreenButton, isFeedVisible, isMobile, other.length, pagination]);
|
|
207
|
+
const gridAutoHeight = (0, react_1.useMemo)(() => contentHeight ? `${contentHeight}px` : undefined, [contentHeight]);
|
|
208
|
+
const minHeight = "400px";
|
|
209
|
+
const gridHeight = (0, react_1.useMemo)(() => height || gridAutoHeight || minHeight, [gridAutoHeight, height]);
|
|
210
|
+
// TODO: disadvantages?
|
|
211
|
+
const {
|
|
212
|
+
gridClasses,
|
|
213
|
+
restClasses
|
|
214
|
+
} = (0, getGridClasses_1.getGridClasses)(className || "");
|
|
215
|
+
return (0, jsx_runtime_1.jsx)(layoutFullScreen_1.LayoutFullScreen, {
|
|
216
|
+
className: (0, classNames_1.classNames)([...gridClasses]),
|
|
217
|
+
children: (0, jsx_runtime_1.jsxs)("div", {
|
|
218
|
+
style: {
|
|
219
|
+
height: gridHeight
|
|
220
|
+
},
|
|
221
|
+
className: (0, classNames_1.classNames)(["zen-table-wrapper", hasToolbar ? "zen-table-wrapper--with-toolbar" : "", ...restClasses]),
|
|
222
|
+
children: [hasToolbar ? (0, jsx_runtime_1.jsxs)(entitiesListActions_1.EntitiesListActions, {
|
|
223
|
+
gridType: isMobile ? deviceType_1.DeviceType.Mobile : deviceType_1.DeviceType.Desktop,
|
|
224
|
+
children: [(0, jsx_runtime_1.jsxs)(entitiesListActions_1.EntitiesListActions.Actions, {
|
|
225
|
+
children: [!isMobile && bulkActions && selectionQty > 0 ? bulkActions : null, feedSortControl]
|
|
226
|
+
}), pagination || other.length > 0 ? (0, jsx_runtime_1.jsxs)(entitiesListActions_1.EntitiesListActions.Pagination, {
|
|
227
|
+
children: [(0, jsx_runtime_1.jsx)(entitiesListActions_1.EntitiesListActions.CustomElements, {
|
|
228
|
+
children: other
|
|
229
|
+
}), !isMobile ? pagination : null]
|
|
230
|
+
}) : null, hasPostActions ? (0, jsx_runtime_1.jsxs)(entitiesListActions_1.EntitiesListActions.PostActions, {
|
|
231
|
+
children: [columnsPopup ? (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
|
|
232
|
+
children: [(0, jsx_runtime_1.jsx)(columnsListButton_1.ColumnsListButton, {
|
|
233
|
+
ref: columnsPopupRef
|
|
234
|
+
}), columnsPopup]
|
|
235
|
+
}) : null, isFeedVisible ? (0, jsx_runtime_1.jsx)(feedExpandControl_1.FeedExpandControl, {
|
|
236
|
+
isExpanded: isFeedExpanded,
|
|
237
|
+
onClick: handleExpanded
|
|
238
|
+
}) : null, isMobile && selectable ? (0, jsx_runtime_1.jsx)(dataFeedSelectPanel_1.DataFeedSelectPanel, {
|
|
239
|
+
panelTitle: translate("Selection panel"),
|
|
240
|
+
buttonTitle: translate("Bulk select"),
|
|
241
|
+
onTriggerClick: handleOnTriggerClick,
|
|
242
|
+
isOpen: selectMode,
|
|
243
|
+
onHidePanel: handleOnHidePanel,
|
|
244
|
+
children: bulkActions
|
|
245
|
+
}) : null, !isMobile ? fullscreenButton : null]
|
|
246
|
+
}) : null]
|
|
247
|
+
}) : null, (0, jsx_runtime_1.jsxs)("div", {
|
|
248
|
+
className: "zen-table__content",
|
|
249
|
+
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
250
|
+
className: "zen-table__table",
|
|
251
|
+
children: isMobile ? (0, jsx_runtime_1.jsxs)(dataFeed_1.DataFeed, {
|
|
252
|
+
columns: loadingColumns,
|
|
253
|
+
feedWrappers: [nestedFeedWrapper, selectableFeedWrapper],
|
|
254
|
+
entities: loadingEntities,
|
|
255
|
+
expanded: isFeedExpanded,
|
|
256
|
+
options: {
|
|
257
|
+
onFeedEnd: onFeedEnd,
|
|
258
|
+
visibleColumns
|
|
259
|
+
},
|
|
260
|
+
actions: actions,
|
|
261
|
+
actionsAsync: actionsAsync,
|
|
262
|
+
primaryActions: primaryActions,
|
|
263
|
+
ref: gridRef,
|
|
264
|
+
rowClassName: rowClassName,
|
|
265
|
+
expandedRows: expanded,
|
|
266
|
+
onExpandedChange: onExpandedChange,
|
|
267
|
+
activePage: activePage,
|
|
268
|
+
active: activeIdForRow,
|
|
269
|
+
onClick: onClickForRow,
|
|
270
|
+
children: [emptyList || (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), footer || (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})]
|
|
271
|
+
}) : (0, jsx_runtime_1.jsxs)(dataGrid_1.DataGrid, {
|
|
272
|
+
columns: loadingColumns,
|
|
273
|
+
entities: loadingEntities,
|
|
274
|
+
ref: gridRef,
|
|
275
|
+
rowClassName: rowClassName,
|
|
276
|
+
expandedRows: expanded,
|
|
277
|
+
onExpandedChange: onExpandedChange,
|
|
278
|
+
active: activeIdForRow,
|
|
279
|
+
onClick: onClickForRow,
|
|
280
|
+
children: [emptyList || (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), footer || (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})]
|
|
281
|
+
})
|
|
282
|
+
}), detailPanel !== null && detailPanel !== void 0 ? detailPanel : null]
|
|
283
|
+
})]
|
|
284
|
+
})
|
|
285
|
+
});
|
|
107
286
|
};
|
|
108
287
|
const Table = (0, react_1.memo)(TableInner);
|
|
109
288
|
exports.Table = Table;
|
|
@@ -114,3 +293,4 @@ Table.Pagination = tablePagination_1.TablePagination;
|
|
|
114
293
|
Table.Fullscreen = tableFullscreen_1.TableFullscreen;
|
|
115
294
|
Table.BulkButton = bulkActionButton_1.BulkActionButton;
|
|
116
295
|
Table.BulkLink = bulkActionLink_1.BulkActionLink;
|
|
296
|
+
Table.DetailPanel = tableDetailPanel_1.TableDetailPanel;
|