@ng-nest/ui 12.0.10 → 12.1.2
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/alert/alert.component.d.ts +2 -1
- package/bundles/ng-nest-ui-alert.umd.js +6 -1
- package/bundles/ng-nest-ui-alert.umd.js.map +1 -1
- package/bundles/ng-nest-ui-carousel.umd.js +10 -10
- package/bundles/ng-nest-ui-carousel.umd.js.map +1 -1
- package/bundles/ng-nest-ui-core.umd.js.map +1 -1
- package/bundles/ng-nest-ui-dialog.umd.js +284 -32
- package/bundles/ng-nest-ui-dialog.umd.js.map +1 -1
- package/bundles/ng-nest-ui-drawer.umd.js +245 -14
- package/bundles/ng-nest-ui-drawer.umd.js.map +1 -1
- package/bundles/ng-nest-ui-find.umd.js +27 -3
- package/bundles/ng-nest-ui-find.umd.js.map +1 -1
- package/bundles/ng-nest-ui-input.umd.js +2 -1
- package/bundles/ng-nest-ui-input.umd.js.map +1 -1
- package/bundles/ng-nest-ui-menu.umd.js +1 -1
- package/bundles/ng-nest-ui-menu.umd.js.map +1 -1
- package/bundles/ng-nest-ui-message.umd.js +52 -16
- package/bundles/ng-nest-ui-message.umd.js.map +1 -1
- package/bundles/ng-nest-ui-popconfirm.umd.js +33 -4
- package/bundles/ng-nest-ui-popconfirm.umd.js.map +1 -1
- package/bundles/ng-nest-ui-popover.umd.js +13 -2
- package/bundles/ng-nest-ui-popover.umd.js.map +1 -1
- package/bundles/ng-nest-ui-portal.umd.js +8 -8
- package/bundles/ng-nest-ui-portal.umd.js.map +1 -1
- package/bundles/ng-nest-ui-progress.umd.js +235 -20
- package/bundles/ng-nest-ui-progress.umd.js.map +1 -1
- package/bundles/ng-nest-ui-select.umd.js +1 -1
- package/bundles/ng-nest-ui-steps.umd.js +19 -7
- package/bundles/ng-nest-ui-steps.umd.js.map +1 -1
- package/bundles/ng-nest-ui-table.umd.js +9 -5
- package/bundles/ng-nest-ui-table.umd.js.map +1 -1
- package/carousel/carousel-panel.component.d.ts +2 -3
- package/core/config/config.d.ts +7 -0
- package/core/interfaces/layout.type.d.ts +1 -1
- package/dialog/dialog-container.component.d.ts +18 -0
- package/dialog/dialog-container.directives.d.ts +24 -0
- package/dialog/dialog-ref.d.ts +9 -0
- package/dialog/dialog.module.d.ts +13 -11
- package/dialog/dialog.property.d.ts +84 -6
- package/dialog/dialog.service.d.ts +19 -0
- package/dialog/public-api.d.ts +4 -0
- package/drawer/drawer-container.component.d.ts +18 -0
- package/drawer/drawer-container.directives.d.ts +19 -0
- package/drawer/drawer-ref.d.ts +9 -0
- package/drawer/drawer.module.d.ts +8 -6
- package/drawer/drawer.property.d.ts +83 -2
- package/drawer/drawer.service.d.ts +19 -0
- package/drawer/public-api.d.ts +5 -0
- package/esm2015/alert/alert.component.js +8 -3
- package/esm2015/carousel/carousel-panel.component.js +12 -11
- package/esm2015/core/config/config.js +1 -1
- package/esm2015/core/interfaces/layout.type.js +1 -1
- package/esm2015/dialog/dialog-container.component.js +59 -0
- package/esm2015/dialog/dialog-container.directives.js +73 -0
- package/esm2015/dialog/dialog-ref.js +17 -0
- package/esm2015/dialog/dialog.component.js +2 -2
- package/esm2015/dialog/dialog.module.js +37 -7
- package/esm2015/dialog/dialog.property.js +17 -16
- package/esm2015/dialog/dialog.service.js +67 -0
- package/esm2015/dialog/public-api.js +5 -1
- package/esm2015/drawer/drawer-container.component.js +59 -0
- package/esm2015/drawer/drawer-container.directives.js +57 -0
- package/esm2015/drawer/drawer-ref.js +17 -0
- package/esm2015/drawer/drawer.component.js +2 -2
- package/esm2015/drawer/drawer.module.js +22 -6
- package/esm2015/drawer/drawer.property.js +22 -6
- package/esm2015/drawer/drawer.service.js +65 -0
- package/esm2015/drawer/public-api.js +6 -1
- package/esm2015/find/find.component.js +12 -3
- package/esm2015/find/find.property.js +18 -2
- package/esm2015/input/input.component.js +3 -2
- package/esm2015/menu/menu.component.js +2 -2
- package/esm2015/message/message-ref.js +12 -0
- package/esm2015/message/message.component.js +3 -3
- package/esm2015/message/message.property.js +2 -2
- package/esm2015/message/message.service.js +37 -15
- package/esm2015/message/public-api.js +2 -1
- package/esm2015/popconfirm/popconfirm.component.js +25 -4
- package/esm2015/popconfirm/popconfirm.property.js +10 -3
- package/esm2015/popover/popover.directive.js +8 -2
- package/esm2015/popover/popover.property.js +7 -2
- package/esm2015/portal/portal.module.js +4 -3
- package/esm2015/portal/portal.service.js +8 -9
- package/esm2015/progress/progress.component.js +177 -15
- package/esm2015/progress/progress.property.js +50 -3
- package/esm2015/select/select.component.js +1 -1
- package/esm2015/steps/steps.component.js +14 -7
- package/esm2015/steps/steps.property.js +8 -3
- package/esm2015/table/table-body.component.js +3 -3
- package/esm2015/table/table.component.js +2 -2
- package/esm2015/table/table.property.js +7 -3
- package/fesm2015/ng-nest-ui-alert.js +7 -2
- package/fesm2015/ng-nest-ui-alert.js.map +1 -1
- package/fesm2015/ng-nest-ui-carousel.js +9 -9
- package/fesm2015/ng-nest-ui-carousel.js.map +1 -1
- package/fesm2015/ng-nest-ui-core.js.map +1 -1
- package/fesm2015/ng-nest-ui-dialog.js +254 -25
- package/fesm2015/ng-nest-ui-dialog.js.map +1 -1
- package/fesm2015/ng-nest-ui-drawer.js +224 -13
- package/fesm2015/ng-nest-ui-drawer.js.map +1 -1
- package/fesm2015/ng-nest-ui-find.js +28 -3
- package/fesm2015/ng-nest-ui-find.js.map +1 -1
- package/fesm2015/ng-nest-ui-input.js +2 -1
- package/fesm2015/ng-nest-ui-input.js.map +1 -1
- package/fesm2015/ng-nest-ui-menu.js +1 -1
- package/fesm2015/ng-nest-ui-menu.js.map +1 -1
- package/fesm2015/ng-nest-ui-message.js +50 -17
- package/fesm2015/ng-nest-ui-message.js.map +1 -1
- package/fesm2015/ng-nest-ui-popconfirm.js +33 -5
- package/fesm2015/ng-nest-ui-popconfirm.js.map +1 -1
- package/fesm2015/ng-nest-ui-popover.js +13 -2
- package/fesm2015/ng-nest-ui-popover.js.map +1 -1
- package/fesm2015/ng-nest-ui-portal.js +10 -10
- package/fesm2015/ng-nest-ui-portal.js.map +1 -1
- package/fesm2015/ng-nest-ui-progress.js +225 -17
- package/fesm2015/ng-nest-ui-progress.js.map +1 -1
- package/fesm2015/ng-nest-ui-select.js +1 -1
- package/fesm2015/ng-nest-ui-steps.js +20 -8
- package/fesm2015/ng-nest-ui-steps.js.map +1 -1
- package/fesm2015/ng-nest-ui-table.js +9 -5
- package/fesm2015/ng-nest-ui-table.js.map +1 -1
- package/find/find.property.d.ts +31 -1
- package/message/message-ref.d.ts +8 -0
- package/message/message.component.d.ts +3 -3
- package/message/message.property.d.ts +24 -4
- package/message/message.service.d.ts +4 -1
- package/message/public-api.d.ts +1 -0
- package/package.json +1 -1
- package/popconfirm/popconfirm.component.d.ts +6 -2
- package/popconfirm/popconfirm.property.d.ts +13 -2
- package/popover/popover.property.d.ts +6 -1
- package/portal/portal.module.d.ts +1 -1
- package/portal/portal.service.d.ts +2 -3
- package/progress/progress.component.d.ts +31 -3
- package/progress/progress.property.d.ts +80 -5
- package/steps/steps.property.d.ts +7 -2
- package/table/table.property.d.ts +24 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, Input, Output, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
|
|
2
|
+
import { InjectionToken, EventEmitter, Component, Input, Output, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, HostBinding, HostListener, Directive, Optional, TemplateRef, Injectable, NgModule } from '@angular/core';
|
|
3
3
|
import { __decorate } from 'tslib';
|
|
4
4
|
import * as i3 from '@ng-nest/ui/core';
|
|
5
|
-
import { XProperty, XInputBoolean, XWithConfig, XIsChange, XIsEmpty, XSlideAnimation } from '@ng-nest/ui/core';
|
|
5
|
+
import { XProperty, XInputBoolean, XWithConfig, XIsChange, XIsEmpty, XSlideAnimation, fillDefault } from '@ng-nest/ui/core';
|
|
6
6
|
import * as i1 from '@angular/cdk/overlay';
|
|
7
7
|
import * as i2 from '@ng-nest/ui/portal';
|
|
8
8
|
import { XPortalModule } from '@ng-nest/ui/portal';
|
|
@@ -12,6 +12,9 @@ import * as i5 from '@angular/common';
|
|
|
12
12
|
import { CommonModule } from '@angular/common';
|
|
13
13
|
import * as i6 from '@ng-nest/ui/outlet';
|
|
14
14
|
import { XOutletModule } from '@ng-nest/ui/outlet';
|
|
15
|
+
import * as i1$1 from '@angular/cdk/portal';
|
|
16
|
+
import { BasePortalOutlet, CdkPortalOutlet, TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
17
|
+
import { filter, take } from 'rxjs/operators';
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Drawer
|
|
@@ -19,7 +22,8 @@ import { XOutletModule } from '@ng-nest/ui/outlet';
|
|
|
19
22
|
* @decorator component
|
|
20
23
|
*/
|
|
21
24
|
const XDrawerPrefix = 'x-drawer';
|
|
22
|
-
const
|
|
25
|
+
const X_DRAWER_CONFIG_NAME = 'drawer';
|
|
26
|
+
const X_DRAWER_DATA = new InjectionToken('XDrawerData');
|
|
23
27
|
/**
|
|
24
28
|
* Drawer Property
|
|
25
29
|
*/
|
|
@@ -39,16 +43,25 @@ class XDrawerProperty extends XProperty {
|
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
/** @nocollapse */ XDrawerProperty.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerProperty, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
42
|
-
/** @nocollapse */ XDrawerProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDrawerProperty, selector: "ng-component", inputs: { title: "title", visible: "visible", placement: "placement", size: "size" }, outputs: { close: "close", visibleChange: "visibleChange" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
46
|
+
/** @nocollapse */ XDrawerProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDrawerProperty, selector: "ng-component", inputs: { title: "title", visible: "visible", placement: "placement", size: "size", backdropClose: "backdropClose", hasBackdrop: "hasBackdrop", className: "className" }, outputs: { close: "close", visibleChange: "visibleChange" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
43
47
|
__decorate([
|
|
44
48
|
XInputBoolean()
|
|
45
49
|
], XDrawerProperty.prototype, "visible", void 0);
|
|
46
50
|
__decorate([
|
|
47
|
-
XWithConfig(
|
|
51
|
+
XWithConfig(X_DRAWER_CONFIG_NAME, 'right')
|
|
48
52
|
], XDrawerProperty.prototype, "placement", void 0);
|
|
49
53
|
__decorate([
|
|
50
|
-
XWithConfig(
|
|
54
|
+
XWithConfig(X_DRAWER_CONFIG_NAME, '30%')
|
|
51
55
|
], XDrawerProperty.prototype, "size", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
XWithConfig(X_DRAWER_CONFIG_NAME, true)
|
|
58
|
+
], XDrawerProperty.prototype, "backdropClose", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
XWithConfig(X_DRAWER_CONFIG_NAME, true)
|
|
61
|
+
], XDrawerProperty.prototype, "hasBackdrop", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
XWithConfig(X_DRAWER_CONFIG_NAME, '')
|
|
64
|
+
], XDrawerProperty.prototype, "className", void 0);
|
|
52
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerProperty, decorators: [{
|
|
53
66
|
type: Component,
|
|
54
67
|
args: [{ template: '' }]
|
|
@@ -60,6 +73,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImpor
|
|
|
60
73
|
type: Input
|
|
61
74
|
}], size: [{
|
|
62
75
|
type: Input
|
|
76
|
+
}], backdropClose: [{
|
|
77
|
+
type: Input
|
|
78
|
+
}], hasBackdrop: [{
|
|
79
|
+
type: Input
|
|
80
|
+
}], className: [{
|
|
81
|
+
type: Input
|
|
63
82
|
}], close: [{
|
|
64
83
|
type: Output
|
|
65
84
|
}], visibleChange: [{
|
|
@@ -138,7 +157,7 @@ class XDrawerComponent extends XDrawerProperty {
|
|
|
138
157
|
}
|
|
139
158
|
}
|
|
140
159
|
/** @nocollapse */ XDrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.Overlay }, { token: i2.XPortalService }, { token: i0.ViewContainerRef }, { token: i3.XConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
141
|
-
/** @nocollapse */ XDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDrawerComponent, selector: "x-drawer", viewQueries: [{ propertyName: "drawerTpl", first: true, predicate: ["drawerTpl"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #drawerTpl>\r\n <div class=\"x-drawer\" [ngClass]=\"classMap\" [@x-slide-animation]=\"placement\">\r\n <div class=\"x-drawer-header\" *ngIf=\"title\">\r\n <div class=\"x-drawer-title\">\r\n <ng-container *xOutlet=\"title\">{{ title }}</ng-container>\r\n </div>\r\n <x-button class=\"x-drawer-close\" icon=\"fto-x\" (click)=\"closePortal()\" onlyIcon closable></x-button>\r\n </div>\r\n <div class=\"x-drawer-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [".x-drawer{margin:0;padding:0;height:100%;width:100%;background-color:var(--x-background);position:relative;box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color)}.x-drawer-header{padding
|
|
160
|
+
/** @nocollapse */ XDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDrawerComponent, selector: "x-drawer", viewQueries: [{ propertyName: "drawerTpl", first: true, predicate: ["drawerTpl"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #drawerTpl>\r\n <div class=\"x-drawer\" [ngClass]=\"classMap\" [@x-slide-animation]=\"placement\">\r\n <div class=\"x-drawer-header\" *ngIf=\"title\">\r\n <div class=\"x-drawer-title\">\r\n <ng-container *xOutlet=\"title\">{{ title }}</ng-container>\r\n </div>\r\n <x-button class=\"x-drawer-close\" icon=\"fto-x\" (click)=\"closePortal()\" onlyIcon closable></x-button>\r\n </div>\r\n <div class=\"x-drawer-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [".x-drawer{margin:0;padding:0;height:100%;width:100%;background-color:var(--x-background);position:relative;box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color)}.x-drawer-header{padding:1rem 1rem .5rem}.x-drawer-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.x-drawer-close{position:absolute;top:.425rem;right:.425rem}.x-drawer-title{padding:0}.x-drawer-content{padding:0 1rem 1rem;height:calc(100% - 3rem);overflow:auto}.x-drawer-no-title .x-drawer-content{padding:.5rem 1rem}\n"], components: [{ type: i4.XButtonComponent, selector: "x-button" }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], animations: [XSlideAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
142
161
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerComponent, decorators: [{
|
|
143
162
|
type: Component,
|
|
144
163
|
args: [{
|
|
@@ -154,17 +173,209 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImpor
|
|
|
154
173
|
args: ['drawerTpl', { static: true }]
|
|
155
174
|
}] } });
|
|
156
175
|
|
|
176
|
+
class XDrawerContainerComponent extends BasePortalOutlet {
|
|
177
|
+
constructor() {
|
|
178
|
+
super();
|
|
179
|
+
this._has = true;
|
|
180
|
+
this.animationChanged = new EventEmitter();
|
|
181
|
+
}
|
|
182
|
+
done({ toState, totalTime }) {
|
|
183
|
+
this.animationChanged.next({ action: 'done', state: toState, totalTime });
|
|
184
|
+
}
|
|
185
|
+
start({ toState, totalTime }) {
|
|
186
|
+
this.animationChanged.next({ action: 'start', state: toState, totalTime });
|
|
187
|
+
}
|
|
188
|
+
attachComponentPortal(portal) {
|
|
189
|
+
if (this.portalOutlet.hasAttached()) {
|
|
190
|
+
throw Error('drawer portal has attached');
|
|
191
|
+
}
|
|
192
|
+
return this.portalOutlet.attachComponentPortal(portal);
|
|
193
|
+
}
|
|
194
|
+
attachTemplatePortal(portal) {
|
|
195
|
+
if (this.portalOutlet.hasAttached()) {
|
|
196
|
+
throw Error('drawer portal has attached');
|
|
197
|
+
}
|
|
198
|
+
return this.portalOutlet.attachTemplatePortal(portal);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** @nocollapse */ XDrawerContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
202
|
+
/** @nocollapse */ XDrawerContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDrawerContainerComponent, selector: "x-drawer-container", host: { listeners: { "@x-slide-animation.done": "done($event)", "@x-slide-animation.start": "start($event)" }, properties: { "class.x-drawer-container": "this._has", "@x-slide-animation": "this.placement" } }, viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet></ng-template>\r\n", styles: [".x-drawer-container{margin:0;height:100%;width:100%;background-color:var(--x-background);position:relative;box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);overflow:auto;padding:1rem}.x-drawer-container-title{display:block;margin:0 0 .5rem;font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.x-drawer-container-content{display:block;margin:0 -1rem;padding:0 1rem;overflow:auto}\n"], directives: [{ type: i1$1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [XSlideAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerContainerComponent, decorators: [{
|
|
204
|
+
type: Component,
|
|
205
|
+
args: [{
|
|
206
|
+
selector: 'x-drawer-container',
|
|
207
|
+
templateUrl: './drawer-container.component.html',
|
|
208
|
+
styleUrls: ['./drawer-container.component.scss'],
|
|
209
|
+
encapsulation: ViewEncapsulation.None,
|
|
210
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
211
|
+
animations: [XSlideAnimation]
|
|
212
|
+
}]
|
|
213
|
+
}], ctorParameters: function () { return []; }, propDecorators: { _has: [{
|
|
214
|
+
type: HostBinding,
|
|
215
|
+
args: ['class.x-drawer-container']
|
|
216
|
+
}], placement: [{
|
|
217
|
+
type: HostBinding,
|
|
218
|
+
args: ['@x-slide-animation']
|
|
219
|
+
}], done: [{
|
|
220
|
+
type: HostListener,
|
|
221
|
+
args: ['@x-slide-animation.done', ['$event']]
|
|
222
|
+
}], start: [{
|
|
223
|
+
type: HostListener,
|
|
224
|
+
args: ['@x-slide-animation.start', ['$event']]
|
|
225
|
+
}], portalOutlet: [{
|
|
226
|
+
type: ViewChild,
|
|
227
|
+
args: [CdkPortalOutlet, { static: true }]
|
|
228
|
+
}] } });
|
|
229
|
+
|
|
230
|
+
// TODO: add more function
|
|
231
|
+
class XDrawerRef {
|
|
232
|
+
constructor(overlayRef, containerInstance) {
|
|
233
|
+
this.overlayRef = overlayRef;
|
|
234
|
+
this.containerInstance = containerInstance;
|
|
235
|
+
}
|
|
236
|
+
close() {
|
|
237
|
+
this.containerInstance.animationChanged
|
|
238
|
+
.pipe(filter((event) => event.state === 'void' && event.action === 'done'), take(1))
|
|
239
|
+
.subscribe(() => {
|
|
240
|
+
this.overlayRef.detach();
|
|
241
|
+
});
|
|
242
|
+
this.containerInstance.placement = 'void';
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
class XDrawerCloseDirective {
|
|
247
|
+
constructor(drawerRef) {
|
|
248
|
+
this.drawerRef = drawerRef;
|
|
249
|
+
}
|
|
250
|
+
onCloseClick() {
|
|
251
|
+
this.drawerRef && this.drawerRef.close();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/** @nocollapse */ XDrawerCloseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerCloseDirective, deps: [{ token: XDrawerRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
255
|
+
/** @nocollapse */ XDrawerCloseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.5", type: XDrawerCloseDirective, selector: "[x-drawer-close]", host: { listeners: { "click": "onCloseClick($event)" } }, ngImport: i0 });
|
|
256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerCloseDirective, decorators: [{
|
|
257
|
+
type: Directive,
|
|
258
|
+
args: [{
|
|
259
|
+
selector: `[x-drawer-close]`
|
|
260
|
+
}]
|
|
261
|
+
}], ctorParameters: function () { return [{ type: XDrawerRef, decorators: [{
|
|
262
|
+
type: Optional
|
|
263
|
+
}] }]; }, propDecorators: { onCloseClick: [{
|
|
264
|
+
type: HostListener,
|
|
265
|
+
args: ['click', ['$event']]
|
|
266
|
+
}] } });
|
|
267
|
+
class XDrawerTitleDirective {
|
|
268
|
+
constructor() {
|
|
269
|
+
this._has = true;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/** @nocollapse */ XDrawerTitleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
273
|
+
/** @nocollapse */ XDrawerTitleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.5", type: XDrawerTitleDirective, selector: "[x-drawer-title]", host: { properties: { "class.x-drawer-container-title": "this._has" } }, ngImport: i0 });
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerTitleDirective, decorators: [{
|
|
275
|
+
type: Directive,
|
|
276
|
+
args: [{
|
|
277
|
+
selector: `[x-drawer-title]`
|
|
278
|
+
}]
|
|
279
|
+
}], propDecorators: { _has: [{
|
|
280
|
+
type: HostBinding,
|
|
281
|
+
args: ['class.x-drawer-container-title']
|
|
282
|
+
}] } });
|
|
283
|
+
class XDrawerContentDirective {
|
|
284
|
+
constructor() {
|
|
285
|
+
this._has = true;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/** @nocollapse */ XDrawerContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
289
|
+
/** @nocollapse */ XDrawerContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.5", type: XDrawerContentDirective, selector: "[x-drawer-content], x-drawer-content", host: { properties: { "class.x-drawer-container-content": "this._has" } }, ngImport: i0 });
|
|
290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerContentDirective, decorators: [{
|
|
291
|
+
type: Directive,
|
|
292
|
+
args: [{
|
|
293
|
+
selector: `[x-drawer-content], x-drawer-content`
|
|
294
|
+
}]
|
|
295
|
+
}], propDecorators: { _has: [{
|
|
296
|
+
type: HostBinding,
|
|
297
|
+
args: ['class.x-drawer-container-content']
|
|
298
|
+
}] } });
|
|
299
|
+
|
|
300
|
+
class XDrawerService {
|
|
301
|
+
constructor(portalService, configService, overlay) {
|
|
302
|
+
this.portalService = portalService;
|
|
303
|
+
this.configService = configService;
|
|
304
|
+
this.overlay = overlay;
|
|
305
|
+
this.default = {
|
|
306
|
+
placement: 'right',
|
|
307
|
+
size: '30%',
|
|
308
|
+
hasBackdrop: true,
|
|
309
|
+
backdropClose: true
|
|
310
|
+
};
|
|
311
|
+
this.configDefault = this.configService.getConfigForComponent(X_DRAWER_CONFIG_NAME);
|
|
312
|
+
Object.assign(this.default, this.configDefault);
|
|
313
|
+
}
|
|
314
|
+
create(content, option = {}) {
|
|
315
|
+
fillDefault(option, this.default);
|
|
316
|
+
const width = ['left', 'right'].includes(option.placement) ? option.size : '100%';
|
|
317
|
+
const height = ['top', 'bottom'].includes(option.placement) ? option.size : '100%';
|
|
318
|
+
const portal = this.portalService.attach({
|
|
319
|
+
content: XDrawerContainerComponent,
|
|
320
|
+
viewContainerRef: option.viewContainerRef,
|
|
321
|
+
overlayConfig: {
|
|
322
|
+
hasBackdrop: option.hasBackdrop,
|
|
323
|
+
panelClass: option.className,
|
|
324
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
325
|
+
positionStrategy: this.portalService.setPosition(option.placement, width, height)
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
const { overlayRef, componentRef } = portal || {};
|
|
329
|
+
const { instance } = componentRef || {};
|
|
330
|
+
instance.placement = option.placement;
|
|
331
|
+
const drawerRef = new XDrawerRef(overlayRef, instance);
|
|
332
|
+
if (content instanceof TemplateRef) {
|
|
333
|
+
instance.attachTemplatePortal(new TemplatePortal(content, option.viewContainerRef, { $implicit: option.data, drawerRef: drawerRef }));
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
const injector = this.portalService.createInjector([
|
|
337
|
+
{ provide: X_DRAWER_DATA, useValue: option.data },
|
|
338
|
+
{ provide: XDrawerRef, useValue: drawerRef }
|
|
339
|
+
]);
|
|
340
|
+
instance.attachComponentPortal(new ComponentPortal(content, option.viewContainerRef, injector));
|
|
341
|
+
}
|
|
342
|
+
if (option.hasBackdrop && option.backdropClose && overlayRef)
|
|
343
|
+
overlayRef.backdropClick().subscribe(() => {
|
|
344
|
+
drawerRef.close();
|
|
345
|
+
});
|
|
346
|
+
return drawerRef;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
/** @nocollapse */ XDrawerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerService, deps: [{ token: i2.XPortalService }, { token: i3.XConfigService }, { token: i1.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
350
|
+
/** @nocollapse */ XDrawerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerService });
|
|
351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerService, decorators: [{
|
|
352
|
+
type: Injectable
|
|
353
|
+
}], ctorParameters: function () { return [{ type: i2.XPortalService }, { type: i3.XConfigService }, { type: i1.Overlay }]; } });
|
|
354
|
+
|
|
157
355
|
class XDrawerModule {
|
|
158
356
|
}
|
|
159
357
|
/** @nocollapse */ XDrawerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
160
|
-
/** @nocollapse */ XDrawerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerModule, declarations: [XDrawerComponent,
|
|
161
|
-
|
|
358
|
+
/** @nocollapse */ XDrawerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerModule, declarations: [XDrawerComponent,
|
|
359
|
+
XDrawerCloseDirective,
|
|
360
|
+
XDrawerTitleDirective,
|
|
361
|
+
XDrawerContentDirective,
|
|
362
|
+
XDrawerContainerComponent,
|
|
363
|
+
XDrawerProperty], imports: [CommonModule, XOutletModule, XButtonModule, XPortalModule], exports: [XDrawerComponent, XDrawerCloseDirective, XDrawerTitleDirective, XDrawerContentDirective, XDrawerContainerComponent] });
|
|
364
|
+
/** @nocollapse */ XDrawerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerModule, providers: [XDrawerService], imports: [[CommonModule, XOutletModule, XButtonModule, XPortalModule]] });
|
|
162
365
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XDrawerModule, decorators: [{
|
|
163
366
|
type: NgModule,
|
|
164
367
|
args: [{
|
|
165
|
-
declarations: [
|
|
166
|
-
|
|
167
|
-
|
|
368
|
+
declarations: [
|
|
369
|
+
XDrawerComponent,
|
|
370
|
+
XDrawerCloseDirective,
|
|
371
|
+
XDrawerTitleDirective,
|
|
372
|
+
XDrawerContentDirective,
|
|
373
|
+
XDrawerContainerComponent,
|
|
374
|
+
XDrawerProperty
|
|
375
|
+
],
|
|
376
|
+
exports: [XDrawerComponent, XDrawerCloseDirective, XDrawerTitleDirective, XDrawerContentDirective, XDrawerContainerComponent],
|
|
377
|
+
imports: [CommonModule, XOutletModule, XButtonModule, XPortalModule],
|
|
378
|
+
providers: [XDrawerService]
|
|
168
379
|
}]
|
|
169
380
|
}] });
|
|
170
381
|
|
|
@@ -172,5 +383,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImpor
|
|
|
172
383
|
* Generated bundle index. Do not edit.
|
|
173
384
|
*/
|
|
174
385
|
|
|
175
|
-
export { XDrawerComponent, XDrawerModule, XDrawerPrefix, XDrawerProperty };
|
|
386
|
+
export { XDrawerCloseDirective, XDrawerComponent, XDrawerContainerComponent, XDrawerContentDirective, XDrawerModule, XDrawerPrefix, XDrawerProperty, XDrawerRef, XDrawerService, XDrawerTitleDirective, X_DRAWER_CONFIG_NAME, X_DRAWER_DATA };
|
|
176
387
|
//# sourceMappingURL=ng-nest-ui-drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-nest-ui-drawer.js","sources":["../../../../lib/ng-nest/ui/drawer/drawer.property.ts","../../../../lib/ng-nest/ui/drawer/drawer.component.ts","../../../../lib/ng-nest/ui/drawer/drawer.component.html","../../../../lib/ng-nest/ui/drawer/drawer.module.ts","../../../../lib/ng-nest/ui/drawer/ng-nest-ui-drawer.ts"],"sourcesContent":["import { XTemplate, XPosition, XProperty, XInputBoolean, XBoolean, XWithConfig } from '@ng-nest/ui/core';\r\nimport { Input, Output, EventEmitter, Component } from '@angular/core';\r\n\r\n/**\r\n * Drawer\r\n * @selector x-drawer\r\n * @decorator component\r\n */\r\nexport const XDrawerPrefix = 'x-drawer';\r\nconst X_CONFIG_NAME = 'drawer';\r\n\r\n/**\r\n * Drawer Property\r\n */\r\n@Component({ template: '' })\r\nexport class XDrawerProperty extends XProperty {\r\n /**\r\n * @zh_CN 标题\r\n * @en_US Title\r\n */\r\n @Input() title?: XTemplate;\r\n /**\r\n * @zh_CN 显示/隐藏\r\n * @en_US Show/hide\r\n */\r\n @Input() @XInputBoolean() visible?: XBoolean;\r\n /**\r\n * @zh_CN 展示方向\r\n * @en_US Display direction\r\n */\r\n @Input() @XWithConfig<XPosition>(X_CONFIG_NAME, 'right') placement?: XPosition;\r\n /**\r\n * @zh_CN 尺寸,支持固定值\r\n * @en_US Size, supports fixed value\r\n */\r\n @Input() @XWithConfig<string>(X_CONFIG_NAME, '30%') size?: string;\r\n /**\r\n * @zh_CN 关闭的事件\r\n * @en_US Closed event\r\n */\r\n @Output() close = new EventEmitter();\r\n /**\r\n * @zh_CN 显示/隐藏的事件\r\n * @en_US Show/hide event\r\n */\r\n @Output() visibleChange = new EventEmitter<boolean>();\r\n}\r\n","import {\r\n Component,\r\n OnInit,\r\n ViewEncapsulation,\r\n Renderer2,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n ChangeDetectionStrategy,\r\n ViewChild,\r\n SimpleChanges,\r\n OnChanges,\r\n TemplateRef,\r\n ViewContainerRef\r\n} from '@angular/core';\r\nimport { XDrawerPrefix, XDrawerProperty } from './drawer.property';\r\nimport { XIsChange, XIsEmpty, XSlideAnimation, XConfigService } from '@ng-nest/ui/core';\r\nimport { XPortalService, XPortalOverlayRef } from '@ng-nest/ui/portal';\r\nimport { Subscription } from 'rxjs';\r\nimport { Overlay } from '@angular/cdk/overlay';\r\n\r\n@Component({\r\n selector: `${XDrawerPrefix}`,\r\n templateUrl: './drawer.component.html',\r\n styleUrls: ['./drawer.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n animations: [XSlideAnimation]\r\n})\r\nexport class XDrawerComponent extends XDrawerProperty implements OnInit, OnChanges {\r\n @ViewChild('drawerTpl', { static: true }) drawerTpl!: TemplateRef<void>;\r\n portal!: XPortalOverlayRef<any>;\r\n back$: Subscription | null = null;\r\n\r\n constructor(\r\n public renderer: Renderer2,\r\n public elementRef: ElementRef,\r\n public cdr: ChangeDetectorRef,\r\n public overlay: Overlay,\r\n public portalService: XPortalService,\r\n public viewContainerRef: ViewContainerRef,\r\n public configService: XConfigService\r\n ) {\r\n super();\r\n }\r\n\r\n ngOnInit() {\r\n this.setClassMap();\r\n }\r\n\r\n ngOnChanges(simples: SimpleChanges) {\r\n const { visible } = simples;\r\n XIsChange(visible) && this.setVisible();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.unsubscribe();\r\n }\r\n\r\n unsubscribe() {\r\n this.back$?.unsubscribe();\r\n }\r\n\r\n setClassMap() {\r\n this.classMap = {\r\n [`${XDrawerPrefix}-${this.placement}`]: !XIsEmpty(this.placement),\r\n [`${XDrawerPrefix}-no-title`]: XIsEmpty(this.title)\r\n };\r\n }\r\n\r\n setVisible() {\r\n if (this.visible) {\r\n this.createPortal();\r\n } else {\r\n this.closePortal();\r\n }\r\n }\r\n\r\n createPortal() {\r\n const width = this.placement === 'left' || this.placement === 'right' ? this.size : '100%';\r\n const height = this.placement === 'top' || this.placement === 'bottom' ? this.size : '100%';\r\n this.portal = this.portalService.attach({\r\n content: this.drawerTpl,\r\n viewContainerRef: this.viewContainerRef,\r\n overlayConfig: {\r\n hasBackdrop: true,\r\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\r\n positionStrategy: this.portalService.setPosition(this.placement, width, height)\r\n }\r\n });\r\n if (this.portal.overlayRef) this.back$ = this.portal.overlayRef.backdropClick().subscribe(() => this.closePortal());\r\n }\r\n\r\n portalAttached() {\r\n return this.portal?.overlayRef?.hasAttached();\r\n }\r\n\r\n closePortal() {\r\n if (this.portalAttached()) {\r\n this.portal?.overlayRef?.detach();\r\n this.unsubscribe();\r\n this.visibleChange.emit(this.visible as boolean);\r\n this.close.emit();\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n","<ng-template #drawerTpl>\r\n <div class=\"x-drawer\" [ngClass]=\"classMap\" [@x-slide-animation]=\"placement\">\r\n <div class=\"x-drawer-header\" *ngIf=\"title\">\r\n <div class=\"x-drawer-title\">\r\n <ng-container *xOutlet=\"title\">{{ title }}</ng-container>\r\n </div>\r\n <x-button class=\"x-drawer-close\" icon=\"fto-x\" (click)=\"closePortal()\" onlyIcon closable></x-button>\r\n </div>\r\n <div class=\"x-drawer-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</ng-template>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { XDrawerComponent } from './drawer.component';\r\nimport { XOutletModule } from '@ng-nest/ui/outlet';\r\nimport { XButtonModule } from '@ng-nest/ui/button';\r\nimport { XPortalModule } from '@ng-nest/ui/portal';\r\nimport { XDrawerProperty } from './drawer.property';\r\n\r\n@NgModule({\r\n declarations: [XDrawerComponent, XDrawerProperty],\r\n exports: [XDrawerComponent],\r\n imports: [CommonModule, XOutletModule, XButtonModule, XPortalModule]\r\n})\r\nexport class XDrawerModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA;;;;;MAKa,aAAa,GAAG,WAAW;AACxC,MAAM,aAAa,GAAG,QAAQ,CAAC;AAE/B;;;MAIa,eAAgB,SAAQ,SAAS;IAD9C;;;;;;QA0BY,UAAK,GAAG,IAAI,YAAY,EAAE,CAAC;;;;;QAK3B,kBAAa,GAAG,IAAI,YAAY,EAAW,CAAC;KACvD;;+HA/BY,eAAe;mHAAf,eAAe,8NADL,EAAE;AAWG;IAAhB,aAAa,EAAE;gDAAoB;AAKY;IAA/C,WAAW,CAAY,aAAa,EAAE,OAAO,CAAC;kDAAuB;AAK3B;IAA1C,WAAW,CAAS,aAAa,EAAE,KAAK,CAAC;6CAAe;2FApBvD,eAAe;kBAD3B,SAAS;mBAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;8BAMhB,KAAK;sBAAb,KAAK;gBAKoB,OAAO;sBAAhC,KAAK;gBAKmD,SAAS;sBAAjE,KAAK;gBAK8C,IAAI;sBAAvD,KAAK;gBAKI,KAAK;sBAAd,MAAM;gBAKG,aAAa;sBAAtB,MAAM;;;MCjBI,gBAAiB,SAAQ,eAAe;IAKnD,YACS,QAAmB,EACnB,UAAsB,EACtB,GAAsB,EACtB,OAAgB,EAChB,aAA6B,EAC7B,gBAAkC,EAClC,aAA6B;QAEpC,KAAK,EAAE,CAAC;QARD,aA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;oBACtC,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,UAAU,EAAE,CAAC,eAAe,CAAC;iBAC9B;wQAE2C,SAAS;sBAAlD,SAAS;uBAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;MEhB7B,aAAa;;6HAAb,aAAa;8HAAb,aAAa,iBAJT,gBAAgB,EAAE,eAAe,aAEtC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,aADzD,gBAAgB;8HAGf,aAAa,YAFf,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAC;2FAEzD,aAAa;kBALzB,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,gBAAgB,EAAE,eAAe,CAAC;oBACjD,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAC;iBACrE;;;ACZD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-drawer.js","sources":["../../../../lib/ng-nest/ui/drawer/drawer.property.ts","../../../../lib/ng-nest/ui/drawer/drawer.component.ts","../../../../lib/ng-nest/ui/drawer/drawer.component.html","../../../../lib/ng-nest/ui/drawer/drawer-container.component.ts","../../../../lib/ng-nest/ui/drawer/drawer-container.component.html","../../../../lib/ng-nest/ui/drawer/drawer-ref.ts","../../../../lib/ng-nest/ui/drawer/drawer-container.directives.ts","../../../../lib/ng-nest/ui/drawer/drawer.service.ts","../../../../lib/ng-nest/ui/drawer/drawer.module.ts","../../../../lib/ng-nest/ui/drawer/ng-nest-ui-drawer.ts"],"sourcesContent":["import { XTemplate, XPosition, XProperty, XInputBoolean, XBoolean, XWithConfig } from '@ng-nest/ui/core';\r\nimport { Input, Output, EventEmitter, Component, InjectionToken, ViewContainerRef } from '@angular/core';\r\nimport { XPortalOverlayRef } from '@ng-nest/ui/portal';\r\nimport { XDrawerContainerComponent } from './drawer-container.component';\r\nimport { XDrawerRef } from './drawer-ref';\r\n\r\n/**\r\n * Drawer\r\n * @selector x-drawer\r\n * @decorator component\r\n */\r\nexport const XDrawerPrefix = 'x-drawer';\r\nexport const X_DRAWER_CONFIG_NAME = 'drawer';\r\nexport const X_DRAWER_DATA = new InjectionToken<any>('XDrawerData');\r\n\r\n/**\r\n * Drawer Property\r\n */\r\n@Component({ template: '' })\r\nexport class XDrawerProperty extends XProperty {\r\n /**\r\n * @zh_CN 标题\r\n * @en_US Title\r\n */\r\n @Input() title?: XTemplate;\r\n /**\r\n * @zh_CN 显示/隐藏\r\n * @en_US Show/hide\r\n */\r\n @Input() @XInputBoolean() visible?: XBoolean;\r\n /**\r\n * @zh_CN 展示方向\r\n * @en_US Display direction\r\n */\r\n @Input() @XWithConfig<XPosition>(X_DRAWER_CONFIG_NAME, 'right') placement?: XPosition;\r\n /**\r\n * @zh_CN 尺寸,支持固定值\r\n * @en_US Size, supports fixed value\r\n */\r\n @Input() @XWithConfig<string>(X_DRAWER_CONFIG_NAME, '30%') size?: string;\r\n /**\r\n * @zh_CN 点击遮罩关闭\r\n * @en_US Click the mask to close\r\n */\r\n @Input() @XWithConfig<XBoolean>(X_DRAWER_CONFIG_NAME, true) backdropClose!: XBoolean;\r\n /**\r\n * @zh_CN 是否显示背景遮罩\r\n * @en_US Whether to display the background mask\r\n */\r\n @Input() @XWithConfig<XBoolean>(X_DRAWER_CONFIG_NAME, true) hasBackdrop!: XBoolean;\r\n /**\r\n * @zh_CN 自定义样式名\r\n * @en_US Custom style name\r\n */\r\n @Input() @XWithConfig<string>(X_DRAWER_CONFIG_NAME, '') className!: string;\r\n /**\r\n * @zh_CN 关闭的事件\r\n * @en_US Closed event\r\n */\r\n @Output() close = new EventEmitter();\r\n /**\r\n * @zh_CN 显示/隐藏的事件\r\n * @en_US Show/hide event\r\n */\r\n @Output() visibleChange = new EventEmitter<boolean>();\r\n}\r\n\r\n/**\r\n * Drawer Option\r\n */\r\nexport interface XDrawerOption {\r\n /**\r\n * @zh_CN 展示方向\r\n * @en_US Display direction\r\n * @default 'right'\r\n * @withConfig true\r\n */\r\n placement?: XPosition;\r\n /**\r\n * @zh_CN 尺寸,支持固定值\r\n * @en_US Size, supports fixed value\r\n * @default '30%'\r\n * @withConfig true\r\n */\r\n size?: string;\r\n /**\r\n * @zh_CN 自定义样式名\r\n * @en_US Custom style name\r\n */\r\n className?: string;\r\n /**\r\n * @zh_CN 点击遮罩关闭\r\n * @en_US Click the mask to close\r\n * @default true\r\n * @withConfig true\r\n */\r\n backdropClose?: boolean;\r\n /**\r\n * @zh_CN 是否显示背景遮罩\r\n * @en_US Whether to display the background mask\r\n * @default true\r\n * @withConfig true\r\n */\r\n hasBackdrop?: boolean;\r\n /**\r\n * @zh_CN 数据,通过 \"@Inject(X_DRAWER_DATA)\" 来接收数据\r\n * @en_US Data. Receive data by \"@Inject(X_DRAWER_DATA)\"\r\n */\r\n data?: any;\r\n /**\r\n * @en_US 视图容器实例可以包含其他视图容器。\r\n * @en_US A view container instance can contain other view containers.\r\n */\r\n viewContainerRef?: ViewContainerRef;\r\n}\r\n\r\n/**\r\n * @zh_CN 创建的抽屉对象\r\n * @en_US Drawer object created\r\n */\r\nexport interface XDrawerOverlayRef extends XPortalOverlayRef<XDrawerContainerComponent> {\r\n drawerRef?: XDrawerRef<any>;\r\n}\r\n\r\nexport type XDrawerAnimationState = XPosition | 'void';\r\n\r\nexport interface XDrawerAnimationEvent {\r\n state: XDrawerAnimationState;\r\n action: 'start' | 'done';\r\n totalTime: number;\r\n}\r\n","import {\r\n Component,\r\n OnInit,\r\n ViewEncapsulation,\r\n Renderer2,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n ChangeDetectionStrategy,\r\n ViewChild,\r\n SimpleChanges,\r\n OnChanges,\r\n TemplateRef,\r\n ViewContainerRef\r\n} from '@angular/core';\r\nimport { XDrawerPrefix, XDrawerProperty } from './drawer.property';\r\nimport { XIsChange, XIsEmpty, XSlideAnimation, XConfigService } from '@ng-nest/ui/core';\r\nimport { XPortalService, XPortalOverlayRef } from '@ng-nest/ui/portal';\r\nimport { Subscription } from 'rxjs';\r\nimport { Overlay } from '@angular/cdk/overlay';\r\n\r\n@Component({\r\n selector: `${XDrawerPrefix}`,\r\n templateUrl: './drawer.component.html',\r\n styleUrls: ['./drawer.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n animations: [XSlideAnimation]\r\n})\r\nexport class XDrawerComponent extends XDrawerProperty implements OnInit, OnChanges {\r\n @ViewChild('drawerTpl', { static: true }) drawerTpl!: TemplateRef<void>;\r\n portal!: XPortalOverlayRef<any>;\r\n back$: Subscription | null = null;\r\n\r\n constructor(\r\n public renderer: Renderer2,\r\n public elementRef: ElementRef,\r\n public cdr: ChangeDetectorRef,\r\n public overlay: Overlay,\r\n public portalService: XPortalService,\r\n public viewContainerRef: ViewContainerRef,\r\n public configService: XConfigService\r\n ) {\r\n super();\r\n }\r\n\r\n ngOnInit() {\r\n this.setClassMap();\r\n }\r\n\r\n ngOnChanges(simples: SimpleChanges) {\r\n const { visible } = simples;\r\n XIsChange(visible) && this.setVisible();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.unsubscribe();\r\n }\r\n\r\n unsubscribe() {\r\n this.back$?.unsubscribe();\r\n }\r\n\r\n setClassMap() {\r\n this.classMap = {\r\n [`${XDrawerPrefix}-${this.placement}`]: !XIsEmpty(this.placement),\r\n [`${XDrawerPrefix}-no-title`]: XIsEmpty(this.title)\r\n };\r\n }\r\n\r\n setVisible() {\r\n if (this.visible) {\r\n this.createPortal();\r\n } else {\r\n this.closePortal();\r\n }\r\n }\r\n\r\n createPortal() {\r\n const width = this.placement === 'left' || this.placement === 'right' ? this.size : '100%';\r\n const height = this.placement === 'top' || this.placement === 'bottom' ? this.size : '100%';\r\n this.portal = this.portalService.attach({\r\n content: this.drawerTpl,\r\n viewContainerRef: this.viewContainerRef,\r\n overlayConfig: {\r\n hasBackdrop: true,\r\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\r\n positionStrategy: this.portalService.setPosition(this.placement, width, height)\r\n }\r\n });\r\n if (this.portal.overlayRef) this.back$ = this.portal.overlayRef.backdropClick().subscribe(() => this.closePortal());\r\n }\r\n\r\n portalAttached() {\r\n return this.portal?.overlayRef?.hasAttached();\r\n }\r\n\r\n closePortal() {\r\n if (this.portalAttached()) {\r\n this.portal?.overlayRef?.detach();\r\n this.unsubscribe();\r\n this.visibleChange.emit(this.visible as boolean);\r\n this.close.emit();\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n","<ng-template #drawerTpl>\r\n <div class=\"x-drawer\" [ngClass]=\"classMap\" [@x-slide-animation]=\"placement\">\r\n <div class=\"x-drawer-header\" *ngIf=\"title\">\r\n <div class=\"x-drawer-title\">\r\n <ng-container *xOutlet=\"title\">{{ title }}</ng-container>\r\n </div>\r\n <x-button class=\"x-drawer-close\" icon=\"fto-x\" (click)=\"closePortal()\" onlyIcon closable></x-button>\r\n </div>\r\n <div class=\"x-drawer-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</ng-template>\r\n","import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ComponentRef,\r\n EmbeddedViewRef,\r\n EventEmitter,\r\n HostBinding,\r\n HostListener,\r\n ViewChild,\r\n ViewEncapsulation\r\n} from '@angular/core';\r\nimport { XSlideAnimation } from '@ng-nest/ui/core';\r\nimport { XDrawerAnimationEvent, XDrawerAnimationState } from './drawer.property';\r\nimport { AnimationEvent } from '@angular/animations';\r\n\r\n@Component({\r\n selector: 'x-drawer-container',\r\n templateUrl: './drawer-container.component.html',\r\n styleUrls: ['./drawer-container.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n animations: [XSlideAnimation]\r\n})\r\nexport class XDrawerContainerComponent extends BasePortalOutlet {\r\n @HostBinding('class.x-drawer-container') _has = true;\r\n @HostBinding('@x-slide-animation') public placement?: XDrawerAnimationState;\r\n @HostListener('@x-slide-animation.done', ['$event']) done({ toState, totalTime }: AnimationEvent) {\r\n this.animationChanged.next({ action: 'done', state: toState as XDrawerAnimationState, totalTime });\r\n }\r\n @HostListener('@x-slide-animation.start', ['$event']) start({ toState, totalTime }: AnimationEvent) {\r\n this.animationChanged.next({ action: 'start', state: toState as XDrawerAnimationState, totalTime });\r\n }\r\n @ViewChild(CdkPortalOutlet, { static: true }) portalOutlet!: CdkPortalOutlet;\r\n\r\n animationChanged = new EventEmitter<XDrawerAnimationEvent>();\r\n\r\n constructor() {\r\n super();\r\n }\r\n\r\n attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\r\n if (this.portalOutlet.hasAttached()) {\r\n throw Error('drawer portal has attached');\r\n }\r\n return this.portalOutlet.attachComponentPortal(portal);\r\n }\r\n attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C> {\r\n if (this.portalOutlet.hasAttached()) {\r\n throw Error('drawer portal has attached');\r\n }\r\n return this.portalOutlet.attachTemplatePortal(portal);\r\n }\r\n}\r\n","<ng-template cdkPortalOutlet></ng-template>\r\n","import { OverlayRef } from '@angular/cdk/overlay';\r\nimport { filter, take } from 'rxjs/operators';\r\nimport { XDrawerContainerComponent } from './drawer-container.component';\r\n\r\n// TODO: add more function\r\nexport class XDrawerRef<C> {\r\n componentInstance!: C;\r\n constructor(public overlayRef: OverlayRef, public containerInstance: XDrawerContainerComponent) {}\r\n close() {\r\n this.containerInstance.animationChanged\r\n .pipe(\r\n filter((event) => event.state === 'void' && event.action === 'done'),\r\n take(1)\r\n )\r\n .subscribe(() => {\r\n this.overlayRef.detach();\r\n });\r\n this.containerInstance.placement = 'void';\r\n }\r\n}\r\n","import { Directive, HostBinding, HostListener, Optional } from '@angular/core';\r\nimport { XDrawerRef } from './drawer-ref';\r\n\r\n@Directive({\r\n selector: `[x-drawer-close]`\r\n})\r\nexport class XDrawerCloseDirective {\r\n @HostListener('click', ['$event']) onCloseClick() {\r\n this.drawerRef && this.drawerRef.close();\r\n }\r\n constructor(@Optional() public drawerRef: XDrawerRef<any>) {}\r\n}\r\n\r\n@Directive({\r\n selector: `[x-drawer-title]`\r\n})\r\nexport class XDrawerTitleDirective {\r\n @HostBinding('class.x-drawer-container-title') _has = true;\r\n}\r\n\r\n@Directive({\r\n selector: `[x-drawer-content], x-drawer-content`\r\n})\r\nexport class XDrawerContentDirective {\r\n @HostBinding('class.x-drawer-container-content') _has = true;\r\n}\r\n","import { Overlay } from '@angular/cdk/overlay';\r\nimport { ComponentPortal, ComponentType, TemplatePortal } from '@angular/cdk/portal';\r\nimport { Injectable, TemplateRef } from '@angular/core';\r\nimport { fillDefault, XConfigService, XDrawerConfig } from '@ng-nest/ui/core';\r\nimport { XPortalService } from '@ng-nest/ui/portal';\r\nimport { XDrawerContainerComponent } from './drawer-container.component';\r\nimport { XDrawerRef } from './drawer-ref';\r\nimport { XDrawerOption, X_DRAWER_CONFIG_NAME, X_DRAWER_DATA } from './drawer.property';\r\n\r\n@Injectable()\r\nexport class XDrawerService {\r\n default: XDrawerOption = {\r\n placement: 'right',\r\n size: '30%',\r\n hasBackdrop: true,\r\n backdropClose: true\r\n };\r\n configDefault?: XDrawerConfig;\r\n\r\n constructor(public portalService: XPortalService, public configService: XConfigService, public overlay: Overlay) {\r\n this.configDefault = this.configService.getConfigForComponent(X_DRAWER_CONFIG_NAME);\r\n Object.assign(this.default, this.configDefault);\r\n }\r\n\r\n create<T>(content: TemplateRef<any> | ComponentType<T>, option: XDrawerOption = {}): XDrawerRef<T> {\r\n fillDefault(option, this.default);\r\n const width = ['left', 'right'].includes(option.placement as string) ? option.size : '100%';\r\n const height = ['top', 'bottom'].includes(option.placement as string) ? option.size : '100%';\r\n const portal = this.portalService.attach<XDrawerContainerComponent>({\r\n content: XDrawerContainerComponent,\r\n viewContainerRef: option.viewContainerRef,\r\n overlayConfig: {\r\n hasBackdrop: option.hasBackdrop,\r\n panelClass: option.className,\r\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\r\n positionStrategy: this.portalService.setPosition(option.placement, width, height)\r\n }\r\n });\r\n const { overlayRef, componentRef } = portal || {};\r\n const { instance } = componentRef! || {};\r\n instance.placement = option.placement;\r\n const drawerRef = new XDrawerRef<T>(overlayRef!, instance);\r\n if (content instanceof TemplateRef) {\r\n instance.attachTemplatePortal(\r\n new TemplatePortal(content, option.viewContainerRef!, { $implicit: option.data, drawerRef: drawerRef })\r\n );\r\n } else {\r\n const injector = this.portalService.createInjector([\r\n { provide: X_DRAWER_DATA, useValue: option.data },\r\n { provide: XDrawerRef, useValue: drawerRef }\r\n ]);\r\n\r\n instance.attachComponentPortal(new ComponentPortal(content, option.viewContainerRef, injector));\r\n }\r\n if (option.hasBackdrop && option.backdropClose && overlayRef)\r\n overlayRef.backdropClick().subscribe(() => {\r\n drawerRef.close();\r\n });\r\n\r\n return drawerRef;\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { XDrawerComponent } from './drawer.component';\r\nimport { XOutletModule } from '@ng-nest/ui/outlet';\r\nimport { XButtonModule } from '@ng-nest/ui/button';\r\nimport { XPortalModule } from '@ng-nest/ui/portal';\r\nimport { XDrawerProperty } from './drawer.property';\r\nimport { XDrawerService } from './drawer.service';\r\nimport { XDrawerContainerComponent } from './drawer-container.component';\r\nimport { XDrawerCloseDirective, XDrawerContentDirective, XDrawerTitleDirective } from './drawer-container.directives';\r\n\r\n@NgModule({\r\n declarations: [\r\n XDrawerComponent,\r\n XDrawerCloseDirective,\r\n XDrawerTitleDirective,\r\n XDrawerContentDirective,\r\n XDrawerContainerComponent,\r\n XDrawerProperty\r\n ],\r\n exports: [XDrawerComponent, XDrawerCloseDirective, XDrawerTitleDirective, XDrawerContentDirective, XDrawerContainerComponent],\r\n imports: [CommonModule, XOutletModule, XButtonModule, XPortalModule],\r\n providers: [XDrawerService]\r\n})\r\nexport class XDrawerModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAMA;;;;;MAKa,aAAa,GAAG,WAAW;MAC3B,oBAAoB,GAAG,SAAS;MAChC,aAAa,GAAG,IAAI,cAAc,CAAM,aAAa,EAAE;AAEpE;;;MAIa,eAAgB,SAAQ,SAAS;IAD9C;;;;;;QAyCY,UAAK,GAAG,IAAI,YAAY,EAAE,CAAC;;;;;QAK3B,kBAAa,GAAG,IAAI,YAAY,EAAW,CAAC;KACvD;;+HA9CY,eAAe;mHAAf,eAAe,kTADL,EAAE;AAWG;IAAhB,aAAa,EAAE;gDAAoB;AAKmB;IAAtD,WAAW,CAAY,oBAAoB,EAAE,OAAO,CAAC;kDAAuB;AAK3B;IAAjD,WAAW,CAAS,oBAAoB,EAAE,KAAK,CAAC;6CAAe;AAKb;IAAlD,WAAW,CAAW,oBAAoB,EAAE,IAAI,CAAC;sDAA0B;AAKzB;IAAlD,WAAW,CAAW,oBAAoB,EAAE,IAAI,CAAC;oDAAwB;AAK3B;IAA9C,WAAW,CAAS,oBAAoB,EAAE,EAAE,CAAC;kDAAoB;2FAnChE,eAAe;kBAD3B,SAAS;mBAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;8BAMhB,KAAK;sBAAb,KAAK;gBAKoB,OAAO;sBAAhC,KAAK;gBAK0D,SAAS;sBAAxE,KAAK;gBAKqD,IAAI;sBAA9D,KAAK;gBAKsD,aAAa;sBAAxE,KAAK;gBAKsD,WAAW;sBAAtE,KAAK;gBAKkD,SAAS;sBAAhE,KAAK;gBAKI,KAAK;sBAAd,MAAM;gBAKG,aAAa;sBAAtB,MAAM;;;MCpCI,gBAAiB,SAAQ,eAAe;IAKnD,YACS,QAAmB,EACnB,UAAsB,EACtB,GAAsB,EACtB,OAAgB,EAChB,aAA6B,EAC7B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AC;iBAC5B;;;ACvBD;;;;;;"}
|
|
@@ -133,7 +133,7 @@ class XFindProperty extends XControlValueAccessor {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
/** @nocollapse */ XFindProperty.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XFindProperty, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
136
|
-
/** @nocollapse */ XFindProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XFindProperty, selector: "ng-component", inputs: { size: "size", bordered: "bordered", multiple: "multiple", columnLabel: "columnLabel", dialogTitle: "dialogTitle", dialogWidth: "dialogWidth", dialogHeight: "dialogHeight", dialogVisible: "dialogVisible", dialogButtonsCenter: "dialogButtonsCenter", tableData: "tableData", tableIndex: "tableIndex", tableSize: "tableSize", tableQuery: "tableQuery", tableTotal: "tableTotal", tableColumns: "tableColumns", tableActivatedRow: "tableActivatedRow", tableCheckedRow: "tableCheckedRow", tableLoading: "tableLoading", tableVirtualScroll: "tableVirtualScroll", tableBodyHeight: "tableBodyHeight", tableMinBufferPx: "tableMinBufferPx", tableMaxBufferPx: "tableMaxBufferPx", tableAdaptionHeight: "tableAdaptionHeight", tableDocPercent: "tableDocPercent", tableRowHeight: "tableRowHeight", treeData: "treeData", treeActivatedId: "treeActivatedId", treeExpandedLevel: "treeExpandedLevel", treeChecked: "treeChecked", treeCheckbox: "treeCheckbox", treeTableConnect: "treeTableConnect", search: "search" }, outputs: { dialogVisibleChange: "dialogVisibleChange", tableIndexChange: "tableIndexChange", tableSizeChange: "tableSizeChange", tableSortChange: "tableSortChange", tableRowEmit: "tableRowEmit", treeActivatedChange: "treeActivatedChange" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
136
|
+
/** @nocollapse */ XFindProperty.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XFindProperty, selector: "ng-component", inputs: { size: "size", bordered: "bordered", multiple: "multiple", columnLabel: "columnLabel", dialogTitle: "dialogTitle", dialogCheckboxLabel: "dialogCheckboxLabel", dialogCheckboxWidth: "dialogCheckboxWidth", dialogEmptyContent: "dialogEmptyContent", dialogWidth: "dialogWidth", dialogHeight: "dialogHeight", dialogVisible: "dialogVisible", dialogButtonsCenter: "dialogButtonsCenter", tableData: "tableData", tableIndex: "tableIndex", tableSize: "tableSize", tableQuery: "tableQuery", tableTotal: "tableTotal", tableColumns: "tableColumns", tableActivatedRow: "tableActivatedRow", tableCheckedRow: "tableCheckedRow", tableLoading: "tableLoading", tableVirtualScroll: "tableVirtualScroll", tableBodyHeight: "tableBodyHeight", tableMinBufferPx: "tableMinBufferPx", tableMaxBufferPx: "tableMaxBufferPx", tableAdaptionHeight: "tableAdaptionHeight", tableDocPercent: "tableDocPercent", tableRowHeight: "tableRowHeight", treeData: "treeData", treeActivatedId: "treeActivatedId", treeExpandedLevel: "treeExpandedLevel", treeChecked: "treeChecked", treeCheckbox: "treeCheckbox", treeTableConnect: "treeTableConnect", search: "search" }, outputs: { dialogVisibleChange: "dialogVisibleChange", tableIndexChange: "tableIndexChange", tableSizeChange: "tableSizeChange", tableSortChange: "tableSortChange", tableRowEmit: "tableRowEmit", treeActivatedChange: "treeActivatedChange" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
137
137
|
__decorate([
|
|
138
138
|
XWithConfig(X_CONFIG_NAME, 'medium')
|
|
139
139
|
], XFindProperty.prototype, "size", void 0);
|
|
@@ -150,6 +150,16 @@ __decorate([
|
|
|
150
150
|
__decorate([
|
|
151
151
|
XWithConfig(X_CONFIG_NAME, '查找选择')
|
|
152
152
|
], XFindProperty.prototype, "dialogTitle", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
XWithConfig(X_CONFIG_NAME, '选择')
|
|
155
|
+
], XFindProperty.prototype, "dialogCheckboxLabel", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
XWithConfig(X_CONFIG_NAME, 60),
|
|
158
|
+
XInputNumber()
|
|
159
|
+
], XFindProperty.prototype, "dialogCheckboxWidth", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
XWithConfig(X_CONFIG_NAME, '请选择数据')
|
|
162
|
+
], XFindProperty.prototype, "dialogEmptyContent", void 0);
|
|
153
163
|
__decorate([
|
|
154
164
|
XInputBoolean()
|
|
155
165
|
], XFindProperty.prototype, "dialogVisible", void 0);
|
|
@@ -207,6 +217,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImpor
|
|
|
207
217
|
type: Input
|
|
208
218
|
}], dialogTitle: [{
|
|
209
219
|
type: Input
|
|
220
|
+
}], dialogCheckboxLabel: [{
|
|
221
|
+
type: Input
|
|
222
|
+
}], dialogCheckboxWidth: [{
|
|
223
|
+
type: Input
|
|
224
|
+
}], dialogEmptyContent: [{
|
|
225
|
+
type: Input
|
|
210
226
|
}], dialogWidth: [{
|
|
211
227
|
type: Input
|
|
212
228
|
}], dialogHeight: [{
|
|
@@ -378,7 +394,16 @@ class XFindComponent extends XFindProperty {
|
|
|
378
394
|
return;
|
|
379
395
|
if (this.hasTable) {
|
|
380
396
|
if (!this.tableColumns.find((x) => x.rowChecked)) {
|
|
381
|
-
this.tableColumns = [
|
|
397
|
+
this.tableColumns = [
|
|
398
|
+
{
|
|
399
|
+
id: '$checked',
|
|
400
|
+
label: this.dialogCheckboxLabel,
|
|
401
|
+
rowChecked: true,
|
|
402
|
+
type: 'checkbox',
|
|
403
|
+
width: this.dialogCheckboxWidth
|
|
404
|
+
},
|
|
405
|
+
...this.tableColumns
|
|
406
|
+
];
|
|
382
407
|
}
|
|
383
408
|
}
|
|
384
409
|
}
|
|
@@ -582,7 +607,7 @@ class XFindComponent extends XFindProperty {
|
|
|
582
607
|
}
|
|
583
608
|
}
|
|
584
609
|
/** @nocollapse */ XFindComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XFindComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.XConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
585
|
-
/** @nocollapse */ XFindComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XFindComponent, selector: "x-find", providers: [XValueAccessor(XFindComponent)], viewQueries: [{ propertyName: "find", first: true, predicate: ["find"], descendants: true, static: true }, { propertyName: "dialogCom", first: true, predicate: ["dialogCom"], descendants: true }, { propertyName: "tableCom", first: true, predicate: ["tableCom"], descendants: true }, { propertyName: "treeCom", first: true, predicate: ["treeCom"], descendants: true }, { propertyName: "buttonCom", first: true, predicate: ["buttonCom"], descendants: true }, { propertyName: "tableRef", first: true, predicate: ["tableRef"], descendants: true }, { propertyName: "treeRef", first: true, predicate: ["treeRef"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\r\n #find\r\n class=\"x-find\"\r\n [class.x-flex]=\"justify || align || direction\"\r\n [class.x-checked]=\"value\"\r\n [class.x-disabled]=\"disabled\"\r\n [class.x-required]=\"requiredIsEmpty\"\r\n [class.x-invalid]=\"invalid\"\r\n [ngClass]=\"classMap\"\r\n>\r\n <label *ngIf=\"label\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-find-row\">\r\n <x-button #buttonCom icon=\"fto-search\" [onlyIcon]=\"!bordered\" [size]=\"size\" [disabled]=\"disabled\" (click)=\"showModal()\"></x-button>\r\n <div class=\"x-find-tags\">\r\n <ng-container *ngIf=\"multiple; else singleTpl\">\r\n <x-tag\r\n *ngFor=\"let item of value; index as i; trackBy: trackByItem\"\r\n closable\r\n [size]=\"size\"\r\n [bordered]=\"bordered\"\r\n [disabled]=\"disabled\"\r\n (close)=\"tagClose(i)\"\r\n >{{ item[columnLabel] }}</x-tag\r\n >\r\n </ng-container>\r\n <ng-template #singleTpl>\r\n <x-tag *ngIf=\"value\" closable [disabled]=\"disabled\" [bordered]=\"bordered\" [size]=\"size\" (close)=\"tagClose()\">{{\r\n value[columnLabel]\r\n }}</x-tag>\r\n </ng-template>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<x-dialog\r\n #dialogCom\r\n [title]=\"dialogTitle\"\r\n [width]=\"dialogWidth\"\r\n [height]=\"dialogHeight\"\r\n [buttonsCenter]=\"dialogButtonsCenter\"\r\n [(visible)]=\"dialogVisible\"\r\n (visibleChange)=\"dialogVisibleChange.emit($event)\"\r\n (closeDone)=\"dialogCloseDone()\"\r\n (cancel)=\"closeModal()\"\r\n (close)=\"closeModal()\"\r\n (confirm)=\"sure()\"\r\n>\r\n <div class=\"x-find-dialog\" [class.x-find-dialog-tree-table]=\"hasTable && hasTree\">\r\n <div class=\"x-find-dialog-tree\" *ngIf=\"hasTree\" #treeRef [style.height.px]=\"hasTreeTable && multiple && height\">\r\n <x-tree\r\n #treeCom\r\n [data]=\"treeData\"\r\n nodeHeight=\"1.8\"\r\n [(manual)]=\"dialogVisible\"\r\n [activatedId]=\"treeActivatedId\"\r\n [expandedLevel]=\"treeExpandedLevel\"\r\n (activatedChange)=\"treeActivatedClick($event)\"\r\n [checkbox]=\"hasTreeMultiple\"\r\n [checked]=\"treeChecked\"\r\n (checkboxChange)=\"treeCheckboxChange($event)\"\r\n [levelCheck]=\"!hasTreeMultiple\"\r\n ></x-tree>\r\n </div>\r\n <div class=\"x-find-dialog-table\" *ngIf=\"hasTable\" #tableRef>\r\n <div class=\"x-find-search\" *ngIf=\"hasSearch\">\r\n <x-input [label]=\"search.label\" direction=\"row\" (xKeydown)=\"searchKeyDown($event)\" [(ngModel)]=\"search.value\"></x-input>\r\n <x-button type=\"primary\" plain (click)=\"searchClick()\">{{ search.button || '\u67E5\u8BE2' }}</x-button>\r\n </div>\r\n <x-table\r\n #tableCom\r\n [data]=\"tableData\"\r\n [columns]=\"tableColumns\"\r\n [(manual)]=\"dialogVisible\"\r\n [(index)]=\"tableIndex\"\r\n [(size)]=\"tableSize\"\r\n [query]=\"tableQuery\"\r\n [total]=\"tableTotal\"\r\n [allowSelectRow]=\"!multiple\"\r\n [checkedRow]=\"tableCheckedRow\"\r\n [loading]=\"tableLoading\"\r\n (indexChange)=\"tableIndexChange.emit($event)\"\r\n (sortChange)=\"tableSortChange.emit($event)\"\r\n [(activatedRow)]=\"tableActivatedRow\"\r\n (activatedRowChange)=\"tableActivatedRowChange($event)\"\r\n [rowHeight]=\"tableRowHeight\"\r\n [bodyHeight]=\"tableBodyHeight\"\r\n [virtualScroll]=\"tableVirtualScroll\"\r\n [minBufferPx]=\"tableMinBufferPx\"\r\n [maxBufferPx]=\"tableMaxBufferPx\"\r\n [adaptionHeight]=\"tableAdaptionHeight\"\r\n [docPercent]=\"tableDocPercent\"\r\n ></x-table>\r\n </div>\r\n <div *ngIf=\"multiple\" class=\"x-find-dialog-checked\" [class.x-find-empty]=\"getEmpty\" [style.height.px]=\"height\">\r\n <x-empty *ngIf=\"getEmpty\" content=\"\
|
|
610
|
+
/** @nocollapse */ XFindComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XFindComponent, selector: "x-find", providers: [XValueAccessor(XFindComponent)], viewQueries: [{ propertyName: "find", first: true, predicate: ["find"], descendants: true, static: true }, { propertyName: "dialogCom", first: true, predicate: ["dialogCom"], descendants: true }, { propertyName: "tableCom", first: true, predicate: ["tableCom"], descendants: true }, { propertyName: "treeCom", first: true, predicate: ["treeCom"], descendants: true }, { propertyName: "buttonCom", first: true, predicate: ["buttonCom"], descendants: true }, { propertyName: "tableRef", first: true, predicate: ["tableRef"], descendants: true }, { propertyName: "treeRef", first: true, predicate: ["treeRef"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\r\n #find\r\n class=\"x-find\"\r\n [class.x-flex]=\"justify || align || direction\"\r\n [class.x-checked]=\"value\"\r\n [class.x-disabled]=\"disabled\"\r\n [class.x-required]=\"requiredIsEmpty\"\r\n [class.x-invalid]=\"invalid\"\r\n [ngClass]=\"classMap\"\r\n>\r\n <label *ngIf=\"label\" [style.width]=\"labelWidth\" [ngClass]=\"labelMap\">{{ label }}</label>\r\n <div class=\"x-find-row\">\r\n <x-button #buttonCom icon=\"fto-search\" [onlyIcon]=\"!bordered\" [size]=\"size\" [disabled]=\"disabled\" (click)=\"showModal()\"></x-button>\r\n <div class=\"x-find-tags\">\r\n <ng-container *ngIf=\"multiple; else singleTpl\">\r\n <x-tag\r\n *ngFor=\"let item of value; index as i; trackBy: trackByItem\"\r\n closable\r\n [size]=\"size\"\r\n [bordered]=\"bordered\"\r\n [disabled]=\"disabled\"\r\n (close)=\"tagClose(i)\"\r\n >{{ item[columnLabel] }}</x-tag\r\n >\r\n </ng-container>\r\n <ng-template #singleTpl>\r\n <x-tag *ngIf=\"value\" closable [disabled]=\"disabled\" [bordered]=\"bordered\" [size]=\"size\" (close)=\"tagClose()\">{{\r\n value[columnLabel]\r\n }}</x-tag>\r\n </ng-template>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<x-dialog\r\n #dialogCom\r\n [title]=\"dialogTitle\"\r\n [width]=\"dialogWidth\"\r\n [height]=\"dialogHeight\"\r\n [buttonsCenter]=\"dialogButtonsCenter\"\r\n [(visible)]=\"dialogVisible\"\r\n (visibleChange)=\"dialogVisibleChange.emit($event)\"\r\n (closeDone)=\"dialogCloseDone()\"\r\n (cancel)=\"closeModal()\"\r\n (close)=\"closeModal()\"\r\n (confirm)=\"sure()\"\r\n>\r\n <div class=\"x-find-dialog\" [class.x-find-dialog-tree-table]=\"hasTable && hasTree\">\r\n <div class=\"x-find-dialog-tree\" *ngIf=\"hasTree\" #treeRef [style.height.px]=\"hasTreeTable && multiple && height\">\r\n <x-tree\r\n #treeCom\r\n [data]=\"treeData\"\r\n nodeHeight=\"1.8\"\r\n [(manual)]=\"dialogVisible\"\r\n [activatedId]=\"treeActivatedId\"\r\n [expandedLevel]=\"treeExpandedLevel\"\r\n (activatedChange)=\"treeActivatedClick($event)\"\r\n [checkbox]=\"hasTreeMultiple\"\r\n [checked]=\"treeChecked\"\r\n (checkboxChange)=\"treeCheckboxChange($event)\"\r\n [levelCheck]=\"!hasTreeMultiple\"\r\n ></x-tree>\r\n </div>\r\n <div class=\"x-find-dialog-table\" *ngIf=\"hasTable\" #tableRef>\r\n <div class=\"x-find-search\" *ngIf=\"hasSearch\">\r\n <x-input [label]=\"search.label\" direction=\"row\" (xKeydown)=\"searchKeyDown($event)\" [(ngModel)]=\"search.value\"></x-input>\r\n <x-button type=\"primary\" plain (click)=\"searchClick()\">{{ search.button || '\u67E5\u8BE2' }}</x-button>\r\n </div>\r\n <x-table\r\n #tableCom\r\n [data]=\"tableData\"\r\n [columns]=\"tableColumns\"\r\n [(manual)]=\"dialogVisible\"\r\n [(index)]=\"tableIndex\"\r\n [(size)]=\"tableSize\"\r\n [query]=\"tableQuery\"\r\n [total]=\"tableTotal\"\r\n [allowSelectRow]=\"!multiple\"\r\n [checkedRow]=\"tableCheckedRow\"\r\n [loading]=\"tableLoading\"\r\n (indexChange)=\"tableIndexChange.emit($event)\"\r\n (sortChange)=\"tableSortChange.emit($event)\"\r\n [(activatedRow)]=\"tableActivatedRow\"\r\n (activatedRowChange)=\"tableActivatedRowChange($event)\"\r\n [rowHeight]=\"tableRowHeight\"\r\n [bodyHeight]=\"tableBodyHeight\"\r\n [virtualScroll]=\"tableVirtualScroll\"\r\n [minBufferPx]=\"tableMinBufferPx\"\r\n [maxBufferPx]=\"tableMaxBufferPx\"\r\n [adaptionHeight]=\"tableAdaptionHeight\"\r\n [docPercent]=\"tableDocPercent\"\r\n ></x-table>\r\n </div>\r\n <div *ngIf=\"multiple\" class=\"x-find-dialog-checked\" [class.x-find-empty]=\"getEmpty\" [style.height.px]=\"height\">\r\n <x-empty *ngIf=\"getEmpty\" [content]=\"dialogEmptyContent\"></x-empty>\r\n <div class=\"x-find-dialog-tags\">\r\n <x-tag *ngFor=\"let item of temp; index as i; trackBy: trackByItem\" closable (close)=\"tempClose(i, item)\">\r\n <span>{{ item[columnLabel] }}</span>\r\n </x-tag>\r\n </div>\r\n </div>\r\n </div>\r\n</x-dialog>\r\n\r\n<ng-template #treeLabelTpl let-node=\"$node\">\r\n <div class=\"x-find-dialog-tree-node\">\r\n <span>{{ node.label }} </span>\r\n <x-icon type=\"fto-check\" *ngIf=\"node.$checked\"></x-icon>\r\n </div>\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";.x-find{margin:0;padding:0;width:100%}.x-find.x-flex{display:flex}.x-find.x-justify-start{justify-content:flex-start}.x-find.x-justify-center{justify-content:center}.x-find.x-justify-end{justify-content:flex-end}.x-find.x-justify-space-between{justify-content:space-between}.x-find.x-justify-space-around{justify-content:space-around}.x-find.x-align-start{align-items:flex-start}.x-find.x-align-center{align-items:center}.x-find.x-align-end{align-items:flex-end}.x-find.x-direction-column{flex-direction:column}.x-find.x-direction-column-reverse{flex-direction:column-reverse}.x-find.x-direction-row{flex-direction:row}.x-find.x-direction-row-reverse{flex-direction:row-reverse}.x-find>label{display:inline-block;white-space:nowrap;position:relative;color:var(--x-text-300);font-weight:600}.x-find>label.x-text-align-start{text-align:start}.x-find>label.x-text-align-center{text-align:center}.x-find>label.x-text-align-end{text-align:end}.x-find-row{flex:1;display:flex;align-items:flex-start;position:relative}.x-find-tags{margin:-.0625rem -.0625rem -.0625rem .4375rem}.x-find-tags>x-tag{margin:.0625rem}.x-find.x-required>label{color:var(--x-danger)}.x-find.x-direction-row>label{padding:0 .5rem 0 0}.x-find.x-direction-row-reverse>label{padding:0 0 0 .5rem}.x-find.x-direction-column{align-items:inherit}.x-find.x-direction-column-reverse{align-items:inherit}.x-find-big>label{height:var(--x-height-big);line-height:var(--x-height-big)}.x-find-large>label{height:var(--x-height-large);line-height:var(--x-height-large)}.x-find-medium>label{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-find-small>label{height:var(--x-height-small);line-height:var(--x-height-small)}.x-find-small .x-find-tags{margin-top:-.1875rem}.x-find-small .x-find-tags>x-tag{margin-top:.125rem}.x-find-mini>label{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-find-mini .x-find-tags{margin-top:-.25rem}.x-find-mini .x-find-tags>x-tag{margin-top:.125rem}.x-find-dialog{flex:1;display:flex}.x-find-dialog-table{flex:1;min-height:18.75rem;height:-moz-fit-content;height:fit-content}.x-find-dialog-tree{flex:1;min-height:18.75rem;max-height:25rem;overflow-y:auto}.x-find-dialog-tree .x-tree-node-content.x-activated{color:var(--x-primary)}.x-find-dialog-tree-node{flex:1;display:flex;align-items:center;justify-content:space-between}.x-find-dialog-tree-node>span{flex:1;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-user-select:none;user-select:none}.x-find-dialog-tree-table .x-find-dialog-tree{flex:initial;min-height:initial;max-height:initial;width:14rem;margin-right:1rem;padding-right:1rem;border-right:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-find-dialog-checked{margin-left:1rem;border-left:var(--x-border-width) var(--x-border-style) var(--x-border);padding-left:1rem;width:10rem;overflow-y:auto;height:100%}.x-find-dialog-checked x-tag{display:block}.x-find-dialog-checked x-tag:not(:first-child){margin-top:.5rem}.x-find-dialog-checked x-tag .x-tag{width:100%;display:flex;justify-content:space-between}.x-find-dialog-checked x-tag .x-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.x-find-dialog-checked.x-find-empty{display:flex;align-items:center;justify-content:center}.x-find-search{display:flex;padding:.3rem}.x-find-search .x-input,.x-find-search x-input{width:15rem}.x-find-search .x-button{margin-left:.5rem}\n"], components: [{ type: i2.XButtonComponent, selector: "x-button" }, { type: i3.XTagComponent, selector: "x-tag" }, { type: i4.XDialogComponent, selector: "x-dialog" }, { type: i5.XTreeComponent, selector: "x-tree" }, { type: i6.XInputComponent, selector: "x-input" }, { type: i7.XTableComponent, selector: "x-table" }, { type: i8.XEmptyComponent, selector: "x-empty" }, { type: i9.XIconComponent, selector: "x-icon" }], directives: [{ type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i11.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
586
611
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: XFindComponent, decorators: [{
|
|
587
612
|
type: Component,
|
|
588
613
|
args: [{
|