ketekny-ui-kit 1.0.32 → 1.0.33
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 +1 -1
- package/src/ui/kDatatable.vue +25 -12
package/package.json
CHANGED
package/src/ui/kDatatable.vue
CHANGED
|
@@ -101,7 +101,7 @@ export default {
|
|
|
101
101
|
selectedKeys: [],
|
|
102
102
|
selectedKeySet: new Set(),
|
|
103
103
|
lastSelectionAnchorKey: null,
|
|
104
|
-
|
|
104
|
+
_pageSelectableKeys: [],
|
|
105
105
|
keyedItems: [],
|
|
106
106
|
currentItemsByKey: new Map(),
|
|
107
107
|
baseKeyToKeys: new Map(),
|
|
@@ -123,17 +123,7 @@ export default {
|
|
|
123
123
|
return Object.keys(this.$slots).filter((name) => !reserved.has(name));
|
|
124
124
|
},
|
|
125
125
|
pageSelectableKeys() {
|
|
126
|
-
|
|
127
|
-
const seen = new Set();
|
|
128
|
-
this.currentPageRowsCache.forEach((rowItem) => {
|
|
129
|
-
const key = this.resolveIncomingItemKey(rowItem);
|
|
130
|
-
if (!key || seen.has(key)) return;
|
|
131
|
-
const sourceItem = this.currentItemsByKey.get(key);
|
|
132
|
-
if (!sourceItem || !this.isItemSelectable(sourceItem)) return;
|
|
133
|
-
seen.add(key);
|
|
134
|
-
keys.push(key);
|
|
135
|
-
});
|
|
136
|
-
return keys;
|
|
126
|
+
return this._pageSelectableKeys;
|
|
137
127
|
},
|
|
138
128
|
allSelectableSelected() {
|
|
139
129
|
if (!this.pageSelectableKeys.length) return false;
|
|
@@ -146,6 +136,8 @@ export default {
|
|
|
146
136
|
},
|
|
147
137
|
|
|
148
138
|
created() {
|
|
139
|
+
this.currentPageRowsCache = []; // non-reactive — mutated during EasyDataTable render
|
|
140
|
+
this._pageRenderScheduled = false; // non-reactive flag
|
|
149
141
|
this.rebuildItemCaches();
|
|
150
142
|
this.applyExternalModelValue(this.modelValue);
|
|
151
143
|
},
|
|
@@ -284,6 +276,14 @@ export default {
|
|
|
284
276
|
}
|
|
285
277
|
this.currentPageRowsCache[rowNumber - 1] = item;
|
|
286
278
|
|
|
279
|
+
if (!this._pageRenderScheduled) {
|
|
280
|
+
this._pageRenderScheduled = true;
|
|
281
|
+
this.$nextTick(() => {
|
|
282
|
+
this._pageRenderScheduled = false;
|
|
283
|
+
this._pageSelectableKeys = this._computePageSelectableKeys();
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
|
|
287
287
|
const externalBodyRowClass =
|
|
288
288
|
this.$attrs["body-row-class-name"] ?? this.$attrs.bodyRowClassName;
|
|
289
289
|
if (typeof externalBodyRowClass === "function") {
|
|
@@ -294,6 +294,19 @@ export default {
|
|
|
294
294
|
}
|
|
295
295
|
return "";
|
|
296
296
|
},
|
|
297
|
+
_computePageSelectableKeys() {
|
|
298
|
+
const keys = [];
|
|
299
|
+
const seen = new Set();
|
|
300
|
+
this.currentPageRowsCache.forEach((rowItem) => {
|
|
301
|
+
const key = this.resolveIncomingItemKey(rowItem);
|
|
302
|
+
if (!key || seen.has(key)) return;
|
|
303
|
+
const sourceItem = this.currentItemsByKey.get(key);
|
|
304
|
+
if (!sourceItem || !this.isItemSelectable(sourceItem)) return;
|
|
305
|
+
seen.add(key);
|
|
306
|
+
keys.push(key);
|
|
307
|
+
});
|
|
308
|
+
return keys;
|
|
309
|
+
},
|
|
297
310
|
rebuildItemCaches() {
|
|
298
311
|
const keyedItems = [];
|
|
299
312
|
const currentItemsByKey = new Map();
|