@ng-nest/ui 12.0.11 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/bundles/ng-nest-ui-alert.umd.js +1 -1
  2. package/bundles/ng-nest-ui-alert.umd.js.map +1 -1
  3. package/bundles/ng-nest-ui-core.umd.js.map +1 -1
  4. package/bundles/ng-nest-ui-dialog.umd.js +284 -32
  5. package/bundles/ng-nest-ui-dialog.umd.js.map +1 -1
  6. package/bundles/ng-nest-ui-drawer.umd.js +245 -14
  7. package/bundles/ng-nest-ui-drawer.umd.js.map +1 -1
  8. package/bundles/ng-nest-ui-input.umd.js +2 -1
  9. package/bundles/ng-nest-ui-input.umd.js.map +1 -1
  10. package/bundles/ng-nest-ui-message.umd.js +3 -3
  11. package/bundles/ng-nest-ui-message.umd.js.map +1 -1
  12. package/bundles/ng-nest-ui-portal.umd.js +8 -8
  13. package/bundles/ng-nest-ui-portal.umd.js.map +1 -1
  14. package/bundles/ng-nest-ui-progress.umd.js +235 -20
  15. package/bundles/ng-nest-ui-progress.umd.js.map +1 -1
  16. package/bundles/ng-nest-ui-select.umd.js +1 -1
  17. package/bundles/ng-nest-ui-steps.umd.js +19 -7
  18. package/bundles/ng-nest-ui-steps.umd.js.map +1 -1
  19. package/bundles/ng-nest-ui-table.umd.js.map +1 -1
  20. package/core/config/config.d.ts +4 -0
  21. package/dialog/dialog-container.component.d.ts +18 -0
  22. package/dialog/dialog-container.directives.d.ts +24 -0
  23. package/dialog/dialog-ref.d.ts +9 -0
  24. package/dialog/dialog.module.d.ts +13 -11
  25. package/dialog/dialog.property.d.ts +84 -6
  26. package/dialog/dialog.service.d.ts +19 -0
  27. package/dialog/public-api.d.ts +4 -0
  28. package/drawer/drawer-container.component.d.ts +18 -0
  29. package/drawer/drawer-container.directives.d.ts +19 -0
  30. package/drawer/drawer-ref.d.ts +9 -0
  31. package/drawer/drawer.module.d.ts +8 -6
  32. package/drawer/drawer.property.d.ts +83 -2
  33. package/drawer/drawer.service.d.ts +19 -0
  34. package/drawer/public-api.d.ts +5 -0
  35. package/esm2015/alert/alert.component.js +2 -2
  36. package/esm2015/core/config/config.js +1 -1
  37. package/esm2015/dialog/dialog-container.component.js +59 -0
  38. package/esm2015/dialog/dialog-container.directives.js +73 -0
  39. package/esm2015/dialog/dialog-ref.js +17 -0
  40. package/esm2015/dialog/dialog.component.js +2 -2
  41. package/esm2015/dialog/dialog.module.js +37 -7
  42. package/esm2015/dialog/dialog.property.js +17 -16
  43. package/esm2015/dialog/dialog.service.js +67 -0
  44. package/esm2015/dialog/public-api.js +5 -1
  45. package/esm2015/drawer/drawer-container.component.js +59 -0
  46. package/esm2015/drawer/drawer-container.directives.js +57 -0
  47. package/esm2015/drawer/drawer-ref.js +17 -0
  48. package/esm2015/drawer/drawer.component.js +2 -2
  49. package/esm2015/drawer/drawer.module.js +22 -6
  50. package/esm2015/drawer/drawer.property.js +22 -6
  51. package/esm2015/drawer/drawer.service.js +65 -0
  52. package/esm2015/drawer/public-api.js +6 -1
  53. package/esm2015/input/input.component.js +3 -2
  54. package/esm2015/message/message.property.js +2 -2
  55. package/esm2015/message/message.service.js +3 -3
  56. package/esm2015/portal/portal.module.js +4 -3
  57. package/esm2015/portal/portal.service.js +8 -9
  58. package/esm2015/progress/progress.component.js +177 -15
  59. package/esm2015/progress/progress.property.js +50 -3
  60. package/esm2015/select/select.component.js +1 -1
  61. package/esm2015/steps/steps.component.js +14 -7
  62. package/esm2015/steps/steps.property.js +8 -3
  63. package/esm2015/table/table.property.js +1 -1
  64. package/fesm2015/ng-nest-ui-alert.js +1 -1
  65. package/fesm2015/ng-nest-ui-alert.js.map +1 -1
  66. package/fesm2015/ng-nest-ui-core.js.map +1 -1
  67. package/fesm2015/ng-nest-ui-dialog.js +254 -25
  68. package/fesm2015/ng-nest-ui-dialog.js.map +1 -1
  69. package/fesm2015/ng-nest-ui-drawer.js +224 -13
  70. package/fesm2015/ng-nest-ui-drawer.js.map +1 -1
  71. package/fesm2015/ng-nest-ui-input.js +2 -1
  72. package/fesm2015/ng-nest-ui-input.js.map +1 -1
  73. package/fesm2015/ng-nest-ui-message.js +3 -3
  74. package/fesm2015/ng-nest-ui-message.js.map +1 -1
  75. package/fesm2015/ng-nest-ui-portal.js +10 -10
  76. package/fesm2015/ng-nest-ui-portal.js.map +1 -1
  77. package/fesm2015/ng-nest-ui-progress.js +225 -17
  78. package/fesm2015/ng-nest-ui-progress.js.map +1 -1
  79. package/fesm2015/ng-nest-ui-select.js +1 -1
  80. package/fesm2015/ng-nest-ui-steps.js +20 -8
  81. package/fesm2015/ng-nest-ui-steps.js.map +1 -1
  82. package/fesm2015/ng-nest-ui-table.js.map +1 -1
  83. package/message/message.property.d.ts +1 -1
  84. package/package.json +1 -1
  85. package/portal/portal.module.d.ts +1 -1
  86. package/portal/portal.service.d.ts +2 -3
  87. package/progress/progress.component.d.ts +31 -3
  88. package/progress/progress.property.d.ts +80 -5
  89. package/steps/steps.property.d.ts +7 -2
  90. package/table/table.property.d.ts +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ng-nest/ui/core'), require('@ng-nest/ui/alert'), require('rxjs'), require('rxjs/operators'), require('@ng-nest/ui/portal'), require('@ng-nest/ui/i18n'), require('@ng-nest/ui/button'), require('@ng-nest/ui/outlet'), require('@angular/common'), require('@ng-nest/ui/icon'), require('@angular/forms'), require('@ng-nest/ui/input'), require('@angular/cdk/drag-drop')) :
3
- typeof define === 'function' && define.amd ? define('@ng-nest/ui/dialog', ['exports', '@angular/core', '@ng-nest/ui/core', '@ng-nest/ui/alert', 'rxjs', 'rxjs/operators', '@ng-nest/ui/portal', '@ng-nest/ui/i18n', '@ng-nest/ui/button', '@ng-nest/ui/outlet', '@angular/common', '@ng-nest/ui/icon', '@angular/forms', '@ng-nest/ui/input', '@angular/cdk/drag-drop'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["ng-nest"] = global["ng-nest"] || {}, global["ng-nest"].ui = global["ng-nest"].ui || {}, global["ng-nest"].ui.dialog = {}), global.ng.core, global["ng-nest"].ui.core, global["ng-nest"].ui.alert, global.rxjs, global.rxjs.operators, global["ng-nest"].ui.portal, global["ng-nest"].ui.i18n, global["ng-nest"].ui.button, global["ng-nest"].ui.outlet, global.ng.common, global["ng-nest"].ui.icon, global.ng.forms, global["ng-nest"].ui.input, global.ng.cdk.dragDrop));
5
- })(this, (function (exports, i0, core, i3, rxjs, operators, i1, i2, i4, i5, i6, icon, forms, input, dragDrop) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ng-nest/ui/core'), require('@ng-nest/ui/alert'), require('rxjs'), require('rxjs/operators'), require('@ng-nest/ui/portal'), require('@ng-nest/ui/i18n'), require('@ng-nest/ui/button'), require('@ng-nest/ui/outlet'), require('@angular/common'), require('@angular/cdk/portal'), require('@ng-nest/ui/icon'), require('@angular/forms'), require('@ng-nest/ui/input'), require('@angular/cdk/drag-drop'), require('@angular/cdk/overlay')) :
3
+ typeof define === 'function' && define.amd ? define('@ng-nest/ui/dialog', ['exports', '@angular/core', '@ng-nest/ui/core', '@ng-nest/ui/alert', 'rxjs', 'rxjs/operators', '@ng-nest/ui/portal', '@ng-nest/ui/i18n', '@ng-nest/ui/button', '@ng-nest/ui/outlet', '@angular/common', '@angular/cdk/portal', '@ng-nest/ui/icon', '@angular/forms', '@ng-nest/ui/input', '@angular/cdk/drag-drop', '@angular/cdk/overlay'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["ng-nest"] = global["ng-nest"] || {}, global["ng-nest"].ui = global["ng-nest"].ui || {}, global["ng-nest"].ui.dialog = {}), global.ng.core, global["ng-nest"].ui.core, global["ng-nest"].ui.alert, global.rxjs, global.rxjs.operators, global["ng-nest"].ui.portal, global["ng-nest"].ui.i18n, global["ng-nest"].ui.button, global["ng-nest"].ui.outlet, global.ng.common, global.ng.cdk.portal, global["ng-nest"].ui.icon, global.ng.forms, global["ng-nest"].ui.input, global.ng.cdk.dragDrop, global.ng.cdk.overlay));
5
+ })(this, (function (exports, i0, i2, i3, rxjs, operators, i1, i2$1, i4, i5, i6, i1$1, icon, forms, input, dragDrop, i3$1) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -23,12 +23,15 @@
23
23
  }
24
24
 
25
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2);
26
27
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
27
28
  var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
28
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
29
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2$1);
29
30
  var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
30
31
  var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
31
32
  var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
33
+ var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
34
+ var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
32
35
 
33
36
  /*! *****************************************************************************
34
37
  Copyright (c) Microsoft Corporation.
@@ -354,8 +357,9 @@
354
357
  * @decorator component
355
358
  */
356
359
  var XDialogPrefix = 'x-dialog';
357
- var X_CONFIG_NAME = 'dialog';
360
+ var X_DIALOG_CONFIG_NAME = 'dialog';
358
361
  var XDialogPortal = 'x-dialog-portal';
362
+ var X_DIALOG_DATA = new i0.InjectionToken('XDialogData');
359
363
  /**
360
364
  * Dialog Property
361
365
  */
@@ -401,48 +405,48 @@
401
405
  /** @nocollapse */ XDialogProperty.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogProperty, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
402
406
  /** @nocollapse */ XDialogProperty.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDialogProperty, selector: "ng-component", inputs: { visible: "visible", placement: "placement", offset: "offset", type: "type", width: "width", height: "height", effect: "effect", footer: "footer", showCancel: "showCancel", cancelText: "cancelText", showConfirm: "showConfirm", confirmText: "confirmText", backdropClose: "backdropClose", hasBackdrop: "hasBackdrop", className: "className", buttonsCenter: "buttonsCenter", draggable: "draggable", beforeClose: "beforeClose" }, outputs: { cancel: "cancel", confirm: "confirm", visibleChange: "visibleChange", showDone: "showDone", closeDone: "closeDone" }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true });
403
407
  __decorate([
404
- core.XInputBoolean()
408
+ i2.XInputBoolean()
405
409
  ], XDialogProperty.prototype, "visible", void 0);
406
410
  __decorate([
407
- core.XWithConfig(X_CONFIG_NAME, 'center')
411
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, 'center')
408
412
  ], XDialogProperty.prototype, "placement", void 0);
409
413
  __decorate([
410
- core.XWithConfig(X_CONFIG_NAME, '1rem')
414
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, '1rem')
411
415
  ], XDialogProperty.prototype, "offset", void 0);
412
416
  __decorate([
413
- core.XWithConfig(X_CONFIG_NAME, '32rem')
417
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, '32rem')
414
418
  ], XDialogProperty.prototype, "width", void 0);
415
419
  __decorate([
416
- core.XWithConfig(X_CONFIG_NAME, 'white')
420
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, 'white')
417
421
  ], XDialogProperty.prototype, "effect", void 0);
418
422
  __decorate([
419
- core.XWithConfig(X_CONFIG_NAME, true)
423
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, true)
420
424
  ], XDialogProperty.prototype, "showCancel", void 0);
421
425
  __decorate([
422
- core.XWithConfig(X_CONFIG_NAME)
426
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME)
423
427
  ], XDialogProperty.prototype, "cancelText", void 0);
424
428
  __decorate([
425
- core.XWithConfig(X_CONFIG_NAME, true)
429
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, true)
426
430
  ], XDialogProperty.prototype, "showConfirm", void 0);
427
431
  __decorate([
428
- core.XWithConfig(X_CONFIG_NAME)
432
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME)
429
433
  ], XDialogProperty.prototype, "confirmText", void 0);
430
434
  __decorate([
431
- core.XWithConfig(X_CONFIG_NAME, true)
435
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, true)
432
436
  ], XDialogProperty.prototype, "backdropClose", void 0);
433
437
  __decorate([
434
- core.XWithConfig(X_CONFIG_NAME, true)
438
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, true)
435
439
  ], XDialogProperty.prototype, "hasBackdrop", void 0);
436
440
  __decorate([
437
- core.XWithConfig(X_CONFIG_NAME, '')
441
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, '')
438
442
  ], XDialogProperty.prototype, "className", void 0);
439
443
  __decorate([
440
- core.XWithConfig(X_CONFIG_NAME),
441
- core.XInputBoolean()
444
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME),
445
+ i2.XInputBoolean()
442
446
  ], XDialogProperty.prototype, "buttonsCenter", void 0);
443
447
  __decorate([
444
- core.XWithConfig(X_CONFIG_NAME, false),
445
- core.XInputBoolean()
448
+ i2.XWithConfig(X_DIALOG_CONFIG_NAME, false),
449
+ i2.XInputBoolean()
446
450
  ], XDialogProperty.prototype, "draggable", void 0);
447
451
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogProperty, decorators: [{
448
452
  type: i0.Component,
@@ -535,7 +539,7 @@
535
539
  };
536
540
  XDialogComponent.prototype.ngOnChanges = function (changes) {
537
541
  var visible = changes.visible;
538
- core.XIsChange(visible) && this.setVisible();
542
+ i2.XIsChange(visible) && this.setVisible();
539
543
  };
540
544
  XDialogComponent.prototype.ngOnDestroy = function () {
541
545
  this.unsubscribe();
@@ -588,7 +592,7 @@
588
592
  return (_b = (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.overlayRef) === null || _b === void 0 ? void 0 : _b.hasAttached();
589
593
  };
590
594
  XDialogComponent.prototype.onClose = function () {
591
- if (core.XIsFunction(this.beforeClose)) {
595
+ if (i2.XIsFunction(this.beforeClose)) {
592
596
  this.beforeClose();
593
597
  }
594
598
  else {
@@ -616,7 +620,7 @@
616
620
  return XDialogComponent;
617
621
  }(XDialogProperty));
618
622
  /** @nocollapse */ XDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ViewContainerRef }, { token: i1__namespace.XPortalService }, { token: i2__namespace.XI18nService }], target: i0__namespace.ɵɵFactoryTarget.Component });
619
- /** @nocollapse */ XDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDialogComponent, selector: "x-dialog", viewQueries: [{ propertyName: "dialogTpl", first: true, predicate: ["dialogTpl"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-template #dialogTpl>\r\n <div class=\"x-dialog\" [@x-move-box-animation]=\"placement\" (@x-move-box-animation.done)=\"moveDone($event)\">\r\n <x-alert\r\n [draggable]=\"draggable\"\r\n [dragBoundary]=\"'.cdk-overlay-container'\"\r\n (close)=\"onClose()\"\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 showIcon=\"false\"\r\n duration=\"0\"\r\n manual\r\n disabledAnimation\r\n ></x-alert>\r\n </div>\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 <x-buttons space=\"1\" *ngIf=\"showCancel || showConfirm\">\r\n <x-button *ngIf=\"showCancel\" (click)=\"onCancel()\">{{ getCancelText }}</x-button>\r\n <x-button *ngIf=\"showConfirm\" type=\"primary\" (click)=\"onConfirm()\">{{ getConfirmText }}</x-button>\r\n </x-buttons>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [".x-dialog{margin:0;padding:0;width:100%;height:100%}.x-dialog x-alert{height:100%}.x-dialog x-alert .x-alert{min-height:100%;height:-moz-fit-content;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:.5rem 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:1}.x-dialog-portal x-dialog{width:100%}\n"], components: [{ type: i3__namespace.XAlertComponent, selector: "x-alert" }, { type: i4__namespace.XButtonsComponent, selector: "x-buttons" }, { type: i4__namespace.XButtonComponent, selector: "x-button" }], directives: [{ type: i5__namespace.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [core.XMoveBoxAnimation], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
623
+ /** @nocollapse */ XDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDialogComponent, selector: "x-dialog", viewQueries: [{ propertyName: "dialogTpl", first: true, predicate: ["dialogTpl"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<ng-template #dialogTpl>\r\n <div class=\"x-dialog\" [@x-move-box-animation]=\"placement\" (@x-move-box-animation.done)=\"moveDone($event)\">\r\n <x-alert\r\n [draggable]=\"draggable\"\r\n [dragBoundary]=\"'.cdk-overlay-container'\"\r\n (close)=\"onClose()\"\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 showIcon=\"false\"\r\n duration=\"0\"\r\n manual\r\n disabledAnimation\r\n ></x-alert>\r\n </div>\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 <x-buttons space=\"1\" *ngIf=\"showCancel || showConfirm\">\r\n <x-button *ngIf=\"showCancel\" (click)=\"onCancel()\">{{ getCancelText }}</x-button>\r\n <x-button *ngIf=\"showConfirm\" type=\"primary\" (click)=\"onConfirm()\">{{ getConfirmText }}</x-button>\r\n </x-buttons>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [".x-dialog{margin:0;padding:0;width:100%;height:100%}.x-dialog x-alert{height:100%}.x-dialog x-alert .x-alert{min-height:100%;height:-moz-fit-content;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:1}.x-dialog-portal x-dialog{width:100%}\n"], components: [{ type: i3__namespace.XAlertComponent, selector: "x-alert" }, { type: i4__namespace.XButtonsComponent, selector: "x-buttons" }, { type: i4__namespace.XButtonComponent, selector: "x-button" }], directives: [{ type: i5__namespace.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [i2.XMoveBoxAnimation], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
620
624
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogComponent, decorators: [{
621
625
  type: i0.Component,
622
626
  args: [{
@@ -625,20 +629,238 @@
625
629
  styleUrls: ['./dialog.component.scss'],
626
630
  encapsulation: i0.ViewEncapsulation.None,
627
631
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
628
- animations: [core.XMoveBoxAnimation]
632
+ animations: [i2.XMoveBoxAnimation]
629
633
  }]
630
634
  }], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ViewContainerRef }, { type: i1__namespace.XPortalService }, { type: i2__namespace.XI18nService }]; }, propDecorators: { dialogTpl: [{
631
635
  type: i0.ViewChild,
632
636
  args: ['dialogTpl', { static: false }]
633
637
  }] } });
634
638
 
639
+ var XDialogContainerComponent = /** @class */ (function (_super) {
640
+ __extends(XDialogContainerComponent, _super);
641
+ function XDialogContainerComponent() {
642
+ var _this = _super.call(this) || this;
643
+ _this._has = true;
644
+ _this.animationChanged = new i0.EventEmitter();
645
+ return _this;
646
+ }
647
+ XDialogContainerComponent.prototype.done = function (_a) {
648
+ var toState = _a.toState, totalTime = _a.totalTime;
649
+ this.animationChanged.next({ action: 'done', state: toState, totalTime: totalTime });
650
+ };
651
+ XDialogContainerComponent.prototype.start = function (_a) {
652
+ var toState = _a.toState, totalTime = _a.totalTime;
653
+ this.animationChanged.next({ action: 'start', state: toState, totalTime: totalTime });
654
+ };
655
+ XDialogContainerComponent.prototype.attachComponentPortal = function (portal) {
656
+ if (this.portalOutlet.hasAttached()) {
657
+ throw Error('dialog portal has attached');
658
+ }
659
+ return this.portalOutlet.attachComponentPortal(portal);
660
+ };
661
+ XDialogContainerComponent.prototype.attachTemplatePortal = function (portal) {
662
+ if (this.portalOutlet.hasAttached()) {
663
+ throw Error('dialog portal has attached');
664
+ }
665
+ return this.portalOutlet.attachTemplatePortal(portal);
666
+ };
667
+ return XDialogContainerComponent;
668
+ }(i1$1.BasePortalOutlet));
669
+ /** @nocollapse */ XDialogContainerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogContainerComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
670
+ /** @nocollapse */ XDialogContainerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: XDialogContainerComponent, selector: "x-dialog-container", host: { listeners: { "@x-move-box-animation.done": "done($event)", "@x-move-box-animation.start": "start($event)" }, properties: { "class.x-dialog-container": "this._has", "@x-move-box-animation": "this.placement" } }, viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: i1$1.CdkPortalOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template cdkPortalOutlet></ng-template>\r\n", styles: [".x-dialog-container{margin:0;width:100%;height:100%;overflow:auto;display:block;padding:1rem;box-sizing:border-box;min-height:inherit;max-height:inherit;background-color:var(--x-background);box-shadow:var(--x-box-shadow) var(--x-box-shadow-light-color);border:.0625rem solid transparent;border-radius:var(--x-border-radius)}.x-dialog-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-dialog-container-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);font-size:calc(var(--x-font-size) - .0625rem);line-height:1.325rem}.x-dialog-container-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin-bottom:-1rem;min-height:4rem}.x-dialog-container-actions[align=center]{justify-content:center}.x-dialog-container-actions[align=start]{justify-content:flex-start}.x-dialog-container-actions x-button:not(:first-child){margin-left:1rem}\n"], directives: [{ type: i1__namespace$1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [i2.XMoveBoxAnimation], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
671
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogContainerComponent, decorators: [{
672
+ type: i0.Component,
673
+ args: [{
674
+ selector: 'x-dialog-container',
675
+ templateUrl: './dialog-container.component.html',
676
+ styleUrls: ['./dialog-container.component.scss'],
677
+ encapsulation: i0.ViewEncapsulation.None,
678
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
679
+ animations: [i2.XMoveBoxAnimation]
680
+ }]
681
+ }], ctorParameters: function () { return []; }, propDecorators: { _has: [{
682
+ type: i0.HostBinding,
683
+ args: ['class.x-dialog-container']
684
+ }], placement: [{
685
+ type: i0.HostBinding,
686
+ args: ['@x-move-box-animation']
687
+ }], done: [{
688
+ type: i0.HostListener,
689
+ args: ['@x-move-box-animation.done', ['$event']]
690
+ }], start: [{
691
+ type: i0.HostListener,
692
+ args: ['@x-move-box-animation.start', ['$event']]
693
+ }], portalOutlet: [{
694
+ type: i0.ViewChild,
695
+ args: [i1$1.CdkPortalOutlet, { static: true }]
696
+ }] } });
697
+
698
+ // TODO: add more function
699
+ var XDialogRef = /** @class */ (function () {
700
+ function XDialogRef(overlayRef, containerInstance) {
701
+ this.overlayRef = overlayRef;
702
+ this.containerInstance = containerInstance;
703
+ }
704
+ XDialogRef.prototype.close = function () {
705
+ var _this = this;
706
+ this.containerInstance.animationChanged
707
+ .pipe(operators.filter(function (event) { return event.state === 'void' && event.action === 'done'; }), operators.take(1))
708
+ .subscribe(function () {
709
+ _this.overlayRef.detach();
710
+ });
711
+ this.containerInstance.placement = 'void';
712
+ };
713
+ return XDialogRef;
714
+ }());
715
+
716
+ var XDialogCloseDirective = /** @class */ (function () {
717
+ function XDialogCloseDirective(dialogRef) {
718
+ this.dialogRef = dialogRef;
719
+ }
720
+ XDialogCloseDirective.prototype.onCloseClick = function () {
721
+ this.dialogRef && this.dialogRef.close();
722
+ };
723
+ return XDialogCloseDirective;
724
+ }());
725
+ /** @nocollapse */ XDialogCloseDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogCloseDirective, deps: [{ token: XDialogRef, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
726
+ /** @nocollapse */ XDialogCloseDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.5", type: XDialogCloseDirective, selector: "[x-dialog-close]", host: { listeners: { "click": "onCloseClick($event)" } }, ngImport: i0__namespace });
727
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogCloseDirective, decorators: [{
728
+ type: i0.Directive,
729
+ args: [{
730
+ selector: "[x-dialog-close]"
731
+ }]
732
+ }], ctorParameters: function () {
733
+ return [{ type: XDialogRef, decorators: [{
734
+ type: i0.Optional
735
+ }] }];
736
+ }, propDecorators: { onCloseClick: [{
737
+ type: i0.HostListener,
738
+ args: ['click', ['$event']]
739
+ }] } });
740
+ var XDialogTitleDirective = /** @class */ (function () {
741
+ function XDialogTitleDirective() {
742
+ this._has = true;
743
+ }
744
+ return XDialogTitleDirective;
745
+ }());
746
+ /** @nocollapse */ XDialogTitleDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogTitleDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
747
+ /** @nocollapse */ XDialogTitleDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.5", type: XDialogTitleDirective, selector: "[x-dialog-title]", host: { properties: { "class.x-dialog-container-title": "this._has" } }, ngImport: i0__namespace });
748
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogTitleDirective, decorators: [{
749
+ type: i0.Directive,
750
+ args: [{
751
+ selector: "[x-dialog-title]"
752
+ }]
753
+ }], propDecorators: { _has: [{
754
+ type: i0.HostBinding,
755
+ args: ['class.x-dialog-container-title']
756
+ }] } });
757
+ var XDialogContentDirective = /** @class */ (function () {
758
+ function XDialogContentDirective() {
759
+ this._has = true;
760
+ }
761
+ return XDialogContentDirective;
762
+ }());
763
+ /** @nocollapse */ XDialogContentDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogContentDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
764
+ /** @nocollapse */ XDialogContentDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.5", type: XDialogContentDirective, selector: "[x-dialog-content], x-dialog-content", host: { properties: { "class.x-dialog-container-content": "this._has" } }, ngImport: i0__namespace });
765
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogContentDirective, decorators: [{
766
+ type: i0.Directive,
767
+ args: [{
768
+ selector: "[x-dialog-content], x-dialog-content"
769
+ }]
770
+ }], propDecorators: { _has: [{
771
+ type: i0.HostBinding,
772
+ args: ['class.x-dialog-container-content']
773
+ }] } });
774
+ var XDialogActionsDirective = /** @class */ (function () {
775
+ function XDialogActionsDirective() {
776
+ this._has = true;
777
+ }
778
+ return XDialogActionsDirective;
779
+ }());
780
+ /** @nocollapse */ XDialogActionsDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogActionsDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
781
+ /** @nocollapse */ XDialogActionsDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.5", type: XDialogActionsDirective, selector: "[x-dialog-actions], x-dialog-actions", host: { properties: { "class.x-dialog-container-actions": "this._has" } }, ngImport: i0__namespace });
782
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogActionsDirective, decorators: [{
783
+ type: i0.Directive,
784
+ args: [{
785
+ selector: "[x-dialog-actions], x-dialog-actions"
786
+ }]
787
+ }], propDecorators: { _has: [{
788
+ type: i0.HostBinding,
789
+ args: ['class.x-dialog-container-actions']
790
+ }] } });
791
+
792
+ var XDialogService = /** @class */ (function () {
793
+ function XDialogService(portalService, configService, overlay) {
794
+ this.portalService = portalService;
795
+ this.configService = configService;
796
+ this.overlay = overlay;
797
+ this.default = {
798
+ placement: 'center',
799
+ offset: '1rem',
800
+ width: '32rem',
801
+ backdropClose: true,
802
+ hasBackdrop: true,
803
+ draggable: false
804
+ };
805
+ this.configDefault = this.configService.getConfigForComponent(X_DIALOG_CONFIG_NAME);
806
+ Object.assign(this.default, this.configDefault);
807
+ }
808
+ XDialogService.prototype.create = function (content, option) {
809
+ if (option === void 0) { option = {}; }
810
+ i2.fillDefault(option, this.default);
811
+ var portal = this.portalService.attach({
812
+ content: XDialogContainerComponent,
813
+ viewContainerRef: option.viewContainerRef,
814
+ overlayConfig: {
815
+ hasBackdrop: option.hasBackdrop,
816
+ panelClass: option.className,
817
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
818
+ positionStrategy: this.portalService.setPlace(option.placement, option.width, option.height, option.offset)
819
+ }
820
+ });
821
+ var _a = portal || {}, overlayRef = _a.overlayRef, componentRef = _a.componentRef;
822
+ var instance = (componentRef || {}).instance;
823
+ instance.placement = option.placement;
824
+ var dialogRef = new XDialogRef(overlayRef, instance);
825
+ if (content instanceof i0.TemplateRef) {
826
+ instance.attachTemplatePortal(new i1$1.TemplatePortal(content, option.viewContainerRef, { $implicit: option.data, dialogRef: dialogRef }));
827
+ }
828
+ else {
829
+ var injector = this.portalService.createInjector([
830
+ { provide: X_DIALOG_DATA, useValue: option.data },
831
+ { provide: XDialogRef, useValue: dialogRef }
832
+ ]);
833
+ var comRef = instance.attachComponentPortal(new i1$1.ComponentPortal(content, option.viewContainerRef, injector));
834
+ dialogRef.componentInstance = comRef.instance;
835
+ }
836
+ if (option.hasBackdrop && option.backdropClose && overlayRef) {
837
+ overlayRef.backdropClick().subscribe(function () {
838
+ dialogRef.close();
839
+ });
840
+ }
841
+ return dialogRef;
842
+ };
843
+ return XDialogService;
844
+ }());
845
+ /** @nocollapse */ XDialogService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogService, deps: [{ token: i1__namespace.XPortalService }, { token: i2__namespace$1.XConfigService }, { token: i3__namespace$1.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
846
+ /** @nocollapse */ XDialogService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogService });
847
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogService, decorators: [{
848
+ type: i0.Injectable
849
+ }], ctorParameters: function () { return [{ type: i1__namespace.XPortalService }, { type: i2__namespace$1.XConfigService }, { type: i3__namespace$1.Overlay }]; } });
850
+
635
851
  var XDialogModule = /** @class */ (function () {
636
852
  function XDialogModule() {
637
853
  }
638
854
  return XDialogModule;
639
855
  }());
640
856
  /** @nocollapse */ XDialogModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
641
- /** @nocollapse */ XDialogModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogModule, declarations: [XDialogComponent, XDialogProperty], imports: [i6.CommonModule,
857
+ /** @nocollapse */ XDialogModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogModule, declarations: [XDialogComponent,
858
+ XDialogCloseDirective,
859
+ XDialogTitleDirective,
860
+ XDialogContentDirective,
861
+ XDialogActionsDirective,
862
+ XDialogContainerComponent,
863
+ XDialogProperty], imports: [i6.CommonModule,
642
864
  forms.FormsModule,
643
865
  forms.ReactiveFormsModule,
644
866
  dragDrop.DragDropModule,
@@ -647,8 +869,13 @@
647
869
  icon.XIconModule,
648
870
  i1.XPortalModule,
649
871
  i3.XAlertModule,
650
- i5.XOutletModule], exports: [XDialogComponent] });
651
- /** @nocollapse */ XDialogModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogModule, imports: [[
872
+ i5.XOutletModule], exports: [XDialogComponent,
873
+ XDialogCloseDirective,
874
+ XDialogTitleDirective,
875
+ XDialogContentDirective,
876
+ XDialogActionsDirective,
877
+ XDialogContainerComponent] });
878
+ /** @nocollapse */ XDialogModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogModule, providers: [XDialogService], imports: [[
652
879
  i6.CommonModule,
653
880
  forms.FormsModule,
654
881
  forms.ReactiveFormsModule,
@@ -663,8 +890,23 @@
663
890
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: XDialogModule, decorators: [{
664
891
  type: i0.NgModule,
665
892
  args: [{
666
- declarations: [XDialogComponent, XDialogProperty],
667
- exports: [XDialogComponent],
893
+ declarations: [
894
+ XDialogComponent,
895
+ XDialogCloseDirective,
896
+ XDialogTitleDirective,
897
+ XDialogContentDirective,
898
+ XDialogActionsDirective,
899
+ XDialogContainerComponent,
900
+ XDialogProperty
901
+ ],
902
+ exports: [
903
+ XDialogComponent,
904
+ XDialogCloseDirective,
905
+ XDialogTitleDirective,
906
+ XDialogContentDirective,
907
+ XDialogActionsDirective,
908
+ XDialogContainerComponent
909
+ ],
668
910
  imports: [
669
911
  i6.CommonModule,
670
912
  forms.FormsModule,
@@ -676,7 +918,8 @@
676
918
  i1.XPortalModule,
677
919
  i3.XAlertModule,
678
920
  i5.XOutletModule
679
- ]
921
+ ],
922
+ providers: [XDialogService]
680
923
  }]
681
924
  }] });
682
925
 
@@ -684,11 +927,20 @@
684
927
  * Generated bundle index. Do not edit.
685
928
  */
686
929
 
930
+ exports.XDialogActionsDirective = XDialogActionsDirective;
931
+ exports.XDialogCloseDirective = XDialogCloseDirective;
687
932
  exports.XDialogComponent = XDialogComponent;
933
+ exports.XDialogContainerComponent = XDialogContainerComponent;
934
+ exports.XDialogContentDirective = XDialogContentDirective;
688
935
  exports.XDialogModule = XDialogModule;
689
936
  exports.XDialogPortal = XDialogPortal;
690
937
  exports.XDialogPrefix = XDialogPrefix;
691
938
  exports.XDialogProperty = XDialogProperty;
939
+ exports.XDialogRef = XDialogRef;
940
+ exports.XDialogService = XDialogService;
941
+ exports.XDialogTitleDirective = XDialogTitleDirective;
942
+ exports.X_DIALOG_CONFIG_NAME = X_DIALOG_CONFIG_NAME;
943
+ exports.X_DIALOG_DATA = X_DIALOG_DATA;
692
944
 
693
945
  Object.defineProperty(exports, '__esModule', { value: true });
694
946