@geotab/zenith 1.17.0-beta.1 → 1.17.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 -1
- package/dist/filtersBar/components/filtersBarDropdown/filtersBarDropdown.d.ts +1 -1
- package/dist/index.css +0 -2
- package/dist/selectRaw/hooks/usePopupWidth.js +6 -16
- package/dist/selectRaw/hooks/usePopupWidth.js.map +1 -1
- package/dist/selectRaw/hooks/usePopupWidth.test.js +10 -14
- package/dist/selectRaw/hooks/usePopupWidth.test.js.map +1 -1
- package/dist/selectRaw/utils/constants.d.ts +0 -1
- package/dist/selectRaw/utils/constants.js +1 -2
- package/dist/selectRaw/utils/constants.js.map +1 -1
- package/dist/selectRaw/utils/getValidWidth.js +1 -1
- package/dist/selectRaw/utils/getValidWidth.js.map +1 -1
- package/dist/selectRaw/utils/getValidWidth.test.js +0 -4
- package/dist/selectRaw/utils/getValidWidth.test.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
43
43
|
|
|
44
44
|
## 1.17.0
|
|
45
45
|
|
|
46
|
+
* BetaPill is updated to collect feedback on new pages/views
|
|
46
47
|
* Add the ability to use customFiltersBar component in the header
|
|
47
48
|
* Add debouncing for the getData function in the dropdown component
|
|
48
49
|
* Add property `target` to Button to allow opening links in new tab
|
|
@@ -50,7 +51,6 @@ Zenith library provides components defined in Zenith Design System. It includes
|
|
|
50
51
|
* Improve skeleton component
|
|
51
52
|
* Improve data rendering in Dropdown
|
|
52
53
|
* Improve Card title
|
|
53
|
-
* Improve BetaPill component
|
|
54
54
|
* Fix SelectField is out of viewport in some cases
|
|
55
55
|
* Fix Extra symbols on SortControl in mobile view
|
|
56
56
|
* Fix for Textarea overflow
|
|
@@ -5,7 +5,7 @@ import { IDropdown } from "../../../dropdown/dropdown";
|
|
|
5
5
|
export interface IFiltersBarDropdownState {
|
|
6
6
|
selectedOption: string[];
|
|
7
7
|
}
|
|
8
|
-
interface IFiltersBarDropdownProps extends Omit<IDropdown, "value" | "onChange" | "getNamedItems" | "buttonType" | "alignment" | "error"> {
|
|
8
|
+
interface IFiltersBarDropdownProps extends Omit<IDropdown, "value" | "onChange" | "getNamedItems" | "buttonType" | "alignment" | "error" | "className" | "children"> {
|
|
9
9
|
}
|
|
10
10
|
export interface IFiltersBarDropdown extends IFiltersBarItem<IFiltersBarDropdownState, IFiltersBarDropdownProps> {
|
|
11
11
|
className?: string;
|
package/dist/index.css
CHANGED
|
@@ -4991,8 +4991,6 @@
|
|
|
4991
4991
|
box-shadow: 0px 0px 8px 2px rgba(0, 0, 0, 0.2);
|
|
4992
4992
|
border-radius: var(--border-radius-default);
|
|
4993
4993
|
background-color: var(--backgrounds-main);
|
|
4994
|
-
min-width: 170px;
|
|
4995
|
-
max-width: 420px;
|
|
4996
4994
|
}
|
|
4997
4995
|
.zen-select__text {
|
|
4998
4996
|
max-width: 100%;
|
|
@@ -25,7 +25,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.usePopupWidth = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const useMobile_1 = require("../../commonHelpers/hooks/useMobile");
|
|
29
28
|
const useResize_1 = require("../../commonHelpers/hooks/useResize");
|
|
30
29
|
const constants_1 = require("../utils/constants");
|
|
31
30
|
const getValidWidth_1 = require("../utils/getValidWidth");
|
|
@@ -34,30 +33,21 @@ const usePopupWidth = (ref) => {
|
|
|
34
33
|
const [popupWidth, setPopupWidth] = react_1.default.useState({
|
|
35
34
|
minWidth: constants_1.POPUP_MIN_WIDTH,
|
|
36
35
|
width: ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width) || constants_1.POPUP_MIN_WIDTH,
|
|
37
|
-
maxWidth:
|
|
36
|
+
maxWidth: "100%"
|
|
38
37
|
});
|
|
39
|
-
const isMobile = (0, useMobile_1.useMobile)();
|
|
40
38
|
(0, react_1.useLayoutEffect)(() => {
|
|
41
39
|
if (!ref.current) {
|
|
42
40
|
return;
|
|
43
41
|
}
|
|
44
42
|
const { width } = ref.current.getBoundingClientRect();
|
|
45
|
-
if (isMobile) {
|
|
46
|
-
setPopupWidth({
|
|
47
|
-
minWidth: constants_1.POPUP_MIN_WIDTH,
|
|
48
|
-
width: (0, getValidWidth_1.getValidWidth)(width),
|
|
49
|
-
maxWidth: "100%"
|
|
50
|
-
});
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
43
|
setPopupWidth({
|
|
54
|
-
minWidth:
|
|
44
|
+
minWidth: constants_1.POPUP_MIN_WIDTH,
|
|
55
45
|
width: (0, getValidWidth_1.getValidWidth)(width),
|
|
56
|
-
maxWidth:
|
|
46
|
+
maxWidth: "100%"
|
|
57
47
|
});
|
|
58
|
-
}, [(_b = ref.current) === null || _b === void 0 ? void 0 : _b.clientWidth,
|
|
48
|
+
}, [(_b = ref.current) === null || _b === void 0 ? void 0 : _b.clientWidth, ref]);
|
|
59
49
|
(0, useResize_1.useResize)(() => {
|
|
60
|
-
if (!ref.current
|
|
50
|
+
if (!ref.current) {
|
|
61
51
|
return;
|
|
62
52
|
}
|
|
63
53
|
const { width } = ref.current.getBoundingClientRect();
|
|
@@ -66,7 +56,7 @@ const usePopupWidth = (ref) => {
|
|
|
66
56
|
width: (0, getValidWidth_1.getValidWidth)(width),
|
|
67
57
|
maxWidth: "100%"
|
|
68
58
|
});
|
|
69
|
-
},
|
|
59
|
+
}, true);
|
|
70
60
|
return popupWidth;
|
|
71
61
|
};
|
|
72
62
|
exports.usePopupWidth = usePopupWidth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopupWidth.js","sourceRoot":"","sources":["../../../selectRaw/hooks/usePopupWidth.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+C;AAC/C,mEA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,CAAC;IAET,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AAxCW,QAAA,aAAa,iBAwCxB"}
|
|
@@ -32,10 +32,6 @@ const constants_1 = require("../utils/constants");
|
|
|
32
32
|
jest.mock("../../commonHelpers/hooks/useMobile", () => ({
|
|
33
33
|
useMobile: jest.fn()
|
|
34
34
|
}));
|
|
35
|
-
// 2. Resize Desktop
|
|
36
|
-
// 3. >MaxWidth on Desktop
|
|
37
|
-
// 4. <MaxWidth on Desktop
|
|
38
|
-
// 5. <MinWidth on Desktop
|
|
39
35
|
describe("usePopupWidth tests", () => {
|
|
40
36
|
beforeEach(() => {
|
|
41
37
|
jest.clearAllMocks();
|
|
@@ -112,9 +108,9 @@ describe("usePopupWidth tests", () => {
|
|
|
112
108
|
wrapper: ({ children }) => (0, jsx_runtime_1.jsx)("div", { ref: ref, children: children })
|
|
113
109
|
});
|
|
114
110
|
expect(setStateMock).toHaveBeenCalledWith({
|
|
115
|
-
maxWidth:
|
|
111
|
+
maxWidth: "100%",
|
|
116
112
|
width: currentWidth,
|
|
117
|
-
minWidth:
|
|
113
|
+
minWidth: constants_1.POPUP_MIN_WIDTH
|
|
118
114
|
});
|
|
119
115
|
});
|
|
120
116
|
it("should set valid value for desktop (if currentWidth > maxWidth)", () => {
|
|
@@ -134,9 +130,9 @@ describe("usePopupWidth tests", () => {
|
|
|
134
130
|
wrapper: ({ children }) => (0, jsx_runtime_1.jsx)("div", { ref: ref, children: children })
|
|
135
131
|
});
|
|
136
132
|
expect(setStateMock).toHaveBeenCalledWith({
|
|
137
|
-
maxWidth:
|
|
138
|
-
width:
|
|
139
|
-
minWidth: constants_1.
|
|
133
|
+
maxWidth: "100%",
|
|
134
|
+
width: currentWidth,
|
|
135
|
+
minWidth: constants_1.POPUP_MIN_WIDTH
|
|
140
136
|
});
|
|
141
137
|
});
|
|
142
138
|
it("should set valid value for desktop (if currentWidth < minWidth)", () => {
|
|
@@ -156,12 +152,12 @@ describe("usePopupWidth tests", () => {
|
|
|
156
152
|
wrapper: ({ children }) => (0, jsx_runtime_1.jsx)("div", { ref: ref, children: children })
|
|
157
153
|
});
|
|
158
154
|
expect(setStateMock).toHaveBeenCalledWith({
|
|
159
|
-
maxWidth:
|
|
155
|
+
maxWidth: "100%",
|
|
160
156
|
width: constants_1.POPUP_MIN_WIDTH,
|
|
161
157
|
minWidth: constants_1.POPUP_MIN_WIDTH
|
|
162
158
|
});
|
|
163
159
|
});
|
|
164
|
-
it("should resize
|
|
160
|
+
it("should resize work on desktop", () => {
|
|
165
161
|
const setStateMock = jest.fn();
|
|
166
162
|
const useStateMock = (useState) => [useState, setStateMock];
|
|
167
163
|
jest.spyOn(react_2.default, "useState").mockImplementation(useStateMock);
|
|
@@ -178,16 +174,16 @@ describe("usePopupWidth tests", () => {
|
|
|
178
174
|
wrapper: ({ children }) => (0, jsx_runtime_1.jsx)("div", { ref: ref, children: children })
|
|
179
175
|
});
|
|
180
176
|
expect(setStateMock).toHaveBeenCalledWith({
|
|
181
|
-
maxWidth:
|
|
177
|
+
maxWidth: "100%",
|
|
182
178
|
width: currentWidth,
|
|
183
|
-
minWidth:
|
|
179
|
+
minWidth: constants_1.POPUP_MIN_WIDTH
|
|
184
180
|
});
|
|
185
181
|
expect(setStateMock).toHaveBeenCalledTimes(1);
|
|
186
182
|
const resizeEvent = new Event("resize");
|
|
187
183
|
(0, react_2.act)(() => {
|
|
188
184
|
window.dispatchEvent(resizeEvent);
|
|
189
185
|
});
|
|
190
|
-
expect(setStateMock).toHaveBeenCalledTimes(
|
|
186
|
+
expect(setStateMock).toHaveBeenCalledTimes(2);
|
|
191
187
|
});
|
|
192
188
|
});
|
|
193
189
|
//# sourceMappingURL=usePopupWidth.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopupWidth.test.js","sourceRoot":"","sources":["../../../selectRaw/hooks/usePopupWidth.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAgD;A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AU,EAAC,GAAG,EAAE,CAAC,IAAA,6BAAa,EAAC,GAAG,CAAC,EAAE;YACjC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,gCAAK,GAAG,EAAE,GAAG,YAAG,QAAQ,GAAO;SAC7D,CAAC,CAAC;QAEH,MAAM,CAAC,YAAY,CAAC,CAAC,oBAAoB,CAAC;YACtC,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,2BAAe;SAC5B,CAAC,CAAC;QAEH,MAAM,CAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAE9C,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAA,WAAG,EAAC,GAAG,EAAE;YACL,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../selectRaw/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../selectRaw/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,GAAG,CAAC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getValidWidth = void 0;
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
|
-
const getValidWidth = (width) => width < constants_1.POPUP_MIN_WIDTH ? constants_1.POPUP_MIN_WIDTH : width
|
|
5
|
+
const getValidWidth = (width) => width < constants_1.POPUP_MIN_WIDTH ? constants_1.POPUP_MIN_WIDTH : width;
|
|
6
6
|
exports.getValidWidth = getValidWidth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getValidWidth.js","sourceRoot":"","sources":["../../../selectRaw/utils/getValidWidth.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"getValidWidth.js","sourceRoot":"","sources":["../../../selectRaw/utils/getValidWidth.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAEvC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,GAAG,2BAAe,CAAC,CAAC,CAAC,2BAAe,CAAC,CAAC,CAAC,KAAK,CAAC;AAArF,QAAA,aAAa,iBAAwE"}
|
|
@@ -7,10 +7,6 @@ describe("getValidWidth", () => {
|
|
|
7
7
|
const result = (0, getValidWidth_1.getValidWidth)(50);
|
|
8
8
|
expect(result).toBe(constants_1.POPUP_MIN_WIDTH);
|
|
9
9
|
});
|
|
10
|
-
it("should return the maximum width if the input width is greater than the maximum width", () => {
|
|
11
|
-
const result = (0, getValidWidth_1.getValidWidth)(2000);
|
|
12
|
-
expect(result).toBe(constants_1.POPUP_MAX_WIDTH);
|
|
13
|
-
});
|
|
14
10
|
it("should return the input width if it is within the valid range", () => {
|
|
15
11
|
const result = (0, getValidWidth_1.getValidWidth)(250);
|
|
16
12
|
expect(result).toBe(250);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getValidWidth.test.js","sourceRoot":"","sources":["../../../selectRaw/utils/getValidWidth.test.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"getValidWidth.test.js","sourceRoot":"","sources":["../../../selectRaw/utils/getValidWidth.test.ts"],"names":[],"mappings":";;AAAA,2CAA8C;AAC9C,mDAAgD;AAEhD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,mFAAmF,EAAE,GAAG,EAAE;QACzF,MAAM,MAAM,GAAG,IAAA,6BAAa,EAAC,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,2BAAe,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACrE,MAAM,MAAM,GAAG,IAAA,6BAAa,EAAC,GAAG,CAAC,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|