@vuu-ui/vuu-data-remote 0.8.23-debug → 0.8.24-debug
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/cjs/index.js +22 -74
- package/cjs/index.js.map +2 -2
- package/esm/index.js +23 -75
- package/esm/index.js.map +2 -2
- package/package.json +7 -7
- package/types/inlined-worker.d.ts +1 -1
- package/types/server-proxy/server-proxy.d.ts +0 -2
- package/types/server-proxy/viewport.d.ts +0 -2
- package/types/vuu-data-source.d.ts +2 -2
package/esm/index.js
CHANGED
|
@@ -136,6 +136,7 @@ function partition(array, test, pass = [], fail = []) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// ../vuu-utils/src/column-utils.ts
|
|
139
|
+
var KEY = 6;
|
|
139
140
|
var metadataKeys = {
|
|
140
141
|
IDX: 0,
|
|
141
142
|
RENDER_IDX: 1,
|
|
@@ -143,7 +144,7 @@ var metadataKeys = {
|
|
|
143
144
|
IS_EXPANDED: 3,
|
|
144
145
|
DEPTH: 4,
|
|
145
146
|
COUNT: 5,
|
|
146
|
-
KEY
|
|
147
|
+
KEY,
|
|
147
148
|
SELECTED: 7,
|
|
148
149
|
count: 8,
|
|
149
150
|
// TODO following only used in datamodel
|
|
@@ -717,7 +718,6 @@ var ArrayBackedMovingWindow = class {
|
|
|
717
718
|
_range = new WeakMap();
|
|
718
719
|
|
|
719
720
|
// src/server-proxy/viewport.ts
|
|
720
|
-
var EMPTY_GROUPBY = [];
|
|
721
721
|
var { debug: debug2, debugEnabled: debugEnabled2, error, info, infoEnabled, warn } = logger("viewport");
|
|
722
722
|
var isLeafUpdate = ({ rowKey, updateType }) => updateType === "U" && !rowKey.startsWith("$root");
|
|
723
723
|
var NO_DATA_UPDATE = [
|
|
@@ -1215,25 +1215,17 @@ var Viewport = class {
|
|
|
1215
1215
|
debug2 == null ? void 0 : debug2(\`columnRequest: \${columns}\`);
|
|
1216
1216
|
return this.createRequest({ columns });
|
|
1217
1217
|
}
|
|
1218
|
-
filterRequest(requestId, dataSourceFilter) {
|
|
1219
|
-
this.awaitOperation(requestId, {
|
|
1220
|
-
type: "filter",
|
|
1221
|
-
data: dataSourceFilter
|
|
1222
|
-
});
|
|
1223
|
-
if (this.useBatchMode) {
|
|
1224
|
-
this.batchMode = true;
|
|
1225
|
-
}
|
|
1226
|
-
const { filter } = dataSourceFilter;
|
|
1227
|
-
info == null ? void 0 : info(\`filterRequest: \${filter}\`);
|
|
1228
|
-
return this.createRequest({ filterSpec: { filter } });
|
|
1229
|
-
}
|
|
1230
1218
|
setConfig(requestId, config) {
|
|
1219
|
+
var _a;
|
|
1231
1220
|
this.awaitOperation(requestId, { type: "config", data: config });
|
|
1232
1221
|
const { filter, ...remainingConfig } = config;
|
|
1233
1222
|
if (this.useBatchMode) {
|
|
1234
1223
|
this.batchMode = true;
|
|
1235
1224
|
}
|
|
1236
1225
|
debugEnabled2 ? debug2 == null ? void 0 : debug2(\`setConfig \${JSON.stringify(config)}\`) : info == null ? void 0 : info(\`setConfig\`);
|
|
1226
|
+
if (!this.isTree && config.groupBy.length > 0) {
|
|
1227
|
+
(_a = this.dataWindow) == null ? void 0 : _a.clear();
|
|
1228
|
+
}
|
|
1237
1229
|
return this.createRequest(
|
|
1238
1230
|
{
|
|
1239
1231
|
...remainingConfig,
|
|
@@ -1256,17 +1248,6 @@ var Viewport = class {
|
|
|
1256
1248
|
info == null ? void 0 : info(\`sortRequest: \${JSON.stringify(sort.sortDefs)}\`);
|
|
1257
1249
|
return this.createRequest({ sort });
|
|
1258
1250
|
}
|
|
1259
|
-
groupByRequest(requestId, groupBy = EMPTY_GROUPBY) {
|
|
1260
|
-
var _a;
|
|
1261
|
-
this.awaitOperation(requestId, { type: "groupBy", data: groupBy });
|
|
1262
|
-
if (this.useBatchMode) {
|
|
1263
|
-
this.batchMode = true;
|
|
1264
|
-
}
|
|
1265
|
-
if (!this.isTree) {
|
|
1266
|
-
(_a = this.dataWindow) == null ? void 0 : _a.clear();
|
|
1267
|
-
}
|
|
1268
|
-
return this.createRequest({ groupBy });
|
|
1269
|
-
}
|
|
1270
1251
|
selectRequest(requestId, selected) {
|
|
1271
1252
|
this.selectedRows = selected;
|
|
1272
1253
|
this.awaitOperation(requestId, { type: "selection", data: selected });
|
|
@@ -1680,17 +1661,6 @@ var ServerProxy = class {
|
|
|
1680
1661
|
const request = viewport.sortRequest(requestId, message.sort);
|
|
1681
1662
|
this.sendIfReady(request, requestId, viewport.status === "subscribed");
|
|
1682
1663
|
}
|
|
1683
|
-
groupBy(viewport, message) {
|
|
1684
|
-
const requestId = nextRequestId();
|
|
1685
|
-
const request = viewport.groupByRequest(requestId, message.groupBy);
|
|
1686
|
-
this.sendIfReady(request, requestId, viewport.status === "subscribed");
|
|
1687
|
-
}
|
|
1688
|
-
filter(viewport, message) {
|
|
1689
|
-
const requestId = nextRequestId();
|
|
1690
|
-
const { filter } = message;
|
|
1691
|
-
const request = viewport.filterRequest(requestId, filter);
|
|
1692
|
-
this.sendIfReady(request, requestId, viewport.status === "subscribed");
|
|
1693
|
-
}
|
|
1694
1664
|
setColumns(viewport, message) {
|
|
1695
1665
|
const requestId = nextRequestId();
|
|
1696
1666
|
const { columns } = message;
|
|
@@ -1863,10 +1833,6 @@ var ServerProxy = class {
|
|
|
1863
1833
|
return this.aggregate(viewport, message);
|
|
1864
1834
|
case "sort":
|
|
1865
1835
|
return this.sort(viewport, message);
|
|
1866
|
-
case "groupBy":
|
|
1867
|
-
return this.groupBy(viewport, message);
|
|
1868
|
-
case "filter":
|
|
1869
|
-
return this.filter(viewport, message);
|
|
1870
1836
|
case "select":
|
|
1871
1837
|
return this.select(viewport, message);
|
|
1872
1838
|
case "suspend":
|
|
@@ -2908,7 +2874,7 @@ var createSchemaFromTableMetadata = ({
|
|
|
2908
2874
|
// src/vuu-data-source.ts
|
|
2909
2875
|
import { parseFilter } from "@vuu-ui/vuu-filter-parser";
|
|
2910
2876
|
import {
|
|
2911
|
-
|
|
2877
|
+
isConfigChanged,
|
|
2912
2878
|
debounce,
|
|
2913
2879
|
EventEmitter as EventEmitter2,
|
|
2914
2880
|
isViewportMenusAction,
|
|
@@ -3232,8 +3198,9 @@ var VuuDataSource = class extends EventEmitter2 {
|
|
|
3232
3198
|
}
|
|
3233
3199
|
set config(config) {
|
|
3234
3200
|
var _a;
|
|
3235
|
-
|
|
3236
|
-
|
|
3201
|
+
const configChanges = this.applyConfig(config);
|
|
3202
|
+
if (configChanges) {
|
|
3203
|
+
if (__privateGet(this, _config) && this.viewport) {
|
|
3237
3204
|
if (config) {
|
|
3238
3205
|
(_a = this.server) == null ? void 0 : _a.send({
|
|
3239
3206
|
viewport: this.viewport,
|
|
@@ -3242,12 +3209,16 @@ var VuuDataSource = class extends EventEmitter2 {
|
|
|
3242
3209
|
});
|
|
3243
3210
|
}
|
|
3244
3211
|
}
|
|
3245
|
-
this.emit("config", __privateGet(this, _config));
|
|
3212
|
+
this.emit("config", __privateGet(this, _config), void 0, configChanges);
|
|
3246
3213
|
}
|
|
3247
3214
|
}
|
|
3248
3215
|
applyConfig(config) {
|
|
3249
3216
|
var _a;
|
|
3250
|
-
|
|
3217
|
+
const { noChanges, ...otherChanges } = isConfigChanged(
|
|
3218
|
+
__privateGet(this, _config),
|
|
3219
|
+
config
|
|
3220
|
+
);
|
|
3221
|
+
if (noChanges !== true) {
|
|
3251
3222
|
if (config) {
|
|
3252
3223
|
const newConfig = ((_a = config == null ? void 0 : config.filter) == null ? void 0 : _a.filter) && (config == null ? void 0 : config.filter.filterStruct) === void 0 ? {
|
|
3253
3224
|
...config,
|
|
@@ -3257,7 +3228,7 @@ var VuuDataSource = class extends EventEmitter2 {
|
|
|
3257
3228
|
}
|
|
3258
3229
|
} : config;
|
|
3259
3230
|
__privateSet(this, _config, withConfigDefaults(newConfig));
|
|
3260
|
-
return
|
|
3231
|
+
return otherChanges;
|
|
3261
3232
|
}
|
|
3262
3233
|
}
|
|
3263
3234
|
}
|
|
@@ -3304,6 +3275,7 @@ var VuuDataSource = class extends EventEmitter2 {
|
|
|
3304
3275
|
return __privateGet(this, _config).sort;
|
|
3305
3276
|
}
|
|
3306
3277
|
set sort(sort) {
|
|
3278
|
+
var _a;
|
|
3307
3279
|
__privateSet(this, _config, {
|
|
3308
3280
|
...__privateGet(this, _config),
|
|
3309
3281
|
sort
|
|
@@ -3314,9 +3286,7 @@ var VuuDataSource = class extends EventEmitter2 {
|
|
|
3314
3286
|
type: "sort",
|
|
3315
3287
|
sort
|
|
3316
3288
|
};
|
|
3317
|
-
|
|
3318
|
-
this.server.send(message);
|
|
3319
|
-
}
|
|
3289
|
+
(_a = this.server) == null ? void 0 : _a.send(message);
|
|
3320
3290
|
}
|
|
3321
3291
|
this.emit("config", __privateGet(this, _config));
|
|
3322
3292
|
}
|
|
@@ -3324,21 +3294,10 @@ var VuuDataSource = class extends EventEmitter2 {
|
|
|
3324
3294
|
return __privateGet(this, _config).filter;
|
|
3325
3295
|
}
|
|
3326
3296
|
set filter(filter) {
|
|
3327
|
-
|
|
3297
|
+
this.config = {
|
|
3328
3298
|
...__privateGet(this, _config),
|
|
3329
3299
|
filter
|
|
3330
|
-
}
|
|
3331
|
-
if (this.viewport) {
|
|
3332
|
-
const message = {
|
|
3333
|
-
viewport: this.viewport,
|
|
3334
|
-
type: "filter",
|
|
3335
|
-
filter
|
|
3336
|
-
};
|
|
3337
|
-
if (this.server) {
|
|
3338
|
-
this.server.send(message);
|
|
3339
|
-
}
|
|
3340
|
-
}
|
|
3341
|
-
this.emit("config", __privateGet(this, _config));
|
|
3300
|
+
};
|
|
3342
3301
|
}
|
|
3343
3302
|
get groupBy() {
|
|
3344
3303
|
return __privateGet(this, _config).groupBy;
|
|
@@ -3347,20 +3306,10 @@ var VuuDataSource = class extends EventEmitter2 {
|
|
|
3347
3306
|
var _a;
|
|
3348
3307
|
if (itemsOrOrderChanged(this.groupBy, groupBy)) {
|
|
3349
3308
|
const wasGrouped = __privateGet(this, _groupBy).length > 0;
|
|
3350
|
-
|
|
3309
|
+
this.config = {
|
|
3351
3310
|
...__privateGet(this, _config),
|
|
3352
3311
|
groupBy
|
|
3353
|
-
}
|
|
3354
|
-
if (this.viewport) {
|
|
3355
|
-
const message = {
|
|
3356
|
-
viewport: this.viewport,
|
|
3357
|
-
type: "groupBy",
|
|
3358
|
-
groupBy: __privateGet(this, _config).groupBy
|
|
3359
|
-
};
|
|
3360
|
-
if (this.server) {
|
|
3361
|
-
this.server.send(message);
|
|
3362
|
-
}
|
|
3363
|
-
}
|
|
3312
|
+
};
|
|
3364
3313
|
if (!wasGrouped && groupBy.length > 0 && this.viewport) {
|
|
3365
3314
|
(_a = this.clientCallback) == null ? void 0 : _a.call(this, {
|
|
3366
3315
|
clientViewportId: this.viewport,
|
|
@@ -3370,7 +3319,6 @@ var VuuDataSource = class extends EventEmitter2 {
|
|
|
3370
3319
|
rows: []
|
|
3371
3320
|
});
|
|
3372
3321
|
}
|
|
3373
|
-
this.emit("config", __privateGet(this, _config));
|
|
3374
3322
|
this.setConfigPending({ groupBy });
|
|
3375
3323
|
}
|
|
3376
3324
|
}
|