@quadrel-enterprise-ui/framework 21.12.21 → 21.12.23
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 +74 -5
- package/fesm2022/quadrel-enterprise-ui-framework.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/i18n/de.json +2 -1
- 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 +20 -0
|
@@ -6260,6 +6260,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
6260
6260
|
class QdDataFacetsLinkComponent {
|
|
6261
6261
|
contextService = inject(QdDataFacetsContextService, { optional: true });
|
|
6262
6262
|
actionService = inject(QdTableExternalActionResultService, { optional: true });
|
|
6263
|
+
_destroyRef = inject(DestroyRef);
|
|
6263
6264
|
config;
|
|
6264
6265
|
data;
|
|
6265
6266
|
testId;
|
|
@@ -6286,6 +6287,8 @@ class QdDataFacetsLinkComponent {
|
|
|
6286
6287
|
if (!isObservable(result))
|
|
6287
6288
|
return;
|
|
6288
6289
|
result.subscribe(success => {
|
|
6290
|
+
if (this._destroyRef.destroyed)
|
|
6291
|
+
return;
|
|
6289
6292
|
const shouldRefresh = success === true && this.config.refresh?.isEnabled;
|
|
6290
6293
|
if (shouldRefresh)
|
|
6291
6294
|
this.actionService?.notifyActionSuccess(this.config.refresh?.page ?? 0);
|
|
@@ -22555,13 +22558,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
22555
22558
|
// @ts-strict-ignore
|
|
22556
22559
|
class QdFilterCategoryBooleanComponent {
|
|
22557
22560
|
filterService = inject(QdFilterService);
|
|
22561
|
+
_destroyRef = inject(DestroyRef);
|
|
22558
22562
|
filterId;
|
|
22559
22563
|
categoryIndex;
|
|
22560
22564
|
testId;
|
|
22561
22565
|
itemIndex = 0;
|
|
22562
22566
|
i18n;
|
|
22563
22567
|
ngOnInit() {
|
|
22564
|
-
this.filterService
|
|
22568
|
+
this.filterService
|
|
22569
|
+
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
22570
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
22571
|
+
.subscribe(item => {
|
|
22565
22572
|
this.i18n = item.i18n;
|
|
22566
22573
|
});
|
|
22567
22574
|
}
|
|
@@ -23552,6 +23559,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
23552
23559
|
class QdFilterCategoryComponent {
|
|
23553
23560
|
filterService = inject(QdFilterService);
|
|
23554
23561
|
translateService = inject(TranslateService);
|
|
23562
|
+
_destroyRef = inject(DestroyRef);
|
|
23555
23563
|
filterId;
|
|
23556
23564
|
isInstantFiltering;
|
|
23557
23565
|
categoryIndex;
|
|
@@ -23572,7 +23580,10 @@ class QdFilterCategoryComponent {
|
|
|
23572
23580
|
return this.testId;
|
|
23573
23581
|
}
|
|
23574
23582
|
ngOnInit() {
|
|
23575
|
-
this.filterService
|
|
23583
|
+
this.filterService
|
|
23584
|
+
.getCategoryById$(this.filterId, this.categoryIndex)
|
|
23585
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
23586
|
+
.subscribe(category => {
|
|
23576
23587
|
this.type = category.type;
|
|
23577
23588
|
});
|
|
23578
23589
|
}
|
|
@@ -33553,6 +33564,8 @@ class QdPageStepperComponent extends CdkStepper {
|
|
|
33553
33564
|
}
|
|
33554
33565
|
resolve$
|
|
33555
33566
|
.pipe(tap(() => {
|
|
33567
|
+
if (this._destroyRef.destroyed)
|
|
33568
|
+
return;
|
|
33556
33569
|
this.next();
|
|
33557
33570
|
this.isGoingToNextStep = false;
|
|
33558
33571
|
}), catchError(() => {
|
|
@@ -33624,7 +33637,10 @@ class QdPageStepperComponent extends CdkStepper {
|
|
|
33624
33637
|
// TODO: Remove this with Angular 18 as the amazing Angular team finally brings a fix for this issue
|
|
33625
33638
|
// see also https://github.com/angular/angular/issues/41519
|
|
33626
33639
|
if (status === 'PENDING')
|
|
33627
|
-
setTimeout(() =>
|
|
33640
|
+
setTimeout(() => {
|
|
33641
|
+
if (!this._destroyRef.destroyed)
|
|
33642
|
+
this.selected?.stepControl?.updateValueAndValidity();
|
|
33643
|
+
}, 500);
|
|
33628
33644
|
}), map(status => status === 'VALID'));
|
|
33629
33645
|
}
|
|
33630
33646
|
areAllStepsValid$() {
|
|
@@ -38112,6 +38128,7 @@ class QdQuickEditComponent {
|
|
|
38112
38128
|
controlContainer = inject(ControlContainer, { optional: true, self: true });
|
|
38113
38129
|
confirmationDialogService = inject(QdConfirmationDialogOpenerService);
|
|
38114
38130
|
_destroyRef = inject(DestroyRef);
|
|
38131
|
+
_document = inject(DOCUMENT);
|
|
38115
38132
|
/**
|
|
38116
38133
|
* Configuration of the QuickEdit. The generic type names the columns.
|
|
38117
38134
|
*
|
|
@@ -38206,6 +38223,10 @@ class QdQuickEditComponent {
|
|
|
38206
38223
|
return this.controlContainer != null;
|
|
38207
38224
|
}
|
|
38208
38225
|
togglerDrawing = false;
|
|
38226
|
+
openRowMenuIndex = null;
|
|
38227
|
+
static _rowMenuIdCounter = 0;
|
|
38228
|
+
_rowMenuIdPrefix = `qd-quick-edit-row-menu-${QdQuickEditComponent._rowMenuIdCounter++}`;
|
|
38229
|
+
_isOpeningRowMenuByKeyboard = false;
|
|
38209
38230
|
constructor() {
|
|
38210
38231
|
if (!this.isFormControl) {
|
|
38211
38232
|
this.quickEditFormGroup = this.fb.group({
|
|
@@ -38250,6 +38271,37 @@ class QdQuickEditComponent {
|
|
|
38250
38271
|
const selectedRowData = this.controlContainer?.control?.controls[rowIndex].value ?? this.rows.value[rowIndex];
|
|
38251
38272
|
action.handler(selectedRowData);
|
|
38252
38273
|
}
|
|
38274
|
+
rowMenuId(rowIndex) {
|
|
38275
|
+
return `${this._rowMenuIdPrefix}-${rowIndex}`;
|
|
38276
|
+
}
|
|
38277
|
+
markRowMenuOpeningByKeyboard(rowIndex) {
|
|
38278
|
+
if (this.openRowMenuIndex !== rowIndex)
|
|
38279
|
+
this._isOpeningRowMenuByKeyboard = true;
|
|
38280
|
+
}
|
|
38281
|
+
openRowMenu(rowIndex) {
|
|
38282
|
+
this.openRowMenuIndex = rowIndex;
|
|
38283
|
+
if (!this._isOpeningRowMenuByKeyboard)
|
|
38284
|
+
return;
|
|
38285
|
+
this._isOpeningRowMenuByKeyboard = false;
|
|
38286
|
+
this.rowMenuItems(this._document.getElementById(this.rowMenuId(rowIndex)))[0]?.focus();
|
|
38287
|
+
}
|
|
38288
|
+
closeRowMenu() {
|
|
38289
|
+
this.openRowMenuIndex = null;
|
|
38290
|
+
this._isOpeningRowMenuByKeyboard = false;
|
|
38291
|
+
}
|
|
38292
|
+
handleRowMenuKeydown(event, popover) {
|
|
38293
|
+
if (event.key === 'Tab') {
|
|
38294
|
+
event.preventDefault();
|
|
38295
|
+
popover.close();
|
|
38296
|
+
return;
|
|
38297
|
+
}
|
|
38298
|
+
const items = this.rowMenuItems(event.currentTarget);
|
|
38299
|
+
const nextItem = this.rowMenuItemForKey(event.key, items, items.indexOf(event.target));
|
|
38300
|
+
if (!nextItem)
|
|
38301
|
+
return;
|
|
38302
|
+
event.preventDefault();
|
|
38303
|
+
nextItem.focus();
|
|
38304
|
+
}
|
|
38253
38305
|
/**
|
|
38254
38306
|
* Maps a column type onto a facet component.
|
|
38255
38307
|
*
|
|
@@ -38374,17 +38426,34 @@ class QdQuickEditComponent {
|
|
|
38374
38426
|
const currentMode = isViewonly ? 'view' : 'edit';
|
|
38375
38427
|
return actions.filter(action => !action.operationMode || action.operationMode === currentMode);
|
|
38376
38428
|
}
|
|
38429
|
+
rowMenuItems(menu) {
|
|
38430
|
+
return Array.from(menu?.querySelectorAll('[role="menuitem"]:not([disabled])') ?? []);
|
|
38431
|
+
}
|
|
38432
|
+
rowMenuItemForKey(key, items, index) {
|
|
38433
|
+
switch (key) {
|
|
38434
|
+
case 'ArrowDown':
|
|
38435
|
+
return items[(index + 1) % items.length];
|
|
38436
|
+
case 'ArrowUp':
|
|
38437
|
+
return items[index > 0 ? index - 1 : items.length - 1];
|
|
38438
|
+
case 'Home':
|
|
38439
|
+
return items[0];
|
|
38440
|
+
case 'End':
|
|
38441
|
+
return items[items.length - 1];
|
|
38442
|
+
default:
|
|
38443
|
+
return undefined;
|
|
38444
|
+
}
|
|
38445
|
+
}
|
|
38377
38446
|
initManualChangeDetectionForControlReset() {
|
|
38378
38447
|
if (!this.isFormControl)
|
|
38379
38448
|
return;
|
|
38380
38449
|
this.controlContainer.control.valueChanges.pipe(takeUntilDestroyed(this._destroyRef), tap(() => this.changeDetectorRef.detectChanges())).subscribe();
|
|
38381
38450
|
}
|
|
38382
38451
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdQuickEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
38383
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdQuickEditComponent, isStandalone: false, selector: "qd-quick-edit", inputs: { config: "config", data: "data", testId: ["data-test-id", "testId"] }, outputs: { formGroupChange: "formGroupChange", addNewClicked: "addNewClicked" }, viewQueries: [{ propertyName: "customForDirective", first: true, predicate: QdCustomForDirective, descendants: true }, { propertyName: "focusables", predicate: QdFocusableDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (showStandaloneCreate) {\n<div class=\"editable-actions\">\n <button qdButton qdButtonGhost icon=\"plus\" (click)=\"createRow()\" [data-test-id]=\"testId + '-button-add-new'\">\n {{ config.standaloneCreateLabel?.i18n ?? \"i18n.qd.quick.edit.createButtonLabel\" | translate }}\n </button>\n</div>\n}\n\n<div class=\"table\" [formGroup]=\"control\">\n @if (!config.canAdd || templateData.length > 0 || config.emptyStateView) {\n <div class=\"table-header\">\n <div class=\"table-row\">\n @for (header of visibleColumns; track header) {\n <div class=\"table-cell\">\n {{ header?.i18n | translate }}\n <qd-tooltip-icon [tooltip]=\"header?.tooltip\"></qd-tooltip-icon>\n </div>\n } @if (hasVisibleActions$ | async) {\n <div class=\"table-cell actions-column\">\n <button class=\"menu-button\">\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"table-body\">\n <div\n class=\"table-row\"\n *qdCustomFor=\"let row of templateData; let rowIndex = index; toggler: togglerDrawing\"\n [formGroupName]=\"rowIndex\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex\"\n >\n @for (column of visibleColumns; track trackByColumnName($index, column)) {\n <div class=\"table-cell\">\n @if (column.type === 'enum') {\n <qd-dropdown\n [config]=\"{\n filter: column.filter,\n options: column.options,\n placeholder: column.placeholder,\n placeholderPrefix: column.placeholderPrefix,\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n [data-test-id]=\"column.name + rowIndex\"\n [dense]=\"true\"\n [formControl]=\"$any(control.controls[rowIndex])?.controls[column.name]\"\n qdFocusable\n class=\"dropdown\"\n >\n </qd-dropdown>\n } @else { @if ($any(control.controls[rowIndex])?.controls[column.name]) {\n <qd-input\n [data-test-id]=\"column.name + rowIndex\"\n [formControlName]=\"column.name\"\n [config]=\"{\n inputType: column.type === 'integer' ? 'number' : 'text',\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n qdFocusable\n ></qd-input>\n } }\n </div>\n } @if (hasVisibleActions$ | async) {\n <td class=\"table-cell actions\" [attr.data-test-id]=\"testId + '-cell-inline-actions'\">\n <button\n type=\"button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n class=\"menu-button\"\n data-test=\"secondary-actions-toggler\"\n >\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n <ng-template #menu>\n @for (secondaryAction of actions$ | async; track secondaryAction) {\n <button\n class=\"secondary-actions\"\n [ngClass]=\"{ disabled: isActionDisabled(secondaryAction, row) }\"\n [attr.disabled]=\"isActionDisabled(secondaryAction, row) || null\"\n (click)=\"handleSecondaryAction(secondaryAction, rowIndex)\"\n >\n {{ secondaryAction.label.i18n | translate }}\n </button>\n } @if (canAdd && (viewonly$ | async) === false) {\n <button class=\"secondary-actions\" (click)=\"removeRow(rowIndex)\">\n {{ \"i18n.qd.quick.edit.removeButtonLabel\" | translate }}\n </button>\n }\n </ng-template>\n </td>\n }\n </div>\n </div>\n @if (config.emptyStateView && !config.emptyStateView.disabled && templateData.length === 0) {\n <div class=\"empty-body\">\n <p>{{ config.emptyStateView.i18n | translate }}</p>\n </div>\n }\n</div>\n", styles: [".table{display:flex;width:100%;flex-direction:column;margin:1.25rem auto;background-color:#fff;font-size:.875rem}.table ::ng-deep .qd-input-input{margin-bottom:0!important}.table-header .table-row{padding-top:.125rem;padding-bottom:.125rem;background-color:#e5e5e5;font-weight:700}.table-header .table-row .actions-column{visibility:hidden}.table-header,.table-body{display:flex;flex-direction:column}.table-row{display:flex;flex-direction:row;padding:.25rem 1rem;border-bottom:.0625rem solid rgb(213,213,213);gap:1rem}.table-row ::ng-deep qd-form-label{display:none!important}.table-row ::ng-deep qd-input{min-width:0;margin-bottom:0!important}.table-body .table-row:hover{background-color:#f5f5f5}.table-cell{display:flex;min-width:0;height:2.3125rem;flex:1;align-items:center;text-align:left}.table-cell:has(.qd-input-error),.table-cell:has(.qd-dropdown-error){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input{position:relative}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input .qd-input-character-counter{position:absolute;right:.25rem;bottom:.125rem;font-size:.625rem;line-height:1;pointer-events:none}.table-cell.actions,.table-cell.actions-column{min-width:auto;flex:0 0 auto}.table-row:last-child{border-bottom:none}.editable-actions{display:flex;justify-content:flex-end;margin-right:.625rem;gap:.625rem}.menu-button{display:flex;padding:0 .625rem 0 .375rem;background:unset;color:#454545;font-size:2rem;vertical-align:middle}.menu-button:hover,.menu-button:focus{color:#000;outline:0!important}.secondary-actions{display:block;width:100%;min-height:2rem;padding:0 1rem;background:#fff0;font-size:.75rem;text-align:left}.secondary-actions:hover{background-color:#f2f7fa}.secondary-actions.disabled{color:#b4b4b4;cursor:not-allowed}.secondary-actions.disabled:hover{background-color:#fff0}.dropdown{width:100%;min-width:0}.empty-body{padding:1.5rem;background:#fff}.empty-body p{margin:0 0 .5rem}\n"], dependencies: [{ 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: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdDropdownComponent, selector: "qd-dropdown", inputs: ["value", "id", "formControlName", "config", "data-test-id", "qdPopoverMaxHeight", "dense"], outputs: ["valueChange", "enterClick", "dropdownOpened", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { 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: "directive", type: QdFocusableDirective, selector: "[qdFocusable]" }, { kind: "component", type: QdTooltipIconComponent, selector: "qd-tooltip-icon", inputs: ["tooltip"] }, { kind: "directive", type: QdCustomForDirective, selector: "[qdCustomFor]", inputs: ["qdCustomForOf", "qdCustomForToggler"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
38452
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: QdQuickEditComponent, isStandalone: false, selector: "qd-quick-edit", inputs: { config: "config", data: "data", testId: ["data-test-id", "testId"] }, outputs: { formGroupChange: "formGroupChange", addNewClicked: "addNewClicked" }, viewQueries: [{ propertyName: "customForDirective", first: true, predicate: QdCustomForDirective, descendants: true }, { propertyName: "focusables", predicate: QdFocusableDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (showStandaloneCreate) {\n<div class=\"editable-actions\">\n <button qdButton qdButtonGhost icon=\"plus\" (click)=\"createRow()\" [data-test-id]=\"testId + '-button-add-new'\">\n {{ config.standaloneCreateLabel?.i18n ?? \"i18n.qd.quick.edit.createButtonLabel\" | translate }}\n </button>\n</div>\n}\n\n<div class=\"table\" [formGroup]=\"control\">\n @if (!config.canAdd || templateData.length > 0 || config.emptyStateView) {\n <div class=\"table-header\">\n <div class=\"table-row\">\n @for (header of visibleColumns; track header) {\n <div class=\"table-cell\">\n {{ header?.i18n | translate }}\n <qd-tooltip-icon [tooltip]=\"header?.tooltip\"></qd-tooltip-icon>\n </div>\n } @if (hasVisibleActions$ | async) {\n <div class=\"table-cell actions-column\">\n <button class=\"menu-button\">\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"table-body\">\n <div\n class=\"table-row\"\n *qdCustomFor=\"let row of templateData; let rowIndex = index; toggler: togglerDrawing\"\n [formGroupName]=\"rowIndex\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex\"\n >\n @for (column of visibleColumns; track trackByColumnName($index, column)) {\n <div class=\"table-cell\">\n @if (column.type === 'enum') {\n <qd-dropdown\n [config]=\"{\n filter: column.filter,\n options: column.options,\n placeholder: column.placeholder,\n placeholderPrefix: column.placeholderPrefix,\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n [data-test-id]=\"column.name + rowIndex\"\n [dense]=\"true\"\n [formControl]=\"$any(control.controls[rowIndex])?.controls[column.name]\"\n qdFocusable\n class=\"dropdown\"\n >\n </qd-dropdown>\n } @else { @if ($any(control.controls[rowIndex])?.controls[column.name]) {\n <qd-input\n [data-test-id]=\"column.name + rowIndex\"\n [formControlName]=\"column.name\"\n [config]=\"{\n inputType: column.type === 'integer' ? 'number' : 'text',\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n qdFocusable\n ></qd-input>\n } }\n </div>\n } @if (hasVisibleActions$ | async) {\n <td class=\"table-cell actions\" [attr.data-test-id]=\"testId + '-cell-inline-actions'\">\n <button\n type=\"button\"\n #rowMenuToggler=\"qdPopoverOnClick\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n (keydown.enter)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (keydown.space)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (opened)=\"openRowMenu(rowIndex)\"\n (closed)=\"closeRowMenu()\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"openRowMenuIndex === rowIndex\"\n [attr.aria-controls]=\"openRowMenuIndex === rowIndex ? rowMenuId(rowIndex) : null\"\n class=\"menu-button\"\n data-test=\"secondary-actions-toggler\"\n >\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n <ng-template #menu>\n <div\n role=\"menu\"\n [id]=\"rowMenuId(rowIndex)\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n (keydown)=\"handleRowMenuKeydown($event, rowMenuToggler)\"\n >\n @for (secondaryAction of actions$ | async; track secondaryAction) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [ngClass]=\"{ disabled: isActionDisabled(secondaryAction, row) }\"\n [attr.disabled]=\"isActionDisabled(secondaryAction, row) || null\"\n (click)=\"handleSecondaryAction(secondaryAction, rowIndex)\"\n >\n {{ secondaryAction.label.i18n | translate }}\n </button>\n } @if (canAdd && (viewonly$ | async) === false) {\n <button role=\"menuitem\" tabindex=\"-1\" class=\"secondary-actions\" (click)=\"removeRow(rowIndex)\">\n {{ \"i18n.qd.quick.edit.removeButtonLabel\" | translate }}\n </button>\n }\n </div>\n </ng-template>\n </td>\n }\n </div>\n </div>\n @if (config.emptyStateView && !config.emptyStateView.disabled && templateData.length === 0) {\n <div class=\"empty-body\">\n <p>{{ config.emptyStateView.i18n | translate }}</p>\n </div>\n }\n</div>\n", styles: [".table{display:flex;width:100%;flex-direction:column;margin:1.25rem auto;background-color:#fff;font-size:.875rem}.table ::ng-deep .qd-input-input{margin-bottom:0!important}.table-header .table-row{padding-top:.125rem;padding-bottom:.125rem;background-color:#e5e5e5;font-weight:700}.table-header .table-row .actions-column{visibility:hidden}.table-header,.table-body{display:flex;flex-direction:column}.table-row{display:flex;flex-direction:row;padding:.25rem 1rem;border-bottom:.0625rem solid rgb(213,213,213);gap:1rem}.table-row ::ng-deep qd-form-label{display:none!important}.table-row ::ng-deep qd-input{min-width:0;margin-bottom:0!important}.table-body .table-row:hover{background-color:#f5f5f5}.table-cell{display:flex;min-width:0;height:2.3125rem;flex:1;align-items:center;text-align:left}.table-cell:has(.qd-input-error),.table-cell:has(.qd-dropdown-error){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input{position:relative}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input .qd-input-character-counter{position:absolute;right:.25rem;bottom:.125rem;font-size:.625rem;line-height:1;pointer-events:none}.table-cell.actions,.table-cell.actions-column{min-width:auto;flex:0 0 auto}.table-row:last-child{border-bottom:none}.editable-actions{display:flex;justify-content:flex-end;margin-right:.625rem;gap:.625rem}.menu-button{display:flex;padding:0 .625rem 0 .375rem;background:unset;color:#454545;font-size:2rem;vertical-align:middle}.menu-button:hover,.menu-button:focus{color:#000;outline:0!important}.secondary-actions{display:block;width:100%;min-height:2rem;padding:0 1rem;background:#fff0;font-size:.75rem;text-align:left}.secondary-actions:hover,.secondary-actions:focus-visible{background-color:#f2f7fa}.secondary-actions.disabled{color:#b4b4b4;cursor:not-allowed}.secondary-actions.disabled:hover{background-color:#fff0}.dropdown{width:100%;min-width:0}.empty-body{padding:1.5rem;background:#fff}.empty-body p{margin:0 0 .5rem}\n"], dependencies: [{ 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: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: QdDropdownComponent, selector: "qd-dropdown", inputs: ["value", "id", "formControlName", "config", "data-test-id", "qdPopoverMaxHeight", "dense"], outputs: ["valueChange", "enterClick", "dropdownOpened", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "component", type: QdInputComponent, selector: "qd-input", inputs: ["formControlName", "value", "config", "isError", "data-test-id"], outputs: ["valueChange", "enterClick", "clickClear", "clickHint", "clickReadonly", "clickViewonly", "optionsResolved"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }, { 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: "directive", type: QdFocusableDirective, selector: "[qdFocusable]" }, { kind: "component", type: QdTooltipIconComponent, selector: "qd-tooltip-icon", inputs: ["tooltip"] }, { kind: "directive", type: QdCustomForDirective, selector: "[qdCustomFor]", inputs: ["qdCustomForOf", "qdCustomForToggler"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
38384
38453
|
}
|
|
38385
38454
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdQuickEditComponent, decorators: [{
|
|
38386
38455
|
type: Component,
|
|
38387
|
-
args: [{ selector: 'qd-quick-edit', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if (showStandaloneCreate) {\n<div class=\"editable-actions\">\n <button qdButton qdButtonGhost icon=\"plus\" (click)=\"createRow()\" [data-test-id]=\"testId + '-button-add-new'\">\n {{ config.standaloneCreateLabel?.i18n ?? \"i18n.qd.quick.edit.createButtonLabel\" | translate }}\n </button>\n</div>\n}\n\n<div class=\"table\" [formGroup]=\"control\">\n @if (!config.canAdd || templateData.length > 0 || config.emptyStateView) {\n <div class=\"table-header\">\n <div class=\"table-row\">\n @for (header of visibleColumns; track header) {\n <div class=\"table-cell\">\n {{ header?.i18n | translate }}\n <qd-tooltip-icon [tooltip]=\"header?.tooltip\"></qd-tooltip-icon>\n </div>\n } @if (hasVisibleActions$ | async) {\n <div class=\"table-cell actions-column\">\n <button class=\"menu-button\">\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"table-body\">\n <div\n class=\"table-row\"\n *qdCustomFor=\"let row of templateData; let rowIndex = index; toggler: togglerDrawing\"\n [formGroupName]=\"rowIndex\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex\"\n >\n @for (column of visibleColumns; track trackByColumnName($index, column)) {\n <div class=\"table-cell\">\n @if (column.type === 'enum') {\n <qd-dropdown\n [config]=\"{\n filter: column.filter,\n options: column.options,\n placeholder: column.placeholder,\n placeholderPrefix: column.placeholderPrefix,\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n [data-test-id]=\"column.name + rowIndex\"\n [dense]=\"true\"\n [formControl]=\"$any(control.controls[rowIndex])?.controls[column.name]\"\n qdFocusable\n class=\"dropdown\"\n >\n </qd-dropdown>\n } @else { @if ($any(control.controls[rowIndex])?.controls[column.name]) {\n <qd-input\n [data-test-id]=\"column.name + rowIndex\"\n [formControlName]=\"column.name\"\n [config]=\"{\n inputType: column.type === 'integer' ? 'number' : 'text',\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n qdFocusable\n ></qd-input>\n } }\n </div>\n } @if (hasVisibleActions$ | async) {\n <td class=\"table-cell actions\" [attr.data-test-id]=\"testId + '-cell-inline-actions'\">\n <button\n type=\"button\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n class=\"menu-button\"\n data-test=\"secondary-actions-toggler\"\n >\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n <ng-template #menu>\n @for (secondaryAction of actions$ | async; track secondaryAction) {\n
|
|
38456
|
+
args: [{ selector: 'qd-quick-edit', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if (showStandaloneCreate) {\n<div class=\"editable-actions\">\n <button qdButton qdButtonGhost icon=\"plus\" (click)=\"createRow()\" [data-test-id]=\"testId + '-button-add-new'\">\n {{ config.standaloneCreateLabel?.i18n ?? \"i18n.qd.quick.edit.createButtonLabel\" | translate }}\n </button>\n</div>\n}\n\n<div class=\"table\" [formGroup]=\"control\">\n @if (!config.canAdd || templateData.length > 0 || config.emptyStateView) {\n <div class=\"table-header\">\n <div class=\"table-row\">\n @for (header of visibleColumns; track header) {\n <div class=\"table-cell\">\n {{ header?.i18n | translate }}\n <qd-tooltip-icon [tooltip]=\"header?.tooltip\"></qd-tooltip-icon>\n </div>\n } @if (hasVisibleActions$ | async) {\n <div class=\"table-cell actions-column\">\n <button class=\"menu-button\">\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n </div>\n }\n </div>\n </div>\n }\n <div class=\"table-body\">\n <div\n class=\"table-row\"\n *qdCustomFor=\"let row of templateData; let rowIndex = index; toggler: togglerDrawing\"\n [formGroupName]=\"rowIndex\"\n [attr.data-test-id]=\"testId + '-row-' + rowIndex\"\n >\n @for (column of visibleColumns; track trackByColumnName($index, column)) {\n <div class=\"table-cell\">\n @if (column.type === 'enum') {\n <qd-dropdown\n [config]=\"{\n filter: column.filter,\n options: column.options,\n placeholder: column.placeholder,\n placeholderPrefix: column.placeholderPrefix,\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n [data-test-id]=\"column.name + rowIndex\"\n [dense]=\"true\"\n [formControl]=\"$any(control.controls[rowIndex])?.controls[column.name]\"\n qdFocusable\n class=\"dropdown\"\n >\n </qd-dropdown>\n } @else { @if ($any(control.controls[rowIndex])?.controls[column.name]) {\n <qd-input\n [data-test-id]=\"column.name + rowIndex\"\n [formControlName]=\"column.name\"\n [config]=\"{\n inputType: column.type === 'integer' ? 'number' : 'text',\n viewonly: (viewonly$ | async) === true || !column.isEditable(row, column.name)\n }\"\n qdFocusable\n ></qd-input>\n } }\n </div>\n } @if (hasVisibleActions$ | async) {\n <td class=\"table-cell actions\" [attr.data-test-id]=\"testId + '-cell-inline-actions'\">\n <button\n type=\"button\"\n #rowMenuToggler=\"qdPopoverOnClick\"\n [qdPopoverOnClick]=\"menu\"\n [qdPopoverCloseStrategy]=\"'onEveryClick'\"\n [qdPopoverStopPropagation]=\"true\"\n [qdPopoverEnableKeyControl]=\"true\"\n [qdPopoverRestoreFocus]=\"true\"\n (keydown.enter)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (keydown.space)=\"markRowMenuOpeningByKeyboard(rowIndex)\"\n (opened)=\"openRowMenu(rowIndex)\"\n (closed)=\"closeRowMenu()\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"openRowMenuIndex === rowIndex\"\n [attr.aria-controls]=\"openRowMenuIndex === rowIndex ? rowMenuId(rowIndex) : null\"\n class=\"menu-button\"\n data-test=\"secondary-actions-toggler\"\n >\n <qd-icon icon=\"overflowMenuHorizontal\"></qd-icon>\n </button>\n <ng-template #menu>\n <div\n role=\"menu\"\n [id]=\"rowMenuId(rowIndex)\"\n [attr.aria-label]=\"'i18n.qd.quick.edit.a11y.moreActions' | translate\"\n (keydown)=\"handleRowMenuKeydown($event, rowMenuToggler)\"\n >\n @for (secondaryAction of actions$ | async; track secondaryAction) {\n <button\n role=\"menuitem\"\n tabindex=\"-1\"\n class=\"secondary-actions\"\n [ngClass]=\"{ disabled: isActionDisabled(secondaryAction, row) }\"\n [attr.disabled]=\"isActionDisabled(secondaryAction, row) || null\"\n (click)=\"handleSecondaryAction(secondaryAction, rowIndex)\"\n >\n {{ secondaryAction.label.i18n | translate }}\n </button>\n } @if (canAdd && (viewonly$ | async) === false) {\n <button role=\"menuitem\" tabindex=\"-1\" class=\"secondary-actions\" (click)=\"removeRow(rowIndex)\">\n {{ \"i18n.qd.quick.edit.removeButtonLabel\" | translate }}\n </button>\n }\n </div>\n </ng-template>\n </td>\n }\n </div>\n </div>\n @if (config.emptyStateView && !config.emptyStateView.disabled && templateData.length === 0) {\n <div class=\"empty-body\">\n <p>{{ config.emptyStateView.i18n | translate }}</p>\n </div>\n }\n</div>\n", styles: [".table{display:flex;width:100%;flex-direction:column;margin:1.25rem auto;background-color:#fff;font-size:.875rem}.table ::ng-deep .qd-input-input{margin-bottom:0!important}.table-header .table-row{padding-top:.125rem;padding-bottom:.125rem;background-color:#e5e5e5;font-weight:700}.table-header .table-row .actions-column{visibility:hidden}.table-header,.table-body{display:flex;flex-direction:column}.table-row{display:flex;flex-direction:row;padding:.25rem 1rem;border-bottom:.0625rem solid rgb(213,213,213);gap:1rem}.table-row ::ng-deep qd-form-label{display:none!important}.table-row ::ng-deep qd-input{min-width:0;margin-bottom:0!important}.table-body .table-row:hover{background-color:#f5f5f5}.table-cell{display:flex;min-width:0;height:2.3125rem;flex:1;align-items:center;text-align:left}.table-cell:has(.qd-input-error),.table-cell:has(.qd-dropdown-error){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter){height:auto;align-items:flex-start}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input{position:relative}.table-cell:has(.qd-input-character-counter) ::ng-deep qd-input .qd-input-character-counter{position:absolute;right:.25rem;bottom:.125rem;font-size:.625rem;line-height:1;pointer-events:none}.table-cell.actions,.table-cell.actions-column{min-width:auto;flex:0 0 auto}.table-row:last-child{border-bottom:none}.editable-actions{display:flex;justify-content:flex-end;margin-right:.625rem;gap:.625rem}.menu-button{display:flex;padding:0 .625rem 0 .375rem;background:unset;color:#454545;font-size:2rem;vertical-align:middle}.menu-button:hover,.menu-button:focus{color:#000;outline:0!important}.secondary-actions{display:block;width:100%;min-height:2rem;padding:0 1rem;background:#fff0;font-size:.75rem;text-align:left}.secondary-actions:hover,.secondary-actions:focus-visible{background-color:#f2f7fa}.secondary-actions.disabled{color:#b4b4b4;cursor:not-allowed}.secondary-actions.disabled:hover{background-color:#fff0}.dropdown{width:100%;min-width:0}.empty-body{padding:1.5rem;background:#fff}.empty-body p{margin:0 0 .5rem}\n"] }]
|
|
38388
38457
|
}], ctorParameters: () => [], propDecorators: { config: [{
|
|
38389
38458
|
type: Input,
|
|
38390
38459
|
args: [{ required: true }]
|