@jobber/components 2.89.0 → 2.89.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.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@ menu: Changelog
8
8
  All notable changes to this project will be documented in this file.
9
9
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
10
10
 
11
+ ## [2.89.1](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.89.0...@jobber/components@2.89.1) (2022-11-30)
12
+
13
+ **Note:** Version bump only for package @jobber/components
14
+
15
+
16
+
17
+
18
+
11
19
  # [2.89.0](https://github.com/GetJobber/atlantis/compare/@jobber/components@2.88.0...@jobber/components@2.89.0) (2022-11-25)
12
20
 
13
21
 
@@ -1,5 +1,5 @@
1
1
  import { ColumnDef, Row } from "@tanstack/react-table";
2
- import { PaginationType, Sorting } from "./types";
2
+ import { PaginationType, SortingType } from "./types";
3
3
  export interface DataTableProps<T> {
4
4
  /**
5
5
  * The actual data that will be used for the table.
@@ -24,7 +24,7 @@ export interface DataTableProps<T> {
24
24
  * https://tanstack.com/table/v8/docs/api/features/sorting#table-options
25
25
  *
26
26
  */
27
- sorting?: Sorting;
27
+ sorting?: SortingType;
28
28
  /**
29
29
  * This will force the table to have the specified hight
30
30
  *
@@ -1,9 +1,9 @@
1
1
  import { Row, Table } from "@tanstack/react-table";
2
- import { Sorting } from "./types";
2
+ import { SortingType } from "./types";
3
3
  interface HeaderProps<T> {
4
4
  table: Table<T>;
5
5
  stickyHeader?: boolean;
6
- sorting?: Sorting;
6
+ sorting?: SortingType;
7
7
  onRowClick?: (row: Row<T>) => void;
8
8
  }
9
9
  export declare function Header<T extends object>({ table, stickyHeader, sorting, onRowClick, }: HeaderProps<T>): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ColumnDef } from "@tanstack/react-table";
2
- import { Pagination, Sorting } from "./types";
2
+ import { PaginationType, SortingType } from "./types";
3
3
  export declare function createTableSettings<T>(data: T[], columns: ColumnDef<T>[], options?: {
4
- pagination?: Pagination;
5
- sorting?: Sorting;
4
+ pagination?: PaginationType;
5
+ sorting?: SortingType;
6
6
  }): any;
@@ -118,7 +118,7 @@ function Pagination(_a) {
118
118
  React__default["default"].createElement("div", { className: styles$1.paginationSelect },
119
119
  React__default["default"].createElement(Option.Select, { value: table.getState().pagination.pageSize, onChange: function (value) {
120
120
  table.setPageSize(Number(value));
121
- } }, itemsPerPageOptions.map(function (numOfPages) { return (React__default["default"].createElement(Option.SelectOption, { key: numOfPages, value: numOfPages }, numOfPages)); })),
121
+ }, size: "small" }, itemsPerPageOptions.map(function (numOfPages) { return (React__default["default"].createElement(Option.SelectOption, { key: numOfPages, value: numOfPages }, numOfPages)); })),
122
122
  React__default["default"].createElement("span", { className: styles$1.paginationSelectLabel }, "per page")),
123
123
  React__default["default"].createElement("div", { className: styles$1.paginationButtons },
124
124
  React__default["default"].createElement(Button.Button, { type: "secondary", variation: "subtle", icon: "arrowLeft", ariaLabel: "arrowLeft", onClick: function () { return table.previousPage(); }, disabled: !table.getCanPreviousPage() }),
@@ -131,19 +131,16 @@ function Header(_a) {
131
131
  var stickyClass = classnames__default["default"]((_b = {}, _b[styles$2.stickyHeader] = stickyHeader, _b));
132
132
  return (React__default["default"].createElement("thead", { className: stickyClass }, table.getHeaderGroups().map(function (headerGroup) { return (React__default["default"].createElement("tr", { key: headerGroup.id }, headerGroup.headers.map(function (header) {
133
133
  var _a;
134
- var _b;
135
134
  return (React__default["default"].createElement("th", { key: header.id, colSpan: header.colSpan, className: sorting && header.column.getCanSort()
136
135
  ? classnames__default["default"](styles$2.sortableColumn, (_a = {},
137
136
  _a[styles$2.pinFirstHeaderSortable] = !!onRowClick,
138
137
  _a))
139
138
  : "", onClick: sorting ? header.column.getToggleSortingHandler() : undefined }, header.isPlaceholder ? null : (React__default["default"].createElement("div", null,
140
- reactTable.flexRender(header.column.columnDef.header, header.getContext()), (_b = {
141
- asc: React__default["default"].createElement(Icon.Icon, { name: "longArrowUp", color: "green" }),
142
- desc: React__default["default"].createElement(Icon.Icon, { name: "longArrowDown", color: "green" }),
143
- }[header.column.getIsSorted()]) !== null && _b !== void 0 ? _b : (React__default["default"].createElement("svg", { style: {
144
- width: "var(--space-large)",
145
- height: "var(--space-large)",
146
- } }))))));
139
+ reactTable.flexRender(header.column.columnDef.header, header.getContext()),
140
+ {
141
+ asc: React__default["default"].createElement(Icon.Icon, { name: "longArrowUp", color: "green" }),
142
+ desc: React__default["default"].createElement(Icon.Icon, { name: "longArrowDown", color: "green" }),
143
+ }[header.column.getIsSorted()]))));
147
144
  }))); })));
148
145
  }
149
146
 
@@ -80,4 +80,4 @@ export interface DefaultSorting {
80
80
  */
81
81
  manualSorting: false;
82
82
  }
83
- export declare type Sorting = DefaultSorting | ManualSorting;
83
+ export declare type SortingType = DefaultSorting | ManualSorting;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "2.89.0",
3
+ "version": "2.89.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -84,5 +84,5 @@
84
84
  "> 1%",
85
85
  "IE 10"
86
86
  ],
87
- "gitHead": "2ae2744cf0846f54353087b6f0ea2fd130fd1a2e"
87
+ "gitHead": "558080c2e04649042031a7529a45d66b3297d085"
88
88
  }