@ptsecurity/mosaic 15.5.0 → 16.0.0

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 (788) hide show
  1. package/_theming.scss +29 -6
  2. package/_visual.scss +6 -4
  3. package/autocomplete/autocomplete-trigger.directive.d.ts +6 -16
  4. package/autocomplete/autocomplete.component.d.ts +1 -1
  5. package/button/_button-theme.scss +2 -5
  6. package/button/button.component.d.ts +1 -1
  7. package/button-toggle/_button-toggle-theme.scss +2 -5
  8. package/button-toggle/button-toggle.component.d.ts +3 -3
  9. package/card/card.component.d.ts +1 -1
  10. package/checkbox/_checkbox-theme.scss +6 -5
  11. package/checkbox/checkbox-config.d.ts +1 -1
  12. package/checkbox/checkbox.d.ts +1 -1
  13. package/code-block/_code-block-theme.scss +2 -6
  14. package/code-block/actionbar.component.d.ts +1 -1
  15. package/code-block/code-block.component.d.ts +1 -1
  16. package/core/common-behaviors/color.d.ts +1 -1
  17. package/core/common-behaviors/constructor.d.ts +2 -2
  18. package/core/common-behaviors/disabled.d.ts +1 -1
  19. package/core/common-behaviors/error-state.d.ts +1 -1
  20. package/core/common-behaviors/tabindex.d.ts +1 -1
  21. package/core/datetime/date-formats.d.ts +1 -1
  22. package/core/formatters/index.d.ts +1 -1
  23. package/core/formatters/number/formatter.d.ts +55 -0
  24. package/core/forms/_forms-theme.scss +2 -4
  25. package/core/label/label-options.d.ts +1 -1
  26. package/core/locales/en-US.d.ts +13 -2
  27. package/core/locales/es-LA.d.ts +21 -0
  28. package/core/locales/fa-IR.d.ts +22 -0
  29. package/core/locales/locale-service.d.ts +111 -5
  30. package/core/locales/pt-BR.d.ts +21 -0
  31. package/core/locales/ru-RU.d.ts +13 -2
  32. package/core/locales/zh-CN.d.ts +20 -0
  33. package/core/option/_optgroup-theme.scss +2 -4
  34. package/core/option/_option-theme.scss +2 -5
  35. package/core/option/action.d.ts +1 -1
  36. package/core/option/optgroup.d.ts +1 -1
  37. package/core/option/option.d.ts +37 -8
  38. package/core/overlay/overlay-position-map.d.ts +7 -1
  39. package/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts +2 -2
  40. package/core/styles/_variables.scss +1 -0
  41. package/core/styles/theming/_badges.scss +2 -1
  42. package/core/styles/theming/_theming.scss +1 -0
  43. package/datepicker/_datepicker-theme.scss +2 -5
  44. package/datepicker/calendar-body.component.d.ts +2 -2
  45. package/datepicker/calendar-header.component.d.ts +9 -3
  46. package/datepicker/calendar.component.d.ts +4 -5
  47. package/datepicker/datepicker-input.directive.d.ts +1 -1
  48. package/datepicker/datepicker-toggle.component.d.ts +1 -1
  49. package/datepicker/datepicker.component.d.ts +1 -1
  50. package/datepicker/month-view.component.d.ts +4 -5
  51. package/divider/divider.component.d.ts +1 -1
  52. package/dl/_dl-theme.scss +2 -5
  53. package/dl/dl.component.d.ts +1 -1
  54. package/dropdown/_dropdown-theme.scss +2 -5
  55. package/dropdown/dropdown-item.component.d.ts +1 -1
  56. package/dropdown/dropdown-trigger.directive.d.ts +1 -1
  57. package/dropdown/dropdown.component.d.ts +1 -1
  58. package/dropdown/dropdown.types.d.ts +3 -3
  59. package/ellipsis-center/ellipsis-center.directive.d.ts +1 -1
  60. package/{esm2020 → esm2022}/autocomplete/autocomplete-origin.directive.mjs +4 -4
  61. package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +555 -0
  62. package/{esm2020 → esm2022}/autocomplete/autocomplete.component.mjs +26 -26
  63. package/{esm2020 → esm2022}/autocomplete/autocomplete.module.mjs +10 -10
  64. package/esm2022/button/button.component.mjs +148 -0
  65. package/{esm2020 → esm2022}/button/button.module.mjs +13 -13
  66. package/esm2022/button-toggle/button-toggle.component.mjs +381 -0
  67. package/{esm2020 → esm2022}/button-toggle/button-toggle.module.mjs +5 -5
  68. package/esm2022/card/card.component.mjs +80 -0
  69. package/{esm2020 → esm2022}/card/card.module.mjs +9 -9
  70. package/{esm2020 → esm2022}/checkbox/checkbox-module.mjs +5 -5
  71. package/{esm2020 → esm2022}/checkbox/checkbox-required-validator.mjs +4 -4
  72. package/esm2022/checkbox/checkbox.mjs +300 -0
  73. package/{esm2020 → esm2022}/code-block/actionbar.component.mjs +4 -4
  74. package/esm2022/code-block/code-block.component.mjs +157 -0
  75. package/esm2022/code-block/code-block.module.mjs +60 -0
  76. package/esm2022/core/common-behaviors/color.mjs +33 -0
  77. package/{esm2020 → esm2022}/core/common-behaviors/common-module.mjs +5 -5
  78. package/{esm2020 → esm2022}/core/common-behaviors/disabled.mjs +6 -6
  79. package/{esm2020 → esm2022}/core/common-behaviors/tabindex.mjs +6 -6
  80. package/{esm2020 → esm2022}/core/error/error-options.mjs +7 -7
  81. package/{esm2020 → esm2022}/core/formatters/date/formatter.mjs +4 -4
  82. package/{esm2020 → esm2022}/core/formatters/date/formatter.pipe.mjs +40 -40
  83. package/esm2022/core/formatters/index.mjs +86 -0
  84. package/esm2022/core/formatters/number/formatter.mjs +350 -0
  85. package/{esm2020 → esm2022}/core/forms/forms-module.mjs +7 -7
  86. package/{esm2020 → esm2022}/core/forms/forms.directive.mjs +7 -7
  87. package/{esm2020 → esm2022}/core/highlight/highlight.pipe.mjs +4 -4
  88. package/{esm2020 → esm2022}/core/highlight/index.mjs +5 -5
  89. package/{esm2020 → esm2022}/core/line/line.mjs +8 -8
  90. package/esm2022/core/locales/en-US.mjs +21 -0
  91. package/esm2022/core/locales/es-LA.mjs +27 -0
  92. package/esm2022/core/locales/fa-IR.mjs +28 -0
  93. package/{esm2020 → esm2022}/core/locales/locale-service.mjs +7 -7
  94. package/{esm2020 → esm2022}/core/locales/locale-service.module.mjs +7 -7
  95. package/esm2022/core/locales/pt-BR.mjs +27 -0
  96. package/esm2022/core/locales/ru-RU.mjs +21 -0
  97. package/esm2022/core/locales/zh-CN.mjs +26 -0
  98. package/{esm2020 → esm2022}/core/option/action.mjs +9 -9
  99. package/{esm2020 → esm2022}/core/option/optgroup.mjs +5 -5
  100. package/{esm2020 → esm2022}/core/option/option-module.mjs +5 -5
  101. package/esm2022/core/option/option.mjs +298 -0
  102. package/esm2022/core/overlay/overlay-position-map.mjs +251 -0
  103. package/{esm2020 → esm2022}/core/pop-up/pop-up-trigger.mjs +4 -4
  104. package/{esm2020 → esm2022}/core/pop-up/pop-up.mjs +4 -4
  105. package/{esm2020 → esm2022}/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  106. package/{esm2020 → esm2022}/core/selection/pseudo-checkbox/pseudo-checkbox.module.mjs +5 -5
  107. package/esm2022/core/services/measure-scrollbar.service.mjs +48 -0
  108. package/{esm2020 → esm2022}/core/utils/data-size/data-size.pipe.mjs +8 -8
  109. package/{esm2020 → esm2022}/core/version.mjs +2 -2
  110. package/{esm2020 → esm2022}/datepicker/calendar-body.component.mjs +4 -4
  111. package/esm2022/datepicker/calendar-header.component.mjs +135 -0
  112. package/esm2022/datepicker/calendar.component.mjs +166 -0
  113. package/esm2022/datepicker/datepicker-input.directive.mjs +955 -0
  114. package/{esm2020 → esm2022}/datepicker/datepicker-intl.mjs +4 -4
  115. package/{esm2020 → esm2022}/datepicker/datepicker-module.mjs +38 -38
  116. package/esm2022/datepicker/datepicker-toggle.component.mjs +86 -0
  117. package/esm2022/datepicker/datepicker.component.mjs +393 -0
  118. package/esm2022/datepicker/month-view.component.mjs +149 -0
  119. package/{esm2020 → esm2022}/divider/divider.component.mjs +4 -4
  120. package/{esm2020 → esm2022}/divider/divider.module.mjs +5 -5
  121. package/{esm2020 → esm2022}/dl/dl.component.mjs +10 -10
  122. package/{esm2020 → esm2022}/dl/dl.module.mjs +13 -13
  123. package/{esm2020 → esm2022}/dropdown/dropdown-content.directive.mjs +4 -4
  124. package/{esm2020 → esm2022}/dropdown/dropdown-item.component.mjs +6 -6
  125. package/esm2022/dropdown/dropdown-trigger.directive.mjs +489 -0
  126. package/esm2022/dropdown/dropdown.component.mjs +292 -0
  127. package/{esm2020 → esm2022}/dropdown/dropdown.module.mjs +15 -15
  128. package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +106 -0
  129. package/{esm2020 → esm2022}/file-upload/file-drop.mjs +4 -4
  130. package/{esm2020 → esm2022}/file-upload/file-upload.module.mjs +25 -25
  131. package/esm2022/file-upload/multiple-file-upload.component.mjs +165 -0
  132. package/esm2022/file-upload/single-file-upload.component.mjs +134 -0
  133. package/{esm2020 → esm2022}/form-field/cleaner.mjs +4 -4
  134. package/esm2022/form-field/form-field.mjs +267 -0
  135. package/{esm2020 → esm2022}/form-field/form-field.module.mjs +23 -23
  136. package/{esm2020 → esm2022}/form-field/hint.mjs +4 -4
  137. package/esm2022/form-field/password-hint.mjs +146 -0
  138. package/{esm2020 → esm2022}/form-field/prefix.mjs +4 -4
  139. package/{esm2020 → esm2022}/form-field/stepper.mjs +6 -6
  140. package/{esm2020 → esm2022}/form-field/suffix.mjs +4 -4
  141. package/esm2022/form-field/validate.directive.mjs +158 -0
  142. package/{esm2020 → esm2022}/icon/icon.component.mjs +7 -7
  143. package/{esm2020 → esm2022}/icon/icon.module.mjs +11 -11
  144. package/{esm2020 → esm2022}/input/input-number-validators.mjs +7 -7
  145. package/esm2022/input/input-number.mjs +168 -0
  146. package/esm2022/input/input-password.mjs +343 -0
  147. package/esm2022/input/input.mjs +297 -0
  148. package/{esm2020 → esm2022}/input/input.module.mjs +23 -23
  149. package/esm2022/link/link.component.mjs +122 -0
  150. package/{esm2020 → esm2022}/link/link.module.mjs +7 -7
  151. package/esm2022/list/list-selection.component.mjs +705 -0
  152. package/{esm2020 → esm2022}/list/list.component.mjs +8 -8
  153. package/{esm2020 → esm2022}/list/list.module.mjs +20 -20
  154. package/esm2022/loader-overlay/loader-overlay.component.mjs +103 -0
  155. package/{esm2020 → esm2022}/loader-overlay/loader-overlay.module.mjs +17 -17
  156. package/{esm2020 → esm2022}/markdown/markdown.component.mjs +13 -13
  157. package/{esm2020 → esm2022}/markdown/markdown.module.mjs +5 -5
  158. package/{esm2020 → esm2022}/markdown/markdown.service.mjs +4 -4
  159. package/{esm2020 → esm2022}/modal/css-unit.pipe.mjs +4 -4
  160. package/esm2022/modal/modal-control.service.mjs +85 -0
  161. package/esm2022/modal/modal.component.mjs +520 -0
  162. package/{esm2020 → esm2022}/modal/modal.directive.mjs +13 -13
  163. package/esm2022/modal/modal.module.mjs +75 -0
  164. package/{esm2020 → esm2022}/modal/modal.service.mjs +8 -8
  165. package/esm2022/navbar/navbar-item.component.mjs +606 -0
  166. package/esm2022/navbar/navbar.component.mjs +248 -0
  167. package/{esm2020 → esm2022}/navbar/navbar.module.mjs +37 -37
  168. package/{esm2020 → esm2022}/navbar/vertical-navbar.component.mjs +20 -17
  169. package/esm2022/popover/popover-confirm.component.mjs +108 -0
  170. package/esm2022/popover/popover.component.mjs +266 -0
  171. package/{esm2020 → esm2022}/popover/popover.module.mjs +8 -8
  172. package/{esm2020 → esm2022}/progress-bar/progress-bar.component.mjs +4 -4
  173. package/{esm2020 → esm2022}/progress-bar/progress-bar.module.mjs +7 -7
  174. package/{esm2020 → esm2022}/progress-spinner/progress-spinner.component.mjs +12 -12
  175. package/{esm2020 → esm2022}/progress-spinner/progress-spinner.module.mjs +7 -7
  176. package/esm2022/radio/radio.component.mjs +457 -0
  177. package/{esm2020 → esm2022}/radio/radio.module.mjs +5 -5
  178. package/esm2022/select/select-option.directive.mjs +65 -0
  179. package/esm2022/select/select.component.mjs +1160 -0
  180. package/{esm2020 → esm2022}/select/select.module.mjs +32 -32
  181. package/esm2022/sidebar/sidebar.component.mjs +146 -0
  182. package/{esm2020 → esm2022}/sidebar/sidebar.module.mjs +9 -9
  183. package/esm2022/sidepanel/sidepanel-container.component.mjs +110 -0
  184. package/{esm2020 → esm2022}/sidepanel/sidepanel-directives.mjs +18 -18
  185. package/{esm2020 → esm2022}/sidepanel/sidepanel.module.mjs +32 -32
  186. package/{esm2020 → esm2022}/sidepanel/sidepanel.service.mjs +10 -10
  187. package/esm2022/splitter/splitter.component.mjs +482 -0
  188. package/{esm2020 → esm2022}/splitter/splitter.module.mjs +12 -12
  189. package/{esm2020 → esm2022}/table/table.component.mjs +4 -4
  190. package/{esm2020 → esm2022}/table/table.module.mjs +9 -9
  191. package/esm2022/tabs/paginated-tab-header.mjs +488 -0
  192. package/esm2022/tabs/tab-body.component.mjs +179 -0
  193. package/{esm2020 → esm2022}/tabs/tab-content.directive.mjs +4 -4
  194. package/esm2022/tabs/tab-group.component.mjs +349 -0
  195. package/{esm2020 → esm2022}/tabs/tab-header.component.mjs +4 -4
  196. package/{esm2020 → esm2022}/tabs/tab-label-wrapper.directive.mjs +4 -4
  197. package/{esm2020 → esm2022}/tabs/tab-label.directive.mjs +4 -4
  198. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +111 -0
  199. package/{esm2020 → esm2022}/tabs/tab.component.mjs +43 -34
  200. package/{esm2020 → esm2022}/tabs/tabs.module.mjs +42 -42
  201. package/esm2022/tags/tag-default-options.mjs +4 -0
  202. package/esm2022/tags/tag-input.mjs +250 -0
  203. package/esm2022/tags/tag-list.component.mjs +718 -0
  204. package/esm2022/tags/tag.component.mjs +381 -0
  205. package/esm2022/tags/tag.module.mjs +56 -0
  206. package/esm2022/textarea/textarea.component.mjs +254 -0
  207. package/{esm2020 → esm2022}/textarea/textarea.module.mjs +5 -5
  208. package/esm2022/timepicker/timepicker.directive.mjs +647 -0
  209. package/{esm2020 → esm2022}/timepicker/timepicker.module.mjs +11 -11
  210. package/{esm2020 → esm2022}/timezone/cities-by-filter.pipe.mjs +4 -4
  211. package/esm2022/timezone/timezone-option.component.mjs +48 -0
  212. package/{esm2020 → esm2022}/timezone/timezone-option.directive.mjs +4 -4
  213. package/{esm2020 → esm2022}/timezone/timezone-select.component.mjs +11 -11
  214. package/{esm2020 → esm2022}/timezone/timezone.module.mjs +29 -29
  215. package/{esm2020 → esm2022}/timezone/utc-offset.pipe.mjs +4 -4
  216. package/esm2022/title/title.directive.mjs +107 -0
  217. package/{esm2020 → esm2022}/title/title.module.mjs +5 -5
  218. package/{esm2020 → esm2022}/toast/toast-container.component.mjs +4 -4
  219. package/esm2022/toast/toast.component.mjs +92 -0
  220. package/esm2022/toast/toast.module.mjs +48 -0
  221. package/esm2022/toast/toast.service.mjs +188 -0
  222. package/esm2022/toggle/toggle.component.mjs +156 -0
  223. package/{esm2020 → esm2022}/toggle/toggle.module.mjs +5 -5
  224. package/esm2022/tooltip/tooltip.component.mjs +299 -0
  225. package/{esm2020 → esm2022}/tooltip/tooltip.module.mjs +14 -14
  226. package/esm2022/tree/data-source/flat-data-source.mjs +162 -0
  227. package/{esm2020 → esm2022}/tree/node.mjs +4 -4
  228. package/{esm2020 → esm2022}/tree/outlet.mjs +4 -4
  229. package/esm2022/tree/padding.directive.mjs +113 -0
  230. package/esm2022/tree/toggle.mjs +81 -0
  231. package/esm2022/tree/tree-base.mjs +243 -0
  232. package/esm2022/tree/tree-option.component.mjs +303 -0
  233. package/esm2022/tree/tree-selection.component.mjs +558 -0
  234. package/{esm2020 → esm2022}/tree/tree.mjs +4 -4
  235. package/{esm2020 → esm2022}/tree/tree.module.mjs +21 -21
  236. package/esm2022/tree-select/tree-select.component.mjs +936 -0
  237. package/{esm2020 → esm2022}/tree-select/tree-select.module.mjs +17 -17
  238. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-autocomplete.mjs +80 -77
  239. package/fesm2022/ptsecurity-mosaic-autocomplete.mjs.map +1 -0
  240. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-button-toggle.mjs +47 -47
  241. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-button-toggle.mjs.map +1 -1
  242. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-button.mjs +25 -25
  243. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-button.mjs.map +1 -1
  244. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-card.mjs +17 -17
  245. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-card.mjs.map +1 -1
  246. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-checkbox.mjs +39 -39
  247. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-checkbox.mjs.map +1 -1
  248. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-code-block.mjs +34 -34
  249. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-code-block.mjs.map +1 -1
  250. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-core.mjs +600 -224
  251. package/fesm2022/ptsecurity-mosaic-core.mjs.map +1 -0
  252. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-datepicker.mjs +335 -351
  253. package/fesm2022/ptsecurity-mosaic-datepicker.mjs.map +1 -0
  254. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-divider.mjs +7 -7
  255. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-divider.mjs.map +1 -1
  256. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-dl.mjs +21 -21
  257. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-dl.mjs.map +1 -1
  258. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-dropdown.mjs +89 -89
  259. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-dropdown.mjs.map +1 -1
  260. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-ellipsis-center.mjs +11 -11
  261. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-ellipsis-center.mjs.map +1 -1
  262. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-file-upload.mjs +55 -47
  263. package/fesm2022/ptsecurity-mosaic-file-upload.mjs.map +1 -0
  264. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-form-field.mjs +92 -87
  265. package/fesm2022/ptsecurity-mosaic-form-field.mjs.map +1 -0
  266. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-icon.mjs +16 -16
  267. package/fesm2022/ptsecurity-mosaic-icon.mjs.map +1 -0
  268. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-input.mjs +128 -128
  269. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-input.mjs.map +1 -1
  270. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-link.mjs +22 -22
  271. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-link.mjs.map +1 -1
  272. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-list.mjs +88 -88
  273. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-list.mjs.map +1 -1
  274. package/fesm2022/ptsecurity-mosaic-loader-overlay.mjs +155 -0
  275. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-loader-overlay.mjs.map +1 -1
  276. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-markdown.mjs +19 -19
  277. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-markdown.mjs.map +1 -1
  278. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-modal.mjs +157 -144
  279. package/fesm2022/ptsecurity-mosaic-modal.mjs.map +1 -0
  280. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-navbar.mjs +196 -187
  281. package/fesm2022/ptsecurity-mosaic-navbar.mjs.map +1 -0
  282. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-popover.mjs +37 -37
  283. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-popover.mjs.map +1 -1
  284. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-progress-bar.mjs +9 -9
  285. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-progress-bar.mjs.map +1 -1
  286. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-progress-spinner.mjs +18 -18
  287. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-progress-spinner.mjs.map +1 -1
  288. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-radio.mjs +80 -79
  289. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-radio.mjs.map +1 -1
  290. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-select.mjs +188 -174
  291. package/fesm2022/ptsecurity-mosaic-select.mjs.map +1 -0
  292. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-sidebar.mjs +29 -29
  293. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-sidebar.mjs.map +1 -1
  294. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-sidepanel.mjs +63 -63
  295. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-sidepanel.mjs.map +1 -1
  296. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-splitter.mjs +55 -55
  297. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-splitter.mjs.map +1 -1
  298. package/fesm2022/ptsecurity-mosaic-table.mjs +45 -0
  299. package/fesm2022/ptsecurity-mosaic-table.mjs.map +1 -0
  300. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tabs.mjs +188 -179
  301. package/fesm2022/ptsecurity-mosaic-tabs.mjs.map +1 -0
  302. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tags.mjs +150 -144
  303. package/fesm2022/ptsecurity-mosaic-tags.mjs.map +1 -0
  304. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-textarea.mjs +41 -41
  305. package/{fesm2015 → fesm2022}/ptsecurity-mosaic-textarea.mjs.map +1 -1
  306. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-timepicker.mjs +95 -95
  307. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-timepicker.mjs.map +1 -1
  308. package/fesm2022/ptsecurity-mosaic-timezone.mjs +314 -0
  309. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-timezone.mjs.map +1 -1
  310. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-title.mjs +18 -18
  311. package/fesm2022/ptsecurity-mosaic-title.mjs.map +1 -0
  312. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-toast.mjs +47 -41
  313. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-toast.mjs.map +1 -1
  314. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-toggle.mjs +35 -35
  315. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-toggle.mjs.map +1 -1
  316. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tooltip.mjs +47 -47
  317. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tooltip.mjs.map +1 -1
  318. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tree-select.mjs +123 -123
  319. package/fesm2022/ptsecurity-mosaic-tree-select.mjs.map +1 -0
  320. package/{fesm2020 → fesm2022}/ptsecurity-mosaic-tree.mjs +203 -198
  321. package/fesm2022/ptsecurity-mosaic-tree.mjs.map +1 -0
  322. package/file-upload/_file-upload-theme.scss +2 -4
  323. package/file-upload/file-upload.d.ts +1 -1
  324. package/file-upload/multiple-file-upload.component.d.ts +5 -4
  325. package/file-upload/single-file-upload.component.d.ts +5 -4
  326. package/form-field/_form-field-theme.scss +7 -5
  327. package/form-field/form-field.d.ts +1 -2
  328. package/form-field/form-field.scss +1 -3
  329. package/form-field/hint.d.ts +1 -1
  330. package/form-field/password-hint.d.ts +6 -3
  331. package/icon/icon.component.d.ts +1 -1
  332. package/input/_input-theme.scss +7 -6
  333. package/input/input-number-validators.d.ts +2 -2
  334. package/input/input-number.d.ts +1 -1
  335. package/input/input-password.d.ts +2 -2
  336. package/input/input.d.ts +1 -1
  337. package/link/_link-theme.scss +7 -8
  338. package/link/link.component.d.ts +1 -1
  339. package/list/_list-theme.scss +2 -5
  340. package/list/list-selection.component.d.ts +2 -2
  341. package/loader-overlay/_loader-overlay-theme.scss +2 -5
  342. package/loader-overlay/loader-overlay.component.d.ts +1 -1
  343. package/loader-overlay/loader-overlay.scss +3 -0
  344. package/markdown/_markdown-theme.scss +3 -6
  345. package/markdown/markdown.component.d.ts +1 -1
  346. package/modal/_modal-theme.scss +3 -5
  347. package/modal/modal.component.d.ts +5 -2
  348. package/modal/modal.module.d.ts +2 -1
  349. package/modal/modal.scss +14 -2
  350. package/modal/modal.type.d.ts +3 -3
  351. package/navbar/_navbar-theme.scss +2 -6
  352. package/navbar/navbar-item.component.d.ts +5 -4
  353. package/navbar/navbar.component.d.ts +7 -4
  354. package/navbar/vertical-navbar.component.d.ts +5 -3
  355. package/package.json +156 -246
  356. package/popover/_popover-theme.scss +2 -6
  357. package/popover/popover-confirm.component.d.ts +1 -1
  358. package/popover/popover.component.d.ts +1 -1
  359. package/prebuilt-themes/dark-theme.css +1 -1
  360. package/prebuilt-themes/default-theme.css +1 -1
  361. package/progress-bar/progress-bar.component.d.ts +2 -2
  362. package/progress-spinner/progress-spinner.component.d.ts +3 -3
  363. package/radio/_radio-theme.scss +6 -6
  364. package/radio/radio.component.d.ts +2 -2
  365. package/select/_select-theme.scss +2 -5
  366. package/select/select.component.d.ts +12 -9
  367. package/select/select.scss +3 -1
  368. package/sidebar/sidebar.component.d.ts +3 -3
  369. package/sidepanel/_sidepanel-theme.scss +2 -5
  370. package/sidepanel/sidepanel-directives.d.ts +2 -2
  371. package/splitter/splitter.component.d.ts +3 -3
  372. package/table/_table-theme.scss +2 -5
  373. package/tabs/_tabs-theme.scss +2 -5
  374. package/tabs/paginated-tab-header.d.ts +3 -3
  375. package/tabs/tab-body.component.d.ts +3 -3
  376. package/tabs/tab-group.component.d.ts +2 -2
  377. package/tabs/tab-header.component.d.ts +2 -2
  378. package/tabs/tab-label-wrapper.directive.d.ts +1 -1
  379. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +1 -1
  380. package/tabs/tab.component.d.ts +1 -1
  381. package/tags/_tag-theme.scss +2 -5
  382. package/tags/tag-default-options.d.ts +4 -0
  383. package/tags/tag-input.d.ts +1 -1
  384. package/tags/tag-list.component.d.ts +2 -1
  385. package/tags/tag-list.scss +6 -2
  386. package/tags/tag.component.d.ts +2 -2
  387. package/textarea/_textarea-theme.scss +2 -5
  388. package/textarea/textarea.component.d.ts +1 -1
  389. package/timepicker/timepicker.directive.d.ts +1 -1
  390. package/timezone/_timezone-option-theme.scss +2 -5
  391. package/timezone/timezone-option.component.d.ts +1 -1
  392. package/toast/_toast-theme.scss +2 -5
  393. package/toast/toast.type.d.ts +1 -1
  394. package/toggle/_toggle-theme.scss +2 -5
  395. package/toggle/toggle.component.d.ts +2 -2
  396. package/tooltip/_tooltip-theme.scss +2 -5
  397. package/tooltip/tooltip.component.d.ts +3 -3
  398. package/tree/_tree-theme.scss +2 -4
  399. package/tree/node.d.ts +1 -1
  400. package/tree/padding.directive.d.ts +1 -1
  401. package/tree/toggle.d.ts +2 -2
  402. package/tree/tree-base.d.ts +1 -1
  403. package/tree/tree-option.component.d.ts +1 -1
  404. package/tree/tree-option.scss +4 -2
  405. package/tree/tree-selection.component.d.ts +1 -1
  406. package/tree-select/_tree-select-theme.scss +2 -5
  407. package/tree-select/tree-select.component.d.ts +1 -1
  408. package/esm2020/autocomplete/autocomplete-trigger.directive.mjs +0 -552
  409. package/esm2020/button/button.component.mjs +0 -148
  410. package/esm2020/button-toggle/button-toggle.component.mjs +0 -381
  411. package/esm2020/card/card.component.mjs +0 -80
  412. package/esm2020/checkbox/checkbox.mjs +0 -300
  413. package/esm2020/code-block/code-block.component.mjs +0 -157
  414. package/esm2020/code-block/code-block.module.mjs +0 -60
  415. package/esm2020/core/common-behaviors/color.mjs +0 -33
  416. package/esm2020/core/formatters/index.mjs +0 -78
  417. package/esm2020/core/formatters/number/formatter.mjs +0 -129
  418. package/esm2020/core/locales/en-US.mjs +0 -10
  419. package/esm2020/core/locales/es-LA.mjs +0 -6
  420. package/esm2020/core/locales/fa-IR.mjs +0 -6
  421. package/esm2020/core/locales/pt-BR.mjs +0 -6
  422. package/esm2020/core/locales/ru-RU.mjs +0 -10
  423. package/esm2020/core/locales/zh-CN.mjs +0 -6
  424. package/esm2020/core/option/option.mjs +0 -262
  425. package/esm2020/core/overlay/overlay-position-map.mjs +0 -245
  426. package/esm2020/core/services/measure-scrollbar.service.mjs +0 -48
  427. package/esm2020/datepicker/calendar-header.component.mjs +0 -134
  428. package/esm2020/datepicker/calendar.component.mjs +0 -175
  429. package/esm2020/datepicker/datepicker-input.directive.mjs +0 -954
  430. package/esm2020/datepicker/datepicker-toggle.component.mjs +0 -86
  431. package/esm2020/datepicker/datepicker.component.mjs +0 -393
  432. package/esm2020/datepicker/month-view.component.mjs +0 -158
  433. package/esm2020/dropdown/dropdown-trigger.directive.mjs +0 -489
  434. package/esm2020/dropdown/dropdown.component.mjs +0 -292
  435. package/esm2020/ellipsis-center/ellipsis-center.directive.mjs +0 -106
  436. package/esm2020/file-upload/multiple-file-upload.component.mjs +0 -161
  437. package/esm2020/file-upload/single-file-upload.component.mjs +0 -130
  438. package/esm2020/form-field/form-field.mjs +0 -270
  439. package/esm2020/form-field/password-hint.mjs +0 -138
  440. package/esm2020/form-field/validate.directive.mjs +0 -158
  441. package/esm2020/input/input-number.mjs +0 -168
  442. package/esm2020/input/input-password.mjs +0 -343
  443. package/esm2020/input/input.mjs +0 -297
  444. package/esm2020/link/link.component.mjs +0 -122
  445. package/esm2020/list/list-selection.component.mjs +0 -705
  446. package/esm2020/loader-overlay/loader-overlay.component.mjs +0 -103
  447. package/esm2020/modal/modal-control.service.mjs +0 -85
  448. package/esm2020/modal/modal.component.mjs +0 -510
  449. package/esm2020/modal/modal.module.mjs +0 -71
  450. package/esm2020/navbar/navbar-item.component.mjs +0 -605
  451. package/esm2020/navbar/navbar.component.mjs +0 -239
  452. package/esm2020/popover/popover-confirm.component.mjs +0 -108
  453. package/esm2020/popover/popover.component.mjs +0 -266
  454. package/esm2020/radio/radio.component.mjs +0 -456
  455. package/esm2020/select/select-option.directive.mjs +0 -65
  456. package/esm2020/select/select.component.mjs +0 -1146
  457. package/esm2020/sidebar/sidebar.component.mjs +0 -146
  458. package/esm2020/sidepanel/sidepanel-container.component.mjs +0 -110
  459. package/esm2020/splitter/splitter.component.mjs +0 -482
  460. package/esm2020/tabs/paginated-tab-header.mjs +0 -488
  461. package/esm2020/tabs/tab-body.component.mjs +0 -179
  462. package/esm2020/tabs/tab-group.component.mjs +0 -349
  463. package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +0 -111
  464. package/esm2020/tags/tag-default-options.mjs +0 -4
  465. package/esm2020/tags/tag-input.mjs +0 -248
  466. package/esm2020/tags/tag-list.component.mjs +0 -714
  467. package/esm2020/tags/tag.component.mjs +0 -381
  468. package/esm2020/tags/tag.module.mjs +0 -56
  469. package/esm2020/textarea/textarea.component.mjs +0 -254
  470. package/esm2020/timepicker/timepicker.directive.mjs +0 -647
  471. package/esm2020/timezone/timezone-option.component.mjs +0 -48
  472. package/esm2020/title/title.directive.mjs +0 -107
  473. package/esm2020/toast/toast.component.mjs +0 -92
  474. package/esm2020/toast/toast.module.mjs +0 -42
  475. package/esm2020/toast/toast.service.mjs +0 -188
  476. package/esm2020/toggle/toggle.component.mjs +0 -156
  477. package/esm2020/tooltip/tooltip.component.mjs +0 -299
  478. package/esm2020/tree/data-source/flat-data-source.mjs +0 -162
  479. package/esm2020/tree/padding.directive.mjs +0 -113
  480. package/esm2020/tree/toggle.mjs +0 -81
  481. package/esm2020/tree/tree-base.mjs +0 -243
  482. package/esm2020/tree/tree-option.component.mjs +0 -299
  483. package/esm2020/tree/tree-selection.component.mjs +0 -557
  484. package/esm2020/tree-select/tree-select.component.mjs +0 -936
  485. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs +0 -753
  486. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs.map +0 -1
  487. package/fesm2015/ptsecurity-mosaic-button-toggle.mjs +0 -405
  488. package/fesm2015/ptsecurity-mosaic-button-toggle.mjs.map +0 -1
  489. package/fesm2015/ptsecurity-mosaic-button.mjs +0 -193
  490. package/fesm2015/ptsecurity-mosaic-button.mjs.map +0 -1
  491. package/fesm2015/ptsecurity-mosaic-card.mjs +0 -111
  492. package/fesm2015/ptsecurity-mosaic-card.mjs.map +0 -1
  493. package/fesm2015/ptsecurity-mosaic-checkbox.mjs +0 -351
  494. package/fesm2015/ptsecurity-mosaic-checkbox.mjs.map +0 -1
  495. package/fesm2015/ptsecurity-mosaic-code-block.mjs +0 -280
  496. package/fesm2015/ptsecurity-mosaic-code-block.mjs.map +0 -1
  497. package/fesm2015/ptsecurity-mosaic-core.mjs +0 -2314
  498. package/fesm2015/ptsecurity-mosaic-core.mjs.map +0 -1
  499. package/fesm2015/ptsecurity-mosaic-datepicker.mjs +0 -2112
  500. package/fesm2015/ptsecurity-mosaic-datepicker.mjs.map +0 -1
  501. package/fesm2015/ptsecurity-mosaic-divider.mjs +0 -61
  502. package/fesm2015/ptsecurity-mosaic-divider.mjs.map +0 -1
  503. package/fesm2015/ptsecurity-mosaic-dl.mjs +0 -126
  504. package/fesm2015/ptsecurity-mosaic-dl.mjs.map +0 -1
  505. package/fesm2015/ptsecurity-mosaic-dropdown.mjs +0 -1115
  506. package/fesm2015/ptsecurity-mosaic-dropdown.mjs.map +0 -1
  507. package/fesm2015/ptsecurity-mosaic-ellipsis-center.mjs +0 -113
  508. package/fesm2015/ptsecurity-mosaic-ellipsis-center.mjs.map +0 -1
  509. package/fesm2015/ptsecurity-mosaic-file-upload.mjs +0 -392
  510. package/fesm2015/ptsecurity-mosaic-file-upload.mjs.map +0 -1
  511. package/fesm2015/ptsecurity-mosaic-form-field.mjs +0 -768
  512. package/fesm2015/ptsecurity-mosaic-form-field.mjs.map +0 -1
  513. package/fesm2015/ptsecurity-mosaic-icon.mjs +0 -86
  514. package/fesm2015/ptsecurity-mosaic-icon.mjs.map +0 -1
  515. package/fesm2015/ptsecurity-mosaic-input.mjs +0 -951
  516. package/fesm2015/ptsecurity-mosaic-input.mjs.map +0 -1
  517. package/fesm2015/ptsecurity-mosaic-link.mjs +0 -150
  518. package/fesm2015/ptsecurity-mosaic-link.mjs.map +0 -1
  519. package/fesm2015/ptsecurity-mosaic-list.mjs +0 -807
  520. package/fesm2015/ptsecurity-mosaic-list.mjs.map +0 -1
  521. package/fesm2015/ptsecurity-mosaic-loader-overlay.mjs +0 -157
  522. package/fesm2015/ptsecurity-mosaic-markdown.mjs +0 -128
  523. package/fesm2015/ptsecurity-mosaic-markdown.mjs.map +0 -1
  524. package/fesm2015/ptsecurity-mosaic-modal.mjs +0 -875
  525. package/fesm2015/ptsecurity-mosaic-modal.mjs.map +0 -1
  526. package/fesm2015/ptsecurity-mosaic-navbar.mjs +0 -1054
  527. package/fesm2015/ptsecurity-mosaic-navbar.mjs.map +0 -1
  528. package/fesm2015/ptsecurity-mosaic-popover.mjs +0 -411
  529. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs +0 -74
  530. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs.map +0 -1
  531. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs +0 -93
  532. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs.map +0 -1
  533. package/fesm2015/ptsecurity-mosaic-radio.mjs +0 -480
  534. package/fesm2015/ptsecurity-mosaic-select.mjs +0 -1286
  535. package/fesm2015/ptsecurity-mosaic-select.mjs.map +0 -1
  536. package/fesm2015/ptsecurity-mosaic-sidebar.mjs +0 -202
  537. package/fesm2015/ptsecurity-mosaic-sidebar.mjs.map +0 -1
  538. package/fesm2015/ptsecurity-mosaic-sidepanel.mjs +0 -622
  539. package/fesm2015/ptsecurity-mosaic-sidepanel.mjs.map +0 -1
  540. package/fesm2015/ptsecurity-mosaic-splitter.mjs.map +0 -1
  541. package/fesm2015/ptsecurity-mosaic-table.mjs +0 -45
  542. package/fesm2015/ptsecurity-mosaic-table.mjs.map +0 -1
  543. package/fesm2015/ptsecurity-mosaic-tabs.mjs +0 -1523
  544. package/fesm2015/ptsecurity-mosaic-tabs.mjs.map +0 -1
  545. package/fesm2015/ptsecurity-mosaic-tags.mjs +0 -1391
  546. package/fesm2015/ptsecurity-mosaic-tags.mjs.map +0 -1
  547. package/fesm2015/ptsecurity-mosaic-textarea.mjs +0 -280
  548. package/fesm2015/ptsecurity-mosaic-timepicker.mjs +0 -708
  549. package/fesm2015/ptsecurity-mosaic-timepicker.mjs.map +0 -1
  550. package/fesm2015/ptsecurity-mosaic-timezone.mjs +0 -316
  551. package/fesm2015/ptsecurity-mosaic-timezone.mjs.map +0 -1
  552. package/fesm2015/ptsecurity-mosaic-title.mjs +0 -128
  553. package/fesm2015/ptsecurity-mosaic-title.mjs.map +0 -1
  554. package/fesm2015/ptsecurity-mosaic-toast.mjs +0 -379
  555. package/fesm2015/ptsecurity-mosaic-toast.mjs.map +0 -1
  556. package/fesm2015/ptsecurity-mosaic-toggle.mjs +0 -178
  557. package/fesm2015/ptsecurity-mosaic-toggle.mjs.map +0 -1
  558. package/fesm2015/ptsecurity-mosaic-tooltip.mjs +0 -369
  559. package/fesm2015/ptsecurity-mosaic-tooltip.mjs.map +0 -1
  560. package/fesm2015/ptsecurity-mosaic-tree-select.mjs +0 -983
  561. package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +0 -1
  562. package/fesm2015/ptsecurity-mosaic-tree.mjs +0 -1815
  563. package/fesm2015/ptsecurity-mosaic-tree.mjs.map +0 -1
  564. package/fesm2020/ptsecurity-mosaic-autocomplete.mjs.map +0 -1
  565. package/fesm2020/ptsecurity-mosaic-core.mjs.map +0 -1
  566. package/fesm2020/ptsecurity-mosaic-datepicker.mjs.map +0 -1
  567. package/fesm2020/ptsecurity-mosaic-file-upload.mjs.map +0 -1
  568. package/fesm2020/ptsecurity-mosaic-form-field.mjs.map +0 -1
  569. package/fesm2020/ptsecurity-mosaic-icon.mjs.map +0 -1
  570. package/fesm2020/ptsecurity-mosaic-loader-overlay.mjs +0 -155
  571. package/fesm2020/ptsecurity-mosaic-loader-overlay.mjs.map +0 -1
  572. package/fesm2020/ptsecurity-mosaic-modal.mjs.map +0 -1
  573. package/fesm2020/ptsecurity-mosaic-navbar.mjs.map +0 -1
  574. package/fesm2020/ptsecurity-mosaic-popover.mjs.map +0 -1
  575. package/fesm2020/ptsecurity-mosaic-radio.mjs.map +0 -1
  576. package/fesm2020/ptsecurity-mosaic-select.mjs.map +0 -1
  577. package/fesm2020/ptsecurity-mosaic-splitter.mjs +0 -524
  578. package/fesm2020/ptsecurity-mosaic-table.mjs +0 -45
  579. package/fesm2020/ptsecurity-mosaic-table.mjs.map +0 -1
  580. package/fesm2020/ptsecurity-mosaic-tabs.mjs.map +0 -1
  581. package/fesm2020/ptsecurity-mosaic-tags.mjs.map +0 -1
  582. package/fesm2020/ptsecurity-mosaic-textarea.mjs.map +0 -1
  583. package/fesm2020/ptsecurity-mosaic-timezone.mjs +0 -314
  584. package/fesm2020/ptsecurity-mosaic-title.mjs.map +0 -1
  585. package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +0 -1
  586. package/fesm2020/ptsecurity-mosaic-tree.mjs.map +0 -1
  587. package/fesm2020/ptsecurity-mosaic.mjs +0 -4
  588. package/fesm2020/ptsecurity-mosaic.mjs.map +0 -1
  589. /package/{esm2020 → esm2022}/autocomplete/index.mjs +0 -0
  590. /package/{esm2020 → esm2022}/autocomplete/ptsecurity-mosaic-autocomplete.mjs +0 -0
  591. /package/{esm2020 → esm2022}/autocomplete/public-api.mjs +0 -0
  592. /package/{esm2020 → esm2022}/button/index.mjs +0 -0
  593. /package/{esm2020 → esm2022}/button/ptsecurity-mosaic-button.mjs +0 -0
  594. /package/{esm2020 → esm2022}/button/public-api.mjs +0 -0
  595. /package/{esm2020 → esm2022}/button-toggle/index.mjs +0 -0
  596. /package/{esm2020 → esm2022}/button-toggle/ptsecurity-mosaic-button-toggle.mjs +0 -0
  597. /package/{esm2020 → esm2022}/button-toggle/public-api.mjs +0 -0
  598. /package/{esm2020 → esm2022}/card/index.mjs +0 -0
  599. /package/{esm2020 → esm2022}/card/ptsecurity-mosaic-card.mjs +0 -0
  600. /package/{esm2020 → esm2022}/card/public-api.mjs +0 -0
  601. /package/{esm2020 → esm2022}/checkbox/checkbox-config.mjs +0 -0
  602. /package/{esm2020 → esm2022}/checkbox/index.mjs +0 -0
  603. /package/{esm2020 → esm2022}/checkbox/ptsecurity-mosaic-checkbox.mjs +0 -0
  604. /package/{esm2020 → esm2022}/checkbox/public-api.mjs +0 -0
  605. /package/{esm2020 → esm2022}/code-block/code-block.types.mjs +0 -0
  606. /package/{esm2020 → esm2022}/code-block/index.mjs +0 -0
  607. /package/{esm2020 → esm2022}/code-block/ptsecurity-mosaic-code-block.mjs +0 -0
  608. /package/{esm2020 → esm2022}/code-block/public-api.mjs +0 -0
  609. /package/{esm2020 → esm2022}/core/animation/animation.mjs +0 -0
  610. /package/{esm2020 → esm2022}/core/animation/fade-animations.mjs +0 -0
  611. /package/{esm2020 → esm2022}/core/animation/index.mjs +0 -0
  612. /package/{esm2020 → esm2022}/core/animation/select-animations.mjs +0 -0
  613. /package/{esm2020 → esm2022}/core/common-behaviors/constructor.mjs +0 -0
  614. /package/{esm2020 → esm2022}/core/common-behaviors/error-state.mjs +0 -0
  615. /package/{esm2020 → esm2022}/core/common-behaviors/index.mjs +0 -0
  616. /package/{esm2020 → esm2022}/core/datetime/date-adapter.mjs +0 -0
  617. /package/{esm2020 → esm2022}/core/datetime/date-formats.mjs +0 -0
  618. /package/{esm2020 → esm2022}/core/datetime/index.mjs +0 -0
  619. /package/{esm2020 → esm2022}/core/forms/index.mjs +0 -0
  620. /package/{esm2020 → esm2022}/core/index.mjs +0 -0
  621. /package/{esm2020 → esm2022}/core/label/label-options.mjs +0 -0
  622. /package/{esm2020 → esm2022}/core/locales/index.mjs +0 -0
  623. /package/{esm2020 → esm2022}/core/option/index.mjs +0 -0
  624. /package/{esm2020 → esm2022}/core/pop-up/constants.mjs +0 -0
  625. /package/{esm2020 → esm2022}/core/pop-up/index.mjs +0 -0
  626. /package/{esm2020 → esm2022}/core/ptsecurity-mosaic-core.mjs +0 -0
  627. /package/{esm2020 → esm2022}/core/public-api.mjs +0 -0
  628. /package/{esm2020 → esm2022}/core/select/constants.mjs +0 -0
  629. /package/{esm2020 → esm2022}/core/select/errors.mjs +0 -0
  630. /package/{esm2020 → esm2022}/core/select/events.mjs +0 -0
  631. /package/{esm2020 → esm2022}/core/select/index.mjs +0 -0
  632. /package/{esm2020 → esm2022}/core/selection/constants.mjs +0 -0
  633. /package/{esm2020 → esm2022}/core/selection/index.mjs +0 -0
  634. /package/{esm2020 → esm2022}/core/title/index.mjs +0 -0
  635. /package/{esm2020 → esm2022}/core/title/title-text-ref.mjs +0 -0
  636. /package/{esm2020 → esm2022}/core/utils/data-size/config.mjs +0 -0
  637. /package/{esm2020 → esm2022}/core/utils/data-size/index.mjs +0 -0
  638. /package/{esm2020 → esm2022}/core/utils/data-size/size.mjs +0 -0
  639. /package/{esm2020 → esm2022}/core/utils/index.mjs +0 -0
  640. /package/{esm2020 → esm2022}/core/utils/public-api.mjs +0 -0
  641. /package/{esm2020 → esm2022}/core/utils/utils.mjs +0 -0
  642. /package/{esm2020 → esm2022}/core/validation/index.mjs +0 -0
  643. /package/{esm2020 → esm2022}/core/validation/validation.mjs +0 -0
  644. /package/{esm2020 → esm2022}/datepicker/datepicker-animations.mjs +0 -0
  645. /package/{esm2020 → esm2022}/datepicker/datepicker-errors.mjs +0 -0
  646. /package/{esm2020 → esm2022}/datepicker/index.mjs +0 -0
  647. /package/{esm2020 → esm2022}/datepicker/ptsecurity-mosaic-datepicker.mjs +0 -0
  648. /package/{esm2020 → esm2022}/datepicker/public-api.mjs +0 -0
  649. /package/{esm2020 → esm2022}/divider/index.mjs +0 -0
  650. /package/{esm2020 → esm2022}/divider/ptsecurity-mosaic-divider.mjs +0 -0
  651. /package/{esm2020 → esm2022}/divider/public-api.mjs +0 -0
  652. /package/{esm2020 → esm2022}/dl/index.mjs +0 -0
  653. /package/{esm2020 → esm2022}/dl/ptsecurity-mosaic-dl.mjs +0 -0
  654. /package/{esm2020 → esm2022}/dl/public-api.mjs +0 -0
  655. /package/{esm2020 → esm2022}/dropdown/dropdown-animations.mjs +0 -0
  656. /package/{esm2020 → esm2022}/dropdown/dropdown-errors.mjs +0 -0
  657. /package/{esm2020 → esm2022}/dropdown/dropdown.types.mjs +0 -0
  658. /package/{esm2020 → esm2022}/dropdown/index.mjs +0 -0
  659. /package/{esm2020 → esm2022}/dropdown/ptsecurity-mosaic-dropdown.mjs +0 -0
  660. /package/{esm2020 → esm2022}/dropdown/public-api.mjs +0 -0
  661. /package/{esm2020 → esm2022}/ellipsis-center/index.mjs +0 -0
  662. /package/{esm2020 → esm2022}/ellipsis-center/ptsecurity-mosaic-ellipsis-center.mjs +0 -0
  663. /package/{esm2020 → esm2022}/ellipsis-center/public-api.mjs +0 -0
  664. /package/{esm2020 → esm2022}/file-upload/file-upload.mjs +0 -0
  665. /package/{esm2020 → esm2022}/file-upload/index.mjs +0 -0
  666. /package/{esm2020 → esm2022}/file-upload/ptsecurity-mosaic-file-upload.mjs +0 -0
  667. /package/{esm2020 → esm2022}/file-upload/public-api.mjs +0 -0
  668. /package/{esm2020 → esm2022}/form-field/form-field-control.mjs +0 -0
  669. /package/{esm2020 → esm2022}/form-field/form-field-errors.mjs +0 -0
  670. /package/{esm2020 → esm2022}/form-field/index.mjs +0 -0
  671. /package/{esm2020 → esm2022}/form-field/ptsecurity-mosaic-form-field.mjs +0 -0
  672. /package/{esm2020 → esm2022}/form-field/public-api.mjs +0 -0
  673. /package/{esm2020 → esm2022}/icon/index.mjs +0 -0
  674. /package/{esm2020 → esm2022}/icon/ptsecurity-mosaic-icon.mjs +0 -0
  675. /package/{esm2020 → esm2022}/icon/public-api.mjs +0 -0
  676. /package/{esm2020 → esm2022}/index.mjs +0 -0
  677. /package/{esm2020 → esm2022}/input/index.mjs +0 -0
  678. /package/{esm2020 → esm2022}/input/input-errors.mjs +0 -0
  679. /package/{esm2020 → esm2022}/input/input-value-accessor.mjs +0 -0
  680. /package/{esm2020 → esm2022}/input/ptsecurity-mosaic-input.mjs +0 -0
  681. /package/{esm2020 → esm2022}/input/public-api.mjs +0 -0
  682. /package/{esm2020 → esm2022}/link/index.mjs +0 -0
  683. /package/{esm2020 → esm2022}/link/ptsecurity-mosaic-link.mjs +0 -0
  684. /package/{esm2020 → esm2022}/link/public-api.mjs +0 -0
  685. /package/{esm2020 → esm2022}/list/index.mjs +0 -0
  686. /package/{esm2020 → esm2022}/list/ptsecurity-mosaic-list.mjs +0 -0
  687. /package/{esm2020 → esm2022}/list/public-api.mjs +0 -0
  688. /package/{esm2020 → esm2022}/loader-overlay/index.mjs +0 -0
  689. /package/{esm2020 → esm2022}/loader-overlay/ptsecurity-mosaic-loader-overlay.mjs +0 -0
  690. /package/{esm2020 → esm2022}/loader-overlay/public-api.mjs +0 -0
  691. /package/{esm2020 → esm2022}/markdown/index.mjs +0 -0
  692. /package/{esm2020 → esm2022}/markdown/markdown.values.mjs +0 -0
  693. /package/{esm2020 → esm2022}/markdown/ptsecurity-mosaic-markdown.mjs +0 -0
  694. /package/{esm2020 → esm2022}/markdown/public-api.mjs +0 -0
  695. /package/{esm2020 → esm2022}/modal/index.mjs +0 -0
  696. /package/{esm2020 → esm2022}/modal/modal-ref.class.mjs +0 -0
  697. /package/{esm2020 → esm2022}/modal/modal-util.mjs +0 -0
  698. /package/{esm2020 → esm2022}/modal/modal.type.mjs +0 -0
  699. /package/{esm2020 → esm2022}/modal/ptsecurity-mosaic-modal.mjs +0 -0
  700. /package/{esm2020 → esm2022}/modal/public-api.mjs +0 -0
  701. /package/{esm2020 → esm2022}/navbar/index.mjs +0 -0
  702. /package/{esm2020 → esm2022}/navbar/ptsecurity-mosaic-navbar.mjs +0 -0
  703. /package/{esm2020 → esm2022}/navbar/public-api.mjs +0 -0
  704. /package/{esm2020 → esm2022}/navbar/vertical-navbar.animation.mjs +0 -0
  705. /package/{esm2020 → esm2022}/popover/index.mjs +0 -0
  706. /package/{esm2020 → esm2022}/popover/popover-animations.mjs +0 -0
  707. /package/{esm2020 → esm2022}/popover/ptsecurity-mosaic-popover.mjs +0 -0
  708. /package/{esm2020 → esm2022}/popover/public-api.mjs +0 -0
  709. /package/{esm2020 → esm2022}/progress-bar/index.mjs +0 -0
  710. /package/{esm2020 → esm2022}/progress-bar/ptsecurity-mosaic-progress-bar.mjs +0 -0
  711. /package/{esm2020 → esm2022}/progress-bar/public-api.mjs +0 -0
  712. /package/{esm2020 → esm2022}/progress-spinner/index.mjs +0 -0
  713. /package/{esm2020 → esm2022}/progress-spinner/ptsecurity-mosaic-progress-spinner.mjs +0 -0
  714. /package/{esm2020 → esm2022}/progress-spinner/public-api.mjs +0 -0
  715. /package/{esm2020 → esm2022}/ptsecurity-mosaic.mjs +0 -0
  716. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
  717. /package/{esm2020 → esm2022}/radio/index.mjs +0 -0
  718. /package/{esm2020 → esm2022}/radio/ptsecurity-mosaic-radio.mjs +0 -0
  719. /package/{esm2020 → esm2022}/radio/public-api.mjs +0 -0
  720. /package/{esm2020 → esm2022}/select/index.mjs +0 -0
  721. /package/{esm2020 → esm2022}/select/ptsecurity-mosaic-select.mjs +0 -0
  722. /package/{esm2020 → esm2022}/select/public-api.mjs +0 -0
  723. /package/{esm2020 → esm2022}/sidebar/index.mjs +0 -0
  724. /package/{esm2020 → esm2022}/sidebar/ptsecurity-mosaic-sidebar.mjs +0 -0
  725. /package/{esm2020 → esm2022}/sidebar/public-api.mjs +0 -0
  726. /package/{esm2020 → esm2022}/sidebar/sidebar-animations.mjs +0 -0
  727. /package/{esm2020 → esm2022}/sidepanel/index.mjs +0 -0
  728. /package/{esm2020 → esm2022}/sidepanel/ptsecurity-mosaic-sidepanel.mjs +0 -0
  729. /package/{esm2020 → esm2022}/sidepanel/public-api.mjs +0 -0
  730. /package/{esm2020 → esm2022}/sidepanel/sidepanel-animations.mjs +0 -0
  731. /package/{esm2020 → esm2022}/sidepanel/sidepanel-config.mjs +0 -0
  732. /package/{esm2020 → esm2022}/sidepanel/sidepanel-ref.mjs +0 -0
  733. /package/{esm2020 → esm2022}/splitter/index.mjs +0 -0
  734. /package/{esm2020 → esm2022}/splitter/ptsecurity-mosaic-splitter.mjs +0 -0
  735. /package/{esm2020 → esm2022}/splitter/public-api.mjs +0 -0
  736. /package/{esm2020 → esm2022}/table/index.mjs +0 -0
  737. /package/{esm2020 → esm2022}/table/ptsecurity-mosaic-table.mjs +0 -0
  738. /package/{esm2020 → esm2022}/table/public-api.mjs +0 -0
  739. /package/{esm2020 → esm2022}/tabs/index.mjs +0 -0
  740. /package/{esm2020 → esm2022}/tabs/ptsecurity-mosaic-tabs.mjs +0 -0
  741. /package/{esm2020 → esm2022}/tabs/public-api.mjs +0 -0
  742. /package/{esm2020 → esm2022}/tabs/tab-nav-bar/index.mjs +0 -0
  743. /package/{esm2020 → esm2022}/tabs/tabs-animations.mjs +0 -0
  744. /package/{esm2020 → esm2022}/tags/index.mjs +0 -0
  745. /package/{esm2020 → esm2022}/tags/ptsecurity-mosaic-tags.mjs +0 -0
  746. /package/{esm2020 → esm2022}/tags/public-api.mjs +0 -0
  747. /package/{esm2020 → esm2022}/tags/tag-text-control.mjs +0 -0
  748. /package/{esm2020 → esm2022}/textarea/index.mjs +0 -0
  749. /package/{esm2020 → esm2022}/textarea/ptsecurity-mosaic-textarea.mjs +0 -0
  750. /package/{esm2020 → esm2022}/textarea/public-api.mjs +0 -0
  751. /package/{esm2020 → esm2022}/timepicker/index.mjs +0 -0
  752. /package/{esm2020 → esm2022}/timepicker/ptsecurity-mosaic-timepicker.mjs +0 -0
  753. /package/{esm2020 → esm2022}/timepicker/public-api.mjs +0 -0
  754. /package/{esm2020 → esm2022}/timepicker/timepicker.constants.mjs +0 -0
  755. /package/{esm2020 → esm2022}/timezone/index.mjs +0 -0
  756. /package/{esm2020 → esm2022}/timezone/ptsecurity-mosaic-timezone.mjs +0 -0
  757. /package/{esm2020 → esm2022}/timezone/public-api.mjs +0 -0
  758. /package/{esm2020 → esm2022}/timezone/timezone.models.mjs +0 -0
  759. /package/{esm2020 → esm2022}/timezone/timezone.utils.mjs +0 -0
  760. /package/{esm2020 → esm2022}/title/index.mjs +0 -0
  761. /package/{esm2020 → esm2022}/title/ptsecurity-mosaic-title.mjs +0 -0
  762. /package/{esm2020 → esm2022}/title/public-api.mjs +0 -0
  763. /package/{esm2020 → esm2022}/toast/index.mjs +0 -0
  764. /package/{esm2020 → esm2022}/toast/ptsecurity-mosaic-toast.mjs +0 -0
  765. /package/{esm2020 → esm2022}/toast/public-api.mjs +0 -0
  766. /package/{esm2020 → esm2022}/toast/toast-animations.mjs +0 -0
  767. /package/{esm2020 → esm2022}/toast/toast.type.mjs +0 -0
  768. /package/{esm2020 → esm2022}/toggle/index.mjs +0 -0
  769. /package/{esm2020 → esm2022}/toggle/ptsecurity-mosaic-toggle.mjs +0 -0
  770. /package/{esm2020 → esm2022}/toggle/public-api.mjs +0 -0
  771. /package/{esm2020 → esm2022}/tooltip/index.mjs +0 -0
  772. /package/{esm2020 → esm2022}/tooltip/ptsecurity-mosaic-tooltip.mjs +0 -0
  773. /package/{esm2020 → esm2022}/tooltip/public-api.mjs +0 -0
  774. /package/{esm2020 → esm2022}/tooltip/tooltip.animations.mjs +0 -0
  775. /package/{esm2020 → esm2022}/tree/control/base-tree-control.mjs +0 -0
  776. /package/{esm2020 → esm2022}/tree/control/flat-tree-control.mjs +0 -0
  777. /package/{esm2020 → esm2022}/tree/control/nested-tree-control.mjs +0 -0
  778. /package/{esm2020 → esm2022}/tree/control/tree-control.mjs +0 -0
  779. /package/{esm2020 → esm2022}/tree/data-source/nested-data-source.mjs +0 -0
  780. /package/{esm2020 → esm2022}/tree/index.mjs +0 -0
  781. /package/{esm2020 → esm2022}/tree/ptsecurity-mosaic-tree.mjs +0 -0
  782. /package/{esm2020 → esm2022}/tree/public-api.mjs +0 -0
  783. /package/{esm2020 → esm2022}/tree/tree-errors.mjs +0 -0
  784. /package/{esm2020 → esm2022}/tree-select/index.mjs +0 -0
  785. /package/{esm2020 → esm2022}/tree-select/ptsecurity-mosaic-tree-select.mjs +0 -0
  786. /package/{esm2020 → esm2022}/tree-select/public-api.mjs +0 -0
  787. /package/{fesm2015 → fesm2022}/ptsecurity-mosaic.mjs +0 -0
  788. /package/{fesm2015 → fesm2022}/ptsecurity-mosaic.mjs.map +0 -0
@@ -1,1815 +0,0 @@
1
- import * as i1 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { Directive, Input, ViewChild, ContentChildren, forwardRef, Inject, Component, ViewEncapsulation, ChangeDetectionStrategy, InjectionToken, EventEmitter, ContentChild, Output, Optional, QueryList, Attribute, NgModule } from '@angular/core';
5
- import * as i2 from '@ptsecurity/mosaic/core';
6
- import { mixinDisabled, MC_TITLE_TEXT_REF, MC_OPTION_ACTION_PARENT, McPseudoCheckbox, McOptionActionComponent, MultipleMode, getMcSelectNonArrayValueError, McPseudoCheckboxModule, escapeRegExp } from '@ptsecurity/mosaic/core';
7
- import { BehaviorSubject, Subject, Observable, of, merge, asyncScheduler } from 'rxjs';
8
- import * as i1$1 from 'rxjs/internal/scheduler/AsyncScheduler';
9
- import { AsyncScheduler } from 'rxjs/internal/scheduler/AsyncScheduler';
10
- import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
11
- import { TreeSizePaddingLeft } from '@mosaic-design/tokens-fe-2022/web';
12
- import { takeUntil, map, take, delay } from 'rxjs/operators';
13
- import { TAB, hasModifierKey, SPACE, LEFT_ARROW, RIGHT_ARROW, isVerticalMovement, isSelectAll, isCopy, DOWN_ARROW, UP_ARROW, ENTER, HOME, END, PAGE_UP, PAGE_DOWN } from '@ptsecurity/cdk/keycodes';
14
- import { McDropdownTrigger } from '@ptsecurity/mosaic/dropdown';
15
- import { McTooltipTrigger } from '@ptsecurity/mosaic/tooltip';
16
- import * as i3 from '@angular/cdk/bidi';
17
- import { SelectionModel, DataSource } from '@angular/cdk/collections';
18
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
19
- import { FocusKeyManager } from '@ptsecurity/cdk/a11y';
20
- import * as i2$1 from '@angular/cdk/clipboard';
21
-
22
- /** Context provided to the tree node component. */
23
- class McTreeNodeOutletContext {
24
- constructor(data) {
25
- this.$implicit = data;
26
- }
27
- }
28
- /**
29
- * Data node definition for the McTree.
30
- * Captures the node's template and a when predicate that describes when this node should be used.
31
- */
32
- class McTreeNodeDef {
33
- /** @docs-private */
34
- constructor(template) {
35
- this.template = template;
36
- }
37
- }
38
- /** @nocollapse */ McTreeNodeDef.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeDef, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
39
- /** @nocollapse */ McTreeNodeDef.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McTreeNodeDef, selector: "[mcTreeNodeDef]", inputs: { when: ["mcTreeNodeDefWhen", "when"], data: ["mcTreeNode", "data"] }, ngImport: i0 });
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeDef, decorators: [{
41
- type: Directive,
42
- args: [{
43
- selector: '[mcTreeNodeDef]',
44
- inputs: ['when: mcTreeNodeDefWhen']
45
- }]
46
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { data: [{
47
- type: Input,
48
- args: ['mcTreeNode']
49
- }] } });
50
-
51
- class McTreeNodeOutlet {
52
- constructor(viewContainer, changeDetectorRef) {
53
- this.viewContainer = viewContainer;
54
- this.changeDetectorRef = changeDetectorRef;
55
- }
56
- }
57
- /** @nocollapse */ McTreeNodeOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeOutlet, deps: [{ token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
58
- /** @nocollapse */ McTreeNodeOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McTreeNodeOutlet, selector: "[mcTreeNodeOutlet]", ngImport: i0 });
59
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeOutlet, decorators: [{
60
- type: Directive,
61
- args: [{ selector: '[mcTreeNodeOutlet]' }]
62
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }]; } });
63
-
64
- /**
65
- * Returns an error to be thrown when there is no usable data.
66
- * @docs-private
67
- */
68
- function getTreeNoValidDataSourceError() {
69
- return Error(`A valid data source must be provided.`);
70
- }
71
- /**
72
- * Returns an error to be thrown when there are multiple nodes that are missing a when function.
73
- * @docs-private
74
- */
75
- function getTreeMultipleDefaultNodeDefsError() {
76
- return Error(`There can only be one default row without a when predicate function.`);
77
- }
78
- /**
79
- * Returns an error to be thrown when there are no matching node defs for a particular set of data.
80
- * @docs-private
81
- */
82
- function getTreeMissingMatchingNodeDefError() {
83
- return Error(`Could not find a matching node definition for the provided node data.`);
84
- }
85
- /**
86
- * Returns an error to be thrown when there are tree control.
87
- * @docs-private
88
- */
89
- function getTreeControlMissingError() {
90
- return Error(`Could not find a tree control for the tree.`);
91
- }
92
- /**
93
- * Returns an error to be thrown when tree control did not implement functions for flat/nested node.
94
- * @docs-private
95
- */
96
- function getTreeControlFunctionsMissingError() {
97
- return Error(`Could not find functions for nested/flat tree in tree control.`);
98
- }
99
-
100
- class McTreeBase {
101
- constructor(differs, changeDetectorRef) {
102
- this.differs = differs;
103
- this.changeDetectorRef = changeDetectorRef;
104
- // TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange.
105
- // Remove the MAX_VALUE in viewChange
106
- /**
107
- * Stream containing the latest information on what rows are being displayed on screen.
108
- * Can be used by the data source to as a heuristic of what data should be provided.
109
- */
110
- this.viewChange = new BehaviorSubject({ start: 0, end: Number.MAX_VALUE });
111
- /** Subject that emits when the component has been destroyed. */
112
- this.onDestroy = new Subject();
113
- /** Level of nodes */
114
- this.levels = new Map();
115
- }
116
- /**
117
- * Provides a stream containing the latest data array to render. Influenced by the tree's
118
- * stream of view window (what dataNodes are currently on screen).
119
- * Data source can be an observable of data array, or a dara array to render.
120
- */
121
- get dataSource() {
122
- return this._dataSource;
123
- }
124
- set dataSource(dataSource) {
125
- if (this._dataSource !== dataSource) {
126
- this.switchDataSource(dataSource);
127
- }
128
- }
129
- ngOnInit() {
130
- this.dataDiffer = this.differs.find([]).create(this.trackBy);
131
- if (!this.treeControl) {
132
- throw getTreeControlMissingError();
133
- }
134
- }
135
- ngOnDestroy() {
136
- this.nodeOutlet.viewContainer.clear();
137
- this.onDestroy.next();
138
- this.onDestroy.complete();
139
- // tslint:disable-next-line:no-unbound-method
140
- if (this._dataSource && typeof this.dataSource.disconnect === 'function') {
141
- this.dataSource.disconnect(this);
142
- }
143
- if (this.dataSubscription) {
144
- this.dataSubscription.unsubscribe();
145
- this.dataSubscription = null;
146
- }
147
- }
148
- ngAfterContentChecked() {
149
- const defaultNodeDefs = this.nodeDefs.filter((def) => !def.when);
150
- if (defaultNodeDefs.length > 1) {
151
- throw getTreeMultipleDefaultNodeDefsError();
152
- }
153
- this.defaultNodeDef = defaultNodeDefs[0];
154
- if (this.dataSource && this.nodeDefs && !this.dataSubscription) {
155
- this.observeRenderChanges();
156
- }
157
- }
158
- /** Check for changes made in the data and render each change (node added/removed/moved). */
159
- renderNodeChanges(data, dataDiffer = this.dataDiffer, viewContainer = this.nodeOutlet.viewContainer, parentData) {
160
- const changes = dataDiffer.diff(data);
161
- if (!changes) {
162
- return;
163
- }
164
- changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
165
- if (item.previousIndex == null) {
166
- this.insertNode(data[currentIndex], currentIndex, viewContainer, parentData);
167
- }
168
- else if (currentIndex == null) {
169
- viewContainer.remove(adjustedPreviousIndex);
170
- this.levels.delete(item.item);
171
- }
172
- else {
173
- const view = viewContainer.get(adjustedPreviousIndex);
174
- viewContainer.move(view, currentIndex);
175
- }
176
- });
177
- this.changeDetectorRef.detectChanges();
178
- }
179
- /**
180
- * Finds the matching node definition that should be used for this node data. If there is only
181
- * one node definition, it is returned. Otherwise, find the node definition that has a when
182
- * predicate that returns true with the data. If none return true, return the default node
183
- * definition.
184
- */
185
- getNodeDef(data, i) {
186
- if (this.nodeDefs.length === 1) {
187
- return this.nodeDefs.first;
188
- }
189
- const nodeDef = this.nodeDefs.find((def) => def.when && def.when(i, data)) || this.defaultNodeDef;
190
- if (!nodeDef) {
191
- throw getTreeMissingMatchingNodeDefError();
192
- }
193
- return nodeDef;
194
- }
195
- /**
196
- * Create the embedded view for the data node template and place it in the correct index location
197
- * within the data node view container.
198
- */
199
- insertNode(nodeData, index, viewContainer, parentData) {
200
- const node = this.getNodeDef(nodeData, index);
201
- // Node context that will be provided to created embedded view
202
- const context = new McTreeNodeOutletContext(nodeData);
203
- // If the tree is flat tree, then use the `getLevel` function in flat tree control
204
- // Otherwise, use the level of parent node.
205
- if (this.treeControl.getLevel) {
206
- context.level = this.treeControl.getLevel(nodeData);
207
- /* tslint:disable-next-line:no-typeof-undefined */
208
- }
209
- else if (typeof parentData !== 'undefined' && this.levels.has(parentData)) {
210
- context.level = this.levels.get(parentData) + 1;
211
- }
212
- else {
213
- context.level = 0;
214
- }
215
- this.levels.set(nodeData, context.level);
216
- // Use default tree nodeOutlet, or nested node's nodeOutlet
217
- const container = viewContainer ? viewContainer : this.nodeOutlet.viewContainer;
218
- container.createEmbeddedView(node.template, context, index);
219
- // Set the data to just created `McTreeNode`.
220
- // The `McTreeNode` created from `createEmbeddedView` will be saved in static variable
221
- // `mostRecentTreeNode`. We get it from static variable and pass the node data to it.
222
- if (McTreeNode.mostRecentTreeNode) {
223
- McTreeNode.mostRecentTreeNode.data = nodeData;
224
- }
225
- }
226
- /** Set up a subscription for the data provided by the data source. */
227
- observeRenderChanges() {
228
- let dataStream;
229
- // Cannot use `instanceof DataSource` since the data source could be a literal with
230
- // `connect` function and may not extends DataSource.
231
- // tslint:disable-next-line:no-unbound-method
232
- if (typeof this._dataSource.connect === 'function') {
233
- dataStream = this._dataSource.connect(this);
234
- }
235
- else if (this._dataSource instanceof Observable) {
236
- dataStream = this._dataSource;
237
- }
238
- else if (Array.isArray(this._dataSource)) {
239
- dataStream = of(this._dataSource);
240
- }
241
- if (dataStream) {
242
- this.dataSubscription = dataStream
243
- .pipe(takeUntil(this.onDestroy))
244
- .subscribe((data) => this.renderNodeChanges(data));
245
- }
246
- else {
247
- throw getTreeNoValidDataSourceError();
248
- }
249
- }
250
- /**
251
- * Switch to the provided data source by resetting the data and unsubscribing from the current
252
- * render change subscription if one exists. If the data source is null, interpret this by
253
- * clearing the node outlet. Otherwise start listening for new data.
254
- */
255
- switchDataSource(dataSource) {
256
- // tslint:disable-next-line:no-unbound-method
257
- if (this._dataSource && typeof this._dataSource.disconnect === 'function') {
258
- this.dataSource.disconnect(this);
259
- }
260
- if (this.dataSubscription) {
261
- this.dataSubscription.unsubscribe();
262
- this.dataSubscription = null;
263
- }
264
- // Remove the all dataNodes if there is now no data source
265
- if (!dataSource) {
266
- this.nodeOutlet.viewContainer.clear();
267
- }
268
- this._dataSource = dataSource;
269
- if (this.nodeDefs) {
270
- this.observeRenderChanges();
271
- }
272
- }
273
- }
274
- /** @nocollapse */ McTreeBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeBase, deps: [{ token: i0.IterableDiffers }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
275
- /** @nocollapse */ McTreeBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McTreeBase, inputs: { treeControl: "treeControl", trackBy: "trackBy", dataSource: "dataSource" }, queries: [{ propertyName: "nodeDefs", predicate: McTreeNodeDef }], viewQueries: [{ propertyName: "nodeOutlet", first: true, predicate: McTreeNodeOutlet, descendants: true, static: true }], ngImport: i0 });
276
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeBase, decorators: [{
277
- type: Directive
278
- }], ctorParameters: function () { return [{ type: i0.IterableDiffers }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { treeControl: [{
279
- type: Input
280
- }], trackBy: [{
281
- type: Input
282
- }], nodeOutlet: [{
283
- type: ViewChild,
284
- args: [McTreeNodeOutlet, { static: true }]
285
- }], nodeDefs: [{
286
- type: ContentChildren,
287
- args: [McTreeNodeDef]
288
- }], dataSource: [{
289
- type: Input
290
- }] } });
291
- class McTreeNode {
292
- constructor(elementRef, tree) {
293
- this.elementRef = elementRef;
294
- this.tree = tree;
295
- this.destroyed = new Subject();
296
- McTreeNode.mostRecentTreeNode = this;
297
- }
298
- get data() {
299
- return this._data;
300
- }
301
- set data(value) {
302
- this._data = value;
303
- }
304
- get isExpanded() {
305
- return this.tree.treeControl.isExpanded(this.data);
306
- }
307
- get level() {
308
- return this.tree.treeControl.getLevel ? this.tree.treeControl.getLevel(this._data) : 0;
309
- }
310
- ngOnDestroy() {
311
- this.destroyed.next();
312
- this.destroyed.complete();
313
- }
314
- focus() {
315
- this.elementRef.nativeElement.focus();
316
- }
317
- }
318
- /**
319
- * The most recently created `McTreeNode`. We save it in static variable so we can retrieve it
320
- * in `McTree` and set the data to it.
321
- */
322
- McTreeNode.mostRecentTreeNode = null;
323
- /** @nocollapse */ McTreeNode.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNode, deps: [{ token: i0.ElementRef }, { token: forwardRef(() => McTreeBase) }], target: i0.ɵɵFactoryTarget.Directive });
324
- /** @nocollapse */ McTreeNode.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McTreeNode, selector: "mc-tree-node", exportAs: ["mcTreeNode"], ngImport: i0 });
325
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNode, decorators: [{
326
- type: Directive,
327
- args: [{
328
- selector: 'mc-tree-node',
329
- exportAs: 'mcTreeNode'
330
- }]
331
- }], ctorParameters: function () {
332
- return [{ type: i0.ElementRef }, { type: McTreeBase, decorators: [{
333
- type: Inject,
334
- args: [forwardRef(() => McTreeBase)]
335
- }] }];
336
- } });
337
-
338
- /** @docs-private */
339
- class McTreeNodeToggleBase {
340
- }
341
- /** @docs-private */
342
- const McTreeNodeToggleMixinBase = mixinDisabled(McTreeNodeToggleBase);
343
- /** @docs-private */
344
- class McTreeNodeToggleBaseDirective extends McTreeNodeToggleMixinBase {
345
- constructor(tree, treeNode) {
346
- super();
347
- this.tree = tree;
348
- this.treeNode = treeNode;
349
- this._recursive = false;
350
- this.tree.treeControl.filterValue
351
- .pipe(map((value) => (value === null || value === void 0 ? void 0 : value.length) > 0))
352
- .subscribe((state) => this.disabled = state);
353
- }
354
- get recursive() {
355
- return this._recursive;
356
- }
357
- set recursive(value) {
358
- this._recursive = coerceBooleanProperty(value);
359
- }
360
- get iconState() {
361
- return this.tree.treeControl.isExpanded(this.node);
362
- }
363
- toggle(event) {
364
- if (this.disabled) {
365
- return;
366
- }
367
- this.recursive
368
- ? this.tree.treeControl.toggleDescendants(this.treeNode.data)
369
- : this.tree.treeControl.toggle(this.treeNode.data);
370
- event.stopPropagation();
371
- }
372
- }
373
- /** @nocollapse */ McTreeNodeToggleBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeToggleBaseDirective, deps: [{ token: McTreeBase }, { token: McTreeNode }], target: i0.ɵɵFactoryTarget.Directive });
374
- /** @nocollapse */ McTreeNodeToggleBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McTreeNodeToggleBaseDirective, inputs: { node: "node", recursive: ["mcTreeNodeToggleRecursive", "recursive"] }, usesInheritance: true, ngImport: i0 });
375
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeToggleBaseDirective, decorators: [{
376
- type: Directive
377
- }], ctorParameters: function () { return [{ type: McTreeBase }, { type: McTreeNode }]; }, propDecorators: { node: [{
378
- type: Input
379
- }], recursive: [{
380
- type: Input,
381
- args: ['mcTreeNodeToggleRecursive']
382
- }] } });
383
- class McTreeNodeToggleComponent extends McTreeNodeToggleBaseDirective {
384
- }
385
- /** @nocollapse */ McTreeNodeToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeToggleComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
386
- /** @nocollapse */ McTreeNodeToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McTreeNodeToggleComponent, selector: "mc-tree-node-toggle", inputs: { disabled: "disabled" }, host: { listeners: { "click": "toggle($event)" }, properties: { "class.mc-expanded": "iconState", "attr.disabled": "disabled || null" }, classAttribute: "mc-tree-node-toggle" }, exportAs: ["mcTreeNodeToggle"], usesInheritance: true, ngImport: i0, template: `<i class="mc mc-icon mc-angle-down-S_16"></i>`, isInline: true, styles: [".mc-tree-node-toggle{display:flex;align-items:center;justify-content:center;flex-shrink:0;height:100%;padding-left:var(--mc-tree-size-toggle-padding, 4px);padding-right:var(--mc-tree-size-toggle-padding, 4px);cursor:pointer}.mc-tree-node-toggle .mc-icon{transform:rotate(-90deg)}.mc-tree-node-toggle.mc-expanded .mc-icon{transform:rotate(0)}.mc-tree-node-toggle[disabled]{cursor:default}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
387
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeToggleComponent, decorators: [{
388
- type: Component,
389
- args: [{ selector: 'mc-tree-node-toggle', exportAs: 'mcTreeNodeToggle', template: `<i class="mc mc-icon mc-angle-down-S_16"></i>`, host: {
390
- class: 'mc-tree-node-toggle',
391
- '[class.mc-expanded]': 'iconState',
392
- '[attr.disabled]': 'disabled || null',
393
- '(click)': 'toggle($event)'
394
- }, inputs: ['disabled'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mc-tree-node-toggle{display:flex;align-items:center;justify-content:center;flex-shrink:0;height:100%;padding-left:var(--mc-tree-size-toggle-padding, 4px);padding-right:var(--mc-tree-size-toggle-padding, 4px);cursor:pointer}.mc-tree-node-toggle .mc-icon{transform:rotate(-90deg)}.mc-tree-node-toggle.mc-expanded .mc-icon{transform:rotate(0)}.mc-tree-node-toggle[disabled]{cursor:default}\n"] }]
395
- }] });
396
- class McTreeNodeToggleDirective extends McTreeNodeToggleBaseDirective {
397
- }
398
- /** @nocollapse */ McTreeNodeToggleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeToggleDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
399
- /** @nocollapse */ McTreeNodeToggleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McTreeNodeToggleDirective, selector: "[mc-tree-node-toggle], [mcTreeNodeToggle]", host: { listeners: { "click": "toggle($event)" }, properties: { "attr.disabled": "disabled || null" } }, exportAs: ["mcTreeNodeToggle"], usesInheritance: true, ngImport: i0 });
400
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodeToggleDirective, decorators: [{
401
- type: Directive,
402
- args: [{
403
- selector: '[mc-tree-node-toggle], [mcTreeNodeToggle]',
404
- exportAs: 'mcTreeNodeToggle',
405
- host: {
406
- '[attr.disabled]': 'disabled || null',
407
- '(click)': 'toggle($event)'
408
- }
409
- }]
410
- }] });
411
-
412
- /**
413
- * Injection token used to provide the parent component to options.
414
- */
415
- const MC_TREE_OPTION_PARENT_COMPONENT = new InjectionToken('MC_TREE_OPTION_PARENT_COMPONENT');
416
- class McTreeOptionChange {
417
- constructor(source, isUserInput = false) {
418
- this.source = source;
419
- this.isUserInput = isUserInput;
420
- }
421
- }
422
- let uniqueIdCounter = 0;
423
- class McTreeOption extends McTreeNode {
424
- constructor(elementRef, changeDetectorRef, ngZone, tree) {
425
- super(elementRef, tree);
426
- this.changeDetectorRef = changeDetectorRef;
427
- this.ngZone = ngZone;
428
- this.tree = tree;
429
- this.onFocus = new Subject();
430
- this.onBlur = new Subject();
431
- this.preventBlur = false;
432
- this.checkboxThirdState = false;
433
- this._disabled = false;
434
- this.onSelectionChange = new EventEmitter();
435
- this._selected = false;
436
- this._id = `mc-tree-option-${uniqueIdCounter++}`;
437
- this.hasFocus = false;
438
- this.updateCheckboxState = () => {
439
- if (this.checkboxThirdState && this.isExpandable) {
440
- if (this.descendantsAllSelected()) {
441
- this.checkboxState = 'checked';
442
- }
443
- else if (this.descendantsPartiallySelected()) {
444
- this.checkboxState = 'indeterminate';
445
- }
446
- else {
447
- this.checkboxState = this.selected ? 'checked' : 'unchecked';
448
- }
449
- }
450
- else {
451
- this.checkboxState = this.selected ? 'checked' : 'unchecked';
452
- }
453
- this.updateParentsCheckboxState(this.data);
454
- };
455
- }
456
- get externalPseudoCheckbox() {
457
- return !!this.pseudoCheckbox;
458
- }
459
- get value() {
460
- return this._value;
461
- }
462
- set value(value) {
463
- this._value = value;
464
- }
465
- get disabled() {
466
- return this._disabled || this.tree.disabled || this.tree.treeControl.isDisabled(this.data);
467
- }
468
- set disabled(value) {
469
- const newValue = coerceBooleanProperty(value);
470
- if (newValue !== this._disabled) {
471
- this._disabled = newValue;
472
- }
473
- }
474
- get showCheckbox() {
475
- return this._showCheckbox !== undefined ? this._showCheckbox : this.tree.showCheckbox;
476
- }
477
- set showCheckbox(value) {
478
- this._showCheckbox = coerceBooleanProperty(value);
479
- }
480
- get selected() {
481
- return this._selected;
482
- }
483
- set selected(value) {
484
- const isSelected = coerceBooleanProperty(value);
485
- if (isSelected !== this._selected) {
486
- this.setSelected(isSelected);
487
- }
488
- }
489
- get id() {
490
- return this._id;
491
- }
492
- get viewValue() {
493
- // TODO: Add input property alternative for node envs.
494
- return (this.getHostElement().textContent || '').trim();
495
- }
496
- get isExpandable() {
497
- var _a;
498
- return !((_a = this.toggleElement) === null || _a === void 0 ? void 0 : _a.disabled) && this.tree.treeControl.isExpandable(this.data);
499
- }
500
- get toggleElement() {
501
- return this.toggleElementComponent || this.toggleElementDirective;
502
- }
503
- get isToggleInDefaultPlace() {
504
- return this.toggleWrapper.nativeElement.childNodes.length > 0;
505
- }
506
- ngAfterContentInit() {
507
- Promise.resolve()
508
- .then(this.updateCheckboxState);
509
- this.value = this.tree.treeControl.getValue(this.data);
510
- }
511
- descendantsAllSelected() {
512
- const descendants = this.tree.treeControl.getDescendants(this.data);
513
- return descendants.every((child) => { var _a; return (_a = this.tree) === null || _a === void 0 ? void 0 : _a.selectionModel.isSelected(child); });
514
- }
515
- descendantsPartiallySelected() {
516
- const descendants = this.tree.treeControl.getDescendants(this.data);
517
- return descendants.some((child) => { var _a; return (_a = this.tree) === null || _a === void 0 ? void 0 : _a.selectionModel.isSelected(child); });
518
- }
519
- updateParentsCheckboxState(node) {
520
- this.tree.treeControl
521
- .getParents(node, [])
522
- .forEach((parent) => {
523
- const parentOption = this.tree.unorderedOptions
524
- .find((option) => option.data === parent);
525
- parentOption === null || parentOption === void 0 ? void 0 : parentOption.updateCheckboxState();
526
- });
527
- }
528
- toggle() {
529
- this.selected = !this.selected;
530
- }
531
- setSelected(selected) {
532
- if (this._selected === selected || !this.tree.selectionModel) {
533
- return;
534
- }
535
- this._selected = selected;
536
- if (selected) {
537
- this.tree.selectionModel.select(this.data);
538
- }
539
- else {
540
- this.tree.selectionModel.deselect(this.data);
541
- }
542
- this.markForCheck();
543
- }
544
- focus(focusOrigin) {
545
- var _a;
546
- if (focusOrigin === 'program') {
547
- return;
548
- }
549
- if (this.disabled || ((_a = this.actionButton) === null || _a === void 0 ? void 0 : _a.hasFocus)) {
550
- return;
551
- }
552
- this.elementRef.nativeElement.focus();
553
- if (!this.hasFocus) {
554
- this.onFocus.next({ option: this });
555
- Promise.resolve().then(() => {
556
- this.hasFocus = true;
557
- this.markForCheck();
558
- });
559
- }
560
- }
561
- blur() {
562
- if (this.preventBlur) {
563
- return;
564
- }
565
- // When animations are enabled, Angular may end up removing the option from the DOM a little
566
- // earlier than usual, causing it to be blurred and throwing off the logic in the tree
567
- // that moves focus not the next item. To work around the issue, we defer marking the option
568
- // as not focused until the next time the zone stabilizes.
569
- this.ngZone.onStable
570
- .asObservable()
571
- .pipe(take(1))
572
- .subscribe(() => {
573
- this.ngZone.run(() => {
574
- var _a;
575
- if (((_a = this.actionButton) === null || _a === void 0 ? void 0 : _a.hasFocus) || this.tree.optionShouldHoldFocusOnBlur) {
576
- return;
577
- }
578
- this.hasFocus = false;
579
- this.onBlur.next({ option: this });
580
- });
581
- });
582
- }
583
- getHeight() {
584
- const clientRects = this.elementRef.nativeElement.getClientRects();
585
- if (clientRects.length) {
586
- return clientRects[0].height;
587
- }
588
- return 0;
589
- }
590
- select(setFocus = true) {
591
- if (this._selected) {
592
- return;
593
- }
594
- this._selected = true;
595
- if (setFocus && !this.hasFocus) {
596
- this.focus();
597
- }
598
- this.updateCheckboxState();
599
- this.markForCheck();
600
- this.emitSelectionChangeEvent();
601
- }
602
- deselect() {
603
- if (!this._selected) {
604
- return;
605
- }
606
- this._selected = false;
607
- this.updateCheckboxState();
608
- this.markForCheck();
609
- }
610
- onKeydown($event) {
611
- if (!this.actionButton) {
612
- return;
613
- }
614
- if ($event.keyCode === TAB && !$event.shiftKey && !this.actionButton.hasFocus) {
615
- this.actionButton.focus();
616
- $event.preventDefault();
617
- }
618
- }
619
- selectViaInteraction($event) {
620
- if (this.disabled) {
621
- return;
622
- }
623
- this.markForCheck();
624
- this.emitSelectionChangeEvent(true);
625
- const shiftKey = $event ? hasModifierKey($event, 'shiftKey') : false;
626
- const ctrlKey = $event ? hasModifierKey($event, 'ctrlKey') : false;
627
- this.tree.setSelectedOptionsByClick(this, shiftKey, ctrlKey);
628
- }
629
- emitSelectionChangeEvent(isUserInput = false) {
630
- this.onSelectionChange.emit(new McTreeOptionChange(this, isUserInput));
631
- }
632
- getHostElement() {
633
- return this.elementRef.nativeElement;
634
- }
635
- markForCheck() {
636
- this.changeDetectorRef.markForCheck();
637
- }
638
- }
639
- /** @nocollapse */ McTreeOption.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeOption, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: MC_TREE_OPTION_PARENT_COMPONENT }], target: i0.ɵɵFactoryTarget.Component });
640
- /** @nocollapse */ McTreeOption.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McTreeOption, selector: "mc-tree-option", inputs: { checkboxThirdState: "checkboxThirdState", disabled: "disabled", showCheckbox: "showCheckbox" }, outputs: { onSelectionChange: "onSelectionChange" }, host: { listeners: { "focusin": "focus()", "blur": "blur()", "click": "selectViaInteraction($event)", "keydown": "onKeydown($event)" }, properties: { "class.mc-selected": "selected", "class.mc-focused": "hasFocus", "class.mc-action-button-focused": "actionButton?.active", "attr.id": "id", "attr.tabindex": "-1", "attr.disabled": "disabled || null" }, classAttribute: "mc-tree-option" }, providers: [
641
- { provide: McTreeNode, useExisting: McTreeOption },
642
- { provide: MC_TITLE_TEXT_REF, useExisting: McTreeOption },
643
- { provide: MC_OPTION_ACTION_PARENT, useExisting: McTreeOption }
644
- ], queries: [{ propertyName: "toggleElementDirective", first: true, predicate: McTreeNodeToggleDirective, descendants: true }, { propertyName: "toggleElementComponent", first: true, predicate: McTreeNodeToggleComponent, descendants: true }, { propertyName: "pseudoCheckbox", first: true, predicate: McPseudoCheckbox, descendants: true }, { propertyName: "actionButton", first: true, predicate: McOptionActionComponent, descendants: true }, { propertyName: "tooltipTrigger", first: true, predicate: McTooltipTrigger, descendants: true }, { propertyName: "dropdownTrigger", first: true, predicate: McDropdownTrigger, descendants: true }], viewQueries: [{ propertyName: "parentTextElement", first: true, predicate: ["mcTitleContainer"], descendants: true }, { propertyName: "toggleWrapper", first: true, predicate: ["toggleWrapper"], descendants: true }], exportAs: ["mcTreeOption"], usesInheritance: true, ngImport: i0, template: "<div class=\"toggle-wrapper\" #toggleWrapper>\n <ng-content select=\"mc-tree-node-toggle, [mc-tree-node-toggle], [mcTreeNodeToggle]\"></ng-content>\n</div>\n\n<ng-container [ngSwitch]=\"externalPseudoCheckbox\">\n <ng-content *ngSwitchCase=\"true\" select=\"mc-pseudo-checkbox\"></ng-content>\n\n <ng-container *ngSwitchCase=\"false\">\n <mc-pseudo-checkbox\n *ngIf=\"showCheckbox\"\n [state]=\"checkboxState\"\n [disabled]=\"disabled\">\n </mc-pseudo-checkbox>\n </ng-container>\n</ng-container>\n\n<ng-content select=\"mc-checkbox\"></ng-content>\n\n<ng-content select=\"[mc-icon]\"></ng-content>\n\n<ng-content select=\"mc-progress-spinner\"></ng-content>\n\n<span class=\"mc-option-text\" #mcTitleContainer><ng-content></ng-content></span>\n\n<ng-content select=\"mc-option-action\"></ng-content>\n\n<div class=\"mc-option-overlay\"></div>\n", styles: [".mc-tree-option{box-sizing:border-box;display:flex;align-items:center;height:var(--mc-tree-size-node-height, 32px);word-wrap:break-word;border:2px solid transparent}.mc-tree-option .mc-option-text{display:inline-block;flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:var(--mc-tree-size-padding-right, 16px)}.mc-tree-option>.mc-icon,.mc-tree-option>.toggle-wrapper>.mc-icon{margin-right:var(--mc-tree-size-icon-padding, 8px);cursor:pointer}.mc-tree-option>.mc-progress-spinner{margin-right:8px}.mc-tree-option:focus{outline:none}.mc-tree-option:not([disabled]){cursor:pointer}.mc-tree-option>.mc-pseudo-checkbox,.mc-tree-option>.mc-checkbox{margin-right:var(--mc-tree-size-icon-padding, 8px)}.mc-tree-option .mc-option-action{display:none}.mc-tree-option:not([disabled]):hover .mc-option-action,.mc-tree-option:not([disabled]).mc-focused .mc-option-action,.mc-tree-option:not([disabled]).mc-action-button-focused .mc-option-action{display:flex}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2.McPseudoCheckbox, selector: "mc-pseudo-checkbox", inputs: ["color", "state", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
645
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeOption, decorators: [{
646
- type: Component,
647
- args: [{ selector: 'mc-tree-option', exportAs: 'mcTreeOption', host: {
648
- class: 'mc-tree-option',
649
- '[class.mc-selected]': 'selected',
650
- '[class.mc-focused]': 'hasFocus',
651
- '[class.mc-action-button-focused]': 'actionButton?.active',
652
- '[attr.id]': 'id',
653
- '[attr.tabindex]': '-1',
654
- '[attr.disabled]': 'disabled || null',
655
- '(focusin)': 'focus()',
656
- '(blur)': 'blur()',
657
- '(click)': 'selectViaInteraction($event)',
658
- '(keydown)': 'onKeydown($event)'
659
- }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
660
- { provide: McTreeNode, useExisting: McTreeOption },
661
- { provide: MC_TITLE_TEXT_REF, useExisting: McTreeOption },
662
- { provide: MC_OPTION_ACTION_PARENT, useExisting: McTreeOption }
663
- ], template: "<div class=\"toggle-wrapper\" #toggleWrapper>\n <ng-content select=\"mc-tree-node-toggle, [mc-tree-node-toggle], [mcTreeNodeToggle]\"></ng-content>\n</div>\n\n<ng-container [ngSwitch]=\"externalPseudoCheckbox\">\n <ng-content *ngSwitchCase=\"true\" select=\"mc-pseudo-checkbox\"></ng-content>\n\n <ng-container *ngSwitchCase=\"false\">\n <mc-pseudo-checkbox\n *ngIf=\"showCheckbox\"\n [state]=\"checkboxState\"\n [disabled]=\"disabled\">\n </mc-pseudo-checkbox>\n </ng-container>\n</ng-container>\n\n<ng-content select=\"mc-checkbox\"></ng-content>\n\n<ng-content select=\"[mc-icon]\"></ng-content>\n\n<ng-content select=\"mc-progress-spinner\"></ng-content>\n\n<span class=\"mc-option-text\" #mcTitleContainer><ng-content></ng-content></span>\n\n<ng-content select=\"mc-option-action\"></ng-content>\n\n<div class=\"mc-option-overlay\"></div>\n", styles: [".mc-tree-option{box-sizing:border-box;display:flex;align-items:center;height:var(--mc-tree-size-node-height, 32px);word-wrap:break-word;border:2px solid transparent}.mc-tree-option .mc-option-text{display:inline-block;flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:var(--mc-tree-size-padding-right, 16px)}.mc-tree-option>.mc-icon,.mc-tree-option>.toggle-wrapper>.mc-icon{margin-right:var(--mc-tree-size-icon-padding, 8px);cursor:pointer}.mc-tree-option>.mc-progress-spinner{margin-right:8px}.mc-tree-option:focus{outline:none}.mc-tree-option:not([disabled]){cursor:pointer}.mc-tree-option>.mc-pseudo-checkbox,.mc-tree-option>.mc-checkbox{margin-right:var(--mc-tree-size-icon-padding, 8px)}.mc-tree-option .mc-option-action{display:none}.mc-tree-option:not([disabled]):hover .mc-option-action,.mc-tree-option:not([disabled]).mc-focused .mc-option-action,.mc-tree-option:not([disabled]).mc-action-button-focused .mc-option-action{display:flex}\n"] }]
664
- }], ctorParameters: function () {
665
- return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
666
- type: Inject,
667
- args: [MC_TREE_OPTION_PARENT_COMPONENT]
668
- }] }];
669
- }, propDecorators: { parentTextElement: [{
670
- type: ViewChild,
671
- args: ['mcTitleContainer']
672
- }], toggleWrapper: [{
673
- type: ViewChild,
674
- args: ['toggleWrapper']
675
- }], toggleElementDirective: [{
676
- type: ContentChild,
677
- args: [McTreeNodeToggleDirective]
678
- }], toggleElementComponent: [{
679
- type: ContentChild,
680
- args: [McTreeNodeToggleComponent]
681
- }], pseudoCheckbox: [{
682
- type: ContentChild,
683
- args: [McPseudoCheckbox]
684
- }], actionButton: [{
685
- type: ContentChild,
686
- args: [McOptionActionComponent]
687
- }], tooltipTrigger: [{
688
- type: ContentChild,
689
- args: [McTooltipTrigger]
690
- }], dropdownTrigger: [{
691
- type: ContentChild,
692
- args: [McDropdownTrigger]
693
- }], checkboxThirdState: [{
694
- type: Input
695
- }], disabled: [{
696
- type: Input
697
- }], showCheckbox: [{
698
- type: Input
699
- }], onSelectionChange: [{
700
- type: Output
701
- }] } });
702
-
703
- /** Regex used to split a string on its CSS units. */
704
- const cssUnitPattern = /([A-Za-z%]+)$/;
705
- class McTreeNodePadding {
706
- constructor(treeNode, tree, renderer, element, option, dir) {
707
- var _a, _b;
708
- this.treeNode = treeNode;
709
- this.tree = tree;
710
- this.renderer = renderer;
711
- this.element = element;
712
- this.option = option;
713
- this.dir = dir;
714
- this._indent = 20;
715
- /** CSS units used for the indentation value. */
716
- this.indentUnits = 'px';
717
- this.baseLeftPadding = parseInt(TreeSizePaddingLeft);
718
- this.iconWidth = 24;
719
- this.destroyed = new Subject();
720
- (_b = (_a = this.dir) === null || _a === void 0 ? void 0 : _a.change) === null || _b === void 0 ? void 0 : _b.pipe(takeUntil(this.destroyed)).subscribe(() => this.setPadding());
721
- }
722
- get level() {
723
- return this._level;
724
- }
725
- set level(value) {
726
- this.setLevelInput(value);
727
- }
728
- get indent() {
729
- return this._indent;
730
- }
731
- set indent(indent) {
732
- this.setIndentInput(indent);
733
- }
734
- get leftPadding() {
735
- return (this.withIcon ? 0 : this.iconWidth) + this.baseLeftPadding;
736
- }
737
- ngAfterViewInit() {
738
- this.withIcon = this.option.isToggleInDefaultPlace;
739
- this.setPadding();
740
- }
741
- ngOnDestroy() {
742
- this.destroyed.next();
743
- this.destroyed.complete();
744
- }
745
- paddingIndent() {
746
- const nodeLevel = (this.treeNode.data && this.tree.treeControl.getLevel)
747
- ? this.tree.treeControl.getLevel(this.treeNode.data)
748
- : 0;
749
- const level = this.level || nodeLevel;
750
- return level > 0 ? `${(level * this._indent) + this.leftPadding}px` : `${this.leftPadding}px`;
751
- }
752
- /**
753
- * This has been extracted to a util because of TS 4 and VE.
754
- * View Engine doesn't support property rename inheritance.
755
- * TS 4.0 doesn't allow properties to override accessors or vice-versa.
756
- * @docs-private
757
- */
758
- setLevelInput(value) {
759
- // Set to null as the fallback value so that _setPadding can fall back to the node level if the
760
- // consumer set the directive as `mcTreeNodePadding=""`. We still want to take this value if
761
- // they set 0 explicitly.
762
- this._level = coerceNumberProperty(value, null);
763
- this.setPadding();
764
- }
765
- /**
766
- * This has been extracted to a util because of TS 4 and VE.
767
- * View Engine doesn't support property rename inheritance.
768
- * TS 4.0 doesn't allow properties to override accessors or vice-versa.
769
- * @docs-private
770
- */
771
- setIndentInput(indent) {
772
- let value = indent;
773
- let units = 'px';
774
- if (typeof indent === 'string') {
775
- const parts = indent.split(cssUnitPattern);
776
- value = parts[0];
777
- units = parts[1] || units;
778
- }
779
- this.indentUnits = units;
780
- this._indent = coerceNumberProperty(value);
781
- this.setPadding();
782
- }
783
- setPadding() {
784
- var _a;
785
- const padding = this.paddingIndent();
786
- const paddingProp = ((_a = this.dir) === null || _a === void 0 ? void 0 : _a.value) === 'rtl' ? 'paddingRight' : 'paddingLeft';
787
- this.renderer.setStyle(this.element.nativeElement, paddingProp, padding);
788
- }
789
- }
790
- /** @nocollapse */ McTreeNodePadding.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodePadding, deps: [{ token: McTreeNode }, { token: McTreeBase }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: McTreeOption }, { token: i3.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
791
- /** @nocollapse */ McTreeNodePadding.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: McTreeNodePadding, selector: "[mcTreeNodePadding]", inputs: { indent: ["mcTreeNodePaddingIndent", "indent"] }, exportAs: ["mcTreeNodePadding"], ngImport: i0 });
792
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeNodePadding, decorators: [{
793
- type: Directive,
794
- args: [{
795
- selector: '[mcTreeNodePadding]',
796
- exportAs: 'mcTreeNodePadding'
797
- }]
798
- }], ctorParameters: function () {
799
- return [{ type: McTreeNode }, { type: McTreeBase }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: McTreeOption }, { type: i3.Directionality, decorators: [{
800
- type: Optional
801
- }] }];
802
- }, propDecorators: { indent: [{
803
- type: Input,
804
- args: ['mcTreeNodePaddingIndent']
805
- }] } });
806
-
807
- class McTree extends McTreeBase {
808
- }
809
- /** @nocollapse */ McTree.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTree, deps: null, target: i0.ɵɵFactoryTarget.Component });
810
- /** @nocollapse */ McTree.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McTree, selector: "mc-tree", host: { classAttribute: "mc-tree" }, exportAs: ["mcTree"], usesInheritance: true, ngImport: i0, template: `<ng-container mcTreeNodeOutlet></ng-container>`, isInline: true, styles: [".mc-tree{display:block}\n"], dependencies: [{ kind: "directive", type: McTreeNodeOutlet, selector: "[mcTreeNodeOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
811
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTree, decorators: [{
812
- type: Component,
813
- args: [{ selector: 'mc-tree', exportAs: 'mcTree', template: `<ng-container mcTreeNodeOutlet></ng-container>`, host: {
814
- class: 'mc-tree'
815
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mc-tree{display:block}\n"] }]
816
- }] });
817
-
818
- const MC_SELECTION_TREE_VALUE_ACCESSOR = {
819
- provide: NG_VALUE_ACCESSOR,
820
- useExisting: forwardRef(() => McTreeSelection),
821
- multi: true
822
- };
823
- class McTreeSelectAllEvent {
824
- constructor(source, options) {
825
- this.source = source;
826
- this.options = options;
827
- }
828
- }
829
- class McTreeCopyEvent {
830
- constructor(source, option) {
831
- this.source = source;
832
- this.option = option;
833
- }
834
- }
835
- class McTreeNavigationChange {
836
- constructor(source, option) {
837
- this.source = source;
838
- this.option = option;
839
- }
840
- }
841
- class McTreeSelectionChange {
842
- constructor(source, option) {
843
- this.source = source;
844
- this.option = option;
845
- }
846
- }
847
- class McTreeSelection extends McTreeBase {
848
- constructor(elementRef, scheduler, differs, changeDetectorRef, multiple, clipboard) {
849
- super(differs, changeDetectorRef);
850
- this.elementRef = elementRef;
851
- this.scheduler = scheduler;
852
- this.clipboard = clipboard;
853
- this.renderedOptions = new QueryList();
854
- this.resetFocusedItemOnBlur = true;
855
- this.multipleMode = null;
856
- this.userTabIndex = null;
857
- this.optionShouldHoldFocusOnBlur = false;
858
- this.navigationChange = new EventEmitter();
859
- this.selectionChange = new EventEmitter();
860
- this.onSelectAll = new EventEmitter();
861
- this.onCopy = new EventEmitter();
862
- this.sortedNodes = [];
863
- this._autoSelect = true;
864
- this._noUnselectLast = true;
865
- this._disabled = false;
866
- this._tabIndex = 0;
867
- this.destroy = new Subject();
868
- /** `View -> model callback called when value changes` */
869
- this.onChange = () => { };
870
- /** `View -> model callback called when select has been touched` */
871
- this.onTouched = () => { };
872
- this.updateRenderedOptions = () => {
873
- const orderedOptions = [];
874
- this.sortedNodes.forEach((node) => {
875
- const found = this.unorderedOptions.find((option) => option.value === this.treeControl.getValue(node));
876
- if (found) {
877
- orderedOptions.push(found);
878
- }
879
- });
880
- this.renderedOptions.reset(orderedOptions);
881
- this.renderedOptions.notifyOnChanges();
882
- this.updateScrollSize();
883
- };
884
- if (multiple === MultipleMode.CHECKBOX || multiple === MultipleMode.KEYBOARD) {
885
- this.multipleMode = multiple;
886
- }
887
- else if (multiple !== null) {
888
- this.multipleMode = MultipleMode.CHECKBOX;
889
- }
890
- if (this.multipleMode === MultipleMode.CHECKBOX) {
891
- this.autoSelect = false;
892
- this.noUnselectLast = false;
893
- }
894
- this.selectionModel = new SelectionModel(this.multiple);
895
- }
896
- get autoSelect() {
897
- return this._autoSelect;
898
- }
899
- set autoSelect(value) {
900
- this._autoSelect = coerceBooleanProperty(value);
901
- }
902
- get optionFocusChanges() {
903
- return merge(...this.renderedOptions.map((option) => option.onFocus));
904
- }
905
- get optionBlurChanges() {
906
- return merge(...this.renderedOptions.map((option) => option.onBlur));
907
- }
908
- get multiple() {
909
- return !!this.multipleMode;
910
- }
911
- get noUnselectLast() {
912
- return this._noUnselectLast;
913
- }
914
- set noUnselectLast(value) {
915
- this._noUnselectLast = coerceBooleanProperty(value);
916
- }
917
- get disabled() {
918
- return this._disabled;
919
- }
920
- set disabled(rawValue) {
921
- const value = coerceBooleanProperty(rawValue);
922
- if (this._disabled !== value) {
923
- this._disabled = value;
924
- this.markOptionsForCheck();
925
- }
926
- }
927
- get tabIndex() {
928
- return this.disabled ? -1 : this._tabIndex;
929
- }
930
- set tabIndex(value) {
931
- this._tabIndex = value;
932
- this.userTabIndex = value;
933
- }
934
- get showCheckbox() {
935
- return this.multipleMode === MultipleMode.CHECKBOX;
936
- }
937
- get isEmpty() {
938
- return this.sortedNodes.length === 0;
939
- }
940
- ngAfterContentInit() {
941
- this.unorderedOptions.changes
942
- .subscribe(this.updateRenderedOptions);
943
- this.keyManager = new FocusKeyManager(this.renderedOptions)
944
- .withVerticalOrientation(true)
945
- .withHorizontalOrientation(null);
946
- this.keyManager.change
947
- .pipe(takeUntil(this.destroy))
948
- .subscribe(() => {
949
- if (this.keyManager.activeItem) {
950
- this.emitNavigationEvent(this.keyManager.activeItem);
951
- // todo need check this logic
952
- if (this.autoSelect && !this.keyManager.activeItem.disabled) {
953
- this.updateOptionsFocus();
954
- }
955
- }
956
- });
957
- this.keyManager.tabOut
958
- .pipe(takeUntil(this.destroy))
959
- .subscribe(() => this.allowFocusEscape());
960
- this.selectionModel.changed
961
- .pipe(takeUntil(this.destroy))
962
- .subscribe(() => {
963
- this.onChange(this.getSelectedValues());
964
- this.renderedOptions.notifyOnChanges();
965
- });
966
- this.renderedOptions.changes
967
- .pipe(takeUntil(this.destroy), delay(0, this.scheduler))
968
- .subscribe((options) => {
969
- this.resetOptions();
970
- // Check to see if we need to update our tab index
971
- this.updateTabIndex();
972
- const selectedValues = this.multiple ? this.getSelectedValues() : [this.getSelectedValues()];
973
- options.forEach((option) => {
974
- if (selectedValues.includes(option.value)) {
975
- option.select(false);
976
- }
977
- else {
978
- option.deselect();
979
- }
980
- option.markForCheck();
981
- });
982
- });
983
- }
984
- ngOnDestroy() {
985
- super.ngOnDestroy();
986
- this.destroy.next();
987
- this.destroy.complete();
988
- }
989
- focus($event) {
990
- if (this.renderedOptions.length === 0 || this.isFocusReceivedFromNestedOption($event)) {
991
- return;
992
- }
993
- this.keyManager.setFocusOrigin('keyboard');
994
- this.keyManager.setFirstItemActive();
995
- this.keyManager.setFocusOrigin('program');
996
- }
997
- blur() {
998
- if (!this.hasFocusedOption() && this.resetFocusedItemOnBlur) {
999
- this.keyManager.setActiveItem(-1);
1000
- }
1001
- this.onTouched();
1002
- this.changeDetectorRef.markForCheck();
1003
- }
1004
- onKeyDown(event) {
1005
- var _a, _b;
1006
- this.keyManager.setFocusOrigin('keyboard');
1007
- // tslint:disable-next-line: deprecation
1008
- const keyCode = event.keyCode;
1009
- if ([SPACE, LEFT_ARROW, RIGHT_ARROW].includes(keyCode) || isVerticalMovement(event)) {
1010
- event.preventDefault();
1011
- }
1012
- if (this.multiple && isSelectAll(event)) {
1013
- this.selectAllOptions();
1014
- event.preventDefault();
1015
- return;
1016
- }
1017
- else if (isCopy(event)) {
1018
- this.copyActiveOption();
1019
- return;
1020
- }
1021
- else if (keyCode === TAB) {
1022
- this.keyManager.tabOut.next();
1023
- return;
1024
- }
1025
- else if (keyCode === LEFT_ARROW && ((_a = this.keyManager.activeItem) === null || _a === void 0 ? void 0 : _a.isExpandable)) {
1026
- this.treeControl.collapse(this.keyManager.activeItem.data);
1027
- return;
1028
- }
1029
- else if (keyCode === RIGHT_ARROW && ((_b = this.keyManager.activeItem) === null || _b === void 0 ? void 0 : _b.isExpandable)) {
1030
- this.treeControl.expand(this.keyManager.activeItem.data);
1031
- return;
1032
- }
1033
- else if (keyCode === DOWN_ARROW) {
1034
- this.keyManager.setNextItemActive();
1035
- }
1036
- else if (keyCode === UP_ARROW) {
1037
- this.keyManager.setPreviousItemActive();
1038
- }
1039
- else if ([SPACE, ENTER].includes(keyCode)) {
1040
- this.toggleFocusedOption();
1041
- return;
1042
- }
1043
- else if (keyCode === HOME) {
1044
- this.keyManager.setFirstItemActive();
1045
- }
1046
- else if (keyCode === END) {
1047
- this.keyManager.setLastItemActive();
1048
- }
1049
- else if (keyCode === PAGE_UP) {
1050
- this.keyManager.setPreviousPageItemActive();
1051
- }
1052
- else if (keyCode === PAGE_DOWN) {
1053
- this.keyManager.setNextPageItemActive();
1054
- }
1055
- if (this.keyManager.activeItem && isVerticalMovement(event)) {
1056
- this.setSelectedOptionsByKey(this.keyManager.activeItem, hasModifierKey(event, 'shiftKey'), hasModifierKey(event, 'ctrlKey'));
1057
- }
1058
- }
1059
- updateScrollSize() {
1060
- if (!this.renderedOptions.first) {
1061
- return;
1062
- }
1063
- this.keyManager.withScrollSize(Math.floor(this.getHeight() / this.renderedOptions.first.getHeight()));
1064
- }
1065
- setSelectedOptionsByKey(option, shiftKey, ctrlKey) {
1066
- if (shiftKey && this.multiple) {
1067
- this.selectActiveOptions();
1068
- this.emitChangeEvent(option);
1069
- }
1070
- else if (ctrlKey) {
1071
- if (!this.canDeselectLast(option)) {
1072
- return;
1073
- }
1074
- }
1075
- else if (this.autoSelect) {
1076
- this.selectionModel.clear();
1077
- this.selectionModel.toggle(option.data);
1078
- this.emitChangeEvent(option);
1079
- }
1080
- }
1081
- setSelectedOptionsByClick(option, shiftKey, ctrlKey) {
1082
- if (!shiftKey && !ctrlKey) {
1083
- this.keyManager.setActiveItem(option);
1084
- }
1085
- if (shiftKey && this.multiple) {
1086
- this.selectActiveOptions();
1087
- }
1088
- else if (ctrlKey) {
1089
- if (!this.canDeselectLast(option)) {
1090
- return;
1091
- }
1092
- this.selectionModel.toggle(option.data);
1093
- this.keyManager.setActiveItem(option);
1094
- }
1095
- else if (this.autoSelect) {
1096
- this.selectionModel.clear();
1097
- this.selectionModel.toggle(option.data);
1098
- }
1099
- else {
1100
- this.selectionModel.toggle(option.data);
1101
- }
1102
- this.emitChangeEvent(option);
1103
- }
1104
- selectActiveOptions() {
1105
- const options = this.renderedOptions.toArray();
1106
- let fromIndex = this.keyManager.previousActiveItemIndex;
1107
- let toIndex = this.keyManager.previousActiveItemIndex = this.keyManager.activeItemIndex;
1108
- const selectedOptionState = options[fromIndex].selected;
1109
- if (toIndex === fromIndex) {
1110
- return;
1111
- }
1112
- if (fromIndex > toIndex) {
1113
- [fromIndex, toIndex] = [toIndex, fromIndex];
1114
- }
1115
- options
1116
- .slice(fromIndex, toIndex + 1)
1117
- .filter((item) => !item.disabled)
1118
- .forEach((renderedOption) => {
1119
- if (!selectedOptionState && this.noUnselectLast && this.selectionModel.selected.length === 1) {
1120
- return;
1121
- }
1122
- renderedOption.setSelected(selectedOptionState);
1123
- });
1124
- }
1125
- setFocusedOption(option) {
1126
- this.keyManager.setActiveItem(option);
1127
- }
1128
- toggleFocusedOption() {
1129
- const focusedOption = this.keyManager.activeItem;
1130
- if (focusedOption && (!focusedOption.selected || this.canDeselectLast(focusedOption))) {
1131
- this.selectionModel.toggle(focusedOption.data);
1132
- this.emitChangeEvent(focusedOption);
1133
- }
1134
- }
1135
- renderNodeChanges(data, dataDiffer = this.dataDiffer, viewContainer = this.nodeOutlet.viewContainer, parentData) {
1136
- super.renderNodeChanges(data, dataDiffer, viewContainer, parentData);
1137
- this.sortedNodes = this.getSortedNodes(viewContainer);
1138
- this.nodeOutlet.changeDetectorRef.detectChanges();
1139
- }
1140
- emitNavigationEvent(option) {
1141
- this.navigationChange.emit(new McTreeNavigationChange(this, option));
1142
- }
1143
- emitChangeEvent(option) {
1144
- this.selectionChange.emit(new McTreeNavigationChange(this, option));
1145
- }
1146
- selectAllOptions() {
1147
- const optionsToSelect = this.renderedOptions
1148
- .filter((option) => !option.disabled);
1149
- optionsToSelect
1150
- .forEach((option) => option.setSelected(true));
1151
- this.onSelectAll.emit(new McTreeSelectAllEvent(this, optionsToSelect));
1152
- }
1153
- copyActiveOption() {
1154
- if (!this.keyManager.activeItem) {
1155
- return;
1156
- }
1157
- const option = this.keyManager.activeItem;
1158
- option.preventBlur = true;
1159
- if (this.onCopy.observers.length) {
1160
- this.onCopy.emit(new McTreeCopyEvent(this, this.keyManager.activeItem));
1161
- }
1162
- else {
1163
- this.onCopyDefaultHandler();
1164
- }
1165
- option.preventBlur = false;
1166
- }
1167
- writeValue(value) {
1168
- if (this.multiple && value && !Array.isArray(value)) {
1169
- throw getMcSelectNonArrayValueError();
1170
- }
1171
- if (value) {
1172
- this.setOptionsFromValues(this.multiple ? value : [value]);
1173
- }
1174
- else {
1175
- this.selectionModel.clear();
1176
- }
1177
- }
1178
- registerOnChange(fn) {
1179
- this.onChange = fn;
1180
- }
1181
- registerOnTouched(fn) {
1182
- this.onTouched = fn;
1183
- }
1184
- /**
1185
- * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
1186
- */
1187
- setDisabledState(isDisabled) {
1188
- this._disabled = isDisabled;
1189
- this.changeDetectorRef.markForCheck();
1190
- }
1191
- setOptionsFromValues(values) {
1192
- this.selectionModel.clear();
1193
- const valuesToSelect = values.reduce((result, value) => {
1194
- return this.treeControl.hasValue(value) ? [...result, this.treeControl.hasValue(value)] : [...result];
1195
- }, []);
1196
- this.selectionModel.select(...valuesToSelect);
1197
- }
1198
- getSelectedValues() {
1199
- const selectedValues = this.selectionModel.selected.map((selected) => this.treeControl.getValue(selected));
1200
- return this.multiple ? selectedValues : selectedValues[0];
1201
- }
1202
- getItemHeight() {
1203
- return this.renderedOptions.first ? this.renderedOptions.first.getHeight() : 0;
1204
- }
1205
- setStateChildren(option, state) {
1206
- const valuesToChange = this.treeControl.getDescendants(option.data);
1207
- if (state) {
1208
- this.selectionModel.select(...valuesToChange);
1209
- }
1210
- else {
1211
- this.selectionModel.deselect(...valuesToChange);
1212
- }
1213
- }
1214
- onCopyDefaultHandler() {
1215
- var _a;
1216
- (_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.copy(this.keyManager.activeItem.value);
1217
- }
1218
- getHeight() {
1219
- const clientRects = this.elementRef.nativeElement.getClientRects();
1220
- if (clientRects.length) {
1221
- return clientRects[0].height;
1222
- }
1223
- return 0;
1224
- }
1225
- updateTabIndex() {
1226
- this._tabIndex = this.renderedOptions.length === 0 ? -1 : 0;
1227
- }
1228
- getSortedNodes(viewContainer) {
1229
- const array = [];
1230
- for (let i = 0; i < viewContainer.length; i++) {
1231
- const viewRef = viewContainer.get(i);
1232
- array.push(viewRef.context.$implicit);
1233
- }
1234
- return array;
1235
- }
1236
- allowFocusEscape() {
1237
- if (this._tabIndex !== -1) {
1238
- this._tabIndex = -1;
1239
- setTimeout(() => {
1240
- this._tabIndex = this.userTabIndex || 0;
1241
- this.changeDetectorRef.markForCheck();
1242
- });
1243
- }
1244
- }
1245
- resetOptions() {
1246
- this.dropSubscriptions();
1247
- this.listenToOptionsFocus();
1248
- }
1249
- dropSubscriptions() {
1250
- if (this.optionFocusSubscription) {
1251
- this.optionFocusSubscription.unsubscribe();
1252
- this.optionFocusSubscription = null;
1253
- }
1254
- if (this.optionBlurSubscription) {
1255
- this.optionBlurSubscription.unsubscribe();
1256
- this.optionBlurSubscription = null;
1257
- }
1258
- }
1259
- listenToOptionsFocus() {
1260
- this.optionFocusSubscription = this.optionFocusChanges
1261
- .subscribe((event) => {
1262
- const index = this.renderedOptions.toArray().indexOf(event.option);
1263
- this.renderedOptions
1264
- .filter((option) => option.hasFocus)
1265
- .forEach((option) => option.hasFocus = false);
1266
- if (this.isValidIndex(index)) {
1267
- this.keyManager.updateActiveItem(index);
1268
- }
1269
- });
1270
- this.optionBlurSubscription = this.optionBlurChanges
1271
- .subscribe(() => this.blur());
1272
- }
1273
- /**
1274
- * Utility to ensure all indexes are valid.
1275
- * @param index The index to be checked.
1276
- * @returns True if the index is valid for our list of options.
1277
- */
1278
- isValidIndex(index) {
1279
- return index >= 0 && index < this.renderedOptions.length;
1280
- }
1281
- /** Checks whether any of the options is focused. */
1282
- hasFocusedOption() {
1283
- return this.renderedOptions.some((option) => option.hasFocus);
1284
- }
1285
- markOptionsForCheck() {
1286
- this.renderedOptions.forEach((option) => option.markForCheck());
1287
- }
1288
- updateOptionsFocus() {
1289
- this.renderedOptions
1290
- .filter((option) => option.hasFocus)
1291
- .forEach((option) => option.hasFocus = false);
1292
- }
1293
- canDeselectLast(option) {
1294
- return !(this.noUnselectLast && this.selectionModel.selected.length === 1 && option.selected);
1295
- }
1296
- isFocusReceivedFromNestedOption($event) {
1297
- if (!$event || !$event.relatedTarget) {
1298
- return false;
1299
- }
1300
- return $event.relatedTarget.classList.contains('mc-tree-option');
1301
- }
1302
- }
1303
- /** @nocollapse */ McTreeSelection.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeSelection, deps: [{ token: i0.ElementRef }, { token: i1$1.AsyncScheduler }, { token: i0.IterableDiffers }, { token: i0.ChangeDetectorRef }, { token: 'multiple', attribute: true }, { token: i2$1.Clipboard, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1304
- /** @nocollapse */ McTreeSelection.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: McTreeSelection, selector: "mc-tree-selection", inputs: { treeControl: "treeControl", autoSelect: "autoSelect", noUnselectLast: "noUnselectLast", disabled: "disabled", tabIndex: "tabIndex" }, outputs: { navigationChange: "navigationChange", selectionChange: "selectionChange", onSelectAll: "onSelectAll", onCopy: "onCopy" }, host: { listeners: { "blur": "blur()", "focus": "focus($event)", "keydown": "onKeyDown($event)", "window:resize": "updateScrollSize()" }, properties: { "attr.tabindex": "tabIndex", "attr.disabled": "disabled || null" }, classAttribute: "mc-tree-selection" }, providers: [
1305
- MC_SELECTION_TREE_VALUE_ACCESSOR,
1306
- { provide: MC_TREE_OPTION_PARENT_COMPONENT, useExisting: McTreeSelection },
1307
- { provide: McTreeBase, useExisting: McTreeSelection }
1308
- ], queries: [{ propertyName: "unorderedOptions", predicate: McTreeOption }], viewQueries: [{ propertyName: "nodeOutlet", first: true, predicate: McTreeNodeOutlet, descendants: true, static: true }], exportAs: ["mcTreeSelection"], usesInheritance: true, ngImport: i0, template: '<ng-container mcTreeNodeOutlet></ng-container>', isInline: true, styles: [".mc-tree-selection{display:block}\n"], dependencies: [{ kind: "directive", type: McTreeNodeOutlet, selector: "[mcTreeNodeOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1309
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeSelection, decorators: [{
1310
- type: Component,
1311
- args: [{ selector: 'mc-tree-selection', exportAs: 'mcTreeSelection', template: '<ng-container mcTreeNodeOutlet></ng-container>', host: {
1312
- class: 'mc-tree-selection',
1313
- '[attr.tabindex]': 'tabIndex',
1314
- '[attr.disabled]': 'disabled || null',
1315
- '(blur)': 'blur()',
1316
- '(focus)': 'focus($event)',
1317
- '(keydown)': 'onKeyDown($event)',
1318
- '(window:resize)': 'updateScrollSize()'
1319
- }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1320
- MC_SELECTION_TREE_VALUE_ACCESSOR,
1321
- { provide: MC_TREE_OPTION_PARENT_COMPONENT, useExisting: McTreeSelection },
1322
- { provide: McTreeBase, useExisting: McTreeSelection }
1323
- ], styles: [".mc-tree-selection{display:block}\n"] }]
1324
- }], ctorParameters: function () {
1325
- return [{ type: i0.ElementRef }, { type: i1$1.AsyncScheduler }, { type: i0.IterableDiffers }, { type: i0.ChangeDetectorRef }, { type: i2.MultipleMode, decorators: [{
1326
- type: Attribute,
1327
- args: ['multiple']
1328
- }] }, { type: i2$1.Clipboard, decorators: [{
1329
- type: Optional
1330
- }] }];
1331
- }, propDecorators: { nodeOutlet: [{
1332
- type: ViewChild,
1333
- args: [McTreeNodeOutlet, { static: true }]
1334
- }], unorderedOptions: [{
1335
- type: ContentChildren,
1336
- args: [McTreeOption]
1337
- }], treeControl: [{
1338
- type: Input
1339
- }], navigationChange: [{
1340
- type: Output
1341
- }], selectionChange: [{
1342
- type: Output
1343
- }], onSelectAll: [{
1344
- type: Output
1345
- }], onCopy: [{
1346
- type: Output
1347
- }], autoSelect: [{
1348
- type: Input
1349
- }], noUnselectLast: [{
1350
- type: Input
1351
- }], disabled: [{
1352
- type: Input
1353
- }], tabIndex: [{
1354
- type: Input
1355
- }] } });
1356
-
1357
- const MC_TREE_DIRECTIVES = [
1358
- McTreeNodeOutlet,
1359
- McTreeNodeDef,
1360
- McTreeNode,
1361
- McTreeNodePadding,
1362
- McTree,
1363
- McTreeSelection,
1364
- McTreeOption,
1365
- McTreeNodeToggleComponent,
1366
- McTreeNodeToggleDirective
1367
- ];
1368
- class McTreeModule {
1369
- }
1370
- /** @nocollapse */ McTreeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1371
- /** @nocollapse */ McTreeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: McTreeModule, declarations: [McTreeNodeOutlet,
1372
- McTreeNodeDef,
1373
- McTreeNode,
1374
- McTreeNodePadding,
1375
- McTree,
1376
- McTreeSelection,
1377
- McTreeOption,
1378
- McTreeNodeToggleComponent,
1379
- McTreeNodeToggleDirective], imports: [CommonModule, McPseudoCheckboxModule], exports: [McTreeNodeOutlet,
1380
- McTreeNodeDef,
1381
- McTreeNode,
1382
- McTreeNodePadding,
1383
- McTree,
1384
- McTreeSelection,
1385
- McTreeOption,
1386
- McTreeNodeToggleComponent,
1387
- McTreeNodeToggleDirective] });
1388
- /** @nocollapse */ McTreeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeModule, providers: [{ provide: AsyncScheduler, useValue: asyncScheduler }], imports: [CommonModule, McPseudoCheckboxModule] });
1389
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: McTreeModule, decorators: [{
1390
- type: NgModule,
1391
- args: [{
1392
- imports: [CommonModule, McPseudoCheckboxModule],
1393
- exports: MC_TREE_DIRECTIVES,
1394
- declarations: MC_TREE_DIRECTIVES,
1395
- providers: [{ provide: AsyncScheduler, useValue: asyncScheduler }]
1396
- }]
1397
- }] });
1398
-
1399
- /** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */
1400
- /* tslint:disable-next-line:naming-convention */
1401
- class BaseTreeControl {
1402
- constructor() {
1403
- /** A selection model with multi-selection to track expansion status. */
1404
- this.expansionModel = new SelectionModel(true);
1405
- this.filterModel = new SelectionModel(true);
1406
- this.filterValue = new BehaviorSubject('');
1407
- }
1408
- /** Toggles one single data node's expanded/collapsed state. */
1409
- toggle(dataNode) {
1410
- if (this.filterValue.value) {
1411
- return;
1412
- }
1413
- this.expansionModel.toggle(dataNode);
1414
- }
1415
- /** Expands one single data node. */
1416
- expand(dataNode) {
1417
- if (this.filterValue.value) {
1418
- return;
1419
- }
1420
- this.expansionModel.select(dataNode);
1421
- }
1422
- /** Collapses one single data node. */
1423
- collapse(dataNode) {
1424
- if (this.filterValue.value) {
1425
- return;
1426
- }
1427
- this.expansionModel.deselect(dataNode);
1428
- }
1429
- /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */
1430
- isExpanded(dataNode) {
1431
- return this.expansionModel.isSelected(dataNode);
1432
- }
1433
- /** Toggles a subtree rooted at `node` recursively. */
1434
- toggleDescendants(dataNode) {
1435
- this.expansionModel.isSelected(dataNode)
1436
- ? this.collapseDescendants(dataNode)
1437
- : this.expandDescendants(dataNode);
1438
- }
1439
- /** Collapse all dataNodes in the tree. */
1440
- collapseAll() {
1441
- this.expansionModel.clear();
1442
- }
1443
- /** Expands a subtree rooted at given data node recursively. */
1444
- expandDescendants(dataNode) {
1445
- const toBeProcessed = [dataNode];
1446
- toBeProcessed.push(...this.getDescendants(dataNode));
1447
- this.expansionModel.select(...toBeProcessed);
1448
- }
1449
- /** Collapses a subtree rooted at given data node recursively. */
1450
- collapseDescendants(dataNode) {
1451
- const toBeProcessed = [dataNode];
1452
- toBeProcessed.push(...this.getDescendants(dataNode));
1453
- this.expansionModel.deselect(...toBeProcessed);
1454
- }
1455
- }
1456
-
1457
- function defaultCompareValues(firstValue, secondValue) {
1458
- return firstValue === secondValue;
1459
- }
1460
- function defaultCompareViewValues(firstViewValue, secondViewValue) {
1461
- return RegExp(escapeRegExp(secondViewValue), 'gi').test(firstViewValue);
1462
- }
1463
- /** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */
1464
- class FlatTreeControl extends BaseTreeControl {
1465
- /** Construct with flat tree data node functions getLevel, isExpandable, getValue and getViewValue. */
1466
- constructor(getLevel, isExpandable,
1467
- /** getValue will be used to determine if the tree contains value or not. Used in method hasValue */
1468
- getValue,
1469
- /** getViewValue will be used for filter nodes. Returned value will be first argument in filterNodesFunction */
1470
- getViewValue,
1471
- /** compareValues will be used to comparing values. */
1472
- compareValues = defaultCompareValues,
1473
- /** compareValues will be used to comparing values. */
1474
- compareViewValues = defaultCompareViewValues,
1475
- /** isDisabled will be used to determine if the node is disabled. */
1476
- isDisabled = () => false) {
1477
- super();
1478
- this.getLevel = getLevel;
1479
- this.isExpandable = isExpandable;
1480
- this.getValue = getValue;
1481
- this.getViewValue = getViewValue;
1482
- this.compareValues = compareValues;
1483
- this.compareViewValues = compareViewValues;
1484
- this.isDisabled = isDisabled;
1485
- }
1486
- /**
1487
- * Gets a list of the data node's subtree of descendent data nodes.
1488
- *
1489
- * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
1490
- * with correct levels.
1491
- */
1492
- getDescendants(dataNode) {
1493
- const startIndex = this.dataNodes.indexOf(dataNode);
1494
- const results = [];
1495
- // Goes through flattened tree nodes in the `dataNodes` array, and get all descendants.
1496
- // The level of descendants of a tree node must be greater than the level of the given
1497
- // tree node.
1498
- // If we reach a node whose level is equal to the level of the tree node, we hit a sibling.
1499
- // If we reach a node whose level is greater than the level of the tree node, we hit a
1500
- // sibling of an ancestor.
1501
- for (let i = startIndex + 1; i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]); i++) {
1502
- results.push(this.dataNodes[i]);
1503
- }
1504
- return results;
1505
- }
1506
- /**
1507
- * Expands all data nodes in the tree.
1508
- *
1509
- * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
1510
- * data nodes of the tree.
1511
- */
1512
- expandAll() {
1513
- this.expansionModel.select(...this.dataNodes);
1514
- }
1515
- getParents(node, result) {
1516
- if (node.parent) {
1517
- result.unshift(node.parent);
1518
- return this.getParents(node.parent, result);
1519
- }
1520
- else {
1521
- return result;
1522
- }
1523
- }
1524
- hasValue(value) {
1525
- return this.dataNodes.find((node) => this.compareValues(this.getValue(node), value));
1526
- }
1527
- filterNodes(value) {
1528
- this.saveExpansionState();
1529
- this.filterModel.clear();
1530
- this.expansionModel.clear();
1531
- const filteredNodes = this.dataNodes
1532
- .filter((node) => this.compareViewValues(this.getViewValue(node), value));
1533
- const filteredNodesWithTheirParents = new Set();
1534
- filteredNodes.forEach((filteredNode) => {
1535
- this.getParents(filteredNode, [])
1536
- .forEach((node) => {
1537
- filteredNodesWithTheirParents.add(node);
1538
- this.expandDataNode(node);
1539
- });
1540
- filteredNodesWithTheirParents.add(filteredNode);
1541
- this.expandDataNode(filteredNode);
1542
- if (this.isExpandable(filteredNode)) {
1543
- const childNodeLevel = this.getLevel(filteredNode) + 1;
1544
- this.getDescendants(filteredNode)
1545
- .filter((childNode) => this.getLevel(childNode) === childNodeLevel)
1546
- .filter((childNode) => !this.isExpandable(childNode) || !this.hasFilteredDescendant(childNode, filteredNodes))
1547
- .forEach((childNode) => {
1548
- filteredNodesWithTheirParents.add(childNode);
1549
- this.expandDataNode(childNode);
1550
- });
1551
- }
1552
- });
1553
- this.filterModel.select(...Array.from(filteredNodesWithTheirParents));
1554
- this.updateFilterValue(value);
1555
- this.restoreExpansionState();
1556
- }
1557
- updateFilterValue(value) {
1558
- Promise.resolve().then(() => this.filterValue.next(value));
1559
- }
1560
- expandDataNode(dataNode) {
1561
- if (this.isExpandable(dataNode)) {
1562
- this.expansionModel.select(dataNode);
1563
- }
1564
- }
1565
- saveExpansionState() {
1566
- if (this.filterValue.value === '') {
1567
- this.expandedItemsBeforeFiltration = this.expansionModel.selected;
1568
- }
1569
- }
1570
- restoreExpansionState() {
1571
- if (this.filterValue.value === '') {
1572
- this.expansionModel.clear();
1573
- this.expansionModel.select(...this.expandedItemsBeforeFiltration);
1574
- }
1575
- }
1576
- hasFilteredDescendant(dataNode, filteredNodes) {
1577
- const filteredViewValues = filteredNodes
1578
- .map((node) => this.getViewValue(node));
1579
- return this.getDescendants(dataNode)
1580
- .filter((node) => filteredViewValues.includes(this.getViewValue(node)))
1581
- .length > 0;
1582
- }
1583
- }
1584
-
1585
- /** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */
1586
- class NestedTreeControl extends BaseTreeControl {
1587
- /** Construct with nested tree function getChildren. */
1588
- constructor(getChildren) {
1589
- super();
1590
- this.getChildren = getChildren;
1591
- }
1592
- /**
1593
- * Expands all dataNodes in the tree.
1594
- *
1595
- * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
1596
- * data nodes of the tree.
1597
- */
1598
- expandAll() {
1599
- this.expansionModel.clear();
1600
- const allNodes = this.dataNodes.reduce((accumulator, dataNode) => [...accumulator, ...this.getDescendants(dataNode), dataNode], []);
1601
- this.expansionModel.select(...allNodes);
1602
- }
1603
- /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */
1604
- getDescendants(dataNode) {
1605
- const descendants = [];
1606
- this._getDescendants(descendants, dataNode);
1607
- return descendants.splice(1);
1608
- }
1609
- /** A helper function to get descendants recursively. */
1610
- // todo нужно придумать другое название и понять в чем отличие между getDescendants и _getDescendants
1611
- /* tslint:disable-next-line:naming-convention */
1612
- _getDescendants(descendants, dataNode) {
1613
- descendants.push(dataNode);
1614
- this.getChildren(dataNode)
1615
- .pipe(take(1))
1616
- .subscribe((children) => {
1617
- if (children && children.length > 0) {
1618
- children.forEach((child) => this._getDescendants(descendants, child));
1619
- }
1620
- });
1621
- }
1622
- }
1623
-
1624
- /**
1625
- * Tree flattener to convert a normal type of node to node with children & level information.
1626
- * Transform nested nodes of type `T` to flattened nodes of type `F`.
1627
- *
1628
- * For example, the input data of type `T` is nested, and contains its children data:
1629
- * SomeNode: {
1630
- * key: 'Fruits',
1631
- * children: [
1632
- * NodeOne: {
1633
- * key: 'Apple',
1634
- * },
1635
- * NodeTwo: {
1636
- * key: 'Pear',
1637
- * }
1638
- * ]
1639
- * }
1640
- * After flattener flatten the tree, the structure will become
1641
- * SomeNode: {
1642
- * key: 'Fruits',
1643
- * expandable: true,
1644
- * level: 1
1645
- * },
1646
- * NodeOne: {
1647
- * key: 'Apple',
1648
- * expandable: false,
1649
- * level: 2
1650
- * },
1651
- * NodeTwo: {
1652
- * key: 'Pear',
1653
- * expandable: false,
1654
- * level: 2
1655
- * }
1656
- * and the output flattened type is `F` with additional information.
1657
- */
1658
- class McTreeFlattener {
1659
- constructor(transformFunction, getLevel, isExpandable, getChildren) {
1660
- this.transformFunction = transformFunction;
1661
- this.getLevel = getLevel;
1662
- this.isExpandable = isExpandable;
1663
- this.getChildren = getChildren;
1664
- }
1665
- flattenNode(node, level, resultNodes, parent) {
1666
- const flatNode = this.transformFunction(node, level, parent);
1667
- resultNodes.push(flatNode);
1668
- if (this.isExpandable(flatNode)) {
1669
- const childrenNodes = this.getChildren(node);
1670
- if (childrenNodes) {
1671
- if (Array.isArray(childrenNodes)) {
1672
- this.flattenChildren(childrenNodes, level, resultNodes, flatNode);
1673
- }
1674
- else {
1675
- childrenNodes
1676
- .pipe(take(1))
1677
- .subscribe((children) => {
1678
- this.flattenChildren(children, level, resultNodes, flatNode);
1679
- });
1680
- }
1681
- }
1682
- }
1683
- return resultNodes;
1684
- }
1685
- flattenChildren(children, level, resultNodes, parent) {
1686
- children.forEach((child) => {
1687
- this.flattenNode(child, level + 1, resultNodes, parent);
1688
- });
1689
- }
1690
- /**
1691
- * Flatten a list of node type T to flattened version of node F.
1692
- * Please note that type T may be nested, and the length of `structuredData` may be different
1693
- * from that of returned list `F[]`.
1694
- */
1695
- flattenNodes(structuredData) {
1696
- const resultNodes = [];
1697
- structuredData.forEach((node) => this.flattenNode(node, 0, resultNodes, null));
1698
- return resultNodes;
1699
- }
1700
- /**
1701
- * Expand flattened node with current expansion status.
1702
- * The returned list may have different length.
1703
- */
1704
- expandFlattenedNodes(nodes, treeControl) {
1705
- const results = [];
1706
- const currentExpand = [];
1707
- currentExpand[0] = true;
1708
- nodes.forEach((node) => {
1709
- let expand = true;
1710
- for (let i = 0; i <= this.getLevel(node); i++) {
1711
- expand = expand && currentExpand[i];
1712
- }
1713
- if (expand) {
1714
- results.push(node);
1715
- }
1716
- if (this.isExpandable(node)) {
1717
- currentExpand[this.getLevel(node) + 1] = treeControl.isExpanded(node);
1718
- }
1719
- });
1720
- return results;
1721
- }
1722
- }
1723
- var McTreeDataSourceChangeTypes;
1724
- (function (McTreeDataSourceChangeTypes) {
1725
- McTreeDataSourceChangeTypes["Expansion"] = "expansion";
1726
- McTreeDataSourceChangeTypes["Filter"] = "filter";
1727
- })(McTreeDataSourceChangeTypes || (McTreeDataSourceChangeTypes = {}));
1728
- /**
1729
- * Data source for flat tree.
1730
- * The data source need to handle expansion/collapsion of the tree node and change the data feed
1731
- * to `McTree`.
1732
- * The nested tree nodes of type `T` are flattened through `MсTreeFlattener`, and converted
1733
- * to type `F` for `McTree` to consume.
1734
- */
1735
- class McTreeFlatDataSource extends DataSource {
1736
- constructor(treeControl, treeFlattener, initialData = []) {
1737
- super();
1738
- this.treeControl = treeControl;
1739
- this.treeFlattener = treeFlattener;
1740
- this.flattenedData = new BehaviorSubject([]);
1741
- this.expandedData = new BehaviorSubject([]);
1742
- this.filteredData = new BehaviorSubject([]);
1743
- this._data = new BehaviorSubject(initialData);
1744
- }
1745
- get data() {
1746
- return this._data.value;
1747
- }
1748
- set data(value) {
1749
- this._data.next(value);
1750
- this.flattenedData.next(this.treeFlattener.flattenNodes(this.data));
1751
- this.treeControl.dataNodes = this.flattenedData.value;
1752
- }
1753
- connect(collectionViewer) {
1754
- return merge(collectionViewer.viewChange, this.treeControl.expansionModel.changed
1755
- .pipe(map((value) => ({ type: McTreeDataSourceChangeTypes.Expansion, value }))), this.treeControl.filterValue
1756
- .pipe(map((value) => ({ type: McTreeDataSourceChangeTypes.Filter, value }))), this.flattenedData)
1757
- .pipe(map((changeObj) => {
1758
- if (changeObj.type === McTreeDataSourceChangeTypes.Filter) {
1759
- if (changeObj.value && changeObj.value.length > 0) {
1760
- return this.filterHandler();
1761
- }
1762
- else {
1763
- return this.expansionHandler(changeObj.value);
1764
- }
1765
- }
1766
- return this.expansionHandler(changeObj.value);
1767
- }));
1768
- }
1769
- filterHandler() {
1770
- this.filteredData.next(this.treeControl.filterModel.selected);
1771
- return this.filteredData.value;
1772
- }
1773
- expansionHandler(_change) {
1774
- const expandedNodes = this.treeFlattener.expandFlattenedNodes(this.flattenedData.value, this.treeControl);
1775
- this.expandedData.next(expandedNodes);
1776
- return this.expandedData.value;
1777
- }
1778
- disconnect() {
1779
- // no op
1780
- }
1781
- }
1782
-
1783
- /**
1784
- * Data source for nested tree.
1785
- *
1786
- * The data source for nested tree doesn't have to consider node flattener, or the way to expand
1787
- * or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node.
1788
- */
1789
- class McTreeNestedDataSource extends DataSource {
1790
- constructor() {
1791
- super(...arguments);
1792
- /* tslint:disable-next-line:naming-convention */
1793
- this._data = new BehaviorSubject([]);
1794
- }
1795
- get data() {
1796
- return this._data.value;
1797
- }
1798
- set data(value) {
1799
- this._data.next(value);
1800
- }
1801
- connect(collectionViewer) {
1802
- return merge(...[collectionViewer.viewChange, this._data])
1803
- .pipe(map(() => this.data));
1804
- }
1805
- disconnect() {
1806
- // no op
1807
- }
1808
- }
1809
-
1810
- /**
1811
- * Generated bundle index. Do not edit.
1812
- */
1813
-
1814
- export { BaseTreeControl, FlatTreeControl, MC_SELECTION_TREE_VALUE_ACCESSOR, MC_TREE_OPTION_PARENT_COMPONENT, McTree, McTreeBase, McTreeCopyEvent, McTreeFlatDataSource, McTreeFlattener, McTreeModule, McTreeNavigationChange, McTreeNestedDataSource, McTreeNode, McTreeNodeDef, McTreeNodeOutlet, McTreeNodeOutletContext, McTreeNodePadding, McTreeNodeToggleBase, McTreeNodeToggleBaseDirective, McTreeNodeToggleComponent, McTreeNodeToggleDirective, McTreeNodeToggleMixinBase, McTreeOption, McTreeOptionChange, McTreeSelectAllEvent, McTreeSelection, McTreeSelectionChange, NestedTreeControl, defaultCompareValues, defaultCompareViewValues };
1815
- //# sourceMappingURL=ptsecurity-mosaic-tree.mjs.map