@eherve/angular-material-datatable 22.2.2 → 22.2.3
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
CHANGED
|
@@ -88,3 +88,27 @@ responses after editing, clearing, replacing the filter or destroying the contro
|
|
|
88
88
|
the stored filter unchanged; successful resolution refreshes the input without emitting a filter change.
|
|
89
89
|
For columns with a resolver, an unresolved value is never displayed as raw text: the input stays blank until its label
|
|
90
90
|
is known, including when lookup fails or returns no option. Columns without a resolver keep their existing display.
|
|
91
|
+
|
|
92
|
+
## Select filter layout
|
|
93
|
+
|
|
94
|
+
Selected filter values stay on one line with compact icons and ellipsis for long labels.
|
|
95
|
+
This also applies to multiple selections; the open menu keeps all option labels available.
|
|
96
|
+
|
|
97
|
+
Searchable `select` columns accept `panelWidth`, forwarded to Angular Material's public
|
|
98
|
+
`MatSelect.panelWidth` input:
|
|
99
|
+
|
|
100
|
+
- omitted or `'auto'`: match the form field width;
|
|
101
|
+
- `null` or `''`: size the menu to its option content, within the viewport;
|
|
102
|
+
- a number (pixels) or CSS width string: use an explicit menu width.
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
{
|
|
106
|
+
type: 'select',
|
|
107
|
+
columnDef: 'actionType',
|
|
108
|
+
property: 'actionType',
|
|
109
|
+
header: 'Type d’action',
|
|
110
|
+
searchable: true,
|
|
111
|
+
options: actionTypeOptions,
|
|
112
|
+
panelWidth: null,
|
|
113
|
+
}
|
|
114
|
+
```
|
|
@@ -2994,8 +2994,8 @@ var HeaderSelectFilterComponent = class HeaderSelectFilterComponent {
|
|
|
2994
2994
|
useExisting: forwardRef(() => HeaderSelectFilterComponent)
|
|
2995
2995
|
}],
|
|
2996
2996
|
ngImport: i0,
|
|
2997
|
-
template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n appearance=\"fill\"\n [class.label-resting]=\"!filterSelect.shouldLabelFloat\"\n >\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <mat-select\n #filterSelect=\"matSelect\"\n [formControl]=\"selectControl\"\n [placeholder]=\"column.placeholder!\"\n [multiple]=\"column.multiple\"\n (closed)=\"onTouched()\"\n >\n <mat-select-trigger>\n @if (column.multiple && selectControl.value | isArray) {\n <div class=\"options\">\n @for (v of selectControl.value; track v) {\n @let option = v | selectOption: options;\n @if (option) {\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n } @else {\n <mat-label [innerHTML]=\"v | safeHtml\"></mat-label>\n }\n }\n </div>\n } @else {\n @let option = selectControl.value | selectOption: options;\n @if (option) {\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n } @else {\n <mat-label [innerHTML]=\"selectControl.value | safeHtml\"></mat-label>\n }\n }\n </mat-select-trigger>\n @if (column.hasGroup) {\n @for (group of groups; track group) {\n <mat-optgroup>\n <mat-label [innerHTML]=\"group.name | safeHtml\"></mat-label>\n @for (option of group.options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n </mat-option>\n }\n </mat-optgroup>\n }\n } @else {\n @for (option of options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n </mat-option>\n }\n }\n </mat-select>\n\n @if (\n selectControl.value !== null &&\n selectControl.value !== undefined &&\n selectControl.value !== \"\"\n ) {\n <button\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n}\n\n<ng-template #selectOption let-option=\"option\">\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case (\"svg\") {\n <mat-icon\n [svgIcon]=\"option.icon\"\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"\n ></mat-icon>\n }\n @default {\n <mat-icon\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"\n >\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label\n [style.color]=\"option.color\"\n [innerHTML]=\"option.name | safeHtml\"\n ></mat-label>\n </div>\n</ng-template>\n",
|
|
2998
|
-
styles: [":host{display:flex;flex:1 1 100%}mat-form-field{--mat-form-field-filled-focus-active-indicator-color: var(--datatable-accent);--mat-form-field-filled-focus-label-text-color: var(--datatable-accent);--mat-form-field-outlined-focus-outline-color: var(--datatable-accent);--mat-form-field-outlined-focus-label-text-color: var(--datatable-accent);--mat-form-field-focus-select-arrow-color: var(--datatable-accent);--mat-select-arrow-transform: none}mat-form-field.label-resting{--mat-select-arrow-transform: translateY(-.5lh)}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mat-form-field-filled-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mat-form-field-filled-container-shape: 0;--mat-form-field-filled-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.options{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;flex-wrap:wrap}.options .option:not(:last-child){margin-right:8px}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"],
|
|
2997
|
+
template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n appearance=\"fill\"\n [class.label-resting]=\"!filterSelect.shouldLabelFloat\"\n >\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <mat-select\n #filterSelect=\"matSelect\"\n [formControl]=\"selectControl\"\n [placeholder]=\"column.placeholder!\"\n [multiple]=\"column.multiple\"\n [panelWidth]=\"column.panelWidth === undefined ? 'auto' : column.panelWidth\"\n (closed)=\"onTouched()\"\n >\n <mat-select-trigger>\n @if (column.multiple && selectControl.value | isArray) {\n <div class=\"options\">\n @for (v of selectControl.value; track v) {\n @let option = v | selectOption: options;\n @if (option) {\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n } @else {\n <mat-label [innerHTML]=\"v | safeHtml\"></mat-label>\n }\n }\n </div>\n } @else {\n @let option = selectControl.value | selectOption: options;\n @if (option) {\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n } @else {\n <mat-label [innerHTML]=\"selectControl.value | safeHtml\"></mat-label>\n }\n }\n </mat-select-trigger>\n @if (column.hasGroup) {\n @for (group of groups; track group) {\n <mat-optgroup>\n <mat-label [innerHTML]=\"group.name | safeHtml\"></mat-label>\n @for (option of group.options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n </mat-option>\n }\n </mat-optgroup>\n }\n } @else {\n @for (option of options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n </mat-option>\n }\n }\n </mat-select>\n\n @if (\n selectControl.value !== null &&\n selectControl.value !== undefined &&\n selectControl.value !== \"\"\n ) {\n <button\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n}\n\n<ng-template #selectOption let-option=\"option\">\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case (\"svg\") {\n <mat-icon\n [svgIcon]=\"option.icon\"\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"\n ></mat-icon>\n }\n @default {\n <mat-icon\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"\n >\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label\n [style.color]=\"option.color\"\n [innerHTML]=\"option.name | safeHtml\"\n ></mat-label>\n </div>\n</ng-template>\n",
|
|
2998
|
+
styles: [":host{display:flex;flex:1 1 100%}mat-form-field{--mat-form-field-filled-focus-active-indicator-color: var(--datatable-accent);--mat-form-field-filled-focus-label-text-color: var(--datatable-accent);--mat-form-field-outlined-focus-outline-color: var(--datatable-accent);--mat-form-field-outlined-focus-label-text-color: var(--datatable-accent);--mat-form-field-focus-select-arrow-color: var(--datatable-accent);--mat-select-arrow-transform: none}mat-form-field.label-resting{--mat-select-arrow-transform: translateY(-.5lh)}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mat-form-field-filled-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mat-form-field-filled-container-shape: 0;--mat-form-field-filled-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.options{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;flex-wrap:wrap}.options .option:not(:last-child){margin-right:8px}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}mat-select{display:flex}mat-select mat-select-trigger{display:block;padding:0;overflow:hidden}mat-select mat-select-trigger .options{flex-wrap:nowrap;overflow:hidden}mat-select mat-select-trigger .option{min-width:0;flex:0 1 auto;overflow:hidden}mat-select mat-select-trigger mat-icon{width:18px;height:18px;min-width:18px;min-height:18px;line-height:18px;font-size:18px;flex:0 0 18px}mat-select mat-select-trigger mat-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n"],
|
|
2999
2999
|
dependencies: [
|
|
3000
3000
|
{
|
|
3001
3001
|
kind: "ngmodule",
|
|
@@ -3201,8 +3201,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3201
3201
|
multi: true,
|
|
3202
3202
|
useExisting: forwardRef(() => HeaderSelectFilterComponent)
|
|
3203
3203
|
}],
|
|
3204
|
-
template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n appearance=\"fill\"\n [class.label-resting]=\"!filterSelect.shouldLabelFloat\"\n >\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <mat-select\n #filterSelect=\"matSelect\"\n [formControl]=\"selectControl\"\n [placeholder]=\"column.placeholder!\"\n [multiple]=\"column.multiple\"\n (closed)=\"onTouched()\"\n >\n <mat-select-trigger>\n @if (column.multiple && selectControl.value | isArray) {\n <div class=\"options\">\n @for (v of selectControl.value; track v) {\n @let option = v | selectOption: options;\n @if (option) {\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n } @else {\n <mat-label [innerHTML]=\"v | safeHtml\"></mat-label>\n }\n }\n </div>\n } @else {\n @let option = selectControl.value | selectOption: options;\n @if (option) {\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n } @else {\n <mat-label [innerHTML]=\"selectControl.value | safeHtml\"></mat-label>\n }\n }\n </mat-select-trigger>\n @if (column.hasGroup) {\n @for (group of groups; track group) {\n <mat-optgroup>\n <mat-label [innerHTML]=\"group.name | safeHtml\"></mat-label>\n @for (option of group.options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n </mat-option>\n }\n </mat-optgroup>\n }\n } @else {\n @for (option of options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n </mat-option>\n }\n }\n </mat-select>\n\n @if (\n selectControl.value !== null &&\n selectControl.value !== undefined &&\n selectControl.value !== \"\"\n ) {\n <button\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n}\n\n<ng-template #selectOption let-option=\"option\">\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case (\"svg\") {\n <mat-icon\n [svgIcon]=\"option.icon\"\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"\n ></mat-icon>\n }\n @default {\n <mat-icon\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"\n >\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label\n [style.color]=\"option.color\"\n [innerHTML]=\"option.name | safeHtml\"\n ></mat-label>\n </div>\n</ng-template>\n",
|
|
3205
|
-
styles: [":host{display:flex;flex:1 1 100%}mat-form-field{--mat-form-field-filled-focus-active-indicator-color: var(--datatable-accent);--mat-form-field-filled-focus-label-text-color: var(--datatable-accent);--mat-form-field-outlined-focus-outline-color: var(--datatable-accent);--mat-form-field-outlined-focus-label-text-color: var(--datatable-accent);--mat-form-field-focus-select-arrow-color: var(--datatable-accent);--mat-select-arrow-transform: none}mat-form-field.label-resting{--mat-select-arrow-transform: translateY(-.5lh)}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mat-form-field-filled-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mat-form-field-filled-container-shape: 0;--mat-form-field-filled-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.options{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;flex-wrap:wrap}.options .option:not(:last-child){margin-right:8px}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}\n"]
|
|
3204
|
+
template: "<!-- @format -->\n\n@if (selectControl) {\n <mat-form-field\n appearance=\"fill\"\n [class.label-resting]=\"!filterSelect.shouldLabelFloat\"\n >\n <mat-label [innerHTML]=\"column.header | safeHtml\"></mat-label>\n <mat-select\n #filterSelect=\"matSelect\"\n [formControl]=\"selectControl\"\n [placeholder]=\"column.placeholder!\"\n [multiple]=\"column.multiple\"\n [panelWidth]=\"column.panelWidth === undefined ? 'auto' : column.panelWidth\"\n (closed)=\"onTouched()\"\n >\n <mat-select-trigger>\n @if (column.multiple && selectControl.value | isArray) {\n <div class=\"options\">\n @for (v of selectControl.value; track v) {\n @let option = v | selectOption: options;\n @if (option) {\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n } @else {\n <mat-label [innerHTML]=\"v | safeHtml\"></mat-label>\n }\n }\n </div>\n } @else {\n @let option = selectControl.value | selectOption: options;\n @if (option) {\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n } @else {\n <mat-label [innerHTML]=\"selectControl.value | safeHtml\"></mat-label>\n }\n }\n </mat-select-trigger>\n @if (column.hasGroup) {\n @for (group of groups; track group) {\n <mat-optgroup>\n <mat-label [innerHTML]=\"group.name | safeHtml\"></mat-label>\n @for (option of group.options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n </mat-option>\n }\n </mat-optgroup>\n }\n } @else {\n @for (option of options; track option) {\n <mat-option [value]=\"option.value\">\n <ng-container\n *ngTemplateOutlet=\"selectOption; context: { option }\"\n ></ng-container>\n </mat-option>\n }\n }\n </mat-select>\n\n @if (\n selectControl.value !== null &&\n selectControl.value !== undefined &&\n selectControl.value !== \"\"\n ) {\n <button\n mat-icon-button\n matSuffix\n size=\"small\"\n [attr.aria-label]=\"datatableIntl.clearFilterLabel\"\n (click)=\"selectControl.setValue(undefined)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </mat-form-field>\n}\n\n<ng-template #selectOption let-option=\"option\">\n <div class=\"option\">\n @if (option.icon) {\n @switch (option.iconSrc) {\n @case (\"svg\") {\n <mat-icon\n [svgIcon]=\"option.icon\"\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"\n ></mat-icon>\n }\n @default {\n <mat-icon\n [style.color]=\"option.iconColor ?? option.color\"\n [style.margin-right.px]=\"8\"\n >\n {{ option.icon }}\n </mat-icon>\n }\n }\n }\n <mat-label\n [style.color]=\"option.color\"\n [innerHTML]=\"option.name | safeHtml\"\n ></mat-label>\n </div>\n</ng-template>\n",
|
|
3205
|
+
styles: [":host{display:flex;flex:1 1 100%}mat-form-field{--mat-form-field-filled-focus-active-indicator-color: var(--datatable-accent);--mat-form-field-filled-focus-label-text-color: var(--datatable-accent);--mat-form-field-outlined-focus-outline-color: var(--datatable-accent);--mat-form-field-outlined-focus-label-text-color: var(--datatable-accent);--mat-form-field-focus-select-arrow-color: var(--datatable-accent);--mat-select-arrow-transform: none}mat-form-field.label-resting{--mat-select-arrow-transform: translateY(-.5lh)}mat-form-field{min-width:auto;flex:1 1 100%;margin:6px 0;--mat-form-field-filled-active-indicator-color: #999;--mat-form-field-hover-state-layer-opacity: 0;--mat-form-field-filled-container-shape: 0;--mat-form-field-filled-container-color: var(--datatable-background)}mat-form-field ::ng-deep .mat-mdc-form-field-bottom-align{display:none}mat-form-field ::ng-deep .mat-mdc-text-field-wrapper{padding:0}.options{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row;flex-wrap:wrap}.options .option:not(:last-child){margin-right:8px}.option{display:flex;box-sizing:border-box;place-content:center start;align-items:center;flex-direction:row}mat-select{display:flex}mat-select mat-select-trigger{display:block;padding:0;overflow:hidden}mat-select mat-select-trigger .options{flex-wrap:nowrap;overflow:hidden}mat-select mat-select-trigger .option{min-width:0;flex:0 1 auto;overflow:hidden}mat-select mat-select-trigger mat-icon{width:18px;height:18px;min-width:18px;min-height:18px;line-height:18px;font-size:18px;flex:0 0 18px}mat-select mat-select-trigger mat-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n"]
|
|
3206
3206
|
}]
|
|
3207
3207
|
}],
|
|
3208
3208
|
propDecorators: { column: [{ type: Input }] }
|