@acorex/components 21.0.1-next.12 → 21.0.1-next.13
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/accordion/index.d.ts +0 -1
- package/action-sheet/index.d.ts +19 -41
- package/button-group/index.d.ts +6 -4
- package/chips/index.d.ts +3 -8
- package/collapse/index.d.ts +4 -6
- package/conversation2/README.md +31 -71
- package/conversation2/index.d.ts +35 -36
- package/data-table/index.d.ts +4 -253
- package/dialog/index.d.ts +15 -19
- package/dropdown/index.d.ts +4 -3
- package/fesm2022/acorex-components-accordion.mjs +8 -13
- package/fesm2022/acorex-components-accordion.mjs.map +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +93 -141
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +6 -6
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-aspect-ratio.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs +5 -4
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-autocomplete.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +3 -3
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +3 -3
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs +2 -2
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +2 -2
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +15 -11
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +5 -5
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +4 -4
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +3 -3
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +6 -8
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +6 -4
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-code-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs +13 -10
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +2 -2
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +2 -2
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-command.mjs +2 -2
- package/fesm2022/acorex-components-command.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +8 -8
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +2 -2
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation2.mjs +155 -161
- package/fesm2022/acorex-components-conversation2.mjs.map +1 -1
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-data-list.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +2 -2
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +16 -452
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +2 -2
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +2 -2
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +10 -12
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +20 -13
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +47 -67
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer-legacy.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +6 -7
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +2 -2
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +13 -12
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-editor.mjs +4 -4
- package/fesm2022/acorex-components-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-file-explorer.mjs.map +1 -1
- package/fesm2022/acorex-components-flow-chart.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +17 -9
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +4 -5
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +18 -18
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +2 -2
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +2 -2
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-kanban.mjs +6 -4
- package/fesm2022/acorex-components-kanban.mjs.map +1 -1
- package/fesm2022/acorex-components-kbd.mjs +25 -7
- package/fesm2022/acorex-components-kbd.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +2 -2
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +2 -2
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +36 -73
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +8 -8
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +2 -2
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +10 -10
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +6 -27
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/{acorex-components-modal-acorex-components-modal-Bmoz9DL5.mjs → acorex-components-modal-acorex-components-modal-BnUdtPke.mjs} +5 -29
- package/fesm2022/acorex-components-modal-acorex-components-modal-BnUdtPke.mjs.map +1 -0
- package/fesm2022/{acorex-components-modal-modal-content.component-CSJU1vRi.mjs → acorex-components-modal-modal-content.component-Cgq-wx_m.mjs} +7 -5
- package/fesm2022/acorex-components-modal-modal-content.component-Cgq-wx_m.mjs.map +1 -0
- package/fesm2022/acorex-components-modal.mjs +1 -1
- package/fesm2022/acorex-components-navbar.mjs +3 -3
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +250 -378
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box-legacy.mjs +2 -2
- package/fesm2022/acorex-components-number-box-legacy.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +2 -2
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +2 -2
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +14 -19
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +4 -4
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-pdf-reader.mjs +2 -2
- package/fesm2022/acorex-components-pdf-reader.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +2 -2
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +6 -6
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +175 -136
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +106 -296
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +5 -3
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs +2 -2
- package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-components-query-builder.mjs +2 -2
- package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +2 -2
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-rail-navigation.mjs +27 -25
- package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +3 -3
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +14 -29
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +2 -2
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +2 -2
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-rrule.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler-picker.mjs +2 -2
- package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +18 -18
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-scss.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +9 -3
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +4 -2
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list-2.mjs +4 -4
- package/fesm2022/acorex-components-selection-list-2.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +2 -2
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +63 -14
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +2 -2
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs +5 -5
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-sliding-item.mjs +2 -2
- package/fesm2022/acorex-components-sliding-item.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +2 -2
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +4 -4
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +2 -2
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag-box.mjs +2 -2
- package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +3 -3
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +2 -2
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +2 -2
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-duration.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs +4 -4
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +125 -233
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-toolbar.mjs +2 -2
- package/fesm2022/acorex-components-toolbar.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +12 -12
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view-legacy.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs +6 -6
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-video-player.mjs +2 -2
- package/fesm2022/acorex-components-video-player.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +12 -12
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/fesm2022/acorex-components.mjs.map +1 -1
- package/grid-layout-builder/index.d.ts +1 -2
- package/kbd/index.d.ts +13 -7
- package/loading/index.d.ts +1 -1
- package/loading-dialog/index.d.ts +15 -31
- package/menu/index.d.ts +0 -4
- package/modal/index.d.ts +0 -7
- package/notification/index.d.ts +30 -47
- package/package.json +15 -15
- package/paint/index.d.ts +1 -6
- package/popover/index.d.ts +27 -20
- package/popup/index.d.ts +27 -98
- package/rate-picker/index.d.ts +5 -15
- package/side-menu/index.d.ts +9 -2
- package/slider/index.d.ts +2 -2
- package/toast/index.d.ts +18 -24
- package/tooltip/index.d.ts +2 -2
- package/fesm2022/acorex-components-modal-acorex-components-modal-Bmoz9DL5.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-modal-content.component-CSJU1vRi.mjs.map +0 -1
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { AXPlatform } from '@acorex/core/platform';
|
|
2
|
+
import { TemplatePortal, ComponentPortal, CdkPortalOutlet, PortalModule } from '@angular/cdk/portal';
|
|
2
3
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, NgZone,
|
|
4
|
+
import { inject, NgZone, ViewContainerRef, TemplateRef, HostListener, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, NgModule } from '@angular/core';
|
|
4
5
|
import { MXBaseComponent, AXClosableComponent, AXComponent, AXComponentClosedPromise, AXCommonModule } from '@acorex/cdk/common';
|
|
5
6
|
import { AXDecoratorCloseButtonComponent, AXDecoratorModule } from '@acorex/components/decorators';
|
|
6
7
|
import { AXLoadingService } from '@acorex/components/loading';
|
|
7
|
-
import { AXComponentService } from '@acorex/core/components';
|
|
8
8
|
import { AXTranslatorPipe, AXTranslationModule } from '@acorex/core/translation';
|
|
9
|
+
import { CdkTrapFocus, A11yModule } from '@angular/cdk/a11y';
|
|
10
|
+
import { DIALOG_DATA, DialogRef, Dialog, DialogModule } from '@angular/cdk/dialog';
|
|
11
|
+
import { CdkDrag, CdkDragHandle, DragDropModule } from '@angular/cdk/drag-drop';
|
|
9
12
|
import { AsyncPipe, CommonModule } from '@angular/common';
|
|
10
|
-
import {
|
|
11
|
-
import { Subject } from 'rxjs';
|
|
13
|
+
import { AXHtmlUtil } from '@acorex/core/utils';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
|
-
* The
|
|
16
|
+
* The Button is a component which detects user interaction and triggers a corresponding event
|
|
15
17
|
*
|
|
16
18
|
* @category Components
|
|
17
19
|
*/
|
|
@@ -19,117 +21,69 @@ class AXPopupComponent extends MXBaseComponent {
|
|
|
19
21
|
constructor() {
|
|
20
22
|
super(...arguments);
|
|
21
23
|
this._zone = inject(NgZone);
|
|
24
|
+
this._viewContainerRef = inject(ViewContainerRef);
|
|
22
25
|
this.loadingService = inject(AXLoadingService);
|
|
23
26
|
this._platform = inject(AXPlatform);
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
this.__content__ = input(...(ngDevMode ? [undefined, { debugName: "__content__" }] : []));
|
|
27
|
-
this.__config__ = input(...(ngDevMode ? [undefined, { debugName: "__config__" }] : []));
|
|
28
|
-
this.__popupRef__ = input(...(ngDevMode ? [undefined, { debugName: "__popupRef__" }] : []));
|
|
29
|
-
this.__id__ = input(...(ngDevMode ? [undefined, { debugName: "__id__" }] : []));
|
|
27
|
+
this.data = inject(DIALOG_DATA);
|
|
28
|
+
this.dialogRef = inject(DialogRef);
|
|
30
29
|
/**
|
|
31
30
|
* Indicates whether the component is loading.
|
|
32
31
|
* @defaultValue true
|
|
33
32
|
*/
|
|
34
33
|
this.isLoading = true;
|
|
35
|
-
/** @ignore */
|
|
36
|
-
this._componentRef = null;
|
|
37
|
-
/** Current title */
|
|
38
|
-
this.title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
39
|
-
/** @ignore */
|
|
40
|
-
this.isDragging = signal(false, ...(ngDevMode ? [{ debugName: "isDragging" }] : []));
|
|
41
|
-
/** @ignore */
|
|
42
|
-
this.dragOffset = signal({ x: 0, y: 0 }, ...(ngDevMode ? [{ debugName: "dragOffset" }] : []));
|
|
43
|
-
/** @ignore */
|
|
44
|
-
this.dragStartPos = { x: 0, y: 0 };
|
|
45
|
-
/** @ignore */
|
|
46
|
-
this.elementStartPos = { x: 0, y: 0 };
|
|
47
34
|
}
|
|
48
35
|
/** @ignore */
|
|
49
36
|
ngOnInit() {
|
|
50
37
|
super.ngOnInit();
|
|
51
|
-
const config = this.__config__();
|
|
52
38
|
if (this._platform.is('SM')) {
|
|
53
|
-
|
|
54
|
-
if (config) {
|
|
55
|
-
config.draggable = false;
|
|
56
|
-
}
|
|
39
|
+
this.data.draggable = false;
|
|
57
40
|
}
|
|
58
|
-
this.title.set(config?.title ?? '');
|
|
59
41
|
this._loadingId = this.loadingService.show({
|
|
60
42
|
location: this.getHostElement(),
|
|
61
43
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const content = this.__content__();
|
|
67
|
-
const config = this.__config__();
|
|
68
|
-
if (!content) {
|
|
69
|
-
this.loadingService.hide(this._loadingId);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (content instanceof TemplateRef) {
|
|
73
|
-
// Render template using ViewContainerRef (supports context)
|
|
74
|
-
this.contentContainerRef.createEmbeddedView(content, {
|
|
75
|
-
$implicit: config?.data,
|
|
44
|
+
//
|
|
45
|
+
if (this.data.content instanceof TemplateRef) {
|
|
46
|
+
this._selectedPortal = new TemplatePortal(this.data.content, this._viewContainerRef, {
|
|
47
|
+
$implicit: this.data,
|
|
76
48
|
ref: this,
|
|
77
49
|
});
|
|
78
|
-
this.
|
|
50
|
+
this.cdr.markForCheck();
|
|
79
51
|
}
|
|
80
|
-
else if (typeof content === 'function') {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
// Set popup reference (only if the component has this input)
|
|
101
|
-
if (inputDefs && '__popup__' in inputDefs) {
|
|
102
|
-
componentRef.setInput('__popup__', this.__popupRef__());
|
|
103
|
-
}
|
|
104
|
-
// Move component to container
|
|
105
|
-
const hostElement = componentRef.location.nativeElement;
|
|
106
|
-
this.contentContainerEl.nativeElement.appendChild(hostElement);
|
|
107
|
-
// Subscribe to close event if available
|
|
108
|
-
const instance = componentRef.instance;
|
|
109
|
-
if (instance.onClosed) {
|
|
110
|
-
instance.onClosed.subscribe((e) => {
|
|
52
|
+
else if (typeof this.data.content === 'function') {
|
|
53
|
+
this._selectedPortal = new ComponentPortal(this.data.content);
|
|
54
|
+
this.cdr.markForCheck();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** @ignore */
|
|
58
|
+
_handleAttched(ref) {
|
|
59
|
+
ref = ref;
|
|
60
|
+
if (ref.instance) {
|
|
61
|
+
this._componentRef = ref.instance;
|
|
62
|
+
Object.assign(this._componentRef, this.data.data);
|
|
63
|
+
Object.assign(this._componentRef, { _isPopup: true });
|
|
64
|
+
Object.assign(this._componentRef, {
|
|
65
|
+
setTitle: (title) => {
|
|
66
|
+
this.data.title = title;
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
if (ref.instance.onClosed) {
|
|
70
|
+
ref.instance.onClosed.subscribe((e) => {
|
|
111
71
|
this.close(e.data);
|
|
112
72
|
});
|
|
113
73
|
}
|
|
114
|
-
this.handleContentRendered();
|
|
115
74
|
}
|
|
116
|
-
}
|
|
117
|
-
/** @ignore */
|
|
118
|
-
handleContentRendered() {
|
|
119
75
|
this._zone.runOutsideAngular(() => {
|
|
120
76
|
setTimeout(() => {
|
|
121
77
|
const body = this.getHostElement().querySelector('.ax-popup-body-container');
|
|
122
78
|
const content = body.children[0];
|
|
123
|
-
if (!content || !body)
|
|
124
|
-
return;
|
|
125
79
|
const popHeader = this.getHostElement().querySelector('.ax-popup-header-container');
|
|
126
80
|
const popFooter = this.getHostElement().querySelector('.ax-popup-footer-container');
|
|
127
81
|
const footer = content.querySelector(':scope > ax-footer');
|
|
128
82
|
const header = content.querySelector(':scope > ax-header');
|
|
129
|
-
if (footer
|
|
130
|
-
popFooter
|
|
83
|
+
if (footer) {
|
|
84
|
+
popFooter?.append(footer);
|
|
131
85
|
}
|
|
132
|
-
if (header
|
|
86
|
+
if (header) {
|
|
133
87
|
popHeader.innerHTML = '';
|
|
134
88
|
popHeader.append(header);
|
|
135
89
|
}
|
|
@@ -140,9 +94,9 @@ class AXPopupComponent extends MXBaseComponent {
|
|
|
140
94
|
this.cdr.markForCheck();
|
|
141
95
|
}
|
|
142
96
|
/** @ignore */
|
|
143
|
-
onKeydownHandler() {
|
|
97
|
+
onKeydownHandler(event) {
|
|
144
98
|
const focusedOrHasFocused = this.getHostElement().matches(':focus-within');
|
|
145
|
-
if (this.
|
|
99
|
+
if (this.data.closeButton && focusedOrHasFocused) {
|
|
146
100
|
this.close();
|
|
147
101
|
}
|
|
148
102
|
}
|
|
@@ -153,10 +107,6 @@ class AXPopupComponent extends MXBaseComponent {
|
|
|
153
107
|
/** @ignore */
|
|
154
108
|
ngOnDestroy() {
|
|
155
109
|
this.loadingService.hide(this._loadingId);
|
|
156
|
-
if (this._componentRef) {
|
|
157
|
-
this._componentRef.destroy();
|
|
158
|
-
this._componentRef = null;
|
|
159
|
-
}
|
|
160
110
|
}
|
|
161
111
|
/**
|
|
162
112
|
* Sets focus on the `.ax-popup` element within the host element after a short delay.
|
|
@@ -165,20 +115,23 @@ class AXPopupComponent extends MXBaseComponent {
|
|
|
165
115
|
setTimeout(() => this.getHostElement().querySelector('.ax-popup')?.focus());
|
|
166
116
|
}
|
|
167
117
|
/**
|
|
168
|
-
* Closes the
|
|
118
|
+
* Closes the dialog, emitting component reference, host element, and optional data.
|
|
169
119
|
* @param {unknown} [data]
|
|
170
120
|
*/
|
|
171
121
|
close(data) {
|
|
172
122
|
const closeFn = () => {
|
|
173
|
-
this.
|
|
123
|
+
this.dialogRef.close({
|
|
124
|
+
component: this._componentRef,
|
|
125
|
+
htmlElement: this.getHostElement(),
|
|
126
|
+
data: data,
|
|
127
|
+
});
|
|
174
128
|
};
|
|
175
|
-
|
|
176
|
-
if (typeof componentInstance?.onClosing === 'function') {
|
|
129
|
+
if (typeof this._componentRef?.onClosing === 'function') {
|
|
177
130
|
const ee = {
|
|
178
131
|
cancel: false,
|
|
179
132
|
data,
|
|
180
133
|
};
|
|
181
|
-
const closingResult =
|
|
134
|
+
const closingResult = this._componentRef?.onClosing(ee);
|
|
182
135
|
if (closingResult instanceof Promise) {
|
|
183
136
|
closingResult.then(() => {
|
|
184
137
|
if (!ee.cancel) {
|
|
@@ -196,102 +149,31 @@ class AXPopupComponent extends MXBaseComponent {
|
|
|
196
149
|
closeFn();
|
|
197
150
|
}
|
|
198
151
|
}
|
|
199
|
-
/**
|
|
200
|
-
* Sets inputs on the content component.
|
|
201
|
-
* @param values - Object containing input values to set
|
|
202
|
-
*/
|
|
203
|
-
setContentInputs(values) {
|
|
204
|
-
const componentRef = this._componentRef;
|
|
205
|
-
if (componentRef) {
|
|
206
|
-
Object.entries(values).forEach(([key, value]) => {
|
|
207
|
-
componentRef.setInput(key, value);
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Sets the popup title.
|
|
213
|
-
* @param title - The new title
|
|
214
|
-
*/
|
|
215
|
-
setTitle(title) {
|
|
216
|
-
this.title.set(title);
|
|
217
|
-
this.cdr.markForCheck();
|
|
218
|
-
}
|
|
219
|
-
// Drag functionality
|
|
220
|
-
onDragStart(event) {
|
|
221
|
-
const config = this.__config__();
|
|
222
|
-
if (!config?.draggable)
|
|
223
|
-
return;
|
|
224
|
-
this.isDragging.set(true);
|
|
225
|
-
this.dragStartPos = { x: event.clientX, y: event.clientY };
|
|
226
|
-
const popup = this.getHostElement().querySelector('.ax-popup');
|
|
227
|
-
if (popup) {
|
|
228
|
-
const rect = popup.getBoundingClientRect();
|
|
229
|
-
this.elementStartPos = { x: rect.left, y: rect.top };
|
|
230
|
-
}
|
|
231
|
-
event.preventDefault();
|
|
232
|
-
}
|
|
233
|
-
onDragMove(event) {
|
|
234
|
-
if (!this.isDragging())
|
|
235
|
-
return;
|
|
236
|
-
const deltaX = event.clientX - this.dragStartPos.x;
|
|
237
|
-
const deltaY = event.clientY - this.dragStartPos.y;
|
|
238
|
-
this.dragOffset.set({
|
|
239
|
-
x: this.elementStartPos.x + deltaX,
|
|
240
|
-
y: this.elementStartPos.y + deltaY,
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
onDragEnd() {
|
|
244
|
-
this.isDragging.set(false);
|
|
245
|
-
}
|
|
246
152
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
247
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AXPopupComponent, isStandalone: true, selector: "ax-popup",
|
|
153
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AXPopupComponent, isStandalone: true, selector: "ax-popup", host: { listeners: { "keydown.escape": "onKeydownHandler($event)" } }, providers: [
|
|
248
154
|
{ provide: AXClosableComponent, useExisting: AXPopupComponent },
|
|
249
155
|
{ provide: AXComponent, useExisting: AXPopupComponent },
|
|
250
|
-
],
|
|
156
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-popup-wrapper\" aria-modal=\"true\" [cdkTrapFocus]=\"true\">\n <div class=\"ax-popup ax-popup-{{ data.size }}\" tabindex=\"0\" cdkDrag [cdkDragDisabled]=\"!data.draggable\">\n <div cdkDragHandle class=\"ax-popup-header-container\">\n @if (data.header) {\n <div class=\"ax-popup-header\">\n <span class=\"ax-popup-title\">{{ data.title | translate | async }}</span>\n @if (data.closeButton) {\n <ax-close-button tabindex=\"1\"></ax-close-button>\n }\n </div>\n }\n </div>\n <div class=\"ax-popup-main-container ax-loading-container\">\n <div class=\"ax-popup-body-container\">\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n </div>\n <div class=\"ax-popup-footer-container\"></div>\n </div>\n </div>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-outline-style:solid;--tw-font-weight:initial;--tw-leading:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer components{.ax-popup:where(.dark,.dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}.ax-popup{max-height:calc(var(--ax-overlay-full-width)*var(--ax-vh));--ax-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--ax-shadow-colored:0 10px 15px -3px var(--ax-shadow-color),0 4px 6px -4px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow,0 0 #0000),var(--ax-ring-shadow,0 0 #0000),var(--ax-shadow)}.ax-popup .ax-popup-header-container{background-color:var(--color-lighter,rgba(var(--ax-sys-color-lighter-surface)))}.ax-popup .ax-popup-header-container:where(.dark,.dark *){background-color:var(--color-dark,rgba(var(--ax-sys-color-dark-surface)))}.ax-popup .ax-popup-header-container .ax-popup-header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-border-lighter,rgba(var(--ax-sys-color-border-lighter-surface)));padding:calc(var(--spacing,.25rem)*3);justify-content:space-between;align-items:center;display:flex}.ax-popup .ax-popup-header-container .ax-popup-header:where(.dark,.dark *){border-color:var(--color-border-dark,rgba(var(--ax-sys-color-border-dark-surface)))}.ax-popup .ax-popup-header-container .ax-popup-header .ax-popup-title{font-size:var(--text-base,1rem);line-height:var(--tw-leading,var(--text-base--line-height, 1.5 ));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}@media (min-width:48rem){.ax-popup .ax-popup-header-container .ax-popup-header .ax-popup-title{font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75/1.125)));--tw-leading:calc(var(--spacing,.25rem)*7);line-height:calc(var(--spacing,.25rem)*7)}}.ax-popup ax-footer{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-border-lighter,rgba(var(--ax-sys-color-border-lighter-surface)));background-color:var(--color-lighter,rgba(var(--ax-sys-color-lighter-surface)));padding:calc(var(--spacing,.25rem)*3);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);justify-content:space-between;align-items:center;display:flex}.ax-popup ax-footer:where(.dark,.dark *){border-color:var(--color-border-dark,rgba(var(--ax-sys-color-border-dark-surface)));background-color:var(--color-dark,rgba(var(--ax-sys-color-dark-surface)))}.ax-popup:focus{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:#0000}.ax-popup:focus-visible{border-color:var(--color-primary,rgba(var(--ax-sys-color-primary-surface)))}.ax-popup .ax-popup-main-container{flex-direction:column;flex:1;display:flex;overflow:hidden}.ax-popup .ax-popup-main-container .ax-popup-body-container{background-color:var(--color-lightest,rgba(var(--ax-sys-color-lightest-surface)));flex:1;overflow:auto}.ax-popup .ax-popup-main-container .ax-popup-body-container:where(.dark,.dark *){background-color:var(--color-darkest,rgba(var(--ax-sys-color-darkest-surface)))}.ax-popup .ax-popup-main-container .ax-popup-footer-container{background-color:var(--color-lighter,rgba(var(--ax-sys-color-lighter-surface)))}.ax-popup .ax-popup-main-container .ax-popup-footer-container:where(.dark,.dark *){background-color:var(--color-dark,rgba(var(--ax-sys-color-dark-surface)))}.ax-popup.ax-popup-full{width:100vw;max-height:calc(100*var(--ax-vh));height:calc(100*var(--ax-vh));border-radius:0!important}.ax-popup.ax-fit{width:fit-content!important}.ax-popup.ax-fit .ax-popup-body-container{max-height:100vh}.ax-popup.ax-fit .ax-popup-body-container>ng-component>div{width:fit-content!important}@media screen and (min-width:320px) and (max-width:640px){.ax-popup.ax-popup-sm,.ax-popup.ax-popup-md,.ax-popup.ax-popup-lg{height:fit-content;width:93vw!important;max-height:calc(var(--ax-overlay-full-width)*var(--ax-vh))!important}:is(.ax-popup.ax-popup-sm,.ax-popup.ax-popup-md,.ax-popup.ax-popup-lg) .ax-popup-body-container>ng-component>div{width:100%}}@media screen and (min-width:768px){.ax-popup.ax-popup-sm{width:55vw!important}.ax-popup.ax-popup-md{width:65vw!important}.ax-popup.ax-popup-lg{width:75vw!important}}@media screen and (min-width:1280px){.ax-popup.ax-popup-sm{width:30vw!important}.ax-popup.ax-popup-md{width:50vw!important}.ax-popup.ax-popup-lg{width:85vw!important}}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}\n/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { 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: "component", type: AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["closeAll", "icon"] }, { kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
251
157
|
}
|
|
252
158
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupComponent, decorators: [{
|
|
253
159
|
type: Component,
|
|
254
160
|
args: [{ selector: 'ax-popup', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
|
255
161
|
{ provide: AXClosableComponent, useExisting: AXPopupComponent },
|
|
256
162
|
{ provide: AXComponent, useExisting: AXPopupComponent },
|
|
257
|
-
], imports: [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}], onDragMove: [{
|
|
268
|
-
type: HostListener,
|
|
269
|
-
args: ['document:mousemove', ['$event']]
|
|
270
|
-
}], onDragEnd: [{
|
|
163
|
+
], imports: [
|
|
164
|
+
CdkTrapFocus,
|
|
165
|
+
CdkDrag,
|
|
166
|
+
CdkDragHandle,
|
|
167
|
+
AXDecoratorCloseButtonComponent,
|
|
168
|
+
CdkPortalOutlet,
|
|
169
|
+
AsyncPipe,
|
|
170
|
+
AXTranslatorPipe,
|
|
171
|
+
], template: "<div class=\"ax-popup-wrapper\" aria-modal=\"true\" [cdkTrapFocus]=\"true\">\n <div class=\"ax-popup ax-popup-{{ data.size }}\" tabindex=\"0\" cdkDrag [cdkDragDisabled]=\"!data.draggable\">\n <div cdkDragHandle class=\"ax-popup-header-container\">\n @if (data.header) {\n <div class=\"ax-popup-header\">\n <span class=\"ax-popup-title\">{{ data.title | translate | async }}</span>\n @if (data.closeButton) {\n <ax-close-button tabindex=\"1\"></ax-close-button>\n }\n </div>\n }\n </div>\n <div class=\"ax-popup-main-container ax-loading-container\">\n <div class=\"ax-popup-body-container\">\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n </div>\n <div class=\"ax-popup-footer-container\"></div>\n </div>\n </div>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-outline-style:solid;--tw-font-weight:initial;--tw-leading:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer components{.ax-popup:where(.dark,.dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}.ax-popup{max-height:calc(var(--ax-overlay-full-width)*var(--ax-vh));--ax-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--ax-shadow-colored:0 10px 15px -3px var(--ax-shadow-color),0 4px 6px -4px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow,0 0 #0000),var(--ax-ring-shadow,0 0 #0000),var(--ax-shadow)}.ax-popup .ax-popup-header-container{background-color:var(--color-lighter,rgba(var(--ax-sys-color-lighter-surface)))}.ax-popup .ax-popup-header-container:where(.dark,.dark *){background-color:var(--color-dark,rgba(var(--ax-sys-color-dark-surface)))}.ax-popup .ax-popup-header-container .ax-popup-header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-border-lighter,rgba(var(--ax-sys-color-border-lighter-surface)));padding:calc(var(--spacing,.25rem)*3);justify-content:space-between;align-items:center;display:flex}.ax-popup .ax-popup-header-container .ax-popup-header:where(.dark,.dark *){border-color:var(--color-border-dark,rgba(var(--ax-sys-color-border-dark-surface)))}.ax-popup .ax-popup-header-container .ax-popup-header .ax-popup-title{font-size:var(--text-base,1rem);line-height:var(--tw-leading,var(--text-base--line-height, 1.5 ));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}@media (min-width:48rem){.ax-popup .ax-popup-header-container .ax-popup-header .ax-popup-title{font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75/1.125)));--tw-leading:calc(var(--spacing,.25rem)*7);line-height:calc(var(--spacing,.25rem)*7)}}.ax-popup ax-footer{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-border-lighter,rgba(var(--ax-sys-color-border-lighter-surface)));background-color:var(--color-lighter,rgba(var(--ax-sys-color-lighter-surface)));padding:calc(var(--spacing,.25rem)*3);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);justify-content:space-between;align-items:center;display:flex}.ax-popup ax-footer:where(.dark,.dark *){border-color:var(--color-border-dark,rgba(var(--ax-sys-color-border-dark-surface)));background-color:var(--color-dark,rgba(var(--ax-sys-color-dark-surface)))}.ax-popup:focus{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:#0000}.ax-popup:focus-visible{border-color:var(--color-primary,rgba(var(--ax-sys-color-primary-surface)))}.ax-popup .ax-popup-main-container{flex-direction:column;flex:1;display:flex;overflow:hidden}.ax-popup .ax-popup-main-container .ax-popup-body-container{background-color:var(--color-lightest,rgba(var(--ax-sys-color-lightest-surface)));flex:1;overflow:auto}.ax-popup .ax-popup-main-container .ax-popup-body-container:where(.dark,.dark *){background-color:var(--color-darkest,rgba(var(--ax-sys-color-darkest-surface)))}.ax-popup .ax-popup-main-container .ax-popup-footer-container{background-color:var(--color-lighter,rgba(var(--ax-sys-color-lighter-surface)))}.ax-popup .ax-popup-main-container .ax-popup-footer-container:where(.dark,.dark *){background-color:var(--color-dark,rgba(var(--ax-sys-color-dark-surface)))}.ax-popup.ax-popup-full{width:100vw;max-height:calc(100*var(--ax-vh));height:calc(100*var(--ax-vh));border-radius:0!important}.ax-popup.ax-fit{width:fit-content!important}.ax-popup.ax-fit .ax-popup-body-container{max-height:100vh}.ax-popup.ax-fit .ax-popup-body-container>ng-component>div{width:fit-content!important}@media screen and (min-width:320px) and (max-width:640px){.ax-popup.ax-popup-sm,.ax-popup.ax-popup-md,.ax-popup.ax-popup-lg{height:fit-content;width:93vw!important;max-height:calc(var(--ax-overlay-full-width)*var(--ax-vh))!important}:is(.ax-popup.ax-popup-sm,.ax-popup.ax-popup-md,.ax-popup.ax-popup-lg) .ax-popup-body-container>ng-component>div{width:100%}}@media screen and (min-width:768px){.ax-popup.ax-popup-sm{width:55vw!important}.ax-popup.ax-popup-md{width:65vw!important}.ax-popup.ax-popup-lg{width:75vw!important}}@media screen and (min-width:1280px){.ax-popup.ax-popup-sm{width:30vw!important}.ax-popup.ax-popup-md{width:50vw!important}.ax-popup.ax-popup-lg{width:85vw!important}}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}\n/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n"] }]
|
|
172
|
+
}], propDecorators: { onKeydownHandler: [{
|
|
271
173
|
type: HostListener,
|
|
272
|
-
args: ['
|
|
174
|
+
args: ['keydown.escape', ['$event']]
|
|
273
175
|
}] } });
|
|
274
176
|
|
|
275
|
-
class AXPopupComponentBase {
|
|
276
|
-
constructor() {
|
|
277
|
-
this.__popup__ = input(...(ngDevMode ? [undefined, { debugName: "__popup__" }] : []));
|
|
278
|
-
}
|
|
279
|
-
close(data = null) {
|
|
280
|
-
this.__popup__().close(data);
|
|
281
|
-
}
|
|
282
|
-
setTitle(title) {
|
|
283
|
-
this.__popup__().setTitle(title);
|
|
284
|
-
}
|
|
285
|
-
bringToFront() {
|
|
286
|
-
this.__popup__().bringToFront();
|
|
287
|
-
}
|
|
288
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupComponentBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
289
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.15", type: AXPopupComponentBase, isStandalone: true, inputs: { __popup__: { classPropertyName: "__popup__", publicName: "__popup__", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
290
|
-
}
|
|
291
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupComponentBase, decorators: [{
|
|
292
|
-
type: Directive
|
|
293
|
-
}], propDecorators: { __popup__: [{ type: i0.Input, args: [{ isSignal: true, alias: "__popup__", required: false }] }] } });
|
|
294
|
-
|
|
295
177
|
/**
|
|
296
178
|
* This is a service which you can create popup with it
|
|
297
179
|
*
|
|
@@ -299,9 +181,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
299
181
|
*/
|
|
300
182
|
class AXPopupService {
|
|
301
183
|
constructor() {
|
|
302
|
-
this.
|
|
303
|
-
this
|
|
184
|
+
this.dialog = inject(Dialog);
|
|
185
|
+
this.#platform = inject(AXPlatform);
|
|
304
186
|
}
|
|
187
|
+
#platform;
|
|
305
188
|
/**
|
|
306
189
|
* @ignore
|
|
307
190
|
*/
|
|
@@ -322,133 +205,60 @@ class AXPopupService {
|
|
|
322
205
|
else {
|
|
323
206
|
config = Object.assign(config, arg2);
|
|
324
207
|
}
|
|
208
|
+
const dialogRef = this.dialog.open(AXPopupComponent, {
|
|
209
|
+
data: Object.assign(config, { content: arg1 }),
|
|
210
|
+
autoFocus: true,
|
|
211
|
+
restoreFocus: true,
|
|
212
|
+
closeOnNavigation: true,
|
|
213
|
+
closeOnDestroy: true,
|
|
214
|
+
hasBackdrop: config.hasBackdrop,
|
|
215
|
+
backdropClass: config.backdropClass,
|
|
216
|
+
disableClose: config.closeOnBackdropClick ? false : true,
|
|
217
|
+
viewContainerRef: config.viewContainerRef,
|
|
218
|
+
providers: config.providers,
|
|
219
|
+
panelClass: config.panelClass ? config.panelClass : [this.#platform.isDark() ? 'dark' : ''],
|
|
220
|
+
direction: config.direction ? config.direction : AXHtmlUtil.isRtl() ? 'rtl' : 'ltr',
|
|
221
|
+
});
|
|
325
222
|
const promise = new AXComponentClosedPromise((resolve) => {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
});
|
|
223
|
+
dialogRef.closed.subscribe((d) => {
|
|
224
|
+
if (resolve) {
|
|
225
|
+
resolve({
|
|
226
|
+
sender: d?.component,
|
|
227
|
+
data: d?.data,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
335
230
|
});
|
|
336
231
|
});
|
|
337
232
|
return promise;
|
|
338
233
|
}
|
|
339
|
-
/**
|
|
340
|
-
* Opens a popup with the specified content and configuration.
|
|
341
|
-
* @param content - Component or template to display
|
|
342
|
-
* @param config - Configuration options for the popup
|
|
343
|
-
* @returns Promise<AXPopupRef> - Reference to the opened popup
|
|
344
|
-
*/
|
|
345
|
-
async openInternal(content, config) {
|
|
346
|
-
const randomId = Math.floor(Math.random() * 100000000000);
|
|
347
|
-
const onClose = new Subject();
|
|
348
|
-
const returnRef = {
|
|
349
|
-
close: (data) => {
|
|
350
|
-
this.close(randomId, data);
|
|
351
|
-
},
|
|
352
|
-
setInputs: (values) => {
|
|
353
|
-
this.setInputs(randomId, values);
|
|
354
|
-
},
|
|
355
|
-
setTitle: (title) => {
|
|
356
|
-
this.setTitle(randomId, title);
|
|
357
|
-
},
|
|
358
|
-
bringToFront: () => {
|
|
359
|
-
this.bringToFront(randomId);
|
|
360
|
-
},
|
|
361
|
-
onClose,
|
|
362
|
-
};
|
|
363
|
-
// Build panel classes
|
|
364
|
-
const panelClasses = ['ax-popup-overlay'];
|
|
365
|
-
if (config.panelClass) {
|
|
366
|
-
panelClasses.push(...config.panelClass);
|
|
367
|
-
}
|
|
368
|
-
const ref = await this.overlayService.create(AXPopupComponent, {
|
|
369
|
-
backdrop: {
|
|
370
|
-
enabled: config.hasBackdrop ?? true,
|
|
371
|
-
background: true,
|
|
372
|
-
closeOnClick: config.closeOnBackdropClick ?? false,
|
|
373
|
-
},
|
|
374
|
-
panelClass: panelClasses,
|
|
375
|
-
inputs: {
|
|
376
|
-
__content__: content,
|
|
377
|
-
__config__: config,
|
|
378
|
-
__popupRef__: returnRef,
|
|
379
|
-
__id__: randomId,
|
|
380
|
-
},
|
|
381
|
-
});
|
|
382
|
-
this.popupList.set(randomId, { overlay: ref, popup: returnRef });
|
|
383
|
-
return returnRef;
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Closes a popup by its ID.
|
|
387
|
-
* @param id - The popup ID to close
|
|
388
|
-
* @param data - Optional data to pass to the close event
|
|
389
|
-
*/
|
|
390
|
-
close(id, data) {
|
|
391
|
-
const ref = this.popupList.get(id);
|
|
392
|
-
if (!ref)
|
|
393
|
-
return;
|
|
394
|
-
ref.popup.onClose.next(data);
|
|
395
|
-
ref.popup.onClose.complete();
|
|
396
|
-
ref.overlay.dispose();
|
|
397
|
-
this.popupList.delete(id);
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Sets input values for a popup by its ID.
|
|
401
|
-
* @param id - The popup ID
|
|
402
|
-
* @param values - Object containing input values to set
|
|
403
|
-
*/
|
|
404
|
-
setInputs(id, values) {
|
|
405
|
-
const ref = this.popupList.get(id)?.overlay.instance;
|
|
406
|
-
if (!ref)
|
|
407
|
-
return;
|
|
408
|
-
if (ref instanceof ComponentRef) {
|
|
409
|
-
const componentInstance = ref.instance;
|
|
410
|
-
componentInstance.setContentInputs(values);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Sets the title for a popup by its ID.
|
|
415
|
-
* @param id - The popup ID
|
|
416
|
-
* @param title - The new title
|
|
417
|
-
*/
|
|
418
|
-
setTitle(id, title) {
|
|
419
|
-
const ref = this.popupList.get(id)?.overlay.instance;
|
|
420
|
-
if (!ref)
|
|
421
|
-
return;
|
|
422
|
-
if (ref instanceof ComponentRef) {
|
|
423
|
-
const componentInstance = ref.instance;
|
|
424
|
-
componentInstance.setTitle(title);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Brings a popup to the front of all other overlays.
|
|
429
|
-
* @param id - The popup ID to bring to front
|
|
430
|
-
*/
|
|
431
|
-
bringToFront(id) {
|
|
432
|
-
const ref = this.popupList.get(id);
|
|
433
|
-
if (!ref)
|
|
434
|
-
return;
|
|
435
|
-
ref.overlay.bringToFront();
|
|
436
|
-
}
|
|
437
234
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
438
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupService
|
|
235
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupService }); }
|
|
439
236
|
}
|
|
440
237
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupService, decorators: [{
|
|
441
|
-
type: Injectable
|
|
442
|
-
args: [{
|
|
443
|
-
providedIn: 'root',
|
|
444
|
-
}]
|
|
238
|
+
type: Injectable
|
|
445
239
|
}] });
|
|
446
240
|
|
|
447
241
|
const COMPONENT = [AXPopupComponent];
|
|
448
|
-
const MODULES = [
|
|
242
|
+
const MODULES = [
|
|
243
|
+
CommonModule,
|
|
244
|
+
AXCommonModule,
|
|
245
|
+
DragDropModule,
|
|
246
|
+
A11yModule,
|
|
247
|
+
PortalModule,
|
|
248
|
+
AXDecoratorModule,
|
|
249
|
+
DialogModule,
|
|
250
|
+
AXTranslationModule,
|
|
251
|
+
];
|
|
449
252
|
class AXPopupModule {
|
|
450
253
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
451
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXPopupModule, imports: [CommonModule,
|
|
254
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXPopupModule, imports: [CommonModule,
|
|
255
|
+
AXCommonModule,
|
|
256
|
+
DragDropModule,
|
|
257
|
+
A11yModule,
|
|
258
|
+
PortalModule,
|
|
259
|
+
AXDecoratorModule,
|
|
260
|
+
DialogModule,
|
|
261
|
+
AXTranslationModule, AXPopupComponent], exports: [AXPopupComponent] }); }
|
|
452
262
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupModule, providers: [AXPopupService], imports: [MODULES, COMPONENT] }); }
|
|
453
263
|
}
|
|
454
264
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXPopupModule, decorators: [{
|
|
@@ -464,5 +274,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
464
274
|
* Generated bundle index. Do not edit.
|
|
465
275
|
*/
|
|
466
276
|
|
|
467
|
-
export { AXPopupComponent,
|
|
277
|
+
export { AXPopupComponent, AXPopupModule, AXPopupService };
|
|
468
278
|
//# sourceMappingURL=acorex-components-popup.mjs.map
|