@jobber/components 4.77.1 → 4.77.2-fixadd-pa.1

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.
@@ -31,13 +31,13 @@ export interface DataListObject {
31
31
  export type DataListHeader<T extends DataListObject> = {
32
32
  readonly [K in keyof T]?: string;
33
33
  };
34
- export interface DataListSorting extends SortableOptions {
34
+ export interface DataListSorting extends Partial<SortableOptions> {
35
35
  readonly key: string;
36
36
  }
37
37
  export interface SortableOptions {
38
- readonly id: string;
39
- readonly label: string;
40
- readonly order: "asc" | "desc";
38
+ readonly id?: string;
39
+ readonly label?: string;
40
+ readonly order?: "asc" | "desc";
41
41
  }
42
42
  export interface DataListProps<T extends DataListObject> {
43
43
  /**
@@ -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(id, sortingKey, label, order) {
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") {
@@ -380,7 +380,7 @@ function DataListHeaderTile({ headers, headerKey, visible = false, }) {
380
380
  }
381
381
  function handleSelectChange(newSortOption) {
382
382
  if (sortableItem) {
383
- toggleSorting(newSortOption.id, sortableItem.key, newSortOption.label, newSortOption.order);
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.1",
3
+ "version": "4.77.2-fixadd-pa.1+365d1481",
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": "fd6db5654246e3087409b5a5a9c4900235c9e9bd"
87
+ "gitHead": "365d1481b345e609d46f884ddf549c68cc134f02"
88
88
  }