@ptsecurity/mosaic 12.2.2 → 13.0.0

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