@dso-toolkit/angular 52.0.2 → 53.0.0

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.
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Component, ChangeDetectionStrategy, Output, NgModule } from '@angular/core';
3
+ import { EventEmitter, Component, ChangeDetectionStrategy, Output, inject, ViewContainerRef, Input, TemplateRef, Injectable, NgModule } from '@angular/core';
4
4
  import { fromEvent } from 'rxjs';
5
5
  import { defineCustomElement as defineCustomElement$1 } from '@dso-toolkit/core/dist/components/dso-accordion.js';
6
6
  import { defineCustomElement as defineCustomElement$2 } from '@dso-toolkit/core/dist/components/dso-accordion-section.js';
@@ -42,6 +42,11 @@ import { defineCustomElement as defineCustomElement$B } from '@dso-toolkit/core/
42
42
  import { defineCustomElement as defineCustomElement$C } from '@dso-toolkit/core/dist/components/dso-tooltip.js';
43
43
  import { defineCustomElement as defineCustomElement$D } from '@dso-toolkit/core/dist/components/dso-tree-view.js';
44
44
  import { defineCustomElement as defineCustomElement$E } from '@dso-toolkit/core/dist/components/dso-viewer-grid.js';
45
+ import { Dialog, DialogModule } from '@angular/cdk/dialog';
46
+ import * as i1 from '@angular/common';
47
+ import { CommonModule } from '@angular/common';
48
+ import * as i2 from '@angular/cdk/portal';
49
+ import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
45
50
 
46
51
  /* eslint-disable */
47
52
  const proxyInputs = (Cmp, inputs) => {
@@ -518,11 +523,11 @@ let DsoExpandableHeading = class DsoExpandableHeading {
518
523
  }
519
524
  };
520
525
  DsoExpandableHeading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoExpandableHeading, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
521
- DsoExpandableHeading.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: DsoExpandableHeading, selector: "dso-expandable-heading", inputs: { color: "color", heading: "heading", open: "open" }, outputs: { dsoToggle: "dsoToggle" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
526
+ DsoExpandableHeading.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: DsoExpandableHeading, selector: "dso-expandable-heading", inputs: { color: "color", editAction: "editAction", heading: "heading", open: "open" }, outputs: { dsoToggle: "dsoToggle" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
522
527
  DsoExpandableHeading = __decorate([
523
528
  ProxyCmp({
524
529
  defineCustomElementFn: defineCustomElement$f,
525
- inputs: ['color', 'heading', 'open']
530
+ inputs: ['color', 'editAction', 'heading', 'open']
526
531
  })
527
532
  ], DsoExpandableHeading);
528
533
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoExpandableHeading, decorators: [{
@@ -532,7 +537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
532
537
  changeDetection: ChangeDetectionStrategy.OnPush,
533
538
  template: '<ng-content></ng-content>',
534
539
  // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
535
- inputs: ['color', 'heading', 'open'],
540
+ inputs: ['color', 'editAction', 'heading', 'open'],
536
541
  }]
537
542
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { dsoToggle: [{
538
543
  type: Output
@@ -1302,19 +1307,168 @@ const DIRECTIVES = [
1302
1307
  DsoViewerGrid
1303
1308
  ];
1304
1309
 
1310
+ class DsoModalContainer {
1311
+ constructor() {
1312
+ this.viewContainerRef = inject(ViewContainerRef);
1313
+ this.dsoClose = new EventEmitter();
1314
+ }
1315
+ }
1316
+ DsoModalContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoModalContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
1317
+ DsoModalContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: DsoModalContainer, selector: "dso-modal-container", inputs: { title: "title", options: "options", bodyPortalRef: "bodyPortalRef", footerPortalRef: "footerPortalRef" }, outputs: { dsoClose: "dsoClose" }, ngImport: i0, template: `
1318
+ <dso-modal
1319
+ [modalTitle]="title"
1320
+ [role]="options?.role"
1321
+ [showCloseButton]="options?.showCloseButton"
1322
+ [initialFocus]="options?.initialFocus"
1323
+ (dsoClose)="dsoClose.emit($event.detail)"
1324
+ >
1325
+ <div *ngIf="bodyPortalRef" slot="body"><ng-template [cdkPortalOutlet]="bodyPortalRef"></ng-template></div>
1326
+ <div *ngIf="footerPortalRef" slot="footer"><ng-template [cdkPortalOutlet]="footerPortalRef"></ng-template></div>
1327
+ </dso-modal>
1328
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "component", type: DsoModal, selector: "dso-modal", inputs: ["initialFocus", "modalTitle", "role", "showCloseButton"], outputs: ["dsoClose"] }] });
1329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoModalContainer, decorators: [{
1330
+ type: Component,
1331
+ args: [{
1332
+ selector: "dso-modal-container",
1333
+ template: `
1334
+ <dso-modal
1335
+ [modalTitle]="title"
1336
+ [role]="options?.role"
1337
+ [showCloseButton]="options?.showCloseButton"
1338
+ [initialFocus]="options?.initialFocus"
1339
+ (dsoClose)="dsoClose.emit($event.detail)"
1340
+ >
1341
+ <div *ngIf="bodyPortalRef" slot="body"><ng-template [cdkPortalOutlet]="bodyPortalRef"></ng-template></div>
1342
+ <div *ngIf="footerPortalRef" slot="footer"><ng-template [cdkPortalOutlet]="footerPortalRef"></ng-template></div>
1343
+ </dso-modal>
1344
+ `,
1345
+ }]
1346
+ }], propDecorators: { title: [{
1347
+ type: Input
1348
+ }], options: [{
1349
+ type: Input
1350
+ }], bodyPortalRef: [{
1351
+ type: Input
1352
+ }], footerPortalRef: [{
1353
+ type: Input
1354
+ }], dsoClose: [{
1355
+ type: Output
1356
+ }] } });
1357
+
1358
+ class DsoModalRef {
1359
+ constructor(dialogRef) {
1360
+ this.dialogRef = dialogRef;
1361
+ }
1362
+ close() {
1363
+ this.dialogRef.close();
1364
+ }
1365
+ onDsoClose() {
1366
+ if (!this.dialogRef.componentInstance) {
1367
+ throw Error("DsoModalRef dialogRef is not opened using a componentInstance");
1368
+ }
1369
+ return this.dialogRef.componentInstance.dsoClose;
1370
+ }
1371
+ }
1372
+
1373
+ class DsoModalController {
1374
+ constructor() {
1375
+ this.cdkDialog = inject(Dialog);
1376
+ }
1377
+ open({ title, body, footer }, config) {
1378
+ const dialogRef = this.cdkDialog.open(DsoModalContainer, { data: config?.data });
1379
+ if (dialogRef.componentInstance) {
1380
+ if (title) {
1381
+ dialogRef.componentInstance.title = title;
1382
+ }
1383
+ if (config?.options) {
1384
+ dialogRef.componentInstance.options = config.options;
1385
+ }
1386
+ const bodyPortal = body instanceof TemplateRef
1387
+ ? new TemplatePortal(body, dialogRef.componentInstance.viewContainerRef)
1388
+ : new ComponentPortal(body);
1389
+ dialogRef.componentInstance.bodyPortalRef = bodyPortal;
1390
+ if (footer) {
1391
+ const footerPortal = footer instanceof TemplateRef
1392
+ ? new TemplatePortal(footer, dialogRef.componentInstance.viewContainerRef)
1393
+ : new ComponentPortal(footer);
1394
+ dialogRef.componentInstance.footerPortalRef = footerPortal;
1395
+ }
1396
+ }
1397
+ return new DsoModalRef(dialogRef);
1398
+ }
1399
+ }
1400
+ DsoModalController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoModalController, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1401
+ DsoModalController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoModalController });
1402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoModalController, decorators: [{
1403
+ type: Injectable
1404
+ }] });
1405
+
1305
1406
  class DsoToolkitModule {
1306
1407
  }
1307
1408
  DsoToolkitModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoToolkitModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1308
- DsoToolkitModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: DsoToolkitModule, declarations: [DsoAccordion, DsoAccordionSection, DsoAlert, DsoAnnotationButton, DsoAnnotationOutput, DsoAttachmentsCounter, DsoAutosuggest, DsoBadge, DsoBanner, DsoCard, DsoCardContainer, DsoDatePicker, DsoDropdownMenu, DsoExpandable, DsoExpandableHeading, DsoHeader, DsoHelpcenterPanel, DsoHighlightBox, DsoIcon, DsoImageOverlay, DsoInfo, DsoInfoButton, DsoLabel, DsoListButton, DsoMapBaseLayers, DsoMapControls, DsoMapOverlays, DsoModal, DsoOzonContent, DsoPagination, DsoProgressBar, DsoProgressIndicator, DsoResponsiveElement, DsoSelectable, DsoSlideToggle, DsoTable, DsoToggletip, DsoTooltip, DsoTreeView, DsoViewerGrid], exports: [DsoAccordion, DsoAccordionSection, DsoAlert, DsoAnnotationButton, DsoAnnotationOutput, DsoAttachmentsCounter, DsoAutosuggest, DsoBadge, DsoBanner, DsoCard, DsoCardContainer, DsoDatePicker, DsoDropdownMenu, DsoExpandable, DsoExpandableHeading, DsoHeader, DsoHelpcenterPanel, DsoHighlightBox, DsoIcon, DsoImageOverlay, DsoInfo, DsoInfoButton, DsoLabel, DsoListButton, DsoMapBaseLayers, DsoMapControls, DsoMapOverlays, DsoModal, DsoOzonContent, DsoPagination, DsoProgressBar, DsoProgressIndicator, DsoResponsiveElement, DsoSelectable, DsoSlideToggle, DsoTable, DsoToggletip, DsoTooltip, DsoTreeView, DsoViewerGrid] });
1309
- DsoToolkitModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoToolkitModule });
1409
+ DsoToolkitModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: DsoToolkitModule, declarations: [DsoAccordion, DsoAccordionSection, DsoAlert, DsoAnnotationButton, DsoAnnotationOutput, DsoAttachmentsCounter, DsoAutosuggest, DsoBadge, DsoBanner, DsoCard, DsoCardContainer, DsoDatePicker, DsoDropdownMenu, DsoExpandable, DsoExpandableHeading, DsoHeader, DsoHelpcenterPanel, DsoHighlightBox, DsoIcon, DsoImageOverlay, DsoInfo, DsoInfoButton, DsoLabel, DsoListButton, DsoMapBaseLayers, DsoMapControls, DsoMapOverlays, DsoModal, DsoOzonContent, DsoPagination, DsoProgressBar, DsoProgressIndicator, DsoResponsiveElement, DsoSelectable, DsoSlideToggle, DsoTable, DsoToggletip, DsoTooltip, DsoTreeView, DsoViewerGrid, DsoModalContainer], imports: [CommonModule, DialogModule], exports: [DsoAccordion, DsoAccordionSection, DsoAlert, DsoAnnotationButton, DsoAnnotationOutput, DsoAttachmentsCounter, DsoAutosuggest, DsoBadge, DsoBanner, DsoCard, DsoCardContainer, DsoDatePicker, DsoDropdownMenu, DsoExpandable, DsoExpandableHeading, DsoHeader, DsoHelpcenterPanel, DsoHighlightBox, DsoIcon, DsoImageOverlay, DsoInfo, DsoInfoButton, DsoLabel, DsoListButton, DsoMapBaseLayers, DsoMapControls, DsoMapOverlays, DsoModal, DsoOzonContent, DsoPagination, DsoProgressBar, DsoProgressIndicator, DsoResponsiveElement, DsoSelectable, DsoSlideToggle, DsoTable, DsoToggletip, DsoTooltip, DsoTreeView, DsoViewerGrid] });
1410
+ DsoToolkitModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoToolkitModule, providers: [DsoModalController], imports: [CommonModule, DialogModule] });
1310
1411
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: DsoToolkitModule, decorators: [{
1311
1412
  type: NgModule,
1312
1413
  args: [{
1313
- declarations: [...DIRECTIVES],
1414
+ declarations: [...DIRECTIVES, DsoModalContainer],
1415
+ imports: [CommonModule, DialogModule],
1416
+ providers: [DsoModalController],
1314
1417
  exports: [...DIRECTIVES],
1315
1418
  }]
1316
1419
  }] });
1317
1420
 
1421
+ /** This component is used to demo the DsoModalController for angular */
1422
+ class ModalControllerDemo {
1423
+ constructor() {
1424
+ this.controller = inject(DsoModalController);
1425
+ this.showCloseButton = false;
1426
+ this.dsoClose = new EventEmitter();
1427
+ }
1428
+ open() {
1429
+ if (this.body) {
1430
+ this.modalRef = this.controller.open({ body: this.body, footer: this.footer, title: this.modalTitle }, { options: { showCloseButton: this.showCloseButton } });
1431
+ this.modalRef.onDsoClose().subscribe((e) => this.dsoClose.emit(e));
1432
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1433
+ window["modalRef"] = { framework: "angular", ref: this.modalRef };
1434
+ }
1435
+ }
1436
+ ngAfterViewInit() {
1437
+ this.open();
1438
+ }
1439
+ }
1440
+ ModalControllerDemo.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ModalControllerDemo, deps: [], target: i0.ɵɵFactoryTarget.Component });
1441
+ ModalControllerDemo.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: ModalControllerDemo, selector: "modal-controller-demo", inputs: { body: "body", footer: "footer", modalTitle: "modalTitle", showCloseButton: "showCloseButton" }, outputs: { dsoClose: "dsoClose" }, ngImport: i0, template: ``, isInline: true });
1442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ModalControllerDemo, decorators: [{
1443
+ type: Component,
1444
+ args: [{
1445
+ selector: "modal-controller-demo",
1446
+ template: ``,
1447
+ }]
1448
+ }], propDecorators: { body: [{
1449
+ type: Input
1450
+ }], footer: [{
1451
+ type: Input
1452
+ }], modalTitle: [{
1453
+ type: Input
1454
+ }], showCloseButton: [{
1455
+ type: Input
1456
+ }], dsoClose: [{
1457
+ type: Output
1458
+ }] } });
1459
+ /** This component is used to demo passing a Type<unknown> as the body for the DsoModalController for angular */
1460
+ class ModalDemoContentComponent {
1461
+ }
1462
+ ModalDemoContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ModalDemoContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1463
+ ModalDemoContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: ModalDemoContentComponent, selector: "modal-demo-content-component", ngImport: i0, template: `Dit is een voorbeeld van een Angular component wat wordt geinstantieerd als body`, isInline: true });
1464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ModalDemoContentComponent, decorators: [{
1465
+ type: Component,
1466
+ args: [{
1467
+ selector: "modal-demo-content-component",
1468
+ template: `Dit is een voorbeeld van een Angular component wat wordt geinstantieerd als body`,
1469
+ }]
1470
+ }] });
1471
+
1318
1472
  /*
1319
1473
  * Public API Surface of component-library
1320
1474
  */
@@ -1323,5 +1477,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
1323
1477
  * Generated bundle index. Do not edit.
1324
1478
  */
1325
1479
 
1326
- export { DIRECTIVES, DsoAccordion, DsoAccordionSection, DsoAlert, DsoAnnotationButton, DsoAnnotationOutput, DsoAttachmentsCounter, DsoAutosuggest, DsoBadge, DsoBanner, DsoCard, DsoCardContainer, DsoDatePicker, DsoDropdownMenu, DsoExpandable, DsoExpandableHeading, DsoHeader, DsoHelpcenterPanel, DsoHighlightBox, DsoIcon, DsoImageOverlay, DsoInfo, DsoInfoButton, DsoLabel, DsoListButton, DsoMapBaseLayers, DsoMapControls, DsoMapOverlays, DsoModal, DsoOzonContent, DsoPagination, DsoProgressBar, DsoProgressIndicator, DsoResponsiveElement, DsoSelectable, DsoSlideToggle, DsoTable, DsoToggletip, DsoToolkitModule, DsoTooltip, DsoTreeView, DsoViewerGrid };
1480
+ export { DIRECTIVES, DsoAccordion, DsoAccordionSection, DsoAlert, DsoAnnotationButton, DsoAnnotationOutput, DsoAttachmentsCounter, DsoAutosuggest, DsoBadge, DsoBanner, DsoCard, DsoCardContainer, DsoDatePicker, DsoDropdownMenu, DsoExpandable, DsoExpandableHeading, DsoHeader, DsoHelpcenterPanel, DsoHighlightBox, DsoIcon, DsoImageOverlay, DsoInfo, DsoInfoButton, DsoLabel, DsoListButton, DsoMapBaseLayers, DsoMapControls, DsoMapOverlays, DsoModal, DsoModalController, DsoModalRef, DsoOzonContent, DsoPagination, DsoProgressBar, DsoProgressIndicator, DsoResponsiveElement, DsoSelectable, DsoSlideToggle, DsoTable, DsoToggletip, DsoToolkitModule, DsoTooltip, DsoTreeView, DsoViewerGrid, ModalControllerDemo, ModalDemoContentComponent };
1327
1481
  //# sourceMappingURL=dso-toolkit-angular.mjs.map