@geotab/zenith 1.23.0 → 1.24.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 +22 -0
- package/dist/banner/bannerMultipLine.js +4 -2
- package/dist/commonStyles/common.less +1 -0
- package/dist/commonStyles/rangeFieldMixin.less +23 -0
- package/dist/dataFeed/dataFeedColumnsItems.js +3 -0
- package/dist/dateRange/dateRange.js +9 -45
- package/dist/dropdown/dropdown.js +2 -1
- package/dist/dropdown/dropdownList.d.ts +0 -4
- package/dist/dropdown/dropdownList.js +1 -7
- package/dist/filtersBar/components/filtersBarDropdown/filtersBarDropdown.js +5 -8
- package/dist/filtersBar/components/filtersBarGroupButton/filtersBarGroupButton.js +1 -1
- package/dist/filtersBar/components/filtersBarGroupsFilter/filtersBarGroupsFilter.js +2 -2
- package/dist/filtersBar/components/filtersBarPeriodPicker/filtersBarPeriodPicker.js +1 -1
- package/dist/filtersBar/filtersBar.js +28 -2
- package/dist/filtersBar/filtersBarSidePanel/components/filtersBarSidePanelRange/filtersBarSidePanelRange.js +19 -3
- package/dist/filtersBar/filtersBarSidePanel/hooks/useDirection.d.ts +7 -0
- package/dist/filtersBar/filtersBarSidePanel/hooks/useDirection.js +32 -0
- package/dist/filtersBar/filtersContainer/filtersContainer.js +1 -1
- package/dist/groupsFilter/groupsFilter.js +7 -3
- package/dist/header/header.js +5 -1
- package/dist/index.css +670 -279
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -2
- package/dist/range/range.js +10 -3
- package/dist/range/rangeField.d.ts +3 -1
- package/dist/range/rangeField.js +3 -2
- package/dist/skeleton/skeleton.js +3 -1
- package/dist/skeletonList/skeletonList.d.ts +10 -0
- package/dist/skeletonList/skeletonList.js +23 -0
- package/dist/summaries/summaries.d.ts +10 -0
- package/dist/summaries/summaries.js +12 -0
- package/dist/summaries/utils/splitIntoPairs.d.ts +3 -0
- package/dist/summaries/utils/splitIntoPairs.js +12 -0
- package/dist/summary/summary.d.ts +14 -0
- package/dist/summary/summary.js +17 -0
- package/dist/utils/headerButtons/headerButtonsProvider.d.ts +17 -0
- package/dist/utils/headerButtons/headerButtonsProvider.js +20 -0
- package/dist/utils/localization/translations/cs-json.d.ts +1 -0
- package/dist/utils/localization/translations/cs-json.js +2 -1
- package/dist/utils/localization/translations/de-json.d.ts +1 -0
- package/dist/utils/localization/translations/de-json.js +2 -1
- package/dist/utils/localization/translations/en-json.d.ts +1 -0
- package/dist/utils/localization/translations/en-json.js +2 -1
- package/dist/utils/localization/translations/es-json.d.ts +1 -0
- package/dist/utils/localization/translations/es-json.js +2 -1
- package/dist/utils/localization/translations/fr-FR-json.d.ts +1 -0
- package/dist/utils/localization/translations/fr-FR-json.js +2 -1
- package/dist/utils/localization/translations/fr-json.d.ts +1 -0
- package/dist/utils/localization/translations/fr-json.js +2 -1
- package/dist/utils/localization/translations/id-json.d.ts +1 -0
- package/dist/utils/localization/translations/id-json.js +2 -1
- package/dist/utils/localization/translations/it-json.d.ts +1 -0
- package/dist/utils/localization/translations/it-json.js +2 -1
- package/dist/utils/localization/translations/ja-json.d.ts +1 -0
- package/dist/utils/localization/translations/ja-json.js +2 -1
- package/dist/utils/localization/translations/ko-KR-json.d.ts +1 -0
- package/dist/utils/localization/translations/ko-KR-json.js +2 -1
- package/dist/utils/localization/translations/ms-json.d.ts +1 -0
- package/dist/utils/localization/translations/ms-json.js +2 -1
- package/dist/utils/localization/translations/nl-json.d.ts +1 -0
- package/dist/utils/localization/translations/nl-json.js +2 -1
- package/dist/utils/localization/translations/pl-json.d.ts +1 -0
- package/dist/utils/localization/translations/pl-json.js +2 -1
- package/dist/utils/localization/translations/pt-BR-json.d.ts +1 -0
- package/dist/utils/localization/translations/pt-BR-json.js +2 -1
- package/dist/utils/localization/translations/sv-json.d.ts +1 -0
- package/dist/utils/localization/translations/sv-json.js +2 -1
- package/dist/utils/localization/translations/th-json.d.ts +1 -0
- package/dist/utils/localization/translations/th-json.js +2 -1
- package/dist/utils/localization/translations/tr-json.d.ts +1 -0
- package/dist/utils/localization/translations/tr-json.js +2 -1
- package/dist/utils/localization/translations/zh-Hans-json.d.ts +1 -0
- package/dist/utils/localization/translations/zh-Hans-json.js +2 -1
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -647,6 +647,8 @@ export { type TLazyContent, type TPromisableProps, LazyContent } from "./skeleto
|
|
|
647
647
|
export { type TSkeletonType, type ISkeleton, Skeleton } from "./skeleton/skeleton";
|
|
648
648
|
export { SortDirections, type ISortControl, SortControl } from "./sortControl/sortControl";
|
|
649
649
|
export { type IStepperInput, Stepper } from "./stepper/stepper";
|
|
650
|
+
export { Summaries } from "./summaries/summaries";
|
|
651
|
+
export { type ISummary, Summary } from "./summary/summary";
|
|
650
652
|
export { SummaryTileType, SummaryTileSize, type ISummaryTile, SummaryTileDisplayName, SummaryTile } from "./summaryTile/summaryTile";
|
|
651
653
|
export { type ISummaryTileTrigger, SummaryTileTrigger } from "./summaryTile/summaryTileTrigger";
|
|
652
654
|
export { getTypeClassName } from "./summaryTile/utils/getTypeClassName";
|
|
@@ -668,6 +670,7 @@ export { calculateArrowPosition } from "./tooltip/helpers/calculateArrowPosition
|
|
|
668
670
|
export { removeArrowClasses } from "./tooltip/helpers/removeArrowClasses";
|
|
669
671
|
export { type TooltipSize, type TMobileView, Tooltip } from "./tooltip/tooltip";
|
|
670
672
|
export { type IAbortablePromiseOptions, type IAbortablePromiseConstructor, AbortablePromise } from "./utils/abortablePromise";
|
|
673
|
+
export { HeaderButtonsProvider } from "./utils/headerButtons/headerButtonsProvider";
|
|
671
674
|
export { LanguageProvider } from "./utils/localization/languageProvider";
|
|
672
675
|
export { useLanguage } from "./utils/localization/useLanguage";
|
|
673
676
|
export { ThemeDark } from "./utils/theme/themeDark";
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,8 @@ exports.IconPrinter = exports.IconPound = exports.IconPlusSquare = exports.IconP
|
|
|
14
14
|
exports.IconSmiley = exports.IconSign = exports.IconSidebar = exports.IconShield4 = exports.IconShield3 = exports.IconShield2 = exports.IconShield = exports.IconShare3 = exports.IconShare2 = exports.IconShare = exports.IconSettings8 = exports.IconSettings7 = exports.IconSettings6 = exports.IconSettings4 = exports.IconSettings3 = exports.IconSettings2 = exports.IconSettings1 = exports.IconServer3 = exports.IconServer2 = exports.IconServer = exports.IconSend = exports.IconSecuredLines = exports.IconSecured = exports.IconSeatbelt = exports.IconSearchPage = exports.IconSearchLines = exports.IconSearchDocument = exports.IconSearch = exports.IconSdCard = exports.IconRuler = exports.IconRoute = exports.IconRotateRepeat2 = exports.IconRotateRepeat = exports.IconRotateCounterclockwise = exports.IconRotateClockwise = exports.IconResizeSmall = exports.IconResizeBig = exports.IconRepeat2 = exports.IconRepeat = exports.IconRemovePeople = exports.IconRefrigeration = exports.IconRedo2 = exports.IconRedo = exports.IconRecord = exports.IconReceipt = exports.IconRadar = exports.IconQuestion = exports.IconPuzzle = exports.IconPullRequest = exports.IconProcessor = void 0;
|
|
15
15
|
exports.IconVolumeOn = exports.IconVolumeOff = exports.IconVolumeOf = exports.IconVolumeMinimum = exports.IconVolumeHalf = exports.IconVolumeFull = exports.IconVolumeDown = exports.IconVoice = exports.IconVisitPage = exports.IconVideoReplay = exports.IconVideo2 = exports.IconVideo = exports.IconUsbHub = exports.IconUsb = exports.IconUpload = exports.IconUnlocked = exports.IconUndock = exports.IconUndo2 = exports.IconUndo = exports.IconUnderline = exports.IconUmbrella = exports.IconTrailer = exports.IconThumbsUp = exports.IconThumbsDown = exports.IconThermometer = exports.IconThermograph = exports.IconTextSize = exports.IconTelevision2 = exports.IconTelevision = exports.IconTarget3 = exports.IconTarget2 = exports.IconTarget = exports.IconTachographTimeCard = exports.IconTachograph = exports.IconTable = exports.IconSupport = exports.IconSun = exports.IconStrikeThrough = exports.IconStore = exports.IconStorage = exports.IconStopwatch = exports.IconStarFilled = exports.IconStarAi = exports.IconStar = exports.IconSquare = exports.IconSpeaker = exports.IconSortVertical = exports.IconSortHorizontal = exports.IconSort2Vertical = exports.IconSort2Horizontal = void 0;
|
|
16
16
|
exports.PageContentLayout = exports.Notification = exports.getPredefinedFocusableItem = exports.DialogContentNew = exports.Modal = exports.MobileSheet = exports.MiniTabs = exports.MiniTabsSize = exports.isLink = exports.isButton = exports.findPrevFocusable = exports.findNextFocusable = exports.findLastFocusable = exports.findFirstFocusable = exports.Menu = exports.ControlledMenu = exports.changeOrder = exports.ListItem = exports.List = exports.ItemData = exports.ItemCompact = exports.LineChartMini = exports.getDefaultDatasetStyle = exports.htmlLegendPlugin = exports.LEGEND_PLUGIN_ID = exports.LineChart = exports.useLayoutSize = exports.LayoutFullScreenProvider = exports.useLayoutFullScreen = exports.LayoutFullScreenElementProvider = exports.useLayoutFullScreenElement = exports.Layout = exports.ImageNothingFound = exports.IconZoom2 = exports.IconZoom = exports.IconZone = exports.IconYen = exports.IconWrite = exports.IconWrench = exports.IconWorld = exports.IconWorkday = exports.IconWifi2 = exports.IconWifi = exports.IconWhisper = exports.IconWebcam = exports.IconWatch2 = exports.IconWatch = exports.IconWarning = exports.IconWallet1 = exports.IconWallet = void 0;
|
|
17
|
-
exports.
|
|
18
|
-
exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useLanguage = exports.LanguageProvider = exports.AbortablePromise = exports.Tooltip = exports.removeArrowClasses = exports.calculateArrowPosition = exports.ToggleButton = exports.Toast = exports.useToast = exports.TimePicker = void 0;
|
|
17
|
+
exports.TextInputRaw = exports.TextInput = exports.TextIconButton = exports.ButtonIconPosition = exports.Tabs = exports.TabsDisplayName = exports.ActionLinkColumn = exports.CheckboxColumn = exports.MainColumn = exports.ActionsColumn = exports.getSortableValue = exports.ColumnSortDirection = exports.getEmptySelection = exports.Table = exports.TabBarContent = exports.TabBar = exports.SummaryTileBarDisplayName = exports.SummaryTileBar = exports.getTypeClassName = exports.SummaryTileTrigger = exports.SummaryTile = exports.SummaryTileDisplayName = exports.SummaryTileSize = exports.SummaryTileType = exports.Summary = exports.Summaries = exports.Stepper = exports.SortControl = exports.SortDirections = exports.Skeleton = exports.LazyContent = exports.SidePanel = exports.CUSTOM_POPUP_COMPONENT_CLASSNAME = exports.SidePanelCloseReason = exports.isChildPopup = exports.SelectField = exports.Select = exports.SearchInput = exports.Range = exports.RadioGroup = exports.Radio = exports.ProgressBar = exports.ProgreesBarSize = exports.ProgressBarType = exports.Popup = exports.PillExpandable = exports.Pill = exports.PaginationType = exports.Pagination = exports.PageLayout = void 0;
|
|
18
|
+
exports.Waiting = exports.UserFormatProvider = exports.useDrive = exports.ThemeProvider = exports.ThemeDrive = exports.ThemeDark = exports.useLanguage = exports.LanguageProvider = exports.HeaderButtonsProvider = exports.AbortablePromise = exports.Tooltip = exports.removeArrowClasses = exports.calculateArrowPosition = exports.ToggleButton = exports.Toast = exports.useToast = exports.TimePicker = exports.TextareaRaw = exports.Textarea = void 0;
|
|
19
19
|
/* eslint-disable max-len */
|
|
20
20
|
var absolute_1 = require("./absolute/absolute");
|
|
21
21
|
Object.defineProperty(exports, "Absolute", { enumerable: true, get: function () { return absolute_1.Absolute; } });
|
|
@@ -1382,6 +1382,10 @@ Object.defineProperty(exports, "SortDirections", { enumerable: true, get: functi
|
|
|
1382
1382
|
Object.defineProperty(exports, "SortControl", { enumerable: true, get: function () { return sortControl_1.SortControl; } });
|
|
1383
1383
|
var stepper_1 = require("./stepper/stepper");
|
|
1384
1384
|
Object.defineProperty(exports, "Stepper", { enumerable: true, get: function () { return stepper_1.Stepper; } });
|
|
1385
|
+
var summaries_1 = require("./summaries/summaries");
|
|
1386
|
+
Object.defineProperty(exports, "Summaries", { enumerable: true, get: function () { return summaries_1.Summaries; } });
|
|
1387
|
+
var summary_1 = require("./summary/summary");
|
|
1388
|
+
Object.defineProperty(exports, "Summary", { enumerable: true, get: function () { return summary_1.Summary; } });
|
|
1385
1389
|
var summaryTile_1 = require("./summaryTile/summaryTile");
|
|
1386
1390
|
Object.defineProperty(exports, "SummaryTileType", { enumerable: true, get: function () { return summaryTile_1.SummaryTileType; } });
|
|
1387
1391
|
Object.defineProperty(exports, "SummaryTileSize", { enumerable: true, get: function () { return summaryTile_1.SummaryTileSize; } });
|
|
@@ -1437,6 +1441,8 @@ var tooltip_1 = require("./tooltip/tooltip");
|
|
|
1437
1441
|
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return tooltip_1.Tooltip; } });
|
|
1438
1442
|
var abortablePromise_1 = require("./utils/abortablePromise");
|
|
1439
1443
|
Object.defineProperty(exports, "AbortablePromise", { enumerable: true, get: function () { return abortablePromise_1.AbortablePromise; } });
|
|
1444
|
+
var headerButtonsProvider_1 = require("./utils/headerButtons/headerButtonsProvider");
|
|
1445
|
+
Object.defineProperty(exports, "HeaderButtonsProvider", { enumerable: true, get: function () { return headerButtonsProvider_1.HeaderButtonsProvider; } });
|
|
1440
1446
|
var languageProvider_1 = require("./utils/localization/languageProvider");
|
|
1441
1447
|
Object.defineProperty(exports, "LanguageProvider", { enumerable: true, get: function () { return languageProvider_1.LanguageProvider; } });
|
|
1442
1448
|
var useLanguage_1 = require("./utils/localization/useLanguage");
|
package/dist/range/range.js
CHANGED
|
@@ -12,6 +12,7 @@ const rangeField_1 = require("./rangeField");
|
|
|
12
12
|
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
13
13
|
const rangeHelper_1 = require("./rangeHelper");
|
|
14
14
|
const formFieldError_1 = require("../formFieldError/formFieldError");
|
|
15
|
+
const useDirection_1 = require("../filtersBar/filtersBarSidePanel/hooks/useDirection");
|
|
15
16
|
const Range = ({ className, onChange, value, labelMin, labelMax, unit, defaultValue, disabled, label, min, max, id, fullWidthTriggerButton, fullBounded, allowEqualMinMax, error, triggerAriaLabel }) => {
|
|
16
17
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
17
18
|
const [currentValue, setCurrentValue] = (0, react_1.useState)(value);
|
|
@@ -22,8 +23,13 @@ const Range = ({ className, onChange, value, labelMin, labelMax, unit, defaultVa
|
|
|
22
23
|
const prevValueRef = (0, react_1.useRef)(value);
|
|
23
24
|
const minRef = (0, react_1.useRef)(null);
|
|
24
25
|
const maxRef = (0, react_1.useRef)(null);
|
|
26
|
+
const { directionState, setContainerNode } = (0, useDirection_1.useDirection)("column");
|
|
25
27
|
const blurTimeoutRef = (0, react_1.useRef)(null);
|
|
26
28
|
const { translate } = (0, useLanguage_1.useLanguage)();
|
|
29
|
+
// This is the callback ref
|
|
30
|
+
const setFieldsContainerRef = (0, react_1.useCallback)((node) => {
|
|
31
|
+
setContainerNode(node);
|
|
32
|
+
}, [setContainerNode]);
|
|
27
33
|
const getSelection = (0, react_1.useCallback)(() => {
|
|
28
34
|
let selection = value.min !== null && value.max !== null ? `${value.min} - ${value.max}` : "";
|
|
29
35
|
if (!selection && value.min !== null) {
|
|
@@ -92,10 +98,11 @@ const Range = ({ className, onChange, value, labelMin, labelMax, unit, defaultVa
|
|
|
92
98
|
setCurrentValue(value);
|
|
93
99
|
}
|
|
94
100
|
}, [currentValue.min, currentValue.max, value]);
|
|
95
|
-
const memoizedMinRangeField = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(rangeField_1.RangeField, { className: "zen-range__min-field", label: labelMin || translate("Min"), unit: unit, value: currentValue.min, id: "min", inputRef: minRef, errorString: (0, rangeHelper_1.getErrorString)("min", currentValue.min, translate, errorType, min, max), onChange: handleChange, onBlur: handleBlur, max: max, min: min }), [translate, unit,
|
|
96
|
-
const memoizedMaxRangeField = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(rangeField_1.RangeField, { className: "zen-range__max-field", label: labelMax || translate("Max"), unit: unit, value: currentValue.max, id: "max", inputRef: maxRef, errorString: (0, rangeHelper_1.getErrorString)("max", currentValue.max, translate, errorType, min, max), onChange: handleChange, onBlur: handleBlur, max: max, min: min }), [max, min, labelMax, handleChange, handleBlur, currentValue.max, translate, unit, errorType]);
|
|
101
|
+
const memoizedMinRangeField = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(rangeField_1.RangeField, { className: "zen-range__min-field", label: labelMin || translate("Min"), unit: unit, value: currentValue.min, id: "min", inputRef: minRef, errorString: (0, rangeHelper_1.getErrorString)("min", currentValue.min, translate, errorType, min, max), onChange: handleChange, onBlur: handleBlur, max: max, min: min, isMinField: true, direction: directionState }), [labelMin, translate, unit, currentValue.min, errorType, min, max, handleChange, handleBlur, directionState]);
|
|
102
|
+
const memoizedMaxRangeField = (0, react_1.useMemo)(() => (0, jsx_runtime_1.jsx)(rangeField_1.RangeField, { className: "zen-range__max-field", label: labelMax || translate("Max"), unit: unit, value: currentValue.max, id: "max", inputRef: maxRef, errorString: (0, rangeHelper_1.getErrorString)("max", currentValue.max, translate, errorType, min, max), onChange: handleChange, onBlur: handleBlur, max: max, min: min, isMinField: false, direction: directionState }), [max, min, labelMax, handleChange, handleBlur, currentValue.max, translate, unit, errorType, directionState]);
|
|
97
103
|
const selection = (0, react_1.useMemo)(() => getSelection(), [getSelection]);
|
|
98
|
-
return (0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-range", error ? "zen-range--error" : "", className || ""]), children: [(0, jsx_runtime_1.jsx)(filterButton_1.FilterButton, { ariaLabel: triggerAriaLabel, ref: triggerRef, id: id || triggerId, className: "zen-range__trigger-button", onClick: handleTriggerClick, disabled: disabled, isActive: isOpen, fullWidth: fullWidthTriggerButton, title: selection ? translate("{rangeName} values {values}").replace("{rangeName}", label).replace("{values}", selection) : "", children: selection ? (0, jsx_runtime_1.jsx)("span", { className: "zen-range__trigger-button-text", children: selection }) : label }), (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, { error: error }), (0, jsx_runtime_1.jsx)(controlledPopup_1.ControlledPopup, { isOpen: isOpen, className: (0, classNames_1.classNames)(["zen-range-popup zen-shadow-dropdown-default", className ? className : ""]), onOpenChange: handleTriggerClick, useTrapFocusWithTrigger: "on", alignment: "bottom-left", shouldHoldScroll: true, triggerRef: triggerRef, ariaLabel: translate("Range Filter popup"), recalculateOnScroll: true, children: (0, jsx_runtime_1.jsxs)("div", { ref: contentRef, className: "zen-range__content", children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-range__label
|
|
104
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-range", error ? "zen-range--error" : "", className || ""]), children: [(0, jsx_runtime_1.jsx)(filterButton_1.FilterButton, { ariaLabel: triggerAriaLabel, ref: triggerRef, id: id || triggerId, className: "zen-range__trigger-button", onClick: handleTriggerClick, disabled: disabled, isActive: isOpen, fullWidth: fullWidthTriggerButton, title: selection ? translate("{rangeName} values {values}").replace("{rangeName}", label).replace("{values}", selection) : "", children: selection ? (0, jsx_runtime_1.jsx)("span", { className: "zen-range__trigger-button-text", children: selection }) : label }), (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, { error: error }), (0, jsx_runtime_1.jsx)(controlledPopup_1.ControlledPopup, { isOpen: isOpen, className: (0, classNames_1.classNames)(["zen-range-popup zen-shadow-dropdown-default", className ? className : ""]), onOpenChange: handleTriggerClick, useTrapFocusWithTrigger: "on", alignment: "bottom-left", shouldHoldScroll: true, triggerRef: triggerRef, ariaLabel: translate("Range Filter popup"), recalculateOnScroll: true, children: (0, jsx_runtime_1.jsxs)("div", { ref: contentRef, className: "zen-range__content", children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-range__label zen-ellipsis", children: label }), (0, jsx_runtime_1.jsxs)("div", { className: "zen-range__fields-wrapper", children: [(0, jsx_runtime_1.jsxs)("div", { ref: setFieldsContainerRef, className: (0, classNames_1.classNames)(["zen-range__fields-container", directionState === "row" ? "zen-range__fields-container--row" : "zen-range__fields-container--column"]), children: [memoizedMinRangeField, memoizedMaxRangeField] }), errorType !== undefined && directionState === "row" ? (0, jsx_runtime_1.jsx)(formFieldError_1.FormFieldError, { className: "zen-range__error", error: [(0, rangeHelper_1.getErrorString)("min", currentValue.min, translate, errorType, min, max) || "", (0, rangeHelper_1.getErrorString)("max", currentValue.max, translate, errorType, min, max) || ""] })
|
|
105
|
+
: null] }), (0, jsx_runtime_1.jsxs)("div", { className: "zen-range__footer", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleClearClick, disabled: isClearDisabled(), className: "zen-range__clear-button", type: buttonType_1.ButtonType.Tertiary, title: translate("Clear"), "data-validated-button": true, children: translate("Clear") }), (0, jsx_runtime_1.jsxs)("div", { className: "zen-range__button-group", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleCancelClick, className: "zen-range__cancel-button", title: translate("Cancel"), "data-validated-button": true, children: translate("Cancel") }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleApplyClick, type: buttonType_1.ButtonType.Primary, disabled: isApplyDisabled(), className: "zen-range__apply-button", title: translate("Apply"), "data-validated-button": true, children: translate("Apply") })] })] })] }) })] });
|
|
99
106
|
};
|
|
100
107
|
exports.Range = Range;
|
|
101
108
|
exports.TRANSLATIONS = [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./rangeField.less";
|
|
3
|
+
import { TDirection } from "../filtersBar/filtersBarSidePanel/hooks/useDirection";
|
|
3
4
|
export interface IRangeField {
|
|
4
5
|
onChange: (id: string, value: number | null) => void;
|
|
5
6
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
@@ -13,6 +14,7 @@ export interface IRangeField {
|
|
|
13
14
|
id: string;
|
|
14
15
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
15
16
|
errorString?: string;
|
|
16
|
-
|
|
17
|
+
direction?: TDirection;
|
|
18
|
+
isMinField: boolean;
|
|
17
19
|
}
|
|
18
20
|
export declare const RangeField: React.FC<IRangeField>;
|
package/dist/range/rangeField.js
CHANGED
|
@@ -6,7 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const textInput_1 = require("../textInput/textInput");
|
|
7
7
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
8
8
|
const iconException_1 = require("../icons/iconException");
|
|
9
|
-
const RangeField = ({ value, onChange, onBlur, id, label, unit, disabled, min, max, inputRef, errorString, className,
|
|
9
|
+
const RangeField = ({ value, onChange, onBlur, id, label, unit, disabled, min, max, inputRef, errorString, className, direction, isMinField }) => {
|
|
10
10
|
const inputId = (0, react_1.useId)();
|
|
11
11
|
const labelId = (0, react_1.useId)();
|
|
12
12
|
const unitId = (0, react_1.useId)();
|
|
@@ -14,6 +14,7 @@ const RangeField = ({ value, onChange, onBlur, id, label, unit, disabled, min, m
|
|
|
14
14
|
const newValue = e.target.value ? Number(e.target.value) : null;
|
|
15
15
|
onChange(id, newValue);
|
|
16
16
|
};
|
|
17
|
-
return (0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-range-field",
|
|
17
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: (0, classNames_1.classNames)(["zen-range-field", direction === "row" ? "zen-range-field--row" : "zen-range-field--column",
|
|
18
|
+
isMinField ? "zen-range-field--min" : "zen-range-field--max", className || ""]), children: [(0, jsx_runtime_1.jsxs)("div", { className: "zen-range-field__content", children: [(0, jsx_runtime_1.jsx)("label", { className: "zen-range-field__label zen-ellipsis", id: labelId, htmlFor: inputId, children: label }), (0, jsx_runtime_1.jsx)("div", { className: "zen-range-field__input-container", children: (0, jsx_runtime_1.jsx)(textInput_1.TextInput, { inputClassName: (0, classNames_1.classNames)(["zen-range-field__input", errorString ? "zen-text-input--error" : ""]), value: value !== null ? value.toString() : "", placeholder: "", onChange: handleChange, onBlur: onBlur, disabled: disabled, type: "number", ref: inputRef, id: inputId, error: "", ariaLabelledby: `${labelId} ${unit ? unitId : ""}`, min: min, max: max }) }), unit ? (0, jsx_runtime_1.jsx)("div", { id: unitId, className: "zen-range-field__sense zen-ellipsis", children: (0, jsx_runtime_1.jsx)("div", { className: "zen-range-field__sense-text zen-ellipsis", children: unit }) }) : null] }), errorString && direction !== "row" ? (0, jsx_runtime_1.jsxs)("div", { className: "zen-range-field__error", children: [(0, jsx_runtime_1.jsx)(iconException_1.IconException, { className: "zen-range-field__error-icon", size: "bigger" }), (0, jsx_runtime_1.jsx)("div", { className: "zen-range-field__error-text", children: errorString })] }) : null] });
|
|
18
19
|
};
|
|
19
20
|
exports.RangeField = RangeField;
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Skeleton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
6
|
+
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
6
7
|
const Skeleton = ({ type = "text", height, width = "100%", className }) => {
|
|
8
|
+
const { translate } = (0, useLanguage_1.useLanguage)();
|
|
7
9
|
const classNameList = (0, classNames_1.classNames)(["zen-skeleton", `zen-skeleton--${type}`, className || ""]);
|
|
8
|
-
return (0, jsx_runtime_1.jsx)("div", { role: "progressbar", style: { height: height, width: width ? width : "100%" }, className: classNameList.trim() });
|
|
10
|
+
return (0, jsx_runtime_1.jsx)("div", { role: "progressbar", "aria-label": translate("Loading"), style: { height: height, width: width ? width : "100%" }, className: classNameList.trim() });
|
|
9
11
|
};
|
|
10
12
|
exports.Skeleton = Skeleton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./skeletonList.less";
|
|
3
|
+
import { IZenComponentProps } from "./../commonHelpers/zenComponent";
|
|
4
|
+
type ISkeletonListSize = "small" | "medium" | "large";
|
|
5
|
+
export interface ISkeletonList extends Omit<IZenComponentProps, "children"> {
|
|
6
|
+
width?: number;
|
|
7
|
+
size?: ISkeletonListSize;
|
|
8
|
+
}
|
|
9
|
+
export declare const SkeletonList: React.FC<ISkeletonList>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SkeletonList = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
6
|
+
const skeleton_1 = require("../skeleton/skeleton");
|
|
7
|
+
const SkeletonList = ({ className, width, size = "small" }) => {
|
|
8
|
+
const styleWidth = width ? { style: { width: `${width}px` } } : {};
|
|
9
|
+
const itemWidth = 115;
|
|
10
|
+
const itemHeight = 14;
|
|
11
|
+
const getSizeCount = (value) => {
|
|
12
|
+
if (value === "large") {
|
|
13
|
+
return 12;
|
|
14
|
+
}
|
|
15
|
+
if (value === "medium") {
|
|
16
|
+
return 8;
|
|
17
|
+
}
|
|
18
|
+
return 4;
|
|
19
|
+
};
|
|
20
|
+
const count = getSizeCount(size);
|
|
21
|
+
return (0, jsx_runtime_1.jsx)("div", Object.assign({}, styleWidth, { className: (0, classNames_1.classNames)(["zen-skeleton-list", className || ""]), children: Array.from({ length: count }, (_, index) => ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { width: itemWidth, height: itemHeight }, `skeleton-${index}`))) }));
|
|
22
|
+
};
|
|
23
|
+
exports.SkeletonList = SkeletonList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { ISummary } from "../summary/summary";
|
|
3
|
+
import "./summaries.less";
|
|
4
|
+
type SummariesType = "row" | "column" | "two-columns";
|
|
5
|
+
interface ISummaries {
|
|
6
|
+
children: ReactElement<ISummary>[];
|
|
7
|
+
type: SummariesType;
|
|
8
|
+
}
|
|
9
|
+
export declare const Summaries: React.FC<ISummaries>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Summaries = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const splitIntoPairs_1 = require("./utils/splitIntoPairs");
|
|
6
|
+
const Summaries = ({ type, children }) => {
|
|
7
|
+
if (type === "two-columns") {
|
|
8
|
+
return (0, jsx_runtime_1.jsx)("div", { className: `zen-summaries__${type}`, children: (0, splitIntoPairs_1.splitIntoPairs)(children).map((pair, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "zen-summaries__two-columns-container", children: [pair[0], pair[1]] }, `summaries-item-${index}`))) });
|
|
9
|
+
}
|
|
10
|
+
return (0, jsx_runtime_1.jsx)("div", { className: `zen-summaries__${type}`, children: children });
|
|
11
|
+
};
|
|
12
|
+
exports.Summaries = Summaries;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitIntoPairs = void 0;
|
|
4
|
+
function splitIntoPairs(arr) {
|
|
5
|
+
const pairs = [];
|
|
6
|
+
for (let i = 0; i < arr.length; i += 2) {
|
|
7
|
+
const pair = arr.slice(i, i + 2);
|
|
8
|
+
pairs.push(pair); // Type assertion as slice returns T[]
|
|
9
|
+
}
|
|
10
|
+
return pairs;
|
|
11
|
+
}
|
|
12
|
+
exports.splitIntoPairs = splitIntoPairs;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import "./summary.less";
|
|
3
|
+
export interface ISummary {
|
|
4
|
+
color?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
value: string | number;
|
|
7
|
+
unit?: string;
|
|
8
|
+
tooltip?: React.ReactNode;
|
|
9
|
+
more?: ReactNode;
|
|
10
|
+
isEnabled?: boolean;
|
|
11
|
+
onToggle?: () => void;
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Summary: React.FC<ISummary>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Summary = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const tooltip_1 = require("../tooltip/tooltip");
|
|
7
|
+
const iconInfoCircle_1 = require("../icons/iconInfoCircle");
|
|
8
|
+
const classNames_1 = require("../commonHelpers/classNames/classNames");
|
|
9
|
+
const useLanguage_1 = require("../utils/localization/useLanguage");
|
|
10
|
+
const Summary = ({ color, title, value, unit, tooltip, more, isEnabled, onToggle, description }) => {
|
|
11
|
+
const isClickable = (0, react_1.useMemo)(() => color && onToggle, [color, onToggle]);
|
|
12
|
+
const { translate } = (0, useLanguage_1.useLanguage)();
|
|
13
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: "zen-summary", children: [(color || title || tooltip) && (0, jsx_runtime_1.jsxs)("div", { className: "zen-summary__header", children: [color && (0, jsx_runtime_1.jsx)("button", { "aria-label": translate("Summary color"), className: (0, classNames_1.classNames)(["zen-summary__color", isClickable ? "zen-summary__clickable" : ""]), style: { backgroundColor: color }, onClick: onToggle }), isClickable ?
|
|
14
|
+
(0, jsx_runtime_1.jsx)("button", { className: (0, classNames_1.classNames)(["zen-summary__title-text zen-ellipsis heading-05 zen-summary__clickable", isEnabled ? "zen-summary__crossed-out" : ""]), onClick: onToggle, children: title }) :
|
|
15
|
+
(0, jsx_runtime_1.jsx)("div", { className: "zen-summary__title-text zen-ellipsis heading-05", children: title }), tooltip && (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { alignment: "top", size: "auto", trigger: (0, jsx_runtime_1.jsx)("div", { className: "zen-summary__trigger", children: (0, jsx_runtime_1.jsx)(iconInfoCircle_1.IconInfoCircle, { size: "large", className: "zen-summary__title-icon" }) }), children: tooltip })] }), (0, jsx_runtime_1.jsxs)("div", { className: "zen-summary__data", children: [(0, jsx_runtime_1.jsx)("div", { className: "zen-summary__value zen-ellipsis", children: value }), unit && (0, jsx_runtime_1.jsx)("div", { className: "zen-summary__unit", children: unit }), more && (0, jsx_runtime_1.jsx)("div", { className: "zen-summary__more zen-ellipsis", children: more })] }), description && (0, jsx_runtime_1.jsx)("div", { className: "zen-summary__content", children: description })] });
|
|
16
|
+
};
|
|
17
|
+
exports.Summary = Summary;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC, ReactElement, PropsWithChildren } from "react";
|
|
2
|
+
import { IHeaderButton } from "../../header/headerButton";
|
|
3
|
+
interface IHeaderButtonsFormat {
|
|
4
|
+
buttons: ReactElement<IHeaderButton>[];
|
|
5
|
+
priority?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const headerButtonsFormatContext: import("react").Context<IHeaderButtonsFormat>;
|
|
8
|
+
interface IHeaderButtonsProviderProps extends PropsWithChildren {
|
|
9
|
+
buttons?: ReactElement<IHeaderButton>[];
|
|
10
|
+
priority?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const HeaderButtonsProvider: FC<IHeaderButtonsProviderProps>;
|
|
13
|
+
export declare const useHeaderButtons: () => {
|
|
14
|
+
buttons: ReactElement<IHeaderButton, string | import("react").JSXElementConstructor<any>>[];
|
|
15
|
+
priority: boolean | undefined;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useHeaderButtons = exports.HeaderButtonsProvider = exports.headerButtonsFormatContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_2 = require("react");
|
|
7
|
+
exports.headerButtonsFormatContext = (0, react_2.createContext)({
|
|
8
|
+
buttons: [],
|
|
9
|
+
priority: false
|
|
10
|
+
});
|
|
11
|
+
const HeaderButtonsProvider = ({ buttons, priority, children }) => ((0, jsx_runtime_1.jsx)(exports.headerButtonsFormatContext.Provider, { value: {
|
|
12
|
+
buttons: buttons || [],
|
|
13
|
+
priority: priority || false
|
|
14
|
+
}, children: children }));
|
|
15
|
+
exports.HeaderButtonsProvider = HeaderButtonsProvider;
|
|
16
|
+
const useHeaderButtons = () => {
|
|
17
|
+
const { buttons, priority } = (0, react_1.useContext)(exports.headerButtonsFormatContext);
|
|
18
|
+
return { buttons, priority };
|
|
19
|
+
};
|
|
20
|
+
exports.useHeaderButtons = useHeaderButtons;
|