@isoftdata/svelte-table 2.6.6 → 2.6.7

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.
@@ -47,18 +47,28 @@ export class ColumnInfoRunicStore {
47
47
  get current() {
48
48
  return this.#value;
49
49
  }
50
- updateColumn = (property, value) => {
51
- if (!(property in this.#value)) {
52
- console.error(`Column ${property} not found in column info store`);
53
- return;
54
- }
55
- const info = this.#value[property];
56
- this.#value[property] = { ...info, ...value };
50
+ updateColumn(property, value) {
51
+ this.updateColumns([
52
+ {
53
+ ...value,
54
+ property,
55
+ },
56
+ ]);
57
+ }
58
+ updateColumns(newColumnInfos) {
59
+ newColumnInfos.forEach(col => {
60
+ if (!(col.property in this.#value)) {
61
+ console.error(`Column ${col.property} not found in column info store`);
62
+ return;
63
+ }
64
+ // This gets run for every column in the table on render, so use Object.assign as it's faster
65
+ Object.assign(this.#value[col.property], col);
66
+ });
57
67
  this.#lastValue = this.#value;
58
68
  if (this.#persistedState) {
59
69
  this.#persistedState.current = this.makeDerived(this.#value);
60
70
  }
61
- };
71
+ }
62
72
  getStoreValFromColumns(columns, storeValue) {
63
73
  const columnInfo = columns.reduce((acc, column) => {
64
74
  const storedColumn = storeValue
package/package.json CHANGED
@@ -1,17 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-table",
3
- "version": "2.6.6",
4
- "scripts": {
5
- "dev": "vite dev",
6
- "build": "vite build && npm run package",
7
- "preview": "vite preview",
8
- "package": "svelte-kit sync && svelte-package && publint",
9
- "prepublishOnly": "npm run package",
10
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12
- "lint": "prettier --plugin-search-dir . --check . && eslint .",
13
- "format": "prettier --plugin-search-dir . --write ."
14
- },
3
+ "version": "2.6.7",
15
4
  "exports": {
16
5
  ".": {
17
6
  "types": "./dist/index.d.ts",
@@ -75,5 +64,15 @@
75
64
  },
76
65
  "engines": {
77
66
  "pnpm": "10.x"
67
+ },
68
+ "scripts": {
69
+ "dev": "vite dev",
70
+ "build": "vite build && npm run package",
71
+ "preview": "vite preview",
72
+ "package": "svelte-kit sync && svelte-package && publint",
73
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
74
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
75
+ "lint": "prettier --plugin-search-dir . --check . && eslint .",
76
+ "format": "prettier --plugin-search-dir . --write ."
78
77
  }
79
- }
78
+ }