@messaia/cdk 22.0.1 → 22.0.2-rc.2
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/README.md +8 -0
- package/fesm2022/messaia-cdk.mjs +140 -35
- package/fesm2022/messaia-cdk.mjs.map +1 -1
- package/package.json +1 -1
- package/types/messaia-cdk.d.ts +25 -3
package/README.md
CHANGED
|
@@ -56,6 +56,14 @@ For multiple standalone tables that share the same model and scope on one page,
|
|
|
56
56
|
use distinct `[rememberSelectionKey]` overrides. Only rows with IDs are remembered,
|
|
57
57
|
and the selection is kept in memory until it is cleared or the app is reloaded.
|
|
58
58
|
|
|
59
|
+
## Server-backed table filters
|
|
60
|
+
|
|
61
|
+
For overlapping field and static filters, the data source intersects exact values
|
|
62
|
+
and exclusions and sends the narrowed result under the original query key. If
|
|
63
|
+
there is no match, it shows an empty page without requesting unfiltered rows.
|
|
64
|
+
If a compound or pattern filter cannot be reduced to an exact filter, the table
|
|
65
|
+
logs a warning and keeps the static restriction.
|
|
66
|
+
|
|
59
67
|
## Running unit tests
|
|
60
68
|
|
|
61
69
|
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
package/fesm2022/messaia-cdk.mjs
CHANGED
|
@@ -17358,6 +17358,35 @@ function getTableDefinition(origin) {
|
|
|
17358
17358
|
return tableDefinition;
|
|
17359
17359
|
}
|
|
17360
17360
|
|
|
17361
|
+
/**
|
|
17362
|
+
* Pagination class to represent paginated data.
|
|
17363
|
+
* @template TModel - The type of items in the pagination.
|
|
17364
|
+
*/
|
|
17365
|
+
class Pagination {
|
|
17366
|
+
/**
|
|
17367
|
+
* Current page number.
|
|
17368
|
+
*/
|
|
17369
|
+
page = 1;
|
|
17370
|
+
/**
|
|
17371
|
+
* Number of items per page.
|
|
17372
|
+
*/
|
|
17373
|
+
pageSize = 10;
|
|
17374
|
+
/**
|
|
17375
|
+
* Total number of pages.
|
|
17376
|
+
*/
|
|
17377
|
+
pageCount = 0;
|
|
17378
|
+
/**
|
|
17379
|
+
* Total number of items across all pages.
|
|
17380
|
+
*/
|
|
17381
|
+
total = 0;
|
|
17382
|
+
/**
|
|
17383
|
+
* Array of items for the current page.
|
|
17384
|
+
*/
|
|
17385
|
+
items = [];
|
|
17386
|
+
}
|
|
17387
|
+
|
|
17388
|
+
/* Match longer prefixes first so != is not parsed as !. */
|
|
17389
|
+
const exclusionOperators = [FilterOperator.NotEqual, FilterOperator.NotEqualAlt, FilterOperator.Not];
|
|
17361
17390
|
/**
|
|
17362
17391
|
* @class TableDataSource
|
|
17363
17392
|
* @description Provides a server-backed data source with filtering, sorting, pagination,
|
|
@@ -17383,8 +17412,8 @@ class TableDataSource extends DataSource {
|
|
|
17383
17412
|
_reloadChange = new BehaviorSubject(0);
|
|
17384
17413
|
/**
|
|
17385
17414
|
* @property onDataLoaded
|
|
17386
|
-
* @description Emits the latest
|
|
17387
|
-
* The initial value is `null` until the first
|
|
17415
|
+
* @description Emits the latest server page or a local empty page when filters rule out every row.
|
|
17416
|
+
* The initial value is `null` until the first page is available.
|
|
17388
17417
|
* @type {BehaviorSubject<Pagination<TEntity> | any>}
|
|
17389
17418
|
*/
|
|
17390
17419
|
onDataLoaded = new BehaviorSubject(null);
|
|
@@ -17590,7 +17619,7 @@ class TableDataSource extends DataSource {
|
|
|
17590
17619
|
Utils.cleanObject(this.fieldFilters);
|
|
17591
17620
|
Utils.cleanObject(this.staticFieldFilters);
|
|
17592
17621
|
/* Compose the service request from table state and field filters. */
|
|
17593
|
-
|
|
17622
|
+
const tableParams = {
|
|
17594
17623
|
includes: this.includes,
|
|
17595
17624
|
projection: Array.isArray(this.projection) ? this.projection.join(',') : this.projection,
|
|
17596
17625
|
page: (this.paginator?.pageIndex ?? 0) + 1,
|
|
@@ -17598,7 +17627,12 @@ class TableDataSource extends DataSource {
|
|
|
17598
17627
|
search: this.filter.toLowerCase(),
|
|
17599
17628
|
sortBy: this.sort?.active,
|
|
17600
17629
|
sortOrder: this.sort?.direction
|
|
17601
|
-
}
|
|
17630
|
+
};
|
|
17631
|
+
const params = this.buildRequestParams(tableParams);
|
|
17632
|
+
/* Use the normal page update path to clear stale rows and totals without sending an empty filter to the API. */
|
|
17633
|
+
if (!params) {
|
|
17634
|
+
return of(Object.assign(new Pagination(), { pageSize: tableParams.pageSize }));
|
|
17635
|
+
}
|
|
17602
17636
|
/* Retrieve the current page from the configured service endpoint. */
|
|
17603
17637
|
return this.service.getList(Utils.cleanObject(params), this.path ?? '', { 'CheckOut': 'Yes' });
|
|
17604
17638
|
}), map$1((result) => {
|
|
@@ -17621,6 +17655,96 @@ class TableDataSource extends DataSource {
|
|
|
17621
17655
|
return of([]);
|
|
17622
17656
|
}));
|
|
17623
17657
|
}
|
|
17658
|
+
/**
|
|
17659
|
+
* Reads exact matches or exclusions without changing the values sent to the API.
|
|
17660
|
+
* @param filter A scalar or an array of values for one query key.
|
|
17661
|
+
* @returns The original values keyed by their serialized operands, or `undefined` for unsupported predicates.
|
|
17662
|
+
* @example A numeric `9` and the exclusion `'!9'` both use `'9'` as their comparison key.
|
|
17663
|
+
*/
|
|
17664
|
+
static readExactFilter(filter) {
|
|
17665
|
+
const values = new Map();
|
|
17666
|
+
let excluded;
|
|
17667
|
+
/* Iterate over each value in the filter, normalizing and validating it. */
|
|
17668
|
+
for (const value of Array.isArray(filter) ? filter : [filter]) {
|
|
17669
|
+
if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean') {
|
|
17670
|
+
return undefined;
|
|
17671
|
+
}
|
|
17672
|
+
/* Convert the value to a string for operator detection. */
|
|
17673
|
+
const text = String(value);
|
|
17674
|
+
const operator = exclusionOperators.find(prefix => text.startsWith(prefix));
|
|
17675
|
+
const key = operator ? text.slice(operator.length) : text;
|
|
17676
|
+
/* Only plain values and lists of exclusions can be reduced to a single set. */
|
|
17677
|
+
if (!key || /^[!<>=~^$]/.test(key) || /[+|]/.test(key) || (excluded !== undefined && excluded !== !!operator)) {
|
|
17678
|
+
return undefined;
|
|
17679
|
+
}
|
|
17680
|
+
/* Compute the intersection of the field and static filter values. */
|
|
17681
|
+
excluded = !!operator;
|
|
17682
|
+
values.set(key, value);
|
|
17683
|
+
}
|
|
17684
|
+
return { values, excluded: excluded ?? false };
|
|
17685
|
+
}
|
|
17686
|
+
/**
|
|
17687
|
+
* Narrows a field filter to values that also satisfy its static restriction.
|
|
17688
|
+
* @param fieldFilter The value selected in the table.
|
|
17689
|
+
* @param staticFilter The restriction configured for the list.
|
|
17690
|
+
* @returns Matching predicates, `[]` when nothing matches, or `undefined` when the intersection cannot be represented.
|
|
17691
|
+
* @example `intersectExactFilters([1, 9], ['!8', '!9'])` returns `[1]`.
|
|
17692
|
+
*/
|
|
17693
|
+
static intersectExactFilters(fieldFilter, staticFilter) {
|
|
17694
|
+
const field = TableDataSource.readExactFilter(fieldFilter);
|
|
17695
|
+
const fixed = TableDataSource.readExactFilter(staticFilter);
|
|
17696
|
+
if (!field || !fixed) {
|
|
17697
|
+
return undefined;
|
|
17698
|
+
}
|
|
17699
|
+
/* To satisfy both exclusion filters, exclude every value from either list. */
|
|
17700
|
+
if (field.excluded && fixed.excluded) {
|
|
17701
|
+
return [...new Map([...fixed.values, ...field.values]).values()];
|
|
17702
|
+
}
|
|
17703
|
+
/* Keep only allowed values that also match the other filter. */
|
|
17704
|
+
const [included, other] = field.excluded ? [fixed, field] : [field, fixed];
|
|
17705
|
+
return [...included.values].filter(([key]) => other.values.has(key) !== other.excluded).map(([, value]) => value);
|
|
17706
|
+
}
|
|
17707
|
+
/**
|
|
17708
|
+
* Merges both filter sets under their original query keys.
|
|
17709
|
+
* @param tableParams The pagination, sorting, and search parameters for the request.
|
|
17710
|
+
* @returns The merged parameters, or `null` when no row can satisfy both filters.
|
|
17711
|
+
*/
|
|
17712
|
+
buildRequestParams(tableParams) {
|
|
17713
|
+
/* Extract the field and static filters, defaulting to empty objects if undefined. */
|
|
17714
|
+
const fieldFilters = this.fieldFilters ?? {};
|
|
17715
|
+
const staticFilters = this.staticFieldFilters ?? {};
|
|
17716
|
+
const params = { ...tableParams, ...fieldFilters, ...staticFilters };
|
|
17717
|
+
for (const [key, fieldValue] of Object.entries(fieldFilters)) {
|
|
17718
|
+
/* Request options and compound filter expressions are not individual field predicates. */
|
|
17719
|
+
if (!Object.hasOwn(staticFilters, key) || Object.hasOwn(tableParams, key) || key === 'filters') {
|
|
17720
|
+
continue;
|
|
17721
|
+
}
|
|
17722
|
+
const staticValue = staticFilters[key];
|
|
17723
|
+
/* Empty arrays impose no restriction, so keep the value from the other filter. */
|
|
17724
|
+
if (fieldValue === staticValue || (Array.isArray(fieldValue) && fieldValue.length === 0)) {
|
|
17725
|
+
continue;
|
|
17726
|
+
}
|
|
17727
|
+
/* Empty static arrays impose no restriction, so keep the value from the other filter. */
|
|
17728
|
+
if (Array.isArray(staticValue) && staticValue.length === 0) {
|
|
17729
|
+
params[key] = fieldValue;
|
|
17730
|
+
continue;
|
|
17731
|
+
}
|
|
17732
|
+
/* Compute the intersection of the field and static filter values. */
|
|
17733
|
+
const intersection = TableDataSource.intersectExactFilters(fieldValue, staticValue);
|
|
17734
|
+
/* If the intersection cannot be expressed under this key, do not broaden the list by dropping its static restriction. */
|
|
17735
|
+
if (!intersection) {
|
|
17736
|
+
console.warn(`Cannot intersect the filters for "${key}". Keeping the static filter.`);
|
|
17737
|
+
continue;
|
|
17738
|
+
}
|
|
17739
|
+
/* If the intersection is empty, no row can satisfy both filters. */
|
|
17740
|
+
if (intersection.length === 0) {
|
|
17741
|
+
return null;
|
|
17742
|
+
}
|
|
17743
|
+
/* Assign the intersection to the request parameters, using a single value if the intersection has only one element. */
|
|
17744
|
+
params[key] = intersection.length === 1 ? intersection[0] : intersection;
|
|
17745
|
+
}
|
|
17746
|
+
return params;
|
|
17747
|
+
}
|
|
17624
17748
|
/**
|
|
17625
17749
|
* @method disconnect
|
|
17626
17750
|
* @description Marks the data source as disconnected from its collection viewer.
|
|
@@ -17897,6 +18021,7 @@ class TableStaticDataSource extends MatTableDataSource {
|
|
|
17897
18021
|
* @method connect
|
|
17898
18022
|
* @description Called when the MatTable connects to the data source.
|
|
17899
18023
|
* This method subscribes to the reload token to trigger a filter update and data refresh.
|
|
18024
|
+
* Clearing the last column filter also clears the active Material table filter.
|
|
17900
18025
|
* @docs-private
|
|
17901
18026
|
* @returns {BehaviorSubject<TEntity[]>} A BehaviorSubject containing the current data array.
|
|
17902
18027
|
*/
|
|
@@ -17904,10 +18029,17 @@ class TableStaticDataSource extends MatTableDataSource {
|
|
|
17904
18029
|
/* Subscribe to the reload token and update filters accordingly */
|
|
17905
18030
|
this._reloadChange.subscribe(x => {
|
|
17906
18031
|
/* Clean up any empty filters before applying them */
|
|
17907
|
-
Object.keys(this.fieldFilters)
|
|
18032
|
+
const fieldKeys = Object.keys(this.fieldFilters);
|
|
18033
|
+
fieldKeys.forEach((key) => ((this.fieldFilters[key] == null || this.fieldFilters[key] === '' || this.fieldFilters[key] === 'undefined')) && this.fieldFilters[key] !== 0 && delete this.fieldFilters[key]);
|
|
18034
|
+
/* Clean up any empty static field filters before applying them */
|
|
17908
18035
|
Object.keys(this.staticFieldFilters).forEach((key) => ((this.staticFieldFilters[key] == null || this.staticFieldFilters[key] === '' || this.staticFieldFilters[key] === 'undefined')) && this.staticFieldFilters[key] !== 0 && delete this.staticFieldFilters[key]);
|
|
18036
|
+
/* Clean up any empty static field filters before applying them */
|
|
18037
|
+
const activeFieldKeys = Object.keys(this.fieldFilters);
|
|
18038
|
+
if (fieldKeys.length > 0 && activeFieldKeys.length === 0) {
|
|
18039
|
+
this.filter = '';
|
|
18040
|
+
}
|
|
17909
18041
|
/* Apply filters dynamically to the table data */
|
|
17910
|
-
|
|
18042
|
+
activeFieldKeys.forEach((key) => {
|
|
17911
18043
|
this.filterPredicate = (data, filter) => !filter || `${data[key]}`.toLowerCase().includes(`${this.filter}`?.toLowerCase());
|
|
17912
18044
|
this.filter = this.fieldFilters[key];
|
|
17913
18045
|
});
|
|
@@ -18626,7 +18758,7 @@ class FilterSelectComponent {
|
|
|
18626
18758
|
provide: MAT_SELECT_CONFIG,
|
|
18627
18759
|
useValue: { overlayPanelClass: 'vd-select-filter-overlay' }
|
|
18628
18760
|
}
|
|
18629
|
-
], queries: [{ propertyName: "optionTemplate", first: true, predicate: VdFilterOptionDirective, descendants: true }], viewQueries: [{ propertyName: "selectEl", first: true, predicate: MatSelect, descendants: true }, { propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true }], ngImport: i0, template: "<mat-form-field subscriptSizing=\"dynamic\" [ngClass]=\"{'filter-not-empty': value}\" dense-3 flex>\r\n @if (!value && value!=0 && !focused) {\r\n <span matPrefix (click)=\"$event.stopPropagation();select.open()\">\r\n <mat-icon fontSet=\"material-symbols-outlined\">manage_search</mat-icon>\r\n </span>\r\n }\r\n <mat-select type=\"input\" [(ngModel)]=\"value\" [multiple]=\"multiple\" flex #select>\r\n @if (filterable) {\r\n <mat-form-field appearance=\"fill\" subscriptSizing=\"dynamic\" dense-3 flex>\r\n <input matInput #filterInput type=\"text\" placeholder=\"Filter...\" class=\"vd-select-filter\" (click)=\"$event.stopPropagation();\" (keyup)=\"handleFilter($event)\" flex>\r\n @if (filterInput?.value) {\r\n <mat-icon (click)=\"$event.stopPropagation(); filterInput!.value = ''; handleFilter($event);\" fontSet=\"material-symbols-outlined\">close</mat-icon>\r\n }\r\n </mat-form-field>\r\n }\r\n @if (!multiple) {\r\n <mat-option class=\"tc-grey-500\" (click)=\"$event.stopPropagation();\"></mat-option>\r\n }\r\n @for (option of filteredOptions; track option; let first = $first) {\r\n <mat-option [value]=\"option[key]\" (click)=\"$event.stopPropagation();\">\r\n @if (!optionTemplate?.templateRef) {\r\n <msa-selection-label [label]=\"option[text]\"></msa-selection-label>\r\n }\r\n @if (optionTemplate?.templateRef) {\r\n <ng-template [ngTemplateOutlet]=\"optionTemplate!.templateRef\" [ngTemplateOutletContext]=\"{ option: option }\"></ng-template>\r\n }\r\n </mat-option>\r\n }\r\n </mat-select>\r\n</mat-form-field>", styles: [".mat-mdc-form-field mat-icon{opacity:.7}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MsaSelectionLabelComponent, selector: "msa-selection-label", inputs: ["label"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
18761
|
+
], queries: [{ propertyName: "optionTemplate", first: true, predicate: VdFilterOptionDirective, descendants: true }], viewQueries: [{ propertyName: "selectEl", first: true, predicate: MatSelect, descendants: true }, { propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true }], ngImport: i0, template: "<mat-form-field subscriptSizing=\"dynamic\" [ngClass]=\"{'filter-not-empty': value}\" dense-3 flex>\r\n @if (!value && value!=0 && !focused) {\r\n <span matPrefix (click)=\"$event.stopPropagation();select.open()\">\r\n <mat-icon fontSet=\"material-symbols-outlined\">manage_search</mat-icon>\r\n </span>\r\n }\r\n <mat-select type=\"input\" [(ngModel)]=\"value\" [multiple]=\"multiple\" [panelWidth]=\"null\" flex #select>\r\n @if (filterable) {\r\n <mat-form-field appearance=\"fill\" subscriptSizing=\"dynamic\" dense-3 flex>\r\n <input matInput #filterInput type=\"text\" placeholder=\"Filter...\" class=\"vd-select-filter\" (click)=\"$event.stopPropagation();\" (keyup)=\"handleFilter($event)\" flex>\r\n @if (filterInput?.value) {\r\n <mat-icon (click)=\"$event.stopPropagation(); filterInput!.value = ''; handleFilter($event);\" fontSet=\"material-symbols-outlined\">close</mat-icon>\r\n }\r\n </mat-form-field>\r\n }\r\n @if (!multiple) {\r\n <mat-option class=\"tc-grey-500\" (click)=\"$event.stopPropagation();\"></mat-option>\r\n }\r\n @for (option of filteredOptions; track option; let first = $first) {\r\n <mat-option [value]=\"option[key]\" (click)=\"$event.stopPropagation();\">\r\n @if (!optionTemplate?.templateRef) {\r\n <msa-selection-label [label]=\"option[text]\"></msa-selection-label>\r\n }\r\n @if (optionTemplate?.templateRef) {\r\n <ng-template [ngTemplateOutlet]=\"optionTemplate!.templateRef\" [ngTemplateOutletContext]=\"{ option: option }\"></ng-template>\r\n }\r\n </mat-option>\r\n }\r\n </mat-select>\r\n</mat-form-field>", styles: [".mat-mdc-form-field mat-icon{opacity:.7}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i2$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MsaSelectionLabelComponent, selector: "msa-selection-label", inputs: ["label"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
18630
18762
|
}
|
|
18631
18763
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: FilterSelectComponent, decorators: [{
|
|
18632
18764
|
type: Component,
|
|
@@ -18648,7 +18780,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
18648
18780
|
provide: MAT_SELECT_CONFIG,
|
|
18649
18781
|
useValue: { overlayPanelClass: 'vd-select-filter-overlay' }
|
|
18650
18782
|
}
|
|
18651
|
-
], template: "<mat-form-field subscriptSizing=\"dynamic\" [ngClass]=\"{'filter-not-empty': value}\" dense-3 flex>\r\n @if (!value && value!=0 && !focused) {\r\n <span matPrefix (click)=\"$event.stopPropagation();select.open()\">\r\n <mat-icon fontSet=\"material-symbols-outlined\">manage_search</mat-icon>\r\n </span>\r\n }\r\n <mat-select type=\"input\" [(ngModel)]=\"value\" [multiple]=\"multiple\" flex #select>\r\n @if (filterable) {\r\n <mat-form-field appearance=\"fill\" subscriptSizing=\"dynamic\" dense-3 flex>\r\n <input matInput #filterInput type=\"text\" placeholder=\"Filter...\" class=\"vd-select-filter\" (click)=\"$event.stopPropagation();\" (keyup)=\"handleFilter($event)\" flex>\r\n @if (filterInput?.value) {\r\n <mat-icon (click)=\"$event.stopPropagation(); filterInput!.value = ''; handleFilter($event);\" fontSet=\"material-symbols-outlined\">close</mat-icon>\r\n }\r\n </mat-form-field>\r\n }\r\n @if (!multiple) {\r\n <mat-option class=\"tc-grey-500\" (click)=\"$event.stopPropagation();\"></mat-option>\r\n }\r\n @for (option of filteredOptions; track option; let first = $first) {\r\n <mat-option [value]=\"option[key]\" (click)=\"$event.stopPropagation();\">\r\n @if (!optionTemplate?.templateRef) {\r\n <msa-selection-label [label]=\"option[text]\"></msa-selection-label>\r\n }\r\n @if (optionTemplate?.templateRef) {\r\n <ng-template [ngTemplateOutlet]=\"optionTemplate!.templateRef\" [ngTemplateOutletContext]=\"{ option: option }\"></ng-template>\r\n }\r\n </mat-option>\r\n }\r\n </mat-select>\r\n</mat-form-field>", styles: [".mat-mdc-form-field mat-icon{opacity:.7}\n"] }]
|
|
18783
|
+
], template: "<mat-form-field subscriptSizing=\"dynamic\" [ngClass]=\"{'filter-not-empty': value}\" dense-3 flex>\r\n @if (!value && value!=0 && !focused) {\r\n <span matPrefix (click)=\"$event.stopPropagation();select.open()\">\r\n <mat-icon fontSet=\"material-symbols-outlined\">manage_search</mat-icon>\r\n </span>\r\n }\r\n <mat-select type=\"input\" [(ngModel)]=\"value\" [multiple]=\"multiple\" [panelWidth]=\"null\" flex #select>\r\n @if (filterable) {\r\n <mat-form-field appearance=\"fill\" subscriptSizing=\"dynamic\" dense-3 flex>\r\n <input matInput #filterInput type=\"text\" placeholder=\"Filter...\" class=\"vd-select-filter\" (click)=\"$event.stopPropagation();\" (keyup)=\"handleFilter($event)\" flex>\r\n @if (filterInput?.value) {\r\n <mat-icon (click)=\"$event.stopPropagation(); filterInput!.value = ''; handleFilter($event);\" fontSet=\"material-symbols-outlined\">close</mat-icon>\r\n }\r\n </mat-form-field>\r\n }\r\n @if (!multiple) {\r\n <mat-option class=\"tc-grey-500\" (click)=\"$event.stopPropagation();\"></mat-option>\r\n }\r\n @for (option of filteredOptions; track option; let first = $first) {\r\n <mat-option [value]=\"option[key]\" (click)=\"$event.stopPropagation();\">\r\n @if (!optionTemplate?.templateRef) {\r\n <msa-selection-label [label]=\"option[text]\"></msa-selection-label>\r\n }\r\n @if (optionTemplate?.templateRef) {\r\n <ng-template [ngTemplateOutlet]=\"optionTemplate!.templateRef\" [ngTemplateOutletContext]=\"{ option: option }\"></ng-template>\r\n }\r\n </mat-option>\r\n }\r\n </mat-select>\r\n</mat-form-field>", styles: [".mat-mdc-form-field mat-icon{opacity:.7}\n"] }]
|
|
18652
18784
|
}], ctorParameters: () => [{ type: i1$5.MatTable }, { type: i2$3.CdkColumnDef }], propDecorators: { optionTemplate: [{
|
|
18653
18785
|
type: ContentChild,
|
|
18654
18786
|
args: [VdFilterOptionDirective]
|
|
@@ -31861,33 +31993,6 @@ __decorate([
|
|
|
31861
31993
|
__metadata("design:type", Boolean)
|
|
31862
31994
|
], Facet.prototype, "multiple", void 0);
|
|
31863
31995
|
|
|
31864
|
-
/**
|
|
31865
|
-
* Pagination class to represent paginated data.
|
|
31866
|
-
* @template TModel - The type of items in the pagination.
|
|
31867
|
-
*/
|
|
31868
|
-
class Pagination {
|
|
31869
|
-
/**
|
|
31870
|
-
* Current page number.
|
|
31871
|
-
*/
|
|
31872
|
-
page = 1;
|
|
31873
|
-
/**
|
|
31874
|
-
* Number of items per page.
|
|
31875
|
-
*/
|
|
31876
|
-
pageSize = 10;
|
|
31877
|
-
/**
|
|
31878
|
-
* Total number of pages.
|
|
31879
|
-
*/
|
|
31880
|
-
pageCount = 0;
|
|
31881
|
-
/**
|
|
31882
|
-
* Total number of items across all pages.
|
|
31883
|
-
*/
|
|
31884
|
-
total = 0;
|
|
31885
|
-
/**
|
|
31886
|
-
* Array of items for the current page.
|
|
31887
|
-
*/
|
|
31888
|
-
items = [];
|
|
31889
|
-
}
|
|
31890
|
-
|
|
31891
31996
|
/**
|
|
31892
31997
|
* To modify the labels and text displayed, create a new instance of MdPaginatorIntl and
|
|
31893
31998
|
* include it in a custom provider
|