@quadrel-enterprise-ui/framework 21.4.2 → 21.4.4
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/fesm2022/quadrel-enterprise-ui-framework.mjs +73 -14
- package/fesm2022/quadrel-enterprise-ui-framework.mjs.map +1 -1
- package/package.json +2 -2
- package/src/assets/i18n/de.json +1 -0
- package/src/assets/i18n/en.json +1 -0
- package/src/assets/i18n/fr.json +1 -0
- package/src/assets/i18n/it.json +1 -0
- package/types/quadrel-enterprise-ui-framework.d.ts +30 -4
|
@@ -5844,6 +5844,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
5844
5844
|
type: Input
|
|
5845
5845
|
}] } });
|
|
5846
5846
|
|
|
5847
|
+
/**
|
|
5848
|
+
* Text that stands in for a value which is missing.
|
|
5849
|
+
*/
|
|
5850
|
+
const QD_EMPTY_VALUE_PLACEHOLDER = '-';
|
|
5851
|
+
/**
|
|
5852
|
+
* Translation key read out instead of the placeholder.
|
|
5853
|
+
*
|
|
5854
|
+
* A screen reader would read the placeholder as "hyphen" or skip it. The
|
|
5855
|
+
* placeholder is therefore hidden from it and this text is read out instead.
|
|
5856
|
+
*/
|
|
5857
|
+
const QD_EMPTY_VALUE_I18N = 'i18n.qd.emptyValue.a11y.label';
|
|
5858
|
+
/**
|
|
5859
|
+
* Tells whether a value counts as content.
|
|
5860
|
+
*
|
|
5861
|
+
* An empty string, `null` and `undefined` count as no content.
|
|
5862
|
+
* A `0` and a `false` count as content.
|
|
5863
|
+
*/
|
|
5864
|
+
const qdHasContent = (value) => value !== '' && value !== undefined && value !== null;
|
|
5865
|
+
|
|
5847
5866
|
/**
|
|
5848
5867
|
* The **QdChip** component can visualize different statuses.
|
|
5849
5868
|
*/
|
|
@@ -6127,6 +6146,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
6127
6146
|
* @description Renders one or multiple chips.
|
|
6128
6147
|
*
|
|
6129
6148
|
* * Note: The content type "chip" can handle a single chip or an array of chips. A chip can be a simple string or an object of the form { label: string; state: QdChipState }.
|
|
6149
|
+
* * Note: A chip shows text. A value of another type is dropped and reported as an error. Use the content type that fits the value, for example "boolean" or "integer". Only when none of them fits, convert the value to a string yourself.
|
|
6150
|
+
* * Note: Entries without a label are dropped. If no entry is left at all, the component renders a dash instead of a chip.
|
|
6130
6151
|
* * Note: This is a base component for all potentially derived components and classes.
|
|
6131
6152
|
*/
|
|
6132
6153
|
class QdDataFacetsChipComponent {
|
|
@@ -6137,12 +6158,16 @@ class QdDataFacetsChipComponent {
|
|
|
6137
6158
|
_chipsSubject = new ReplaySubject(1);
|
|
6138
6159
|
chips$;
|
|
6139
6160
|
truncatedChips$;
|
|
6161
|
+
hasNoChips$;
|
|
6162
|
+
emptyValue = QD_EMPTY_VALUE_PLACEHOLDER;
|
|
6163
|
+
emptyValueI18n = QD_EMPTY_VALUE_I18N;
|
|
6140
6164
|
get maxChipCount() {
|
|
6141
6165
|
return this.config?.maxChipCount ?? Number.MAX_SAFE_INTEGER;
|
|
6142
6166
|
}
|
|
6143
6167
|
ngOnInit() {
|
|
6144
6168
|
this.chips$ = this._chipsSubject.pipe(map(chips => chips.slice(0, this.maxChipCount)));
|
|
6145
6169
|
this.truncatedChips$ = this._chipsSubject.pipe(map(chips => chips.slice(this.maxChipCount)));
|
|
6170
|
+
this.hasNoChips$ = this._chipsSubject.pipe(map(chips => chips.length === 0));
|
|
6146
6171
|
this.setChips();
|
|
6147
6172
|
}
|
|
6148
6173
|
ngOnChanges() {
|
|
@@ -6152,20 +6177,35 @@ class QdDataFacetsChipComponent {
|
|
|
6152
6177
|
this._chipsSubject.next(this.getChips());
|
|
6153
6178
|
}
|
|
6154
6179
|
getChips() {
|
|
6155
|
-
if (!this.data)
|
|
6180
|
+
if (!qdHasContent(this.data))
|
|
6156
6181
|
return [];
|
|
6157
6182
|
const chips = Array.isArray(this.data) ? this.data : [this.data];
|
|
6158
|
-
return chips.map(chip => (
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6183
|
+
return chips.map(chip => this.toChip(chip)).filter(chip => qdHasContent(chip.label));
|
|
6184
|
+
}
|
|
6185
|
+
toChip(chip) {
|
|
6186
|
+
const label = this.getLabel(chip);
|
|
6187
|
+
return {
|
|
6188
|
+
label,
|
|
6189
|
+
state: this.config?.state?.[label] || this.getState(chip) || chipStateDefault
|
|
6190
|
+
};
|
|
6191
|
+
}
|
|
6192
|
+
getLabel(chip) {
|
|
6193
|
+
if (typeof chip === 'string')
|
|
6194
|
+
return chip;
|
|
6195
|
+
if (typeof chip === 'object')
|
|
6196
|
+
return chip?.label;
|
|
6197
|
+
console.error(`Quadrel Framework | QdDataFacetsChip - Value must be a string. Got ${chip}. Use the content type that fits the value, for example "boolean" or "integer".`);
|
|
6198
|
+
return undefined;
|
|
6199
|
+
}
|
|
6200
|
+
getState(chip) {
|
|
6201
|
+
return typeof chip === 'object' ? chip?.state : undefined;
|
|
6162
6202
|
}
|
|
6163
6203
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdDataFacetsChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6164
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdDataFacetsChipComponent, isStandalone: false, selector: "qd-data-facets-chip", inputs: { config: "config", data: "data", i18n: "i18n", testId: "testId" }, host: { properties: { "attr.data-test-id": "testId" }, classAttribute: "qd-data-facets" }, usesOnChanges: true, ngImport: i0, template: "@for (chip of chips$ | async; track chip) {\n<qd-chip [state]=\"chip.state\">\n {{ config?.isTranslated ? (i18n + \".\" + chip.label | translate) : chip.label }}\n</qd-chip>\n} @if (truncatedChips$ | async; as truncatedChips) { @if (truncatedChips.length > 0) {\n<qd-data-facets-chip-truncated-indicator\n [truncatedChips]=\"truncatedChips\"\n [i18n]=\"i18n\"\n [columnOptions]=\"config\"\n></qd-data-facets-chip-truncated-indicator>\n} }\n", styles: [":host{line-height:normal}qd-chip{margin-right:.5625rem;margin-bottom:.125rem}qd-truncated-chips-indicator,qd-chip:last-child{margin-right:0;margin-bottom:.5625rem}span:host{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5625rem}span:host qd-truncated-chips-indicator,span:host qd-chip{margin:0}span:host qd-truncated-chips-indicator:last-child,span:host qd-chip:last-child{margin-bottom:.5625rem}\n"], dependencies: [{ kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdDataFacetsChipTruncatedIndicatorComponent, selector: "qd-data-facets-chip-truncated-indicator", inputs: ["truncatedChips", "i18n", "columnOptions"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6204
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdDataFacetsChipComponent, isStandalone: false, selector: "qd-data-facets-chip", inputs: { config: "config", data: "data", i18n: "i18n", testId: "testId" }, host: { properties: { "attr.data-test-id": "testId" }, classAttribute: "qd-data-facets" }, usesOnChanges: true, ngImport: i0, template: "@for (chip of chips$ | async; track chip) {\n<qd-chip [state]=\"chip.state\">\n {{ config?.isTranslated ? (i18n + \".\" + chip.label | translate) : chip.label }}\n</qd-chip>\n} @if (hasNoChips$ | async) {\n<span [attr.data-test-id]=\"testId ? testId + '-empty' : null\" aria-hidden=\"true\">{{ emptyValue }}</span>\n<span class=\"qd-visually-hidden\">{{ emptyValueI18n | translate }}</span>\n} @if (truncatedChips$ | async; as truncatedChips) { @if (truncatedChips.length > 0) {\n<qd-data-facets-chip-truncated-indicator\n [truncatedChips]=\"truncatedChips\"\n [i18n]=\"i18n\"\n [columnOptions]=\"config\"\n></qd-data-facets-chip-truncated-indicator>\n} }\n", styles: [":host{line-height:normal}qd-chip{margin-right:.5625rem;margin-bottom:.125rem}qd-truncated-chips-indicator,qd-chip:last-child{margin-right:0;margin-bottom:.5625rem}span:host{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5625rem}span:host qd-truncated-chips-indicator,span:host qd-chip{margin:0}span:host qd-truncated-chips-indicator:last-child,span:host qd-chip:last-child{margin-bottom:.5625rem}\n"], dependencies: [{ kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdDataFacetsChipTruncatedIndicatorComponent, selector: "qd-data-facets-chip-truncated-indicator", inputs: ["truncatedChips", "i18n", "columnOptions"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6165
6205
|
}
|
|
6166
6206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdDataFacetsChipComponent, decorators: [{
|
|
6167
6207
|
type: Component,
|
|
6168
|
-
args: [{ selector: 'qd-data-facets-chip', host: { class: 'qd-data-facets', '[attr.data-test-id]': 'testId' }, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@for (chip of chips$ | async; track chip) {\n<qd-chip [state]=\"chip.state\">\n {{ config?.isTranslated ? (i18n + \".\" + chip.label | translate) : chip.label }}\n</qd-chip>\n} @if (truncatedChips$ | async; as truncatedChips) { @if (truncatedChips.length > 0) {\n<qd-data-facets-chip-truncated-indicator\n [truncatedChips]=\"truncatedChips\"\n [i18n]=\"i18n\"\n [columnOptions]=\"config\"\n></qd-data-facets-chip-truncated-indicator>\n} }\n", styles: [":host{line-height:normal}qd-chip{margin-right:.5625rem;margin-bottom:.125rem}qd-truncated-chips-indicator,qd-chip:last-child{margin-right:0;margin-bottom:.5625rem}span:host{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5625rem}span:host qd-truncated-chips-indicator,span:host qd-chip{margin:0}span:host qd-truncated-chips-indicator:last-child,span:host qd-chip:last-child{margin-bottom:.5625rem}\n"] }]
|
|
6208
|
+
args: [{ selector: 'qd-data-facets-chip', host: { class: 'qd-data-facets', '[attr.data-test-id]': 'testId' }, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@for (chip of chips$ | async; track chip) {\n<qd-chip [state]=\"chip.state\">\n {{ config?.isTranslated ? (i18n + \".\" + chip.label | translate) : chip.label }}\n</qd-chip>\n} @if (hasNoChips$ | async) {\n<span [attr.data-test-id]=\"testId ? testId + '-empty' : null\" aria-hidden=\"true\">{{ emptyValue }}</span>\n<span class=\"qd-visually-hidden\">{{ emptyValueI18n | translate }}</span>\n} @if (truncatedChips$ | async; as truncatedChips) { @if (truncatedChips.length > 0) {\n<qd-data-facets-chip-truncated-indicator\n [truncatedChips]=\"truncatedChips\"\n [i18n]=\"i18n\"\n [columnOptions]=\"config\"\n></qd-data-facets-chip-truncated-indicator>\n} }\n", styles: [":host{line-height:normal}qd-chip{margin-right:.5625rem;margin-bottom:.125rem}qd-truncated-chips-indicator,qd-chip:last-child{margin-right:0;margin-bottom:.5625rem}span:host{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5625rem}span:host qd-truncated-chips-indicator,span:host qd-chip{margin:0}span:host qd-truncated-chips-indicator:last-child,span:host qd-chip:last-child{margin-bottom:.5625rem}\n"] }]
|
|
6169
6209
|
}], propDecorators: { config: [{
|
|
6170
6210
|
type: Input
|
|
6171
6211
|
}], data: [{
|
|
@@ -9660,12 +9700,12 @@ class QdFormViewonlyComponent {
|
|
|
9660
9700
|
}
|
|
9661
9701
|
formatValue(value) {
|
|
9662
9702
|
if (!this.hasContent(value)) {
|
|
9663
|
-
return
|
|
9703
|
+
return QD_EMPTY_VALUE_PLACEHOLDER;
|
|
9664
9704
|
}
|
|
9665
9705
|
return this.getTranslationKey(value);
|
|
9666
9706
|
}
|
|
9667
9707
|
hasContent(value) {
|
|
9668
|
-
return value
|
|
9708
|
+
return qdHasContent(value);
|
|
9669
9709
|
}
|
|
9670
9710
|
getTranslationKey(value) {
|
|
9671
9711
|
if (typeof value === 'string')
|
|
@@ -30166,9 +30206,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
30166
30206
|
type: Input
|
|
30167
30207
|
}] } });
|
|
30168
30208
|
|
|
30209
|
+
/**
|
|
30210
|
+
* @description Renders the value of a status facet as a chip.
|
|
30211
|
+
*
|
|
30212
|
+
* * Note: Without a value the facet renders a dash instead of a chip.
|
|
30213
|
+
*/
|
|
30169
30214
|
class QdStatusFacetComponent {
|
|
30170
30215
|
facet;
|
|
30171
30216
|
data;
|
|
30217
|
+
testId;
|
|
30218
|
+
emptyValue = QD_EMPTY_VALUE_PLACEHOLDER;
|
|
30219
|
+
emptyValueI18n = QD_EMPTY_VALUE_I18N;
|
|
30220
|
+
get hasValue() {
|
|
30221
|
+
return qdHasContent(this.stringData);
|
|
30222
|
+
}
|
|
30172
30223
|
get stringData() {
|
|
30173
30224
|
return this.data[this.facet.name];
|
|
30174
30225
|
}
|
|
@@ -30176,15 +30227,17 @@ class QdStatusFacetComponent {
|
|
|
30176
30227
|
return this.facet.options;
|
|
30177
30228
|
}
|
|
30178
30229
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdStatusFacetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30179
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
30230
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdStatusFacetComponent, isStandalone: false, selector: "qd-status-facet", inputs: { facet: "facet", data: "data", testId: "testId" }, ngImport: i0, template: "@if (hasValue) {\n<qd-chip [state]=\"options.state[stringData]\">\n {{ options.i18ns ? (options.i18ns + \".\" + data[facet.name] | translate) : data[facet.name] }}\n</qd-chip>\n} @else {\n<span [attr.data-test-id]=\"testId ? testId + '-empty' : null\" aria-hidden=\"true\">{{ emptyValue }}</span>\n<span class=\"qd-visually-hidden\">{{ emptyValueI18n | translate }}</span>\n}\n", styles: [":host{display:block;margin-top:-.3125rem}\n"], dependencies: [{ kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
|
|
30180
30231
|
}
|
|
30181
30232
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdStatusFacetComponent, decorators: [{
|
|
30182
30233
|
type: Component,
|
|
30183
|
-
args: [{ selector: 'qd-status-facet', standalone: false, template: "<qd-chip [state]=\"options.state[stringData]\">\n {{ options.i18ns ? (options.i18ns + \".\" + data[facet.name] | translate) : data[facet.name] }}\n</qd-chip>\n", styles: [":host{display:block;margin-top:-.3125rem}\n"] }]
|
|
30234
|
+
args: [{ selector: 'qd-status-facet', standalone: false, template: "@if (hasValue) {\n<qd-chip [state]=\"options.state[stringData]\">\n {{ options.i18ns ? (options.i18ns + \".\" + data[facet.name] | translate) : data[facet.name] }}\n</qd-chip>\n} @else {\n<span [attr.data-test-id]=\"testId ? testId + '-empty' : null\" aria-hidden=\"true\">{{ emptyValue }}</span>\n<span class=\"qd-visually-hidden\">{{ emptyValueI18n | translate }}</span>\n}\n", styles: [":host{display:block;margin-top:-.3125rem}\n"] }]
|
|
30184
30235
|
}], propDecorators: { facet: [{
|
|
30185
30236
|
type: Input
|
|
30186
30237
|
}], data: [{
|
|
30187
30238
|
type: Input
|
|
30239
|
+
}], testId: [{
|
|
30240
|
+
type: Input
|
|
30188
30241
|
}] } });
|
|
30189
30242
|
|
|
30190
30243
|
class QdValueFacetComponent {
|
|
@@ -30252,6 +30305,7 @@ class QdDynamicFacetComponent {
|
|
|
30252
30305
|
dynamicFacet;
|
|
30253
30306
|
facet;
|
|
30254
30307
|
data;
|
|
30308
|
+
testId;
|
|
30255
30309
|
ref;
|
|
30256
30310
|
get component() {
|
|
30257
30311
|
return this.ref?.instance;
|
|
@@ -30267,6 +30321,7 @@ class QdDynamicFacetComponent {
|
|
|
30267
30321
|
this.ref = viewContainerRef.createComponent(facet);
|
|
30268
30322
|
this.ref.instance.facet = this.facet;
|
|
30269
30323
|
this.ref.instance.data = this.data;
|
|
30324
|
+
this.ref.instance.testId = this.testId;
|
|
30270
30325
|
}
|
|
30271
30326
|
ngOnChanges(changes) {
|
|
30272
30327
|
if (!this.component)
|
|
@@ -30275,9 +30330,11 @@ class QdDynamicFacetComponent {
|
|
|
30275
30330
|
this.component.facet = changes['facet'].currentValue;
|
|
30276
30331
|
if (changes['data'])
|
|
30277
30332
|
this.component.data = changes['data'].currentValue;
|
|
30333
|
+
if (changes['testId'])
|
|
30334
|
+
this.component.testId = changes['testId'].currentValue;
|
|
30278
30335
|
}
|
|
30279
30336
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdDynamicFacetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30280
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: QdDynamicFacetComponent, isStandalone: false, selector: "qd-dynamic-facet", inputs: { facet: "facet", data: "data" }, viewQueries: [{ propertyName: "dynamicFacet", first: true, predicate: QdDynamicFacetDirective, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template [qdDynamicFacet]></ng-template>\n", dependencies: [{ kind: "directive", type: QdDynamicFacetDirective, selector: "[qdDynamicFacet]" }] });
|
|
30337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: QdDynamicFacetComponent, isStandalone: false, selector: "qd-dynamic-facet", inputs: { facet: "facet", data: "data", testId: "testId" }, viewQueries: [{ propertyName: "dynamicFacet", first: true, predicate: QdDynamicFacetDirective, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template [qdDynamicFacet]></ng-template>\n", dependencies: [{ kind: "directive", type: QdDynamicFacetDirective, selector: "[qdDynamicFacet]" }] });
|
|
30281
30338
|
}
|
|
30282
30339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdDynamicFacetComponent, decorators: [{
|
|
30283
30340
|
type: Component,
|
|
@@ -30289,6 +30346,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
30289
30346
|
type: Input
|
|
30290
30347
|
}], data: [{
|
|
30291
30348
|
type: Input
|
|
30349
|
+
}], testId: [{
|
|
30350
|
+
type: Input
|
|
30292
30351
|
}] } });
|
|
30293
30352
|
|
|
30294
30353
|
/**
|
|
@@ -31257,11 +31316,11 @@ class QdPageObjectHeaderComponent {
|
|
|
31257
31316
|
});
|
|
31258
31317
|
}
|
|
31259
31318
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdPageObjectHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31260
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdPageObjectHeaderComponent, isStandalone: false, selector: "qd-page-object-header", inputs: { config: "config", hasNavigation: "hasNavigation", testId: ["data-test-id", "testId"] }, host: { listeners: { "click": "toggleFacets()" }, properties: { "style.borderBottom": "borderBottomStyle", "class.in-dialog": "this.isInDialog" } }, usesOnChanges: true, ngImport: i0, template: "@if (isLoading$ | async) {\n<div class=\"loading-overlay\"><qd-spinner></qd-spinner></div>\n}\n\n<div class=\"object-header-top\">\n <header class=\"object-header-title\">{{ config.title.i18n | translate }}</header>\n <div class=\"object-header-toolbar\">\n <ng-content></ng-content>\n\n <button class=\"button-icon\" data-test-id=\"archive-button\">\n @if (showArchive$ | async) {\n <qd-icon (click)=\"archiveButton?.handler()\" class=\"header-action-icon\" [icon]=\"'resultNew'\"></qd-icon>\n }\n </button>\n\n <button class=\"button-icon\" data-test-id=\"delete-button\">\n @if (showDelete$ | async) {\n <qd-icon class=\"header-action-icon\" (click)=\"deleteButton?.handler()\" [icon]=\"'trash'\"></qd-icon>\n }\n </button>\n\n @if (showEdit$ | async) {\n <button qdButton (click)=\"edit()\" data-test-id=\"edit-button\">\n {{ editButton?.label?.i18n || \"i18n.qd.page.header.edit\" | translate }}\n </button>\n } @if (showCancel$ | async) {\n <button qdButton qdButtonGhost (click)=\"cancel()\" data-test-id=\"cancel-button\">\n {{ cancelButton.label?.i18n || \"i18n.qd.page.header.cancel\" | translate }}\n </button>\n } @if (showSave$ | async) {\n <button qdButton (click)=\"save()\" data-test-id=\"save-button\" [disabled]=\"($canSave | async) === false\">\n {{ saveButton.label?.i18n || \"i18n.qd.page.header.save\" | translate }}\n </button>\n } @if (customActions$ | async; as customActions) { @if (!adaptiveMode) { @if (customActions.actions.length > 1) {\n <button [qdMenuButton]=\"customActions\" [autoSize]=\"false\" [data-test-id]=\"'page-'\" data-test-id=\"custom-button\">\n {{ config?.customActionsLabel?.i18n || \"i18n.qd.page.header.actions\" | translate }}\n </button>\n } @else { @if ((customActions$ | async).actions[0]; as singleAction) { @if (singleAction.handler &&\n !singleAction.isHidden) {\n <button qdButton [disabled]=\"singleAction.isDisabled\" (click)=\"singleAction.handler()\" data-test-id=\"custom-button\">\n {{ singleAction.label?.i18n | translate }}\n </button>\n } } } } @else { @if ((customActions$ | async)?.actions.length >= 1) {\n <button\n type=\"button\"\n class=\"adaptive-menu-button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMinWidth]=\"160\"\n >\n <qd-icon icon=\"overflowMenuVertical\"></qd-icon>\n </button>\n }\n <ng-template #menu>\n @for (action of customActions.actions; track action; let i = $index) {\n <button class=\"adaptive-menu-entry\" type=\"button\" [disabled]=\"action.isDisabled\" (click)=\"action.handler()\">\n {{ action.label.i18n | translate }}\n </button>\n }\n </ng-template>\n } }\n </div>\n</div>\n\n<div class=\"object-header-facets\" [ngClass]=\"{ amongThemselves: adaptiveMode && !facetsCollapsed }\">\n @if (pageObjectData$ | async; as data) { @for (facet of headerFacets | slice : 0 : (adaptiveMode && facetsCollapsed ?\n 2 : headerFacets?.length ?? 0); track facet) {\n <div class=\"object-header-facet\" [attr.data-test-id]=\"testId + '-facet-' + facet.name\">\n <div class=\"facet-label\">{{ facet.label.i18n | translate }}</div>\n <qd-dynamic-facet class=\"dynamic-facet\" [facet]=\"facet\" [data]=\"data\"></qd-dynamic-facet>\n </div>\n } } @if (!config.hideContexts && contexts$ | async; as contexts) { @for ( context of contexts | slice : 0 :\n (adaptiveMode && facetsCollapsed ? 2 - (headerFacets?.length ?? 0) : contexts?.length); track context; let index =\n $index; let first = $first) {\n <div\n class=\"object-header-facet\"\n [ngClass]=\"{ hasDivider: headerFacets && first, adaptiveFirst: headerFacets && adaptiveMode && first }\"\n [attr.data-test-id]=\"testId + '-context-facet-' + context.context.id\"\n >\n <div class=\"facet-label\">{{ context.label | translate }}</div>\n @if (context.value.length === 0) {\n <span class=\"no-selected-context\">{{ \"i18n.qd.page.context.noSelectionPlaceholder\" | translate }}</span>\n } @if (context.value.length !== 0) {\n <span>\n <qd-chip state=\"neutral\" [close]=\"isContextSelectable\" (closeClickEmitter)=\"clearContext(context.context)\">\n @for (val of context.value; track val; let last = $last) {\n {{ val.label.i18n | translate }}@if (!last) {\n <span>, </span>\n } }\n </qd-chip>\n </span>\n } @if (isContextSelectable && (!facetsCollapsed || !adaptiveMode)) {\n <span class=\"select-button\">\n <button\n qdButton\n qdButtonLink\n type=\"button\"\n (click)=\"changeContext(context.context, context.selection, $event)\"\n [data-test-id]=\"'object-header-select-context-' + context.context.id\"\n >\n {{\n context.value.length !== 0\n ? (\"i18n.qd.page.context.button.change\" | translate)\n : (\"i18n.qd.page.context.button.select\" | translate)\n }}\n </button>\n </span>\n }\n </div>\n } } @if (contexts$ | async; as togglerContexts) { @if (adaptiveMode && headerFacets?.length + togglerContexts.length >\n 2) {\n <span class=\"facets-toggler\" [attr.data-test-id]=\"testId + '-facets-toggler'\">\n @if (facetsCollapsed) {\n <span [attr.data-test-id]=\"testId + '-facets-toggler-count'\"\n >+{{ headerFacets.length + togglerContexts.length - 2 }}</span\n >\n }\n <button qdIconButton [data-test-id]=\"'toggle-button'\">\n <qd-icon [icon]=\"facetsCollapsed ? 'ctrlDown' : 'ctrlTop'\"></qd-icon>\n </button>\n </span>\n } }\n</div>\n", styles: [":host{display:flex;flex-direction:column;justify-content:space-between;padding:1.25rem;border-bottom:.125rem solid rgb(213,213,213);background:#fff;gap:1.25rem}@media(max-width:599.98px){:host{padding:1.25rem .9375rem}}:host .object-header-top{display:flex;align-items:flex-start;justify-content:space-between}:host .object-header-top .object-header-title{padding:2px;color:#171717;font-size:1.3125rem;font-weight:500}:host .object-header-top .object-header-toolbar{display:flex;align-items:center;column-gap:.5rem}:host .object-header-top .object-header-toolbar .button-icon{background:none}:host .object-header-top .object-header-toolbar .button-icon+.button-icon{margin-left:-.5rem}:host .object-header-top .object-header-toolbar .header-action-icon{color:#14516f;cursor:pointer;font-size:1.5rem}:host.in-dialog .object-header-toolbar{padding-right:2.5rem}:host .object-header-facets{position:relative;display:flex;flex-wrap:wrap;font-size:1.125rem;gap:1.25rem}:host .object-header-facets .object-header-facet{display:flex;min-width:3.75rem;flex-direction:column}:host .object-header-facets .object-header-facet.hasDivider{padding-left:1.25rem;border-left:.0625rem solid rgb(117,117,117)}:host .object-header-facets .object-header-facet.adaptiveFirst{padding-top:1.25rem}:host .object-header-facets .object-header-facet .facet-label{display:block;margin-bottom:0;color:#757575;font-size:.875rem;padding-bottom:.375rem;font-weight:500}:host .object-header-facets .facets-toggler{position:absolute;top:0;right:0;display:flex;align-items:center;padding-right:.3125rem;font-size:.625rem;line-height:.625rem}:host .object-header-facets.amongThemselves{display:grid}:host .object-header-facets.amongThemselves .object-header-facet.hasDivider{padding-left:0;border-top:.0625rem solid rgb(117,117,117);border-left:none}.loading-overlay{position:absolute;z-index:10000;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}.no-selected-context{height:1.625rem;color:#979797;font-size:.875rem;line-height:1.625rem}.select-button{margin-top:.25rem}.adaptive-menu-button{display:flex;background:unset;color:#454545;font-size:2rem}.adaptive-menu-button:hover,.adaptive-menu-button:focus{color:#000}.adaptive-menu-entry{display:block;overflow:hidden;width:100%;min-height:2.25rem;padding:0 1rem;background:#fff0;text-align:left;text-overflow:ellipsis;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdButtonComponent, selector: "button[qdButton], a[qdButton]", inputs: ["disabled", "color", "icon", "data-test-id", "additionalInfo"] }, { kind: "directive", type: QdButtonGhostDirective, selector: "button[qdButtonGhost], a[qdButtonGhost]" }, { kind: "directive", type: QdButtonLinkDirective, selector: "button[qdButtonLink], a[qdButtonLink]" }, { kind: "component", type: QdIconButtonComponent, selector: "button[qdIconButton], a[qdIconButton]", inputs: ["color", "data-test-id"] }, { kind: "component", type: QdMenuButtonComponent, selector: "button[qdMenuButton], a[qdMenuButton]", inputs: ["qdMenuButton", "data-test-id", "autoSize"] }, { kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "component", type: QdSpinnerComponent, selector: "qd-spinner" }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdDynamicFacetComponent, selector: "qd-dynamic-facet", inputs: ["facet", "data"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.SlicePipe, name: "slice" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
31319
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdPageObjectHeaderComponent, isStandalone: false, selector: "qd-page-object-header", inputs: { config: "config", hasNavigation: "hasNavigation", testId: ["data-test-id", "testId"] }, host: { listeners: { "click": "toggleFacets()" }, properties: { "style.borderBottom": "borderBottomStyle", "class.in-dialog": "this.isInDialog" } }, usesOnChanges: true, ngImport: i0, template: "@if (isLoading$ | async) {\n<div class=\"loading-overlay\"><qd-spinner></qd-spinner></div>\n}\n\n<div class=\"object-header-top\">\n <header class=\"object-header-title\">{{ config.title.i18n | translate }}</header>\n <div class=\"object-header-toolbar\">\n <ng-content></ng-content>\n\n <button class=\"button-icon\" data-test-id=\"archive-button\">\n @if (showArchive$ | async) {\n <qd-icon (click)=\"archiveButton?.handler()\" class=\"header-action-icon\" [icon]=\"'resultNew'\"></qd-icon>\n }\n </button>\n\n <button class=\"button-icon\" data-test-id=\"delete-button\">\n @if (showDelete$ | async) {\n <qd-icon class=\"header-action-icon\" (click)=\"deleteButton?.handler()\" [icon]=\"'trash'\"></qd-icon>\n }\n </button>\n\n @if (showEdit$ | async) {\n <button qdButton (click)=\"edit()\" data-test-id=\"edit-button\">\n {{ editButton?.label?.i18n || \"i18n.qd.page.header.edit\" | translate }}\n </button>\n } @if (showCancel$ | async) {\n <button qdButton qdButtonGhost (click)=\"cancel()\" data-test-id=\"cancel-button\">\n {{ cancelButton.label?.i18n || \"i18n.qd.page.header.cancel\" | translate }}\n </button>\n } @if (showSave$ | async) {\n <button qdButton (click)=\"save()\" data-test-id=\"save-button\" [disabled]=\"($canSave | async) === false\">\n {{ saveButton.label?.i18n || \"i18n.qd.page.header.save\" | translate }}\n </button>\n } @if (customActions$ | async; as customActions) { @if (!adaptiveMode) { @if (customActions.actions.length > 1) {\n <button [qdMenuButton]=\"customActions\" [autoSize]=\"false\" [data-test-id]=\"'page-'\" data-test-id=\"custom-button\">\n {{ config?.customActionsLabel?.i18n || \"i18n.qd.page.header.actions\" | translate }}\n </button>\n } @else { @if ((customActions$ | async).actions[0]; as singleAction) { @if (singleAction.handler &&\n !singleAction.isHidden) {\n <button qdButton [disabled]=\"singleAction.isDisabled\" (click)=\"singleAction.handler()\" data-test-id=\"custom-button\">\n {{ singleAction.label?.i18n | translate }}\n </button>\n } } } } @else { @if ((customActions$ | async)?.actions.length >= 1) {\n <button\n type=\"button\"\n class=\"adaptive-menu-button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMinWidth]=\"160\"\n >\n <qd-icon icon=\"overflowMenuVertical\"></qd-icon>\n </button>\n }\n <ng-template #menu>\n @for (action of customActions.actions; track action; let i = $index) {\n <button class=\"adaptive-menu-entry\" type=\"button\" [disabled]=\"action.isDisabled\" (click)=\"action.handler()\">\n {{ action.label.i18n | translate }}\n </button>\n }\n </ng-template>\n } }\n </div>\n</div>\n\n<div class=\"object-header-facets\" [ngClass]=\"{ amongThemselves: adaptiveMode && !facetsCollapsed }\">\n @if (pageObjectData$ | async; as data) { @for (facet of headerFacets | slice : 0 : (adaptiveMode && facetsCollapsed ?\n 2 : headerFacets?.length ?? 0); track facet) {\n <div class=\"object-header-facet\" [attr.data-test-id]=\"testId + '-facet-' + facet.name\">\n <div class=\"facet-label\">{{ facet.label.i18n | translate }}</div>\n <qd-dynamic-facet\n class=\"dynamic-facet\"\n [facet]=\"facet\"\n [data]=\"data\"\n [testId]=\"testId + '-facet-' + facet.name\"\n ></qd-dynamic-facet>\n </div>\n } } @if (!config.hideContexts && contexts$ | async; as contexts) { @for ( context of contexts | slice : 0 :\n (adaptiveMode && facetsCollapsed ? 2 - (headerFacets?.length ?? 0) : contexts?.length); track context; let index =\n $index; let first = $first) {\n <div\n class=\"object-header-facet\"\n [ngClass]=\"{ hasDivider: headerFacets && first, adaptiveFirst: headerFacets && adaptiveMode && first }\"\n [attr.data-test-id]=\"testId + '-context-facet-' + context.context.id\"\n >\n <div class=\"facet-label\">{{ context.label | translate }}</div>\n @if (context.value.length === 0) {\n <span class=\"no-selected-context\">{{ \"i18n.qd.page.context.noSelectionPlaceholder\" | translate }}</span>\n } @if (context.value.length !== 0) {\n <span>\n <qd-chip state=\"neutral\" [close]=\"isContextSelectable\" (closeClickEmitter)=\"clearContext(context.context)\">\n @for (val of context.value; track val; let last = $last) {\n {{ val.label.i18n | translate }}@if (!last) {\n <span>, </span>\n } }\n </qd-chip>\n </span>\n } @if (isContextSelectable && (!facetsCollapsed || !adaptiveMode)) {\n <span class=\"select-button\">\n <button\n qdButton\n qdButtonLink\n type=\"button\"\n (click)=\"changeContext(context.context, context.selection, $event)\"\n [data-test-id]=\"'object-header-select-context-' + context.context.id\"\n >\n {{\n context.value.length !== 0\n ? (\"i18n.qd.page.context.button.change\" | translate)\n : (\"i18n.qd.page.context.button.select\" | translate)\n }}\n </button>\n </span>\n }\n </div>\n } } @if (contexts$ | async; as togglerContexts) { @if (adaptiveMode && headerFacets?.length + togglerContexts.length >\n 2) {\n <span class=\"facets-toggler\" [attr.data-test-id]=\"testId + '-facets-toggler'\">\n @if (facetsCollapsed) {\n <span [attr.data-test-id]=\"testId + '-facets-toggler-count'\"\n >+{{ headerFacets.length + togglerContexts.length - 2 }}</span\n >\n }\n <button qdIconButton [data-test-id]=\"'toggle-button'\">\n <qd-icon [icon]=\"facetsCollapsed ? 'ctrlDown' : 'ctrlTop'\"></qd-icon>\n </button>\n </span>\n } }\n</div>\n", styles: [":host{display:flex;flex-direction:column;justify-content:space-between;padding:1.25rem;border-bottom:.125rem solid rgb(213,213,213);background:#fff;gap:1.25rem}@media(max-width:599.98px){:host{padding:1.25rem .9375rem}}:host .object-header-top{display:flex;align-items:flex-start;justify-content:space-between}:host .object-header-top .object-header-title{padding:2px;color:#171717;font-size:1.3125rem;font-weight:500}:host .object-header-top .object-header-toolbar{display:flex;align-items:center;column-gap:.5rem}:host .object-header-top .object-header-toolbar .button-icon{background:none}:host .object-header-top .object-header-toolbar .button-icon+.button-icon{margin-left:-.5rem}:host .object-header-top .object-header-toolbar .header-action-icon{color:#14516f;cursor:pointer;font-size:1.5rem}:host.in-dialog .object-header-toolbar{padding-right:2.5rem}:host .object-header-facets{position:relative;display:flex;flex-wrap:wrap;font-size:1.125rem;gap:1.25rem}:host .object-header-facets .object-header-facet{display:flex;min-width:3.75rem;flex-direction:column}:host .object-header-facets .object-header-facet.hasDivider{padding-left:1.25rem;border-left:.0625rem solid rgb(117,117,117)}:host .object-header-facets .object-header-facet.adaptiveFirst{padding-top:1.25rem}:host .object-header-facets .object-header-facet .facet-label{display:block;margin-bottom:0;color:#757575;font-size:.875rem;padding-bottom:.375rem;font-weight:500}:host .object-header-facets .facets-toggler{position:absolute;top:0;right:0;display:flex;align-items:center;padding-right:.3125rem;font-size:.625rem;line-height:.625rem}:host .object-header-facets.amongThemselves{display:grid}:host .object-header-facets.amongThemselves .object-header-facet.hasDivider{padding-left:0;border-top:.0625rem solid rgb(117,117,117);border-left:none}.loading-overlay{position:absolute;z-index:10000;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}.no-selected-context{height:1.625rem;color:#979797;font-size:.875rem;line-height:1.625rem}.select-button{margin-top:.25rem}.adaptive-menu-button{display:flex;background:unset;color:#454545;font-size:2rem}.adaptive-menu-button:hover,.adaptive-menu-button:focus{color:#000}.adaptive-menu-entry{display:block;overflow:hidden;width:100%;min-height:2.25rem;padding:0 1rem;background:#fff0;text-align:left;text-overflow:ellipsis;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdButtonComponent, selector: "button[qdButton], a[qdButton]", inputs: ["disabled", "color", "icon", "data-test-id", "additionalInfo"] }, { kind: "directive", type: QdButtonGhostDirective, selector: "button[qdButtonGhost], a[qdButtonGhost]" }, { kind: "directive", type: QdButtonLinkDirective, selector: "button[qdButtonLink], a[qdButtonLink]" }, { kind: "component", type: QdIconButtonComponent, selector: "button[qdIconButton], a[qdIconButton]", inputs: ["color", "data-test-id"] }, { kind: "component", type: QdMenuButtonComponent, selector: "button[qdMenuButton], a[qdMenuButton]", inputs: ["qdMenuButton", "data-test-id", "autoSize"] }, { kind: "component", type: QdChipComponent, selector: "qd-chip", inputs: ["state", "close", "data", "data-test-id"], outputs: ["closeClickEmitter"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { kind: "component", type: QdSpinnerComponent, selector: "qd-spinner" }, { kind: "directive", type: QdPopoverOnClickDirective, selector: "[qdPopoverOnClick]", inputs: ["qdPopoverOnClick", "qdPopoverPlacement", "qdPopoverOffsetX", "qdPopoverOffsetY", "qdPopoverCloseStrategy", "qdPopoverDisabled", "qdPopoverStopPropagation", "qdPopoverBackgroundColor", "qdPopoverMaxHeight", "qdPopoverMinWidth", "qdPopoverMaxWidth", "qdPopoverAutoSize", "qdPopoverEnableKeyControl", "qdPopoverRestoreFocus", "qdPopoverFlipIntoViewport"], outputs: ["opened", "closed"], exportAs: ["qdPopoverOnClick"] }, { kind: "component", type: QdDynamicFacetComponent, selector: "qd-dynamic-facet", inputs: ["facet", "data", "testId"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.SlicePipe, name: "slice" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
31261
31320
|
}
|
|
31262
31321
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdPageObjectHeaderComponent, decorators: [{
|
|
31263
31322
|
type: Component,
|
|
31264
|
-
args: [{ selector: 'qd-page-object-header', changeDetection: ChangeDetectionStrategy.OnPush, host: { '[style.borderBottom]': 'borderBottomStyle' }, standalone: false, template: "@if (isLoading$ | async) {\n<div class=\"loading-overlay\"><qd-spinner></qd-spinner></div>\n}\n\n<div class=\"object-header-top\">\n <header class=\"object-header-title\">{{ config.title.i18n | translate }}</header>\n <div class=\"object-header-toolbar\">\n <ng-content></ng-content>\n\n <button class=\"button-icon\" data-test-id=\"archive-button\">\n @if (showArchive$ | async) {\n <qd-icon (click)=\"archiveButton?.handler()\" class=\"header-action-icon\" [icon]=\"'resultNew'\"></qd-icon>\n }\n </button>\n\n <button class=\"button-icon\" data-test-id=\"delete-button\">\n @if (showDelete$ | async) {\n <qd-icon class=\"header-action-icon\" (click)=\"deleteButton?.handler()\" [icon]=\"'trash'\"></qd-icon>\n }\n </button>\n\n @if (showEdit$ | async) {\n <button qdButton (click)=\"edit()\" data-test-id=\"edit-button\">\n {{ editButton?.label?.i18n || \"i18n.qd.page.header.edit\" | translate }}\n </button>\n } @if (showCancel$ | async) {\n <button qdButton qdButtonGhost (click)=\"cancel()\" data-test-id=\"cancel-button\">\n {{ cancelButton.label?.i18n || \"i18n.qd.page.header.cancel\" | translate }}\n </button>\n } @if (showSave$ | async) {\n <button qdButton (click)=\"save()\" data-test-id=\"save-button\" [disabled]=\"($canSave | async) === false\">\n {{ saveButton.label?.i18n || \"i18n.qd.page.header.save\" | translate }}\n </button>\n } @if (customActions$ | async; as customActions) { @if (!adaptiveMode) { @if (customActions.actions.length > 1) {\n <button [qdMenuButton]=\"customActions\" [autoSize]=\"false\" [data-test-id]=\"'page-'\" data-test-id=\"custom-button\">\n {{ config?.customActionsLabel?.i18n || \"i18n.qd.page.header.actions\" | translate }}\n </button>\n } @else { @if ((customActions$ | async).actions[0]; as singleAction) { @if (singleAction.handler &&\n !singleAction.isHidden) {\n <button qdButton [disabled]=\"singleAction.isDisabled\" (click)=\"singleAction.handler()\" data-test-id=\"custom-button\">\n {{ singleAction.label?.i18n | translate }}\n </button>\n } } } } @else { @if ((customActions$ | async)?.actions.length >= 1) {\n <button\n type=\"button\"\n class=\"adaptive-menu-button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMinWidth]=\"160\"\n >\n <qd-icon icon=\"overflowMenuVertical\"></qd-icon>\n </button>\n }\n <ng-template #menu>\n @for (action of customActions.actions; track action; let i = $index) {\n <button class=\"adaptive-menu-entry\" type=\"button\" [disabled]=\"action.isDisabled\" (click)=\"action.handler()\">\n {{ action.label.i18n | translate }}\n </button>\n }\n </ng-template>\n } }\n </div>\n</div>\n\n<div class=\"object-header-facets\" [ngClass]=\"{ amongThemselves: adaptiveMode && !facetsCollapsed }\">\n @if (pageObjectData$ | async; as data) { @for (facet of headerFacets | slice : 0 : (adaptiveMode && facetsCollapsed ?\n 2 : headerFacets?.length ?? 0); track facet) {\n <div class=\"object-header-facet\" [attr.data-test-id]=\"testId + '-facet-' + facet.name\">\n <div class=\"facet-label\">{{ facet.label.i18n | translate }}</div>\n <qd-dynamic-facet
|
|
31323
|
+
args: [{ selector: 'qd-page-object-header', changeDetection: ChangeDetectionStrategy.OnPush, host: { '[style.borderBottom]': 'borderBottomStyle' }, standalone: false, template: "@if (isLoading$ | async) {\n<div class=\"loading-overlay\"><qd-spinner></qd-spinner></div>\n}\n\n<div class=\"object-header-top\">\n <header class=\"object-header-title\">{{ config.title.i18n | translate }}</header>\n <div class=\"object-header-toolbar\">\n <ng-content></ng-content>\n\n <button class=\"button-icon\" data-test-id=\"archive-button\">\n @if (showArchive$ | async) {\n <qd-icon (click)=\"archiveButton?.handler()\" class=\"header-action-icon\" [icon]=\"'resultNew'\"></qd-icon>\n }\n </button>\n\n <button class=\"button-icon\" data-test-id=\"delete-button\">\n @if (showDelete$ | async) {\n <qd-icon class=\"header-action-icon\" (click)=\"deleteButton?.handler()\" [icon]=\"'trash'\"></qd-icon>\n }\n </button>\n\n @if (showEdit$ | async) {\n <button qdButton (click)=\"edit()\" data-test-id=\"edit-button\">\n {{ editButton?.label?.i18n || \"i18n.qd.page.header.edit\" | translate }}\n </button>\n } @if (showCancel$ | async) {\n <button qdButton qdButtonGhost (click)=\"cancel()\" data-test-id=\"cancel-button\">\n {{ cancelButton.label?.i18n || \"i18n.qd.page.header.cancel\" | translate }}\n </button>\n } @if (showSave$ | async) {\n <button qdButton (click)=\"save()\" data-test-id=\"save-button\" [disabled]=\"($canSave | async) === false\">\n {{ saveButton.label?.i18n || \"i18n.qd.page.header.save\" | translate }}\n </button>\n } @if (customActions$ | async; as customActions) { @if (!adaptiveMode) { @if (customActions.actions.length > 1) {\n <button [qdMenuButton]=\"customActions\" [autoSize]=\"false\" [data-test-id]=\"'page-'\" data-test-id=\"custom-button\">\n {{ config?.customActionsLabel?.i18n || \"i18n.qd.page.header.actions\" | translate }}\n </button>\n } @else { @if ((customActions$ | async).actions[0]; as singleAction) { @if (singleAction.handler &&\n !singleAction.isHidden) {\n <button qdButton [disabled]=\"singleAction.isDisabled\" (click)=\"singleAction.handler()\" data-test-id=\"custom-button\">\n {{ singleAction.label?.i18n | translate }}\n </button>\n } } } } @else { @if ((customActions$ | async)?.actions.length >= 1) {\n <button\n type=\"button\"\n class=\"adaptive-menu-button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverMinWidth]=\"160\"\n >\n <qd-icon icon=\"overflowMenuVertical\"></qd-icon>\n </button>\n }\n <ng-template #menu>\n @for (action of customActions.actions; track action; let i = $index) {\n <button class=\"adaptive-menu-entry\" type=\"button\" [disabled]=\"action.isDisabled\" (click)=\"action.handler()\">\n {{ action.label.i18n | translate }}\n </button>\n }\n </ng-template>\n } }\n </div>\n</div>\n\n<div class=\"object-header-facets\" [ngClass]=\"{ amongThemselves: adaptiveMode && !facetsCollapsed }\">\n @if (pageObjectData$ | async; as data) { @for (facet of headerFacets | slice : 0 : (adaptiveMode && facetsCollapsed ?\n 2 : headerFacets?.length ?? 0); track facet) {\n <div class=\"object-header-facet\" [attr.data-test-id]=\"testId + '-facet-' + facet.name\">\n <div class=\"facet-label\">{{ facet.label.i18n | translate }}</div>\n <qd-dynamic-facet\n class=\"dynamic-facet\"\n [facet]=\"facet\"\n [data]=\"data\"\n [testId]=\"testId + '-facet-' + facet.name\"\n ></qd-dynamic-facet>\n </div>\n } } @if (!config.hideContexts && contexts$ | async; as contexts) { @for ( context of contexts | slice : 0 :\n (adaptiveMode && facetsCollapsed ? 2 - (headerFacets?.length ?? 0) : contexts?.length); track context; let index =\n $index; let first = $first) {\n <div\n class=\"object-header-facet\"\n [ngClass]=\"{ hasDivider: headerFacets && first, adaptiveFirst: headerFacets && adaptiveMode && first }\"\n [attr.data-test-id]=\"testId + '-context-facet-' + context.context.id\"\n >\n <div class=\"facet-label\">{{ context.label | translate }}</div>\n @if (context.value.length === 0) {\n <span class=\"no-selected-context\">{{ \"i18n.qd.page.context.noSelectionPlaceholder\" | translate }}</span>\n } @if (context.value.length !== 0) {\n <span>\n <qd-chip state=\"neutral\" [close]=\"isContextSelectable\" (closeClickEmitter)=\"clearContext(context.context)\">\n @for (val of context.value; track val; let last = $last) {\n {{ val.label.i18n | translate }}@if (!last) {\n <span>, </span>\n } }\n </qd-chip>\n </span>\n } @if (isContextSelectable && (!facetsCollapsed || !adaptiveMode)) {\n <span class=\"select-button\">\n <button\n qdButton\n qdButtonLink\n type=\"button\"\n (click)=\"changeContext(context.context, context.selection, $event)\"\n [data-test-id]=\"'object-header-select-context-' + context.context.id\"\n >\n {{\n context.value.length !== 0\n ? (\"i18n.qd.page.context.button.change\" | translate)\n : (\"i18n.qd.page.context.button.select\" | translate)\n }}\n </button>\n </span>\n }\n </div>\n } } @if (contexts$ | async; as togglerContexts) { @if (adaptiveMode && headerFacets?.length + togglerContexts.length >\n 2) {\n <span class=\"facets-toggler\" [attr.data-test-id]=\"testId + '-facets-toggler'\">\n @if (facetsCollapsed) {\n <span [attr.data-test-id]=\"testId + '-facets-toggler-count'\"\n >+{{ headerFacets.length + togglerContexts.length - 2 }}</span\n >\n }\n <button qdIconButton [data-test-id]=\"'toggle-button'\">\n <qd-icon [icon]=\"facetsCollapsed ? 'ctrlDown' : 'ctrlTop'\"></qd-icon>\n </button>\n </span>\n } }\n</div>\n", styles: [":host{display:flex;flex-direction:column;justify-content:space-between;padding:1.25rem;border-bottom:.125rem solid rgb(213,213,213);background:#fff;gap:1.25rem}@media(max-width:599.98px){:host{padding:1.25rem .9375rem}}:host .object-header-top{display:flex;align-items:flex-start;justify-content:space-between}:host .object-header-top .object-header-title{padding:2px;color:#171717;font-size:1.3125rem;font-weight:500}:host .object-header-top .object-header-toolbar{display:flex;align-items:center;column-gap:.5rem}:host .object-header-top .object-header-toolbar .button-icon{background:none}:host .object-header-top .object-header-toolbar .button-icon+.button-icon{margin-left:-.5rem}:host .object-header-top .object-header-toolbar .header-action-icon{color:#14516f;cursor:pointer;font-size:1.5rem}:host.in-dialog .object-header-toolbar{padding-right:2.5rem}:host .object-header-facets{position:relative;display:flex;flex-wrap:wrap;font-size:1.125rem;gap:1.25rem}:host .object-header-facets .object-header-facet{display:flex;min-width:3.75rem;flex-direction:column}:host .object-header-facets .object-header-facet.hasDivider{padding-left:1.25rem;border-left:.0625rem solid rgb(117,117,117)}:host .object-header-facets .object-header-facet.adaptiveFirst{padding-top:1.25rem}:host .object-header-facets .object-header-facet .facet-label{display:block;margin-bottom:0;color:#757575;font-size:.875rem;padding-bottom:.375rem;font-weight:500}:host .object-header-facets .facets-toggler{position:absolute;top:0;right:0;display:flex;align-items:center;padding-right:.3125rem;font-size:.625rem;line-height:.625rem}:host .object-header-facets.amongThemselves{display:grid}:host .object-header-facets.amongThemselves .object-header-facet.hasDivider{padding-left:0;border-top:.0625rem solid rgb(117,117,117);border-left:none}.loading-overlay{position:absolute;z-index:10000;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}.no-selected-context{height:1.625rem;color:#979797;font-size:.875rem;line-height:1.625rem}.select-button{margin-top:.25rem}.adaptive-menu-button{display:flex;background:unset;color:#454545;font-size:2rem}.adaptive-menu-button:hover,.adaptive-menu-button:focus{color:#000}.adaptive-menu-entry{display:block;overflow:hidden;width:100%;min-height:2.25rem;padding:0 1rem;background:#fff0;text-align:left;text-overflow:ellipsis;white-space:nowrap}\n"] }]
|
|
31265
31324
|
}], propDecorators: { config: [{
|
|
31266
31325
|
type: Input,
|
|
31267
31326
|
args: [{ required: true }]
|