@lavalogic/scoria 0.22.4 → 0.22.5

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.
@@ -1,12 +1,12 @@
1
1
  import type { Pixels } from '../../../../../Types/Internal/Misc.js';
2
2
  import type { SelectOption } from '../../../../../Types/Internal/SelectOption.js';
3
3
  import type { Snippet } from 'svelte';
4
+ import type { MemoryColumnIndex } from '../../Coordinates/ColumnIndices.js';
4
5
  import type { FilterFn } from '../../Filtering/FilterFn.js';
5
6
  import type { FilterValueType } from '../../Filtering/FilterValueType.js';
6
7
  import { ColumnType } from '../ColumnType.js';
7
8
  import type { AccessorFn } from './AccessorFn.js';
8
9
  import type { ValidationFn } from './ValidationFn.js';
9
- import type { MemoryColumnIndex } from '../../Coordinates/ColumnIndices.js';
10
10
  export interface ColumnDefProps<T extends object, in FilterFnType, out OptionsType> {
11
11
  id: string;
12
12
  header: string | Snippet;
@@ -66,7 +66,7 @@ export class ColumnDef {
66
66
  console.warn(`Column ${this.id} is not sortable`);
67
67
  return;
68
68
  }
69
- this._isResizing = v;
69
+ this._visible = v;
70
70
  }
71
71
  _filterValueType;
72
72
  get filterValueType() {
@@ -1163,7 +1163,7 @@ export class TableContext {
1163
1163
  }
1164
1164
  };
1165
1165
  resetSelectedItems = () => {
1166
- this._selectedItems = new SvelteMap();
1166
+ this._selectedItems.clear();
1167
1167
  };
1168
1168
  selectAllInCurrentPage = async () => {
1169
1169
  void this.paginationRepo?.pageStartIndex;
@@ -1173,18 +1173,20 @@ export class TableContext {
1173
1173
  ? Math.min(this.paginationRepo.pageEndIndexExclusive, sortedData.length)
1174
1174
  : sortedData.length;
1175
1175
  // Will be doing one full reassignment to this.selectedItems to avoid svelteMap redraws
1176
- const cloned = new SvelteMap(this.selectedItems);
1176
+ // const cloned = new SvelteMap(this.selectedItems);
1177
+ const sel = this.selectedItems; // HACK: keep the same svelteMap going so that we can support setSelectionMap()
1178
+ // if this is deemed problematic, we'll need to find another way to ask for a new map from the context consumer
1177
1179
  const pending = [];
1178
1180
  if (this.allSelectedInCurrentPage) {
1179
1181
  for (let i = pageStartIndex; i < pageEndIndexExclusive; i++) {
1180
1182
  const raw = this._cachedKey(sortedData[i]);
1181
1183
  if (raw instanceof Promise) {
1182
1184
  pending.push(raw.then((key) => {
1183
- cloned.delete(key);
1185
+ sel.delete(key);
1184
1186
  }));
1185
1187
  }
1186
1188
  else {
1187
- cloned.delete(raw);
1189
+ sel.delete(raw);
1188
1190
  }
1189
1191
  }
1190
1192
  }
@@ -1202,10 +1204,10 @@ export class TableContext {
1202
1204
  const raw = this._cachedKey(item);
1203
1205
  if (raw instanceof Promise) {
1204
1206
  return raw.then((key) => {
1205
- cloned.set(key, item);
1207
+ sel.set(key, item);
1206
1208
  });
1207
1209
  }
1208
- cloned.set(raw, item);
1210
+ sel.set(raw, item);
1209
1211
  };
1210
1212
  const r = s instanceof Promise ? s.then(doSet) : doSet(s);
1211
1213
  if (r instanceof Promise) {
@@ -1219,11 +1221,11 @@ export class TableContext {
1219
1221
  const raw = this._cachedKey(item);
1220
1222
  if (raw instanceof Promise) {
1221
1223
  pending.push(raw.then((key) => {
1222
- cloned.set(key, item);
1224
+ sel.set(key, item);
1223
1225
  }));
1224
1226
  }
1225
1227
  else {
1226
- cloned.set(raw, item);
1228
+ sel.set(raw, item);
1227
1229
  }
1228
1230
  }
1229
1231
  }
@@ -1231,7 +1233,8 @@ export class TableContext {
1231
1233
  if (pending.length > 0) {
1232
1234
  await Promise.all(pending);
1233
1235
  }
1234
- this._selectedItems = cloned;
1236
+ // HACK
1237
+ // this._selectedItems = cloned;
1235
1238
  };
1236
1239
  onHighlightAll = () => {
1237
1240
  if (this.allHighlighted) {
@@ -75,10 +75,12 @@ export function SQLFriendly(date) {
75
75
  }
76
76
  export function SQLFriendlyWithLocalTime(date, timeDate) {
77
77
  if (typeof date === 'string') {
78
- date = new SvelteDate(date);
78
+ // eslint-disable-next-line svelte/prefer-svelte-reactivity
79
+ date = new Date(date);
79
80
  }
80
81
  if (typeof timeDate === 'string') {
81
- timeDate = new SvelteDate(date);
82
+ // eslint-disable-next-line svelte/prefer-svelte-reactivity
83
+ timeDate = new Date(timeDate);
82
84
  }
83
85
  return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date
84
86
  .getDate()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.22.4",
4
+ "version": "0.22.5",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },