@ng-nest/ui 13.1.1 → 13.1.4

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 (215) hide show
  1. package/core/config/config.d.ts +9 -0
  2. package/date-picker/picker-date.component.d.ts +1 -1
  3. package/dialog/dialog-portal.component.d.ts +33 -5
  4. package/dialog/dialog-portal.directives.d.ts +17 -0
  5. package/dialog/dialog-ref.d.ts +11 -1
  6. package/dialog/dialog.module.d.ts +1 -1
  7. package/dialog/dialog.property.d.ts +28 -0
  8. package/dialog/dialog.service.d.ts +1 -0
  9. package/empty/empty.component.d.ts +1 -1
  10. package/esm2020/core/config/config.mjs +1 -1
  11. package/esm2020/date-picker/picker-date.component.mjs +2 -2
  12. package/esm2020/dialog/dialog-portal.component.mjs +49 -12
  13. package/esm2020/dialog/dialog-portal.directives.mjs +47 -1
  14. package/esm2020/dialog/dialog-ref.mjs +81 -2
  15. package/esm2020/dialog/dialog.component.mjs +6 -4
  16. package/esm2020/dialog/dialog.module.mjs +10 -2
  17. package/esm2020/dialog/dialog.property.mjs +1 -1
  18. package/esm2020/dialog/dialog.service.mjs +53 -8
  19. package/esm2020/empty/empty.component.mjs +2 -2
  20. package/esm2020/i18n/i18n.property.mjs +1 -1
  21. package/esm2020/i18n/languages/ar_EG.mjs +7 -1
  22. package/esm2020/i18n/languages/bg_BG.mjs +7 -1
  23. package/esm2020/i18n/languages/ca_ES.mjs +7 -1
  24. package/esm2020/i18n/languages/cs_CZ.mjs +7 -1
  25. package/esm2020/i18n/languages/da_DK.mjs +7 -1
  26. package/esm2020/i18n/languages/de_DE.mjs +7 -1
  27. package/esm2020/i18n/languages/el_GR.mjs +7 -1
  28. package/esm2020/i18n/languages/en_GB.mjs +7 -1
  29. package/esm2020/i18n/languages/en_US.mjs +7 -1
  30. package/esm2020/i18n/languages/es_ES.mjs +7 -1
  31. package/esm2020/i18n/languages/et_EE.mjs +7 -1
  32. package/esm2020/i18n/languages/fa_IR.mjs +7 -1
  33. package/esm2020/i18n/languages/fi_FI.mjs +7 -1
  34. package/esm2020/i18n/languages/fr_BE.mjs +7 -1
  35. package/esm2020/i18n/languages/fr_FR.mjs +7 -1
  36. package/esm2020/i18n/languages/he_IL.mjs +7 -1
  37. package/esm2020/i18n/languages/hi_IN.mjs +7 -1
  38. package/esm2020/i18n/languages/hr_HR.mjs +7 -1
  39. package/esm2020/i18n/languages/hu_HU.mjs +7 -1
  40. package/esm2020/i18n/languages/hy_AM.mjs +7 -1
  41. package/esm2020/i18n/languages/id_ID.mjs +7 -1
  42. package/esm2020/i18n/languages/is_IS.mjs +7 -1
  43. package/esm2020/i18n/languages/it_IT.mjs +7 -1
  44. package/esm2020/i18n/languages/ja_JP.mjs +7 -1
  45. package/esm2020/i18n/languages/ka_GE.mjs +7 -1
  46. package/esm2020/i18n/languages/kn_IN.mjs +7 -1
  47. package/esm2020/i18n/languages/ko_KR.mjs +7 -1
  48. package/esm2020/i18n/languages/ku_IQ.mjs +7 -1
  49. package/esm2020/i18n/languages/lv_LV.mjs +7 -1
  50. package/esm2020/i18n/languages/mn_MN.mjs +7 -1
  51. package/esm2020/i18n/languages/ms_MY.mjs +7 -1
  52. package/esm2020/i18n/languages/nb_NO.mjs +7 -1
  53. package/esm2020/i18n/languages/ne_NP.mjs +7 -1
  54. package/esm2020/i18n/languages/nl_BE.mjs +7 -1
  55. package/esm2020/i18n/languages/nl_NL.mjs +7 -1
  56. package/esm2020/i18n/languages/pl_PL.mjs +7 -1
  57. package/esm2020/i18n/languages/pt_BR.mjs +7 -1
  58. package/esm2020/i18n/languages/pt_PT.mjs +7 -1
  59. package/esm2020/i18n/languages/ro_RO.mjs +7 -1
  60. package/esm2020/i18n/languages/ru_RU.mjs +7 -1
  61. package/esm2020/i18n/languages/sk_SK.mjs +7 -1
  62. package/esm2020/i18n/languages/sl_SI.mjs +7 -1
  63. package/esm2020/i18n/languages/sr_RS.mjs +7 -1
  64. package/esm2020/i18n/languages/sv_SE.mjs +7 -1
  65. package/esm2020/i18n/languages/ta_IN.mjs +7 -1
  66. package/esm2020/i18n/languages/th_TH.mjs +7 -1
  67. package/esm2020/i18n/languages/tr_TR.mjs +7 -1
  68. package/esm2020/i18n/languages/uk_UA.mjs +7 -1
  69. package/esm2020/i18n/languages/vi_VN.mjs +7 -1
  70. package/esm2020/i18n/languages/zh_CN.mjs +7 -1
  71. package/esm2020/i18n/languages/zh_TW.mjs +7 -1
  72. package/esm2020/list/list-option.component.mjs +21 -8
  73. package/esm2020/list/list.component.mjs +55 -13
  74. package/esm2020/list/list.module.mjs +5 -1
  75. package/esm2020/list/list.property.mjs +33 -5
  76. package/esm2020/page-header/page-header.component.mjs +2 -2
  77. package/esm2020/pagination/pagination.component.mjs +2 -2
  78. package/esm2020/rate/rate.component.mjs +21 -4
  79. package/esm2020/rate/rate.property.mjs +9 -3
  80. package/esm2020/resizable/resizable.directive.mjs +73 -35
  81. package/esm2020/resizable/resizable.property.mjs +1 -1
  82. package/esm2020/select/select-portal.component.mjs +26 -9
  83. package/esm2020/select/select.component.mjs +15 -3
  84. package/esm2020/select/select.module.mjs +5 -4
  85. package/esm2020/select/select.property.mjs +12 -2
  86. package/esm2020/text-retract/text-retract.component.mjs +2 -2
  87. package/esm2020/upload/upload.component.mjs +13 -9
  88. package/esm2020/upload/upload.module.mjs +5 -2
  89. package/esm2020/upload/upload.property.mjs +30 -2
  90. package/fesm2015/ng-nest-ui-core.mjs.map +1 -1
  91. package/fesm2015/ng-nest-ui-date-picker.mjs +1 -1
  92. package/fesm2015/ng-nest-ui-date-picker.mjs.map +1 -1
  93. package/fesm2015/ng-nest-ui-dialog.mjs +249 -28
  94. package/fesm2015/ng-nest-ui-dialog.mjs.map +1 -1
  95. package/fesm2015/ng-nest-ui-empty.mjs +1 -1
  96. package/fesm2015/ng-nest-ui-empty.mjs.map +1 -1
  97. package/fesm2015/ng-nest-ui-i18n.mjs +306 -0
  98. package/fesm2015/ng-nest-ui-i18n.mjs.map +1 -1
  99. package/fesm2015/ng-nest-ui-list.mjs +107 -22
  100. package/fesm2015/ng-nest-ui-list.mjs.map +1 -1
  101. package/fesm2015/ng-nest-ui-page-header.mjs +1 -1
  102. package/fesm2015/ng-nest-ui-page-header.mjs.map +1 -1
  103. package/fesm2015/ng-nest-ui-pagination.mjs +1 -1
  104. package/fesm2015/ng-nest-ui-pagination.mjs.map +1 -1
  105. package/fesm2015/ng-nest-ui-rate.mjs +27 -4
  106. package/fesm2015/ng-nest-ui-rate.mjs.map +1 -1
  107. package/fesm2015/ng-nest-ui-resizable.mjs +72 -34
  108. package/fesm2015/ng-nest-ui-resizable.mjs.map +1 -1
  109. package/fesm2015/ng-nest-ui-select.mjs +56 -16
  110. package/fesm2015/ng-nest-ui-select.mjs.map +1 -1
  111. package/fesm2015/ng-nest-ui-text-retract.mjs +1 -1
  112. package/fesm2015/ng-nest-ui-text-retract.mjs.map +1 -1
  113. package/fesm2015/ng-nest-ui-upload.mjs +45 -10
  114. package/fesm2015/ng-nest-ui-upload.mjs.map +1 -1
  115. package/fesm2020/ng-nest-ui-core.mjs.map +1 -1
  116. package/fesm2020/ng-nest-ui-date-picker.mjs +1 -1
  117. package/fesm2020/ng-nest-ui-date-picker.mjs.map +1 -1
  118. package/fesm2020/ng-nest-ui-dialog.mjs +242 -28
  119. package/fesm2020/ng-nest-ui-dialog.mjs.map +1 -1
  120. package/fesm2020/ng-nest-ui-empty.mjs +1 -1
  121. package/fesm2020/ng-nest-ui-empty.mjs.map +1 -1
  122. package/fesm2020/ng-nest-ui-i18n.mjs +306 -0
  123. package/fesm2020/ng-nest-ui-i18n.mjs.map +1 -1
  124. package/fesm2020/ng-nest-ui-list.mjs +107 -22
  125. package/fesm2020/ng-nest-ui-list.mjs.map +1 -1
  126. package/fesm2020/ng-nest-ui-page-header.mjs +1 -1
  127. package/fesm2020/ng-nest-ui-page-header.mjs.map +1 -1
  128. package/fesm2020/ng-nest-ui-pagination.mjs +1 -1
  129. package/fesm2020/ng-nest-ui-pagination.mjs.map +1 -1
  130. package/fesm2020/ng-nest-ui-rate.mjs +27 -4
  131. package/fesm2020/ng-nest-ui-rate.mjs.map +1 -1
  132. package/fesm2020/ng-nest-ui-resizable.mjs +72 -34
  133. package/fesm2020/ng-nest-ui-resizable.mjs.map +1 -1
  134. package/fesm2020/ng-nest-ui-select.mjs +56 -16
  135. package/fesm2020/ng-nest-ui-select.mjs.map +1 -1
  136. package/fesm2020/ng-nest-ui-text-retract.mjs +1 -1
  137. package/fesm2020/ng-nest-ui-text-retract.mjs.map +1 -1
  138. package/fesm2020/ng-nest-ui-upload.mjs +45 -10
  139. package/fesm2020/ng-nest-ui-upload.mjs.map +1 -1
  140. package/i18n/i18n.property.d.ts +8 -0
  141. package/i18n/languages/ar_EG.d.ts +6 -0
  142. package/i18n/languages/bg_BG.d.ts +6 -0
  143. package/i18n/languages/ca_ES.d.ts +6 -0
  144. package/i18n/languages/cs_CZ.d.ts +6 -0
  145. package/i18n/languages/da_DK.d.ts +6 -0
  146. package/i18n/languages/de_DE.d.ts +6 -0
  147. package/i18n/languages/el_GR.d.ts +6 -0
  148. package/i18n/languages/en_GB.d.ts +6 -0
  149. package/i18n/languages/en_US.d.ts +6 -0
  150. package/i18n/languages/es_ES.d.ts +6 -0
  151. package/i18n/languages/et_EE.d.ts +6 -0
  152. package/i18n/languages/fa_IR.d.ts +6 -0
  153. package/i18n/languages/fi_FI.d.ts +6 -0
  154. package/i18n/languages/fr_BE.d.ts +6 -0
  155. package/i18n/languages/fr_FR.d.ts +6 -0
  156. package/i18n/languages/he_IL.d.ts +6 -0
  157. package/i18n/languages/hi_IN.d.ts +6 -0
  158. package/i18n/languages/hr_HR.d.ts +6 -0
  159. package/i18n/languages/hu_HU.d.ts +6 -0
  160. package/i18n/languages/hy_AM.d.ts +6 -0
  161. package/i18n/languages/id_ID.d.ts +6 -0
  162. package/i18n/languages/is_IS.d.ts +6 -0
  163. package/i18n/languages/it_IT.d.ts +6 -0
  164. package/i18n/languages/ja_JP.d.ts +6 -0
  165. package/i18n/languages/ka_GE.d.ts +6 -0
  166. package/i18n/languages/kn_IN.d.ts +6 -0
  167. package/i18n/languages/ko_KR.d.ts +6 -0
  168. package/i18n/languages/ku_IQ.d.ts +6 -0
  169. package/i18n/languages/lv_LV.d.ts +6 -0
  170. package/i18n/languages/mn_MN.d.ts +6 -0
  171. package/i18n/languages/ms_MY.d.ts +6 -0
  172. package/i18n/languages/nb_NO.d.ts +6 -0
  173. package/i18n/languages/ne_NP.d.ts +6 -0
  174. package/i18n/languages/nl_BE.d.ts +6 -0
  175. package/i18n/languages/nl_NL.d.ts +6 -0
  176. package/i18n/languages/pl_PL.d.ts +6 -0
  177. package/i18n/languages/pt_BR.d.ts +6 -0
  178. package/i18n/languages/pt_PT.d.ts +6 -0
  179. package/i18n/languages/ro_RO.d.ts +6 -0
  180. package/i18n/languages/ru_RU.d.ts +6 -0
  181. package/i18n/languages/sk_SK.d.ts +6 -0
  182. package/i18n/languages/sl_SI.d.ts +6 -0
  183. package/i18n/languages/sr_RS.d.ts +6 -0
  184. package/i18n/languages/sv_SE.d.ts +6 -0
  185. package/i18n/languages/ta_IN.d.ts +6 -0
  186. package/i18n/languages/th_TH.d.ts +6 -0
  187. package/i18n/languages/tr_TR.d.ts +6 -0
  188. package/i18n/languages/uk_UA.d.ts +6 -0
  189. package/i18n/languages/vi_VN.d.ts +6 -0
  190. package/i18n/languages/zh_CN.d.ts +6 -0
  191. package/i18n/languages/zh_TW.d.ts +6 -0
  192. package/list/examples/en_US/default/size/README.md +6 -0
  193. package/list/examples/zh_CN/default/size/README.md +6 -0
  194. package/list/list-option.component.d.ts +8 -2
  195. package/list/list.component.d.ts +7 -1
  196. package/list/list.module.d.ts +3 -2
  197. package/list/list.property.d.ts +29 -4
  198. package/package.json +1 -1
  199. package/page-header/page-header.component.d.ts +1 -1
  200. package/pagination/pagination.component.d.ts +1 -1
  201. package/rate/examples/en_US/default/color/README.md +6 -0
  202. package/rate/examples/zh_CN/default/color/README.md +6 -0
  203. package/rate/rate.component.d.ts +1 -0
  204. package/rate/rate.property.d.ts +13 -1
  205. package/resizable/resizable.directive.d.ts +4 -8
  206. package/resizable/resizable.property.d.ts +5 -0
  207. package/select/select-portal.component.d.ts +10 -1
  208. package/select/select.component.d.ts +1 -0
  209. package/select/select.module.d.ts +2 -1
  210. package/select/select.property.d.ts +11 -1
  211. package/tag/examples/zh_CN/default/bordered/README.md +1 -1
  212. package/text-retract/text-retract.component.d.ts +1 -1
  213. package/upload/upload.component.d.ts +4 -4
  214. package/upload/upload.module.d.ts +1 -1
  215. package/upload/upload.property.d.ts +21 -1
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, EventEmitter, Component, Input, Output, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, HostBinding, HostListener, Directive, Optional, TemplateRef, Injectable, NgModule } from '@angular/core';
3
- import * as i2$1 from '@ng-nest/ui/core';
2
+ import { InjectionToken, EventEmitter, Component, Input, Output, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, QueryList, HostBinding, HostListener, ContentChildren, Directive, Optional, TemplateRef, Injectable, NgModule } from '@angular/core';
3
+ import * as i2$2 from '@ng-nest/ui/core';
4
4
  import { XInputBoolean, XWithConfig, XIsChange, XIsFunction, XMoveBoxAnimation, fillDefault } from '@ng-nest/ui/core';
5
5
  import { __decorate } from 'tslib';
6
6
  import * as i4 from '@ng-nest/ui/alert';
@@ -17,13 +17,15 @@ import * as i6 from '@ng-nest/ui/outlet';
17
17
  import { XOutletModule } from '@ng-nest/ui/outlet';
18
18
  import * as i7 from '@angular/common';
19
19
  import { CommonModule } from '@angular/common';
20
- import * as i1$1 from '@angular/cdk/portal';
20
+ import * as i3$1 from '@angular/cdk/portal';
21
21
  import { BasePortalOutlet, CdkPortalOutlet, TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
22
+ import * as i1$1 from '@angular/cdk/drag-drop';
23
+ import { CdkDragHandle, CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
24
+ import * as i2$1 from '@ng-nest/ui/resizable';
25
+ import { XResizableModule } from '@ng-nest/ui/resizable';
22
26
  import { XIconModule } from '@ng-nest/ui/icon';
23
27
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
24
28
  import { XInputModule } from '@ng-nest/ui/input';
25
- import { XResizableModule } from '@ng-nest/ui/resizable';
26
- import { DragDropModule } from '@angular/cdk/drag-drop';
27
29
 
28
30
  /**
29
31
  * Dialog
@@ -415,24 +417,35 @@ class XDialogComponent extends XDialogProperty {
415
417
  const contentHeight = Number(this.initContentHeight) + Number(event.clientHeight) - Number(this.initHeight);
416
418
  this.renderer.setStyle(this.dialogContent, 'max-height', 'initial');
417
419
  this.renderer.setStyle(this.dialogContent, 'flex', 'initial');
418
- this.renderer.setStyle(this.dialogContent, 'height', `${contentHeight}px`);
420
+ if (['top-start', 'top-end', 'bottom', 'top', 'bottom-start', 'bottom-end'].includes(event.direction)) {
421
+ this.renderer.setStyle(this.dialogContent, 'height', `${contentHeight}px`);
422
+ }
419
423
  }
420
424
  }
421
425
  /** @nocollapse */ /** @nocollapse */ XDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }, { token: i1.XPortalService }, { token: i2.Overlay }, { token: i3.XI18nService }], target: i0.ɵɵFactoryTarget.Component });
422
- /** @nocollapse */ /** @nocollapse */ XDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: XDialogComponent, selector: "x-dialog", viewQueries: [{ propertyName: "dialogTpl", first: true, predicate: ["dialogTpl"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #dialogTpl>\r\n <div\r\n class=\"x-dialog\"\r\n [@x-move-box-animation]=\"placement\"\r\n (@x-move-box-animation.done)=\"moveDone($event)\"\r\n [class.x-dialog-maximize]=\"isMaximize\"\r\n [class.x-dialog-resizable]=\"resizable\"\r\n [class.x-dialog-default-maximize]=\"isDefaultMaximize\"\r\n >\r\n <x-alert\r\n [draggable]=\"draggable && dialogBox['draggable']\"\r\n [resizable]=\"resizable && dialogBox['resizable']\"\r\n [dragFreeDragPosition]=\"dialogBox['distance']\"\r\n [offsetLeft]=\"offsetLeft\"\r\n [offsetTop]=\"offsetTop\"\r\n [minWidth]=\"dialogBox['minWidth']\"\r\n [minHeight]=\"dialogBox['minHeight']\"\r\n [dragBoundary]=\"'.cdk-overlay-container'\"\r\n [title]=\"title\"\r\n [content]=\"contentTpl\"\r\n [type]=\"type\"\r\n [effect]=\"effect\"\r\n [hideClose]=\"hideClose\"\r\n [closeText]=\"closeText\"\r\n [operationTpl]=\"operationTpl\"\r\n (close)=\"onClose()\"\r\n (dragEnded)=\"onDragEnded($event)\"\r\n (resizing)=\"onResizing($event)\"\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\r\n<ng-template #operationTpl>\r\n <ng-container *ngIf=\"maximize || resizable\">\r\n <x-button size=\"small\" [icon]=\"isMaximize ? 'fto-minimize' : 'fto-maximize'\" [onlyIcon]=\"true\" (click)=\"onSize()\"></x-button>\r\n </ng-container>\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-direction:column;flex:1;max-height:70vh;overflow:auto}.x-dialog-maximize>x-alert .x-alert{left:0!important;top:0!important}.x-dialog-maximize .x-dialog-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}.x-dialog-default-maximize .x-dialog-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important;flex:initial}.x-dialog-container x-dialog{width:100%}\n"], components: [{ type: i4.XAlertComponent, selector: "x-alert" }, { type: i5.XButtonsComponent, selector: "x-buttons" }, { type: i5.XButtonComponent, selector: "x-button" }], directives: [{ type: i6.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [XMoveBoxAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
426
+ /** @nocollapse */ /** @nocollapse */ XDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: XDialogComponent, selector: "x-dialog", viewQueries: [{ propertyName: "dialogTpl", first: true, predicate: ["dialogTpl"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #dialogTpl>\r\n <div\r\n class=\"x-dialog\"\r\n [@x-move-box-animation]=\"placement\"\r\n (@x-move-box-animation.done)=\"moveDone($event)\"\r\n [class.x-dialog-maximize]=\"isMaximize\"\r\n [class.x-dialog-resizable]=\"resizable\"\r\n [class.x-dialog-default-maximize]=\"isDefaultMaximize\"\r\n >\r\n <x-alert\r\n [draggable]=\"draggable && dialogBox['draggable']\"\r\n [resizable]=\"resizable && dialogBox['resizable']\"\r\n [dragFreeDragPosition]=\"dialogBox['distance']\"\r\n [offsetLeft]=\"offsetLeft\"\r\n [offsetTop]=\"offsetTop\"\r\n [minWidth]=\"dialogBox['minWidth']\"\r\n [minHeight]=\"dialogBox['minHeight']\"\r\n [dragBoundary]=\"'.cdk-overlay-container'\"\r\n [title]=\"title\"\r\n [content]=\"contentTpl\"\r\n [type]=\"type\"\r\n [effect]=\"effect\"\r\n [hideClose]=\"hideClose\"\r\n [closeText]=\"closeText\"\r\n [operationTpl]=\"operationTpl\"\r\n (close)=\"onClose()\"\r\n (dragEnded)=\"onDragEnded($event)\"\r\n (resizing)=\"onResizing($event)\"\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\r\n<ng-template #operationTpl>\r\n <ng-container *ngIf=\"maximize || resizable\">\r\n <x-button size=\"small\" [icon]=\"isMaximize ? 'fto-minimize' : 'fto-maximize'\" [onlyIcon]=\"true\" (click)=\"onSize()\"></x-button>\r\n </ng-container>\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-direction:column;flex:1;max-height:70vh;overflow:auto;min-height:2rem}.x-dialog-maximize>x-alert .x-alert{left:0!important;top:0!important}.x-dialog-maximize .x-dialog-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}.x-dialog-default-maximize .x-dialog-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important;flex:initial}.x-dialog-container x-dialog{width:100%}\n"], components: [{ type: i4.XAlertComponent, selector: "x-alert" }, { type: i5.XButtonsComponent, selector: "x-buttons" }, { type: i5.XButtonComponent, selector: "x-button" }], directives: [{ type: i6.XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [XMoveBoxAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
423
427
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogComponent, decorators: [{
424
428
  type: Component,
425
- args: [{ selector: `${XDialogPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [XMoveBoxAnimation], template: "<ng-template #dialogTpl>\r\n <div\r\n class=\"x-dialog\"\r\n [@x-move-box-animation]=\"placement\"\r\n (@x-move-box-animation.done)=\"moveDone($event)\"\r\n [class.x-dialog-maximize]=\"isMaximize\"\r\n [class.x-dialog-resizable]=\"resizable\"\r\n [class.x-dialog-default-maximize]=\"isDefaultMaximize\"\r\n >\r\n <x-alert\r\n [draggable]=\"draggable && dialogBox['draggable']\"\r\n [resizable]=\"resizable && dialogBox['resizable']\"\r\n [dragFreeDragPosition]=\"dialogBox['distance']\"\r\n [offsetLeft]=\"offsetLeft\"\r\n [offsetTop]=\"offsetTop\"\r\n [minWidth]=\"dialogBox['minWidth']\"\r\n [minHeight]=\"dialogBox['minHeight']\"\r\n [dragBoundary]=\"'.cdk-overlay-container'\"\r\n [title]=\"title\"\r\n [content]=\"contentTpl\"\r\n [type]=\"type\"\r\n [effect]=\"effect\"\r\n [hideClose]=\"hideClose\"\r\n [closeText]=\"closeText\"\r\n [operationTpl]=\"operationTpl\"\r\n (close)=\"onClose()\"\r\n (dragEnded)=\"onDragEnded($event)\"\r\n (resizing)=\"onResizing($event)\"\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\r\n<ng-template #operationTpl>\r\n <ng-container *ngIf=\"maximize || resizable\">\r\n <x-button size=\"small\" [icon]=\"isMaximize ? 'fto-minimize' : 'fto-maximize'\" [onlyIcon]=\"true\" (click)=\"onSize()\"></x-button>\r\n </ng-container>\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-direction:column;flex:1;max-height:70vh;overflow:auto}.x-dialog-maximize>x-alert .x-alert{left:0!important;top:0!important}.x-dialog-maximize .x-dialog-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}.x-dialog-default-maximize .x-dialog-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important;flex:initial}.x-dialog-container x-dialog{width:100%}\n"] }]
429
+ args: [{ selector: `${XDialogPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [XMoveBoxAnimation], template: "<ng-template #dialogTpl>\r\n <div\r\n class=\"x-dialog\"\r\n [@x-move-box-animation]=\"placement\"\r\n (@x-move-box-animation.done)=\"moveDone($event)\"\r\n [class.x-dialog-maximize]=\"isMaximize\"\r\n [class.x-dialog-resizable]=\"resizable\"\r\n [class.x-dialog-default-maximize]=\"isDefaultMaximize\"\r\n >\r\n <x-alert\r\n [draggable]=\"draggable && dialogBox['draggable']\"\r\n [resizable]=\"resizable && dialogBox['resizable']\"\r\n [dragFreeDragPosition]=\"dialogBox['distance']\"\r\n [offsetLeft]=\"offsetLeft\"\r\n [offsetTop]=\"offsetTop\"\r\n [minWidth]=\"dialogBox['minWidth']\"\r\n [minHeight]=\"dialogBox['minHeight']\"\r\n [dragBoundary]=\"'.cdk-overlay-container'\"\r\n [title]=\"title\"\r\n [content]=\"contentTpl\"\r\n [type]=\"type\"\r\n [effect]=\"effect\"\r\n [hideClose]=\"hideClose\"\r\n [closeText]=\"closeText\"\r\n [operationTpl]=\"operationTpl\"\r\n (close)=\"onClose()\"\r\n (dragEnded)=\"onDragEnded($event)\"\r\n (resizing)=\"onResizing($event)\"\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\r\n<ng-template #operationTpl>\r\n <ng-container *ngIf=\"maximize || resizable\">\r\n <x-button size=\"small\" [icon]=\"isMaximize ? 'fto-minimize' : 'fto-maximize'\" [onlyIcon]=\"true\" (click)=\"onSize()\"></x-button>\r\n </ng-container>\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-direction:column;flex:1;max-height:70vh;overflow:auto;min-height:2rem}.x-dialog-maximize>x-alert .x-alert{left:0!important;top:0!important}.x-dialog-maximize .x-dialog-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}.x-dialog-default-maximize .x-dialog-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important;flex:initial}.x-dialog-container x-dialog{width:100%}\n"] }]
426
430
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }, { type: i1.XPortalService }, { type: i2.Overlay }, { type: i3.XI18nService }]; }, propDecorators: { dialogTpl: [{
427
431
  type: ViewChild,
428
432
  args: ['dialogTpl', { static: false }]
429
433
  }] } });
430
434
 
431
435
  class XDialogPortalComponent extends BasePortalOutlet {
432
- constructor() {
436
+ constructor(renderer) {
433
437
  super();
434
- this._has = true;
438
+ this.renderer = renderer;
435
439
  this.animationChanged = new EventEmitter();
440
+ this.offsetLeft = 0;
441
+ this.offsetTop = 0;
442
+ this.minWidth = '0rem';
443
+ this.minHeight = '0rem';
444
+ this.initHeight = 0;
445
+ this.initContentHeight = 0;
446
+ this.defaultMaximize = false;
447
+ this.distance = { x: 0, y: 0 };
448
+ this.dialogBox = {};
436
449
  }
437
450
  done({ toState, totalTime }) {
438
451
  this.animationChanged.next({ action: 'done', state: toState, totalTime });
@@ -440,6 +453,17 @@ class XDialogPortalComponent extends BasePortalOutlet {
440
453
  start({ toState, totalTime }) {
441
454
  this.animationChanged.next({ action: 'start', state: toState, totalTime });
442
455
  }
456
+ ngOnInit() {
457
+ this.dialogBox['draggable'] = this.defaultMaximize ? this.dialogBox['draggable'] : this.option.draggable;
458
+ this.dialogBox['resizable'] = this.defaultMaximize ? this.dialogBox['resizable'] : this.option.resizable;
459
+ }
460
+ ngAfterViewInit() {
461
+ let list = new QueryList();
462
+ for (let item of this.dialogRef.dragHandleRefs) {
463
+ list.reset([...list.toArray(), new CdkDragHandle(item, this.dragRef)]);
464
+ }
465
+ this.dragRef._handles = list;
466
+ }
443
467
  attachComponentPortal(portal) {
444
468
  if (this.portalOutlet.hasAttached()) {
445
469
  throw Error('dialog portal has attached');
@@ -452,16 +476,24 @@ class XDialogPortalComponent extends BasePortalOutlet {
452
476
  }
453
477
  return this.portalOutlet.attachTemplatePortal(portal);
454
478
  }
479
+ resizing(event) {
480
+ const contentHeight = Number(this.initContentHeight) + Number(event.clientHeight) - Number(this.initHeight);
481
+ this.renderer.setStyle(this.dialogContent, 'max-height', 'initial');
482
+ this.renderer.setStyle(this.dialogContent, 'flex', 'initial');
483
+ if (['top-start', 'top-end', 'bottom', 'top', 'bottom-start', 'bottom-end'].includes(event.direction)) {
484
+ this.renderer.setStyle(this.dialogContent, 'height', `${contentHeight}px`);
485
+ }
486
+ }
487
+ onDragEnded(event) {
488
+ this.distance = { x: this.distance.x + event.distance.x, y: this.distance.y + event.distance.y };
489
+ }
455
490
  }
456
- /** @nocollapse */ /** @nocollapse */ XDialogPortalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogPortalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
457
- /** @nocollapse */ /** @nocollapse */ XDialogPortalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: XDialogPortalComponent, selector: "x-dialog-portal", host: { listeners: { "@x-move-box-animation.done": "done($event)", "@x-move-box-animation.start": "start($event)" }, properties: { "class.x-dialog-portal": "this._has", "@x-move-box-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-dialog-portal{margin:0;padding: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-portal-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-portal-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-portal-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-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}\n"], directives: [{ type: i1$1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [XMoveBoxAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
491
+ /** @nocollapse */ /** @nocollapse */ XDialogPortalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogPortalComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
492
+ /** @nocollapse */ /** @nocollapse */ XDialogPortalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: XDialogPortalComponent, selector: "x-dialog-portal", host: { listeners: { "@x-move-box-animation.done": "done($event)", "@x-move-box-animation.start": "start($event)" }, properties: { "@x-move-box-animation": "this.placement" } }, queries: [{ propertyName: "handles", predicate: CdkDragHandle, descendants: true }], viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }, { propertyName: "dragRef", first: true, predicate: CdkDrag, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"x-dialog-portal\"\r\n #dragRef\r\n cdkDrag\r\n [cdkDragDisabled]=\"!option.draggable && !dialogBox['draggable']\"\r\n [cdkDragBoundary]=\"'.cdk-overlay-container'\"\r\n [cdkDragFreeDragPosition]=\"dialogBox['distance']\"\r\n [xResizable]=\"option.resizable && dialogBox['resizable']!\"\r\n (resizing)=\"resizing($event)\"\r\n (cdkDragEnded)=\"onDragEnded($event)\"\r\n [offsetLeft]=\"offsetLeft\"\r\n [offsetTop]=\"offsetTop\"\r\n [style.minWidth]=\"dialogBox['minWidth']\"\r\n [style.minHeight]=\"dialogBox['minHeight']\"\r\n [class.x-dialog-portal-fullscreen]=\"dialogRef.fullscreen\"\r\n>\r\n <ng-template cdkPortalOutlet></ng-template>\r\n</div>\r\n", styles: [".x-dialog-portal{margin:0;padding:0;width:100%;height:100%;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-portal-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:3rem;line-height:3rem;display:block;align-items:center;margin:-1rem -1rem 0;padding:0 1rem}.x-dialog-portal-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);font-size:calc(var(--x-font-size) - .0625rem);line-height:1.325rem}.x-dialog-portal-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin:0 -1rem -1rem;padding:0 1rem;height:4rem}.x-dialog-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}.x-dialog-portal-drag-handle{cursor:move}.x-dialog-portal-fullscreen{left:0!important;top:0!important}.x-dialog-portal-fullscreen .x-dialog-portal-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}x-dialog-portal{width:100%;height:100%}\n"], directives: [{ type: i1$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i2$1.XResizableDirective, selector: "[xResizable]" }, { type: i3$1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [XMoveBoxAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
458
493
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogPortalComponent, decorators: [{
459
494
  type: Component,
460
- args: [{ selector: 'x-dialog-portal', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [XMoveBoxAnimation], template: "<ng-template cdkPortalOutlet></ng-template>\r\n", styles: [".x-dialog-portal{margin:0;padding: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-portal-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-portal-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-portal-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-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}\n"] }]
461
- }], ctorParameters: function () { return []; }, propDecorators: { _has: [{
462
- type: HostBinding,
463
- args: ['class.x-dialog-portal']
464
- }], placement: [{
495
+ args: [{ selector: 'x-dialog-portal', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [XMoveBoxAnimation], template: "<div\r\n class=\"x-dialog-portal\"\r\n #dragRef\r\n cdkDrag\r\n [cdkDragDisabled]=\"!option.draggable && !dialogBox['draggable']\"\r\n [cdkDragBoundary]=\"'.cdk-overlay-container'\"\r\n [cdkDragFreeDragPosition]=\"dialogBox['distance']\"\r\n [xResizable]=\"option.resizable && dialogBox['resizable']!\"\r\n (resizing)=\"resizing($event)\"\r\n (cdkDragEnded)=\"onDragEnded($event)\"\r\n [offsetLeft]=\"offsetLeft\"\r\n [offsetTop]=\"offsetTop\"\r\n [style.minWidth]=\"dialogBox['minWidth']\"\r\n [style.minHeight]=\"dialogBox['minHeight']\"\r\n [class.x-dialog-portal-fullscreen]=\"dialogRef.fullscreen\"\r\n>\r\n <ng-template cdkPortalOutlet></ng-template>\r\n</div>\r\n", styles: [".x-dialog-portal{margin:0;padding:0;width:100%;height:100%;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-portal-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:3rem;line-height:3rem;display:block;align-items:center;margin:-1rem -1rem 0;padding:0 1rem}.x-dialog-portal-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);font-size:calc(var(--x-font-size) - .0625rem);line-height:1.325rem}.x-dialog-portal-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin:0 -1rem -1rem;padding:0 1rem;height:4rem}.x-dialog-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}.x-dialog-portal-drag-handle{cursor:move}.x-dialog-portal-fullscreen{left:0!important;top:0!important}.x-dialog-portal-fullscreen .x-dialog-portal-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}x-dialog-portal{width:100%;height:100%}\n"] }]
496
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { placement: [{
465
497
  type: HostBinding,
466
498
  args: ['@x-move-box-animation']
467
499
  }], done: [{
@@ -473,13 +505,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
473
505
  }], portalOutlet: [{
474
506
  type: ViewChild,
475
507
  args: [CdkPortalOutlet, { static: true }]
508
+ }], dragRef: [{
509
+ type: ViewChild,
510
+ args: [CdkDrag, { static: true }]
511
+ }], handles: [{
512
+ type: ContentChildren,
513
+ args: [CdkDragHandle, { descendants: true }]
476
514
  }] } });
477
515
 
478
516
  // TODO: add more function
479
517
  class XDialogRef {
480
- constructor(overlayRef, containerInstance) {
518
+ constructor(overlayRef, containerInstance, renderer, portalService) {
481
519
  this.overlayRef = overlayRef;
482
520
  this.containerInstance = containerInstance;
521
+ this.renderer = renderer;
522
+ this.portalService = portalService;
523
+ this.fullscreen = false;
524
+ this.dragHandleRefs = [];
525
+ this._isFristFullscreen = true;
483
526
  }
484
527
  close() {
485
528
  this.containerInstance.animationChanged
@@ -489,6 +532,79 @@ class XDialogRef {
489
532
  });
490
533
  this.containerInstance.placement = 'void';
491
534
  }
535
+ onFullscreen() {
536
+ let { dialogBox, dialogRef, overlayElement, distance, hostElement, defaultMaximize } = this.containerInstance;
537
+ if (!dialogRef.fullscreen) {
538
+ dialogRef.overlayRef.updateSize({
539
+ width: '100%',
540
+ height: '100%',
541
+ minWidth: '100%',
542
+ minHeight: '100%'
543
+ });
544
+ dialogRef.fullscreen = true;
545
+ dialogBox['minWidth'] = '100%';
546
+ dialogBox['minHeight'] = '100%';
547
+ dialogBox['draggable'] = false;
548
+ dialogBox['resizable'] = false;
549
+ if (this.option.resizable) {
550
+ this.renderer.setStyle(overlayElement, 'margin', '0 0 0 0');
551
+ }
552
+ if (this.option.draggable) {
553
+ dialogBox['distance'] = { x: 0, y: 0 };
554
+ }
555
+ }
556
+ else {
557
+ dialogBox['minWidth'] = this.option.minWidth;
558
+ dialogBox['minHeight'] = this.option.minHeight;
559
+ if (this._isFristFullscreen && defaultMaximize) {
560
+ this.option.draggable = dialogBox['draggable'];
561
+ this.option.resizable = dialogBox['resizable'];
562
+ }
563
+ else {
564
+ dialogBox['draggable'] = this.option.draggable;
565
+ dialogBox['resizable'] = this.option.resizable;
566
+ }
567
+ dialogRef.overlayRef?.updateSize({
568
+ width: dialogBox['width'],
569
+ height: dialogBox['height'],
570
+ minWidth: dialogBox['minWidth'],
571
+ minHeight: dialogBox['minHeight']
572
+ });
573
+ dialogRef.fullscreen = false;
574
+ if (this.option.draggable) {
575
+ dialogBox['distance'] = { ...distance };
576
+ }
577
+ if (this.option.resizable) {
578
+ if (dialogBox['marginTop']) {
579
+ this.renderer.setStyle(overlayElement, 'margin-top', `${dialogBox['marginTop']}`);
580
+ }
581
+ if (dialogBox['marginLeft']) {
582
+ this.renderer.setStyle(overlayElement, 'margin-left', `${dialogBox['marginLeft']}`);
583
+ }
584
+ if (dialogBox['marginRight']) {
585
+ this.renderer.setStyle(overlayElement, 'margin-right', `${dialogBox['marginRight']}`);
586
+ }
587
+ if (dialogBox['marginBottom']) {
588
+ this.renderer.setStyle(overlayElement, 'margin-bottom', `${dialogBox['marginBottom']}`);
589
+ }
590
+ }
591
+ if (this._isFristFullscreen && defaultMaximize) {
592
+ dialogRef.overlayRef?.updatePositionStrategy(this.portalService.setPlace(this.option.placement, this.option.offset));
593
+ this.renderer.addClass(hostElement, PortalResizablePrefix);
594
+ setTimeout(() => {
595
+ Object.assign(dialogBox, this.portalService.setResizable(overlayElement, this.option.placement));
596
+ this.containerInstance.offsetLeft = overlayElement.offsetLeft;
597
+ this.containerInstance.offsetTop = overlayElement.offsetTop;
598
+ const dialogDraggable = overlayElement?.querySelector('.x-dialog-portal');
599
+ this.containerInstance.initHeight = dialogDraggable.clientHeight;
600
+ this.containerInstance.dialogContent = overlayElement?.querySelector('.x-dialog-portal-content');
601
+ this.containerInstance.initContentHeight = this.containerInstance.dialogContent?.clientHeight;
602
+ this.containerInstance.dialogBox = dialogBox;
603
+ });
604
+ }
605
+ }
606
+ this._isFristFullscreen = false;
607
+ }
492
608
  }
493
609
 
494
610
  class XDialogCloseDirective {
@@ -559,6 +675,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
559
675
  }], propDecorators: { _has: [{
560
676
  type: HostBinding,
561
677
  args: ['class.x-dialog-portal-actions']
678
+ }] } });
679
+ class XDialogDragHandleDirective {
680
+ constructor(dialogRef, elementRef) {
681
+ this.dialogRef = dialogRef;
682
+ this.elementRef = elementRef;
683
+ }
684
+ get getDraggable() {
685
+ return !this.dialogRef.fullscreen && this.dialogRef.option.draggable;
686
+ }
687
+ ngOnInit() {
688
+ this.dialogRef.dragHandleRefs.push(this.elementRef);
689
+ }
690
+ }
691
+ /** @nocollapse */ /** @nocollapse */ XDialogDragHandleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogDragHandleDirective, deps: [{ token: XDialogRef, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
692
+ /** @nocollapse */ /** @nocollapse */ XDialogDragHandleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: XDialogDragHandleDirective, selector: "[x-dialog-drag-handle], x-dialog-drag-handle", host: { properties: { "class.x-dialog-portal-drag-handle": "this.getDraggable" } }, ngImport: i0 });
693
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogDragHandleDirective, decorators: [{
694
+ type: Directive,
695
+ args: [{
696
+ selector: `[x-dialog-drag-handle], x-dialog-drag-handle`
697
+ }]
698
+ }], ctorParameters: function () { return [{ type: XDialogRef, decorators: [{
699
+ type: Optional
700
+ }] }, { type: i0.ElementRef }]; }, propDecorators: { getDraggable: [{
701
+ type: HostBinding,
702
+ args: ['class.x-dialog-portal-drag-handle']
703
+ }] } });
704
+ class XDialogFullscreenDirective {
705
+ constructor(dialogRef) {
706
+ this.dialogRef = dialogRef;
707
+ }
708
+ onFullscreenClick() {
709
+ this.dialogRef && this.dialogRef.onFullscreen();
710
+ }
711
+ }
712
+ /** @nocollapse */ /** @nocollapse */ XDialogFullscreenDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogFullscreenDirective, deps: [{ token: XDialogRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
713
+ /** @nocollapse */ /** @nocollapse */ XDialogFullscreenDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: XDialogFullscreenDirective, selector: "[x-dialog-fullscreen], x-dialog-fullscreen", host: { listeners: { "click": "onFullscreenClick($event)" } }, ngImport: i0 });
714
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogFullscreenDirective, decorators: [{
715
+ type: Directive,
716
+ args: [{
717
+ selector: `[x-dialog-fullscreen], x-dialog-fullscreen`
718
+ }]
719
+ }], ctorParameters: function () { return [{ type: XDialogRef, decorators: [{
720
+ type: Optional
721
+ }] }]; }, propDecorators: { onFullscreenClick: [{
722
+ type: HostListener,
723
+ args: ['click', ['$event']]
562
724
  }] } });
563
725
 
564
726
  class XDialogService {
@@ -571,10 +733,12 @@ class XDialogService {
571
733
  placement: 'center',
572
734
  offset: '1rem',
573
735
  width: '32rem',
736
+ minWidth: '18rem',
737
+ minHeight: '9rem',
574
738
  backdropClose: true,
575
- hasBackdrop: true
576
- // draggable: false,
577
- // resizable: false
739
+ hasBackdrop: true,
740
+ draggable: false,
741
+ resizable: false
578
742
  };
579
743
  this.renderer = this.rendererFactory.createRenderer(null, null);
580
744
  this.configDefault = this.configService.getConfigForComponent(X_DIALOG_CONFIG_NAME);
@@ -591,16 +755,48 @@ class XDialogService {
591
755
  scrollStrategy: this.overlay.scrollStrategies.block(),
592
756
  width: option.width,
593
757
  height: option.height,
758
+ minWidth: option.minWidth,
759
+ minHeight: option.minHeight,
594
760
  positionStrategy: this.portalService.setPlace(option.placement, option.offset)
595
761
  }
596
762
  });
597
- // if (option.resizable) {
598
- // this.renderer.addClass(portal.overlayRef?.hostElement, PortalResizablePrefix);
599
- // }
600
763
  const { overlayRef, componentRef } = portal || {};
601
764
  const { instance } = componentRef || {};
765
+ const { hostElement, overlayElement } = overlayRef || {};
766
+ const dialogRef = new XDialogRef(overlayRef, instance, this.renderer, this.portalService);
767
+ let dialogBox = {
768
+ draggable: option.draggable,
769
+ resizable: option.resizable
770
+ };
771
+ let defaultMaximize = this.setMaximize(option);
772
+ Object.assign(dialogBox, {
773
+ width: defaultMaximize ? this.default.width : option.width,
774
+ height: defaultMaximize ? null : option.height,
775
+ minWidth: option.minWidth,
776
+ minHeight: option.minHeight
777
+ });
602
778
  instance.placement = option.placement;
603
- const dialogRef = new XDialogRef(overlayRef, instance);
779
+ instance.option = option;
780
+ instance.dialogRef = dialogRef;
781
+ instance.defaultMaximize = defaultMaximize;
782
+ instance.dialogBox = dialogBox;
783
+ instance.hostElement = hostElement;
784
+ instance.overlayElement = overlayElement;
785
+ dialogRef.option = option;
786
+ dialogRef.fullscreen = defaultMaximize;
787
+ if (option.resizable && !defaultMaximize) {
788
+ this.renderer.addClass(hostElement, PortalResizablePrefix);
789
+ setTimeout(() => {
790
+ Object.assign(dialogBox, this.portalService.setResizable(overlayElement, option.placement));
791
+ instance.offsetLeft = overlayElement.offsetLeft;
792
+ instance.offsetTop = overlayElement.offsetTop;
793
+ const dialogDraggable = overlayElement?.querySelector('.x-dialog-portal');
794
+ instance.initHeight = dialogDraggable.clientHeight;
795
+ instance.dialogContent = overlayElement?.querySelector('.x-dialog-portal-content');
796
+ instance.initContentHeight = instance.dialogContent?.clientHeight;
797
+ instance.dialogBox = dialogBox;
798
+ });
799
+ }
604
800
  if (content instanceof TemplateRef) {
605
801
  instance.attachTemplatePortal(new TemplatePortal(content, option.viewContainerRef, { $implicit: option.data, dialogRef: dialogRef }));
606
802
  }
@@ -619,12 +815,22 @@ class XDialogService {
619
815
  }
620
816
  return dialogRef;
621
817
  }
818
+ setMaximize(option = {}) {
819
+ const ws = ['100%', '100vw'];
820
+ const hs = ['100%', '100vh'];
821
+ if (ws.includes(option.width) && hs.includes(option.height)) {
822
+ option.resizable = false;
823
+ option.draggable = false;
824
+ return true;
825
+ }
826
+ return false;
827
+ }
622
828
  }
623
- /** @nocollapse */ /** @nocollapse */ XDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogService, deps: [{ token: i1.XPortalService }, { token: i2$1.XConfigService }, { token: i2.Overlay }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
829
+ /** @nocollapse */ /** @nocollapse */ XDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogService, deps: [{ token: i1.XPortalService }, { token: i2$2.XConfigService }, { token: i2.Overlay }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
624
830
  /** @nocollapse */ /** @nocollapse */ XDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogService });
625
831
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogService, decorators: [{
626
832
  type: Injectable
627
- }], ctorParameters: function () { return [{ type: i1.XPortalService }, { type: i2$1.XConfigService }, { type: i2.Overlay }, { type: i0.RendererFactory2 }]; } });
833
+ }], ctorParameters: function () { return [{ type: i1.XPortalService }, { type: i2$2.XConfigService }, { type: i2.Overlay }, { type: i0.RendererFactory2 }]; } });
628
834
 
629
835
  class XDialogModule {
630
836
  }
@@ -634,6 +840,8 @@ class XDialogModule {
634
840
  XDialogTitleDirective,
635
841
  XDialogContentDirective,
636
842
  XDialogActionsDirective,
843
+ XDialogDragHandleDirective,
844
+ XDialogFullscreenDirective,
637
845
  XDialogPortalComponent,
638
846
  XDialogProperty], imports: [CommonModule,
639
847
  FormsModule,
@@ -650,6 +858,8 @@ class XDialogModule {
650
858
  XDialogTitleDirective,
651
859
  XDialogContentDirective,
652
860
  XDialogActionsDirective,
861
+ XDialogDragHandleDirective,
862
+ XDialogFullscreenDirective,
653
863
  XDialogPortalComponent] });
654
864
  /** @nocollapse */ /** @nocollapse */ XDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogModule, providers: [XDialogService], imports: [[
655
865
  CommonModule,
@@ -673,6 +883,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
673
883
  XDialogTitleDirective,
674
884
  XDialogContentDirective,
675
885
  XDialogActionsDirective,
886
+ XDialogDragHandleDirective,
887
+ XDialogFullscreenDirective,
676
888
  XDialogPortalComponent,
677
889
  XDialogProperty
678
890
  ],
@@ -682,6 +894,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
682
894
  XDialogTitleDirective,
683
895
  XDialogContentDirective,
684
896
  XDialogActionsDirective,
897
+ XDialogDragHandleDirective,
898
+ XDialogFullscreenDirective,
685
899
  XDialogPortalComponent
686
900
  ],
687
901
  imports: [
@@ -705,5 +919,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
705
919
  * Generated bundle index. Do not edit.
706
920
  */
707
921
 
708
- export { XDialogActionsDirective, XDialogCloseDirective, XDialogComponent, XDialogContainer, XDialogContentDirective, XDialogModule, XDialogPortalComponent, XDialogPrefix, XDialogProperty, XDialogRef, XDialogService, XDialogTitleDirective, X_DIALOG_CONFIG_NAME, X_DIALOG_DATA };
922
+ export { XDialogActionsDirective, XDialogCloseDirective, XDialogComponent, XDialogContainer, XDialogContentDirective, XDialogDragHandleDirective, XDialogFullscreenDirective, XDialogModule, XDialogPortalComponent, XDialogPrefix, XDialogProperty, XDialogRef, XDialogService, XDialogTitleDirective, X_DIALOG_CONFIG_NAME, X_DIALOG_DATA };
709
923
  //# sourceMappingURL=ng-nest-ui-dialog.mjs.map