@geotab/zenith 3.9.0-beta.ssr.2 → 3.9.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 +29 -8
- package/dist/card/card.d.ts +1 -1
- package/dist/card/card.js +1 -1
- package/dist/{title → card/components}/title.d.ts +1 -1
- package/dist/card/components/title.js +26 -0
- package/dist/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/dist/chart/pieChart/centerTextPlugin.js +11 -4
- package/dist/chart/pieChart.js +10 -1
- package/dist/commonHelpers/hooks/useDeviceType.js +2 -1
- package/dist/commonHelpers/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/commonHelpers/hooks/useIsomorphicLayoutEffect.js +6 -0
- package/dist/commonHelpers/isDomEnv.js +1 -2
- package/dist/commonHelpers/useUniqueId.js +2 -2
- package/dist/commonHelpers/utils.d.ts +0 -9
- package/dist/commonHelpers/utils.js +1 -11
- package/dist/commonStyles/common.less +13 -1
- package/dist/commonStyles/fonts/notosarabic/LICENSE.txt +93 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Bold.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Bold.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Medium.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Medium.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Regular.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Regular.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-SemiBold.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-SemiBold.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic.less +43 -0
- package/dist/commonStyles/typography/typography.less +6 -0
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -5
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +38 -2
- package/dist/dateInputInner/dateInputInnerControlBlock.js +5 -2
- package/dist/dateRangeRaw/dateRangeRaw.js +5 -1
- package/dist/filtersBar/filtersBarActions/filtersBarActions.js +3 -1
- package/dist/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +1 -1
- package/dist/index.css +1981 -212
- package/dist/index.d.ts +5 -5
- package/dist/index.js +24 -26
- package/dist/menu/components/menuItem.js +4 -4
- package/dist/menu/controlledMenu.js +4 -4
- package/dist/nav/nav.js +10 -5
- package/dist/selectRaw/selectRaw.js +1 -1
- package/dist/shield/shield.js +5 -3
- package/dist/table/children/useTableChildren.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +3 -3
- package/dist/table/selectable/useSelectableRows.d.ts +0 -8
- package/dist/table/selectable/useSelectableRows.js +7 -14
- package/dist/table/table.js +7 -1
- package/dist/tooltip/tooltip.d.ts +2 -1
- package/dist/tooltip/tooltip.js +51 -55
- package/dist/utils/localization/languageProvider.js +5 -2
- package/dist/utils/localization/translations/ar.json +0 -1
- package/dist/utils/localization/translations/cs.json +0 -1
- package/dist/utils/localization/translations/da-DK.json +0 -1
- package/dist/utils/localization/translations/de.json +0 -1
- package/dist/utils/localization/translations/en.json +3 -1
- package/dist/utils/localization/translations/es.json +0 -1
- package/dist/utils/localization/translations/fi-FI.json +0 -1
- package/dist/utils/localization/translations/fr-FR.json +0 -1
- package/dist/utils/localization/translations/fr.json +0 -1
- package/dist/utils/localization/translations/hu-HU.json +0 -1
- package/dist/utils/localization/translations/id.json +0 -1
- package/dist/utils/localization/translations/it.json +0 -1
- package/dist/utils/localization/translations/ja.json +0 -1
- package/dist/utils/localization/translations/ko-KR.json +0 -1
- package/dist/utils/localization/translations/ms.json +0 -1
- package/dist/utils/localization/translations/nb-NO.json +0 -1
- package/dist/utils/localization/translations/nl.json +0 -1
- package/dist/utils/localization/translations/pl.json +0 -1
- package/dist/utils/localization/translations/pt-BR.json +0 -1
- package/dist/utils/localization/translations/pt-PT.json +0 -1
- package/dist/utils/localization/translations/ro-RO.json +0 -1
- package/dist/utils/localization/translations/sk-SK.json +0 -1
- package/dist/utils/localization/translations/sv.json +0 -1
- package/dist/utils/localization/translations/th.json +0 -1
- package/dist/utils/localization/translations/tr.json +0 -1
- package/dist/utils/localization/translations/zh-Hans.json +0 -1
- package/dist/utils/localization/translations/zh-TW.json +0 -1
- package/esm/card/card.d.ts +1 -1
- package/esm/card/card.js +1 -1
- package/esm/{title → card/components}/title.d.ts +1 -1
- package/esm/card/components/title.js +22 -0
- package/esm/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/esm/chart/pieChart/centerTextPlugin.js +11 -4
- package/esm/chart/pieChart.js +11 -2
- package/esm/commonHelpers/hooks/useDeviceType.js +3 -2
- package/esm/commonHelpers/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/esm/commonHelpers/hooks/useIsomorphicLayoutEffect.js +3 -0
- package/esm/commonHelpers/isDomEnv.js +1 -2
- package/esm/commonHelpers/useUniqueId.js +1 -1
- package/esm/commonHelpers/utils.d.ts +0 -9
- package/esm/commonHelpers/utils.js +0 -9
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +3 -5
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +38 -2
- package/esm/dateInputInner/dateInputInnerControlBlock.js +5 -2
- package/esm/dateRangeRaw/dateRangeRaw.js +5 -1
- package/esm/filtersBar/filtersBarActions/filtersBarActions.js +3 -1
- package/esm/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +1 -1
- package/esm/index.d.ts +5 -5
- package/esm/index.js +5 -5
- package/esm/menu/components/menuItem.js +1 -1
- package/esm/menu/controlledMenu.js +1 -1
- package/esm/nav/nav.js +10 -5
- package/esm/selectRaw/selectRaw.js +1 -1
- package/esm/shield/shield.js +5 -3
- package/esm/table/children/useTableChildren.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +3 -3
- package/esm/table/selectable/useSelectableRows.d.ts +0 -8
- package/esm/table/selectable/useSelectableRows.js +7 -14
- package/esm/table/table.js +7 -1
- package/esm/tooltip/tooltip.d.ts +2 -1
- package/esm/tooltip/tooltip.js +51 -55
- package/esm/utils/localization/languageProvider.js +5 -2
- package/esm/utils/localization/translations/ar.json +0 -1
- package/esm/utils/localization/translations/cs.json +0 -1
- package/esm/utils/localization/translations/da-DK.json +0 -1
- package/esm/utils/localization/translations/de.json +0 -1
- package/esm/utils/localization/translations/en.json +3 -1
- package/esm/utils/localization/translations/es.json +0 -1
- package/esm/utils/localization/translations/fi-FI.json +0 -1
- package/esm/utils/localization/translations/fr-FR.json +0 -1
- package/esm/utils/localization/translations/fr.json +0 -1
- package/esm/utils/localization/translations/hu-HU.json +0 -1
- package/esm/utils/localization/translations/id.json +0 -1
- package/esm/utils/localization/translations/it.json +0 -1
- package/esm/utils/localization/translations/ja.json +0 -1
- package/esm/utils/localization/translations/ko-KR.json +0 -1
- package/esm/utils/localization/translations/ms.json +0 -1
- package/esm/utils/localization/translations/nb-NO.json +0 -1
- package/esm/utils/localization/translations/nl.json +0 -1
- package/esm/utils/localization/translations/pl.json +0 -1
- package/esm/utils/localization/translations/pt-BR.json +0 -1
- package/esm/utils/localization/translations/pt-PT.json +0 -1
- package/esm/utils/localization/translations/ro-RO.json +0 -1
- package/esm/utils/localization/translations/sk-SK.json +0 -1
- package/esm/utils/localization/translations/sv.json +0 -1
- package/esm/utils/localization/translations/th.json +0 -1
- package/esm/utils/localization/translations/tr.json +0 -1
- package/esm/utils/localization/translations/zh-Hans.json +0 -1
- package/esm/utils/localization/translations/zh-TW.json +0 -1
- package/package.json +38 -35
- package/dist/title/title.js +0 -27
- package/esm/title/title.js +0 -23
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { zen } from "../utils/zen";
|
|
2
|
-
/**
|
|
3
|
-
* Generates a random unique ID string.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* **Prefer `React.useId()`** inside React components. `useId` produces IDs that are
|
|
7
|
-
* stable across server and client renders, preventing SSR hydration mismatches.
|
|
8
|
-
* Use `generateId` only outside of a React component context where `useId` is not available.
|
|
9
|
-
*/
|
|
10
|
-
export const generateId = () => "id" + Math.random().toString().substring(2);
|
|
11
2
|
export const echo = (_) => _;
|
|
12
3
|
export function flattenArrays(arrayOfArrays) {
|
|
13
4
|
return arrayOfArrays.reduce((akk, arr) => akk.concat(arr), []);
|
|
@@ -7,21 +7,19 @@ import { DeviceType } from "../../../../commonHelpers/hooks/deviceType";
|
|
|
7
7
|
type TBulkAction = IBulkActionLink | IBulkActionButton;
|
|
8
8
|
export interface IBulkActionsProps extends IZenComponentProps {
|
|
9
9
|
selected: number;
|
|
10
|
-
/**
|
|
11
|
-
* When `true`, displays "All selected" instead of a count, and enables action buttons
|
|
12
|
-
* even when `selected` is 0 (i.e., cross-page "select all" is active).
|
|
13
|
-
*/
|
|
14
10
|
allSelected?: boolean;
|
|
15
11
|
onClearSelection: () => void;
|
|
12
|
+
onSelectAll?: () => void;
|
|
16
13
|
gridType?: DeviceType;
|
|
17
14
|
children?: ReactElement<TBulkAction> | null | (ReactElement<TBulkAction> | null)[];
|
|
15
|
+
turnOffSelectAll?: boolean;
|
|
18
16
|
}
|
|
19
17
|
export interface IBulkActions extends IBulkActionsProps {
|
|
20
18
|
ActionLink: (props: IBulkActionLink) => ReactNode;
|
|
21
19
|
ActionButton: (props: IBulkActionButton) => ReactNode;
|
|
22
20
|
}
|
|
23
21
|
export declare const BulkActions: {
|
|
24
|
-
({ selected, allSelected, className, onClearSelection, gridType, children }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
({ selected, allSelected, className, onClearSelection, onSelectAll, gridType, children, turnOffSelectAll }: IBulkActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
25
23
|
ActionLink: ({ title, icon, link, disabled, type, ref }: IBulkActionLink) => import("react/jsx-runtime").JSX.Element;
|
|
26
24
|
ActionButton: ({ title, icon, clickHandler, onClick, disabled, type, ref }: IBulkActionButton) => import("react/jsx-runtime").JSX.Element;
|
|
27
25
|
translations: string[];
|
|
@@ -12,6 +12,7 @@ import { useNonFittingElements } from "../../../../header/hooks/useNonFittingEle
|
|
|
12
12
|
import { useResizeObserver } from "../../../../commonHelpers/hooks/useResizeObserver";
|
|
13
13
|
import { Menu } from "../../../../menu/menu";
|
|
14
14
|
import { IconDotVertical } from "../../../../icons/iconDotVertical";
|
|
15
|
+
import { Button } from "../../../../button/button";
|
|
15
16
|
injectString("cs", "{1} selected", "{1} vybran\xFD/vybran\xE9");
|
|
16
17
|
injectString("da-DK", "{1} selected", "{1} valgt");
|
|
17
18
|
injectString("de", "{1} selected", "{1} ausgew\xE4hlt");
|
|
@@ -93,6 +94,33 @@ injectString("zh-Hans", "Clear selection", "\u6E05\u9664\u9009\u62E9");
|
|
|
93
94
|
injectString("zh-TW", "Clear selection", "\u6E05\u9664\u9078\u53D6\u9805\u76EE");
|
|
94
95
|
injectString("ro-RO", "Clear selection", "\u0218terge\u021Bi selec\u021Bia");
|
|
95
96
|
injectString("ar-SA", "Clear selection", "\u0645\u0633\u062D \u0627\u0644\u062A\u062D\u062F\u064A\u062F");
|
|
97
|
+
injectString("cs", "Select all", "Vybrat v\u0161e");
|
|
98
|
+
injectString("da-DK", "Select all", "V\xE6lg alle");
|
|
99
|
+
injectString("de", "Select all", "Alle ausw\xE4hlen");
|
|
100
|
+
injectString("en", "Select all", "Select all");
|
|
101
|
+
injectString("es", "Select all", "Seleccionar todo");
|
|
102
|
+
injectString("fi-FI", "Select all", "Valitse kaikki");
|
|
103
|
+
injectString("fr", "Select all", "S\xE9lectionner tout");
|
|
104
|
+
injectString("fr-FR", "Select all", "S\xE9lectionner tout");
|
|
105
|
+
injectString("hu-HU", "Select all", "V\xE1laszd ki az \xF6sszeset.");
|
|
106
|
+
injectString("id", "Select all", "Pilih semua");
|
|
107
|
+
injectString("it", "Select all", "Selezionare tutto");
|
|
108
|
+
injectString("ja", "Select all", "\u3059\u3079\u3066\u9078\u629E");
|
|
109
|
+
injectString("ko-KR", "Select all", "\uBAA8\uB450 \uC120\uD0DD");
|
|
110
|
+
injectString("ms", "Select all", "Pilih semua");
|
|
111
|
+
injectString("nb-NO", "Select all", "Velg alle");
|
|
112
|
+
injectString("nl", "Select all", "Alles selecteren");
|
|
113
|
+
injectString("pl", "Select all", "Wybierz wszystko");
|
|
114
|
+
injectString("pt-BR", "Select all", "Selecionar tudo");
|
|
115
|
+
injectString("pt-PT", "Select all", "Selecionar tudo");
|
|
116
|
+
injectString("sk-SK", "Select all", "Vyber v\u0161etko.");
|
|
117
|
+
injectString("sv", "Select all", "V\xE4lj alla");
|
|
118
|
+
injectString("th", "Select all", "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14");
|
|
119
|
+
injectString("tr", "Select all", "T\xFCm\xFCn\xFC se\xE7");
|
|
120
|
+
injectString("zh-Hans", "Select all", "\u5168\u9009");
|
|
121
|
+
injectString("zh-TW", "Select all", "\u5168\u9078");
|
|
122
|
+
injectString("ro-RO", "Select all", "Selecta\u021Bi tot");
|
|
123
|
+
injectString("ar-SA", "Select all", "\u062A\u062D\u062F\u064A\u062F \u0627\u0644\u0643\u0644");
|
|
96
124
|
injectString("cs", "More", "V\xEDce");
|
|
97
125
|
injectString("da-DK", "More", "Mere");
|
|
98
126
|
injectString("de", "More", "Mehr");
|
|
@@ -125,8 +153,10 @@ export const BulkActions = ({
|
|
|
125
153
|
allSelected,
|
|
126
154
|
className,
|
|
127
155
|
onClearSelection,
|
|
156
|
+
onSelectAll,
|
|
128
157
|
gridType = DeviceType.Desktop,
|
|
129
|
-
children
|
|
158
|
+
children,
|
|
159
|
+
turnOffSelectAll
|
|
130
160
|
}) => {
|
|
131
161
|
var _a;
|
|
132
162
|
const {
|
|
@@ -170,7 +200,13 @@ export const BulkActions = ({
|
|
|
170
200
|
}), _jsx("span", {
|
|
171
201
|
className: "zen-bulk-actions__number-of-selected ellipsis",
|
|
172
202
|
children: text
|
|
173
|
-
}),
|
|
203
|
+
}), onSelectAll && !turnOffSelectAll ? _jsx(Button, {
|
|
204
|
+
type: "tertiary",
|
|
205
|
+
className: "zen-bulk-actions__select-all",
|
|
206
|
+
disabled: allSelected,
|
|
207
|
+
onClick: onSelectAll,
|
|
208
|
+
children: translate("Select all")
|
|
209
|
+
}) : null, _jsxs("div", {
|
|
174
210
|
className: "zen-bulk-actions__action-button-holder",
|
|
175
211
|
ref: buttonHolder,
|
|
176
212
|
children: [Children.map(visibleElements, element => cloneElement(element, {
|
|
@@ -108,12 +108,15 @@ export const DateInputInnerControlBlock = props => {
|
|
|
108
108
|
value: timePickerValue,
|
|
109
109
|
onChange: timeChangeHandler,
|
|
110
110
|
isMobileView: isMobileView,
|
|
111
|
-
fullWidth: true
|
|
111
|
+
fullWidth: true,
|
|
112
|
+
// eslint-disable-next-line
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
dataTimeId: id
|
|
112
115
|
}), isHasTimeError ? _jsx(FormFieldError, {
|
|
113
116
|
id: timeErrorId,
|
|
114
117
|
error: translate("The time must be set")
|
|
115
118
|
}) : null]
|
|
116
|
-
}) : null, [isActiveField, isHasTimeError,
|
|
119
|
+
}) : null, [selectTime, isActiveField, isHasTimeError, timePickerValue, timeChangeHandler, isMobileView, id, timeErrorId, translate]);
|
|
117
120
|
return _jsxs("div", {
|
|
118
121
|
className: classNames(["zen-date-input-inner__control-block", className || ""]),
|
|
119
122
|
children: [title ? _jsx("label", {
|
|
@@ -219,6 +219,7 @@ injectString("zh-Hans", "Previous", "\u524D\u4E00");
|
|
|
219
219
|
injectString("zh-TW", "Previous", "\u4E0A\u4E00\u500B");
|
|
220
220
|
injectString("ro-RO", "Previous", "\xCEnapoi");
|
|
221
221
|
injectString("ar-SA", "Previous", "\u0627\u0644\u0633\u0627\u0628\u0642");
|
|
222
|
+
injectString("en", "Previous date period", "Previous date period");
|
|
222
223
|
injectString("cs", "Next", "Dal\u0161\xED");
|
|
223
224
|
injectString("da-DK", "Next", "N\xE6ste");
|
|
224
225
|
injectString("de", "Next", "N\xE4chstes");
|
|
@@ -246,6 +247,7 @@ injectString("zh-Hans", "Next", "\u4E0B\u4E00\u4E2A");
|
|
|
246
247
|
injectString("zh-TW", "Next", "\u4E0B\u4E00\u6B65");
|
|
247
248
|
injectString("ro-RO", "Next", "\xCEnainte");
|
|
248
249
|
injectString("ar-SA", "Next", "\u0627\u0644\u062A\u0627\u0644\u064A");
|
|
250
|
+
injectString("en", "Next date period", "Next date period");
|
|
249
251
|
export const DateRangeRaw = props => {
|
|
250
252
|
var _a;
|
|
251
253
|
const {
|
|
@@ -693,6 +695,7 @@ export const DateRangeRaw = props => {
|
|
|
693
695
|
onClick: decreaseRange,
|
|
694
696
|
className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--left"]),
|
|
695
697
|
title: translate("Previous"),
|
|
698
|
+
"aria-label": translate("Previous date period"),
|
|
696
699
|
children: _jsx(IconChevronLeftSmall, {
|
|
697
700
|
size: isDrive || isMobile ? "huge" : "large"
|
|
698
701
|
})
|
|
@@ -702,6 +705,7 @@ export const DateRangeRaw = props => {
|
|
|
702
705
|
onClick: increaseRange,
|
|
703
706
|
className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--right"]),
|
|
704
707
|
title: translate("Next"),
|
|
708
|
+
"aria-label": translate("Next date period"),
|
|
705
709
|
children: _jsx(IconChevronRightSmall, {
|
|
706
710
|
size: isDrive || isMobile ? "huge" : "large"
|
|
707
711
|
})
|
|
@@ -709,4 +713,4 @@ export const DateRangeRaw = props => {
|
|
|
709
713
|
}) : chip ? chipTriggerComponent : popupTriggerComponent, isMobile ? memoizedMobileView : memoizedDesktopView]
|
|
710
714
|
});
|
|
711
715
|
};
|
|
712
|
-
export const TRANSLATIONS = ["Custom", "Date range", "Clear", "Cancel", "Apply", "Reset", "Today", "Next", "Previous", "Choose dates", "Date range not available", "Choose your date range", "Some of the dates you selected aren
|
|
716
|
+
export const TRANSLATIONS = ["Custom", "Date range", "Clear", "Cancel", "Apply", "Reset", "Today", "Next", "Previous", "Choose dates", "Date range not available", "Choose your date range", "Some of the dates you selected aren’t available. Please try a different range.", "Please select the dates you want to view.", "Previous date period", "Next date period"];
|
|
@@ -6,6 +6,7 @@ import { ButtonType } from "../../button/buttonType";
|
|
|
6
6
|
import { ButtonIconPosition, TextIconButton } from "../../textIconButton/textIconButton";
|
|
7
7
|
import { useLanguage } from "../../utils/localization/useLanguage";
|
|
8
8
|
import { IconSettings6 } from "../../icons/iconSettings6";
|
|
9
|
+
injectString("en", "Active filters: {}", "Active filters: {}");
|
|
9
10
|
injectString("cs", "Filters", "Filtry");
|
|
10
11
|
injectString("da-DK", "Filters", "Filtre");
|
|
11
12
|
injectString("de", "Filters", "Filter");
|
|
@@ -110,6 +111,7 @@ export const FiltersBarActions = ({
|
|
|
110
111
|
onClick: onShowAllFilters,
|
|
111
112
|
icon: IconSettings6,
|
|
112
113
|
iconPosition: ButtonIconPosition.Start,
|
|
114
|
+
"aria-label": selectedQuantityToDisplay && selectedQuantityToDisplay > 0 ? translate("Active filters: {}").replace("{}", selectedQuantityToDisplay.toString()) : translate("Filters"),
|
|
113
115
|
children: _jsxs("span", {
|
|
114
116
|
className: "zen-filters-toolbar__action-label",
|
|
115
117
|
children: [translate("Filters"), selectedQuantityToDisplay && selectedQuantityToDisplay > 0 ? _jsx("span", {
|
|
@@ -134,4 +136,4 @@ export const FiltersBarActions = ({
|
|
|
134
136
|
}) : null]
|
|
135
137
|
});
|
|
136
138
|
};
|
|
137
|
-
export const TRANSLATIONS = ["Filters", "Clear", "Search"];
|
|
139
|
+
export const TRANSLATIONS = ["Filters", "Clear", "Search", "Active filters: {}"];
|
|
@@ -33,7 +33,7 @@ export const handleCustomMenuWrapper = (reactNode, content, menuItems) => {
|
|
|
33
33
|
const el = createElement(Menu.Item, {
|
|
34
34
|
id: reactNode.props.id || menu.props.id,
|
|
35
35
|
key: reactNode.props.id || menu.props.id,
|
|
36
|
-
name: reactNode.props.name || "",
|
|
36
|
+
name: reactNode.props.name || menu.props.name || "",
|
|
37
37
|
disabled: reactNode.props.disabled || menu.props.disabled,
|
|
38
38
|
link: reactNode.props.link || menu.props.link,
|
|
39
39
|
target: reactNode.props.target || menu.props.target,
|
package/esm/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { type ICardButton, CardButton } from "./card/components/cardButton/cardB
|
|
|
20
20
|
export { type ICardToggle, CardToggle } from "./card/components/cardToggle/cardToggle";
|
|
21
21
|
export { type IContent, Content } from "./card/components/content";
|
|
22
22
|
export { type TCardStatus, Status } from "./card/components/status";
|
|
23
|
+
export { Title } from "./card/components/title";
|
|
23
24
|
export { TitleLink } from "./card/components/titleLink";
|
|
24
25
|
export { getDefaultFullWidthValue } from "./card/helpers/getDefaultFullWidthValue";
|
|
25
26
|
export { getIconFromStatus } from "./card/helpers/getIconFromStatus";
|
|
@@ -48,7 +49,7 @@ export { hexToRGBA } from "./commonHelpers/colorUtils";
|
|
|
48
49
|
export { type IEntityWithId } from "./commonHelpers/entity";
|
|
49
50
|
export { generateId } from "./commonHelpers/generateId";
|
|
50
51
|
export { DeviceType } from "./commonHelpers/hooks/deviceType";
|
|
51
|
-
export {
|
|
52
|
+
export { SSRProvider } from "./commonHelpers/hooks/ssrProvider";
|
|
52
53
|
export { useDebounce } from "./commonHelpers/hooks/useDebounce";
|
|
53
54
|
export { useDebouncedMemo } from "./commonHelpers/hooks/useDebouncedMemo";
|
|
54
55
|
export { useDeviceType } from "./commonHelpers/hooks/useDeviceType";
|
|
@@ -73,6 +74,8 @@ export { useDropdownState } from "./dropdown/useDropdownState";
|
|
|
73
74
|
export { type IEmptyState, EmptyState } from "./emptyState/emptyState";
|
|
74
75
|
export { type IFavoriteButton, FavoriteButton } from "./favoriteButton/favoriteButton";
|
|
75
76
|
export { FeedbackProvider } from "./feedbackProvider/feedbackProvider";
|
|
77
|
+
export { TemplateDownloadSection } from "./fileUpload/components/templateDownloadSection";
|
|
78
|
+
export { UploadedFilesSection } from "./fileUpload/components/uploadedFilesSection";
|
|
76
79
|
export { FileUpload } from "./fileUpload/fileUpload";
|
|
77
80
|
export { type IUploadedFile, type ITemplateDownload, type IFileUploadMeta, type IFileUpload } from "./fileUpload/fileUploadType";
|
|
78
81
|
export { type TFilterButton, type IFilterButton, FilterButton } from "./filterButton/filterButton";
|
|
@@ -748,7 +751,7 @@ export { type ITab, type ITabBar, TabBar } from "./tabBar/tabBar";
|
|
|
748
751
|
export { type ITabBarContent, TabBarContent } from "./tabBar/tabBarContent";
|
|
749
752
|
export { type ITableDetailPanel } from "./table/children/tableDetailPanel";
|
|
750
753
|
export { NestedData } from "./table/nested/nestedData";
|
|
751
|
-
export {
|
|
754
|
+
export { useNestedRows } from "./table/nested/useNestedRows";
|
|
752
755
|
export { type IListColumn, type TFeedResult, type IFeedExpandable, type ITable, type IListColumnWrapper, Table, getEmptySelection, ColumnSortDirection, getSortableValue, ActionsColumn, MainColumn, CheckboxColumn, ActionLinkColumn } from "./table/table";
|
|
753
756
|
export { type ITabElement, type ITabs, TabsDisplayName, Tabs } from "./tabs/tabs";
|
|
754
757
|
export { ButtonIconPosition, type TButtonIconPosition, type ITextIconButton, TextIconButton } from "./textIconButton/textIconButton";
|
|
@@ -757,7 +760,6 @@ export { type ITextInputRaw, TextInputRaw } from "./textInputRaw/textInputRaw";
|
|
|
757
760
|
export { type ITextarea, Textarea } from "./textarea/textarea";
|
|
758
761
|
export { type ITextareaRaw, TextareaRaw } from "./textareaRaw/textareaRaw";
|
|
759
762
|
export { type ITimePicker, type TTimePicker, TimePicker } from "./timePicker/timePicker";
|
|
760
|
-
export { Title } from "./title/title";
|
|
761
763
|
export { type IShowToast, useToast } from "./toast/hooks/useToast";
|
|
762
764
|
export { type IToast, Toast } from "./toast/toast";
|
|
763
765
|
export { type IToggleButton, type TToggleButton, ToggleButton } from "./toggleButton/toggleButton";
|
|
@@ -769,8 +771,6 @@ export { type TooltipSize, type TMobileView, Tooltip } from "./tooltip/tooltip";
|
|
|
769
771
|
export { type IAbortablePromiseOptions, type IAbortablePromiseConstructor, AbortablePromise } from "./utils/abortablePromise";
|
|
770
772
|
export { HeaderButtonsProvider } from "./utils/headerButtons/headerButtonsProvider";
|
|
771
773
|
export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelpers";
|
|
772
|
-
export { directionContext } from "./utils/localization/directionContext";
|
|
773
|
-
export { type TTextDirection, getTextDirection } from "./utils/localization/getTextDirection";
|
|
774
774
|
export { LanguageProvider } from "./utils/localization/languageProvider";
|
|
775
775
|
export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
|
|
776
776
|
export { useDirection } from "./utils/localization/useDirection";
|
package/esm/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { CardButton } from "./card/components/cardButton/cardButton";
|
|
|
21
21
|
export { CardToggle } from "./card/components/cardToggle/cardToggle";
|
|
22
22
|
export { Content } from "./card/components/content";
|
|
23
23
|
export { Status } from "./card/components/status";
|
|
24
|
+
export { Title } from "./card/components/title";
|
|
24
25
|
export { TitleLink } from "./card/components/titleLink";
|
|
25
26
|
export { getDefaultFullWidthValue } from "./card/helpers/getDefaultFullWidthValue";
|
|
26
27
|
export { getIconFromStatus } from "./card/helpers/getIconFromStatus";
|
|
@@ -48,7 +49,7 @@ export { classNames } from "./commonHelpers/classNames/classNames";
|
|
|
48
49
|
export { hexToRGBA } from "./commonHelpers/colorUtils";
|
|
49
50
|
export { generateId } from "./commonHelpers/generateId";
|
|
50
51
|
export { DeviceType } from "./commonHelpers/hooks/deviceType";
|
|
51
|
-
export {
|
|
52
|
+
export { SSRProvider } from "./commonHelpers/hooks/ssrProvider";
|
|
52
53
|
export { useDebounce } from "./commonHelpers/hooks/useDebounce";
|
|
53
54
|
export { useDebouncedMemo } from "./commonHelpers/hooks/useDebouncedMemo";
|
|
54
55
|
export { useDeviceType } from "./commonHelpers/hooks/useDeviceType";
|
|
@@ -72,6 +73,8 @@ export { useDropdownState } from "./dropdown/useDropdownState";
|
|
|
72
73
|
export { EmptyState } from "./emptyState/emptyState";
|
|
73
74
|
export { FavoriteButton } from "./favoriteButton/favoriteButton";
|
|
74
75
|
export { FeedbackProvider } from "./feedbackProvider/feedbackProvider";
|
|
76
|
+
export { TemplateDownloadSection } from "./fileUpload/components/templateDownloadSection";
|
|
77
|
+
export { UploadedFilesSection } from "./fileUpload/components/uploadedFilesSection";
|
|
75
78
|
export { FileUpload } from "./fileUpload/fileUpload";
|
|
76
79
|
export { FilterButton } from "./filterButton/filterButton";
|
|
77
80
|
export { FiltersChip } from "./filters/components/filtersChip";
|
|
@@ -733,7 +736,7 @@ export { SummaryTileBar, SummaryTileBarDisplayName } from "./summaryTileBar/summ
|
|
|
733
736
|
export { TabBar } from "./tabBar/tabBar";
|
|
734
737
|
export { TabBarContent } from "./tabBar/tabBarContent";
|
|
735
738
|
export { NestedData } from "./table/nested/nestedData";
|
|
736
|
-
export {
|
|
739
|
+
export { useNestedRows } from "./table/nested/useNestedRows";
|
|
737
740
|
export { Table, getEmptySelection, ColumnSortDirection, getSortableValue, ActionsColumn, MainColumn, CheckboxColumn, ActionLinkColumn } from "./table/table";
|
|
738
741
|
export { TabsDisplayName, Tabs } from "./tabs/tabs";
|
|
739
742
|
export { ButtonIconPosition, TextIconButton } from "./textIconButton/textIconButton";
|
|
@@ -742,7 +745,6 @@ export { TextInputRaw } from "./textInputRaw/textInputRaw";
|
|
|
742
745
|
export { Textarea } from "./textarea/textarea";
|
|
743
746
|
export { TextareaRaw } from "./textareaRaw/textareaRaw";
|
|
744
747
|
export { TimePicker } from "./timePicker/timePicker";
|
|
745
|
-
export { Title } from "./title/title";
|
|
746
748
|
export { useToast } from "./toast/hooks/useToast";
|
|
747
749
|
export { Toast } from "./toast/toast";
|
|
748
750
|
export { ToggleButton } from "./toggleButton/toggleButton";
|
|
@@ -753,8 +755,6 @@ export { Tooltip } from "./tooltip/tooltip";
|
|
|
753
755
|
export { AbortablePromise } from "./utils/abortablePromise";
|
|
754
756
|
export { HeaderButtonsProvider } from "./utils/headerButtons/headerButtonsProvider";
|
|
755
757
|
export { getNewFocusableItem, getFirstFocusableItem } from "./utils/keyboardHelpers";
|
|
756
|
-
export { directionContext } from "./utils/localization/directionContext";
|
|
757
|
-
export { getTextDirection } from "./utils/localization/getTextDirection";
|
|
758
758
|
export { LanguageProvider } from "./utils/localization/languageProvider";
|
|
759
759
|
export { dictionaries, injectString } from "./utils/localization/translationsDictionary";
|
|
760
760
|
export { useDirection } from "./utils/localization/useDirection";
|
|
@@ -6,7 +6,7 @@ import { ControlledMenu } from "../controlledMenu";
|
|
|
6
6
|
import { ControlledPopup } from "../../controlledPopup/controlledPopup";
|
|
7
7
|
import { PathContext } from "../contexts/pathContext";
|
|
8
8
|
import { classNames } from "../../commonHelpers/classNames/classNames";
|
|
9
|
-
import { generateId } from "../../commonHelpers/
|
|
9
|
+
import { generateId } from "../../commonHelpers/generateId";
|
|
10
10
|
import { MenuAlignmentContext } from "../../header/headerContext";
|
|
11
11
|
import { isSeparator } from "./menuSeparator";
|
|
12
12
|
export const isMenuItem = (element) => {
|
|
@@ -16,7 +16,7 @@ import { ControlledPopup } from "../controlledPopup/controlledPopup";
|
|
|
16
16
|
import { MobileSheet } from "../mobileSheet/mobileSheet";
|
|
17
17
|
import { DeviceType } from "../commonHelpers/hooks/deviceType";
|
|
18
18
|
import { useDeviceType } from "../commonHelpers/hooks/useDeviceType";
|
|
19
|
-
import { generateId } from "../commonHelpers/
|
|
19
|
+
import { generateId } from "../commonHelpers/generateId";
|
|
20
20
|
import { PathProvider } from "./contexts/pathProvider";
|
|
21
21
|
import { isSeparator, MenuSeparator } from "./components/menuSeparator";
|
|
22
22
|
import { FOCUSABLE_SELECTOR } from "../utils/focusableSelector";
|
package/esm/nav/nav.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Children, cloneElement, Fragment, useCallback, useEffect, useLayoutEffe
|
|
|
5
5
|
import { NavDivider } from "./navDivider/navDivider";
|
|
6
6
|
import { detectOverlayScrollbar, filterPrimaryNavItems, collectNavItems } from "./utils/navUtils";
|
|
7
7
|
import { useResize } from "../commonHelpers/hooks/useResize";
|
|
8
|
-
import {
|
|
8
|
+
import { usePortal } from "../commonHelpers/hooks/usePortal";
|
|
9
9
|
import { NavMobileBar } from "./navMobileBar/navMobileBar";
|
|
10
10
|
import { useMobile } from "../commonHelpers/hooks/useMobile";
|
|
11
11
|
import { FOCUSABLE_SELECTOR } from "../utils/focusableSelector";
|
|
@@ -132,6 +132,7 @@ export const Nav = ({ children, className, collapsed = false, onCollapseToggle,
|
|
|
132
132
|
useEffect(() => {
|
|
133
133
|
onMenuVisibilityToggle === null || onMenuVisibilityToggle === void 0 ? void 0 : onMenuVisibilityToggle(!isMobile || isMobileMenuOpen);
|
|
134
134
|
}, [isMobile, isMobileMenuOpen, onMenuVisibilityToggle]);
|
|
135
|
+
const navMobileBarPortal = usePortal(_jsx(NavMobileBar, { onMenuToggle: onMobileMenuToggle, isMenuOpen: isMobileMenuOpen, children: isEditState ? editListItems : primaryItems }), mobileBarContainer !== null && mobileBarContainer !== void 0 ? mobileBarContainer : undefined);
|
|
135
136
|
return (_jsxs(NavContext, { value: {
|
|
136
137
|
collapsed,
|
|
137
138
|
onCollapseToggle,
|
|
@@ -142,13 +143,17 @@ export const Nav = ({ children, className, collapsed = false, onCollapseToggle,
|
|
|
142
143
|
searchTerm,
|
|
143
144
|
onSearch: setSearchTerm,
|
|
144
145
|
onNavigate: () => onIsMobileMenuOpenToggle && onIsMobileMenuOpenToggle(false)
|
|
145
|
-
}, children: [!isMobile || isMobileMenuOpen ? (_jsxs("div", { ref: menuRef, className: classNames([
|
|
146
|
+
}, children: [!isMobile || isMobileMenuOpen ? (_jsxs("div", { ref: menuRef, className: classNames([
|
|
147
|
+
"zen-nav",
|
|
148
|
+
isMobile ? "zen-nav--mobile" : "",
|
|
149
|
+
isMobile && isEditState ? "zen-nav--mobile-edit" : "",
|
|
150
|
+
collapsed ? "zen-nav--collapsed" : "",
|
|
151
|
+
className || ""
|
|
152
|
+
]), children: [header
|
|
146
153
|
? cloneElement(header, Object.assign(Object.assign({}, header.props), { className: classNames(["zen-nav__header", header.props.className || ""]) }))
|
|
147
154
|
: null, _jsx(NavContent, { children: isEditState
|
|
148
155
|
? editListItems
|
|
149
156
|
: sectionsToRender.map((section, index) => (_jsxs(Fragment, { children: [cloneElement(section, {
|
|
150
157
|
className: classNames(["zen-nav__section", section.props.className || ""])
|
|
151
|
-
}), isMobile || index < sectionsToRender.length - 1 ? _jsx(NavDivider, {}) : null] }, index))) }), footerToRender] })) : null, mobileBarContainer &&
|
|
152
|
-
isMobile &&
|
|
153
|
-
createPortal(_jsx(NavMobileBar, { onMenuToggle: onMobileMenuToggle, isMenuOpen: isMobileMenuOpen, children: isEditState ? editListItems : primaryItems }), mobileBarContainer)] }));
|
|
158
|
+
}), isMobile || index < sectionsToRender.length - 1 ? _jsx(NavDivider, {}) : null] }, index))) }), footerToRender] })) : null, mobileBarContainer && isMobile && navMobileBarPortal] }));
|
|
154
159
|
};
|
|
@@ -147,6 +147,6 @@ export const SelectRaw = (props) => {
|
|
|
147
147
|
"zen-ellipsis",
|
|
148
148
|
"zen-caption__content",
|
|
149
149
|
!selectValue ? "zen-select__text--placeholder" : ""
|
|
150
|
-
]), children: text }), _jsx(IconChevronDownSmall, { className: "zen-select__arrow zen-caption__post-content", size: "large" })] }), _jsx(Absolute, { recalculateOnScroll: true, className: classNames(["zen-select__popup", classNamePopup || ""]), triggerRef: innerTriggerRef, id: popupId, isOpen: isOpen, onOpenChange: onPopupVisibilityChange, children: _jsx(PassiveSelectListComp, { id: listId, title: title, disabled: disabled, multiselect: false, items: items.map(item => (Object.assign(Object.assign({}, item), { state: selectValue === item.id ? CheckboxState.On : CheckboxState.Off }))), value: new Map(items.map(item => [item.id, selectValue === item.id ? CheckboxState.On : CheckboxState.Off])), activeIndex: state.activeIndex, size: pageSize, onChangeItem: onChangeItem, style: { width, minWidth, maxWidth } }) })] }));
|
|
150
|
+
]), children: text }), _jsx(IconChevronDownSmall, { className: "zen-select__arrow zen-caption__post-content", size: "large" })] }), _jsx(Absolute, { recalculateOnScroll: true, className: classNames(["zen-select__popup", classNamePopup || ""]), triggerRef: innerTriggerRef, id: popupId, isOpen: isOpen, onOpenChange: onPopupVisibilityChange, focusOnOpen: false, children: _jsx(PassiveSelectListComp, { id: listId, title: title, disabled: disabled, multiselect: false, items: items.map(item => (Object.assign(Object.assign({}, item), { state: selectValue === item.id ? CheckboxState.On : CheckboxState.Off }))), value: new Map(items.map(item => [item.id, selectValue === item.id ? CheckboxState.On : CheckboxState.Off])), activeIndex: state.activeIndex, size: pageSize, onChangeItem: onChangeItem, style: { width, minWidth, maxWidth } }) })] }));
|
|
151
151
|
};
|
|
152
152
|
SelectRaw.displayName = "SelectRaw";
|
package/esm/shield/shield.js
CHANGED
|
@@ -2,16 +2,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
4
4
|
import { useFadeComponent } from "../utils/useFadeComponent";
|
|
5
|
-
import {
|
|
5
|
+
import { usePortal } from "../commonHelpers/hooks/usePortal";
|
|
6
6
|
import { zen } from "../utils/zen";
|
|
7
7
|
export const Shield = ({ className, dataShieldId, isVisible }) => {
|
|
8
|
-
var _a, _b;
|
|
8
|
+
var _a, _b, _c, _d;
|
|
9
9
|
const { renderComponent, showContent, setIsOpen, handleTransitionEnd } = useFadeComponent(isVisible || false);
|
|
10
|
+
const container = (_d = (_b = (_a = zen.document) === null || _a === void 0 ? void 0 : _a.fullscreenElement) !== null && _b !== void 0 ? _b : (_c = zen.document) === null || _c === void 0 ? void 0 : _c.body) !== null && _d !== void 0 ? _d : undefined;
|
|
11
|
+
const portal = usePortal(_jsx("div", { onTransitionEnd: handleTransitionEnd, className: classNames(["zen-shield", "zen-shield-faded", showContent ? "zen-shield-faded--visible" : "", className !== null && className !== void 0 ? className : ""]), "data-shield-id": dataShieldId || "" }), container);
|
|
10
12
|
useEffect(() => {
|
|
11
13
|
setIsOpen(isVisible || false);
|
|
12
14
|
}, [isVisible, setIsOpen]);
|
|
13
15
|
if (!renderComponent && !isVisible) {
|
|
14
16
|
return isVisible === undefined ? (_jsx("div", { className: classNames(["zen-shield", className !== null && className !== void 0 ? className : ""]), "data-shield-id": dataShieldId || "" })) : null;
|
|
15
17
|
}
|
|
16
|
-
return
|
|
18
|
+
return portal;
|
|
17
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, RefObject } from "react";
|
|
2
|
-
export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
|
|
2
|
+
export declare const useTableChildren: (children: ReactNode, isMobile: boolean, selected: number, allSelected: boolean, clearSelection: () => void, selectAll: () => void, turnOffSelectAll?: boolean, activeId?: string, gridRef?: RefObject<HTMLElement | null>, onCloseDetailPanel?: () => void) => {
|
|
3
3
|
bulkActions: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
4
4
|
pagination: ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
5
5
|
activePage: number | undefined;
|
|
@@ -24,7 +24,7 @@ const isChildElement = function (child, expectedType) {
|
|
|
24
24
|
}
|
|
25
25
|
return false;
|
|
26
26
|
};
|
|
27
|
-
export const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, activeId, gridRef, onCloseDetailPanel) => useMemo(() => {
|
|
27
|
+
export const useTableChildren = (children, isMobile, selected, allSelected, clearSelection, selectAll, turnOffSelectAll, activeId, gridRef, onCloseDetailPanel) => useMemo(() => {
|
|
28
28
|
let bulkActions = undefined;
|
|
29
29
|
let tablePagination = undefined;
|
|
30
30
|
let activePage = undefined;
|
|
@@ -39,7 +39,7 @@ export const useTableChildren = (children, isMobile, selected, allSelected, clea
|
|
|
39
39
|
}
|
|
40
40
|
if (isChildElement(child, TableBulkActions.displayName)) {
|
|
41
41
|
const bulkActionButtons = child.props.children || [];
|
|
42
|
-
bulkActions = (_jsx(BulkActions, { gridType: isMobile ? DeviceType.Mobile : DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, children: bulkActionButtons }));
|
|
42
|
+
bulkActions = (_jsx(BulkActions, { gridType: isMobile ? DeviceType.Mobile : DeviceType.Desktop, selected: selected, allSelected: allSelected, onClearSelection: clearSelection, onSelectAll: selectAll, turnOffSelectAll: turnOffSelectAll, children: bulkActionButtons }));
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
if (isChildElement(child, TablePagination.displayName)) {
|
|
@@ -100,4 +100,4 @@ export const useTableChildren = (children, isMobile, selected, allSelected, clea
|
|
|
100
100
|
detailPanel: detailPanel,
|
|
101
101
|
other: other
|
|
102
102
|
};
|
|
103
|
-
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, activeId, onCloseDetailPanel]);
|
|
103
|
+
}, [children, clearSelection, isMobile, selected, gridRef, allSelected, selectAll, turnOffSelectAll, activeId, onCloseDetailPanel]);
|
|
@@ -16,14 +16,6 @@ export interface ISelectableRowsOptions<T extends IRowEntity<N>, N extends IEnti
|
|
|
16
16
|
checkboxTitle?: (entity: T | N) => string;
|
|
17
17
|
headerTitle?: (state: SelectionState) => string;
|
|
18
18
|
turnOffSelectAll?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* When `true`, the header checkbox emits the current page's IDs instead of `{ all: true }`.
|
|
21
|
-
* When `undefined`, falls back to `turnOffSelectAll` for backward compatibility.
|
|
22
|
-
*
|
|
23
|
-
* Note: avoid setting this to `false` alongside `turnOffSelectAll: true` — the checkbox
|
|
24
|
-
* will emit `{ all: true }` while the dropdown hides the "Select all" option, which is inconsistent.
|
|
25
|
-
*/
|
|
26
|
-
checkboxSelectsCurrentPage?: boolean;
|
|
27
19
|
checkboxPlaceholder?: boolean;
|
|
28
20
|
strategy?: TSelectionStrategy;
|
|
29
21
|
selectAll?: boolean;
|
|
@@ -157,6 +157,7 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
159
|
const newSelections = getCurrentPageSelection(entities, selectable);
|
|
160
|
+
setState(newState);
|
|
160
161
|
const newValue = {
|
|
161
162
|
selected: [...newSelections],
|
|
162
163
|
all: false
|
|
@@ -175,16 +176,8 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
175
176
|
return translate("Deselect all");
|
|
176
177
|
}, [selectable, selectableState, state, translate]);
|
|
177
178
|
const isEntityChecked = useCallback((entity, isNested) => isRowChecked(selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy, entity, isNested), [selections, state, selectable === null || selectable === void 0 ? void 0 : selectable.strategy]);
|
|
178
|
-
const hasSelectable = !!selectable;
|
|
179
|
-
const selectableCheckboxSelectsCurrentPage = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxSelectsCurrentPage;
|
|
180
|
-
const selectableTurnOffSelectAll = selectable === null || selectable === void 0 ? void 0 : selectable.turnOffSelectAll;
|
|
181
|
-
const selectableCheckboxInHeader = selectable === null || selectable === void 0 ? void 0 : selectable.checkboxInHeader;
|
|
182
|
-
const selectableSelectionLimit = selectable === null || selectable === void 0 ? void 0 : selectable.selectionLimit;
|
|
183
|
-
const selectableHeader = selectable === null || selectable === void 0 ? void 0 : selectable.header;
|
|
184
|
-
const checkboxEmitsCurrentPage = selectableCheckboxSelectsCurrentPage !== null && selectableCheckboxSelectsCurrentPage !== void 0 ? selectableCheckboxSelectsCurrentPage : selectableTurnOffSelectAll;
|
|
185
|
-
const checkboxInHeaderValue = selectableCheckboxInHeader !== undefined ? selectableCheckboxInHeader : selectableSelectionLimit !== undefined ? false : undefined;
|
|
186
179
|
const wrapper = useMemo(() => {
|
|
187
|
-
if (!
|
|
180
|
+
if (!selectable) {
|
|
188
181
|
return null;
|
|
189
182
|
}
|
|
190
183
|
return {
|
|
@@ -226,23 +219,23 @@ export const useSelectableRows = (columns, entities, isMobile, selectMode, setSe
|
|
|
226
219
|
checked: state === SelectionState.CurrentPage || state === SelectionState.All,
|
|
227
220
|
indeterminate: state === SelectionState.Partial,
|
|
228
221
|
onChange: newValue => {
|
|
229
|
-
const newState = newValue ?
|
|
222
|
+
const newState = newValue ? selectable.turnOffSelectAll ? SelectionState.CurrentPage : SelectionState.All : SelectionState.None;
|
|
230
223
|
setState(newState);
|
|
231
224
|
onChangeSelectionState(newState);
|
|
232
225
|
},
|
|
233
226
|
calculateSelectionState: () => selectableState,
|
|
234
|
-
checkboxInHeader:
|
|
235
|
-
header:
|
|
227
|
+
checkboxInHeader: selectable.checkboxInHeader !== undefined ? selectable.checkboxInHeader : selectable.selectionLimit !== undefined ? false : undefined,
|
|
228
|
+
header: selectable.header,
|
|
236
229
|
onSelect: newState => {
|
|
237
230
|
setState(newState);
|
|
238
231
|
onChangeSelectionState(newState);
|
|
239
232
|
},
|
|
240
|
-
turnOffSelectAll:
|
|
233
|
+
turnOffSelectAll: selectable.turnOffSelectAll
|
|
241
234
|
});
|
|
242
235
|
return cell;
|
|
243
236
|
}
|
|
244
237
|
};
|
|
245
|
-
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener,
|
|
238
|
+
}, [checkboxDisabled, checkboxTitle, checkboxVisible, headerTitle, onChangeSelectionState, onSelectListener, selectable, selectableState, state, isMobile, checkboxPlaceholder, isEntityChecked]);
|
|
246
239
|
const selectableFeedWrapper = useCallback((primaryData, secondaryData, entity, isNested) => {
|
|
247
240
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
248
241
|
if (!entity) {
|
package/esm/table/table.js
CHANGED
|
@@ -175,6 +175,12 @@ const TableInner = ({
|
|
|
175
175
|
selected: []
|
|
176
176
|
});
|
|
177
177
|
}, [selectable]);
|
|
178
|
+
const selectAll = useCallback(() => {
|
|
179
|
+
selectable === null || selectable === void 0 ? void 0 : selectable.onSelect({
|
|
180
|
+
all: true,
|
|
181
|
+
selected: []
|
|
182
|
+
});
|
|
183
|
+
}, [selectable]);
|
|
178
184
|
const [activeIdInternal, setActiveInternal] = useState(undefined);
|
|
179
185
|
const activeId = active !== undefined ? active : activeIdInternal;
|
|
180
186
|
const onClickInternal = useCallback(id => setActiveInternal(id === activeIdInternal ? undefined : id), [activeIdInternal, setActiveInternal]);
|
|
@@ -191,7 +197,7 @@ const TableInner = ({
|
|
|
191
197
|
detailPanel,
|
|
192
198
|
footer,
|
|
193
199
|
other
|
|
194
|
-
} = useTableChildren(children, isMobile, selectionQty, ((_c = selectable === null || selectable === void 0 ? void 0 : selectable.selection) === null || _c === void 0 ? void 0 : _c.all) || false, clearSelection, activeId, gridRef, onCloseDetailPanel);
|
|
200
|
+
} = 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);
|
|
195
201
|
const hasDetailPanel = !!detailPanel;
|
|
196
202
|
const shouldEnableRowClick = hasDetailPanel || !!onClick;
|
|
197
203
|
const activeIdForRow = shouldEnableRowClick ? activeId : undefined;
|
package/esm/tooltip/tooltip.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ interface ITooltip extends IZenComponentProps {
|
|
|
10
10
|
}>;
|
|
11
11
|
alignment?: TAlignment;
|
|
12
12
|
triggerClassName?: string;
|
|
13
|
+
triggerAriaLabel?: string;
|
|
13
14
|
mobileTitle?: string;
|
|
14
15
|
/**
|
|
15
16
|
* @deprecated
|
|
@@ -32,5 +33,5 @@ interface ITooltip extends IZenComponentProps {
|
|
|
32
33
|
*/
|
|
33
34
|
mobileSheetTitle?: ReactElement | string;
|
|
34
35
|
}
|
|
35
|
-
export declare const Tooltip: ({ trigger, triggerClassName, className, alignment, children, mobileSheetTitle, mobileTitle }: ITooltip) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const Tooltip: ({ trigger, triggerClassName, triggerAriaLabel, className, alignment, children, mobileSheetTitle, mobileTitle }: ITooltip) => import("react/jsx-runtime").JSX.Element;
|
|
36
37
|
export {};
|