@acontplus/ng-components 3.1.0 → 3.2.1
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 +101 -234
- package/fesm2022/acontplus-ng-components.mjs +1151 -132
- package/fesm2022/acontplus-ng-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/button/v2/button.scss +8 -0
- package/src/lib/components/date-range-input/date-range-input.scss +1 -6
- package/src/lib/components/dialog/acp-dialog-container.scss +140 -0
- package/src/lib/components/dialog-wrapper/dialog-wrapper.scss +0 -4
- package/types/acontplus-ng-components.d.ts +688 -49
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef, EventEmitter, booleanAttribute, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, input, output, contentChild, TemplateRef, computed, InjectionToken, NgZone, Injector, signal, Service, ElementRef, HostListener, Directive, ViewChild, ViewContainerRef, Renderer2, afterRenderEffect, untracked,
|
|
2
|
+
import { inject, ChangeDetectorRef, EventEmitter, booleanAttribute, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, input, output, contentChild, TemplateRef, computed, InjectionToken, NgZone, Injector, signal, Service, ElementRef, HostListener, Directive, ViewChild, ViewContainerRef, Renderer2, afterRenderEffect, untracked, makeEnvironmentProviders, viewChild, isSignal, effect, Injectable, Pipe, KeyValueDiffers, CSP_NONCE, DOCUMENT as DOCUMENT$1, ContentChildren, model, forwardRef, ANIMATION_MODULE_TYPE, ApplicationRef, ContentChild, HostBinding, PLATFORM_ID, DestroyRef, SecurityContext } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/material/button';
|
|
4
4
|
import { MatIconButton, MatButtonModule, MatButton, MatMiniFabButton, MatFabButton } from '@angular/material/button';
|
|
5
5
|
import * as i1$2 from '@angular/common';
|
|
@@ -14,15 +14,17 @@ import { MatCardModule, MatCard, MatCardHeader, MatCardContent } from '@angular/
|
|
|
14
14
|
import * as i3$1 from '@angular/cdk/overlay';
|
|
15
15
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
16
16
|
import { ComponentPortal, CdkPortalOutlet, TemplatePortal, DomPortalOutlet } from '@angular/cdk/portal';
|
|
17
|
-
import { Subject, firstValueFrom, catchError, of,
|
|
18
|
-
import { takeUntil,
|
|
17
|
+
import { Subject, firstValueFrom, from, isObservable, catchError, of, merge, combineLatest, Observable, fromEvent, defer, Subscription, map as map$1, BehaviorSubject, filter as filter$1, tap, debounceTime } from 'rxjs';
|
|
18
|
+
import { takeUntil, take, switchMap, mapTo, startWith, pairwise, distinctUntilChanged, share, map, skip, filter } from 'rxjs/operators';
|
|
19
19
|
import * as i3 from '@angular/material/progress-spinner';
|
|
20
20
|
import { MatProgressSpinnerModule, MatProgressSpinner } from '@angular/material/progress-spinner';
|
|
21
21
|
import { CdkTrapFocus, LiveAnnouncer, _IdGenerator, FocusMonitor, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y';
|
|
22
|
-
import { CdkDrag, CdkDragHandle, moveItemInArray, CdkDropList } from '@angular/cdk/drag-drop';
|
|
23
22
|
import * as i1$3 from '@angular/material/dialog';
|
|
24
23
|
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule, MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
|
24
|
+
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
25
|
+
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
25
26
|
import { REPORT_FORMAT, DEFAULT_ICONS, FALLBACK_ICON } from '@acontplus/ui-kit';
|
|
27
|
+
import { CdkDrag, CdkDragHandle, moveItemInArray, CdkDropList } from '@angular/cdk/drag-drop';
|
|
26
28
|
import * as i1$5 from '@angular/forms';
|
|
27
29
|
import { FormControl, ReactiveFormsModule, FormsModule, NG_VALUE_ACCESSOR, FormGroup, Validators } from '@angular/forms';
|
|
28
30
|
import * as i1$4 from '@ng-select/ng-select';
|
|
@@ -63,8 +65,6 @@ import { MatListModule } from '@angular/material/list';
|
|
|
63
65
|
import { MatDividerModule } from '@angular/material/divider';
|
|
64
66
|
import * as i1$6 from '@angular/material/toolbar';
|
|
65
67
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
66
|
-
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
67
|
-
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
68
68
|
import * as i1$8 from 'ngx-permissions';
|
|
69
69
|
import { NgxPermissionsModule } from 'ngx-permissions';
|
|
70
70
|
import * as i1$9 from '@angular/material/slide-toggle';
|
|
@@ -1220,6 +1220,194 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
1220
1220
|
}]
|
|
1221
1221
|
}], ctorParameters: () => [], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: true }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], hide: [{ type: i0.Output, args: ["hide"] }], itemSelected: [{ type: i0.Output, args: ["itemSelected"] }] } });
|
|
1222
1222
|
|
|
1223
|
+
/**
|
|
1224
|
+
* Declarative dialog structure wrapper. Use it inside a dialog content template
|
|
1225
|
+
* to group the titlebar, body and actions sections.
|
|
1226
|
+
*
|
|
1227
|
+
* @example
|
|
1228
|
+
* ```html
|
|
1229
|
+
* <acp-dialog>
|
|
1230
|
+
* <acp-dialog-titlebar title="Edit user" icon="person" />
|
|
1231
|
+
* <acp-dialog-content>
|
|
1232
|
+
* <p>Dialog body</p>
|
|
1233
|
+
* </acp-dialog-content>
|
|
1234
|
+
* <acp-dialog-actions align="end">
|
|
1235
|
+
* <acp-button text="Cancel" appearance="text" (clicked)="ref.close()" />
|
|
1236
|
+
* <acp-button text="Save" color="success" (clicked)="ref.close(user)" />
|
|
1237
|
+
* </acp-dialog-actions>
|
|
1238
|
+
* </acp-dialog>
|
|
1239
|
+
* ```
|
|
1240
|
+
*/
|
|
1241
|
+
class AcpDialog {
|
|
1242
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1243
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.0", type: AcpDialog, isStandalone: true, selector: "acp-dialog", host: { properties: { "style.display": "\"contents\"" }, classAttribute: "acp-dialog" }, ngImport: i0, template: `
|
|
1244
|
+
<ng-content select="acp-dialog-titlebar" />
|
|
1245
|
+
<ng-content select="acp-dialog-content" />
|
|
1246
|
+
<ng-content select="acp-dialog-actions" />
|
|
1247
|
+
<ng-content />
|
|
1248
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1249
|
+
}
|
|
1250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialog, decorators: [{
|
|
1251
|
+
type: Component,
|
|
1252
|
+
args: [{
|
|
1253
|
+
selector: 'acp-dialog',
|
|
1254
|
+
standalone: true,
|
|
1255
|
+
template: `
|
|
1256
|
+
<ng-content select="acp-dialog-titlebar" />
|
|
1257
|
+
<ng-content select="acp-dialog-content" />
|
|
1258
|
+
<ng-content select="acp-dialog-actions" />
|
|
1259
|
+
<ng-content />
|
|
1260
|
+
`,
|
|
1261
|
+
host: {
|
|
1262
|
+
class: 'acp-dialog',
|
|
1263
|
+
'[style.display]': '"contents"',
|
|
1264
|
+
},
|
|
1265
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1266
|
+
encapsulation: ViewEncapsulation.None,
|
|
1267
|
+
}]
|
|
1268
|
+
}] });
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Declarative dialog content body. Use it inside `<acp-dialog>` or any dialog
|
|
1272
|
+
* content template to mark the scrollable body section.
|
|
1273
|
+
*
|
|
1274
|
+
* @example
|
|
1275
|
+
* ```html
|
|
1276
|
+
* <acp-dialog-content>
|
|
1277
|
+
* <p>Dialog body</p>
|
|
1278
|
+
* </acp-dialog-content>
|
|
1279
|
+
* ```
|
|
1280
|
+
*/
|
|
1281
|
+
class AcpDialogContent {
|
|
1282
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1283
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.0", type: AcpDialogContent, isStandalone: true, selector: "acp-dialog-content", host: { classAttribute: "acp-dialog-content" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1284
|
+
}
|
|
1285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogContent, decorators: [{
|
|
1286
|
+
type: Component,
|
|
1287
|
+
args: [{
|
|
1288
|
+
selector: 'acp-dialog-content',
|
|
1289
|
+
standalone: true,
|
|
1290
|
+
template: `<ng-content />`,
|
|
1291
|
+
host: { class: 'acp-dialog-content' },
|
|
1292
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1293
|
+
encapsulation: ViewEncapsulation.None,
|
|
1294
|
+
}]
|
|
1295
|
+
}] });
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* Reference to a dialog opened via `AcpDialogService`. Mirrors the public surface
|
|
1299
|
+
* of `MatDialogRef` so consumers can subscribe to `afterClosed()`, close manually,
|
|
1300
|
+
* inspect the component instance, etc.
|
|
1301
|
+
*
|
|
1302
|
+
* It is both the value returned by `AcpDialogService.open()` and an injectable
|
|
1303
|
+
* token: content components can `inject(AcpDialogRef)` to close themselves.
|
|
1304
|
+
*/
|
|
1305
|
+
class AcpDialogRef {
|
|
1306
|
+
matDialogRef;
|
|
1307
|
+
/** Emits every time a configured dialog action is clicked, before it closes. */
|
|
1308
|
+
clickedResult;
|
|
1309
|
+
/** Observable mirror of {@link clickedResult}. */
|
|
1310
|
+
get actionClicked$() {
|
|
1311
|
+
return this.clickedResult.asObservable();
|
|
1312
|
+
}
|
|
1313
|
+
constructor(matDialogRef, clickedResult) {
|
|
1314
|
+
this.matDialogRef = matDialogRef;
|
|
1315
|
+
this.clickedResult = clickedResult ?? new Subject();
|
|
1316
|
+
}
|
|
1317
|
+
/** The instance of the component opened into the dialog. */
|
|
1318
|
+
get componentInstance() {
|
|
1319
|
+
return this.readRef(ref => ref.componentInstance);
|
|
1320
|
+
}
|
|
1321
|
+
/** `ComponentRef` of the component opened into the dialog. */
|
|
1322
|
+
get componentRef() {
|
|
1323
|
+
return this.readRef(ref => ref.componentRef) ?? null;
|
|
1324
|
+
}
|
|
1325
|
+
/** Whether the user is allowed to close the dialog. */
|
|
1326
|
+
get disableClose() {
|
|
1327
|
+
return this.readRef(ref => ref.disableClose);
|
|
1328
|
+
}
|
|
1329
|
+
/** Unique ID for the dialog. */
|
|
1330
|
+
get id() {
|
|
1331
|
+
return this.readRef(ref => ref.id) ?? '';
|
|
1332
|
+
}
|
|
1333
|
+
/** Gets an observable that is notified when the dialog is finished closing. */
|
|
1334
|
+
afterClosed() {
|
|
1335
|
+
return this.fromRef(ref => ref.afterClosed());
|
|
1336
|
+
}
|
|
1337
|
+
/** Gets an observable that is notified when the dialog is finished opening. */
|
|
1338
|
+
afterOpened() {
|
|
1339
|
+
return this.fromRef(ref => ref.afterOpened());
|
|
1340
|
+
}
|
|
1341
|
+
/** Gets an observable that is notified when the dialog has started closing. */
|
|
1342
|
+
beforeClosed() {
|
|
1343
|
+
return this.fromRef(ref => ref.beforeClosed());
|
|
1344
|
+
}
|
|
1345
|
+
/** Gets an observable that emits when the overlay's backdrop has been clicked. */
|
|
1346
|
+
backdropClick() {
|
|
1347
|
+
return this.fromRef(ref => ref.backdropClick());
|
|
1348
|
+
}
|
|
1349
|
+
/** Gets an observable that emits when keydown events are targeted on the overlay. */
|
|
1350
|
+
keydownEvents() {
|
|
1351
|
+
return this.fromRef(ref => ref.keydownEvents());
|
|
1352
|
+
}
|
|
1353
|
+
/** Gets the current lifecycle state of the dialog. */
|
|
1354
|
+
getState() {
|
|
1355
|
+
return this.readRef(ref => ref.getState());
|
|
1356
|
+
}
|
|
1357
|
+
/** Resolves with the result once the dialog finishes closing. */
|
|
1358
|
+
get closed() {
|
|
1359
|
+
return firstValueFrom(this.afterClosed());
|
|
1360
|
+
}
|
|
1361
|
+
/** Observable that emits the result once the dialog finishes closing. */
|
|
1362
|
+
get closed$() {
|
|
1363
|
+
return this.afterClosed();
|
|
1364
|
+
}
|
|
1365
|
+
/** Closes the dialog, optionally returning a result. */
|
|
1366
|
+
close(result) {
|
|
1367
|
+
this.withRef(ref => ref.close(result));
|
|
1368
|
+
}
|
|
1369
|
+
/** Updates the dialog's position. */
|
|
1370
|
+
updatePosition(position) {
|
|
1371
|
+
this.withRef(ref => ref.updatePosition(position));
|
|
1372
|
+
return this;
|
|
1373
|
+
}
|
|
1374
|
+
/** Updates the dialog's width and height. */
|
|
1375
|
+
updateSize(width = '', height = '') {
|
|
1376
|
+
this.withRef(ref => ref.updateSize(width, height));
|
|
1377
|
+
return this;
|
|
1378
|
+
}
|
|
1379
|
+
/** Add a CSS class or an array of classes to the overlay pane. */
|
|
1380
|
+
addPanelClass(classes) {
|
|
1381
|
+
this.withRef(ref => ref.addPanelClass(classes));
|
|
1382
|
+
return this;
|
|
1383
|
+
}
|
|
1384
|
+
/** Remove a CSS class or an array of classes from the overlay pane. */
|
|
1385
|
+
removePanelClass(classes) {
|
|
1386
|
+
this.withRef(ref => ref.removePanelClass(classes));
|
|
1387
|
+
return this;
|
|
1388
|
+
}
|
|
1389
|
+
fromRef(fn) {
|
|
1390
|
+
if (this.matDialogRef instanceof Promise) {
|
|
1391
|
+
return from(this.matDialogRef).pipe(take(1), switchMap(fn));
|
|
1392
|
+
}
|
|
1393
|
+
return fn(this.matDialogRef);
|
|
1394
|
+
}
|
|
1395
|
+
readRef(fn) {
|
|
1396
|
+
if (this.matDialogRef instanceof Promise) {
|
|
1397
|
+
return undefined;
|
|
1398
|
+
}
|
|
1399
|
+
return fn(this.matDialogRef);
|
|
1400
|
+
}
|
|
1401
|
+
withRef(fn) {
|
|
1402
|
+
if (this.matDialogRef instanceof Promise) {
|
|
1403
|
+
this.matDialogRef.then(ref => fn(ref));
|
|
1404
|
+
}
|
|
1405
|
+
else {
|
|
1406
|
+
fn(this.matDialogRef);
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1223
1411
|
class Button {
|
|
1224
1412
|
variant = input('primary', /* @ts-ignore */
|
|
1225
1413
|
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
@@ -1433,12 +1621,16 @@ class BaseButton {
|
|
|
1433
1621
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1434
1622
|
text = input(/* @ts-ignore */
|
|
1435
1623
|
...(ngDevMode ? [undefined, { debugName: "text" }] : /* istanbul ignore next */ []));
|
|
1624
|
+
ariaLabel = input(/* @ts-ignore */
|
|
1625
|
+
...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1626
|
+
form = input(/* @ts-ignore */
|
|
1627
|
+
...(ngDevMode ? [undefined, { debugName: "form" }] : /* istanbul ignore next */ []));
|
|
1436
1628
|
hasText = computed(() => !!this.text() && this.text().trim().length > 0, /* @ts-ignore */
|
|
1437
1629
|
...(ngDevMode ? [{ debugName: "hasText" }] : /* istanbul ignore next */ []));
|
|
1438
1630
|
clicked = output();
|
|
1439
1631
|
focused = output();
|
|
1440
1632
|
blurred = output();
|
|
1441
|
-
colorClass = computed(() => `acp-${this.color()}
|
|
1633
|
+
colorClass = computed(() => (this.color() === 'danger' ? 'acp-error' : `acp-${this.color()}`), /* @ts-ignore */
|
|
1442
1634
|
...(ngDevMode ? [{ debugName: "colorClass" }] : /* istanbul ignore next */ []));
|
|
1443
1635
|
sizeClass = computed(() => `acp-${this.size()}`, /* @ts-ignore */
|
|
1444
1636
|
...(ngDevMode ? [{ debugName: "sizeClass" }] : /* istanbul ignore next */ []));
|
|
@@ -1451,7 +1643,7 @@ class BaseButton {
|
|
|
1451
1643
|
pointerEvents = computed(() => (this.isDisabled() ? 'none' : 'auto'), /* @ts-ignore */
|
|
1452
1644
|
...(ngDevMode ? [{ debugName: "pointerEvents" }] : /* istanbul ignore next */ []));
|
|
1453
1645
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: BaseButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1454
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.0", type: BaseButton, isStandalone: true, inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, square: { classPropertyName: "square", publicName: "square", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, suffixIcon: { classPropertyName: "suffixIcon", publicName: "suffixIcon", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, showProgress: { classPropertyName: "showProgress", publicName: "showProgress", isSignal: true, isRequired: false, transformFunction: null }, progressType: { classPropertyName: "progressType", publicName: "progressType", isSignal: true, isRequired: false, transformFunction: null }, progressText: { classPropertyName: "progressText", publicName: "progressText", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disableRipple: { classPropertyName: "disableRipple", publicName: "disableRipple", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, extended: { classPropertyName: "extended", publicName: "extended", isSignal: true, isRequired: false, transformFunction: null }, block: { classPropertyName: "block", publicName: "block", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked", focused: "focused", blurred: "blurred" }, host: { properties: { "style.pointer-events": "pointerEvents()" } }, ngImport: i0 });
|
|
1646
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.0", type: BaseButton, isStandalone: true, inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, square: { classPropertyName: "square", publicName: "square", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, suffixIcon: { classPropertyName: "suffixIcon", publicName: "suffixIcon", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, showProgress: { classPropertyName: "showProgress", publicName: "showProgress", isSignal: true, isRequired: false, transformFunction: null }, progressType: { classPropertyName: "progressType", publicName: "progressType", isSignal: true, isRequired: false, transformFunction: null }, progressText: { classPropertyName: "progressText", publicName: "progressText", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disableRipple: { classPropertyName: "disableRipple", publicName: "disableRipple", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, extended: { classPropertyName: "extended", publicName: "extended", isSignal: true, isRequired: false, transformFunction: null }, block: { classPropertyName: "block", publicName: "block", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked", focused: "focused", blurred: "blurred" }, host: { properties: { "style.pointer-events": "pointerEvents()" } }, ngImport: i0 });
|
|
1455
1647
|
}
|
|
1456
1648
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: BaseButton, decorators: [{
|
|
1457
1649
|
type: Directive,
|
|
@@ -1460,7 +1652,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
1460
1652
|
'[style.pointer-events]': 'pointerEvents()',
|
|
1461
1653
|
},
|
|
1462
1654
|
}]
|
|
1463
|
-
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], square: [{ type: i0.Input, args: [{ isSignal: true, alias: "square", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], suffixIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffixIcon", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], showProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "showProgress", required: false }] }], progressType: [{ type: i0.Input, args: [{ isSignal: true, alias: "progressType", required: false }] }], progressText: [{ type: i0.Input, args: [{ isSignal: true, alias: "progressText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], disableRipple: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableRipple", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], extended: [{ type: i0.Input, args: [{ isSignal: true, alias: "extended", required: false }] }], block: [{ type: i0.Input, args: [{ isSignal: true, alias: "block", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }], focused: [{ type: i0.Output, args: ["focused"] }], blurred: [{ type: i0.Output, args: ["blurred"] }] } });
|
|
1655
|
+
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], square: [{ type: i0.Input, args: [{ isSignal: true, alias: "square", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], suffixIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffixIcon", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], showProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "showProgress", required: false }] }], progressType: [{ type: i0.Input, args: [{ isSignal: true, alias: "progressType", required: false }] }], progressText: [{ type: i0.Input, args: [{ isSignal: true, alias: "progressText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], disableRipple: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableRipple", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], extended: [{ type: i0.Input, args: [{ isSignal: true, alias: "extended", required: false }] }], block: [{ type: i0.Input, args: [{ isSignal: true, alias: "block", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }], focused: [{ type: i0.Output, args: ["focused"] }], blurred: [{ type: i0.Output, args: ["blurred"] }] } });
|
|
1464
1656
|
|
|
1465
1657
|
class ButtonLoaderDirective {
|
|
1466
1658
|
acpLoading = input(false, { ...(ngDevMode ? { debugName: "acpLoading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -1523,7 +1715,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
1523
1715
|
|
|
1524
1716
|
class AcpButton extends BaseButton {
|
|
1525
1717
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpButton, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1526
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AcpButton, isStandalone: true, selector: "acp-button", usesInheritance: true, ngImport: i0, template: "@if (variant() === 'icon') {\n<button\n matIconButton\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [ngClass]=\"[colorClass(), squareClass(), blockClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n <mat-icon>{{icon()}}</mat-icon>\n</button>\n} @else if (variant() === 'fab') {\n<button\n matFab\n [extended]=\"extended()\"\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [ngClass]=\"[colorClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n @if (icon()) { <mat-icon>{{icon()}}</mat-icon> } @if (extended()) { @if (hasText()) { {{text()}} }\n @else { <ng-content></ng-content> } }\n</button>\n} @else if (variant() === 'mini-fab') {\n<button\n matMiniFab\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [ngClass]=\"[colorClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n <mat-icon>{{icon()}}</mat-icon>\n</button>\n} @else {\n<button\n [matButton]=\"appearance()\"\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [showProgress]=\"showProgress()\"\n [type]=\"type()\"\n [ngClass]=\"[colorClass(), squareClass(), blockClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n @if (icon()) { <mat-icon>{{icon()}}</mat-icon> } @if (hasText()) { {{text()}} } @else {\n <ng-content></ng-content> } @if (showProgress() && progressType() === 'spinner') {\n <mat-progress-spinner\n progressIndicator\n mode=\"indeterminate\"\n [diameter]=\"20\"\n aria-label=\"Loading\"\n />\n } @if (showProgress() && progressType() === 'text') {\n <div progressIndicator role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n {{ progressText() }}\n </div>\n } @if (suffixIcon()) {\n <mat-icon iconPositionEnd>{{suffixIcon()}}</mat-icon> }\n</button>\n}\n", styles: [".acp-primary{--mat-button-filled-container-color: var(--acp-theme-primary-color);--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: var(--acp-theme-primary-color);--mat-button-protected-label-text-color: var(--acp-theme-primary-color);--mat-button-text-label-text-color: var(--acp-theme-primary-color);--mat-button-text-state-layer-color: var(--acp-theme-primary-color)}.acp-secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary)}.acp-accent{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary)}.acp-error{--mat-button-filled-container-color: var(--mat-sys-error);--mat-button-filled-label-text-color: var(--mat-sys-on-error);--mat-button-outlined-label-text-color: var(--mat-sys-error);--mat-button-protected-label-text-color: var(--mat-sys-error);--mat-button-text-label-text-color: var(--mat-sys-error);--mat-button-text-state-layer-color: var(--mat-sys-error)}.acp-success{--mat-button-filled-container-color: #4caf50;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #4caf50;--mat-button-protected-label-text-color: #4caf50;--mat-button-text-label-text-color: #4caf50;--mat-button-text-state-layer-color: #4caf50}.acp-warning{--mat-button-filled-container-color: #f59e0b;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #f59e0b;--mat-button-protected-label-text-color: #f59e0b;--mat-button-text-label-text-color: #f59e0b;--mat-button-text-state-layer-color: #f59e0b}.acp-info{--mat-button-filled-container-color: #3b82f6;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #3b82f6;--mat-button-protected-label-text-color: #3b82f6;--mat-button-text-label-text-color: #3b82f6;--mat-button-text-state-layer-color: #3b82f6}.acp-dark{--mat-button-filled-container-color: #1f2937;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-protected-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-text-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-text-state-layer-color: light-dark(#1f2937, #ffffff)}[matIconButton].acp-primary{--mat-icon-color: var(--acp-theme-primary-color)}[matIconButton].acp-secondary{--mat-icon-color: var(--mat-sys-secondary)}[matIconButton].acp-accent{--mat-icon-color: var(--mat-sys-tertiary)}[matIconButton].acp-error{--mat-icon-color: var(--mat-sys-error)}[matIconButton].acp-success{--mat-icon-color: #10b981}[matIconButton].acp-warning{--mat-icon-color: #f59e0b}[matIconButton].acp-info{--mat-icon-color: #3b82f6}[matFab].acp-primary{--mat-fab-container-color: var(--acp-theme-primary-color);--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-secondary{--mat-fab-container-color: var(--mat-sys-secondary);--mat-fab-foreground-color: var(--mat-sys-on-secondary);--mat-fab-state-layer-color: var(--mat-sys-on-secondary)}[matFab].acp-accent{--mat-fab-container-color: var(--mat-sys-tertiary);--mat-fab-foreground-color: var(--mat-sys-on-tertiary);--mat-fab-state-layer-color: var(--mat-sys-on-tertiary)}[matFab].acp-error{--mat-fab-container-color: var(--mat-sys-error);--mat-fab-foreground-color: var(--mat-sys-on-error);--mat-fab-state-layer-color: var(--mat-sys-on-error)}[matFab].acp-success{--mat-fab-container-color: #4caf50;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-warning{--mat-fab-container-color: #f59e0b;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-info{--mat-fab-container-color: #3b82f6;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-dark{--mat-fab-container-color: #1f2937;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matMiniFab].acp-primary{--mat-fab-small-container-color: var(--acp-theme-primary-color);--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-secondary{--mat-fab-small-container-color: var(--mat-sys-secondary);--mat-fab-small-foreground-color: var(--mat-sys-on-secondary);--mat-fab-small-state-layer-color: var(--mat-sys-on-secondary)}[matMiniFab].acp-accent{--mat-fab-small-container-color: var(--mat-sys-tertiary);--mat-fab-small-foreground-color: var(--mat-sys-on-tertiary);--mat-fab-small-state-layer-color: var(--mat-sys-on-tertiary)}[matMiniFab].acp-error{--mat-fab-small-container-color: var(--mat-sys-error);--mat-fab-small-foreground-color: var(--mat-sys-on-error);--mat-fab-small-state-layer-color: var(--mat-sys-on-error)}[matMiniFab].acp-success{--mat-fab-small-container-color: #4caf50;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-warning{--mat-fab-small-container-color: #f59e0b;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-info{--mat-fab-small-container-color: #3b82f6;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-dark{--mat-fab-small-container-color: #1f2937;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}.acp-square{--mat-button-filled-container-shape: 8px;--mat-button-outlined-container-shape: 8px;--mat-button-protected-container-shape: 8px;--mat-button-text-container-shape: 8px;--mat-button-tonal-container-shape: 8px;--mat-icon-button-container-shape: 8px}.acp-block{width:100%}.acp-medium{--mat-checkbox-touch-target-display: block;--mat-checkbox-state-layer-size: 36px;--mat-chip-container-height: 28px;--mat-expansion-header-collapsed-state-height: 44px;--mat-expansion-header-expanded-state-height: 60px;--mat-fab-small-touch-target-display: ;--mat-fab-touch-target-display: block;--mat-button-filled-touch-target-display: block;--mat-button-filled-container-height: 36px;--mat-button-outlined-container-height: 36px;--mat-button-outlined-touch-target-display: block;--mat-button-protected-touch-target-display: block;--mat-button-protected-container-height: 36px;--mat-button-text-touch-target-display: block;--mat-button-text-container-height: 36px;--mat-button-tonal-container-height: 36px;--mat-button-tonal-touch-target-display: block;--mat-form-field-container-height: 52px;--mat-form-field-filled-label-display: block;--mat-form-field-container-vertical-padding: 14px;--mat-form-field-filled-with-label-container-padding-top: 22px;--mat-form-field-filled-with-label-container-padding-bottom: 6px;--mat-icon-button-touch-target-display: block;--mat-icon-button-state-layer-size: 36px;--mat-list-list-item-leading-icon-start-space: 12px;--mat-list-list-item-leading-icon-end-space: 12px;--mat-list-list-item-one-line-container-height: 44px;--mat-list-list-item-two-line-container-height: 60px;--mat-list-list-item-three-line-container-height: 84px;--mat-paginator-container-size: 52px;--mat-paginator-form-field-container-height: 40px;--mat-paginator-form-field-container-vertical-padding: 8px;--mat-paginator-touch-target-display: block;--mat-radio-touch-target-display: block;--mat-radio-state-layer-size: 36px;--mat-tab-container-height: 44px;--mat-select-arrow-transform: translateY(-8px);--mat-button-toggle-height: 40px;--mat-stepper-header-height: 68px;--mat-table-header-container-height: 52px;--mat-table-footer-container-height: 48px;--mat-table-row-item-container-height: 48px;--mat-toolbar-standard-height: 60px;--mat-toolbar-mobile-height: 52px;--mat-tree-node-min-height: 44px;--mat-sys-corner-extra-large: 28px;--mat-sys-corner-extra-large-top: 28px 28px 0 0;--mat-sys-corner-extra-small: 4px;--mat-sys-corner-extra-small-top: 4px 4px 0 0;--mat-sys-corner-full: 9999px;--mat-sys-corner-large: 16px;--mat-sys-corner-large-end: 0 16px 16px 0;--mat-sys-corner-large-start: 16px 0 0 16px;--mat-sys-corner-large-top: 16px 16px 0 0;--mat-sys-corner-medium: 12px;--mat-sys-corner-none: 0;--mat-sys-corner-small: 8px;--mat-sys-dragged-state-layer-opacity: .16;--mat-sys-focus-state-layer-opacity: .12;--mat-sys-hover-state-layer-opacity: .08;--mat-sys-pressed-state-layer-opacity: .12;--mat-button-filled-horizontal-padding: 20px;--mat-button-outlined-horizontal-padding: 20px;--mat-button-protected-horizontal-padding: 20px;--mat-button-text-horizontal-padding: 20px;--mat-button-tonal-horizontal-padding: 20px;--mat-button-toggle-height: 36px}.acp-small{--mat-checkbox-touch-target-display: none;--mat-checkbox-state-layer-size: 32px;--mat-chip-container-height: 24px;--mat-expansion-header-collapsed-state-height: 40px;--mat-expansion-header-expanded-state-height: 56px;--mat-fab-small-touch-target-display: ;--mat-fab-touch-target-display: none;--mat-button-filled-touch-target-display: none;--mat-button-filled-container-height: 32px;--mat-button-outlined-container-height: 32px;--mat-button-outlined-touch-target-display: none;--mat-button-protected-touch-target-display: none;--mat-button-protected-container-height: 32px;--mat-button-text-touch-target-display: none;--mat-button-text-container-height: 32px;--mat-button-tonal-container-height: 32px;--mat-button-tonal-touch-target-display: none;--mat-form-field-container-height: 48px;--mat-form-field-filled-label-display: none;--mat-form-field-container-vertical-padding: 12px;--mat-form-field-filled-with-label-container-padding-top: 12px;--mat-form-field-filled-with-label-container-padding-bottom: 12px;--mat-icon-button-touch-target-display: none;--mat-icon-button-state-layer-size: 32px;--mat-list-list-item-leading-icon-start-space: 8px;--mat-list-list-item-leading-icon-end-space: 8px;--mat-list-list-item-one-line-container-height: 40px;--mat-list-list-item-two-line-container-height: 56px;--mat-list-list-item-three-line-container-height: 80px;--mat-paginator-container-size: 48px;--mat-paginator-form-field-container-height: 40px;--mat-paginator-form-field-container-vertical-padding: 8px;--mat-paginator-touch-target-display: none;--mat-radio-touch-target-display: none;--mat-radio-state-layer-size: 32px;--mat-tab-container-height: 40px;--mat-select-arrow-transform: none;--mat-button-toggle-height: 40px;--mat-stepper-header-height: 64px;--mat-table-header-container-height: 48px;--mat-table-footer-container-height: 44px;--mat-table-row-item-container-height: 44px;--mat-toolbar-standard-height: 56px;--mat-toolbar-mobile-height: 48px;--mat-tree-node-min-height: 40px;--mat-sys-corner-extra-large: 28px;--mat-sys-corner-extra-large-top: 28px 28px 0 0;--mat-sys-corner-extra-small: 4px;--mat-sys-corner-extra-small-top: 4px 4px 0 0;--mat-sys-corner-full: 9999px;--mat-sys-corner-large: 16px;--mat-sys-corner-large-end: 0 16px 16px 0;--mat-sys-corner-large-start: 16px 0 0 16px;--mat-sys-corner-large-top: 16px 16px 0 0;--mat-sys-corner-medium: 12px;--mat-sys-corner-none: 0;--mat-sys-corner-small: 8px;--mat-sys-dragged-state-layer-opacity: .16;--mat-sys-focus-state-layer-opacity: .12;--mat-sys-hover-state-layer-opacity: .08;--mat-sys-pressed-state-layer-opacity: .12;--mat-button-filled-horizontal-padding: 16px;--mat-button-outlined-horizontal-padding: 16px;--mat-button-protected-horizontal-padding: 16px;--mat-button-text-horizontal-padding: 16px;--mat-button-tonal-horizontal-padding: 16px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: ButtonLoaderDirective, selector: "button[acpLoading]", inputs: ["acpLoading"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1718
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AcpButton, isStandalone: true, selector: "acp-button", usesInheritance: true, ngImport: i0, template: "@if (variant() === 'icon') {\n<button\n matIconButton\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"[colorClass(), squareClass(), blockClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n <mat-icon>{{icon()}}</mat-icon>\n</button>\n} @else if (variant() === 'fab') {\n<button\n matFab\n [extended]=\"extended()\"\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"[colorClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n @if (icon()) { <mat-icon>{{icon()}}</mat-icon> } @if (extended()) { @if (hasText()) { {{text()}} }\n @else { <ng-content></ng-content> } }\n</button>\n} @else if (variant() === 'mini-fab') {\n<button\n matMiniFab\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"[colorClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n <mat-icon>{{icon()}}</mat-icon>\n</button>\n} @else {\n<button\n [matButton]=\"appearance()\"\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [showProgress]=\"showProgress()\"\n [type]=\"type()\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"[colorClass(), squareClass(), blockClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n @if (icon()) { <mat-icon>{{icon()}}</mat-icon> } @if (hasText()) { {{text()}} } @else {\n <ng-content></ng-content> } @if (showProgress() && progressType() === 'spinner') {\n <mat-progress-spinner\n progressIndicator\n mode=\"indeterminate\"\n [diameter]=\"20\"\n aria-label=\"Loading\"\n />\n } @if (showProgress() && progressType() === 'text') {\n <div progressIndicator role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n {{ progressText() }}\n </div>\n } @if (suffixIcon()) {\n <mat-icon iconPositionEnd>{{suffixIcon()}}</mat-icon> }\n</button>\n}\n", styles: [".acp-primary{--mat-button-filled-container-color: var(--acp-theme-primary-color);--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: var(--acp-theme-primary-color);--mat-button-protected-label-text-color: var(--acp-theme-primary-color);--mat-button-text-label-text-color: var(--acp-theme-primary-color);--mat-button-text-state-layer-color: var(--acp-theme-primary-color)}.acp-secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary)}.acp-accent{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary)}.acp-error{--mat-button-filled-container-color: var(--mat-sys-error);--mat-button-filled-label-text-color: var(--mat-sys-on-error);--mat-button-outlined-label-text-color: var(--mat-sys-error);--mat-button-protected-label-text-color: var(--mat-sys-error);--mat-button-text-label-text-color: var(--mat-sys-error);--mat-button-text-state-layer-color: var(--mat-sys-error)}.acp-success{--mat-button-filled-container-color: #4caf50;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #4caf50;--mat-button-protected-label-text-color: #4caf50;--mat-button-text-label-text-color: #4caf50;--mat-button-text-state-layer-color: #4caf50}.acp-warning{--mat-button-filled-container-color: #f59e0b;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #f59e0b;--mat-button-protected-label-text-color: #f59e0b;--mat-button-text-label-text-color: #f59e0b;--mat-button-text-state-layer-color: #f59e0b}.acp-info{--mat-button-filled-container-color: #3b82f6;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #3b82f6;--mat-button-protected-label-text-color: #3b82f6;--mat-button-text-label-text-color: #3b82f6;--mat-button-text-state-layer-color: #3b82f6}.acp-dark{--mat-button-filled-container-color: #1f2937;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-protected-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-text-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-text-state-layer-color: light-dark(#1f2937, #ffffff)}[matIconButton].acp-primary{--mat-icon-color: var(--acp-theme-primary-color)}[matIconButton].acp-secondary{--mat-icon-color: var(--mat-sys-secondary)}[matIconButton].acp-accent{--mat-icon-color: var(--mat-sys-tertiary)}[matIconButton].acp-error{--mat-icon-color: var(--mat-sys-error)}[matIconButton].acp-success{--mat-icon-color: #10b981}[matIconButton].acp-warning{--mat-icon-color: #f59e0b}[matIconButton].acp-info{--mat-icon-color: #3b82f6}[matIconButton].acp-light{--mat-icon-color: #ffffff}[matFab].acp-primary{--mat-fab-container-color: var(--acp-theme-primary-color);--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-secondary{--mat-fab-container-color: var(--mat-sys-secondary);--mat-fab-foreground-color: var(--mat-sys-on-secondary);--mat-fab-state-layer-color: var(--mat-sys-on-secondary)}[matFab].acp-accent{--mat-fab-container-color: var(--mat-sys-tertiary);--mat-fab-foreground-color: var(--mat-sys-on-tertiary);--mat-fab-state-layer-color: var(--mat-sys-on-tertiary)}[matFab].acp-error{--mat-fab-container-color: var(--mat-sys-error);--mat-fab-foreground-color: var(--mat-sys-on-error);--mat-fab-state-layer-color: var(--mat-sys-on-error)}[matFab].acp-success{--mat-fab-container-color: #4caf50;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-warning{--mat-fab-container-color: #f59e0b;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-info{--mat-fab-container-color: #3b82f6;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-dark{--mat-fab-container-color: #1f2937;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matMiniFab].acp-primary{--mat-fab-small-container-color: var(--acp-theme-primary-color);--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-secondary{--mat-fab-small-container-color: var(--mat-sys-secondary);--mat-fab-small-foreground-color: var(--mat-sys-on-secondary);--mat-fab-small-state-layer-color: var(--mat-sys-on-secondary)}[matMiniFab].acp-accent{--mat-fab-small-container-color: var(--mat-sys-tertiary);--mat-fab-small-foreground-color: var(--mat-sys-on-tertiary);--mat-fab-small-state-layer-color: var(--mat-sys-on-tertiary)}[matMiniFab].acp-error{--mat-fab-small-container-color: var(--mat-sys-error);--mat-fab-small-foreground-color: var(--mat-sys-on-error);--mat-fab-small-state-layer-color: var(--mat-sys-on-error)}[matMiniFab].acp-success{--mat-fab-small-container-color: #4caf50;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-warning{--mat-fab-small-container-color: #f59e0b;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-info{--mat-fab-small-container-color: #3b82f6;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-dark{--mat-fab-small-container-color: #1f2937;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}.acp-square{--mat-button-filled-container-shape: 8px;--mat-button-outlined-container-shape: 8px;--mat-button-protected-container-shape: 8px;--mat-button-text-container-shape: 8px;--mat-button-tonal-container-shape: 8px;--mat-icon-button-container-shape: 8px}.acp-block{width:100%}.acp-medium{--mat-checkbox-touch-target-display: block;--mat-checkbox-state-layer-size: 36px;--mat-chip-container-height: 28px;--mat-expansion-header-collapsed-state-height: 44px;--mat-expansion-header-expanded-state-height: 60px;--mat-fab-small-touch-target-display: ;--mat-fab-touch-target-display: block;--mat-button-filled-touch-target-display: block;--mat-button-filled-container-height: 36px;--mat-button-outlined-container-height: 36px;--mat-button-outlined-touch-target-display: block;--mat-button-protected-touch-target-display: block;--mat-button-protected-container-height: 36px;--mat-button-text-touch-target-display: block;--mat-button-text-container-height: 36px;--mat-button-tonal-container-height: 36px;--mat-button-tonal-touch-target-display: block;--mat-form-field-container-height: 52px;--mat-form-field-filled-label-display: block;--mat-form-field-container-vertical-padding: 14px;--mat-form-field-filled-with-label-container-padding-top: 22px;--mat-form-field-filled-with-label-container-padding-bottom: 6px;--mat-icon-button-touch-target-display: block;--mat-icon-button-state-layer-size: 36px;--mat-list-list-item-leading-icon-start-space: 12px;--mat-list-list-item-leading-icon-end-space: 12px;--mat-list-list-item-one-line-container-height: 44px;--mat-list-list-item-two-line-container-height: 60px;--mat-list-list-item-three-line-container-height: 84px;--mat-paginator-container-size: 52px;--mat-paginator-form-field-container-height: 40px;--mat-paginator-form-field-container-vertical-padding: 8px;--mat-paginator-touch-target-display: block;--mat-radio-touch-target-display: block;--mat-radio-state-layer-size: 36px;--mat-tab-container-height: 44px;--mat-select-arrow-transform: translateY(-8px);--mat-button-toggle-height: 40px;--mat-stepper-header-height: 68px;--mat-table-header-container-height: 52px;--mat-table-footer-container-height: 48px;--mat-table-row-item-container-height: 48px;--mat-toolbar-standard-height: 60px;--mat-toolbar-mobile-height: 52px;--mat-tree-node-min-height: 44px;--mat-sys-corner-extra-large: 28px;--mat-sys-corner-extra-large-top: 28px 28px 0 0;--mat-sys-corner-extra-small: 4px;--mat-sys-corner-extra-small-top: 4px 4px 0 0;--mat-sys-corner-full: 9999px;--mat-sys-corner-large: 16px;--mat-sys-corner-large-end: 0 16px 16px 0;--mat-sys-corner-large-start: 16px 0 0 16px;--mat-sys-corner-large-top: 16px 16px 0 0;--mat-sys-corner-medium: 12px;--mat-sys-corner-none: 0;--mat-sys-corner-small: 8px;--mat-sys-dragged-state-layer-opacity: .16;--mat-sys-focus-state-layer-opacity: .12;--mat-sys-hover-state-layer-opacity: .08;--mat-sys-pressed-state-layer-opacity: .12;--mat-button-filled-horizontal-padding: 20px;--mat-button-outlined-horizontal-padding: 20px;--mat-button-protected-horizontal-padding: 20px;--mat-button-text-horizontal-padding: 20px;--mat-button-tonal-horizontal-padding: 20px;--mat-button-toggle-height: 36px}.acp-small{--mat-checkbox-touch-target-display: none;--mat-checkbox-state-layer-size: 32px;--mat-chip-container-height: 24px;--mat-expansion-header-collapsed-state-height: 40px;--mat-expansion-header-expanded-state-height: 56px;--mat-fab-small-touch-target-display: ;--mat-fab-touch-target-display: none;--mat-button-filled-touch-target-display: none;--mat-button-filled-container-height: 32px;--mat-button-outlined-container-height: 32px;--mat-button-outlined-touch-target-display: none;--mat-button-protected-touch-target-display: none;--mat-button-protected-container-height: 32px;--mat-button-text-touch-target-display: none;--mat-button-text-container-height: 32px;--mat-button-tonal-container-height: 32px;--mat-button-tonal-touch-target-display: none;--mat-form-field-container-height: 48px;--mat-form-field-filled-label-display: none;--mat-form-field-container-vertical-padding: 12px;--mat-form-field-filled-with-label-container-padding-top: 12px;--mat-form-field-filled-with-label-container-padding-bottom: 12px;--mat-icon-button-touch-target-display: none;--mat-icon-button-state-layer-size: 32px;--mat-list-list-item-leading-icon-start-space: 8px;--mat-list-list-item-leading-icon-end-space: 8px;--mat-list-list-item-one-line-container-height: 40px;--mat-list-list-item-two-line-container-height: 56px;--mat-list-list-item-three-line-container-height: 80px;--mat-paginator-container-size: 48px;--mat-paginator-form-field-container-height: 40px;--mat-paginator-form-field-container-vertical-padding: 8px;--mat-paginator-touch-target-display: none;--mat-radio-touch-target-display: none;--mat-radio-state-layer-size: 32px;--mat-tab-container-height: 40px;--mat-select-arrow-transform: none;--mat-button-toggle-height: 40px;--mat-stepper-header-height: 64px;--mat-table-header-container-height: 48px;--mat-table-footer-container-height: 44px;--mat-table-row-item-container-height: 44px;--mat-toolbar-standard-height: 56px;--mat-toolbar-mobile-height: 48px;--mat-tree-node-min-height: 40px;--mat-sys-corner-extra-large: 28px;--mat-sys-corner-extra-large-top: 28px 28px 0 0;--mat-sys-corner-extra-small: 4px;--mat-sys-corner-extra-small-top: 4px 4px 0 0;--mat-sys-corner-full: 9999px;--mat-sys-corner-large: 16px;--mat-sys-corner-large-end: 0 16px 16px 0;--mat-sys-corner-large-start: 16px 0 0 16px;--mat-sys-corner-large-top: 16px 16px 0 0;--mat-sys-corner-medium: 12px;--mat-sys-corner-none: 0;--mat-sys-corner-small: 8px;--mat-sys-dragged-state-layer-opacity: .16;--mat-sys-focus-state-layer-opacity: .12;--mat-sys-hover-state-layer-opacity: .08;--mat-sys-pressed-state-layer-opacity: .12;--mat-button-filled-horizontal-padding: 16px;--mat-button-outlined-horizontal-padding: 16px;--mat-button-protected-horizontal-padding: 16px;--mat-button-text-horizontal-padding: 16px;--mat-button-tonal-horizontal-padding: 16px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$1.MatMiniFabButton, selector: "button[mat-mini-fab], a[mat-mini-fab], button[matMiniFab], a[matMiniFab]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i1$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: ButtonLoaderDirective, selector: "button[acpLoading]", inputs: ["acpLoading"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1527
1719
|
}
|
|
1528
1720
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpButton, decorators: [{
|
|
1529
1721
|
type: Component,
|
|
@@ -1533,25 +1725,834 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
1533
1725
|
MatIconModule,
|
|
1534
1726
|
MatProgressSpinnerModule,
|
|
1535
1727
|
ButtonLoaderDirective,
|
|
1536
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (variant() === 'icon') {\n<button\n matIconButton\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [ngClass]=\"[colorClass(), squareClass(), blockClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n <mat-icon>{{icon()}}</mat-icon>\n</button>\n} @else if (variant() === 'fab') {\n<button\n matFab\n [extended]=\"extended()\"\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [ngClass]=\"[colorClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n @if (icon()) { <mat-icon>{{icon()}}</mat-icon> } @if (extended()) { @if (hasText()) { {{text()}} }\n @else { <ng-content></ng-content> } }\n</button>\n} @else if (variant() === 'mini-fab') {\n<button\n matMiniFab\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [ngClass]=\"[colorClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n <mat-icon>{{icon()}}</mat-icon>\n</button>\n} @else {\n<button\n [matButton]=\"appearance()\"\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [showProgress]=\"showProgress()\"\n [type]=\"type()\"\n [ngClass]=\"[colorClass(), squareClass(), blockClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n @if (icon()) { <mat-icon>{{icon()}}</mat-icon> } @if (hasText()) { {{text()}} } @else {\n <ng-content></ng-content> } @if (showProgress() && progressType() === 'spinner') {\n <mat-progress-spinner\n progressIndicator\n mode=\"indeterminate\"\n [diameter]=\"20\"\n aria-label=\"Loading\"\n />\n } @if (showProgress() && progressType() === 'text') {\n <div progressIndicator role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n {{ progressText() }}\n </div>\n } @if (suffixIcon()) {\n <mat-icon iconPositionEnd>{{suffixIcon()}}</mat-icon> }\n</button>\n}\n", styles: [".acp-primary{--mat-button-filled-container-color: var(--acp-theme-primary-color);--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: var(--acp-theme-primary-color);--mat-button-protected-label-text-color: var(--acp-theme-primary-color);--mat-button-text-label-text-color: var(--acp-theme-primary-color);--mat-button-text-state-layer-color: var(--acp-theme-primary-color)}.acp-secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary)}.acp-accent{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary)}.acp-error{--mat-button-filled-container-color: var(--mat-sys-error);--mat-button-filled-label-text-color: var(--mat-sys-on-error);--mat-button-outlined-label-text-color: var(--mat-sys-error);--mat-button-protected-label-text-color: var(--mat-sys-error);--mat-button-text-label-text-color: var(--mat-sys-error);--mat-button-text-state-layer-color: var(--mat-sys-error)}.acp-success{--mat-button-filled-container-color: #4caf50;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #4caf50;--mat-button-protected-label-text-color: #4caf50;--mat-button-text-label-text-color: #4caf50;--mat-button-text-state-layer-color: #4caf50}.acp-warning{--mat-button-filled-container-color: #f59e0b;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #f59e0b;--mat-button-protected-label-text-color: #f59e0b;--mat-button-text-label-text-color: #f59e0b;--mat-button-text-state-layer-color: #f59e0b}.acp-info{--mat-button-filled-container-color: #3b82f6;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #3b82f6;--mat-button-protected-label-text-color: #3b82f6;--mat-button-text-label-text-color: #3b82f6;--mat-button-text-state-layer-color: #3b82f6}.acp-dark{--mat-button-filled-container-color: #1f2937;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-protected-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-text-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-text-state-layer-color: light-dark(#1f2937, #ffffff)}[matIconButton].acp-primary{--mat-icon-color: var(--acp-theme-primary-color)}[matIconButton].acp-secondary{--mat-icon-color: var(--mat-sys-secondary)}[matIconButton].acp-accent{--mat-icon-color: var(--mat-sys-tertiary)}[matIconButton].acp-error{--mat-icon-color: var(--mat-sys-error)}[matIconButton].acp-success{--mat-icon-color: #10b981}[matIconButton].acp-warning{--mat-icon-color: #f59e0b}[matIconButton].acp-info{--mat-icon-color: #3b82f6}[matFab].acp-primary{--mat-fab-container-color: var(--acp-theme-primary-color);--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-secondary{--mat-fab-container-color: var(--mat-sys-secondary);--mat-fab-foreground-color: var(--mat-sys-on-secondary);--mat-fab-state-layer-color: var(--mat-sys-on-secondary)}[matFab].acp-accent{--mat-fab-container-color: var(--mat-sys-tertiary);--mat-fab-foreground-color: var(--mat-sys-on-tertiary);--mat-fab-state-layer-color: var(--mat-sys-on-tertiary)}[matFab].acp-error{--mat-fab-container-color: var(--mat-sys-error);--mat-fab-foreground-color: var(--mat-sys-on-error);--mat-fab-state-layer-color: var(--mat-sys-on-error)}[matFab].acp-success{--mat-fab-container-color: #4caf50;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-warning{--mat-fab-container-color: #f59e0b;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-info{--mat-fab-container-color: #3b82f6;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-dark{--mat-fab-container-color: #1f2937;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matMiniFab].acp-primary{--mat-fab-small-container-color: var(--acp-theme-primary-color);--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-secondary{--mat-fab-small-container-color: var(--mat-sys-secondary);--mat-fab-small-foreground-color: var(--mat-sys-on-secondary);--mat-fab-small-state-layer-color: var(--mat-sys-on-secondary)}[matMiniFab].acp-accent{--mat-fab-small-container-color: var(--mat-sys-tertiary);--mat-fab-small-foreground-color: var(--mat-sys-on-tertiary);--mat-fab-small-state-layer-color: var(--mat-sys-on-tertiary)}[matMiniFab].acp-error{--mat-fab-small-container-color: var(--mat-sys-error);--mat-fab-small-foreground-color: var(--mat-sys-on-error);--mat-fab-small-state-layer-color: var(--mat-sys-on-error)}[matMiniFab].acp-success{--mat-fab-small-container-color: #4caf50;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-warning{--mat-fab-small-container-color: #f59e0b;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-info{--mat-fab-small-container-color: #3b82f6;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-dark{--mat-fab-small-container-color: #1f2937;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}.acp-square{--mat-button-filled-container-shape: 8px;--mat-button-outlined-container-shape: 8px;--mat-button-protected-container-shape: 8px;--mat-button-text-container-shape: 8px;--mat-button-tonal-container-shape: 8px;--mat-icon-button-container-shape: 8px}.acp-block{width:100%}.acp-medium{--mat-checkbox-touch-target-display: block;--mat-checkbox-state-layer-size: 36px;--mat-chip-container-height: 28px;--mat-expansion-header-collapsed-state-height: 44px;--mat-expansion-header-expanded-state-height: 60px;--mat-fab-small-touch-target-display: ;--mat-fab-touch-target-display: block;--mat-button-filled-touch-target-display: block;--mat-button-filled-container-height: 36px;--mat-button-outlined-container-height: 36px;--mat-button-outlined-touch-target-display: block;--mat-button-protected-touch-target-display: block;--mat-button-protected-container-height: 36px;--mat-button-text-touch-target-display: block;--mat-button-text-container-height: 36px;--mat-button-tonal-container-height: 36px;--mat-button-tonal-touch-target-display: block;--mat-form-field-container-height: 52px;--mat-form-field-filled-label-display: block;--mat-form-field-container-vertical-padding: 14px;--mat-form-field-filled-with-label-container-padding-top: 22px;--mat-form-field-filled-with-label-container-padding-bottom: 6px;--mat-icon-button-touch-target-display: block;--mat-icon-button-state-layer-size: 36px;--mat-list-list-item-leading-icon-start-space: 12px;--mat-list-list-item-leading-icon-end-space: 12px;--mat-list-list-item-one-line-container-height: 44px;--mat-list-list-item-two-line-container-height: 60px;--mat-list-list-item-three-line-container-height: 84px;--mat-paginator-container-size: 52px;--mat-paginator-form-field-container-height: 40px;--mat-paginator-form-field-container-vertical-padding: 8px;--mat-paginator-touch-target-display: block;--mat-radio-touch-target-display: block;--mat-radio-state-layer-size: 36px;--mat-tab-container-height: 44px;--mat-select-arrow-transform: translateY(-8px);--mat-button-toggle-height: 40px;--mat-stepper-header-height: 68px;--mat-table-header-container-height: 52px;--mat-table-footer-container-height: 48px;--mat-table-row-item-container-height: 48px;--mat-toolbar-standard-height: 60px;--mat-toolbar-mobile-height: 52px;--mat-tree-node-min-height: 44px;--mat-sys-corner-extra-large: 28px;--mat-sys-corner-extra-large-top: 28px 28px 0 0;--mat-sys-corner-extra-small: 4px;--mat-sys-corner-extra-small-top: 4px 4px 0 0;--mat-sys-corner-full: 9999px;--mat-sys-corner-large: 16px;--mat-sys-corner-large-end: 0 16px 16px 0;--mat-sys-corner-large-start: 16px 0 0 16px;--mat-sys-corner-large-top: 16px 16px 0 0;--mat-sys-corner-medium: 12px;--mat-sys-corner-none: 0;--mat-sys-corner-small: 8px;--mat-sys-dragged-state-layer-opacity: .16;--mat-sys-focus-state-layer-opacity: .12;--mat-sys-hover-state-layer-opacity: .08;--mat-sys-pressed-state-layer-opacity: .12;--mat-button-filled-horizontal-padding: 20px;--mat-button-outlined-horizontal-padding: 20px;--mat-button-protected-horizontal-padding: 20px;--mat-button-text-horizontal-padding: 20px;--mat-button-tonal-horizontal-padding: 20px;--mat-button-toggle-height: 36px}.acp-small{--mat-checkbox-touch-target-display: none;--mat-checkbox-state-layer-size: 32px;--mat-chip-container-height: 24px;--mat-expansion-header-collapsed-state-height: 40px;--mat-expansion-header-expanded-state-height: 56px;--mat-fab-small-touch-target-display: ;--mat-fab-touch-target-display: none;--mat-button-filled-touch-target-display: none;--mat-button-filled-container-height: 32px;--mat-button-outlined-container-height: 32px;--mat-button-outlined-touch-target-display: none;--mat-button-protected-touch-target-display: none;--mat-button-protected-container-height: 32px;--mat-button-text-touch-target-display: none;--mat-button-text-container-height: 32px;--mat-button-tonal-container-height: 32px;--mat-button-tonal-touch-target-display: none;--mat-form-field-container-height: 48px;--mat-form-field-filled-label-display: none;--mat-form-field-container-vertical-padding: 12px;--mat-form-field-filled-with-label-container-padding-top: 12px;--mat-form-field-filled-with-label-container-padding-bottom: 12px;--mat-icon-button-touch-target-display: none;--mat-icon-button-state-layer-size: 32px;--mat-list-list-item-leading-icon-start-space: 8px;--mat-list-list-item-leading-icon-end-space: 8px;--mat-list-list-item-one-line-container-height: 40px;--mat-list-list-item-two-line-container-height: 56px;--mat-list-list-item-three-line-container-height: 80px;--mat-paginator-container-size: 48px;--mat-paginator-form-field-container-height: 40px;--mat-paginator-form-field-container-vertical-padding: 8px;--mat-paginator-touch-target-display: none;--mat-radio-touch-target-display: none;--mat-radio-state-layer-size: 32px;--mat-tab-container-height: 40px;--mat-select-arrow-transform: none;--mat-button-toggle-height: 40px;--mat-stepper-header-height: 64px;--mat-table-header-container-height: 48px;--mat-table-footer-container-height: 44px;--mat-table-row-item-container-height: 44px;--mat-toolbar-standard-height: 56px;--mat-toolbar-mobile-height: 48px;--mat-tree-node-min-height: 40px;--mat-sys-corner-extra-large: 28px;--mat-sys-corner-extra-large-top: 28px 28px 0 0;--mat-sys-corner-extra-small: 4px;--mat-sys-corner-extra-small-top: 4px 4px 0 0;--mat-sys-corner-full: 9999px;--mat-sys-corner-large: 16px;--mat-sys-corner-large-end: 0 16px 16px 0;--mat-sys-corner-large-start: 16px 0 0 16px;--mat-sys-corner-large-top: 16px 16px 0 0;--mat-sys-corner-medium: 12px;--mat-sys-corner-none: 0;--mat-sys-corner-small: 8px;--mat-sys-dragged-state-layer-opacity: .16;--mat-sys-focus-state-layer-opacity: .12;--mat-sys-hover-state-layer-opacity: .08;--mat-sys-pressed-state-layer-opacity: .12;--mat-button-filled-horizontal-padding: 16px;--mat-button-outlined-horizontal-padding: 16px;--mat-button-protected-horizontal-padding: 16px;--mat-button-text-horizontal-padding: 16px;--mat-button-tonal-horizontal-padding: 16px}\n"] }]
|
|
1728
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (variant() === 'icon') {\n<button\n matIconButton\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"[colorClass(), squareClass(), blockClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n <mat-icon>{{icon()}}</mat-icon>\n</button>\n} @else if (variant() === 'fab') {\n<button\n matFab\n [extended]=\"extended()\"\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"[colorClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n @if (icon()) { <mat-icon>{{icon()}}</mat-icon> } @if (extended()) { @if (hasText()) { {{text()}} }\n @else { <ng-content></ng-content> } }\n</button>\n} @else if (variant() === 'mini-fab') {\n<button\n matMiniFab\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [type]=\"type()\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"[colorClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n <mat-icon>{{icon()}}</mat-icon>\n</button>\n} @else {\n<button\n [matButton]=\"appearance()\"\n [disabled]=\"isDisabled()\"\n [disableRipple]=\"disableRipple()\"\n [acpLoading]=\"loading()\"\n [showProgress]=\"showProgress()\"\n [type]=\"type()\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel()\"\n [ngClass]=\"[colorClass(), squareClass(), blockClass(), sizeClass()]\"\n (click)=\"clicked.emit()\"\n (focus)=\"focused.emit()\"\n (blur)=\"blurred.emit()\"\n>\n @if (icon()) { <mat-icon>{{icon()}}</mat-icon> } @if (hasText()) { {{text()}} } @else {\n <ng-content></ng-content> } @if (showProgress() && progressType() === 'spinner') {\n <mat-progress-spinner\n progressIndicator\n mode=\"indeterminate\"\n [diameter]=\"20\"\n aria-label=\"Loading\"\n />\n } @if (showProgress() && progressType() === 'text') {\n <div progressIndicator role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n {{ progressText() }}\n </div>\n } @if (suffixIcon()) {\n <mat-icon iconPositionEnd>{{suffixIcon()}}</mat-icon> }\n</button>\n}\n", styles: [".acp-primary{--mat-button-filled-container-color: var(--acp-theme-primary-color);--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: var(--acp-theme-primary-color);--mat-button-protected-label-text-color: var(--acp-theme-primary-color);--mat-button-text-label-text-color: var(--acp-theme-primary-color);--mat-button-text-state-layer-color: var(--acp-theme-primary-color)}.acp-secondary{--mat-button-filled-container-color: var(--mat-sys-secondary);--mat-button-filled-label-text-color: var(--mat-sys-on-secondary);--mat-button-outlined-label-text-color: var(--mat-sys-secondary);--mat-button-protected-label-text-color: var(--mat-sys-secondary);--mat-button-text-label-text-color: var(--mat-sys-secondary);--mat-button-text-state-layer-color: var(--mat-sys-secondary)}.acp-accent{--mat-button-filled-container-color: var(--mat-sys-tertiary);--mat-button-filled-label-text-color: var(--mat-sys-on-tertiary);--mat-button-outlined-label-text-color: var(--mat-sys-tertiary);--mat-button-protected-label-text-color: var(--mat-sys-tertiary);--mat-button-text-label-text-color: var(--mat-sys-tertiary);--mat-button-text-state-layer-color: var(--mat-sys-tertiary)}.acp-error{--mat-button-filled-container-color: var(--mat-sys-error);--mat-button-filled-label-text-color: var(--mat-sys-on-error);--mat-button-outlined-label-text-color: var(--mat-sys-error);--mat-button-protected-label-text-color: var(--mat-sys-error);--mat-button-text-label-text-color: var(--mat-sys-error);--mat-button-text-state-layer-color: var(--mat-sys-error)}.acp-success{--mat-button-filled-container-color: #4caf50;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #4caf50;--mat-button-protected-label-text-color: #4caf50;--mat-button-text-label-text-color: #4caf50;--mat-button-text-state-layer-color: #4caf50}.acp-warning{--mat-button-filled-container-color: #f59e0b;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #f59e0b;--mat-button-protected-label-text-color: #f59e0b;--mat-button-text-label-text-color: #f59e0b;--mat-button-text-state-layer-color: #f59e0b}.acp-info{--mat-button-filled-container-color: #3b82f6;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: #3b82f6;--mat-button-protected-label-text-color: #3b82f6;--mat-button-text-label-text-color: #3b82f6;--mat-button-text-state-layer-color: #3b82f6}.acp-dark{--mat-button-filled-container-color: #1f2937;--mat-button-filled-label-text-color: #ffffff;--mat-button-outlined-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-protected-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-text-label-text-color: light-dark(#1f2937, #ffffff);--mat-button-text-state-layer-color: light-dark(#1f2937, #ffffff)}[matIconButton].acp-primary{--mat-icon-color: var(--acp-theme-primary-color)}[matIconButton].acp-secondary{--mat-icon-color: var(--mat-sys-secondary)}[matIconButton].acp-accent{--mat-icon-color: var(--mat-sys-tertiary)}[matIconButton].acp-error{--mat-icon-color: var(--mat-sys-error)}[matIconButton].acp-success{--mat-icon-color: #10b981}[matIconButton].acp-warning{--mat-icon-color: #f59e0b}[matIconButton].acp-info{--mat-icon-color: #3b82f6}[matIconButton].acp-light{--mat-icon-color: #ffffff}[matFab].acp-primary{--mat-fab-container-color: var(--acp-theme-primary-color);--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-secondary{--mat-fab-container-color: var(--mat-sys-secondary);--mat-fab-foreground-color: var(--mat-sys-on-secondary);--mat-fab-state-layer-color: var(--mat-sys-on-secondary)}[matFab].acp-accent{--mat-fab-container-color: var(--mat-sys-tertiary);--mat-fab-foreground-color: var(--mat-sys-on-tertiary);--mat-fab-state-layer-color: var(--mat-sys-on-tertiary)}[matFab].acp-error{--mat-fab-container-color: var(--mat-sys-error);--mat-fab-foreground-color: var(--mat-sys-on-error);--mat-fab-state-layer-color: var(--mat-sys-on-error)}[matFab].acp-success{--mat-fab-container-color: #4caf50;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-warning{--mat-fab-container-color: #f59e0b;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-info{--mat-fab-container-color: #3b82f6;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matFab].acp-dark{--mat-fab-container-color: #1f2937;--mat-fab-foreground-color: #ffffff;--mat-fab-state-layer-color: #ffffff}[matMiniFab].acp-primary{--mat-fab-small-container-color: var(--acp-theme-primary-color);--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-secondary{--mat-fab-small-container-color: var(--mat-sys-secondary);--mat-fab-small-foreground-color: var(--mat-sys-on-secondary);--mat-fab-small-state-layer-color: var(--mat-sys-on-secondary)}[matMiniFab].acp-accent{--mat-fab-small-container-color: var(--mat-sys-tertiary);--mat-fab-small-foreground-color: var(--mat-sys-on-tertiary);--mat-fab-small-state-layer-color: var(--mat-sys-on-tertiary)}[matMiniFab].acp-error{--mat-fab-small-container-color: var(--mat-sys-error);--mat-fab-small-foreground-color: var(--mat-sys-on-error);--mat-fab-small-state-layer-color: var(--mat-sys-on-error)}[matMiniFab].acp-success{--mat-fab-small-container-color: #4caf50;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-warning{--mat-fab-small-container-color: #f59e0b;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-info{--mat-fab-small-container-color: #3b82f6;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}[matMiniFab].acp-dark{--mat-fab-small-container-color: #1f2937;--mat-fab-small-foreground-color: #ffffff;--mat-fab-small-state-layer-color: #ffffff}.acp-square{--mat-button-filled-container-shape: 8px;--mat-button-outlined-container-shape: 8px;--mat-button-protected-container-shape: 8px;--mat-button-text-container-shape: 8px;--mat-button-tonal-container-shape: 8px;--mat-icon-button-container-shape: 8px}.acp-block{width:100%}.acp-medium{--mat-checkbox-touch-target-display: block;--mat-checkbox-state-layer-size: 36px;--mat-chip-container-height: 28px;--mat-expansion-header-collapsed-state-height: 44px;--mat-expansion-header-expanded-state-height: 60px;--mat-fab-small-touch-target-display: ;--mat-fab-touch-target-display: block;--mat-button-filled-touch-target-display: block;--mat-button-filled-container-height: 36px;--mat-button-outlined-container-height: 36px;--mat-button-outlined-touch-target-display: block;--mat-button-protected-touch-target-display: block;--mat-button-protected-container-height: 36px;--mat-button-text-touch-target-display: block;--mat-button-text-container-height: 36px;--mat-button-tonal-container-height: 36px;--mat-button-tonal-touch-target-display: block;--mat-form-field-container-height: 52px;--mat-form-field-filled-label-display: block;--mat-form-field-container-vertical-padding: 14px;--mat-form-field-filled-with-label-container-padding-top: 22px;--mat-form-field-filled-with-label-container-padding-bottom: 6px;--mat-icon-button-touch-target-display: block;--mat-icon-button-state-layer-size: 36px;--mat-list-list-item-leading-icon-start-space: 12px;--mat-list-list-item-leading-icon-end-space: 12px;--mat-list-list-item-one-line-container-height: 44px;--mat-list-list-item-two-line-container-height: 60px;--mat-list-list-item-three-line-container-height: 84px;--mat-paginator-container-size: 52px;--mat-paginator-form-field-container-height: 40px;--mat-paginator-form-field-container-vertical-padding: 8px;--mat-paginator-touch-target-display: block;--mat-radio-touch-target-display: block;--mat-radio-state-layer-size: 36px;--mat-tab-container-height: 44px;--mat-select-arrow-transform: translateY(-8px);--mat-button-toggle-height: 40px;--mat-stepper-header-height: 68px;--mat-table-header-container-height: 52px;--mat-table-footer-container-height: 48px;--mat-table-row-item-container-height: 48px;--mat-toolbar-standard-height: 60px;--mat-toolbar-mobile-height: 52px;--mat-tree-node-min-height: 44px;--mat-sys-corner-extra-large: 28px;--mat-sys-corner-extra-large-top: 28px 28px 0 0;--mat-sys-corner-extra-small: 4px;--mat-sys-corner-extra-small-top: 4px 4px 0 0;--mat-sys-corner-full: 9999px;--mat-sys-corner-large: 16px;--mat-sys-corner-large-end: 0 16px 16px 0;--mat-sys-corner-large-start: 16px 0 0 16px;--mat-sys-corner-large-top: 16px 16px 0 0;--mat-sys-corner-medium: 12px;--mat-sys-corner-none: 0;--mat-sys-corner-small: 8px;--mat-sys-dragged-state-layer-opacity: .16;--mat-sys-focus-state-layer-opacity: .12;--mat-sys-hover-state-layer-opacity: .08;--mat-sys-pressed-state-layer-opacity: .12;--mat-button-filled-horizontal-padding: 20px;--mat-button-outlined-horizontal-padding: 20px;--mat-button-protected-horizontal-padding: 20px;--mat-button-text-horizontal-padding: 20px;--mat-button-tonal-horizontal-padding: 20px;--mat-button-toggle-height: 36px}.acp-small{--mat-checkbox-touch-target-display: none;--mat-checkbox-state-layer-size: 32px;--mat-chip-container-height: 24px;--mat-expansion-header-collapsed-state-height: 40px;--mat-expansion-header-expanded-state-height: 56px;--mat-fab-small-touch-target-display: ;--mat-fab-touch-target-display: none;--mat-button-filled-touch-target-display: none;--mat-button-filled-container-height: 32px;--mat-button-outlined-container-height: 32px;--mat-button-outlined-touch-target-display: none;--mat-button-protected-touch-target-display: none;--mat-button-protected-container-height: 32px;--mat-button-text-touch-target-display: none;--mat-button-text-container-height: 32px;--mat-button-tonal-container-height: 32px;--mat-button-tonal-touch-target-display: none;--mat-form-field-container-height: 48px;--mat-form-field-filled-label-display: none;--mat-form-field-container-vertical-padding: 12px;--mat-form-field-filled-with-label-container-padding-top: 12px;--mat-form-field-filled-with-label-container-padding-bottom: 12px;--mat-icon-button-touch-target-display: none;--mat-icon-button-state-layer-size: 32px;--mat-list-list-item-leading-icon-start-space: 8px;--mat-list-list-item-leading-icon-end-space: 8px;--mat-list-list-item-one-line-container-height: 40px;--mat-list-list-item-two-line-container-height: 56px;--mat-list-list-item-three-line-container-height: 80px;--mat-paginator-container-size: 48px;--mat-paginator-form-field-container-height: 40px;--mat-paginator-form-field-container-vertical-padding: 8px;--mat-paginator-touch-target-display: none;--mat-radio-touch-target-display: none;--mat-radio-state-layer-size: 32px;--mat-tab-container-height: 40px;--mat-select-arrow-transform: none;--mat-button-toggle-height: 40px;--mat-stepper-header-height: 64px;--mat-table-header-container-height: 48px;--mat-table-footer-container-height: 44px;--mat-table-row-item-container-height: 44px;--mat-toolbar-standard-height: 56px;--mat-toolbar-mobile-height: 48px;--mat-tree-node-min-height: 40px;--mat-sys-corner-extra-large: 28px;--mat-sys-corner-extra-large-top: 28px 28px 0 0;--mat-sys-corner-extra-small: 4px;--mat-sys-corner-extra-small-top: 4px 4px 0 0;--mat-sys-corner-full: 9999px;--mat-sys-corner-large: 16px;--mat-sys-corner-large-end: 0 16px 16px 0;--mat-sys-corner-large-start: 16px 0 0 16px;--mat-sys-corner-large-top: 16px 16px 0 0;--mat-sys-corner-medium: 12px;--mat-sys-corner-none: 0;--mat-sys-corner-small: 8px;--mat-sys-dragged-state-layer-opacity: .16;--mat-sys-focus-state-layer-opacity: .12;--mat-sys-hover-state-layer-opacity: .08;--mat-sys-pressed-state-layer-opacity: .12;--mat-button-filled-horizontal-padding: 16px;--mat-button-outlined-horizontal-padding: 16px;--mat-button-protected-horizontal-padding: 16px;--mat-button-text-horizontal-padding: 16px;--mat-button-tonal-horizontal-padding: 16px}\n"] }]
|
|
1537
1729
|
}] });
|
|
1538
1730
|
|
|
1539
1731
|
/**
|
|
1540
|
-
*
|
|
1541
|
-
*
|
|
1542
|
-
*
|
|
1732
|
+
* Token used to deliver `AcpDialogConfig.data` to the content component.
|
|
1733
|
+
* Content components read it with `inject(ACP_DIALOG_DATA)` (typed as `D`).
|
|
1734
|
+
* This is the single data channel, used identically for bare and shell dialogs.
|
|
1735
|
+
*/
|
|
1736
|
+
const ACP_DIALOG_DATA = new InjectionToken('ACP_DIALOG_DATA', {
|
|
1737
|
+
factory: () => null,
|
|
1738
|
+
});
|
|
1739
|
+
/**
|
|
1740
|
+
* Application-wide defaults for every dialog opened through `AcpDialogService`.
|
|
1741
|
+
* Mirrors `MAT_DIALOG_DEFAULT_OPTIONS` from Angular Material.
|
|
1742
|
+
* Per-call config always wins over these defaults.
|
|
1743
|
+
*/
|
|
1744
|
+
const ACP_DIALOG_DEFAULT_OPTIONS = new InjectionToken('ACP_DIALOG_DEFAULT_OPTIONS');
|
|
1745
|
+
/**
|
|
1746
|
+
* Token used by the declarative `<acp-dialog-actions>` component to register
|
|
1747
|
+
* its action buttons with the hosting `AcpDialogContainer`.
|
|
1748
|
+
*/
|
|
1749
|
+
const ACP_DIALOG_ACTIONS = new InjectionToken('ACP_DIALOG_ACTIONS');
|
|
1750
|
+
/**
|
|
1751
|
+
* Token used by the declarative `<acp-dialog-titlebar>` component to register
|
|
1752
|
+
* its template with the hosting `AcpDialogContainer`.
|
|
1753
|
+
*/
|
|
1754
|
+
const ACP_DIALOG_TITLEBAR = new InjectionToken('ACP_DIALOG_TITLEBAR');
|
|
1755
|
+
/**
|
|
1756
|
+
* Registers application-wide dialog defaults, e.g.:
|
|
1757
|
+
* `provideAcpDialogDefaults({ fullScreenOnMobile: true })`.
|
|
1758
|
+
*/
|
|
1759
|
+
function provideAcpDialogDefaults(defaults) {
|
|
1760
|
+
return makeEnvironmentProviders([{ provide: ACP_DIALOG_DEFAULT_OPTIONS, useValue: defaults }]);
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
/**
|
|
1764
|
+
* Dialog actions container. Use it declaratively inside a dialog content
|
|
1765
|
+
* template, or let `AcpDialogContainer` instantiate it from `config.actions`.
|
|
1766
|
+
*
|
|
1767
|
+
* @example
|
|
1768
|
+
* ```html
|
|
1769
|
+
* <acp-dialog-actions align="end">
|
|
1770
|
+
* <acp-button text="Cancel" appearance="text" (clicked)="ref.close()" />
|
|
1771
|
+
* <acp-button text="Save" color="success" (clicked)="ref.close(user)" />
|
|
1772
|
+
* </acp-dialog-actions>
|
|
1773
|
+
* ```
|
|
1774
|
+
*/
|
|
1775
|
+
class AcpDialogActions {
|
|
1776
|
+
outlet = inject(ACP_DIALOG_ACTIONS, { optional: true });
|
|
1777
|
+
matDialogRef = inject(MatDialogRef, { optional: true });
|
|
1778
|
+
containerData = inject(MAT_DIALOG_DATA, {
|
|
1779
|
+
optional: true,
|
|
1780
|
+
});
|
|
1781
|
+
injector = inject(Injector);
|
|
1782
|
+
actionsTemplateRef = viewChild.required('actionsTemplate', { ...(ngDevMode ? { debugName: "actionsTemplateRef" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
1783
|
+
actionStateSignals = new WeakMap();
|
|
1784
|
+
renderInline = signal(this.outlet == null, /* @ts-ignore */
|
|
1785
|
+
...(ngDevMode ? [{ debugName: "renderInline" }] : /* istanbul ignore next */ []));
|
|
1786
|
+
hostDisplay = signal(this.outlet == null ? 'contents' : 'none', /* @ts-ignore */
|
|
1787
|
+
...(ngDevMode ? [{ debugName: "hostDisplay" }] : /* istanbul ignore next */ []));
|
|
1788
|
+
/** Alignment of the action buttons. @default 'end' */
|
|
1789
|
+
align = input('end', /* @ts-ignore */
|
|
1790
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
1791
|
+
/** Configured footer actions. When omitted, the component works as a declarative slot. */
|
|
1792
|
+
actions = input(/* @ts-ignore */
|
|
1793
|
+
...(ngDevMode ? [undefined, { debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
1794
|
+
/** Optional title used to label the actions footer. */
|
|
1795
|
+
dialogTitle = input(/* @ts-ignore */
|
|
1796
|
+
...(ngDevMode ? [undefined, { debugName: "dialogTitle" }] : /* istanbul ignore next */ []));
|
|
1797
|
+
/** Accessible label for the actions footer. Falls back to a generated one. */
|
|
1798
|
+
ariaLabel = computed(() => {
|
|
1799
|
+
const title = this.dialogTitle();
|
|
1800
|
+
return title ? `Actions for ${title}` : 'Dialog actions';
|
|
1801
|
+
}, /* @ts-ignore */
|
|
1802
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1803
|
+
ngAfterViewInit() {
|
|
1804
|
+
if (this.outlet) {
|
|
1805
|
+
this.outlet.register(this.actionsTemplateRef(), this.align());
|
|
1806
|
+
this.hostDisplay.set('none');
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
/** Resolves an action's boolean state (boolean, signal or observable). */
|
|
1810
|
+
resolveActionState(state) {
|
|
1811
|
+
if (state === undefined) {
|
|
1812
|
+
return false;
|
|
1813
|
+
}
|
|
1814
|
+
if (typeof state === 'boolean') {
|
|
1815
|
+
return state;
|
|
1816
|
+
}
|
|
1817
|
+
if (isSignal(state)) {
|
|
1818
|
+
return state();
|
|
1819
|
+
}
|
|
1820
|
+
if (isObservable(state)) {
|
|
1821
|
+
let sig = this.actionStateSignals.get(state);
|
|
1822
|
+
if (!sig) {
|
|
1823
|
+
sig = toSignal(state, { injector: this.injector, initialValue: false });
|
|
1824
|
+
this.actionStateSignals.set(state, sig);
|
|
1825
|
+
}
|
|
1826
|
+
return sig();
|
|
1827
|
+
}
|
|
1828
|
+
return false;
|
|
1829
|
+
}
|
|
1830
|
+
/** Broadcasts the click and closes the dialog unless the event is prevented. */
|
|
1831
|
+
handleActionClick(event, action) {
|
|
1832
|
+
const click = { action, event };
|
|
1833
|
+
this.containerData?.actionClicks?.next(click);
|
|
1834
|
+
}
|
|
1835
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1836
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AcpDialogActions, isStandalone: true, selector: "acp-dialog-actions", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, dialogTitle: { classPropertyName: "dialogTitle", publicName: "dialogTitle", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "style.display": "hostDisplay()" } }, viewQueries: [{ propertyName: "actionsTemplateRef", first: true, predicate: ["actionsTemplate"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: `
|
|
1837
|
+
<ng-template #actionsTemplate><ng-content /></ng-template>
|
|
1838
|
+
|
|
1839
|
+
@if (renderInline()) {
|
|
1840
|
+
<mat-dialog-actions
|
|
1841
|
+
class="acp-dialog-actions"
|
|
1842
|
+
[align]="align()"
|
|
1843
|
+
[attr.aria-label]="ariaLabel()"
|
|
1844
|
+
>
|
|
1845
|
+
@for (action of actions() ?? []; track action.key ?? action.text ?? $index) {
|
|
1846
|
+
<acp-button
|
|
1847
|
+
[text]="action.text"
|
|
1848
|
+
[color]="action.color ?? 'primary'"
|
|
1849
|
+
[appearance]="action.appearance ?? 'filled'"
|
|
1850
|
+
[variant]="action.variant ?? 'basic'"
|
|
1851
|
+
[icon]="action.icon"
|
|
1852
|
+
[suffixIcon]="action.suffixIcon"
|
|
1853
|
+
[disabled]="resolveActionState(action.disabled)"
|
|
1854
|
+
[loading]="resolveActionState(action.loading)"
|
|
1855
|
+
[ariaLabel]="action.ariaLabel"
|
|
1856
|
+
[size]="action.size ?? 'large'"
|
|
1857
|
+
[block]="action.block ?? false"
|
|
1858
|
+
[extended]="action.extended ?? false"
|
|
1859
|
+
[type]="action.type ?? 'button'"
|
|
1860
|
+
[form]="action.form"
|
|
1861
|
+
(click)="handleActionClick($event, action)"
|
|
1862
|
+
/>
|
|
1863
|
+
}
|
|
1864
|
+
<ng-container [ngTemplateOutlet]="actionsTemplate" />
|
|
1865
|
+
</mat-dialog-actions>
|
|
1866
|
+
}
|
|
1867
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: AcpButton, selector: "acp-button" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1868
|
+
}
|
|
1869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogActions, decorators: [{
|
|
1870
|
+
type: Component,
|
|
1871
|
+
args: [{
|
|
1872
|
+
selector: 'acp-dialog-actions',
|
|
1873
|
+
standalone: true,
|
|
1874
|
+
imports: [MatDialogModule, AcpButton, NgTemplateOutlet],
|
|
1875
|
+
template: `
|
|
1876
|
+
<ng-template #actionsTemplate><ng-content /></ng-template>
|
|
1877
|
+
|
|
1878
|
+
@if (renderInline()) {
|
|
1879
|
+
<mat-dialog-actions
|
|
1880
|
+
class="acp-dialog-actions"
|
|
1881
|
+
[align]="align()"
|
|
1882
|
+
[attr.aria-label]="ariaLabel()"
|
|
1883
|
+
>
|
|
1884
|
+
@for (action of actions() ?? []; track action.key ?? action.text ?? $index) {
|
|
1885
|
+
<acp-button
|
|
1886
|
+
[text]="action.text"
|
|
1887
|
+
[color]="action.color ?? 'primary'"
|
|
1888
|
+
[appearance]="action.appearance ?? 'filled'"
|
|
1889
|
+
[variant]="action.variant ?? 'basic'"
|
|
1890
|
+
[icon]="action.icon"
|
|
1891
|
+
[suffixIcon]="action.suffixIcon"
|
|
1892
|
+
[disabled]="resolveActionState(action.disabled)"
|
|
1893
|
+
[loading]="resolveActionState(action.loading)"
|
|
1894
|
+
[ariaLabel]="action.ariaLabel"
|
|
1895
|
+
[size]="action.size ?? 'large'"
|
|
1896
|
+
[block]="action.block ?? false"
|
|
1897
|
+
[extended]="action.extended ?? false"
|
|
1898
|
+
[type]="action.type ?? 'button'"
|
|
1899
|
+
[form]="action.form"
|
|
1900
|
+
(click)="handleActionClick($event, action)"
|
|
1901
|
+
/>
|
|
1902
|
+
}
|
|
1903
|
+
<ng-container [ngTemplateOutlet]="actionsTemplate" />
|
|
1904
|
+
</mat-dialog-actions>
|
|
1905
|
+
}
|
|
1906
|
+
`,
|
|
1907
|
+
host: {
|
|
1908
|
+
role: 'group',
|
|
1909
|
+
'[style.display]': 'hostDisplay()',
|
|
1910
|
+
},
|
|
1911
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1912
|
+
encapsulation: ViewEncapsulation.None,
|
|
1913
|
+
}]
|
|
1914
|
+
}], propDecorators: { actionsTemplateRef: [{ type: i0.ViewChild, args: ['actionsTemplate', { ...{ read: TemplateRef }, isSignal: true }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], dialogTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogTitle", required: false }] }] } });
|
|
1915
|
+
|
|
1916
|
+
/**
|
|
1917
|
+
* Dialog title bar. Use it inside a dialog content template for a declarative
|
|
1918
|
+
* header, or let `AcpDialogContainer` instantiate it from `config.header`.
|
|
1919
|
+
*
|
|
1920
|
+
* @example
|
|
1921
|
+
* ```html
|
|
1922
|
+
* <acp-dialog-titlebar title="Edit user" icon="person">
|
|
1923
|
+
* <acp-dialog-actions align="end">
|
|
1924
|
+
* <acp-button text="Cancel" appearance="text" (clicked)="ref.close()" />
|
|
1925
|
+
* <acp-button text="Save" color="success" (clicked)="ref.close(user)" />
|
|
1926
|
+
* </acp-dialog-actions>
|
|
1927
|
+
* </acp-dialog-titlebar>
|
|
1928
|
+
* ```
|
|
1929
|
+
*/
|
|
1930
|
+
class AcpDialogTitlebar {
|
|
1931
|
+
elementRef = inject(ElementRef);
|
|
1932
|
+
matDialogRef = inject(MatDialogRef, { optional: true });
|
|
1933
|
+
outlet = inject(ACP_DIALOG_TITLEBAR, { optional: true });
|
|
1934
|
+
titlebarTemplateRef = viewChild.required('titlebarTemplate', { ...(ngDevMode ? { debugName: "titlebarTemplateRef" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
1935
|
+
renderInline = signal(this.outlet == null, /* @ts-ignore */
|
|
1936
|
+
...(ngDevMode ? [{ debugName: "renderInline" }] : /* istanbul ignore next */ []));
|
|
1937
|
+
hostDisplay = signal(this.outlet == null ? 'contents' : 'none', /* @ts-ignore */
|
|
1938
|
+
...(ngDevMode ? [{ debugName: "hostDisplay" }] : /* istanbul ignore next */ []));
|
|
1939
|
+
/** CSS classes applied to the header element. */
|
|
1940
|
+
headerClasses = computed(() => {
|
|
1941
|
+
const classes = ['acp-dialog-header'];
|
|
1942
|
+
if (this.color()) {
|
|
1943
|
+
classes.push(`acp-dialog-header--${this.color()}`);
|
|
1944
|
+
}
|
|
1945
|
+
if (this.colorClass()) {
|
|
1946
|
+
classes.push(this.colorClass());
|
|
1947
|
+
}
|
|
1948
|
+
return classes.join(' ');
|
|
1949
|
+
}, /* @ts-ignore */
|
|
1950
|
+
...(ngDevMode ? [{ debugName: "headerClasses" }] : /* istanbul ignore next */ []));
|
|
1951
|
+
/** Close-button color resolved from `closeColor` or the header background. */
|
|
1952
|
+
resolvedCloseColor = computed(() => {
|
|
1953
|
+
const requested = this.closeColor();
|
|
1954
|
+
if (requested) {
|
|
1955
|
+
return requested;
|
|
1956
|
+
}
|
|
1957
|
+
const darkBackgrounds = new Set([
|
|
1958
|
+
'primary',
|
|
1959
|
+
'secondary',
|
|
1960
|
+
'accent',
|
|
1961
|
+
'success',
|
|
1962
|
+
'info',
|
|
1963
|
+
'error',
|
|
1964
|
+
'danger',
|
|
1965
|
+
'dark',
|
|
1966
|
+
]);
|
|
1967
|
+
return darkBackgrounds.has(this.color() ?? '') ? 'light' : 'dark';
|
|
1968
|
+
}, /* @ts-ignore */
|
|
1969
|
+
...(ngDevMode ? [{ debugName: "resolvedCloseColor" }] : /* istanbul ignore next */ []));
|
|
1970
|
+
/** Title text shown in the header. */
|
|
1971
|
+
title = input(/* @ts-ignore */
|
|
1972
|
+
...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1973
|
+
/** Optional subtitle shown below the title. */
|
|
1974
|
+
subtitle = input(/* @ts-ignore */
|
|
1975
|
+
...(ngDevMode ? [undefined, { debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
1976
|
+
/** Optional Material icon name displayed before the title. */
|
|
1977
|
+
icon = input(/* @ts-ignore */
|
|
1978
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1979
|
+
/** Whether the close button is shown. @default true */
|
|
1980
|
+
closable = input(true, /* @ts-ignore */
|
|
1981
|
+
...(ngDevMode ? [{ debugName: "closable" }] : /* istanbul ignore next */ []));
|
|
1982
|
+
/** Accessible label for the close button. @default 'Close dialog' */
|
|
1983
|
+
closeLabel = input('Close dialog', /* @ts-ignore */
|
|
1984
|
+
...(ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []));
|
|
1985
|
+
/** Whether the dialog can be dragged by its header. @default true */
|
|
1986
|
+
draggable = input(true, /* @ts-ignore */
|
|
1987
|
+
...(ngDevMode ? [{ debugName: "draggable" }] : /* istanbul ignore next */ []));
|
|
1988
|
+
/** Predefined header color theme. */
|
|
1989
|
+
color = input(/* @ts-ignore */
|
|
1990
|
+
...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1991
|
+
/** Additional CSS class names to apply to the header. */
|
|
1992
|
+
colorClass = input(/* @ts-ignore */
|
|
1993
|
+
...(ngDevMode ? [undefined, { debugName: "colorClass" }] : /* istanbul ignore next */ []));
|
|
1994
|
+
/** Explicit close icon color. If omitted, it is chosen from the header `color`. */
|
|
1995
|
+
closeColor = input(/* @ts-ignore */
|
|
1996
|
+
...(ngDevMode ? [undefined, { debugName: "closeColor" }] : /* istanbul ignore next */ []));
|
|
1997
|
+
/** Emitted when the close button is clicked and no `MatDialogRef` is available. */
|
|
1998
|
+
closed = output();
|
|
1999
|
+
close() {
|
|
2000
|
+
if (this.matDialogRef) {
|
|
2001
|
+
this.matDialogRef.close();
|
|
2002
|
+
}
|
|
2003
|
+
else {
|
|
2004
|
+
this.closed.emit();
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
bringToFront() {
|
|
2008
|
+
const pane = this.elementRef.nativeElement.closest('.cdk-overlay-pane');
|
|
2009
|
+
if (pane) {
|
|
2010
|
+
const current = parseInt(pane.style.zIndex || '1000', 10);
|
|
2011
|
+
const next = Math.max(1000, isNaN(current) ? 1000 : current + 1);
|
|
2012
|
+
pane.style.zIndex = next.toString();
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
ngAfterViewInit() {
|
|
2016
|
+
if (this.outlet) {
|
|
2017
|
+
this.outlet.register(this.titlebarTemplateRef(), this.title());
|
|
2018
|
+
this.hostDisplay.set('none');
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogTitlebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2022
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AcpDialogTitlebar, isStandalone: true, selector: "acp-dialog-titlebar", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, colorClass: { classPropertyName: "colorClass", publicName: "colorClass", isSignal: true, isRequired: false, transformFunction: null }, closeColor: { classPropertyName: "closeColor", publicName: "closeColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { properties: { "style.display": "hostDisplay()" }, classAttribute: "acp-dialog-titlebar" }, viewQueries: [{ propertyName: "titlebarTemplateRef", first: true, predicate: ["titlebarTemplate"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: `
|
|
2023
|
+
<ng-template #titlebarTemplate>
|
|
2024
|
+
<div
|
|
2025
|
+
[class]="headerClasses()"
|
|
2026
|
+
cdkDrag
|
|
2027
|
+
cdkDragRootElement=".cdk-overlay-pane"
|
|
2028
|
+
[cdkDragDisabled]="draggable() === false"
|
|
2029
|
+
cdkDragHandle
|
|
2030
|
+
(mousedown)="bringToFront()"
|
|
2031
|
+
>
|
|
2032
|
+
<h6 mat-dialog-title class="acp-dialog-title">
|
|
2033
|
+
@if (icon()) {
|
|
2034
|
+
<mat-icon class="acp-dialog-title-icon" aria-hidden="true">{{ icon() }}</mat-icon>
|
|
2035
|
+
}
|
|
2036
|
+
<span>
|
|
2037
|
+
@if (title()) {
|
|
2038
|
+
{{ title() }}
|
|
2039
|
+
} @else {
|
|
2040
|
+
<ng-content />
|
|
2041
|
+
}
|
|
2042
|
+
</span>
|
|
2043
|
+
@if (closable() !== false) {
|
|
2044
|
+
<acp-button
|
|
2045
|
+
class="acp-dialog-close-btn"
|
|
2046
|
+
variant="icon"
|
|
2047
|
+
icon="close"
|
|
2048
|
+
[color]="resolvedCloseColor()"
|
|
2049
|
+
[ariaLabel]="closeLabel() ?? 'Close dialog'"
|
|
2050
|
+
(clicked)="close()"
|
|
2051
|
+
/>
|
|
2052
|
+
}
|
|
2053
|
+
</h6>
|
|
2054
|
+
@if (subtitle()) {
|
|
2055
|
+
<p class="acp-dialog-subtitle">{{ subtitle() }}</p>
|
|
2056
|
+
}
|
|
2057
|
+
</div>
|
|
2058
|
+
</ng-template>
|
|
2059
|
+
|
|
2060
|
+
@if (renderInline()) {
|
|
2061
|
+
<ng-container [ngTemplateOutlet]="titlebarTemplate" />
|
|
2062
|
+
}
|
|
2063
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: AcpButton, selector: "acp-button" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2064
|
+
}
|
|
2065
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogTitlebar, decorators: [{
|
|
2066
|
+
type: Component,
|
|
2067
|
+
args: [{
|
|
2068
|
+
selector: 'acp-dialog-titlebar',
|
|
2069
|
+
standalone: true,
|
|
2070
|
+
imports: [CdkDrag, CdkDragHandle, MatDialogModule, MatIconModule, AcpButton, NgTemplateOutlet],
|
|
2071
|
+
template: `
|
|
2072
|
+
<ng-template #titlebarTemplate>
|
|
2073
|
+
<div
|
|
2074
|
+
[class]="headerClasses()"
|
|
2075
|
+
cdkDrag
|
|
2076
|
+
cdkDragRootElement=".cdk-overlay-pane"
|
|
2077
|
+
[cdkDragDisabled]="draggable() === false"
|
|
2078
|
+
cdkDragHandle
|
|
2079
|
+
(mousedown)="bringToFront()"
|
|
2080
|
+
>
|
|
2081
|
+
<h6 mat-dialog-title class="acp-dialog-title">
|
|
2082
|
+
@if (icon()) {
|
|
2083
|
+
<mat-icon class="acp-dialog-title-icon" aria-hidden="true">{{ icon() }}</mat-icon>
|
|
2084
|
+
}
|
|
2085
|
+
<span>
|
|
2086
|
+
@if (title()) {
|
|
2087
|
+
{{ title() }}
|
|
2088
|
+
} @else {
|
|
2089
|
+
<ng-content />
|
|
2090
|
+
}
|
|
2091
|
+
</span>
|
|
2092
|
+
@if (closable() !== false) {
|
|
2093
|
+
<acp-button
|
|
2094
|
+
class="acp-dialog-close-btn"
|
|
2095
|
+
variant="icon"
|
|
2096
|
+
icon="close"
|
|
2097
|
+
[color]="resolvedCloseColor()"
|
|
2098
|
+
[ariaLabel]="closeLabel() ?? 'Close dialog'"
|
|
2099
|
+
(clicked)="close()"
|
|
2100
|
+
/>
|
|
2101
|
+
}
|
|
2102
|
+
</h6>
|
|
2103
|
+
@if (subtitle()) {
|
|
2104
|
+
<p class="acp-dialog-subtitle">{{ subtitle() }}</p>
|
|
2105
|
+
}
|
|
2106
|
+
</div>
|
|
2107
|
+
</ng-template>
|
|
2108
|
+
|
|
2109
|
+
@if (renderInline()) {
|
|
2110
|
+
<ng-container [ngTemplateOutlet]="titlebarTemplate" />
|
|
2111
|
+
}
|
|
2112
|
+
`,
|
|
2113
|
+
host: {
|
|
2114
|
+
class: 'acp-dialog-titlebar',
|
|
2115
|
+
'[style.display]': 'hostDisplay()',
|
|
2116
|
+
},
|
|
2117
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2118
|
+
encapsulation: ViewEncapsulation.None,
|
|
2119
|
+
}]
|
|
2120
|
+
}], propDecorators: { titlebarTemplateRef: [{ type: i0.ViewChild, args: ['titlebarTemplate', { ...{ read: TemplateRef }, isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], draggable: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggable", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], colorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorClass", required: false }] }], closeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeColor", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* Shell that hosts any content inside an `AcpDialog`. Renders the optional
|
|
2124
|
+
* branded header (draggable title bar with icon, title and close button) and
|
|
2125
|
+
* optional footer actions.
|
|
2126
|
+
*
|
|
2127
|
+
* Content can be a component class, a `TemplateRef`, or a plain string. It is
|
|
2128
|
+
* created with a child `Injector` that provides `ACP_DIALOG_DATA` (the caller's
|
|
2129
|
+
* `config.data`) and `AcpDialogRef` (a typed handle to close the dialog).
|
|
2130
|
+
*
|
|
2131
|
+
* Opened exclusively through `AcpDialogService`; not meant to be used in templates.
|
|
2132
|
+
*/
|
|
2133
|
+
class AcpDialogContainer {
|
|
2134
|
+
parentInjector = inject(Injector);
|
|
2135
|
+
containerData = inject(MAT_DIALOG_DATA);
|
|
2136
|
+
actionClicks = this.containerData.actionClicks;
|
|
2137
|
+
dialogRef = new AcpDialogRef(inject(MatDialogRef), this.actionClicks);
|
|
2138
|
+
/** Outlet where the configured content is rendered. */
|
|
2139
|
+
contentHost = viewChild.required('contentHost', { ...(ngDevMode ? { debugName: "contentHost" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
2140
|
+
/** Outlet where declarative `acp-dialog-actions` content is rendered. */
|
|
2141
|
+
actionOutlet = viewChild('actionOutlet', { ...(ngDevMode ? { debugName: "actionOutlet" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
2142
|
+
/** Outlet where declarative `acp-dialog-titlebar` content is rendered. */
|
|
2143
|
+
titlebarOutletRef = viewChild('titlebarOutlet', { ...(ngDevMode ? { debugName: "titlebarOutletRef" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
2144
|
+
/** Template used to render a plain string content. */
|
|
2145
|
+
stringTemplate = viewChild.required('stringContent', { ...(ngDevMode ? { debugName: "stringTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
2146
|
+
/** Whether the content has registered a declarative `acp-dialog-actions` template. */
|
|
2147
|
+
hasDeclarativeActions = signal(false, /* @ts-ignore */
|
|
2148
|
+
...(ngDevMode ? [{ debugName: "hasDeclarativeActions" }] : /* istanbul ignore next */ []));
|
|
2149
|
+
/** Whether the content has registered a declarative `acp-dialog-titlebar` template. */
|
|
2150
|
+
hasDeclarativeTitlebar = signal(false, /* @ts-ignore */
|
|
2151
|
+
...(ngDevMode ? [{ debugName: "hasDeclarativeTitlebar" }] : /* istanbul ignore next */ []));
|
|
2152
|
+
/** Pending declarative actions template, captured before the outlet is ready. */
|
|
2153
|
+
pendingActionTemplate = signal(undefined, /* @ts-ignore */
|
|
2154
|
+
...(ngDevMode ? [{ debugName: "pendingActionTemplate" }] : /* istanbul ignore next */ []));
|
|
2155
|
+
/** Pending declarative titlebar template, captured before the outlet is ready. */
|
|
2156
|
+
pendingTitlebarTemplate = signal(undefined, /* @ts-ignore */
|
|
2157
|
+
...(ngDevMode ? [{ debugName: "pendingTitlebarTemplate" }] : /* istanbul ignore next */ []));
|
|
2158
|
+
/** Alignment requested by a declarative actions template. */
|
|
2159
|
+
declarativeActionsAlign = signal(undefined, /* @ts-ignore */
|
|
2160
|
+
...(ngDevMode ? [{ debugName: "declarativeActionsAlign" }] : /* istanbul ignore next */ []));
|
|
2161
|
+
/** Title requested by a declarative titlebar template. */
|
|
2162
|
+
declarativeTitle = signal(undefined, /* @ts-ignore */
|
|
2163
|
+
...(ngDevMode ? [{ debugName: "declarativeTitle" }] : /* istanbul ignore next */ []));
|
|
2164
|
+
/** Outlet object provided to content so `acp-dialog-actions` can register itself. */
|
|
2165
|
+
actionsOutlet = {
|
|
2166
|
+
register: (template, align) => {
|
|
2167
|
+
this.pendingActionTemplate.set(template);
|
|
2168
|
+
this.hasDeclarativeActions.set(true);
|
|
2169
|
+
this.declarativeActionsAlign.set(align);
|
|
2170
|
+
},
|
|
2171
|
+
hasActions: this.hasDeclarativeActions.asReadonly(),
|
|
2172
|
+
};
|
|
2173
|
+
/** Outlet object provided to content so `acp-dialog-titlebar` can register itself. */
|
|
2174
|
+
titlebarOutlet = {
|
|
2175
|
+
register: (template, title) => {
|
|
2176
|
+
this.pendingTitlebarTemplate.set(template);
|
|
2177
|
+
this.hasDeclarativeTitlebar.set(true);
|
|
2178
|
+
this.declarativeTitle.set(title);
|
|
2179
|
+
},
|
|
2180
|
+
hasTitlebar: this.hasDeclarativeTitlebar.asReadonly(),
|
|
2181
|
+
};
|
|
2182
|
+
/** Exposed header configuration, including the `title` shortcut. */
|
|
2183
|
+
headerConfig = computed(() => {
|
|
2184
|
+
if (this.config.header) {
|
|
2185
|
+
return this.config.header;
|
|
2186
|
+
}
|
|
2187
|
+
if (this.config.title) {
|
|
2188
|
+
return { title: this.config.title };
|
|
2189
|
+
}
|
|
2190
|
+
return undefined;
|
|
2191
|
+
}, /* @ts-ignore */
|
|
2192
|
+
...(ngDevMode ? [{ debugName: "headerConfig" }] : /* istanbul ignore next */ []));
|
|
2193
|
+
/** Title used for the actions footer label. */
|
|
2194
|
+
resolvedDialogTitle = computed(() => this.headerConfig()?.title ?? this.declarativeTitle(), /* @ts-ignore */
|
|
2195
|
+
...(ngDevMode ? [{ debugName: "resolvedDialogTitle" }] : /* istanbul ignore next */ []));
|
|
2196
|
+
/** Alignment used for the actions footer. */
|
|
2197
|
+
resolvedActionsAlign = computed(() => this.declarativeActionsAlign() ?? this.config.actionsAlign ?? 'end', /* @ts-ignore */
|
|
2198
|
+
...(ngDevMode ? [{ debugName: "resolvedActionsAlign" }] : /* istanbul ignore next */ []));
|
|
2199
|
+
/** Whether the current content is a plain string. */
|
|
2200
|
+
isStringContent = signal(false, /* @ts-ignore */
|
|
2201
|
+
...(ngDevMode ? [{ debugName: "isStringContent" }] : /* istanbul ignore next */ []));
|
|
2202
|
+
get config() {
|
|
2203
|
+
return this.containerData.config;
|
|
2204
|
+
}
|
|
2205
|
+
get content() {
|
|
2206
|
+
return this.containerData.content;
|
|
2207
|
+
}
|
|
2208
|
+
constructor() {
|
|
2209
|
+
effect(onCleanup => {
|
|
2210
|
+
const outlet = this.actionOutlet();
|
|
2211
|
+
const template = this.pendingActionTemplate();
|
|
2212
|
+
let viewRef;
|
|
2213
|
+
if (outlet && template) {
|
|
2214
|
+
outlet.clear();
|
|
2215
|
+
viewRef = outlet.createEmbeddedView(template);
|
|
2216
|
+
}
|
|
2217
|
+
onCleanup(() => viewRef?.destroy());
|
|
2218
|
+
});
|
|
2219
|
+
effect(onCleanup => {
|
|
2220
|
+
const outlet = this.titlebarOutletRef();
|
|
2221
|
+
const template = this.pendingTitlebarTemplate();
|
|
2222
|
+
let viewRef;
|
|
2223
|
+
if (outlet && template) {
|
|
2224
|
+
outlet.clear();
|
|
2225
|
+
viewRef = outlet.createEmbeddedView(template);
|
|
2226
|
+
}
|
|
2227
|
+
onCleanup(() => viewRef?.destroy());
|
|
2228
|
+
});
|
|
2229
|
+
}
|
|
2230
|
+
ngAfterViewInit() {
|
|
2231
|
+
const content = this.content;
|
|
2232
|
+
const injector = this.createContentInjector();
|
|
2233
|
+
this.contentHost().clear();
|
|
2234
|
+
this.isStringContent.set(false);
|
|
2235
|
+
if (typeof content === 'string') {
|
|
2236
|
+
this.isStringContent.set(true);
|
|
2237
|
+
this.contentHost().createEmbeddedView(this.stringTemplate(), { content });
|
|
2238
|
+
}
|
|
2239
|
+
else if (content instanceof TemplateRef) {
|
|
2240
|
+
this.contentHost().createEmbeddedView(content, {
|
|
2241
|
+
$implicit: this.config.data,
|
|
2242
|
+
data: this.config.data,
|
|
2243
|
+
ref: this.dialogRef,
|
|
2244
|
+
}, { injector });
|
|
2245
|
+
}
|
|
2246
|
+
else {
|
|
2247
|
+
this.contentHost().createComponent(content, { injector, bindings: this.config.bindings });
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
createContentInjector() {
|
|
2251
|
+
return Injector.create({
|
|
2252
|
+
parent: this.parentInjector,
|
|
2253
|
+
providers: [
|
|
2254
|
+
{ provide: ACP_DIALOG_DATA, useValue: this.config.data },
|
|
2255
|
+
{ provide: AcpDialogRef, useValue: this.dialogRef },
|
|
2256
|
+
{ provide: ACP_DIALOG_ACTIONS, useValue: this.actionsOutlet },
|
|
2257
|
+
{ provide: ACP_DIALOG_TITLEBAR, useValue: this.titlebarOutlet },
|
|
2258
|
+
],
|
|
2259
|
+
});
|
|
2260
|
+
}
|
|
2261
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2262
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AcpDialogContainer, isStandalone: true, selector: "acp-dialog-container", viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "actionOutlet", first: true, predicate: ["actionOutlet"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "titlebarOutletRef", first: true, predicate: ["titlebarOutlet"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "stringTemplate", first: true, predicate: ["stringContent"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "@if (headerConfig(); as header) { @if (config.showHeader !== false && !hasDeclarativeTitlebar()) {\n<acp-dialog-titlebar\n [title]=\"header.title\"\n [subtitle]=\"header.subtitle\"\n [icon]=\"header.icon\"\n [closable]=\"header.closable ?? true\"\n [closeLabel]=\"header.closeLabel ?? 'Close dialog'\"\n [draggable]=\"header.draggable ?? true\"\n [color]=\"header.color\"\n [colorClass]=\"header.colorClass\"\n [closeColor]=\"header.closeColor\"\n/>\n} }\n\n<ng-template #titlebarOutlet />\n\n<mat-dialog-content class=\"acp-dialog-content\">\n <ng-template #contentHost />\n <ng-template #stringContent let-content>\n <div class=\"acp-dialog-message\">{{ content }}</div>\n </ng-template>\n</mat-dialog-content>\n\n@if ((config.actions?.length && config.showActions !== false) || hasDeclarativeActions()) {\n<acp-dialog-actions\n [align]=\"resolvedActionsAlign()\"\n [actions]=\"hasDeclarativeActions() ? undefined : config.actions\"\n [dialogTitle]=\"resolvedDialogTitle()\"\n>\n <ng-template #actionOutlet />\n</acp-dialog-actions>\n}\n", styles: [".acp-dialog-header{cursor:move;border-bottom:1px solid var(--acp-dialog-header-border-color, var(--mat-sys-outline-variant, #dee2e6));color:var(--acp-dialog-header-text-color, var(--mat-sys-on-surface, #212529));position:relative}.acp-dialog-header.acp-dialog-header--primary{background-color:var(--acp-dialog-primary-header-background-color, var(--mat-sys-primary, #1976d2));color:var(--acp-dialog-primary-header-text-color, var(--mat-sys-on-primary, #fff))}.acp-dialog-header.acp-dialog-header--secondary{background-color:var(--acp-dialog-secondary-header-background-color, var(--mat-sys-secondary, #9c27b0));color:var(--acp-dialog-secondary-header-text-color, var(--mat-sys-on-secondary, #fff))}.acp-dialog-header.acp-dialog-header--accent{background-color:var(--acp-dialog-accent-header-background-color, var(--mat-sys-tertiary, #7c4dff));color:var(--acp-dialog-accent-header-text-color, var(--mat-sys-on-tertiary, #fff))}.acp-dialog-header.acp-dialog-header--error,.acp-dialog-header.acp-dialog-header--danger{background-color:var(--acp-dialog-error-header-background-color, var(--mat-sys-error, #b3261e));color:var(--acp-dialog-error-header-text-color, var(--mat-sys-on-error, #fff))}.acp-dialog-header.acp-dialog-header--success{background-color:var(--acp-dialog-success-header-background-color, #22c55e);color:var(--acp-dialog-success-header-text-color, #fff)}.acp-dialog-header.acp-dialog-header--warning{background-color:var(--acp-dialog-warning-header-background-color, #f59e0b);color:var(--acp-dialog-warning-header-text-color, #212529)}.acp-dialog-header.acp-dialog-header--info{background-color:var(--acp-dialog-info-header-background-color, #0ea5e9);color:var(--acp-dialog-info-header-text-color, #fff)}.acp-dialog-header.acp-dialog-header--dark{background-color:var(--acp-dialog-dark-header-background-color, #212529);color:var(--acp-dialog-dark-header-text-color, #fff)}.acp-dialog-header[class*=acp-dialog-header--] .acp-dialog-subtitle{color:inherit;opacity:.85}h6[mat-dialog-title].acp-dialog-title{display:flex;align-items:center;font-size:var(--acp-dialog-title-font-size, 1.2rem);font-weight:var(--acp-dialog-title-font-weight, 500);margin:0;width:100%;padding-right:48px;color:currentColor}.acp-dialog-title-icon{margin-right:var(--acp-dialog-title-icon-gap, 12px);vertical-align:middle}h6[mat-dialog-title].acp-dialog-title span{flex-grow:1}.acp-dialog-close-btn{position:absolute;top:8px;right:16px}.acp-dialog-subtitle{margin:0;padding:0 var(--acp-dialog-subtitle-padding, 24px) var(--acp-dialog-subtitle-padding, 16px);font-size:var(--acp-dialog-subtitle-font-size, .875rem);color:var(--acp-dialog-subtitle-color, var(--mat-sys-on-surface-variant, #6c757d))}.acp-dialog-message{padding:var(--acp-dialog-message-padding, 24px);color:var(--acp-dialog-message-text-color, var(--mat-sys-on-surface, #212529))}.acp-dialog-message-actions{display:flex;justify-content:flex-end;gap:8px;padding:0 var(--acp-dialog-message-padding, 24px) var(--acp-dialog-message-padding, 24px)}.acp-dialog-actions{display:flex;align-items:center;gap:var(--acp-dialog-actions-gap, 8px);padding:var(--acp-dialog-actions-padding, 16px 24px);border-top:1px solid var(--acp-dialog-actions-border-color, var(--mat-sys-outline-variant, #dee2e6))}.acp-dialog-full-screen .mat-mdc-dialog-surface{height:100vh}.acp-dialog-full-screen acp-dialog-container{min-height:100vh}.acp-dialog-full-screen .acp-dialog-content.mat-mdc-dialog-content{max-height:100%;height:100%}.acp-dialog-full-screen .acp-dialog-actions,.acp-dialog-full-screen .mat-mdc-dialog-actions{margin-top:auto}\n"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: AcpDialogTitlebar, selector: "acp-dialog-titlebar", inputs: ["title", "subtitle", "icon", "closable", "closeLabel", "draggable", "color", "colorClass", "closeColor"], outputs: ["closed"] }, { kind: "component", type: AcpDialogActions, selector: "acp-dialog-actions", inputs: ["align", "actions", "dialogTitle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2263
|
+
}
|
|
2264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogContainer, decorators: [{
|
|
2265
|
+
type: Component,
|
|
2266
|
+
args: [{ selector: 'acp-dialog-container', imports: [MatDialogModule, AcpDialogTitlebar, AcpDialogActions], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (headerConfig(); as header) { @if (config.showHeader !== false && !hasDeclarativeTitlebar()) {\n<acp-dialog-titlebar\n [title]=\"header.title\"\n [subtitle]=\"header.subtitle\"\n [icon]=\"header.icon\"\n [closable]=\"header.closable ?? true\"\n [closeLabel]=\"header.closeLabel ?? 'Close dialog'\"\n [draggable]=\"header.draggable ?? true\"\n [color]=\"header.color\"\n [colorClass]=\"header.colorClass\"\n [closeColor]=\"header.closeColor\"\n/>\n} }\n\n<ng-template #titlebarOutlet />\n\n<mat-dialog-content class=\"acp-dialog-content\">\n <ng-template #contentHost />\n <ng-template #stringContent let-content>\n <div class=\"acp-dialog-message\">{{ content }}</div>\n </ng-template>\n</mat-dialog-content>\n\n@if ((config.actions?.length && config.showActions !== false) || hasDeclarativeActions()) {\n<acp-dialog-actions\n [align]=\"resolvedActionsAlign()\"\n [actions]=\"hasDeclarativeActions() ? undefined : config.actions\"\n [dialogTitle]=\"resolvedDialogTitle()\"\n>\n <ng-template #actionOutlet />\n</acp-dialog-actions>\n}\n", styles: [".acp-dialog-header{cursor:move;border-bottom:1px solid var(--acp-dialog-header-border-color, var(--mat-sys-outline-variant, #dee2e6));color:var(--acp-dialog-header-text-color, var(--mat-sys-on-surface, #212529));position:relative}.acp-dialog-header.acp-dialog-header--primary{background-color:var(--acp-dialog-primary-header-background-color, var(--mat-sys-primary, #1976d2));color:var(--acp-dialog-primary-header-text-color, var(--mat-sys-on-primary, #fff))}.acp-dialog-header.acp-dialog-header--secondary{background-color:var(--acp-dialog-secondary-header-background-color, var(--mat-sys-secondary, #9c27b0));color:var(--acp-dialog-secondary-header-text-color, var(--mat-sys-on-secondary, #fff))}.acp-dialog-header.acp-dialog-header--accent{background-color:var(--acp-dialog-accent-header-background-color, var(--mat-sys-tertiary, #7c4dff));color:var(--acp-dialog-accent-header-text-color, var(--mat-sys-on-tertiary, #fff))}.acp-dialog-header.acp-dialog-header--error,.acp-dialog-header.acp-dialog-header--danger{background-color:var(--acp-dialog-error-header-background-color, var(--mat-sys-error, #b3261e));color:var(--acp-dialog-error-header-text-color, var(--mat-sys-on-error, #fff))}.acp-dialog-header.acp-dialog-header--success{background-color:var(--acp-dialog-success-header-background-color, #22c55e);color:var(--acp-dialog-success-header-text-color, #fff)}.acp-dialog-header.acp-dialog-header--warning{background-color:var(--acp-dialog-warning-header-background-color, #f59e0b);color:var(--acp-dialog-warning-header-text-color, #212529)}.acp-dialog-header.acp-dialog-header--info{background-color:var(--acp-dialog-info-header-background-color, #0ea5e9);color:var(--acp-dialog-info-header-text-color, #fff)}.acp-dialog-header.acp-dialog-header--dark{background-color:var(--acp-dialog-dark-header-background-color, #212529);color:var(--acp-dialog-dark-header-text-color, #fff)}.acp-dialog-header[class*=acp-dialog-header--] .acp-dialog-subtitle{color:inherit;opacity:.85}h6[mat-dialog-title].acp-dialog-title{display:flex;align-items:center;font-size:var(--acp-dialog-title-font-size, 1.2rem);font-weight:var(--acp-dialog-title-font-weight, 500);margin:0;width:100%;padding-right:48px;color:currentColor}.acp-dialog-title-icon{margin-right:var(--acp-dialog-title-icon-gap, 12px);vertical-align:middle}h6[mat-dialog-title].acp-dialog-title span{flex-grow:1}.acp-dialog-close-btn{position:absolute;top:8px;right:16px}.acp-dialog-subtitle{margin:0;padding:0 var(--acp-dialog-subtitle-padding, 24px) var(--acp-dialog-subtitle-padding, 16px);font-size:var(--acp-dialog-subtitle-font-size, .875rem);color:var(--acp-dialog-subtitle-color, var(--mat-sys-on-surface-variant, #6c757d))}.acp-dialog-message{padding:var(--acp-dialog-message-padding, 24px);color:var(--acp-dialog-message-text-color, var(--mat-sys-on-surface, #212529))}.acp-dialog-message-actions{display:flex;justify-content:flex-end;gap:8px;padding:0 var(--acp-dialog-message-padding, 24px) var(--acp-dialog-message-padding, 24px)}.acp-dialog-actions{display:flex;align-items:center;gap:var(--acp-dialog-actions-gap, 8px);padding:var(--acp-dialog-actions-padding, 16px 24px);border-top:1px solid var(--acp-dialog-actions-border-color, var(--mat-sys-outline-variant, #dee2e6))}.acp-dialog-full-screen .mat-mdc-dialog-surface{height:100vh}.acp-dialog-full-screen acp-dialog-container{min-height:100vh}.acp-dialog-full-screen .acp-dialog-content.mat-mdc-dialog-content{max-height:100%;height:100%}.acp-dialog-full-screen .acp-dialog-actions,.acp-dialog-full-screen .mat-mdc-dialog-actions{margin-top:auto}\n"] }]
|
|
2267
|
+
}], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
|
|
2268
|
+
read: ViewContainerRef,
|
|
2269
|
+
}, isSignal: true }] }], actionOutlet: [{ type: i0.ViewChild, args: ['actionOutlet', { ...{ read: ViewContainerRef }, isSignal: true }] }], titlebarOutletRef: [{ type: i0.ViewChild, args: ['titlebarOutlet', { ...{ read: ViewContainerRef }, isSignal: true }] }], stringTemplate: [{ type: i0.ViewChild, args: ['stringContent', { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
2270
|
+
|
|
2271
|
+
const SIZES = {
|
|
2272
|
+
xs: '320px',
|
|
2273
|
+
sm: '450px',
|
|
2274
|
+
md: '600px',
|
|
2275
|
+
lg: '800px',
|
|
2276
|
+
xl: '1000px',
|
|
2277
|
+
xxl: '1280px',
|
|
2278
|
+
full: '100vw',
|
|
2279
|
+
};
|
|
2280
|
+
/**
|
|
2281
|
+
* Reusable dialog service — a branded alternative to `MatDialog`. Every dialog
|
|
2282
|
+
* renders inside `AcpDialogContainer`, so content always works the same way:
|
|
2283
|
+
*
|
|
2284
|
+
* - read data with `inject(ACP_DIALOG_DATA)`,
|
|
2285
|
+
* - close the dialog with `inject(AcpDialogRef).close(result)`.
|
|
2286
|
+
*
|
|
2287
|
+
* Usage:
|
|
2288
|
+
* ```ts
|
|
2289
|
+
* private dialogs = inject(AcpDialogService);
|
|
2290
|
+
*
|
|
2291
|
+
* this.dialogs.open(UserForm, {
|
|
2292
|
+
* title: 'Edit user',
|
|
2293
|
+
* actions: [
|
|
2294
|
+
* { text: 'Cancel' },
|
|
2295
|
+
* { text: 'Save', color: 'success', result: user },
|
|
2296
|
+
* ],
|
|
2297
|
+
* size: 'lg',
|
|
2298
|
+
* data: { userId: 5 },
|
|
2299
|
+
* }).afterClosed().subscribe(saved => {
|
|
2300
|
+
* // handle result
|
|
2301
|
+
* });
|
|
2302
|
+
*
|
|
2303
|
+
* // or with a single config object:
|
|
2304
|
+
* this.dialogs.open({
|
|
2305
|
+
* content: UserForm,
|
|
2306
|
+
* title: 'Edit user',
|
|
2307
|
+
* actions: [{ text: 'Save', color: 'success' }],
|
|
2308
|
+
* data: { userId: 5 },
|
|
2309
|
+
* }).afterClosed().subscribe(saved => {
|
|
2310
|
+
* // handle result
|
|
2311
|
+
* });
|
|
2312
|
+
* ```
|
|
2313
|
+
*/
|
|
2314
|
+
class AcpDialogService {
|
|
2315
|
+
dialog = inject(MatDialog);
|
|
2316
|
+
overlay = inject(Overlay);
|
|
2317
|
+
breakpointObserver = inject(BreakpointObserver);
|
|
2318
|
+
defaults = inject(ACP_DIALOG_DEFAULT_OPTIONS, {
|
|
2319
|
+
optional: true,
|
|
2320
|
+
});
|
|
2321
|
+
/** Stream that emits when all open dialogs have finished closing. */
|
|
2322
|
+
get afterAllClosed() {
|
|
2323
|
+
return this.dialog.afterAllClosed;
|
|
2324
|
+
}
|
|
2325
|
+
/** Stream that emits when a dialog has been opened. */
|
|
2326
|
+
get afterOpened() {
|
|
2327
|
+
return this.dialog.afterOpened;
|
|
2328
|
+
}
|
|
2329
|
+
/** Keeps track of the currently-open dialogs. */
|
|
2330
|
+
get openDialogs() {
|
|
2331
|
+
return this.dialog.openDialogs;
|
|
2332
|
+
}
|
|
2333
|
+
open(contentOrConfig, maybeConfig) {
|
|
2334
|
+
if (contentOrConfig instanceof TemplateRef) {
|
|
2335
|
+
return this.openWithContent(contentOrConfig, this.mergeDefaults(maybeConfig ?? {}));
|
|
2336
|
+
}
|
|
2337
|
+
if (typeof contentOrConfig === 'function' && isComponentClass(contentOrConfig)) {
|
|
2338
|
+
return this.openWithContent(contentOrConfig, this.mergeDefaults(maybeConfig ?? {}));
|
|
2339
|
+
}
|
|
2340
|
+
const { content, ...rest } = contentOrConfig;
|
|
2341
|
+
return this.openWithContent(content, this.mergeDefaults(rest));
|
|
2342
|
+
}
|
|
2343
|
+
/** Closes all currently open dialogs. */
|
|
2344
|
+
closeAll() {
|
|
2345
|
+
this.dialog.closeAll();
|
|
2346
|
+
}
|
|
2347
|
+
/** Finds an open dialog by its id. */
|
|
2348
|
+
getDialogById(id) {
|
|
2349
|
+
const matRef = this.dialog.getDialogById(id);
|
|
2350
|
+
return matRef ? new AcpDialogRef(matRef) : undefined;
|
|
2351
|
+
}
|
|
2352
|
+
// --- Internals ---
|
|
2353
|
+
openWithContent(content, config) {
|
|
2354
|
+
const resolved = this.resolveContent(content, config.data);
|
|
2355
|
+
const actionClicks = new Subject();
|
|
2356
|
+
if (resolved instanceof Promise) {
|
|
2357
|
+
return new AcpDialogRef(resolved.then(c => this.createMatRef(c, config, actionClicks)), actionClicks);
|
|
2358
|
+
}
|
|
2359
|
+
return new AcpDialogRef(this.createMatRef(resolved, config, actionClicks), actionClicks);
|
|
2360
|
+
}
|
|
2361
|
+
createMatRef(content, config, actionClicks) {
|
|
2362
|
+
const matRef = this.dialog.open(AcpDialogContainer, this.buildMatConfig(config, { content, config, actionClicks }));
|
|
2363
|
+
this.wireCloseGestures(matRef, config);
|
|
2364
|
+
return matRef;
|
|
2365
|
+
}
|
|
2366
|
+
resolveContent(content, data, depth = 0) {
|
|
2367
|
+
if (isTemplateRef(content)) {
|
|
2368
|
+
return content;
|
|
2369
|
+
}
|
|
2370
|
+
if (typeof content === 'string') {
|
|
2371
|
+
return content;
|
|
2372
|
+
}
|
|
2373
|
+
if (isComponentClass(content)) {
|
|
2374
|
+
return content;
|
|
2375
|
+
}
|
|
2376
|
+
if (isDialogComponentLoader(content)) {
|
|
2377
|
+
return content.loadComponent().then(c => this.resolveContent(c, data, depth));
|
|
2378
|
+
}
|
|
2379
|
+
if (typeof content === 'function') {
|
|
2380
|
+
if (depth > 5) {
|
|
2381
|
+
throw new Error('AcpDialog content factory nested too deeply');
|
|
2382
|
+
}
|
|
2383
|
+
const result = content(data);
|
|
2384
|
+
if (result && typeof result.then === 'function') {
|
|
2385
|
+
return result.then(c => this.resolveContent(c, data, depth + 1));
|
|
2386
|
+
}
|
|
2387
|
+
return this.resolveContent(result, data, depth + 1);
|
|
2388
|
+
}
|
|
2389
|
+
throw new Error(`Unsupported AcpDialog content: ${String(content)}`);
|
|
2390
|
+
}
|
|
2391
|
+
mergeDefaults(config) {
|
|
2392
|
+
const defaults = this.defaults;
|
|
2393
|
+
const { header, closeOn, ...rest } = config;
|
|
2394
|
+
return {
|
|
2395
|
+
...defaults,
|
|
2396
|
+
...rest,
|
|
2397
|
+
header: header ? { ...defaults?.header, ...header } : defaults?.header,
|
|
2398
|
+
closeOn: closeOn ? { ...defaults?.closeOn, ...closeOn } : defaults?.closeOn,
|
|
2399
|
+
};
|
|
2400
|
+
}
|
|
2401
|
+
buildMatConfig(config, data) {
|
|
2402
|
+
const matConfig = new MatDialogConfig();
|
|
2403
|
+
matConfig.data = data;
|
|
2404
|
+
const fullScreen = config.size === 'full' ||
|
|
2405
|
+
(config.fullScreenOnMobile === true &&
|
|
2406
|
+
this.breakpointObserver.isMatched([
|
|
2407
|
+
Breakpoints.HandsetPortrait,
|
|
2408
|
+
Breakpoints.HandsetLandscape,
|
|
2409
|
+
]));
|
|
2410
|
+
if (fullScreen) {
|
|
2411
|
+
matConfig.width = '100vw';
|
|
2412
|
+
matConfig.height = '100vh';
|
|
2413
|
+
matConfig.maxWidth = '100vw';
|
|
2414
|
+
matConfig.maxHeight = '100vh';
|
|
2415
|
+
}
|
|
2416
|
+
else {
|
|
2417
|
+
matConfig.width = this.toMatSize(config.width) ?? SIZES[config.size ?? 'md'];
|
|
2418
|
+
matConfig.height = this.toMatSize(config.height);
|
|
2419
|
+
matConfig.minWidth = this.toMatSize(config.minWidth);
|
|
2420
|
+
matConfig.minHeight = this.toMatSize(config.minHeight);
|
|
2421
|
+
matConfig.maxWidth = this.toMatSize(config.maxWidth) ?? '95vw';
|
|
2422
|
+
matConfig.maxHeight = this.toMatSize(config.maxHeight);
|
|
2423
|
+
matConfig.position = config.position;
|
|
2424
|
+
}
|
|
2425
|
+
matConfig.panelClass = [
|
|
2426
|
+
'acp-dialog',
|
|
2427
|
+
`acp-dialog-${config.size ?? 'md'}`,
|
|
2428
|
+
...(fullScreen ? ['acp-dialog-full-screen'] : []),
|
|
2429
|
+
...(Array.isArray(config.panelClass)
|
|
2430
|
+
? config.panelClass
|
|
2431
|
+
: config.panelClass
|
|
2432
|
+
? [config.panelClass]
|
|
2433
|
+
: []),
|
|
2434
|
+
];
|
|
2435
|
+
matConfig.hasBackdrop = config.hasBackdrop ?? true;
|
|
2436
|
+
matConfig.backdropClass = config.backdropClass;
|
|
2437
|
+
const closeOn = this.normalizeCloseOn(config);
|
|
2438
|
+
matConfig.disableClose = closeOn.backdropClick === false || closeOn.escapeKey === false;
|
|
2439
|
+
matConfig.id = config.id;
|
|
2440
|
+
matConfig.injector = config.injector;
|
|
2441
|
+
matConfig.viewContainerRef = config.viewContainerRef;
|
|
2442
|
+
matConfig.closeOnNavigation = config.closeOnNavigation;
|
|
2443
|
+
matConfig.closePredicate = config.closePredicate;
|
|
2444
|
+
matConfig.direction = config.direction;
|
|
2445
|
+
matConfig.delayFocusTrap = config.delayFocusTrap;
|
|
2446
|
+
matConfig.ariaModal = config.ariaModal;
|
|
2447
|
+
matConfig.autoFocus = config.autoFocus ?? 'first-tabbable';
|
|
2448
|
+
matConfig.restoreFocus = config.restoreFocus ?? true;
|
|
2449
|
+
matConfig.scrollStrategy = this.resolveScrollStrategy(config.scrollStrategy);
|
|
2450
|
+
matConfig.enterAnimationDuration = config.enterAnimationDuration ?? '300ms';
|
|
2451
|
+
matConfig.exitAnimationDuration = config.exitAnimationDuration ?? '200ms';
|
|
2452
|
+
matConfig.ariaLabel = config.ariaLabel;
|
|
2453
|
+
matConfig.ariaLabelledBy = config.ariaLabelledBy;
|
|
2454
|
+
matConfig.ariaDescribedBy = config.ariaDescribedBy;
|
|
2455
|
+
matConfig.role = config.role ?? 'dialog';
|
|
2456
|
+
return matConfig;
|
|
2457
|
+
}
|
|
2458
|
+
normalizeCloseOn(config) {
|
|
2459
|
+
if (config.disableClose === true) {
|
|
2460
|
+
return { backdropClick: false, escapeKey: false };
|
|
2461
|
+
}
|
|
2462
|
+
if (config.disableClose === false) {
|
|
2463
|
+
return { backdropClick: true, escapeKey: true };
|
|
2464
|
+
}
|
|
2465
|
+
return {
|
|
2466
|
+
backdropClick: config.closeOn?.backdropClick !== false,
|
|
2467
|
+
escapeKey: config.closeOn?.escapeKey !== false,
|
|
2468
|
+
};
|
|
2469
|
+
}
|
|
2470
|
+
toMatSize(value) {
|
|
2471
|
+
return typeof value === 'number' ? `${value}px` : value;
|
|
2472
|
+
}
|
|
2473
|
+
resolveScrollStrategy(strategy) {
|
|
2474
|
+
if (typeof strategy !== 'string') {
|
|
2475
|
+
return strategy ?? this.overlay.scrollStrategies.block();
|
|
2476
|
+
}
|
|
2477
|
+
const strategies = this.overlay.scrollStrategies;
|
|
2478
|
+
switch (strategy) {
|
|
2479
|
+
case 'block':
|
|
2480
|
+
return strategies.block();
|
|
2481
|
+
case 'close':
|
|
2482
|
+
return strategies.close();
|
|
2483
|
+
case 'noop':
|
|
2484
|
+
return strategies.noop();
|
|
2485
|
+
default:
|
|
2486
|
+
return strategies.block();
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
wireCloseGestures(matRef, config) {
|
|
2490
|
+
const closeOn = this.normalizeCloseOn(config);
|
|
2491
|
+
const backdropClick = closeOn.backdropClick;
|
|
2492
|
+
const escapeKey = closeOn.escapeKey;
|
|
2493
|
+
if (backdropClick === escapeKey) {
|
|
2494
|
+
return;
|
|
2495
|
+
}
|
|
2496
|
+
const closed$ = matRef.afterClosed();
|
|
2497
|
+
if (escapeKey) {
|
|
2498
|
+
matRef
|
|
2499
|
+
.keydownEvents()
|
|
2500
|
+
.pipe(takeUntil(closed$))
|
|
2501
|
+
.subscribe(event => {
|
|
2502
|
+
if (event.key === 'Escape') {
|
|
2503
|
+
matRef.close();
|
|
2504
|
+
}
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
else {
|
|
2508
|
+
matRef
|
|
2509
|
+
.backdropClick()
|
|
2510
|
+
.pipe(takeUntil(closed$))
|
|
2511
|
+
.subscribe(() => matRef.close());
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2514
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2515
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogService, providedIn: 'root' });
|
|
2516
|
+
}
|
|
2517
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDialogService, decorators: [{
|
|
2518
|
+
type: Injectable,
|
|
2519
|
+
args: [{
|
|
2520
|
+
providedIn: 'root',
|
|
2521
|
+
}]
|
|
2522
|
+
}] });
|
|
2523
|
+
function isDialogComponentLoader(value) {
|
|
2524
|
+
return (typeof value === 'object' &&
|
|
2525
|
+
value !== null &&
|
|
2526
|
+
'loadComponent' in value &&
|
|
2527
|
+
typeof value.loadComponent === 'function');
|
|
2528
|
+
}
|
|
2529
|
+
function isTemplateRef(value) {
|
|
2530
|
+
return value instanceof TemplateRef;
|
|
2531
|
+
}
|
|
2532
|
+
function isComponentClass(value) {
|
|
2533
|
+
if (typeof value !== 'function') {
|
|
2534
|
+
return false;
|
|
2535
|
+
}
|
|
2536
|
+
const fn = value;
|
|
2537
|
+
return (!!fn['ɵcmp'] || !!fn['ɵfac'] || /^\s*class\s/.test(Function.prototype.toString.call(value)));
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
/**
|
|
2541
|
+
* Centralized service that manages z-index stacking for all dialogs.
|
|
2542
|
+
* Ensures dialogs always appear in the correct order.
|
|
2543
|
+
* Alert dialogs always take priority over regular dialogs.
|
|
1543
2544
|
*/
|
|
1544
2545
|
class DialogZIndexService {
|
|
1545
|
-
//
|
|
2546
|
+
// Z-index ranges per dialog type
|
|
1546
2547
|
static Z_INDEX_RANGES = {
|
|
1547
|
-
normal: { base: 1000, current: 1000 }, //
|
|
1548
|
-
alert: { base: 2000, current: 2000 }, //
|
|
2548
|
+
normal: { base: 1000, current: 1000 }, // Regular dialogs: 1000-1999
|
|
2549
|
+
alert: { base: 2000, current: 2000 }, // Alert dialogs: 2000-2999 (always on top)
|
|
1549
2550
|
};
|
|
1550
2551
|
static Z_INDEX_INCREMENT = 10;
|
|
1551
2552
|
/**
|
|
1552
|
-
*
|
|
1553
|
-
* @param type
|
|
1554
|
-
* @returns
|
|
2553
|
+
* Gets the next available z-index for a specific dialog type.
|
|
2554
|
+
* @param type Dialog type (normal, alert)
|
|
2555
|
+
* @returns The next z-index to use
|
|
1555
2556
|
*/
|
|
1556
2557
|
getNextZIndex(type = 'normal') {
|
|
1557
2558
|
const range = DialogZIndexService.Z_INDEX_RANGES[type];
|
|
@@ -1559,23 +2560,23 @@ class DialogZIndexService {
|
|
|
1559
2560
|
return range.current;
|
|
1560
2561
|
}
|
|
1561
2562
|
/**
|
|
1562
|
-
*
|
|
1563
|
-
* @param type
|
|
1564
|
-
* @returns
|
|
2563
|
+
* Gets the highest z-index currently in use for a specific type.
|
|
2564
|
+
* @param type Dialog type
|
|
2565
|
+
* @returns The highest z-index currently in use for that type
|
|
1565
2566
|
*/
|
|
1566
2567
|
getCurrentZIndex(type = 'normal') {
|
|
1567
2568
|
return DialogZIndexService.Z_INDEX_RANGES[type].current;
|
|
1568
2569
|
}
|
|
1569
2570
|
/**
|
|
1570
|
-
*
|
|
1571
|
-
* @returns
|
|
2571
|
+
* Gets the highest z-index across all dialog types.
|
|
2572
|
+
* @returns The highest z-index of all dialogs
|
|
1572
2573
|
*/
|
|
1573
2574
|
getHighestZIndex() {
|
|
1574
2575
|
return Math.max(...Object.values(DialogZIndexService.Z_INDEX_RANGES).map(range => range.current));
|
|
1575
2576
|
}
|
|
1576
2577
|
/**
|
|
1577
|
-
*
|
|
1578
|
-
* @param type
|
|
2578
|
+
* Resets the z-index counter (useful for testing).
|
|
2579
|
+
* @param type Specific type to reset, or undefined to reset all
|
|
1579
2580
|
*/
|
|
1580
2581
|
reset(type) {
|
|
1581
2582
|
if (type) {
|
|
@@ -1583,41 +2584,39 @@ class DialogZIndexService {
|
|
|
1583
2584
|
range.current = range.base;
|
|
1584
2585
|
}
|
|
1585
2586
|
else {
|
|
1586
|
-
|
|
1587
|
-
Object.entries(DialogZIndexService.Z_INDEX_RANGES).forEach(([_, range]) => {
|
|
2587
|
+
Object.values(DialogZIndexService.Z_INDEX_RANGES).forEach(range => {
|
|
1588
2588
|
range.current = range.base;
|
|
1589
2589
|
});
|
|
1590
2590
|
}
|
|
1591
2591
|
}
|
|
1592
2592
|
/**
|
|
1593
|
-
*
|
|
1594
|
-
* @param dialogRef
|
|
1595
|
-
* @param type
|
|
1596
|
-
* @param zIndex
|
|
2593
|
+
* Applies a z-index to a specific dialog.
|
|
2594
|
+
* @param dialogRef Dialog reference
|
|
2595
|
+
* @param type Dialog type (determines the z-index range)
|
|
2596
|
+
* @param zIndex Specific z-index to apply (optional)
|
|
1597
2597
|
*/
|
|
1598
2598
|
applyZIndex(dialogRef, type = 'normal', zIndex) {
|
|
1599
|
-
const targetZIndex = zIndex
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
}, 0);
|
|
2599
|
+
const targetZIndex = zIndex ?? this.getNextZIndex(type);
|
|
2600
|
+
const overlayRef = this.getOverlayRef(dialogRef);
|
|
2601
|
+
if (!overlayRef) {
|
|
2602
|
+
return;
|
|
2603
|
+
}
|
|
2604
|
+
const pane = overlayRef.overlayElement;
|
|
2605
|
+
const backdrop = overlayRef.backdropElement;
|
|
2606
|
+
if (pane) {
|
|
2607
|
+
pane.style.zIndex = (targetZIndex + 2).toString();
|
|
2608
|
+
// Data attributes for debugging
|
|
2609
|
+
pane.setAttribute('data-dialog-type', type);
|
|
2610
|
+
pane.setAttribute('data-z-index', targetZIndex.toString());
|
|
2611
|
+
}
|
|
2612
|
+
if (backdrop) {
|
|
2613
|
+
backdrop.style.zIndex = (targetZIndex + 1).toString();
|
|
2614
|
+
}
|
|
1616
2615
|
}
|
|
1617
2616
|
/**
|
|
1618
|
-
*
|
|
1619
|
-
* @param element
|
|
1620
|
-
* @param type
|
|
2617
|
+
* Brings a dialog to the front (used by the drag functionality).
|
|
2618
|
+
* @param element Dialog element to bring to the front
|
|
2619
|
+
* @param type Dialog type
|
|
1621
2620
|
*/
|
|
1622
2621
|
bringToFront(element, type = 'normal') {
|
|
1623
2622
|
const pane = element.closest('.cdk-overlay-pane');
|
|
@@ -1625,7 +2624,7 @@ class DialogZIndexService {
|
|
|
1625
2624
|
const newZIndex = this.getNextZIndex(type);
|
|
1626
2625
|
pane.style.zIndex = (newZIndex + 2).toString();
|
|
1627
2626
|
pane.setAttribute('data-z-index', newZIndex.toString());
|
|
1628
|
-
//
|
|
2627
|
+
// Also update the backdrop if it exists
|
|
1629
2628
|
const backdrop = pane.parentElement?.querySelector('.cdk-overlay-backdrop');
|
|
1630
2629
|
if (backdrop) {
|
|
1631
2630
|
backdrop.style.zIndex = (newZIndex + 1).toString();
|
|
@@ -1633,28 +2632,30 @@ class DialogZIndexService {
|
|
|
1633
2632
|
}
|
|
1634
2633
|
}
|
|
1635
2634
|
/**
|
|
1636
|
-
*
|
|
1637
|
-
*
|
|
1638
|
-
* @param dialogRef
|
|
2635
|
+
* Forces a dialog to stay above every other dialog.
|
|
2636
|
+
* Useful for critical alerts that must have maximum priority.
|
|
2637
|
+
* @param dialogRef Dialog reference
|
|
1639
2638
|
*/
|
|
1640
2639
|
forceToTop(dialogRef) {
|
|
1641
2640
|
const highestZIndex = this.getHighestZIndex();
|
|
1642
2641
|
const topZIndex = highestZIndex + DialogZIndexService.Z_INDEX_INCREMENT;
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
2642
|
+
const overlayRef = this.getOverlayRef(dialogRef);
|
|
2643
|
+
if (!overlayRef) {
|
|
2644
|
+
return;
|
|
2645
|
+
}
|
|
2646
|
+
const pane = overlayRef.overlayElement;
|
|
2647
|
+
const backdrop = overlayRef.backdropElement;
|
|
2648
|
+
if (pane) {
|
|
2649
|
+
pane.style.zIndex = (topZIndex + 2).toString();
|
|
2650
|
+
pane.setAttribute('data-z-index', topZIndex.toString());
|
|
2651
|
+
pane.setAttribute('data-forced-top', 'true');
|
|
2652
|
+
}
|
|
2653
|
+
if (backdrop) {
|
|
2654
|
+
backdrop.style.zIndex = (topZIndex + 1).toString();
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
getOverlayRef(dialogRef) {
|
|
2658
|
+
return dialogRef._overlayRef;
|
|
1658
2659
|
}
|
|
1659
2660
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: DialogZIndexService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1660
2661
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: DialogZIndexService, providedIn: 'root' });
|
|
@@ -1687,19 +2688,6 @@ class DialogWrapper {
|
|
|
1687
2688
|
*/
|
|
1688
2689
|
header = viewChild('dialogHeader', /* @ts-ignore */
|
|
1689
2690
|
...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
1690
|
-
/**
|
|
1691
|
-
* Timeout ID for debouncing z-index updates to prevent excessive DOM manipulations.
|
|
1692
|
-
*/
|
|
1693
|
-
bringToFrontTimeoutId = null;
|
|
1694
|
-
/**
|
|
1695
|
-
* Creates an instance of DialogWrapper.
|
|
1696
|
-
*
|
|
1697
|
-
* @param dialogRef Reference to the dialog opened via the Material Dialog service
|
|
1698
|
-
* @param config Configuration for the dialog wrapper, injected from MAT_DIALOG_DATA
|
|
1699
|
-
*/
|
|
1700
|
-
constructor() {
|
|
1701
|
-
// Constructor intentionally empty - required by Angular DI
|
|
1702
|
-
}
|
|
1703
2691
|
/**
|
|
1704
2692
|
* Lifecycle hook that initializes the dynamic content after the view is ready.
|
|
1705
2693
|
* Creates the component specified in the config and passes data to it.
|
|
@@ -1708,19 +2696,16 @@ class DialogWrapper {
|
|
|
1708
2696
|
// Dynamically create the content component after the view is ready.
|
|
1709
2697
|
this.contentHost().clear();
|
|
1710
2698
|
const componentRef = this.contentHost().createComponent(this.config.component);
|
|
1711
|
-
// Pass the provided data
|
|
1712
|
-
//
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
if (this.bringToFrontTimeoutId !== null) {
|
|
1722
|
-
cancelAnimationFrame(this.bringToFrontTimeoutId);
|
|
1723
|
-
this.bringToFrontTimeoutId = null;
|
|
2699
|
+
// Pass the provided data to the new component. `setInput` supports both signal
|
|
2700
|
+
// inputs and decorator-based @Input() properties and marks the component dirty;
|
|
2701
|
+
// fall back to a plain property assignment when `data` is not declared as an input.
|
|
2702
|
+
if (this.config.data !== undefined && componentRef.instance) {
|
|
2703
|
+
try {
|
|
2704
|
+
componentRef.setInput('data', this.config.data);
|
|
2705
|
+
}
|
|
2706
|
+
catch {
|
|
2707
|
+
componentRef.instance.data = this.config.data;
|
|
2708
|
+
}
|
|
1724
2709
|
}
|
|
1725
2710
|
}
|
|
1726
2711
|
/**
|
|
@@ -1742,12 +2727,12 @@ class DialogWrapper {
|
|
|
1742
2727
|
}
|
|
1743
2728
|
}
|
|
1744
2729
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: DialogWrapper, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1745
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: DialogWrapper, isStandalone: true, selector: "acp-dialog-wrapper", viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "header", first: true, predicate: ["dialogHeader"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (!config.hideHeader) {\n<div\n class=\"acp-dialog-header\"\n cdkDrag\n cdkDragRootElement=\".cdk-overlay-pane\"\n cdkDragHandle\n #dialogHeader\n (mousedown)=\"bringToFront()\"\n>\n <h6 mat-dialog-title class=\"acp-dialog-title\">\n @if (config.icon) {\n <mat-icon class=\"acp-dialog-title-icon\" aria-hidden=\"true\">{{ config.icon }}</mat-icon>\n }\n <span>{{ config.title }}</span>\n @if (config.showCloseButton !== false) {\n <acp-button\n [customClass]=\"'acp-dialog-close-btn'\"\n matStyle=\"icon\"\n icon=\"close\"\n (handleClick)=\"onClose()\"\n ariaLabel=\"Close
|
|
2730
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: DialogWrapper, isStandalone: true, selector: "acp-dialog-wrapper", viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "header", first: true, predicate: ["dialogHeader"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (!config.hideHeader) {\n<div\n class=\"acp-dialog-header\"\n cdkDrag\n cdkDragRootElement=\".cdk-overlay-pane\"\n cdkDragHandle\n #dialogHeader\n (mousedown)=\"bringToFront()\"\n>\n <h6 mat-dialog-title class=\"acp-dialog-title\">\n @if (config.icon) {\n <mat-icon class=\"acp-dialog-title-icon\" aria-hidden=\"true\">{{ config.icon }}</mat-icon>\n }\n <span>{{ config.title }}</span>\n @if (config.showCloseButton !== false) {\n <acp-button\n [customClass]=\"'acp-dialog-close-btn'\"\n matStyle=\"icon\"\n icon=\"close\"\n (handleClick)=\"onClose()\"\n [ariaLabel]=\"config.closeAriaLabel ?? 'Close dialog'\"\n />\n }\n </h6>\n</div>\n}\n\n<ng-template #contentHost />\n", styles: [".acp-dialog-header{cursor:move;border-bottom:1px solid var(--mat-sys-outline-variant, #dee2e6);color:var(--mat-sys-on-surface, #212529);position:relative}h6[mat-dialog-title].acp-dialog-title{display:flex;align-items:center;font-size:1.2rem;font-weight:500;margin:0;width:100%;padding-right:48px}.acp-dialog-title-icon{margin-right:12px;vertical-align:middle}h6[mat-dialog-title].acp-dialog-title span{flex-grow:1}.acp-dialog-close-btn{position:absolute;top:8px;right:16px}\n"], dependencies: [{ kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1$3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1746
2731
|
}
|
|
1747
2732
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: DialogWrapper, decorators: [{
|
|
1748
2733
|
type: Component,
|
|
1749
|
-
args: [{ selector: 'acp-dialog-wrapper', standalone: true, imports: [CdkDrag, CdkDragHandle, MatDialogModule, MatIconModule, Button], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (!config.hideHeader) {\n<div\n class=\"acp-dialog-header\"\n cdkDrag\n cdkDragRootElement=\".cdk-overlay-pane\"\n cdkDragHandle\n #dialogHeader\n (mousedown)=\"bringToFront()\"\n>\n <h6 mat-dialog-title class=\"acp-dialog-title\">\n @if (config.icon) {\n <mat-icon class=\"acp-dialog-title-icon\" aria-hidden=\"true\">{{ config.icon }}</mat-icon>\n }\n <span>{{ config.title }}</span>\n @if (config.showCloseButton !== false) {\n <acp-button\n [customClass]=\"'acp-dialog-close-btn'\"\n matStyle=\"icon\"\n icon=\"close\"\n (handleClick)=\"onClose()\"\n ariaLabel=\"Close
|
|
1750
|
-
}],
|
|
2734
|
+
args: [{ selector: 'acp-dialog-wrapper', standalone: true, imports: [CdkDrag, CdkDragHandle, MatDialogModule, MatIconModule, Button], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (!config.hideHeader) {\n<div\n class=\"acp-dialog-header\"\n cdkDrag\n cdkDragRootElement=\".cdk-overlay-pane\"\n cdkDragHandle\n #dialogHeader\n (mousedown)=\"bringToFront()\"\n>\n <h6 mat-dialog-title class=\"acp-dialog-title\">\n @if (config.icon) {\n <mat-icon class=\"acp-dialog-title-icon\" aria-hidden=\"true\">{{ config.icon }}</mat-icon>\n }\n <span>{{ config.title }}</span>\n @if (config.showCloseButton !== false) {\n <acp-button\n [customClass]=\"'acp-dialog-close-btn'\"\n matStyle=\"icon\"\n icon=\"close\"\n (handleClick)=\"onClose()\"\n [ariaLabel]=\"config.closeAriaLabel ?? 'Close dialog'\"\n />\n }\n </h6>\n</div>\n}\n\n<ng-template #contentHost />\n", styles: [".acp-dialog-header{cursor:move;border-bottom:1px solid var(--mat-sys-outline-variant, #dee2e6);color:var(--mat-sys-on-surface, #212529);position:relative}h6[mat-dialog-title].acp-dialog-title{display:flex;align-items:center;font-size:1.2rem;font-weight:500;margin:0;width:100%;padding-right:48px}.acp-dialog-title-icon{margin-right:12px;vertical-align:middle}h6[mat-dialog-title].acp-dialog-title span{flex-grow:1}.acp-dialog-close-btn{position:absolute;top:8px;right:16px}\n"] }]
|
|
2735
|
+
}], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
|
|
1751
2736
|
read: ViewContainerRef,
|
|
1752
2737
|
}, isSignal: true }] }], header: [{ type: i0.ViewChild, args: ['dialogHeader', { isSignal: true }] }] } });
|
|
1753
2738
|
|
|
@@ -8077,16 +9062,16 @@ class AcpDateRangeInput {
|
|
|
8077
9062
|
* @param option The selected date option.
|
|
8078
9063
|
* @param input The HTML input element to update.
|
|
8079
9064
|
*/
|
|
8080
|
-
updateDateOnOptionSelect(option, input) {
|
|
9065
|
+
updateDateOnOptionSelect(option, input, emitEvent = true) {
|
|
8081
9066
|
// If there is a callback function, use it to get the date range
|
|
8082
9067
|
if (option?.callBackFunction) {
|
|
8083
9068
|
const dateRange = option.callBackFunction();
|
|
8084
9069
|
if (dateRange?.start && dateRange?.end) {
|
|
8085
|
-
this.updateSelectedDates(input, dateRange.start, dateRange.end, option);
|
|
9070
|
+
this.updateSelectedDates(input, dateRange.start, dateRange.end, option, emitEvent);
|
|
8086
9071
|
return;
|
|
8087
9072
|
}
|
|
8088
9073
|
}
|
|
8089
|
-
this.updateDateWithSelectedOption(option, input);
|
|
9074
|
+
this.updateDateWithSelectedOption(option, input, emitEvent);
|
|
8090
9075
|
}
|
|
8091
9076
|
/**
|
|
8092
9077
|
* Calculates and updates the start and end dates based on the selected option.
|
|
@@ -8094,7 +9079,7 @@ class AcpDateRangeInput {
|
|
|
8094
9079
|
* @param option The selected date option.
|
|
8095
9080
|
* @param input The HTML input element to update.
|
|
8096
9081
|
*/
|
|
8097
|
-
updateDateWithSelectedOption(option, input) {
|
|
9082
|
+
updateDateWithSelectedOption(option, input, emitEvent = true) {
|
|
8098
9083
|
const currDate = new Date();
|
|
8099
9084
|
let startDate = new Date();
|
|
8100
9085
|
let lastDate = new Date();
|
|
@@ -8127,7 +9112,7 @@ class AcpDateRangeInput {
|
|
|
8127
9112
|
break;
|
|
8128
9113
|
}
|
|
8129
9114
|
// Update the selected dates
|
|
8130
|
-
this.updateSelectedDates(input, startDate, lastDate, option);
|
|
9115
|
+
this.updateSelectedDates(input, startDate, lastDate, option, emitEvent);
|
|
8131
9116
|
}
|
|
8132
9117
|
/**
|
|
8133
9118
|
* Updates the date range and input display.
|
|
@@ -8137,7 +9122,7 @@ class AcpDateRangeInput {
|
|
|
8137
9122
|
* @param end End date of the range.
|
|
8138
9123
|
* @param opt Optional selected date option.
|
|
8139
9124
|
*/
|
|
8140
|
-
updateSelectedDates(input, start, end, opt) {
|
|
9125
|
+
updateSelectedDates(input, start, end, opt, emitEvent = true) {
|
|
8141
9126
|
const range = new DateRange(start, end);
|
|
8142
9127
|
this.selectedDates = range;
|
|
8143
9128
|
const expr = this.resolveDisplayExpr(start, end, opt);
|
|
@@ -8151,12 +9136,14 @@ class AcpDateRangeInput {
|
|
|
8151
9136
|
else {
|
|
8152
9137
|
input.value = rangeLabel;
|
|
8153
9138
|
}
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
9139
|
+
if (emitEvent) {
|
|
9140
|
+
this.dateSelectionChanged.emit({
|
|
9141
|
+
range,
|
|
9142
|
+
selectedOption: this.dateDropDownOptions.find(o => o.isSelected) ?? null,
|
|
9143
|
+
startExpr: expr.start,
|
|
9144
|
+
endExpr: expr.end,
|
|
9145
|
+
});
|
|
9146
|
+
}
|
|
8160
9147
|
this.cdref.markForCheck();
|
|
8161
9148
|
}
|
|
8162
9149
|
/**
|
|
@@ -8185,7 +9172,7 @@ class AcpDateRangeInput {
|
|
|
8185
9172
|
}
|
|
8186
9173
|
const selectedOptions = this._dateOptions().find(option => option.isSelected);
|
|
8187
9174
|
if (selectedOptions && selectedOptions.optionType !== ACP_DATE_OPTION_TYPE.CUSTOM) {
|
|
8188
|
-
this.updatedFromListValueSelection(selectedOptions, input);
|
|
9175
|
+
this.updatedFromListValueSelection(selectedOptions, input, false);
|
|
8189
9176
|
this.cdref.detectChanges();
|
|
8190
9177
|
}
|
|
8191
9178
|
}
|
|
@@ -8259,15 +9246,15 @@ class AcpDateRangeInput {
|
|
|
8259
9246
|
* @param selectedOption The selected date option.
|
|
8260
9247
|
* @param input The HTML input element to update.
|
|
8261
9248
|
*/
|
|
8262
|
-
updatedFromListValueSelection(selectedOption, input) {
|
|
9249
|
+
updatedFromListValueSelection(selectedOption, input, emitEvent = true) {
|
|
8263
9250
|
// This will update value if option is selected from default list.
|
|
8264
9251
|
if (!selectedOption.callBackFunction) {
|
|
8265
|
-
this.updateDateOnOptionSelect(selectedOption, input);
|
|
9252
|
+
this.updateDateOnOptionSelect(selectedOption, input, emitEvent);
|
|
8266
9253
|
return;
|
|
8267
9254
|
}
|
|
8268
9255
|
// This will update value if option is selected from provided custom list.
|
|
8269
9256
|
const dateRange = selectedOption.callBackFunction();
|
|
8270
|
-
this.updateSelectedDates(input, dateRange.start ?? new Date(), dateRange.end ?? new Date(), selectedOption);
|
|
9257
|
+
this.updateSelectedDates(input, dateRange.start ?? new Date(), dateRange.end ?? new Date(), selectedOption, emitEvent);
|
|
8271
9258
|
}
|
|
8272
9259
|
/**
|
|
8273
9260
|
* Checks whether default initialization of options is required.
|
|
@@ -8288,7 +9275,7 @@ class AcpDateRangeInput {
|
|
|
8288
9275
|
this._dateOptions.set(options);
|
|
8289
9276
|
}
|
|
8290
9277
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDateRangeInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8291
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AcpDateRangeInput, isStandalone: true, selector: "acp-date-range-input", inputs: { inputLabel: { classPropertyName: "inputLabel", publicName: "inputLabel", isSignal: false, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, showCalendarIcon: { classPropertyName: "showCalendarIcon", publicName: "showCalendarIcon", isSignal: true, isRequired: false, transformFunction: null }, showRangeRequired: { classPropertyName: "showRangeRequired", publicName: "showRangeRequired", isSignal: true, isRequired: false, transformFunction: null }, isRangeRequired: { classPropertyName: "isRangeRequired", publicName: "isRangeRequired", isSignal: true, isRequired: false, transformFunction: null }, staticOptionId: { classPropertyName: "staticOptionId", publicName: "staticOptionId", isSignal: false, isRequired: false, transformFunction: null }, dynamicOptionId: { classPropertyName: "dynamicOptionId", publicName: "dynamicOptionId", isSignal: false, isRequired: false, transformFunction: null }, calendarId: { classPropertyName: "calendarId", publicName: "calendarId", isSignal: false, isRequired: false, transformFunction: null }, enableDefaultOptions: { classPropertyName: "enableDefaultOptions", publicName: "enableDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, selectedDates: { classPropertyName: "selectedDates", publicName: "selectedDates", isSignal: false, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: false, isRequired: false, transformFunction: null }, isShowStaticDefaultOptions: { classPropertyName: "isShowStaticDefaultOptions", publicName: "isShowStaticDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, hideDefaultOptions: { classPropertyName: "hideDefaultOptions", publicName: "hideDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayOffsetX: { classPropertyName: "cdkConnectedOverlayOffsetX", publicName: "cdkConnectedOverlayOffsetX", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayOffsetY: { classPropertyName: "cdkConnectedOverlayOffsetY", publicName: "cdkConnectedOverlayOffsetY", isSignal: false, isRequired: false, transformFunction: null }, listCdkConnectedOverlayOffsetY: { classPropertyName: "listCdkConnectedOverlayOffsetY", publicName: "listCdkConnectedOverlayOffsetY", isSignal: false, isRequired: false, transformFunction: null }, listCdkConnectedOverlayOffsetX: { classPropertyName: "listCdkConnectedOverlayOffsetX", publicName: "listCdkConnectedOverlayOffsetX", isSignal: false, isRequired: false, transformFunction: null }, selectedOptionIndex: { classPropertyName: "selectedOptionIndex", publicName: "selectedOptionIndex", isSignal: false, isRequired: false, transformFunction: null }, displaySelectedLabel: { classPropertyName: "displaySelectedLabel", publicName: "displaySelectedLabel", isSignal: false, isRequired: false, transformFunction: null }, displaySelectedExpression: { classPropertyName: "displaySelectedExpression", publicName: "displaySelectedExpression", isSignal: false, isRequired: false, transformFunction: null }, enableEditableDates: { classPropertyName: "enableEditableDates", publicName: "enableEditableDates", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayPush: { classPropertyName: "cdkConnectedOverlayPush", publicName: "cdkConnectedOverlayPush", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayPositions: { classPropertyName: "cdkConnectedOverlayPositions", publicName: "cdkConnectedOverlayPositions", isSignal: false, isRequired: false, transformFunction: null }, allowSingleDateSelection: { classPropertyName: "allowSingleDateSelection", publicName: "allowSingleDateSelection", isSignal: false, isRequired: false, transformFunction: null }, autoSelectOption: { classPropertyName: "autoSelectOption", publicName: "autoSelectOption", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null }, dateDropDownOptions: { classPropertyName: "dateDropDownOptions", publicName: "dateDropDownOptions", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { dateSelectionChanged: "dateSelectionChanged", dateListOptions: "dateListOptions", rangeRequiredChange: "rangeRequiredChange" }, viewQueries: [{ propertyName: "calendar", first: true, predicate: ["calendar"], descendants: true }], ngImport: i0, template: "<!--\n AcpDateRangeInput Component Template\n @author AcontPlus S.A.S\n @version 1.0.0\n\n Comprehensive date range picker with predefined options, custom calendar selection,\n and support for human-readable date expressions.\n-->\n<div class=\"date-picker-main ndp-main\" cdkOverlayOrigin #trigger>\n <mat-form-field\n class=\"w-full\"\n [class]=\"{ 'display-hidden': isShowStaticDefaultOptions }\"\n (click)=\"toggleDateOptionSelectionList($event)\"\n >\n <mat-label (click)=\"toggleDateOptionSelectionList($event)\">{{ inputLabel }}</mat-label>\n <input\n matInput\n #dateInput\n class=\"cursor-pointer\"\n id=\"date-input-field\"\n (input)=\"onMainInputChange(dateInput)\"\n />\n <ng-container matSuffix>\n @if (showClearButton() && !!dateInput.value) {\n <button\n mat-icon-button\n class=\"cursor-pointer pe-0 ps-0\"\n matTooltip=\"Clear\"\n (click)=\"clearSelection($event)\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n } @if (showCalendarIcon()) {\n <button mat-icon-button class=\"cursor-pointer\">\n <mat-icon>date_range</mat-icon>\n </button>\n } @if (showRangeRequired()) {\n <button\n mat-icon-button\n class=\"cursor-pointer\"\n [class.checked]=\"isRangeRequired()\"\n (click)=\"toggleRangeSelection($event)\"\n matTooltip=\"Rango de fechas obligatorio\"\n >\n <mat-icon [color]=\"isRangeRequired() ? 'accent' : ''\">\n {{ isRangeRequired() ? 'check_box' : 'check_box_outline_blank' }}\n </mat-icon>\n </button>\n }\n </ng-container>\n </mat-form-field>\n\n @if (dateDropDownOptions.length && isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: staticOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDateOptionList\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayOffsetX]=\"listCdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"listCdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isDateOptionList = false\"\n >\n @if (dateDropDownOptions.length && !isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: dynamicOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n </ng-template>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isCustomRange\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayPositions]=\"cdkConnectedOverlayPositions\"\n [cdkConnectedOverlayOffsetX]=\"cdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"cdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isCustomRange = false\"\n >\n <div\n class=\"custom-ckd-container ndp-cdk-container custom-calendar-container ndp-calendar-container\"\n [class]=\"{ 'without-default-opt': hideDefaultOptions }\"\n >\n <div class=\"row-1\">\n @if (!hideDefaultOptions) {\n <div class=\"pt-custom column-1\">\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n }\n \"\n />\n </div>\n <div class=\"ndp-column-separator\"></div>\n }\n <div class=\"mt-2 column-2\">\n <acp-date-range-calendar\n [selectedDates]=\"selectedDates\"\n #calendar\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (selectedDatesChange)=\"onCalendarSelectionChange($event)\"\n />\n </div>\n </div>\n <div class=\"row-2 br-top\">\n <div class=\"footer-content ndp-footer-content\">\n @if (enableEditableDates) {\n <form class=\"ndp-date-inputs\" [formGroup]=\"editableForm\">\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>Start</mat-label>\n <input\n matInput\n formControlName=\"start\"\n placeholder=\"e.g. now-7d\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.start.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.start.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n }\n </mat-form-field>\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>End</mat-label>\n <input\n matInput\n formControlName=\"end\"\n placeholder=\"e.g. now\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.end.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.end.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n } @else if (editableForm.hasError('rangeOrder')) {\n <mat-error>Start must be before end</mat-error>\n }\n </mat-form-field>\n </form>\n } @else {\n <span id=\"range-label-text\" class=\"ndp-range-label-text\">\n {{ calendar.selectedDates?.start | date: dateFormat }} @if (calendar.selectedDates?.end)\n {\n <span> - {{ calendar.selectedDates?.end | date: dateFormat }} </span>\n }\n </span>\n }\n <div class=\"buttons\">\n <acp-button\n type=\"button\"\n appearance=\"filled\"\n color=\"primary\"\n size=\"small\"\n [class.disabled]=\"\n enableEditableDates\n ? editableForm.invalid\n : !(calendar.selectedDates?.start && calendar.selectedDates?.end)\n \"\n (clicked)=\"\n enableEditableDates && commitEditableDates(calendar);\n updateCustomRange(dateInput, calendar.selectedDates)\n \"\n >\n Aplicar \n </acp-button>\n <acp-button\n type=\"button\"\n appearance=\"text\"\n color=\"error\"\n size=\"small\"\n (clicked)=\"isCustomRange = false\"\n >Cancelar</acp-button\n >\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n</div>\n\n<ng-template\n #dateOptionList\n let-options\n let-input=\"dateInput\"\n let-optionId=\"optionId\"\n let-className=\"className\"\n>\n <mat-action-list [ngClass]=\"className\" [id]=\"optionId\">\n @for (option of options; track option.optionLabel) {\n <mat-list-item [activated]=\"option.isSelected\" (click)=\"updateSelection(option, input)\">\n {{ option.optionLabel }}\n </mat-list-item>\n }\n </mat-action-list>\n</ng-template>\n", styles: ["::ng-deep .cdk-overlay-dark-backdrop{background:none}mat-list-item.mat-mdc-list-item{height:40px}mat-list-item.mdc-list-item--activated{background-color:var(--ndp-selected-option-bg, var(--mat-sys-secondary-container, rgba(0, 0, 0, .08)))}::ng-deep .cdk-overlay-pane:has(.custom-ckd-container),::ng-deep .cdk-overlay-pane:has(.ndp-cdk-container){width:100%;background-color:var(--mat-sys-surface-container);max-height:100vh;overflow-y:auto;overflow-x:hidden;max-width:700px;margin-top:-22px;border:1px solid var(--mat-sys-surface-container)}::ng-deep .cdk-overlay-pane:has(.range-input){max-width:250px}.br-top{border-top:1px solid var(--mat-sys-surface-container)}.br-right{border-right:1px solid var(--mat-sys-surface-container)}.disabled{pointer-events:none;opacity:.5}.mat-button,.mdc-button{font-family:var(--mat-list-list-item-label-text-font);line-height:var(--mat-list-list-item-label-text-line-height);font-size:var(--mat-list-list-item-label-text-size);font-weight:var(--mat-list-list-item-label-text-weight);letter-spacing:var(--mat-list-list-item-label-text-tracking)}.w-full{width:100%}.display-hidden{display:none}.custom-calendar-container,.ndp-calendar-container{width:100%}.row-1,.row-2{width:100%;box-sizing:border-box}.row-1{display:flex;align-items:stretch}.row-2{padding:16px}.ndp-column-separator{flex:0 0 1px;background-color:var(--mat-sys-surface-container)}.footer-content,.ndp-footer-content{align-items:center;display:flex;text-align:right;justify-content:end;gap:16px;text-overflow:ellipsis}.footer-content .buttons,.ndp-footer-content .buttons{display:flex;gap:8px}.ndp-date-inputs{display:flex;gap:8px;margin-right:auto;align-items:flex-start}.ndp-date-field{width:150px}.column-1{flex:0 0 25%;overflow:auto}.column-2{flex:1 1 auto;min-width:0}.without-default-opt .column-1{display:none}@media(max-width:400px){.footer-content,.ndp-footer-content{display:block}.footer-content .buttons,.ndp-footer-content .buttons{justify-content:flex-end;margin-top:20px}#range-label-text{margin-right:1.5rem}}@media(max-width:650px){.row-1{flex-direction:column}.column-1{flex-basis:auto}.column-separator{display:none}}.pe-0{padding-right:0}.ps-0{padding-left:0}button.checked{color:var(--mat-sys-primary);border-radius:4px}.ndp-range-label-text{color:var(--mat-sys-on-surface)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i3$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i6.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: AcpDateRangeCalendar, selector: "acp-date-range-calendar", inputs: ["minDate", "maxDate", "selectedDates"], outputs: ["selectedDatesChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AcpButton, selector: "acp-button" }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9278
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: AcpDateRangeInput, isStandalone: true, selector: "acp-date-range-input", inputs: { inputLabel: { classPropertyName: "inputLabel", publicName: "inputLabel", isSignal: false, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, showCalendarIcon: { classPropertyName: "showCalendarIcon", publicName: "showCalendarIcon", isSignal: true, isRequired: false, transformFunction: null }, showRangeRequired: { classPropertyName: "showRangeRequired", publicName: "showRangeRequired", isSignal: true, isRequired: false, transformFunction: null }, isRangeRequired: { classPropertyName: "isRangeRequired", publicName: "isRangeRequired", isSignal: true, isRequired: false, transformFunction: null }, staticOptionId: { classPropertyName: "staticOptionId", publicName: "staticOptionId", isSignal: false, isRequired: false, transformFunction: null }, dynamicOptionId: { classPropertyName: "dynamicOptionId", publicName: "dynamicOptionId", isSignal: false, isRequired: false, transformFunction: null }, calendarId: { classPropertyName: "calendarId", publicName: "calendarId", isSignal: false, isRequired: false, transformFunction: null }, enableDefaultOptions: { classPropertyName: "enableDefaultOptions", publicName: "enableDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, selectedDates: { classPropertyName: "selectedDates", publicName: "selectedDates", isSignal: false, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: false, isRequired: false, transformFunction: null }, isShowStaticDefaultOptions: { classPropertyName: "isShowStaticDefaultOptions", publicName: "isShowStaticDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, hideDefaultOptions: { classPropertyName: "hideDefaultOptions", publicName: "hideDefaultOptions", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayOffsetX: { classPropertyName: "cdkConnectedOverlayOffsetX", publicName: "cdkConnectedOverlayOffsetX", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayOffsetY: { classPropertyName: "cdkConnectedOverlayOffsetY", publicName: "cdkConnectedOverlayOffsetY", isSignal: false, isRequired: false, transformFunction: null }, listCdkConnectedOverlayOffsetY: { classPropertyName: "listCdkConnectedOverlayOffsetY", publicName: "listCdkConnectedOverlayOffsetY", isSignal: false, isRequired: false, transformFunction: null }, listCdkConnectedOverlayOffsetX: { classPropertyName: "listCdkConnectedOverlayOffsetX", publicName: "listCdkConnectedOverlayOffsetX", isSignal: false, isRequired: false, transformFunction: null }, selectedOptionIndex: { classPropertyName: "selectedOptionIndex", publicName: "selectedOptionIndex", isSignal: false, isRequired: false, transformFunction: null }, displaySelectedLabel: { classPropertyName: "displaySelectedLabel", publicName: "displaySelectedLabel", isSignal: false, isRequired: false, transformFunction: null }, displaySelectedExpression: { classPropertyName: "displaySelectedExpression", publicName: "displaySelectedExpression", isSignal: false, isRequired: false, transformFunction: null }, enableEditableDates: { classPropertyName: "enableEditableDates", publicName: "enableEditableDates", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayPush: { classPropertyName: "cdkConnectedOverlayPush", publicName: "cdkConnectedOverlayPush", isSignal: false, isRequired: false, transformFunction: null }, cdkConnectedOverlayPositions: { classPropertyName: "cdkConnectedOverlayPositions", publicName: "cdkConnectedOverlayPositions", isSignal: false, isRequired: false, transformFunction: null }, allowSingleDateSelection: { classPropertyName: "allowSingleDateSelection", publicName: "allowSingleDateSelection", isSignal: false, isRequired: false, transformFunction: null }, autoSelectOption: { classPropertyName: "autoSelectOption", publicName: "autoSelectOption", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null }, dateDropDownOptions: { classPropertyName: "dateDropDownOptions", publicName: "dateDropDownOptions", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { dateSelectionChanged: "dateSelectionChanged", dateListOptions: "dateListOptions", rangeRequiredChange: "rangeRequiredChange" }, viewQueries: [{ propertyName: "calendar", first: true, predicate: ["calendar"], descendants: true }], ngImport: i0, template: "<!--\n AcpDateRangeInput Component Template\n @author AcontPlus S.A.S\n @version 1.0.0\n\n Comprehensive date range picker with predefined options, custom calendar selection,\n and support for human-readable date expressions.\n-->\n<div class=\"date-picker-main ndp-main\" cdkOverlayOrigin #trigger>\n <mat-form-field\n class=\"w-full\"\n [class]=\"{ 'display-hidden': isShowStaticDefaultOptions }\"\n (click)=\"toggleDateOptionSelectionList($event)\"\n >\n <mat-label (click)=\"toggleDateOptionSelectionList($event)\">{{ inputLabel }}</mat-label>\n <input\n matInput\n #dateInput\n class=\"cursor-pointer\"\n id=\"date-input-field\"\n (input)=\"onMainInputChange(dateInput)\"\n />\n <ng-container matSuffix>\n @if (showClearButton() && !!dateInput.value) {\n <button\n mat-icon-button\n class=\"cursor-pointer pe-0 ps-0\"\n matTooltip=\"Clear\"\n (click)=\"clearSelection($event)\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n } @if (showCalendarIcon()) {\n <button mat-icon-button class=\"cursor-pointer\">\n <mat-icon>date_range</mat-icon>\n </button>\n } @if (showRangeRequired()) {\n <button\n mat-icon-button\n class=\"cursor-pointer\"\n [class.checked]=\"isRangeRequired()\"\n (click)=\"toggleRangeSelection($event)\"\n matTooltip=\"Rango de fechas obligatorio\"\n >\n <mat-icon [color]=\"isRangeRequired() ? 'accent' : ''\">\n {{ isRangeRequired() ? 'check_box' : 'check_box_outline_blank' }}\n </mat-icon>\n </button>\n }\n </ng-container>\n </mat-form-field>\n\n @if (dateDropDownOptions.length && isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: staticOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDateOptionList\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayOffsetX]=\"listCdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"listCdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isDateOptionList = false\"\n >\n @if (dateDropDownOptions.length && !isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: dynamicOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n </ng-template>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isCustomRange\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayPositions]=\"cdkConnectedOverlayPositions\"\n [cdkConnectedOverlayOffsetX]=\"cdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"cdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isCustomRange = false\"\n >\n <div\n class=\"custom-ckd-container ndp-cdk-container custom-calendar-container ndp-calendar-container\"\n [class]=\"{ 'without-default-opt': hideDefaultOptions }\"\n >\n <div class=\"row-1\">\n @if (!hideDefaultOptions) {\n <div class=\"pt-custom column-1\">\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n }\n \"\n />\n </div>\n <div class=\"ndp-column-separator\"></div>\n }\n <div class=\"mt-2 column-2\">\n <acp-date-range-calendar\n [selectedDates]=\"selectedDates\"\n #calendar\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (selectedDatesChange)=\"onCalendarSelectionChange($event)\"\n />\n </div>\n </div>\n <div class=\"row-2 br-top\">\n <div class=\"footer-content ndp-footer-content\">\n @if (enableEditableDates) {\n <form class=\"ndp-date-inputs\" [formGroup]=\"editableForm\">\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>Start</mat-label>\n <input\n matInput\n formControlName=\"start\"\n placeholder=\"e.g. now-7d\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.start.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.start.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n }\n </mat-form-field>\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>End</mat-label>\n <input\n matInput\n formControlName=\"end\"\n placeholder=\"e.g. now\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.end.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.end.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n } @else if (editableForm.hasError('rangeOrder')) {\n <mat-error>Start must be before end</mat-error>\n }\n </mat-form-field>\n </form>\n } @else {\n <span id=\"range-label-text\" class=\"ndp-range-label-text\">\n {{ calendar.selectedDates?.start | date: dateFormat }} @if (calendar.selectedDates?.end)\n {\n <span> - {{ calendar.selectedDates?.end | date: dateFormat }} </span>\n }\n </span>\n }\n <div class=\"buttons\">\n <acp-button\n type=\"button\"\n appearance=\"filled\"\n color=\"primary\"\n size=\"small\"\n [class.disabled]=\"\n enableEditableDates\n ? editableForm.invalid\n : !(calendar.selectedDates?.start && calendar.selectedDates?.end)\n \"\n (clicked)=\"\n enableEditableDates && commitEditableDates(calendar);\n updateCustomRange(dateInput, calendar.selectedDates)\n \"\n >\n Aplicar \n </acp-button>\n <acp-button\n type=\"button\"\n appearance=\"text\"\n color=\"error\"\n size=\"small\"\n (clicked)=\"isCustomRange = false\"\n >Cancelar</acp-button\n >\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n</div>\n\n<ng-template\n #dateOptionList\n let-options\n let-input=\"dateInput\"\n let-optionId=\"optionId\"\n let-className=\"className\"\n>\n <mat-action-list [ngClass]=\"className\" [id]=\"optionId\">\n @for (option of options; track option.optionLabel) {\n <mat-list-item [activated]=\"option.isSelected\" (click)=\"updateSelection(option, input)\">\n {{ option.optionLabel }}\n </mat-list-item>\n }\n </mat-action-list>\n</ng-template>\n", styles: ["mat-list-item.mat-mdc-list-item{height:40px}mat-list-item.mdc-list-item--activated{background-color:var(--ndp-selected-option-bg, var(--mat-sys-secondary-container, rgba(0, 0, 0, .08)))}::ng-deep .cdk-overlay-pane:has(.custom-ckd-container),::ng-deep .cdk-overlay-pane:has(.ndp-cdk-container){width:100%;background-color:var(--mat-sys-surface-container);max-height:100vh;overflow-y:auto;overflow-x:hidden;max-width:700px;margin-top:0;border:1px solid var(--mat-sys-surface-container)}::ng-deep .cdk-overlay-pane:has(.range-input){max-width:250px}.br-top{border-top:1px solid var(--mat-sys-surface-container)}.br-right{border-right:1px solid var(--mat-sys-surface-container)}.disabled{pointer-events:none;opacity:.5}.mat-button,.mdc-button{font-family:var(--mat-list-list-item-label-text-font);line-height:var(--mat-list-list-item-label-text-line-height);font-size:var(--mat-list-list-item-label-text-size);font-weight:var(--mat-list-list-item-label-text-weight);letter-spacing:var(--mat-list-list-item-label-text-tracking)}.w-full{width:100%}.display-hidden{display:none}.custom-calendar-container,.ndp-calendar-container{width:100%}.row-1,.row-2{width:100%;box-sizing:border-box}.row-1{display:flex;align-items:stretch}.row-2{padding:16px}.ndp-column-separator{flex:0 0 1px;background-color:var(--mat-sys-surface-container)}.footer-content,.ndp-footer-content{align-items:center;display:flex;text-align:right;justify-content:end;gap:16px;text-overflow:ellipsis}.footer-content .buttons,.ndp-footer-content .buttons{display:flex;gap:8px}.ndp-date-inputs{display:flex;gap:8px;margin-right:auto;align-items:flex-start}.ndp-date-field{width:150px}.column-1{flex:0 0 25%;overflow:auto}.column-2{flex:1 1 auto;min-width:0}.without-default-opt .column-1{display:none}@media(max-width:400px){.footer-content,.ndp-footer-content{display:block}.footer-content .buttons,.ndp-footer-content .buttons{justify-content:flex-end;margin-top:20px}#range-label-text{margin-right:1.5rem}}@media(max-width:650px){.row-1{flex-direction:column}.column-1{flex-basis:auto}.column-separator{display:none}}.pe-0{padding-right:0}.ps-0{padding-left:0}button.checked{color:var(--mat-sys-primary);border-radius:4px}.ndp-range-label-text{color:var(--mat-sys-on-surface)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i3$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i6.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: AcpDateRangeCalendar, selector: "acp-date-range-calendar", inputs: ["minDate", "maxDate", "selectedDates"], outputs: ["selectedDatesChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AcpButton, selector: "acp-button" }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8292
9279
|
}
|
|
8293
9280
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AcpDateRangeInput, decorators: [{
|
|
8294
9281
|
type: Component,
|
|
@@ -8311,7 +9298,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
8311
9298
|
DatePipe,
|
|
8312
9299
|
NgTemplateOutlet,
|
|
8313
9300
|
AcpButton,
|
|
8314
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n AcpDateRangeInput Component Template\n @author AcontPlus S.A.S\n @version 1.0.0\n\n Comprehensive date range picker with predefined options, custom calendar selection,\n and support for human-readable date expressions.\n-->\n<div class=\"date-picker-main ndp-main\" cdkOverlayOrigin #trigger>\n <mat-form-field\n class=\"w-full\"\n [class]=\"{ 'display-hidden': isShowStaticDefaultOptions }\"\n (click)=\"toggleDateOptionSelectionList($event)\"\n >\n <mat-label (click)=\"toggleDateOptionSelectionList($event)\">{{ inputLabel }}</mat-label>\n <input\n matInput\n #dateInput\n class=\"cursor-pointer\"\n id=\"date-input-field\"\n (input)=\"onMainInputChange(dateInput)\"\n />\n <ng-container matSuffix>\n @if (showClearButton() && !!dateInput.value) {\n <button\n mat-icon-button\n class=\"cursor-pointer pe-0 ps-0\"\n matTooltip=\"Clear\"\n (click)=\"clearSelection($event)\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n } @if (showCalendarIcon()) {\n <button mat-icon-button class=\"cursor-pointer\">\n <mat-icon>date_range</mat-icon>\n </button>\n } @if (showRangeRequired()) {\n <button\n mat-icon-button\n class=\"cursor-pointer\"\n [class.checked]=\"isRangeRequired()\"\n (click)=\"toggleRangeSelection($event)\"\n matTooltip=\"Rango de fechas obligatorio\"\n >\n <mat-icon [color]=\"isRangeRequired() ? 'accent' : ''\">\n {{ isRangeRequired() ? 'check_box' : 'check_box_outline_blank' }}\n </mat-icon>\n </button>\n }\n </ng-container>\n </mat-form-field>\n\n @if (dateDropDownOptions.length && isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: staticOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDateOptionList\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayOffsetX]=\"listCdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"listCdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isDateOptionList = false\"\n >\n @if (dateDropDownOptions.length && !isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: dynamicOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n </ng-template>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isCustomRange\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayPositions]=\"cdkConnectedOverlayPositions\"\n [cdkConnectedOverlayOffsetX]=\"cdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"cdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isCustomRange = false\"\n >\n <div\n class=\"custom-ckd-container ndp-cdk-container custom-calendar-container ndp-calendar-container\"\n [class]=\"{ 'without-default-opt': hideDefaultOptions }\"\n >\n <div class=\"row-1\">\n @if (!hideDefaultOptions) {\n <div class=\"pt-custom column-1\">\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n }\n \"\n />\n </div>\n <div class=\"ndp-column-separator\"></div>\n }\n <div class=\"mt-2 column-2\">\n <acp-date-range-calendar\n [selectedDates]=\"selectedDates\"\n #calendar\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (selectedDatesChange)=\"onCalendarSelectionChange($event)\"\n />\n </div>\n </div>\n <div class=\"row-2 br-top\">\n <div class=\"footer-content ndp-footer-content\">\n @if (enableEditableDates) {\n <form class=\"ndp-date-inputs\" [formGroup]=\"editableForm\">\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>Start</mat-label>\n <input\n matInput\n formControlName=\"start\"\n placeholder=\"e.g. now-7d\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.start.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.start.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n }\n </mat-form-field>\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>End</mat-label>\n <input\n matInput\n formControlName=\"end\"\n placeholder=\"e.g. now\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.end.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.end.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n } @else if (editableForm.hasError('rangeOrder')) {\n <mat-error>Start must be before end</mat-error>\n }\n </mat-form-field>\n </form>\n } @else {\n <span id=\"range-label-text\" class=\"ndp-range-label-text\">\n {{ calendar.selectedDates?.start | date: dateFormat }} @if (calendar.selectedDates?.end)\n {\n <span> - {{ calendar.selectedDates?.end | date: dateFormat }} </span>\n }\n </span>\n }\n <div class=\"buttons\">\n <acp-button\n type=\"button\"\n appearance=\"filled\"\n color=\"primary\"\n size=\"small\"\n [class.disabled]=\"\n enableEditableDates\n ? editableForm.invalid\n : !(calendar.selectedDates?.start && calendar.selectedDates?.end)\n \"\n (clicked)=\"\n enableEditableDates && commitEditableDates(calendar);\n updateCustomRange(dateInput, calendar.selectedDates)\n \"\n >\n Aplicar \n </acp-button>\n <acp-button\n type=\"button\"\n appearance=\"text\"\n color=\"error\"\n size=\"small\"\n (clicked)=\"isCustomRange = false\"\n >Cancelar</acp-button\n >\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n</div>\n\n<ng-template\n #dateOptionList\n let-options\n let-input=\"dateInput\"\n let-optionId=\"optionId\"\n let-className=\"className\"\n>\n <mat-action-list [ngClass]=\"className\" [id]=\"optionId\">\n @for (option of options; track option.optionLabel) {\n <mat-list-item [activated]=\"option.isSelected\" (click)=\"updateSelection(option, input)\">\n {{ option.optionLabel }}\n </mat-list-item>\n }\n </mat-action-list>\n</ng-template>\n", styles: ["::ng-deep .cdk-overlay-dark-backdrop{background:none}mat-list-item.mat-mdc-list-item{height:40px}mat-list-item.mdc-list-item--activated{background-color:var(--ndp-selected-option-bg, var(--mat-sys-secondary-container, rgba(0, 0, 0, .08)))}::ng-deep .cdk-overlay-pane:has(.custom-ckd-container),::ng-deep .cdk-overlay-pane:has(.ndp-cdk-container){width:100%;background-color:var(--mat-sys-surface-container);max-height:100vh;overflow-y:auto;overflow-x:hidden;max-width:700px;margin-top:-22px;border:1px solid var(--mat-sys-surface-container)}::ng-deep .cdk-overlay-pane:has(.range-input){max-width:250px}.br-top{border-top:1px solid var(--mat-sys-surface-container)}.br-right{border-right:1px solid var(--mat-sys-surface-container)}.disabled{pointer-events:none;opacity:.5}.mat-button,.mdc-button{font-family:var(--mat-list-list-item-label-text-font);line-height:var(--mat-list-list-item-label-text-line-height);font-size:var(--mat-list-list-item-label-text-size);font-weight:var(--mat-list-list-item-label-text-weight);letter-spacing:var(--mat-list-list-item-label-text-tracking)}.w-full{width:100%}.display-hidden{display:none}.custom-calendar-container,.ndp-calendar-container{width:100%}.row-1,.row-2{width:100%;box-sizing:border-box}.row-1{display:flex;align-items:stretch}.row-2{padding:16px}.ndp-column-separator{flex:0 0 1px;background-color:var(--mat-sys-surface-container)}.footer-content,.ndp-footer-content{align-items:center;display:flex;text-align:right;justify-content:end;gap:16px;text-overflow:ellipsis}.footer-content .buttons,.ndp-footer-content .buttons{display:flex;gap:8px}.ndp-date-inputs{display:flex;gap:8px;margin-right:auto;align-items:flex-start}.ndp-date-field{width:150px}.column-1{flex:0 0 25%;overflow:auto}.column-2{flex:1 1 auto;min-width:0}.without-default-opt .column-1{display:none}@media(max-width:400px){.footer-content,.ndp-footer-content{display:block}.footer-content .buttons,.ndp-footer-content .buttons{justify-content:flex-end;margin-top:20px}#range-label-text{margin-right:1.5rem}}@media(max-width:650px){.row-1{flex-direction:column}.column-1{flex-basis:auto}.column-separator{display:none}}.pe-0{padding-right:0}.ps-0{padding-left:0}button.checked{color:var(--mat-sys-primary);border-radius:4px}.ndp-range-label-text{color:var(--mat-sys-on-surface)}\n"] }]
|
|
9301
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n AcpDateRangeInput Component Template\n @author AcontPlus S.A.S\n @version 1.0.0\n\n Comprehensive date range picker with predefined options, custom calendar selection,\n and support for human-readable date expressions.\n-->\n<div class=\"date-picker-main ndp-main\" cdkOverlayOrigin #trigger>\n <mat-form-field\n class=\"w-full\"\n [class]=\"{ 'display-hidden': isShowStaticDefaultOptions }\"\n (click)=\"toggleDateOptionSelectionList($event)\"\n >\n <mat-label (click)=\"toggleDateOptionSelectionList($event)\">{{ inputLabel }}</mat-label>\n <input\n matInput\n #dateInput\n class=\"cursor-pointer\"\n id=\"date-input-field\"\n (input)=\"onMainInputChange(dateInput)\"\n />\n <ng-container matSuffix>\n @if (showClearButton() && !!dateInput.value) {\n <button\n mat-icon-button\n class=\"cursor-pointer pe-0 ps-0\"\n matTooltip=\"Clear\"\n (click)=\"clearSelection($event)\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n } @if (showCalendarIcon()) {\n <button mat-icon-button class=\"cursor-pointer\">\n <mat-icon>date_range</mat-icon>\n </button>\n } @if (showRangeRequired()) {\n <button\n mat-icon-button\n class=\"cursor-pointer\"\n [class.checked]=\"isRangeRequired()\"\n (click)=\"toggleRangeSelection($event)\"\n matTooltip=\"Rango de fechas obligatorio\"\n >\n <mat-icon [color]=\"isRangeRequired() ? 'accent' : ''\">\n {{ isRangeRequired() ? 'check_box' : 'check_box_outline_blank' }}\n </mat-icon>\n </button>\n }\n </ng-container>\n </mat-form-field>\n\n @if (dateDropDownOptions.length && isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: staticOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDateOptionList\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayOffsetX]=\"listCdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"listCdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isDateOptionList = false\"\n >\n @if (dateDropDownOptions.length && !isShowStaticDefaultOptions) {\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n optionId: dynamicOptionId,\n className: 'w-full custom-ckd-container ndp-cdk-container range-input',\n }\n \"\n />\n }\n </ng-template>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayBackdropClass]=\"'cdk-overlay-transparent-backdrop'\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isCustomRange\"\n [cdkConnectedOverlayPush]=\"cdkConnectedOverlayPush\"\n [cdkConnectedOverlayPositions]=\"cdkConnectedOverlayPositions\"\n [cdkConnectedOverlayOffsetX]=\"cdkConnectedOverlayOffsetX\"\n [cdkConnectedOverlayOffsetY]=\"cdkConnectedOverlayOffsetY\"\n (backdropClick)=\"isCustomRange = false\"\n >\n <div\n class=\"custom-ckd-container ndp-cdk-container custom-calendar-container ndp-calendar-container\"\n [class]=\"{ 'without-default-opt': hideDefaultOptions }\"\n >\n <div class=\"row-1\">\n @if (!hideDefaultOptions) {\n <div class=\"pt-custom column-1\">\n <ng-container\n *ngTemplateOutlet=\"\n dateOptionList;\n context: {\n $implicit: visibleOptions(),\n dateInput: dateInput,\n }\n \"\n />\n </div>\n <div class=\"ndp-column-separator\"></div>\n }\n <div class=\"mt-2 column-2\">\n <acp-date-range-calendar\n [selectedDates]=\"selectedDates\"\n #calendar\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (selectedDatesChange)=\"onCalendarSelectionChange($event)\"\n />\n </div>\n </div>\n <div class=\"row-2 br-top\">\n <div class=\"footer-content ndp-footer-content\">\n @if (enableEditableDates) {\n <form class=\"ndp-date-inputs\" [formGroup]=\"editableForm\">\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>Start</mat-label>\n <input\n matInput\n formControlName=\"start\"\n placeholder=\"e.g. now-7d\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.start.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.start.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n }\n </mat-form-field>\n <mat-form-field class=\"ndp-date-field\" subscriptSizing=\"dynamic\">\n <mat-label>End</mat-label>\n <input\n matInput\n formControlName=\"end\"\n placeholder=\"e.g. now\"\n (blur)=\"commitEditableDates(calendar)\"\n (keydown.enter)=\"applyEditableDates(dateInput, calendar)\"\n />\n @if (editableForm.controls.end.hasError('required')) {\n <mat-error>Required</mat-error>\n } @else if (editableForm.controls.end.hasError('invalidDate')) {\n <mat-error>Invalid date or expression</mat-error>\n } @else if (editableForm.hasError('rangeOrder')) {\n <mat-error>Start must be before end</mat-error>\n }\n </mat-form-field>\n </form>\n } @else {\n <span id=\"range-label-text\" class=\"ndp-range-label-text\">\n {{ calendar.selectedDates?.start | date: dateFormat }} @if (calendar.selectedDates?.end)\n {\n <span> - {{ calendar.selectedDates?.end | date: dateFormat }} </span>\n }\n </span>\n }\n <div class=\"buttons\">\n <acp-button\n type=\"button\"\n appearance=\"filled\"\n color=\"primary\"\n size=\"small\"\n [class.disabled]=\"\n enableEditableDates\n ? editableForm.invalid\n : !(calendar.selectedDates?.start && calendar.selectedDates?.end)\n \"\n (clicked)=\"\n enableEditableDates && commitEditableDates(calendar);\n updateCustomRange(dateInput, calendar.selectedDates)\n \"\n >\n Aplicar \n </acp-button>\n <acp-button\n type=\"button\"\n appearance=\"text\"\n color=\"error\"\n size=\"small\"\n (clicked)=\"isCustomRange = false\"\n >Cancelar</acp-button\n >\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n</div>\n\n<ng-template\n #dateOptionList\n let-options\n let-input=\"dateInput\"\n let-optionId=\"optionId\"\n let-className=\"className\"\n>\n <mat-action-list [ngClass]=\"className\" [id]=\"optionId\">\n @for (option of options; track option.optionLabel) {\n <mat-list-item [activated]=\"option.isSelected\" (click)=\"updateSelection(option, input)\">\n {{ option.optionLabel }}\n </mat-list-item>\n }\n </mat-action-list>\n</ng-template>\n", styles: ["mat-list-item.mat-mdc-list-item{height:40px}mat-list-item.mdc-list-item--activated{background-color:var(--ndp-selected-option-bg, var(--mat-sys-secondary-container, rgba(0, 0, 0, .08)))}::ng-deep .cdk-overlay-pane:has(.custom-ckd-container),::ng-deep .cdk-overlay-pane:has(.ndp-cdk-container){width:100%;background-color:var(--mat-sys-surface-container);max-height:100vh;overflow-y:auto;overflow-x:hidden;max-width:700px;margin-top:0;border:1px solid var(--mat-sys-surface-container)}::ng-deep .cdk-overlay-pane:has(.range-input){max-width:250px}.br-top{border-top:1px solid var(--mat-sys-surface-container)}.br-right{border-right:1px solid var(--mat-sys-surface-container)}.disabled{pointer-events:none;opacity:.5}.mat-button,.mdc-button{font-family:var(--mat-list-list-item-label-text-font);line-height:var(--mat-list-list-item-label-text-line-height);font-size:var(--mat-list-list-item-label-text-size);font-weight:var(--mat-list-list-item-label-text-weight);letter-spacing:var(--mat-list-list-item-label-text-tracking)}.w-full{width:100%}.display-hidden{display:none}.custom-calendar-container,.ndp-calendar-container{width:100%}.row-1,.row-2{width:100%;box-sizing:border-box}.row-1{display:flex;align-items:stretch}.row-2{padding:16px}.ndp-column-separator{flex:0 0 1px;background-color:var(--mat-sys-surface-container)}.footer-content,.ndp-footer-content{align-items:center;display:flex;text-align:right;justify-content:end;gap:16px;text-overflow:ellipsis}.footer-content .buttons,.ndp-footer-content .buttons{display:flex;gap:8px}.ndp-date-inputs{display:flex;gap:8px;margin-right:auto;align-items:flex-start}.ndp-date-field{width:150px}.column-1{flex:0 0 25%;overflow:auto}.column-2{flex:1 1 auto;min-width:0}.without-default-opt .column-1{display:none}@media(max-width:400px){.footer-content,.ndp-footer-content{display:block}.footer-content .buttons,.ndp-footer-content .buttons{justify-content:flex-end;margin-top:20px}#range-label-text{margin-right:1.5rem}}@media(max-width:650px){.row-1{flex-direction:column}.column-1{flex-basis:auto}.column-separator{display:none}}.pe-0{padding-right:0}.ps-0{padding-left:0}button.checked{color:var(--mat-sys-primary);border-radius:4px}.ndp-range-label-text{color:var(--mat-sys-on-surface)}\n"] }]
|
|
8315
9302
|
}], propDecorators: { inputLabel: [{
|
|
8316
9303
|
type: Input
|
|
8317
9304
|
}], showClearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearButton", required: false }] }], showCalendarIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCalendarIcon", required: false }] }], showRangeRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRangeRequired", required: false }] }], isRangeRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRangeRequired", required: false }] }], staticOptionId: [{
|
|
@@ -9687,7 +10674,8 @@ class AdvancedDialogService {
|
|
|
9687
10674
|
async open(component, config = {}) {
|
|
9688
10675
|
const dialogConfig = await this.buildDialogConfig(config);
|
|
9689
10676
|
const dialogRef = this.dialog.open(component, dialogConfig);
|
|
9690
|
-
|
|
10677
|
+
this.wireCloseBehavior(dialogRef, config);
|
|
10678
|
+
// Apply centralized z-index
|
|
9691
10679
|
this.zIndexService.applyZIndex(dialogRef);
|
|
9692
10680
|
return dialogRef;
|
|
9693
10681
|
}
|
|
@@ -9706,7 +10694,8 @@ class AdvancedDialogService {
|
|
|
9706
10694
|
};
|
|
9707
10695
|
const dialogConfig = await this.buildDialogConfig(configWithWrapperData);
|
|
9708
10696
|
const dialogRef = this.dialog.open(DialogWrapper, dialogConfig);
|
|
9709
|
-
|
|
10697
|
+
this.wireCloseBehavior(dialogRef, matDialogConfig);
|
|
10698
|
+
// Apply centralized z-index
|
|
9710
10699
|
this.zIndexService.applyZIndex(dialogRef);
|
|
9711
10700
|
return dialogRef;
|
|
9712
10701
|
}
|
|
@@ -9726,52 +10715,61 @@ class AdvancedDialogService {
|
|
|
9726
10715
|
// --- Private Configuration Builder ---
|
|
9727
10716
|
async buildDialogConfig(config) {
|
|
9728
10717
|
const dialogConfig = new MatDialogConfig();
|
|
10718
|
+
const basePanelClasses = [];
|
|
9729
10719
|
// Asynchronously check for mobile state to prevent memory leaks from dangling subscriptions.
|
|
9730
10720
|
const isMobile = await firstValueFrom(this.isMobile$);
|
|
9731
10721
|
// Apply fullscreen if 'full' size is set OR if mobile fullscreen is enabled on a mobile device.
|
|
9732
10722
|
if (config.size === 'full' || (config.isMobileFullScreen && isMobile)) {
|
|
9733
10723
|
this.applyFullScreenConfig(dialogConfig);
|
|
10724
|
+
basePanelClasses.push('full-screen-dialog');
|
|
9734
10725
|
}
|
|
9735
10726
|
else {
|
|
9736
10727
|
this.applyStandardConfig(dialogConfig, config);
|
|
9737
10728
|
}
|
|
9738
10729
|
// Apply all other common configurations.
|
|
9739
|
-
this.applyCommonConfig(dialogConfig, config);
|
|
10730
|
+
this.applyCommonConfig(dialogConfig, config, basePanelClasses);
|
|
9740
10731
|
return dialogConfig;
|
|
9741
10732
|
}
|
|
9742
10733
|
applyFullScreenConfig(dialogConfig) {
|
|
9743
10734
|
dialogConfig.width = '100vw';
|
|
9744
10735
|
dialogConfig.height = '100vh';
|
|
9745
10736
|
dialogConfig.maxWidth = '100vw';
|
|
9746
|
-
dialogConfig.
|
|
10737
|
+
dialogConfig.maxHeight = '100vh';
|
|
9747
10738
|
}
|
|
9748
10739
|
applyStandardConfig(dialogConfig, config) {
|
|
9749
10740
|
const width = config.width ?? this.getDialogWidth(config.size);
|
|
9750
10741
|
dialogConfig.width = width;
|
|
9751
10742
|
dialogConfig.height = config.height;
|
|
9752
10743
|
dialogConfig.minWidth = config.minWidth;
|
|
10744
|
+
dialogConfig.minHeight = config.minHeight;
|
|
9753
10745
|
const maxWidth = config.maxWidth ?? '95vw';
|
|
9754
10746
|
dialogConfig.maxWidth = maxWidth;
|
|
9755
10747
|
const maxHeight = config.maxHeight ?? 'auto';
|
|
9756
10748
|
dialogConfig.maxHeight = maxHeight;
|
|
9757
10749
|
dialogConfig.position = config.position;
|
|
9758
10750
|
}
|
|
9759
|
-
applyCommonConfig(dialogConfig, config) {
|
|
10751
|
+
applyCommonConfig(dialogConfig, config, basePanelClasses = []) {
|
|
9760
10752
|
dialogConfig.data = config.data;
|
|
9761
10753
|
dialogConfig.hasBackdrop = config.hasBackdrop ?? true;
|
|
9762
10754
|
dialogConfig.backdropClass = config.backdropClass;
|
|
9763
|
-
const panelClasses =
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
10755
|
+
const panelClasses = [...basePanelClasses];
|
|
10756
|
+
if (Array.isArray(config.panelClass)) {
|
|
10757
|
+
panelClasses.push(...config.panelClass);
|
|
10758
|
+
}
|
|
10759
|
+
else if (config.panelClass) {
|
|
10760
|
+
panelClasses.push(config.panelClass);
|
|
10761
|
+
}
|
|
9768
10762
|
if (config.size) {
|
|
9769
10763
|
panelClasses.push(`dialog-${config.size}`);
|
|
9770
10764
|
}
|
|
9771
10765
|
dialogConfig.panelClass = panelClasses;
|
|
9772
|
-
|
|
9773
|
-
//
|
|
10766
|
+
// MatDialog's `disableClose` blocks both the backdrop click and the Escape key.
|
|
10767
|
+
// When only one of them should be disabled, `disableClose` is set and the
|
|
10768
|
+
// allowed gesture is re-enabled in `wireCloseBehavior`.
|
|
10769
|
+
dialogConfig.disableClose =
|
|
10770
|
+
!(config.backdropClickClosable ?? true) || !(config.escapeKeyClosable ?? true);
|
|
9774
10771
|
dialogConfig.autoFocus = config.autoFocus ?? 'first-tabbable';
|
|
10772
|
+
dialogConfig.restoreFocus = config.restoreFocus ?? true;
|
|
9775
10773
|
dialogConfig.scrollStrategy = config.scrollStrategy ?? this.overlay.scrollStrategies.block();
|
|
9776
10774
|
dialogConfig.enterAnimationDuration = config.enterAnimationDuration ?? '300ms';
|
|
9777
10775
|
dialogConfig.exitAnimationDuration = config.exitAnimationDuration ?? '200ms';
|
|
@@ -9780,6 +10778,27 @@ class AdvancedDialogService {
|
|
|
9780
10778
|
dialogConfig.ariaDescribedBy = config.ariaDescribedBy;
|
|
9781
10779
|
dialogConfig.role = config.role;
|
|
9782
10780
|
}
|
|
10781
|
+
/**
|
|
10782
|
+
* Re-enables a single close gesture (backdrop click or Escape) when the other
|
|
10783
|
+
* one is disabled, since MatDialog's `disableClose` blocks both at once.
|
|
10784
|
+
*/
|
|
10785
|
+
wireCloseBehavior(dialogRef, config) {
|
|
10786
|
+
const backdropClosable = config.backdropClickClosable ?? true;
|
|
10787
|
+
const escapeClosable = config.escapeKeyClosable ?? true;
|
|
10788
|
+
if (backdropClosable === escapeClosable) {
|
|
10789
|
+
return;
|
|
10790
|
+
}
|
|
10791
|
+
if (escapeClosable) {
|
|
10792
|
+
dialogRef.keydownEvents().subscribe(event => {
|
|
10793
|
+
if (event.key === 'Escape') {
|
|
10794
|
+
dialogRef.close();
|
|
10795
|
+
}
|
|
10796
|
+
});
|
|
10797
|
+
}
|
|
10798
|
+
else {
|
|
10799
|
+
dialogRef.backdropClick().subscribe(() => dialogRef.close());
|
|
10800
|
+
}
|
|
10801
|
+
}
|
|
9783
10802
|
getDialogWidth(size = 'md') {
|
|
9784
10803
|
const sizeMap = {
|
|
9785
10804
|
xs: '320px',
|
|
@@ -11210,5 +12229,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
11210
12229
|
* Generated bundle index. Do not edit.
|
|
11211
12230
|
*/
|
|
11212
12231
|
|
|
11213
|
-
export { ACP_ACTIVE_DATE_DEBOUNCE, ACP_BADGE_COLORS, ACP_BADGE_SHAPES, ACP_BADGE_SIZES, ACP_BADGE_VARIANTS, ACP_DATE_OPTION_TYPE, ACP_DEFAULT_DATE_OPTIONS, ACP_DRAWER_DATA, ACP_DRAWER_DEFAULT_OPTIONS, ACP_POPOVER_CONTENT, ACP_POPOVER_DEFAULT_OPTIONS, ACP_POPOVER_SCROLL_STRATEGY, AcpAlert, AcpBadge, AcpButton, AcpCard, AcpCheckboxBase, AcpCheckboxGroup, AcpContextMenu, AcpContextMenuDirective, AcpContextMenuPanel, AcpContextMenuService, AcpDateRangeInput, AcpDrawer, AcpDrawerConfig, AcpDrawerContainer, AcpDrawerRef, AcpHeader, AcpHeaderActions, AcpHeaderBranding, AcpHeaderCenter, AcpHeaderEnd, AcpHeaderLanguage, AcpHeaderNotifications, AcpHeaderStart, AcpHeaderTheme, AcpHeaderWorkspace, AcpKpiCard, AcpPopover, AcpPopoverContent, AcpPopoverTarget, AcpPopoverTrigger, AcpSelectDateOption, AcpShellLayout, AcpShellSlotHeader, AcpShellSlotSidebar, AcpShellSlotSidebarFooter, AcpShellSlotToolbar, AcpShellSlotTopmenu, AcpSidebar, AcpSidebarBranding, AcpSidebarContent, AcpSidebarHeader, AcpSidebarToggle, AcpSidebarUserPanel, AcpTopmenu, AcpTopmenuPanel, AdvancedDialogService, Branding, Button, CONTEXT_MENU_DATA, CONTEXT_MENU_ITEMS, DATA_GRID_DEFAULT_OPTIONS, DataGrid, DateRangePicker, DialogWrapper, DialogZIndexService, DynamicCard, DynamicSelect, GetTotalPipe, IconRegistryService, InputChip, KPI_CARD_TOKENS, KPI_CARD_TREND_CONFIGS, KeyboardNavigationService, NavAccordionDirective, NavAccordionItemDirective, NavAccordionToggleDirective, OverlayService, Pagination, SidemenuComponent, Spinner, StatusDisplayPipe, SvgIcon, TREND_CONFIGS, TabulatorTable, ThemeSwitcher, ThemeToggle, ToUpperCase, UserIcon, UserMenu, UserPanel, _AcpPopoverContentBase, formatValue };
|
|
12232
|
+
export { ACP_ACTIVE_DATE_DEBOUNCE, ACP_BADGE_COLORS, ACP_BADGE_SHAPES, ACP_BADGE_SIZES, ACP_BADGE_VARIANTS, ACP_DATE_OPTION_TYPE, ACP_DEFAULT_DATE_OPTIONS, ACP_DIALOG_ACTIONS, ACP_DIALOG_DATA, ACP_DIALOG_DEFAULT_OPTIONS, ACP_DIALOG_TITLEBAR, ACP_DRAWER_DATA, ACP_DRAWER_DEFAULT_OPTIONS, ACP_POPOVER_CONTENT, ACP_POPOVER_DEFAULT_OPTIONS, ACP_POPOVER_SCROLL_STRATEGY, AcpAlert, AcpBadge, AcpButton, AcpCard, AcpCheckboxBase, AcpCheckboxGroup, AcpContextMenu, AcpContextMenuDirective, AcpContextMenuPanel, AcpContextMenuService, AcpDateRangeInput, AcpDialog, AcpDialogActions, AcpDialogContainer, AcpDialogContent, AcpDialogRef, AcpDialogService, AcpDialogTitlebar, AcpDrawer, AcpDrawerConfig, AcpDrawerContainer, AcpDrawerRef, AcpHeader, AcpHeaderActions, AcpHeaderBranding, AcpHeaderCenter, AcpHeaderEnd, AcpHeaderLanguage, AcpHeaderNotifications, AcpHeaderStart, AcpHeaderTheme, AcpHeaderWorkspace, AcpKpiCard, AcpPopover, AcpPopoverContent, AcpPopoverTarget, AcpPopoverTrigger, AcpSelectDateOption, AcpShellLayout, AcpShellSlotHeader, AcpShellSlotSidebar, AcpShellSlotSidebarFooter, AcpShellSlotToolbar, AcpShellSlotTopmenu, AcpSidebar, AcpSidebarBranding, AcpSidebarContent, AcpSidebarHeader, AcpSidebarToggle, AcpSidebarUserPanel, AcpTopmenu, AcpTopmenuPanel, AdvancedDialogService, Branding, Button, CONTEXT_MENU_DATA, CONTEXT_MENU_ITEMS, DATA_GRID_DEFAULT_OPTIONS, DataGrid, DateRangePicker, DialogWrapper, DialogZIndexService, DynamicCard, DynamicSelect, GetTotalPipe, IconRegistryService, InputChip, KPI_CARD_TOKENS, KPI_CARD_TREND_CONFIGS, KeyboardNavigationService, NavAccordionDirective, NavAccordionItemDirective, NavAccordionToggleDirective, OverlayService, Pagination, SidemenuComponent, Spinner, StatusDisplayPipe, SvgIcon, TREND_CONFIGS, TabulatorTable, ThemeSwitcher, ThemeToggle, ToUpperCase, UserIcon, UserMenu, UserPanel, _AcpPopoverContentBase, formatValue, provideAcpDialogDefaults };
|
|
11214
12233
|
//# sourceMappingURL=acontplus-ng-components.mjs.map
|