@koobiq/components 16.0.0-beta.6 → 16.0.0-beta.7

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 (283) hide show
  1. package/autocomplete/autocomplete-trigger.directive.d.ts +5 -15
  2. package/button-toggle/button-toggle.component.d.ts +2 -2
  3. package/checkbox/_checkbox-theme.scss +10 -2
  4. package/checkbox/checkbox.d.ts +1 -1
  5. package/code-block/README.md +14 -14
  6. package/code-block/_code-block-theme.scss +8 -0
  7. package/code-block/code-block.component.d.ts +1 -1
  8. package/core/animation/index.d.ts +1 -1
  9. package/core/animation/select-animations.d.ts +1 -1
  10. package/core/formatters/index.d.ts +1 -1
  11. package/core/formatters/number/formatter.d.ts +56 -1
  12. package/core/forms/forms.directive.d.ts +2 -2
  13. package/core/locales/en-US.d.ts +19 -1
  14. package/core/locales/es-LA.d.ts +27 -0
  15. package/core/locales/fa-IR.d.ts +28 -0
  16. package/core/locales/locale-service.d.ts +148 -3
  17. package/core/locales/pt-BR.d.ts +27 -0
  18. package/core/locales/ru-RU.d.ts +20 -1
  19. package/core/locales/zh-CN.d.ts +26 -0
  20. package/core/option/action.d.ts +1 -1
  21. package/core/option/optgroup.d.ts +1 -1
  22. package/core/option/option.d.ts +37 -8
  23. package/core/overlay/overlay-position-map.d.ts +7 -1
  24. package/core/pop-up/constants.d.ts +2 -1
  25. package/core/public-api.d.ts +1 -0
  26. package/core/select/constants.d.ts +2 -2
  27. package/core/services/theme.service.d.ts +23 -0
  28. package/core/styles/_variables.scss +1 -0
  29. package/core/styles/common/_select.scss +24 -24
  30. package/core/styles/theming/_components-theming.scss +31 -5
  31. package/datepicker/calendar-body.component.d.ts +1 -1
  32. package/datepicker/calendar-header.component.d.ts +9 -3
  33. package/datepicker/calendar.component.d.ts +4 -5
  34. package/datepicker/datepicker-animations.d.ts +1 -1
  35. package/datepicker/datepicker-input.directive.d.ts +4 -4
  36. package/datepicker/datepicker-toggle.component.d.ts +3 -3
  37. package/datepicker/datepicker.component.d.ts +2 -2
  38. package/datepicker/month-view.component.d.ts +5 -6
  39. package/dl/_dl-theme.scss +2 -56
  40. package/dl/dl.component.d.ts +1 -2
  41. package/dl/dl.scss +10 -47
  42. package/dropdown/dropdown-animations.d.ts +1 -1
  43. package/dropdown/dropdown-content.directive.d.ts +1 -1
  44. package/dropdown/dropdown-item.component.d.ts +1 -1
  45. package/dropdown/dropdown-trigger.directive.d.ts +2 -2
  46. package/dropdown/dropdown.component.d.ts +1 -1
  47. package/dropdown/dropdown.types.d.ts +1 -1
  48. package/esm2022/alert/alert.component.mjs +2 -2
  49. package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +24 -21
  50. package/esm2022/button-toggle/button-toggle.component.mjs +8 -8
  51. package/esm2022/checkbox/checkbox.mjs +3 -3
  52. package/esm2022/code-block/actionbar.component.mjs +1 -1
  53. package/esm2022/code-block/code-block.component.mjs +3 -3
  54. package/esm2022/core/animation/index.mjs +2 -2
  55. package/esm2022/core/animation/select-animations.mjs +4 -4
  56. package/esm2022/core/formatters/index.mjs +10 -2
  57. package/esm2022/core/formatters/number/formatter.mjs +224 -3
  58. package/esm2022/core/forms/forms.directive.mjs +5 -5
  59. package/esm2022/core/locales/en-US.mjs +22 -4
  60. package/esm2022/core/locales/es-LA.mjs +31 -2
  61. package/esm2022/core/locales/fa-IR.mjs +30 -2
  62. package/esm2022/core/locales/locale-service.mjs +4 -4
  63. package/esm2022/core/locales/pt-BR.mjs +29 -2
  64. package/esm2022/core/locales/ru-RU.mjs +23 -2
  65. package/esm2022/core/locales/zh-CN.mjs +28 -2
  66. package/esm2022/core/option/action.mjs +3 -3
  67. package/esm2022/core/option/optgroup.mjs +3 -3
  68. package/esm2022/core/option/option.mjs +47 -10
  69. package/esm2022/core/overlay/overlay-position-map.mjs +7 -1
  70. package/esm2022/core/pop-up/constants.mjs +2 -1
  71. package/esm2022/core/pop-up/pop-up-trigger.mjs +12 -3
  72. package/esm2022/core/public-api.mjs +2 -1
  73. package/esm2022/core/select/constants.mjs +3 -3
  74. package/esm2022/core/services/theme.service.mjs +60 -0
  75. package/esm2022/core/version.mjs +2 -2
  76. package/esm2022/datepicker/calendar-body.component.mjs +3 -3
  77. package/esm2022/datepicker/calendar-header.component.mjs +9 -8
  78. package/esm2022/datepicker/calendar.component.mjs +7 -16
  79. package/esm2022/datepicker/datepicker-animations.mjs +2 -2
  80. package/esm2022/datepicker/datepicker-input.directive.mjs +29 -20
  81. package/esm2022/datepicker/datepicker-toggle.component.mjs +6 -6
  82. package/esm2022/datepicker/datepicker.component.mjs +11 -11
  83. package/esm2022/datepicker/month-view.component.mjs +9 -18
  84. package/esm2022/dl/dl.component.mjs +3 -7
  85. package/esm2022/dropdown/dropdown-animations.mjs +4 -4
  86. package/esm2022/dropdown/dropdown-content.directive.mjs +3 -3
  87. package/esm2022/dropdown/dropdown-errors.mjs +6 -6
  88. package/esm2022/dropdown/dropdown-item.component.mjs +5 -5
  89. package/esm2022/dropdown/dropdown-trigger.directive.mjs +8 -8
  90. package/esm2022/dropdown/dropdown.component.mjs +8 -8
  91. package/esm2022/dropdown/dropdown.types.mjs +1 -1
  92. package/esm2022/file-upload/file-drop.mjs +4 -4
  93. package/esm2022/file-upload/multiple-file-upload.component.mjs +12 -8
  94. package/esm2022/file-upload/single-file-upload.component.mjs +12 -8
  95. package/esm2022/form-field/cleaner.mjs +3 -3
  96. package/esm2022/form-field/form-field.mjs +7 -7
  97. package/esm2022/form-field/hint.mjs +4 -4
  98. package/esm2022/form-field/password-hint.mjs +11 -11
  99. package/esm2022/form-field/password-toggle.mjs +21 -8
  100. package/esm2022/form-field/suffix.mjs +3 -3
  101. package/esm2022/form-field/validate.directive.mjs +4 -4
  102. package/esm2022/input/input-number.mjs +259 -43
  103. package/esm2022/link/link.component.mjs +3 -3
  104. package/esm2022/list/list-selection.component.mjs +6 -6
  105. package/esm2022/loader-overlay/loader-overlay.component.mjs +2 -2
  106. package/esm2022/modal/modal-control.service.mjs +5 -5
  107. package/esm2022/modal/modal-ref.class.mjs +1 -1
  108. package/esm2022/modal/modal.component.mjs +124 -111
  109. package/esm2022/modal/modal.service.mjs +23 -23
  110. package/esm2022/modal/modal.type.mjs +1 -3
  111. package/esm2022/navbar/navbar-item.component.mjs +6 -6
  112. package/esm2022/navbar/navbar.component.mjs +18 -9
  113. package/esm2022/navbar/vertical-navbar.component.mjs +9 -6
  114. package/esm2022/popover/popover-animations.mjs +2 -2
  115. package/esm2022/popover/popover-confirm.component.mjs +9 -9
  116. package/esm2022/popover/popover.component.mjs +23 -23
  117. package/esm2022/radio/radio.component.mjs +10 -8
  118. package/esm2022/select/select.component.mjs +32 -17
  119. package/esm2022/sidebar/sidebar-animations.mjs +2 -2
  120. package/esm2022/sidebar/sidebar.component.mjs +9 -9
  121. package/esm2022/sidepanel/sidepanel-directives.mjs +2 -2
  122. package/esm2022/splitter/splitter.component.mjs +3 -3
  123. package/esm2022/table/table.component.mjs +3 -3
  124. package/esm2022/tabs/tab-body.component.mjs +7 -7
  125. package/esm2022/tabs/tab-content.directive.mjs +3 -3
  126. package/esm2022/tabs/tab-group.component.mjs +3 -3
  127. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +6 -6
  128. package/esm2022/tabs/tab.component.mjs +14 -5
  129. package/esm2022/tabs/tabs-animations.mjs +2 -2
  130. package/esm2022/tags/tag-input.mjs +3 -3
  131. package/esm2022/tags/tag-list.component.mjs +5 -5
  132. package/esm2022/tags/tag.component.mjs +10 -10
  133. package/esm2022/timepicker/timepicker.directive.mjs +10 -10
  134. package/esm2022/timezone/timezone-option.component.mjs +3 -3
  135. package/esm2022/timezone/timezone-select.component.mjs +5 -5
  136. package/esm2022/title/title.directive.mjs +5 -5
  137. package/esm2022/toast/toast.module.mjs +10 -4
  138. package/esm2022/toggle/toggle.component.mjs +3 -3
  139. package/esm2022/tooltip/tooltip.component.mjs +16 -16
  140. package/esm2022/tree/node.mjs +5 -5
  141. package/esm2022/tree/outlet.mjs +3 -3
  142. package/esm2022/tree/padding.directive.mjs +6 -6
  143. package/esm2022/tree/toggle.mjs +8 -8
  144. package/esm2022/tree/tree-base.mjs +3 -3
  145. package/esm2022/tree/tree-option.component.mjs +8 -5
  146. package/esm2022/tree/tree-selection.component.mjs +8 -6
  147. package/esm2022/tree/tree.mjs +3 -3
  148. package/esm2022/tree-select/tree-select.component.mjs +13 -13
  149. package/fesm2022/koobiq-components-alert.mjs +2 -2
  150. package/fesm2022/koobiq-components-alert.mjs.map +1 -1
  151. package/fesm2022/koobiq-components-autocomplete.mjs +24 -21
  152. package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
  153. package/fesm2022/koobiq-components-button-toggle.mjs +7 -7
  154. package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
  155. package/fesm2022/koobiq-components-checkbox.mjs +2 -2
  156. package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
  157. package/fesm2022/koobiq-components-code-block.mjs +3 -3
  158. package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
  159. package/fesm2022/koobiq-components-core.mjs +526 -39
  160. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  161. package/fesm2022/koobiq-components-datepicker.mjs +66 -74
  162. package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
  163. package/fesm2022/koobiq-components-dl.mjs +2 -6
  164. package/fesm2022/koobiq-components-dl.mjs.map +1 -1
  165. package/fesm2022/koobiq-components-dropdown.mjs +28 -28
  166. package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
  167. package/fesm2022/koobiq-components-file-upload.mjs +23 -15
  168. package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
  169. package/fesm2022/koobiq-components-form-field.mjs +46 -34
  170. package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
  171. package/fesm2022/koobiq-components-input.mjs +257 -43
  172. package/fesm2022/koobiq-components-input.mjs.map +1 -1
  173. package/fesm2022/koobiq-components-link.mjs +2 -2
  174. package/fesm2022/koobiq-components-link.mjs.map +1 -1
  175. package/fesm2022/koobiq-components-list.mjs +5 -5
  176. package/fesm2022/koobiq-components-list.mjs.map +1 -1
  177. package/fesm2022/koobiq-components-loader-overlay.mjs +2 -2
  178. package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
  179. package/fesm2022/koobiq-components-modal.mjs +149 -140
  180. package/fesm2022/koobiq-components-modal.mjs.map +1 -1
  181. package/fesm2022/koobiq-components-navbar.mjs +28 -20
  182. package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
  183. package/fesm2022/koobiq-components-popover.mjs +30 -30
  184. package/fesm2022/koobiq-components-popover.mjs.map +1 -1
  185. package/fesm2022/koobiq-components-radio.mjs +9 -7
  186. package/fesm2022/koobiq-components-radio.mjs.map +1 -1
  187. package/fesm2022/koobiq-components-select.mjs +31 -16
  188. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  189. package/fesm2022/koobiq-components-sidebar.mjs +8 -8
  190. package/fesm2022/koobiq-components-sidebar.mjs.map +1 -1
  191. package/fesm2022/koobiq-components-sidepanel.mjs +1 -1
  192. package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
  193. package/fesm2022/koobiq-components-splitter.mjs +2 -2
  194. package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
  195. package/fesm2022/koobiq-components-table.mjs +2 -2
  196. package/fesm2022/koobiq-components-table.mjs.map +1 -1
  197. package/fesm2022/koobiq-components-tabs.mjs +29 -20
  198. package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
  199. package/fesm2022/koobiq-components-tags.mjs +15 -15
  200. package/fesm2022/koobiq-components-tags.mjs.map +1 -1
  201. package/fesm2022/koobiq-components-timepicker.mjs +9 -9
  202. package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
  203. package/fesm2022/koobiq-components-timezone.mjs +6 -6
  204. package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
  205. package/fesm2022/koobiq-components-title.mjs +4 -4
  206. package/fesm2022/koobiq-components-title.mjs.map +1 -1
  207. package/fesm2022/koobiq-components-toast.mjs +8 -2
  208. package/fesm2022/koobiq-components-toast.mjs.map +1 -1
  209. package/fesm2022/koobiq-components-toggle.mjs +2 -2
  210. package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
  211. package/fesm2022/koobiq-components-tooltip.mjs +15 -15
  212. package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
  213. package/fesm2022/koobiq-components-tree-select.mjs +12 -12
  214. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
  215. package/fesm2022/koobiq-components-tree.mjs +36 -31
  216. package/fesm2022/koobiq-components-tree.mjs.map +1 -1
  217. package/file-upload/file-drop.d.ts +1 -1
  218. package/file-upload/multiple-file-upload.component.d.ts +4 -3
  219. package/file-upload/single-file-upload.component.d.ts +4 -3
  220. package/form-field/_hint-theme.scss +1 -1
  221. package/form-field/cleaner.d.ts +1 -1
  222. package/form-field/form-field.d.ts +2 -2
  223. package/form-field/form-field.scss +2 -2
  224. package/form-field/hint.d.ts +1 -1
  225. package/form-field/password-hint.d.ts +2 -1
  226. package/form-field/password-toggle.d.ts +11 -6
  227. package/form-field/suffix.d.ts +1 -1
  228. package/form-field/validate.directive.d.ts +1 -1
  229. package/icon/_icon-theme.scss +2 -1
  230. package/input/input-number.d.ts +61 -10
  231. package/link/_link-theme.scss +4 -0
  232. package/link/link.component.d.ts +1 -1
  233. package/list/list-selection.component.d.ts +1 -1
  234. package/loader-overlay/loader-overlay.scss +3 -0
  235. package/modal/README.md +5 -5
  236. package/modal/modal-ref.class.d.ts +2 -2
  237. package/modal/modal.component.d.ts +51 -47
  238. package/modal/modal.type.d.ts +35 -36
  239. package/navbar/navbar-item.component.d.ts +2 -2
  240. package/navbar/navbar.component.d.ts +5 -2
  241. package/navbar/vertical-navbar.component.d.ts +4 -2
  242. package/package.json +9 -11
  243. package/popover/README.md +14 -14
  244. package/popover/_popover-theme.scss +11 -11
  245. package/popover/popover-animations.d.ts +1 -1
  246. package/popover/popover-confirm.component.d.ts +1 -1
  247. package/popover/popover.component.d.ts +3 -3
  248. package/prebuilt-themes/dark-theme.css +1 -1
  249. package/prebuilt-themes/light-theme.css +1 -1
  250. package/radio/_radio-theme.scss +15 -2
  251. package/radio/radio.component.d.ts +2 -2
  252. package/radio/radio.scss +13 -0
  253. package/select/select.component.d.ts +14 -11
  254. package/sidebar/sidebar-animations.d.ts +1 -1
  255. package/sidebar/sidebar.component.d.ts +3 -3
  256. package/splitter/splitter.component.d.ts +1 -1
  257. package/table/table.component.d.ts +1 -1
  258. package/tabs/tab-body.component.d.ts +1 -1
  259. package/tabs/tab-content.directive.d.ts +1 -1
  260. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +2 -2
  261. package/tabs/tab.component.d.ts +1 -1
  262. package/tabs/tabs-animations.d.ts +1 -1
  263. package/tags/_tag-theme.scss +1 -1
  264. package/tags/tag-input.d.ts +2 -2
  265. package/tags/tag-list.component.d.ts +2 -2
  266. package/tags/tag-list.scss +2 -0
  267. package/tags/tag.component.d.ts +3 -3
  268. package/timepicker/timepicker.directive.d.ts +2 -2
  269. package/timezone/timezone-option.component.d.ts +1 -1
  270. package/timezone/timezone-select.component.d.ts +1 -1
  271. package/title/title.directive.d.ts +1 -1
  272. package/toggle/toggle.component.d.ts +1 -1
  273. package/tooltip/tooltip.component.d.ts +3 -3
  274. package/tree/node.d.ts +1 -1
  275. package/tree/outlet.d.ts +1 -1
  276. package/tree/padding.directive.d.ts +1 -1
  277. package/tree/toggle.d.ts +3 -3
  278. package/tree/tree-base.d.ts +1 -1
  279. package/tree/tree-option.component.d.ts +1 -1
  280. package/tree/tree-option.scss +2 -0
  281. package/tree/tree-selection.component.d.ts +1 -1
  282. package/tree/tree.d.ts +1 -1
  283. package/tree-select/tree-select.component.d.ts +1 -1
@@ -1,14 +1,15 @@
1
+ import * as i3 from '@angular/cdk/a11y';
2
+ import { A11yModule, FocusTrapFactory, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
1
3
  import * as i1 from '@angular/cdk/overlay';
2
4
  import { OverlayRef, OverlayModule } from '@angular/cdk/overlay';
3
- import * as i3 from '@angular/common';
5
+ import * as i4 from '@angular/common';
4
6
  import { DOCUMENT, CommonModule } from '@angular/common';
5
7
  import * as i0 from '@angular/core';
6
8
  import { Injectable, Optional, SkipSelf, Pipe, EventEmitter, TemplateRef, Type, Injector, ViewContainerRef, ElementRef, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, Input, Output, ViewChild, ViewChildren, Directive, NgModule } from '@angular/core';
7
9
  import { ESCAPE, ENTER } from '@koobiq/cdk/keycodes';
8
10
  import { KbqComponentColors } from '@koobiq/components/core';
11
+ import { take, filter } from 'rxjs/operators';
9
12
  import { Subject } from 'rxjs';
10
- import * as i4 from '@angular/cdk/a11y';
11
- import { A11yModule, FocusTrapFactory, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
12
13
  import * as i5 from '@koobiq/components/button';
13
14
  import { KbqButtonModule } from '@koobiq/components/button';
14
15
  import * as i6 from '@koobiq/components/icon';
@@ -16,7 +17,6 @@ import { KbqIconModule } from '@koobiq/components/icon';
16
17
  import * as i7 from '@koobiq/components/title';
17
18
  import { KbqTitleModule } from '@koobiq/components/title';
18
19
  import { ComponentPortal } from '@angular/cdk/portal';
19
- import { filter } from 'rxjs/operators';
20
20
 
21
21
  class KbqModalControlService {
22
22
  // Track singleton afterAllClose through over the injection tree
@@ -70,20 +70,20 @@ class KbqModalControlService {
70
70
  }
71
71
  handleMultipleMasks(modalRef) {
72
72
  const modals = Array.from(this.registeredMetaMap.values()).map((v) => v.modalRef);
73
- if (modals.filter((modal) => modal.mcVisible).length > 1) {
73
+ if (modals.filter((modal) => modal.kbqVisible).length > 1) {
74
74
  const otherModals = modals.splice(0, modals.length - 1)
75
- .filter((modal) => modal.mcVisible && modal.mcMask);
75
+ .filter((modal) => modal.kbqVisible && modal.kbqMask);
76
76
  // hide other masks
77
77
  setTimeout(() => {
78
78
  otherModals.forEach((modal) => {
79
- modal.getInstance().mcMask = false;
79
+ modal.getInstance().kbqMask = false;
80
80
  modal.markForCheck();
81
81
  });
82
82
  });
83
83
  // show other masks on close
84
84
  modalRef.afterClose.subscribe(() => {
85
85
  otherModals.forEach((modal) => {
86
- modal.getInstance().mcMask = true;
86
+ modal.getInstance().kbqMask = true;
87
87
  modal.markForCheck();
88
88
  });
89
89
  });
@@ -129,8 +129,6 @@ var ModalSize;
129
129
  (function (ModalSize) {
130
130
  ModalSize["Small"] = "small";
131
131
  ModalSize["Medium"] = "medium";
132
- // Normal is deprecated and will be deleted in 16.x
133
- ModalSize["Normal"] = "medium";
134
132
  ModalSize["Large"] = "large";
135
133
  })(ModalSize || (ModalSize = {}));
136
134
 
@@ -152,37 +150,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
152
150
  // Duration when perform animations (ms)
153
151
  const MODAL_ANIMATE_DURATION = 200;
154
152
  class KbqModalComponent extends KbqModalRef {
155
- get mcVisible() { return this._mcVisible; }
156
- set mcVisible(value) { this._mcVisible = value; }
157
- get mcClosable() { return this._mcClosable; }
158
- set mcClosable(value) { this._mcClosable = value; }
159
- get mcMask() { return this._mcMask; }
160
- set mcMask(value) { this._mcMask = value; }
161
- get mcMaskClosable() { return this._mcMaskClosable; }
162
- set mcMaskClosable(value) { this._mcMaskClosable = value; }
163
- get mcOkLoading() { return this._mcOkLoading; }
164
- set mcOkLoading(value) { this._mcOkLoading = value; }
165
- get mcCancelLoading() { return this._mcCancelLoading; }
166
- set mcCancelLoading(value) { this._mcCancelLoading = value; }
167
- // Observable alias for mcAfterOpen
153
+ get kbqVisible() { return this._kbqVisible; }
154
+ set kbqVisible(value) { this._kbqVisible = value; }
155
+ get kbqClosable() { return this._kbqClosable; }
156
+ set kbqClosable(value) { this._kbqClosable = value; }
157
+ get kbqMask() { return this._kbqMask; }
158
+ set kbqMask(value) { this._kbqMask = value; }
159
+ get kbqMaskClosable() { return this._kbqMaskClosable; }
160
+ set kbqMaskClosable(value) { this._kbqMaskClosable = value; }
161
+ get kbqOkLoading() { return this._kbqOkLoading; }
162
+ set kbqOkLoading(value) { this._kbqOkLoading = value; }
163
+ get kbqCancelLoading() { return this._kbqCancelLoading; }
164
+ set kbqCancelLoading(value) { this._kbqCancelLoading = value; }
165
+ // Observable alias for kbqAfterOpen
168
166
  get afterOpen() {
169
- return this.mcAfterOpen.asObservable();
167
+ return this.kbqAfterOpen.asObservable();
170
168
  }
171
- // Observable alias for mcAfterClose
169
+ // Observable alias for kbqAfterClose
172
170
  get afterClose() {
173
- return this.mcAfterClose.asObservable();
171
+ return this.kbqAfterClose.asObservable();
174
172
  }
175
173
  get okText() {
176
- return this.mcOkText;
174
+ return this.kbqOkText;
177
175
  }
178
176
  get cancelText() {
179
- return this.mcCancelText;
177
+ return this.kbqCancelText;
180
178
  }
181
179
  // Indicate whether this dialog should hidden
182
180
  get hidden() {
183
- return !this.mcVisible && !this.animationState;
181
+ return !this.kbqVisible && !this.animationState;
184
182
  }
185
- constructor(overlay, renderer, cfr, elementRef, viewContainer, modalControl, changeDetector, document) {
183
+ constructor(overlay, renderer, cfr, elementRef, viewContainer, modalControl, changeDetector, focusMonitor, document) {
186
184
  super();
187
185
  this.overlay = overlay;
188
186
  this.renderer = renderer;
@@ -191,45 +189,46 @@ class KbqModalComponent extends KbqModalRef {
191
189
  this.viewContainer = viewContainer;
192
190
  this.modalControl = modalControl;
193
191
  this.changeDetector = changeDetector;
192
+ this.focusMonitor = focusMonitor;
194
193
  this.document = document;
195
194
  this.componentColors = KbqComponentColors;
196
- this.mcModalType = 'default';
197
- this._mcVisible = false;
198
- this.mcVisibleChange = new EventEmitter();
199
- this.mcZIndex = 1000;
200
- this.mcSize = ModalSize.Medium;
201
- this.mcCloseByESC = true;
202
- this._mcClosable = true;
203
- this._mcMask = true;
204
- this._mcMaskClosable = false;
195
+ this.kbqModalType = 'default';
196
+ this._kbqVisible = false;
197
+ this.kbqVisibleChange = new EventEmitter();
198
+ this.kbqZIndex = 1000;
199
+ this.kbqSize = ModalSize.Medium;
200
+ this.kbqCloseByESC = true;
201
+ this._kbqClosable = true;
202
+ this._kbqMask = true;
203
+ this._kbqMaskClosable = false;
205
204
  // Trigger when modal open(visible) after animations
206
- this.mcAfterOpen = new EventEmitter();
205
+ this.kbqAfterOpen = new EventEmitter();
207
206
  // Trigger when modal leave-animation over
208
- this.mcAfterClose = new EventEmitter();
209
- this.mcOkType = KbqComponentColors.Contrast;
210
- this.mcRestoreFocus = true;
211
- this._mcOkLoading = false;
212
- this.mcOnOk = new EventEmitter();
213
- this._mcCancelLoading = false;
214
- this.mcOnCancel = new EventEmitter();
207
+ this.kbqAfterClose = new EventEmitter();
208
+ this.kbqOkType = KbqComponentColors.Contrast;
209
+ this.kbqRestoreFocus = true;
210
+ this._kbqOkLoading = false;
211
+ this.kbqOnOk = new EventEmitter();
212
+ this._kbqCancelLoading = false;
213
+ this.kbqOnCancel = new EventEmitter();
215
214
  // The origin point that animation based on
216
215
  this.transformOrigin = '0px 0px 0px';
217
- this.mcGetContainer = () => this.overlay.create();
216
+ this.kbqGetContainer = () => this.overlay.create();
218
217
  }
219
218
  ngOnInit() {
220
219
  // Create component along without View
221
- if (this.isComponent(this.mcContent)) {
222
- this.createDynamicComponent(this.mcContent);
220
+ if (this.isComponent(this.kbqContent)) {
221
+ this.createDynamicComponent(this.kbqContent);
223
222
  }
224
223
  // Setup default button options
225
- if (this.isModalButtons(this.mcFooter)) {
226
- this.mcFooter = this.formatModalButtons(this.mcFooter);
224
+ if (this.isModalButtons(this.kbqFooter)) {
225
+ this.kbqFooter = this.formatModalButtons(this.kbqFooter);
227
226
  }
228
- if (this.isComponent(this.mcComponent)) {
229
- this.createDynamicComponent(this.mcComponent);
227
+ if (this.isComponent(this.kbqComponent)) {
228
+ this.createDynamicComponent(this.kbqComponent);
230
229
  }
231
230
  // Place the modal dom to elsewhere
232
- this.container = typeof this.mcGetContainer === 'function' ? this.mcGetContainer() : this.mcGetContainer;
231
+ this.container = typeof this.kbqGetContainer === 'function' ? this.kbqGetContainer() : this.kbqGetContainer;
233
232
  if (this.container instanceof HTMLElement) {
234
233
  this.container.appendChild(this.elementRef.nativeElement);
235
234
  }
@@ -242,13 +241,13 @@ class KbqModalComponent extends KbqModalRef {
242
241
  }
243
242
  // [NOTE] NOT available when using by service!
244
243
  // Because ngOnChanges never be called when using by service,
245
- // here we can't support "mcContent"(Component) etc. as inputs that initialized dynamically.
246
- // BUT: User also can change "mcContent" dynamically to trigger UI changes
244
+ // here we can't support "kbqContent"(Component) etc. as inputs that initialized dynamically.
245
+ // BUT: User also can change "kbqContent" dynamically to trigger UI changes
247
246
  // (provided you don't use Component that needs initializations)
248
247
  ngOnChanges(changes) {
249
- if (changes.mcVisible) {
248
+ if (changes.kbqVisible) {
250
249
  // Do not trigger animation while initializing
251
- this.handleVisibleStateChange(this.mcVisible, !changes.mcVisible.firstChange);
250
+ this.handleVisibleStateChange(this.kbqVisible, !changes.kbqVisible.firstChange);
252
251
  }
253
252
  }
254
253
  ngAfterViewInit() {
@@ -271,14 +270,21 @@ class KbqModalComponent extends KbqModalRef {
271
270
  }
272
271
  open() {
273
272
  this.focusedElementBeforeOpen = this.document.activeElement;
273
+ this.focusMonitor.monitor(this.modalContainer, true)
274
+ .pipe(take(1))
275
+ .subscribe((origin) => {
276
+ this.previouslyFocusedElementOrigin = origin;
277
+ this.focusMonitor.stopMonitoring(this.modalContainer);
278
+ });
274
279
  this.changeVisibleFromInside(true);
275
280
  }
276
281
  close(result) {
277
- if (this.mcRestoreFocus) {
278
- this.focusedElementBeforeOpen?.focus();
279
- }
280
- this.changeVisibleFromInside(false, result);
281
- this.focusedElementBeforeOpen = null;
282
+ this.changeVisibleFromInside(false, result).then(() => {
283
+ if (this.kbqRestoreFocus && this.focusedElementBeforeOpen) {
284
+ this.focusMonitor.focusVia(this.focusedElementBeforeOpen, this.previouslyFocusedElementOrigin);
285
+ this.focusedElementBeforeOpen = null;
286
+ }
287
+ });
282
288
  }
283
289
  // Destroy equals Close
284
290
  destroy(result) {
@@ -309,16 +315,16 @@ class KbqModalComponent extends KbqModalRef {
309
315
  return this.getElement().getElementsByClassName('kbq-modal-footer').item(0);
310
316
  }
311
317
  onClickMask($event) {
312
- if (this.mcMask &&
313
- this.mcMaskClosable &&
318
+ if (this.kbqMask &&
319
+ this.kbqMaskClosable &&
314
320
  $event.target.classList.contains('kbq-modal-wrap') &&
315
- this.mcVisible) {
321
+ this.kbqVisible) {
316
322
  this.onClickOkCancel('cancel');
317
323
  }
318
324
  }
319
325
  // tslint:disable-next-line: no-reserved-keywords
320
326
  isModalType(type) {
321
- return this.mcModalType === type;
327
+ return this.kbqModalType === type;
322
328
  }
323
329
  onKeyDown(event) {
324
330
  // tslint:disable-next-line:deprecation .key isn't supported in Edge
@@ -328,7 +334,7 @@ class KbqModalComponent extends KbqModalRef {
328
334
  }
329
335
  // tslint:disable-next-line:deprecation .key isn't supported in Edge
330
336
  if (event.ctrlKey && event.keyCode === ENTER) {
331
- if (this.mcModalType === 'confirm') {
337
+ if (this.kbqModalType === 'confirm') {
332
338
  this.triggerOk();
333
339
  }
334
340
  this.getElement().querySelector('[kbq-modal-main-action]')?.click();
@@ -337,22 +343,25 @@ class KbqModalComponent extends KbqModalRef {
337
343
  }
338
344
  // AoT
339
345
  onClickCloseBtn() {
340
- if (this.mcVisible) {
346
+ if (this.kbqVisible) {
341
347
  this.onClickOkCancel('cancel');
342
348
  }
343
349
  }
344
350
  // AoT
345
351
  // tslint:disable-next-line: no-reserved-keywords
346
352
  onClickOkCancel(type) {
347
- const trigger = { ok: this.mcOnOk, cancel: this.mcOnCancel }[type];
348
- const loadingKey = { ok: 'mcOkLoading', cancel: 'mcCancelLoading' }[type];
353
+ this.handleCloseResult(type, (doClose) => doClose !== false);
354
+ }
355
+ handleCloseResult(triggerType, canClose) {
356
+ const trigger = { ok: this.kbqOnOk, cancel: this.kbqOnCancel }[triggerType];
357
+ const loadingKey = { ok: 'kbqOkLoading', cancel: 'kbqCancelLoading' }[triggerType];
349
358
  if (trigger instanceof EventEmitter) {
350
359
  trigger.emit(this.getContentComponent());
351
360
  }
352
361
  else if (typeof trigger === 'function') {
353
362
  const result = trigger(this.getContentComponent());
354
363
  // Users can return "false" to prevent closing by default
355
- const caseClose = (doClose) => (doClose !== false) && this.close(doClose);
364
+ const caseClose = (doClose) => canClose(doClose) && this.close(doClose);
356
365
  if (isPromise(result)) {
357
366
  this[loadingKey] = true;
358
367
  const handleThen = (doClose) => {
@@ -392,7 +401,7 @@ class KbqModalComponent extends KbqModalRef {
392
401
  }
393
402
  return typeof value === 'function' ? value.apply(options, args) : value;
394
403
  }
395
- // On mcFooter's modal button click
404
+ // On kbqFooter's modal button click
396
405
  // AoT
397
406
  onButtonClick(button) {
398
407
  // Call onClick directly
@@ -414,21 +423,21 @@ class KbqModalComponent extends KbqModalRef {
414
423
  // Emit open/close event after animations over
415
424
  .then(() => {
416
425
  if (visible) {
417
- this.mcAfterOpen.emit();
426
+ this.kbqAfterOpen.emit();
418
427
  }
419
428
  else {
420
- this.mcAfterClose.emit(closeResult);
429
+ this.kbqAfterClose.emit(closeResult);
421
430
  // Show/hide scrollbar when animation is over
422
431
  this.changeBodyOverflow();
423
432
  }
424
433
  });
425
434
  }
426
- // Change mcVisible from inside
435
+ // Change kbqVisible from inside
427
436
  changeVisibleFromInside(visible, closeResult) {
428
- if (this.mcVisible !== visible) {
429
- // Change mcVisible value immediately
430
- this.mcVisible = visible;
431
- this.mcVisibleChange.emit(visible);
437
+ if (this.kbqVisible !== visible) {
438
+ // Change kbqVisible value immediately
439
+ this.kbqVisible = visible;
440
+ this.kbqVisibleChange.emit(visible);
432
441
  return this.handleVisibleStateChange(visible, true, closeResult);
433
442
  }
434
443
  return Promise.resolve();
@@ -499,9 +508,9 @@ class KbqModalComponent extends KbqModalRef {
499
508
  parent: this.viewContainer.injector
500
509
  });
501
510
  this.contentComponentRef = factory.create(childInjector);
502
- if (this.mcComponentParams) {
511
+ if (this.kbqComponentParams) {
503
512
  // @ts-ignore
504
- Object.assign(this.contentComponentRef.instance, this.mcComponentParams);
513
+ Object.assign(this.contentComponentRef.instance, this.kbqComponentParams);
505
514
  }
506
515
  // Do the first change detection immediately
507
516
  // (or we do detection at ngAfterViewInit, multi-changes error will be thrown)
@@ -528,78 +537,78 @@ class KbqModalComponent extends KbqModalRef {
528
537
  this.renderer.removeStyle(this.document.body, 'overflow');
529
538
  }
530
539
  }
531
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalComponent, deps: [{ token: i1.Overlay }, { token: i0.Renderer2 }, { token: i0.ComponentFactoryResolver }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: KbqModalControlService }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
532
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.5", type: KbqModalComponent, selector: "kbq-modal", inputs: { mcModalType: "mcModalType", mcComponent: "mcComponent", mcContent: "mcContent", mcComponentParams: "mcComponentParams", mcFooter: "mcFooter", mcVisible: "mcVisible", mcZIndex: "mcZIndex", mcWidth: "mcWidth", mcSize: "mcSize", mcWrapClassName: "mcWrapClassName", mcClassName: "mcClassName", mcStyle: "mcStyle", mcTitle: "mcTitle", mcCloseByESC: "mcCloseByESC", mcClosable: "mcClosable", mcMask: "mcMask", mcMaskClosable: "mcMaskClosable", mcMaskStyle: "mcMaskStyle", mcBodyStyle: "mcBodyStyle", mcOkText: "mcOkText", mcOkType: "mcOkType", mcRestoreFocus: "mcRestoreFocus", mcOkLoading: "mcOkLoading", mcOnOk: "mcOnOk", mcCancelText: "mcCancelText", mcCancelLoading: "mcCancelLoading", mcOnCancel: "mcOnCancel", mcGetContainer: "mcGetContainer" }, outputs: { mcVisibleChange: "mcVisibleChange", mcAfterOpen: "mcAfterOpen", mcAfterClose: "mcAfterClose", mcOnOk: "mcOnOk", mcOnCancel: "mcOnCancel" }, host: { listeners: { "keydown": "onKeyDown($event)" } }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, static: true }, { propertyName: "bodyContainer", first: true, predicate: ["bodyContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "modalBody", first: true, predicate: ["modalBody"], descendants: true }, { propertyName: "autoFocusedButtons", predicate: ["autoFocusedButton"], descendants: true, read: ElementRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!-- Compatible: the <ng-content> can appear only once -->\n<ng-template #tplOriginContent>\n <ng-content></ng-content>\n</ng-template>\n\n<div>\n <div *ngIf=\"mcMask\"\n class=\"kbq-modal-mask\"\n [ngClass]=\"maskAnimationClassMap\"\n [class.kbq-modal-mask-hidden]=\"hidden\"\n [ngStyle]=\"mcMaskStyle\"\n [style.zIndex]=\"mcZIndex\">\n </div>\n\n <div (mousedown)=\"onClickMask($event)\"\n class=\"kbq-modal-wrap {{ mcWrapClassName }}\"\n [style.zIndex]=\"mcZIndex\"\n [style.display]=\"hidden ? 'none' : ''\"\n tabindex=\"-1\">\n\n <div #modalContainer\n class=\"kbq-modal {{ mcClassName }} kbq-modal_{{ mcSize }}\"\n [ngClass]=\"modalAnimationClassMap\"\n [ngStyle]=\"mcStyle\"\n [style.width]=\"mcWidth | toCssUnit\"\n [style.transform-origin]=\"transformOrigin\">\n\n <div class=\"kbq-modal-content\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"mcRestoreFocus\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isModalType('default')\"\n [ngTemplateOutlet]=\"tplContentDefault\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('confirm')\"\n [ngTemplateOutlet]=\"tplContentConfirm\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('custom')\"\n [ngTemplateOutlet]=\"tplContentCustom\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #tplContentCustom>\n <ng-container #bodyContainer></ng-container>\n</ng-template>\n\n\n<!-- [Predefined] Default Modal Content -->\n<ng-template #tplContentDefault>\n <div *ngIf=\"mcTitle\" class=\"kbq-modal-header\" kbq-title>\n <div class=\"kbq-modal-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcTitle)\" [ngTemplateOutlet]=\"$any(mcTitle)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcTitle)\">\n <div [innerHTML]=\"mcTitle\"></div>\n </ng-container>\n </ng-container>\n </div>\n\n <button *ngIf=\"mcClosable\"\n kbq-button\n [color]=\"'contrast'\"\n (click)=\"onClickCloseBtn()\"\n class=\"kbq-modal-close kbq-button_transparent\">\n <i kbq-icon=\"mc-close-L_16\" [color]=\"componentColors.Contrast\"></i>\n </button>\n </div>\n <div class=\"kbq-modal-body kbq-scrollbar\" #modalBody [ngStyle]=\"mcBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(mcContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcContent)\" [ngTemplateOutlet]=\"$any(mcContent)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcContent)\">\n <div [innerHTML]=\"mcContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf=\"mcFooter || mcOkText || mcCancelText\" class=\"kbq-modal-footer\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcFooter)\" [ngTemplateOutlet]=\"$any(mcFooter)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcFooter)\">\n <div [innerHTML]=\"mcFooter\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"isModalButtons(mcFooter)\">\n <ng-container *ngFor=\"let button of $any(mcFooter)\">\n <button\n kbq-button\n #autoFocusedButton\n [attr.autofocus]=\"button.autoFocus\"\n [attr.kbq-modal-main-action]=\"button.mcModalMainAction\"\n *ngIf=\"getButtonCallableProp(button, 'show')\"\n [disabled]=\"getButtonCallableProp(button, 'disabled')\"\n [class.kbq-progress]=\"getButtonCallableProp(button, 'loading')\"\n (click)=\"onButtonClick(button)\"\n [color]=\"button.type\">\n {{ button.label }}\n </button>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button\n #autoFocusedButton\n [attr.autofocus]=\"true\"\n *ngIf=\"mcOkText\"\n kbq-button\n [color]=\"componentColors.Contrast\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n <button *ngIf=\"mcCancelText\" kbq-button (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n<!-- /[Predefined] Default Modal Content -->\n\n<!-- [Predefined] Confirm Modal Content -->\n<ng-template #tplContentConfirm>\n <div class=\"kbq-modal-body\" [ngStyle]=\"mcBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(mcContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcContent)\"\n [ngTemplateOutlet]=\"$any(mcContent)\">\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcContent)\">\n <div [innerHTML]=\"mcContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"kbq-confirm-footer\" *ngIf=\"mcOkText || mcCancelText\">\n <button\n kbq-button\n #autoFocusedButton\n [color]=\"mcOkType\"\n [attr.autofocus]=\"true\"\n *ngIf=\"mcOkText\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n\n <button kbq-button *ngIf=\"mcCancelText\" (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </div>\n</ng-template>\n<!-- /[Predefined] Confirm Modal Content -->\n", styles: [".kbq-confirm .kbq-modal-close{display:none}.kbq-confirm .kbq-modal-body{padding-right:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-left:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-bottom:var(--kbq-modal-size-content-padding-bottom, 24px)}.kbq-confirm .kbq-confirm-footer{display:flex;padding:var(--kbq-modal-size-footer-padding-top, 8px) var(--kbq-modal-size-footer-padding-horizontal, ) var(--kbq-modal-size-footer-padding-bottom, 32px) var(--kbq-modal-size-footer-padding-horizontal, 32px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal{box-sizing:border-box;position:relative;top:48px;border-radius:var(--kbq-modal-size-border-radius, 8px);width:auto;margin:0 auto;list-style:none}.kbq-modal.zoom-enter,.kbq-modal.zoom-appear{animation-duration:.3s;transform:none;opacity:0}.kbq-modal.kbq-modal_small{width:var(--kbq-modal-size-small-width, 400px)}.kbq-modal.kbq-modal_medium{width:var(--kbq-modal-size-medium-width, 640px)}.kbq-modal.kbq-modal_large{width:var(--kbq-modal-size-large-width, 960px)}.kbq-modal-wrap{position:fixed;z-index:1000;inset:0;overflow:auto;-webkit-overflow-scrolling:touch;outline:0}.kbq-modal-content{position:relative;border-radius:var(--kbq-modal-size-border-radius, 8px);background-clip:padding-box;background-color:#fff}.kbq-modal-header{display:flex;align-items:center;justify-content:space-between;padding:var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-right, 12px) var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-left, 32px)}.kbq-modal-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.kbq-modal-body{display:block;overflow-y:auto;max-height:calc(100vh - 260px);padding-right:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-left:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-bottom:var(--kbq-modal-size-content-padding-bottom, 24px);word-wrap:break-word}.kbq-modal-footer{display:flex;align-items:center;padding:var(--kbq-modal-size-footer-padding-top, 8px) var(--kbq-modal-size-footer-padding-horizontal, ) var(--kbq-modal-size-footer-padding-bottom, 32px) var(--kbq-modal-size-footer-padding-horizontal, 32px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal-mask{position:fixed;z-index:1000;inset:0;height:100%}.kbq-modal-mask.kbq-modal-mask-hidden{display:none}.kbq-modal-open{overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: i5.KbqButton, selector: "[kbq-button]", inputs: ["color", "tabIndex", "kbqStyle", "disabled"] }, { kind: "directive", type: i5.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "component", type: i6.KbqIcon, selector: "[kbq-icon]", inputs: ["color", "small", "autoColor"] }, { kind: "directive", type: i7.KbqTitleDirective, selector: "[kbq-title]", exportAs: ["mcTitle"] }, { kind: "pipe", type: CssUnitPipe, name: "toCssUnit" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
540
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalComponent, deps: [{ token: i1.Overlay }, { token: i0.Renderer2 }, { token: i0.ComponentFactoryResolver }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: KbqModalControlService }, { token: i0.ChangeDetectorRef }, { token: i3.FocusMonitor }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
541
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.5", type: KbqModalComponent, selector: "kbq-modal", inputs: { kbqModalType: "kbqModalType", kbqComponent: "kbqComponent", kbqContent: "kbqContent", kbqComponentParams: "kbqComponentParams", kbqFooter: "kbqFooter", kbqVisible: "kbqVisible", kbqZIndex: "kbqZIndex", kbqWidth: "kbqWidth", kbqSize: "kbqSize", kbqWrapClassName: "kbqWrapClassName", kbqClassName: "kbqClassName", kbqStyle: "kbqStyle", kbqTitle: "kbqTitle", kbqCloseByESC: "kbqCloseByESC", kbqClosable: "kbqClosable", kbqMask: "kbqMask", kbqMaskClosable: "kbqMaskClosable", kbqMaskStyle: "kbqMaskStyle", kbqBodyStyle: "kbqBodyStyle", kbqOkText: "kbqOkText", kbqOkType: "kbqOkType", kbqRestoreFocus: "kbqRestoreFocus", kbqOkLoading: "kbqOkLoading", kbqOnOk: "kbqOnOk", kbqCancelText: "kbqCancelText", kbqCancelLoading: "kbqCancelLoading", kbqOnCancel: "kbqOnCancel", kbqGetContainer: "kbqGetContainer" }, outputs: { kbqVisibleChange: "kbqVisibleChange", kbqAfterOpen: "kbqAfterOpen", kbqAfterClose: "kbqAfterClose", kbqOnOk: "kbqOnOk", kbqOnCancel: "kbqOnCancel" }, host: { listeners: { "keydown": "onKeyDown($event)" } }, viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true, static: true }, { propertyName: "bodyContainer", first: true, predicate: ["bodyContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "modalBody", first: true, predicate: ["modalBody"], descendants: true }, { propertyName: "autoFocusedButtons", predicate: ["autoFocusedButton"], descendants: true, read: ElementRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!-- Compatible: the <ng-content> can appear only once -->\n<ng-template #tplOriginContent>\n <ng-content></ng-content>\n</ng-template>\n\n<div>\n <div *ngIf=\"kbqMask\"\n class=\"kbq-modal-mask\"\n [ngClass]=\"maskAnimationClassMap\"\n [class.kbq-modal-mask-hidden]=\"hidden\"\n [ngStyle]=\"kbqMaskStyle\"\n [style.zIndex]=\"kbqZIndex\">\n </div>\n\n <div (mousedown)=\"onClickMask($event)\"\n class=\"kbq-modal-wrap {{ kbqWrapClassName }}\"\n [style.zIndex]=\"kbqZIndex\"\n [style.display]=\"hidden ? 'none' : ''\"\n tabindex=\"-1\">\n\n <div #modalContainer\n class=\"kbq-modal {{ kbqClassName }} kbq-modal_{{ kbqSize }}\"\n [ngClass]=\"modalAnimationClassMap\"\n [ngStyle]=\"kbqStyle\"\n [style.width]=\"kbqWidth | toCssUnit\"\n [style.transform-origin]=\"transformOrigin\">\n\n <div class=\"kbq-modal-content\" cdkTrapFocus>\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isModalType('default')\"\n [ngTemplateOutlet]=\"tplContentDefault\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('confirm')\"\n [ngTemplateOutlet]=\"tplContentConfirm\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('custom')\"\n [ngTemplateOutlet]=\"tplContentCustom\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #tplContentCustom>\n <ng-container #bodyContainer></ng-container>\n</ng-template>\n\n\n<!-- [Predefined] Default Modal Content -->\n<ng-template #tplContentDefault>\n <div *ngIf=\"kbqTitle\" class=\"kbq-modal-header\" kbq-title>\n <div class=\"kbq-modal-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqTitle)\" [ngTemplateOutlet]=\"$any(kbqTitle)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqTitle)\">\n <div [innerHTML]=\"kbqTitle\"></div>\n </ng-container>\n </ng-container>\n </div>\n\n <button *ngIf=\"kbqClosable\"\n kbq-button\n [color]=\"'contrast'\"\n (click)=\"onClickCloseBtn()\"\n class=\"kbq-modal-close kbq-button_transparent\">\n <i kbq-icon=\"mc-close-L_16\" [color]=\"componentColors.Contrast\"></i>\n </button>\n </div>\n <div class=\"kbq-modal-body kbq-scrollbar\" #modalBody [ngStyle]=\"kbqBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(kbqContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqContent)\" [ngTemplateOutlet]=\"$any(kbqContent)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqContent)\">\n <div [innerHTML]=\"kbqContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf=\"kbqFooter || kbqOkText || kbqCancelText\" class=\"kbq-modal-footer\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqFooter)\" [ngTemplateOutlet]=\"$any(kbqFooter)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqFooter)\">\n <div [innerHTML]=\"kbqFooter\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"isModalButtons(kbqFooter)\">\n <ng-container *ngFor=\"let button of $any(kbqFooter)\">\n <button\n kbq-button\n #autoFocusedButton\n [attr.autofocus]=\"button.autoFocus\"\n [attr.kbq-modal-main-action]=\"button.kbqModalMainAction\"\n *ngIf=\"getButtonCallableProp(button, 'show')\"\n [disabled]=\"getButtonCallableProp(button, 'disabled')\"\n [class.kbq-progress]=\"getButtonCallableProp(button, 'loading')\"\n (click)=\"onButtonClick(button)\"\n [color]=\"button.type\">\n {{ button.label }}\n </button>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button\n #autoFocusedButton\n [attr.autofocus]=\"true\"\n *ngIf=\"kbqOkText\"\n kbq-button\n [color]=\"componentColors.Contrast\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n <button *ngIf=\"kbqCancelText\" kbq-button (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n<!-- /[Predefined] Default Modal Content -->\n\n<!-- [Predefined] Confirm Modal Content -->\n<ng-template #tplContentConfirm>\n <div class=\"kbq-modal-body\" [ngStyle]=\"kbqBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(kbqContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqContent)\"\n [ngTemplateOutlet]=\"$any(kbqContent)\">\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqContent)\">\n <div [innerHTML]=\"kbqContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"kbq-confirm-footer\" *ngIf=\"kbqOkText || kbqCancelText\">\n <button\n kbq-button\n #autoFocusedButton\n [color]=\"kbqOkType\"\n [attr.autofocus]=\"true\"\n *ngIf=\"kbqOkText\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n\n <button kbq-button *ngIf=\"kbqCancelText\" (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </div>\n</ng-template>\n<!-- /[Predefined] Confirm Modal Content -->\n", styles: [".kbq-confirm .kbq-modal-close{display:none}.kbq-confirm .kbq-modal-body{padding-right:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-left:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-bottom:var(--kbq-modal-size-content-padding-bottom, 24px)}.kbq-confirm .kbq-confirm-footer{display:flex;padding:var(--kbq-modal-size-footer-padding-top, 8px) var(--kbq-modal-size-footer-padding-horizontal, ) var(--kbq-modal-size-footer-padding-bottom, 32px) var(--kbq-modal-size-footer-padding-horizontal, 32px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal{box-sizing:border-box;position:relative;top:48px;border-radius:var(--kbq-modal-size-border-radius, 8px);width:auto;margin:0 auto;list-style:none}.kbq-modal.zoom-enter,.kbq-modal.zoom-appear{animation-duration:.3s;transform:none;opacity:0}.kbq-modal.kbq-modal_small{width:var(--kbq-modal-size-small-width, 400px)}.kbq-modal.kbq-modal_medium{width:var(--kbq-modal-size-medium-width, 640px)}.kbq-modal.kbq-modal_large{width:var(--kbq-modal-size-large-width, 960px)}.kbq-modal-wrap{position:fixed;z-index:1000;inset:0;overflow:auto;-webkit-overflow-scrolling:touch;outline:0}.kbq-modal-content{position:relative;border-radius:var(--kbq-modal-size-border-radius, 8px);background-clip:padding-box;background-color:#fff}.kbq-modal-header{display:flex;align-items:center;justify-content:space-between;padding:var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-right, 12px) var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-left, 32px)}.kbq-modal-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.kbq-modal-body{display:block;overflow-y:auto;max-height:calc(100vh - 260px);padding-right:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-left:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-bottom:var(--kbq-modal-size-content-padding-bottom, 24px);word-wrap:break-word}.kbq-modal-footer{display:flex;align-items:center;padding:var(--kbq-modal-size-footer-padding-top, 8px) var(--kbq-modal-size-footer-padding-horizontal, ) var(--kbq-modal-size-footer-padding-bottom, 32px) var(--kbq-modal-size-footer-padding-horizontal, 32px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal-mask{position:fixed;z-index:1000;inset:0;height:100%}.kbq-modal-mask.kbq-modal-mask-hidden{display:none}.kbq-modal-open{overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: i5.KbqButton, selector: "[kbq-button]", inputs: ["color", "tabIndex", "kbqStyle", "disabled"] }, { kind: "directive", type: i5.KbqButtonCssStyler, selector: "[kbq-button]" }, { kind: "component", type: i6.KbqIcon, selector: "[kbq-icon]", inputs: ["color", "small", "autoColor"] }, { kind: "directive", type: i7.KbqTitleDirective, selector: "[kbq-title]", exportAs: ["kbqTitle"] }, { kind: "pipe", type: CssUnitPipe, name: "toCssUnit" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
533
542
  }
534
543
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalComponent, decorators: [{
535
544
  type: Component,
536
545
  args: [{ selector: 'kbq-modal', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
537
546
  '(keydown)': 'onKeyDown($event)'
538
- }, template: "<!-- Compatible: the <ng-content> can appear only once -->\n<ng-template #tplOriginContent>\n <ng-content></ng-content>\n</ng-template>\n\n<div>\n <div *ngIf=\"mcMask\"\n class=\"kbq-modal-mask\"\n [ngClass]=\"maskAnimationClassMap\"\n [class.kbq-modal-mask-hidden]=\"hidden\"\n [ngStyle]=\"mcMaskStyle\"\n [style.zIndex]=\"mcZIndex\">\n </div>\n\n <div (mousedown)=\"onClickMask($event)\"\n class=\"kbq-modal-wrap {{ mcWrapClassName }}\"\n [style.zIndex]=\"mcZIndex\"\n [style.display]=\"hidden ? 'none' : ''\"\n tabindex=\"-1\">\n\n <div #modalContainer\n class=\"kbq-modal {{ mcClassName }} kbq-modal_{{ mcSize }}\"\n [ngClass]=\"modalAnimationClassMap\"\n [ngStyle]=\"mcStyle\"\n [style.width]=\"mcWidth | toCssUnit\"\n [style.transform-origin]=\"transformOrigin\">\n\n <div class=\"kbq-modal-content\" cdkTrapFocus [cdkTrapFocusAutoCapture]=\"mcRestoreFocus\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isModalType('default')\"\n [ngTemplateOutlet]=\"tplContentDefault\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('confirm')\"\n [ngTemplateOutlet]=\"tplContentConfirm\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('custom')\"\n [ngTemplateOutlet]=\"tplContentCustom\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #tplContentCustom>\n <ng-container #bodyContainer></ng-container>\n</ng-template>\n\n\n<!-- [Predefined] Default Modal Content -->\n<ng-template #tplContentDefault>\n <div *ngIf=\"mcTitle\" class=\"kbq-modal-header\" kbq-title>\n <div class=\"kbq-modal-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcTitle)\" [ngTemplateOutlet]=\"$any(mcTitle)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcTitle)\">\n <div [innerHTML]=\"mcTitle\"></div>\n </ng-container>\n </ng-container>\n </div>\n\n <button *ngIf=\"mcClosable\"\n kbq-button\n [color]=\"'contrast'\"\n (click)=\"onClickCloseBtn()\"\n class=\"kbq-modal-close kbq-button_transparent\">\n <i kbq-icon=\"mc-close-L_16\" [color]=\"componentColors.Contrast\"></i>\n </button>\n </div>\n <div class=\"kbq-modal-body kbq-scrollbar\" #modalBody [ngStyle]=\"mcBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(mcContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcContent)\" [ngTemplateOutlet]=\"$any(mcContent)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcContent)\">\n <div [innerHTML]=\"mcContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf=\"mcFooter || mcOkText || mcCancelText\" class=\"kbq-modal-footer\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcFooter)\" [ngTemplateOutlet]=\"$any(mcFooter)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcFooter)\">\n <div [innerHTML]=\"mcFooter\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"isModalButtons(mcFooter)\">\n <ng-container *ngFor=\"let button of $any(mcFooter)\">\n <button\n kbq-button\n #autoFocusedButton\n [attr.autofocus]=\"button.autoFocus\"\n [attr.kbq-modal-main-action]=\"button.mcModalMainAction\"\n *ngIf=\"getButtonCallableProp(button, 'show')\"\n [disabled]=\"getButtonCallableProp(button, 'disabled')\"\n [class.kbq-progress]=\"getButtonCallableProp(button, 'loading')\"\n (click)=\"onButtonClick(button)\"\n [color]=\"button.type\">\n {{ button.label }}\n </button>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button\n #autoFocusedButton\n [attr.autofocus]=\"true\"\n *ngIf=\"mcOkText\"\n kbq-button\n [color]=\"componentColors.Contrast\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n <button *ngIf=\"mcCancelText\" kbq-button (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n<!-- /[Predefined] Default Modal Content -->\n\n<!-- [Predefined] Confirm Modal Content -->\n<ng-template #tplContentConfirm>\n <div class=\"kbq-modal-body\" [ngStyle]=\"mcBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(mcContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(mcContent)\"\n [ngTemplateOutlet]=\"$any(mcContent)\">\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(mcContent)\">\n <div [innerHTML]=\"mcContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"kbq-confirm-footer\" *ngIf=\"mcOkText || mcCancelText\">\n <button\n kbq-button\n #autoFocusedButton\n [color]=\"mcOkType\"\n [attr.autofocus]=\"true\"\n *ngIf=\"mcOkText\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n\n <button kbq-button *ngIf=\"mcCancelText\" (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </div>\n</ng-template>\n<!-- /[Predefined] Confirm Modal Content -->\n", styles: [".kbq-confirm .kbq-modal-close{display:none}.kbq-confirm .kbq-modal-body{padding-right:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-left:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-bottom:var(--kbq-modal-size-content-padding-bottom, 24px)}.kbq-confirm .kbq-confirm-footer{display:flex;padding:var(--kbq-modal-size-footer-padding-top, 8px) var(--kbq-modal-size-footer-padding-horizontal, ) var(--kbq-modal-size-footer-padding-bottom, 32px) var(--kbq-modal-size-footer-padding-horizontal, 32px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal{box-sizing:border-box;position:relative;top:48px;border-radius:var(--kbq-modal-size-border-radius, 8px);width:auto;margin:0 auto;list-style:none}.kbq-modal.zoom-enter,.kbq-modal.zoom-appear{animation-duration:.3s;transform:none;opacity:0}.kbq-modal.kbq-modal_small{width:var(--kbq-modal-size-small-width, 400px)}.kbq-modal.kbq-modal_medium{width:var(--kbq-modal-size-medium-width, 640px)}.kbq-modal.kbq-modal_large{width:var(--kbq-modal-size-large-width, 960px)}.kbq-modal-wrap{position:fixed;z-index:1000;inset:0;overflow:auto;-webkit-overflow-scrolling:touch;outline:0}.kbq-modal-content{position:relative;border-radius:var(--kbq-modal-size-border-radius, 8px);background-clip:padding-box;background-color:#fff}.kbq-modal-header{display:flex;align-items:center;justify-content:space-between;padding:var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-right, 12px) var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-left, 32px)}.kbq-modal-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.kbq-modal-body{display:block;overflow-y:auto;max-height:calc(100vh - 260px);padding-right:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-left:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-bottom:var(--kbq-modal-size-content-padding-bottom, 24px);word-wrap:break-word}.kbq-modal-footer{display:flex;align-items:center;padding:var(--kbq-modal-size-footer-padding-top, 8px) var(--kbq-modal-size-footer-padding-horizontal, ) var(--kbq-modal-size-footer-padding-bottom, 32px) var(--kbq-modal-size-footer-padding-horizontal, 32px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal-mask{position:fixed;z-index:1000;inset:0;height:100%}.kbq-modal-mask.kbq-modal-mask-hidden{display:none}.kbq-modal-open{overflow:hidden}\n"] }]
539
- }], ctorParameters: function () { return [{ type: i1.Overlay }, { type: i0.Renderer2 }, { type: i0.ComponentFactoryResolver }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: KbqModalControlService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
547
+ }, template: "<!-- Compatible: the <ng-content> can appear only once -->\n<ng-template #tplOriginContent>\n <ng-content></ng-content>\n</ng-template>\n\n<div>\n <div *ngIf=\"kbqMask\"\n class=\"kbq-modal-mask\"\n [ngClass]=\"maskAnimationClassMap\"\n [class.kbq-modal-mask-hidden]=\"hidden\"\n [ngStyle]=\"kbqMaskStyle\"\n [style.zIndex]=\"kbqZIndex\">\n </div>\n\n <div (mousedown)=\"onClickMask($event)\"\n class=\"kbq-modal-wrap {{ kbqWrapClassName }}\"\n [style.zIndex]=\"kbqZIndex\"\n [style.display]=\"hidden ? 'none' : ''\"\n tabindex=\"-1\">\n\n <div #modalContainer\n class=\"kbq-modal {{ kbqClassName }} kbq-modal_{{ kbqSize }}\"\n [ngClass]=\"modalAnimationClassMap\"\n [ngStyle]=\"kbqStyle\"\n [style.width]=\"kbqWidth | toCssUnit\"\n [style.transform-origin]=\"transformOrigin\">\n\n <div class=\"kbq-modal-content\" cdkTrapFocus>\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isModalType('default')\"\n [ngTemplateOutlet]=\"tplContentDefault\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('confirm')\"\n [ngTemplateOutlet]=\"tplContentConfirm\"></ng-container>\n <ng-container *ngSwitchCase=\"isModalType('custom')\"\n [ngTemplateOutlet]=\"tplContentCustom\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #tplContentCustom>\n <ng-container #bodyContainer></ng-container>\n</ng-template>\n\n\n<!-- [Predefined] Default Modal Content -->\n<ng-template #tplContentDefault>\n <div *ngIf=\"kbqTitle\" class=\"kbq-modal-header\" kbq-title>\n <div class=\"kbq-modal-title\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqTitle)\" [ngTemplateOutlet]=\"$any(kbqTitle)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqTitle)\">\n <div [innerHTML]=\"kbqTitle\"></div>\n </ng-container>\n </ng-container>\n </div>\n\n <button *ngIf=\"kbqClosable\"\n kbq-button\n [color]=\"'contrast'\"\n (click)=\"onClickCloseBtn()\"\n class=\"kbq-modal-close kbq-button_transparent\">\n <i kbq-icon=\"mc-close-L_16\" [color]=\"componentColors.Contrast\"></i>\n </button>\n </div>\n <div class=\"kbq-modal-body kbq-scrollbar\" #modalBody [ngStyle]=\"kbqBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(kbqContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqContent)\" [ngTemplateOutlet]=\"$any(kbqContent)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqContent)\">\n <div [innerHTML]=\"kbqContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div *ngIf=\"kbqFooter || kbqOkText || kbqCancelText\" class=\"kbq-modal-footer\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqFooter)\" [ngTemplateOutlet]=\"$any(kbqFooter)\"></ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqFooter)\">\n <div [innerHTML]=\"kbqFooter\"></div>\n </ng-container>\n <ng-container *ngSwitchCase=\"isModalButtons(kbqFooter)\">\n <ng-container *ngFor=\"let button of $any(kbqFooter)\">\n <button\n kbq-button\n #autoFocusedButton\n [attr.autofocus]=\"button.autoFocus\"\n [attr.kbq-modal-main-action]=\"button.kbqModalMainAction\"\n *ngIf=\"getButtonCallableProp(button, 'show')\"\n [disabled]=\"getButtonCallableProp(button, 'disabled')\"\n [class.kbq-progress]=\"getButtonCallableProp(button, 'loading')\"\n (click)=\"onButtonClick(button)\"\n [color]=\"button.type\">\n {{ button.label }}\n </button>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button\n #autoFocusedButton\n [attr.autofocus]=\"true\"\n *ngIf=\"kbqOkText\"\n kbq-button\n [color]=\"componentColors.Contrast\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n <button *ngIf=\"kbqCancelText\" kbq-button (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </ng-container>\n </ng-container>\n </div>\n</ng-template>\n<!-- /[Predefined] Default Modal Content -->\n\n<!-- [Predefined] Confirm Modal Content -->\n<ng-template #tplContentConfirm>\n <div class=\"kbq-modal-body\" [ngStyle]=\"kbqBodyStyle\">\n <ng-container #bodyContainer>\n <ng-container *ngIf=\"!isComponent(kbqContent)\" [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(kbqContent)\"\n [ngTemplateOutlet]=\"$any(kbqContent)\">\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(kbqContent)\">\n <div [innerHTML]=\"kbqContent\"></div>\n </ng-container>\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"tplOriginContent\"></ng-container>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"kbq-confirm-footer\" *ngIf=\"kbqOkText || kbqCancelText\">\n <button\n kbq-button\n #autoFocusedButton\n [color]=\"kbqOkType\"\n [attr.autofocus]=\"true\"\n *ngIf=\"kbqOkText\"\n (click)=\"onClickOkCancel('ok')\">\n\n {{ okText }}\n </button>\n\n <button kbq-button *ngIf=\"kbqCancelText\" (click)=\"onClickOkCancel('cancel')\">\n {{ cancelText }}\n </button>\n </div>\n</ng-template>\n<!-- /[Predefined] Confirm Modal Content -->\n", styles: [".kbq-confirm .kbq-modal-close{display:none}.kbq-confirm .kbq-modal-body{padding-right:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-left:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-bottom:var(--kbq-modal-size-content-padding-bottom, 24px)}.kbq-confirm .kbq-confirm-footer{display:flex;padding:var(--kbq-modal-size-footer-padding-top, 8px) var(--kbq-modal-size-footer-padding-horizontal, ) var(--kbq-modal-size-footer-padding-bottom, 32px) var(--kbq-modal-size-footer-padding-horizontal, 32px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal{box-sizing:border-box;position:relative;top:48px;border-radius:var(--kbq-modal-size-border-radius, 8px);width:auto;margin:0 auto;list-style:none}.kbq-modal.zoom-enter,.kbq-modal.zoom-appear{animation-duration:.3s;transform:none;opacity:0}.kbq-modal.kbq-modal_small{width:var(--kbq-modal-size-small-width, 400px)}.kbq-modal.kbq-modal_medium{width:var(--kbq-modal-size-medium-width, 640px)}.kbq-modal.kbq-modal_large{width:var(--kbq-modal-size-large-width, 960px)}.kbq-modal-wrap{position:fixed;z-index:1000;inset:0;overflow:auto;-webkit-overflow-scrolling:touch;outline:0}.kbq-modal-content{position:relative;border-radius:var(--kbq-modal-size-border-radius, 8px);background-clip:padding-box;background-color:#fff}.kbq-modal-header{display:flex;align-items:center;justify-content:space-between;padding:var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-right, 12px) var(--kbq-modal-size-header-padding-vertical, 16px) var(--kbq-modal-size-header-padding-left, 32px)}.kbq-modal-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.kbq-modal-body{display:block;overflow-y:auto;max-height:calc(100vh - 260px);padding-right:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-left:var(--kbq-modal-size-content-padding-horizontal, 32px);padding-bottom:var(--kbq-modal-size-content-padding-bottom, 24px);word-wrap:break-word}.kbq-modal-footer{display:flex;align-items:center;padding:var(--kbq-modal-size-footer-padding-top, 8px) var(--kbq-modal-size-footer-padding-horizontal, ) var(--kbq-modal-size-footer-padding-bottom, 32px) var(--kbq-modal-size-footer-padding-horizontal, 32px);gap:var(--kbq-modal-size-footer-content-gap-horizontal, 16px)}.kbq-modal-mask{position:fixed;z-index:1000;inset:0;height:100%}.kbq-modal-mask.kbq-modal-mask-hidden{display:none}.kbq-modal-open{overflow:hidden}\n"] }]
548
+ }], ctorParameters: function () { return [{ type: i1.Overlay }, { type: i0.Renderer2 }, { type: i0.ComponentFactoryResolver }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: KbqModalControlService }, { type: i0.ChangeDetectorRef }, { type: i3.FocusMonitor }, { type: undefined, decorators: [{
540
549
  type: Inject,
541
550
  args: [DOCUMENT]
542
- }] }]; }, propDecorators: { mcModalType: [{
551
+ }] }]; }, propDecorators: { kbqModalType: [{
543
552
  type: Input
544
- }], mcComponent: [{
553
+ }], kbqComponent: [{
545
554
  type: Input
546
- }], mcContent: [{
555
+ }], kbqContent: [{
547
556
  type: Input
548
- }], mcComponentParams: [{
557
+ }], kbqComponentParams: [{
549
558
  type: Input
550
- }], mcFooter: [{
559
+ }], kbqFooter: [{
551
560
  type: Input
552
- }], mcVisible: [{
561
+ }], kbqVisible: [{
553
562
  type: Input
554
- }], mcVisibleChange: [{
563
+ }], kbqVisibleChange: [{
555
564
  type: Output
556
- }], mcZIndex: [{
565
+ }], kbqZIndex: [{
557
566
  type: Input
558
- }], mcWidth: [{
567
+ }], kbqWidth: [{
559
568
  type: Input
560
- }], mcSize: [{
569
+ }], kbqSize: [{
561
570
  type: Input
562
- }], mcWrapClassName: [{
571
+ }], kbqWrapClassName: [{
563
572
  type: Input
564
- }], mcClassName: [{
573
+ }], kbqClassName: [{
565
574
  type: Input
566
- }], mcStyle: [{
575
+ }], kbqStyle: [{
567
576
  type: Input
568
- }], mcTitle: [{
577
+ }], kbqTitle: [{
569
578
  type: Input
570
- }], mcCloseByESC: [{
579
+ }], kbqCloseByESC: [{
571
580
  type: Input
572
- }], mcClosable: [{
581
+ }], kbqClosable: [{
573
582
  type: Input
574
- }], mcMask: [{
583
+ }], kbqMask: [{
575
584
  type: Input
576
- }], mcMaskClosable: [{
585
+ }], kbqMaskClosable: [{
577
586
  type: Input
578
- }], mcMaskStyle: [{
587
+ }], kbqMaskStyle: [{
579
588
  type: Input
580
- }], mcBodyStyle: [{
589
+ }], kbqBodyStyle: [{
581
590
  type: Input
582
- }], mcAfterOpen: [{
591
+ }], kbqAfterOpen: [{
583
592
  type: Output
584
- }], mcAfterClose: [{
593
+ }], kbqAfterClose: [{
585
594
  type: Output
586
- }], mcOkText: [{
595
+ }], kbqOkText: [{
587
596
  type: Input
588
- }], mcOkType: [{
597
+ }], kbqOkType: [{
589
598
  type: Input
590
- }], mcRestoreFocus: [{
599
+ }], kbqRestoreFocus: [{
591
600
  type: Input
592
- }], mcOkLoading: [{
601
+ }], kbqOkLoading: [{
593
602
  type: Input
594
- }], mcOnOk: [{
603
+ }], kbqOnOk: [{
595
604
  type: Input
596
605
  }, {
597
606
  type: Output
598
- }], mcCancelText: [{
607
+ }], kbqCancelText: [{
599
608
  type: Input
600
- }], mcCancelLoading: [{
609
+ }], kbqCancelLoading: [{
601
610
  type: Input
602
- }], mcOnCancel: [{
611
+ }], kbqOnCancel: [{
603
612
  type: Input
604
613
  }, {
605
614
  type: Output
@@ -615,7 +624,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
615
624
  }], modalBody: [{
616
625
  type: ViewChild,
617
626
  args: ['modalBody']
618
- }], mcGetContainer: [{
627
+ }], kbqGetContainer: [{
619
628
  type: Input
620
629
  }] } });
621
630
  ////////////
@@ -682,18 +691,18 @@ class ModalBuilderForService {
682
691
  constructor(overlay, options = {}) {
683
692
  this.overlay = overlay;
684
693
  this.createModal();
685
- if (!('mcGetContainer' in options)) {
686
- options.mcGetContainer = undefined;
694
+ if (!('kbqGetContainer' in options)) {
695
+ options.kbqGetContainer = undefined;
687
696
  }
688
697
  this.changeProps(options);
689
698
  this.modalRef.instance.open();
690
- this.modalRef.instance.mcAfterClose.subscribe(() => this.destroyModal());
699
+ this.modalRef.instance.kbqAfterClose.subscribe(() => this.destroyModal());
691
700
  this.overlayRef.keydownEvents()
692
701
  .pipe(filter((event) => {
693
702
  // tslint:disable-next-line:deprecation replacement .key isn't supported in Edge
694
- return !!(event.keyCode === ESCAPE && options.mcCloseByESC);
703
+ return !!(event.keyCode === ESCAPE && options.kbqCloseByESC);
695
704
  }))
696
- .subscribe(() => this.modalRef.instance.close());
705
+ .subscribe(() => this.getInstance()?.handleCloseResult('cancel', () => true));
697
706
  }
698
707
  getInstance() {
699
708
  return this.modalRef && this.modalRef.instance;
@@ -734,44 +743,44 @@ class KbqModalService {
734
743
  this.modalControl.closeAll();
735
744
  }
736
745
  create(options = {}) {
737
- if (typeof options.mcOnCancel !== 'function') {
746
+ if (typeof options.kbqOnCancel !== 'function') {
738
747
  // Leave a empty function to close this modal by default
739
748
  // tslint:disable-next-line
740
- options.mcOnCancel = () => { };
749
+ options.kbqOnCancel = () => { };
741
750
  }
742
- if (!('mcCloseByESC' in options)) {
743
- options.mcCloseByESC = true;
751
+ if (!('kbqCloseByESC' in options)) {
752
+ options.kbqCloseByESC = true;
744
753
  }
745
754
  // Remove the Cancel button if the user not specify a Cancel button
746
- if (!('mcCancelText' in options)) {
747
- options.mcCancelText = undefined;
755
+ if (!('kbqCancelText' in options)) {
756
+ options.kbqCancelText = undefined;
748
757
  }
749
758
  // Remove the Ok button if the user not specify a Ok button
750
- if (!('mcOkText' in options)) {
751
- options.mcOkText = undefined;
759
+ if (!('kbqOkText' in options)) {
760
+ options.kbqOkText = undefined;
752
761
  }
753
762
  // Remove the footer if the user not specify a footer
754
- if (!('mcFooter' in options)) {
755
- options.mcFooter = undefined;
763
+ if (!('kbqFooter' in options)) {
764
+ options.kbqFooter = undefined;
756
765
  }
757
766
  return new ModalBuilderForService(this.overlay, options).getInstance();
758
767
  }
759
768
  confirm(options = {}, confirmType = 'confirm') {
760
- if ('mcFooter' in options) {
761
- console.warn(`The Confirm-Modal doesn't support "mcFooter", this property will be ignored.`);
769
+ if ('kbqFooter' in options) {
770
+ console.warn(`The Confirm-Modal doesn't support "kbqFooter", this property will be ignored.`);
762
771
  }
763
772
  // NOTE: only support function currently by calling confirm()
764
- if (typeof options.mcOnOk !== 'function') {
773
+ if (typeof options.kbqOnOk !== 'function') {
765
774
  // Leave a empty function to close this modal by default
766
775
  // tslint:disable-next-line
767
- options.mcOnOk = () => { };
776
+ options.kbqOnOk = () => { };
768
777
  }
769
- options.mcModalType = 'confirm';
770
- options.mcClassName = `kbq-confirm kbq-confirm-${confirmType} ${options.mcClassName || ''}`;
778
+ options.kbqModalType = 'confirm';
779
+ options.kbqClassName = `kbq-confirm kbq-confirm-${confirmType} ${options.kbqClassName || ''}`;
771
780
  return this.create(options);
772
781
  }
773
782
  open(options = {}) {
774
- options.mcModalType = 'custom';
783
+ options.kbqModalType = 'custom';
775
784
  return this.create(options);
776
785
  }
777
786
  success(options = {}) {