@koobiq/components 16.0.0-beta.1

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 (1007) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -0
  3. package/_index.scss +3 -0
  4. package/alert/README.md +0 -0
  5. package/alert/_alert-theme.scss +61 -0
  6. package/alert/alert.component.d.ts +22 -0
  7. package/alert/alert.component.scss +81 -0
  8. package/alert/alert.module.d.ts +10 -0
  9. package/alert/index.d.ts +1 -0
  10. package/alert/public-api.d.ts +2 -0
  11. package/autocomplete/README.md +0 -0
  12. package/autocomplete/_autocomplete-theme.scss +21 -0
  13. package/autocomplete/autocomplete-origin.directive.d.ts +12 -0
  14. package/autocomplete/autocomplete-trigger.directive.d.ts +167 -0
  15. package/autocomplete/autocomplete.component.d.ts +73 -0
  16. package/autocomplete/autocomplete.module.d.ts +12 -0
  17. package/autocomplete/autocomplete.scss +63 -0
  18. package/autocomplete/index.d.ts +1 -0
  19. package/autocomplete/public-api.d.ts +4 -0
  20. package/button/README.md +0 -0
  21. package/button/_button-base.scss +69 -0
  22. package/button/_button-theme.scss +180 -0
  23. package/button/button.component.d.ts +58 -0
  24. package/button/button.module.d.ts +11 -0
  25. package/button/button.scss +59 -0
  26. package/button/index.d.ts +1 -0
  27. package/button/public-api.d.ts +2 -0
  28. package/button-toggle/README.md +0 -0
  29. package/button-toggle/_button-toggle-theme.scss +92 -0
  30. package/button-toggle/button-toggle.component.d.ts +145 -0
  31. package/button-toggle/button-toggle.module.d.ts +10 -0
  32. package/button-toggle/button-toggle.scss +163 -0
  33. package/button-toggle/index.d.ts +1 -0
  34. package/button-toggle/public-api.d.ts +2 -0
  35. package/card/README.md +0 -0
  36. package/card/_card-theme.scss +61 -0
  37. package/card/card.component.d.ts +28 -0
  38. package/card/card.component.scss +40 -0
  39. package/card/card.module.d.ts +10 -0
  40. package/card/index.d.ts +1 -0
  41. package/card/public-api.d.ts +2 -0
  42. package/checkbox/README.md +1 -0
  43. package/checkbox/_checkbox-theme.scss +120 -0
  44. package/checkbox/checkbox-config.d.ts +13 -0
  45. package/checkbox/checkbox-module.d.ts +9 -0
  46. package/checkbox/checkbox-required-validator.d.ts +13 -0
  47. package/checkbox/checkbox.d.ts +133 -0
  48. package/checkbox/checkbox.scss +177 -0
  49. package/checkbox/index.d.ts +1 -0
  50. package/checkbox/public-api.d.ts +4 -0
  51. package/code-block/README.md +32 -0
  52. package/code-block/_code-block-theme.scss +326 -0
  53. package/code-block/actionbar.component.d.ts +22 -0
  54. package/code-block/actionbar.component.scss +27 -0
  55. package/code-block/code-block.component.d.ts +74 -0
  56. package/code-block/code-block.module.d.ts +14 -0
  57. package/code-block/code-block.scss +128 -0
  58. package/code-block/code-block.types.d.ts +16 -0
  59. package/code-block/index.d.ts +1 -0
  60. package/code-block/public-api.d.ts +3 -0
  61. package/core/_index.scss +1 -0
  62. package/core/animation/animation.d.ts +6 -0
  63. package/core/animation/fade-animations.d.ts +2 -0
  64. package/core/animation/index.d.ts +3 -0
  65. package/core/animation/select-animations.d.ts +12 -0
  66. package/core/common-behaviors/color.d.ts +33 -0
  67. package/core/common-behaviors/common-module.d.ts +25 -0
  68. package/core/common-behaviors/constructor.d.ts +9 -0
  69. package/core/common-behaviors/disabled.d.ts +8 -0
  70. package/core/common-behaviors/error-state.d.ts +28 -0
  71. package/core/common-behaviors/index.d.ts +5 -0
  72. package/core/common-behaviors/tabindex.d.ts +8 -0
  73. package/core/datetime/date-adapter.d.ts +12 -0
  74. package/core/datetime/date-formats.d.ts +4 -0
  75. package/core/datetime/index.d.ts +2 -0
  76. package/core/error/error-options.d.ts +14 -0
  77. package/core/form-field/form-field-ref.d.ts +11 -0
  78. package/core/form-field/index.d.ts +1 -0
  79. package/core/formatters/date/formatter.d.ts +9 -0
  80. package/core/formatters/date/formatter.pipe.d.ts +109 -0
  81. package/core/formatters/index.d.ts +11 -0
  82. package/core/formatters/number/formatter.d.ts +37 -0
  83. package/core/forms/_forms-theme.scss +34 -0
  84. package/core/forms/_forms.scss +114 -0
  85. package/core/forms/forms-module.d.ts +7 -0
  86. package/core/forms/forms.directive.d.ts +22 -0
  87. package/core/forms/index.d.ts +2 -0
  88. package/core/highlight/_highlight-theme.scss +8 -0
  89. package/core/highlight/highlight.pipe.d.ts +8 -0
  90. package/core/highlight/index.d.ts +9 -0
  91. package/core/index.d.ts +1 -0
  92. package/core/label/label-options.d.ts +13 -0
  93. package/core/line/line.d.ts +28 -0
  94. package/core/locales/en-US.d.ts +11 -0
  95. package/core/locales/es-LA.d.ts +7 -0
  96. package/core/locales/fa-IR.d.ts +7 -0
  97. package/core/locales/index.d.ts +4 -0
  98. package/core/locales/locale-service.d.ts +63 -0
  99. package/core/locales/locale-service.module.d.ts +6 -0
  100. package/core/locales/pt-BR.d.ts +7 -0
  101. package/core/locales/ru-RU.d.ts +11 -0
  102. package/core/locales/zh-CN.d.ts +7 -0
  103. package/core/option/_optgroup-theme.scss +25 -0
  104. package/core/option/_option-action-theme.scss +41 -0
  105. package/core/option/_option-theme.scss +44 -0
  106. package/core/option/action.d.ts +44 -0
  107. package/core/option/action.scss +28 -0
  108. package/core/option/index.d.ts +4 -0
  109. package/core/option/optgroup.d.ts +16 -0
  110. package/core/option/optgroup.scss +16 -0
  111. package/core/option/option-module.d.ts +11 -0
  112. package/core/option/option.d.ts +116 -0
  113. package/core/option/option.scss +62 -0
  114. package/core/overlay/overlay-position-map.d.ts +34 -0
  115. package/core/pop-up/_pop-up.scss +129 -0
  116. package/core/pop-up/constants.d.ts +30 -0
  117. package/core/pop-up/index.d.ts +3 -0
  118. package/core/pop-up/pop-up-trigger.d.ts +71 -0
  119. package/core/pop-up/pop-up.d.ts +36 -0
  120. package/core/public-api.d.ts +21 -0
  121. package/core/select/constants.d.ts +23 -0
  122. package/core/select/errors.d.ts +19 -0
  123. package/core/select/events.d.ts +1 -0
  124. package/core/select/index.d.ts +3 -0
  125. package/core/selection/constants.d.ts +4 -0
  126. package/core/selection/index.d.ts +3 -0
  127. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +48 -0
  128. package/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts +32 -0
  129. package/core/selection/pseudo-checkbox/pseudo-checkbox.module.d.ts +8 -0
  130. package/core/selection/pseudo-checkbox/pseudo-checkbox.scss +77 -0
  131. package/core/services/measure-scrollbar.service.d.ts +11 -0
  132. package/core/styles/_core.scss +11 -0
  133. package/core/styles/_koobiq-theme.scss +153 -0
  134. package/core/styles/_tokens.kbq.import.scss +4 -0
  135. package/core/styles/_tokens.scss +6 -0
  136. package/core/styles/_variables.scss +9 -0
  137. package/core/styles/common/_animation.scss +35 -0
  138. package/core/styles/common/_button.scss +10 -0
  139. package/core/styles/common/_clearfix.scss +13 -0
  140. package/core/styles/common/_groups.scss +119 -0
  141. package/core/styles/common/_index.scss +13 -0
  142. package/core/styles/common/_input.scss +28 -0
  143. package/core/styles/common/_layout.scss +8 -0
  144. package/core/styles/common/_list.scss +46 -0
  145. package/core/styles/common/_overlay.scss +173 -0
  146. package/core/styles/common/_popup.scss +11 -0
  147. package/core/styles/common/_rtl.scss +33 -0
  148. package/core/styles/common/_size.scss +8 -0
  149. package/core/styles/common/_vendor-prefixes.scss +24 -0
  150. package/core/styles/common/_visually-hidden.scss +36 -0
  151. package/core/styles/functions/_index.scss +3 -0
  152. package/core/styles/functions/_number.scss +65 -0
  153. package/core/styles/functions/_string.scss +19 -0
  154. package/core/styles/functions/_timing.scss +30 -0
  155. package/core/styles/theming/_badges-theme.scss +118 -0
  156. package/core/styles/theming/_badges.scss +57 -0
  157. package/core/styles/theming/_components-theming.scss +1218 -0
  158. package/core/styles/theming/_index.scss +2 -0
  159. package/core/styles/theming/_scrollbars-theme.scss +77 -0
  160. package/core/styles/theming/_theming.scss +144 -0
  161. package/core/styles/theming/prebuilt/light-theme.scss +20 -0
  162. package/core/styles/typography/_index.scss +2 -0
  163. package/core/styles/typography/_typography-utils.scss +78 -0
  164. package/core/styles/typography/_typography.scss +191 -0
  165. package/core/styles/visual/_body.scss +35 -0
  166. package/core/styles/visual/_index.scss +3 -0
  167. package/core/styles/visual/_layout-media.scss +7 -0
  168. package/core/styles/visual/_layout.scss +527 -0
  169. package/core/title/index.d.ts +1 -0
  170. package/core/title/title-text-ref.d.ts +6 -0
  171. package/core/utils/data-size/config.d.ts +20 -0
  172. package/core/utils/data-size/data-size.pipe.d.ts +13 -0
  173. package/core/utils/data-size/index.d.ts +3 -0
  174. package/core/utils/data-size/size.d.ts +16 -0
  175. package/core/utils/index.d.ts +1 -0
  176. package/core/utils/public-api.d.ts +2 -0
  177. package/core/utils/utils.d.ts +2 -0
  178. package/core/validation/index.d.ts +1 -0
  179. package/core/validation/validation.d.ts +7 -0
  180. package/core/version.d.ts +2 -0
  181. package/datepicker/README.md +0 -0
  182. package/datepicker/_datepicker-theme.scss +101 -0
  183. package/datepicker/calendar-body.component.d.ts +55 -0
  184. package/datepicker/calendar-body.scss +61 -0
  185. package/datepicker/calendar-header.component.d.ts +45 -0
  186. package/datepicker/calendar-header.scss +75 -0
  187. package/datepicker/calendar.component.d.ts +81 -0
  188. package/datepicker/calendar.scss +68 -0
  189. package/datepicker/datepicker-animations.d.ts +9 -0
  190. package/datepicker/datepicker-content.scss +33 -0
  191. package/datepicker/datepicker-errors.d.ts +2 -0
  192. package/datepicker/datepicker-input.directive.d.ts +180 -0
  193. package/datepicker/datepicker-input.scss +15 -0
  194. package/datepicker/datepicker-intl.d.ts +32 -0
  195. package/datepicker/datepicker-module.d.ts +20 -0
  196. package/datepicker/datepicker-toggle.component.d.ts +35 -0
  197. package/datepicker/datepicker-toggle.scss +41 -0
  198. package/datepicker/datepicker.component.d.ts +148 -0
  199. package/datepicker/index.d.ts +1 -0
  200. package/datepicker/month-view.component.d.ts +74 -0
  201. package/datepicker/public-api.d.ts +10 -0
  202. package/divider/README.md +0 -0
  203. package/divider/_divider-theme.scss +10 -0
  204. package/divider/divider.component.d.ts +14 -0
  205. package/divider/divider.module.d.ts +8 -0
  206. package/divider/divider.scss +47 -0
  207. package/divider/index.d.ts +1 -0
  208. package/divider/public-api.d.ts +2 -0
  209. package/dl/README.md +0 -0
  210. package/dl/_dl-theme.scss +86 -0
  211. package/dl/dl.component.d.ts +27 -0
  212. package/dl/dl.module.d.ts +10 -0
  213. package/dl/dl.scss +99 -0
  214. package/dl/index.d.ts +1 -0
  215. package/dl/public-api.d.ts +2 -0
  216. package/dropdown/_dropdown-theme.scss +85 -0
  217. package/dropdown/dropdown-animations.d.ts +11 -0
  218. package/dropdown/dropdown-content.directive.d.ts +32 -0
  219. package/dropdown/dropdown-errors.d.ts +17 -0
  220. package/dropdown/dropdown-item.component.d.ts +52 -0
  221. package/dropdown/dropdown-item.scss +82 -0
  222. package/dropdown/dropdown-trigger.directive.d.ts +136 -0
  223. package/dropdown/dropdown.component.d.ts +121 -0
  224. package/dropdown/dropdown.module.d.ts +13 -0
  225. package/dropdown/dropdown.scss +79 -0
  226. package/dropdown/dropdown.types.d.ts +53 -0
  227. package/dropdown/index.d.ts +1 -0
  228. package/dropdown/public-api.d.ts +8 -0
  229. package/ellipsis-center/ellipsis-center.directive.d.ts +27 -0
  230. package/ellipsis-center/index.d.ts +1 -0
  231. package/ellipsis-center/public-api.d.ts +1 -0
  232. package/esm2022/alert/alert.component.mjs +67 -0
  233. package/esm2022/alert/alert.module.mjs +44 -0
  234. package/esm2022/alert/index.mjs +2 -0
  235. package/esm2022/alert/koobiq-components-alert.mjs +5 -0
  236. package/esm2022/alert/public-api.mjs +3 -0
  237. package/esm2022/autocomplete/autocomplete-origin.directive.mjs +21 -0
  238. package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +552 -0
  239. package/esm2022/autocomplete/autocomplete.component.mjs +153 -0
  240. package/esm2022/autocomplete/autocomplete.module.mjs +34 -0
  241. package/esm2022/autocomplete/index.mjs +2 -0
  242. package/esm2022/autocomplete/koobiq-components-autocomplete.mjs +5 -0
  243. package/esm2022/autocomplete/public-api.mjs +5 -0
  244. package/esm2022/button/button.component.mjs +164 -0
  245. package/esm2022/button/button.module.mjs +40 -0
  246. package/esm2022/button/index.mjs +2 -0
  247. package/esm2022/button/koobiq-components-button.mjs +5 -0
  248. package/esm2022/button/public-api.mjs +3 -0
  249. package/esm2022/button-toggle/button-toggle.component.mjs +381 -0
  250. package/esm2022/button-toggle/button-toggle.module.mjs +20 -0
  251. package/esm2022/button-toggle/index.mjs +2 -0
  252. package/esm2022/button-toggle/koobiq-components-button-toggle.mjs +5 -0
  253. package/esm2022/button-toggle/public-api.mjs +3 -0
  254. package/esm2022/card/card.component.mjs +80 -0
  255. package/esm2022/card/card.module.mjs +28 -0
  256. package/esm2022/card/index.mjs +2 -0
  257. package/esm2022/card/koobiq-components-card.mjs +5 -0
  258. package/esm2022/card/public-api.mjs +3 -0
  259. package/esm2022/checkbox/checkbox-config.mjs +6 -0
  260. package/esm2022/checkbox/checkbox-module.mjs +19 -0
  261. package/esm2022/checkbox/checkbox-required-validator.mjs +27 -0
  262. package/esm2022/checkbox/checkbox.mjs +304 -0
  263. package/esm2022/checkbox/index.mjs +2 -0
  264. package/esm2022/checkbox/koobiq-components-checkbox.mjs +5 -0
  265. package/esm2022/checkbox/public-api.mjs +5 -0
  266. package/esm2022/code-block/actionbar.component.mjs +67 -0
  267. package/esm2022/code-block/code-block.component.mjs +157 -0
  268. package/esm2022/code-block/code-block.module.mjs +60 -0
  269. package/esm2022/code-block/code-block.types.mjs +2 -0
  270. package/esm2022/code-block/index.mjs +2 -0
  271. package/esm2022/code-block/koobiq-components-code-block.mjs +5 -0
  272. package/esm2022/code-block/public-api.mjs +4 -0
  273. package/esm2022/core/animation/animation.mjs +8 -0
  274. package/esm2022/core/animation/fade-animations.mjs +9 -0
  275. package/esm2022/core/animation/index.mjs +4 -0
  276. package/esm2022/core/animation/select-animations.mjs +45 -0
  277. package/esm2022/core/common-behaviors/color.mjs +45 -0
  278. package/esm2022/core/common-behaviors/common-module.mjs +83 -0
  279. package/esm2022/core/common-behaviors/constructor.mjs +2 -0
  280. package/esm2022/core/common-behaviors/disabled.mjs +17 -0
  281. package/esm2022/core/common-behaviors/error-state.mjs +21 -0
  282. package/esm2022/core/common-behaviors/index.mjs +6 -0
  283. package/esm2022/core/common-behaviors/tabindex.mjs +18 -0
  284. package/esm2022/core/datetime/date-adapter.mjs +15 -0
  285. package/esm2022/core/datetime/date-formats.mjs +3 -0
  286. package/esm2022/core/datetime/index.mjs +3 -0
  287. package/esm2022/core/error/error-options.mjs +26 -0
  288. package/esm2022/core/form-field/form-field-ref.mjs +8 -0
  289. package/esm2022/core/form-field/index.mjs +2 -0
  290. package/esm2022/core/formatters/date/formatter.mjs +21 -0
  291. package/esm2022/core/formatters/date/formatter.pipe.mjs +220 -0
  292. package/esm2022/core/formatters/index.mjs +78 -0
  293. package/esm2022/core/formatters/number/formatter.mjs +129 -0
  294. package/esm2022/core/forms/forms-module.mjs +24 -0
  295. package/esm2022/core/forms/forms.directive.mjs +66 -0
  296. package/esm2022/core/forms/index.mjs +3 -0
  297. package/esm2022/core/highlight/highlight.pipe.mjs +23 -0
  298. package/esm2022/core/highlight/index.mjs +19 -0
  299. package/esm2022/core/index.mjs +2 -0
  300. package/esm2022/core/koobiq-components-core.mjs +5 -0
  301. package/esm2022/core/label/label-options.mjs +4 -0
  302. package/esm2022/core/line/line.mjs +70 -0
  303. package/esm2022/core/locales/en-US.mjs +10 -0
  304. package/esm2022/core/locales/es-LA.mjs +6 -0
  305. package/esm2022/core/locales/fa-IR.mjs +6 -0
  306. package/esm2022/core/locales/index.mjs +5 -0
  307. package/esm2022/core/locales/locale-service.mjs +70 -0
  308. package/esm2022/core/locales/locale-service.module.mjs +19 -0
  309. package/esm2022/core/locales/pt-BR.mjs +6 -0
  310. package/esm2022/core/locales/ru-RU.mjs +10 -0
  311. package/esm2022/core/locales/zh-CN.mjs +6 -0
  312. package/esm2022/core/option/action.mjs +122 -0
  313. package/esm2022/core/option/index.mjs +5 -0
  314. package/esm2022/core/option/optgroup.mjs +31 -0
  315. package/esm2022/core/option/option-module.mjs +21 -0
  316. package/esm2022/core/option/option.mjs +262 -0
  317. package/esm2022/core/overlay/overlay-position-map.mjs +244 -0
  318. package/esm2022/core/pop-up/constants.mjs +36 -0
  319. package/esm2022/core/pop-up/index.mjs +4 -0
  320. package/esm2022/core/pop-up/pop-up-trigger.mjs +247 -0
  321. package/esm2022/core/pop-up/pop-up.mjs +94 -0
  322. package/esm2022/core/public-api.mjs +22 -0
  323. package/esm2022/core/select/constants.mjs +27 -0
  324. package/esm2022/core/select/errors.mjs +26 -0
  325. package/esm2022/core/select/events.mjs +2 -0
  326. package/esm2022/core/select/index.mjs +4 -0
  327. package/esm2022/core/selection/constants.mjs +6 -0
  328. package/esm2022/core/selection/index.mjs +4 -0
  329. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +52 -0
  330. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.module.mjs +18 -0
  331. package/esm2022/core/services/measure-scrollbar.service.mjs +48 -0
  332. package/esm2022/core/title/index.mjs +2 -0
  333. package/esm2022/core/title/title-text-ref.mjs +3 -0
  334. package/esm2022/core/utils/data-size/config.mjs +22 -0
  335. package/esm2022/core/utils/data-size/data-size.pipe.mjs +32 -0
  336. package/esm2022/core/utils/data-size/index.mjs +4 -0
  337. package/esm2022/core/utils/data-size/size.mjs +50 -0
  338. package/esm2022/core/utils/index.mjs +2 -0
  339. package/esm2022/core/utils/public-api.mjs +3 -0
  340. package/esm2022/core/utils/utils.mjs +5 -0
  341. package/esm2022/core/validation/index.mjs +2 -0
  342. package/esm2022/core/validation/validation.mjs +5 -0
  343. package/esm2022/core/version.mjs +3 -0
  344. package/esm2022/datepicker/calendar-body.component.mjs +87 -0
  345. package/esm2022/datepicker/calendar-header.component.mjs +134 -0
  346. package/esm2022/datepicker/calendar.component.mjs +175 -0
  347. package/esm2022/datepicker/datepicker-animations.mjs +32 -0
  348. package/esm2022/datepicker/datepicker-errors.mjs +6 -0
  349. package/esm2022/datepicker/datepicker-input.directive.mjs +954 -0
  350. package/esm2022/datepicker/datepicker-intl.mjs +40 -0
  351. package/esm2022/datepicker/datepicker-module.mjs +97 -0
  352. package/esm2022/datepicker/datepicker-toggle.component.mjs +86 -0
  353. package/esm2022/datepicker/datepicker.component.mjs +393 -0
  354. package/esm2022/datepicker/index.mjs +2 -0
  355. package/esm2022/datepicker/koobiq-components-datepicker.mjs +5 -0
  356. package/esm2022/datepicker/month-view.component.mjs +158 -0
  357. package/esm2022/datepicker/public-api.mjs +11 -0
  358. package/esm2022/divider/divider.component.mjs +49 -0
  359. package/esm2022/divider/divider.module.mjs +18 -0
  360. package/esm2022/divider/index.mjs +2 -0
  361. package/esm2022/divider/koobiq-components-divider.mjs +5 -0
  362. package/esm2022/divider/public-api.mjs +3 -0
  363. package/esm2022/dl/dl.component.mjs +82 -0
  364. package/esm2022/dl/dl.module.mjs +40 -0
  365. package/esm2022/dl/index.mjs +2 -0
  366. package/esm2022/dl/koobiq-components-dl.mjs +5 -0
  367. package/esm2022/dl/public-api.mjs +3 -0
  368. package/esm2022/dropdown/dropdown-animations.mjs +41 -0
  369. package/esm2022/dropdown/dropdown-content.directive.mjs +64 -0
  370. package/esm2022/dropdown/dropdown-errors.mjs +29 -0
  371. package/esm2022/dropdown/dropdown-item.component.mjs +146 -0
  372. package/esm2022/dropdown/dropdown-trigger.directive.mjs +489 -0
  373. package/esm2022/dropdown/dropdown.component.mjs +292 -0
  374. package/esm2022/dropdown/dropdown.module.mjs +48 -0
  375. package/esm2022/dropdown/dropdown.types.mjs +24 -0
  376. package/esm2022/dropdown/index.mjs +2 -0
  377. package/esm2022/dropdown/koobiq-components-dropdown.mjs +5 -0
  378. package/esm2022/dropdown/public-api.mjs +9 -0
  379. package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +106 -0
  380. package/esm2022/ellipsis-center/index.mjs +2 -0
  381. package/esm2022/ellipsis-center/koobiq-components-ellipsis-center.mjs +5 -0
  382. package/esm2022/ellipsis-center/public-api.mjs +2 -0
  383. package/esm2022/file-upload/file-drop.mjs +43 -0
  384. package/esm2022/file-upload/file-upload.mjs +4 -0
  385. package/esm2022/file-upload/file-upload.module.mjs +66 -0
  386. package/esm2022/file-upload/index.mjs +2 -0
  387. package/esm2022/file-upload/koobiq-components-file-upload.mjs +5 -0
  388. package/esm2022/file-upload/multiple-file-upload.component.mjs +161 -0
  389. package/esm2022/file-upload/public-api.mjs +6 -0
  390. package/esm2022/file-upload/single-file-upload.component.mjs +130 -0
  391. package/esm2022/form-field/cleaner.mjs +14 -0
  392. package/esm2022/form-field/form-field-control.mjs +5 -0
  393. package/esm2022/form-field/form-field-errors.mjs +7 -0
  394. package/esm2022/form-field/form-field.mjs +276 -0
  395. package/esm2022/form-field/form-field.module.mjs +71 -0
  396. package/esm2022/form-field/hint.mjs +34 -0
  397. package/esm2022/form-field/index.mjs +2 -0
  398. package/esm2022/form-field/koobiq-components-form-field.mjs +5 -0
  399. package/esm2022/form-field/password-hint.mjs +144 -0
  400. package/esm2022/form-field/password-toggle.mjs +64 -0
  401. package/esm2022/form-field/prefix.mjs +13 -0
  402. package/esm2022/form-field/public-api.mjs +13 -0
  403. package/esm2022/form-field/stepper.mjs +71 -0
  404. package/esm2022/form-field/suffix.mjs +13 -0
  405. package/esm2022/form-field/validate.directive.mjs +158 -0
  406. package/esm2022/icon/icon.component.mjs +145 -0
  407. package/esm2022/icon/icon.module.mjs +40 -0
  408. package/esm2022/icon/index.mjs +2 -0
  409. package/esm2022/icon/koobiq-components-icon.mjs +5 -0
  410. package/esm2022/icon/public-api.mjs +3 -0
  411. package/esm2022/index.mjs +2 -0
  412. package/esm2022/input/index.mjs +2 -0
  413. package/esm2022/input/input-errors.mjs +4 -0
  414. package/esm2022/input/input-number-validators.mjs +88 -0
  415. package/esm2022/input/input-number.mjs +168 -0
  416. package/esm2022/input/input-password.mjs +233 -0
  417. package/esm2022/input/input-value-accessor.mjs +3 -0
  418. package/esm2022/input/input.mjs +297 -0
  419. package/esm2022/input/input.module.mjs +63 -0
  420. package/esm2022/input/koobiq-components-input.mjs +5 -0
  421. package/esm2022/input/public-api.mjs +7 -0
  422. package/esm2022/koobiq-components.mjs +5 -0
  423. package/esm2022/link/index.mjs +2 -0
  424. package/esm2022/link/koobiq-components-link.mjs +5 -0
  425. package/esm2022/link/link.component.mjs +132 -0
  426. package/esm2022/link/link.module.mjs +24 -0
  427. package/esm2022/link/public-api.mjs +3 -0
  428. package/esm2022/list/index.mjs +2 -0
  429. package/esm2022/list/koobiq-components-list.mjs +5 -0
  430. package/esm2022/list/list-selection.component.mjs +705 -0
  431. package/esm2022/list/list.component.mjs +44 -0
  432. package/esm2022/list/list.module.mjs +53 -0
  433. package/esm2022/list/public-api.mjs +4 -0
  434. package/esm2022/loader-overlay/index.mjs +2 -0
  435. package/esm2022/loader-overlay/koobiq-components-loader-overlay.mjs +5 -0
  436. package/esm2022/loader-overlay/loader-overlay.component.mjs +103 -0
  437. package/esm2022/loader-overlay/loader-overlay.module.mjs +48 -0
  438. package/esm2022/loader-overlay/public-api.mjs +3 -0
  439. package/esm2022/markdown/index.mjs +2 -0
  440. package/esm2022/markdown/koobiq-components-markdown.mjs +5 -0
  441. package/esm2022/markdown/markdown.component.mjs +53 -0
  442. package/esm2022/markdown/markdown.module.mjs +23 -0
  443. package/esm2022/markdown/markdown.service.mjs +25 -0
  444. package/esm2022/markdown/markdown.values.mjs +29 -0
  445. package/esm2022/markdown/public-api.mjs +5 -0
  446. package/esm2022/modal/css-unit.pipe.mjs +17 -0
  447. package/esm2022/modal/index.mjs +2 -0
  448. package/esm2022/modal/koobiq-components-modal.mjs +5 -0
  449. package/esm2022/modal/modal-control.service.mjs +85 -0
  450. package/esm2022/modal/modal-ref.class.mjs +8 -0
  451. package/esm2022/modal/modal-util.mjs +17 -0
  452. package/esm2022/modal/modal.component.mjs +509 -0
  453. package/esm2022/modal/modal.directive.mjs +52 -0
  454. package/esm2022/modal/modal.module.mjs +69 -0
  455. package/esm2022/modal/modal.service.mjs +124 -0
  456. package/esm2022/modal/modal.type.mjs +9 -0
  457. package/esm2022/modal/public-api.mjs +7 -0
  458. package/esm2022/navbar/index.mjs +2 -0
  459. package/esm2022/navbar/koobiq-components-navbar.mjs +5 -0
  460. package/esm2022/navbar/navbar-item.component.mjs +605 -0
  461. package/esm2022/navbar/navbar.component.mjs +239 -0
  462. package/esm2022/navbar/navbar.module.mjs +90 -0
  463. package/esm2022/navbar/public-api.mjs +5 -0
  464. package/esm2022/navbar/vertical-navbar.animation.mjs +10 -0
  465. package/esm2022/navbar/vertical-navbar.component.mjs +114 -0
  466. package/esm2022/popover/index.mjs +2 -0
  467. package/esm2022/popover/koobiq-components-popover.mjs +5 -0
  468. package/esm2022/popover/popover-animations.mjs +16 -0
  469. package/esm2022/popover/popover-confirm.component.mjs +108 -0
  470. package/esm2022/popover/popover.component.mjs +266 -0
  471. package/esm2022/popover/popover.module.mjs +29 -0
  472. package/esm2022/popover/public-api.mjs +5 -0
  473. package/esm2022/progress-bar/index.mjs +2 -0
  474. package/esm2022/progress-bar/koobiq-components-progress-bar.mjs +5 -0
  475. package/esm2022/progress-bar/progress-bar.component.mjs +70 -0
  476. package/esm2022/progress-bar/progress-bar.module.mjs +36 -0
  477. package/esm2022/progress-bar/public-api.mjs +3 -0
  478. package/esm2022/progress-spinner/index.mjs +2 -0
  479. package/esm2022/progress-spinner/koobiq-components-progress-spinner.mjs +5 -0
  480. package/esm2022/progress-spinner/progress-spinner.component.mjs +85 -0
  481. package/esm2022/progress-spinner/progress-spinner.module.mjs +36 -0
  482. package/esm2022/progress-spinner/public-api.mjs +3 -0
  483. package/esm2022/public-api.mjs +2 -0
  484. package/esm2022/radio/index.mjs +2 -0
  485. package/esm2022/radio/koobiq-components-radio.mjs +5 -0
  486. package/esm2022/radio/public-api.mjs +3 -0
  487. package/esm2022/radio/radio.component.mjs +460 -0
  488. package/esm2022/radio/radio.module.mjs +20 -0
  489. package/esm2022/select/index.mjs +2 -0
  490. package/esm2022/select/koobiq-components-select.mjs +5 -0
  491. package/esm2022/select/public-api.mjs +4 -0
  492. package/esm2022/select/select-option.directive.mjs +65 -0
  493. package/esm2022/select/select.component.mjs +1146 -0
  494. package/esm2022/select/select.module.mjs +79 -0
  495. package/esm2022/sidebar/index.mjs +2 -0
  496. package/esm2022/sidebar/koobiq-components-sidebar.mjs +5 -0
  497. package/esm2022/sidebar/public-api.mjs +3 -0
  498. package/esm2022/sidebar/sidebar-animations.mjs +23 -0
  499. package/esm2022/sidebar/sidebar.component.mjs +146 -0
  500. package/esm2022/sidebar/sidebar.module.mjs +30 -0
  501. package/esm2022/sidepanel/index.mjs +2 -0
  502. package/esm2022/sidepanel/koobiq-components-sidepanel.mjs +5 -0
  503. package/esm2022/sidepanel/public-api.mjs +7 -0
  504. package/esm2022/sidepanel/sidepanel-animations.mjs +26 -0
  505. package/esm2022/sidepanel/sidepanel-config.mjs +33 -0
  506. package/esm2022/sidepanel/sidepanel-container.component.mjs +110 -0
  507. package/esm2022/sidepanel/sidepanel-directives.mjs +167 -0
  508. package/esm2022/sidepanel/sidepanel-ref.mjs +53 -0
  509. package/esm2022/sidepanel/sidepanel.module.mjs +75 -0
  510. package/esm2022/sidepanel/sidepanel.service.mjs +171 -0
  511. package/esm2022/splitter/index.mjs +2 -0
  512. package/esm2022/splitter/koobiq-components-splitter.mjs +5 -0
  513. package/esm2022/splitter/public-api.mjs +3 -0
  514. package/esm2022/splitter/splitter.component.mjs +482 -0
  515. package/esm2022/splitter/splitter.module.mjs +38 -0
  516. package/esm2022/table/index.mjs +2 -0
  517. package/esm2022/table/koobiq-components-table.mjs +5 -0
  518. package/esm2022/table/public-api.mjs +3 -0
  519. package/esm2022/table/table.component.mjs +13 -0
  520. package/esm2022/table/table.module.mjs +28 -0
  521. package/esm2022/tabs/index.mjs +2 -0
  522. package/esm2022/tabs/koobiq-components-tabs.mjs +5 -0
  523. package/esm2022/tabs/paginated-tab-header.mjs +479 -0
  524. package/esm2022/tabs/public-api.mjs +11 -0
  525. package/esm2022/tabs/tab-body.component.mjs +179 -0
  526. package/esm2022/tabs/tab-content.directive.mjs +15 -0
  527. package/esm2022/tabs/tab-group.component.mjs +349 -0
  528. package/esm2022/tabs/tab-header.component.mjs +67 -0
  529. package/esm2022/tabs/tab-label-wrapper.directive.mjs +78 -0
  530. package/esm2022/tabs/tab-label.directive.mjs +17 -0
  531. package/esm2022/tabs/tab-nav-bar/index.mjs +2 -0
  532. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +111 -0
  533. package/esm2022/tabs/tab.component.mjs +134 -0
  534. package/esm2022/tabs/tabs-animations.mjs +24 -0
  535. package/esm2022/tabs/tabs.module.mjs +106 -0
  536. package/esm2022/tags/index.mjs +2 -0
  537. package/esm2022/tags/koobiq-components-tags.mjs +5 -0
  538. package/esm2022/tags/public-api.mjs +6 -0
  539. package/esm2022/tags/tag-default-options.mjs +4 -0
  540. package/esm2022/tags/tag-input.mjs +248 -0
  541. package/esm2022/tags/tag-list.component.mjs +714 -0
  542. package/esm2022/tags/tag-text-control.mjs +2 -0
  543. package/esm2022/tags/tag.component.mjs +381 -0
  544. package/esm2022/tags/tag.module.mjs +56 -0
  545. package/esm2022/textarea/index.mjs +2 -0
  546. package/esm2022/textarea/koobiq-components-textarea.mjs +5 -0
  547. package/esm2022/textarea/public-api.mjs +3 -0
  548. package/esm2022/textarea/textarea.component.mjs +254 -0
  549. package/esm2022/textarea/textarea.module.mjs +21 -0
  550. package/esm2022/timepicker/index.mjs +2 -0
  551. package/esm2022/timepicker/koobiq-components-timepicker.mjs +5 -0
  552. package/esm2022/timepicker/public-api.mjs +4 -0
  553. package/esm2022/timepicker/timepicker.constants.mjs +25 -0
  554. package/esm2022/timepicker/timepicker.directive.mjs +647 -0
  555. package/esm2022/timepicker/timepicker.module.mjs +32 -0
  556. package/esm2022/timezone/cities-by-filter.pipe.mjs +17 -0
  557. package/esm2022/timezone/index.mjs +2 -0
  558. package/esm2022/timezone/koobiq-components-timezone.mjs +5 -0
  559. package/esm2022/timezone/public-api.mjs +7 -0
  560. package/esm2022/timezone/timezone-option.component.mjs +48 -0
  561. package/esm2022/timezone/timezone-option.directive.mjs +60 -0
  562. package/esm2022/timezone/timezone-select.component.mjs +40 -0
  563. package/esm2022/timezone/timezone.models.mjs +3 -0
  564. package/esm2022/timezone/timezone.module.mjs +75 -0
  565. package/esm2022/timezone/timezone.utils.mjs +79 -0
  566. package/esm2022/timezone/utc-offset.pipe.mjs +17 -0
  567. package/esm2022/title/index.mjs +2 -0
  568. package/esm2022/title/koobiq-components-title.mjs +5 -0
  569. package/esm2022/title/public-api.mjs +3 -0
  570. package/esm2022/title/title.directive.mjs +107 -0
  571. package/esm2022/title/title.module.mjs +18 -0
  572. package/esm2022/toast/index.mjs +2 -0
  573. package/esm2022/toast/koobiq-components-toast.mjs +5 -0
  574. package/esm2022/toast/public-api.mjs +6 -0
  575. package/esm2022/toast/toast-animations.mjs +9 -0
  576. package/esm2022/toast/toast-container.component.mjs +44 -0
  577. package/esm2022/toast/toast.component.mjs +92 -0
  578. package/esm2022/toast/toast.module.mjs +42 -0
  579. package/esm2022/toast/toast.service.mjs +188 -0
  580. package/esm2022/toast/toast.type.mjs +15 -0
  581. package/esm2022/toggle/index.mjs +2 -0
  582. package/esm2022/toggle/koobiq-components-toggle.mjs +5 -0
  583. package/esm2022/toggle/public-api.mjs +3 -0
  584. package/esm2022/toggle/toggle.component.mjs +160 -0
  585. package/esm2022/toggle/toggle.module.mjs +20 -0
  586. package/esm2022/tooltip/index.mjs +2 -0
  587. package/esm2022/tooltip/koobiq-components-tooltip.mjs +5 -0
  588. package/esm2022/tooltip/public-api.mjs +3 -0
  589. package/esm2022/tooltip/tooltip.animations.mjs +19 -0
  590. package/esm2022/tooltip/tooltip.component.mjs +308 -0
  591. package/esm2022/tooltip/tooltip.module.mjs +42 -0
  592. package/esm2022/tree/control/base-tree-control.mjs +60 -0
  593. package/esm2022/tree/control/flat-tree-control.mjs +130 -0
  594. package/esm2022/tree/control/nested-tree-control.mjs +41 -0
  595. package/esm2022/tree/control/tree-control.mjs +2 -0
  596. package/esm2022/tree/data-source/flat-data-source.mjs +162 -0
  597. package/esm2022/tree/data-source/nested-data-source.mjs +30 -0
  598. package/esm2022/tree/index.mjs +2 -0
  599. package/esm2022/tree/koobiq-components-tree.mjs +5 -0
  600. package/esm2022/tree/node.mjs +31 -0
  601. package/esm2022/tree/outlet.mjs +15 -0
  602. package/esm2022/tree/padding.directive.mjs +113 -0
  603. package/esm2022/tree/public-api.mjs +16 -0
  604. package/esm2022/tree/toggle.mjs +81 -0
  605. package/esm2022/tree/tree-base.mjs +243 -0
  606. package/esm2022/tree/tree-errors.mjs +36 -0
  607. package/esm2022/tree/tree-option.component.mjs +299 -0
  608. package/esm2022/tree/tree-selection.component.mjs +557 -0
  609. package/esm2022/tree/tree.mjs +15 -0
  610. package/esm2022/tree/tree.module.mjs +57 -0
  611. package/esm2022/tree-select/index.mjs +2 -0
  612. package/esm2022/tree-select/koobiq-components-tree-select.mjs +5 -0
  613. package/esm2022/tree-select/public-api.mjs +3 -0
  614. package/esm2022/tree-select/tree-select.component.mjs +936 -0
  615. package/esm2022/tree-select/tree-select.module.mjs +45 -0
  616. package/fesm2022/koobiq-components-alert.mjs +115 -0
  617. package/fesm2022/koobiq-components-alert.mjs.map +1 -0
  618. package/fesm2022/koobiq-components-autocomplete.mjs +748 -0
  619. package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -0
  620. package/fesm2022/koobiq-components-button-toggle.mjs +403 -0
  621. package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -0
  622. package/fesm2022/koobiq-components-button.mjs +207 -0
  623. package/fesm2022/koobiq-components-button.mjs.map +1 -0
  624. package/fesm2022/koobiq-components-card.mjs +111 -0
  625. package/fesm2022/koobiq-components-card.mjs.map +1 -0
  626. package/fesm2022/koobiq-components-checkbox.mjs +353 -0
  627. package/fesm2022/koobiq-components-checkbox.mjs.map +1 -0
  628. package/fesm2022/koobiq-components-code-block.mjs +278 -0
  629. package/fesm2022/koobiq-components-code-block.mjs.map +1 -0
  630. package/fesm2022/koobiq-components-core.mjs +2338 -0
  631. package/fesm2022/koobiq-components-core.mjs.map +1 -0
  632. package/fesm2022/koobiq-components-datepicker.mjs +2101 -0
  633. package/fesm2022/koobiq-components-datepicker.mjs.map +1 -0
  634. package/fesm2022/koobiq-components-divider.mjs +71 -0
  635. package/fesm2022/koobiq-components-divider.mjs.map +1 -0
  636. package/fesm2022/koobiq-components-dl.mjs +126 -0
  637. package/fesm2022/koobiq-components-dl.mjs.map +1 -0
  638. package/fesm2022/koobiq-components-dropdown.mjs +1102 -0
  639. package/fesm2022/koobiq-components-dropdown.mjs.map +1 -0
  640. package/fesm2022/koobiq-components-ellipsis-center.mjs +111 -0
  641. package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -0
  642. package/fesm2022/koobiq-components-file-upload.mjs +388 -0
  643. package/fesm2022/koobiq-components-file-upload.mjs.map +1 -0
  644. package/fesm2022/koobiq-components-form-field.mjs +825 -0
  645. package/fesm2022/koobiq-components-form-field.mjs.map +1 -0
  646. package/fesm2022/koobiq-components-icon.mjs +188 -0
  647. package/fesm2022/koobiq-components-icon.mjs.map +1 -0
  648. package/fesm2022/koobiq-components-input.mjs +831 -0
  649. package/fesm2022/koobiq-components-input.mjs.map +1 -0
  650. package/fesm2022/koobiq-components-link.mjs +159 -0
  651. package/fesm2022/koobiq-components-link.mjs.map +1 -0
  652. package/fesm2022/koobiq-components-list.mjs +800 -0
  653. package/fesm2022/koobiq-components-list.mjs.map +1 -0
  654. package/fesm2022/koobiq-components-loader-overlay.mjs +155 -0
  655. package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -0
  656. package/fesm2022/koobiq-components-markdown.mjs +127 -0
  657. package/fesm2022/koobiq-components-markdown.mjs.map +1 -0
  658. package/fesm2022/koobiq-components-modal.mjs +868 -0
  659. package/fesm2022/koobiq-components-modal.mjs.map +1 -0
  660. package/fesm2022/koobiq-components-navbar.mjs +1037 -0
  661. package/fesm2022/koobiq-components-navbar.mjs.map +1 -0
  662. package/fesm2022/koobiq-components-popover.mjs +407 -0
  663. package/fesm2022/koobiq-components-popover.mjs.map +1 -0
  664. package/fesm2022/koobiq-components-progress-bar.mjs +110 -0
  665. package/fesm2022/koobiq-components-progress-bar.mjs.map +1 -0
  666. package/fesm2022/koobiq-components-progress-spinner.mjs +125 -0
  667. package/fesm2022/koobiq-components-progress-spinner.mjs.map +1 -0
  668. package/fesm2022/koobiq-components-radio.mjs +481 -0
  669. package/fesm2022/koobiq-components-radio.mjs.map +1 -0
  670. package/fesm2022/koobiq-components-select.mjs +1278 -0
  671. package/fesm2022/koobiq-components-select.mjs.map +1 -0
  672. package/fesm2022/koobiq-components-sidebar.mjs +202 -0
  673. package/fesm2022/koobiq-components-sidebar.mjs.map +1 -0
  674. package/fesm2022/koobiq-components-sidepanel.mjs +613 -0
  675. package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -0
  676. package/fesm2022/koobiq-components-splitter.mjs +524 -0
  677. package/fesm2022/koobiq-components-splitter.mjs.map +1 -0
  678. package/fesm2022/koobiq-components-table.mjs +45 -0
  679. package/fesm2022/koobiq-components-table.mjs.map +1 -0
  680. package/fesm2022/koobiq-components-tabs.mjs +1499 -0
  681. package/fesm2022/koobiq-components-tabs.mjs.map +1 -0
  682. package/fesm2022/koobiq-components-tags.mjs +1383 -0
  683. package/fesm2022/koobiq-components-tags.mjs.map +1 -0
  684. package/fesm2022/koobiq-components-textarea.mjs +277 -0
  685. package/fesm2022/koobiq-components-textarea.mjs.map +1 -0
  686. package/fesm2022/koobiq-components-timepicker.mjs +706 -0
  687. package/fesm2022/koobiq-components-timepicker.mjs.map +1 -0
  688. package/fesm2022/koobiq-components-timezone.mjs +314 -0
  689. package/fesm2022/koobiq-components-timezone.mjs.map +1 -0
  690. package/fesm2022/koobiq-components-title.mjs +125 -0
  691. package/fesm2022/koobiq-components-title.mjs.map +1 -0
  692. package/fesm2022/koobiq-components-toast.mjs +375 -0
  693. package/fesm2022/koobiq-components-toast.mjs.map +1 -0
  694. package/fesm2022/koobiq-components-toggle.mjs +182 -0
  695. package/fesm2022/koobiq-components-toggle.mjs.map +1 -0
  696. package/fesm2022/koobiq-components-tooltip.mjs +370 -0
  697. package/fesm2022/koobiq-components-tooltip.mjs.map +1 -0
  698. package/fesm2022/koobiq-components-tree-select.mjs +978 -0
  699. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -0
  700. package/fesm2022/koobiq-components-tree.mjs +1802 -0
  701. package/fesm2022/koobiq-components-tree.mjs.map +1 -0
  702. package/fesm2022/koobiq-components.mjs +4 -0
  703. package/fesm2022/koobiq-components.mjs.map +1 -0
  704. package/file-upload/README.md +0 -0
  705. package/file-upload/_file-upload-theme.scss +174 -0
  706. package/file-upload/file-drop.d.ts +11 -0
  707. package/file-upload/file-upload.d.ts +22 -0
  708. package/file-upload/file-upload.module.d.ts +18 -0
  709. package/file-upload/file-upload.scss +46 -0
  710. package/file-upload/index.d.ts +1 -0
  711. package/file-upload/multiple-file-upload.component.d.ts +51 -0
  712. package/file-upload/multiple-file-upload.component.scss +148 -0
  713. package/file-upload/public-api.d.ts +5 -0
  714. package/file-upload/single-file-upload.component.d.ts +34 -0
  715. package/file-upload/single-file-upload.component.scss +60 -0
  716. package/form-field/README.md +0 -0
  717. package/form-field/_form-field-theme.scss +112 -0
  718. package/form-field/_hint-theme.scss +67 -0
  719. package/form-field/cleaner.d.ts +5 -0
  720. package/form-field/cleaner.scss +22 -0
  721. package/form-field/form-field-control.d.ts +37 -0
  722. package/form-field/form-field-errors.d.ts +2 -0
  723. package/form-field/form-field.d.ts +84 -0
  724. package/form-field/form-field.module.d.ts +17 -0
  725. package/form-field/form-field.scss +143 -0
  726. package/form-field/hint.d.ts +17 -0
  727. package/form-field/hint.scss +15 -0
  728. package/form-field/index.d.ts +1 -0
  729. package/form-field/password-hint.d.ts +40 -0
  730. package/form-field/password-hint.scss +11 -0
  731. package/form-field/password-toggle.d.ts +18 -0
  732. package/form-field/password-toggle.scss +29 -0
  733. package/form-field/prefix.d.ts +5 -0
  734. package/form-field/public-api.d.ts +12 -0
  735. package/form-field/stepper.d.ts +11 -0
  736. package/form-field/stepper.scss +33 -0
  737. package/form-field/suffix.d.ts +5 -0
  738. package/form-field/validate.directive.d.ts +33 -0
  739. package/icon/README.md +0 -0
  740. package/icon/_icon-theme.scss +267 -0
  741. package/icon/icon.component.d.ts +47 -0
  742. package/icon/icon.module.d.ts +10 -0
  743. package/icon/icon.scss +73 -0
  744. package/icon/index.d.ts +1 -0
  745. package/icon/public-api.d.ts +2 -0
  746. package/index.d.ts +1 -0
  747. package/input/_input-theme.scss +13 -0
  748. package/input/index.d.ts +1 -0
  749. package/input/input-errors.d.ts +1 -0
  750. package/input/input-number-validators.d.ts +35 -0
  751. package/input/input-number.d.ts +33 -0
  752. package/input/input-password.d.ts +92 -0
  753. package/input/input-value-accessor.d.ts +4 -0
  754. package/input/input.d.ts +117 -0
  755. package/input/input.module.d.ts +15 -0
  756. package/input/input.scss +48 -0
  757. package/input/public-api.d.ts +6 -0
  758. package/link/README.md +0 -0
  759. package/link/_link-theme.scss +178 -0
  760. package/link/index.d.ts +1 -0
  761. package/link/link.component.d.ts +47 -0
  762. package/link/link.module.d.ts +9 -0
  763. package/link/public-api.d.ts +2 -0
  764. package/list/README.md +0 -0
  765. package/list/_list-base.scss +54 -0
  766. package/list/_list-theme.scss +47 -0
  767. package/list/index.d.ts +1 -0
  768. package/list/list-selection.component.d.ts +172 -0
  769. package/list/list.component.d.ts +18 -0
  770. package/list/list.module.d.ts +11 -0
  771. package/list/list.scss +52 -0
  772. package/list/public-api.d.ts +3 -0
  773. package/loader-overlay/README.md +0 -0
  774. package/loader-overlay/_loader-overlay-theme.scss +34 -0
  775. package/loader-overlay/index.d.ts +1 -0
  776. package/loader-overlay/loader-overlay.component.d.ts +34 -0
  777. package/loader-overlay/loader-overlay.module.d.ts +11 -0
  778. package/loader-overlay/loader-overlay.scss +64 -0
  779. package/loader-overlay/public-api.d.ts +2 -0
  780. package/markdown/README.md +0 -0
  781. package/markdown/_markdown-theme.scss +142 -0
  782. package/markdown/index.d.ts +1 -0
  783. package/markdown/markdown.component.d.ts +19 -0
  784. package/markdown/markdown.module.d.ts +11 -0
  785. package/markdown/markdown.scss +249 -0
  786. package/markdown/markdown.service.d.ts +7 -0
  787. package/markdown/markdown.values.d.ts +3 -0
  788. package/markdown/public-api.d.ts +4 -0
  789. package/modal/README.md +34 -0
  790. package/modal/_modal-animation.scss +114 -0
  791. package/modal/_modal-confirm.scss +53 -0
  792. package/modal/_modal-theme.scss +90 -0
  793. package/modal/css-unit.pipe.d.ts +7 -0
  794. package/modal/index.d.ts +1 -0
  795. package/modal/modal-control.service.d.ts +20 -0
  796. package/modal/modal-ref.class.d.ts +36 -0
  797. package/modal/modal-util.d.ts +12 -0
  798. package/modal/modal.component.d.ts +128 -0
  799. package/modal/modal.directive.d.ts +17 -0
  800. package/modal/modal.module.d.ts +14 -0
  801. package/modal/modal.scss +143 -0
  802. package/modal/modal.service.d.ts +33 -0
  803. package/modal/modal.type.d.ts +61 -0
  804. package/modal/public-api.d.ts +6 -0
  805. package/navbar/README.md +41 -0
  806. package/navbar/_navbar-theme.scss +123 -0
  807. package/navbar/index.d.ts +1 -0
  808. package/navbar/navbar-brand.scss +70 -0
  809. package/navbar/navbar-divider.scss +18 -0
  810. package/navbar/navbar-item.component.d.ts +167 -0
  811. package/navbar/navbar-item.scss +159 -0
  812. package/navbar/navbar.component.d.ts +58 -0
  813. package/navbar/navbar.module.d.ts +14 -0
  814. package/navbar/navbar.scss +20 -0
  815. package/navbar/public-api.d.ts +4 -0
  816. package/navbar/vertical-navbar.animation.d.ts +2 -0
  817. package/navbar/vertical-navbar.component.d.ts +23 -0
  818. package/navbar/vertical-navbar.scss +46 -0
  819. package/package.json +323 -0
  820. package/popover/README.md +32 -0
  821. package/popover/_popover-theme.scss +111 -0
  822. package/popover/index.d.ts +1 -0
  823. package/popover/popover-animations.d.ts +4 -0
  824. package/popover/popover-confirm.component.d.ts +33 -0
  825. package/popover/popover.component.d.ts +75 -0
  826. package/popover/popover.module.d.ts +12 -0
  827. package/popover/popover.scss +114 -0
  828. package/popover/public-api.d.ts +4 -0
  829. package/prebuilt-themes/dark-theme.css +1 -0
  830. package/prebuilt-themes/light-theme.css +1 -0
  831. package/progress-bar/README.md +0 -0
  832. package/progress-bar/_progress-bar-theme.scss +41 -0
  833. package/progress-bar/index.d.ts +1 -0
  834. package/progress-bar/progress-bar.component.d.ts +28 -0
  835. package/progress-bar/progress-bar.module.d.ts +9 -0
  836. package/progress-bar/progress-bar.scss +68 -0
  837. package/progress-bar/public-api.d.ts +2 -0
  838. package/progress-spinner/README.md +0 -0
  839. package/progress-spinner/_progress-spinner-theme.scss +35 -0
  840. package/progress-spinner/index.d.ts +1 -0
  841. package/progress-spinner/progress-spinner.component.d.ts +34 -0
  842. package/progress-spinner/progress-spinner.module.d.ts +9 -0
  843. package/progress-spinner/progress-spinner.scss +72 -0
  844. package/progress-spinner/public-api.d.ts +2 -0
  845. package/public-api.d.ts +1 -0
  846. package/radio/_radio-theme.scss +95 -0
  847. package/radio/index.d.ts +1 -0
  848. package/radio/public-api.d.ts +2 -0
  849. package/radio/radio.component.d.ts +204 -0
  850. package/radio/radio.module.d.ts +10 -0
  851. package/radio/radio.scss +143 -0
  852. package/select/README.md +0 -0
  853. package/select/_select-theme.scss +55 -0
  854. package/select/index.d.ts +1 -0
  855. package/select/public-api.d.ts +3 -0
  856. package/select/select-option.directive.d.ts +20 -0
  857. package/select/select.component.d.ts +330 -0
  858. package/select/select.module.d.ts +15 -0
  859. package/select/select.scss +222 -0
  860. package/sidebar/index.d.ts +1 -0
  861. package/sidebar/public-api.d.ts +2 -0
  862. package/sidebar/sidebar-animations.d.ts +8 -0
  863. package/sidebar/sidebar.component.d.ts +53 -0
  864. package/sidebar/sidebar.module.d.ts +8 -0
  865. package/sidebar/sidebar.scss +12 -0
  866. package/sidepanel/_sidepanel-theme.scss +67 -0
  867. package/sidepanel/index.d.ts +1 -0
  868. package/sidepanel/public-api.d.ts +6 -0
  869. package/sidepanel/sidepanel-animations.d.ts +14 -0
  870. package/sidepanel/sidepanel-config.d.ts +31 -0
  871. package/sidepanel/sidepanel-container.component.d.ts +46 -0
  872. package/sidepanel/sidepanel-directives.d.ts +50 -0
  873. package/sidepanel/sidepanel-ref.d.ts +24 -0
  874. package/sidepanel/sidepanel.module.d.ts +16 -0
  875. package/sidepanel/sidepanel.scss +203 -0
  876. package/sidepanel/sidepanel.service.d.ts +57 -0
  877. package/splitter/_splitter-theme.scss +31 -0
  878. package/splitter/index.d.ts +1 -0
  879. package/splitter/public-api.d.ts +2 -0
  880. package/splitter/splitter.component.d.ts +130 -0
  881. package/splitter/splitter.module.d.ts +9 -0
  882. package/splitter/splitter.scss +48 -0
  883. package/table/README.md +0 -0
  884. package/table/_table-theme.scss +65 -0
  885. package/table/index.d.ts +1 -0
  886. package/table/public-api.d.ts +2 -0
  887. package/table/table.component.d.ts +5 -0
  888. package/table/table.module.d.ts +10 -0
  889. package/table/table.scss +76 -0
  890. package/tabs/README.md +0 -0
  891. package/tabs/_tabs-common.scss +197 -0
  892. package/tabs/_tabs-theme.scss +240 -0
  893. package/tabs/index.d.ts +1 -0
  894. package/tabs/paginated-tab-header.d.ts +179 -0
  895. package/tabs/public-api.d.ts +10 -0
  896. package/tabs/tab-body.component.d.ts +95 -0
  897. package/tabs/tab-body.scss +8 -0
  898. package/tabs/tab-content.directive.d.ts +9 -0
  899. package/tabs/tab-group.component.d.ts +134 -0
  900. package/tabs/tab-group.scss +63 -0
  901. package/tabs/tab-header.component.d.ts +35 -0
  902. package/tabs/tab-header.scss +106 -0
  903. package/tabs/tab-label-wrapper.directive.d.ts +31 -0
  904. package/tabs/tab-label.directive.d.ts +9 -0
  905. package/tabs/tab-nav-bar/index.d.ts +1 -0
  906. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +40 -0
  907. package/tabs/tab-nav-bar/tab-nav-bar.scss +54 -0
  908. package/tabs/tab.component.d.ts +68 -0
  909. package/tabs/tabs-animations.d.ts +4 -0
  910. package/tabs/tabs.module.d.ts +21 -0
  911. package/tags/README.md +0 -0
  912. package/tags/_tag-theme.scss +100 -0
  913. package/tags/index.d.ts +1 -0
  914. package/tags/public-api.d.ts +5 -0
  915. package/tags/tag-default-options.d.ts +8 -0
  916. package/tags/tag-input.d.ts +87 -0
  917. package/tags/tag-list.component.d.ts +246 -0
  918. package/tags/tag-list.scss +66 -0
  919. package/tags/tag-text-control.d.ts +10 -0
  920. package/tags/tag.component.d.ts +140 -0
  921. package/tags/tag.module.d.ts +11 -0
  922. package/tags/tag.scss +67 -0
  923. package/textarea/README.md +0 -0
  924. package/textarea/_textarea-theme.scss +13 -0
  925. package/textarea/index.d.ts +1 -0
  926. package/textarea/public-api.d.ts +2 -0
  927. package/textarea/textarea.component.d.ts +114 -0
  928. package/textarea/textarea.module.d.ts +11 -0
  929. package/textarea/textarea.scss +45 -0
  930. package/timepicker/README.md +0 -0
  931. package/timepicker/index.d.ts +1 -0
  932. package/timepicker/public-api.d.ts +3 -0
  933. package/timepicker/timepicker.constants.d.ts +20 -0
  934. package/timepicker/timepicker.directive.d.ts +141 -0
  935. package/timepicker/timepicker.module.d.ts +11 -0
  936. package/timepicker/timepicker.scss +18 -0
  937. package/timezone/README.md +0 -0
  938. package/timezone/_timezone-option-theme.scss +34 -0
  939. package/timezone/cities-by-filter.pipe.d.ts +7 -0
  940. package/timezone/index.d.ts +1 -0
  941. package/timezone/public-api.d.ts +6 -0
  942. package/timezone/timezone-option.component.d.ts +15 -0
  943. package/timezone/timezone-option.component.scss +35 -0
  944. package/timezone/timezone-option.directive.d.ts +20 -0
  945. package/timezone/timezone-select.component.d.ts +14 -0
  946. package/timezone/timezone.models.d.ts +16 -0
  947. package/timezone/timezone.module.d.ts +19 -0
  948. package/timezone/timezone.utils.d.ts +18 -0
  949. package/timezone/utc-offset.pipe.d.ts +7 -0
  950. package/title/index.d.ts +1 -0
  951. package/title/public-api.d.ts +2 -0
  952. package/title/title.directive.d.ts +31 -0
  953. package/title/title.module.d.ts +8 -0
  954. package/toast/_toast-theme.scss +61 -0
  955. package/toast/index.d.ts +1 -0
  956. package/toast/public-api.d.ts +5 -0
  957. package/toast/toast-animations.d.ts +4 -0
  958. package/toast/toast-container.component.d.ts +15 -0
  959. package/toast/toast-container.component.scss +23 -0
  960. package/toast/toast.component.d.ts +35 -0
  961. package/toast/toast.component.scss +76 -0
  962. package/toast/toast.module.d.ts +13 -0
  963. package/toast/toast.service.d.ts +51 -0
  964. package/toast/toast.type.d.ts +27 -0
  965. package/toggle/_toggle-theme.scss +98 -0
  966. package/toggle/index.d.ts +1 -0
  967. package/toggle/public-api.d.ts +2 -0
  968. package/toggle/toggle.component.d.ts +57 -0
  969. package/toggle/toggle.module.d.ts +10 -0
  970. package/toggle/toggle.scss +99 -0
  971. package/tooltip/_tooltip-theme.scss +49 -0
  972. package/tooltip/index.d.ts +1 -0
  973. package/tooltip/public-api.d.ts +2 -0
  974. package/tooltip/tooltip.animations.d.ts +8 -0
  975. package/tooltip/tooltip.component.d.ts +94 -0
  976. package/tooltip/tooltip.module.d.ts +9 -0
  977. package/tooltip/tooltip.scss +54 -0
  978. package/tree/_tree-theme.scss +69 -0
  979. package/tree/control/base-tree-control.d.ts +40 -0
  980. package/tree/control/flat-tree-control.d.ts +53 -0
  981. package/tree/control/nested-tree-control.d.ts +19 -0
  982. package/tree/control/tree-control.d.ts +44 -0
  983. package/tree/data-source/flat-data-source.d.ts +80 -0
  984. package/tree/data-source/nested-data-source.d.ts +15 -0
  985. package/tree/index.d.ts +1 -0
  986. package/tree/node.d.ts +34 -0
  987. package/tree/outlet.d.ts +9 -0
  988. package/tree/padding.directive.d.ts +47 -0
  989. package/tree/public-api.d.ts +15 -0
  990. package/tree/toggle.d.ts +30 -0
  991. package/tree/toggle.scss +35 -0
  992. package/tree/tree-base.d.ts +97 -0
  993. package/tree/tree-errors.d.ts +25 -0
  994. package/tree/tree-option.component.d.ts +80 -0
  995. package/tree/tree-option.scss +67 -0
  996. package/tree/tree-selection.component.d.ts +134 -0
  997. package/tree/tree-selection.scss +3 -0
  998. package/tree/tree.d.ts +6 -0
  999. package/tree/tree.module.d.ts +16 -0
  1000. package/tree/tree.scss +3 -0
  1001. package/tree-select/README.md +0 -0
  1002. package/tree-select/_tree-select-theme.scss +41 -0
  1003. package/tree-select/index.d.ts +1 -0
  1004. package/tree-select/public-api.d.ts +2 -0
  1005. package/tree-select/tree-select.component.d.ts +283 -0
  1006. package/tree-select/tree-select.module.d.ts +14 -0
  1007. package/tree-select/tree-select.scss +225 -0
@@ -0,0 +1,1102 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Directive, Inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, ViewChild, ContentChild, HostListener, EventEmitter, QueryList, TemplateRef, Input, ContentChildren, Output, Self, NgModule } from '@angular/core';
3
+ import * as i1$1 from '@angular/cdk/overlay';
4
+ import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
5
+ import * as i2 from '@angular/common';
6
+ import { DOCUMENT, CommonModule } from '@angular/common';
7
+ import * as i3 from '@koobiq/components/icon';
8
+ import { KbqIcon, KbqIconModule } from '@koobiq/components/icon';
9
+ import { TemplatePortal, DomPortalOutlet } from '@angular/cdk/portal';
10
+ import { Subject, Subscription, merge, of, asapScheduler } from 'rxjs';
11
+ import * as i1 from '@angular/cdk/a11y';
12
+ import { mixinDisabled, KBQ_TITLE_TEXT_REF } from '@koobiq/components/core';
13
+ import * as i4 from '@angular/cdk/bidi';
14
+ import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
15
+ import { RIGHT_ARROW, LEFT_ARROW, ESCAPE, ENTER, SPACE, DOWN_ARROW as DOWN_ARROW$1 } from '@koobiq/cdk/keycodes';
16
+ import { startWith, switchMap, take, filter, takeUntil, delay } from 'rxjs/operators';
17
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
18
+ import { UP_ARROW, DOWN_ARROW } from '@angular/cdk/keycodes';
19
+ import { FocusKeyManager } from '@koobiq/cdk/a11y';
20
+ import { trigger, state, style, transition, group, query, animate } from '@angular/animations';
21
+
22
+ /**
23
+ * Injection token used to provide the parent dropdown to dropdown-specific components.
24
+ * @docs-private
25
+ */
26
+ const KBQ_DROPDOWN_PANEL = new InjectionToken('KBQ_DROPDOWN_PANEL');
27
+ /** Injection token to be used to override the default options for `kbq-dropdown`. */
28
+ const KBQ_DROPDOWN_DEFAULT_OPTIONS = new InjectionToken('kbq-dropdown-default-options', {
29
+ providedIn: 'root',
30
+ factory: KBQ_DROPDOWN_DEFAULT_OPTIONS_FACTORY
31
+ });
32
+ /** @docs-private */
33
+ // tslint:disable-next-line:naming-convention
34
+ function KBQ_DROPDOWN_DEFAULT_OPTIONS_FACTORY() {
35
+ return {
36
+ overlapTriggerX: true,
37
+ overlapTriggerY: false,
38
+ xPosition: 'after',
39
+ yPosition: 'below',
40
+ backdropClass: 'cdk-overlay-transparent-backdrop',
41
+ hasBackdrop: false
42
+ };
43
+ }
44
+
45
+ /**
46
+ * Dropdown content that will be rendered lazily once the dropdown is opened.
47
+ */
48
+ class KbqDropdownContent {
49
+ constructor(template, componentFactoryResolver, appRef, injector, viewContainerRef, document) {
50
+ this.template = template;
51
+ this.componentFactoryResolver = componentFactoryResolver;
52
+ this.appRef = appRef;
53
+ this.injector = injector;
54
+ this.viewContainerRef = viewContainerRef;
55
+ this.document = document;
56
+ /** Emits when the dropdown content has been attached. */
57
+ this.attached = new Subject();
58
+ }
59
+ /**
60
+ * Attaches the content with a particular context.
61
+ * @docs-private
62
+ */
63
+ attach(context = {}) {
64
+ if (!this.portal) {
65
+ this.portal = new TemplatePortal(this.template, this.viewContainerRef);
66
+ }
67
+ this.detach();
68
+ if (!this.outlet) {
69
+ this.outlet = new DomPortalOutlet(this.document.createElement('div'), this.componentFactoryResolver, this.appRef, this.injector);
70
+ }
71
+ const element = this.template.elementRef.nativeElement;
72
+ // Because we support opening the same dropdown from different triggers (which in turn have their
73
+ // own `OverlayRef` panel), we have to re-insert the host element every time, otherwise we
74
+ // risk it staying attached to a pane that's no longer in the DOM.
75
+ element.parentNode.insertBefore(this.outlet.outletElement, element);
76
+ this.portal.attach(this.outlet, context);
77
+ this.attached.next();
78
+ }
79
+ /**
80
+ * Detaches the content.
81
+ * @docs-private
82
+ */
83
+ detach() {
84
+ if (this.portal?.isAttached) {
85
+ this.portal.detach();
86
+ }
87
+ }
88
+ ngOnDestroy() {
89
+ this.outlet?.dispose();
90
+ }
91
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownContent, deps: [{ token: i0.TemplateRef }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.ViewContainerRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
92
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.5", type: KbqDropdownContent, selector: "ng-template[mcDropdownContent]", ngImport: i0 }); }
93
+ }
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownContent, decorators: [{
95
+ type: Directive,
96
+ args: [{
97
+ selector: 'ng-template[mcDropdownContent]'
98
+ }]
99
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
100
+ type: Inject,
101
+ args: [DOCUMENT]
102
+ }] }]; } });
103
+
104
+ // Boilerplate for applying mixins to KbqDropdownItem.
105
+ /** @docs-private */
106
+ class KbqDropdownItemBase {
107
+ }
108
+ /** @docs-private */
109
+ const KbqDropdownItemMixinBase = mixinDisabled(KbqDropdownItemBase);
110
+ /**
111
+ * This directive is intended to be used inside an kbq-dropdown tag.
112
+ * It exists mostly to set the role attribute.
113
+ */
114
+ class KbqDropdownItem extends KbqDropdownItemMixinBase {
115
+ constructor(elementRef, focusMonitor, parentDropdownPanel) {
116
+ super();
117
+ this.elementRef = elementRef;
118
+ this.focusMonitor = focusMonitor;
119
+ this.parentDropdownPanel = parentDropdownPanel;
120
+ /** Stream that emits when the dropdown item is hovered. */
121
+ this.hovered = new Subject();
122
+ /** Stream that emits when the menu item is focused. */
123
+ this.focused = new Subject();
124
+ /** Whether the dropdown item is highlighted. */
125
+ this.highlighted = false;
126
+ /** Whether the dropdown item acts as a trigger for a nested dropdown. */
127
+ this.isNested = false;
128
+ }
129
+ ngAfterViewInit() {
130
+ if (this.focusMonitor) {
131
+ // Start monitoring the element so it gets the appropriate focused classes. We want
132
+ // to show the focus style for menu items only when the focus was not caused by a
133
+ // mouse or touch interaction.
134
+ this.focusMonitor.monitor(this.elementRef, false);
135
+ }
136
+ }
137
+ ngOnDestroy() {
138
+ if (this.focusMonitor) {
139
+ this.focusMonitor.stopMonitoring(this.elementRef);
140
+ }
141
+ this.hovered.complete();
142
+ this.focused.complete();
143
+ }
144
+ resetStyles() {
145
+ this.getHostElement().classList.remove('cdk-keyboard-focused');
146
+ }
147
+ /** Focuses the dropdown item. */
148
+ focus(origin, options) {
149
+ if (this.focusMonitor && origin) {
150
+ this.focusMonitor.focusVia(this.getHostElement(), origin, options);
151
+ }
152
+ else {
153
+ this.getHostElement().focus(options);
154
+ }
155
+ this.focused.next(this);
156
+ }
157
+ /** Returns the host DOM element. */
158
+ getHostElement() {
159
+ return this.elementRef.nativeElement;
160
+ }
161
+ /** Used to set the `tabindex`. */
162
+ getTabIndex() {
163
+ return this.disabled ? '-1' : '0';
164
+ }
165
+ /** Prevents the default element actions if it is disabled. */
166
+ // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
167
+ // In Ivy the `host` bindings will be merged when this class is extended, whereas in
168
+ // ViewEngine they're overwritten.
169
+ // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
170
+ // tslint:disable-next-line:no-host-decorator-in-concrete
171
+ checkDisabled(event) {
172
+ if (this.disabled) {
173
+ event.preventDefault();
174
+ event.stopPropagation();
175
+ }
176
+ }
177
+ /** Emits to the hover stream. */
178
+ // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
179
+ // In Ivy the `host` bindings will be merged when this class is extended, whereas in
180
+ // ViewEngine they're overwritten.
181
+ // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
182
+ // tslint:disable-next-line:no-host-decorator-in-concrete
183
+ handleMouseEnter() {
184
+ this.hovered.next(this);
185
+ }
186
+ /** Gets the label to be used when determining whether the option should be focused. */
187
+ getLabel() {
188
+ const clone = this.getHostElement().cloneNode(true);
189
+ const icons = clone.querySelectorAll('[kbq-icon], .kbq-icon');
190
+ // Strip away icons so they don't show up in the text.
191
+ // tslint:disable-next-line:prefer-for-of
192
+ for (let i = 0; i < icons.length; i++) {
193
+ const icon = icons[i];
194
+ icon.parentNode?.removeChild(icon);
195
+ }
196
+ return clone.textContent?.trim() || '';
197
+ }
198
+ haltDisabledEvents(event) {
199
+ if (this.disabled) {
200
+ event.preventDefault();
201
+ event.stopImmediatePropagation();
202
+ event.stopPropagation();
203
+ }
204
+ }
205
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownItem, deps: [{ token: i0.ElementRef }, { token: i1.FocusMonitor }, { token: KBQ_DROPDOWN_PANEL, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
206
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.5", type: KbqDropdownItem, selector: "kbq-dropdown-item, [kbq-dropdown-item]", inputs: { disabled: "disabled" }, host: { listeners: { "click": "checkDisabled($event)", "mouseenter": "handleMouseEnter()" }, properties: { "class.kbq-dropdown-item_with-icon": "icon", "class.kbq-dropdown-item_highlighted": "highlighted", "attr.disabled": "disabled || null", "attr.tabindex": "getTabIndex()" }, classAttribute: "kbq-dropdown-item" }, providers: [
207
+ { provide: KBQ_TITLE_TEXT_REF, useExisting: KbqDropdownItem }
208
+ ], queries: [{ propertyName: "icon", first: true, predicate: KbqIcon, descendants: true }], viewQueries: [{ propertyName: "textElement", first: true, predicate: ["mcTitleText"], descendants: true, static: true }], exportAs: ["mcDropdownItem"], usesInheritance: true, ngImport: i0, template: "<div class=\"kbq-dropdown-item-wrapper\" #mcTitleText>\n <ng-content></ng-content>\n</div>\n<i *ngIf=\"isNested\" kbq-icon=\"mc-angle-right-S_16\" class=\"kbq-dropdown-trigger__icon\"></i>\n<div class=\"kbq-dropdown-item-overlay\" (click)=\"haltDisabledEvents($event)\"></div>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:29px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-button-size-border-width, 2px))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-button-size-border-radius, 8px)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-button-size-border-radius, 8px)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-button-size-border-width, 2px))}.kbq-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.kbq-dropdown-item{-webkit-user-select:none;user-select:none;display:flex;align-items:center;position:relative;box-sizing:border-box;width:100%;border:1px solid transparent;outline:none;padding:0;text-align:left;white-space:nowrap}.kbq-dropdown-item:not([disabled]){cursor:pointer}.kbq-dropdown-item .kbq-dropdown-item__caption{margin-top:4px}.kbq-dropdown-item.kbq-dropdown-item_with-icon .kbq-dropdown-item__caption{margin-left:24px}.kbq-dropdown-item-wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;padding:var(--kbq-dropdown-item-size-padding, 5px 15px)}.kbq-dropdown-item-wrapper [kbq-icon]{padding:var(--kbq-dropdown-item-size-icon-padding, 0 8px 2px 0)}.kbq-dropdown-item-overlay{position:absolute;inset:-1px;border-radius:inherit}.kbq-dropdown__group-header{-webkit-user-select:none;user-select:none;padding:var(--kbq-dropdown-item-size-padding, 6px 15px)}.kbq-dropdown__group-header.kbq-dropdown__group-header_small{padding:var(--kbq-dropdown-item-size-padding, 8px 15px)}.kbq-dropdown__divider{height:var(--kbq-dropdown-divider-size-height, 1px);margin:var(--kbq-dropdown-divider-size-margin, 4px 0)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.KbqIcon, selector: "[kbq-icon]", inputs: ["color", "small", "autoColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
209
+ }
210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownItem, decorators: [{
211
+ type: Component,
212
+ args: [{ selector: 'kbq-dropdown-item, [kbq-dropdown-item]', exportAs: 'mcDropdownItem', inputs: ['disabled'], host: {
213
+ class: 'kbq-dropdown-item',
214
+ '[class.kbq-dropdown-item_with-icon]': 'icon',
215
+ '[class.kbq-dropdown-item_highlighted]': 'highlighted',
216
+ '[attr.disabled]': 'disabled || null',
217
+ '[attr.tabindex]': 'getTabIndex()'
218
+ }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
219
+ { provide: KBQ_TITLE_TEXT_REF, useExisting: KbqDropdownItem }
220
+ ], template: "<div class=\"kbq-dropdown-item-wrapper\" #mcTitleText>\n <ng-content></ng-content>\n</div>\n<i *ngIf=\"isNested\" kbq-icon=\"mc-angle-right-S_16\" class=\"kbq-dropdown-trigger__icon\"></i>\n<div class=\"kbq-dropdown-item-overlay\" (click)=\"haltDisabledEvents($event)\"></div>\n", styles: ["@keyframes kbq-progress{0%{background-position:0 0}to{background-position:29px 0}}.kbq-progress{position:relative}.kbq-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:kbq-progress 1s linear infinite}.kbq-group{display:flex;flex-direction:row}.kbq-group .kbq-group_justified>.kbq-group-item{width:100%}.kbq-group .kbq-group-item+.kbq-group-item{margin-left:calc(-1 * var(--kbq-button-size-border-width, 2px))}.kbq-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group{display:flex;flex-direction:column}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--kbq-button-size-border-radius, 8px)}.kbq-vertical-group>.kbq-group-item:first-child:not(:last-child)>.kbq-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--kbq-button-size-border-radius, 8px)}.kbq-vertical-group>.kbq-group-item:last-child:not(:first-child)>.kbq-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child){border-radius:0}.kbq-vertical-group>.kbq-group-item:not(:first-child):not(:last-child)>.kbq-form-field__container{border-radius:0}.kbq-vertical-group .kbq-group-item+.kbq-group-item{margin-top:calc(-1 * var(--kbq-button-size-border-width, 2px))}.kbq-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.kbq-dropdown-item{-webkit-user-select:none;user-select:none;display:flex;align-items:center;position:relative;box-sizing:border-box;width:100%;border:1px solid transparent;outline:none;padding:0;text-align:left;white-space:nowrap}.kbq-dropdown-item:not([disabled]){cursor:pointer}.kbq-dropdown-item .kbq-dropdown-item__caption{margin-top:4px}.kbq-dropdown-item.kbq-dropdown-item_with-icon .kbq-dropdown-item__caption{margin-left:24px}.kbq-dropdown-item-wrapper{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;padding:var(--kbq-dropdown-item-size-padding, 5px 15px)}.kbq-dropdown-item-wrapper [kbq-icon]{padding:var(--kbq-dropdown-item-size-icon-padding, 0 8px 2px 0)}.kbq-dropdown-item-overlay{position:absolute;inset:-1px;border-radius:inherit}.kbq-dropdown__group-header{-webkit-user-select:none;user-select:none;padding:var(--kbq-dropdown-item-size-padding, 6px 15px)}.kbq-dropdown__group-header.kbq-dropdown__group-header_small{padding:var(--kbq-dropdown-item-size-padding, 8px 15px)}.kbq-dropdown__divider{height:var(--kbq-dropdown-divider-size-height, 1px);margin:var(--kbq-dropdown-divider-size-margin, 4px 0)}\n"] }]
221
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FocusMonitor }, { type: undefined, decorators: [{
222
+ type: Inject,
223
+ args: [KBQ_DROPDOWN_PANEL]
224
+ }, {
225
+ type: Optional
226
+ }] }]; }, propDecorators: { textElement: [{
227
+ type: ViewChild,
228
+ args: ['mcTitleText', { static: true }]
229
+ }], icon: [{
230
+ type: ContentChild,
231
+ args: [KbqIcon]
232
+ }], checkDisabled: [{
233
+ type: HostListener,
234
+ args: ['click', ['$event']]
235
+ }], handleMouseEnter: [{
236
+ type: HostListener,
237
+ args: ['mouseenter']
238
+ }] } });
239
+
240
+ /**
241
+ * Throws an exception for the case when dropdown trigger doesn't have a valid kbq-dropdown instance
242
+ * @docs-private
243
+ */
244
+ function throwKbqDropdownMissingError() {
245
+ throw Error(`mcDropdownTriggerFor: must pass in an kbq-dropdown instance.
246
+ Example:
247
+ <kbq-dropdown #dropdown="mcDropdown"></kbq-dropdown>
248
+ <button [mcDropdownTriggerFor]="dropdown"></button>`);
249
+ }
250
+ /**
251
+ * Throws an exception for the case when dropdown's x-position value isn't valid.
252
+ * In other words, it doesn't match 'before' or 'after'.
253
+ * @docs-private
254
+ */
255
+ function throwKbqDropdownInvalidPositionX() {
256
+ throw Error(`xPosition value must be either 'before' or after'.
257
+ Example: <kbq-dropdown [xPosition]="'before'" #dropdown="mcDropdown"></kbq-dropdown>`);
258
+ }
259
+ /**
260
+ * Throws an exception for the case when dropdown's y-position value isn't valid.
261
+ * In other words, it doesn't match 'above' or 'below'.
262
+ * @docs-private
263
+ */
264
+ function throwKbqDropdownInvalidPositionY() {
265
+ throw Error(`yPosition value must be either 'above' or below'.
266
+ Example: <kbq-dropdown [yPosition]="'above'" #dropdown="mcDropdown"></kbq-dropdown>`);
267
+ }
268
+
269
+ /**
270
+ * Animations used by the kbq-dropdown component.
271
+ * @docs-private
272
+ */
273
+ const mcDropdownAnimations = {
274
+ /**
275
+ * This animation controls the dropdown panel's entry and exit from the page.
276
+ *
277
+ * When the dropdown panel is added to the DOM, it scales in and fades in its border.
278
+ *
279
+ * When the dropdown panel is removed from the DOM, it simply fades out after a brief
280
+ * delay to display the ripple.
281
+ */
282
+ transformDropdown: trigger('transformDropdown', [
283
+ state('void', style({
284
+ opacity: 0,
285
+ transform: 'scale(0.8)'
286
+ })),
287
+ transition('void => enter', group([
288
+ query('.kbq-dropdown__content', animate('50ms linear', style({ opacity: 1 }))),
289
+ animate('50ms cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'scale(1)' }))
290
+ ])),
291
+ transition('* => void', animate('50ms 25ms linear', style({ opacity: 0 })))
292
+ ]),
293
+ /**
294
+ * This animation fades in the background color and content of the dropdown panel
295
+ * after its containing element is scaled in.
296
+ */
297
+ fadeInItems: trigger('fadeInItems', [
298
+ // now. Remove next time we do breaking changes.
299
+ state('showing', style({ opacity: 1 })),
300
+ transition('void => *', [
301
+ style({ opacity: 0 }),
302
+ animate('200ms 60ms cubic-bezier(0.55, 0, 0.55, 0.2)')
303
+ ])
304
+ ])
305
+ };
306
+ const fadeInItems = mcDropdownAnimations.fadeInItems;
307
+ const transformDropdown = mcDropdownAnimations.transformDropdown;
308
+
309
+ class KbqDropdown {
310
+ /** Position of the dropdown in the X axis. */
311
+ get xPosition() {
312
+ return this._xPosition;
313
+ }
314
+ set xPosition(value) {
315
+ if (value !== 'before' && value !== 'after') {
316
+ throwKbqDropdownInvalidPositionX();
317
+ }
318
+ this._xPosition = value;
319
+ this.setPositionClasses();
320
+ }
321
+ /** Position of the dropdown in the Y axis. */
322
+ get yPosition() {
323
+ return this._yPosition;
324
+ }
325
+ set yPosition(value) {
326
+ if (value !== 'above' && value !== 'below') {
327
+ throwKbqDropdownInvalidPositionY();
328
+ }
329
+ this._yPosition = value;
330
+ this.setPositionClasses();
331
+ }
332
+ /** Whether the dropdown should overlap its trigger vertically. */
333
+ get overlapTriggerY() {
334
+ return this._overlapTriggerY;
335
+ }
336
+ set overlapTriggerY(value) {
337
+ this._overlapTriggerY = coerceBooleanProperty(value);
338
+ }
339
+ /** Whether the dropdown should overlap its trigger horizontally. */
340
+ get overlapTriggerX() {
341
+ return this._overlapTriggerX;
342
+ }
343
+ set overlapTriggerX(value) {
344
+ this._overlapTriggerX = coerceBooleanProperty(value);
345
+ }
346
+ /** Whether the dropdown has a backdrop. */
347
+ get hasBackdrop() {
348
+ return this._hasBackdrop;
349
+ }
350
+ set hasBackdrop(value) {
351
+ this._hasBackdrop = coerceBooleanProperty(value);
352
+ }
353
+ /**
354
+ * This method takes classes set on the host kbq-dropdown element and applies them on the
355
+ * dropdown template that displays in the overlay container. Otherwise, it's difficult
356
+ * to style the containing dropdown from outside the component.
357
+ * @param classes list of class names
358
+ */
359
+ set panelClass(classes) {
360
+ const previousPanelClass = this.previousPanelClass;
361
+ if (previousPanelClass && previousPanelClass.length) {
362
+ previousPanelClass
363
+ .split(' ')
364
+ .forEach((className) => this.classList[className] = false);
365
+ }
366
+ this.previousPanelClass = classes;
367
+ if (classes?.length) {
368
+ classes
369
+ .split(' ')
370
+ .forEach((className) => this.classList[className] = true);
371
+ this.elementRef.nativeElement.className = '';
372
+ }
373
+ }
374
+ constructor(elementRef, ngZone, defaultOptions) {
375
+ this.elementRef = elementRef;
376
+ this.ngZone = ngZone;
377
+ this.defaultOptions = defaultOptions;
378
+ this.navigationWithWrap = false;
379
+ this._xPosition = this.defaultOptions.xPosition;
380
+ this._yPosition = this.defaultOptions.yPosition;
381
+ this._overlapTriggerX = this.defaultOptions.overlapTriggerX;
382
+ this._overlapTriggerY = this.defaultOptions.overlapTriggerY;
383
+ this._hasBackdrop = this.defaultOptions.hasBackdrop;
384
+ this.triggerWidth = '';
385
+ /** Config object to be passed into the dropdown's ngClass */
386
+ this.classList = {};
387
+ /** Current state of the panel animation. */
388
+ this.panelAnimationState = 'void';
389
+ /** Emits whenever an animation on the dropdown completes. */
390
+ this.animationDone = new Subject();
391
+ /** Class to be added to the backdrop element. */
392
+ this.backdropClass = this.defaultOptions.backdropClass;
393
+ /** Event emitted when the dropdown is closed. */
394
+ this.closed = new EventEmitter();
395
+ /** Only the direct descendant menu items. */
396
+ this.directDescendantItems = new QueryList();
397
+ /** Subscription to tab events on the dropdown panel */
398
+ this.tabSubscription = Subscription.EMPTY;
399
+ }
400
+ ngOnInit() {
401
+ this.setPositionClasses();
402
+ }
403
+ ngAfterContentInit() {
404
+ this.updateDirectDescendants();
405
+ this.keyManager = new FocusKeyManager(this.directDescendantItems)
406
+ .withTypeAhead();
407
+ if (this.navigationWithWrap) {
408
+ this.keyManager.withWrap();
409
+ }
410
+ this.tabSubscription = this.keyManager.tabOut
411
+ .subscribe(() => this.closed.emit('tab'));
412
+ // If a user manually (programmatically) focuses a menu item, we need to reflect that focus
413
+ // change back to the key manager. Note that we don't need to unsubscribe here because focused
414
+ // is internal and we know that it gets completed on destroy.
415
+ this.directDescendantItems.changes
416
+ .pipe(startWith(this.directDescendantItems), switchMap((items) => merge(...items.map((item) => item.focused))))
417
+ .subscribe((focusedItem) => this.keyManager.updateActiveItem(focusedItem));
418
+ }
419
+ ngOnDestroy() {
420
+ this.directDescendantItems.destroy();
421
+ this.tabSubscription.unsubscribe();
422
+ this.closed.complete();
423
+ }
424
+ /** Stream that emits whenever the hovered dropdown item changes. */
425
+ hovered() {
426
+ const itemChanges = this.directDescendantItems.changes;
427
+ return itemChanges.pipe(startWith(this.directDescendantItems), switchMap((items) => merge(...items.map((item) => item.hovered))));
428
+ }
429
+ /** Handle a keyboard event from the dropdown, delegating to the appropriate action. */
430
+ handleKeydown(event) {
431
+ // tslint:disable-next-line:deprecation
432
+ const keyCode = event.keyCode;
433
+ switch (keyCode) {
434
+ case ESCAPE:
435
+ this.closed.emit('keydown');
436
+ break;
437
+ case LEFT_ARROW:
438
+ if (this.parent && this.direction === 'ltr') {
439
+ this.closed.emit('keydown');
440
+ }
441
+ break;
442
+ case RIGHT_ARROW:
443
+ if (this.parent && this.direction === 'rtl') {
444
+ this.closed.emit('keydown');
445
+ }
446
+ break;
447
+ default:
448
+ if (keyCode === UP_ARROW || keyCode === DOWN_ARROW) {
449
+ this.keyManager.setFocusOrigin('keyboard');
450
+ }
451
+ this.keyManager.onKeydown(event);
452
+ return;
453
+ }
454
+ // Don't allow the event to propagate if we've already handled it, or it may
455
+ // end up reaching other overlays that were opened earlier.
456
+ event.stopPropagation();
457
+ }
458
+ /**
459
+ * Focus the first item in the dropdown.
460
+ * @param origin Action from which the focus originated. Used to set the correct styling.
461
+ */
462
+ focusFirstItem(origin = 'program') {
463
+ // When the content is rendered lazily, it takes a bit before the items are inside the DOM.
464
+ if (this.lazyContent) {
465
+ this.ngZone.onStable
466
+ .pipe(take(1))
467
+ .subscribe(() => this.keyManager.setFocusOrigin(origin).setFirstItemActive());
468
+ }
469
+ else {
470
+ this.keyManager.setFocusOrigin(origin).setFirstItemActive();
471
+ }
472
+ }
473
+ /**
474
+ * Resets the active item in the dropdown. This is used when the dropdown is opened, allowing
475
+ * the user to start from the first option when pressing the down arrow.
476
+ */
477
+ resetActiveItem() {
478
+ this.keyManager.activeItem?.resetStyles();
479
+ this.keyManager.setActiveItem(-1);
480
+ }
481
+ /**
482
+ * Adds classes to the dropdown panel based on its position. Can be used by
483
+ * consumers to add specific styling based on the position.
484
+ * @param posX Position of the dropdown along the x axis.
485
+ * @param posY Position of the dropdown along the y axis.
486
+ * @docs-private
487
+ */
488
+ setPositionClasses(posX = this.xPosition, posY = this.yPosition) {
489
+ const classes = this.classList;
490
+ classes['kbq-dropdown-before'] = posX === 'before';
491
+ classes['kbq-dropdown-after'] = posX === 'after';
492
+ classes['kbq-dropdown-above'] = posY === 'above';
493
+ classes['kbq-dropdown-below'] = posY === 'below';
494
+ }
495
+ /** Starts the enter animation. */
496
+ startAnimation() {
497
+ this.panelAnimationState = 'enter';
498
+ }
499
+ /** Resets the panel animation to its initial state. */
500
+ resetAnimation() {
501
+ this.panelAnimationState = 'void';
502
+ }
503
+ /** Callback that is invoked when the panel animation completes. */
504
+ onAnimationDone(event) {
505
+ this.animationDone.next(event);
506
+ this.isAnimating = false;
507
+ }
508
+ onAnimationStart(event) {
509
+ this.isAnimating = true;
510
+ // Scroll the content element to the top as soon as the animation starts. This is necessary,
511
+ // because we move focus to the first item while it's still being animated, which can throw
512
+ // the browser off when it determines the scroll position. Alternatively we can move focus
513
+ // when the animation is done, however moving focus asynchronously will interrupt screen
514
+ // readers which are in the process of reading out the dropdown already. We take the `element`
515
+ // from the `event` since we can't use a `ViewChild` to access the pane.
516
+ if (event.toState === 'enter' && this.keyManager.activeItemIndex === 0) {
517
+ event.element.scrollTop = 0;
518
+ }
519
+ }
520
+ close() {
521
+ const focusOrigin = this.keyManager.getFocusOrigin() === 'keyboard' ? 'keydown' : 'click';
522
+ this.closed.emit(focusOrigin);
523
+ }
524
+ /**
525
+ * Sets up a stream that will keep track of any newly-added menu items and will update the list
526
+ * of direct descendants. We collect the descendants this way, because `_allItems` can include
527
+ * items that are part of child menus, and using a custom way of registering items is unreliable
528
+ * when it comes to maintaining the item order.
529
+ */
530
+ updateDirectDescendants() {
531
+ this.items.changes
532
+ .pipe(startWith(this.items))
533
+ .subscribe((items) => {
534
+ this.directDescendantItems.reset(items.filter((item) => item.parentDropdownPanel === this));
535
+ this.directDescendantItems.notifyOnChanges();
536
+ });
537
+ }
538
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdown, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: KBQ_DROPDOWN_DEFAULT_OPTIONS }], target: i0.ɵɵFactoryTarget.Component }); }
539
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.5", type: KbqDropdown, selector: "kbq-dropdown", inputs: { navigationWithWrap: "navigationWithWrap", xPosition: "xPosition", yPosition: "yPosition", overlapTriggerY: "overlapTriggerY", overlapTriggerX: "overlapTriggerX", hasBackdrop: "hasBackdrop", panelClass: ["class", "panelClass"], backdropClass: "backdropClass" }, outputs: { closed: "closed" }, providers: [
540
+ { provide: KBQ_DROPDOWN_PANEL, useExisting: KbqDropdown }
541
+ ], queries: [{ propertyName: "lazyContent", first: true, predicate: KbqDropdownContent, descendants: true }, { propertyName: "items", predicate: KbqDropdownItem, descendants: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], exportAs: ["mcDropdown"], ngImport: i0, template: "<ng-template>\n <div class=\"kbq-dropdown__panel\"\n [ngClass]=\"classList\"\n [class.kbq-dropdown__panel_nested]=\"parent\"\n [style.min-width]=\"triggerWidth\"\n (keydown)=\"handleKeydown($event)\"\n (click)=\"close()\"\n [@transformDropdown]=\"panelAnimationState\"\n (@transformDropdown.start)=\"onAnimationStart($event)\"\n (@transformDropdown.done)=\"onAnimationDone($event)\"\n tabindex=\"-1\">\n\n <div class=\"kbq-dropdown__content\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n", styles: [".kbq-dropdown-trigger.kbq-button-icon_right{padding-right:var(--kbq-dropdown-trigger-size-button-right-padding, 8px)}.kbq-dropdown-trigger.kbq-button-icon_right.kbq-button-icon_left .kbq-icon_left{margin-right:0}.kbq-dropdown-trigger.kbq-button-icon .kbq-icon_right{margin-left:var(--kbq-dropdown-trigger-size-right-icon-padding, 4px)}.kbq-dropdown-trigger__icon{margin-left:auto;padding-right:var(--kbq-dropdown-trigger-size-right-icon-padding, 4px)}.kbq-dropdown__panel{margin-top:-1px;max-width:var(--kbq-dropdown-panel-size-max-width, 640px);border-width:var(--kbq-dropdown-panel-size-border-width, 1px);border-style:solid;border-bottom-left-radius:var(--kbq-dropdown-panel-size-border-radius, 8px);border-bottom-right-radius:var(--kbq-dropdown-panel-size-border-radius, 8px);padding:var(--kbq-dropdown-panel-size-padding, 4px 0)}.kbq-dropdown__panel.kbq-dropdown__panel_nested{border-top-left-radius:var(--kbq-dropdown-panel-size-border-radius, 8px);border-top-right-radius:var(--kbq-dropdown-panel-size-border-radius, 8px)}.kbq-dropdown__panel.ng-animating{pointer-events:none}.kbq-dropdown__content{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
542
+ mcDropdownAnimations.transformDropdown,
543
+ mcDropdownAnimations.fadeInItems
544
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
545
+ }
546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdown, decorators: [{
547
+ type: Component,
548
+ args: [{ selector: 'kbq-dropdown', exportAs: 'mcDropdown', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, animations: [
549
+ mcDropdownAnimations.transformDropdown,
550
+ mcDropdownAnimations.fadeInItems
551
+ ], providers: [
552
+ { provide: KBQ_DROPDOWN_PANEL, useExisting: KbqDropdown }
553
+ ], template: "<ng-template>\n <div class=\"kbq-dropdown__panel\"\n [ngClass]=\"classList\"\n [class.kbq-dropdown__panel_nested]=\"parent\"\n [style.min-width]=\"triggerWidth\"\n (keydown)=\"handleKeydown($event)\"\n (click)=\"close()\"\n [@transformDropdown]=\"panelAnimationState\"\n (@transformDropdown.start)=\"onAnimationStart($event)\"\n (@transformDropdown.done)=\"onAnimationDone($event)\"\n tabindex=\"-1\">\n\n <div class=\"kbq-dropdown__content\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n", styles: [".kbq-dropdown-trigger.kbq-button-icon_right{padding-right:var(--kbq-dropdown-trigger-size-button-right-padding, 8px)}.kbq-dropdown-trigger.kbq-button-icon_right.kbq-button-icon_left .kbq-icon_left{margin-right:0}.kbq-dropdown-trigger.kbq-button-icon .kbq-icon_right{margin-left:var(--kbq-dropdown-trigger-size-right-icon-padding, 4px)}.kbq-dropdown-trigger__icon{margin-left:auto;padding-right:var(--kbq-dropdown-trigger-size-right-icon-padding, 4px)}.kbq-dropdown__panel{margin-top:-1px;max-width:var(--kbq-dropdown-panel-size-max-width, 640px);border-width:var(--kbq-dropdown-panel-size-border-width, 1px);border-style:solid;border-bottom-left-radius:var(--kbq-dropdown-panel-size-border-radius, 8px);border-bottom-right-radius:var(--kbq-dropdown-panel-size-border-radius, 8px);padding:var(--kbq-dropdown-panel-size-padding, 4px 0)}.kbq-dropdown__panel.kbq-dropdown__panel_nested{border-top-left-radius:var(--kbq-dropdown-panel-size-border-radius, 8px);border-top-right-radius:var(--kbq-dropdown-panel-size-border-radius, 8px)}.kbq-dropdown__panel.ng-animating{pointer-events:none}.kbq-dropdown__content{display:flex;flex-direction:column}\n"] }]
554
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
555
+ type: Inject,
556
+ args: [KBQ_DROPDOWN_DEFAULT_OPTIONS]
557
+ }] }]; }, propDecorators: { navigationWithWrap: [{
558
+ type: Input
559
+ }], xPosition: [{
560
+ type: Input
561
+ }], yPosition: [{
562
+ type: Input
563
+ }], overlapTriggerY: [{
564
+ type: Input
565
+ }], overlapTriggerX: [{
566
+ type: Input
567
+ }], hasBackdrop: [{
568
+ type: Input
569
+ }], panelClass: [{
570
+ type: Input,
571
+ args: ['class']
572
+ }], backdropClass: [{
573
+ type: Input
574
+ }], templateRef: [{
575
+ type: ViewChild,
576
+ args: [TemplateRef, { static: false }]
577
+ }], items: [{
578
+ type: ContentChildren,
579
+ args: [KbqDropdownItem, { descendants: true }]
580
+ }], lazyContent: [{
581
+ type: ContentChild,
582
+ args: [KbqDropdownContent, { static: false }]
583
+ }], closed: [{
584
+ type: Output
585
+ }] } });
586
+
587
+ /** Injection token that determines the scroll handling while the dropdown is open. */
588
+ const KBQ_DROPDOWN_SCROLL_STRATEGY = new InjectionToken('kbq-dropdown-scroll-strategy');
589
+ /** @docs-private */
590
+ // tslint:disable-next-line:naming-convention
591
+ function KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY(overlay) {
592
+ return () => overlay.scrollStrategies.reposition();
593
+ }
594
+ /** @docs-private */
595
+ const KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER = {
596
+ provide: KBQ_DROPDOWN_SCROLL_STRATEGY,
597
+ deps: [Overlay],
598
+ useFactory: KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY
599
+ };
600
+ /** Default top padding of the nested dropdown panel. */
601
+ const NESTED_PANEL_TOP_PADDING = 4;
602
+ const NESTED_PANEL_LEFT_PADDING = 8;
603
+ /** Options for binding a passive event listener. */
604
+ const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
605
+ /**
606
+ * This directive is intended to be used in conjunction with an kbq-dropdown tag. It is
607
+ * responsible for toggling the display of the provided dropdown instance.
608
+ */
609
+ class KbqDropdownTrigger {
610
+ /** References the dropdown instance that the trigger is associated with. */
611
+ get dropdown() {
612
+ return this._dropdown;
613
+ }
614
+ set dropdown(dropdown) {
615
+ if (dropdown === this._dropdown) {
616
+ return;
617
+ }
618
+ this._dropdown = dropdown;
619
+ this.closeSubscription.unsubscribe();
620
+ if (dropdown) {
621
+ this.closeSubscription = dropdown.closed
622
+ .asObservable()
623
+ .subscribe((reason) => {
624
+ this.destroy(reason);
625
+ // If a click closed the dropdown, we should close the entire chain of nested dropdowns.
626
+ if (['click', 'tab'].includes(reason) && this.parent) {
627
+ this.parent.closed.emit(reason);
628
+ }
629
+ });
630
+ }
631
+ }
632
+ /** The text direction of the containing app. */
633
+ get dir() {
634
+ return this._dir?.value === 'rtl' ? 'rtl' : 'ltr';
635
+ }
636
+ /** Whether the dropdown is open. */
637
+ get opened() {
638
+ return this._opened;
639
+ }
640
+ constructor(overlay, elementRef, viewContainerRef, scrollStrategy, parent, dropdownItemInstance, _dir, changeDetecotrRef, focusMonitor) {
641
+ this.overlay = overlay;
642
+ this.elementRef = elementRef;
643
+ this.viewContainerRef = viewContainerRef;
644
+ this.scrollStrategy = scrollStrategy;
645
+ this.parent = parent;
646
+ this.dropdownItemInstance = dropdownItemInstance;
647
+ this._dir = _dir;
648
+ this.changeDetecotrRef = changeDetecotrRef;
649
+ this.focusMonitor = focusMonitor;
650
+ this.openByArrowDown = true;
651
+ /**
652
+ * Whether focus should be restored when the menu is closed.
653
+ * Note that disabling this option can have accessibility implications
654
+ * and it's up to you to manage focus, if you decide to turn it off.
655
+ */
656
+ this.restoreFocus = true;
657
+ /** Event emitted when the associated dropdown is opened. */
658
+ this.dropdownOpened = new EventEmitter();
659
+ /** Event emitted when the associated dropdown is closed. */
660
+ this.dropdownClosed = new EventEmitter();
661
+ this._opened = false;
662
+ this.overlayRef = null;
663
+ this.closeSubscription = Subscription.EMPTY;
664
+ this.hoverSubscription = Subscription.EMPTY;
665
+ /**
666
+ * Handles touch start events on the trigger.
667
+ * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.
668
+ */
669
+ this.handleTouchStart = () => this.openedBy = 'touch';
670
+ elementRef.nativeElement.addEventListener('touchstart', this.handleTouchStart, passiveEventListenerOptions);
671
+ if (dropdownItemInstance) {
672
+ dropdownItemInstance.isNested = this.isNested();
673
+ }
674
+ }
675
+ ngAfterContentInit() {
676
+ this.check();
677
+ this.handleHover();
678
+ }
679
+ ngOnDestroy() {
680
+ if (this.overlayRef) {
681
+ this.overlayRef.dispose();
682
+ this.overlayRef = null;
683
+ }
684
+ this.elementRef.nativeElement.removeEventListener('touchstart', this.handleTouchStart, passiveEventListenerOptions);
685
+ this.cleanUpSubscriptions();
686
+ }
687
+ /** Whether the dropdown triggers a nested dropdown or a top-level one. */
688
+ isNested() {
689
+ return !!(this.dropdownItemInstance && this.parent);
690
+ }
691
+ /** Toggles the dropdown between the open and closed states. */
692
+ toggle() {
693
+ // tslint:disable-next-line:no-void-expression
694
+ return this._opened ? this.close() : this.open();
695
+ }
696
+ /** Opens the dropdown. */
697
+ open() {
698
+ if (this._opened) {
699
+ return;
700
+ }
701
+ this.check();
702
+ const overlayRef = this.createOverlay();
703
+ const overlayConfig = overlayRef.getConfig();
704
+ this.setPosition(overlayConfig.positionStrategy);
705
+ overlayConfig.hasBackdrop = this.dropdown.hasBackdrop ? !this.isNested() : this.dropdown.hasBackdrop;
706
+ overlayRef.attach(this.getPortal());
707
+ if (this.dropdown.lazyContent) {
708
+ this.dropdown.lazyContent.detach();
709
+ this.dropdown.lazyContent.attach(this.data);
710
+ }
711
+ this.closeSubscription = this.closingActions()
712
+ .subscribe(() => this.close());
713
+ this.init();
714
+ if (this.dropdown instanceof KbqDropdown) {
715
+ this.dropdown.startAnimation();
716
+ }
717
+ }
718
+ /** Closes the dropdown. */
719
+ close() {
720
+ this.dropdown.closed.emit();
721
+ }
722
+ /**
723
+ * Focuses the dropdown trigger.
724
+ */
725
+ focus(origin, options) {
726
+ if (this.focusMonitor && origin) {
727
+ this.focusMonitor.focusVia(this.elementRef.nativeElement, origin, options);
728
+ }
729
+ else {
730
+ this.elementRef.nativeElement.focus();
731
+ }
732
+ }
733
+ /** Handles mouse presses on the trigger. */
734
+ handleMousedown(event) {
735
+ // Since right or middle button clicks won't trigger the `click` event,
736
+ // we shouldn't consider the dropdown as opened by mouse in those cases.
737
+ this.openedBy = event.button === 0 ? 'mouse' : undefined;
738
+ // Since clicking on the trigger won't close the dropdown if it opens a nested dropdown,
739
+ // we should prevent focus from moving onto it via click to avoid the
740
+ // highlight from lingering on the dropdown item.
741
+ if (this.isNested()) {
742
+ event.preventDefault();
743
+ }
744
+ }
745
+ /** Handles key presses on the trigger. */
746
+ handleKeydown(event) {
747
+ // tslint:disable-next-line:deprecation
748
+ const keyCode = event.keyCode;
749
+ if (keyCode === ENTER || keyCode === SPACE) {
750
+ this.openedBy = 'keyboard';
751
+ event.preventDefault();
752
+ if (this.isNested()) {
753
+ // Stop event propagation to avoid closing the parent dropdown.
754
+ event.stopPropagation();
755
+ this.open();
756
+ }
757
+ else {
758
+ this.toggle();
759
+ }
760
+ }
761
+ if ((this.isNested() &&
762
+ ((keyCode === RIGHT_ARROW && this.dir === 'ltr') || (keyCode === LEFT_ARROW && this.dir === 'rtl'))) ||
763
+ (!this.isNested() && (keyCode === DOWN_ARROW$1 && this.openByArrowDown))) {
764
+ event.preventDefault();
765
+ this.openedBy = 'keyboard';
766
+ this.open();
767
+ }
768
+ }
769
+ /** Handles click events on the trigger. */
770
+ handleClick(event) {
771
+ if (this.isNested()) {
772
+ // Stop event propagation to avoid closing the parent dropdown.
773
+ event.stopPropagation();
774
+ this.open();
775
+ }
776
+ else {
777
+ this.toggle();
778
+ }
779
+ }
780
+ /** Closes the dropdown and does the necessary cleanup. */
781
+ destroy(reason) {
782
+ if (!this.overlayRef || !this.opened) {
783
+ return;
784
+ }
785
+ this.lastDestroyReason = reason;
786
+ this.dropdown.resetActiveItem();
787
+ this.closeSubscription.unsubscribe();
788
+ this.overlayRef.detach();
789
+ if (this.restoreFocus && (reason === 'keydown' || !this.openedBy || !this.isNested())) {
790
+ this.focus(this.openedBy);
791
+ }
792
+ this.openedBy = undefined;
793
+ if (this.dropdown instanceof KbqDropdown) {
794
+ this.dropdown.resetAnimation();
795
+ const animationSubscription = this.dropdown.animationDone
796
+ .pipe(filter((event) => event.toState === 'void'), take(1));
797
+ if (this.dropdown.lazyContent) {
798
+ // Wait for the exit animation to finish before detaching the content.
799
+ animationSubscription
800
+ .pipe(
801
+ // Interrupt if the content got re-attached.
802
+ takeUntil(this.dropdown.lazyContent.attached))
803
+ .subscribe({
804
+ next: () => this.dropdown.lazyContent.detach(),
805
+ // No matter whether the content got re-attached, reset the this.dropdown.
806
+ complete: () => this.setIsOpened(false)
807
+ });
808
+ }
809
+ else {
810
+ animationSubscription
811
+ .subscribe(() => this.setIsOpened(false));
812
+ }
813
+ }
814
+ else {
815
+ this.setIsOpened(false);
816
+ if (this.dropdown.lazyContent) {
817
+ this.dropdown.lazyContent.detach();
818
+ }
819
+ }
820
+ }
821
+ /**
822
+ * This method sets the dropdown state to open and focuses the first item if
823
+ * the dropdown was opened via the keyboard.
824
+ */
825
+ init() {
826
+ this.dropdown.parent = this.isNested() ? this.parent : undefined;
827
+ this.dropdown.direction = this.dir;
828
+ if (!this.dropdown.parent) {
829
+ this.dropdown.triggerWidth = this.getWidth();
830
+ }
831
+ this.dropdown.focusFirstItem(this.openedBy || 'program');
832
+ this.setIsOpened(true);
833
+ }
834
+ // set state rather than toggle to support triggers sharing a dropdown
835
+ setIsOpened(isOpen) {
836
+ if (isOpen !== this._opened) {
837
+ this.changeDetecotrRef.markForCheck();
838
+ }
839
+ this._opened = isOpen;
840
+ // tslint:disable-next-line:no-void-expression
841
+ this._opened ? this.dropdownOpened.emit() : this.dropdownClosed.emit();
842
+ if (this.isNested()) {
843
+ this.dropdownItemInstance.highlighted = isOpen;
844
+ }
845
+ }
846
+ /**
847
+ * This method checks that a valid instance of KbqDropdown has been passed into
848
+ * mcDropdownTriggerFor. If not, an exception is thrown.
849
+ */
850
+ check() {
851
+ if (!this.dropdown) {
852
+ throwKbqDropdownMissingError();
853
+ }
854
+ }
855
+ /**
856
+ * This method creates the overlay from the provided dropdown's template and saves its
857
+ * OverlayRef so that it can be attached to the DOM when open is called.
858
+ */
859
+ createOverlay() {
860
+ if (!this.overlayRef) {
861
+ const config = this.getOverlayConfig();
862
+ this.subscribeToPositions(config.positionStrategy);
863
+ this.overlayRef = this.overlay.create(config);
864
+ // Consume the `keydownEvents` in order to prevent them from going to another overlay.
865
+ // Ideally we'd also have our keyboard event logic in here, however doing so will
866
+ // break anybody that may have implemented the `KbqDropdownPanel` themselves.
867
+ this.overlayRef.keydownEvents()
868
+ .subscribe();
869
+ }
870
+ return this.overlayRef;
871
+ }
872
+ /**
873
+ * This method builds the configuration object needed to create the overlay, the OverlayState.
874
+ * @returns OverlayConfig
875
+ */
876
+ getOverlayConfig() {
877
+ return new OverlayConfig({
878
+ positionStrategy: this.overlay.position()
879
+ .flexibleConnectedTo(this.elementRef)
880
+ .withLockedPosition()
881
+ .withTransformOriginOn('.kbq-dropdown__panel'),
882
+ backdropClass: this.dropdown.backdropClass || 'cdk-overlay-transparent-backdrop',
883
+ scrollStrategy: this.scrollStrategy(),
884
+ direction: this.dir
885
+ });
886
+ }
887
+ /**
888
+ * Listens to changes in the position of the overlay and sets the correct classes
889
+ * on the dropdown based on the new position. This ensures the animation origin is always
890
+ * correct, even if a fallback position is used for the overlay.
891
+ */
892
+ subscribeToPositions(position) {
893
+ if (this.dropdown.setPositionClasses) {
894
+ position.positionChanges
895
+ .subscribe((change) => {
896
+ const posX = change.connectionPair.overlayX === 'start' ? 'after' : 'before';
897
+ const posY = change.connectionPair.overlayY === 'top' ? 'below' : 'above';
898
+ this.dropdown.setPositionClasses(posX, posY);
899
+ });
900
+ }
901
+ }
902
+ /**
903
+ * Sets the appropriate positions on a position strategy
904
+ * so the overlay connects with the trigger correctly.
905
+ * @param positionStrategy Strategy whose position to update.
906
+ */
907
+ setPosition(positionStrategy) {
908
+ let [originX, originFallbackX, overlayX, overlayFallbackX] = this.dropdown.xPosition === 'before' ?
909
+ ['end', 'start', 'end', 'start'] :
910
+ ['start', 'end', 'start', 'end'];
911
+ // tslint:disable-next-line:prefer-const
912
+ let [overlayY, overlayFallbackY, originY, originFallbackY] = this.dropdown.yPosition === 'above' ?
913
+ ['bottom', 'top', 'bottom', 'top'] :
914
+ ['top', 'bottom', 'top', 'bottom'];
915
+ let offsetY = 0;
916
+ let offsetX = 0;
917
+ if (this.isNested()) {
918
+ // When the dropdown is nested, it should always align itself
919
+ // to the edges of the trigger, instead of overlapping it.
920
+ overlayFallbackX = originX = this.dropdown.xPosition === 'before' ? 'start' : 'end';
921
+ originFallbackX = overlayX = originX === 'end' ? 'start' : 'end';
922
+ offsetY = overlayY === 'bottom' ? NESTED_PANEL_TOP_PADDING : -NESTED_PANEL_TOP_PADDING;
923
+ offsetX = NESTED_PANEL_LEFT_PADDING;
924
+ }
925
+ else {
926
+ if (!this.dropdown.overlapTriggerY) {
927
+ originY = overlayY === 'top' ? 'bottom' : 'top';
928
+ originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';
929
+ }
930
+ if (!this.dropdown.overlapTriggerX) {
931
+ overlayFallbackX = originX = this.dropdown.xPosition === 'before' ? 'start' : 'end';
932
+ originFallbackX = overlayX = originX === 'end' ? 'start' : 'end';
933
+ }
934
+ }
935
+ positionStrategy.withPositions([
936
+ { originX, originY, overlayX, overlayY, offsetY, offsetX: -offsetX },
937
+ { originX: originFallbackX, originY, overlayX: overlayFallbackX, overlayY, offsetY, offsetX },
938
+ {
939
+ originX,
940
+ originY: originFallbackY,
941
+ overlayX,
942
+ overlayY: overlayFallbackY,
943
+ offsetY: -offsetY,
944
+ offsetX: -offsetX
945
+ },
946
+ {
947
+ originX: originFallbackX,
948
+ originY: originFallbackY,
949
+ overlayX: overlayFallbackX,
950
+ overlayY: overlayFallbackY,
951
+ offsetY: -offsetY,
952
+ offsetX: -offsetX
953
+ }
954
+ ]);
955
+ }
956
+ /** Cleans up the active subscriptions. */
957
+ cleanUpSubscriptions() {
958
+ this.closeSubscription.unsubscribe();
959
+ this.hoverSubscription.unsubscribe();
960
+ }
961
+ /** Returns a stream that emits whenever an action that should close the dropdown occurs. */
962
+ closingActions() {
963
+ const backdrop = this.overlayRef.backdropClick();
964
+ const outsidePointerEvents = this.overlayRef.outsidePointerEvents();
965
+ const detachments = this.overlayRef.detachments();
966
+ const parentClose = this.parent ? this.parent.closed : of();
967
+ const hover = this.parent ? this.parent.hovered()
968
+ .pipe(filter((active) => active !== this.dropdownItemInstance), filter(() => this._opened)) : of();
969
+ return merge(backdrop, outsidePointerEvents, parentClose, hover, detachments);
970
+ }
971
+ /** Handles the cases where the user hovers over the trigger. */
972
+ handleHover() {
973
+ // Subscribe to changes in the hovered item in order to toggle the panel.
974
+ if (!this.isNested()) {
975
+ return;
976
+ }
977
+ this.hoverSubscription = this.parent.hovered()
978
+ // Since we might have multiple competing triggers for the same dropdown (e.g. a nested dropdown
979
+ // with different data and triggers), we have to delay it by a tick to ensure that
980
+ // it won't be closed immediately after it is opened.
981
+ .pipe(filter((active) => active === this.dropdownItemInstance && !active.disabled), delay(0, asapScheduler))
982
+ .subscribe(() => {
983
+ this.openedBy = 'mouse';
984
+ // If the same dropdown is used between multiple triggers, it might still be animating
985
+ // while the new trigger tries to re-open it. Wait for the animation to finish
986
+ // before doing so. Also interrupt if the user moves to another item.
987
+ if (this.dropdown instanceof KbqDropdown && this.dropdown.isAnimating) {
988
+ // We need the `delay(0)` here in order to avoid
989
+ // 'changed after checked' errors in some cases. See #12194.
990
+ this.dropdown.animationDone
991
+ .pipe(take(1), delay(0, asapScheduler), takeUntil(this.parent.hovered()))
992
+ .subscribe(() => this.open());
993
+ }
994
+ else {
995
+ this.open();
996
+ }
997
+ });
998
+ }
999
+ /** Gets the portal that should be attached to the overlay. */
1000
+ getPortal() {
1001
+ // Note that we can avoid this check by keeping the portal on the dropdown panel.
1002
+ // While it would be cleaner, we'd have to introduce another required method on
1003
+ // `KbqDropdownPanel`, making it harder to consume.
1004
+ if (!this.portal || this.portal.templateRef !== this.dropdown.templateRef) {
1005
+ this.portal = new TemplatePortal(this.dropdown.templateRef, this.viewContainerRef);
1006
+ }
1007
+ return this.portal;
1008
+ }
1009
+ getWidth() {
1010
+ const nativeElement = this.elementRef.nativeElement;
1011
+ const { width, borderRightWidth, borderLeftWidth } = window.getComputedStyle(nativeElement);
1012
+ return `${parseInt(width) - parseInt(borderRightWidth) - parseInt(borderLeftWidth)}px`;
1013
+ }
1014
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownTrigger, deps: [{ token: i1$1.Overlay }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: KBQ_DROPDOWN_SCROLL_STRATEGY }, { token: KbqDropdown, optional: true }, { token: KbqDropdownItem, optional: true, self: true }, { token: i4.Directionality, optional: true }, { token: i0.ChangeDetectorRef }, { token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Directive }); }
1015
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.5", type: KbqDropdownTrigger, selector: "[mcDropdownTriggerFor]", inputs: { data: ["mcDropdownTriggerData", "data"], openByArrowDown: "openByArrowDown", restoreFocus: ["mcDropdownTriggerRestoreFocus", "restoreFocus"], dropdown: ["mcDropdownTriggerFor", "dropdown"] }, outputs: { dropdownOpened: "dropdownOpened", dropdownClosed: "dropdownClosed" }, host: { listeners: { "mousedown": "handleMousedown($event)", "keydown": "handleKeydown($event)", "click": "handleClick($event)" }, properties: { "class.kbq-pressed": "opened" }, classAttribute: "kbq-dropdown-trigger" }, exportAs: ["mcDropdownTrigger"], ngImport: i0 }); }
1016
+ }
1017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownTrigger, decorators: [{
1018
+ type: Directive,
1019
+ args: [{
1020
+ selector: `[mcDropdownTriggerFor]`,
1021
+ exportAs: 'mcDropdownTrigger',
1022
+ host: {
1023
+ class: 'kbq-dropdown-trigger',
1024
+ '[class.kbq-pressed]': 'opened',
1025
+ '(mousedown)': 'handleMousedown($event)',
1026
+ '(keydown)': 'handleKeydown($event)',
1027
+ '(click)': 'handleClick($event)'
1028
+ }
1029
+ }]
1030
+ }], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
1031
+ type: Inject,
1032
+ args: [KBQ_DROPDOWN_SCROLL_STRATEGY]
1033
+ }] }, { type: KbqDropdown, decorators: [{
1034
+ type: Optional
1035
+ }] }, { type: KbqDropdownItem, decorators: [{
1036
+ type: Optional
1037
+ }, {
1038
+ type: Self
1039
+ }] }, { type: i4.Directionality, decorators: [{
1040
+ type: Optional
1041
+ }] }, { type: i0.ChangeDetectorRef }, { type: i1.FocusMonitor }]; }, propDecorators: { data: [{
1042
+ type: Input,
1043
+ args: ['mcDropdownTriggerData']
1044
+ }], openByArrowDown: [{
1045
+ type: Input
1046
+ }], restoreFocus: [{
1047
+ type: Input,
1048
+ args: ['mcDropdownTriggerRestoreFocus']
1049
+ }], dropdown: [{
1050
+ type: Input,
1051
+ args: ['mcDropdownTriggerFor']
1052
+ }], dropdownOpened: [{
1053
+ type: Output
1054
+ }], dropdownClosed: [{
1055
+ type: Output
1056
+ }] } });
1057
+
1058
+ class KbqDropdownModule {
1059
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1060
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownModule, declarations: [KbqDropdown,
1061
+ KbqDropdownItem,
1062
+ KbqDropdownTrigger,
1063
+ KbqDropdownContent], imports: [CommonModule,
1064
+ OverlayModule,
1065
+ KbqIconModule], exports: [KbqDropdown,
1066
+ KbqDropdownItem,
1067
+ KbqDropdownTrigger,
1068
+ KbqDropdownContent] }); }
1069
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownModule, providers: [KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [CommonModule,
1070
+ OverlayModule,
1071
+ KbqIconModule] }); }
1072
+ }
1073
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.5", ngImport: i0, type: KbqDropdownModule, decorators: [{
1074
+ type: NgModule,
1075
+ args: [{
1076
+ imports: [
1077
+ CommonModule,
1078
+ OverlayModule,
1079
+ KbqIconModule
1080
+ ],
1081
+ exports: [
1082
+ KbqDropdown,
1083
+ KbqDropdownItem,
1084
+ KbqDropdownTrigger,
1085
+ KbqDropdownContent
1086
+ ],
1087
+ declarations: [
1088
+ KbqDropdown,
1089
+ KbqDropdownItem,
1090
+ KbqDropdownTrigger,
1091
+ KbqDropdownContent
1092
+ ],
1093
+ providers: [KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER]
1094
+ }]
1095
+ }] });
1096
+
1097
+ /**
1098
+ * Generated bundle index. Do not edit.
1099
+ */
1100
+
1101
+ export { KBQ_DROPDOWN_DEFAULT_OPTIONS, KBQ_DROPDOWN_DEFAULT_OPTIONS_FACTORY, KBQ_DROPDOWN_PANEL, KBQ_DROPDOWN_SCROLL_STRATEGY, KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY, KBQ_DROPDOWN_SCROLL_STRATEGY_FACTORY_PROVIDER, KbqDropdown, KbqDropdownContent, KbqDropdownItem, KbqDropdownModule, KbqDropdownTrigger, NESTED_PANEL_LEFT_PADDING, NESTED_PANEL_TOP_PADDING, fadeInItems, mcDropdownAnimations, throwKbqDropdownInvalidPositionX, throwKbqDropdownInvalidPositionY, throwKbqDropdownMissingError, transformDropdown };
1102
+ //# sourceMappingURL=koobiq-components-dropdown.mjs.map