@mozaic-ds/angular 2.0.46 → 2.0.47
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.
|
@@ -5378,12 +5378,17 @@ class FilterEngine {
|
|
|
5378
5378
|
return resolveFilterType(this.state.columnDefMap().get(field));
|
|
5379
5379
|
}
|
|
5380
5380
|
/**
|
|
5381
|
-
* Builds the column descriptors consumed by the filter builder UI.
|
|
5382
|
-
*
|
|
5381
|
+
* Builds the column descriptors consumed by the filter builder UI.
|
|
5382
|
+
*
|
|
5383
|
+
* All `filterable` columns are included, even those that ship a custom
|
|
5384
|
+
* `filterTemplate`. The custom template drives the inline header filter
|
|
5385
|
+
* row (quick per-column UI), while the builder — rendered in the toolbar
|
|
5386
|
+
* drawer and in the column-menu overlay — always uses the generic editors.
|
|
5387
|
+
* The two mechanisms are complementary and can coexist on the same column.
|
|
5383
5388
|
*/
|
|
5384
5389
|
describeFilterableColumns() {
|
|
5385
5390
|
const defs = this.state.columnDefs();
|
|
5386
|
-
return defs.filter((d) => d.filterable
|
|
5391
|
+
return defs.filter((d) => d.filterable).map((d) => this.describeColumn(d));
|
|
5387
5392
|
}
|
|
5388
5393
|
describeColumn(def) {
|
|
5389
5394
|
const type = resolveFilterType(def);
|
|
@@ -8914,12 +8919,13 @@ class MozGridHeaderCellComponent {
|
|
|
8914
8919
|
onMenuItemClick(item) {
|
|
8915
8920
|
const field = this.columnState().field;
|
|
8916
8921
|
const actionId = item.id;
|
|
8917
|
-
//
|
|
8918
|
-
//
|
|
8919
|
-
//
|
|
8920
|
-
//
|
|
8921
|
-
//
|
|
8922
|
-
|
|
8922
|
+
// "Filter in this column" always opens the conditions builder overlay
|
|
8923
|
+
// anchored on the gear button, seeded on the current column. This stays
|
|
8924
|
+
// true even when the column provides a `filterTemplate`: the inline
|
|
8925
|
+
// header filter row (driven by the template) and the builder overlay
|
|
8926
|
+
// are complementary — quick filter vs. advanced conditions — and must
|
|
8927
|
+
// both be reachable from the column menu.
|
|
8928
|
+
if (actionId === 'filter-column') {
|
|
8923
8929
|
this.openFilterOverlay(field);
|
|
8924
8930
|
return;
|
|
8925
8931
|
}
|
|
@@ -11338,6 +11344,27 @@ class MozGridComponent {
|
|
|
11338
11344
|
getAllVisibleFields() {
|
|
11339
11345
|
return this.state.visibleColumns().map((c) => c.field);
|
|
11340
11346
|
}
|
|
11347
|
+
/**
|
|
11348
|
+
* Resolves a list of internal `HistoryCellChange` records into the public
|
|
11349
|
+
* `BulkCellChange[]` shape exposed on bulk events. Looks up each row's
|
|
11350
|
+
* configured id so consumers can persist changes without a second pass.
|
|
11351
|
+
*/
|
|
11352
|
+
toBulkCellChanges(changes) {
|
|
11353
|
+
if (changes.length === 0)
|
|
11354
|
+
return [];
|
|
11355
|
+
const data = this.state.sourceData();
|
|
11356
|
+
const idField = this.state.rowIdField?.() ?? 'id';
|
|
11357
|
+
return changes.map((c) => {
|
|
11358
|
+
const row = data[c.rowIndex];
|
|
11359
|
+
return {
|
|
11360
|
+
rowIndex: c.rowIndex,
|
|
11361
|
+
rowId: row ? row[idField] : undefined,
|
|
11362
|
+
field: c.field,
|
|
11363
|
+
oldValue: c.before,
|
|
11364
|
+
newValue: c.after,
|
|
11365
|
+
};
|
|
11366
|
+
});
|
|
11367
|
+
}
|
|
11341
11368
|
clearSelectionAndCloseBar() {
|
|
11342
11369
|
const mode = this.state.activeSelectionMode();
|
|
11343
11370
|
if (mode === 'rows') {
|
|
@@ -11418,6 +11445,7 @@ class MozGridComponent {
|
|
|
11418
11445
|
data: pasteRows,
|
|
11419
11446
|
rowIds: this.getRowSelectionIds(event),
|
|
11420
11447
|
fields: this.getAllVisibleFields(),
|
|
11448
|
+
changes: this.toBulkCellChanges(changes),
|
|
11421
11449
|
selectionMode: 'rows',
|
|
11422
11450
|
rowSelection: event,
|
|
11423
11451
|
});
|
|
@@ -11474,6 +11502,7 @@ class MozGridComponent {
|
|
|
11474
11502
|
data: rows,
|
|
11475
11503
|
rowIds: this.getRangeRowIds(pasteRange),
|
|
11476
11504
|
fields: this.getRangeFields(pasteRange),
|
|
11505
|
+
changes: this.toBulkCellChanges(allChanges),
|
|
11477
11506
|
});
|
|
11478
11507
|
}
|
|
11479
11508
|
catch {
|
|
@@ -11519,6 +11548,7 @@ class MozGridComponent {
|
|
|
11519
11548
|
cellCount: event.count,
|
|
11520
11549
|
rowIds: this.getRowSelectionIds(event),
|
|
11521
11550
|
fields: this.getAllVisibleFields(),
|
|
11551
|
+
changes: this.toBulkCellChanges(changes),
|
|
11522
11552
|
selectionMode: 'rows',
|
|
11523
11553
|
rowSelection: event,
|
|
11524
11554
|
});
|
|
@@ -11544,6 +11574,7 @@ class MozGridComponent {
|
|
|
11544
11574
|
cellCount: rows * colCount,
|
|
11545
11575
|
rowIds: this.getRangeRowIds(range),
|
|
11546
11576
|
fields: this.getRangeFields(range),
|
|
11577
|
+
changes: this.toBulkCellChanges(changes),
|
|
11547
11578
|
});
|
|
11548
11579
|
}
|
|
11549
11580
|
extractRangeData() {
|