@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
@@ -423,24 +425,35 @@ class XDialogComponent extends XDialogProperty {
423
425
  const contentHeight = Number(this.initContentHeight) + Number(event.clientHeight) - Number(this.initHeight);
424
426
  this.renderer.setStyle(this.dialogContent, 'max-height', 'initial');
425
427
  this.renderer.setStyle(this.dialogContent, 'flex', 'initial');
426
- this.renderer.setStyle(this.dialogContent, 'height', `${contentHeight}px`);
428
+ if (['top-start', 'top-end', 'bottom', 'top', 'bottom-start', 'bottom-end'].includes(event.direction)) {
429
+ this.renderer.setStyle(this.dialogContent, 'height', `${contentHeight}px`);
430
+ }
427
431
  }
428
432
  }
429
433
  /** @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 });
430
- /** @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 });
434
+ /** @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 });
431
435
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogComponent, decorators: [{
432
436
  type: Component,
433
- 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"] }]
437
+ 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"] }]
434
438
  }], 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: [{
435
439
  type: ViewChild,
436
440
  args: ['dialogTpl', { static: false }]
437
441
  }] } });
438
442
 
439
443
  class XDialogPortalComponent extends BasePortalOutlet {
440
- constructor() {
444
+ constructor(renderer) {
441
445
  super();
442
- this._has = true;
446
+ this.renderer = renderer;
443
447
  this.animationChanged = new EventEmitter();
448
+ this.offsetLeft = 0;
449
+ this.offsetTop = 0;
450
+ this.minWidth = '0rem';
451
+ this.minHeight = '0rem';
452
+ this.initHeight = 0;
453
+ this.initContentHeight = 0;
454
+ this.defaultMaximize = false;
455
+ this.distance = { x: 0, y: 0 };
456
+ this.dialogBox = {};
444
457
  }
445
458
  done({ toState, totalTime }) {
446
459
  this.animationChanged.next({ action: 'done', state: toState, totalTime });
@@ -448,6 +461,17 @@ class XDialogPortalComponent extends BasePortalOutlet {
448
461
  start({ toState, totalTime }) {
449
462
  this.animationChanged.next({ action: 'start', state: toState, totalTime });
450
463
  }
464
+ ngOnInit() {
465
+ this.dialogBox['draggable'] = this.defaultMaximize ? this.dialogBox['draggable'] : this.option.draggable;
466
+ this.dialogBox['resizable'] = this.defaultMaximize ? this.dialogBox['resizable'] : this.option.resizable;
467
+ }
468
+ ngAfterViewInit() {
469
+ let list = new QueryList();
470
+ for (let item of this.dialogRef.dragHandleRefs) {
471
+ list.reset([...list.toArray(), new CdkDragHandle(item, this.dragRef)]);
472
+ }
473
+ this.dragRef._handles = list;
474
+ }
451
475
  attachComponentPortal(portal) {
452
476
  if (this.portalOutlet.hasAttached()) {
453
477
  throw Error('dialog portal has attached');
@@ -460,16 +484,24 @@ class XDialogPortalComponent extends BasePortalOutlet {
460
484
  }
461
485
  return this.portalOutlet.attachTemplatePortal(portal);
462
486
  }
487
+ resizing(event) {
488
+ const contentHeight = Number(this.initContentHeight) + Number(event.clientHeight) - Number(this.initHeight);
489
+ this.renderer.setStyle(this.dialogContent, 'max-height', 'initial');
490
+ this.renderer.setStyle(this.dialogContent, 'flex', 'initial');
491
+ if (['top-start', 'top-end', 'bottom', 'top', 'bottom-start', 'bottom-end'].includes(event.direction)) {
492
+ this.renderer.setStyle(this.dialogContent, 'height', `${contentHeight}px`);
493
+ }
494
+ }
495
+ onDragEnded(event) {
496
+ this.distance = { x: this.distance.x + event.distance.x, y: this.distance.y + event.distance.y };
497
+ }
463
498
  }
464
- /** @nocollapse */ /** @nocollapse */ XDialogPortalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogPortalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
465
- /** @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 });
499
+ /** @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 });
500
+ /** @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 });
466
501
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogPortalComponent, decorators: [{
467
502
  type: Component,
468
- 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"] }]
469
- }], ctorParameters: function () { return []; }, propDecorators: { _has: [{
470
- type: HostBinding,
471
- args: ['class.x-dialog-portal']
472
- }], placement: [{
503
+ 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"] }]
504
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { placement: [{
473
505
  type: HostBinding,
474
506
  args: ['@x-move-box-animation']
475
507
  }], done: [{
@@ -481,13 +513,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
481
513
  }], portalOutlet: [{
482
514
  type: ViewChild,
483
515
  args: [CdkPortalOutlet, { static: true }]
516
+ }], dragRef: [{
517
+ type: ViewChild,
518
+ args: [CdkDrag, { static: true }]
519
+ }], handles: [{
520
+ type: ContentChildren,
521
+ args: [CdkDragHandle, { descendants: true }]
484
522
  }] } });
485
523
 
486
524
  // TODO: add more function
487
525
  class XDialogRef {
488
- constructor(overlayRef, containerInstance) {
526
+ constructor(overlayRef, containerInstance, renderer, portalService) {
489
527
  this.overlayRef = overlayRef;
490
528
  this.containerInstance = containerInstance;
529
+ this.renderer = renderer;
530
+ this.portalService = portalService;
531
+ this.fullscreen = false;
532
+ this.dragHandleRefs = [];
533
+ this._isFristFullscreen = true;
491
534
  }
492
535
  close() {
493
536
  this.containerInstance.animationChanged
@@ -497,6 +540,81 @@ class XDialogRef {
497
540
  });
498
541
  this.containerInstance.placement = 'void';
499
542
  }
543
+ onFullscreen() {
544
+ var _a, _b;
545
+ let { dialogBox, dialogRef, overlayElement, distance, hostElement, defaultMaximize } = this.containerInstance;
546
+ if (!dialogRef.fullscreen) {
547
+ dialogRef.overlayRef.updateSize({
548
+ width: '100%',
549
+ height: '100%',
550
+ minWidth: '100%',
551
+ minHeight: '100%'
552
+ });
553
+ dialogRef.fullscreen = true;
554
+ dialogBox['minWidth'] = '100%';
555
+ dialogBox['minHeight'] = '100%';
556
+ dialogBox['draggable'] = false;
557
+ dialogBox['resizable'] = false;
558
+ if (this.option.resizable) {
559
+ this.renderer.setStyle(overlayElement, 'margin', '0 0 0 0');
560
+ }
561
+ if (this.option.draggable) {
562
+ dialogBox['distance'] = { x: 0, y: 0 };
563
+ }
564
+ }
565
+ else {
566
+ dialogBox['minWidth'] = this.option.minWidth;
567
+ dialogBox['minHeight'] = this.option.minHeight;
568
+ if (this._isFristFullscreen && defaultMaximize) {
569
+ this.option.draggable = dialogBox['draggable'];
570
+ this.option.resizable = dialogBox['resizable'];
571
+ }
572
+ else {
573
+ dialogBox['draggable'] = this.option.draggable;
574
+ dialogBox['resizable'] = this.option.resizable;
575
+ }
576
+ (_a = dialogRef.overlayRef) === null || _a === void 0 ? void 0 : _a.updateSize({
577
+ width: dialogBox['width'],
578
+ height: dialogBox['height'],
579
+ minWidth: dialogBox['minWidth'],
580
+ minHeight: dialogBox['minHeight']
581
+ });
582
+ dialogRef.fullscreen = false;
583
+ if (this.option.draggable) {
584
+ dialogBox['distance'] = Object.assign({}, distance);
585
+ }
586
+ if (this.option.resizable) {
587
+ if (dialogBox['marginTop']) {
588
+ this.renderer.setStyle(overlayElement, 'margin-top', `${dialogBox['marginTop']}`);
589
+ }
590
+ if (dialogBox['marginLeft']) {
591
+ this.renderer.setStyle(overlayElement, 'margin-left', `${dialogBox['marginLeft']}`);
592
+ }
593
+ if (dialogBox['marginRight']) {
594
+ this.renderer.setStyle(overlayElement, 'margin-right', `${dialogBox['marginRight']}`);
595
+ }
596
+ if (dialogBox['marginBottom']) {
597
+ this.renderer.setStyle(overlayElement, 'margin-bottom', `${dialogBox['marginBottom']}`);
598
+ }
599
+ }
600
+ if (this._isFristFullscreen && defaultMaximize) {
601
+ (_b = dialogRef.overlayRef) === null || _b === void 0 ? void 0 : _b.updatePositionStrategy(this.portalService.setPlace(this.option.placement, this.option.offset));
602
+ this.renderer.addClass(hostElement, PortalResizablePrefix);
603
+ setTimeout(() => {
604
+ var _a;
605
+ Object.assign(dialogBox, this.portalService.setResizable(overlayElement, this.option.placement));
606
+ this.containerInstance.offsetLeft = overlayElement.offsetLeft;
607
+ this.containerInstance.offsetTop = overlayElement.offsetTop;
608
+ const dialogDraggable = overlayElement === null || overlayElement === void 0 ? void 0 : overlayElement.querySelector('.x-dialog-portal');
609
+ this.containerInstance.initHeight = dialogDraggable.clientHeight;
610
+ this.containerInstance.dialogContent = overlayElement === null || overlayElement === void 0 ? void 0 : overlayElement.querySelector('.x-dialog-portal-content');
611
+ this.containerInstance.initContentHeight = (_a = this.containerInstance.dialogContent) === null || _a === void 0 ? void 0 : _a.clientHeight;
612
+ this.containerInstance.dialogBox = dialogBox;
613
+ });
614
+ }
615
+ }
616
+ this._isFristFullscreen = false;
617
+ }
500
618
  }
501
619
 
502
620
  class XDialogCloseDirective {
@@ -569,6 +687,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
569
687
  }], propDecorators: { _has: [{
570
688
  type: HostBinding,
571
689
  args: ['class.x-dialog-portal-actions']
690
+ }] } });
691
+ class XDialogDragHandleDirective {
692
+ constructor(dialogRef, elementRef) {
693
+ this.dialogRef = dialogRef;
694
+ this.elementRef = elementRef;
695
+ }
696
+ get getDraggable() {
697
+ return !this.dialogRef.fullscreen && this.dialogRef.option.draggable;
698
+ }
699
+ ngOnInit() {
700
+ this.dialogRef.dragHandleRefs.push(this.elementRef);
701
+ }
702
+ }
703
+ /** @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 });
704
+ /** @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 });
705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogDragHandleDirective, decorators: [{
706
+ type: Directive,
707
+ args: [{
708
+ selector: `[x-dialog-drag-handle], x-dialog-drag-handle`
709
+ }]
710
+ }], ctorParameters: function () {
711
+ return [{ type: XDialogRef, decorators: [{
712
+ type: Optional
713
+ }] }, { type: i0.ElementRef }];
714
+ }, propDecorators: { getDraggable: [{
715
+ type: HostBinding,
716
+ args: ['class.x-dialog-portal-drag-handle']
717
+ }] } });
718
+ class XDialogFullscreenDirective {
719
+ constructor(dialogRef) {
720
+ this.dialogRef = dialogRef;
721
+ }
722
+ onFullscreenClick() {
723
+ this.dialogRef && this.dialogRef.onFullscreen();
724
+ }
725
+ }
726
+ /** @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 });
727
+ /** @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 });
728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogFullscreenDirective, decorators: [{
729
+ type: Directive,
730
+ args: [{
731
+ selector: `[x-dialog-fullscreen], x-dialog-fullscreen`
732
+ }]
733
+ }], ctorParameters: function () {
734
+ return [{ type: XDialogRef, decorators: [{
735
+ type: Optional
736
+ }] }];
737
+ }, propDecorators: { onFullscreenClick: [{
738
+ type: HostListener,
739
+ args: ['click', ['$event']]
572
740
  }] } });
573
741
 
574
742
  class XDialogService {
@@ -581,10 +749,12 @@ class XDialogService {
581
749
  placement: 'center',
582
750
  offset: '1rem',
583
751
  width: '32rem',
752
+ minWidth: '18rem',
753
+ minHeight: '9rem',
584
754
  backdropClose: true,
585
- hasBackdrop: true
586
- // draggable: false,
587
- // resizable: false
755
+ hasBackdrop: true,
756
+ draggable: false,
757
+ resizable: false
588
758
  };
589
759
  this.renderer = this.rendererFactory.createRenderer(null, null);
590
760
  this.configDefault = this.configService.getConfigForComponent(X_DIALOG_CONFIG_NAME);
@@ -601,16 +771,49 @@ class XDialogService {
601
771
  scrollStrategy: this.overlay.scrollStrategies.block(),
602
772
  width: option.width,
603
773
  height: option.height,
774
+ minWidth: option.minWidth,
775
+ minHeight: option.minHeight,
604
776
  positionStrategy: this.portalService.setPlace(option.placement, option.offset)
605
777
  }
606
778
  });
607
- // if (option.resizable) {
608
- // this.renderer.addClass(portal.overlayRef?.hostElement, PortalResizablePrefix);
609
- // }
610
779
  const { overlayRef, componentRef } = portal || {};
611
780
  const { instance } = componentRef || {};
781
+ const { hostElement, overlayElement } = overlayRef || {};
782
+ const dialogRef = new XDialogRef(overlayRef, instance, this.renderer, this.portalService);
783
+ let dialogBox = {
784
+ draggable: option.draggable,
785
+ resizable: option.resizable
786
+ };
787
+ let defaultMaximize = this.setMaximize(option);
788
+ Object.assign(dialogBox, {
789
+ width: defaultMaximize ? this.default.width : option.width,
790
+ height: defaultMaximize ? null : option.height,
791
+ minWidth: option.minWidth,
792
+ minHeight: option.minHeight
793
+ });
612
794
  instance.placement = option.placement;
613
- const dialogRef = new XDialogRef(overlayRef, instance);
795
+ instance.option = option;
796
+ instance.dialogRef = dialogRef;
797
+ instance.defaultMaximize = defaultMaximize;
798
+ instance.dialogBox = dialogBox;
799
+ instance.hostElement = hostElement;
800
+ instance.overlayElement = overlayElement;
801
+ dialogRef.option = option;
802
+ dialogRef.fullscreen = defaultMaximize;
803
+ if (option.resizable && !defaultMaximize) {
804
+ this.renderer.addClass(hostElement, PortalResizablePrefix);
805
+ setTimeout(() => {
806
+ var _a;
807
+ Object.assign(dialogBox, this.portalService.setResizable(overlayElement, option.placement));
808
+ instance.offsetLeft = overlayElement.offsetLeft;
809
+ instance.offsetTop = overlayElement.offsetTop;
810
+ const dialogDraggable = overlayElement === null || overlayElement === void 0 ? void 0 : overlayElement.querySelector('.x-dialog-portal');
811
+ instance.initHeight = dialogDraggable.clientHeight;
812
+ instance.dialogContent = overlayElement === null || overlayElement === void 0 ? void 0 : overlayElement.querySelector('.x-dialog-portal-content');
813
+ instance.initContentHeight = (_a = instance.dialogContent) === null || _a === void 0 ? void 0 : _a.clientHeight;
814
+ instance.dialogBox = dialogBox;
815
+ });
816
+ }
614
817
  if (content instanceof TemplateRef) {
615
818
  instance.attachTemplatePortal(new TemplatePortal(content, option.viewContainerRef, { $implicit: option.data, dialogRef: dialogRef }));
616
819
  }
@@ -629,12 +832,22 @@ class XDialogService {
629
832
  }
630
833
  return dialogRef;
631
834
  }
835
+ setMaximize(option = {}) {
836
+ const ws = ['100%', '100vw'];
837
+ const hs = ['100%', '100vh'];
838
+ if (ws.includes(option.width) && hs.includes(option.height)) {
839
+ option.resizable = false;
840
+ option.draggable = false;
841
+ return true;
842
+ }
843
+ return false;
844
+ }
632
845
  }
633
- /** @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 });
846
+ /** @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 });
634
847
  /** @nocollapse */ /** @nocollapse */ XDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogService });
635
848
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogService, decorators: [{
636
849
  type: Injectable
637
- }], ctorParameters: function () { return [{ type: i1.XPortalService }, { type: i2$1.XConfigService }, { type: i2.Overlay }, { type: i0.RendererFactory2 }]; } });
850
+ }], ctorParameters: function () { return [{ type: i1.XPortalService }, { type: i2$2.XConfigService }, { type: i2.Overlay }, { type: i0.RendererFactory2 }]; } });
638
851
 
639
852
  class XDialogModule {
640
853
  }
@@ -644,6 +857,8 @@ class XDialogModule {
644
857
  XDialogTitleDirective,
645
858
  XDialogContentDirective,
646
859
  XDialogActionsDirective,
860
+ XDialogDragHandleDirective,
861
+ XDialogFullscreenDirective,
647
862
  XDialogPortalComponent,
648
863
  XDialogProperty], imports: [CommonModule,
649
864
  FormsModule,
@@ -660,6 +875,8 @@ class XDialogModule {
660
875
  XDialogTitleDirective,
661
876
  XDialogContentDirective,
662
877
  XDialogActionsDirective,
878
+ XDialogDragHandleDirective,
879
+ XDialogFullscreenDirective,
663
880
  XDialogPortalComponent] });
664
881
  /** @nocollapse */ /** @nocollapse */ XDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: XDialogModule, providers: [XDialogService], imports: [[
665
882
  CommonModule,
@@ -683,6 +900,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
683
900
  XDialogTitleDirective,
684
901
  XDialogContentDirective,
685
902
  XDialogActionsDirective,
903
+ XDialogDragHandleDirective,
904
+ XDialogFullscreenDirective,
686
905
  XDialogPortalComponent,
687
906
  XDialogProperty
688
907
  ],
@@ -692,6 +911,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
692
911
  XDialogTitleDirective,
693
912
  XDialogContentDirective,
694
913
  XDialogActionsDirective,
914
+ XDialogDragHandleDirective,
915
+ XDialogFullscreenDirective,
695
916
  XDialogPortalComponent
696
917
  ],
697
918
  imports: [
@@ -715,5 +936,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
715
936
  * Generated bundle index. Do not edit.
716
937
  */
717
938
 
718
- export { XDialogActionsDirective, XDialogCloseDirective, XDialogComponent, XDialogContainer, XDialogContentDirective, XDialogModule, XDialogPortalComponent, XDialogPrefix, XDialogProperty, XDialogRef, XDialogService, XDialogTitleDirective, X_DIALOG_CONFIG_NAME, X_DIALOG_DATA };
939
+ export { XDialogActionsDirective, XDialogCloseDirective, XDialogComponent, XDialogContainer, XDialogContentDirective, XDialogDragHandleDirective, XDialogFullscreenDirective, XDialogModule, XDialogPortalComponent, XDialogPrefix, XDialogProperty, XDialogRef, XDialogService, XDialogTitleDirective, X_DIALOG_CONFIG_NAME, X_DIALOG_DATA };
719
940
  //# sourceMappingURL=ng-nest-ui-dialog.mjs.map