@geotab/zenith 3.8.0-beta.1 → 3.9.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -12
- package/dist/button/button.d.ts +2 -1
- package/dist/button/button.js +3 -3
- package/dist/calendar/calendar.js +201 -4
- package/dist/card/card.d.ts +1 -1
- package/dist/card/card.js +1 -1
- package/dist/card/components/cardButton/cardButton.d.ts +2 -1
- package/dist/card/components/cardButton/cardButton.js +5 -3
- package/dist/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/dist/chart/barChart/getBarLegendItems.js +3 -5
- package/dist/chart/lineChart/getLineLegendItems.js +7 -7
- package/dist/chart/pieChart/centerTextPlugin.js +13 -5
- package/dist/chart/pieChart/getPieLegendItems.js +8 -12
- package/dist/chart/pieChart.js +13 -11
- package/dist/chart/plugins/legend/interfaces.d.ts +1 -1
- package/dist/commonHelpers/generateId.d.ts +8 -0
- package/dist/commonHelpers/generateId.js +8 -0
- package/dist/commonHelpers/hooks/ssrProvider.d.ts +14 -0
- package/dist/commonHelpers/hooks/ssrProvider.js +12 -0
- package/dist/commonHelpers/hooks/useClientReady.js +3 -1
- package/dist/commonHelpers/hooks/useDeviceType.js +6 -2
- package/dist/commonHelpers/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/commonHelpers/hooks/useIsomorphicLayoutEffect.js +6 -0
- package/dist/commonHelpers/hooks/useMobile.js +4 -3
- package/dist/commonHelpers/hooks/usePortal.js +2 -5
- package/dist/commonHelpers/isDomEnv.js +1 -2
- package/dist/commonHelpers/useUniqueId.d.ts +6 -0
- package/dist/commonHelpers/useUniqueId.js +8 -2
- package/dist/commonHelpers/utils.d.ts +0 -1
- package/dist/commonHelpers/utils.js +1 -3
- package/dist/commonStyles/common.less +13 -1
- package/dist/commonStyles/fonts/notosarabic/LICENSE.txt +93 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Bold.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Bold.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Medium.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Medium.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Regular.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-Regular.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-SemiBold.woff +0 -0
- package/dist/commonStyles/fonts/notosarabic/NotoSansArabic-SemiBold.woff2 +0 -0
- package/dist/commonStyles/fonts/notosarabic.less +43 -0
- package/dist/commonStyles/pillStyles/pillContent.less +2 -3
- package/dist/commonStyles/pillStyles/pillStyles.less +1 -2
- package/dist/commonStyles/pillStyles/pillTextContent.less +2 -2
- package/dist/commonStyles/typography/typography.less +440 -305
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +5 -3
- package/dist/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +2 -38
- package/dist/dateInputInner/dateInputInnerControlBlock.js +12 -8
- package/dist/dateRangeRaw/dateRangeRaw.js +5 -1
- package/dist/dialog/dialog.js +4 -3
- package/dist/feedbackContainer/feedbackContainer.js +4 -4
- package/dist/fileUpload/fileUpload.js +21 -12
- package/dist/filters/components/filtersSidePanel.d.ts +1 -1
- package/dist/filters/components/filtersSidePanel.js +123 -116
- package/dist/filters/filters.js +1 -2
- package/dist/filtersBar/filtersBar.d.ts +2 -0
- package/dist/filtersBar/filtersBar.js +5 -3
- package/dist/filtersBar/filtersBarActions/filtersBarActions.js +3 -1
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +3 -0
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
- package/dist/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +86 -80
- package/dist/formFieldError/formFieldError.d.ts +2 -1
- package/dist/formFieldError/formFieldError.js +2 -2
- package/dist/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +1 -1
- package/dist/index.css +3210 -2238
- package/dist/index.d.ts +3 -5
- package/dist/index.js +24 -29
- package/dist/menu/components/menuItem.js +4 -4
- package/dist/menu/controlledMenu.js +4 -4
- package/dist/nav/nav.js +10 -5
- package/dist/nav/navAddMenu/navAddMenu.js +1 -2
- package/dist/nav/navEditList/navEditListUtils.d.ts +1 -1
- package/dist/nav/navEditList/navEditListUtils.js +2 -1
- package/dist/nav/navItem/navActionItem.js +3 -3
- package/dist/nav/navItem/navItem.js +1 -2
- package/dist/pageHeader/pageHeaderActions.js +4 -3
- package/dist/rangeRaw/rangeRaw.js +7 -1
- package/dist/selectList/selectList.js +11 -7
- package/dist/selectRaw/selectRaw.js +1 -1
- package/dist/shield/shield.js +5 -3
- package/dist/sidePanel/sidePanel.js +9 -8
- package/dist/summaryTile/summaryTile.d.ts +1 -3
- package/dist/summaryTile/summaryTile.js +1 -2
- package/dist/table/children/useTableChildren.d.ts +1 -1
- package/dist/table/children/useTableChildren.js +3 -3
- package/dist/table/flexible/useFlexibleColumns.js +39 -1
- package/dist/table/nested/useNestedRows.d.ts +1 -0
- package/dist/table/nested/useNestedRows.js +3 -3
- package/dist/table/selectable/useSelectableRows.d.ts +9 -0
- package/dist/table/selectable/useSelectableRows.js +18 -11
- package/dist/table/table.js +1 -7
- package/dist/{card/components → title}/title.d.ts +1 -1
- package/dist/title/title.js +27 -0
- package/dist/toggleButtonRaw/toggleButtonRaw.js +3 -1
- package/dist/toggleButtonRaw/types.d.ts +1 -0
- package/dist/tooltip/tooltip.d.ts +2 -1
- package/dist/tooltip/tooltip.js +68 -64
- package/dist/utils/localization/directionContext.d.ts +3 -0
- package/dist/utils/localization/directionContext.js +5 -0
- package/dist/utils/localization/getTextDirection.d.ts +2 -0
- package/dist/utils/localization/getTextDirection.js +6 -0
- package/dist/utils/localization/languageProvider.js +15 -1
- package/dist/utils/localization/translations/en-json.d.ts +2 -0
- package/dist/utils/localization/translations/en-json.js +3 -1
- package/dist/utils/localization/translations/en.json +3 -0
- package/dist/utils/localization/useDirection.d.ts +2 -0
- package/dist/utils/localization/useDirection.js +7 -0
- package/esm/button/button.d.ts +2 -1
- package/esm/button/button.js +3 -3
- package/esm/calendar/calendar.js +201 -4
- package/esm/card/card.d.ts +1 -1
- package/esm/card/card.js +1 -1
- package/esm/card/components/cardButton/cardButton.d.ts +2 -1
- package/esm/card/components/cardButton/cardButton.js +5 -3
- package/esm/card/helpers/getIconTypeFromStatus.d.ts +1 -1
- package/esm/chart/barChart/getBarLegendItems.js +3 -5
- package/esm/chart/lineChart/getLineLegendItems.js +7 -7
- package/esm/chart/pieChart/centerTextPlugin.js +13 -5
- package/esm/chart/pieChart/getPieLegendItems.js +8 -12
- package/esm/chart/pieChart.js +14 -12
- package/esm/chart/plugins/legend/interfaces.d.ts +1 -1
- package/esm/commonHelpers/generateId.d.ts +8 -0
- package/esm/commonHelpers/generateId.js +8 -0
- package/esm/commonHelpers/hooks/ssrProvider.d.ts +14 -0
- package/esm/commonHelpers/hooks/ssrProvider.js +6 -0
- package/esm/commonHelpers/hooks/useClientReady.js +4 -2
- package/esm/commonHelpers/hooks/useDeviceType.js +7 -3
- package/esm/commonHelpers/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/esm/commonHelpers/hooks/useIsomorphicLayoutEffect.js +3 -0
- package/esm/commonHelpers/hooks/useMobile.js +4 -3
- package/esm/commonHelpers/hooks/usePortal.js +2 -5
- package/esm/commonHelpers/isDomEnv.js +1 -2
- package/esm/commonHelpers/useUniqueId.d.ts +6 -0
- package/esm/commonHelpers/useUniqueId.js +7 -1
- package/esm/commonHelpers/utils.d.ts +0 -1
- package/esm/commonHelpers/utils.js +0 -1
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.d.ts +5 -3
- package/esm/dataGrid/withSelectableRows/components/bulkActions/bulkActions.js +2 -38
- package/esm/dateInputInner/dateInputInnerControlBlock.js +13 -9
- package/esm/dateRangeRaw/dateRangeRaw.js +5 -1
- package/esm/dialog/dialog.js +4 -3
- package/esm/feedbackContainer/feedbackContainer.js +4 -4
- package/esm/fileUpload/fileUpload.js +21 -12
- package/esm/filters/components/filtersSidePanel.d.ts +1 -1
- package/esm/filters/components/filtersSidePanel.js +123 -116
- package/esm/filters/filters.js +2 -3
- package/esm/filtersBar/filtersBar.d.ts +2 -0
- package/esm/filtersBar/filtersBar.js +5 -3
- package/esm/filtersBar/filtersBarActions/filtersBarActions.js +3 -1
- package/esm/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +3 -0
- package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.d.ts +1 -1
- package/esm/filtersBar/filtersBarSidePanel/filtersBarSidePanel.js +86 -80
- package/esm/formFieldError/formFieldError.d.ts +2 -1
- package/esm/formFieldError/formFieldError.js +2 -2
- package/esm/header/components/collapsedItemsControl/utils/handleCustomMenuWrapper.js +1 -1
- package/esm/index.d.ts +3 -5
- package/esm/index.js +3 -5
- package/esm/menu/components/menuItem.js +1 -1
- package/esm/menu/controlledMenu.js +1 -1
- package/esm/nav/nav.js +10 -5
- package/esm/nav/navAddMenu/navAddMenu.js +2 -3
- package/esm/nav/navEditList/navEditListUtils.d.ts +1 -1
- package/esm/nav/navEditList/navEditListUtils.js +2 -1
- package/esm/nav/navItem/navActionItem.js +3 -2
- package/esm/nav/navItem/navItem.js +2 -3
- package/esm/pageHeader/pageHeaderActions.js +4 -3
- package/esm/rangeRaw/rangeRaw.js +7 -1
- package/esm/selectList/selectList.js +11 -7
- package/esm/selectRaw/selectRaw.js +1 -1
- package/esm/shield/shield.js +5 -3
- package/esm/sidePanel/sidePanel.js +9 -8
- package/esm/summaryTile/summaryTile.d.ts +1 -3
- package/esm/summaryTile/summaryTile.js +1 -2
- package/esm/table/children/useTableChildren.d.ts +1 -1
- package/esm/table/children/useTableChildren.js +3 -3
- package/esm/table/flexible/useFlexibleColumns.js +39 -1
- package/esm/table/nested/useNestedRows.d.ts +1 -0
- package/esm/table/nested/useNestedRows.js +1 -1
- package/esm/table/selectable/useSelectableRows.d.ts +9 -0
- package/esm/table/selectable/useSelectableRows.js +15 -8
- package/esm/table/table.js +1 -7
- package/esm/{card/components → title}/title.d.ts +1 -1
- package/esm/title/title.js +23 -0
- package/esm/toggleButtonRaw/toggleButtonRaw.js +3 -1
- package/esm/toggleButtonRaw/types.d.ts +1 -0
- package/esm/tooltip/tooltip.d.ts +2 -1
- package/esm/tooltip/tooltip.js +68 -64
- package/esm/utils/localization/directionContext.d.ts +3 -0
- package/esm/utils/localization/directionContext.js +2 -0
- package/esm/utils/localization/getTextDirection.d.ts +2 -0
- package/esm/utils/localization/getTextDirection.js +2 -0
- package/esm/utils/localization/languageProvider.js +15 -1
- package/esm/utils/localization/translations/en-json.d.ts +2 -0
- package/esm/utils/localization/translations/en-json.js +3 -1
- package/esm/utils/localization/translations/en.json +3 -0
- package/esm/utils/localization/useDirection.d.ts +2 -0
- package/esm/utils/localization/useDirection.js +3 -0
- package/package.json +33 -31
- package/dist/card/components/title.js +0 -22
- package/dist/commonHelpers/hooks/deviceProvider.d.ts +0 -7
- package/dist/commonHelpers/hooks/deviceProvider.js +0 -11
- package/esm/card/components/title.js +0 -18
- package/esm/commonHelpers/hooks/deviceProvider.d.ts +0 -7
- package/esm/commonHelpers/hooks/deviceProvider.js +0 -4
|
@@ -63,7 +63,7 @@ const mergeStates = (initialState, newState) => {
|
|
|
63
63
|
});
|
|
64
64
|
return state;
|
|
65
65
|
};
|
|
66
|
-
const FiltersBar = ({ className, children, isAllFiltersVisible, hideAllFiltersButton, parentElement, selectedQuantity, ignoreNewFunctionality, pillName, pillIcon, pillType, toggleAllFilters, getDefaultFiltersState, onClearAllFilters, onApplyAllFilters }) => {
|
|
66
|
+
const FiltersBar = ({ className, children, isAllFiltersVisible, hideAllFiltersButton, parentElement, selectedQuantity, trailingContent, ignoreNewFunctionality, pillName, pillIcon, pillType, toggleAllFilters, getDefaultFiltersState, onClearAllFilters, onApplyAllFilters }) => {
|
|
67
67
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
68
68
|
ignoreNewFunctionality; // TODO: remove after deprecated ignoreNewFunctionality removed
|
|
69
69
|
const allFiltersRef = (0, react_1.useRef)(null);
|
|
@@ -134,7 +134,9 @@ const FiltersBar = ({ className, children, isAllFiltersVisible, hideAllFiltersBu
|
|
|
134
134
|
}
|
|
135
135
|
}, [filterBarChildren, memoizedShouldUpdate, sidePanelState, stateFromChildren]);
|
|
136
136
|
const searchChild = childrenArray.find(child => child && typeof child === "object" && "type" in child && child.type === filtersBarSearch_1.FiltersBarSearch);
|
|
137
|
-
|
|
137
|
+
(0, react_1.useEffect)(() => {
|
|
138
|
+
setSearchComponent(searchChild);
|
|
139
|
+
}, [searchChild, setSearchComponent]);
|
|
138
140
|
(0, react_1.useEffect)(() => {
|
|
139
141
|
setFiltersBarToggleAllFiltersFn(toggleAllFilters);
|
|
140
142
|
}, [toggleAllFilters, setFiltersBarToggleAllFiltersFn]);
|
|
@@ -236,7 +238,7 @@ const FiltersBar = ({ className, children, isAllFiltersVisible, hideAllFiltersBu
|
|
|
236
238
|
if (!isClientReady) {
|
|
237
239
|
return null;
|
|
238
240
|
}
|
|
239
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isMobile && ((0, jsx_runtime_1.jsxs)("div", { ref: toolbarRef, className: (0, classNames_1.classNames)(["zen-filters-toolbar", noActions ? "zen-filters-toolbar--no-actions" : "", className !== null && className !== void 0 ? className : ""]), children: [(0, jsx_runtime_1.jsx)(filtersContainer_1.FiltersContainer, { children: filterBarChildren }), (0, jsx_runtime_1.jsx)(filtersBarActions_1.FiltersBarActions, { allFiltersRef: allFiltersRef, onShowAllFilters: () => toggleAllFiltersCallback(true), onClearFilters: handleClearClick, selectedQuantity: selectedQuantity !== undefined ? selectedQuantity : filtersBarState.currentNumberOfChangedFilters, selectedQuantityToDisplay: selectedQuantity !== undefined ? selectedQuantity : filtersBarState.numberOfChangedFilters, hideAllFiltersButton: isAllFiltersButtonHidden, onApplyButtonClick: onApplyAllFilters ? handleApplyAllFilters(false) : undefined, isApplyButtonShown: isApplyButtonShown })] })), !isAllFiltersButtonHidden ? sidePanel : null] }));
|
|
241
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!isMobile && ((0, jsx_runtime_1.jsxs)("div", { ref: toolbarRef, className: (0, classNames_1.classNames)(["zen-filters-toolbar", noActions ? "zen-filters-toolbar--no-actions" : "", className !== null && className !== void 0 ? className : ""]), children: [(0, jsx_runtime_1.jsx)(filtersContainer_1.FiltersContainer, { children: filterBarChildren }), (0, jsx_runtime_1.jsx)(filtersBarActions_1.FiltersBarActions, { allFiltersRef: allFiltersRef, onShowAllFilters: () => toggleAllFiltersCallback(true), onClearFilters: handleClearClick, selectedQuantity: selectedQuantity !== undefined ? selectedQuantity : filtersBarState.currentNumberOfChangedFilters, selectedQuantityToDisplay: selectedQuantity !== undefined ? selectedQuantity : filtersBarState.numberOfChangedFilters, hideAllFiltersButton: isAllFiltersButtonHidden, onApplyButtonClick: onApplyAllFilters ? handleApplyAllFilters(false) : undefined, isApplyButtonShown: isApplyButtonShown }), trailingContent && (0, jsx_runtime_1.jsx)("div", { className: "zen-filters-toolbar__trailing-content", children: trailingContent })] })), !isAllFiltersButtonHidden ? sidePanel : null] }));
|
|
240
242
|
};
|
|
241
243
|
exports.FiltersBar = FiltersBar;
|
|
242
244
|
exports.FiltersBar.Search = filtersBarSearch_1.FiltersBarSearch;
|
|
@@ -14,6 +14,7 @@ const buttonType_1 = require("../../button/buttonType");
|
|
|
14
14
|
const textIconButton_1 = require("../../textIconButton/textIconButton");
|
|
15
15
|
const useLanguage_1 = require("../../utils/localization/useLanguage");
|
|
16
16
|
const iconSettings6_1 = require("../../icons/iconSettings6");
|
|
17
|
+
injectString("en", "Active filters: {}", "Active filters: {}");
|
|
17
18
|
injectString("cs", "Filters", "Filtry");
|
|
18
19
|
injectString("da-DK", "Filters", "Filtre");
|
|
19
20
|
injectString("de", "Filters", "Filter");
|
|
@@ -118,6 +119,7 @@ const FiltersBarActions = ({
|
|
|
118
119
|
onClick: onShowAllFilters,
|
|
119
120
|
icon: iconSettings6_1.IconSettings6,
|
|
120
121
|
iconPosition: textIconButton_1.ButtonIconPosition.Start,
|
|
122
|
+
"aria-label": selectedQuantityToDisplay && selectedQuantityToDisplay > 0 ? translate("Active filters: {}").replace("{}", selectedQuantityToDisplay.toString()) : translate("Filters"),
|
|
121
123
|
children: (0, jsx_runtime_1.jsxs)("span", {
|
|
122
124
|
className: "zen-filters-toolbar__action-label",
|
|
123
125
|
children: [translate("Filters"), selectedQuantityToDisplay && selectedQuantityToDisplay > 0 ? (0, jsx_runtime_1.jsx)("span", {
|
|
@@ -143,4 +145,4 @@ const FiltersBarActions = ({
|
|
|
143
145
|
});
|
|
144
146
|
};
|
|
145
147
|
exports.FiltersBarActions = FiltersBarActions;
|
|
146
|
-
exports.TRANSLATIONS = ["Filters", "Clear", "Search"];
|
|
148
|
+
exports.TRANSLATIONS = ["Filters", "Clear", "Search", "Active filters: {}"];
|
|
@@ -86,6 +86,7 @@ const FiltersBarSidePanelRange = ({
|
|
|
86
86
|
}) => {
|
|
87
87
|
const generatedId = (0, react_1.useId)();
|
|
88
88
|
const intId = id || generatedId;
|
|
89
|
+
const rangeErrorId = `${intId}-error`;
|
|
89
90
|
const [currentValue, setCurrentValue] = (0, react_1.useState)(value);
|
|
90
91
|
const [errorType, setErrorType] = (0, react_1.useState)(undefined);
|
|
91
92
|
const prevValueRef = (0, react_1.useRef)(value);
|
|
@@ -160,11 +161,13 @@ const FiltersBarSidePanelRange = ({
|
|
|
160
161
|
return (0, jsx_runtime_1.jsxs)("div", {
|
|
161
162
|
ref: setFieldsContainerRef,
|
|
162
163
|
id: intId,
|
|
164
|
+
"aria-describedby": errorType !== undefined && directionState === "row" ? rangeErrorId : undefined,
|
|
163
165
|
className: (0, classNames_1.classNames)(["zen-filters-bar-side-panel-range", className || ""]),
|
|
164
166
|
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
165
167
|
className: rangeFieldContainerClasses,
|
|
166
168
|
children: [memoizedMinRangeField, memoizedMaxRangeField]
|
|
167
169
|
}), errorType !== undefined && directionState === "row" ? (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, {
|
|
170
|
+
id: rangeErrorId,
|
|
168
171
|
className: "zen-filters-bar-side-panel-range__error",
|
|
169
172
|
error: [(0, rangeHelper_1.getErrorString)("min", currentValue.min, translate, errorType, min, max) || "", (0, rangeHelper_1.getErrorString)("max", currentValue.max, translate, errorType, min, max) || ""]
|
|
170
173
|
}) : null]
|
|
@@ -20,7 +20,7 @@ interface IFiltersBarSidePanelInternal extends IZenComponentProps {
|
|
|
20
20
|
}
|
|
21
21
|
export interface IFiltersBarSidePanel extends Pick<IFiltersBarSidePanelInternal, "className" | "children" | "state" | "dispatch"> {
|
|
22
22
|
}
|
|
23
|
-
export declare const FiltersBarSidePanel: ({ isOpen, className, children, triggerRef, parentElement, pillName, pillIcon, pillType, onClosePanel, getDefaultFiltersState, state, dispatch, onApplyAllFilters }: IFiltersBarSidePanelInternal) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const FiltersBarSidePanel: ({ isOpen, className, children, triggerRef, parentElement, pillName, pillIcon, pillType, onClosePanel, getDefaultFiltersState, state, dispatch, onApplyAllFilters }: IFiltersBarSidePanelInternal) => import("react/jsx-runtime").JSX.Element | null;
|
|
24
24
|
export declare const FiltersBarSidePanelContainer: (_: IFiltersBarSidePanel) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export declare const TRANSLATIONS: string[];
|
|
26
26
|
export {};
|
|
@@ -163,8 +163,9 @@ const useUniqueId_1 = require("../../commonHelpers/useUniqueId");
|
|
|
163
163
|
const useBodyScroll_1 = require("../../utils/useBodyScroll");
|
|
164
164
|
const footerButtons_1 = require("../../footerButtons/footerButtons");
|
|
165
165
|
const pill_1 = require("../../pill/pill");
|
|
166
|
-
const react_dom_1 = require("react-dom");
|
|
167
166
|
const zen_1 = require("../../utils/zen");
|
|
167
|
+
const usePortal_1 = require("../../commonHelpers/hooks/usePortal");
|
|
168
|
+
const useClientReady_1 = require("../../commonHelpers/hooks/useClientReady");
|
|
168
169
|
const getChangeHandlers = children => {
|
|
169
170
|
const handlers = {};
|
|
170
171
|
react_1.Children.map(children, child => {
|
|
@@ -309,95 +310,100 @@ const FiltersBarSidePanel = ({
|
|
|
309
310
|
handleClose();
|
|
310
311
|
};
|
|
311
312
|
}, [isOpen, setScrollHidden, resetScroll]);
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
children: (0, jsx_runtime_1.jsxs)("div", {
|
|
325
|
-
className: "zen-side-panel-filters-bar-wrapper",
|
|
313
|
+
const isClientReady = (0, useClientReady_1.useClientReady)();
|
|
314
|
+
const portal = (0, usePortal_1.usePortal)((0, jsx_runtime_1.jsx)(sidePanel_1.SidePanel, {
|
|
315
|
+
triggerRef: triggerRef,
|
|
316
|
+
isOpen: isOpen,
|
|
317
|
+
label: translate("All Filters"),
|
|
318
|
+
onHidePanel: onCloseAction,
|
|
319
|
+
className: (0, classNames_1.classNames)(["zen-side-panel-filters-bar", dark ? "zen-dark" : "", className !== null && className !== void 0 ? className : ""]),
|
|
320
|
+
onTransitionEnd: handleReadyForFocus,
|
|
321
|
+
children: (0, jsx_runtime_1.jsxs)("div", {
|
|
322
|
+
className: "zen-side-panel-filters-bar-wrapper",
|
|
323
|
+
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
324
|
+
className: "zen-side-panel-filters-bar__header",
|
|
326
325
|
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
327
|
-
className: "zen-side-panel-filters-
|
|
328
|
-
children: [(0, jsx_runtime_1.
|
|
329
|
-
className: "zen-side-panel-filters-bar__title-
|
|
330
|
-
children:
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
326
|
+
className: "zen-side-panel-filters-bar__title-wrapper",
|
|
327
|
+
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
328
|
+
className: "zen-side-panel-filters-bar__title zen-ellipsis",
|
|
329
|
+
children: translate("All Filters")
|
|
330
|
+
}), pillName ? (0, jsx_runtime_1.jsx)("div", {
|
|
331
|
+
className: "zen-side-panel-filters-bar__title-pill",
|
|
332
|
+
children: (0, jsx_runtime_1.jsx)(pill_1.Pill, {
|
|
333
|
+
type: pillType,
|
|
334
|
+
icon: pillIcon,
|
|
335
|
+
children: pillName
|
|
336
|
+
})
|
|
337
|
+
}) : null]
|
|
338
|
+
}), (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, {
|
|
339
|
+
type: "tertiary-black",
|
|
340
|
+
className: "zen-side-panel-filters-bar__close-button",
|
|
341
|
+
icon: iconClose_1.IconClose,
|
|
342
|
+
iconSize: isMobile ? "huge" : "large",
|
|
343
|
+
onClick: onClosePanel,
|
|
344
|
+
iconPosition: textIconButton_2.ButtonIconPosition.Start,
|
|
345
|
+
title: translate("Close")
|
|
346
|
+
})]
|
|
347
|
+
}), (0, jsx_runtime_1.jsx)("div", {
|
|
348
|
+
className: "zen-side-panel-filters-bar__content",
|
|
349
|
+
children: newChildren
|
|
350
|
+
}), (0, jsx_runtime_1.jsx)("div", {
|
|
351
|
+
className: (0, classNames_1.classNames)(["zen-side-panel-filters-bar__footer", isMobile ? "zen-side-panel-filters-bar__footer--mobile" : "", isLongTextLanguages && !isMobile ? "zen-side-panel-filters-bar__footer--long-text" : ""]),
|
|
352
|
+
children: isMobile ? (0, jsx_runtime_1.jsxs)(footerButtons_1.FooterButtons, {
|
|
353
|
+
children: [(0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
354
|
+
className: "zen-side-panel-filters-bar__apply-button",
|
|
355
|
+
disabled: applyDisabled,
|
|
356
|
+
onClick: onApplyFilters,
|
|
357
|
+
type: "primary",
|
|
358
|
+
children: translate("Apply")
|
|
359
|
+
}), (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
360
|
+
className: "zen-side-panel-filters-bar__cancel-button",
|
|
361
|
+
type: "secondary",
|
|
346
362
|
onClick: onClosePanel,
|
|
347
|
-
|
|
348
|
-
|
|
363
|
+
children: translate("Cancel")
|
|
364
|
+
}), (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
365
|
+
className: "zen-side-panel-filters-bar__clear-button",
|
|
366
|
+
onClick: onResetFilters,
|
|
367
|
+
type: "tertiary",
|
|
368
|
+
children: translate("Reset All")
|
|
349
369
|
})]
|
|
350
|
-
})
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
370
|
+
}) : (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
|
|
371
|
+
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
372
|
+
className: "zen-side-panel-filters-bar__footer-section",
|
|
373
|
+
children: (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
374
|
+
type: "tertiary",
|
|
375
|
+
className: "zen-side-panel-filters-bar__clear-button",
|
|
376
|
+
onClick: onResetFilters,
|
|
377
|
+
children: translate("Reset All")
|
|
378
|
+
})
|
|
379
|
+
}), (0, jsx_runtime_1.jsxs)("div", {
|
|
380
|
+
className: "zen-side-panel-filters-bar__footer-section",
|
|
356
381
|
children: [(0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
357
|
-
className: "zen-side-panel-filters-bar__apply-button",
|
|
358
|
-
disabled: applyDisabled,
|
|
359
|
-
onClick: onApplyFilters,
|
|
360
|
-
type: "primary",
|
|
361
|
-
children: translate("Apply")
|
|
362
|
-
}), (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
363
382
|
className: "zen-side-panel-filters-bar__cancel-button",
|
|
364
383
|
type: "secondary",
|
|
365
384
|
onClick: onClosePanel,
|
|
366
385
|
children: translate("Cancel")
|
|
367
386
|
}), (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
368
|
-
className: "zen-side-panel-filters-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}) : (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
|
|
374
|
-
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
375
|
-
className: "zen-side-panel-filters-bar__footer-section",
|
|
376
|
-
children: (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
377
|
-
type: "tertiary",
|
|
378
|
-
className: "zen-side-panel-filters-bar__clear-button",
|
|
379
|
-
onClick: onResetFilters,
|
|
380
|
-
children: translate("Reset All")
|
|
381
|
-
})
|
|
382
|
-
}), (0, jsx_runtime_1.jsxs)("div", {
|
|
383
|
-
className: "zen-side-panel-filters-bar__footer-section",
|
|
384
|
-
children: [(0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
385
|
-
className: "zen-side-panel-filters-bar__cancel-button",
|
|
386
|
-
type: "secondary",
|
|
387
|
-
onClick: onClosePanel,
|
|
388
|
-
children: translate("Cancel")
|
|
389
|
-
}), (0, jsx_runtime_1.jsx)(button_1.Button, {
|
|
390
|
-
className: "zen-side-panel-filters-bar__apply-button zen-side-panel-filters-bar__apply-button--desktop",
|
|
391
|
-
disabled: applyDisabled,
|
|
392
|
-
onClick: onApplyFilters,
|
|
393
|
-
type: "primary",
|
|
394
|
-
children: translate("Apply")
|
|
395
|
-
})]
|
|
387
|
+
className: "zen-side-panel-filters-bar__apply-button zen-side-panel-filters-bar__apply-button--desktop",
|
|
388
|
+
disabled: applyDisabled,
|
|
389
|
+
onClick: onApplyFilters,
|
|
390
|
+
type: "primary",
|
|
391
|
+
children: translate("Apply")
|
|
396
392
|
})]
|
|
397
|
-
})
|
|
398
|
-
})
|
|
399
|
-
})
|
|
400
|
-
})
|
|
393
|
+
})]
|
|
394
|
+
})
|
|
395
|
+
})]
|
|
396
|
+
})
|
|
397
|
+
}), (_b = parentElement !== null && parentElement !== void 0 ? parentElement : (_a = zen_1.zen.document) === null || _a === void 0 ? void 0 : _a.fullscreenElement) !== null && _b !== void 0 ? _b : (_c = zen_1.zen.document) === null || _c === void 0 ? void 0 : _c.body);
|
|
398
|
+
if (!isClientReady) {
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
return (0, jsx_runtime_1.jsxs)(react_1.Fragment, {
|
|
402
|
+
children: [(0, jsx_runtime_1.jsx)(shield_1.Shield, {
|
|
403
|
+
className: "zen-high-level-shield",
|
|
404
|
+
dataShieldId: dataShieldId,
|
|
405
|
+
isVisible: isOpen
|
|
406
|
+
}), portal]
|
|
401
407
|
});
|
|
402
408
|
};
|
|
403
409
|
exports.FiltersBarSidePanel = FiltersBarSidePanel;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "./formFieldError.less";
|
|
2
2
|
interface IFormFieldError {
|
|
3
|
+
id?: string;
|
|
3
4
|
className?: string;
|
|
4
5
|
error?: string | string[];
|
|
5
6
|
}
|
|
6
|
-
export declare const FormFieldError: ({ className, error }: IFormFieldError) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare const FormFieldError: ({ id, className, error }: IFormFieldError) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
8
|
export {};
|
|
@@ -6,12 +6,12 @@ const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
|
6
6
|
const iconException_1 = require("../icons/iconException");
|
|
7
7
|
const useDrive_1 = require("../utils/theme/useDrive");
|
|
8
8
|
const useDriveClassName_1 = require("../utils/theme/useDriveClassName");
|
|
9
|
-
const FormFieldError = ({ className, error }) => {
|
|
9
|
+
const FormFieldError = ({ id, className, error }) => {
|
|
10
10
|
const driveComponentClass = (0, useDriveClassName_1.useDriveClassName)("zen-form-field-error");
|
|
11
11
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
12
12
|
const errorStrings = Array.isArray(error)
|
|
13
13
|
? error.filter(el => el).map((erStr, ind) => (0, jsx_runtime_1.jsx)("div", { children: erStr }, `error_str_${ind}`))
|
|
14
14
|
: error && (0, jsx_runtime_1.jsx)("div", { children: error });
|
|
15
|
-
return error ? ((0, jsx_runtime_1.jsxs)("
|
|
15
|
+
return error ? ((0, jsx_runtime_1.jsxs)("span", { id: id, className: (0, classNames_1.classNames)(["zen-form-field-error", driveComponentClass || "", className || ""]), children: [(0, jsx_runtime_1.jsx)(iconException_1.IconException, { className: "zen-form-field-error__error-icon", size: isDrive ? "large" : "bigger" }), (0, jsx_runtime_1.jsx)("span", { className: "zen-form-field-error__error-text", children: errorStrings })] })) : null;
|
|
16
16
|
};
|
|
17
17
|
exports.FormFieldError = FormFieldError;
|
|
@@ -36,7 +36,7 @@ const handleCustomMenuWrapper = (reactNode, content, menuItems) => {
|
|
|
36
36
|
const el = (0, react_1.createElement)(menu_1.Menu.Item, {
|
|
37
37
|
id: reactNode.props.id || menu.props.id,
|
|
38
38
|
key: reactNode.props.id || menu.props.id,
|
|
39
|
-
name: reactNode.props.name || "",
|
|
39
|
+
name: reactNode.props.name || menu.props.name || "",
|
|
40
40
|
disabled: reactNode.props.disabled || menu.props.disabled,
|
|
41
41
|
link: reactNode.props.link || menu.props.link,
|
|
42
42
|
target: reactNode.props.target || menu.props.target,
|