@easyquery/ui 7.1.3-beta02 → 7.2.0-rc04
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/dist/assets/css/aggr-settings.css +6 -6
- package/dist/assets/css/easyfacets.css +11 -1
- package/dist/browser/eq.community.css.map +1 -1
- package/dist/browser/eq.community.js +1341 -1075
- package/dist/browser/eq.community.js.map +1 -1
- package/dist/browser/eq.community.min.js +3 -3
- package/dist/browser/eq.community.min.js.LICENSE.txt +0 -2
- package/dist/browser/eq.community.min.js.map +1 -1
- package/dist/browser/eq.core.css +26 -16
- package/dist/browser/eq.core.min.css +3 -3
- package/dist/browser/eq.view.css +2 -2
- package/dist/browser/eq.view.min.css +2 -2
- package/dist/bundles/easyquery.ui.js +500 -314
- package/dist/bundles/easyquery.ui.js.map +1 -1
- package/dist/bundles/easyquery.ui.min.js +1 -1
- package/dist/bundles/easyquery.ui.min.js.LICENSE.txt +0 -2
- package/dist/bundles/easyquery.ui.min.js.map +1 -1
- package/dist/lib/dialog/aggr_settings_dialog.js +2 -2
- package/dist/lib/dialog/aggr_settings_dialog.js.map +1 -1
- package/dist/lib/extensions.js +1 -1
- package/dist/lib/facets/pivot_table_facet.js +21 -5
- package/dist/lib/facets/pivot_table_facet.js.map +1 -1
- package/dist/lib/facets/result_facet.d.ts +1 -1
- package/dist/lib/facets/result_facet.js +26 -54
- package/dist/lib/facets/result_facet.js.map +1 -1
- package/dist/lib/i18n/text_resources.js +1 -0
- package/dist/lib/i18n/text_resources.js.map +1 -1
- package/dist/lib/utils/popup_menu.d.ts +3 -3
- package/dist/lib/views/data_filter_view.d.ts +1 -0
- package/dist/lib/views/data_filter_view.js +3 -1
- package/dist/lib/views/data_filter_view.js.map +1 -1
- package/dist/lib/views/html_data_filter_view.js +3 -1
- package/dist/lib/views/html_data_filter_view.js.map +1 -1
- package/dist/lib/views/report_view.d.ts +3 -3
- package/dist/lib/views/report_view.js +15 -10
- package/dist/lib/views/report_view.js.map +1 -1
- package/dist/lib/views/view.js +4 -0
- package/dist/lib/views/view.js.map +1 -1
- package/dist/lib/views/view_options.d.ts +2 -1
- package/dist/lib/widgets/aggregation_bar.d.ts +1 -1
- package/dist/lib/widgets/charts/chart_widget.d.ts +1 -1
- package/dist/lib/widgets/columns_bar.d.ts +1 -1
- package/dist/lib/widgets/columns_bar.js.map +1 -1
- package/dist/lib/widgets/columns_panel.d.ts +1 -1
- package/dist/lib/widgets/columns_panel.js +4 -3
- package/dist/lib/widgets/columns_panel.js.map +1 -1
- package/dist/lib/widgets/easy_grid_widget.js +2 -2
- package/dist/lib/widgets/easy_grid_widget.js.map +1 -1
- package/dist/lib/widgets/entities_panel.d.ts +1 -1
- package/dist/lib/widgets/filter_bar.d.ts +1 -1
- package/dist/lib/widgets/query_panel.d.ts +1 -1
- package/dist/lib/widgets/query_panel.js +4 -3
- package/dist/lib/widgets/query_panel.js.map +1 -1
- package/dist/lib/widgets/queryname_widget.d.ts +1 -1
- package/dist/lib/widgets/renderers/aggr_settings/aggr_settings_renderer.d.ts +1 -1
- package/dist/lib/widgets/renderers/aggr_settings/aggr_settings_renderer.js +4 -4
- package/dist/lib/widgets/renderers/aggr_settings/aggr_settings_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.js +0 -1
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.d.ts +1 -1
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js +1 -3
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js.map +1 -1
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.d.ts +1 -1
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js +10 -3
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js.map +1 -1
- package/dist/lib/widgets/renderers/querypanel/addrow_renderer.d.ts +1 -1
- package/dist/lib/widgets/renderers/querypanel/condition_renderer.d.ts +1 -1
- package/dist/lib/widgets/renderers/querypanel/expression_renderer.d.ts +1 -1
- package/dist/lib/widgets/renderers/querypanel/operator_renderer.d.ts +1 -1
- package/dist/lib/widgets/renderers/querypanel/text_renderer.d.ts +1 -1
- package/dist/lib/widgets/renderers/sortingbar/column_renderer_sp.d.ts +1 -1
- package/dist/lib/widgets/result_facets_panel.d.ts +1 -1
- package/dist/lib/widgets/result_facets_panel.js +3 -0
- package/dist/lib/widgets/result_facets_panel.js.map +1 -1
- package/dist/lib/widgets/sorting_bar.d.ts +1 -1
- package/package.json +6 -8
|
@@ -763,7 +763,7 @@ var i18n_i18n;
|
|
|
763
763
|
var utils_utils;
|
|
764
764
|
(function (utils) {
|
|
765
765
|
function getAllDataTypes() {
|
|
766
|
-
return Object.values(DataType);
|
|
766
|
+
return Object.values(DataType).filter(function (item) { return typeof item === "number"; });
|
|
767
767
|
}
|
|
768
768
|
utils.getAllDataTypes = getAllDataTypes;
|
|
769
769
|
function getDateDataTypes() {
|
|
@@ -771,12 +771,16 @@ var utils_utils;
|
|
|
771
771
|
}
|
|
772
772
|
utils.getDateDataTypes = getDateDataTypes;
|
|
773
773
|
function getStringDataTypes() {
|
|
774
|
-
return [DataType.String, DataType.Memo];
|
|
774
|
+
return [DataType.String, DataType.Memo, DataType.FixedChar];
|
|
775
775
|
}
|
|
776
776
|
utils.getStringDataTypes = getStringDataTypes;
|
|
777
777
|
var _numericTypes = [DataType.Byte, DataType.Word, DataType.Int32,
|
|
778
|
-
DataType.Int64, DataType.Float, DataType.Currency];
|
|
779
|
-
|
|
778
|
+
DataType.Int64, DataType.Float, DataType.Currency, DataType.Autoinc];
|
|
779
|
+
function getNumericDataTypes() {
|
|
780
|
+
return _numericTypes;
|
|
781
|
+
}
|
|
782
|
+
utils.getNumericDataTypes = getNumericDataTypes;
|
|
783
|
+
var _intTypes = [DataType.Byte, DataType.Word, DataType.Int32, DataType.Int64, DataType.Autoinc];
|
|
780
784
|
//-------------- object functions -------------------
|
|
781
785
|
/**
|
|
782
786
|
* Copy the content of all objests passed in `args` parameters into `target`
|
|
@@ -841,7 +845,7 @@ var utils_utils;
|
|
|
841
845
|
hashSet.set(sourceVal, target[key]);
|
|
842
846
|
}
|
|
843
847
|
else {
|
|
844
|
-
if (typeof target[key] == 'undefined') {
|
|
848
|
+
if (typeof target[key] == 'undefined' || target[key] == null) {
|
|
845
849
|
target[key] = Object.create(Object.getPrototypeOf(sourceVal));
|
|
846
850
|
}
|
|
847
851
|
hashSet.set(sourceVal, target[key]);
|
|
@@ -1370,7 +1374,7 @@ var http_client_HttpClient = /** @class */ (function () {
|
|
|
1370
1374
|
var desc = {
|
|
1371
1375
|
method: method,
|
|
1372
1376
|
url: url,
|
|
1373
|
-
headers: __assign({}, this.defaultHeaders, options.headers || {}),
|
|
1377
|
+
headers: __assign(__assign({}, this.defaultHeaders), options.headers || {}),
|
|
1374
1378
|
queryParams: options.queryParams || {},
|
|
1375
1379
|
data: data
|
|
1376
1380
|
};
|
|
@@ -1516,6 +1520,12 @@ var MetaEntity = /** @class */ (function () {
|
|
|
1516
1520
|
};
|
|
1517
1521
|
internalProcessEntity(this);
|
|
1518
1522
|
};
|
|
1523
|
+
MetaEntity.prototype.getFirstPrimaryAttr = function () {
|
|
1524
|
+
return this.getPrimaryAttrs()[0];
|
|
1525
|
+
};
|
|
1526
|
+
MetaEntity.prototype.getPrimaryAttrs = function () {
|
|
1527
|
+
return this.attributes.filter(function (attr) { return attr.isPrimaryKey; });
|
|
1528
|
+
};
|
|
1519
1529
|
return MetaEntity;
|
|
1520
1530
|
}());
|
|
1521
1531
|
|
|
@@ -2134,9 +2144,9 @@ var meta_data_MetaData = /** @class */ (function () {
|
|
|
2134
2144
|
}());
|
|
2135
2145
|
|
|
2136
2146
|
//# sourceMappingURL=meta_data.js.map
|
|
2137
|
-
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/
|
|
2138
|
-
var
|
|
2139
|
-
|
|
2147
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/aggr_settings.js
|
|
2148
|
+
var aggr_settings_assign = (undefined && undefined.__assign) || function () {
|
|
2149
|
+
aggr_settings_assign = Object.assign || function(t) {
|
|
2140
2150
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2141
2151
|
s = arguments[i];
|
|
2142
2152
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
@@ -2144,7 +2154,7 @@ var aggr_calculator_assign = (undefined && undefined.__assign) || function () {
|
|
|
2144
2154
|
}
|
|
2145
2155
|
return t;
|
|
2146
2156
|
};
|
|
2147
|
-
return
|
|
2157
|
+
return aggr_settings_assign.apply(this, arguments);
|
|
2148
2158
|
};
|
|
2149
2159
|
/**
|
|
2150
2160
|
* Defines aggregations settings for the current context.
|
|
@@ -2157,16 +2167,32 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2157
2167
|
this.groups = [];
|
|
2158
2168
|
this.useGrandTotals = false;
|
|
2159
2169
|
this.useRecordCount = false;
|
|
2160
|
-
this.
|
|
2170
|
+
this._caseSensitiveGroups = false;
|
|
2161
2171
|
this.COUNT_FIELD_NAME = 'GRPRECCNT';
|
|
2162
2172
|
}
|
|
2173
|
+
Object.defineProperty(AggregationSettings.prototype, "caseSensitiveGroups", {
|
|
2174
|
+
get: function () {
|
|
2175
|
+
return this._caseSensitiveGroups;
|
|
2176
|
+
},
|
|
2177
|
+
set: function (value) {
|
|
2178
|
+
this._caseSensitiveGroups = value;
|
|
2179
|
+
this.updateCompareProc();
|
|
2180
|
+
},
|
|
2181
|
+
enumerable: true,
|
|
2182
|
+
configurable: true
|
|
2183
|
+
});
|
|
2184
|
+
AggregationSettings.prototype.updateCompareProc = function () {
|
|
2185
|
+
this.compareValues = this._caseSensitiveGroups
|
|
2186
|
+
? this.strictCompare
|
|
2187
|
+
: this.caseInsensitiveCompare;
|
|
2188
|
+
};
|
|
2163
2189
|
AggregationSettings.prototype.addGroup = function (settings) {
|
|
2164
2190
|
var cols = settings.columns || this.colStore.getColumnIds(settings.from, settings.to);
|
|
2165
2191
|
if (!this.colStore.validateColumns(cols))
|
|
2166
2192
|
throw "Invalid columns: " + cols;
|
|
2167
2193
|
if (this.hasColumnsInUse(cols))
|
|
2168
2194
|
throw "Can't add same columns to different groups/aggregates";
|
|
2169
|
-
this.groups.push(
|
|
2195
|
+
this.groups.push(aggr_settings_assign({ columns: cols }, settings));
|
|
2170
2196
|
return this;
|
|
2171
2197
|
};
|
|
2172
2198
|
AggregationSettings.prototype.addAggregateColumn = function (colIndexOrId, funcId) {
|
|
@@ -2191,7 +2217,7 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2191
2217
|
var cols = [];
|
|
2192
2218
|
var mappedGrops = this.groups.map(function (grp) {
|
|
2193
2219
|
cols = cols.concat(grp.columns);
|
|
2194
|
-
return
|
|
2220
|
+
return aggr_settings_assign(aggr_settings_assign({}, grp), { columns: Array.from(cols), aggregates: Array.from(_this.aggregates) });
|
|
2195
2221
|
});
|
|
2196
2222
|
return mappedGrops;
|
|
2197
2223
|
};
|
|
@@ -2283,10 +2309,35 @@ var AggregationSettings = /** @class */ (function () {
|
|
|
2283
2309
|
}
|
|
2284
2310
|
}
|
|
2285
2311
|
};
|
|
2312
|
+
AggregationSettings.prototype.buildGroupKey = function (group, row) {
|
|
2313
|
+
var caseInsensitive = !this.caseSensitiveGroups;
|
|
2314
|
+
var result = {};
|
|
2315
|
+
if (group) {
|
|
2316
|
+
for (var _i = 0, _a = group.columns; _i < _a.length; _i++) {
|
|
2317
|
+
var colId = _a[_i];
|
|
2318
|
+
var keyVal = row.getValue(colId);
|
|
2319
|
+
if (caseInsensitive && typeof (keyVal) === 'string') {
|
|
2320
|
+
keyVal = keyVal.toLowerCase();
|
|
2321
|
+
}
|
|
2322
|
+
result[colId] = keyVal;
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
return result;
|
|
2326
|
+
};
|
|
2327
|
+
//returns true if value1 == value2
|
|
2328
|
+
AggregationSettings.prototype.strictCompare = function (value1, value2) {
|
|
2329
|
+
return value1 === value2;
|
|
2330
|
+
};
|
|
2331
|
+
//makes a case insensative comparision of two values and return true if there are equal
|
|
2332
|
+
AggregationSettings.prototype.caseInsensitiveCompare = function (value1, value2) {
|
|
2333
|
+
var val1 = (typeof value1 === 'string') ? value1.toLowerCase() : value1;
|
|
2334
|
+
var val2 = (typeof value2 === 'string') ? value2.toLowerCase() : value2;
|
|
2335
|
+
return val1 === val2;
|
|
2336
|
+
};
|
|
2286
2337
|
return AggregationSettings;
|
|
2287
2338
|
}());
|
|
2288
2339
|
|
|
2289
|
-
//# sourceMappingURL=
|
|
2340
|
+
//# sourceMappingURL=aggr_settings.js.map
|
|
2290
2341
|
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/data/data_column.js
|
|
2291
2342
|
|
|
2292
2343
|
|
|
@@ -2314,6 +2365,7 @@ var data_column_DataColumn = /** @class */ (function () {
|
|
|
2314
2365
|
this.groupFooterColumnTemplate = desc.gfct;
|
|
2315
2366
|
this.style = desc.style || {};
|
|
2316
2367
|
this.description = desc.description;
|
|
2368
|
+
this.calculatedWidth = 0;
|
|
2317
2369
|
}
|
|
2318
2370
|
return DataColumn;
|
|
2319
2371
|
}());
|
|
@@ -2353,9 +2405,10 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2353
2405
|
.map(function (col, index) { return index; });
|
|
2354
2406
|
};
|
|
2355
2407
|
DataColumnList.prototype.put = function (index, col) {
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2408
|
+
if (index >= 0 && index < this.count) {
|
|
2409
|
+
this.items[index] = col;
|
|
2410
|
+
this.updateDateColumnIdx();
|
|
2411
|
+
}
|
|
2359
2412
|
};
|
|
2360
2413
|
DataColumnList.prototype.move = function (col, newIndex) {
|
|
2361
2414
|
var oldIndex = this.items.indexOf(col);
|
|
@@ -2365,8 +2418,12 @@ var data_column_DataColumnList = /** @class */ (function () {
|
|
|
2365
2418
|
}
|
|
2366
2419
|
};
|
|
2367
2420
|
DataColumnList.prototype.get = function (index) {
|
|
2368
|
-
|
|
2369
|
-
|
|
2421
|
+
if (index >= 0 && index < this.count) {
|
|
2422
|
+
return this.items[index];
|
|
2423
|
+
}
|
|
2424
|
+
else {
|
|
2425
|
+
return null;
|
|
2426
|
+
}
|
|
2370
2427
|
};
|
|
2371
2428
|
DataColumnList.prototype.getIndex = function (id) {
|
|
2372
2429
|
return this.mapper[id];
|
|
@@ -2450,16 +2507,23 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2450
2507
|
function EasyDataTable(options) {
|
|
2451
2508
|
this._chunkSize = 1000;
|
|
2452
2509
|
this._elasticChunks = false;
|
|
2453
|
-
|
|
2454
|
-
this.chunkMap = {};
|
|
2510
|
+
this.cachedRows = [];
|
|
2455
2511
|
this.total = 0;
|
|
2456
2512
|
this.loader = null;
|
|
2457
2513
|
this.needTotal = true;
|
|
2514
|
+
this.isInMemory = false;
|
|
2458
2515
|
options = options || {};
|
|
2459
2516
|
this._chunkSize = options.chunkSize || this._chunkSize;
|
|
2460
2517
|
this._elasticChunks = options.elasticChunks || this._elasticChunks;
|
|
2461
2518
|
this.loader = options.loader;
|
|
2519
|
+
if (typeof options.inMemory !== 'undefined') {
|
|
2520
|
+
this.isInMemory = options.inMemory;
|
|
2521
|
+
}
|
|
2522
|
+
if (this.isInMemory) {
|
|
2523
|
+
this.needTotal = false;
|
|
2524
|
+
}
|
|
2462
2525
|
this._columns = new data_column_DataColumnList();
|
|
2526
|
+
this.onUpdate = options.onUpdate;
|
|
2463
2527
|
if (options.columns) {
|
|
2464
2528
|
for (var _i = 0, _a = options.columns; _i < _a.length; _i++) {
|
|
2465
2529
|
var colDesc = _a[_i];
|
|
@@ -2490,7 +2554,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2490
2554
|
this._chunkSize = value;
|
|
2491
2555
|
this.total = 0;
|
|
2492
2556
|
this.needTotal = !this.elasticChunks;
|
|
2493
|
-
this.
|
|
2557
|
+
this.cachedRows = [];
|
|
2494
2558
|
},
|
|
2495
2559
|
enumerable: true,
|
|
2496
2560
|
configurable: true
|
|
@@ -2503,7 +2567,7 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2503
2567
|
this._elasticChunks = value;
|
|
2504
2568
|
this.total = 0;
|
|
2505
2569
|
this.needTotal = !this.elasticChunks;
|
|
2506
|
-
this.
|
|
2570
|
+
this.cachedRows = [];
|
|
2507
2571
|
},
|
|
2508
2572
|
enumerable: true,
|
|
2509
2573
|
configurable: true
|
|
@@ -2531,22 +2595,12 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2531
2595
|
endIndex = this.total;
|
|
2532
2596
|
}
|
|
2533
2597
|
}
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
var allChunksCached = true;
|
|
2537
|
-
for (var i = lbChunk; i <= ubChunk; i++) {
|
|
2538
|
-
if (!this.chunkMap[i]) {
|
|
2539
|
-
allChunksCached = false;
|
|
2540
|
-
break;
|
|
2541
|
-
}
|
|
2598
|
+
if (this.isInMemory && endIndex > this.cachedRows.length) {
|
|
2599
|
+
endIndex = this.cachedRows.length;
|
|
2542
2600
|
}
|
|
2601
|
+
var allChunksCached = endIndex <= this.cachedRows.length;
|
|
2543
2602
|
if (allChunksCached) {
|
|
2544
|
-
|
|
2545
|
-
for (var i = lbChunk; i <= ubChunk; i++) {
|
|
2546
|
-
resultArr = resultArr.concat(this.chunkMap[i].rows);
|
|
2547
|
-
}
|
|
2548
|
-
var firstChunkOffset = this.chunkMap[lbChunk].offset;
|
|
2549
|
-
return Promise.resolve(resultArr.slice(fromIndex - firstChunkOffset, endIndex - firstChunkOffset));
|
|
2603
|
+
return Promise.resolve(this.cachedRows.slice(fromIndex, endIndex));
|
|
2550
2604
|
}
|
|
2551
2605
|
//if loader is not defined
|
|
2552
2606
|
if (!this.loader) {
|
|
@@ -2557,53 +2611,34 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2557
2611
|
if (this.needTotal) {
|
|
2558
2612
|
this.needTotal = false;
|
|
2559
2613
|
}
|
|
2560
|
-
var
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2614
|
+
var offset = this.cachedRows.length;
|
|
2615
|
+
var limit = endIndex - offset;
|
|
2616
|
+
if (limit < this._chunkSize) {
|
|
2617
|
+
limit = this._chunkSize;
|
|
2618
|
+
}
|
|
2619
|
+
var resultPromise = this.loader.loadChunk({
|
|
2620
|
+
offset: offset,
|
|
2565
2621
|
limit: limit,
|
|
2566
2622
|
needTotal: needTotal
|
|
2567
2623
|
})
|
|
2568
2624
|
.then(function (result) {
|
|
2569
|
-
var chunks = result.table.getCachedChunks();
|
|
2570
2625
|
if (needTotal) {
|
|
2571
2626
|
_this.total = result.total;
|
|
2572
|
-
if (endIndex > _this.total) {
|
|
2573
|
-
endIndex = _this.total;
|
|
2574
|
-
}
|
|
2575
2627
|
}
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
_this.chunkMap[index] = {
|
|
2580
|
-
offset: index * _this._chunkSize,
|
|
2581
|
-
rows: chunk.rows
|
|
2582
|
-
};
|
|
2583
|
-
index++;
|
|
2628
|
+
Array.prototype.push.apply(_this.cachedRows, result.table.getCachedRows());
|
|
2629
|
+
if (endIndex > _this.cachedRows.length) {
|
|
2630
|
+
endIndex = _this.cachedRows.length;
|
|
2584
2631
|
}
|
|
2585
2632
|
if (_this.elasticChunks) {
|
|
2586
2633
|
var count_1 = result.table.getCachedCount();
|
|
2587
|
-
if (count_1
|
|
2588
|
-
|
|
2589
|
-
if (count_1 === limit) {
|
|
2590
|
-
chunk.rows.splice(chunk.rows.length - 1, 1);
|
|
2591
|
-
if (chunk.rows.length == 0) {
|
|
2592
|
-
delete _this.chunkMap[index - 1];
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
if (count_1 < limit) {
|
|
2596
|
-
_this.total = _this.getCachedCount();
|
|
2597
|
-
}
|
|
2634
|
+
if (count_1 < limit) {
|
|
2635
|
+
_this.total = _this.cachedRows.length;
|
|
2598
2636
|
}
|
|
2599
2637
|
}
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
resultArr = resultArr.concat(_this.chunkMap[i].rows);
|
|
2603
|
-
}
|
|
2604
|
-
var firstChunkOffset = _this.chunkMap[lbChunk].offset;
|
|
2605
|
-
return resultArr.slice(fromIndex - firstChunkOffset, endIndex - firstChunkOffset);
|
|
2638
|
+
_this.fireUpdated();
|
|
2639
|
+
return _this.cachedRows.slice(fromIndex, endIndex);
|
|
2606
2640
|
});
|
|
2641
|
+
return resultPromise;
|
|
2607
2642
|
};
|
|
2608
2643
|
EasyDataTable.prototype.getRow = function (index) {
|
|
2609
2644
|
return this.getRows({ offset: index, limit: 1 })
|
|
@@ -2615,16 +2650,16 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2615
2650
|
EasyDataTable.prototype.setTotal = function (total) {
|
|
2616
2651
|
this.total = total;
|
|
2617
2652
|
this.needTotal = false;
|
|
2618
|
-
this.chunkMap = {};
|
|
2619
2653
|
};
|
|
2620
2654
|
EasyDataTable.prototype.getCachedCount = function () {
|
|
2621
|
-
return this.
|
|
2655
|
+
return this.cachedRows.length;
|
|
2622
2656
|
};
|
|
2623
2657
|
EasyDataTable.prototype.clear = function () {
|
|
2624
2658
|
this.columns.clear();
|
|
2625
|
-
this.
|
|
2659
|
+
this.cachedRows = [];
|
|
2626
2660
|
this.total = 0;
|
|
2627
2661
|
this.needTotal = !this._elasticChunks;
|
|
2662
|
+
this.fireUpdated();
|
|
2628
2663
|
};
|
|
2629
2664
|
EasyDataTable.prototype.createRow = function (dataOrRow) {
|
|
2630
2665
|
var _this = this;
|
|
@@ -2655,60 +2690,33 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2655
2690
|
}
|
|
2656
2691
|
return null;
|
|
2657
2692
|
};
|
|
2658
|
-
EasyDataTable.prototype.addRow = function (
|
|
2693
|
+
EasyDataTable.prototype.addRow = function (rowOrValues) {
|
|
2659
2694
|
var newRow;
|
|
2660
|
-
if (Array.isArray(
|
|
2695
|
+
if (Array.isArray(rowOrValues)) {
|
|
2696
|
+
var values = rowOrValues;
|
|
2661
2697
|
var dateIdx = this._columns.getDateColumnIndexes();
|
|
2662
2698
|
if (dateIdx.length > 0) {
|
|
2663
2699
|
for (var _i = 0, dateIdx_1 = dateIdx; _i < dateIdx_1.length; _i++) {
|
|
2664
2700
|
var idx = dateIdx_1[_i];
|
|
2665
|
-
if (
|
|
2666
|
-
|
|
2701
|
+
if (values[idx]) {
|
|
2702
|
+
values[idx] = this.mapDate(values[idx], this._columns.get(idx).type);
|
|
2667
2703
|
}
|
|
2668
2704
|
}
|
|
2669
2705
|
}
|
|
2670
|
-
newRow = new DataRow(this._columns,
|
|
2706
|
+
newRow = new DataRow(this._columns, values);
|
|
2671
2707
|
}
|
|
2672
2708
|
else {
|
|
2673
|
-
newRow = this.createRow(
|
|
2674
|
-
}
|
|
2675
|
-
var lastChunk = this.getLastChunk();
|
|
2676
|
-
if (!lastChunk || lastChunk.rows.length >= this._chunkSize) {
|
|
2677
|
-
lastChunk = this.createChunk();
|
|
2709
|
+
newRow = this.createRow(rowOrValues);
|
|
2678
2710
|
}
|
|
2679
|
-
|
|
2711
|
+
this.cachedRows.push(newRow);
|
|
2680
2712
|
var cachedTotal = this.getCachedCount();
|
|
2681
2713
|
if (cachedTotal > this.total) {
|
|
2682
2714
|
this.total = cachedTotal;
|
|
2683
2715
|
}
|
|
2684
2716
|
return newRow;
|
|
2685
2717
|
};
|
|
2686
|
-
EasyDataTable.prototype.createChunk = function (index) {
|
|
2687
|
-
if (typeof index == 'undefined') {
|
|
2688
|
-
index = this.getLastChunkIndex() + 1;
|
|
2689
|
-
}
|
|
2690
|
-
var chunk = { offset: index * this._chunkSize, rows: [] };
|
|
2691
|
-
this.chunkMap[index] = chunk;
|
|
2692
|
-
return chunk;
|
|
2693
|
-
};
|
|
2694
|
-
EasyDataTable.prototype.getLastChunkIndex = function () {
|
|
2695
|
-
var keys = Object.keys(this.chunkMap);
|
|
2696
|
-
return keys.length > 0
|
|
2697
|
-
? parseInt(keys[keys.length - 1])
|
|
2698
|
-
: -1;
|
|
2699
|
-
};
|
|
2700
|
-
EasyDataTable.prototype.getLastChunk = function () {
|
|
2701
|
-
var index = this.getLastChunkIndex();
|
|
2702
|
-
return index > -1
|
|
2703
|
-
? this.chunkMap[index]
|
|
2704
|
-
: null;
|
|
2705
|
-
};
|
|
2706
2718
|
EasyDataTable.prototype.getCachedRows = function () {
|
|
2707
|
-
return this.
|
|
2708
|
-
.reduce(function (acc, v) { return acc.concat(v.rows); }, []);
|
|
2709
|
-
};
|
|
2710
|
-
EasyDataTable.prototype.getCachedChunks = function () {
|
|
2711
|
-
return Object.values(this.chunkMap);
|
|
2719
|
+
return this.cachedRows;
|
|
2712
2720
|
};
|
|
2713
2721
|
EasyDataTable.prototype.totalIsKnown = function () {
|
|
2714
2722
|
if (this.elasticChunks) {
|
|
@@ -2717,6 +2725,11 @@ var easy_data_table_EasyDataTable = /** @class */ (function () {
|
|
|
2717
2725
|
}
|
|
2718
2726
|
return !this.needTotal;
|
|
2719
2727
|
};
|
|
2728
|
+
EasyDataTable.prototype.fireUpdated = function () {
|
|
2729
|
+
if (this.onUpdate) {
|
|
2730
|
+
this.onUpdate(this);
|
|
2731
|
+
}
|
|
2732
|
+
};
|
|
2720
2733
|
return EasyDataTable;
|
|
2721
2734
|
}());
|
|
2722
2735
|
|
|
@@ -2901,7 +2914,6 @@ i18n_i18n.resetLocales();
|
|
|
2901
2914
|
|
|
2902
2915
|
|
|
2903
2916
|
|
|
2904
|
-
//data
|
|
2905
2917
|
|
|
2906
2918
|
|
|
2907
2919
|
|
|
@@ -2962,7 +2974,7 @@ __webpack_require__.d(__webpack_exports__, "r", function() { return /* reexport
|
|
|
2962
2974
|
__webpack_require__.d(__webpack_exports__, "s", function() { return /* reexport */ slideUp; });
|
|
2963
2975
|
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ DefaultDialogService; });
|
|
2964
2976
|
|
|
2965
|
-
// UNUSED EXPORTS: GridColumnAlign, GridColumn, GridColumnList, DFMT_REGEX, CellRendererType, GridCellRendererStore, Calendar, DateTimePicker, DefaultCalendar, DefaultTimePicker, TimePicker, browserUtils, DomTextAreaElementBuilder, DomInputElementBuilder, DomSelectElementBuilder, EqDragEvent, DragManager, mask, wrapInner, getDocSize, eqCssPrefix, eqCssMobile, DefaultDialog, DefaultProgressDialog, DefaultDialogSet, DialogFooterAlignment, dialogs
|
|
2977
|
+
// UNUSED EXPORTS: AutoResizeColumns, GridColumnAlign, GridColumn, GridColumnList, DFMT_REGEX, CellRendererType, GridCellRendererStore, Calendar, DateTimePicker, DefaultCalendar, DefaultTimePicker, TimePicker, browserUtils, DomTextAreaElementBuilder, DomInputElementBuilder, DomSelectElementBuilder, EqDragEvent, DragManager, mask, wrapInner, getDocSize, eqCssPrefix, eqCssMobile, DefaultDialog, DefaultProgressDialog, DefaultDialogSet, DialogFooterAlignment, dialogs
|
|
2966
2978
|
|
|
2967
2979
|
// EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/core/dist/lib/public_api.js + 21 modules
|
|
2968
2980
|
var public_api = __webpack_require__(0);
|
|
@@ -3309,6 +3321,13 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
3309
3321
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3310
3322
|
};
|
|
3311
3323
|
})();
|
|
3324
|
+
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
|
|
3325
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
3326
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
3327
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
3328
|
+
r[k] = a[j];
|
|
3329
|
+
return r;
|
|
3330
|
+
};
|
|
3312
3331
|
|
|
3313
3332
|
var DomElementBuilder = /** @class */ (function () {
|
|
3314
3333
|
function DomElementBuilder(tag, parent) {
|
|
@@ -3379,7 +3398,7 @@ var DomElementBuilder = /** @class */ (function () {
|
|
|
3379
3398
|
classNames[_i - 1] = arguments[_i];
|
|
3380
3399
|
}
|
|
3381
3400
|
if (className) {
|
|
3382
|
-
var fullList = className.trim().split(" ")
|
|
3401
|
+
var fullList = __spreadArrays(className.trim().split(" "), classNames);
|
|
3383
3402
|
for (var i = 0; i < fullList.length; i++)
|
|
3384
3403
|
this.element.classList.add(fullList[i]);
|
|
3385
3404
|
}
|
|
@@ -3391,7 +3410,7 @@ var DomElementBuilder = /** @class */ (function () {
|
|
|
3391
3410
|
classNames[_i - 1] = arguments[_i];
|
|
3392
3411
|
}
|
|
3393
3412
|
if (className) {
|
|
3394
|
-
var fullList = className.trim().split(" ")
|
|
3413
|
+
var fullList = __spreadArrays(className.trim().split(" "), classNames);
|
|
3395
3414
|
for (var i = 0; i < fullList.length; i++)
|
|
3396
3415
|
this.element.classList.remove(fullList[i]);
|
|
3397
3416
|
}
|
|
@@ -3958,6 +3977,14 @@ var drag_manager_DragManager = /** @class */ (function () {
|
|
|
3958
3977
|
//global variable
|
|
3959
3978
|
var eqDragManager = new drag_manager_DragManager();
|
|
3960
3979
|
//# sourceMappingURL=drag_manager.js.map
|
|
3980
|
+
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/ui/dist/lib/grid/easy_grid_options.js
|
|
3981
|
+
var AutoResizeColumns;
|
|
3982
|
+
(function (AutoResizeColumns) {
|
|
3983
|
+
AutoResizeColumns[AutoResizeColumns["Always"] = 0] = "Always";
|
|
3984
|
+
AutoResizeColumns[AutoResizeColumns["Once"] = 1] = "Once";
|
|
3985
|
+
AutoResizeColumns[AutoResizeColumns["Never"] = 2] = "Never";
|
|
3986
|
+
})(AutoResizeColumns || (AutoResizeColumns = {}));
|
|
3987
|
+
//# sourceMappingURL=easy_grid_options.js.map
|
|
3961
3988
|
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/ui/dist/lib/grid/easy_grid_cell_renderer.js
|
|
3962
3989
|
|
|
3963
3990
|
|
|
@@ -4109,13 +4136,7 @@ var easy_grid_cell_renderer_GridCellRendererStore = /** @class */ (function () {
|
|
|
4109
4136
|
// CONCATENATED MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/ui/dist/lib/grid/easy_grid_columns.js
|
|
4110
4137
|
|
|
4111
4138
|
|
|
4112
|
-
var DEFAULT_WIDTH = 150;
|
|
4113
|
-
var DEFAULT_WIDTH_NUMBER = 120;
|
|
4114
|
-
var DEFAULT_WIDTH_DATE = 200;
|
|
4115
|
-
var DEFAULT_WIDTH_BOOL = 80;
|
|
4116
4139
|
var DEFAULT_WIDTH_STRING = 250;
|
|
4117
|
-
var MIN_WIDTH_STRING = 100;
|
|
4118
|
-
var MAX_WIDTH_STRING = 500;
|
|
4119
4140
|
var ROW_NUM_WIDTH = 60;
|
|
4120
4141
|
var GridColumnAlign;
|
|
4121
4142
|
(function (GridColumnAlign) {
|
|
@@ -4147,31 +4168,18 @@ var easy_grid_columns_GridColumn = /** @class */ (function () {
|
|
|
4147
4168
|
this.isRowNum = false;
|
|
4148
4169
|
this.dataColumn = column;
|
|
4149
4170
|
this.grid = grid;
|
|
4171
|
+
var widthOptions = grid.options.columnWidths || {};
|
|
4150
4172
|
if (column) {
|
|
4151
4173
|
if (column.style.alignment) {
|
|
4152
4174
|
this.align = MapAlignment(column.style.alignment);
|
|
4153
4175
|
}
|
|
4154
|
-
|
|
4155
|
-
var cellType = this.grid.cellRendererStore.getCellType(coltype);
|
|
4156
|
-
switch (cellType) {
|
|
4157
|
-
case CellRendererType.NUMBER:
|
|
4158
|
-
this.width = DEFAULT_WIDTH_NUMBER;
|
|
4159
|
-
break;
|
|
4160
|
-
case CellRendererType.DATETIME:
|
|
4161
|
-
this.width = DEFAULT_WIDTH_DATE;
|
|
4162
|
-
break;
|
|
4163
|
-
case CellRendererType.BOOL:
|
|
4164
|
-
this.width = DEFAULT_WIDTH_BOOL;
|
|
4165
|
-
break;
|
|
4166
|
-
default:
|
|
4167
|
-
this.width = DEFAULT_WIDTH_STRING;
|
|
4168
|
-
}
|
|
4176
|
+
this.width = (widthOptions && widthOptions[this.type]) ? widthOptions[this.type].default : DEFAULT_WIDTH_STRING;
|
|
4169
4177
|
this.cellRenderer = this.grid.cellRendererStore.getDefaultRenderer(column.type);
|
|
4170
4178
|
this._description = column.description;
|
|
4171
4179
|
}
|
|
4172
4180
|
else if (isRowNum) {
|
|
4173
4181
|
this.isRowNum = true;
|
|
4174
|
-
this.width = ROW_NUM_WIDTH;
|
|
4182
|
+
this.width = (widthOptions && widthOptions.rowNumColumn) ? widthOptions.rowNumColumn.default : ROW_NUM_WIDTH;
|
|
4175
4183
|
this._label = '';
|
|
4176
4184
|
this.cellRenderer = this.grid.cellRendererStore.getDefaultRendererByType(CellRendererType.NUMBER);
|
|
4177
4185
|
}
|
|
@@ -4217,9 +4225,10 @@ var easy_grid_columns_GridColumnList = /** @class */ (function () {
|
|
|
4217
4225
|
GridColumnList.prototype.sync = function (columnList, hasRowNumCol) {
|
|
4218
4226
|
if (hasRowNumCol === void 0) { hasRowNumCol = true; }
|
|
4219
4227
|
this.clear();
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4228
|
+
var rowNumCol = new easy_grid_columns_GridColumn(null, this.grid, true);
|
|
4229
|
+
this.add(rowNumCol);
|
|
4230
|
+
if (!hasRowNumCol) {
|
|
4231
|
+
rowNumCol.isVisible = false;
|
|
4223
4232
|
}
|
|
4224
4233
|
if (columnList) {
|
|
4225
4234
|
for (var _i = 0, _a = columnList.getItems(); _i < _a.length; _i++) {
|
|
@@ -4293,6 +4302,14 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
4293
4302
|
};
|
|
4294
4303
|
return __assign.apply(this, arguments);
|
|
4295
4304
|
};
|
|
4305
|
+
var easy_grid_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
|
|
4306
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
4307
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
4308
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
4309
|
+
r[k] = a[j];
|
|
4310
|
+
return r;
|
|
4311
|
+
};
|
|
4312
|
+
|
|
4296
4313
|
|
|
4297
4314
|
|
|
4298
4315
|
|
|
@@ -4325,14 +4342,42 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4325
4342
|
pageSize: 30,
|
|
4326
4343
|
pageSizeItems: [20, 30, 50, 100, 200]
|
|
4327
4344
|
},
|
|
4328
|
-
|
|
4345
|
+
columnWidths: {
|
|
4346
|
+
autoResize: AutoResizeColumns.Always,
|
|
4347
|
+
stringColumns: {
|
|
4348
|
+
min: 100,
|
|
4349
|
+
max: 500,
|
|
4350
|
+
default: 250
|
|
4351
|
+
},
|
|
4352
|
+
numberColumns: {
|
|
4353
|
+
min: 60,
|
|
4354
|
+
default: 120
|
|
4355
|
+
},
|
|
4356
|
+
boolColumns: {
|
|
4357
|
+
min: 50,
|
|
4358
|
+
default: 80
|
|
4359
|
+
},
|
|
4360
|
+
dateColumns: {
|
|
4361
|
+
min: 80,
|
|
4362
|
+
default: 200
|
|
4363
|
+
},
|
|
4364
|
+
otherColumns: {
|
|
4365
|
+
min: 100,
|
|
4366
|
+
max: 500,
|
|
4367
|
+
default: 250
|
|
4368
|
+
},
|
|
4369
|
+
rowNumColumn: {
|
|
4370
|
+
min: 40,
|
|
4371
|
+
default: 60
|
|
4372
|
+
}
|
|
4373
|
+
},
|
|
4374
|
+
showPlusButton: false,
|
|
4329
4375
|
viewportRowsCount: null,
|
|
4330
4376
|
showActiveRow: true
|
|
4331
4377
|
};
|
|
4332
4378
|
this.rowsOnPagePromise = null;
|
|
4333
4379
|
this.containerInitialHeight = 0;
|
|
4334
4380
|
this.firstRender = true;
|
|
4335
|
-
this.compareValues = this.strictCompare;
|
|
4336
4381
|
this.prevRowTotals = null;
|
|
4337
4382
|
this.landingIndex = -1;
|
|
4338
4383
|
this.landingSlot = domel('div')
|
|
@@ -4344,7 +4389,8 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4344
4389
|
if (options && options.paging) {
|
|
4345
4390
|
options.paging = public_api["i" /* utils */].assign(this.defaultDataGridOptions.paging, options.paging);
|
|
4346
4391
|
}
|
|
4347
|
-
this.options =
|
|
4392
|
+
this.options = this.mergeOptions(options);
|
|
4393
|
+
this.processColumnWidthsOptions();
|
|
4348
4394
|
if (!this.options.slot)
|
|
4349
4395
|
throw Error('"slot" parameter is required to initialize EasyDataGrid');
|
|
4350
4396
|
if (!this.options.dataTable)
|
|
@@ -4356,6 +4402,42 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4356
4402
|
this.setSlot(this.options.slot);
|
|
4357
4403
|
this.init(this.options);
|
|
4358
4404
|
}
|
|
4405
|
+
EasyGrid.prototype.mergeOptions = function (options) {
|
|
4406
|
+
var colWidthOptions = public_api["i" /* utils */].assignDeep({}, this.defaultDataGridOptions.columnWidths, options.columnWidths);
|
|
4407
|
+
var pagingOptions = public_api["i" /* utils */].assignDeep({}, this.defaultDataGridOptions.paging, options.paging);
|
|
4408
|
+
var result = public_api["i" /* utils */].assign({}, this.defaultDataGridOptions, options);
|
|
4409
|
+
result.columnWidths = colWidthOptions;
|
|
4410
|
+
result.paging = pagingOptions;
|
|
4411
|
+
return result;
|
|
4412
|
+
};
|
|
4413
|
+
EasyGrid.prototype.processColumnWidthsOptions = function () {
|
|
4414
|
+
var widthOptions = this.options.columnWidths;
|
|
4415
|
+
if (!widthOptions)
|
|
4416
|
+
return;
|
|
4417
|
+
//string columns
|
|
4418
|
+
public_api["i" /* utils */].getStringDataTypes().forEach(function (dataType) {
|
|
4419
|
+
widthOptions[dataType] = __assign(__assign({}, widthOptions.stringColumns), widthOptions[dataType]);
|
|
4420
|
+
});
|
|
4421
|
+
//numeric columns
|
|
4422
|
+
public_api["i" /* utils */].getNumericDataTypes().forEach(function (dataType) {
|
|
4423
|
+
widthOptions[dataType] = __assign(__assign({}, widthOptions.numberColumns), widthOptions[dataType]);
|
|
4424
|
+
});
|
|
4425
|
+
//bool columns
|
|
4426
|
+
widthOptions[public_api["d" /* DataType */].Bool] = __assign(__assign({}, widthOptions.boolColumns), widthOptions[public_api["d" /* DataType */].Bool]);
|
|
4427
|
+
//date columns
|
|
4428
|
+
public_api["i" /* utils */].getDateDataTypes().forEach(function (dataType) {
|
|
4429
|
+
widthOptions[dataType] = __assign(__assign({}, widthOptions.dateColumns), widthOptions[dataType]);
|
|
4430
|
+
});
|
|
4431
|
+
//other columns
|
|
4432
|
+
var knownTypes = easy_grid_spreadArrays(public_api["i" /* utils */].getStringDataTypes(), public_api["i" /* utils */].getNumericDataTypes(), public_api["i" /* utils */].getDateDataTypes(), [
|
|
4433
|
+
public_api["d" /* DataType */].Bool
|
|
4434
|
+
]);
|
|
4435
|
+
public_api["i" /* utils */].getAllDataTypes().forEach(function (dataType) {
|
|
4436
|
+
if (!(dataType in knownTypes)) {
|
|
4437
|
+
widthOptions[dataType] = __assign(__assign({}, widthOptions.otherColumns), widthOptions[dataType]);
|
|
4438
|
+
}
|
|
4439
|
+
});
|
|
4440
|
+
};
|
|
4359
4441
|
EasyGrid.prototype.setSlot = function (slot) {
|
|
4360
4442
|
if (typeof slot === 'string') {
|
|
4361
4443
|
if (slot.length) {
|
|
@@ -4388,8 +4470,8 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4388
4470
|
if (options.onRowDbClick) {
|
|
4389
4471
|
this.addEventListener('rowDbClick', options.onRowDbClick);
|
|
4390
4472
|
}
|
|
4391
|
-
if (options.
|
|
4392
|
-
this.addEventListener('
|
|
4473
|
+
if (options.onPlusButtonClick) {
|
|
4474
|
+
this.addEventListener('plusButtonClick', options.onPlusButtonClick);
|
|
4393
4475
|
}
|
|
4394
4476
|
if (options.onColumnChanged) {
|
|
4395
4477
|
this.addEventListener('columnChanged', options.onColumnChanged);
|
|
@@ -4475,7 +4557,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4475
4557
|
};
|
|
4476
4558
|
EasyGrid.prototype.render = function () {
|
|
4477
4559
|
var _this = this;
|
|
4478
|
-
if (!this.hasData() && !this.options.
|
|
4560
|
+
if (!this.hasData() && !this.options.showPlusButton)
|
|
4479
4561
|
return;
|
|
4480
4562
|
this.containerInitialHeight = this.slot.clientHeight;
|
|
4481
4563
|
this.rootDiv = document.createElement('div');
|
|
@@ -4492,6 +4574,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4492
4574
|
gridContainer.classList.add(this.cssPrefix + "-container");
|
|
4493
4575
|
gridContainer.appendChild(this.rootDiv);
|
|
4494
4576
|
this.slot.appendChild(gridContainer);
|
|
4577
|
+
var needAutoResize = this.options.columnWidths.autoResize !== AutoResizeColumns.Never;
|
|
4495
4578
|
if (this.rowsOnPagePromise) {
|
|
4496
4579
|
this.rowsOnPagePromise
|
|
4497
4580
|
.then(function () { return _this.updateHeight(); })
|
|
@@ -4502,8 +4585,13 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4502
4585
|
}
|
|
4503
4586
|
else {
|
|
4504
4587
|
setTimeout(function () {
|
|
4505
|
-
_this.updateHeight()
|
|
4506
|
-
|
|
4588
|
+
_this.updateHeight()
|
|
4589
|
+
.then(function () {
|
|
4590
|
+
_this.firstRender = false;
|
|
4591
|
+
if (needAutoResize) {
|
|
4592
|
+
_this.resizeColumns();
|
|
4593
|
+
}
|
|
4594
|
+
});
|
|
4507
4595
|
}, 100);
|
|
4508
4596
|
}
|
|
4509
4597
|
};
|
|
@@ -4514,14 +4602,14 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4514
4602
|
var firstRow = _this.bodyCellContainerDiv.firstElementChild;
|
|
4515
4603
|
var rowHeight = firstRow ? firstRow.offsetHeight : DEFAULT_ROW_HEIGHT;
|
|
4516
4604
|
var rowCount = _this.options.viewportRowsCount; // || DEFAULT_ROW_COUNT;
|
|
4517
|
-
var
|
|
4518
|
-
domel(_this.
|
|
4519
|
-
.setStyle('height',
|
|
4605
|
+
var viewportHeight_1 = rowHeight * rowCount;
|
|
4606
|
+
domel(_this.bodyViewportDiv)
|
|
4607
|
+
.setStyle('height', viewportHeight_1 + "px");
|
|
4520
4608
|
setTimeout(function () {
|
|
4521
4609
|
var sbHeight = _this.bodyViewportDiv.offsetHeight - _this.bodyViewportDiv.clientHeight;
|
|
4522
|
-
|
|
4523
|
-
domel(_this.
|
|
4524
|
-
.setStyle('height',
|
|
4610
|
+
viewportHeight_1 = viewportHeight_1 + sbHeight;
|
|
4611
|
+
domel(_this.bodyViewportDiv)
|
|
4612
|
+
.setStyle('height', viewportHeight_1 + "px");
|
|
4525
4613
|
resolve();
|
|
4526
4614
|
}, 100);
|
|
4527
4615
|
return;
|
|
@@ -4568,7 +4656,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4568
4656
|
_this.headerRowDiv.appendChild(hd);
|
|
4569
4657
|
if (column.isRowNum) {
|
|
4570
4658
|
domel(hd)
|
|
4571
|
-
.addChildElement(_this.
|
|
4659
|
+
.addChildElement(_this.renderHeaderButtons());
|
|
4572
4660
|
}
|
|
4573
4661
|
});
|
|
4574
4662
|
var containerWidth = this.getContainerWidth();
|
|
@@ -4582,7 +4670,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4582
4670
|
var _this = this;
|
|
4583
4671
|
var colBuilder = domel('div')
|
|
4584
4672
|
.addClass(this.cssPrefix + "-header-cell")
|
|
4585
|
-
.data('col-idx', "" +
|
|
4673
|
+
.data('col-idx', "" + index)
|
|
4586
4674
|
.setStyle('width', column.width + "px");
|
|
4587
4675
|
if (column.dataColumn) {
|
|
4588
4676
|
colBuilder
|
|
@@ -4620,14 +4708,6 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4620
4708
|
}
|
|
4621
4709
|
return colDiv;
|
|
4622
4710
|
};
|
|
4623
|
-
EasyGrid.prototype.strictCompare = function (value1, value2) {
|
|
4624
|
-
return value1 !== value2;
|
|
4625
|
-
};
|
|
4626
|
-
EasyGrid.prototype.caseInsensitiveCompare = function (value1, value2) {
|
|
4627
|
-
var val1 = (typeof value1 === 'string') ? value1.toLowerCase() : value1;
|
|
4628
|
-
var val2 = (typeof value2 === 'string') ? value2.toLowerCase() : value2;
|
|
4629
|
-
return val1 !== val2;
|
|
4630
|
-
};
|
|
4631
4711
|
EasyGrid.prototype.renderBody = function () {
|
|
4632
4712
|
var _this = this;
|
|
4633
4713
|
this.bodyDiv = domel('div')
|
|
@@ -4641,10 +4721,6 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4641
4721
|
.addClass(this.cssPrefix + "-cell-container")
|
|
4642
4722
|
.toDOM();
|
|
4643
4723
|
var showAggrs = this.canShowAggregates();
|
|
4644
|
-
this.compareValues = this.caseInsensitiveCompare;
|
|
4645
|
-
if (showAggrs && this.options.aggregates.settings.caseSensitiveGroups) {
|
|
4646
|
-
this.compareValues = this.strictCompare;
|
|
4647
|
-
}
|
|
4648
4724
|
if (this.dataTable) {
|
|
4649
4725
|
this.showProgress();
|
|
4650
4726
|
this.rowsOnPagePromise = this.getRowsToRender()
|
|
@@ -4654,15 +4730,22 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4654
4730
|
//prevent double rendering (bad solution, we have to figure out how to avoid this behavior properly)
|
|
4655
4731
|
_this.bodyCellContainerDiv.innerHTML = '';
|
|
4656
4732
|
_this.prevRowTotals = null;
|
|
4733
|
+
var rowsToRender = 0;
|
|
4657
4734
|
if (rows.length) {
|
|
4658
4735
|
var groups_1 = showAggrs
|
|
4659
4736
|
? _this.options.aggregates.settings.getGroups()
|
|
4660
4737
|
: [];
|
|
4738
|
+
rowsToRender = (rows.length < _this.pagination.pageSize)
|
|
4739
|
+
? rows.length
|
|
4740
|
+
: _this.pagination.pageSize;
|
|
4661
4741
|
rows.forEach(function (row, index) {
|
|
4662
4742
|
if (showAggrs)
|
|
4663
4743
|
_this.updateTotalsState(groups_1, row);
|
|
4664
|
-
|
|
4665
|
-
|
|
4744
|
+
//we don't actually render the last row
|
|
4745
|
+
if (index < rowsToRender) {
|
|
4746
|
+
var tr = _this.renderRow(row, index);
|
|
4747
|
+
_this.bodyCellContainerDiv.appendChild(tr);
|
|
4748
|
+
}
|
|
4666
4749
|
});
|
|
4667
4750
|
var showGrandTotalsOnEachPage = _this.options.aggregates && _this.options.aggregates.showGrandTotalsOnEachPage;
|
|
4668
4751
|
if (showAggrs && (_this.isLastPage() || showGrandTotalsOnEachPage)) {
|
|
@@ -4670,10 +4753,16 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4670
4753
|
_this.updateTotalsState(groups_1, row, true);
|
|
4671
4754
|
}
|
|
4672
4755
|
}
|
|
4673
|
-
var
|
|
4674
|
-
|
|
4675
|
-
.
|
|
4676
|
-
|
|
4756
|
+
var needAutoResize = _this.options.columnWidths.autoResize !== AutoResizeColumns.Never;
|
|
4757
|
+
if (needAutoResize) {
|
|
4758
|
+
_this.resizeColumns();
|
|
4759
|
+
}
|
|
4760
|
+
else {
|
|
4761
|
+
var containerWidth = _this.getContainerWidth();
|
|
4762
|
+
domel(_this.bodyCellContainerDiv)
|
|
4763
|
+
.setStyle('width', containerWidth + "px");
|
|
4764
|
+
}
|
|
4765
|
+
return rowsToRender;
|
|
4677
4766
|
})
|
|
4678
4767
|
.catch(function (error) { console.error(error); return 0; });
|
|
4679
4768
|
}
|
|
@@ -4681,7 +4770,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4681
4770
|
domel(_this.headerViewportDiv)
|
|
4682
4771
|
.setStyle('margin-left', "-" + _this.bodyViewportDiv.scrollLeft + "px");
|
|
4683
4772
|
});
|
|
4684
|
-
this.bodyViewportDiv.addEventListener('keydown', this.
|
|
4773
|
+
this.bodyViewportDiv.addEventListener('keydown', this.onViewportKeydown.bind(this));
|
|
4685
4774
|
};
|
|
4686
4775
|
EasyGrid.prototype.isLastPage = function () {
|
|
4687
4776
|
if (this.dataTable.elasticChunks) {
|
|
@@ -4707,7 +4796,7 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4707
4796
|
var group = groups[level - 1];
|
|
4708
4797
|
for (var _i = 0, _a = group.columns; _i < _a.length; _i++) {
|
|
4709
4798
|
var col = _a[_i];
|
|
4710
|
-
if (
|
|
4799
|
+
if (!aggrSettings.compareValues(this.prevRowTotals.getValue(col), newRow.getValue(col))) {
|
|
4711
4800
|
changeLevel = level;
|
|
4712
4801
|
break;
|
|
4713
4802
|
}
|
|
@@ -4768,8 +4857,8 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4768
4857
|
});
|
|
4769
4858
|
var aggrContainer = this.options.aggregates.calculator.getAggrContainer();
|
|
4770
4859
|
var aggrCols = aggrSettings.getAggregates().map(function (c) { return c.colId; });
|
|
4771
|
-
var key =
|
|
4772
|
-
aggrContainer.
|
|
4860
|
+
var key = aggrSettings.buildGroupKey(group, row);
|
|
4861
|
+
aggrContainer.getAggregateData(level, key)
|
|
4773
4862
|
.then(function (values) {
|
|
4774
4863
|
for (var _i = 0, aggrCols_1 = aggrCols; _i < aggrCols_1.length; _i++) {
|
|
4775
4864
|
var aggrColId = aggrCols_1[_i];
|
|
@@ -4810,34 +4899,20 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4810
4899
|
}
|
|
4811
4900
|
}
|
|
4812
4901
|
if (groupFooterTemplate) {
|
|
4813
|
-
var cellDiv_1 = _this.renderCell(column,
|
|
4902
|
+
var cellDiv_1 = _this.renderCell(column, index, val, rowElement);
|
|
4814
4903
|
var innerCell = cellDiv_1.firstChild;
|
|
4815
4904
|
val = innerCell.innerHTML;
|
|
4816
4905
|
val = _this.applyGroupColumnTemplate(groupFooterTemplate, val, values[aggrSettings.COUNT_FIELD_NAME]);
|
|
4817
4906
|
}
|
|
4818
4907
|
}
|
|
4819
|
-
var cellDiv = _this.renderCell(column,
|
|
4908
|
+
var cellDiv = _this.renderCell(column, index, val, rowElement);
|
|
4820
4909
|
rowElement.appendChild(cellDiv);
|
|
4821
4910
|
});
|
|
4822
4911
|
})
|
|
4823
4912
|
.catch(function (error) { return console.error(error); });
|
|
4824
4913
|
return rowElement;
|
|
4825
4914
|
};
|
|
4826
|
-
EasyGrid.prototype.
|
|
4827
|
-
var aggrSettings = this.options.aggregates.settings;
|
|
4828
|
-
var caseInsensitive = aggrSettings && !aggrSettings.caseSensitiveGroups;
|
|
4829
|
-
var result = {};
|
|
4830
|
-
for (var _i = 0, _a = group.columns; _i < _a.length; _i++) {
|
|
4831
|
-
var colId = _a[_i];
|
|
4832
|
-
var keyVal = row.getValue(colId);
|
|
4833
|
-
if (caseInsensitive && typeof (keyVal) === 'string') {
|
|
4834
|
-
keyVal = keyVal.toLowerCase();
|
|
4835
|
-
}
|
|
4836
|
-
result[colId] = keyVal;
|
|
4837
|
-
}
|
|
4838
|
-
return result;
|
|
4839
|
-
};
|
|
4840
|
-
EasyGrid.prototype.onVieportKeydown = function (ev) {
|
|
4915
|
+
EasyGrid.prototype.onViewportKeydown = function (ev) {
|
|
4841
4916
|
if (this.options.showActiveRow) {
|
|
4842
4917
|
var rowCount = this.bodyCellContainerDiv.querySelectorAll("." + this.cssPrefix + "-row").length;
|
|
4843
4918
|
var newValue = void 0;
|
|
@@ -4891,13 +4966,17 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4891
4966
|
}
|
|
4892
4967
|
}
|
|
4893
4968
|
};
|
|
4969
|
+
/** Returns a promise with the list of the rows to render on one page.
|
|
4970
|
+
* The list contains pageSize+1 row to make it possible
|
|
4971
|
+
* to render the totals row (if it appears to be on the edge between pages)
|
|
4972
|
+
*/
|
|
4894
4973
|
EasyGrid.prototype.getRowsToRender = function () {
|
|
4895
4974
|
if (this.options.paging.enabled === false) {
|
|
4896
4975
|
return Promise.resolve(this.dataTable.getCachedRows());
|
|
4897
4976
|
}
|
|
4898
4977
|
return this.dataTable.getRows({
|
|
4899
|
-
|
|
4900
|
-
|
|
4978
|
+
offset: (this.pagination.page - 1) * this.pagination.pageSize,
|
|
4979
|
+
limit: this.pagination.pageSize + 1
|
|
4901
4980
|
})
|
|
4902
4981
|
.catch(function (error) {
|
|
4903
4982
|
console.error(error);
|
|
@@ -4922,23 +5001,26 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4922
5001
|
var pageInfoDiv = domel('div')
|
|
4923
5002
|
.addClass(this.cssPrefix + "-page-info")
|
|
4924
5003
|
.toDOM();
|
|
4925
|
-
var
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
var
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
.
|
|
4941
|
-
|
|
5004
|
+
var rowCount = this.dataTable.getTotal();
|
|
5005
|
+
if (rowCount > 0) {
|
|
5006
|
+
var fistPageRecordNum = count
|
|
5007
|
+
? (this.pagination.page - 1) * this.pagination.pageSize + 1
|
|
5008
|
+
: 0;
|
|
5009
|
+
var lastPageRecordNum = count
|
|
5010
|
+
? fistPageRecordNum + count - 1
|
|
5011
|
+
: 0;
|
|
5012
|
+
var totalStr = this.dataTable.getTotal().toString();
|
|
5013
|
+
if (this.dataTable.elasticChunks) {
|
|
5014
|
+
var count_1 = this.dataTable.getCachedCount();
|
|
5015
|
+
var total = this.dataTable.getTotal();
|
|
5016
|
+
if (count_1 !== total)
|
|
5017
|
+
totalStr = '?';
|
|
5018
|
+
}
|
|
5019
|
+
pageInfoDiv.innerHTML = public_api["g" /* i18n */].getText('GridPageInfo')
|
|
5020
|
+
.replace('{FirstPageRecordNum}', "<span>" + fistPageRecordNum.toString() + "</span>")
|
|
5021
|
+
.replace('{LastPageRecordNum}', "<span>" + lastPageRecordNum.toString() + "</span>")
|
|
5022
|
+
.replace('{Total}', "<span>" + totalStr + "</span>");
|
|
5023
|
+
}
|
|
4942
5024
|
return pageInfoDiv;
|
|
4943
5025
|
};
|
|
4944
5026
|
EasyGrid.prototype.showProgress = function () {
|
|
@@ -4993,13 +5075,13 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
4993
5075
|
if (this.options.showActiveRow && index == this.activeRowIndex) {
|
|
4994
5076
|
rowBuilder.addClass(this.cssPrefix + "-row-active");
|
|
4995
5077
|
}
|
|
4996
|
-
this.columns.getItems().forEach(function (column) {
|
|
5078
|
+
this.columns.getItems().forEach(function (column, index) {
|
|
4997
5079
|
if (!column.isVisible) {
|
|
4998
5080
|
return;
|
|
4999
5081
|
}
|
|
5000
5082
|
var colindex = column.isRowNum ? -1 : _this.dataTable.columns.getIndex(column.dataColumn.id);
|
|
5001
5083
|
var val = column.isRowNum ? indexGlobal + 1 : row.getValue(colindex);
|
|
5002
|
-
rowElement.appendChild(_this.renderCell(column,
|
|
5084
|
+
rowElement.appendChild(_this.renderCell(column, index, val, rowElement));
|
|
5003
5085
|
});
|
|
5004
5086
|
return rowElement;
|
|
5005
5087
|
};
|
|
@@ -5033,7 +5115,8 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
5033
5115
|
var _this = this;
|
|
5034
5116
|
var paginateDiv = document.createElement('div');
|
|
5035
5117
|
paginateDiv.className = this.cssPrefix + "-pagination-wrapper";
|
|
5036
|
-
|
|
5118
|
+
var rowCount = this.dataTable.getTotal();
|
|
5119
|
+
if (this.options.paging && this.options.paging.enabled && rowCount > 0) {
|
|
5037
5120
|
var prefix_1 = this.paginationOptions.useBootstrap ? '' : this.cssPrefix + "-";
|
|
5038
5121
|
var buttonClickHandler_1 = function (ev) {
|
|
5039
5122
|
var element = ev.target;
|
|
@@ -5159,18 +5242,18 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
5159
5242
|
EasyGrid.prototype.removeEventListener = function (eventType, handlerId) {
|
|
5160
5243
|
this.eventEmitter.unsubscribe(eventType, handlerId);
|
|
5161
5244
|
};
|
|
5162
|
-
EasyGrid.prototype.
|
|
5245
|
+
EasyGrid.prototype.renderHeaderButtons = function () {
|
|
5163
5246
|
var _this = this;
|
|
5164
|
-
if (this.options.
|
|
5247
|
+
if (this.options.showPlusButton) {
|
|
5165
5248
|
return domel('div')
|
|
5166
|
-
.addClass(this.cssPrefix + "-
|
|
5167
|
-
.title(this.options.
|
|
5249
|
+
.addClass(this.cssPrefix + "-header-btn-plus")
|
|
5250
|
+
.title(this.options.plusButtonTitle || 'Add')
|
|
5168
5251
|
.addChild('a', function (builder) { return builder
|
|
5169
5252
|
.attr('href', 'javascript:void(0)')
|
|
5170
5253
|
.on('click', function (e) {
|
|
5171
5254
|
e.preventDefault();
|
|
5172
5255
|
_this.fireEvent({
|
|
5173
|
-
type: '
|
|
5256
|
+
type: 'plusButtonClick',
|
|
5174
5257
|
sourceEvent: e
|
|
5175
5258
|
});
|
|
5176
5259
|
}); })
|
|
@@ -5271,6 +5354,97 @@ var easy_grid_EasyGrid = /** @class */ (function () {
|
|
|
5271
5354
|
EasyGrid.prototype.focus = function () {
|
|
5272
5355
|
this.bodyViewportDiv.focus();
|
|
5273
5356
|
};
|
|
5357
|
+
EasyGrid.prototype.resizeColumns = function () {
|
|
5358
|
+
if (this.options.columnWidths.autoResize === AutoResizeColumns.Never)
|
|
5359
|
+
return;
|
|
5360
|
+
var containerWidth = this.bodyCellContainerDiv.style.width;
|
|
5361
|
+
this.bodyCellContainerDiv.style.visibility = 'hidden';
|
|
5362
|
+
this.bodyCellContainerDiv.style.width = '1px';
|
|
5363
|
+
//this.headerRowDiv.style.visibility = 'hidden';
|
|
5364
|
+
this.headerRowDiv.style.width = '1px';
|
|
5365
|
+
var sumWidth = 0;
|
|
5366
|
+
var columns = this.columns.getItems();
|
|
5367
|
+
var headerCells = this.headerCellContainerDiv.querySelectorAll("." + this.cssPrefix + "-header-cell");
|
|
5368
|
+
var headerIdx = 0;
|
|
5369
|
+
var _loop_1 = function (idx) {
|
|
5370
|
+
var column = columns[idx];
|
|
5371
|
+
if (!column.isVisible)
|
|
5372
|
+
return "continue";
|
|
5373
|
+
var calculatedWidth = this_1.options.columnWidths.autoResize !== AutoResizeColumns.Always && column.dataColumn
|
|
5374
|
+
? column.dataColumn.calculatedWidth
|
|
5375
|
+
: 0;
|
|
5376
|
+
var cellValues = this_1.bodyCellContainerDiv.querySelectorAll("." + this_1.cssPrefix + "-cell[data-col-idx=\"" + idx + "\"] > ." + this_1.cssPrefix + "-cell-value");
|
|
5377
|
+
var maxWidth = 0;
|
|
5378
|
+
if (calculatedWidth > 0) {
|
|
5379
|
+
sumWidth += calculatedWidth;
|
|
5380
|
+
column.width = calculatedWidth;
|
|
5381
|
+
cellValues.forEach(function (value) {
|
|
5382
|
+
value.parentElement.style.width = calculatedWidth + "px";
|
|
5383
|
+
});
|
|
5384
|
+
headerCells[headerIdx].style.width = calculatedWidth + "px";
|
|
5385
|
+
}
|
|
5386
|
+
else {
|
|
5387
|
+
if (cellValues.length == 0) {
|
|
5388
|
+
headerCells[headerIdx].style.width = null;
|
|
5389
|
+
headerCells[headerIdx].style.whiteSpace = 'nowrap';
|
|
5390
|
+
}
|
|
5391
|
+
maxWidth = headerCells[headerIdx].offsetWidth;
|
|
5392
|
+
if (cellValues.length > 0) {
|
|
5393
|
+
cellValues.forEach(function (value) {
|
|
5394
|
+
value.parentElement.style.width = null;
|
|
5395
|
+
var width = value.parentElement.offsetWidth;
|
|
5396
|
+
if (width > maxWidth) {
|
|
5397
|
+
maxWidth = width;
|
|
5398
|
+
}
|
|
5399
|
+
});
|
|
5400
|
+
maxWidth += 3;
|
|
5401
|
+
var maxOption = column.isRowNum
|
|
5402
|
+
? this_1.options.columnWidths.rowNumColumn.max || 500
|
|
5403
|
+
: this_1.options.columnWidths[column.dataColumn.type].max || 2000;
|
|
5404
|
+
var minOption = column.isRowNum
|
|
5405
|
+
? this_1.options.columnWidths.rowNumColumn.min || 0
|
|
5406
|
+
: this_1.options.columnWidths[column.dataColumn.type].min || 20;
|
|
5407
|
+
if (maxWidth > maxOption) {
|
|
5408
|
+
maxWidth = maxOption;
|
|
5409
|
+
}
|
|
5410
|
+
if (maxWidth < minOption) {
|
|
5411
|
+
maxWidth = minOption;
|
|
5412
|
+
}
|
|
5413
|
+
if (public_api["i" /* utils */].isNumericType(column.type)) {
|
|
5414
|
+
//increase the calculated width in 1.3 times for numeric columns
|
|
5415
|
+
maxWidth = Math.round(maxWidth * 1.3);
|
|
5416
|
+
}
|
|
5417
|
+
sumWidth += maxWidth;
|
|
5418
|
+
column.width = maxWidth;
|
|
5419
|
+
cellValues.forEach(function (value) {
|
|
5420
|
+
value.parentElement.style.width = maxWidth + "px";
|
|
5421
|
+
});
|
|
5422
|
+
headerCells[headerIdx].style.width = maxWidth + "px";
|
|
5423
|
+
if (column.dataColumn) {
|
|
5424
|
+
column.dataColumn.calculatedWidth = maxWidth;
|
|
5425
|
+
}
|
|
5426
|
+
}
|
|
5427
|
+
else {
|
|
5428
|
+
sumWidth += maxWidth;
|
|
5429
|
+
}
|
|
5430
|
+
}
|
|
5431
|
+
headerIdx++;
|
|
5432
|
+
};
|
|
5433
|
+
var this_1 = this;
|
|
5434
|
+
for (var idx = 0; idx < this.columns.count; idx++) {
|
|
5435
|
+
_loop_1(idx);
|
|
5436
|
+
}
|
|
5437
|
+
if (sumWidth > 0) {
|
|
5438
|
+
this.bodyCellContainerDiv.style.width = sumWidth + "px";
|
|
5439
|
+
this.headerCellContainerDiv.style.width = sumWidth + "px";
|
|
5440
|
+
}
|
|
5441
|
+
else {
|
|
5442
|
+
this.bodyCellContainerDiv.style.width = containerWidth;
|
|
5443
|
+
this.headerCellContainerDiv.style.width = containerWidth;
|
|
5444
|
+
}
|
|
5445
|
+
this.bodyCellContainerDiv.style.visibility = null;
|
|
5446
|
+
this.headerRowDiv.removeAttribute('style');
|
|
5447
|
+
};
|
|
5274
5448
|
return EasyGrid;
|
|
5275
5449
|
}());
|
|
5276
5450
|
|
|
@@ -6457,6 +6631,7 @@ addEasyDataUITexts();
|
|
|
6457
6631
|
|
|
6458
6632
|
|
|
6459
6633
|
|
|
6634
|
+
|
|
6460
6635
|
//datetimepicker
|
|
6461
6636
|
|
|
6462
6637
|
|
|
@@ -6773,7 +6948,7 @@ var public_api = __webpack_require__(0);
|
|
|
6773
6948
|
// EXTERNAL MODULE: external "easyqueryCore"
|
|
6774
6949
|
var external_easyqueryCore_ = __webpack_require__(2);
|
|
6775
6950
|
|
|
6776
|
-
// EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/ui/dist/lib/public_api.js +
|
|
6951
|
+
// EXTERNAL MODULE: c:/azuredevops-agents/korzhdev/_work/1/s/easydata/easydata.js/packs/ui/dist/lib/public_api.js + 17 modules
|
|
6777
6952
|
var lib_public_api = __webpack_require__(1);
|
|
6778
6953
|
|
|
6779
6954
|
// EXTERNAL MODULE: ./src/utils/utils.ts
|
|
@@ -8730,6 +8905,13 @@ var DisplayFormatParser = /** @class */ (function () {
|
|
|
8730
8905
|
|
|
8731
8906
|
|
|
8732
8907
|
// CONCATENATED MODULE: ./src/widgets/renderers/columnspanel/column_renderer_cp.ts
|
|
8908
|
+
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
|
|
8909
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
8910
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
8911
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
8912
|
+
r[k] = a[j];
|
|
8913
|
+
return r;
|
|
8914
|
+
};
|
|
8733
8915
|
|
|
8734
8916
|
|
|
8735
8917
|
|
|
@@ -9128,7 +9310,7 @@ var column_renderer_cp_ColumnRendererCP = /** @class */ (function () {
|
|
|
9128
9310
|
};
|
|
9129
9311
|
ColumnRendererCP.prototype.renderColumnTypeButton = function () {
|
|
9130
9312
|
var _this = this;
|
|
9131
|
-
return (this.isEditable() && this.panel.options.allowAggrColumns !== false
|
|
9313
|
+
return (this.isEditable() && this.panel.options.allowAggrColumns !== false)
|
|
9132
9314
|
? Object(lib_public_api["i" /* domel */])('div')
|
|
9133
9315
|
.addClass(utils["b" /* eqCssPrefix */] + "-button-placeholder", this.cssPrefix + "-button-placeholder", this.cssPrefix + "-typebutton-placeholder", this.cssPrefix + "-button-active")
|
|
9134
9316
|
.data("btnplaceholder", "")
|
|
@@ -9470,7 +9652,7 @@ var column_renderer_cp_ColumnRendererCP = /** @class */ (function () {
|
|
|
9470
9652
|
text: ' ',
|
|
9471
9653
|
items: common
|
|
9472
9654
|
});
|
|
9473
|
-
var sortItems = this.panel.options.allowSorting ? this.panel.getSortMenuList()
|
|
9655
|
+
var sortItems = this.panel.options.allowSorting ? __spreadArrays(this.panel.getSortMenuList(), this.panel.getMoveMenuList()) :
|
|
9474
9656
|
this.panel.getMoveMenuList();
|
|
9475
9657
|
items.push({
|
|
9476
9658
|
id: '__group',
|
|
@@ -9479,7 +9661,7 @@ var column_renderer_cp_ColumnRendererCP = /** @class */ (function () {
|
|
|
9479
9661
|
});
|
|
9480
9662
|
var extra = this.getExtraButtonMenuItems();
|
|
9481
9663
|
if (extra && Array.isArray(extra)) {
|
|
9482
|
-
items = items
|
|
9664
|
+
items = __spreadArrays(items, extra);
|
|
9483
9665
|
}
|
|
9484
9666
|
var formatItems = this.getFormatsMenuItems();
|
|
9485
9667
|
if (formatItems.length > 1) {
|
|
@@ -10493,11 +10675,12 @@ var columns_panel_ColumnsPanel = /** @class */ (function (_super) {
|
|
|
10493
10675
|
this.columnsBlock.appendChild(this.renderColumn(column));
|
|
10494
10676
|
}
|
|
10495
10677
|
}
|
|
10496
|
-
catch (
|
|
10678
|
+
catch (err) {
|
|
10679
|
+
var error = err;
|
|
10497
10680
|
this.context.throwError({
|
|
10498
10681
|
action: "ColumnsPanel rendering",
|
|
10499
|
-
text:
|
|
10500
|
-
sourceError:
|
|
10682
|
+
text: error.message,
|
|
10683
|
+
sourceError: error
|
|
10501
10684
|
});
|
|
10502
10685
|
}
|
|
10503
10686
|
};
|
|
@@ -11148,7 +11331,6 @@ var column_renderer_cb_ColumnRendererCB = /** @class */ (function () {
|
|
|
11148
11331
|
.toDOM();
|
|
11149
11332
|
};
|
|
11150
11333
|
ColumnRendererCB.prototype.getDefaultCaption = function () {
|
|
11151
|
-
console.log('Calling getDefaultCaption() BASE');
|
|
11152
11334
|
return this.getDefaultTitleText(this.baseAttr);
|
|
11153
11335
|
};
|
|
11154
11336
|
ColumnRendererCB.prototype.getDefaultTitleText = function (attr) {
|
|
@@ -11218,8 +11400,7 @@ var column_renderer_cb_ColumnRendererCB = /** @class */ (function () {
|
|
|
11218
11400
|
};
|
|
11219
11401
|
ColumnRendererCB.prototype.renderColumnTypeButton = function () {
|
|
11220
11402
|
var _this = this;
|
|
11221
|
-
if (!this.isEditable() || this.bar.options.allowAggrColumns === false
|
|
11222
|
-
|| this.column.getQuery().enableAggregation) {
|
|
11403
|
+
if (!this.isEditable() || this.bar.options.allowAggrColumns === false) {
|
|
11223
11404
|
return null;
|
|
11224
11405
|
}
|
|
11225
11406
|
return Object(lib_public_api["i" /* domel */])('div')
|
|
@@ -11506,7 +11687,6 @@ var aggrfunc_column_renderer_AggrFuncColumnRendererCB = /** @class */ (function
|
|
|
11506
11687
|
.getAttributeByIdSafe(this.column.expr.args[0].value);
|
|
11507
11688
|
};
|
|
11508
11689
|
AggrFuncColumnRendererCB.prototype.getDefaultCaption = function () {
|
|
11509
|
-
console.log('Calling getDefaultCaption() AGGR');
|
|
11510
11690
|
return this.getDefaultTitleText(this.baseAttr) + ' '
|
|
11511
11691
|
+ this.bar.getContext().getModel().getAggrFunctionCaption(this.column.expr.func);
|
|
11512
11692
|
};
|
|
@@ -15280,11 +15460,12 @@ var query_panel_QueryPanel = /** @class */ (function (_super) {
|
|
|
15280
15460
|
addrowRenderer.render();
|
|
15281
15461
|
}
|
|
15282
15462
|
}
|
|
15283
|
-
catch (
|
|
15463
|
+
catch (err) {
|
|
15464
|
+
var error = err;
|
|
15284
15465
|
this.context.throwError({
|
|
15285
15466
|
action: "QueryPanel rendering",
|
|
15286
|
-
text:
|
|
15287
|
-
sourceError:
|
|
15467
|
+
text: error.message,
|
|
15468
|
+
sourceError: error
|
|
15288
15469
|
});
|
|
15289
15470
|
}
|
|
15290
15471
|
};
|
|
@@ -16225,9 +16406,9 @@ var easy_grid_widget_EasyGridWidget = /** @class */ (function (_super) {
|
|
|
16225
16406
|
EasyGridWidget.prototype.init = function (context, options) {
|
|
16226
16407
|
var _this = this;
|
|
16227
16408
|
_super.prototype.init.call(this, context, options);
|
|
16228
|
-
var gridOptions = __assign({}, options, { slot: this.slot, dataTable: context.resultTable });
|
|
16409
|
+
var gridOptions = __assign(__assign({}, options), { slot: this.slot, dataTable: context.resultTable });
|
|
16229
16410
|
this.options = public_api["i" /* utils */].assign(this.options, options);
|
|
16230
|
-
gridOptions.
|
|
16411
|
+
gridOptions.onPlusButtonClick = function (ev) { return _this.addColumnClickHandler(ev); };
|
|
16231
16412
|
gridOptions.onColumnMoved = function (ev) { return _this.columnMovedHandler(ev); };
|
|
16232
16413
|
if (gridOptions.aggregates) {
|
|
16233
16414
|
this.hasCustomTotalsSettings = true;
|
|
@@ -16753,10 +16934,11 @@ var export_dialog_ExportDialog = /** @class */ (function () {
|
|
|
16753
16934
|
|
|
16754
16935
|
// CONCATENATED MODULE: ./src/facets/result_facet.ts
|
|
16755
16936
|
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16937
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16756
16938
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16757
16939
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16758
16940
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16759
|
-
function step(result) { result.done ? resolve(result.value) :
|
|
16941
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16760
16942
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
16761
16943
|
});
|
|
16762
16944
|
};
|
|
@@ -16802,7 +16984,7 @@ var result_facet_ResultFacet = /** @class */ (function () {
|
|
|
16802
16984
|
this.downloadAllClickHandler = function () {
|
|
16803
16985
|
var resultTable = _this.getContext().resultTable;
|
|
16804
16986
|
if (!resultTable.elasticChunks) {
|
|
16805
|
-
var
|
|
16987
|
+
var nextChunkStart_1 = resultTable.getCachedRows().length;
|
|
16806
16988
|
var recordsToLoad_1 = resultTable.getTotal() - resultTable.getCachedCount();
|
|
16807
16989
|
var ds = _this.getDialogService();
|
|
16808
16990
|
var dlg_1 = ds.openProgress({
|
|
@@ -16814,27 +16996,21 @@ var result_facet_ResultFacet = /** @class */ (function () {
|
|
|
16814
16996
|
determinated: true
|
|
16815
16997
|
});
|
|
16816
16998
|
var loadedRecords_1 = 0;
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
}, 10);
|
|
16833
|
-
};
|
|
16834
|
-
for (var _i = 0, chunksToLoad_1 = chunksToLoad; _i < chunksToLoad_1.length; _i++) {
|
|
16835
|
-
var chunk = chunksToLoad_1[_i];
|
|
16836
|
-
_loop_1(chunk);
|
|
16837
|
-
}
|
|
16999
|
+
setTimeout(function () {
|
|
17000
|
+
resultTable.getRows({ offset: nextChunkStart_1, limit: recordsToLoad_1 })
|
|
17001
|
+
.then(function (_) {
|
|
17002
|
+
loadedRecords_1 += _.length;
|
|
17003
|
+
var progress = loadedRecords_1 / recordsToLoad_1;
|
|
17004
|
+
dlg_1.updateContent(public_api["g" /* i18n */].getText('Facets', 'LoadDataDlgContent')
|
|
17005
|
+
.replace('{loadedRecs}', "" + loadedRecords_1)
|
|
17006
|
+
.replace('{totalRecs}', "" + recordsToLoad_1));
|
|
17007
|
+
dlg_1.updateProgress(progress);
|
|
17008
|
+
})
|
|
17009
|
+
.catch(function (error) {
|
|
17010
|
+
dlg_1.submit();
|
|
17011
|
+
_this.getContext().throwError(error);
|
|
17012
|
+
});
|
|
17013
|
+
}, 10);
|
|
16838
17014
|
}
|
|
16839
17015
|
else {
|
|
16840
17016
|
var ds = _this.getDialogService();
|
|
@@ -16935,6 +17111,11 @@ var result_facet_ResultFacet = /** @class */ (function () {
|
|
|
16935
17111
|
var resultTable = context.resultTable;
|
|
16936
17112
|
return (resultTable.getCachedCount() == resultTable.getTotal());
|
|
16937
17113
|
};
|
|
17114
|
+
ResultFacet.prototype.showErrorMessage = function (message) {
|
|
17115
|
+
this.displayMessageDiv.innerHTML = message;
|
|
17116
|
+
this.displayMessageDiv.classList.add(this.cssPrefix + "-error-message");
|
|
17117
|
+
Object(lib_public_api["i" /* domel */])(this.displayMessageDiv).show();
|
|
17118
|
+
};
|
|
16938
17119
|
ResultFacet.prototype.showUnableDisplayMessage = function (message) {
|
|
16939
17120
|
var context = this.getContext();
|
|
16940
17121
|
var resultTable = context.resultTable;
|
|
@@ -16978,14 +17159,13 @@ var result_facet_ResultFacet = /** @class */ (function () {
|
|
|
16978
17159
|
};
|
|
16979
17160
|
ResultFacet.prototype.loadElasticChunk = function () {
|
|
16980
17161
|
return __awaiter(this, void 0, void 0, function () {
|
|
16981
|
-
var resultTable,
|
|
17162
|
+
var resultTable, nextChunkStart;
|
|
16982
17163
|
var _this = this;
|
|
16983
17164
|
return __generator(this, function (_a) {
|
|
16984
17165
|
resultTable = this.getContext().resultTable;
|
|
16985
|
-
|
|
16986
|
-
lastChunk = chunks[chunks.length - 1];
|
|
17166
|
+
nextChunkStart = resultTable.getCachedRows().length;
|
|
16987
17167
|
//next chunk
|
|
16988
|
-
return [2 /*return*/, resultTable.getRows({ offset:
|
|
17168
|
+
return [2 /*return*/, resultTable.getRows({ offset: nextChunkStart, limit: resultTable.chunkSize })
|
|
16989
17169
|
.then(function (_) {
|
|
16990
17170
|
return resultTable.totalIsKnown()
|
|
16991
17171
|
? Promise.resolve()
|
|
@@ -16994,33 +17174,6 @@ var result_facet_ResultFacet = /** @class */ (function () {
|
|
|
16994
17174
|
});
|
|
16995
17175
|
});
|
|
16996
17176
|
};
|
|
16997
|
-
ResultFacet.prototype.getChunksForLoading = function () {
|
|
16998
|
-
var resultTable = this.getContext().resultTable;
|
|
16999
|
-
var chunkSize = resultTable.chunkSize;
|
|
17000
|
-
var cachedChunks = resultTable.getCachedChunks();
|
|
17001
|
-
var chunksToLoad = [];
|
|
17002
|
-
if (cachedChunks[0].offset != 0) {
|
|
17003
|
-
chunksToLoad.push({ offset: 0 });
|
|
17004
|
-
}
|
|
17005
|
-
for (var i = 1; i < cachedChunks.length; i++) {
|
|
17006
|
-
var diffOffset = cachedChunks[i].offset - cachedChunks[i - 1].offset - chunkSize;
|
|
17007
|
-
if (diffOffset >= chunkSize) {
|
|
17008
|
-
var numbOfChunks = diffOffset / chunkSize;
|
|
17009
|
-
for (var j = 1; j <= numbOfChunks; j++) {
|
|
17010
|
-
chunksToLoad.push({ offset: cachedChunks[i - 1].offset + j * chunkSize });
|
|
17011
|
-
}
|
|
17012
|
-
}
|
|
17013
|
-
}
|
|
17014
|
-
var lastChunk = cachedChunks[cachedChunks.length - 1];
|
|
17015
|
-
var diff = resultTable.getTotal() - lastChunk.offset;
|
|
17016
|
-
if (diff >= chunkSize) {
|
|
17017
|
-
var numbOfChunks = diff / chunkSize;
|
|
17018
|
-
for (var j = 1; j <= numbOfChunks; j++) {
|
|
17019
|
-
chunksToLoad.push({ offset: lastChunk.offset + j * chunkSize });
|
|
17020
|
-
}
|
|
17021
|
-
}
|
|
17022
|
-
return chunksToLoad;
|
|
17023
|
-
};
|
|
17024
17177
|
ResultFacet.prototype.onResize = function () {
|
|
17025
17178
|
};
|
|
17026
17179
|
return ResultFacet;
|
|
@@ -18054,21 +18207,25 @@ var pivot_table_facet_PivotTableFacet = /** @class */ (function (_super) {
|
|
|
18054
18207
|
PivotTableFacet.prototype.init = function (slot) {
|
|
18055
18208
|
var _this = this;
|
|
18056
18209
|
_super.prototype.init.call(this, slot);
|
|
18210
|
+
this.options.maxRowCount = this.options.maxRowCount || 500;
|
|
18211
|
+
this.options.viewportRowsCount = this.options.viewportRowsCount || 50;
|
|
18057
18212
|
this.grid = new lib_public_api["e" /* EasyGrid */]({
|
|
18058
18213
|
slot: this.contentDiv,
|
|
18059
18214
|
dataTable: this.pivotTable,
|
|
18060
18215
|
paging: {
|
|
18061
|
-
enabled: false
|
|
18216
|
+
enabled: false,
|
|
18217
|
+
pageSize: this.options.maxRowCount
|
|
18062
18218
|
},
|
|
18219
|
+
viewportRowsCount: this.options.viewportRowsCount,
|
|
18063
18220
|
useRowNumeration: false,
|
|
18064
|
-
|
|
18221
|
+
showPlusButton: false,
|
|
18065
18222
|
allowDragDrop: false,
|
|
18066
18223
|
onGetCellRenderer: function (column, defaultRenderer) {
|
|
18067
18224
|
if (column.dataColumn) {
|
|
18068
18225
|
if (column.dataColumn.id == "total") {
|
|
18069
18226
|
return function (value, column, cell, rowEl) {
|
|
18070
18227
|
defaultRenderer(value, column, cell, rowEl);
|
|
18071
|
-
cell.
|
|
18228
|
+
cell.classList.add('pivot-cell-total');
|
|
18072
18229
|
};
|
|
18073
18230
|
}
|
|
18074
18231
|
if (_this.settings.totalsRow) {
|
|
@@ -18329,6 +18486,18 @@ var pivot_table_facet_PivotTableFacet = /** @class */ (function (_super) {
|
|
|
18329
18486
|
PivotTableFacet.prototype.refreshCore = function () {
|
|
18330
18487
|
this.updatePivotData();
|
|
18331
18488
|
if (this.grid) {
|
|
18489
|
+
var dataSize = this.pivotTable.getTotal();
|
|
18490
|
+
var maxRow = this.grid.options.paging.pageSize;
|
|
18491
|
+
if (dataSize > maxRow) {
|
|
18492
|
+
this.contentDiv.classList.remove('pivot-grid-with-totals');
|
|
18493
|
+
this.showErrorMessage(public_api["g" /* i18n */].getText('Facets', 'ErrTooMuchData'));
|
|
18494
|
+
}
|
|
18495
|
+
if (this.options.viewportRowsCount > dataSize) {
|
|
18496
|
+
this.grid.options.viewportRowsCount = dataSize;
|
|
18497
|
+
}
|
|
18498
|
+
else {
|
|
18499
|
+
this.grid.options.viewportRowsCount = this.options.viewportRowsCount;
|
|
18500
|
+
}
|
|
18332
18501
|
this.grid.refresh();
|
|
18333
18502
|
}
|
|
18334
18503
|
};
|
|
@@ -18503,10 +18672,10 @@ var pivot_table_facet_PivotTableFacet = /** @class */ (function (_super) {
|
|
|
18503
18672
|
total_row.push(totalByCol);
|
|
18504
18673
|
}
|
|
18505
18674
|
this.pivotTable.addRow(total_row);
|
|
18506
|
-
this.contentDiv.classList.add('pivot-grid-totals
|
|
18675
|
+
this.contentDiv.classList.add('pivot-grid-with-totals');
|
|
18507
18676
|
}
|
|
18508
18677
|
else {
|
|
18509
|
-
this.contentDiv.classList.remove('pivot-grid-totals
|
|
18678
|
+
this.contentDiv.classList.remove('pivot-grid-with-totals');
|
|
18510
18679
|
}
|
|
18511
18680
|
};
|
|
18512
18681
|
PivotTableFacet.prototype.calcAggrFunc = function (func, options) {
|
|
@@ -18881,6 +19050,9 @@ var result_facets_panel_ResultFacetsPanel = /** @class */ (function (_super) {
|
|
|
18881
19050
|
ResultFacetsPanel.prototype.attachQueryObserver = function () {
|
|
18882
19051
|
var _this = this;
|
|
18883
19052
|
var query = this.getQuery();
|
|
19053
|
+
if (this.queryEventCallbackId) {
|
|
19054
|
+
query.removeChangedCallback(this.queryEventCallbackId);
|
|
19055
|
+
}
|
|
18884
19056
|
this.queryEventCallbackId = query.addChangedCallback(function (event) {
|
|
18885
19057
|
//if something has changed, and that change is related to columns
|
|
18886
19058
|
var edata = event.data;
|
|
@@ -19504,10 +19676,10 @@ var aggr_settings_renderer_AggrSettingsRenderer = /** @class */ (function () {
|
|
|
19504
19676
|
b.on('change', _this.countsCheckboxChangeHandler.bind(_this));
|
|
19505
19677
|
})
|
|
19506
19678
|
.addChild('span', function (b) { return b
|
|
19507
|
-
.addClass('slider round'); })
|
|
19679
|
+
.addClass('slider round'); })
|
|
19508
19680
|
.addChild('span', function (b) { return b
|
|
19509
19681
|
.addClass('switch-text')
|
|
19510
|
-
.addText(external_easyqueryCore_["i18n"].getText('AggrSettings', 'GroupCountsLabel')); }); })
|
|
19682
|
+
.addText(external_easyqueryCore_["i18n"].getText('AggrSettings', 'GroupCountsLabel')); }); }); })
|
|
19511
19683
|
.addChild('div', function (b) { return b
|
|
19512
19684
|
.addClass(_this.cssPrefix + "-grandtotals")
|
|
19513
19685
|
.addChild('label', function (b) { return b
|
|
@@ -19520,10 +19692,10 @@ var aggr_settings_renderer_AggrSettingsRenderer = /** @class */ (function () {
|
|
|
19520
19692
|
b.on('change', _this.grandCheckboxChangeHandler.bind(_this));
|
|
19521
19693
|
})
|
|
19522
19694
|
.addChild('span', function (b) { return b
|
|
19523
|
-
.addClass('slider round'); })
|
|
19695
|
+
.addClass('slider round'); })
|
|
19524
19696
|
.addChild('span', function (b) { return b
|
|
19525
19697
|
.addClass('switch-text')
|
|
19526
|
-
.addText(external_easyqueryCore_["i18n"].getText('AggrSettings', 'GrandTotalsLabel')); }); });
|
|
19698
|
+
.addText(external_easyqueryCore_["i18n"].getText('AggrSettings', 'GrandTotalsLabel')); }); }); });
|
|
19527
19699
|
var groups = this.slot.querySelectorAll("." + this.cssPrefix + "-group");
|
|
19528
19700
|
groups.forEach(function (el) {
|
|
19529
19701
|
Object(lib_public_api["i" /* domel */])(el)
|
|
@@ -19872,10 +20044,10 @@ var aggr_settings_dialog_AggrSettingsDialog = /** @class */ (function () {
|
|
|
19872
20044
|
b.on('change', _this.enableAggrCheckBoxChangeHandler.bind(_this));
|
|
19873
20045
|
})
|
|
19874
20046
|
.addChild('span', function (b) { return b
|
|
19875
|
-
.addClass('slider round'); })
|
|
20047
|
+
.addClass('slider round'); })
|
|
19876
20048
|
.addChild('span', function (b) { return b
|
|
19877
20049
|
.addClass('switch-text')
|
|
19878
|
-
.addText(external_easyqueryCore_["i18n"].getText('AggrSettings', 'EnableAggrLabel')); }); })
|
|
20050
|
+
.addText(external_easyqueryCore_["i18n"].getText('AggrSettings', 'EnableAggrLabel')); }); }); })
|
|
19879
20051
|
.addChild('div', function (b) { return b
|
|
19880
20052
|
.id('AggrSettingsComponent'); });
|
|
19881
20053
|
return b.toDOM();
|
|
@@ -20510,6 +20682,10 @@ var view_View = /** @class */ (function () {
|
|
|
20510
20682
|
View.prototype.fetchData = function (options) {
|
|
20511
20683
|
var _this = this;
|
|
20512
20684
|
options = options || { refresh: true };
|
|
20685
|
+
this.context.clearResult();
|
|
20686
|
+
//don't run fetch if the query is empty
|
|
20687
|
+
if (this.context.getQuery().isEmpty() && !this.resultOptions.fetchEmptyQueries)
|
|
20688
|
+
return;
|
|
20513
20689
|
this.showResultSpinner();
|
|
20514
20690
|
this.context.fetchData({
|
|
20515
20691
|
elasticPaging: options.elasticPaging,
|
|
@@ -21519,7 +21695,9 @@ var data_filter_view_extends = (undefined && undefined.__extends) || (function (
|
|
|
21519
21695
|
var data_filter_view_DataFilterView = /** @class */ (function (_super) {
|
|
21520
21696
|
data_filter_view_extends(DataFilterView, _super);
|
|
21521
21697
|
function DataFilterView() {
|
|
21522
|
-
|
|
21698
|
+
var _this = _super.call(this) || this;
|
|
21699
|
+
_this.resultOptions.fetchEmptyQueries = true;
|
|
21700
|
+
return _this;
|
|
21523
21701
|
}
|
|
21524
21702
|
DataFilterView.prototype.initOptions = function (options) {
|
|
21525
21703
|
var _this = this;
|
|
@@ -21597,7 +21775,9 @@ var html_data_filter_view_extends = (undefined && undefined.__extends) || (funct
|
|
|
21597
21775
|
var html_data_filter_view_HtmlDataFilterView = /** @class */ (function (_super) {
|
|
21598
21776
|
html_data_filter_view_extends(HtmlDataFilterView, _super);
|
|
21599
21777
|
function HtmlDataFilterView() {
|
|
21600
|
-
|
|
21778
|
+
var _this = _super.call(this) || this;
|
|
21779
|
+
_this.resultOptions.fetchEmptyQueries = true;
|
|
21780
|
+
return _this;
|
|
21601
21781
|
}
|
|
21602
21782
|
/**
|
|
21603
21783
|
* Creates the widget that represents Grid Widget.
|
|
@@ -21667,7 +21847,7 @@ var report_view_ReportView = /** @class */ (function (_super) {
|
|
|
21667
21847
|
_this.loadReportButtonClickHandler = _this.loadReportButtonClick.bind(_this);
|
|
21668
21848
|
_this.saveReportButtonClickHandler = _this.saveReportButtonClick.bind(_this);
|
|
21669
21849
|
_this.removeReportButtonClickHandler = _this.removeReportButtonClick.bind(_this);
|
|
21670
|
-
_this.
|
|
21850
|
+
_this.reloadReportDataButtonClickHandler = _this.reloadReportDataButtonClick.bind(_this);
|
|
21671
21851
|
browser_utils["a" /* browserUtils */].onMobileModeChanged(function (_) {
|
|
21672
21852
|
document.location.reload();
|
|
21673
21853
|
});
|
|
@@ -21754,7 +21934,7 @@ var report_view_ReportView = /** @class */ (function (_super) {
|
|
|
21754
21934
|
var loadReportButton = "LoadReportButton";
|
|
21755
21935
|
var saveReportButton = "SaveReportButton";
|
|
21756
21936
|
var removeReportButton = "RemoveReportButton";
|
|
21757
|
-
var
|
|
21937
|
+
var reloadReportDataButton = "ReloadReportDataButton";
|
|
21758
21938
|
var resultCountSpan = "ResultCount";
|
|
21759
21939
|
var exportButtons = "ResultExportButtons";
|
|
21760
21940
|
var exportClass = this.exportClass;
|
|
@@ -21766,7 +21946,7 @@ var report_view_ReportView = /** @class */ (function (_super) {
|
|
|
21766
21946
|
loadReportButton = options.slots.loadReportButton || loadReportButton;
|
|
21767
21947
|
saveReportButton = options.slots.saveReportButton || saveReportButton;
|
|
21768
21948
|
removeReportButton = options.slots.removeReportButton || removeReportButton;
|
|
21769
|
-
|
|
21949
|
+
reloadReportDataButton = options.slots.reloadReportDataButton || reloadReportDataButton;
|
|
21770
21950
|
exportClass = options.slots.exportClass || exportClass;
|
|
21771
21951
|
}
|
|
21772
21952
|
this.exportButtons = this.domRoots.reduce(function (elems, root) {
|
|
@@ -21813,10 +21993,14 @@ var report_view_ReportView = /** @class */ (function (_super) {
|
|
|
21813
21993
|
this.removeReportButton.addEventListener('click', this.removeReportButtonClickHandler);
|
|
21814
21994
|
}
|
|
21815
21995
|
}
|
|
21816
|
-
if (!this.
|
|
21817
|
-
this.
|
|
21818
|
-
|
|
21819
|
-
|
|
21996
|
+
if (!this.reloadReportDataButton) {
|
|
21997
|
+
this.reloadReportDataButton = this.resolveElement(reloadReportDataButton);
|
|
21998
|
+
//OBSOLETE: remove the next 3 lines. We just support the old default button ID here
|
|
21999
|
+
if (!this.reloadReportDataButton) {
|
|
22000
|
+
this.reloadReportDataButton = this.resolveElement('UpdateReportButton');
|
|
22001
|
+
}
|
|
22002
|
+
if (this.reloadReportDataButton) {
|
|
22003
|
+
this.reloadReportDataButton.addEventListener('click', this.reloadReportDataButtonClickHandler);
|
|
21820
22004
|
}
|
|
21821
22005
|
}
|
|
21822
22006
|
this.reportListSlot = document.getElementById('ReportList');
|
|
@@ -21894,6 +22078,7 @@ var report_view_ReportView = /** @class */ (function (_super) {
|
|
|
21894
22078
|
var query = self.context.getQuery();
|
|
21895
22079
|
var reportLoaded = function () {
|
|
21896
22080
|
_this.renderReportProps();
|
|
22081
|
+
_this.context.resultTable.clear();
|
|
21897
22082
|
query.fireChangedEvent({
|
|
21898
22083
|
part: external_easyqueryCore_["QueryChangePart"].All,
|
|
21899
22084
|
noSync: true,
|
|
@@ -22120,8 +22305,8 @@ var report_view_ReportView = /** @class */ (function (_super) {
|
|
|
22120
22305
|
this.removeReportButton.removeEventListener('click', this.removeReportButtonClickHandler);
|
|
22121
22306
|
this.removeReportButton = null;
|
|
22122
22307
|
}
|
|
22123
|
-
if (this.
|
|
22124
|
-
this.
|
|
22308
|
+
if (this.reloadReportDataButton) {
|
|
22309
|
+
this.reloadReportDataButton.removeEventListener('click', this.reloadReportDataButtonClickHandler);
|
|
22125
22310
|
this.removeReportButton = null;
|
|
22126
22311
|
}
|
|
22127
22312
|
if (this.reportListSlot) {
|
|
@@ -22222,7 +22407,7 @@ var report_view_ReportView = /** @class */ (function (_super) {
|
|
|
22222
22407
|
/**
|
|
22223
22408
|
* The handler of the "Update" button click.
|
|
22224
22409
|
*/
|
|
22225
|
-
ReportView.prototype.
|
|
22410
|
+
ReportView.prototype.reloadReportDataButtonClick = function () {
|
|
22226
22411
|
this.fetchData();
|
|
22227
22412
|
};
|
|
22228
22413
|
/**
|
|
@@ -22526,6 +22711,7 @@ function addEasyQueryUITexts() {
|
|
|
22526
22711
|
TabNameLabel: 'Tab name',
|
|
22527
22712
|
ErrQueryChanged: 'FAILED TO DISPLAY. QUERY WAS CHANGED',
|
|
22528
22713
|
ErrNotEnoughData: "We can't display the graph because not all data for this query is loaded. \n The total number of records: {totalRecs}, currently loaded: {cachedRecs}. \n You can [download the result]. Please note: this may take some time and consume a lot of memory.",
|
|
22714
|
+
ErrTooMuchData: 'Too much data. The grid is not able to display it',
|
|
22529
22715
|
Chart: {
|
|
22530
22716
|
FacetTitle: 'Chart',
|
|
22531
22717
|
DlgTitle: 'Chart settings',
|