@itfin/components 1.3.81 → 1.3.83

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itfin/components",
3
- "version": "1.3.81",
3
+ "version": "1.3.83",
4
4
  "author": "Vitalii Savchuk <esvit666@gmail.com>",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -132,14 +132,11 @@ class itfTable2 extends Vue {
132
132
  }
133
133
  state.selectedIds = [];
134
134
  for (const column of list) {
135
- const stateColumn = state.columns.find(i => i.property === column.property);
136
- if (stateColumn) {
137
- Object.assign(stateColumn, {
138
- ...column,
139
- width: stateColumn.width
140
- });
141
- } else {
135
+ const stateColumnIndex = state.columns.findIndex(i => i.property === column.property);
136
+ if (stateColumnIndex === -1) {
142
137
  state.columns.push(column);
138
+ } else {
139
+ state.columns[stateColumnIndex] = { ...column, width: state.columns[stateColumnIndex].width };
143
140
  }
144
141
  }
145
142
  for (const column of state.columns) {
@@ -159,7 +156,8 @@ class itfTable2 extends Vue {
159
156
  if (!this.stateName) {
160
157
  return;
161
158
  }
162
- localStorage.setItem(this.stateKey, JSON.stringify(this.state));
159
+ const columns = this.state.columns.map((s) => ({ property: s.property, width: s.width, index: s.index }));
160
+ localStorage.setItem(this.stateKey, JSON.stringify({ columns }));
163
161
  }
164
162
 
165
163
  mounted() {