@geotab/zenith 3.11.0-beta.0 → 3.11.0-beta.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 +3 -26
- package/dist/calendar/calendar.js +4 -7
- package/dist/card/components/title.js +1 -4
- package/dist/card/components/titleLink.js +2 -5
- package/dist/chart/barChart/getDefaultOptions.d.ts +1 -2
- package/dist/chart/barChart/getDefaultOptions.js +2 -5
- package/dist/chart/barChart.js +4 -6
- package/dist/chart/lineChart/getDefaultOptions.d.ts +1 -2
- package/dist/chart/lineChart/getDefaultOptions.js +2 -5
- package/dist/chart/lineChart.js +2 -4
- package/dist/checkboxListWithAction/checkboxListWithAction.js +1 -4
- package/dist/commonHelpers/arrowNavigation/components/arrowButton/arrowButton.js +1 -4
- package/dist/commonStyles/pillStyles/pillContent.less +14 -13
- package/dist/commonStyles/pillStyles/pillStyles.less +5 -4
- package/dist/commonStyles/pillStyles/pillTextContent.less +2 -2
- package/dist/commonStyles/typography/typography.less +19 -579
- package/dist/controlledPopup/controlledPopup.d.ts +0 -1
- package/dist/controlledPopup/controlledPopup.js +1 -3
- package/dist/dataGrid/cell/cell.d.ts +1 -2
- package/dist/dataGrid/cell/cell.js +2 -2
- package/dist/dataGrid/dataGrid.js +4 -7
- package/dist/dataGrid/listColumn.d.ts +0 -2
- package/dist/dataGrid/row/row.d.ts +1 -2
- package/dist/dataGrid/row/row.js +9 -13
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.js +1 -2
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +0 -4
- package/dist/dateRangeInner/dateRangeInner.js +2 -5
- package/dist/dateRangeRaw/dateRangeRaw.js +2 -5
- package/dist/dateRangeRaw/utils/parseLabel.js +1 -1
- package/dist/dropdownRaw/dropdownRaw.js +6 -12
- package/dist/fileUpload/components/dropZoneContent.js +100 -100
- package/dist/fileUpload/fileUpload.js +100 -100
- package/dist/filters/components/filtersSearchList.js +1 -4
- package/dist/filtersBar/filtersContainer/filtersContainer.js +61 -62
- package/dist/formStepperButtons/formStepperButtons.js +1 -4
- package/dist/groupsFilterRaw/groupsFilterAdjustmentState.js +1 -4
- package/dist/groupsFilterRaw/groupsFilterInitialState.js +1 -4
- package/dist/header/headerBack.js +1 -4
- package/dist/icons/iconAlignLeft.js +3 -1
- package/dist/icons/iconAlignmentLeft.js +3 -1
- package/dist/icons/iconAlignmentRight.js +3 -1
- package/dist/icons/iconArrowBottomLeft.js +3 -1
- package/dist/icons/iconArrowBottomRight.js +3 -1
- package/dist/icons/iconArrowLeftPath.js +3 -1
- package/dist/icons/iconArrowRight.js +3 -1
- package/dist/icons/iconArrowRightCircle.js +3 -1
- package/dist/icons/iconArrowRightPath.js +3 -1
- package/dist/icons/iconArrowTopLeft.js +3 -1
- package/dist/icons/iconArrowTopRight.js +3 -1
- package/dist/icons/iconChevronDoubleRight.js +3 -1
- package/dist/icons/iconChevronRight.js +3 -1
- package/dist/icons/iconChevronRightSmall.js +3 -1
- package/dist/icons/iconCornerDownLeft.js +3 -1
- package/dist/icons/iconCornerDownRight.js +3 -1
- package/dist/icons/iconCornerLeftDown.js +3 -1
- package/dist/icons/iconCornerLeftUp.js +3 -1
- package/dist/icons/iconCornerRightDown.js +3 -1
- package/dist/icons/iconCornerRightUp.js +3 -1
- package/dist/icons/iconCornerUpLeft.js +3 -1
- package/dist/icons/iconCornerUpRight.js +3 -1
- package/dist/index.css +2920 -3245
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/dist/lineChartMini/lineChartMini.js +3 -15
- package/dist/list/itemData/itemDataInternal.js +1 -4
- package/dist/list/listItem/listItem.js +1 -4
- package/dist/menu/components/controlledMenuList/controlledMenuList.js +1 -4
- package/dist/menu/components/menuButton.js +1 -4
- package/dist/menu/utils/useMenuItemCore.js +1 -4
- package/dist/nav/navItem/navItem.js +1 -4
- package/dist/pagination/paginationArrow.js +3 -10
- package/dist/radioGroupRaw/radioGroupRaw.js +1 -2
- package/dist/rangeRaw/rangeRaw.js +1 -0
- package/dist/selectList/selectList.helpers.d.ts +1 -1
- package/dist/selectList/selectList.helpers.js +4 -29
- package/dist/selectList/selectList.js +1 -3
- package/dist/selectList/selectList.reducer.js +2 -1
- package/dist/selectList/selectListItem.js +1 -4
- package/dist/sortControl/sortControl.js +4 -59
- package/dist/table/children/useTableChildren.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +3 -3
- package/dist/table/flexible/columnsList.js +2 -4
- package/dist/table/selectable/useSelectableRows.d.ts +0 -8
- package/dist/table/selectable/useSelectableRows.js +6 -14
- package/dist/table/table.js +7 -1
- package/dist/tabs/tabs.js +58 -60
- package/dist/tabs/tabsTestHelper.js +2 -2
- package/dist/timePickerRaw/timePickerRaw.js +1 -1
- package/dist/toggleButtonRaw/toggleButtonRaw.js +2 -5
- package/dist/utils/localization/translations/ar.json +1 -3
- package/dist/utils/localization/translations/cs.json +5 -9
- package/dist/utils/localization/translations/da-DK.json +5 -9
- package/dist/utils/localization/translations/de.json +5 -9
- package/dist/utils/localization/translations/en.json +1 -5
- package/dist/utils/localization/translations/es.json +5 -9
- package/dist/utils/localization/translations/fi-FI.json +5 -9
- package/dist/utils/localization/translations/fr-FR.json +5 -9
- package/dist/utils/localization/translations/fr.json +5 -9
- package/dist/utils/localization/translations/hu-HU.json +5 -9
- package/dist/utils/localization/translations/id.json +5 -9
- package/dist/utils/localization/translations/it.json +5 -9
- package/dist/utils/localization/translations/ja.json +5 -9
- package/dist/utils/localization/translations/ko-KR.json +5 -9
- package/dist/utils/localization/translations/ms.json +5 -9
- package/dist/utils/localization/translations/nb-NO.json +5 -9
- package/dist/utils/localization/translations/nl.json +5 -9
- package/dist/utils/localization/translations/pl.json +5 -9
- package/dist/utils/localization/translations/pt-BR.json +5 -9
- package/dist/utils/localization/translations/pt-PT.json +5 -9
- package/dist/utils/localization/translations/ro-RO.json +5 -9
- package/dist/utils/localization/translations/sk-SK.json +5 -9
- package/dist/utils/localization/translations/sv.json +5 -9
- package/dist/utils/localization/translations/th.json +5 -9
- package/dist/utils/localization/translations/tr.json +5 -9
- package/dist/utils/localization/translations/zh-Hans.json +5 -9
- package/dist/utils/localization/translations/zh-TW.json +5 -9
- package/dist/utils/positioningUtils/alignments.d.ts +2 -2
- package/dist/utils/positioningUtils/alignments.js +2 -2
- package/dist/utils/positioningUtils/calculatePosition.js +6 -4
- package/esm/calendar/calendar.js +4 -7
- package/esm/card/components/title.js +1 -4
- package/esm/card/components/titleLink.js +2 -5
- package/esm/chart/barChart/getDefaultOptions.d.ts +1 -2
- package/esm/chart/barChart/getDefaultOptions.js +2 -5
- package/esm/chart/barChart.js +4 -6
- package/esm/chart/lineChart/getDefaultOptions.d.ts +1 -2
- package/esm/chart/lineChart/getDefaultOptions.js +2 -5
- package/esm/chart/lineChart.js +2 -4
- package/esm/checkboxListWithAction/checkboxListWithAction.js +1 -4
- package/esm/commonHelpers/arrowNavigation/components/arrowButton/arrowButton.js +1 -4
- package/esm/controlledPopup/controlledPopup.d.ts +0 -1
- package/esm/controlledPopup/controlledPopup.js +1 -3
- package/esm/dataGrid/cell/cell.d.ts +1 -2
- package/esm/dataGrid/cell/cell.js +2 -2
- package/esm/dataGrid/dataGrid.js +4 -7
- package/esm/dataGrid/listColumn.d.ts +0 -2
- package/esm/dataGrid/row/row.d.ts +1 -2
- package/esm/dataGrid/row/row.js +9 -13
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsList.js +1 -2
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +0 -4
- package/esm/dateRangeInner/dateRangeInner.js +2 -5
- package/esm/dateRangeRaw/dateRangeRaw.js +2 -5
- package/esm/dateRangeRaw/utils/parseLabel.js +1 -1
- package/esm/dropdownRaw/dropdownRaw.js +6 -12
- package/esm/fileUpload/components/dropZoneContent.js +100 -100
- package/esm/fileUpload/fileUpload.js +100 -100
- package/esm/filters/components/filtersSearchList.js +1 -4
- package/esm/filtersBar/filtersContainer/filtersContainer.js +61 -62
- package/esm/formStepperButtons/formStepperButtons.js +1 -4
- package/esm/groupsFilterRaw/groupsFilterAdjustmentState.js +1 -4
- package/esm/groupsFilterRaw/groupsFilterInitialState.js +1 -4
- package/esm/header/headerBack.js +1 -4
- package/esm/icons/iconAlignLeft.js +3 -1
- package/esm/icons/iconAlignmentLeft.js +3 -1
- package/esm/icons/iconAlignmentRight.js +3 -1
- package/esm/icons/iconArrowBottomLeft.js +3 -1
- package/esm/icons/iconArrowBottomRight.js +3 -1
- package/esm/icons/iconArrowLeftPath.js +3 -1
- package/esm/icons/iconArrowRight.js +3 -1
- package/esm/icons/iconArrowRightCircle.js +3 -1
- package/esm/icons/iconArrowRightPath.js +3 -1
- package/esm/icons/iconArrowTopLeft.js +3 -1
- package/esm/icons/iconArrowTopRight.js +3 -1
- package/esm/icons/iconChevronDoubleRight.js +3 -1
- package/esm/icons/iconChevronRight.js +3 -1
- package/esm/icons/iconChevronRightSmall.js +3 -1
- package/esm/icons/iconCornerDownLeft.js +3 -1
- package/esm/icons/iconCornerDownRight.js +3 -1
- package/esm/icons/iconCornerLeftDown.js +3 -1
- package/esm/icons/iconCornerLeftUp.js +3 -1
- package/esm/icons/iconCornerRightDown.js +3 -1
- package/esm/icons/iconCornerRightUp.js +3 -1
- package/esm/icons/iconCornerUpLeft.js +3 -1
- package/esm/icons/iconCornerUpRight.js +3 -1
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -1
- package/esm/lineChartMini/lineChartMini.js +3 -15
- package/esm/list/itemData/itemDataInternal.js +1 -4
- package/esm/list/listItem/listItem.js +1 -4
- package/esm/menu/components/controlledMenuList/controlledMenuList.js +1 -4
- package/esm/menu/components/menuButton.js +1 -4
- package/esm/menu/utils/useMenuItemCore.js +1 -4
- package/esm/nav/navItem/navItem.js +1 -4
- package/esm/pagination/paginationArrow.js +3 -10
- package/esm/radioGroupRaw/radioGroupRaw.js +1 -2
- package/esm/rangeRaw/rangeRaw.js +1 -0
- package/esm/selectList/selectList.helpers.d.ts +1 -1
- package/esm/selectList/selectList.helpers.js +4 -29
- package/esm/selectList/selectList.js +1 -3
- package/esm/selectList/selectList.reducer.js +2 -1
- package/esm/selectList/selectListItem.js +1 -4
- package/esm/sortControl/sortControl.js +4 -59
- package/esm/table/children/useTableChildren.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +3 -3
- package/esm/table/flexible/columnsList.js +2 -4
- package/esm/table/selectable/useSelectableRows.d.ts +0 -8
- package/esm/table/selectable/useSelectableRows.js +6 -14
- package/esm/table/table.js +7 -1
- package/esm/tabs/tabs.js +58 -60
- package/esm/tabs/tabsTestHelper.js +2 -2
- package/esm/timePickerRaw/timePickerRaw.js +1 -1
- package/esm/toggleButtonRaw/toggleButtonRaw.js +2 -5
- package/esm/utils/localization/translations/ar.json +1 -3
- package/esm/utils/localization/translations/cs.json +5 -9
- package/esm/utils/localization/translations/da-DK.json +5 -9
- package/esm/utils/localization/translations/de.json +5 -9
- package/esm/utils/localization/translations/en.json +1 -5
- package/esm/utils/localization/translations/es.json +5 -9
- package/esm/utils/localization/translations/fi-FI.json +5 -9
- package/esm/utils/localization/translations/fr-FR.json +5 -9
- package/esm/utils/localization/translations/fr.json +5 -9
- package/esm/utils/localization/translations/hu-HU.json +5 -9
- package/esm/utils/localization/translations/id.json +5 -9
- package/esm/utils/localization/translations/it.json +5 -9
- package/esm/utils/localization/translations/ja.json +5 -9
- package/esm/utils/localization/translations/ko-KR.json +5 -9
- package/esm/utils/localization/translations/ms.json +5 -9
- package/esm/utils/localization/translations/nb-NO.json +5 -9
- package/esm/utils/localization/translations/nl.json +5 -9
- package/esm/utils/localization/translations/pl.json +5 -9
- package/esm/utils/localization/translations/pt-BR.json +5 -9
- package/esm/utils/localization/translations/pt-PT.json +5 -9
- package/esm/utils/localization/translations/ro-RO.json +5 -9
- package/esm/utils/localization/translations/sk-SK.json +5 -9
- package/esm/utils/localization/translations/sv.json +5 -9
- package/esm/utils/localization/translations/th.json +5 -9
- package/esm/utils/localization/translations/tr.json +5 -9
- package/esm/utils/localization/translations/zh-Hans.json +5 -9
- package/esm/utils/localization/translations/zh-TW.json +5 -9
- package/esm/utils/positioningUtils/alignments.d.ts +2 -2
- package/esm/utils/positioningUtils/alignments.js +2 -2
- package/esm/utils/positioningUtils/calculatePosition.js +6 -4
- package/package.json +122 -123
- package/dist/utils/localization/useDirectionalIcon.d.ts +0 -3
- package/dist/utils/localization/useDirectionalIcon.js +0 -9
- package/esm/testHelpers/mockAbsoluteAlignment.d.ts +0 -1
- package/esm/testHelpers/mockAbsoluteAlignment.js +0 -10
- package/esm/utils/localization/useDirectionalIcon.d.ts +0 -3
- package/esm/utils/localization/useDirectionalIcon.js +0 -5
|
@@ -4,8 +4,6 @@ import { Fragment, useCallback, useEffect, useId, useRef, useState } from "react
|
|
|
4
4
|
import { Checkbox } from "../checkbox/checkbox";
|
|
5
5
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
6
6
|
import { IconChevronRight } from "../icons/iconChevronRight";
|
|
7
|
-
import { IconChevronLeft } from "../icons/iconChevronLeft";
|
|
8
|
-
import { useDirectionalIcon } from "../utils/localization/useDirectionalIcon";
|
|
9
7
|
import { useLanguage } from "../utils/localization/useLanguage";
|
|
10
8
|
import { useDriveClassName } from "../utils/theme/useDriveClassName";
|
|
11
9
|
injectString("cs", "Number of selected child groups - {count}", "Po\u010Det vybran\xFDch pod\u0159\xEDzen\xFDch skupin\xA0\u2013 {count}");
|
|
@@ -129,7 +127,6 @@ export const CheckboxListWithAction = ({
|
|
|
129
127
|
translate
|
|
130
128
|
} = useLanguage();
|
|
131
129
|
const driveComponentClass = useDriveClassName("zen-checkbox-list-with-action");
|
|
132
|
-
const ChevronIcon = useDirectionalIcon(IconChevronRight, IconChevronLeft);
|
|
133
130
|
const listId = useId();
|
|
134
131
|
const checkboxId = `${listId}_check_list-item_`;
|
|
135
132
|
const navigationInstructionsId = `${listId}_navigation_instructions`;
|
|
@@ -364,7 +361,7 @@ export const CheckboxListWithAction = ({
|
|
|
364
361
|
})), _jsxs("div", Object.assign({
|
|
365
362
|
className: "zen-checkbox-list-with-action__label-info"
|
|
366
363
|
}, otherArgs, {
|
|
367
|
-
children: [getLabelColorInfo(option.color, option.isWithAction, option.partialChecked, otherArgs), option.isWithAction && _jsx(
|
|
364
|
+
children: [getLabelColorInfo(option.color, option.isWithAction, option.partialChecked, otherArgs), option.isWithAction && _jsx(IconChevronRight, {
|
|
368
365
|
size: "large"
|
|
369
366
|
})]
|
|
370
367
|
}))]
|
|
@@ -4,12 +4,9 @@ import { Button } from "../../../../button/button";
|
|
|
4
4
|
import { IconChevronLeft } from "../../../../icons/iconChevronLeft";
|
|
5
5
|
import { IconChevronRight } from "../../../../icons/iconChevronRight";
|
|
6
6
|
import { useDrive } from "../../../../utils/theme/useDrive";
|
|
7
|
-
import { useDirectionalIcon } from "../../../../utils/localization/useDirectionalIcon";
|
|
8
7
|
import { driveIconSize } from "../../../../svgIcon/svgIconSize";
|
|
9
8
|
export const ArrowNavButton = ({ value, isHidden, disabled, className, arrowButtonHandler, onMouseDown, onMouseUp }) => {
|
|
10
9
|
const isDrive = useDrive();
|
|
11
10
|
const iconSize = isDrive ? driveIconSize("large") : "large";
|
|
12
|
-
|
|
13
|
-
const RightIcon = useDirectionalIcon(IconChevronRight, IconChevronLeft);
|
|
14
|
-
return (_jsx(Button, { type: "tertiary-black", className: classNames(["zen-arrow-nav-button", isHidden ? "zen-arrow-nav-button--invisible" : "", className !== null && className !== void 0 ? className : ""]), "aria-label": value, disabled: disabled, onClick: arrowButtonHandler, "data-action": value, onMouseDown: onMouseDown, onMouseUp: onMouseUp, children: value === "left" ? (_jsx(LeftIcon, { size: iconSize, className: "zen-arrow-nav-button__icon" })) : (_jsx(RightIcon, { size: iconSize, className: "zen-arrow-nav-button__icon" })) }));
|
|
11
|
+
return (_jsx(Button, { type: "tertiary-black", className: classNames(["zen-arrow-nav-button", isHidden ? "zen-arrow-nav-button--invisible" : "", className !== null && className !== void 0 ? className : ""]), "aria-label": value, disabled: disabled, onClick: arrowButtonHandler, "data-action": value, onMouseDown: onMouseDown, onMouseUp: onMouseUp, children: value === "left" ? (_jsx(IconChevronLeft, { size: iconSize, className: "zen-arrow-nav-button__icon" })) : (_jsx(IconChevronRight, { size: iconSize, className: "zen-arrow-nav-button__icon" })) }));
|
|
15
12
|
};
|
|
@@ -9,7 +9,6 @@ import { TAlignment as TAlignmentAbsolute } from "../absolute/absolute";
|
|
|
9
9
|
export type TAlignment = "top" | "top-left" | "top-right" | "left" | "left-top" | "left-bottom" | "right" | "right-top" | "right-bottom" | "bottom" | "bottom-left" | "bottom-right";
|
|
10
10
|
export interface IControlledPopup extends IZenComponentProps {
|
|
11
11
|
triggerRef: RefObject<HTMLElement | null>;
|
|
12
|
-
/** Alignment of the popup relative to its trigger. Defaults to `"bottom-left"` (flips to `"bottom-right"` in RTL). */
|
|
13
12
|
alignment?: TAlignmentAbsolute;
|
|
14
13
|
id?: string;
|
|
15
14
|
className?: string;
|
|
@@ -3,12 +3,10 @@ import { useEffect, useId } from "react";
|
|
|
3
3
|
import { Absolute } from "../absolute/absolute";
|
|
4
4
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
5
5
|
import { useClientReady } from "../commonHelpers/hooks/useClientReady";
|
|
6
|
-
import { useRTLAlignment } from "../utils/localization/useRTLAlignment";
|
|
7
6
|
export const ControlledPopup = ({ isOpen, id, paddingX, paddingY, triggerRef, className, children, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, ariaLabel, ariaLabelledby, recalculateOnScroll, closeOnScroll, preventAttributesAutoSet, focusOnOpen, role = "dialog" }) => {
|
|
8
7
|
const autoId = useId();
|
|
9
8
|
const popupId = id || autoId;
|
|
10
9
|
const isClientReady = useClientReady();
|
|
11
|
-
const rtlAlignment = useRTLAlignment(alignment !== null && alignment !== void 0 ? alignment : "bottom-left");
|
|
12
10
|
useEffect(() => {
|
|
13
11
|
if (!triggerRef.current || !isClientReady) {
|
|
14
12
|
return;
|
|
@@ -23,5 +21,5 @@ export const ControlledPopup = ({ isOpen, id, paddingX, paddingY, triggerRef, cl
|
|
|
23
21
|
triggerRef.current.setAttribute("aria-expanded", isOpen ? "true" : "false");
|
|
24
22
|
triggerRef.current.setAttribute("aria-controls", popupId);
|
|
25
23
|
}, [triggerRef, isOpen, popupId, preventAttributesAutoSet, isClientReady]);
|
|
26
|
-
return (_jsx(Absolute, Object.assign({ triggerRef: triggerRef, alignment:
|
|
24
|
+
return (_jsx(Absolute, Object.assign({ triggerRef: triggerRef, alignment: alignment, id: popupId, isOpen: isOpen, className: classNames(["zen-popup", className ? className : ""]), paddingX: paddingX, paddingY: paddingY, inline: inline, onOpenChange: onOpenChange, useTrapFocusWithTrigger: useTrapFocusWithTrigger, shouldHoldScroll: shouldHoldScroll }, (role !== false && typeof role === "string" ? { role } : {}), (role !== false && ariaLabel ? { ariaLabel } : {}), (role !== false && ariaLabelledby ? { ariaLabelledby } : {}), { recalculateOnScroll: recalculateOnScroll, closeOnScroll: closeOnScroll, focusOnOpen: focusOnOpen, children: children })));
|
|
27
25
|
};
|
|
@@ -13,9 +13,8 @@ export interface IDataGridCell<T extends IEntityWithId> extends IZenComponentPro
|
|
|
13
13
|
defaultValue: string | undefined;
|
|
14
14
|
entity: T;
|
|
15
15
|
width?: number;
|
|
16
|
-
maxWidth?: number;
|
|
17
16
|
colspan?: number;
|
|
18
17
|
onClick?: () => void;
|
|
19
18
|
isActive?: boolean;
|
|
20
19
|
}
|
|
21
|
-
export declare const DataGridCell: <T extends IEntityWithId>({ index, limited, visibleOnHover, isVisible, width,
|
|
20
|
+
export declare const DataGridCell: <T extends IEntityWithId>({ index, limited, visibleOnHover, isVisible, width, render, renderWrappers, renderPlaceholder, defaultValue, entity, colspan, className, onClick, isActive }: IDataGridCell<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { classNames } from "../../commonHelpers/classNames/classNames";
|
|
|
4
4
|
import { isPromiseLike } from "../columns/basicColumn";
|
|
5
5
|
import { isActiveElement } from "../../list/utils/isActiveElement";
|
|
6
6
|
import { zen } from "../../utils/zen";
|
|
7
|
-
const Cell = ({ index, limited, visibleOnHover, isVisible, width,
|
|
7
|
+
const Cell = ({ index, limited, visibleOnHover, isVisible, width, render, renderWrappers, renderPlaceholder, defaultValue, entity, colspan, className, onClick, isActive }) => {
|
|
8
8
|
const [content, setContent] = useState("");
|
|
9
9
|
const placeholderRenderer = useCallback(() => {
|
|
10
10
|
const renderFn = renderPlaceholder || (() => "...");
|
|
@@ -69,6 +69,6 @@ const Cell = ({ index, limited, visibleOnHover, isVisible, width, maxWidth, rend
|
|
|
69
69
|
visibleOnHover ? "zen-data-grid__row-cell--visible-on-hover" : "",
|
|
70
70
|
onClick ? "zen-data-grid__row-cell--clickable" : "",
|
|
71
71
|
limited ? "zen-ellipsis" : ""
|
|
72
|
-
]), style: { minWidth: width || "auto", maxWidth:
|
|
72
|
+
]), style: { minWidth: width || "auto", maxWidth: width || "auto" }, role: "gridcell", children: content }));
|
|
73
73
|
};
|
|
74
74
|
export const DataGridCell = memo(Cell);
|
package/esm/dataGrid/dataGrid.js
CHANGED
|
@@ -49,7 +49,7 @@ const getHeaderPropsFromWrappers = wrappers => wrappers.reduce((result, wrapper)
|
|
|
49
49
|
const props = (_a = wrapper.getHeaderProps) === null || _a === void 0 ? void 0 : _a.call(wrapper);
|
|
50
50
|
return props ? Object.assign(Object.assign({}, result), props) : result;
|
|
51
51
|
}, {});
|
|
52
|
-
const getColumnWidth =
|
|
52
|
+
const getColumnWidth = defaultWidth => Math.floor(Math.max(defaultWidth, MIN_CELL_WIDTH));
|
|
53
53
|
export const EmptyList = ({
|
|
54
54
|
children
|
|
55
55
|
}) => _jsx("div", {
|
|
@@ -144,13 +144,12 @@ const DataGridInner = ({
|
|
|
144
144
|
setVisibleRows(visible);
|
|
145
145
|
}, [entities]);
|
|
146
146
|
const listOfDefaultWidthColumns = useMemo(() => columnsList.map(column => column.meta.defaultWidth), [columnsList]);
|
|
147
|
-
const listOfMinWidthColumns = useMemo(() => columnsList.map(column => column.meta.minWidth), [columnsList]);
|
|
148
147
|
const {
|
|
149
148
|
result: observerResult
|
|
150
149
|
} = useResizeObserver({
|
|
151
150
|
target: gridRef.current
|
|
152
151
|
});
|
|
153
|
-
const allocatedSpace = listOfDefaultWidthColumns.reduce((acc, width
|
|
152
|
+
const allocatedSpace = listOfDefaultWidthColumns.reduce((acc, width) => acc + (width === undefined ? 0 : getColumnWidth(width)), 0);
|
|
154
153
|
const unallocatedSpace = observerResult && observerResult.contentRect.width - allocatedSpace || 0;
|
|
155
154
|
const flexibleColumnsQty = listOfDefaultWidthColumns.filter(width => width === undefined).length;
|
|
156
155
|
const flexibleColumnWidth = getColumnWidth(unallocatedSpace / flexibleColumnsQty);
|
|
@@ -173,19 +172,18 @@ const DataGridInner = ({
|
|
|
173
172
|
}, [updateScroll, scheduleLazyRender]);
|
|
174
173
|
const getCellParams = useCallback(columnIndex => {
|
|
175
174
|
const defaultWidth = listOfDefaultWidthColumns[columnIndex];
|
|
176
|
-
const minWidth = listOfMinWidthColumns[columnIndex];
|
|
177
175
|
const limited = !!defaultWidth && defaultWidth > 0;
|
|
178
176
|
const isFirst = columnIndex === 0;
|
|
179
177
|
const isLast = columnIndex === listOfDefaultWidthColumns.length - 1;
|
|
180
178
|
// If the column is the last one or doesn't have a default width, it should be limited to the remaining space
|
|
181
|
-
const width = getColumnWidth(defaultWidth || flexibleColumnWidth
|
|
179
|
+
const width = getColumnWidth(defaultWidth || flexibleColumnWidth);
|
|
182
180
|
return {
|
|
183
181
|
limited,
|
|
184
182
|
isFirst,
|
|
185
183
|
isLast,
|
|
186
184
|
width
|
|
187
185
|
};
|
|
188
|
-
}, [listOfDefaultWidthColumns,
|
|
186
|
+
}, [listOfDefaultWidthColumns, flexibleColumnWidth]);
|
|
189
187
|
const renderHeaderCell = useCallback((column, columnIndex) => {
|
|
190
188
|
var _a;
|
|
191
189
|
const {
|
|
@@ -224,7 +222,6 @@ const DataGridInner = ({
|
|
|
224
222
|
expanded: expandedRows && expandedRows.indexOf(entity.id) > -1,
|
|
225
223
|
onExpandedChange: entity.children && entity.children.length > 0 ? isExpanded => onExpandedChange && onExpandedChange(entity.id, isExpanded) : undefined,
|
|
226
224
|
isActive: active === entity.id,
|
|
227
|
-
active: active,
|
|
228
225
|
onClick: onClick,
|
|
229
226
|
isTreeGrid: isTreeGrid,
|
|
230
227
|
ariaPosinset: entityIndex + 1,
|
|
@@ -2,8 +2,6 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import { ColumnSortDirection } from "../table/table";
|
|
3
3
|
export interface IListColumnMeta<T, N = T> {
|
|
4
4
|
readonly defaultWidth?: number;
|
|
5
|
-
readonly minWidth?: number;
|
|
6
|
-
readonly maxWidth?: number;
|
|
7
5
|
readonly defaultValue?: string;
|
|
8
6
|
readonly lazyLoad?: boolean;
|
|
9
7
|
readonly visibleOnHover?: boolean;
|
|
@@ -16,8 +16,7 @@ export interface IDataGridRow<T extends IRowEntity<N>, N extends IEntityWithId>
|
|
|
16
16
|
ariaPosinset: number;
|
|
17
17
|
ariaSetsize: number;
|
|
18
18
|
isActive?: boolean;
|
|
19
|
-
active?: string;
|
|
20
19
|
onClick?: (id: string) => void;
|
|
21
20
|
}
|
|
22
21
|
export declare const MIN_CELL_WIDTH = 100;
|
|
23
|
-
export declare const DataGridRow: <T extends IRowEntity<N>, N extends IEntityWithId = T>({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow, className, expanded, onExpandedChange, isTreeGrid, ariaPosinset, ariaSetsize, onClick, isActive
|
|
22
|
+
export declare const DataGridRow: <T extends IRowEntity<N>, N extends IEntityWithId = T>({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow, className, expanded, onExpandedChange, isTreeGrid, ariaPosinset, ariaSetsize, onClick, isActive }: IDataGridRow<T, N>) => import("react/jsx-runtime").JSX.Element;
|
package/esm/dataGrid/row/row.js
CHANGED
|
@@ -3,12 +3,10 @@ import { memo, useCallback, useId, useMemo } from "react";
|
|
|
3
3
|
import { classNames } from "../../commonHelpers/classNames/classNames";
|
|
4
4
|
import { DataGridCell } from "../cell/cell";
|
|
5
5
|
export const MIN_CELL_WIDTH = 100;
|
|
6
|
-
const getColumnWidth = (defaultWidth
|
|
7
|
-
const Row = ({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow, className, expanded, onExpandedChange, isTreeGrid, ariaPosinset, ariaSetsize, onClick, isActive
|
|
6
|
+
const getColumnWidth = (defaultWidth) => Math.floor(Math.max(defaultWidth, MIN_CELL_WIDTH));
|
|
7
|
+
const Row = ({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow, className, expanded, onExpandedChange, isTreeGrid, ariaPosinset, ariaSetsize, onClick, isActive }) => {
|
|
8
8
|
const isVisible = visibleRows.has(entity.id);
|
|
9
9
|
const listOfDefaultWidthColumns = useMemo(() => columns.map(column => column.meta.defaultWidth), [columns]);
|
|
10
|
-
const listOfMinWidthColumns = useMemo(() => columns.map(column => column.meta.minWidth), [columns]);
|
|
11
|
-
const listOfMaxWidthColumns = useMemo(() => columns.map(column => column.meta.maxWidth), [columns]);
|
|
12
10
|
const getColWidth = useCallback((columnIndex, colspan) => {
|
|
13
11
|
const colsp = colspan || 1;
|
|
14
12
|
let columnWidth = 0;
|
|
@@ -17,28 +15,26 @@ const Row = ({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow,
|
|
|
17
15
|
continue;
|
|
18
16
|
}
|
|
19
17
|
const defaultWidth = listOfDefaultWidthColumns[columnIndex + i];
|
|
20
|
-
const minWidth = listOfMinWidthColumns[columnIndex + i];
|
|
21
18
|
// If the column is the last one or doesn't have a default width, it should be limited to the remaining space
|
|
22
|
-
const width = getColumnWidth(defaultWidth || flexibleColumnWidth
|
|
19
|
+
const width = getColumnWidth(defaultWidth || flexibleColumnWidth);
|
|
23
20
|
columnWidth += width;
|
|
24
21
|
}
|
|
25
22
|
return columnWidth;
|
|
26
|
-
}, [flexibleColumnWidth, listOfDefaultWidthColumns
|
|
23
|
+
}, [flexibleColumnWidth, listOfDefaultWidthColumns]);
|
|
27
24
|
const getCellParams = useCallback((columnIndex, colspan) => {
|
|
28
25
|
const width = getColWidth(columnIndex, colspan);
|
|
29
26
|
const defaultWidth = listOfDefaultWidthColumns[columnIndex];
|
|
30
|
-
const maxWidth = listOfMaxWidthColumns[columnIndex];
|
|
31
27
|
const limited = !!defaultWidth && defaultWidth > 0;
|
|
32
28
|
const isFirst = columnIndex === 0;
|
|
33
29
|
const isLast = columnIndex === listOfDefaultWidthColumns.length - 1;
|
|
34
|
-
return { limited, isFirst, isLast, width
|
|
35
|
-
}, [getColWidth, listOfDefaultWidthColumns
|
|
30
|
+
return { limited, isFirst, isLast, width };
|
|
31
|
+
}, [getColWidth, listOfDefaultWidthColumns]);
|
|
36
32
|
const mainRowId = useId();
|
|
37
33
|
const renderCells = useCallback((rowEntity, isNested) => columns.reduce((acc, column, index) => {
|
|
38
34
|
const colspanFn = column.colspan;
|
|
39
35
|
let colspan = colspanFn ? (typeof colspanFn === "function" ? colspanFn(rowEntity) : colspanFn) : undefined;
|
|
40
36
|
colspan = colspan && colspan > 1 ? colspan : undefined;
|
|
41
|
-
const { limited, width
|
|
37
|
+
const { limited, width } = getCellParams(index, colspan);
|
|
42
38
|
if (acc.colspan > 0) {
|
|
43
39
|
acc.colspan--;
|
|
44
40
|
return acc;
|
|
@@ -53,9 +49,9 @@ const Row = ({ id, entity, columns, visibleRows, flexibleColumnWidth, isLastRow,
|
|
|
53
49
|
? column.columnComponent.renderNested.bind(column.columnComponent)
|
|
54
50
|
: column.columnComponent.render.bind(column.columnComponent))
|
|
55
51
|
: column.columnComponent.render.bind(column.columnComponent);
|
|
56
|
-
acc.cells.push(_jsx(DataGridCell, { render: e => renderFn(e, isNested), renderPlaceholder: column.meta.renderPlaceholder, renderWrappers: renderWrappers, defaultValue: column.meta.defaultValue, entity: rowEntity, index: index, limited: limited, visibleOnHover: column.meta.visibleOnHover, width: column.meta.visibleOnHover ? 0 : width,
|
|
52
|
+
acc.cells.push(_jsx(DataGridCell, { render: e => renderFn(e, isNested), renderPlaceholder: column.meta.renderPlaceholder, renderWrappers: renderWrappers, defaultValue: column.meta.defaultValue, entity: rowEntity, index: index, limited: limited, visibleOnHover: column.meta.visibleOnHover, width: column.meta.visibleOnHover ? 0 : width, isVisible: isVisible, colspan: colspan, onClick: !isNested && onExpandedChange ? () => onExpandedChange(!expanded) : onClick ? () => onClick(rowEntity.id) : undefined, isActive: isActive, className: isNested ? "zen-data-grid__row-cell--nested" : "" }, `${rowEntity.id}_${column.name}`));
|
|
57
53
|
return acc;
|
|
58
|
-
}, { cells: [], colspan: 0 }).cells, [columns, expanded, getCellParams, isVisible, onExpandedChange, isActive,
|
|
54
|
+
}, { cells: [], colspan: 0 }).cells, [columns, expanded, getCellParams, isVisible, onExpandedChange, isActive, onClick]);
|
|
59
55
|
const cells = useMemo(() => renderCells(entity, false), [entity, renderCells]);
|
|
60
56
|
const nestedCells = useMemo(() => (expanded && entity.children ? entity.children : []).map(nestedEntity => renderCells(nestedEntity, true)), [entity.children, expanded, renderCells]);
|
|
61
57
|
return (_jsxs(_Fragment, { children: [_jsx("tr", { "data-row-id": id, id: mainRowId, role: "row", "aria-level": isTreeGrid ? 1 : undefined, "aria-posinset": isTreeGrid ? ariaPosinset : undefined, "aria-setsize": isTreeGrid ? ariaSetsize : undefined, "aria-expanded": isTreeGrid ? expanded : undefined, className: classNames(["zen-data-grid__row", className || "", isLastRow ? "zen-data-grid__row--last" : ""]), children: cells }, mainRowId), nestedCells.map((nestedRow, index) => (_jsx("tr", { id: `${mainRowId}_child_${index}`, role: "row", "aria-level": 2, "aria-posinset": index + 1, "aria-setsize": nestedCells.length, className: "zen-data-grid__row zen-data-grid__row--nested", children: nestedRow }, `${mainRowId}_child_${index}`)))] }));
|
|
@@ -18,7 +18,6 @@ const SubColumnsList = ({ title, columns, settings, disabledColumns, onChange, s
|
|
|
18
18
|
showCheckbox: true,
|
|
19
19
|
children: c.title
|
|
20
20
|
})), [columns, disabledColumns, sortColumnsInt]);
|
|
21
|
-
const allDisabled = useMemo(() => items.every(item => item.disabled), [items]);
|
|
22
21
|
const state = columns.reduce((res, c) => {
|
|
23
22
|
res.set(c.id, settings.get(c.name) !== false ? CheckboxState.On : CheckboxState.Off);
|
|
24
23
|
return res;
|
|
@@ -31,7 +30,7 @@ const SubColumnsList = ({ title, columns, settings, disabledColumns, onChange, s
|
|
|
31
30
|
});
|
|
32
31
|
onChange && onChange(newSettings);
|
|
33
32
|
}, [columns, settings, onChange]);
|
|
34
|
-
const list = useMemo(() =>
|
|
33
|
+
const list = useMemo(() => _jsx(SelectList, { id: id, items: items, value: state, title: title || "", multiselect: true, showCheckbox: true, onChange: onChangeItem }), [id, items, state, title, onChangeItem]);
|
|
35
34
|
if (!title) {
|
|
36
35
|
return list;
|
|
37
36
|
}
|
|
@@ -7,10 +7,6 @@ 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;
|
|
16
12
|
onSelectAll?: () => void;
|
|
@@ -6,8 +6,6 @@ import { useLanguage } from "../utils/localization/useLanguage";
|
|
|
6
6
|
import { userFormatContext } from "../utils/userFormat/userFormatContext";
|
|
7
7
|
import { deformatDate, formatDate } from "../utils/formatDate";
|
|
8
8
|
import { IconChevronRight } from "../icons/iconChevronRight";
|
|
9
|
-
import { IconChevronLeft } from "../icons/iconChevronLeft";
|
|
10
|
-
import { useDirectionalIcon } from "../utils/localization/useDirectionalIcon";
|
|
11
9
|
import { parseLabel } from "../dateRange/dateRange";
|
|
12
10
|
import { normalizeDates } from "../filtersBar/components/filtersBarPeriodPicker/normalizeDates";
|
|
13
11
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
@@ -62,7 +60,6 @@ export const DateRangeInner = ({
|
|
|
62
60
|
translate
|
|
63
61
|
} = useLanguage();
|
|
64
62
|
const isMobileView = !!setShowMobileCalendar;
|
|
65
|
-
const ChevronIcon = useDirectionalIcon(IconChevronRight, IconChevronLeft);
|
|
66
63
|
const {
|
|
67
64
|
dateFormat,
|
|
68
65
|
weekStartsOnSunday,
|
|
@@ -101,7 +98,7 @@ export const DateRangeInner = ({
|
|
|
101
98
|
}) : null]
|
|
102
99
|
}), _jsx("div", {
|
|
103
100
|
className: "zen-date-range-inner__mobile-custom-icon-wrapper",
|
|
104
|
-
children: _jsx(
|
|
101
|
+
children: _jsx(IconChevronRight, {
|
|
105
102
|
size: "large"
|
|
106
103
|
})
|
|
107
104
|
})]
|
|
@@ -122,7 +119,7 @@ export const DateRangeInner = ({
|
|
|
122
119
|
key: option.id
|
|
123
120
|
}));
|
|
124
121
|
return optionsToPass;
|
|
125
|
-
}, [
|
|
122
|
+
}, [calendarLabel, isMobileView, onOptionSelect, options, selection, setShowMobileCalendar]);
|
|
126
123
|
const calendarId = useMemo(() => `${id}-calendar`, [id]);
|
|
127
124
|
const optionSelectHandler = useCallback(e => {
|
|
128
125
|
let selectedValue = e.target.value;
|
|
@@ -21,7 +21,6 @@ import { areMapsEqual } from "./utils/areMapsEqual";
|
|
|
21
21
|
import { IconChevronLeftSmall } from "../icons/iconChevronLeftSmall";
|
|
22
22
|
import { useDrive } from "../utils/theme/useDrive";
|
|
23
23
|
import { IconChevronRightSmall } from "../icons/iconChevronRightSmall";
|
|
24
|
-
import { useDirectionalIcon } from "../utils/localization/useDirectionalIcon";
|
|
25
24
|
import { ReviewTextControl } from "../formGroup/components/reviewTextControl";
|
|
26
25
|
import { Chip } from "../chip/chip";
|
|
27
26
|
import { useChipStatus } from "../chip/chipStatusProvider";
|
|
@@ -291,8 +290,6 @@ export const DateRangeRaw = props => {
|
|
|
291
290
|
} = useLanguage();
|
|
292
291
|
const isMobile = useMobile();
|
|
293
292
|
const isDrive = useDrive();
|
|
294
|
-
const PrevStepperIcon = useDirectionalIcon(IconChevronLeftSmall, IconChevronRightSmall);
|
|
295
|
-
const NextStepperIcon = useDirectionalIcon(IconChevronRightSmall, IconChevronLeftSmall);
|
|
296
293
|
const chipStatus = useChipStatus();
|
|
297
294
|
const driveWrapperTriggerClassName = useDriveClassName("zen-date-range-wrapper");
|
|
298
295
|
const mobileWrapperTriggerClassName = useMobileClassName("zen-date-range-wrapper");
|
|
@@ -699,7 +696,7 @@ export const DateRangeRaw = props => {
|
|
|
699
696
|
className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--left"]),
|
|
700
697
|
title: translate("Previous"),
|
|
701
698
|
"aria-label": translate("Previous date period"),
|
|
702
|
-
children: _jsx(
|
|
699
|
+
children: _jsx(IconChevronLeftSmall, {
|
|
703
700
|
size: isDrive || isMobile ? "huge" : "large"
|
|
704
701
|
})
|
|
705
702
|
}), popupTriggerComponent, _jsx("button", {
|
|
@@ -709,7 +706,7 @@ export const DateRangeRaw = props => {
|
|
|
709
706
|
className: classNames(["zen-date-range__stepper", "zen-date-range__stepper--right"]),
|
|
710
707
|
title: translate("Next"),
|
|
711
708
|
"aria-label": translate("Next date period"),
|
|
712
|
-
children: _jsx(
|
|
709
|
+
children: _jsx(IconChevronRightSmall, {
|
|
713
710
|
size: isDrive || isMobile ? "huge" : "large"
|
|
714
711
|
})
|
|
715
712
|
})]
|
|
@@ -7,5 +7,5 @@ export const parseLabel = (option, dateFormat, translate, toLocalFn) => {
|
|
|
7
7
|
localeFrom.getFullYear() === localeTo.getFullYear()) {
|
|
8
8
|
return formatDate(localeFrom, dateFormat, translate);
|
|
9
9
|
}
|
|
10
|
-
return `${formatDate(localeFrom, dateFormat, translate)}
|
|
10
|
+
return `${formatDate(localeFrom, dateFormat, translate)} - ${formatDate(localeTo, dateFormat, translate)}`;
|
|
11
11
|
};
|
|
@@ -543,18 +543,12 @@ export const DropdownRaw = props => {
|
|
|
543
543
|
}, [setChecked, setSearch]);
|
|
544
544
|
const debouncedGetData = useDebounce((signal, searchValue, isChecked) => getData ? (isCheckboxMode ? getData(signal, searchValue, isChecked) : getData(signal, searchValue)).then(dta => handleData(dta, searchValue)).catch(handleError) : customGetData(searchValue).then(dta => handleData(dta, searchValue)).catch(handleError), 200);
|
|
545
545
|
const controlData = useCallback((signal, searchValue, isChecked) => {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
type: StateActionType.ShowWaiting,
|
|
553
|
-
payload: undefined
|
|
554
|
-
});
|
|
555
|
-
debouncedGetData(signal, searchValue, isChecked);
|
|
556
|
-
}
|
|
557
|
-
}, [debouncedGetData, handleData, handleQueryMode, isQueryMode, getData, dataItems]);
|
|
546
|
+
!isQueryMode && dispatchState({
|
|
547
|
+
type: StateActionType.ShowWaiting,
|
|
548
|
+
payload: undefined
|
|
549
|
+
});
|
|
550
|
+
isQueryMode ? handleQueryMode(searchValue, isChecked) : debouncedGetData(signal, searchValue, isChecked);
|
|
551
|
+
}, [debouncedGetData, handleQueryMode, isQueryMode]);
|
|
558
552
|
useEffect(() => {
|
|
559
553
|
var _a;
|
|
560
554
|
const timeoutId = (_a = zen.setTimeout) === null || _a === void 0 ? void 0 : _a.call(zen, () => {
|