@tanstack/svelte-table 8.0.0-alpha.86 → 8.0.0-alpha.87

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.
@@ -2669,7 +2669,7 @@ var drawChart = (function (exports) {
2669
2669
  </script>
2670
2670
  <script>
2671
2671
  /*<!--*/
2672
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"74a1-163"},{"name":"svelte-table/src","children":[{"uid":"74a1-165","name":"placeholder.svelte"},{"uid":"74a1-167","name":"render-component.ts"},{"uid":"74a1-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"74a1-163":{"renderedLength":137360,"gzipLength":23349,"brotliLength":0,"mainUid":"74a1-162"},"74a1-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"74a1-164"},"74a1-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"74a1-166"},"74a1-169":{"renderedLength":2729,"gzipLength":868,"brotliLength":0,"mainUid":"74a1-168"}},"nodeMetas":{"74a1-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"74a1-163"},"imported":[],"importedBy":[{"uid":"74a1-168"}]},"74a1-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"74a1-165"},"imported":[{"uid":"74a1-170"}],"importedBy":[{"uid":"74a1-168"}]},"74a1-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"74a1-167"},"imported":[{"uid":"74a1-170"}],"importedBy":[{"uid":"74a1-168"}]},"74a1-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"74a1-169"},"imported":[{"uid":"74a1-162"},{"uid":"74a1-164"},{"uid":"74a1-170"},{"uid":"74a1-171"},{"uid":"74a1-166"}],"importedBy":[],"isEntry":true},"74a1-170":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"74a1-168"},{"uid":"74a1-164"},{"uid":"74a1-166"}],"isExternal":true},"74a1-171":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"74a1-168"}],"isExternal":true}},"env":{"rollup":"2.70.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
2672
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"3258-163"},{"name":"svelte-table/src","children":[{"uid":"3258-165","name":"placeholder.svelte"},{"uid":"3258-167","name":"render-component.ts"},{"uid":"3258-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"3258-163":{"renderedLength":137397,"gzipLength":23365,"brotliLength":0,"mainUid":"3258-162"},"3258-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"3258-164"},"3258-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"3258-166"},"3258-169":{"renderedLength":2729,"gzipLength":868,"brotliLength":0,"mainUid":"3258-168"}},"nodeMetas":{"3258-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"3258-163"},"imported":[],"importedBy":[{"uid":"3258-168"}]},"3258-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"3258-165"},"imported":[{"uid":"3258-170"}],"importedBy":[{"uid":"3258-168"}]},"3258-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"3258-167"},"imported":[{"uid":"3258-170"}],"importedBy":[{"uid":"3258-168"}]},"3258-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"3258-169"},"imported":[{"uid":"3258-162"},{"uid":"3258-164"},{"uid":"3258-170"},{"uid":"3258-171"},{"uid":"3258-166"}],"importedBy":[],"isEntry":true},"3258-170":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"3258-168"},{"uid":"3258-164"},{"uid":"3258-166"}],"isExternal":true},"3258-171":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"3258-168"}],"isExternal":true}},"env":{"rollup":"2.70.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
2673
2673
 
2674
2674
  const run = () => {
2675
2675
  const width = window.innerWidth;
@@ -11,21 +11,21 @@
11
11
  "children": [
12
12
  {
13
13
  "name": "table-core/build/esm/index.js",
14
- "uid": "74a1-173"
14
+ "uid": "3258-173"
15
15
  },
16
16
  {
17
17
  "name": "svelte-table/src",
18
18
  "children": [
19
19
  {
20
- "uid": "74a1-175",
20
+ "uid": "3258-175",
21
21
  "name": "placeholder.svelte"
22
22
  },
23
23
  {
24
- "uid": "74a1-177",
24
+ "uid": "3258-177",
25
25
  "name": "render-component.ts"
26
26
  },
27
27
  {
28
- "uid": "74a1-179",
28
+ "uid": "3258-179",
29
29
  "name": "index.ts"
30
30
  }
31
31
  ]
@@ -38,125 +38,125 @@
38
38
  "isRoot": true
39
39
  },
40
40
  "nodeParts": {
41
- "74a1-173": {
42
- "renderedLength": 137360,
43
- "gzipLength": 23349,
41
+ "3258-173": {
42
+ "renderedLength": 137397,
43
+ "gzipLength": 23365,
44
44
  "brotliLength": 0,
45
- "mainUid": "74a1-172"
45
+ "mainUid": "3258-172"
46
46
  },
47
- "74a1-175": {
47
+ "3258-175": {
48
48
  "renderedLength": 925,
49
49
  "gzipLength": 444,
50
50
  "brotliLength": 0,
51
- "mainUid": "74a1-174"
51
+ "mainUid": "3258-174"
52
52
  },
53
- "74a1-177": {
53
+ "3258-177": {
54
54
  "renderedLength": 1365,
55
55
  "gzipLength": 519,
56
56
  "brotliLength": 0,
57
- "mainUid": "74a1-176"
57
+ "mainUid": "3258-176"
58
58
  },
59
- "74a1-179": {
59
+ "3258-179": {
60
60
  "renderedLength": 2729,
61
61
  "gzipLength": 868,
62
62
  "brotliLength": 0,
63
- "mainUid": "74a1-178"
63
+ "mainUid": "3258-178"
64
64
  }
65
65
  },
66
66
  "nodeMetas": {
67
- "74a1-172": {
67
+ "3258-172": {
68
68
  "id": "/packages/table-core/build/esm/index.js",
69
69
  "moduleParts": {
70
- "index.production.js": "74a1-173"
70
+ "index.production.js": "3258-173"
71
71
  },
72
72
  "imported": [],
73
73
  "importedBy": [
74
74
  {
75
- "uid": "74a1-178"
75
+ "uid": "3258-178"
76
76
  }
77
77
  ]
78
78
  },
79
- "74a1-174": {
79
+ "3258-174": {
80
80
  "id": "/packages/svelte-table/src/placeholder.svelte",
81
81
  "moduleParts": {
82
- "index.production.js": "74a1-175"
82
+ "index.production.js": "3258-175"
83
83
  },
84
84
  "imported": [
85
85
  {
86
- "uid": "74a1-180"
86
+ "uid": "3258-180"
87
87
  }
88
88
  ],
89
89
  "importedBy": [
90
90
  {
91
- "uid": "74a1-178"
91
+ "uid": "3258-178"
92
92
  }
93
93
  ]
94
94
  },
95
- "74a1-176": {
95
+ "3258-176": {
96
96
  "id": "/packages/svelte-table/src/render-component.ts",
97
97
  "moduleParts": {
98
- "index.production.js": "74a1-177"
98
+ "index.production.js": "3258-177"
99
99
  },
100
100
  "imported": [
101
101
  {
102
- "uid": "74a1-180"
102
+ "uid": "3258-180"
103
103
  }
104
104
  ],
105
105
  "importedBy": [
106
106
  {
107
- "uid": "74a1-178"
107
+ "uid": "3258-178"
108
108
  }
109
109
  ]
110
110
  },
111
- "74a1-178": {
111
+ "3258-178": {
112
112
  "id": "/packages/svelte-table/src/index.ts",
113
113
  "moduleParts": {
114
- "index.production.js": "74a1-179"
114
+ "index.production.js": "3258-179"
115
115
  },
116
116
  "imported": [
117
117
  {
118
- "uid": "74a1-172"
118
+ "uid": "3258-172"
119
119
  },
120
120
  {
121
- "uid": "74a1-174"
121
+ "uid": "3258-174"
122
122
  },
123
123
  {
124
- "uid": "74a1-180"
124
+ "uid": "3258-180"
125
125
  },
126
126
  {
127
- "uid": "74a1-181"
127
+ "uid": "3258-181"
128
128
  },
129
129
  {
130
- "uid": "74a1-176"
130
+ "uid": "3258-176"
131
131
  }
132
132
  ],
133
133
  "importedBy": [],
134
134
  "isEntry": true
135
135
  },
136
- "74a1-180": {
136
+ "3258-180": {
137
137
  "id": "svelte/internal",
138
138
  "moduleParts": {},
139
139
  "imported": [],
140
140
  "importedBy": [
141
141
  {
142
- "uid": "74a1-178"
142
+ "uid": "3258-178"
143
143
  },
144
144
  {
145
- "uid": "74a1-174"
145
+ "uid": "3258-174"
146
146
  },
147
147
  {
148
- "uid": "74a1-176"
148
+ "uid": "3258-176"
149
149
  }
150
150
  ],
151
151
  "isExternal": true
152
152
  },
153
- "74a1-181": {
153
+ "3258-181": {
154
154
  "id": "svelte/store",
155
155
  "moduleParts": {},
156
156
  "imported": [],
157
157
  "importedBy": [
158
158
  {
159
- "uid": "74a1-178"
159
+ "uid": "3258-178"
160
160
  }
161
161
  ],
162
162
  "isExternal": true
@@ -2344,21 +2344,54 @@
2344
2344
  }
2345
2345
 
2346
2346
  const reSplitAlphaNumeric = /([0-9]+)/gm;
2347
- const sortingFns = {
2348
- alphanumeric,
2349
- alphanumericCaseSensitive,
2350
- text,
2351
- textCaseSensitive,
2352
- datetime,
2353
- basic
2354
- };
2355
2347
 
2356
- function alphanumeric(rowA, rowB, columnId) {
2348
+ const alphanumeric = (rowA, rowB, columnId) => {
2357
2349
  return compareAlphanumeric(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
2358
- }
2350
+ };
2359
2351
 
2360
- function alphanumericCaseSensitive(rowA, rowB, columnId) {
2352
+ const alphanumericCaseSensitive = (rowA, rowB, columnId) => {
2361
2353
  return compareAlphanumeric(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
2354
+ }; // The text filter is more basic (less numeric support)
2355
+ // but is much faster
2356
+
2357
+
2358
+ const text = (rowA, rowB, columnId) => {
2359
+ return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
2360
+ }; // The text filter is more basic (less numeric support)
2361
+ // but is much faster
2362
+
2363
+
2364
+ const textCaseSensitive = (rowA, rowB, columnId) => {
2365
+ return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
2366
+ };
2367
+
2368
+ const datetime = (rowA, rowB, columnId) => {
2369
+ return compareBasic(rowA.getValue(columnId).getTime(), rowB.getValue(columnId).getTime());
2370
+ };
2371
+
2372
+ const basic = (rowA, rowB, columnId) => {
2373
+ return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId));
2374
+ }; // Utils
2375
+
2376
+
2377
+ function compareBasic(a, b) {
2378
+ return a === b ? 0 : a > b ? 1 : -1;
2379
+ }
2380
+
2381
+ function toString(a) {
2382
+ if (typeof a === 'number') {
2383
+ if (isNaN(a) || a === Infinity || a === -Infinity) {
2384
+ return '';
2385
+ }
2386
+
2387
+ return String(a);
2388
+ }
2389
+
2390
+ if (typeof a === 'string') {
2391
+ return a;
2392
+ }
2393
+
2394
+ return '';
2362
2395
  } // Mixed sorting is slow, but very inclusive of many edge cases.
2363
2396
  // It handles numbers, mixed alphanumeric combinations, and even
2364
2397
  // null, undefined, and Infinity
@@ -2405,48 +2438,17 @@
2405
2438
  }
2406
2439
 
2407
2440
  return a.length - b.length;
2408
- } // The text filter is more basic (less numeric support)
2409
- // but is much faster
2410
-
2411
-
2412
- function text(rowA, rowB, columnId) {
2413
- return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
2414
- } // The text filter is more basic (less numeric support)
2415
- // but is much faster
2416
-
2417
-
2418
- function textCaseSensitive(rowA, rowB, columnId) {
2419
- return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
2420
- }
2421
-
2422
- function datetime(rowA, rowB, columnId) {
2423
- return compareBasic(rowA.getValue(columnId).getTime(), rowB.getValue(columnId).getTime());
2424
- }
2425
-
2426
- function basic(rowA, rowB, columnId) {
2427
- return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId));
2428
- } // Utils
2429
-
2430
-
2431
- function compareBasic(a, b) {
2432
- return a === b ? 0 : a > b ? 1 : -1;
2433
- }
2434
-
2435
- function toString(a) {
2436
- if (typeof a === 'number') {
2437
- if (isNaN(a) || a === Infinity || a === -Infinity) {
2438
- return '';
2439
- }
2441
+ } // Exports
2440
2442
 
2441
- return String(a);
2442
- }
2443
-
2444
- if (typeof a === 'string') {
2445
- return a;
2446
- }
2447
2443
 
2448
- return '';
2449
- }
2444
+ const sortingFns = {
2445
+ alphanumeric,
2446
+ alphanumericCaseSensitive,
2447
+ text,
2448
+ textCaseSensitive,
2449
+ datetime,
2450
+ basic
2451
+ };
2450
2452
 
2451
2453
  //
2452
2454
  const Sorting = {