@jobber/components 4.77.1 → 4.77.2-fixdatali.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.
|
@@ -35,8 +35,8 @@ export interface DataListSorting extends SortableOptions {
|
|
|
35
35
|
readonly key: string;
|
|
36
36
|
}
|
|
37
37
|
export interface SortableOptions {
|
|
38
|
-
readonly id: string;
|
|
39
|
-
readonly label: string;
|
|
38
|
+
readonly id: string | undefined;
|
|
39
|
+
readonly label: string | undefined;
|
|
40
40
|
readonly order: "asc" | "desc";
|
|
41
41
|
}
|
|
42
42
|
export interface DataListProps<T extends DataListObject> {
|
package/dist/DataList/index.js
CHANGED
|
@@ -346,7 +346,7 @@ function DataListHeaderTile({ headers, headerKey, visible = false, }) {
|
|
|
346
346
|
React__default["default"].createElement(Text.Text, { maxLines: "single" }, headers[headerKey]),
|
|
347
347
|
isSortable && (sortableItem === null || sortableItem === void 0 ? void 0 : sortableItem.options) && isDropDownOpen && (React__default["default"].createElement(DataListSortingOptions, { options: sortableItem.options, selectedOption: selectedOption, onSelectChange: handleSelectChange, onClose: () => setIsDropDownOpen(false), optionsListRef: optionsListRef, dataListHeaderTileRef: dataListHeaderTileRef })),
|
|
348
348
|
(sortingState === null || sortingState === void 0 ? void 0 : sortingState.key) === headerKey ? (React__default["default"].createElement(DataListSortingArrows, { order: sortingState.order })) : (sortingState === null || sortingState === void 0 ? void 0 : sortingState.key) !== headerKey && isSortable ? (React__default["default"].createElement(DataListSortingArrows, { order: "none" })) : null));
|
|
349
|
-
function toggleSorting(
|
|
349
|
+
function toggleSorting(sortingKey, id, label, order) {
|
|
350
350
|
const isSameKey = (sortingState === null || sortingState === void 0 ? void 0 : sortingState.label) === label && sortingKey === (sortingState === null || sortingState === void 0 ? void 0 : sortingState.key);
|
|
351
351
|
const isDescending = (sortingState === null || sortingState === void 0 ? void 0 : sortingState.order) === "desc";
|
|
352
352
|
if (isSameKey && isDescending && order !== "asc") {
|
|
@@ -357,8 +357,8 @@ function DataListHeaderTile({ headers, headerKey, visible = false, }) {
|
|
|
357
357
|
}
|
|
358
358
|
const sortingOrder = order || (isSameKey && !isDescending ? "desc" : "asc");
|
|
359
359
|
sorting === null || sorting === void 0 ? void 0 : sorting.onSort({
|
|
360
|
-
id,
|
|
361
360
|
key: sortingKey,
|
|
361
|
+
id,
|
|
362
362
|
label,
|
|
363
363
|
order: sortingOrder,
|
|
364
364
|
});
|
|
@@ -380,7 +380,7 @@ function DataListHeaderTile({ headers, headerKey, visible = false, }) {
|
|
|
380
380
|
}
|
|
381
381
|
function handleSelectChange(newSortOption) {
|
|
382
382
|
if (sortableItem) {
|
|
383
|
-
toggleSorting(
|
|
383
|
+
toggleSorting(sortableItem.key, newSortOption.id, newSortOption.label, newSortOption.order);
|
|
384
384
|
}
|
|
385
385
|
setIsDropDownOpen(true);
|
|
386
386
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.77.
|
|
3
|
+
"version": "4.77.2-fixdatali.0+20308379",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@jobber/design": "^0.53.0",
|
|
23
|
-
"@jobber/formatters": "
|
|
23
|
+
"@jobber/formatters": "^0.2.2",
|
|
24
24
|
"@jobber/hooks": "^2.8.1",
|
|
25
25
|
"@popperjs/core": "^2.0.6",
|
|
26
26
|
"@std-proposal/temporal": "0.0.1",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"> 1%",
|
|
85
85
|
"IE 10"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "203083797593ac38913494bd11cfc09bd6bd8add"
|
|
88
88
|
}
|