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