@geotab/zenith 3.7.0-beta.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/checkbox/checkbox.d.ts +3 -1
- package/dist/checkbox/checkbox.js +5 -8
- package/dist/checkboxListWithAction/checkboxListWithAction.d.ts +3 -1
- package/dist/checkboxListWithAction/checkboxListWithAction.js +185 -3
- package/dist/dropdown/dropdownPopup.d.ts +1 -1
- package/dist/dropdown/dropdownTrigger.d.ts +1 -1
- package/dist/dropdownRaw/dropdownList.d.ts +2 -1
- package/dist/dropdownRaw/dropdownList.js +15 -4
- package/dist/dropdownRaw/dropdownPopup.d.ts +3 -1
- package/dist/dropdownRaw/dropdownPopup.js +35 -5
- package/dist/dropdownRaw/dropdownRaw.js +82 -7
- package/dist/dropdownRaw/dropdownSearchableTrigger.d.ts +2 -1
- package/dist/dropdownRaw/dropdownSearchableTrigger.js +7 -2
- package/dist/dropdownRaw/dropdownTrigger.d.ts +2 -1
- package/dist/dropdownRaw/dropdownTrigger.js +3 -5
- package/dist/footerButtons/footerButtons.d.ts +6 -4
- package/dist/footerButtons/footerButtons.js +3 -8
- package/dist/groupsFilterRaw/groupsFilterInitialState.js +16 -0
- package/dist/groupsFilterRaw/groupsFilterTrigger.js +4 -0
- package/dist/index.css +14 -0
- package/dist/nav/navItem/navItem.d.ts +1 -0
- package/dist/nav/navItem/navItem.js +4 -1
- package/dist/utils/localization/translations/cs.json +2 -1
- package/dist/utils/localization/translations/de.json +2 -1
- package/dist/utils/localization/translations/en.json +2 -1
- package/dist/utils/localization/translations/es.json +2 -1
- package/dist/utils/localization/translations/fr-FR.json +2 -1
- package/dist/utils/localization/translations/fr.json +2 -1
- package/dist/utils/localization/translations/id.json +2 -1
- package/dist/utils/localization/translations/it.json +2 -1
- package/dist/utils/localization/translations/ja.json +2 -1
- package/dist/utils/localization/translations/ms.json +2 -1
- package/dist/utils/localization/translations/nl.json +2 -1
- package/dist/utils/localization/translations/pl.json +2 -1
- package/dist/utils/localization/translations/pt-BR.json +2 -1
- package/dist/utils/localization/translations/sv.json +2 -1
- package/dist/utils/localization/translations/th.json +2 -1
- package/dist/utils/localization/translations/tr.json +2 -1
- package/dist/utils/localization/translations/zh-Hans.json +2 -1
- package/esm/checkbox/checkbox.d.ts +3 -1
- package/esm/checkbox/checkbox.js +5 -8
- package/esm/checkboxListWithAction/checkboxListWithAction.d.ts +3 -1
- package/esm/checkboxListWithAction/checkboxListWithAction.js +186 -4
- package/esm/dropdown/dropdownPopup.d.ts +1 -1
- package/esm/dropdown/dropdownTrigger.d.ts +1 -1
- package/esm/dropdownRaw/dropdownList.d.ts +2 -1
- package/esm/dropdownRaw/dropdownList.js +16 -5
- package/esm/dropdownRaw/dropdownPopup.d.ts +3 -1
- package/esm/dropdownRaw/dropdownPopup.js +37 -7
- package/esm/dropdownRaw/dropdownRaw.js +82 -7
- package/esm/dropdownRaw/dropdownSearchableTrigger.d.ts +2 -1
- package/esm/dropdownRaw/dropdownSearchableTrigger.js +7 -2
- package/esm/dropdownRaw/dropdownTrigger.d.ts +2 -1
- package/esm/dropdownRaw/dropdownTrigger.js +3 -5
- package/esm/footerButtons/footerButtons.d.ts +6 -4
- package/esm/footerButtons/footerButtons.js +3 -8
- package/esm/groupsFilterRaw/groupsFilterInitialState.js +16 -0
- package/esm/groupsFilterRaw/groupsFilterTrigger.js +4 -0
- package/esm/nav/navItem/navItem.d.ts +1 -0
- package/esm/nav/navItem/navItem.js +5 -2
- package/esm/utils/localization/translations/cs.json +2 -1
- package/esm/utils/localization/translations/de.json +2 -1
- package/esm/utils/localization/translations/en.json +2 -1
- package/esm/utils/localization/translations/es.json +2 -1
- package/esm/utils/localization/translations/fr-FR.json +2 -1
- package/esm/utils/localization/translations/fr.json +2 -1
- package/esm/utils/localization/translations/id.json +2 -1
- package/esm/utils/localization/translations/it.json +2 -1
- package/esm/utils/localization/translations/ja.json +2 -1
- package/esm/utils/localization/translations/ms.json +2 -1
- package/esm/utils/localization/translations/nl.json +2 -1
- package/esm/utils/localization/translations/pl.json +2 -1
- package/esm/utils/localization/translations/pt-BR.json +2 -1
- package/esm/utils/localization/translations/sv.json +2 -1
- package/esm/utils/localization/translations/th.json +2 -1
- package/esm/utils/localization/translations/tr.json +2 -1
- package/esm/utils/localization/translations/zh-Hans.json +2 -1
- package/package.json +1 -4
|
@@ -141,9 +141,10 @@ export const DropdownSearchableTrigger = _a => {
|
|
|
141
141
|
ref,
|
|
142
142
|
name,
|
|
143
143
|
onBlur,
|
|
144
|
-
popupId
|
|
144
|
+
popupId,
|
|
145
|
+
handleFocusOnPopup
|
|
145
146
|
} = _a,
|
|
146
|
-
otherProps = __rest(_a, ["value", "className", "onChange", "placeholder", "isOpenPopup", "inputRef", "handleClick", "width", "title", "id", "disabled", "count", "currentSelection", "isError", "fullWidth", "ref", "name", "onBlur", "popupId"])
|
|
147
|
+
otherProps = __rest(_a, ["value", "className", "onChange", "placeholder", "isOpenPopup", "inputRef", "handleClick", "width", "title", "id", "disabled", "count", "currentSelection", "isError", "fullWidth", "ref", "name", "onBlur", "popupId", "handleFocusOnPopup"])
|
|
147
148
|
// eslint-disable-next-line complexity
|
|
148
149
|
;
|
|
149
150
|
const {
|
|
@@ -176,6 +177,10 @@ export const DropdownSearchableTrigger = _a => {
|
|
|
176
177
|
if (e.key === " " && !isOpenPopup) {
|
|
177
178
|
handleClick(true);
|
|
178
179
|
}
|
|
180
|
+
if (e.key === "ArrowDown" && isOpenPopup) {
|
|
181
|
+
e.preventDefault();
|
|
182
|
+
handleFocusOnPopup === null || handleFocusOnPopup === void 0 ? void 0 : handleFocusOnPopup();
|
|
183
|
+
}
|
|
179
184
|
};
|
|
180
185
|
const clickHandler = e => {
|
|
181
186
|
if (e.target === inputRef.current && isOpenPopup || e.target === clearRef.current && isOpenPopup) {
|
|
@@ -23,6 +23,7 @@ export interface IDropdownTrigger extends IZenComponentProps {
|
|
|
23
23
|
name?: string;
|
|
24
24
|
onBlur?: () => void;
|
|
25
25
|
popupId?: string;
|
|
26
|
+
handleFocusOnPopup?: () => void;
|
|
26
27
|
}
|
|
27
|
-
export declare const DropdownTrigger: ({ name, onBlur, isActive, id, triggerRef, searchField, placeholder, disabled, fullWidth, currentSelection, handleClick, inputValue, className, onSearchChange, width, title, triggerAriaLabel, count, inputRef, buttonType, isError, popupId, ...otherProps }: IDropdownTrigger) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const DropdownTrigger: ({ name, onBlur, isActive, id, triggerRef, searchField, placeholder, disabled, fullWidth, currentSelection, handleClick, inputValue, className, onSearchChange, width, title, triggerAriaLabel, count, inputRef, buttonType, isError, popupId, handleFocusOnPopup, ...otherProps }: IDropdownTrigger) => import("react/jsx-runtime").JSX.Element;
|
|
28
29
|
export declare const TRANSLATIONS: string[];
|
|
@@ -15,13 +15,11 @@ import { FilterButton } from "../filterButton/filterButton";
|
|
|
15
15
|
import { useRef } from "react";
|
|
16
16
|
import { classNames } from "../commonHelpers/classNames/classNames";
|
|
17
17
|
export const DropdownTrigger = (_a) => {
|
|
18
|
-
var { name, onBlur, isActive, id, triggerRef, searchField, placeholder, disabled, fullWidth, currentSelection, handleClick, inputValue, className, onSearchChange = () => { }, width, title, triggerAriaLabel, count, inputRef, buttonType, isError, popupId } = _a, otherProps = __rest(_a, ["name", "onBlur", "isActive", "id", "triggerRef", "searchField", "placeholder", "disabled", "fullWidth", "currentSelection", "handleClick", "inputValue", "className", "onSearchChange", "width", "title", "triggerAriaLabel", "count", "inputRef", "buttonType", "isError", "popupId"]);
|
|
18
|
+
var { name, onBlur, isActive, id, triggerRef, searchField, placeholder, disabled, fullWidth, currentSelection, handleClick, inputValue, className, onSearchChange = () => { }, width, title, triggerAriaLabel, count, inputRef, buttonType, isError, popupId, handleFocusOnPopup } = _a, otherProps = __rest(_a, ["name", "onBlur", "isActive", "id", "triggerRef", "searchField", "placeholder", "disabled", "fullWidth", "currentSelection", "handleClick", "inputValue", "className", "onSearchChange", "width", "title", "triggerAriaLabel", "count", "inputRef", "buttonType", "isError", "popupId", "handleFocusOnPopup"]);
|
|
19
19
|
const elInpRef = useRef(null);
|
|
20
20
|
const handleButtonClick = () => {
|
|
21
21
|
handleClick(!isActive);
|
|
22
22
|
};
|
|
23
|
-
return _jsx(_Fragment, { children: searchField ? _jsx(DropdownSearchableTrigger, Object.assign({ value: inputValue || "", name: name, onChange: onSearchChange, isOpenPopup: isActive, inputRef: inputRef || elInpRef, handleClick: handleClick, ref: triggerRef, width: width, placeholder: placeholder, disabled: disabled, id: id, title: title, count: count, currentSelection: currentSelection, className: className, isError: isError, fullWidth: fullWidth, popupId: popupId }, otherProps)) : _jsx(FilterButton, Object.assign({ ref: triggerRef, id: id, name: name, onBlur: onBlur, className: classNames(["zen-dropdown__trigger-button", isError ? "zen-dropdown__trigger-button--error" : "", className || ""]), onClick: handleButtonClick, disabled: disabled, isActive: isActive, fullWidth: width ? true : fullWidth, maxWidth: width, minWidth: width, quantity: count || undefined, type: buttonType, title: title, ariaLabel: triggerAriaLabel || placeholder, "aria-expanded": isActive, "aria-haspopup": "dialog", "data-role": "dialog", "aria-controls": popupId }, otherProps, { children: currentSelection ? _jsx("span", { className: classNames(["zen-dropdown__trigger-button-text", buttonType ? `zen-dropdown__trigger-button-text--${buttonType.toString()}` : ""]), children: currentSelection }) : placeholder })) });
|
|
23
|
+
return (_jsx(_Fragment, { children: searchField ? (_jsx(DropdownSearchableTrigger, Object.assign({ value: inputValue || "", name: name, onChange: onSearchChange, isOpenPopup: isActive, inputRef: inputRef || elInpRef, handleClick: handleClick, handleFocusOnPopup: handleFocusOnPopup, ref: triggerRef, width: width, placeholder: placeholder, disabled: disabled, id: id, title: title, count: count, currentSelection: currentSelection, className: className, isError: isError, fullWidth: fullWidth, popupId: popupId }, otherProps))) : (_jsx(FilterButton, Object.assign({ ref: triggerRef, id: id, name: name, onBlur: onBlur, className: classNames(["zen-dropdown__trigger-button", isError ? "zen-dropdown__trigger-button--error" : "", className || ""]), onClick: handleButtonClick, disabled: disabled, isActive: isActive, fullWidth: width ? true : fullWidth, maxWidth: width, minWidth: width, quantity: count || undefined, type: buttonType, title: title, ariaLabel: triggerAriaLabel || placeholder, "aria-expanded": isActive, "aria-haspopup": "dialog", "data-role": "dialog", "aria-controls": popupId }, otherProps, { children: currentSelection ? (_jsx("span", { className: classNames(["zen-dropdown__trigger-button-text", buttonType ? `zen-dropdown__trigger-button-text--${buttonType.toString()}` : ""]), children: currentSelection })) : (placeholder) }))) }));
|
|
24
24
|
};
|
|
25
|
-
export const TRANSLATIONS = [
|
|
26
|
-
...SearchableTriggerTranslations
|
|
27
|
-
];
|
|
25
|
+
export const TRANSLATIONS = [...SearchableTriggerTranslations];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { IZenComponentProps } from "./../commonHelpers/zenComponent";
|
|
2
3
|
import { ReactElement } from "react";
|
|
3
4
|
import { IButton } from "../button/button";
|
|
@@ -5,10 +6,11 @@ import "./footerButtons.less";
|
|
|
5
6
|
export interface IFooterButtons extends IZenComponentProps {
|
|
6
7
|
children: ReactElement<IButton> | (ReactElement<IButton> | null | undefined)[];
|
|
7
8
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
* @deprecated
|
|
10
|
+
* @param stacked - will be removed in the next major release
|
|
11
|
+
*/
|
|
11
12
|
stacked?: boolean;
|
|
12
13
|
isSticky?: boolean;
|
|
14
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
13
15
|
}
|
|
14
|
-
export declare const FooterButtons: ({ className, children, isSticky }: IFooterButtons) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const FooterButtons: ({ className, children, isSticky, ref }: IFooterButtons) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,7 @@ const getChildren = (children) => {
|
|
|
9
9
|
}
|
|
10
10
|
return (React.Children.count(children) === 1 ? [children] : React.Children.toArray(children).filter((child) => React.isValidElement(child)));
|
|
11
11
|
};
|
|
12
|
-
export const FooterButtons = ({ className, children, isSticky = false }) => {
|
|
12
|
+
export const FooterButtons = ({ className, children, isSticky = false, ref }) => {
|
|
13
13
|
const footerButtonsId = useUniqueId();
|
|
14
14
|
const driveComponentClassName = useDriveClassName("zen-footer-buttons");
|
|
15
15
|
const maxLength = 3;
|
|
@@ -28,11 +28,6 @@ export const FooterButtons = ({ className, children, isSticky = false }) => {
|
|
|
28
28
|
});
|
|
29
29
|
return clonedElements;
|
|
30
30
|
}, [children, footerButtonsId]);
|
|
31
|
-
const containerClassNames = classNames([
|
|
32
|
-
|
|
33
|
-
isSticky && driveComponentClassName ? "zen-footer-buttons--sticky" : "",
|
|
34
|
-
driveComponentClassName || "",
|
|
35
|
-
className || ""
|
|
36
|
-
]);
|
|
37
|
-
return _jsx("div", { className: containerClassNames, children: childrenArray });
|
|
31
|
+
const containerClassNames = classNames(["zen-footer-buttons", isSticky && driveComponentClassName ? "zen-footer-buttons--sticky" : "", driveComponentClassName || "", className || ""]);
|
|
32
|
+
return (_jsx("div", { className: containerClassNames, ref: ref, children: childrenArray }));
|
|
38
33
|
};
|
|
@@ -190,14 +190,30 @@ injectString("tr", "Select Filters:", "Se\xE7ili Filtreler:");
|
|
|
190
190
|
injectString("zh-Hans", "Select Filters:", "\u9009\u4E2D\u7684\u7B5B\u9009\u5668\uFF1A");
|
|
191
191
|
injectString("zh-TW", "Select Filters:", "\u9078\u64C7\u7BE9\u9078\u689D\u4EF6\uFF1A");
|
|
192
192
|
injectString("ro-RO", "Select Filters:", "Selecta\u021Bi filtrele:");
|
|
193
|
+
injectString("cs", "Results", "V\xFDsledky");
|
|
193
194
|
injectString("da-DK", "Results", "Resultater");
|
|
195
|
+
injectString("de", "Results", "Ergebnisse");
|
|
194
196
|
injectString("en", "Results", "Results");
|
|
197
|
+
injectString("es", "Results", "Resultados");
|
|
195
198
|
injectString("fi-FI", "Results", "Tulokset");
|
|
199
|
+
injectString("fr", "Results", "R\xE9sultats");
|
|
200
|
+
injectString("fr-FR", "Results", "R\xE9sultats");
|
|
196
201
|
injectString("hu-HU", "Results", "Eredm\xE9nyek");
|
|
202
|
+
injectString("id", "Results", "Hasil");
|
|
203
|
+
injectString("it", "Results", "Risultati");
|
|
204
|
+
injectString("ja", "Results", "\u7D50\u679C");
|
|
197
205
|
injectString("ko-KR", "Results", "\uACB0\uACFC");
|
|
206
|
+
injectString("ms", "Results", "Keputusan");
|
|
198
207
|
injectString("nb-NO", "Results", "Resultater");
|
|
208
|
+
injectString("nl", "Results", "Resultaten");
|
|
209
|
+
injectString("pl", "Results", "Wyniki");
|
|
210
|
+
injectString("pt-BR", "Results", "Resultados");
|
|
199
211
|
injectString("pt-PT", "Results", "Resultados");
|
|
200
212
|
injectString("sk-SK", "Results", "V\xFDsledky");
|
|
213
|
+
injectString("sv", "Results", "Resultat");
|
|
214
|
+
injectString("th", "Results", "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C");
|
|
215
|
+
injectString("tr", "Results", "Sonu\xE7lar");
|
|
216
|
+
injectString("zh-Hans", "Results", "\u7ED3\u679C");
|
|
201
217
|
injectString("zh-TW", "Results", "\u7D50\u679C");
|
|
202
218
|
injectString("ro-RO", "Results", "Rezultate");
|
|
203
219
|
export const GroupsFilterInitialState = ({
|
|
@@ -104,6 +104,10 @@ export const GroupsFilterTrigger = _a => {
|
|
|
104
104
|
e.nativeEvent.stopImmediatePropagation();
|
|
105
105
|
handleClick();
|
|
106
106
|
}
|
|
107
|
+
if (e.key === "Tab" && isOpenPopup) {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
handleFocusOnPopup === null || handleFocusOnPopup === void 0 ? void 0 : handleFocusOnPopup();
|
|
110
|
+
}
|
|
107
111
|
};
|
|
108
112
|
const clickHandler = e => {
|
|
109
113
|
if (e.target === inputRef.current && isOpenPopup) {
|
|
@@ -27,6 +27,7 @@ export interface ILinkNavItem extends INavItemCommon {
|
|
|
27
27
|
export interface IButtonNavItem extends INavItemCommon {
|
|
28
28
|
onClick?: () => void;
|
|
29
29
|
menuAlignment?: TAlignment;
|
|
30
|
+
onDropdownStateChange?: (isOpen: boolean) => void;
|
|
30
31
|
}
|
|
31
32
|
interface INavItemContext {
|
|
32
33
|
parentLevel?: number;
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { classNames } from "../../commonHelpers/classNames/classNames";
|
|
14
|
-
import { useRef, useState, Children, cloneElement, createContext, useContext } from "react";
|
|
14
|
+
import { useRef, useState, useEffect, Children, cloneElement, createContext, useContext } from "react";
|
|
15
15
|
import { IconBeta } from "../../icons/iconBeta";
|
|
16
16
|
import { IconChevronRight } from "../../icons/iconChevronRight";
|
|
17
17
|
import { IconOpen2 } from "../../icons/iconOpen2";
|
|
@@ -70,9 +70,12 @@ const LinkNavItem = (_a) => {
|
|
|
70
70
|
};
|
|
71
71
|
LinkNavItem.displayName = "LinkNavItem";
|
|
72
72
|
const ButtonNavItem = (_a) => {
|
|
73
|
-
var { className, title, onClick, collapsed, active, children, tabIndex, menuAlignment = "right-top", isMenuItem = true, tooltipAlignment = defaultTooltipAlignment, actionIcon, actionIconTitle, onActionIconClick } = _a, rest = __rest(_a, ["className", "title", "onClick", "collapsed", "active", "children", "tabIndex", "menuAlignment", "isMenuItem", "tooltipAlignment", "actionIcon", "actionIconTitle", "onActionIconClick"]);
|
|
73
|
+
var { className, title, onClick, collapsed, active, children, tabIndex, menuAlignment = "right-top", isMenuItem = true, tooltipAlignment = defaultTooltipAlignment, actionIcon, actionIconTitle, onActionIconClick, onDropdownStateChange } = _a, rest = __rest(_a, ["className", "title", "onClick", "collapsed", "active", "children", "tabIndex", "menuAlignment", "isMenuItem", "tooltipAlignment", "actionIcon", "actionIconTitle", "onActionIconClick", "onDropdownStateChange"]);
|
|
74
74
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
75
75
|
const { parentLevel = 0, closeParentMenu } = useContext(NavItemContext);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
onDropdownStateChange === null || onDropdownStateChange === void 0 ? void 0 : onDropdownStateChange(menuOpen);
|
|
78
|
+
}, [menuOpen, onDropdownStateChange]);
|
|
76
79
|
const triggerRef = useRef(null);
|
|
77
80
|
const currentLevel = parentLevel + 1;
|
|
78
81
|
const validChildren = Children.toArray(children).filter(child => {
|
|
@@ -316,5 +316,6 @@
|
|
|
316
316
|
"This filter is currently applied.": "This filter is currently applied.",
|
|
317
317
|
"Remove filter": "Remove filter",
|
|
318
318
|
"Exit full screen table view": "Exit full screen table view",
|
|
319
|
-
"Close search": "Close search"
|
|
319
|
+
"Close search": "Close search",
|
|
320
|
+
"Has additional actions. Use right arrow to access button, left arrow to return.": "Has additional actions. Use right arrow to access button, left arrow to return."
|
|
320
321
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geotab/zenith",
|
|
3
|
-
"version": "3.7.0
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "Zenith components library on React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "esm/index.d.ts",
|
|
@@ -98,9 +98,6 @@
|
|
|
98
98
|
"react": "^19.2.0",
|
|
99
99
|
"react-dom": "^19.2.0"
|
|
100
100
|
},
|
|
101
|
-
"overrides": {
|
|
102
|
-
"serialize-javascript": "^7.0.3"
|
|
103
|
-
},
|
|
104
101
|
"files": [
|
|
105
102
|
"./dist/",
|
|
106
103
|
"./esm"
|