@koobiq/components 16.0.0-beta.5 → 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 (294) hide show
  1. package/autocomplete/autocomplete-trigger.directive.d.ts +5 -15
  2. package/button/_button-theme.scss +20 -9
  3. package/button-toggle/button-toggle.component.d.ts +2 -2
  4. package/checkbox/_checkbox-theme.scss +10 -2
  5. package/checkbox/checkbox.d.ts +1 -1
  6. package/code-block/README.md +14 -14
  7. package/code-block/_code-block-theme.scss +8 -0
  8. package/code-block/code-block.component.d.ts +1 -1
  9. package/core/animation/index.d.ts +1 -1
  10. package/core/animation/select-animations.d.ts +1 -1
  11. package/core/formatters/index.d.ts +1 -1
  12. package/core/formatters/number/formatter.d.ts +56 -1
  13. package/core/forms/forms.directive.d.ts +2 -2
  14. package/core/locales/en-US.d.ts +19 -1
  15. package/core/locales/es-LA.d.ts +27 -0
  16. package/core/locales/fa-IR.d.ts +28 -0
  17. package/core/locales/locale-service.d.ts +148 -3
  18. package/core/locales/pt-BR.d.ts +27 -0
  19. package/core/locales/ru-RU.d.ts +20 -1
  20. package/core/locales/zh-CN.d.ts +26 -0
  21. package/core/option/action.d.ts +1 -1
  22. package/core/option/optgroup.d.ts +1 -1
  23. package/core/option/option.d.ts +37 -8
  24. package/core/overlay/overlay-position-map.d.ts +7 -1
  25. package/core/pop-up/constants.d.ts +2 -1
  26. package/core/public-api.d.ts +1 -0
  27. package/core/select/constants.d.ts +2 -2
  28. package/core/services/theme.service.d.ts +23 -0
  29. package/core/styles/_variables.scss +1 -0
  30. package/core/styles/common/_select.scss +24 -24
  31. package/core/styles/theming/_components-theming.scss +31 -5
  32. package/datepicker/calendar-body.component.d.ts +1 -1
  33. package/datepicker/calendar-header.component.d.ts +9 -3
  34. package/datepicker/calendar.component.d.ts +4 -5
  35. package/datepicker/datepicker-animations.d.ts +1 -1
  36. package/datepicker/datepicker-input.directive.d.ts +4 -4
  37. package/datepicker/datepicker-toggle.component.d.ts +3 -3
  38. package/datepicker/datepicker.component.d.ts +2 -2
  39. package/datepicker/month-view.component.d.ts +5 -6
  40. package/dl/_dl-theme.scss +2 -56
  41. package/dl/dl.component.d.ts +1 -2
  42. package/dl/dl.scss +10 -47
  43. package/dropdown/dropdown-animations.d.ts +1 -1
  44. package/dropdown/dropdown-content.directive.d.ts +1 -1
  45. package/dropdown/dropdown-item.component.d.ts +1 -1
  46. package/dropdown/dropdown-trigger.directive.d.ts +2 -2
  47. package/dropdown/dropdown.component.d.ts +1 -1
  48. package/dropdown/dropdown.types.d.ts +1 -1
  49. package/esm2022/alert/alert.component.mjs +2 -2
  50. package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +24 -21
  51. package/esm2022/button-toggle/button-toggle.component.mjs +8 -8
  52. package/esm2022/checkbox/checkbox.mjs +3 -3
  53. package/esm2022/code-block/actionbar.component.mjs +1 -1
  54. package/esm2022/code-block/code-block.component.mjs +3 -3
  55. package/esm2022/core/animation/index.mjs +2 -2
  56. package/esm2022/core/animation/select-animations.mjs +4 -4
  57. package/esm2022/core/formatters/index.mjs +10 -2
  58. package/esm2022/core/formatters/number/formatter.mjs +224 -3
  59. package/esm2022/core/forms/forms.directive.mjs +5 -5
  60. package/esm2022/core/locales/en-US.mjs +22 -4
  61. package/esm2022/core/locales/es-LA.mjs +31 -2
  62. package/esm2022/core/locales/fa-IR.mjs +30 -2
  63. package/esm2022/core/locales/locale-service.mjs +4 -4
  64. package/esm2022/core/locales/pt-BR.mjs +29 -2
  65. package/esm2022/core/locales/ru-RU.mjs +23 -2
  66. package/esm2022/core/locales/zh-CN.mjs +28 -2
  67. package/esm2022/core/option/action.mjs +3 -3
  68. package/esm2022/core/option/optgroup.mjs +3 -3
  69. package/esm2022/core/option/option.mjs +47 -10
  70. package/esm2022/core/overlay/overlay-position-map.mjs +7 -1
  71. package/esm2022/core/pop-up/constants.mjs +2 -1
  72. package/esm2022/core/pop-up/pop-up-trigger.mjs +12 -3
  73. package/esm2022/core/public-api.mjs +2 -1
  74. package/esm2022/core/select/constants.mjs +3 -3
  75. package/esm2022/core/services/theme.service.mjs +60 -0
  76. package/esm2022/core/version.mjs +2 -2
  77. package/esm2022/datepicker/calendar-body.component.mjs +3 -3
  78. package/esm2022/datepicker/calendar-header.component.mjs +9 -8
  79. package/esm2022/datepicker/calendar.component.mjs +7 -16
  80. package/esm2022/datepicker/datepicker-animations.mjs +2 -2
  81. package/esm2022/datepicker/datepicker-input.directive.mjs +29 -20
  82. package/esm2022/datepicker/datepicker-toggle.component.mjs +6 -6
  83. package/esm2022/datepicker/datepicker.component.mjs +11 -11
  84. package/esm2022/datepicker/month-view.component.mjs +9 -18
  85. package/esm2022/dl/dl.component.mjs +3 -7
  86. package/esm2022/dropdown/dropdown-animations.mjs +4 -4
  87. package/esm2022/dropdown/dropdown-content.directive.mjs +3 -3
  88. package/esm2022/dropdown/dropdown-errors.mjs +6 -6
  89. package/esm2022/dropdown/dropdown-item.component.mjs +5 -5
  90. package/esm2022/dropdown/dropdown-trigger.directive.mjs +8 -8
  91. package/esm2022/dropdown/dropdown.component.mjs +8 -8
  92. package/esm2022/dropdown/dropdown.types.mjs +1 -1
  93. package/esm2022/file-upload/file-drop.mjs +4 -4
  94. package/esm2022/file-upload/multiple-file-upload.component.mjs +12 -8
  95. package/esm2022/file-upload/single-file-upload.component.mjs +12 -8
  96. package/esm2022/form-field/cleaner.mjs +3 -3
  97. package/esm2022/form-field/form-field.mjs +9 -12
  98. package/esm2022/form-field/hint.mjs +4 -4
  99. package/esm2022/form-field/password-hint.mjs +22 -13
  100. package/esm2022/form-field/password-toggle.mjs +25 -8
  101. package/esm2022/form-field/suffix.mjs +3 -3
  102. package/esm2022/form-field/validate.directive.mjs +4 -4
  103. package/esm2022/input/input-number.mjs +259 -43
  104. package/esm2022/link/link.component.mjs +3 -3
  105. package/esm2022/list/list-selection.component.mjs +6 -6
  106. package/esm2022/loader-overlay/loader-overlay.component.mjs +2 -2
  107. package/esm2022/modal/modal-control.service.mjs +5 -5
  108. package/esm2022/modal/modal-ref.class.mjs +1 -1
  109. package/esm2022/modal/modal.component.mjs +126 -112
  110. package/esm2022/modal/modal.module.mjs +13 -7
  111. package/esm2022/modal/modal.service.mjs +23 -23
  112. package/esm2022/modal/modal.type.mjs +1 -3
  113. package/esm2022/navbar/navbar-item.component.mjs +17 -17
  114. package/esm2022/navbar/navbar.component.mjs +18 -9
  115. package/esm2022/navbar/vertical-navbar.component.mjs +9 -6
  116. package/esm2022/popover/popover-animations.mjs +2 -2
  117. package/esm2022/popover/popover-confirm.component.mjs +9 -9
  118. package/esm2022/popover/popover.component.mjs +23 -23
  119. package/esm2022/radio/radio.component.mjs +11 -8
  120. package/esm2022/select/select.component.mjs +35 -21
  121. package/esm2022/sidebar/sidebar-animations.mjs +2 -2
  122. package/esm2022/sidebar/sidebar.component.mjs +9 -9
  123. package/esm2022/sidepanel/sidepanel-directives.mjs +2 -2
  124. package/esm2022/sidepanel/sidepanel.module.mjs +10 -4
  125. package/esm2022/splitter/splitter.component.mjs +3 -3
  126. package/esm2022/table/table.component.mjs +3 -3
  127. package/esm2022/tabs/paginated-tab-header.mjs +11 -2
  128. package/esm2022/tabs/tab-body.component.mjs +7 -7
  129. package/esm2022/tabs/tab-content.directive.mjs +3 -3
  130. package/esm2022/tabs/tab-group.component.mjs +3 -3
  131. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +6 -6
  132. package/esm2022/tabs/tab.component.mjs +14 -5
  133. package/esm2022/tabs/tabs-animations.mjs +2 -2
  134. package/esm2022/tags/tag-default-options.mjs +1 -1
  135. package/esm2022/tags/tag-input.mjs +12 -10
  136. package/esm2022/tags/tag-list.component.mjs +12 -8
  137. package/esm2022/tags/tag.component.mjs +13 -13
  138. package/esm2022/timepicker/timepicker.directive.mjs +10 -10
  139. package/esm2022/timezone/timezone-option.component.mjs +3 -3
  140. package/esm2022/timezone/timezone-select.component.mjs +5 -5
  141. package/esm2022/title/title.directive.mjs +6 -6
  142. package/esm2022/toast/toast.module.mjs +10 -4
  143. package/esm2022/toggle/toggle.component.mjs +3 -3
  144. package/esm2022/tooltip/tooltip.component.mjs +16 -16
  145. package/esm2022/tree/node.mjs +5 -5
  146. package/esm2022/tree/outlet.mjs +3 -3
  147. package/esm2022/tree/padding.directive.mjs +6 -6
  148. package/esm2022/tree/toggle.mjs +8 -8
  149. package/esm2022/tree/tree-base.mjs +3 -3
  150. package/esm2022/tree/tree-option.component.mjs +9 -5
  151. package/esm2022/tree/tree-selection.component.mjs +8 -6
  152. package/esm2022/tree/tree.mjs +3 -3
  153. package/esm2022/tree-select/tree-select.component.mjs +13 -13
  154. package/fesm2022/koobiq-components-alert.mjs +2 -2
  155. package/fesm2022/koobiq-components-alert.mjs.map +1 -1
  156. package/fesm2022/koobiq-components-autocomplete.mjs +24 -21
  157. package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
  158. package/fesm2022/koobiq-components-button-toggle.mjs +7 -7
  159. package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
  160. package/fesm2022/koobiq-components-checkbox.mjs +2 -2
  161. package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
  162. package/fesm2022/koobiq-components-code-block.mjs +3 -3
  163. package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
  164. package/fesm2022/koobiq-components-core.mjs +526 -39
  165. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  166. package/fesm2022/koobiq-components-datepicker.mjs +66 -74
  167. package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
  168. package/fesm2022/koobiq-components-dl.mjs +2 -6
  169. package/fesm2022/koobiq-components-dl.mjs.map +1 -1
  170. package/fesm2022/koobiq-components-dropdown.mjs +28 -28
  171. package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
  172. package/fesm2022/koobiq-components-file-upload.mjs +23 -15
  173. package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
  174. package/fesm2022/koobiq-components-form-field.mjs +61 -40
  175. package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
  176. package/fesm2022/koobiq-components-input.mjs +257 -43
  177. package/fesm2022/koobiq-components-input.mjs.map +1 -1
  178. package/fesm2022/koobiq-components-link.mjs +2 -2
  179. package/fesm2022/koobiq-components-link.mjs.map +1 -1
  180. package/fesm2022/koobiq-components-list.mjs +5 -5
  181. package/fesm2022/koobiq-components-list.mjs.map +1 -1
  182. package/fesm2022/koobiq-components-loader-overlay.mjs +2 -2
  183. package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
  184. package/fesm2022/koobiq-components-modal.mjs +161 -145
  185. package/fesm2022/koobiq-components-modal.mjs.map +1 -1
  186. package/fesm2022/koobiq-components-navbar.mjs +39 -31
  187. package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
  188. package/fesm2022/koobiq-components-popover.mjs +30 -30
  189. package/fesm2022/koobiq-components-popover.mjs.map +1 -1
  190. package/fesm2022/koobiq-components-radio.mjs +10 -7
  191. package/fesm2022/koobiq-components-radio.mjs.map +1 -1
  192. package/fesm2022/koobiq-components-select.mjs +34 -20
  193. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  194. package/fesm2022/koobiq-components-sidebar.mjs +8 -8
  195. package/fesm2022/koobiq-components-sidebar.mjs.map +1 -1
  196. package/fesm2022/koobiq-components-sidepanel.mjs +10 -4
  197. package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
  198. package/fesm2022/koobiq-components-splitter.mjs +2 -2
  199. package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
  200. package/fesm2022/koobiq-components-table.mjs +2 -2
  201. package/fesm2022/koobiq-components-table.mjs.map +1 -1
  202. package/fesm2022/koobiq-components-tabs.mjs +39 -21
  203. package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
  204. package/fesm2022/koobiq-components-tags.mjs +34 -28
  205. package/fesm2022/koobiq-components-tags.mjs.map +1 -1
  206. package/fesm2022/koobiq-components-timepicker.mjs +9 -9
  207. package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
  208. package/fesm2022/koobiq-components-timezone.mjs +6 -6
  209. package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
  210. package/fesm2022/koobiq-components-title.mjs +5 -5
  211. package/fesm2022/koobiq-components-title.mjs.map +1 -1
  212. package/fesm2022/koobiq-components-toast.mjs +8 -2
  213. package/fesm2022/koobiq-components-toast.mjs.map +1 -1
  214. package/fesm2022/koobiq-components-toggle.mjs +2 -2
  215. package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
  216. package/fesm2022/koobiq-components-tooltip.mjs +15 -15
  217. package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
  218. package/fesm2022/koobiq-components-tree-select.mjs +12 -12
  219. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
  220. package/fesm2022/koobiq-components-tree.mjs +37 -31
  221. package/fesm2022/koobiq-components-tree.mjs.map +1 -1
  222. package/file-upload/file-drop.d.ts +1 -1
  223. package/file-upload/multiple-file-upload.component.d.ts +4 -3
  224. package/file-upload/single-file-upload.component.d.ts +4 -3
  225. package/form-field/_hint-theme.scss +1 -1
  226. package/form-field/cleaner.d.ts +1 -1
  227. package/form-field/form-field.d.ts +2 -3
  228. package/form-field/form-field.scss +2 -2
  229. package/form-field/hint.d.ts +1 -1
  230. package/form-field/password-hint.d.ts +7 -3
  231. package/form-field/password-toggle.d.ts +12 -6
  232. package/form-field/suffix.d.ts +1 -1
  233. package/form-field/validate.directive.d.ts +1 -1
  234. package/icon/_icon-theme.scss +2 -1
  235. package/input/_input-theme.scss +2 -1
  236. package/input/input-number.d.ts +61 -10
  237. package/link/_link-theme.scss +4 -0
  238. package/link/link.component.d.ts +1 -1
  239. package/list/list-selection.component.d.ts +1 -1
  240. package/loader-overlay/loader-overlay.scss +3 -0
  241. package/modal/README.md +5 -5
  242. package/modal/modal-ref.class.d.ts +2 -2
  243. package/modal/modal.component.d.ts +51 -47
  244. package/modal/modal.module.d.ts +2 -1
  245. package/modal/modal.scss +7 -0
  246. package/modal/modal.type.d.ts +35 -36
  247. package/navbar/navbar-item.component.d.ts +4 -3
  248. package/navbar/navbar.component.d.ts +5 -2
  249. package/navbar/vertical-navbar.component.d.ts +4 -2
  250. package/package.json +9 -11
  251. package/popover/README.md +14 -14
  252. package/popover/_popover-theme.scss +11 -11
  253. package/popover/popover-animations.d.ts +1 -1
  254. package/popover/popover-confirm.component.d.ts +1 -1
  255. package/popover/popover.component.d.ts +3 -3
  256. package/prebuilt-themes/dark-theme.css +1 -1
  257. package/prebuilt-themes/light-theme.css +1 -1
  258. package/radio/_radio-theme.scss +15 -2
  259. package/radio/radio.component.d.ts +2 -2
  260. package/radio/radio.scss +13 -0
  261. package/select/select.component.d.ts +14 -11
  262. package/select/select.scss +1 -1
  263. package/sidebar/sidebar-animations.d.ts +1 -1
  264. package/sidebar/sidebar.component.d.ts +3 -3
  265. package/splitter/splitter.component.d.ts +1 -1
  266. package/table/table.component.d.ts +1 -1
  267. package/tabs/paginated-tab-header.d.ts +1 -0
  268. package/tabs/tab-body.component.d.ts +1 -1
  269. package/tabs/tab-content.directive.d.ts +1 -1
  270. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +2 -2
  271. package/tabs/tab.component.d.ts +1 -1
  272. package/tabs/tabs-animations.d.ts +1 -1
  273. package/tags/_tag-theme.scss +1 -1
  274. package/tags/tag-default-options.d.ts +4 -0
  275. package/tags/tag-input.d.ts +2 -2
  276. package/tags/tag-list.component.d.ts +3 -2
  277. package/tags/tag-list.scss +2 -0
  278. package/tags/tag.component.d.ts +4 -4
  279. package/timepicker/timepicker.directive.d.ts +2 -2
  280. package/timezone/timezone-option.component.d.ts +1 -1
  281. package/timezone/timezone-select.component.d.ts +1 -1
  282. package/title/title.directive.d.ts +1 -1
  283. package/toggle/toggle.component.d.ts +1 -1
  284. package/tooltip/tooltip.component.d.ts +3 -3
  285. package/tree/node.d.ts +1 -1
  286. package/tree/outlet.d.ts +1 -1
  287. package/tree/padding.directive.d.ts +1 -1
  288. package/tree/toggle.d.ts +3 -3
  289. package/tree/tree-base.d.ts +1 -1
  290. package/tree/tree-option.component.d.ts +1 -1
  291. package/tree/tree-option.scss +2 -0
  292. package/tree/tree-selection.component.d.ts +1 -1
  293. package/tree/tree.d.ts +1 -1
  294. package/tree-select/tree-select.component.d.ts +1 -1
@@ -1,20 +1,22 @@
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 } 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';
15
16
  import { KbqIconModule } from '@koobiq/components/icon';
17
+ import * as i7 from '@koobiq/components/title';
18
+ import { KbqTitleModule } from '@koobiq/components/title';
16
19
  import { ComponentPortal } from '@angular/cdk/portal';
17
- import { filter } from 'rxjs/operators';
18
20
 
19
21
  class KbqModalControlService {
20
22
  // Track singleton afterAllClose through over the injection tree
@@ -68,20 +70,20 @@ class KbqModalControlService {
68
70
  }
69
71
  handleMultipleMasks(modalRef) {
70
72
  const modals = Array.from(this.registeredMetaMap.values()).map((v) => v.modalRef);
71
- if (modals.filter((modal) => modal.mcVisible).length > 1) {
73
+ if (modals.filter((modal) => modal.kbqVisible).length > 1) {
72
74
  const otherModals = modals.splice(0, modals.length - 1)
73
- .filter((modal) => modal.mcVisible && modal.mcMask);
75
+ .filter((modal) => modal.kbqVisible && modal.kbqMask);
74
76
  // hide other masks
75
77
  setTimeout(() => {
76
78
  otherModals.forEach((modal) => {
77
- modal.getInstance().mcMask = false;
79
+ modal.getInstance().kbqMask = false;
78
80
  modal.markForCheck();
79
81
  });
80
82
  });
81
83
  // show other masks on close
82
84
  modalRef.afterClose.subscribe(() => {
83
85
  otherModals.forEach((modal) => {
84
- modal.getInstance().mcMask = true;
86
+ modal.getInstance().kbqMask = true;
85
87
  modal.markForCheck();
86
88
  });
87
89
  });
@@ -127,8 +129,6 @@ var ModalSize;
127
129
  (function (ModalSize) {
128
130
  ModalSize["Small"] = "small";
129
131
  ModalSize["Medium"] = "medium";
130
- // Normal is deprecated and will be deleted in 16.x
131
- ModalSize["Normal"] = "medium";
132
132
  ModalSize["Large"] = "large";
133
133
  })(ModalSize || (ModalSize = {}));
134
134
 
@@ -150,37 +150,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
150
150
  // Duration when perform animations (ms)
151
151
  const MODAL_ANIMATE_DURATION = 200;
152
152
  class KbqModalComponent extends KbqModalRef {
153
- get mcVisible() { return this._mcVisible; }
154
- set mcVisible(value) { this._mcVisible = value; }
155
- get mcClosable() { return this._mcClosable; }
156
- set mcClosable(value) { this._mcClosable = value; }
157
- get mcMask() { return this._mcMask; }
158
- set mcMask(value) { this._mcMask = value; }
159
- get mcMaskClosable() { return this._mcMaskClosable; }
160
- set mcMaskClosable(value) { this._mcMaskClosable = value; }
161
- get mcOkLoading() { return this._mcOkLoading; }
162
- set mcOkLoading(value) { this._mcOkLoading = value; }
163
- get mcCancelLoading() { return this._mcCancelLoading; }
164
- set mcCancelLoading(value) { this._mcCancelLoading = value; }
165
- // 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
166
166
  get afterOpen() {
167
- return this.mcAfterOpen.asObservable();
167
+ return this.kbqAfterOpen.asObservable();
168
168
  }
169
- // Observable alias for mcAfterClose
169
+ // Observable alias for kbqAfterClose
170
170
  get afterClose() {
171
- return this.mcAfterClose.asObservable();
171
+ return this.kbqAfterClose.asObservable();
172
172
  }
173
173
  get okText() {
174
- return this.mcOkText;
174
+ return this.kbqOkText;
175
175
  }
176
176
  get cancelText() {
177
- return this.mcCancelText;
177
+ return this.kbqCancelText;
178
178
  }
179
179
  // Indicate whether this dialog should hidden
180
180
  get hidden() {
181
- return !this.mcVisible && !this.animationState;
181
+ return !this.kbqVisible && !this.animationState;
182
182
  }
183
- constructor(overlay, renderer, cfr, elementRef, viewContainer, modalControl, changeDetector, document) {
183
+ constructor(overlay, renderer, cfr, elementRef, viewContainer, modalControl, changeDetector, focusMonitor, document) {
184
184
  super();
185
185
  this.overlay = overlay;
186
186
  this.renderer = renderer;
@@ -189,45 +189,46 @@ class KbqModalComponent extends KbqModalRef {
189
189
  this.viewContainer = viewContainer;
190
190
  this.modalControl = modalControl;
191
191
  this.changeDetector = changeDetector;
192
+ this.focusMonitor = focusMonitor;
192
193
  this.document = document;
193
194
  this.componentColors = KbqComponentColors;
194
- this.mcModalType = 'default';
195
- this._mcVisible = false;
196
- this.mcVisibleChange = new EventEmitter();
197
- this.mcZIndex = 1000;
198
- this.mcSize = ModalSize.Medium;
199
- this.mcCloseByESC = true;
200
- this._mcClosable = true;
201
- this._mcMask = true;
202
- 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;
203
204
  // Trigger when modal open(visible) after animations
204
- this.mcAfterOpen = new EventEmitter();
205
+ this.kbqAfterOpen = new EventEmitter();
205
206
  // Trigger when modal leave-animation over
206
- this.mcAfterClose = new EventEmitter();
207
- this.mcOkType = KbqComponentColors.Contrast;
208
- this.mcRestoreFocus = true;
209
- this._mcOkLoading = false;
210
- this.mcOnOk = new EventEmitter();
211
- this._mcCancelLoading = false;
212
- 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();
213
214
  // The origin point that animation based on
214
215
  this.transformOrigin = '0px 0px 0px';
215
- this.mcGetContainer = () => this.overlay.create();
216
+ this.kbqGetContainer = () => this.overlay.create();
216
217
  }
217
218
  ngOnInit() {
218
219
  // Create component along without View
219
- if (this.isComponent(this.mcContent)) {
220
- this.createDynamicComponent(this.mcContent);
220
+ if (this.isComponent(this.kbqContent)) {
221
+ this.createDynamicComponent(this.kbqContent);
221
222
  }
222
223
  // Setup default button options
223
- if (this.isModalButtons(this.mcFooter)) {
224
- this.mcFooter = this.formatModalButtons(this.mcFooter);
224
+ if (this.isModalButtons(this.kbqFooter)) {
225
+ this.kbqFooter = this.formatModalButtons(this.kbqFooter);
225
226
  }
226
- if (this.isComponent(this.mcComponent)) {
227
- this.createDynamicComponent(this.mcComponent);
227
+ if (this.isComponent(this.kbqComponent)) {
228
+ this.createDynamicComponent(this.kbqComponent);
228
229
  }
229
230
  // Place the modal dom to elsewhere
230
- this.container = typeof this.mcGetContainer === 'function' ? this.mcGetContainer() : this.mcGetContainer;
231
+ this.container = typeof this.kbqGetContainer === 'function' ? this.kbqGetContainer() : this.kbqGetContainer;
231
232
  if (this.container instanceof HTMLElement) {
232
233
  this.container.appendChild(this.elementRef.nativeElement);
233
234
  }
@@ -240,13 +241,13 @@ class KbqModalComponent extends KbqModalRef {
240
241
  }
241
242
  // [NOTE] NOT available when using by service!
242
243
  // Because ngOnChanges never be called when using by service,
243
- // here we can't support "mcContent"(Component) etc. as inputs that initialized dynamically.
244
- // 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
245
246
  // (provided you don't use Component that needs initializations)
246
247
  ngOnChanges(changes) {
247
- if (changes.mcVisible) {
248
+ if (changes.kbqVisible) {
248
249
  // Do not trigger animation while initializing
249
- this.handleVisibleStateChange(this.mcVisible, !changes.mcVisible.firstChange);
250
+ this.handleVisibleStateChange(this.kbqVisible, !changes.kbqVisible.firstChange);
250
251
  }
251
252
  }
252
253
  ngAfterViewInit() {
@@ -269,14 +270,21 @@ class KbqModalComponent extends KbqModalRef {
269
270
  }
270
271
  open() {
271
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
+ });
272
279
  this.changeVisibleFromInside(true);
273
280
  }
274
281
  close(result) {
275
- if (this.mcRestoreFocus) {
276
- this.focusedElementBeforeOpen?.focus();
277
- }
278
- this.changeVisibleFromInside(false, result);
279
- 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
+ });
280
288
  }
281
289
  // Destroy equals Close
282
290
  destroy(result) {
@@ -307,16 +315,16 @@ class KbqModalComponent extends KbqModalRef {
307
315
  return this.getElement().getElementsByClassName('kbq-modal-footer').item(0);
308
316
  }
309
317
  onClickMask($event) {
310
- if (this.mcMask &&
311
- this.mcMaskClosable &&
318
+ if (this.kbqMask &&
319
+ this.kbqMaskClosable &&
312
320
  $event.target.classList.contains('kbq-modal-wrap') &&
313
- this.mcVisible) {
321
+ this.kbqVisible) {
314
322
  this.onClickOkCancel('cancel');
315
323
  }
316
324
  }
317
325
  // tslint:disable-next-line: no-reserved-keywords
318
326
  isModalType(type) {
319
- return this.mcModalType === type;
327
+ return this.kbqModalType === type;
320
328
  }
321
329
  onKeyDown(event) {
322
330
  // tslint:disable-next-line:deprecation .key isn't supported in Edge
@@ -326,7 +334,7 @@ class KbqModalComponent extends KbqModalRef {
326
334
  }
327
335
  // tslint:disable-next-line:deprecation .key isn't supported in Edge
328
336
  if (event.ctrlKey && event.keyCode === ENTER) {
329
- if (this.mcModalType === 'confirm') {
337
+ if (this.kbqModalType === 'confirm') {
330
338
  this.triggerOk();
331
339
  }
332
340
  this.getElement().querySelector('[kbq-modal-main-action]')?.click();
@@ -335,22 +343,25 @@ class KbqModalComponent extends KbqModalRef {
335
343
  }
336
344
  // AoT
337
345
  onClickCloseBtn() {
338
- if (this.mcVisible) {
346
+ if (this.kbqVisible) {
339
347
  this.onClickOkCancel('cancel');
340
348
  }
341
349
  }
342
350
  // AoT
343
351
  // tslint:disable-next-line: no-reserved-keywords
344
352
  onClickOkCancel(type) {
345
- const trigger = { ok: this.mcOnOk, cancel: this.mcOnCancel }[type];
346
- 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];
347
358
  if (trigger instanceof EventEmitter) {
348
359
  trigger.emit(this.getContentComponent());
349
360
  }
350
361
  else if (typeof trigger === 'function') {
351
362
  const result = trigger(this.getContentComponent());
352
363
  // Users can return "false" to prevent closing by default
353
- const caseClose = (doClose) => (doClose !== false) && this.close(doClose);
364
+ const caseClose = (doClose) => canClose(doClose) && this.close(doClose);
354
365
  if (isPromise(result)) {
355
366
  this[loadingKey] = true;
356
367
  const handleThen = (doClose) => {
@@ -390,7 +401,7 @@ class KbqModalComponent extends KbqModalRef {
390
401
  }
391
402
  return typeof value === 'function' ? value.apply(options, args) : value;
392
403
  }
393
- // On mcFooter's modal button click
404
+ // On kbqFooter's modal button click
394
405
  // AoT
395
406
  onButtonClick(button) {
396
407
  // Call onClick directly
@@ -412,21 +423,21 @@ class KbqModalComponent extends KbqModalRef {
412
423
  // Emit open/close event after animations over
413
424
  .then(() => {
414
425
  if (visible) {
415
- this.mcAfterOpen.emit();
426
+ this.kbqAfterOpen.emit();
416
427
  }
417
428
  else {
418
- this.mcAfterClose.emit(closeResult);
429
+ this.kbqAfterClose.emit(closeResult);
419
430
  // Show/hide scrollbar when animation is over
420
431
  this.changeBodyOverflow();
421
432
  }
422
433
  });
423
434
  }
424
- // Change mcVisible from inside
435
+ // Change kbqVisible from inside
425
436
  changeVisibleFromInside(visible, closeResult) {
426
- if (this.mcVisible !== visible) {
427
- // Change mcVisible value immediately
428
- this.mcVisible = visible;
429
- this.mcVisibleChange.emit(visible);
437
+ if (this.kbqVisible !== visible) {
438
+ // Change kbqVisible value immediately
439
+ this.kbqVisible = visible;
440
+ this.kbqVisibleChange.emit(visible);
430
441
  return this.handleVisibleStateChange(visible, true, closeResult);
431
442
  }
432
443
  return Promise.resolve();
@@ -497,9 +508,9 @@ class KbqModalComponent extends KbqModalRef {
497
508
  parent: this.viewContainer.injector
498
509
  });
499
510
  this.contentComponentRef = factory.create(childInjector);
500
- if (this.mcComponentParams) {
511
+ if (this.kbqComponentParams) {
501
512
  // @ts-ignore
502
- Object.assign(this.contentComponentRef.instance, this.mcComponentParams);
513
+ Object.assign(this.contentComponentRef.instance, this.kbqComponentParams);
503
514
  }
504
515
  // Do the first change detection immediately
505
516
  // (or we do detection at ngAfterViewInit, multi-changes error will be thrown)
@@ -526,78 +537,78 @@ class KbqModalComponent extends KbqModalRef {
526
537
  this.renderer.removeStyle(this.document.body, 'overflow');
527
538
  }
528
539
  }
529
- /** @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 }); }
530
- /** @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>\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\">\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-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: "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 }); }
531
542
  }
532
543
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalComponent, decorators: [{
533
544
  type: Component,
534
545
  args: [{ selector: 'kbq-modal', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
535
546
  '(keydown)': 'onKeyDown($event)'
536
- }, 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>\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\">\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-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"] }]
537
- }], 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: [{
538
549
  type: Inject,
539
550
  args: [DOCUMENT]
540
- }] }]; }, propDecorators: { mcModalType: [{
551
+ }] }]; }, propDecorators: { kbqModalType: [{
541
552
  type: Input
542
- }], mcComponent: [{
553
+ }], kbqComponent: [{
543
554
  type: Input
544
- }], mcContent: [{
555
+ }], kbqContent: [{
545
556
  type: Input
546
- }], mcComponentParams: [{
557
+ }], kbqComponentParams: [{
547
558
  type: Input
548
- }], mcFooter: [{
559
+ }], kbqFooter: [{
549
560
  type: Input
550
- }], mcVisible: [{
561
+ }], kbqVisible: [{
551
562
  type: Input
552
- }], mcVisibleChange: [{
563
+ }], kbqVisibleChange: [{
553
564
  type: Output
554
- }], mcZIndex: [{
565
+ }], kbqZIndex: [{
555
566
  type: Input
556
- }], mcWidth: [{
567
+ }], kbqWidth: [{
557
568
  type: Input
558
- }], mcSize: [{
569
+ }], kbqSize: [{
559
570
  type: Input
560
- }], mcWrapClassName: [{
571
+ }], kbqWrapClassName: [{
561
572
  type: Input
562
- }], mcClassName: [{
573
+ }], kbqClassName: [{
563
574
  type: Input
564
- }], mcStyle: [{
575
+ }], kbqStyle: [{
565
576
  type: Input
566
- }], mcTitle: [{
577
+ }], kbqTitle: [{
567
578
  type: Input
568
- }], mcCloseByESC: [{
579
+ }], kbqCloseByESC: [{
569
580
  type: Input
570
- }], mcClosable: [{
581
+ }], kbqClosable: [{
571
582
  type: Input
572
- }], mcMask: [{
583
+ }], kbqMask: [{
573
584
  type: Input
574
- }], mcMaskClosable: [{
585
+ }], kbqMaskClosable: [{
575
586
  type: Input
576
- }], mcMaskStyle: [{
587
+ }], kbqMaskStyle: [{
577
588
  type: Input
578
- }], mcBodyStyle: [{
589
+ }], kbqBodyStyle: [{
579
590
  type: Input
580
- }], mcAfterOpen: [{
591
+ }], kbqAfterOpen: [{
581
592
  type: Output
582
- }], mcAfterClose: [{
593
+ }], kbqAfterClose: [{
583
594
  type: Output
584
- }], mcOkText: [{
595
+ }], kbqOkText: [{
585
596
  type: Input
586
- }], mcOkType: [{
597
+ }], kbqOkType: [{
587
598
  type: Input
588
- }], mcRestoreFocus: [{
599
+ }], kbqRestoreFocus: [{
589
600
  type: Input
590
- }], mcOkLoading: [{
601
+ }], kbqOkLoading: [{
591
602
  type: Input
592
- }], mcOnOk: [{
603
+ }], kbqOnOk: [{
593
604
  type: Input
594
605
  }, {
595
606
  type: Output
596
- }], mcCancelText: [{
607
+ }], kbqCancelText: [{
597
608
  type: Input
598
- }], mcCancelLoading: [{
609
+ }], kbqCancelLoading: [{
599
610
  type: Input
600
- }], mcOnCancel: [{
611
+ }], kbqOnCancel: [{
601
612
  type: Input
602
613
  }, {
603
614
  type: Output
@@ -613,7 +624,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
613
624
  }], modalBody: [{
614
625
  type: ViewChild,
615
626
  args: ['modalBody']
616
- }], mcGetContainer: [{
627
+ }], kbqGetContainer: [{
617
628
  type: Input
618
629
  }] } });
619
630
  ////////////
@@ -680,18 +691,18 @@ class ModalBuilderForService {
680
691
  constructor(overlay, options = {}) {
681
692
  this.overlay = overlay;
682
693
  this.createModal();
683
- if (!('mcGetContainer' in options)) {
684
- options.mcGetContainer = undefined;
694
+ if (!('kbqGetContainer' in options)) {
695
+ options.kbqGetContainer = undefined;
685
696
  }
686
697
  this.changeProps(options);
687
698
  this.modalRef.instance.open();
688
- this.modalRef.instance.mcAfterClose.subscribe(() => this.destroyModal());
699
+ this.modalRef.instance.kbqAfterClose.subscribe(() => this.destroyModal());
689
700
  this.overlayRef.keydownEvents()
690
701
  .pipe(filter((event) => {
691
702
  // tslint:disable-next-line:deprecation replacement .key isn't supported in Edge
692
- return !!(event.keyCode === ESCAPE && options.mcCloseByESC);
703
+ return !!(event.keyCode === ESCAPE && options.kbqCloseByESC);
693
704
  }))
694
- .subscribe(() => this.modalRef.instance.close());
705
+ .subscribe(() => this.getInstance()?.handleCloseResult('cancel', () => true));
695
706
  }
696
707
  getInstance() {
697
708
  return this.modalRef && this.modalRef.instance;
@@ -732,44 +743,44 @@ class KbqModalService {
732
743
  this.modalControl.closeAll();
733
744
  }
734
745
  create(options = {}) {
735
- if (typeof options.mcOnCancel !== 'function') {
746
+ if (typeof options.kbqOnCancel !== 'function') {
736
747
  // Leave a empty function to close this modal by default
737
748
  // tslint:disable-next-line
738
- options.mcOnCancel = () => { };
749
+ options.kbqOnCancel = () => { };
739
750
  }
740
- if (!('mcCloseByESC' in options)) {
741
- options.mcCloseByESC = true;
751
+ if (!('kbqCloseByESC' in options)) {
752
+ options.kbqCloseByESC = true;
742
753
  }
743
754
  // Remove the Cancel button if the user not specify a Cancel button
744
- if (!('mcCancelText' in options)) {
745
- options.mcCancelText = undefined;
755
+ if (!('kbqCancelText' in options)) {
756
+ options.kbqCancelText = undefined;
746
757
  }
747
758
  // Remove the Ok button if the user not specify a Ok button
748
- if (!('mcOkText' in options)) {
749
- options.mcOkText = undefined;
759
+ if (!('kbqOkText' in options)) {
760
+ options.kbqOkText = undefined;
750
761
  }
751
762
  // Remove the footer if the user not specify a footer
752
- if (!('mcFooter' in options)) {
753
- options.mcFooter = undefined;
763
+ if (!('kbqFooter' in options)) {
764
+ options.kbqFooter = undefined;
754
765
  }
755
766
  return new ModalBuilderForService(this.overlay, options).getInstance();
756
767
  }
757
768
  confirm(options = {}, confirmType = 'confirm') {
758
- if ('mcFooter' in options) {
759
- 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.`);
760
771
  }
761
772
  // NOTE: only support function currently by calling confirm()
762
- if (typeof options.mcOnOk !== 'function') {
773
+ if (typeof options.kbqOnOk !== 'function') {
763
774
  // Leave a empty function to close this modal by default
764
775
  // tslint:disable-next-line
765
- options.mcOnOk = () => { };
776
+ options.kbqOnOk = () => { };
766
777
  }
767
- options.mcModalType = 'confirm';
768
- options.mcClassName = `kbq-confirm kbq-confirm-${confirmType} ${options.mcClassName || ''}`;
778
+ options.kbqModalType = 'confirm';
779
+ options.kbqClassName = `kbq-confirm kbq-confirm-${confirmType} ${options.kbqClassName || ''}`;
769
780
  return this.create(options);
770
781
  }
771
782
  open(options = {}) {
772
- options.mcModalType = 'custom';
783
+ options.kbqModalType = 'custom';
773
784
  return this.create(options);
774
785
  }
775
786
  success(options = {}) {
@@ -800,19 +811,22 @@ class KbqModalModule {
800
811
  OverlayModule,
801
812
  A11yModule,
802
813
  KbqButtonModule,
803
- KbqIconModule], exports: [KbqModalComponent,
814
+ KbqIconModule,
815
+ KbqTitleModule], exports: [KbqModalComponent,
804
816
  KbqModalTitle,
805
817
  KbqModalBody,
806
818
  KbqModalFooter,
807
819
  KbqModalMainAction] }); }
808
820
  /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalModule, providers: [
809
821
  KbqModalControlService,
810
- KbqModalService
822
+ KbqModalService,
823
+ { provide: FocusTrapFactory, useClass: ConfigurableFocusTrapFactory }
811
824
  ], imports: [CommonModule,
812
825
  OverlayModule,
813
826
  A11yModule,
814
827
  KbqButtonModule,
815
- KbqIconModule] }); }
828
+ KbqIconModule,
829
+ KbqTitleModule] }); }
816
830
  }
817
831
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqModalModule, decorators: [{
818
832
  type: NgModule,
@@ -822,7 +836,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
822
836
  OverlayModule,
823
837
  A11yModule,
824
838
  KbqButtonModule,
825
- KbqIconModule
839
+ KbqIconModule,
840
+ KbqTitleModule
826
841
  ],
827
842
  exports: [
828
843
  KbqModalComponent,
@@ -841,7 +856,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImpor
841
856
  ],
842
857
  providers: [
843
858
  KbqModalControlService,
844
- KbqModalService
859
+ KbqModalService,
860
+ { provide: FocusTrapFactory, useClass: ConfigurableFocusTrapFactory }
845
861
  ]
846
862
  }]
847
863
  }] });