@ng-nest/ui 20.1.7 → 20.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-complete/index.d.ts +10 -2
- package/cascade/index.d.ts +2 -1
- package/checkbox/index.d.ts +1 -1
- package/collapse/index.d.ts +0 -3
- package/color-picker/index.d.ts +2 -1
- package/core/index.d.ts +3 -65
- package/date-picker/index.d.ts +20 -4
- package/dialog/index.d.ts +27 -11
- package/drawer/index.d.ts +10 -12
- package/dropdown/index.d.ts +2 -1
- package/fesm2022/ng-nest-ui-affix.mjs +11 -11
- package/fesm2022/ng-nest-ui-alert.mjs +13 -13
- package/fesm2022/ng-nest-ui-alert.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-anchor.mjs +18 -18
- package/fesm2022/ng-nest-ui-anchor.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-api.mjs +7 -7
- package/fesm2022/ng-nest-ui-api.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-attachments.mjs +18 -18
- package/fesm2022/ng-nest-ui-auto-complete.mjs +33 -26
- package/fesm2022/ng-nest-ui-auto-complete.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-avatar.mjs +18 -18
- package/fesm2022/ng-nest-ui-avatar.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-back-top.mjs +12 -12
- package/fesm2022/ng-nest-ui-back-top.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-badge.mjs +13 -13
- package/fesm2022/ng-nest-ui-badge.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-base-form.mjs +8 -8
- package/fesm2022/ng-nest-ui-bubble.mjs +20 -20
- package/fesm2022/ng-nest-ui-bubble.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-button.mjs +19 -19
- package/fesm2022/ng-nest-ui-button.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-calendar.mjs +11 -11
- package/fesm2022/ng-nest-ui-card.mjs +11 -11
- package/fesm2022/ng-nest-ui-carousel.mjs +21 -21
- package/fesm2022/ng-nest-ui-carousel.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-cascade.mjs +27 -25
- package/fesm2022/ng-nest-ui-cascade.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-checkbox.mjs +12 -12
- package/fesm2022/ng-nest-ui-checkbox.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-collapse.mjs +20 -28
- package/fesm2022/ng-nest-ui-collapse.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color-picker.mjs +31 -29
- package/fesm2022/ng-nest-ui-color-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color.mjs +11 -11
- package/fesm2022/ng-nest-ui-color.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-comment.mjs +18 -18
- package/fesm2022/ng-nest-ui-container.mjs +35 -35
- package/fesm2022/ng-nest-ui-container.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-core.mjs +20 -348
- package/fesm2022/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-coversations.mjs +11 -11
- package/fesm2022/ng-nest-ui-crumb.mjs +11 -11
- package/fesm2022/ng-nest-ui-date-picker.mjs +92 -78
- package/fesm2022/ng-nest-ui-date-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-description.mjs +20 -20
- package/fesm2022/ng-nest-ui-description.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dialog.mjs +122 -73
- package/fesm2022/ng-nest-ui-dialog.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-doc.mjs +7 -7
- package/fesm2022/ng-nest-ui-doc.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-drag.mjs +11 -11
- package/fesm2022/ng-nest-ui-drawer.mjs +67 -84
- package/fesm2022/ng-nest-ui-drawer.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dropdown.mjs +27 -25
- package/fesm2022/ng-nest-ui-dropdown.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-empty.mjs +11 -11
- package/fesm2022/ng-nest-ui-examples.mjs +7 -7
- package/fesm2022/ng-nest-ui-examples.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-find.mjs +12 -12
- package/fesm2022/ng-nest-ui-find.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-form.mjs +19 -19
- package/fesm2022/ng-nest-ui-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-highlight.mjs +15 -15
- package/fesm2022/ng-nest-ui-highlight.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-i18n.mjs +14 -14
- package/fesm2022/ng-nest-ui-icon.mjs +14 -14
- package/fesm2022/ng-nest-ui-icon.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-image.mjs +21 -21
- package/fesm2022/ng-nest-ui-image.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-inner.mjs +11 -11
- package/fesm2022/ng-nest-ui-inner.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input-number.mjs +12 -12
- package/fesm2022/ng-nest-ui-input-number.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input.mjs +19 -19
- package/fesm2022/ng-nest-ui-input.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-keyword.mjs +11 -11
- package/fesm2022/ng-nest-ui-keyword.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-layout.mjs +18 -18
- package/fesm2022/ng-nest-ui-layout.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-link.mjs +12 -12
- package/fesm2022/ng-nest-ui-link.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-list.mjs +23 -23
- package/fesm2022/ng-nest-ui-list.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-loading.mjs +12 -12
- package/fesm2022/ng-nest-ui-loading.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-menu.mjs +18 -18
- package/fesm2022/ng-nest-ui-message-box.mjs +33 -20
- package/fesm2022/ng-nest-ui-message-box.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-message.mjs +13 -13
- package/fesm2022/ng-nest-ui-message.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-notification.mjs +13 -13
- package/fesm2022/ng-nest-ui-notification.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-outlet.mjs +8 -8
- package/fesm2022/ng-nest-ui-page-header.mjs +11 -11
- package/fesm2022/ng-nest-ui-pagination.mjs +11 -11
- package/fesm2022/ng-nest-ui-pagination.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-pattern.mjs +7 -7
- package/fesm2022/ng-nest-ui-pattern.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-popconfirm.mjs +11 -11
- package/fesm2022/ng-nest-ui-popover.mjs +25 -21
- package/fesm2022/ng-nest-ui-popover.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-portal.mjs +7 -7
- package/fesm2022/ng-nest-ui-progress.mjs +11 -11
- package/fesm2022/ng-nest-ui-prompts.mjs +11 -11
- package/fesm2022/ng-nest-ui-radio.mjs +12 -12
- package/fesm2022/ng-nest-ui-radio.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-rate.mjs +12 -12
- package/fesm2022/ng-nest-ui-rate.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-resizable.mjs +11 -11
- package/fesm2022/ng-nest-ui-resizable.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-result.mjs +11 -11
- package/fesm2022/ng-nest-ui-ripple.mjs +11 -11
- package/fesm2022/ng-nest-ui-ripple.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-scrollable.mjs +8 -8
- package/fesm2022/ng-nest-ui-scrollable.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-select.mjs +34 -26
- package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-sender.mjs +15 -15
- package/fesm2022/ng-nest-ui-sender.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-skeleton.mjs +11 -11
- package/fesm2022/ng-nest-ui-slider-select.mjs +13 -13
- package/fesm2022/ng-nest-ui-slider-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-slider.mjs +12 -12
- package/fesm2022/ng-nest-ui-slider.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-statistic.mjs +18 -18
- package/fesm2022/ng-nest-ui-steps.mjs +11 -11
- package/fesm2022/ng-nest-ui-suggestion.mjs +11 -11
- package/fesm2022/ng-nest-ui-switch.mjs +12 -12
- package/fesm2022/ng-nest-ui-switch.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-table-view.mjs +60 -60
- package/fesm2022/ng-nest-ui-table-view.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-table.mjs +60 -49
- package/fesm2022/ng-nest-ui-table.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tabs.mjs +30 -30
- package/fesm2022/ng-nest-ui-tabs.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tag.mjs +29 -19
- package/fesm2022/ng-nest-ui-tag.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-text-retract.mjs +11 -11
- package/fesm2022/ng-nest-ui-textarea.mjs +12 -12
- package/fesm2022/ng-nest-ui-textarea.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-theme.mjs +11 -11
- package/fesm2022/ng-nest-ui-thought-chain.mjs +11 -11
- package/fesm2022/ng-nest-ui-time-ago.mjs +7 -7
- package/fesm2022/ng-nest-ui-time-picker.mjs +31 -29
- package/fesm2022/ng-nest-ui-time-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-time-range.mjs +7 -7
- package/fesm2022/ng-nest-ui-timeline.mjs +11 -11
- package/fesm2022/ng-nest-ui-tooltip.mjs +27 -74
- package/fesm2022/ng-nest-ui-tooltip.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-transfer.mjs +12 -12
- package/fesm2022/ng-nest-ui-transfer.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree-file.mjs +11 -11
- package/fesm2022/ng-nest-ui-tree-select.mjs +27 -25
- package/fesm2022/ng-nest-ui-tree-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree.mjs +23 -23
- package/fesm2022/ng-nest-ui-tree.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-typography.mjs +11 -11
- package/fesm2022/ng-nest-ui-upload.mjs +31 -28
- package/fesm2022/ng-nest-ui-upload.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-welcome.mjs +11 -11
- package/message/index.d.ts +1 -3
- package/message-box/index.d.ts +4 -3
- package/notification/index.d.ts +1 -3
- package/package.json +52 -52
- package/popover/index.d.ts +2 -1
- package/radio/index.d.ts +1 -1
- package/select/index.d.ts +11 -2
- package/style/animates/base.scss +32 -0
- package/style/animates/conect.scss +32 -0
- package/style/animates/fade.scss +32 -0
- package/style/animates/index.scss +11 -0
- package/style/animates/move.scss +129 -0
- package/style/animates/opacity.scss +26 -0
- package/style/animates/slide.scss +113 -0
- package/style/core/index.css +353 -0
- package/style/core/index.css.map +1 -1
- package/style/core/index.scss +1 -6
- package/table/index.d.ts +15 -4
- package/table-view/index.d.ts +1 -1
- package/tag/index.d.ts +6 -1
- package/time-picker/index.d.ts +2 -1
- package/tooltip/index.d.ts +2 -12
- package/tree-select/index.d.ts +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, input, model, output, Component, inject, ViewContainerRef, viewChild, signal, computed, DestroyRef, effect, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, HostListener, Directive, Renderer2, ChangeDetectorRef, contentChildren, EventEmitter, NgModule, RendererFactory2, TemplateRef, Injectable } from '@angular/core';
|
|
3
|
-
import { XPropertyFunction, XToCssPixelValue, XToBoolean, XToNumber, XProperty, XConfigService, XIsFunction,
|
|
2
|
+
import { InjectionToken, input, model, output, Component, inject, ViewContainerRef, DOCUMENT, viewChild, signal, computed, DestroyRef, effect, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, HostListener, Directive, Renderer2, ChangeDetectorRef, contentChildren, EventEmitter, NgModule, RendererFactory2, TemplateRef, Injectable } from '@angular/core';
|
|
3
|
+
import { XPropertyFunction, XToCssPixelValue, XToBoolean, XToNumber, XProperty, XConfigService, XIsFunction, XFillDefault } from '@ng-nest/ui/core';
|
|
4
4
|
import { XPortalService, XPortalResizablePrefix } from '@ng-nest/ui/portal';
|
|
5
|
-
import { Subject, filter, take } from 'rxjs';
|
|
5
|
+
import { Subject, fromEvent, filter, take, takeUntil as takeUntil$1 } from 'rxjs';
|
|
6
6
|
import { Overlay } from '@angular/cdk/overlay';
|
|
7
7
|
import { XI18nService, zh_CN } from '@ng-nest/ui/i18n';
|
|
8
8
|
import { map, takeUntil } from 'rxjs/operators';
|
|
@@ -146,6 +146,11 @@ class XDialogProperty extends XPropertyFunction(X_DIALOG_CONFIG_NAME) {
|
|
|
146
146
|
* @en_US Whether to display the background mask
|
|
147
147
|
*/
|
|
148
148
|
this.hasBackdrop = input(this.config?.hasBackdrop ?? true, ...(ngDevMode ? [{ debugName: "hasBackdrop", transform: XToBoolean }] : [{ transform: XToBoolean }]));
|
|
149
|
+
/**
|
|
150
|
+
* @zh_CN 是否支持键盘 esc 关闭
|
|
151
|
+
* @en_US Whether to support keyboard esc to close
|
|
152
|
+
*/
|
|
153
|
+
this.keyboard = input(this.config?.keyboard ?? true, ...(ngDevMode ? [{ debugName: "keyboard", transform: XToBoolean }] : [{ transform: XToBoolean }]));
|
|
149
154
|
/**
|
|
150
155
|
* @zh_CN 自定义样式名
|
|
151
156
|
* @en_US Custom style name
|
|
@@ -197,13 +202,13 @@ class XDialogProperty extends XPropertyFunction(X_DIALOG_CONFIG_NAME) {
|
|
|
197
202
|
*/
|
|
198
203
|
this.closeDone = output();
|
|
199
204
|
}
|
|
200
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
201
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.
|
|
205
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
206
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.5", type: XDialogProperty, isStandalone: true, selector: "x-dialog-property", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, hideClose: { classPropertyName: "hideClose", publicName: "hideClose", isSignal: true, isRequired: false, transformFunction: null }, closeText: { classPropertyName: "closeText", publicName: "closeText", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, offsetLeft: { classPropertyName: "offsetLeft", publicName: "offsetLeft", isSignal: true, isRequired: false, transformFunction: null }, offsetTop: { classPropertyName: "offsetTop", publicName: "offsetTop", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, effect: { classPropertyName: "effect", publicName: "effect", isSignal: true, isRequired: false, transformFunction: null }, footer: { classPropertyName: "footer", publicName: "footer", isSignal: true, isRequired: false, transformFunction: null }, showCancel: { classPropertyName: "showCancel", publicName: "showCancel", isSignal: true, isRequired: false, transformFunction: null }, cancelText: { classPropertyName: "cancelText", publicName: "cancelText", isSignal: true, isRequired: false, transformFunction: null }, showConfirm: { classPropertyName: "showConfirm", publicName: "showConfirm", isSignal: true, isRequired: false, transformFunction: null }, confirmText: { classPropertyName: "confirmText", publicName: "confirmText", isSignal: true, isRequired: false, transformFunction: null }, backdropClose: { classPropertyName: "backdropClose", publicName: "backdropClose", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, keyboard: { classPropertyName: "keyboard", publicName: "keyboard", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, buttonsCenter: { classPropertyName: "buttonsCenter", publicName: "buttonsCenter", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, maximize: { classPropertyName: "maximize", publicName: "maximize", isSignal: true, isRequired: false, transformFunction: null }, beforeClose: { classPropertyName: "beforeClose", publicName: "beforeClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", cancel: "cancel", confirm: "confirm", close: "close", showDone: "showDone", closeDone: "closeDone" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
202
207
|
}
|
|
203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogProperty, decorators: [{
|
|
204
209
|
type: Component,
|
|
205
210
|
args: [{ selector: `${XDialogPrefix}-property`, template: '' }]
|
|
206
|
-
}] });
|
|
211
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], hideClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideClose", required: false }] }], closeText: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeText", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], offsetLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsetLeft", required: false }] }], offsetTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "offsetTop", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], effect: [{ type: i0.Input, args: [{ isSignal: true, alias: "effect", required: false }] }], footer: [{ type: i0.Input, args: [{ isSignal: true, alias: "footer", required: false }] }], showCancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCancel", required: false }] }], cancelText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelText", required: false }] }], showConfirm: [{ type: i0.Input, args: [{ isSignal: true, alias: "showConfirm", required: false }] }], confirmText: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmText", required: false }] }], backdropClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "backdropClose", required: false }] }], hasBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackdrop", required: false }] }], keyboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "keyboard", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], buttonsCenter: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonsCenter", required: false }] }], draggable: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggable", required: false }] }], maximize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maximize", required: false }] }], beforeClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "beforeClose", required: false }] }], cancel: [{ type: i0.Output, args: ["cancel"] }], confirm: [{ type: i0.Output, args: ["confirm"] }], close: [{ type: i0.Output, args: ["close"] }], showDone: [{ type: i0.Output, args: ["showDone"] }], closeDone: [{ type: i0.Output, args: ["closeDone"] }] } });
|
|
207
212
|
/**
|
|
208
213
|
* Dialog Container
|
|
209
214
|
* @selector x-dialog-container
|
|
@@ -215,15 +220,16 @@ const X_DIALOG_CONTAINER = new InjectionToken('X_DIALOG_CONTAINER');
|
|
|
215
220
|
* Dialog Container Property
|
|
216
221
|
*/
|
|
217
222
|
class XDialogContainerProperty extends XProperty {
|
|
218
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
219
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
223
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogContainerProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
224
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.5", type: XDialogContainerProperty, isStandalone: true, selector: "x-dialog-container-property", usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
220
225
|
}
|
|
221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogContainerProperty, decorators: [{
|
|
222
227
|
type: Component,
|
|
223
228
|
args: [{ selector: `${XDialogContainerPrefix}-property`, template: '' }]
|
|
224
229
|
}] });
|
|
225
230
|
|
|
226
231
|
class XDialogComponent extends XDialogProperty {
|
|
232
|
+
static { this.dialogOverlayRefs = []; }
|
|
227
233
|
get getVisible() {
|
|
228
234
|
return this.visible();
|
|
229
235
|
}
|
|
@@ -234,6 +240,7 @@ class XDialogComponent extends XDialogProperty {
|
|
|
234
240
|
this.overlay = inject(Overlay);
|
|
235
241
|
this.i18n = inject(XI18nService);
|
|
236
242
|
this.unSubject = new Subject();
|
|
243
|
+
this.document = inject(DOCUMENT);
|
|
237
244
|
this.clsName = `${XDialogPrefix}-${this.placement()}`;
|
|
238
245
|
this.dialogTpl = viewChild.required('dialogTpl');
|
|
239
246
|
this.locale = toSignal(this.i18n.localeChange.pipe(map((x) => x.dialog)), { initialValue: zh_CN.dialog });
|
|
@@ -256,6 +263,7 @@ class XDialogComponent extends XDialogProperty {
|
|
|
256
263
|
return this.confirmText() || this.locale().confirmText;
|
|
257
264
|
}, ...(ngDevMode ? [{ debugName: "getConfirmText" }] : []));
|
|
258
265
|
this.getStyle = computed(() => {
|
|
266
|
+
console.log(this.protalService.setContainerStyle(this.placement(), this.offset()));
|
|
259
267
|
return this.container
|
|
260
268
|
? {
|
|
261
269
|
...this.protalService.setContainerStyle(this.placement(), this.offset()),
|
|
@@ -288,6 +296,7 @@ class XDialogComponent extends XDialogProperty {
|
|
|
288
296
|
this.destroyRef.onDestroy(() => {
|
|
289
297
|
this.destroy.set(true);
|
|
290
298
|
this.backdropClick$?.unsubscribe();
|
|
299
|
+
this.keyboard$?.unsubscribe();
|
|
291
300
|
this.unSubject.next();
|
|
292
301
|
this.unSubject.complete();
|
|
293
302
|
});
|
|
@@ -333,8 +342,22 @@ class XDialogComponent extends XDialogProperty {
|
|
|
333
342
|
minWidth: this.minWidth(),
|
|
334
343
|
minHeight: this.minHeight()
|
|
335
344
|
});
|
|
345
|
+
XDialogComponent.dialogOverlayRefs.push(this.dialogRef);
|
|
336
346
|
if (this.hasBackdrop() && this.backdropClose() && this.dialogRef?.overlayRef) {
|
|
337
|
-
this.backdropClick$ = this.dialogRef.overlayRef.backdropClick().subscribe(() =>
|
|
347
|
+
this.backdropClick$ = this.dialogRef.overlayRef.backdropClick().subscribe(() => {
|
|
348
|
+
this.onClose('close');
|
|
349
|
+
this.keyboard$?.unsubscribe();
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
if (this.keyboard()) {
|
|
353
|
+
this.keyboard$ = fromEvent(this.document, 'keydown').subscribe((event) => {
|
|
354
|
+
if (event.key === 'Escape' || event.keyCode === 27) {
|
|
355
|
+
if (XDialogComponent.dialogOverlayRefs[XDialogComponent.dialogOverlayRefs.length - 1] === this.dialogRef) {
|
|
356
|
+
this.onClose('close');
|
|
357
|
+
this.keyboard$?.unsubscribe();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
});
|
|
338
361
|
}
|
|
339
362
|
}
|
|
340
363
|
setWidthHeight() {
|
|
@@ -419,7 +442,7 @@ class XDialogComponent extends XDialogProperty {
|
|
|
419
442
|
}
|
|
420
443
|
}
|
|
421
444
|
moveDone($event) {
|
|
422
|
-
if ($event.
|
|
445
|
+
if ($event.animationName.endsWith('-leave')) {
|
|
423
446
|
!this.destroy() && this.closeDone.emit($event);
|
|
424
447
|
this.isMaximize.set(false);
|
|
425
448
|
this.dialogBox = {
|
|
@@ -432,34 +455,34 @@ class XDialogComponent extends XDialogProperty {
|
|
|
432
455
|
!this.destroy() && this.showDone.emit($event);
|
|
433
456
|
}
|
|
434
457
|
}
|
|
435
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
436
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
458
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
459
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.5", type: XDialogComponent, isStandalone: true, selector: "x-dialog", host: { properties: { "class.x-dialog-visible": "this.getVisible", "class": "this.clsName" } }, viewQueries: [{ propertyName: "dialogTpl", first: true, predicate: ["dialogTpl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #dialogTpl>\r\n @if (visible()) {\r\n @if (container && hasBackdrop()) {\r\n <div\r\n class=\"x-dialog-backdrop\"\r\n animate.enter=\"x-opacity-enter\"\r\n animate.leave=\"x-opacity-leave\"\r\n (click)=\"onClose('close')\"\r\n ></div>\r\n }\r\n <div\r\n class=\"x-dialog\"\r\n [animate.enter]=\"`x-move-${placement()}-enter`\"\r\n [animate.leave]=\"`x-move-${placement()}-leave`\"\r\n (animationend)=\"moveDone($event)\"\r\n [class.x-dialog-maximize]=\"isMaximize()\"\r\n [class.x-dialog-default-maximize]=\"isDefaultMaximize()\"\r\n [ngStyle]=\"getStyle()\"\r\n >\r\n <x-alert\r\n [draggable]=\"draggableSignal() && dialogBox['draggable']\"\r\n [dragFreeDragPosition]=\"dialogBox['distance']\"\r\n [minWidth]=\"dialogBox['minWidth']\"\r\n [minHeight]=\"dialogBox['minHeight']\"\r\n [dragBoundary]=\"'.cdk-overlay-container'\"\r\n [title]=\"title()\"\r\n [content]=\"contentTpl\"\r\n [type]=\"type()\"\r\n [effect]=\"effect()\"\r\n [hideClose]=\"hideClose()\"\r\n [closeText]=\"closeText()\"\r\n [operationTpl]=\"operationTpl\"\r\n (close)=\"onClose('close')\"\r\n (dragEnded)=\"onDragEnded($event)\"\r\n [showIcon]=\"false\"\r\n [duration]=\"0\"\r\n manual\r\n disabledAnimation\r\n ></x-alert>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #contentTpl>\r\n <div class=\"x-dialog-inner\">\r\n <div class=\"x-dialog-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n <div class=\"x-dialog-buttons\" [class.x-dialog-buttons-center]=\"buttonsCenter()\">\r\n <ng-container *xOutlet=\"footer()\">\r\n @if (showCancel() || showConfirm()) {\r\n <x-buttons space=\"0.5rem\">\r\n @if (showCancel()) {\r\n <x-button class=\"x-dialog-cancel\" (click)=\"onClose('cancel')\" flat plain>{{ getCancelText() }}</x-button>\r\n }\r\n @if (showConfirm()) {\r\n <x-button class=\"x-dialog-confirm\" type=\"primary\" flat (click)=\"onClose('confirm')\">{{\r\n getConfirmText()\r\n }}</x-button>\r\n }\r\n </x-buttons>\r\n }\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #operationTpl>\r\n @if (maximizeSignal()) {\r\n <x-button\r\n size=\"small\"\r\n flat\r\n [icon]=\"isMaximize() ? 'fto-minimize' : 'fto-maximize'\"\r\n [onlyIcon]=\"true\"\r\n (click)=\"onSize()\"\r\n class=\"x-dialog-maximize\"\r\n ></x-button>\r\n }\r\n</ng-template>\r\n\r\n@if (container) {\r\n <ng-container *ngTemplateOutlet=\"dialogTpl\"></ng-container>\r\n}\r\n", styles: [".x-dialog{margin:0;padding:0}.x-dialog{width:100%;height:100%}.x-dialog>x-alert{height:100%}.x-dialog>x-alert .x-alert{min-height:100%;height:fit-content;align-items:inherit;padding:0}.x-dialog>x-alert .x-alert-inner{min-height:100%;display:flex;flex-direction:column}.x-dialog>x-alert .x-alert-title{padding:1rem 1rem 0}.x-dialog>x-alert .x-alert-content{flex:1;display:flex;flex-direction:column;padding:0 1rem .5rem}.x-dialog-inner{display:flex;flex-direction:column;margin:.5rem 0;flex:1}.x-dialog-buttons{display:flex;justify-content:flex-end}.x-dialog-buttons>x-buttons{margin-top:1rem;align-self:flex-end}.x-dialog-buttons-center{justify-content:center}.x-dialog-content{display:inline-flex;flex-direction:column;flex:1;max-height:70vh;overflow:auto;min-height:2rem}.x-dialog-maximize>x-alert .x-alert{left:0!important;top:0!important;border-radius:0!important}.x-dialog-maximize .x-dialog-content{max-height:calc(100vh - 7.875rem)!important;height:calc(100vh - 7.875rem)!important}.x-dialog-default-maximize .x-dialog-content{max-height:calc(100vh - 7.875rem)!important;height:calc(100vh - 7.875rem)!important;flex:initial}.x-dialog-default-maximize>x-alert .x-alert{left:0!important;top:0!important;border-radius:0!important}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: XAlertComponent, selector: "x-alert" }, { kind: "component", type: XButtonComponent, selector: "x-button" }, { kind: "component", type: XButtonsComponent, selector: "x-buttons" }, { kind: "directive", type: XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
437
460
|
}
|
|
438
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogComponent, decorators: [{
|
|
439
462
|
type: Component,
|
|
440
|
-
args: [{ selector: `${XDialogPrefix}`, imports: [NgStyle, NgTemplateOutlet, XAlertComponent, XButtonComponent, XButtonsComponent, XOutletDirective], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
463
|
+
args: [{ selector: `${XDialogPrefix}`, imports: [NgStyle, NgTemplateOutlet, XAlertComponent, XButtonComponent, XButtonsComponent, XOutletDirective], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #dialogTpl>\r\n @if (visible()) {\r\n @if (container && hasBackdrop()) {\r\n <div\r\n class=\"x-dialog-backdrop\"\r\n animate.enter=\"x-opacity-enter\"\r\n animate.leave=\"x-opacity-leave\"\r\n (click)=\"onClose('close')\"\r\n ></div>\r\n }\r\n <div\r\n class=\"x-dialog\"\r\n [animate.enter]=\"`x-move-${placement()}-enter`\"\r\n [animate.leave]=\"`x-move-${placement()}-leave`\"\r\n (animationend)=\"moveDone($event)\"\r\n [class.x-dialog-maximize]=\"isMaximize()\"\r\n [class.x-dialog-default-maximize]=\"isDefaultMaximize()\"\r\n [ngStyle]=\"getStyle()\"\r\n >\r\n <x-alert\r\n [draggable]=\"draggableSignal() && dialogBox['draggable']\"\r\n [dragFreeDragPosition]=\"dialogBox['distance']\"\r\n [minWidth]=\"dialogBox['minWidth']\"\r\n [minHeight]=\"dialogBox['minHeight']\"\r\n [dragBoundary]=\"'.cdk-overlay-container'\"\r\n [title]=\"title()\"\r\n [content]=\"contentTpl\"\r\n [type]=\"type()\"\r\n [effect]=\"effect()\"\r\n [hideClose]=\"hideClose()\"\r\n [closeText]=\"closeText()\"\r\n [operationTpl]=\"operationTpl\"\r\n (close)=\"onClose('close')\"\r\n (dragEnded)=\"onDragEnded($event)\"\r\n [showIcon]=\"false\"\r\n [duration]=\"0\"\r\n manual\r\n disabledAnimation\r\n ></x-alert>\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #contentTpl>\r\n <div class=\"x-dialog-inner\">\r\n <div class=\"x-dialog-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n <div class=\"x-dialog-buttons\" [class.x-dialog-buttons-center]=\"buttonsCenter()\">\r\n <ng-container *xOutlet=\"footer()\">\r\n @if (showCancel() || showConfirm()) {\r\n <x-buttons space=\"0.5rem\">\r\n @if (showCancel()) {\r\n <x-button class=\"x-dialog-cancel\" (click)=\"onClose('cancel')\" flat plain>{{ getCancelText() }}</x-button>\r\n }\r\n @if (showConfirm()) {\r\n <x-button class=\"x-dialog-confirm\" type=\"primary\" flat (click)=\"onClose('confirm')\">{{\r\n getConfirmText()\r\n }}</x-button>\r\n }\r\n </x-buttons>\r\n }\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #operationTpl>\r\n @if (maximizeSignal()) {\r\n <x-button\r\n size=\"small\"\r\n flat\r\n [icon]=\"isMaximize() ? 'fto-minimize' : 'fto-maximize'\"\r\n [onlyIcon]=\"true\"\r\n (click)=\"onSize()\"\r\n class=\"x-dialog-maximize\"\r\n ></x-button>\r\n }\r\n</ng-template>\r\n\r\n@if (container) {\r\n <ng-container *ngTemplateOutlet=\"dialogTpl\"></ng-container>\r\n}\r\n", styles: [".x-dialog{margin:0;padding:0}.x-dialog{width:100%;height:100%}.x-dialog>x-alert{height:100%}.x-dialog>x-alert .x-alert{min-height:100%;height:fit-content;align-items:inherit;padding:0}.x-dialog>x-alert .x-alert-inner{min-height:100%;display:flex;flex-direction:column}.x-dialog>x-alert .x-alert-title{padding:1rem 1rem 0}.x-dialog>x-alert .x-alert-content{flex:1;display:flex;flex-direction:column;padding:0 1rem .5rem}.x-dialog-inner{display:flex;flex-direction:column;margin:.5rem 0;flex:1}.x-dialog-buttons{display:flex;justify-content:flex-end}.x-dialog-buttons>x-buttons{margin-top:1rem;align-self:flex-end}.x-dialog-buttons-center{justify-content:center}.x-dialog-content{display:inline-flex;flex-direction:column;flex:1;max-height:70vh;overflow:auto;min-height:2rem}.x-dialog-maximize>x-alert .x-alert{left:0!important;top:0!important;border-radius:0!important}.x-dialog-maximize .x-dialog-content{max-height:calc(100vh - 7.875rem)!important;height:calc(100vh - 7.875rem)!important}.x-dialog-default-maximize .x-dialog-content{max-height:calc(100vh - 7.875rem)!important;height:calc(100vh - 7.875rem)!important;flex:initial}.x-dialog-default-maximize>x-alert .x-alert{left:0!important;top:0!important;border-radius:0!important}\n"] }]
|
|
441
464
|
}], ctorParameters: () => [], propDecorators: { getVisible: [{
|
|
442
465
|
type: HostBinding,
|
|
443
466
|
args: ['class.x-dialog-visible']
|
|
444
467
|
}], clsName: [{
|
|
445
468
|
type: HostBinding,
|
|
446
469
|
args: ['class']
|
|
447
|
-
}] } });
|
|
470
|
+
}], dialogTpl: [{ type: i0.ViewChild, args: ['dialogTpl', { isSignal: true }] }] } });
|
|
448
471
|
|
|
449
472
|
class XDialogContainerComponent extends XDialogContainerProperty {
|
|
450
473
|
constructor() {
|
|
451
474
|
super(...arguments);
|
|
452
475
|
this._has = true;
|
|
453
476
|
}
|
|
454
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
455
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.
|
|
477
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogContainerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
478
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.5", type: XDialogContainerComponent, isStandalone: true, selector: "x-dialog-container", host: { properties: { "class.x-dialog-container": "this._has" } }, providers: [
|
|
456
479
|
{
|
|
457
480
|
provide: X_DIALOG_CONTAINER,
|
|
458
481
|
useExisting: XDialogContainerComponent
|
|
459
482
|
}
|
|
460
483
|
], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [".x-dialog-container{margin:0;padding:0}.x-dialog-container{position:relative;z-index:1;box-sizing:border-box;display:block;overflow:hidden}.x-dialog-container x-dialog{display:flex;position:absolute;width:100%;height:100%;z-index:-1;transition:z-index .4s;top:0;left:0}.x-dialog-container .x-dialog{position:absolute;display:block;outline:0;z-index:1001;width:initial;height:initial}.x-dialog-container .x-dialog-top,.x-dialog-container .x-dialog-bottom{justify-content:center}.x-dialog-container .x-dialog-center{justify-content:center;align-items:center}.x-dialog-container .x-dialog-left,.x-dialog-container .x-dialog-right{align-items:center}.x-dialog-container .x-dialog-visible{display:flex;z-index:1000}.x-dialog-container .x-dialog-backdrop{position:absolute;inset:0;z-index:1000;pointer-events:auto;background:#00000052}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
461
484
|
}
|
|
462
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
485
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogContainerComponent, decorators: [{
|
|
463
486
|
type: Component,
|
|
464
487
|
args: [{ selector: 'x-dialog-container', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
465
488
|
{
|
|
@@ -482,16 +505,19 @@ class XDialogRef {
|
|
|
482
505
|
this.fullscreen = false;
|
|
483
506
|
this.dragHandleRefs = [];
|
|
484
507
|
this.afterClose = new Subject();
|
|
508
|
+
this.unsubject = new Subject();
|
|
485
509
|
this._isFristFullscreen = true;
|
|
486
510
|
}
|
|
487
511
|
close(result) {
|
|
488
512
|
this.containerInstance.animationChanged
|
|
489
|
-
.pipe(filter((event) => event.
|
|
513
|
+
.pipe(filter((event) => event.animationName.endsWith('-leave') && event.action === 'end'), take(1))
|
|
490
514
|
.subscribe(() => {
|
|
491
515
|
this.overlayRef.dispose();
|
|
492
516
|
this.afterClose.next(result);
|
|
493
517
|
});
|
|
494
|
-
this.
|
|
518
|
+
this.overlayRef.detach();
|
|
519
|
+
this.unsubject.next();
|
|
520
|
+
this.unsubject.complete();
|
|
495
521
|
}
|
|
496
522
|
onFullscreen() {
|
|
497
523
|
let { dialogBox, dialogRef, overlayElement, distance, hostElement, defaultMaximize } = this.containerInstance;
|
|
@@ -577,10 +603,10 @@ class XDialogCloseDirective {
|
|
|
577
603
|
onCloseClick() {
|
|
578
604
|
this.dialogRef && this.dialogRef.close();
|
|
579
605
|
}
|
|
580
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
581
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
606
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogCloseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
607
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.5", type: XDialogCloseDirective, isStandalone: true, selector: "[x-dialog-close]", host: { listeners: { "click": "onCloseClick($event)" } }, ngImport: i0 }); }
|
|
582
608
|
}
|
|
583
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
609
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogCloseDirective, decorators: [{
|
|
584
610
|
type: Directive,
|
|
585
611
|
args: [{
|
|
586
612
|
selector: `[x-dialog-close]`
|
|
@@ -593,10 +619,10 @@ class XDialogTitleDirective {
|
|
|
593
619
|
constructor() {
|
|
594
620
|
this._has = true;
|
|
595
621
|
}
|
|
596
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
597
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
622
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
623
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.5", type: XDialogTitleDirective, isStandalone: true, selector: "[x-dialog-title], x-dialog-title", host: { properties: { "class.x-dialog-portal-title": "this._has" } }, ngImport: i0 }); }
|
|
598
624
|
}
|
|
599
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
625
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogTitleDirective, decorators: [{
|
|
600
626
|
type: Directive,
|
|
601
627
|
args: [{
|
|
602
628
|
selector: `[x-dialog-title], x-dialog-title`
|
|
@@ -609,10 +635,10 @@ class XDialogContentDirective {
|
|
|
609
635
|
constructor() {
|
|
610
636
|
this._has = true;
|
|
611
637
|
}
|
|
612
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
613
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
638
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
639
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.5", type: XDialogContentDirective, isStandalone: true, selector: "[x-dialog-content], x-dialog-content", host: { properties: { "class.x-dialog-portal-content": "this._has" } }, ngImport: i0 }); }
|
|
614
640
|
}
|
|
615
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogContentDirective, decorators: [{
|
|
616
642
|
type: Directive,
|
|
617
643
|
args: [{
|
|
618
644
|
selector: `[x-dialog-content], x-dialog-content`
|
|
@@ -625,10 +651,10 @@ class XDialogActionsDirective {
|
|
|
625
651
|
constructor() {
|
|
626
652
|
this._has = true;
|
|
627
653
|
}
|
|
628
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
629
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
654
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
655
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.5", type: XDialogActionsDirective, isStandalone: true, selector: "[x-dialog-actions], x-dialog-actions", host: { properties: { "class.x-dialog-portal-actions": "this._has" } }, ngImport: i0 }); }
|
|
630
656
|
}
|
|
631
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogActionsDirective, decorators: [{
|
|
632
658
|
type: Directive,
|
|
633
659
|
args: [{
|
|
634
660
|
selector: `[x-dialog-actions], x-dialog-actions`
|
|
@@ -644,10 +670,10 @@ class XDialogDragHandleDirective {
|
|
|
644
670
|
get getDraggable() {
|
|
645
671
|
return !this.dialogRef?.fullscreen && this.dialogRef?.option.draggable;
|
|
646
672
|
}
|
|
647
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
648
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
673
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogDragHandleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
674
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.5", type: XDialogDragHandleDirective, isStandalone: true, selector: "[x-dialog-drag-handle], x-dialog-drag-handle", host: { properties: { "class.x-dialog-portal-drag-handle": "this.getDraggable" } }, hostDirectives: [{ directive: i1.CdkDragHandle, inputs: ["cdkDragHandleDisabled", "xDialogDragHandleDisabled"] }], ngImport: i0 }); }
|
|
649
675
|
}
|
|
650
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
676
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogDragHandleDirective, decorators: [{
|
|
651
677
|
type: Directive,
|
|
652
678
|
args: [{
|
|
653
679
|
selector: `[x-dialog-drag-handle], x-dialog-drag-handle`,
|
|
@@ -669,10 +695,10 @@ class XDialogFullscreenDirective {
|
|
|
669
695
|
onFullscreenClick() {
|
|
670
696
|
this.dialogRef && this.dialogRef.onFullscreen();
|
|
671
697
|
}
|
|
672
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
673
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.
|
|
698
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogFullscreenDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
699
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.5", type: XDialogFullscreenDirective, isStandalone: true, selector: "[x-dialog-fullscreen], x-dialog-fullscreen", host: { listeners: { "click": "onFullscreenClick($event)" } }, ngImport: i0 }); }
|
|
674
700
|
}
|
|
675
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogFullscreenDirective, decorators: [{
|
|
676
702
|
type: Directive,
|
|
677
703
|
args: [{
|
|
678
704
|
selector: `[x-dialog-fullscreen], x-dialog-fullscreen`
|
|
@@ -685,7 +711,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
685
711
|
class XDialogPortalComponent extends BasePortalOutlet {
|
|
686
712
|
constructor() {
|
|
687
713
|
super(...arguments);
|
|
688
|
-
// @HostBinding('class.x-dialog-portal') _has = true;
|
|
689
714
|
this.placement = model.required(...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
690
715
|
this.renderer = inject(Renderer2);
|
|
691
716
|
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
@@ -703,26 +728,24 @@ class XDialogPortalComponent extends BasePortalOutlet {
|
|
|
703
728
|
this.distance = { x: 0, y: 0 };
|
|
704
729
|
this.dialogBox = {};
|
|
705
730
|
}
|
|
706
|
-
get
|
|
707
|
-
return this.placement()
|
|
731
|
+
get enimateEnter() {
|
|
732
|
+
return `x-move-${this.placement()}-enter`;
|
|
708
733
|
}
|
|
709
|
-
|
|
710
|
-
this.
|
|
711
|
-
action: 'done',
|
|
712
|
-
state: toState,
|
|
713
|
-
totalTime
|
|
714
|
-
});
|
|
734
|
+
get enimateLeave() {
|
|
735
|
+
return `x-move-${this.placement()}-leave`;
|
|
715
736
|
}
|
|
716
|
-
|
|
717
|
-
this.animationChanged.next({
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
});
|
|
737
|
+
done(event) {
|
|
738
|
+
this.animationChanged.next({ action: 'end', animationName: event.animationName });
|
|
739
|
+
}
|
|
740
|
+
start(event) {
|
|
741
|
+
this.animationChanged.next({ action: 'start', animationName: event.animationName });
|
|
722
742
|
}
|
|
723
743
|
ngOnInit() {
|
|
724
744
|
this.dialogBox['draggable'] = this.defaultMaximize ? this.dialogBox['draggable'] : this.option.draggable;
|
|
725
745
|
}
|
|
746
|
+
ngAfterViewInit() {
|
|
747
|
+
this.portalOutlet().setDisposeFn(() => { });
|
|
748
|
+
}
|
|
726
749
|
attachComponentPortal(portal) {
|
|
727
750
|
if (this.portalOutlet().hasAttached()) {
|
|
728
751
|
throw Error('dialog portal has attached');
|
|
@@ -741,26 +764,29 @@ class XDialogPortalComponent extends BasePortalOutlet {
|
|
|
741
764
|
y: this.distance.y + event.distance.y
|
|
742
765
|
};
|
|
743
766
|
}
|
|
744
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
745
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
767
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogPortalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
768
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.5", type: XDialogPortalComponent, isStandalone: true, selector: "x-dialog-portal", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { placement: "placementChange" }, host: { listeners: { "animationend": "done($event)", "animationstart": "start($event)" }, properties: { "animate.enter": "this.enimateEnter", "animate.leave": "this.enimateLeave" } }, queries: [{ propertyName: "handles", predicate: XDialogDragHandleDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, isSignal: true }, { propertyName: "dragRef", first: true, predicate: CdkDrag, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"x-dialog-portal\"\r\n #dragRef\r\n cdkDrag\r\n [cdkDragBoundary]=\"'.cdk-overlay-container'\"\r\n [cdkDragDisabled]=\"!option.draggable && !dialogBox['draggable']\"\r\n [cdkDragRootElement]=\"'.cdk-overlay-pane'\"\r\n [cdkDragFreeDragPosition]=\"dialogBox['distance']\"\r\n (cdkDragEnded)=\"onDragEnded($event)\"\r\n [style.minWidth]=\"dialogBox['minWidth']\"\r\n [style.minHeight]=\"dialogBox['minHeight']\"\r\n [style.maxWidth]=\"dialogBox['maxWidth']\"\r\n [style.maxHeight]=\"dialogBox['maxHeight']\"\r\n>\r\n <ng-template cdkPortalOutlet></ng-template>\r\n</div>\r\n", styles: [".x-dialog-portal{margin:0;padding:0}.x-dialog-portal{width:100%;height:100%;display:block;padding:1rem;box-sizing:border-box;min-height:inherit;max-height:inherit;background-color:var(--x-background-100);box-shadow:var(--x-box-shadow);border-radius:var(--x-border-small-radius)}.x-dialog-portal-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:3rem;line-height:3rem;display:block;align-items:center;margin:-1rem -1rem 0;padding:0 1rem}.x-dialog-portal-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);line-height:1.325rem}.x-dialog-portal-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin:0 -1rem -1rem;padding:0 1rem;height:4rem}.x-dialog-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}.x-dialog-portal-drag-handle{cursor:move}.x-dialog-portal-fullscreen{margin:0!important}.x-dialog-portal-fullscreen .x-dialog-portal{left:0!important;top:0!important;border-radius:0}.x-dialog-portal-fullscreen .x-dialog-portal-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}x-dialog-portal{width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1.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: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
746
769
|
}
|
|
747
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogPortalComponent, decorators: [{
|
|
748
771
|
type: Component,
|
|
749
|
-
args: [{ selector: 'x-dialog-portal', imports: [DragDropModule, PortalModule], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
750
|
-
}], propDecorators: {
|
|
772
|
+
args: [{ selector: 'x-dialog-portal', imports: [DragDropModule, PortalModule], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"x-dialog-portal\"\r\n #dragRef\r\n cdkDrag\r\n [cdkDragBoundary]=\"'.cdk-overlay-container'\"\r\n [cdkDragDisabled]=\"!option.draggable && !dialogBox['draggable']\"\r\n [cdkDragRootElement]=\"'.cdk-overlay-pane'\"\r\n [cdkDragFreeDragPosition]=\"dialogBox['distance']\"\r\n (cdkDragEnded)=\"onDragEnded($event)\"\r\n [style.minWidth]=\"dialogBox['minWidth']\"\r\n [style.minHeight]=\"dialogBox['minHeight']\"\r\n [style.maxWidth]=\"dialogBox['maxWidth']\"\r\n [style.maxHeight]=\"dialogBox['maxHeight']\"\r\n>\r\n <ng-template cdkPortalOutlet></ng-template>\r\n</div>\r\n", styles: [".x-dialog-portal{margin:0;padding:0}.x-dialog-portal{width:100%;height:100%;display:block;padding:1rem;box-sizing:border-box;min-height:inherit;max-height:inherit;background-color:var(--x-background-100);box-shadow:var(--x-box-shadow);border-radius:var(--x-border-small-radius)}.x-dialog-portal-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:3rem;line-height:3rem;display:block;align-items:center;margin:-1rem -1rem 0;padding:0 1rem}.x-dialog-portal-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);line-height:1.325rem}.x-dialog-portal-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin:0 -1rem -1rem;padding:0 1rem;height:4rem}.x-dialog-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}.x-dialog-portal-drag-handle{cursor:move}.x-dialog-portal-fullscreen{margin:0!important}.x-dialog-portal-fullscreen .x-dialog-portal{left:0!important;top:0!important;border-radius:0}.x-dialog-portal-fullscreen .x-dialog-portal-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}x-dialog-portal{width:100%;height:100%}\n"] }]
|
|
773
|
+
}], propDecorators: { placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: true }] }, { type: i0.Output, args: ["placementChange"] }], enimateEnter: [{
|
|
751
774
|
type: HostBinding,
|
|
752
|
-
args: ['
|
|
775
|
+
args: ['animate.enter']
|
|
776
|
+
}], enimateLeave: [{
|
|
777
|
+
type: HostBinding,
|
|
778
|
+
args: ['animate.leave']
|
|
753
779
|
}], done: [{
|
|
754
780
|
type: HostListener,
|
|
755
|
-
args: ['
|
|
781
|
+
args: ['animationend', ['$event']]
|
|
756
782
|
}], start: [{
|
|
757
783
|
type: HostListener,
|
|
758
|
-
args: ['
|
|
759
|
-
}] } });
|
|
784
|
+
args: ['animationstart', ['$event']]
|
|
785
|
+
}], portalOutlet: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkPortalOutlet), { isSignal: true }] }], dragRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkDrag), { isSignal: true }] }], handles: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => XDialogDragHandleDirective), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
760
786
|
|
|
761
787
|
class XDialogModule {
|
|
762
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
763
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
788
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
789
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.5", ngImport: i0, type: XDialogModule, imports: [XDialogComponent,
|
|
764
790
|
XDialogContainerComponent,
|
|
765
791
|
XDialogCloseDirective,
|
|
766
792
|
XDialogTitleDirective,
|
|
@@ -775,9 +801,9 @@ class XDialogModule {
|
|
|
775
801
|
XDialogActionsDirective,
|
|
776
802
|
XDialogDragHandleDirective,
|
|
777
803
|
XDialogFullscreenDirective] }); }
|
|
778
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.
|
|
804
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogModule, imports: [XDialogComponent] }); }
|
|
779
805
|
}
|
|
780
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
806
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogModule, decorators: [{
|
|
781
807
|
type: NgModule,
|
|
782
808
|
args: [{
|
|
783
809
|
exports: [
|
|
@@ -813,13 +839,16 @@ class XDialogService {
|
|
|
813
839
|
minHeight: '8rem',
|
|
814
840
|
backdropClose: true,
|
|
815
841
|
hasBackdrop: true,
|
|
842
|
+
keyboard: true,
|
|
816
843
|
draggable: false
|
|
817
844
|
};
|
|
818
845
|
this.portalService = inject(XPortalService);
|
|
819
846
|
this.configService = inject(XConfigService);
|
|
820
847
|
this.overlay = inject(Overlay);
|
|
821
848
|
this.rendererFactory = inject(RendererFactory2);
|
|
849
|
+
this.document = inject(DOCUMENT);
|
|
822
850
|
this.renderer = this.rendererFactory.createRenderer(null, null);
|
|
851
|
+
this.dialogRefs = [];
|
|
823
852
|
this.configDefault = this.configService.getConfigForComponent(X_DIALOG_CONFIG_NAME);
|
|
824
853
|
Object.assign(this.default, this.configDefault);
|
|
825
854
|
}
|
|
@@ -862,6 +891,7 @@ class XDialogService {
|
|
|
862
891
|
instance.overlayElement = overlayElement;
|
|
863
892
|
dialogRef.option = option;
|
|
864
893
|
dialogRef.fullscreen = defaultMaximize;
|
|
894
|
+
dialogRef.unsubject = new Subject();
|
|
865
895
|
if (defaultMaximize) {
|
|
866
896
|
this.renderer.addClass(overlayElement, 'x-dialog-portal-fullscreen');
|
|
867
897
|
}
|
|
@@ -876,9 +906,28 @@ class XDialogService {
|
|
|
876
906
|
const comRef = instance.attachComponentPortal(new ComponentPortal(content, option.viewContainerRef, injector));
|
|
877
907
|
dialogRef.componentInstance = comRef.instance;
|
|
878
908
|
}
|
|
909
|
+
this.dialogRefs.push(dialogRef);
|
|
910
|
+
const close = () => {
|
|
911
|
+
dialogRef.close();
|
|
912
|
+
this.dialogRefs.splice(this.dialogRefs.indexOf(dialogRef), 1);
|
|
913
|
+
};
|
|
879
914
|
if (option.hasBackdrop && option.backdropClose && overlayRef) {
|
|
880
|
-
overlayRef
|
|
881
|
-
|
|
915
|
+
overlayRef
|
|
916
|
+
.backdropClick()
|
|
917
|
+
.pipe(takeUntil$1(dialogRef.unsubject))
|
|
918
|
+
.subscribe(() => {
|
|
919
|
+
close();
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
if (option.keyboard) {
|
|
923
|
+
fromEvent(this.document, 'keydown')
|
|
924
|
+
.pipe(takeUntil$1(dialogRef.unsubject))
|
|
925
|
+
.subscribe((event) => {
|
|
926
|
+
if (event.key === 'Escape' || event.keyCode === 27) {
|
|
927
|
+
if (this.dialogRefs[this.dialogRefs.length - 1] === dialogRef) {
|
|
928
|
+
close();
|
|
929
|
+
}
|
|
930
|
+
}
|
|
882
931
|
});
|
|
883
932
|
}
|
|
884
933
|
return dialogRef;
|
|
@@ -893,10 +942,10 @@ class XDialogService {
|
|
|
893
942
|
}
|
|
894
943
|
return false;
|
|
895
944
|
}
|
|
896
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
897
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
945
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
946
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogService, providedIn: 'root' }); }
|
|
898
947
|
}
|
|
899
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
948
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.5", ngImport: i0, type: XDialogService, decorators: [{
|
|
900
949
|
type: Injectable,
|
|
901
950
|
args: [{ providedIn: 'root' }]
|
|
902
951
|
}], ctorParameters: () => [] });
|