@aeris-ui/core 22.0.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/fesm2022/aeris-ui-core-accordion.mjs +412 -0
- package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +107 -0
- package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-auto-complete.mjs +754 -0
- package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-auto-focus.mjs +63 -0
- package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-avatar.mjs +133 -0
- package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-badge.mjs +163 -0
- package/fesm2022/aeris-ui-core-badge.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-block-ui.mjs +139 -0
- package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-breadcrumb.mjs +433 -0
- package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-button-group.mjs +39 -0
- package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-button.mjs +246 -0
- package/fesm2022/aeris-ui-core-button.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-card.mjs +134 -0
- package/fesm2022/aeris-ui-core-card.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-carousel.mjs +542 -0
- package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-cascade-select.mjs +673 -0
- package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-chart.mjs +296 -0
- package/fesm2022/aeris-ui-core-chart.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-checkbox.mjs +220 -0
- package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-chip.mjs +200 -0
- package/fesm2022/aeris-ui-core-chip.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-class-names.mjs +67 -0
- package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-color-picker.mjs +1192 -0
- package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-compare.mjs +508 -0
- package/fesm2022/aeris-ui-core-compare.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs +818 -0
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-confirm-popup.mjs +1010 -0
- package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-context-menu.mjs +720 -0
- package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-date-picker.mjs +1471 -0
- package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-dialog.mjs +574 -0
- package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-divider.mjs +51 -0
- package/fesm2022/aeris-ui-core-divider.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-drawer.mjs +549 -0
- package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +333 -0
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-editor.mjs +1548 -0
- package/fesm2022/aeris-ui-core-editor.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-file-upload.mjs +965 -0
- package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-filter-service.mjs +304 -0
- package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-fluid.mjs +23 -0
- package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-focus-trap.mjs +185 -0
- package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-galleria.mjs +1657 -0
- package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-glass.mjs +35 -0
- package/fesm2022/aeris-ui-core-glass.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-icon-field.mjs +113 -0
- package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-inplace.mjs +243 -0
- package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-group.mjs +110 -0
- package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-mask.mjs +343 -0
- package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-number.mjs +497 -0
- package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-otp.mjs +361 -0
- package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-input-text.mjs +226 -0
- package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-key-filter.mjs +208 -0
- package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-mega-menu.mjs +835 -0
- package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-menu.mjs +796 -0
- package/fesm2022/aeris-ui-core-menu.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-menubar.mjs +729 -0
- package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-message.mjs +225 -0
- package/fesm2022/aeris-ui-core-message.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-meter-group.mjs +377 -0
- package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-multi-select.mjs +1033 -0
- package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-order-list.mjs +351 -0
- package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-organization-chart.mjs +382 -0
- package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-paginator.mjs +254 -0
- package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-panel.mjs +352 -0
- package/fesm2022/aeris-ui-core-panel.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-password.mjs +479 -0
- package/fesm2022/aeris-ui-core-password.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-pick-list.mjs +939 -0
- package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-popover.mjs +535 -0
- package/fesm2022/aeris-ui-core-popover.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-progress-bar.mjs +260 -0
- package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-progress-spinner.mjs +218 -0
- package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-radio-button.mjs +194 -0
- package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-rating.mjs +385 -0
- package/fesm2022/aeris-ui-core-rating.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-scroll-panel.mjs +211 -0
- package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-scroll-top.mjs +94 -0
- package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-select.mjs +1134 -0
- package/fesm2022/aeris-ui-core-select.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-skeleton.mjs +47 -0
- package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-slider.mjs +724 -0
- package/fesm2022/aeris-ui-core-slider.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-speed-dial.mjs +589 -0
- package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-split-button.mjs +532 -0
- package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-splitter.mjs +488 -0
- package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-stepper.mjs +437 -0
- package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-style-class.mjs +344 -0
- package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-table.mjs +1580 -0
- package/fesm2022/aeris-ui-core-table.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tabs.mjs +438 -0
- package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-textarea.mjs +349 -0
- package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-theme-builder.mjs +1565 -0
- package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-theming.mjs +150 -0
- package/fesm2022/aeris-ui-core-theming.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tiered-menu.mjs +718 -0
- package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-timeline.mjs +278 -0
- package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-toast.mjs +422 -0
- package/fesm2022/aeris-ui-core-toast.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-toggle-switch.mjs +202 -0
- package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-toolbar.mjs +136 -0
- package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tooltip.mjs +365 -0
- package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tree-select.mjs +995 -0
- package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tree-table.mjs +1600 -0
- package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-tree.mjs +962 -0
- package/fesm2022/aeris-ui-core-tree.mjs.map +1 -0
- package/fesm2022/aeris-ui-core.mjs +360 -0
- package/fesm2022/aeris-ui-core.mjs.map +1 -0
- package/package.json +432 -0
- package/schematics/aeris-setup.schema.json +52 -0
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/schema.json +64 -0
- package/schematics/runtime/package.json +3 -0
- package/schematics/runtime/schematics/ng-add/index.js +13 -0
- package/schematics/runtime/schematics/ng-add/index.js.map +1 -0
- package/schematics/runtime/schematics/ng-add/options.js +338 -0
- package/schematics/runtime/schematics/ng-add/options.js.map +1 -0
- package/schematics/runtime/schematics/ng-add/schema.js +3 -0
- package/schematics/runtime/schematics/ng-add/schema.js.map +1 -0
- package/schematics/runtime/schematics/ng-add/workspace.js +273 -0
- package/schematics/runtime/schematics/ng-add/workspace.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-color-derivation.js +12 -0
- package/schematics/runtime/theme-builder/aeris-color-derivation.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-color.js +263 -0
- package/schematics/runtime/theme-builder/aeris-color.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-contrast.js +245 -0
- package/schematics/runtime/theme-builder/aeris-contrast.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-foundation.js +47 -0
- package/schematics/runtime/theme-builder/aeris-foundation.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-semantic-tones.js +121 -0
- package/schematics/runtime/theme-builder/aeris-semantic-tones.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme-generator.js +238 -0
- package/schematics/runtime/theme-builder/aeris-theme-generator.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme-resolver.js +101 -0
- package/schematics/runtime/theme-builder/aeris-theme-resolver.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme-tokens.js +82 -0
- package/schematics/runtime/theme-builder/aeris-theme-tokens.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme-validation.js +183 -0
- package/schematics/runtime/theme-builder/aeris-theme-validation.js.map +1 -0
- package/schematics/runtime/theme-builder/aeris-theme.js +322 -0
- package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -0
- package/schematics/runtime/theme-builder/public-api.js +17 -0
- package/schematics/runtime/theme-builder/public-api.js.map +1 -0
- package/styles/_index.scss +1 -0
- package/styles/_tokens.scss +13 -0
- package/styles/aeris.css +555 -0
- package/styles/controls.css +169 -0
- package/tools/aeris-theme.mjs +149 -0
- package/tools/aeris-theme.schema.json +143 -0
- package/types/aeris-ui-core-accordion.d.ts +101 -0
- package/types/aeris-ui-core-animate-on-scroll.d.ts +34 -0
- package/types/aeris-ui-core-auto-complete.d.ts +154 -0
- package/types/aeris-ui-core-auto-focus.d.ts +17 -0
- package/types/aeris-ui-core-avatar.d.ts +44 -0
- package/types/aeris-ui-core-badge.d.ts +48 -0
- package/types/aeris-ui-core-block-ui.d.ts +28 -0
- package/types/aeris-ui-core-breadcrumb.d.ts +104 -0
- package/types/aeris-ui-core-button-group.d.ts +17 -0
- package/types/aeris-ui-core-button.d.ts +71 -0
- package/types/aeris-ui-core-card.d.ts +43 -0
- package/types/aeris-ui-core-carousel.d.ts +126 -0
- package/types/aeris-ui-core-cascade-select.d.ts +130 -0
- package/types/aeris-ui-core-chart.d.ts +92 -0
- package/types/aeris-ui-core-checkbox.d.ts +55 -0
- package/types/aeris-ui-core-chip.d.ts +56 -0
- package/types/aeris-ui-core-class-names.d.ts +21 -0
- package/types/aeris-ui-core-color-picker.d.ts +149 -0
- package/types/aeris-ui-core-compare.d.ts +109 -0
- package/types/aeris-ui-core-confirm-dialog.d.ts +263 -0
- package/types/aeris-ui-core-confirm-popup.d.ts +281 -0
- package/types/aeris-ui-core-context-menu.d.ts +156 -0
- package/types/aeris-ui-core-date-picker.d.ts +226 -0
- package/types/aeris-ui-core-dialog.d.ts +124 -0
- package/types/aeris-ui-core-divider.d.ts +21 -0
- package/types/aeris-ui-core-drawer.d.ts +119 -0
- package/types/aeris-ui-core-dynamic-dialog.d.ts +148 -0
- package/types/aeris-ui-core-editor.d.ts +130 -0
- package/types/aeris-ui-core-file-upload.d.ts +199 -0
- package/types/aeris-ui-core-filter-service.d.ts +54 -0
- package/types/aeris-ui-core-fluid.d.ts +10 -0
- package/types/aeris-ui-core-focus-trap.d.ts +32 -0
- package/types/aeris-ui-core-galleria.d.ts +273 -0
- package/types/aeris-ui-core-glass.d.ts +17 -0
- package/types/aeris-ui-core-icon-field.d.ts +36 -0
- package/types/aeris-ui-core-inplace.d.ts +68 -0
- package/types/aeris-ui-core-input-group.d.ts +38 -0
- package/types/aeris-ui-core-input-mask.d.ts +73 -0
- package/types/aeris-ui-core-input-number.d.ts +87 -0
- package/types/aeris-ui-core-input-otp.d.ts +88 -0
- package/types/aeris-ui-core-input-text.d.ts +63 -0
- package/types/aeris-ui-core-key-filter.d.ts +41 -0
- package/types/aeris-ui-core-mega-menu.d.ts +130 -0
- package/types/aeris-ui-core-menu.d.ts +182 -0
- package/types/aeris-ui-core-menubar.d.ts +145 -0
- package/types/aeris-ui-core-message.d.ts +65 -0
- package/types/aeris-ui-core-meter-group.d.ts +100 -0
- package/types/aeris-ui-core-multi-select.d.ts +193 -0
- package/types/aeris-ui-core-order-list.d.ts +73 -0
- package/types/aeris-ui-core-organization-chart.d.ts +85 -0
- package/types/aeris-ui-core-paginator.d.ts +39 -0
- package/types/aeris-ui-core-panel.d.ts +85 -0
- package/types/aeris-ui-core-password.d.ts +110 -0
- package/types/aeris-ui-core-pick-list.d.ts +193 -0
- package/types/aeris-ui-core-popover.d.ts +112 -0
- package/types/aeris-ui-core-progress-bar.d.ts +81 -0
- package/types/aeris-ui-core-progress-spinner.d.ts +51 -0
- package/types/aeris-ui-core-radio-button.d.ts +51 -0
- package/types/aeris-ui-core-rating.d.ts +80 -0
- package/types/aeris-ui-core-scroll-panel.d.ts +66 -0
- package/types/aeris-ui-core-scroll-top.d.ts +29 -0
- package/types/aeris-ui-core-select.d.ts +223 -0
- package/types/aeris-ui-core-skeleton.d.ts +18 -0
- package/types/aeris-ui-core-slider.d.ts +117 -0
- package/types/aeris-ui-core-speed-dial.d.ts +119 -0
- package/types/aeris-ui-core-split-button.d.ts +122 -0
- package/types/aeris-ui-core-splitter.d.ts +113 -0
- package/types/aeris-ui-core-stepper.d.ts +99 -0
- package/types/aeris-ui-core-style-class.d.ts +73 -0
- package/types/aeris-ui-core-table.d.ts +333 -0
- package/types/aeris-ui-core-tabs.d.ts +82 -0
- package/types/aeris-ui-core-textarea.d.ts +80 -0
- package/types/aeris-ui-core-theme-builder.d.ts +499 -0
- package/types/aeris-ui-core-theming.d.ts +47 -0
- package/types/aeris-ui-core-tiered-menu.d.ts +152 -0
- package/types/aeris-ui-core-timeline.d.ts +80 -0
- package/types/aeris-ui-core-toast.d.ts +127 -0
- package/types/aeris-ui-core-toggle-switch.d.ts +52 -0
- package/types/aeris-ui-core-toolbar.d.ts +47 -0
- package/types/aeris-ui-core-tooltip.d.ts +92 -0
- package/types/aeris-ui-core-tree-select.d.ts +187 -0
- package/types/aeris-ui-core-tree-table.d.ts +311 -0
- package/types/aeris-ui-core-tree.d.ts +179 -0
- package/types/aeris-ui-core.d.ts +85 -0
|
@@ -0,0 +1,818 @@
|
|
|
1
|
+
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, TemplateRef, Directive, ApplicationRef, EnvironmentInjector, signal, createComponent, Service, computed, viewChild, contentChild, model, input, booleanAttribute, output, effect, Component } from '@angular/core';
|
|
4
|
+
import { AerisDialog, AerisDialogFooterTemplate, AerisDialogHeadlessTemplate } from '@aeris-ui/core/dialog';
|
|
5
|
+
import { AerisButtonDirective } from '@aeris-ui/core/button';
|
|
6
|
+
|
|
7
|
+
class AerisConfirmDialogEventStream {
|
|
8
|
+
listeners = new Set();
|
|
9
|
+
completed = false;
|
|
10
|
+
subscribe(next) {
|
|
11
|
+
if (this.completed)
|
|
12
|
+
return { unsubscribe: () => undefined };
|
|
13
|
+
this.listeners.add(next);
|
|
14
|
+
return {
|
|
15
|
+
unsubscribe: () => {
|
|
16
|
+
this.listeners.delete(next);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
next(event) {
|
|
21
|
+
if (this.completed)
|
|
22
|
+
return;
|
|
23
|
+
for (const listener of [...this.listeners])
|
|
24
|
+
listener(event);
|
|
25
|
+
}
|
|
26
|
+
complete() {
|
|
27
|
+
this.completed = true;
|
|
28
|
+
this.listeners.clear();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
class AerisConfirmDialogIconTemplate {
|
|
32
|
+
template = inject(TemplateRef);
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogIconTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
34
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: AerisConfirmDialogIconTemplate, isStandalone: true, selector: "ng-template[aerisConfirmDialogIcon]", ngImport: i0 });
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogIconTemplate, decorators: [{
|
|
37
|
+
type: Directive,
|
|
38
|
+
args: [{ selector: 'ng-template[aerisConfirmDialogIcon]' }]
|
|
39
|
+
}] });
|
|
40
|
+
class AerisConfirmDialogMessageTemplate {
|
|
41
|
+
template = inject(TemplateRef);
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogMessageTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
43
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: AerisConfirmDialogMessageTemplate, isStandalone: true, selector: "ng-template[aerisConfirmDialogMessage]", ngImport: i0 });
|
|
44
|
+
}
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogMessageTemplate, decorators: [{
|
|
46
|
+
type: Directive,
|
|
47
|
+
args: [{ selector: 'ng-template[aerisConfirmDialogMessage]' }]
|
|
48
|
+
}] });
|
|
49
|
+
class AerisConfirmDialogFooterTemplate {
|
|
50
|
+
template = inject(TemplateRef);
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogFooterTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
52
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: AerisConfirmDialogFooterTemplate, isStandalone: true, selector: "ng-template[aerisConfirmDialogFooter]", ngImport: i0 });
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogFooterTemplate, decorators: [{
|
|
55
|
+
type: Directive,
|
|
56
|
+
args: [{ selector: 'ng-template[aerisConfirmDialogFooter]' }]
|
|
57
|
+
}] });
|
|
58
|
+
class AerisConfirmDialogHeadlessTemplate {
|
|
59
|
+
template = inject(TemplateRef);
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogHeadlessTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
61
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: AerisConfirmDialogHeadlessTemplate, isStandalone: true, selector: "ng-template[aerisConfirmDialogHeadless]", ngImport: i0 });
|
|
62
|
+
}
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogHeadlessTemplate, decorators: [{
|
|
64
|
+
type: Directive,
|
|
65
|
+
args: [{ selector: 'ng-template[aerisConfirmDialogHeadless]' }]
|
|
66
|
+
}] });
|
|
67
|
+
class AerisConfirmDialogRef {
|
|
68
|
+
acceptedStream = new AerisConfirmDialogEventStream();
|
|
69
|
+
rejectedStream = new AerisConfirmDialogEventStream();
|
|
70
|
+
closedStream = new AerisConfirmDialogEventStream();
|
|
71
|
+
shownStream = new AerisConfirmDialogEventStream();
|
|
72
|
+
controller = null;
|
|
73
|
+
closedOnce = false;
|
|
74
|
+
accepted = this.acceptedStream;
|
|
75
|
+
rejected = this.rejectedStream;
|
|
76
|
+
closed = this.closedStream;
|
|
77
|
+
shown = this.shownStream;
|
|
78
|
+
accept(originalEvent = null) {
|
|
79
|
+
if (this.closedOnce)
|
|
80
|
+
return;
|
|
81
|
+
this.controller?.accept(originalEvent);
|
|
82
|
+
}
|
|
83
|
+
reject(originalEvent = null) {
|
|
84
|
+
if (this.closedOnce)
|
|
85
|
+
return;
|
|
86
|
+
this.controller?.reject(originalEvent);
|
|
87
|
+
}
|
|
88
|
+
close(originalEvent = null) {
|
|
89
|
+
if (this.closedOnce)
|
|
90
|
+
return;
|
|
91
|
+
this.controller?.close(originalEvent);
|
|
92
|
+
}
|
|
93
|
+
focus(options) {
|
|
94
|
+
this.controller?.focus(options);
|
|
95
|
+
}
|
|
96
|
+
attach(controller) {
|
|
97
|
+
this.controller = controller;
|
|
98
|
+
}
|
|
99
|
+
notifyShown(event) {
|
|
100
|
+
if (this.closedOnce)
|
|
101
|
+
return;
|
|
102
|
+
this.shownStream.next(event);
|
|
103
|
+
}
|
|
104
|
+
notifyAccepted(event) {
|
|
105
|
+
if (this.closedOnce)
|
|
106
|
+
return;
|
|
107
|
+
this.acceptedStream.next(event);
|
|
108
|
+
}
|
|
109
|
+
notifyRejected(event) {
|
|
110
|
+
if (this.closedOnce)
|
|
111
|
+
return;
|
|
112
|
+
this.rejectedStream.next(event);
|
|
113
|
+
}
|
|
114
|
+
notifyClosed(event) {
|
|
115
|
+
if (this.closedOnce)
|
|
116
|
+
return;
|
|
117
|
+
this.closedOnce = true;
|
|
118
|
+
this.closedStream.next(event);
|
|
119
|
+
this.acceptedStream.complete();
|
|
120
|
+
this.rejectedStream.complete();
|
|
121
|
+
this.closedStream.complete();
|
|
122
|
+
this.shownStream.complete();
|
|
123
|
+
this.controller = null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
class AerisConfirmDialogService {
|
|
127
|
+
appRef = inject(ApplicationRef);
|
|
128
|
+
document = inject(DOCUMENT);
|
|
129
|
+
environmentInjector = inject(EnvironmentInjector);
|
|
130
|
+
requestState = signal(null, /* @ts-ignore */
|
|
131
|
+
...(ngDevMode ? [{ debugName: "requestState" }] : /* istanbul ignore next */ []));
|
|
132
|
+
closeState = signal(0, /* @ts-ignore */
|
|
133
|
+
...(ngDevMode ? [{ debugName: "closeState" }] : /* istanbul ignore next */ []));
|
|
134
|
+
activeRefs = new Set();
|
|
135
|
+
dynamicHosts = new Map();
|
|
136
|
+
nextId = 0;
|
|
137
|
+
request = this.requestState.asReadonly();
|
|
138
|
+
closeSignal = this.closeState.asReadonly();
|
|
139
|
+
confirm(config) {
|
|
140
|
+
const ref = new AerisConfirmDialogRef();
|
|
141
|
+
const resolvedConfig = this.resolveConfig(config);
|
|
142
|
+
if (!resolvedConfig.key) {
|
|
143
|
+
this.openDynamicHost(resolvedConfig, ref);
|
|
144
|
+
return ref;
|
|
145
|
+
}
|
|
146
|
+
const request = {
|
|
147
|
+
id: ++this.nextId,
|
|
148
|
+
config: resolvedConfig,
|
|
149
|
+
ref,
|
|
150
|
+
};
|
|
151
|
+
this.activeRefs.add(ref);
|
|
152
|
+
ref.closed.subscribe(() => this.activeRefs.delete(ref));
|
|
153
|
+
this.requestState.set(request);
|
|
154
|
+
return ref;
|
|
155
|
+
}
|
|
156
|
+
closeAll() {
|
|
157
|
+
for (const ref of [...this.activeRefs])
|
|
158
|
+
ref.close();
|
|
159
|
+
this.closeState.update((value) => value + 1);
|
|
160
|
+
}
|
|
161
|
+
openDynamicHost(config, ref) {
|
|
162
|
+
const hostRef = createComponent(AerisConfirmDialog, {
|
|
163
|
+
environmentInjector: this.environmentInjector,
|
|
164
|
+
});
|
|
165
|
+
const cleanup = () => {
|
|
166
|
+
if (!this.activeRefs.delete(ref))
|
|
167
|
+
return;
|
|
168
|
+
this.dynamicHosts.delete(ref);
|
|
169
|
+
this.appRef.detachView(hostRef.hostView);
|
|
170
|
+
hostRef.destroy();
|
|
171
|
+
};
|
|
172
|
+
this.activeRefs.add(ref);
|
|
173
|
+
this.dynamicHosts.set(ref, hostRef);
|
|
174
|
+
ref.closed.subscribe(() => queueMicrotask(cleanup));
|
|
175
|
+
this.appRef.attachView(hostRef.hostView);
|
|
176
|
+
this.document.body.appendChild(this.rootNode(hostRef));
|
|
177
|
+
hostRef.changeDetectorRef.detectChanges();
|
|
178
|
+
hostRef.instance.openWithConfig(config, ref);
|
|
179
|
+
ref.attach({
|
|
180
|
+
accept: (originalEvent) => {
|
|
181
|
+
hostRef.instance.accept(originalEvent);
|
|
182
|
+
hostRef.changeDetectorRef.detectChanges();
|
|
183
|
+
},
|
|
184
|
+
reject: (originalEvent) => {
|
|
185
|
+
hostRef.instance.reject(originalEvent);
|
|
186
|
+
hostRef.changeDetectorRef.detectChanges();
|
|
187
|
+
},
|
|
188
|
+
close: (originalEvent) => {
|
|
189
|
+
hostRef.instance.close(originalEvent);
|
|
190
|
+
hostRef.changeDetectorRef.detectChanges();
|
|
191
|
+
},
|
|
192
|
+
focus: (options) => hostRef.instance.focus(options),
|
|
193
|
+
});
|
|
194
|
+
hostRef.changeDetectorRef.detectChanges();
|
|
195
|
+
}
|
|
196
|
+
rootNode(hostRef) {
|
|
197
|
+
const [node] = hostRef.hostView.rootNodes;
|
|
198
|
+
return node instanceof Node ? node : this.document.createTextNode('');
|
|
199
|
+
}
|
|
200
|
+
resolveConfig(config) {
|
|
201
|
+
return {
|
|
202
|
+
key: config.key ?? '',
|
|
203
|
+
header: config.header ?? 'Confirm action',
|
|
204
|
+
message: config.message ?? '',
|
|
205
|
+
data: config.data,
|
|
206
|
+
icon: config.icon ?? 'question',
|
|
207
|
+
severity: config.severity ?? 'primary',
|
|
208
|
+
acceptLabel: config.acceptLabel ?? 'Confirm',
|
|
209
|
+
rejectLabel: config.rejectLabel ?? 'Cancel',
|
|
210
|
+
acceptVisible: config.acceptVisible ?? true,
|
|
211
|
+
rejectVisible: config.rejectVisible ?? true,
|
|
212
|
+
acceptDisabled: config.acceptDisabled ?? false,
|
|
213
|
+
rejectDisabled: config.rejectDisabled ?? false,
|
|
214
|
+
acceptAriaLabel: config.acceptAriaLabel ?? config.acceptLabel ?? 'Confirm',
|
|
215
|
+
rejectAriaLabel: config.rejectAriaLabel ?? config.rejectLabel ?? 'Cancel',
|
|
216
|
+
defaultFocus: config.defaultFocus ?? 'accept',
|
|
217
|
+
modal: config.modal ?? true,
|
|
218
|
+
backdrop: config.backdrop ?? true,
|
|
219
|
+
backdropBlur: config.backdropBlur ?? true,
|
|
220
|
+
backdropBlurAmount: config.backdropBlurAmount ?? '',
|
|
221
|
+
dismissibleMask: config.dismissibleMask ?? false,
|
|
222
|
+
closeOnEscape: config.closeOnEscape ?? true,
|
|
223
|
+
closable: config.closable ?? true,
|
|
224
|
+
blockScroll: config.blockScroll ?? true,
|
|
225
|
+
focusTrap: config.focusTrap ?? true,
|
|
226
|
+
restoreFocus: config.restoreFocus ?? true,
|
|
227
|
+
autoFocus: config.autoFocus ?? true,
|
|
228
|
+
initialFocus: config.initialFocus ?? '',
|
|
229
|
+
position: config.position ?? 'center',
|
|
230
|
+
size: config.size ?? 'sm',
|
|
231
|
+
width: config.width ?? '',
|
|
232
|
+
maxWidth: config.maxWidth ?? '',
|
|
233
|
+
mobileWidth: config.mobileWidth ?? '',
|
|
234
|
+
closeAriaLabel: config.closeAriaLabel ?? 'Close confirmation dialog',
|
|
235
|
+
ariaLabel: config.ariaLabel ?? '',
|
|
236
|
+
ariaLabelledBy: config.ariaLabelledBy ?? '',
|
|
237
|
+
ariaDescribedBy: config.ariaDescribedBy ?? '',
|
|
238
|
+
accept: config.accept,
|
|
239
|
+
reject: config.reject,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogService, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
243
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogService });
|
|
244
|
+
}
|
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialogService, decorators: [{
|
|
246
|
+
type: Service
|
|
247
|
+
}] });
|
|
248
|
+
class AerisConfirmDialog {
|
|
249
|
+
service = inject(AerisConfirmDialogService);
|
|
250
|
+
activeRequest = signal(null, /* @ts-ignore */
|
|
251
|
+
...(ngDevMode ? [{ debugName: "activeRequest" }] : /* istanbul ignore next */ []));
|
|
252
|
+
localConfig = computed(() => ({
|
|
253
|
+
key: this.key(),
|
|
254
|
+
header: this.header(),
|
|
255
|
+
message: this.message(),
|
|
256
|
+
data: this.data(),
|
|
257
|
+
icon: this.icon(),
|
|
258
|
+
severity: this.severity(),
|
|
259
|
+
acceptLabel: this.acceptLabel(),
|
|
260
|
+
rejectLabel: this.rejectLabel(),
|
|
261
|
+
acceptVisible: this.acceptVisible(),
|
|
262
|
+
rejectVisible: this.rejectVisible(),
|
|
263
|
+
acceptDisabled: this.acceptDisabled(),
|
|
264
|
+
rejectDisabled: this.rejectDisabled(),
|
|
265
|
+
acceptAriaLabel: this.acceptAriaLabel() || this.acceptLabel(),
|
|
266
|
+
rejectAriaLabel: this.rejectAriaLabel() || this.rejectLabel(),
|
|
267
|
+
defaultFocus: this.defaultFocus(),
|
|
268
|
+
modal: this.modal(),
|
|
269
|
+
backdrop: this.backdrop(),
|
|
270
|
+
backdropBlur: this.backdropBlur(),
|
|
271
|
+
backdropBlurAmount: this.backdropBlurAmount(),
|
|
272
|
+
dismissibleMask: this.dismissibleMask(),
|
|
273
|
+
closeOnEscape: this.closeOnEscape(),
|
|
274
|
+
closable: this.closable(),
|
|
275
|
+
blockScroll: this.blockScroll(),
|
|
276
|
+
focusTrap: this.focusTrap(),
|
|
277
|
+
restoreFocus: this.restoreFocus(),
|
|
278
|
+
autoFocus: this.autoFocus(),
|
|
279
|
+
initialFocus: this.initialFocus(),
|
|
280
|
+
position: this.position(),
|
|
281
|
+
size: this.size(),
|
|
282
|
+
width: this.width(),
|
|
283
|
+
maxWidth: this.maxWidth(),
|
|
284
|
+
mobileWidth: this.mobileWidth(),
|
|
285
|
+
closeAriaLabel: this.closeAriaLabel(),
|
|
286
|
+
ariaLabel: this.ariaLabel(),
|
|
287
|
+
ariaLabelledBy: this.ariaLabelledBy(),
|
|
288
|
+
ariaDescribedBy: this.ariaDescribedBy(),
|
|
289
|
+
}), /* @ts-ignore */
|
|
290
|
+
...(ngDevMode ? [{ debugName: "localConfig" }] : /* istanbul ignore next */ []));
|
|
291
|
+
lastRequestId = 0;
|
|
292
|
+
lastCloseSignal = 0;
|
|
293
|
+
pendingResult = null;
|
|
294
|
+
pendingReason = 'api';
|
|
295
|
+
pendingOriginalEvent = null;
|
|
296
|
+
dialog = viewChild('dialog', /* @ts-ignore */
|
|
297
|
+
...(ngDevMode ? [{ debugName: "dialog" }] : /* istanbul ignore next */ []));
|
|
298
|
+
iconTemplate = contentChild(AerisConfirmDialogIconTemplate, /* @ts-ignore */
|
|
299
|
+
...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
|
|
300
|
+
messageTemplate = contentChild(AerisConfirmDialogMessageTemplate, /* @ts-ignore */
|
|
301
|
+
...(ngDevMode ? [{ debugName: "messageTemplate" }] : /* istanbul ignore next */ []));
|
|
302
|
+
footerTemplate = contentChild(AerisConfirmDialogFooterTemplate, /* @ts-ignore */
|
|
303
|
+
...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
|
|
304
|
+
headlessTemplate = contentChild(AerisConfirmDialogHeadlessTemplate, /* @ts-ignore */
|
|
305
|
+
...(ngDevMode ? [{ debugName: "headlessTemplate" }] : /* istanbul ignore next */ []));
|
|
306
|
+
settings = computed(() => this.activeRequest()?.config ?? this.localConfig(), /* @ts-ignore */
|
|
307
|
+
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
308
|
+
acceptButtonSeverity = computed(() => {
|
|
309
|
+
const severity = this.settings().severity;
|
|
310
|
+
return severity === 'neutral' ? 'secondary' : severity;
|
|
311
|
+
}, /* @ts-ignore */
|
|
312
|
+
...(ngDevMode ? [{ debugName: "acceptButtonSeverity" }] : /* istanbul ignore next */ []));
|
|
313
|
+
templateContext = computed(() => ({
|
|
314
|
+
$implicit: this,
|
|
315
|
+
config: this.settings(),
|
|
316
|
+
data: this.settings().data,
|
|
317
|
+
accept: (event) => this.accept(event ?? null),
|
|
318
|
+
reject: (event) => this.reject(event ?? null),
|
|
319
|
+
close: (event) => this.close(event ?? null),
|
|
320
|
+
}), /* @ts-ignore */
|
|
321
|
+
...(ngDevMode ? [{ debugName: "templateContext" }] : /* istanbul ignore next */ []));
|
|
322
|
+
computedAriaDescribedBy = computed(() => {
|
|
323
|
+
const describedBy = this.settings().ariaDescribedBy;
|
|
324
|
+
if (describedBy)
|
|
325
|
+
return describedBy;
|
|
326
|
+
return this.settings().message || this.messageTemplate() ? this.messageId : '';
|
|
327
|
+
}, /* @ts-ignore */
|
|
328
|
+
...(ngDevMode ? [{ debugName: "computedAriaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
329
|
+
initialFocusTarget = computed(() => {
|
|
330
|
+
const settings = this.settings();
|
|
331
|
+
if (settings.initialFocus)
|
|
332
|
+
return settings.initialFocus;
|
|
333
|
+
switch (settings.defaultFocus) {
|
|
334
|
+
case 'accept':
|
|
335
|
+
return '.aeris-confirm-dialog__accept';
|
|
336
|
+
case 'reject':
|
|
337
|
+
return '.aeris-confirm-dialog__reject';
|
|
338
|
+
case 'close':
|
|
339
|
+
return '.aeris-dialog__action';
|
|
340
|
+
case 'dialog':
|
|
341
|
+
return '.aeris-dialog__panel';
|
|
342
|
+
case 'none':
|
|
343
|
+
return '';
|
|
344
|
+
default:
|
|
345
|
+
return '';
|
|
346
|
+
}
|
|
347
|
+
}, /* @ts-ignore */
|
|
348
|
+
...(ngDevMode ? [{ debugName: "initialFocusTarget" }] : /* istanbul ignore next */ []));
|
|
349
|
+
autoFocusTarget = computed(() => this.settings().autoFocus && this.settings().defaultFocus !== 'none', /* @ts-ignore */
|
|
350
|
+
...(ngDevMode ? [{ debugName: "autoFocusTarget" }] : /* istanbul ignore next */ []));
|
|
351
|
+
visible = model(false, /* @ts-ignore */
|
|
352
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
353
|
+
key = input('', /* @ts-ignore */
|
|
354
|
+
...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
355
|
+
header = input('Confirm action', /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
357
|
+
message = input('', /* @ts-ignore */
|
|
358
|
+
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
359
|
+
data = input(/* @ts-ignore */
|
|
360
|
+
...(ngDevMode ? [undefined, { debugName: "data" }] : /* istanbul ignore next */ []));
|
|
361
|
+
icon = input('question', /* @ts-ignore */
|
|
362
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
363
|
+
severity = input('primary', /* @ts-ignore */
|
|
364
|
+
...(ngDevMode ? [{ debugName: "severity" }] : /* istanbul ignore next */ []));
|
|
365
|
+
acceptLabel = input('Confirm', /* @ts-ignore */
|
|
366
|
+
...(ngDevMode ? [{ debugName: "acceptLabel" }] : /* istanbul ignore next */ []));
|
|
367
|
+
rejectLabel = input('Cancel', /* @ts-ignore */
|
|
368
|
+
...(ngDevMode ? [{ debugName: "rejectLabel" }] : /* istanbul ignore next */ []));
|
|
369
|
+
acceptVisible = input(true, { ...(ngDevMode ? { debugName: "acceptVisible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
370
|
+
rejectVisible = input(true, { ...(ngDevMode ? { debugName: "rejectVisible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
371
|
+
acceptDisabled = input(false, { ...(ngDevMode ? { debugName: "acceptDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
372
|
+
rejectDisabled = input(false, { ...(ngDevMode ? { debugName: "rejectDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
373
|
+
acceptAriaLabel = input('', /* @ts-ignore */
|
|
374
|
+
...(ngDevMode ? [{ debugName: "acceptAriaLabel" }] : /* istanbul ignore next */ []));
|
|
375
|
+
rejectAriaLabel = input('', /* @ts-ignore */
|
|
376
|
+
...(ngDevMode ? [{ debugName: "rejectAriaLabel" }] : /* istanbul ignore next */ []));
|
|
377
|
+
defaultFocus = input('accept', /* @ts-ignore */
|
|
378
|
+
...(ngDevMode ? [{ debugName: "defaultFocus" }] : /* istanbul ignore next */ []));
|
|
379
|
+
modal = input(true, { ...(ngDevMode ? { debugName: "modal" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
380
|
+
backdrop = input(true, { ...(ngDevMode ? { debugName: "backdrop" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
381
|
+
backdropBlur = input(true, { ...(ngDevMode ? { debugName: "backdropBlur" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
382
|
+
backdropBlurAmount = input('', /* @ts-ignore */
|
|
383
|
+
...(ngDevMode ? [{ debugName: "backdropBlurAmount" }] : /* istanbul ignore next */ []));
|
|
384
|
+
dismissibleMask = input(false, { ...(ngDevMode ? { debugName: "dismissibleMask" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
385
|
+
closeOnEscape = input(true, { ...(ngDevMode ? { debugName: "closeOnEscape" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
386
|
+
closable = input(true, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
387
|
+
blockScroll = input(true, { ...(ngDevMode ? { debugName: "blockScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
388
|
+
focusTrap = input(true, { ...(ngDevMode ? { debugName: "focusTrap" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
389
|
+
restoreFocus = input(true, { ...(ngDevMode ? { debugName: "restoreFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
390
|
+
autoFocus = input(true, { ...(ngDevMode ? { debugName: "autoFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
391
|
+
initialFocus = input('', /* @ts-ignore */
|
|
392
|
+
...(ngDevMode ? [{ debugName: "initialFocus" }] : /* istanbul ignore next */ []));
|
|
393
|
+
position = input('center', /* @ts-ignore */
|
|
394
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
395
|
+
size = input('sm', /* @ts-ignore */
|
|
396
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
397
|
+
width = input('', /* @ts-ignore */
|
|
398
|
+
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
399
|
+
maxWidth = input('', /* @ts-ignore */
|
|
400
|
+
...(ngDevMode ? [{ debugName: "maxWidth" }] : /* istanbul ignore next */ []));
|
|
401
|
+
mobileWidth = input('', /* @ts-ignore */
|
|
402
|
+
...(ngDevMode ? [{ debugName: "mobileWidth" }] : /* istanbul ignore next */ []));
|
|
403
|
+
closeAriaLabel = input('Close confirmation dialog', /* @ts-ignore */
|
|
404
|
+
...(ngDevMode ? [{ debugName: "closeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
405
|
+
ariaLabel = input('', /* @ts-ignore */
|
|
406
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
407
|
+
ariaLabelledBy = input('', /* @ts-ignore */
|
|
408
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
|
|
409
|
+
ariaDescribedBy = input('', /* @ts-ignore */
|
|
410
|
+
...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
411
|
+
shown = output();
|
|
412
|
+
accepted = output();
|
|
413
|
+
rejected = output();
|
|
414
|
+
closed = output();
|
|
415
|
+
messageId = `aeris-confirm-dialog-${Math.random().toString(36).slice(2)}-message`;
|
|
416
|
+
constructor() {
|
|
417
|
+
effect(() => {
|
|
418
|
+
const request = this.service.request();
|
|
419
|
+
if (!request || request.id === this.lastRequestId)
|
|
420
|
+
return;
|
|
421
|
+
if (request.config.key !== this.key())
|
|
422
|
+
return;
|
|
423
|
+
this.lastRequestId = request.id;
|
|
424
|
+
this.openRequest(request);
|
|
425
|
+
});
|
|
426
|
+
effect(() => {
|
|
427
|
+
const closeSignal = this.service.closeSignal();
|
|
428
|
+
if (closeSignal === this.lastCloseSignal)
|
|
429
|
+
return;
|
|
430
|
+
this.lastCloseSignal = closeSignal;
|
|
431
|
+
this.close();
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
openWithConfig(config, ref) {
|
|
435
|
+
this.openRequest({
|
|
436
|
+
id: ++this.lastRequestId,
|
|
437
|
+
config,
|
|
438
|
+
ref,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
accept(originalEvent = null) {
|
|
442
|
+
const settings = this.settings();
|
|
443
|
+
if (!this.visible() || settings.acceptDisabled || !settings.acceptVisible)
|
|
444
|
+
return;
|
|
445
|
+
const event = this.actionEvent(originalEvent);
|
|
446
|
+
settings.accept?.(event);
|
|
447
|
+
this.accepted.emit(event);
|
|
448
|
+
this.activeRequest()?.ref.notifyAccepted(event);
|
|
449
|
+
this.closeWithResult('accept', 'accept', originalEvent);
|
|
450
|
+
}
|
|
451
|
+
reject(originalEvent = null) {
|
|
452
|
+
const settings = this.settings();
|
|
453
|
+
if (!this.visible() || settings.rejectDisabled || !settings.rejectVisible)
|
|
454
|
+
return;
|
|
455
|
+
const event = this.actionEvent(originalEvent);
|
|
456
|
+
settings.reject?.(event);
|
|
457
|
+
this.rejected.emit(event);
|
|
458
|
+
this.activeRequest()?.ref.notifyRejected(event);
|
|
459
|
+
this.closeWithResult('reject', 'reject', originalEvent);
|
|
460
|
+
}
|
|
461
|
+
close(originalEvent = null) {
|
|
462
|
+
if (!this.visible())
|
|
463
|
+
return;
|
|
464
|
+
this.closeWithResult('dismiss', 'api', originalEvent);
|
|
465
|
+
}
|
|
466
|
+
focus(options) {
|
|
467
|
+
this.dialog()?.focus(options);
|
|
468
|
+
}
|
|
469
|
+
handleShown(event) {
|
|
470
|
+
const shownEvent = this.actionEvent(event.originalEvent);
|
|
471
|
+
this.shown.emit(shownEvent);
|
|
472
|
+
this.activeRequest()?.ref.notifyShown(shownEvent);
|
|
473
|
+
}
|
|
474
|
+
handleHidden(event) {
|
|
475
|
+
const result = this.pendingResult ?? 'dismiss';
|
|
476
|
+
const reason = this.pendingReason === 'api' ? event.reason : this.pendingReason;
|
|
477
|
+
const originalEvent = this.pendingOriginalEvent ?? event.originalEvent;
|
|
478
|
+
const closeEvent = {
|
|
479
|
+
...this.actionEvent(originalEvent),
|
|
480
|
+
result,
|
|
481
|
+
reason,
|
|
482
|
+
};
|
|
483
|
+
const ref = this.activeRequest()?.ref;
|
|
484
|
+
this.visible.set(false);
|
|
485
|
+
this.pendingResult = null;
|
|
486
|
+
this.pendingReason = 'api';
|
|
487
|
+
this.pendingOriginalEvent = null;
|
|
488
|
+
this.activeRequest.set(null);
|
|
489
|
+
this.closed.emit(closeEvent);
|
|
490
|
+
ref?.notifyClosed(closeEvent);
|
|
491
|
+
}
|
|
492
|
+
openRequest(request) {
|
|
493
|
+
this.pendingResult = null;
|
|
494
|
+
this.pendingReason = 'api';
|
|
495
|
+
this.pendingOriginalEvent = null;
|
|
496
|
+
this.activeRequest.set(request);
|
|
497
|
+
request.ref.attach({
|
|
498
|
+
accept: (originalEvent) => this.accept(originalEvent),
|
|
499
|
+
reject: (originalEvent) => this.reject(originalEvent),
|
|
500
|
+
close: (originalEvent) => this.close(originalEvent),
|
|
501
|
+
focus: (options) => this.focus(options),
|
|
502
|
+
});
|
|
503
|
+
this.visible.set(true);
|
|
504
|
+
}
|
|
505
|
+
closeWithResult(result, reason, originalEvent) {
|
|
506
|
+
this.pendingResult = result;
|
|
507
|
+
this.pendingReason = reason;
|
|
508
|
+
this.pendingOriginalEvent = originalEvent;
|
|
509
|
+
this.dialog()?.hide(originalEvent, reason === 'accept' || reason === 'reject' ? 'api' : reason);
|
|
510
|
+
}
|
|
511
|
+
actionEvent(originalEvent) {
|
|
512
|
+
const settings = this.settings();
|
|
513
|
+
return {
|
|
514
|
+
originalEvent,
|
|
515
|
+
data: settings.data,
|
|
516
|
+
config: settings,
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
520
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: AerisConfirmDialog, isStandalone: true, selector: "aeris-confirm-dialog", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, acceptLabel: { classPropertyName: "acceptLabel", publicName: "acceptLabel", isSignal: true, isRequired: false, transformFunction: null }, rejectLabel: { classPropertyName: "rejectLabel", publicName: "rejectLabel", isSignal: true, isRequired: false, transformFunction: null }, acceptVisible: { classPropertyName: "acceptVisible", publicName: "acceptVisible", isSignal: true, isRequired: false, transformFunction: null }, rejectVisible: { classPropertyName: "rejectVisible", publicName: "rejectVisible", isSignal: true, isRequired: false, transformFunction: null }, acceptDisabled: { classPropertyName: "acceptDisabled", publicName: "acceptDisabled", isSignal: true, isRequired: false, transformFunction: null }, rejectDisabled: { classPropertyName: "rejectDisabled", publicName: "rejectDisabled", isSignal: true, isRequired: false, transformFunction: null }, acceptAriaLabel: { classPropertyName: "acceptAriaLabel", publicName: "acceptAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, rejectAriaLabel: { classPropertyName: "rejectAriaLabel", publicName: "rejectAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, defaultFocus: { classPropertyName: "defaultFocus", publicName: "defaultFocus", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, backdrop: { classPropertyName: "backdrop", publicName: "backdrop", isSignal: true, isRequired: false, transformFunction: null }, backdropBlur: { classPropertyName: "backdropBlur", publicName: "backdropBlur", isSignal: true, isRequired: false, transformFunction: null }, backdropBlurAmount: { classPropertyName: "backdropBlurAmount", publicName: "backdropBlurAmount", isSignal: true, isRequired: false, transformFunction: null }, dismissibleMask: { classPropertyName: "dismissibleMask", publicName: "dismissibleMask", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, blockScroll: { classPropertyName: "blockScroll", publicName: "blockScroll", isSignal: true, isRequired: false, transformFunction: null }, focusTrap: { classPropertyName: "focusTrap", publicName: "focusTrap", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, initialFocus: { classPropertyName: "initialFocus", publicName: "initialFocus", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, mobileWidth: { classPropertyName: "mobileWidth", publicName: "mobileWidth", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", shown: "shown", accepted: "accepted", rejected: "rejected", closed: "closed" }, host: { properties: { "attr.data-open": "visible() || null" }, classAttribute: "aeris-confirm-dialog" }, queries: [{ propertyName: "iconTemplate", first: true, predicate: AerisConfirmDialogIconTemplate, descendants: true, isSignal: true }, { propertyName: "messageTemplate", first: true, predicate: AerisConfirmDialogMessageTemplate, descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: AerisConfirmDialogFooterTemplate, descendants: true, isSignal: true }, { propertyName: "headlessTemplate", first: true, predicate: AerisConfirmDialogHeadlessTemplate, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
521
|
+
<aeris-dialog
|
|
522
|
+
#dialog
|
|
523
|
+
[role]="'alertdialog'"
|
|
524
|
+
[header]="settings().header"
|
|
525
|
+
[modal]="settings().modal"
|
|
526
|
+
[backdrop]="settings().backdrop"
|
|
527
|
+
[backdropBlur]="settings().backdropBlur"
|
|
528
|
+
[backdropBlurAmount]="settings().backdropBlurAmount"
|
|
529
|
+
[dismissibleMask]="settings().dismissibleMask"
|
|
530
|
+
[closeOnEscape]="settings().closeOnEscape"
|
|
531
|
+
[closable]="settings().closable"
|
|
532
|
+
[blockScroll]="settings().blockScroll"
|
|
533
|
+
[focusTrap]="settings().focusTrap"
|
|
534
|
+
[restoreFocus]="settings().restoreFocus"
|
|
535
|
+
[autoFocus]="autoFocusTarget()"
|
|
536
|
+
[initialFocus]="initialFocusTarget()"
|
|
537
|
+
[position]="settings().position"
|
|
538
|
+
[size]="settings().size"
|
|
539
|
+
[width]="settings().width"
|
|
540
|
+
[maxWidth]="settings().maxWidth"
|
|
541
|
+
[mobileWidth]="settings().mobileWidth"
|
|
542
|
+
[closeAriaLabel]="settings().closeAriaLabel"
|
|
543
|
+
[ariaLabel]="settings().ariaLabel"
|
|
544
|
+
[ariaLabelledBy]="settings().ariaLabelledBy"
|
|
545
|
+
[ariaDescribedBy]="computedAriaDescribedBy()"
|
|
546
|
+
[visible]="visible()"
|
|
547
|
+
(shown)="handleShown($event)"
|
|
548
|
+
(hidden)="handleHidden($event)"
|
|
549
|
+
>
|
|
550
|
+
@if (headlessTemplate(); as headlessTemplateRef) {
|
|
551
|
+
<ng-template aerisDialogHeadless>
|
|
552
|
+
<ng-container
|
|
553
|
+
[ngTemplateOutlet]="headlessTemplateRef.template"
|
|
554
|
+
[ngTemplateOutletContext]="templateContext()"
|
|
555
|
+
/>
|
|
556
|
+
</ng-template>
|
|
557
|
+
} @else {
|
|
558
|
+
<div class="aeris-confirm-dialog__content" [attr.data-severity]="settings().severity">
|
|
559
|
+
@if (iconTemplate(); as iconTemplateRef) {
|
|
560
|
+
<div class="aeris-confirm-dialog__icon" aria-hidden="true">
|
|
561
|
+
<ng-container
|
|
562
|
+
[ngTemplateOutlet]="iconTemplateRef.template"
|
|
563
|
+
[ngTemplateOutletContext]="templateContext()"
|
|
564
|
+
/>
|
|
565
|
+
</div>
|
|
566
|
+
} @else if (settings().icon !== 'none') {
|
|
567
|
+
<span
|
|
568
|
+
class="aeris-confirm-dialog__icon"
|
|
569
|
+
[attr.data-icon]="settings().icon"
|
|
570
|
+
aria-hidden="true"
|
|
571
|
+
>
|
|
572
|
+
<svg viewBox="0 0 24 24" focusable="false">
|
|
573
|
+
@switch (settings().icon) {
|
|
574
|
+
@case ('info') {
|
|
575
|
+
<path d="M12 17v-6" />
|
|
576
|
+
<path d="M12 7.5h.01" />
|
|
577
|
+
<path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z" />
|
|
578
|
+
}
|
|
579
|
+
@case ('warning') {
|
|
580
|
+
<path d="M12 4.5 21 19H3L12 4.5Z" />
|
|
581
|
+
<path d="M12 10v4" />
|
|
582
|
+
<path d="M12 17h.01" />
|
|
583
|
+
}
|
|
584
|
+
@case ('danger') {
|
|
585
|
+
<path d="M12 4.5 21 19H3L12 4.5Z" />
|
|
586
|
+
<path d="M12 10v4" />
|
|
587
|
+
<path d="M12 17h.01" />
|
|
588
|
+
}
|
|
589
|
+
@case ('success') {
|
|
590
|
+
<path d="M20 7 10 17l-5-5" />
|
|
591
|
+
}
|
|
592
|
+
@default {
|
|
593
|
+
<path d="M9.75 9a2.25 2.25 0 1 1 3.15 2.07c-.61.28-.9.82-.9 1.43v.5" />
|
|
594
|
+
<path d="M12 17h.01" />
|
|
595
|
+
<path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z" />
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
</svg>
|
|
599
|
+
</span>
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
<div class="aeris-confirm-dialog__message" [id]="messageId">
|
|
603
|
+
@if (messageTemplate(); as messageTemplateRef) {
|
|
604
|
+
<ng-container
|
|
605
|
+
[ngTemplateOutlet]="messageTemplateRef.template"
|
|
606
|
+
[ngTemplateOutletContext]="templateContext()"
|
|
607
|
+
/>
|
|
608
|
+
} @else {
|
|
609
|
+
{{ settings().message }}
|
|
610
|
+
}
|
|
611
|
+
</div>
|
|
612
|
+
</div>
|
|
613
|
+
|
|
614
|
+
<ng-template aerisDialogFooter>
|
|
615
|
+
@if (footerTemplate(); as footerTemplateRef) {
|
|
616
|
+
<ng-container
|
|
617
|
+
[ngTemplateOutlet]="footerTemplateRef.template"
|
|
618
|
+
[ngTemplateOutletContext]="templateContext()"
|
|
619
|
+
/>
|
|
620
|
+
} @else {
|
|
621
|
+
<div class="aeris-confirm-dialog__actions">
|
|
622
|
+
@if (settings().rejectVisible) {
|
|
623
|
+
<button
|
|
624
|
+
aerisButton
|
|
625
|
+
type="button"
|
|
626
|
+
variant="secondary"
|
|
627
|
+
class="aeris-confirm-dialog__button aeris-confirm-dialog__reject"
|
|
628
|
+
[disabled]="settings().rejectDisabled"
|
|
629
|
+
[attr.aria-label]="settings().rejectAriaLabel"
|
|
630
|
+
(click)="reject($event)"
|
|
631
|
+
>
|
|
632
|
+
{{ settings().rejectLabel }}
|
|
633
|
+
</button>
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
@if (settings().acceptVisible) {
|
|
637
|
+
<button
|
|
638
|
+
aerisButton
|
|
639
|
+
type="button"
|
|
640
|
+
class="aeris-confirm-dialog__button aeris-confirm-dialog__accept"
|
|
641
|
+
[severity]="acceptButtonSeverity()"
|
|
642
|
+
[attr.data-severity]="settings().severity"
|
|
643
|
+
[disabled]="settings().acceptDisabled"
|
|
644
|
+
[attr.aria-label]="settings().acceptAriaLabel"
|
|
645
|
+
(click)="accept($event)"
|
|
646
|
+
>
|
|
647
|
+
{{ settings().acceptLabel }}
|
|
648
|
+
</button>
|
|
649
|
+
}
|
|
650
|
+
</div>
|
|
651
|
+
}
|
|
652
|
+
</ng-template>
|
|
653
|
+
}
|
|
654
|
+
</aeris-dialog>
|
|
655
|
+
`, isInline: true, styles: [":host{--_aeris-confirm-dialog-icon-size: 2.5rem;display:contents}.aeris-confirm-dialog__content{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.875rem;align-items:start}.aeris-confirm-dialog__content:not(:has(.aeris-confirm-dialog__icon)){grid-template-columns:1fr}.aeris-confirm-dialog__icon{width:var(--aeris-confirm-dialog-icon-size, var(--_aeris-confirm-dialog-icon-size));height:var(--aeris-confirm-dialog-icon-size, var(--_aeris-confirm-dialog-icon-size));display:inline-grid;place-items:center;border-radius:var(--aeris-confirm-dialog-icon-radius, 999px);background:var(--aeris-confirm-dialog-icon-background, color-mix(in srgb, var(--aeris-primary, #6f7f49) 14%, transparent));color:var(--aeris-confirm-dialog-icon-color, var(--aeris-primary-text, #4c5f27));flex:0 0 auto}.aeris-confirm-dialog__icon svg{width:1.35rem;height:1.35rem;display:block;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.aeris-confirm-dialog__content[data-severity=success] .aeris-confirm-dialog__icon{background:color-mix(in srgb,var(--aeris-success, #5d7d3f) 16%,transparent);color:var(--aeris-success-text, #3e6124)}.aeris-confirm-dialog__content[data-severity=info] .aeris-confirm-dialog__icon{background:color-mix(in srgb,var(--aeris-info, #58789d) 16%,transparent);color:var(--aeris-info-text, #2f5c87)}.aeris-confirm-dialog__content[data-severity=warning] .aeris-confirm-dialog__icon{background:color-mix(in srgb,var(--aeris-warning, #c38600) 18%,transparent);color:var(--aeris-warning-text, #8a6100)}.aeris-confirm-dialog__content[data-severity=danger] .aeris-confirm-dialog__icon{background:color-mix(in srgb,var(--aeris-danger, #c81e2a) 16%,transparent);color:var(--aeris-danger-text, #a31722)}.aeris-confirm-dialog__message{min-width:0;color:var(--aeris-confirm-dialog-message-color, var(--aeris-text-2, #555555));font-size:.9375rem;line-height:1.55}.aeris-confirm-dialog__message:empty{display:none}.aeris-confirm-dialog__actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}@media(max-width:34rem){.aeris-confirm-dialog__content{grid-template-columns:1fr}.aeris-confirm-dialog__actions,.aeris-confirm-dialog__actions .aeris-button{width:100%}}\n"], dependencies: [{ kind: "component", type: AerisButtonDirective, selector: "button[aerisButton], a[aerisButton]", inputs: ["variant", "text", "outlined", "link", "plain", "size", "severity", "iconPosition", "loading", "showSpinner", "iconOnly", "raised", "rounded", "fluid"] }, { kind: "component", type: AerisDialog, selector: "aeris-dialog", inputs: ["visible", "maximized", "header", "role", "modal", "backdrop", "backdropBlur", "backdropBlurAmount", "dismissibleMask", "closeOnEscape", "closable", "maximizable", "draggable", "resizable", "blockScroll", "focusTrap", "restoreFocus", "autoFocus", "initialFocus", "position", "size", "width", "minWidth", "maxWidth", "height", "maxHeight", "mobileWidth", "closeAriaLabel", "ariaLabel", "ariaLabelledBy", "ariaDescribedBy"], outputs: ["visibleChange", "maximizedChange", "shown", "hidden", "visibilityChanged"] }, { kind: "directive", type: AerisDialogFooterTemplate, selector: "ng-template[aerisDialogFooter]" }, { kind: "directive", type: AerisDialogHeadlessTemplate, selector: "ng-template[aerisDialogHeadless]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
656
|
+
}
|
|
657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisConfirmDialog, decorators: [{
|
|
658
|
+
type: Component,
|
|
659
|
+
args: [{ selector: 'aeris-confirm-dialog', imports: [
|
|
660
|
+
AerisButtonDirective,
|
|
661
|
+
AerisDialog,
|
|
662
|
+
AerisDialogFooterTemplate,
|
|
663
|
+
AerisDialogHeadlessTemplate,
|
|
664
|
+
NgTemplateOutlet,
|
|
665
|
+
], template: `
|
|
666
|
+
<aeris-dialog
|
|
667
|
+
#dialog
|
|
668
|
+
[role]="'alertdialog'"
|
|
669
|
+
[header]="settings().header"
|
|
670
|
+
[modal]="settings().modal"
|
|
671
|
+
[backdrop]="settings().backdrop"
|
|
672
|
+
[backdropBlur]="settings().backdropBlur"
|
|
673
|
+
[backdropBlurAmount]="settings().backdropBlurAmount"
|
|
674
|
+
[dismissibleMask]="settings().dismissibleMask"
|
|
675
|
+
[closeOnEscape]="settings().closeOnEscape"
|
|
676
|
+
[closable]="settings().closable"
|
|
677
|
+
[blockScroll]="settings().blockScroll"
|
|
678
|
+
[focusTrap]="settings().focusTrap"
|
|
679
|
+
[restoreFocus]="settings().restoreFocus"
|
|
680
|
+
[autoFocus]="autoFocusTarget()"
|
|
681
|
+
[initialFocus]="initialFocusTarget()"
|
|
682
|
+
[position]="settings().position"
|
|
683
|
+
[size]="settings().size"
|
|
684
|
+
[width]="settings().width"
|
|
685
|
+
[maxWidth]="settings().maxWidth"
|
|
686
|
+
[mobileWidth]="settings().mobileWidth"
|
|
687
|
+
[closeAriaLabel]="settings().closeAriaLabel"
|
|
688
|
+
[ariaLabel]="settings().ariaLabel"
|
|
689
|
+
[ariaLabelledBy]="settings().ariaLabelledBy"
|
|
690
|
+
[ariaDescribedBy]="computedAriaDescribedBy()"
|
|
691
|
+
[visible]="visible()"
|
|
692
|
+
(shown)="handleShown($event)"
|
|
693
|
+
(hidden)="handleHidden($event)"
|
|
694
|
+
>
|
|
695
|
+
@if (headlessTemplate(); as headlessTemplateRef) {
|
|
696
|
+
<ng-template aerisDialogHeadless>
|
|
697
|
+
<ng-container
|
|
698
|
+
[ngTemplateOutlet]="headlessTemplateRef.template"
|
|
699
|
+
[ngTemplateOutletContext]="templateContext()"
|
|
700
|
+
/>
|
|
701
|
+
</ng-template>
|
|
702
|
+
} @else {
|
|
703
|
+
<div class="aeris-confirm-dialog__content" [attr.data-severity]="settings().severity">
|
|
704
|
+
@if (iconTemplate(); as iconTemplateRef) {
|
|
705
|
+
<div class="aeris-confirm-dialog__icon" aria-hidden="true">
|
|
706
|
+
<ng-container
|
|
707
|
+
[ngTemplateOutlet]="iconTemplateRef.template"
|
|
708
|
+
[ngTemplateOutletContext]="templateContext()"
|
|
709
|
+
/>
|
|
710
|
+
</div>
|
|
711
|
+
} @else if (settings().icon !== 'none') {
|
|
712
|
+
<span
|
|
713
|
+
class="aeris-confirm-dialog__icon"
|
|
714
|
+
[attr.data-icon]="settings().icon"
|
|
715
|
+
aria-hidden="true"
|
|
716
|
+
>
|
|
717
|
+
<svg viewBox="0 0 24 24" focusable="false">
|
|
718
|
+
@switch (settings().icon) {
|
|
719
|
+
@case ('info') {
|
|
720
|
+
<path d="M12 17v-6" />
|
|
721
|
+
<path d="M12 7.5h.01" />
|
|
722
|
+
<path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z" />
|
|
723
|
+
}
|
|
724
|
+
@case ('warning') {
|
|
725
|
+
<path d="M12 4.5 21 19H3L12 4.5Z" />
|
|
726
|
+
<path d="M12 10v4" />
|
|
727
|
+
<path d="M12 17h.01" />
|
|
728
|
+
}
|
|
729
|
+
@case ('danger') {
|
|
730
|
+
<path d="M12 4.5 21 19H3L12 4.5Z" />
|
|
731
|
+
<path d="M12 10v4" />
|
|
732
|
+
<path d="M12 17h.01" />
|
|
733
|
+
}
|
|
734
|
+
@case ('success') {
|
|
735
|
+
<path d="M20 7 10 17l-5-5" />
|
|
736
|
+
}
|
|
737
|
+
@default {
|
|
738
|
+
<path d="M9.75 9a2.25 2.25 0 1 1 3.15 2.07c-.61.28-.9.82-.9 1.43v.5" />
|
|
739
|
+
<path d="M12 17h.01" />
|
|
740
|
+
<path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z" />
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
</svg>
|
|
744
|
+
</span>
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
<div class="aeris-confirm-dialog__message" [id]="messageId">
|
|
748
|
+
@if (messageTemplate(); as messageTemplateRef) {
|
|
749
|
+
<ng-container
|
|
750
|
+
[ngTemplateOutlet]="messageTemplateRef.template"
|
|
751
|
+
[ngTemplateOutletContext]="templateContext()"
|
|
752
|
+
/>
|
|
753
|
+
} @else {
|
|
754
|
+
{{ settings().message }}
|
|
755
|
+
}
|
|
756
|
+
</div>
|
|
757
|
+
</div>
|
|
758
|
+
|
|
759
|
+
<ng-template aerisDialogFooter>
|
|
760
|
+
@if (footerTemplate(); as footerTemplateRef) {
|
|
761
|
+
<ng-container
|
|
762
|
+
[ngTemplateOutlet]="footerTemplateRef.template"
|
|
763
|
+
[ngTemplateOutletContext]="templateContext()"
|
|
764
|
+
/>
|
|
765
|
+
} @else {
|
|
766
|
+
<div class="aeris-confirm-dialog__actions">
|
|
767
|
+
@if (settings().rejectVisible) {
|
|
768
|
+
<button
|
|
769
|
+
aerisButton
|
|
770
|
+
type="button"
|
|
771
|
+
variant="secondary"
|
|
772
|
+
class="aeris-confirm-dialog__button aeris-confirm-dialog__reject"
|
|
773
|
+
[disabled]="settings().rejectDisabled"
|
|
774
|
+
[attr.aria-label]="settings().rejectAriaLabel"
|
|
775
|
+
(click)="reject($event)"
|
|
776
|
+
>
|
|
777
|
+
{{ settings().rejectLabel }}
|
|
778
|
+
</button>
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
@if (settings().acceptVisible) {
|
|
782
|
+
<button
|
|
783
|
+
aerisButton
|
|
784
|
+
type="button"
|
|
785
|
+
class="aeris-confirm-dialog__button aeris-confirm-dialog__accept"
|
|
786
|
+
[severity]="acceptButtonSeverity()"
|
|
787
|
+
[attr.data-severity]="settings().severity"
|
|
788
|
+
[disabled]="settings().acceptDisabled"
|
|
789
|
+
[attr.aria-label]="settings().acceptAriaLabel"
|
|
790
|
+
(click)="accept($event)"
|
|
791
|
+
>
|
|
792
|
+
{{ settings().acceptLabel }}
|
|
793
|
+
</button>
|
|
794
|
+
}
|
|
795
|
+
</div>
|
|
796
|
+
}
|
|
797
|
+
</ng-template>
|
|
798
|
+
}
|
|
799
|
+
</aeris-dialog>
|
|
800
|
+
`, host: {
|
|
801
|
+
class: 'aeris-confirm-dialog',
|
|
802
|
+
'[attr.data-open]': 'visible() || null',
|
|
803
|
+
}, styles: [":host{--_aeris-confirm-dialog-icon-size: 2.5rem;display:contents}.aeris-confirm-dialog__content{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.875rem;align-items:start}.aeris-confirm-dialog__content:not(:has(.aeris-confirm-dialog__icon)){grid-template-columns:1fr}.aeris-confirm-dialog__icon{width:var(--aeris-confirm-dialog-icon-size, var(--_aeris-confirm-dialog-icon-size));height:var(--aeris-confirm-dialog-icon-size, var(--_aeris-confirm-dialog-icon-size));display:inline-grid;place-items:center;border-radius:var(--aeris-confirm-dialog-icon-radius, 999px);background:var(--aeris-confirm-dialog-icon-background, color-mix(in srgb, var(--aeris-primary, #6f7f49) 14%, transparent));color:var(--aeris-confirm-dialog-icon-color, var(--aeris-primary-text, #4c5f27));flex:0 0 auto}.aeris-confirm-dialog__icon svg{width:1.35rem;height:1.35rem;display:block;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.aeris-confirm-dialog__content[data-severity=success] .aeris-confirm-dialog__icon{background:color-mix(in srgb,var(--aeris-success, #5d7d3f) 16%,transparent);color:var(--aeris-success-text, #3e6124)}.aeris-confirm-dialog__content[data-severity=info] .aeris-confirm-dialog__icon{background:color-mix(in srgb,var(--aeris-info, #58789d) 16%,transparent);color:var(--aeris-info-text, #2f5c87)}.aeris-confirm-dialog__content[data-severity=warning] .aeris-confirm-dialog__icon{background:color-mix(in srgb,var(--aeris-warning, #c38600) 18%,transparent);color:var(--aeris-warning-text, #8a6100)}.aeris-confirm-dialog__content[data-severity=danger] .aeris-confirm-dialog__icon{background:color-mix(in srgb,var(--aeris-danger, #c81e2a) 16%,transparent);color:var(--aeris-danger-text, #a31722)}.aeris-confirm-dialog__message{min-width:0;color:var(--aeris-confirm-dialog-message-color, var(--aeris-text-2, #555555));font-size:.9375rem;line-height:1.55}.aeris-confirm-dialog__message:empty{display:none}.aeris-confirm-dialog__actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}@media(max-width:34rem){.aeris-confirm-dialog__content{grid-template-columns:1fr}.aeris-confirm-dialog__actions,.aeris-confirm-dialog__actions .aeris-button{width:100%}}\n"] }]
|
|
804
|
+
}], ctorParameters: () => [], propDecorators: { dialog: [{ type: i0.ViewChild, args: ['dialog', { isSignal: true }] }], iconTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AerisConfirmDialogIconTemplate), { isSignal: true }] }], messageTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AerisConfirmDialogMessageTemplate), { isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AerisConfirmDialogFooterTemplate), { isSignal: true }] }], headlessTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => AerisConfirmDialogHeadlessTemplate), { isSignal: true }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: false }] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], acceptLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptLabel", required: false }] }], rejectLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rejectLabel", required: false }] }], acceptVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptVisible", required: false }] }], rejectVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "rejectVisible", required: false }] }], acceptDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptDisabled", required: false }] }], rejectDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "rejectDisabled", required: false }] }], acceptAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptAriaLabel", required: false }] }], rejectAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rejectAriaLabel", required: false }] }], defaultFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocus", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], backdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdrop", required: false }] }], backdropBlur: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdropBlur", required: false }] }], backdropBlurAmount: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdropBlurAmount", required: false }] }], dismissibleMask: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissibleMask", required: false }] }], closeOnEscape: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnEscape", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], blockScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockScroll", required: false }] }], focusTrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusTrap", required: false }] }], restoreFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreFocus", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], initialFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFocus", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], mobileWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "mobileWidth", required: false }] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], shown: [{ type: i0.Output, args: ["shown"] }], accepted: [{ type: i0.Output, args: ["accepted"] }], rejected: [{ type: i0.Output, args: ["rejected"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
805
|
+
const AerisConfirmDialogModule = [
|
|
806
|
+
AerisConfirmDialog,
|
|
807
|
+
AerisConfirmDialogIconTemplate,
|
|
808
|
+
AerisConfirmDialogMessageTemplate,
|
|
809
|
+
AerisConfirmDialogFooterTemplate,
|
|
810
|
+
AerisConfirmDialogHeadlessTemplate,
|
|
811
|
+
];
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Generated bundle index. Do not edit.
|
|
815
|
+
*/
|
|
816
|
+
|
|
817
|
+
export { AerisConfirmDialog, AerisConfirmDialogFooterTemplate, AerisConfirmDialogHeadlessTemplate, AerisConfirmDialogIconTemplate, AerisConfirmDialogMessageTemplate, AerisConfirmDialogModule, AerisConfirmDialogRef, AerisConfirmDialogService };
|
|
818
|
+
//# sourceMappingURL=aeris-ui-core-confirm-dialog.mjs.map
|