@likable-hair/svelte 3.1.17 → 3.1.18

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.
@@ -11,20 +11,22 @@ export let headers = [], items = [], sortedBy = void 0, sortDirection = "asc";
11
11
  export let calculateRowStyles = void 0;
12
12
  export let calculateRowClasses = void 0;
13
13
  function handleHeaderClick(header) {
14
- if (!!sortedBy && header.value == sortedBy) {
15
- if (sortDirection == "asc")
16
- sortDirection = "desc";
17
- else if (sortDirection == "desc") {
18
- sortedBy = void 0;
14
+ if (header.sortable) {
15
+ if (!!sortedBy && header.value == sortedBy) {
16
+ if (sortDirection == "asc")
17
+ sortDirection = "desc";
18
+ else if (sortDirection == "desc") {
19
+ sortedBy = void 0;
20
+ }
21
+ } else {
22
+ sortedBy = header.value;
23
+ sortDirection = "asc";
19
24
  }
20
- } else {
21
- sortedBy = header.value;
22
- sortDirection = "asc";
25
+ dispatch("sort", {
26
+ sortedBy,
27
+ sortDirection
28
+ });
23
29
  }
24
- dispatch("sort", {
25
- sortedBy,
26
- sortDirection
27
- });
28
30
  }
29
31
  function handleRowClick(item) {
30
32
  dispatch("rowClick", {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likable-hair/svelte",
3
3
  "description": "A Svelte component for likablehair and others",
4
- "version": "3.1.17",
4
+ "version": "3.1.18",
5
5
  "scripts": {
6
6
  "host": "vite --host",
7
7
  "dev": "vite dev",