@geotab/zenith 3.9.2 → 3.10.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 +15 -3
- package/dist/absolute/absolute.d.ts +7 -1
- package/dist/absolute/absolute.js +8 -4
- package/dist/alertRaw/alertRaw.js +4 -4
- package/dist/alertRaw/components/alertAnimation.js +2 -2
- package/dist/banner/bannerMultipLine.js +4 -4
- package/dist/banner/bannerSingleLine.js +4 -4
- package/dist/betaPill/betaPill.d.ts +4 -9
- package/dist/betaPill/betaPill.js +7 -8
- package/dist/bookmark/bookmark.d.ts +2 -1
- package/dist/bookmark/bookmark.js +4 -2
- package/dist/card/components/cardButton/cardButton.d.ts +2 -1
- package/dist/card/components/cardButton/cardButton.js +3 -3
- package/dist/checkbox/checkbox.js +2 -2
- package/dist/commonStyles/rangeFieldMixin.less +9 -9
- package/dist/controlledPopup/controlledPopup.d.ts +2 -1
- package/dist/controlledPopup/controlledPopup.js +2 -2
- package/dist/dataFeed/hooks/useVisibleColumns.js +1 -1
- package/dist/dataGrid/extensions/toBasicColumn.js +2 -1
- package/dist/dataGrid/listColumn.d.ts +1 -0
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.d.ts +2 -2
- package/dist/dataGrid/withFlexibleColumns/components/columnSettingsList.js +5 -5
- package/dist/dataGrid/withFlexibleColumns/withFlexibleColumns.js +15 -6
- package/dist/dialog/dialogContent.js +4 -4
- package/dist/dropdownRaw/dropdownHelper.d.ts +4 -1
- package/dist/dropdownRaw/dropdownHelper.js +2 -1
- package/dist/dropdownRaw/dropdownRaw.js +2 -2
- package/dist/dropdownRaw/dropdownTrigger.d.ts +1 -1
- package/dist/dropdownRaw/dropdownTrigger.js +1 -1
- package/dist/fileUpload/components/uploadedFilesSection.js +3 -3
- package/dist/filters/components/filtersSavedChipComponent.js +3 -3
- package/dist/filters/components/filtersSearchItemData.js +3 -3
- package/dist/filters/components/filtersSidePanel.js +4 -4
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +4 -4
- package/dist/formGroup/components/reviewListToggle/reviewListToggle.js +13 -13
- package/dist/groupsFilterRaw/groupsFilterInitialState.js +1 -1
- package/dist/headerTitle/headerTitle.d.ts +3 -9
- package/dist/headerTitle/headerTitle.js +2 -3
- 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/icons/iconLayoutSidebar.js +3 -1
- package/dist/icons/iconPinFilled.d.ts +3 -0
- package/dist/icons/iconPinFilled.js +12 -0
- package/dist/icons/iconSidebar.js +3 -1
- package/dist/icons/iconUndock.js +3 -1
- package/dist/index.css +556 -504
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -6
- package/dist/list/listItem/listItem.d.ts +3 -1
- package/dist/list/listItem/listItem.js +4 -2
- package/dist/menu/controlledMenu.d.ts +1 -0
- package/dist/menu/controlledMenu.js +2 -2
- package/dist/mobileSheet/mobileSheet.js +4 -4
- package/dist/modal/modal.js +4 -4
- package/dist/nav/nav.d.ts +7 -1
- package/dist/nav/nav.js +11 -6
- package/dist/nav/navEmpty/navEmpty.d.ts +10 -0
- package/dist/nav/navEmpty/navEmpty.js +7 -0
- package/dist/notification/notification.js +4 -4
- package/dist/notification/pushNotification/pushNotification.js +1 -1
- package/dist/pill/components/pillNonActionable/pillNonActionable.js +4 -4
- package/dist/pillExpandable/pillExpandable.js +4 -4
- package/dist/table/detailPanel/detailPanelHeader.js +4 -4
- package/dist/table/flexible/columnsList.d.ts +1 -2
- package/dist/table/flexible/columnsList.js +6 -5
- package/dist/table/flexible/columnsPopup.js +0 -3
- package/dist/table/flexible/useFlexibleColumns.d.ts +1 -0
- package/dist/table/flexible/useFlexibleColumns.js +4 -3
- package/dist/table/loading/useLoading.d.ts +1 -0
- package/dist/table/loading/useLoading.js +1 -1
- package/dist/table/nested/useNestedRows.d.ts +1 -0
- package/dist/table/selectable/useSelectableRows.js +23 -5
- package/dist/table/table.d.ts +1 -0
- package/dist/table/table.js +7 -2
- package/dist/tabs/tabItem/tabItem.d.ts +2 -1
- package/dist/tabs/tabItem/tabItem.js +4 -2
- package/dist/tabs/tabs.d.ts +1 -0
- package/dist/tabs/tabs.js +2 -1
- package/dist/toastRaw/components/toastAnimation.js +2 -2
- package/dist/toastRaw/toastRaw.js +4 -4
- package/dist/toggleButtonRaw/toggleButtonRaw.js +13 -13
- package/dist/tooltip/tooltip.js +4 -4
- package/dist/utils/localization/flipAlignment.d.ts +2 -0
- package/dist/utils/localization/flipAlignment.js +19 -0
- package/dist/utils/localization/makeLanguageWrapper.d.ts +8 -0
- package/dist/utils/localization/makeLanguageWrapper.js +11 -0
- package/dist/utils/localization/translations/cs.json +2 -2
- package/dist/utils/localization/translations/da-DK.json +2 -2
- package/dist/utils/localization/translations/es.json +2 -2
- package/dist/utils/localization/translations/fi-FI.json +1 -1
- package/dist/utils/localization/translations/hu-HU.json +2 -2
- package/dist/utils/localization/translations/ko-KR.json +2 -2
- package/dist/utils/localization/translations/ms.json +1 -1
- package/dist/utils/localization/translations/nb-NO.json +1 -1
- package/dist/utils/localization/translations/pt-BR.json +2 -2
- package/dist/utils/localization/translations/pt-PT.json +3 -3
- package/dist/utils/localization/translations/ro-RO.json +5 -5
- package/dist/utils/localization/translations/sk-SK.json +1 -1
- package/dist/utils/localization/translations/zh-Hans.json +1 -1
- package/dist/utils/localization/useIsRTL.d.ts +1 -0
- package/dist/utils/localization/useIsRTL.js +6 -0
- package/dist/utils/localization/useRTLAlignment.d.ts +2 -0
- package/dist/utils/localization/useRTLAlignment.js +10 -0
- package/esm/absolute/absolute.d.ts +7 -1
- package/esm/absolute/absolute.js +8 -4
- package/esm/alertRaw/alertRaw.js +4 -4
- package/esm/alertRaw/components/alertAnimation.js +2 -2
- package/esm/banner/bannerMultipLine.js +4 -4
- package/esm/banner/bannerSingleLine.js +4 -4
- package/esm/betaPill/betaPill.d.ts +4 -9
- package/esm/betaPill/betaPill.js +7 -8
- package/esm/bookmark/bookmark.d.ts +2 -1
- package/esm/bookmark/bookmark.js +4 -2
- package/esm/card/components/cardButton/cardButton.d.ts +2 -1
- package/esm/card/components/cardButton/cardButton.js +3 -3
- package/esm/checkbox/checkbox.js +2 -2
- package/esm/controlledPopup/controlledPopup.d.ts +2 -1
- package/esm/controlledPopup/controlledPopup.js +2 -2
- package/esm/dataFeed/hooks/useVisibleColumns.js +1 -1
- package/esm/dataGrid/extensions/toBasicColumn.js +2 -1
- package/esm/dataGrid/listColumn.d.ts +1 -0
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsList.d.ts +2 -2
- package/esm/dataGrid/withFlexibleColumns/components/columnSettingsList.js +5 -5
- package/esm/dataGrid/withFlexibleColumns/withFlexibleColumns.js +15 -6
- package/esm/dialog/dialogContent.js +4 -4
- package/esm/dropdownRaw/dropdownHelper.d.ts +4 -1
- package/esm/dropdownRaw/dropdownHelper.js +2 -1
- package/esm/dropdownRaw/dropdownRaw.js +2 -2
- package/esm/dropdownRaw/dropdownTrigger.d.ts +1 -1
- package/esm/dropdownRaw/dropdownTrigger.js +1 -1
- package/esm/fileUpload/components/uploadedFilesSection.js +3 -3
- package/esm/filters/components/filtersSavedChipComponent.js +3 -3
- package/esm/filters/components/filtersSearchItemData.js +3 -3
- package/esm/filters/components/filtersSidePanel.js +4 -4
- package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +4 -4
- package/esm/formGroup/components/reviewListToggle/reviewListToggle.js +13 -13
- package/esm/groupsFilterRaw/groupsFilterInitialState.js +1 -1
- package/esm/headerTitle/headerTitle.d.ts +3 -9
- package/esm/headerTitle/headerTitle.js +2 -3
- 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/icons/iconLayoutSidebar.js +3 -1
- package/esm/icons/iconPinFilled.d.ts +3 -0
- package/esm/icons/iconPinFilled.js +8 -0
- package/esm/icons/iconSidebar.js +3 -1
- package/esm/icons/iconUndock.js +3 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/list/listItem/listItem.d.ts +3 -1
- package/esm/list/listItem/listItem.js +4 -2
- package/esm/menu/controlledMenu.d.ts +1 -0
- package/esm/menu/controlledMenu.js +2 -2
- package/esm/mobileSheet/mobileSheet.js +4 -4
- package/esm/modal/modal.js +4 -4
- package/esm/nav/nav.d.ts +7 -1
- package/esm/nav/nav.js +11 -6
- package/esm/nav/navEmpty/navEmpty.d.ts +10 -0
- package/esm/nav/navEmpty/navEmpty.js +3 -0
- package/esm/notification/notification.js +4 -4
- package/esm/notification/pushNotification/pushNotification.js +1 -1
- package/esm/pill/components/pillNonActionable/pillNonActionable.js +4 -4
- package/esm/pillExpandable/pillExpandable.js +4 -4
- package/esm/table/detailPanel/detailPanelHeader.js +4 -4
- package/esm/table/flexible/columnsList.d.ts +1 -2
- package/esm/table/flexible/columnsList.js +6 -5
- package/esm/table/flexible/columnsPopup.js +0 -3
- package/esm/table/flexible/useFlexibleColumns.d.ts +1 -0
- package/esm/table/flexible/useFlexibleColumns.js +4 -3
- package/esm/table/loading/useLoading.d.ts +1 -0
- package/esm/table/loading/useLoading.js +1 -1
- package/esm/table/nested/useNestedRows.d.ts +1 -0
- package/esm/table/selectable/useSelectableRows.js +23 -5
- package/esm/table/table.d.ts +1 -0
- package/esm/table/table.js +7 -2
- package/esm/tabs/tabItem/tabItem.d.ts +2 -1
- package/esm/tabs/tabItem/tabItem.js +4 -2
- package/esm/tabs/tabs.d.ts +1 -0
- package/esm/tabs/tabs.js +2 -1
- package/esm/toastRaw/components/toastAnimation.js +2 -2
- package/esm/toastRaw/toastRaw.js +4 -4
- package/esm/toggleButtonRaw/toggleButtonRaw.js +13 -13
- package/esm/tooltip/tooltip.js +4 -4
- package/esm/utils/localization/flipAlignment.d.ts +2 -0
- package/esm/utils/localization/flipAlignment.js +15 -0
- package/esm/utils/localization/makeLanguageWrapper.d.ts +8 -0
- package/esm/utils/localization/makeLanguageWrapper.js +7 -0
- package/esm/utils/localization/translations/cs.json +2 -2
- package/esm/utils/localization/translations/da-DK.json +2 -2
- package/esm/utils/localization/translations/es.json +2 -2
- package/esm/utils/localization/translations/fi-FI.json +1 -1
- package/esm/utils/localization/translations/hu-HU.json +2 -2
- package/esm/utils/localization/translations/ko-KR.json +2 -2
- package/esm/utils/localization/translations/ms.json +1 -1
- package/esm/utils/localization/translations/nb-NO.json +1 -1
- package/esm/utils/localization/translations/pt-BR.json +2 -2
- package/esm/utils/localization/translations/pt-PT.json +3 -3
- package/esm/utils/localization/translations/ro-RO.json +5 -5
- package/esm/utils/localization/translations/sk-SK.json +1 -1
- package/esm/utils/localization/translations/zh-Hans.json +1 -1
- package/esm/utils/localization/useIsRTL.d.ts +1 -0
- package/esm/utils/localization/useIsRTL.js +2 -0
- package/esm/utils/localization/useRTLAlignment.d.ts +2 -0
- package/esm/utils/localization/useRTLAlignment.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,9 +47,21 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
47
47
|
|
|
48
48
|
## Change log
|
|
49
49
|
|
|
50
|
-
### 3.
|
|
51
|
-
|
|
52
|
-
-
|
|
50
|
+
### 3.10.0
|
|
51
|
+
|
|
52
|
+
- Add `wrap` and `vertical` props to `ListItem`
|
|
53
|
+
- Add `data-analytics-id` prop to `Tab`, `TabItem`, and `Bookmark`
|
|
54
|
+
- `Nav` component: support show/hide separator between Core and Apps sections
|
|
55
|
+
- `Nav` empty state support
|
|
56
|
+
- Allow multiple columns to be disabled in `ColumnsList`
|
|
57
|
+
- Flip icons for Arabic (RTL) language
|
|
58
|
+
- `Dropdown` search and select-all improvements
|
|
59
|
+
- Fix system font fallback in Storybook pages
|
|
60
|
+
- [MYG-128651](https://geotab.atlassian.net/browse/MYG-128651): Update Zenith beta pill parameters to take optional custom text
|
|
61
|
+
- Increase max height of zen popup
|
|
62
|
+
- [MYG-128520](https://geotab.atlassian.net/browse/MYG-128520): Fix SidePanel not animating open due to RTL regression
|
|
63
|
+
- [MYG-121631](https://geotab.atlassian.net/browse/MYG-121631): Add `closeOnScroll` prop to close `ContextMenu` on scroll
|
|
64
|
+
- [MYG-123578](https://geotab.atlassian.net/browse/MYG-123578): Fix checkbox accessibility by moving input inside label wrapper
|
|
53
65
|
|
|
54
66
|
### 3.9.1
|
|
55
67
|
|
|
@@ -22,8 +22,14 @@ export interface IAbsolute extends IZenComponentProps {
|
|
|
22
22
|
ariaLabelledby?: string;
|
|
23
23
|
alignmentsFn?: IAlignment;
|
|
24
24
|
recalculateOnScroll?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* When true, closes the popup on scroll instead of repositioning it.
|
|
27
|
+
* Mutually exclusive with `recalculateOnScroll` — setting both causes a
|
|
28
|
+
* wasted position recalculation before the popup closes.
|
|
29
|
+
*/
|
|
30
|
+
closeOnScroll?: boolean;
|
|
25
31
|
recalculateTrigger?: boolean;
|
|
26
32
|
/** Whether to focus the first focusable element when popup opens. Default: true */
|
|
27
33
|
focusOnOpen?: boolean;
|
|
28
34
|
}
|
|
29
|
-
export declare const Absolute: ({ isOpen, id, paddingX, paddingY, className, children, triggerRef, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, stateFullChilds, role, ariaLabel, ariaLabelledby, alignmentsFn, recalculateOnScroll, recalculateTrigger, focusOnOpen }: IAbsolute) => import("react/jsx-runtime").JSX.Element | "" | null;
|
|
35
|
+
export declare const Absolute: ({ isOpen, id, paddingX, paddingY, className, children, triggerRef, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, stateFullChilds, role, ariaLabel, ariaLabelledby, alignmentsFn, recalculateOnScroll, closeOnScroll, recalculateTrigger, focusOnOpen }: IAbsolute) => import("react/jsx-runtime").JSX.Element | "" | null;
|
|
@@ -19,7 +19,7 @@ const useScroll_1 = require("../commonHelpers/hooks/useScroll");
|
|
|
19
19
|
const getScrollableParent_1 = require("../utils/getScrollableParent");
|
|
20
20
|
const useClientReady_1 = require("../commonHelpers/hooks/useClientReady");
|
|
21
21
|
const zen_1 = require("../utils/zen");
|
|
22
|
-
const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, triggerRef, alignment, inline, onOpenChange, useTrapFocusWithTrigger = "off", shouldHoldScroll, stateFullChilds, role, ariaLabel, ariaLabelledby, alignmentsFn, recalculateOnScroll, recalculateTrigger = true, focusOnOpen = true }) => {
|
|
22
|
+
const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, triggerRef, alignment, inline, onOpenChange, useTrapFocusWithTrigger = "off", shouldHoldScroll, stateFullChilds, role, ariaLabel, ariaLabelledby, alignmentsFn, recalculateOnScroll, closeOnScroll, recalculateTrigger = true, focusOnOpen = true }) => {
|
|
23
23
|
const popupRef = (0, react_1.useRef)(null);
|
|
24
24
|
const prevScroll = (0, react_1.useRef)(0);
|
|
25
25
|
const { dark } = (0, react_1.useContext)(themeContext_1.themeContext);
|
|
@@ -47,14 +47,18 @@ const Absolute = ({ isOpen, id, paddingX, paddingY, className, children, trigger
|
|
|
47
47
|
return "";
|
|
48
48
|
};
|
|
49
49
|
const parent = (0, react_1.useMemo)(() => {
|
|
50
|
-
if (!isOpen || !recalculateOnScroll) {
|
|
50
|
+
if (!isOpen || (!recalculateOnScroll && !closeOnScroll)) {
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
53
|
return (0, getScrollableParent_1.getScrollableParent)(triggerRef.current);
|
|
54
|
-
}, [triggerRef, isOpen, recalculateOnScroll]);
|
|
54
|
+
}, [triggerRef, isOpen, recalculateOnScroll, closeOnScroll]);
|
|
55
55
|
const calculatePosition = (0, react_1.useCallback)(() => (0, calculatePosition_1.calculatePosition)(triggerRef, popupRef, paddingX, paddingY, inline, alignment, alignmentsFn, parent ? parent : undefined), [triggerRef, paddingX, paddingY, inline, alignment, alignmentsFn, popupRef, parent]);
|
|
56
|
+
const handleCloseOnScroll = (0, react_1.useCallback)(() => {
|
|
57
|
+
onOpenChange(false);
|
|
58
|
+
}, [onOpenChange]);
|
|
56
59
|
(0, useResize_1.useResize)(calculatePosition, isOpen);
|
|
57
|
-
(0, useScroll_1.useScroll)(calculatePosition, isOpen, parent);
|
|
60
|
+
(0, useScroll_1.useScroll)(calculatePosition, isOpen && !!recalculateOnScroll, parent);
|
|
61
|
+
(0, useScroll_1.useScroll)(handleCloseOnScroll, isOpen && !!closeOnScroll, parent);
|
|
58
62
|
(0, react_1.useLayoutEffect)(calculatePosition, [isOpen, children, recalculateTrigger, calculatePosition]);
|
|
59
63
|
function handleEscape() {
|
|
60
64
|
onOpenChange(false);
|
|
@@ -19,10 +19,10 @@ injectString("da-DK", "Close", "Luk");
|
|
|
19
19
|
injectString("de", "Close", "Schlie\xDFen");
|
|
20
20
|
injectString("en", "Close", "Close");
|
|
21
21
|
injectString("es", "Close", "Cerrar");
|
|
22
|
-
injectString("fi-FI", "Close", "
|
|
22
|
+
injectString("fi-FI", "Close", "Sulkea");
|
|
23
23
|
injectString("fr", "Close", "Fermer");
|
|
24
24
|
injectString("fr-FR", "Close", "Fermer");
|
|
25
|
-
injectString("hu-HU", "Close", "
|
|
25
|
+
injectString("hu-HU", "Close", "Bez\xE1r\xE1s");
|
|
26
26
|
injectString("id", "Close", "Tutup");
|
|
27
27
|
injectString("it", "Close", "Chiudere");
|
|
28
28
|
injectString("ja", "Close", "\u9589\u3058\u308B");
|
|
@@ -33,13 +33,13 @@ injectString("nl", "Close", "Sluiten");
|
|
|
33
33
|
injectString("pl", "Close", "Zamknij");
|
|
34
34
|
injectString("pt-BR", "Close", "Fechar");
|
|
35
35
|
injectString("pt-PT", "Close", "Fechar");
|
|
36
|
-
injectString("sk-SK", "Close", "
|
|
36
|
+
injectString("sk-SK", "Close", "Zatvori\u0165");
|
|
37
37
|
injectString("sv", "Close", "St\xE4ng");
|
|
38
38
|
injectString("th", "Close", "\u0E1B\u0E34\u0E14");
|
|
39
39
|
injectString("tr", "Close", "Kapat");
|
|
40
40
|
injectString("zh-Hans", "Close", "\u5173\u95ED");
|
|
41
41
|
injectString("zh-TW", "Close", "\u95DC\u9589");
|
|
42
|
-
injectString("ro-RO", "Close", "\xCEnchide
|
|
42
|
+
injectString("ro-RO", "Close", "\xCEnchide");
|
|
43
43
|
injectString("ar-SA", "Close", "\u0625\u063A\u0644\u0627\u0642");
|
|
44
44
|
const alertAnimation_1 = __importDefault(require("./components/alertAnimation"));
|
|
45
45
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
@@ -35,7 +35,7 @@ const AlertAnimation = ({ id, children, isOpen, animation }) => {
|
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
if (animation === "left-right") {
|
|
38
|
-
ref.current.animate([{
|
|
38
|
+
ref.current.animate([{ insetInlineStart: "0%" }, { insetInlineStart: "120%" }], {
|
|
39
39
|
duration: 300,
|
|
40
40
|
iterations: 1,
|
|
41
41
|
delay: 0,
|
|
@@ -46,7 +46,7 @@ const AlertAnimation = ({ id, children, isOpen, animation }) => {
|
|
|
46
46
|
};
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
ref.current.animate([{
|
|
49
|
+
ref.current.animate([{ insetInlineStart: "120%" }, { insetInlineStart: "0%" }], {
|
|
50
50
|
duration: 300,
|
|
51
51
|
iterations: 1,
|
|
52
52
|
delay: 0,
|
|
@@ -19,10 +19,10 @@ injectString("da-DK", "Close", "Luk");
|
|
|
19
19
|
injectString("de", "Close", "Schlie\xDFen");
|
|
20
20
|
injectString("en", "Close", "Close");
|
|
21
21
|
injectString("es", "Close", "Cerrar");
|
|
22
|
-
injectString("fi-FI", "Close", "
|
|
22
|
+
injectString("fi-FI", "Close", "Sulkea");
|
|
23
23
|
injectString("fr", "Close", "Fermer");
|
|
24
24
|
injectString("fr-FR", "Close", "Fermer");
|
|
25
|
-
injectString("hu-HU", "Close", "
|
|
25
|
+
injectString("hu-HU", "Close", "Bez\xE1r\xE1s");
|
|
26
26
|
injectString("id", "Close", "Tutup");
|
|
27
27
|
injectString("it", "Close", "Chiudere");
|
|
28
28
|
injectString("ja", "Close", "\u9589\u3058\u308B");
|
|
@@ -33,13 +33,13 @@ injectString("nl", "Close", "Sluiten");
|
|
|
33
33
|
injectString("pl", "Close", "Zamknij");
|
|
34
34
|
injectString("pt-BR", "Close", "Fechar");
|
|
35
35
|
injectString("pt-PT", "Close", "Fechar");
|
|
36
|
-
injectString("sk-SK", "Close", "
|
|
36
|
+
injectString("sk-SK", "Close", "Zatvori\u0165");
|
|
37
37
|
injectString("sv", "Close", "St\xE4ng");
|
|
38
38
|
injectString("th", "Close", "\u0E1B\u0E34\u0E14");
|
|
39
39
|
injectString("tr", "Close", "Kapat");
|
|
40
40
|
injectString("zh-Hans", "Close", "\u5173\u95ED");
|
|
41
41
|
injectString("zh-TW", "Close", "\u95DC\u9589");
|
|
42
|
-
injectString("ro-RO", "Close", "\xCEnchide
|
|
42
|
+
injectString("ro-RO", "Close", "\xCEnchide");
|
|
43
43
|
injectString("ar-SA", "Close", "\u0625\u063A\u0644\u0627\u0642");
|
|
44
44
|
const bannerUtils_1 = require("./bannerUtils");
|
|
45
45
|
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
@@ -19,10 +19,10 @@ injectString("da-DK", "Close", "Luk");
|
|
|
19
19
|
injectString("de", "Close", "Schlie\xDFen");
|
|
20
20
|
injectString("en", "Close", "Close");
|
|
21
21
|
injectString("es", "Close", "Cerrar");
|
|
22
|
-
injectString("fi-FI", "Close", "
|
|
22
|
+
injectString("fi-FI", "Close", "Sulkea");
|
|
23
23
|
injectString("fr", "Close", "Fermer");
|
|
24
24
|
injectString("fr-FR", "Close", "Fermer");
|
|
25
|
-
injectString("hu-HU", "Close", "
|
|
25
|
+
injectString("hu-HU", "Close", "Bez\xE1r\xE1s");
|
|
26
26
|
injectString("id", "Close", "Tutup");
|
|
27
27
|
injectString("it", "Close", "Chiudere");
|
|
28
28
|
injectString("ja", "Close", "\u9589\u3058\u308B");
|
|
@@ -33,13 +33,13 @@ injectString("nl", "Close", "Sluiten");
|
|
|
33
33
|
injectString("pl", "Close", "Zamknij");
|
|
34
34
|
injectString("pt-BR", "Close", "Fechar");
|
|
35
35
|
injectString("pt-PT", "Close", "Fechar");
|
|
36
|
-
injectString("sk-SK", "Close", "
|
|
36
|
+
injectString("sk-SK", "Close", "Zatvori\u0165");
|
|
37
37
|
injectString("sv", "Close", "St\xE4ng");
|
|
38
38
|
injectString("th", "Close", "\u0E1B\u0E34\u0E14");
|
|
39
39
|
injectString("tr", "Close", "Kapat");
|
|
40
40
|
injectString("zh-Hans", "Close", "\u5173\u95ED");
|
|
41
41
|
injectString("zh-TW", "Close", "\u95DC\u9589");
|
|
42
|
-
injectString("ro-RO", "Close", "\xCEnchide
|
|
42
|
+
injectString("ro-RO", "Close", "\xCEnchide");
|
|
43
43
|
injectString("ar-SA", "Close", "\u0625\u063A\u0644\u0627\u0642");
|
|
44
44
|
const button_1 = require("../button/button");
|
|
45
45
|
const buttonType_1 = require("../button/buttonType");
|
|
@@ -6,26 +6,21 @@ export interface IBetaPillActions {
|
|
|
6
6
|
link?: string;
|
|
7
7
|
linkOptions?: ILinkOptions;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* @internal - temporary escape hatch
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
export interface IBetaPillBaseInternal {
|
|
14
|
-
name?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
}
|
|
17
9
|
interface IBetaPillBase {
|
|
18
10
|
className?: string;
|
|
11
|
+
name?: string;
|
|
19
12
|
}
|
|
20
13
|
interface IBetaPillWithActions extends IBetaPillBase {
|
|
21
14
|
feedbackAction?: IBetaPillActions;
|
|
22
15
|
betaOptionAction?: IBetaPillActions;
|
|
16
|
+
description?: string;
|
|
23
17
|
}
|
|
24
18
|
interface IBetaPillWithoutActions extends IBetaPillBase {
|
|
25
19
|
feedbackAction?: never;
|
|
26
20
|
betaOptionAction?: never;
|
|
21
|
+
description?: never;
|
|
27
22
|
}
|
|
28
23
|
export type IBetaPill = IBetaPillWithActions | IBetaPillWithoutActions;
|
|
29
|
-
export declare const BetaPill: (
|
|
24
|
+
export declare const BetaPill: ({ className, feedbackAction, betaOptionAction, name, description }: IBetaPill) => import("react/jsx-runtime").JSX.Element;
|
|
30
25
|
export declare const TRANSLATIONS: string[];
|
|
31
26
|
export {};
|
|
@@ -124,14 +124,13 @@ injectString("zh-Hans", "Beta", "\u6D4B\u8BD5\u7248");
|
|
|
124
124
|
injectString("zh-TW", "Beta", "\u6E2C\u8A66\u7248");
|
|
125
125
|
injectString("ro-RO", "Beta", "Beta");
|
|
126
126
|
injectString("ar-SA", "Beta", "\u062A\u062C\u0631\u064A\u0628\u064A");
|
|
127
|
-
const BetaPill =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
} = props;
|
|
127
|
+
const BetaPill = ({
|
|
128
|
+
className,
|
|
129
|
+
feedbackAction,
|
|
130
|
+
betaOptionAction,
|
|
131
|
+
name,
|
|
132
|
+
description
|
|
133
|
+
}) => {
|
|
135
134
|
const {
|
|
136
135
|
translate
|
|
137
136
|
} = (0, useLanguage_1.useLanguage)();
|
|
@@ -3,6 +3,7 @@ import { IZenComponentProps } from "../commonHelpers/zenComponent";
|
|
|
3
3
|
export interface IBookmark extends IZenComponentProps {
|
|
4
4
|
bookmarked: boolean;
|
|
5
5
|
onChange: (bookmarkState: boolean) => void;
|
|
6
|
+
dataAnalyticsId?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const Bookmark: ({ className, bookmarked, onChange }: IBookmark) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const Bookmark: ({ className, bookmarked, onChange, dataAnalyticsId }: IBookmark) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export declare const TRANSLATIONS: string[];
|
|
@@ -75,7 +75,8 @@ const iconBookmarkSelectedHover_1 = require("../icons/iconBookmarkSelectedHover"
|
|
|
75
75
|
const Bookmark = ({
|
|
76
76
|
className,
|
|
77
77
|
bookmarked,
|
|
78
|
-
onChange
|
|
78
|
+
onChange,
|
|
79
|
+
dataAnalyticsId
|
|
79
80
|
}) => {
|
|
80
81
|
const [isHovered, setIsHovered] = (0, react_1.useState)(false);
|
|
81
82
|
const {
|
|
@@ -108,7 +109,8 @@ const Bookmark = ({
|
|
|
108
109
|
iconSize: isDrive ? (0, svgIconSize_1.driveIconSize)("large") : "large",
|
|
109
110
|
iconClasses: `zen-page-bookmark__icon zen-page-bookmark__icon${bookmarked ? "--active" : "--inactive"}`,
|
|
110
111
|
"aria-label": title,
|
|
111
|
-
title: title
|
|
112
|
+
title: title,
|
|
113
|
+
dataAnalyticsId: dataAnalyticsId
|
|
112
114
|
})
|
|
113
115
|
});
|
|
114
116
|
};
|
|
@@ -11,5 +11,6 @@ export interface ICardButton extends IZenIdComponentProps {
|
|
|
11
11
|
link?: string;
|
|
12
12
|
target?: HTMLAttributeAnchorTarget;
|
|
13
13
|
dataAnalyticsId?: string;
|
|
14
|
+
ariaLabel?: string;
|
|
14
15
|
}
|
|
15
|
-
export declare const CardButton: ({ children, disabled, icon, name, onClick, link, className, target: linkTarget, dataAnalyticsId }: ICardButton) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const CardButton: ({ children, disabled, icon, name, onClick, link, className, target: linkTarget, dataAnalyticsId, ariaLabel }: ICardButton) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,7 +12,7 @@ const menu_1 = require("../../../menu/menu");
|
|
|
12
12
|
const useDriveClassName_1 = require("../../../utils/theme/useDriveClassName");
|
|
13
13
|
const useDrive_1 = require("../../../utils/theme/useDrive");
|
|
14
14
|
const toKebabCase_1 = require("../../../utils/toKebabCase");
|
|
15
|
-
const CardButton = ({ children, disabled = false, icon, name, onClick, link, className, target: linkTarget, dataAnalyticsId }) => {
|
|
15
|
+
const CardButton = ({ children, disabled = false, icon, name, onClick, link, className, target: linkTarget, dataAnalyticsId, ariaLabel }) => {
|
|
16
16
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
17
17
|
const triggerRef = (0, react_1.useRef)(null);
|
|
18
18
|
const content = [];
|
|
@@ -32,9 +32,9 @@ const CardButton = ({ children, disabled = false, icon, name, onClick, link, cla
|
|
|
32
32
|
}
|
|
33
33
|
onClick === null || onClick === void 0 ? void 0 : onClick(...args);
|
|
34
34
|
};
|
|
35
|
-
const renderLink = () => ((0, jsx_runtime_1.jsxs)(button_1.Button, { disabled: disabled, type: "tertiary", link: link, target: linkTarget, title: name, dataAnalyticsId: analyticsId, className: (0, classNames_1.classNames)([className || "", "zen-card-button", "zen-caption", cardButtonDriveClasses || ""]), children: [icon && (0, react_1.createElement)(icon, { size: isDrive ? "huge" : "large", className: "zen-caption__pre-content" }), (0, jsx_runtime_1.jsx)("span", { className: "zen-caption__content", children: name })] }));
|
|
35
|
+
const renderLink = () => ((0, jsx_runtime_1.jsxs)(button_1.Button, { disabled: disabled, type: "tertiary", link: link, target: linkTarget, title: name, ariaLabel: ariaLabel, dataAnalyticsId: analyticsId, className: (0, classNames_1.classNames)([className || "", "zen-card-button", "zen-caption", cardButtonDriveClasses || ""]), children: [icon && (0, react_1.createElement)(icon, { size: isDrive ? "huge" : "large", className: "zen-caption__pre-content" }), (0, jsx_runtime_1.jsx)("span", { className: "zen-caption__content", children: name })] }));
|
|
36
36
|
const renderButton = () => {
|
|
37
|
-
const trigger = ((0, jsx_runtime_1.jsxs)(button_1.Button, { htmlType: "button", ref: triggerRef, disabled: disabled, type: "tertiary", onClick: onButtonClickHandler, title: name, dataAnalyticsId: analyticsId, className: (0, classNames_1.classNames)([className || "", "zen-card-button", "zen-caption", cardButtonDriveClasses || ""]), children: [icon && (0, react_1.createElement)(icon, { size: isDrive ? "huge" : "large", className: "zen-caption__pre-content" }), (0, jsx_runtime_1.jsx)("span", { className: "zen-caption__content", children: name }), !!content.length &&
|
|
37
|
+
const trigger = ((0, jsx_runtime_1.jsxs)(button_1.Button, { htmlType: "button", ref: triggerRef, disabled: disabled, type: "tertiary", onClick: onButtonClickHandler, title: name, ariaLabel: ariaLabel, dataAnalyticsId: analyticsId, className: (0, classNames_1.classNames)([className || "", "zen-card-button", "zen-caption", cardButtonDriveClasses || ""]), children: [icon && (0, react_1.createElement)(icon, { size: isDrive ? "huge" : "large", className: "zen-caption__pre-content" }), (0, jsx_runtime_1.jsx)("span", { className: "zen-caption__content", children: name }), !!content.length &&
|
|
38
38
|
(isOpen ? ((0, jsx_runtime_1.jsx)(iconChevronTopSmall_1.IconChevronTopSmall, { size: isDrive ? "huge" : "large", className: "zen-caption__post-content" })) : ((0, jsx_runtime_1.jsx)(iconChevronDownSmall_1.IconChevronDownSmall, { size: isDrive ? "huge" : "large", className: "zen-caption__post-content" })))] }));
|
|
39
39
|
return content.length ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [trigger, (0, jsx_runtime_1.jsx)(controlledMenu_1.ControlledMenu, { title: name, isOpen: isOpen, setIsOpen: setIsOpen, triggerRef: triggerRef, children: content })] })) : (trigger);
|
|
40
40
|
};
|
|
@@ -54,10 +54,10 @@ const Checkbox = (_a) => {
|
|
|
54
54
|
const isMobile = (0, useMobile_1.useMobile)();
|
|
55
55
|
const checkboxIconClasses = (0, react_1.useMemo)(() => (0, classNames_1.classNames)(["zen-checkbox__icon", disabled ? "zen-checkbox__icon--disabled" : ""]), [disabled]);
|
|
56
56
|
const checkbox = ((0, jsx_runtime_1.jsx)(triStateCheckbox_1.TriStateCheckbox, Object.assign({ className: "zen-checkbox__input", id: intId, checked: checked, indeterminate: indeterminate, disabled: disabled, "aria-label": title, "aria-describedby": describedBy }, rest)));
|
|
57
|
-
const iconAndLabel = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-checkbox__box", children: state === checkboxState_1.CheckboxState.Indeterminate ? ((0, jsx_runtime_1.jsx)(checkboxIconMinus_1.CheckboxIconMinus, { className: checkboxIconClasses, size: driveClasses ? "bigger" : "medium" })) : state === checkboxState_1.CheckboxState.On ? ((0, jsx_runtime_1.jsx)(checkboxIconCheckmark_1.CheckboxIconCheckmark, { className: checkboxIconClasses, size: driveClasses ? "bigger" : "medium" })) : null }), children ? ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-checkbox__label-text", fullWidth ? "zen-checkbox__label-text--full-width" : ""]), children: children })) : null] }));
|
|
57
|
+
const iconAndLabel = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-checkbox__box", "aria-hidden": true, children: state === checkboxState_1.CheckboxState.Indeterminate ? ((0, jsx_runtime_1.jsx)(checkboxIconMinus_1.CheckboxIconMinus, { className: checkboxIconClasses, size: driveClasses ? "bigger" : "medium" })) : state === checkboxState_1.CheckboxState.On ? ((0, jsx_runtime_1.jsx)(checkboxIconCheckmark_1.CheckboxIconCheckmark, { className: checkboxIconClasses, size: driveClasses ? "bigger" : "medium" })) : null }), children ? ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-checkbox__label-text", fullWidth ? "zen-checkbox__label-text--full-width" : ""]), children: children })) : null] }));
|
|
58
58
|
if (wrapped) {
|
|
59
59
|
return ((0, jsx_runtime_1.jsxs)("label", { className: (0, classNames_1.classNames)(["zen-checkbox", driveClasses || "", className]), title: title, children: [checkbox, (0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-checkbox__label", reverse ? "zen-checkbox__label--reverse" : ""]), children: iconAndLabel })] }));
|
|
60
60
|
}
|
|
61
|
-
return ((0, jsx_runtime_1.
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classNames_1.classNames)(["zen-checkbox", isMobile && !driveClasses ? "zen-checkbox--mobile" : "", driveClasses || "", className]), children: (0, jsx_runtime_1.jsxs)("label", { className: (0, classNames_1.classNames)(["zen-checkbox__label", reverse ? "zen-checkbox__label--reverse" : ""]), title: title, children: [checkbox, iconAndLabel] }) }));
|
|
62
62
|
};
|
|
63
63
|
exports.Checkbox = Checkbox;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: minmax(min-content, auto) minmax(auto, 168px) minmax(0, auto);
|
|
4
4
|
grid-template-rows: auto auto;
|
|
5
|
-
gap:
|
|
5
|
+
gap: (4 / @rem) (8 / @rem);
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-items: start;
|
|
8
8
|
}
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
align-items: center;
|
|
13
13
|
justify-items: start;
|
|
14
14
|
grid-template-columns:
|
|
15
|
-
minmax(
|
|
16
|
-
minmax(
|
|
17
|
-
minmax(
|
|
18
|
-
minmax(
|
|
19
|
-
minmax(
|
|
20
|
-
minmax(
|
|
21
|
-
row-gap:
|
|
22
|
-
column-gap:
|
|
15
|
+
minmax((24 / @rem), (32 / @rem))
|
|
16
|
+
minmax((64 / @rem), (64 / @rem))
|
|
17
|
+
minmax((24 / @rem), (32 / @rem))
|
|
18
|
+
minmax((24 / @rem), (32 / @rem))
|
|
19
|
+
minmax((64 / @rem), (64 / @rem))
|
|
20
|
+
minmax((24 / @rem), (32 / @rem));
|
|
21
|
+
row-gap: (4 / @rem);
|
|
22
|
+
column-gap: (8 / @rem);
|
|
23
23
|
}
|
|
@@ -23,8 +23,9 @@ export interface IControlledPopup extends IZenComponentProps {
|
|
|
23
23
|
ariaLabel?: string;
|
|
24
24
|
ariaLabelledby?: string;
|
|
25
25
|
recalculateOnScroll?: boolean;
|
|
26
|
+
closeOnScroll?: boolean;
|
|
26
27
|
preventAttributesAutoSet?: boolean;
|
|
27
28
|
/** Whether to focus the first focusable element when popup opens. Default: true */
|
|
28
29
|
focusOnOpen?: boolean;
|
|
29
30
|
}
|
|
30
|
-
export declare const ControlledPopup: ({ isOpen, id, paddingX, paddingY, triggerRef, className, children, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, ariaLabel, ariaLabelledby, recalculateOnScroll, preventAttributesAutoSet, focusOnOpen, role }: IControlledPopup) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const ControlledPopup: ({ isOpen, id, paddingX, paddingY, triggerRef, className, children, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, ariaLabel, ariaLabelledby, recalculateOnScroll, closeOnScroll, preventAttributesAutoSet, focusOnOpen, role }: IControlledPopup) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const absolute_1 = require("../absolute/absolute");
|
|
7
7
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
8
8
|
const useClientReady_1 = require("../commonHelpers/hooks/useClientReady");
|
|
9
|
-
const ControlledPopup = ({ isOpen, id, paddingX, paddingY, triggerRef, className, children, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, ariaLabel, ariaLabelledby, recalculateOnScroll, preventAttributesAutoSet, focusOnOpen, role = "dialog" }) => {
|
|
9
|
+
const ControlledPopup = ({ isOpen, id, paddingX, paddingY, triggerRef, className, children, alignment, inline, onOpenChange, useTrapFocusWithTrigger, shouldHoldScroll, ariaLabel, ariaLabelledby, recalculateOnScroll, closeOnScroll, preventAttributesAutoSet, focusOnOpen, role = "dialog" }) => {
|
|
10
10
|
const autoId = (0, react_1.useId)();
|
|
11
11
|
const popupId = id || autoId;
|
|
12
12
|
const isClientReady = (0, useClientReady_1.useClientReady)();
|
|
@@ -24,6 +24,6 @@ const ControlledPopup = ({ isOpen, id, paddingX, paddingY, triggerRef, className
|
|
|
24
24
|
triggerRef.current.setAttribute("aria-expanded", isOpen ? "true" : "false");
|
|
25
25
|
triggerRef.current.setAttribute("aria-controls", popupId);
|
|
26
26
|
}, [triggerRef, isOpen, popupId, preventAttributesAutoSet, isClientReady]);
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(absolute_1.Absolute, Object.assign({ triggerRef: triggerRef, alignment: alignment, id: popupId, isOpen: isOpen, className: (0, classNames_1.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, focusOnOpen: focusOnOpen, children: children })));
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(absolute_1.Absolute, Object.assign({ triggerRef: triggerRef, alignment: alignment, id: popupId, isOpen: isOpen, className: (0, classNames_1.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 })));
|
|
28
28
|
};
|
|
29
29
|
exports.ControlledPopup = ControlledPopup;
|
|
@@ -10,7 +10,7 @@ const useVisibleColumns = (columnsList, expanded, options) => {
|
|
|
10
10
|
secondaryColumns = expanded ? columnsList.slice(visibleColumns) : [];
|
|
11
11
|
return { mainColumns, secondaryColumns };
|
|
12
12
|
}
|
|
13
|
-
mainColumns = columnsList.slice(0, columnsList.length - collapsedColumnsQty);
|
|
13
|
+
mainColumns = columnsList.slice(0, Math.max(1, columnsList.length - collapsedColumnsQty));
|
|
14
14
|
secondaryColumns = expanded ? columnsList.slice(mainColumns.length) : [];
|
|
15
15
|
return { mainColumns, secondaryColumns };
|
|
16
16
|
};
|
|
@@ -9,8 +9,9 @@ const DEFAULT_META = {
|
|
|
9
9
|
visibleOnHover: false
|
|
10
10
|
};
|
|
11
11
|
const toBasicColumn = (column) => {
|
|
12
|
+
var _a;
|
|
12
13
|
const defaultColumn = (0, defaultColumnComponent_1.defaultColumnComponent)(column.id);
|
|
13
14
|
const columnComponent = column.columnComponent || defaultColumn;
|
|
14
|
-
return Object.assign(Object.assign({}, column), { name: column.name || column.id || "", meta: Object.assign(Object.assign({}, DEFAULT_META), (column.meta || {})), columnComponent: columnComponent, wrappers: column.wrappers || [], colspan: column.colspan || 1 });
|
|
15
|
+
return Object.assign(Object.assign({}, column), { name: column.name || column.id || "", meta: Object.assign(Object.assign({}, DEFAULT_META), (column.meta || {})), columnComponent: columnComponent, wrappers: column.wrappers || [], alwaysVisible: (_a = column.alwaysVisible) !== null && _a !== void 0 ? _a : false, colspan: column.colspan || 1 });
|
|
15
16
|
};
|
|
16
17
|
exports.toBasicColumn = toBasicColumn;
|
|
@@ -17,6 +17,7 @@ export interface IListColumn<T, N = T> {
|
|
|
17
17
|
meta?: IListColumnMeta<T, N>;
|
|
18
18
|
columnComponent?: IColumnComponent<T, N>;
|
|
19
19
|
wrappers?: IListColumnWrapper<T, N>[];
|
|
20
|
+
alwaysVisible?: boolean;
|
|
20
21
|
colspan?: undefined | number | ((entity: T | N) => number | undefined);
|
|
21
22
|
}
|
|
22
23
|
export type TRenderResult = ReactNode | PromiseLike<ReactNode | undefined> | undefined;
|
|
@@ -6,10 +6,10 @@ import { IRowEntity } from "../../row/row";
|
|
|
6
6
|
interface IColumnSettingsList<T extends IRowEntity<T>> extends IZenComponentProps {
|
|
7
7
|
columns: IListFlexibleColumnStrict<T, T>[];
|
|
8
8
|
settings: Map<string, boolean>;
|
|
9
|
-
|
|
9
|
+
disabledColumns?: string[];
|
|
10
10
|
onChange?: (newState: Map<string, boolean>) => void;
|
|
11
11
|
sortGroups?: (a: string, b: string) => number;
|
|
12
12
|
sortColumns?: (a: string, b: string) => number;
|
|
13
13
|
}
|
|
14
|
-
export declare function ColumnSettingsList<T extends IRowEntity<T> & IColumnsGroup>({ columns, settings,
|
|
14
|
+
export declare function ColumnSettingsList<T extends IRowEntity<T> & IColumnsGroup>({ columns, settings, disabledColumns, onChange, sortGroups, sortColumns }: IColumnSettingsList<T>): import("react/jsx-runtime").JSX.Element[];
|
|
15
15
|
export {};
|
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const groupColumns_1 = require("../../extensions/groupColumns");
|
|
7
7
|
const selectList_1 = require("../../../selectList/selectList");
|
|
8
8
|
const checkboxState_1 = require("../../../checkbox/checkboxState");
|
|
9
|
-
const SubColumnsList = ({ title, columns, settings,
|
|
9
|
+
const SubColumnsList = ({ title, columns, settings, disabledColumns, onChange, sortColumns }) => {
|
|
10
10
|
const id = (0, react_1.useId)();
|
|
11
11
|
const sortColumnsInt = (0, react_1.useCallback)((a, b) => {
|
|
12
12
|
if (sortColumns) {
|
|
@@ -17,10 +17,10 @@ const SubColumnsList = ({ title, columns, settings, firstColumn, onChange, sortC
|
|
|
17
17
|
const items = (0, react_1.useMemo)(() => columns.sort(sortColumnsInt).map(c => ({
|
|
18
18
|
id: c.id,
|
|
19
19
|
title: c.title,
|
|
20
|
-
disabled: c.name
|
|
20
|
+
disabled: (disabledColumns === null || disabledColumns === void 0 ? void 0 : disabledColumns.includes(c.name)) || false,
|
|
21
21
|
showCheckbox: true,
|
|
22
22
|
children: c.title
|
|
23
|
-
})), [columns,
|
|
23
|
+
})), [columns, disabledColumns, sortColumnsInt]);
|
|
24
24
|
const state = columns.reduce((res, c) => {
|
|
25
25
|
res.set(c.id, settings.get(c.name) !== false ? checkboxState_1.CheckboxState.On : checkboxState_1.CheckboxState.Off);
|
|
26
26
|
return res;
|
|
@@ -39,7 +39,7 @@ const SubColumnsList = ({ title, columns, settings, firstColumn, onChange, sortC
|
|
|
39
39
|
}
|
|
40
40
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "zen-columns-list__sub-section", children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-columns-list__title zen-ellipsis", children: title }), list] }));
|
|
41
41
|
};
|
|
42
|
-
function ColumnSettingsList({ columns, settings,
|
|
42
|
+
function ColumnSettingsList({ columns, settings, disabledColumns, onChange, sortGroups, sortColumns }) {
|
|
43
43
|
const groupped = (0, groupColumns_1.groupColumns)(columns);
|
|
44
44
|
const sortGroupsInt = (0, react_1.useCallback)((a, b) => {
|
|
45
45
|
if (sortGroups) {
|
|
@@ -49,6 +49,6 @@ function ColumnSettingsList({ columns, settings, firstColumn, onChange, sortGrou
|
|
|
49
49
|
}, [sortGroups]);
|
|
50
50
|
return Array.from(groupped.entries())
|
|
51
51
|
.sort(sortGroupsInt)
|
|
52
|
-
.map(([title, cs]) => ((0, jsx_runtime_1.jsx)(SubColumnsList, { title: title, columns: cs, settings: settings,
|
|
52
|
+
.map(([title, cs]) => ((0, jsx_runtime_1.jsx)(SubColumnsList, { title: title, columns: cs, settings: settings, disabledColumns: disabledColumns, onChange: onChange, sortColumns: sortColumns }, cs.map(c => c.id).join("-"))));
|
|
53
53
|
}
|
|
54
54
|
exports.ColumnSettingsList = ColumnSettingsList;
|
|
@@ -13,6 +13,7 @@ const flexibleColumnWrapper_1 = require("./columns/flexibleColumnWrapper");
|
|
|
13
13
|
const columnSettings_1 = require("./components/columnSettings");
|
|
14
14
|
const columnSettingsList_1 = require("./components/columnSettingsList");
|
|
15
15
|
const columnSettingsSidePanel_1 = require("./components/columnSettingsSidePanel");
|
|
16
|
+
const emptySearchList_1 = require("../emptySearchList/emptySearchList");
|
|
16
17
|
const zen_1 = require("../../utils/zen");
|
|
17
18
|
// T - type of entity
|
|
18
19
|
// P - props of wrapped component
|
|
@@ -25,6 +26,7 @@ const withFlexibleColumns = (DataGridComponent) => {
|
|
|
25
26
|
const [isPanelOpen, setIsPanelOpen] = (0, react_1.useState)(false);
|
|
26
27
|
const allColumns = (0, react_1.useMemo)(() => columns.map(column => (Object.assign(Object.assign({}, (0, toBasicColumn_1.toBasicColumn)(Object.assign({}, column))), { visible: column.visible !== false, group: column.group || "" }))), [columns]);
|
|
27
28
|
const columnsSettings = (0, react_1.useMemo)(() => (0, flexibleColumnsStorage_1.mergeColumnsSettings)(allColumns, options.columnsSettings || settingsStore.getItem()), [allColumns, options.columnsSettings, settingsStore]);
|
|
29
|
+
const hasConfigurableColumns = (0, react_1.useMemo)(() => allColumns.filter(c => c.title).some(c => !c.alwaysVisible), [allColumns]);
|
|
28
30
|
const visibleColumns = (0, react_1.useMemo)(() => {
|
|
29
31
|
const visibleColumnsMap = new Map(allColumns.map(c => [c.name, c]));
|
|
30
32
|
return columnsSettings
|
|
@@ -66,10 +68,12 @@ const withFlexibleColumns = (DataGridComponent) => {
|
|
|
66
68
|
}, 0);
|
|
67
69
|
}), [settingsStore]);
|
|
68
70
|
const listOfColumns = (0, react_1.useMemo)(() => {
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
+
const configurableColumnNames = new Set(allColumns.filter(c => c.title).map(c => c.name));
|
|
72
|
+
const visibleConfigurableSettings = columnsSettings.filter(s => s.visible && configurableColumnNames.has(s.name));
|
|
73
|
+
const lastVisibleColumn = visibleConfigurableSettings.length === 1 ? [visibleConfigurableSettings[0].name] : [];
|
|
74
|
+
const disabledColumns = [...allColumns.filter(c => c.alwaysVisible).map(c => c.name), ...lastVisibleColumn];
|
|
71
75
|
const columnSettingsMap = new Map(columnsSettings.map(s => [s.name, s.visible]));
|
|
72
|
-
return ((0, jsx_runtime_1.jsx)(columnSettingsList_1.ColumnSettingsList, { columns: allColumns.filter(c => c.title), settings: columnSettingsMap,
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)(columnSettingsList_1.ColumnSettingsList, { columns: allColumns.filter(c => c.title), settings: columnSettingsMap, disabledColumns: disabledColumns, onChange: async (newSettings) => {
|
|
73
77
|
const settings = columnsSettings.map(s => {
|
|
74
78
|
const visible = newSettings.get(s.name) !== false;
|
|
75
79
|
return Object.assign(Object.assign({}, s), { visible });
|
|
@@ -77,7 +81,7 @@ const withFlexibleColumns = (DataGridComponent) => {
|
|
|
77
81
|
await saveSettingsToTheStore(settings);
|
|
78
82
|
onChangeSettings(settings);
|
|
79
83
|
}, sortGroups: sortGroups, sortColumns: sortColumns }));
|
|
80
|
-
}, [columnsSettings, allColumns, saveSettingsToTheStore, onChangeSettings,
|
|
84
|
+
}, [columnsSettings, allColumns, saveSettingsToTheStore, onChangeSettings, sortGroups, sortColumns]);
|
|
81
85
|
const onReorderListener = (0, react_1.useCallback)(async ([from, to]) => {
|
|
82
86
|
if (from === to) {
|
|
83
87
|
return;
|
|
@@ -137,10 +141,15 @@ const withFlexibleColumns = (DataGridComponent) => {
|
|
|
137
141
|
onResetSettings();
|
|
138
142
|
setIsPanelOpen(false);
|
|
139
143
|
}, [onResetSettings, saveSettingsToTheStore]);
|
|
140
|
-
|
|
144
|
+
(0, react_1.useEffect)(() => {
|
|
145
|
+
if (popupTriggerRef === null || popupTriggerRef === void 0 ? void 0 : popupTriggerRef.current) {
|
|
146
|
+
popupTriggerRef.current.style.display = hasConfigurableColumns ? "" : "none";
|
|
147
|
+
}
|
|
148
|
+
}, [popupTriggerRef, hasConfigurableColumns]);
|
|
149
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [popupTriggerRef && hasConfigurableColumns ? (options.isFeed ? ((0, jsx_runtime_1.jsx)(columnSettingsSidePanel_1.ColumnSettingsSidePanel, { triggerRef: popupTriggerRef, isOpen: isPanelOpen, onOpen: () => setIsPanelOpen(true), onClose: () => setIsPanelOpen(false), onReset: onResetListener, children: (0, jsx_runtime_1.jsx)(columnSettings_1.ColumnSettings, { onReset: onResetListener, showFooter: false, children: listOfColumns }) })) : ((0, jsx_runtime_1.jsx)(popup_1.Popup, { triggerRef: popupTriggerRef, alignment: "bottom-right", children: (0, jsx_runtime_1.jsx)(columnSettings_1.ColumnSettings, { onReset: onResetListener, children: listOfColumns }) }, "flexible-popup"))) : null, visibleColumns.length === 0 && hasConfigurableColumns ? ((0, jsx_runtime_1.jsx)("div", { className: "zen-data-grid__empty", children: (0, jsx_runtime_1.jsx)(emptySearchList_1.EmptySearchList, {}) })) : ((0, jsx_runtime_1.jsx)(DataGridComponent, Object.assign({}, props, { columns: [...visibleColumns], ref: gridRef }), "grid"))] }));
|
|
141
150
|
};
|
|
142
151
|
FlexibleColumnsComponent.displayName = `withFlexibleColumns(${DataGridComponent.displayName || DataGridComponent.name || "Component"})`;
|
|
143
152
|
return FlexibleColumnsComponent;
|
|
144
153
|
};
|
|
145
154
|
exports.withFlexibleColumns = withFlexibleColumns;
|
|
146
|
-
exports.withFlexibleColumns.translations = [...columnSettings_1.ColumnSettings.translations, ...columnSettingsSidePanel_1.ColumnSettingsSidePanel.translations];
|
|
155
|
+
exports.withFlexibleColumns.translations = [...columnSettings_1.ColumnSettings.translations, ...columnSettingsSidePanel_1.ColumnSettingsSidePanel.translations, ...emptySearchList_1.EmptySearchList.translations];
|
|
@@ -15,10 +15,10 @@ injectString("da-DK", "Close", "Luk");
|
|
|
15
15
|
injectString("de", "Close", "Schlie\xDFen");
|
|
16
16
|
injectString("en", "Close", "Close");
|
|
17
17
|
injectString("es", "Close", "Cerrar");
|
|
18
|
-
injectString("fi-FI", "Close", "
|
|
18
|
+
injectString("fi-FI", "Close", "Sulkea");
|
|
19
19
|
injectString("fr", "Close", "Fermer");
|
|
20
20
|
injectString("fr-FR", "Close", "Fermer");
|
|
21
|
-
injectString("hu-HU", "Close", "
|
|
21
|
+
injectString("hu-HU", "Close", "Bez\xE1r\xE1s");
|
|
22
22
|
injectString("id", "Close", "Tutup");
|
|
23
23
|
injectString("it", "Close", "Chiudere");
|
|
24
24
|
injectString("ja", "Close", "\u9589\u3058\u308B");
|
|
@@ -29,13 +29,13 @@ injectString("nl", "Close", "Sluiten");
|
|
|
29
29
|
injectString("pl", "Close", "Zamknij");
|
|
30
30
|
injectString("pt-BR", "Close", "Fechar");
|
|
31
31
|
injectString("pt-PT", "Close", "Fechar");
|
|
32
|
-
injectString("sk-SK", "Close", "
|
|
32
|
+
injectString("sk-SK", "Close", "Zatvori\u0165");
|
|
33
33
|
injectString("sv", "Close", "St\xE4ng");
|
|
34
34
|
injectString("th", "Close", "\u0E1B\u0E34\u0E14");
|
|
35
35
|
injectString("tr", "Close", "Kapat");
|
|
36
36
|
injectString("zh-Hans", "Close", "\u5173\u95ED");
|
|
37
37
|
injectString("zh-TW", "Close", "\u95DC\u9589");
|
|
38
|
-
injectString("ro-RO", "Close", "\xCEnchide
|
|
38
|
+
injectString("ro-RO", "Close", "\xCEnchide");
|
|
39
39
|
injectString("ar-SA", "Close", "\u0625\u063A\u0644\u0627\u0642");
|
|
40
40
|
const dialogHelpers_1 = require("./dialogHelpers");
|
|
41
41
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
@@ -31,7 +31,7 @@ export declare const checkIsDataProblem: (selectedIds: string[], groupsMap: IDro
|
|
|
31
31
|
export declare const getStringFromSelected: (selectedIds: string[], groupsMapSelected: IDropdownState["groupsMapSelected"], translate: (s: string) => string, rootId: string) => string;
|
|
32
32
|
export declare const getStringFromAllSelected: (groupsMap: IDropdownState["groupsMap"], translate: (s: string) => string, rootId: string) => string;
|
|
33
33
|
export declare const getSelectedCount: (selectedIds: string[]) => number;
|
|
34
|
-
export declare const getAllyTriggerProps: (allyPattern: "selectOnlyCombobox" | "comboboxWithDialog" | "buttonWithDialog") => {
|
|
34
|
+
export declare const getAllyTriggerProps: (allyPattern: "selectOnlyCombobox" | "comboboxWithDialog" | "buttonWithDialog" | "buttonWithMenu") => {
|
|
35
35
|
readonly role: "combobox";
|
|
36
36
|
readonly "aria-haspopup": "listbox";
|
|
37
37
|
} | {
|
|
@@ -40,4 +40,7 @@ export declare const getAllyTriggerProps: (allyPattern: "selectOnlyCombobox" | "
|
|
|
40
40
|
} | {
|
|
41
41
|
readonly role: "button";
|
|
42
42
|
readonly "aria-haspopup": "dialog";
|
|
43
|
+
} | {
|
|
44
|
+
readonly role: "button";
|
|
45
|
+
readonly "aria-haspopup": "menu";
|
|
43
46
|
};
|
|
@@ -167,7 +167,8 @@ exports.getSelectedCount = getSelectedCount;
|
|
|
167
167
|
const ALLY_TRIGGER_PROPS = {
|
|
168
168
|
selectOnlyCombobox: { role: "combobox", "aria-haspopup": "listbox" },
|
|
169
169
|
comboboxWithDialog: { role: "combobox", "aria-haspopup": "dialog" },
|
|
170
|
-
buttonWithDialog: { role: "button", "aria-haspopup": "dialog" }
|
|
170
|
+
buttonWithDialog: { role: "button", "aria-haspopup": "dialog" },
|
|
171
|
+
buttonWithMenu: { role: "button", "aria-haspopup": "menu" }
|
|
171
172
|
};
|
|
172
173
|
const getAllyTriggerProps = (allyPattern) => ALLY_TRIGGER_PROPS[allyPattern];
|
|
173
174
|
exports.getAllyTriggerProps = getAllyTriggerProps;
|
|
@@ -910,7 +910,7 @@ const DropdownRaw = props => {
|
|
|
910
910
|
if (searchField) {
|
|
911
911
|
return "comboboxWithDialog";
|
|
912
912
|
}
|
|
913
|
-
return "
|
|
913
|
+
return "buttonWithMenu";
|
|
914
914
|
}, [searchField, multiselect]);
|
|
915
915
|
if (isReadOnly) {
|
|
916
916
|
// TODO: how many items should we show?
|
|
@@ -990,7 +990,7 @@ const DropdownRaw = props => {
|
|
|
990
990
|
isSearchInPopup: chip,
|
|
991
991
|
mobileSheetStackingClassName: mobileSheetStackingClassName,
|
|
992
992
|
handleFocusOnSentinelItem: handleFocusOnSentinelItem,
|
|
993
|
-
role: memoizedAllyPattern === "selectOnlyCombobox" ? false : "dialog",
|
|
993
|
+
role: memoizedAllyPattern === "selectOnlyCombobox" || memoizedAllyPattern === "buttonWithMenu" ? false : "dialog",
|
|
994
994
|
children: getPopupContent
|
|
995
995
|
})]
|
|
996
996
|
});
|