@geotab/zenith 1.20.0-beta.0 → 1.20.0-beta.2
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 +6 -0
- package/dist/chart/lineChart.js +1 -1
- package/dist/dataGrid/withSortableColumns/columns/sortableColumnWrapper.js +1 -1
- package/dist/filtersBar/components/filtersBarPeriodPicker/filtersBarPeriodPicker.d.ts +1 -1
- package/dist/lineChart/lineChart.d.ts +3 -0
- package/dist/lineChart/lineChart.js +3 -0
- package/dist/stepperRaw/utils/onBeforeInput.js +0 -9
- package/dist/table/sortable/sortableHeader.js +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -42,12 +42,18 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
42
42
|
|
|
43
43
|
## 1.20.0
|
|
44
44
|
|
|
45
|
+
* New component `Chart`
|
|
45
46
|
* Add feature to detect range value in DateRange
|
|
46
47
|
* Add possibility to prevent unchecking selection in SelectField
|
|
47
48
|
* Add icon IconLaptop and deprecated duplicated
|
|
48
49
|
* Audit: Feedback (Modal and Banner)
|
|
49
50
|
* Fix GroupsButton positioning
|
|
50
51
|
* Fix sort indicator in Table
|
|
52
|
+
* Collect all Zenith documentation in one file
|
|
53
|
+
|
|
54
|
+
## 1.19.1
|
|
55
|
+
|
|
56
|
+
* Fix stepper issue with decimal values
|
|
51
57
|
|
|
52
58
|
## 1.19.0
|
|
53
59
|
|
package/dist/chart/lineChart.js
CHANGED
|
@@ -59,6 +59,7 @@ const LineChart = (_a) => {
|
|
|
59
59
|
const tooltipId = (0, react_1.useMemo)(() => (0, generateId_1.generateId)(), []);
|
|
60
60
|
const { isHidden, toggleHidden } = (0, useHidden_1.useHidden)();
|
|
61
61
|
const { toLocalDateTime } = (0, react_1.useContext)(userFormatContext_1.userFormatContext);
|
|
62
|
+
const isTimedData = (0, react_1.useMemo)(() => (0, isDateRange_1.isDateRange)(data, true), [data]);
|
|
62
63
|
const chartData = (0, react_1.useMemo)(() => {
|
|
63
64
|
const chData = Object.assign({}, data);
|
|
64
65
|
chData.datasets = chData.datasets.map((ds, i) => (0, getDefaultDatasetStyle_1.getDefaultDatasetStyle)(ds, i));
|
|
@@ -72,7 +73,6 @@ const LineChart = (_a) => {
|
|
|
72
73
|
chData.datasets = chData.datasets.map((ds, i) => isHidden(ds.parentIndex !== undefined ? ds.parentIndex : i) ? Object.assign(Object.assign({}, ds), { hidden: true }) : ds);
|
|
73
74
|
return (0, convertDates_1.convertDates)(chData, toLocalDateTime);
|
|
74
75
|
}, [data, isHidden, toLocalDateTime]);
|
|
75
|
-
const isTimedData = (0, react_1.useMemo)(() => (0, isDateRange_1.isDateRange)(chartData, true), [chartData]);
|
|
76
76
|
const yAxisMeta = (0, react_1.useMemo)(() => (0, getYAxisMeta_1.getYAxisMeta)(chartData), [chartData]);
|
|
77
77
|
const xAxisMeta = (0, react_1.useMemo)(() => (0, getXAxisMeta_1.getXAxisMeta)(chartData, isTimedData), [chartData, isTimedData]);
|
|
78
78
|
const { chartRef, ticks } = (0, useChartTicks_1.useChartTicks)();
|
|
@@ -47,7 +47,7 @@ const SortableHeaderCell = ({ columnName, isSortedBy, sortDirection, title, tool
|
|
|
47
47
|
sortDirection === columnSortDirection_1.ColumnSortDirection.Ascending
|
|
48
48
|
? "zen-sortable-column-button--dir-asc"
|
|
49
49
|
: "zen-sortable-column-button--dir-desc"
|
|
50
|
-
]), title: iconTitle, "aria-label": iconTitle,
|
|
50
|
+
]), title: iconTitle, "aria-label": iconTitle, onMouseDown: () => {
|
|
51
51
|
onSortChange({
|
|
52
52
|
sortColumn: columnName,
|
|
53
53
|
sortDirection: sortDirection === columnSortDirection_1.ColumnSortDirection.Ascending
|
|
@@ -49,7 +49,7 @@ export interface IFiltersBarPeriodPicker extends Omit<IFiltersBarPeriodPickerImp
|
|
|
49
49
|
export type IPeriodPickerUnsetValue = IDateRangeValueOptionalLabel | IDateRangeValue | undefined;
|
|
50
50
|
interface IFiltersBarPeriodPickerUnsetValueImp extends IFiltersBarItem<IPeriodPickerUnsetValue, IFiltersBarDateRangePickerUnsetValue> {
|
|
51
51
|
props: IFiltersBarDateRangePickerUnsetValue;
|
|
52
|
-
defaultState:
|
|
52
|
+
defaultState: IDateRangeValue | undefined;
|
|
53
53
|
className?: string;
|
|
54
54
|
checkError?: (isError: boolean) => void;
|
|
55
55
|
sidePanelMaxGroupedItemsLength?: number;
|
|
@@ -14,5 +14,8 @@ export interface ILineChart extends IZenComponentProps {
|
|
|
14
14
|
options?: ILineChartOptions;
|
|
15
15
|
plugins?: Plugin<"line">[];
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated - will be removed in the next releases.
|
|
19
|
+
*/
|
|
17
20
|
export declare const LineChart: React.FC<ILineChart>;
|
|
18
21
|
export {};
|
|
@@ -70,6 +70,9 @@ const getDefaultOptions = (fontSize) => {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated - will be removed in the next releases.
|
|
75
|
+
*/
|
|
73
76
|
const LineChart = (_a) => {
|
|
74
77
|
var { data, options = {}, plugins, className } = _a, rest = __rest(_a, ["data", "options", "plugins", "className"]);
|
|
75
78
|
const isDrive = (0, useDrive_1.useDrive)();
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onBeforeInput = void 0;
|
|
4
4
|
const onBeforeInput = (e) => {
|
|
5
|
-
var _a, _b;
|
|
6
5
|
switch (e.nativeEvent.data.toLowerCase()) {
|
|
7
6
|
// prevent using some special characters
|
|
8
7
|
case "e":
|
|
@@ -10,14 +9,6 @@ const onBeforeInput = (e) => {
|
|
|
10
9
|
e.preventDefault();
|
|
11
10
|
break;
|
|
12
11
|
}
|
|
13
|
-
// prevent using separator if "step" is not decimal
|
|
14
|
-
case ".":
|
|
15
|
-
case ",": {
|
|
16
|
-
if (!((_a = e.target.getAttribute("step")) === null || _a === void 0 ? void 0 : _a.includes(".")) && !((_b = e.target.getAttribute("step")) === null || _b === void 0 ? void 0 : _b.includes(","))) {
|
|
17
|
-
e.preventDefault();
|
|
18
|
-
}
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
12
|
// prevent multiple minus signs
|
|
22
13
|
case "-": {
|
|
23
14
|
if (e.target.value.includes("-")) {
|
|
@@ -80,6 +80,6 @@ const SortableHeaderCell = ({ columnName, isSortedBy, sortDirection, title, tool
|
|
|
80
80
|
sortDirection === interfaces_1.ColumnSortDirection.Ascending
|
|
81
81
|
? "zen-sortable-column-button--dir-asc"
|
|
82
82
|
: "zen-sortable-column-button--dir-desc"
|
|
83
|
-
]), title: iconTitle, "aria-label": iconTitle,
|
|
83
|
+
]), title: iconTitle, "aria-label": iconTitle, onMouseDown: onHeaderClick, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isMobile ? iconButton : null, (0, jsx_runtime_1.jsx)("div", { className: "zen-sortable-column-button__content zen-caption__content", children: title }), isMobile ? null : iconButton] }) }) }));
|
|
84
84
|
};
|
|
85
85
|
exports.SortableHeaderCell = SortableHeaderCell;
|
package/package.json
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geotab/zenith",
|
|
3
|
-
"
|
|
4
|
-
"access": "public"
|
|
5
|
-
},
|
|
6
|
-
"version": "1.20.0-beta.0",
|
|
3
|
+
"version": "1.20.0-beta.2",
|
|
7
4
|
"description": "Zenith components library on React",
|
|
8
5
|
"main": "dist/index.js",
|
|
9
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,6 +9,7 @@
|
|
|
12
9
|
"start": "npm run storybook --loglevel verbose",
|
|
13
10
|
"lint": "npx eslint -c \".eslintrc.js\" --ext \".ts\" --ext \".tsx\" \"**/*.tsx\" \"**/*.ts\" --ignore-path \".eslintignore\"",
|
|
14
11
|
"new": "node newComponent.mjs",
|
|
12
|
+
"build-ai-mdx": "node collectmdx.js",
|
|
15
13
|
"build-ts": "npx tsc -b tsconfig.build.json && node less-transformer.js",
|
|
16
14
|
"build-less": "node less-compile.js",
|
|
17
15
|
"build-copy": "node build-copy.js",
|
|
@@ -26,7 +24,7 @@
|
|
|
26
24
|
"test-coverage": "npm run clean && npm run test-build && jest --collectCoverage=true --coverage --collectCoverageFrom=./**/*.js --json --outputFile=jest-result.json --coverageReporters=html --coverageReporters=text-summary --coverageReporters=cobertura --noStackTrace && node testHelpers/cobertura/cobertura.js",
|
|
27
25
|
"coverage": "npm run test-coverage && google-chrome ./jest-coverage/index.html",
|
|
28
26
|
"storybook": "storybook dev -p 6006",
|
|
29
|
-
"build-storybook": "storybook build",
|
|
27
|
+
"build-storybook": "storybook build && npm run build-ai-mdx",
|
|
30
28
|
"clean": "rm -rf ./dist && rm -rf ./jest-coverage"
|
|
31
29
|
},
|
|
32
30
|
"author": "",
|
|
@@ -93,5 +91,8 @@
|
|
|
93
91
|
"last 1 firefox version",
|
|
94
92
|
"last 1 safari version"
|
|
95
93
|
]
|
|
96
|
-
}
|
|
94
|
+
},
|
|
95
|
+
"publishConfig": {
|
|
96
|
+
"access": "public"
|
|
97
|
+
}
|
|
97
98
|
}
|