@ptsecurity/mosaic 12.1.0 → 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 (731) hide show
  1. package/_theming.scss +113 -66
  2. package/_visual.scss +11 -9
  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/core/pop-up/pop-up-trigger.d.ts +9 -12
  20. package/datepicker/README.md +0 -0
  21. package/datepicker/package.json +5 -5
  22. package/design-tokens/package.json +5 -5
  23. package/design-tokens/style-dictionary/build.js +6 -0
  24. package/design-tokens/style-dictionary/configs/index.js +2 -1
  25. package/design-tokens/tokens/components/navbar.json5 +12 -9
  26. package/design-tokens/tokens.d.ts +11 -9
  27. package/divider/README.md +0 -0
  28. package/divider/package.json +5 -5
  29. package/dropdown/dropdown-item.component.d.ts +1 -0
  30. package/dropdown/package.json +5 -5
  31. package/{esm2015/autocomplete/autocomplete-origin.directive.js → esm2020/autocomplete/autocomplete-origin.directive.mjs} +4 -4
  32. package/{esm2015/autocomplete/autocomplete-trigger.directive.js → esm2020/autocomplete/autocomplete-trigger.directive.mjs} +4 -4
  33. package/esm2020/autocomplete/autocomplete.component.mjs +154 -0
  34. package/{esm2015/autocomplete/autocomplete.module.js → esm2020/autocomplete/autocomplete.module.mjs} +5 -5
  35. package/{esm2015/autocomplete/index.js → esm2020/autocomplete/index.mjs} +0 -0
  36. package/{esm2015/autocomplete/ptsecurity-mosaic-autocomplete.js → esm2020/autocomplete/ptsecurity-mosaic-autocomplete.mjs} +0 -0
  37. package/{esm2015/autocomplete/public-api.js → esm2020/autocomplete/public-api.mjs} +0 -0
  38. package/esm2020/button/button.component.mjs +129 -0
  39. package/esm2020/button/button.module.mjs +38 -0
  40. package/{esm2015/button/index.js → esm2020/button/index.mjs} +0 -0
  41. package/{esm2015/button/ptsecurity-mosaic-button.js → esm2020/button/ptsecurity-mosaic-button.mjs} +0 -0
  42. package/{esm2015/button/public-api.js → esm2020/button/public-api.mjs} +0 -0
  43. package/esm2020/button-toggle/button-toggle.component.mjs +362 -0
  44. package/{esm2015/button-toggle/button-toggle.module.js → esm2020/button-toggle/button-toggle.module.mjs} +5 -5
  45. package/{esm2015/button-toggle/index.js → esm2020/button-toggle/index.mjs} +0 -0
  46. package/{esm2015/button-toggle/ptsecurity-mosaic-button-toggle.js → esm2020/button-toggle/ptsecurity-mosaic-button-toggle.mjs} +0 -0
  47. package/{esm2015/button-toggle/public-api.js → esm2020/button-toggle/public-api.mjs} +0 -0
  48. package/esm2020/card/card.component.mjs +80 -0
  49. package/{esm2015/card/card.module.js → esm2020/card/card.module.mjs} +5 -5
  50. package/{esm2015/card/index.js → esm2020/card/index.mjs} +0 -0
  51. package/{esm2015/card/ptsecurity-mosaic-card.js → esm2020/card/ptsecurity-mosaic-card.mjs} +0 -0
  52. package/{esm2015/card/public-api.js → esm2020/card/public-api.mjs} +0 -0
  53. package/{esm2015/checkbox/checkbox-config.js → esm2020/checkbox/checkbox-config.mjs} +0 -0
  54. package/{esm2015/checkbox/checkbox-module.js → esm2020/checkbox/checkbox-module.mjs} +5 -5
  55. package/{esm2015/checkbox/checkbox-required-validator.js → esm2020/checkbox/checkbox-required-validator.mjs} +4 -4
  56. package/esm2020/checkbox/checkbox.mjs +315 -0
  57. package/{esm2015/checkbox/index.js → esm2020/checkbox/index.mjs} +0 -0
  58. package/{esm2015/checkbox/ptsecurity-mosaic-checkbox.js → esm2020/checkbox/ptsecurity-mosaic-checkbox.mjs} +0 -0
  59. package/{esm2015/checkbox/public-api.js → esm2020/checkbox/public-api.mjs} +0 -0
  60. package/{esm2015/core/animation/animation.js → esm2020/core/animation/animation.mjs} +0 -0
  61. package/{esm2015/core/animation/fade-animations.js → esm2020/core/animation/fade-animations.mjs} +0 -0
  62. package/{esm2015/core/animation/index.js → esm2020/core/animation/index.mjs} +0 -0
  63. package/{esm2015/core/animation/select-animations.js → esm2020/core/animation/select-animations.mjs} +0 -0
  64. package/{esm2015/core/common-behaviors/color.js → esm2020/core/common-behaviors/color.mjs} +0 -0
  65. package/{esm2015/core/common-behaviors/common-module.js → esm2020/core/common-behaviors/common-module.mjs} +5 -5
  66. package/{esm2015/core/common-behaviors/constructor.js → esm2020/core/common-behaviors/constructor.mjs} +0 -0
  67. package/{esm2015/core/common-behaviors/disabled.js → esm2020/core/common-behaviors/disabled.mjs} +0 -0
  68. package/{esm2015/core/common-behaviors/error-state.js → esm2020/core/common-behaviors/error-state.mjs} +0 -0
  69. package/{esm2015/core/common-behaviors/index.js → esm2020/core/common-behaviors/index.mjs} +0 -0
  70. package/{esm2015/core/common-behaviors/tabindex.js → esm2020/core/common-behaviors/tabindex.mjs} +0 -0
  71. package/{esm2015/core/error/error-options.js → esm2020/core/error/error-options.mjs} +7 -7
  72. package/esm2020/core/formatters/date/formatter.mjs +314 -0
  73. package/esm2020/core/formatters/date/templates/en-US.mjs +280 -0
  74. package/esm2020/core/formatters/date/templates/ru-RU.mjs +280 -0
  75. package/{esm2015/core/formatters/index.js → esm2020/core/formatters/index.mjs} +5 -5
  76. package/esm2020/core/formatters/number/formatter.mjs +105 -0
  77. package/{esm2015/core/forms/forms-module.js → esm2020/core/forms/forms-module.mjs} +5 -5
  78. package/{esm2015/core/forms/forms.directive.js → esm2020/core/forms/forms.directive.mjs} +7 -7
  79. package/{esm2015/core/forms/index.js → esm2020/core/forms/index.mjs} +0 -0
  80. package/{esm2015/core/highlight/highlight.pipe.js → esm2020/core/highlight/highlight.pipe.mjs} +4 -4
  81. package/{esm2015/core/highlight/index.js → esm2020/core/highlight/index.mjs} +5 -5
  82. package/{esm2015/core/index.js → esm2020/core/index.mjs} +0 -0
  83. package/{esm2015/core/label/label-options.js → esm2020/core/label/label-options.mjs} +0 -0
  84. package/{esm2015/core/line/line.js → esm2020/core/line/line.mjs} +8 -8
  85. package/esm2020/core/option/action.mjs +121 -0
  86. package/{esm2015/core/option/index.js → esm2020/core/option/index.mjs} +0 -0
  87. package/esm2020/core/option/optgroup.mjs +31 -0
  88. package/{esm2015/core/option/option-module.js → esm2020/core/option/option-module.mjs} +5 -5
  89. package/esm2020/core/option/option.mjs +254 -0
  90. package/{esm2015/core/overlay/overlay-position-map.js → esm2020/core/overlay/overlay-position-map.mjs} +0 -0
  91. package/{esm2015/core/pop-up/constants.js → esm2020/core/pop-up/constants.mjs} +0 -0
  92. package/{esm2015/core/pop-up/index.js → esm2020/core/pop-up/index.mjs} +0 -0
  93. package/esm2020/core/pop-up/pop-up-trigger.mjs +246 -0
  94. package/esm2020/core/pop-up/pop-up.mjs +91 -0
  95. package/{esm2015/core/ptsecurity-mosaic-core.js → esm2020/core/ptsecurity-mosaic-core.mjs} +0 -0
  96. package/{esm2015/core/public-api.js → esm2020/core/public-api.mjs} +0 -0
  97. package/{esm2015/core/select/constants.js → esm2020/core/select/constants.mjs} +0 -0
  98. package/{esm2015/core/select/errors.js → esm2020/core/select/errors.mjs} +0 -0
  99. package/{esm2015/core/select/events.js → esm2020/core/select/events.mjs} +0 -0
  100. package/{esm2015/core/select/index.js → esm2020/core/select/index.mjs} +0 -0
  101. package/{esm2015/core/selection/constants.js → esm2020/core/selection/constants.mjs} +0 -0
  102. package/{esm2015/core/selection/index.js → esm2020/core/selection/index.mjs} +0 -0
  103. package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +37 -0
  104. package/{esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.module.js → esm2020/core/selection/pseudo-checkbox/pseudo-checkbox.module.mjs} +5 -5
  105. package/{esm2015/core/services/measure-scrollbar.service.js → esm2020/core/services/measure-scrollbar.service.mjs} +4 -4
  106. package/{esm2015/core/utils/index.js → esm2020/core/utils/index.mjs} +0 -0
  107. package/{esm2015/core/utils/public-api.js → esm2020/core/utils/public-api.mjs} +0 -0
  108. package/{esm2015/core/utils/utils.js → esm2020/core/utils/utils.mjs} +0 -0
  109. package/{esm2015/core/validation/index.js → esm2020/core/validation/index.mjs} +0 -0
  110. package/{esm2015/core/validation/validation.js → esm2020/core/validation/validation.mjs} +0 -0
  111. package/esm2020/datepicker/calendar-body.component.mjs +106 -0
  112. package/esm2020/datepicker/calendar.component.mjs +362 -0
  113. package/{esm2015/datepicker/datepicker-animations.js → esm2020/datepicker/datepicker-animations.mjs} +0 -0
  114. package/{esm2015/datepicker/datepicker-errors.js → esm2020/datepicker/datepicker-errors.mjs} +0 -0
  115. package/esm2020/datepicker/datepicker-input.directive.mjs +900 -0
  116. package/{esm2015/datepicker/datepicker-intl.js → esm2020/datepicker/datepicker-intl.mjs} +4 -4
  117. package/{esm2015/datepicker/datepicker-module.js → esm2020/datepicker/datepicker-module.mjs} +5 -5
  118. package/esm2020/datepicker/datepicker-toggle.component.mjs +86 -0
  119. package/esm2020/datepicker/datepicker.component.mjs +408 -0
  120. package/{esm2015/datepicker/index.js → esm2020/datepicker/index.mjs} +0 -0
  121. package/{esm2015/datepicker/month-view.component.js → esm2020/datepicker/month-view.component.mjs} +5 -11
  122. package/{esm2015/datepicker/multi-year-view.component.js → esm2020/datepicker/multi-year-view.component.mjs} +5 -11
  123. package/{esm2015/datepicker/ptsecurity-mosaic-datepicker.js → esm2020/datepicker/ptsecurity-mosaic-datepicker.mjs} +0 -0
  124. package/{esm2015/datepicker/public-api.js → esm2020/datepicker/public-api.mjs} +0 -0
  125. package/{esm2015/datepicker/year-view.component.js → esm2020/datepicker/year-view.component.mjs} +5 -11
  126. package/{esm2015/design-tokens/index.js → esm2020/design-tokens/index.mjs} +0 -0
  127. package/{esm2015/design-tokens/ptsecurity-mosaic-design-tokens.js → esm2020/design-tokens/ptsecurity-mosaic-design-tokens.mjs} +0 -0
  128. package/{esm2015/design-tokens/public-api.js → esm2020/design-tokens/public-api.mjs} +0 -0
  129. package/{esm2015/design-tokens/tokens.js → esm2020/design-tokens/tokens.mjs} +12 -10
  130. package/{esm2015/divider/divider.component.js → esm2020/divider/divider.component.mjs} +6 -13
  131. package/{esm2015/divider/divider.module.js → esm2020/divider/divider.module.mjs} +5 -5
  132. package/{esm2015/divider/index.js → esm2020/divider/index.mjs} +0 -0
  133. package/{esm2015/divider/ptsecurity-mosaic-divider.js → esm2020/divider/ptsecurity-mosaic-divider.mjs} +0 -0
  134. package/{esm2015/divider/public-api.js → esm2020/divider/public-api.mjs} +0 -0
  135. package/{esm2015/dropdown/dropdown-animations.js → esm2020/dropdown/dropdown-animations.mjs} +0 -0
  136. package/{esm2015/dropdown/dropdown-content.directive.js → esm2020/dropdown/dropdown-content.directive.mjs} +6 -8
  137. package/{esm2015/dropdown/dropdown-errors.js → esm2020/dropdown/dropdown-errors.mjs} +0 -0
  138. package/esm2020/dropdown/dropdown-item.component.mjs +139 -0
  139. package/esm2020/dropdown/dropdown-trigger.directive.mjs +485 -0
  140. package/esm2020/dropdown/dropdown.component.mjs +292 -0
  141. package/{esm2015/dropdown/dropdown.module.js → esm2020/dropdown/dropdown.module.mjs} +5 -5
  142. package/{esm2015/dropdown/dropdown.types.js → esm2020/dropdown/dropdown.types.mjs} +0 -0
  143. package/{esm2015/dropdown/index.js → esm2020/dropdown/index.mjs} +0 -0
  144. package/{esm2015/dropdown/ptsecurity-mosaic-dropdown.js → esm2020/dropdown/ptsecurity-mosaic-dropdown.mjs} +0 -0
  145. package/{esm2015/dropdown/public-api.js → esm2020/dropdown/public-api.mjs} +0 -0
  146. package/esm2020/form-field/cleaner.mjs +23 -0
  147. package/{esm2015/form-field/form-field-control.js → esm2020/form-field/form-field-control.mjs} +0 -0
  148. package/{esm2015/form-field/form-field-errors.js → esm2020/form-field/form-field-errors.mjs} +0 -0
  149. package/esm2020/form-field/form-field.mjs +205 -0
  150. package/{esm2015/form-field/form-field.module.js → esm2020/form-field/form-field.module.mjs} +5 -5
  151. package/{esm2015/form-field/hint.js → esm2020/form-field/hint.mjs} +4 -4
  152. package/{esm2015/form-field/index.js → esm2020/form-field/index.mjs} +0 -0
  153. package/{esm2015/form-field/prefix.js → esm2020/form-field/prefix.mjs} +4 -4
  154. package/{esm2015/form-field/ptsecurity-mosaic-form-field.js → esm2020/form-field/ptsecurity-mosaic-form-field.mjs} +0 -0
  155. package/{esm2015/form-field/public-api.js → esm2020/form-field/public-api.mjs} +0 -0
  156. package/{esm2015/form-field/stepper.js → esm2020/form-field/stepper.mjs} +4 -4
  157. package/{esm2015/form-field/suffix.js → esm2020/form-field/suffix.mjs} +4 -4
  158. package/esm2020/icon/icon.component.mjs +44 -0
  159. package/{esm2015/icon/icon.module.js → esm2020/icon/icon.module.mjs} +5 -5
  160. package/{esm2015/icon/index.js → esm2020/icon/index.mjs} +0 -0
  161. package/{esm2015/icon/ptsecurity-mosaic-icon.js → esm2020/icon/ptsecurity-mosaic-icon.mjs} +0 -0
  162. package/{esm2015/icon/public-api.js → esm2020/icon/public-api.mjs} +0 -0
  163. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  164. package/{esm2015/input/index.js → esm2020/input/index.mjs} +0 -0
  165. package/{esm2015/input/input-errors.js → esm2020/input/input-errors.mjs} +0 -0
  166. package/esm2020/input/input-number-validators.mjs +92 -0
  167. package/{esm2015/input/input-number.js → esm2020/input/input-number.mjs} +4 -4
  168. package/{esm2015/input/input-value-accessor.js → esm2020/input/input-value-accessor.mjs} +0 -0
  169. package/{esm2015/input/input.js → esm2020/input/input.mjs} +7 -7
  170. package/{esm2015/input/input.module.js → esm2020/input/input.module.mjs} +5 -5
  171. package/{esm2015/input/ptsecurity-mosaic-input.js → esm2020/input/ptsecurity-mosaic-input.mjs} +0 -0
  172. package/{esm2015/input/public-api.js → esm2020/input/public-api.mjs} +0 -0
  173. package/{esm2015/link/index.js → esm2020/link/index.mjs} +0 -0
  174. package/esm2020/link/link.component.mjs +107 -0
  175. package/{esm2015/link/link.module.js → esm2020/link/link.module.mjs} +5 -5
  176. package/{esm2015/link/ptsecurity-mosaic-link.js → esm2020/link/ptsecurity-mosaic-link.mjs} +0 -0
  177. package/{esm2015/link/public-api.js → esm2020/link/public-api.mjs} +0 -0
  178. package/{esm2015/list/index.js → esm2020/list/index.mjs} +0 -0
  179. package/esm2020/list/list-selection.component.mjs +693 -0
  180. package/esm2020/list/list.component.mjs +44 -0
  181. package/{esm2015/list/list.module.js → esm2020/list/list.module.mjs} +5 -5
  182. package/{esm2015/list/ptsecurity-mosaic-list.js → esm2020/list/ptsecurity-mosaic-list.mjs} +0 -0
  183. package/{esm2015/list/public-api.js → esm2020/list/public-api.mjs} +0 -0
  184. package/{esm2015/modal/css-unit.pipe.js → esm2020/modal/css-unit.pipe.mjs} +4 -4
  185. package/{esm2015/modal/index.js → esm2020/modal/index.mjs} +0 -0
  186. package/{esm2015/modal/modal-control.service.js → esm2020/modal/modal-control.service.mjs} +4 -4
  187. package/{esm2015/modal/modal-ref.class.js → esm2020/modal/modal-ref.class.mjs} +0 -0
  188. package/{esm2015/modal/modal-util.js → esm2020/modal/modal-util.mjs} +0 -0
  189. package/esm2020/modal/modal.component.mjs +501 -0
  190. package/{esm2015/modal/modal.directive.js → esm2020/modal/modal.directive.mjs} +13 -13
  191. package/esm2020/modal/modal.module.mjs +72 -0
  192. package/esm2020/modal/modal.service.mjs +124 -0
  193. package/{esm2015/modal/modal.type.js → esm2020/modal/modal.type.mjs} +0 -0
  194. package/{esm2015/modal/ptsecurity-mosaic-modal.js → esm2020/modal/ptsecurity-mosaic-modal.mjs} +0 -0
  195. package/{esm2015/modal/public-api.js → esm2020/modal/public-api.mjs} +0 -0
  196. package/{esm2015/navbar/index.js → esm2020/navbar/index.mjs} +0 -0
  197. package/esm2020/navbar/navbar-item.component.mjs +577 -0
  198. package/esm2020/navbar/navbar.component.mjs +237 -0
  199. package/esm2020/navbar/navbar.module.mjs +92 -0
  200. package/{esm2015/navbar/ptsecurity-mosaic-navbar.js → esm2020/navbar/ptsecurity-mosaic-navbar.mjs} +0 -0
  201. package/{esm2015/navbar/public-api.js → esm2020/navbar/public-api.mjs} +0 -0
  202. package/{esm2015/navbar/vertical-navbar.animation.js → esm2020/navbar/vertical-navbar.animation.mjs} +2 -2
  203. package/esm2020/navbar/vertical-navbar.component.mjs +114 -0
  204. package/{esm2015/popover/index.js → esm2020/popover/index.mjs} +0 -0
  205. package/{esm2015/popover/popover-animations.js → esm2020/popover/popover-animations.mjs} +0 -0
  206. package/esm2020/popover/popover-confirm.component.mjs +108 -0
  207. package/esm2020/popover/popover.component.mjs +253 -0
  208. package/esm2020/popover/popover.module.mjs +24 -0
  209. package/{esm2015/popover/ptsecurity-mosaic-popover.js → esm2020/popover/ptsecurity-mosaic-popover.mjs} +0 -0
  210. package/{esm2015/popover/public-api.js → esm2020/popover/public-api.mjs} +2 -1
  211. package/{esm2015/progress-bar/index.js → esm2020/progress-bar/index.mjs} +0 -0
  212. package/esm2020/progress-bar/progress-bar.component.mjs +42 -0
  213. package/{esm2015/progress-bar/progress-bar.module.js → esm2020/progress-bar/progress-bar.module.mjs} +5 -5
  214. package/{esm2015/progress-bar/ptsecurity-mosaic-progress-bar.js → esm2020/progress-bar/ptsecurity-mosaic-progress-bar.mjs} +0 -0
  215. package/{esm2015/progress-bar/public-api.js → esm2020/progress-bar/public-api.mjs} +0 -0
  216. package/{esm2015/progress-spinner/index.js → esm2020/progress-spinner/index.mjs} +0 -0
  217. package/esm2020/progress-spinner/progress-spinner.component.mjs +46 -0
  218. package/{esm2015/progress-spinner/progress-spinner.module.js → esm2020/progress-spinner/progress-spinner.module.mjs} +5 -5
  219. package/{esm2015/progress-spinner/ptsecurity-mosaic-progress-spinner.js → esm2020/progress-spinner/ptsecurity-mosaic-progress-spinner.mjs} +0 -0
  220. package/{esm2015/progress-spinner/public-api.js → esm2020/progress-spinner/public-api.mjs} +0 -0
  221. package/{esm2015/ptsecurity-mosaic.js → esm2020/ptsecurity-mosaic.mjs} +0 -0
  222. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  223. package/{esm2015/radio/index.js → esm2020/radio/index.mjs} +0 -0
  224. package/{esm2015/radio/ptsecurity-mosaic-radio.js → esm2020/radio/ptsecurity-mosaic-radio.mjs} +0 -0
  225. package/{esm2015/radio/public-api.js → esm2020/radio/public-api.mjs} +0 -0
  226. package/esm2020/radio/radio.component.mjs +458 -0
  227. package/{esm2015/radio/radio.module.js → esm2020/radio/radio.module.mjs} +5 -5
  228. package/{esm2015/select/index.js → esm2020/select/index.mjs} +0 -0
  229. package/{esm2015/select/ptsecurity-mosaic-select.js → esm2020/select/ptsecurity-mosaic-select.mjs} +0 -0
  230. package/{esm2015/select/public-api.js → esm2020/select/public-api.mjs} +0 -0
  231. package/esm2020/select/select.component.mjs +1110 -0
  232. package/{esm2015/select/select.module.js → esm2020/select/select.module.mjs} +5 -5
  233. package/{esm2015/sidebar/index.js → esm2020/sidebar/index.mjs} +0 -0
  234. package/{esm2015/sidebar/ptsecurity-mosaic-sidebar.js → esm2020/sidebar/ptsecurity-mosaic-sidebar.mjs} +0 -0
  235. package/{esm2015/sidebar/public-api.js → esm2020/sidebar/public-api.mjs} +0 -0
  236. package/{esm2015/sidebar/sidebar-animations.js → esm2020/sidebar/sidebar-animations.mjs} +0 -0
  237. package/esm2020/sidebar/sidebar.component.mjs +146 -0
  238. package/{esm2015/sidebar/sidebar.module.js → esm2020/sidebar/sidebar.module.mjs} +5 -5
  239. package/{esm2015/sidepanel/index.js → esm2020/sidepanel/index.mjs} +0 -0
  240. package/{esm2015/sidepanel/ptsecurity-mosaic-sidepanel.js → esm2020/sidepanel/ptsecurity-mosaic-sidepanel.mjs} +0 -0
  241. package/{esm2015/sidepanel/public-api.js → esm2020/sidepanel/public-api.mjs} +0 -0
  242. package/{esm2015/sidepanel/sidepanel-animations.js → esm2020/sidepanel/sidepanel-animations.mjs} +0 -0
  243. package/{esm2015/sidepanel/sidepanel-config.js → esm2020/sidepanel/sidepanel-config.mjs} +0 -0
  244. package/esm2020/sidepanel/sidepanel-container.component.mjs +106 -0
  245. package/esm2020/sidepanel/sidepanel-directives.mjs +159 -0
  246. package/{esm2015/sidepanel/sidepanel-ref.js → esm2020/sidepanel/sidepanel-ref.mjs} +0 -0
  247. package/esm2020/sidepanel/sidepanel.module.mjs +74 -0
  248. package/esm2020/sidepanel/sidepanel.service.mjs +167 -0
  249. package/{esm2015/splitter/index.js → esm2020/splitter/index.mjs} +0 -0
  250. package/{esm2015/splitter/ptsecurity-mosaic-splitter.js → esm2020/splitter/ptsecurity-mosaic-splitter.mjs} +0 -0
  251. package/{esm2015/splitter/public-api.js → esm2020/splitter/public-api.mjs} +0 -0
  252. package/esm2020/splitter/splitter.component.mjs +480 -0
  253. package/esm2020/splitter/splitter.module.mjs +40 -0
  254. package/{esm2015/table/index.js → esm2020/table/index.mjs} +0 -0
  255. package/{esm2015/table/ptsecurity-mosaic-table.js → esm2020/table/ptsecurity-mosaic-table.mjs} +0 -0
  256. package/{esm2015/table/public-api.js → esm2020/table/public-api.mjs} +0 -0
  257. package/{esm2015/table/table.component.js → esm2020/table/table.component.mjs} +4 -4
  258. package/{esm2015/table/table.module.js → esm2020/table/table.module.mjs} +5 -5
  259. package/{esm2015/tabs/index.js → esm2020/tabs/index.mjs} +0 -0
  260. package/esm2020/tabs/paginated-tab-header.mjs +479 -0
  261. package/{esm2015/tabs/ptsecurity-mosaic-tabs.js → esm2020/tabs/ptsecurity-mosaic-tabs.mjs} +0 -0
  262. package/{esm2015/tabs/public-api.js → esm2020/tabs/public-api.mjs} +0 -0
  263. package/esm2020/tabs/tab-body.component.mjs +178 -0
  264. package/{esm2015/tabs/tab-content.directive.js → esm2020/tabs/tab-content.directive.mjs} +4 -4
  265. package/esm2020/tabs/tab-group.component.mjs +350 -0
  266. package/esm2020/tabs/tab-header.component.mjs +67 -0
  267. package/{esm2015/tabs/tab-label-wrapper.directive.js → esm2020/tabs/tab-label-wrapper.directive.mjs} +4 -4
  268. package/{esm2015/tabs/tab-label.directive.js → esm2020/tabs/tab-label.directive.mjs} +4 -4
  269. package/{esm2015/tabs/tab-nav-bar/index.js → esm2020/tabs/tab-nav-bar/index.mjs} +0 -0
  270. package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +110 -0
  271. package/{esm2015/tabs/tab.component.js → esm2020/tabs/tab.component.mjs} +4 -4
  272. package/{esm2015/tabs/tabs-animations.js → esm2020/tabs/tabs-animations.mjs} +0 -0
  273. package/{esm2015/tabs/tabs.module.js → esm2020/tabs/tabs.module.mjs} +5 -5
  274. package/{esm2015/tags/index.js → esm2020/tags/index.mjs} +0 -0
  275. package/{esm2015/tags/ptsecurity-mosaic-tags.js → esm2020/tags/ptsecurity-mosaic-tags.mjs} +0 -0
  276. package/{esm2015/tags/public-api.js → esm2020/tags/public-api.mjs} +0 -0
  277. package/{esm2015/tags/tag-default-options.js → esm2020/tags/tag-default-options.mjs} +0 -0
  278. package/{esm2015/tags/tag-input.js → esm2020/tags/tag-input.mjs} +4 -4
  279. package/esm2020/tags/tag-list.component.mjs +722 -0
  280. package/{esm2015/tags/tag-text-control.js → esm2020/tags/tag-text-control.mjs} +0 -0
  281. package/esm2020/tags/tag.component.mjs +374 -0
  282. package/{esm2015/tags/tag.module.js → esm2020/tags/tag.module.mjs} +5 -5
  283. package/{esm2015/textarea/index.js → esm2020/textarea/index.mjs} +0 -0
  284. package/{esm2015/textarea/ptsecurity-mosaic-textarea.js → esm2020/textarea/ptsecurity-mosaic-textarea.mjs} +0 -0
  285. package/{esm2015/textarea/public-api.js → esm2020/textarea/public-api.mjs} +0 -0
  286. package/{esm2015/textarea/textarea.component.js → esm2020/textarea/textarea.component.mjs} +4 -4
  287. package/{esm2015/textarea/textarea.module.js → esm2020/textarea/textarea.module.mjs} +5 -5
  288. package/{esm2015/timepicker/index.js → esm2020/timepicker/index.mjs} +0 -0
  289. package/{esm2015/timepicker/ptsecurity-mosaic-timepicker.js → esm2020/timepicker/ptsecurity-mosaic-timepicker.mjs} +0 -0
  290. package/{esm2015/timepicker/public-api.js → esm2020/timepicker/public-api.mjs} +0 -0
  291. package/{esm2015/timepicker/timepicker.constants.js → esm2020/timepicker/timepicker.constants.mjs} +0 -0
  292. package/esm2020/timepicker/timepicker.directive.mjs +653 -0
  293. package/{esm2015/timepicker/timepicker.module.js → esm2020/timepicker/timepicker.module.mjs} +5 -5
  294. package/{esm2015/toggle/index.js → esm2020/toggle/index.mjs} +0 -0
  295. package/{esm2015/toggle/ptsecurity-mosaic-toggle.js → esm2020/toggle/ptsecurity-mosaic-toggle.mjs} +0 -0
  296. package/{esm2015/toggle/public-api.js → esm2020/toggle/public-api.mjs} +0 -0
  297. package/esm2020/toggle/toggle.component.mjs +158 -0
  298. package/{esm2015/toggle/toggle.module.js → esm2020/toggle/toggle.module.mjs} +5 -5
  299. package/{esm2015/tooltip/index.js → esm2020/tooltip/index.mjs} +0 -0
  300. package/{esm2015/tooltip/ptsecurity-mosaic-tooltip.js → esm2020/tooltip/ptsecurity-mosaic-tooltip.mjs} +0 -0
  301. package/{esm2015/tooltip/public-api.js → esm2020/tooltip/public-api.mjs} +0 -0
  302. package/{esm2015/tooltip/tooltip.animations.js → esm2020/tooltip/tooltip.animations.mjs} +0 -0
  303. package/esm2020/tooltip/tooltip.component.mjs +291 -0
  304. package/{esm2015/tooltip/tooltip.module.js → esm2020/tooltip/tooltip.module.mjs} +5 -5
  305. package/{esm2015/tree/control/base-tree-control.js → esm2020/tree/control/base-tree-control.mjs} +0 -0
  306. package/{esm2015/tree/control/flat-tree-control.js → esm2020/tree/control/flat-tree-control.mjs} +0 -0
  307. package/{esm2015/tree/control/nested-tree-control.js → esm2020/tree/control/nested-tree-control.mjs} +0 -0
  308. package/{esm2015/tree/control/tree-control.js → esm2020/tree/control/tree-control.mjs} +0 -0
  309. package/{esm2015/tree/data-source/flat-data-source.js → esm2020/tree/data-source/flat-data-source.mjs} +0 -0
  310. package/{esm2015/tree/data-source/nested-data-source.js → esm2020/tree/data-source/nested-data-source.mjs} +0 -0
  311. package/{esm2015/tree/index.js → esm2020/tree/index.mjs} +0 -0
  312. package/{esm2015/tree/node.js → esm2020/tree/node.mjs} +4 -4
  313. package/{esm2015/tree/outlet.js → esm2020/tree/outlet.mjs} +4 -4
  314. package/esm2020/tree/padding.directive.mjs +110 -0
  315. package/{esm2015/tree/ptsecurity-mosaic-tree.js → esm2020/tree/ptsecurity-mosaic-tree.mjs} +0 -0
  316. package/{esm2015/tree/public-api.js → esm2020/tree/public-api.mjs} +0 -0
  317. package/esm2020/tree/toggle.mjs +80 -0
  318. package/{esm2015/tree/tree-base.js → esm2020/tree/tree-base.mjs} +7 -7
  319. package/{esm2015/tree/tree-errors.js → esm2020/tree/tree-errors.mjs} +0 -0
  320. package/esm2020/tree/tree-option.component.mjs +226 -0
  321. package/esm2020/tree/tree-selection.component.mjs +530 -0
  322. package/esm2020/tree/tree.mjs +15 -0
  323. package/esm2020/tree/tree.module.mjs +53 -0
  324. package/{esm2015/tree-select/index.js → esm2020/tree-select/index.mjs} +0 -0
  325. package/{esm2015/tree-select/ptsecurity-mosaic-tree-select.js → esm2020/tree-select/ptsecurity-mosaic-tree-select.mjs} +0 -0
  326. package/{esm2015/tree-select/public-api.js → esm2020/tree-select/public-api.mjs} +0 -0
  327. package/esm2020/tree-select/tree-select.component.mjs +889 -0
  328. package/{esm2015/tree-select/tree-select.module.js → esm2020/tree-select/tree-select.module.mjs} +5 -5
  329. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs +756 -0
  330. package/fesm2015/ptsecurity-mosaic-autocomplete.mjs.map +1 -0
  331. package/fesm2015/ptsecurity-mosaic-button-toggle.mjs +385 -0
  332. package/fesm2015/ptsecurity-mosaic-button-toggle.mjs.map +1 -0
  333. package/fesm2015/ptsecurity-mosaic-button.mjs +170 -0
  334. package/fesm2015/ptsecurity-mosaic-button.mjs.map +1 -0
  335. package/fesm2015/{ptsecurity-mosaic-card.js → ptsecurity-mosaic-card.mjs} +10 -18
  336. package/fesm2015/ptsecurity-mosaic-card.mjs.map +1 -0
  337. package/fesm2015/ptsecurity-mosaic-checkbox.mjs +366 -0
  338. package/fesm2015/ptsecurity-mosaic-checkbox.mjs.map +1 -0
  339. package/fesm2015/{ptsecurity-mosaic-core.js → ptsecurity-mosaic-core.mjs} +186 -241
  340. package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -0
  341. package/fesm2015/ptsecurity-mosaic-datepicker.mjs +2700 -0
  342. package/fesm2015/ptsecurity-mosaic-datepicker.mjs.map +1 -0
  343. package/fesm2015/{ptsecurity-mosaic-design-tokens.js → ptsecurity-mosaic-design-tokens.mjs} +13 -11
  344. package/fesm2015/ptsecurity-mosaic-design-tokens.mjs.map +1 -0
  345. package/fesm2015/ptsecurity-mosaic-divider.mjs +61 -0
  346. package/fesm2015/ptsecurity-mosaic-divider.mjs.map +1 -0
  347. package/fesm2015/ptsecurity-mosaic-dropdown.mjs +1106 -0
  348. package/fesm2015/ptsecurity-mosaic-dropdown.mjs.map +1 -0
  349. package/fesm2015/ptsecurity-mosaic-form-field.mjs +378 -0
  350. package/fesm2015/ptsecurity-mosaic-form-field.mjs.map +1 -0
  351. package/fesm2015/ptsecurity-mosaic-icon.mjs +88 -0
  352. package/fesm2015/ptsecurity-mosaic-icon.mjs.map +1 -0
  353. package/fesm2015/ptsecurity-mosaic-input.mjs +609 -0
  354. package/fesm2015/ptsecurity-mosaic-input.mjs.map +1 -0
  355. package/fesm2015/{ptsecurity-mosaic-link.js → ptsecurity-mosaic-link.mjs} +8 -8
  356. package/fesm2015/ptsecurity-mosaic-link.mjs.map +1 -0
  357. package/fesm2015/ptsecurity-mosaic-list.mjs +796 -0
  358. package/fesm2015/ptsecurity-mosaic-list.mjs.map +1 -0
  359. package/fesm2015/ptsecurity-mosaic-modal.mjs +842 -0
  360. package/fesm2015/ptsecurity-mosaic-modal.mjs.map +1 -0
  361. package/fesm2015/ptsecurity-mosaic-navbar.mjs +1025 -0
  362. package/fesm2015/ptsecurity-mosaic-navbar.mjs.map +1 -0
  363. package/fesm2015/ptsecurity-mosaic-popover.mjs +393 -0
  364. package/fesm2015/ptsecurity-mosaic-popover.mjs.map +1 -0
  365. package/fesm2015/{ptsecurity-mosaic-progress-bar.js → ptsecurity-mosaic-progress-bar.mjs} +10 -18
  366. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs.map +1 -0
  367. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs +80 -0
  368. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs.map +1 -0
  369. package/fesm2015/ptsecurity-mosaic-radio.mjs +481 -0
  370. package/fesm2015/ptsecurity-mosaic-radio.mjs.map +1 -0
  371. package/fesm2015/ptsecurity-mosaic-select.mjs +1175 -0
  372. package/fesm2015/ptsecurity-mosaic-select.mjs.map +1 -0
  373. package/fesm2015/{ptsecurity-mosaic-sidebar.js → ptsecurity-mosaic-sidebar.mjs} +16 -25
  374. package/fesm2015/ptsecurity-mosaic-sidebar.mjs.map +1 -0
  375. package/fesm2015/ptsecurity-mosaic-sidepanel.mjs +592 -0
  376. package/fesm2015/ptsecurity-mosaic-sidepanel.mjs.map +1 -0
  377. package/fesm2015/ptsecurity-mosaic-splitter.mjs +524 -0
  378. package/fesm2015/ptsecurity-mosaic-splitter.mjs.map +1 -0
  379. package/fesm2015/{ptsecurity-mosaic-table.js → ptsecurity-mosaic-table.mjs} +8 -8
  380. package/fesm2015/ptsecurity-mosaic-table.mjs.map +1 -0
  381. package/fesm2015/ptsecurity-mosaic-tabs.mjs +1511 -0
  382. package/fesm2015/ptsecurity-mosaic-tabs.mjs.map +1 -0
  383. package/fesm2015/ptsecurity-mosaic-tags.mjs +1372 -0
  384. package/fesm2015/ptsecurity-mosaic-tags.mjs.map +1 -0
  385. package/fesm2015/ptsecurity-mosaic-textarea.mjs +293 -0
  386. package/fesm2015/ptsecurity-mosaic-textarea.mjs.map +1 -0
  387. package/fesm2015/ptsecurity-mosaic-timepicker.mjs +715 -0
  388. package/fesm2015/ptsecurity-mosaic-timepicker.mjs.map +1 -0
  389. package/fesm2015/{ptsecurity-mosaic-toggle.js → ptsecurity-mosaic-toggle.mjs} +12 -23
  390. package/fesm2015/ptsecurity-mosaic-toggle.mjs.map +1 -0
  391. package/fesm2015/ptsecurity-mosaic-tooltip.mjs +362 -0
  392. package/fesm2015/ptsecurity-mosaic-tooltip.mjs.map +1 -0
  393. package/fesm2015/ptsecurity-mosaic-tree-select.mjs +932 -0
  394. package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +1 -0
  395. package/fesm2015/ptsecurity-mosaic-tree.mjs +1707 -0
  396. package/fesm2015/ptsecurity-mosaic-tree.mjs.map +1 -0
  397. package/fesm2015/{ptsecurity-mosaic.js → ptsecurity-mosaic.mjs} +1 -1
  398. package/fesm2015/ptsecurity-mosaic.mjs.map +1 -0
  399. package/{fesm2015/ptsecurity-mosaic-autocomplete.js → fesm2020/ptsecurity-mosaic-autocomplete.mjs} +17 -26
  400. package/fesm2020/ptsecurity-mosaic-autocomplete.mjs.map +1 -0
  401. package/{fesm2015/ptsecurity-mosaic-button-toggle.js → fesm2020/ptsecurity-mosaic-button-toggle.mjs} +15 -23
  402. package/fesm2020/ptsecurity-mosaic-button-toggle.mjs.map +1 -0
  403. package/fesm2020/ptsecurity-mosaic-button.mjs +170 -0
  404. package/fesm2020/ptsecurity-mosaic-button.mjs.map +1 -0
  405. package/fesm2020/ptsecurity-mosaic-card.mjs +113 -0
  406. package/fesm2020/ptsecurity-mosaic-card.mjs.map +1 -0
  407. package/{fesm2015/ptsecurity-mosaic-checkbox.js → fesm2020/ptsecurity-mosaic-checkbox.mjs} +13 -23
  408. package/fesm2020/ptsecurity-mosaic-checkbox.mjs.map +1 -0
  409. package/fesm2020/ptsecurity-mosaic-core.mjs +2688 -0
  410. package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -0
  411. package/{fesm2015/ptsecurity-mosaic-datepicker.js → fesm2020/ptsecurity-mosaic-datepicker.mjs} +77 -121
  412. package/fesm2020/ptsecurity-mosaic-datepicker.mjs.map +1 -0
  413. package/fesm2020/ptsecurity-mosaic-design-tokens.mjs +939 -0
  414. package/fesm2020/ptsecurity-mosaic-design-tokens.mjs.map +1 -0
  415. package/fesm2020/ptsecurity-mosaic-divider.mjs +61 -0
  416. package/fesm2020/ptsecurity-mosaic-divider.mjs.map +1 -0
  417. package/{fesm2015/ptsecurity-mosaic-dropdown.js → fesm2020/ptsecurity-mosaic-dropdown.mjs} +45 -53
  418. package/fesm2020/ptsecurity-mosaic-dropdown.mjs.map +1 -0
  419. package/fesm2020/ptsecurity-mosaic-form-field.mjs +377 -0
  420. package/fesm2020/ptsecurity-mosaic-form-field.mjs.map +1 -0
  421. package/fesm2020/ptsecurity-mosaic-icon.mjs +86 -0
  422. package/fesm2020/ptsecurity-mosaic-icon.mjs.map +1 -0
  423. package/{fesm2015/ptsecurity-mosaic-input.js → fesm2020/ptsecurity-mosaic-input.mjs} +41 -27
  424. package/fesm2020/ptsecurity-mosaic-input.mjs.map +1 -0
  425. package/fesm2020/ptsecurity-mosaic-link.mjs +136 -0
  426. package/fesm2020/ptsecurity-mosaic-link.mjs.map +1 -0
  427. package/{fesm2015/ptsecurity-mosaic-list.js → fesm2020/ptsecurity-mosaic-list.mjs} +41 -70
  428. package/fesm2020/ptsecurity-mosaic-list.mjs.map +1 -0
  429. package/{fesm2015/ptsecurity-mosaic-modal.js → fesm2020/ptsecurity-mosaic-modal.mjs} +63 -59
  430. package/fesm2020/ptsecurity-mosaic-modal.mjs.map +1 -0
  431. package/fesm2020/ptsecurity-mosaic-navbar.mjs +1009 -0
  432. package/fesm2020/ptsecurity-mosaic-navbar.mjs.map +1 -0
  433. package/fesm2020/ptsecurity-mosaic-popover.mjs +389 -0
  434. package/fesm2020/ptsecurity-mosaic-popover.mjs.map +1 -0
  435. package/fesm2020/ptsecurity-mosaic-progress-bar.mjs +76 -0
  436. package/fesm2020/ptsecurity-mosaic-progress-bar.mjs.map +1 -0
  437. package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs +80 -0
  438. package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs.map +1 -0
  439. package/{fesm2015/ptsecurity-mosaic-radio.js → fesm2020/ptsecurity-mosaic-radio.mjs} +13 -22
  440. package/fesm2020/ptsecurity-mosaic-radio.mjs.map +1 -0
  441. package/{fesm2015/ptsecurity-mosaic-select.js → fesm2020/ptsecurity-mosaic-select.mjs} +23 -35
  442. package/fesm2020/ptsecurity-mosaic-select.mjs.map +1 -0
  443. package/fesm2020/ptsecurity-mosaic-sidebar.mjs +202 -0
  444. package/fesm2020/ptsecurity-mosaic-sidebar.mjs.map +1 -0
  445. package/{fesm2015/ptsecurity-mosaic-sidepanel.js → fesm2020/ptsecurity-mosaic-sidepanel.mjs} +57 -53
  446. package/fesm2020/ptsecurity-mosaic-sidepanel.mjs.map +1 -0
  447. package/fesm2020/ptsecurity-mosaic-splitter.mjs +524 -0
  448. package/fesm2020/ptsecurity-mosaic-splitter.mjs.map +1 -0
  449. package/fesm2020/ptsecurity-mosaic-table.mjs +50 -0
  450. package/fesm2020/ptsecurity-mosaic-table.mjs.map +1 -0
  451. package/{fesm2015/ptsecurity-mosaic-tabs.js → fesm2020/ptsecurity-mosaic-tabs.mjs} +65 -102
  452. package/fesm2020/ptsecurity-mosaic-tabs.mjs.map +1 -0
  453. package/{fesm2015/ptsecurity-mosaic-tags.js → fesm2020/ptsecurity-mosaic-tags.mjs} +29 -47
  454. package/fesm2020/ptsecurity-mosaic-tags.mjs.map +1 -0
  455. package/{fesm2015/ptsecurity-mosaic-textarea.js → fesm2020/ptsecurity-mosaic-textarea.mjs} +8 -8
  456. package/fesm2020/ptsecurity-mosaic-textarea.mjs.map +1 -0
  457. package/{fesm2015/ptsecurity-mosaic-timepicker.js → fesm2020/ptsecurity-mosaic-timepicker.mjs} +16 -15
  458. package/fesm2020/ptsecurity-mosaic-timepicker.mjs.map +1 -0
  459. package/fesm2020/ptsecurity-mosaic-toggle.mjs +180 -0
  460. package/fesm2020/ptsecurity-mosaic-toggle.mjs.map +1 -0
  461. package/fesm2020/ptsecurity-mosaic-tooltip.mjs +354 -0
  462. package/fesm2020/ptsecurity-mosaic-tooltip.mjs.map +1 -0
  463. package/{fesm2015/ptsecurity-mosaic-tree-select.js → fesm2020/ptsecurity-mosaic-tree-select.mjs} +16 -27
  464. package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +1 -0
  465. package/{fesm2015/ptsecurity-mosaic-tree.js → fesm2020/ptsecurity-mosaic-tree.mjs} +61 -108
  466. package/fesm2020/ptsecurity-mosaic-tree.mjs.map +1 -0
  467. package/fesm2020/ptsecurity-mosaic.mjs +4 -0
  468. package/fesm2020/ptsecurity-mosaic.mjs.map +1 -0
  469. package/form-field/README.md +0 -0
  470. package/form-field/cleaner.d.ts +2 -0
  471. package/form-field/package.json +5 -5
  472. package/icon/README.md +0 -0
  473. package/icon/package.json +5 -5
  474. package/input/input-number-validators.d.ts +2 -2
  475. package/input/package.json +5 -5
  476. package/link/README.md +0 -0
  477. package/link/package.json +5 -5
  478. package/list/README.md +0 -0
  479. package/list/package.json +5 -5
  480. package/modal/README.md +34 -0
  481. package/modal/modal.component.d.ts +2 -0
  482. package/modal/modal.module.d.ts +1 -1
  483. package/modal/package.json +5 -5
  484. package/navbar/README.md +41 -0
  485. package/navbar/navbar-item.component.d.ts +122 -34
  486. package/navbar/navbar.component.d.ts +37 -9
  487. package/navbar/navbar.module.d.ts +2 -1
  488. package/navbar/package.json +5 -5
  489. package/navbar/vertical-navbar.component.d.ts +15 -26
  490. package/package.json +299 -14
  491. package/popover/README.md +32 -0
  492. package/popover/package.json +5 -5
  493. package/popover/popover-confirm.component.d.ts +33 -0
  494. package/popover/popover.component.d.ts +14 -4
  495. package/popover/popover.module.d.ts +6 -3
  496. package/popover/public-api.d.ts +1 -0
  497. package/prebuilt-themes/dark-theme.css +1 -1
  498. package/prebuilt-themes/default-theme.css +1 -1
  499. package/prebuilt-visual/default-visual.css +1 -1
  500. package/progress-bar/README.md +0 -0
  501. package/progress-bar/package.json +5 -5
  502. package/progress-spinner/README.md +0 -0
  503. package/progress-spinner/package.json +5 -5
  504. package/radio/package.json +5 -5
  505. package/schematics/README.md +35 -0
  506. package/schematics/ng-update/data/index.d.ts +1 -0
  507. package/schematics/ng-update/data/index.js +10 -9
  508. package/schematics/ng-update/data/index.js.map +1 -1
  509. package/schematics/ng-update/data/symbol-removal.d.ts +2 -0
  510. package/schematics/ng-update/data/symbol-removal.js +5 -0
  511. package/schematics/ng-update/data/symbol-removal.js.map +1 -0
  512. package/schematics/ng-update/index.js +3 -3
  513. package/schematics/ng-update/index.js.map +1 -1
  514. package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js +1 -2
  515. package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js.map +1 -1
  516. package/schematics/ng-update/upgrade-data.js +2 -1
  517. package/schematics/ng-update/upgrade-data.js.map +1 -1
  518. package/schematics/tsconfig.lib.json +2 -2
  519. package/select/README.md +0 -0
  520. package/select/package.json +5 -5
  521. package/select/select.component.d.ts +2 -7
  522. package/sidebar/package.json +5 -5
  523. package/sidepanel/package.json +5 -5
  524. package/sidepanel/sidepanel-directives.d.ts +2 -0
  525. package/sidepanel/sidepanel.module.d.ts +2 -1
  526. package/splitter/package.json +5 -5
  527. package/splitter/splitter.component.d.ts +46 -5
  528. package/splitter/splitter.module.d.ts +1 -1
  529. package/table/README.md +0 -0
  530. package/table/package.json +5 -5
  531. package/tabs/README.md +0 -0
  532. package/tabs/package.json +5 -5
  533. package/tags/README.md +0 -0
  534. package/tags/package.json +5 -5
  535. package/textarea/README.md +0 -0
  536. package/textarea/package.json +5 -5
  537. package/timepicker/README.md +0 -0
  538. package/timepicker/package.json +5 -5
  539. package/toggle/package.json +5 -5
  540. package/tooltip/package.json +5 -5
  541. package/tooltip/tooltip.component.d.ts +12 -3
  542. package/tree/package.json +5 -5
  543. package/tree/padding.directive.d.ts +1 -1
  544. package/tree/tree-option.component.d.ts +1 -1
  545. package/tree/tree-selection.component.d.ts +2 -2
  546. package/tree/tree.module.d.ts +1 -1
  547. package/tree-select/README.md +0 -0
  548. package/tree-select/package.json +5 -5
  549. package/tree-select/tree-select.component.d.ts +2 -7
  550. package/bundles/ptsecurity-mosaic-autocomplete.umd.js +0 -1162
  551. package/bundles/ptsecurity-mosaic-autocomplete.umd.js.map +0 -1
  552. package/bundles/ptsecurity-mosaic-button-toggle.umd.js +0 -757
  553. package/bundles/ptsecurity-mosaic-button-toggle.umd.js.map +0 -1
  554. package/bundles/ptsecurity-mosaic-button.umd.js +0 -535
  555. package/bundles/ptsecurity-mosaic-button.umd.js.map +0 -1
  556. package/bundles/ptsecurity-mosaic-card.umd.js +0 -481
  557. package/bundles/ptsecurity-mosaic-card.umd.js.map +0 -1
  558. package/bundles/ptsecurity-mosaic-checkbox.umd.js +0 -764
  559. package/bundles/ptsecurity-mosaic-checkbox.umd.js.map +0 -1
  560. package/bundles/ptsecurity-mosaic-core.umd.js +0 -2887
  561. package/bundles/ptsecurity-mosaic-core.umd.js.map +0 -1
  562. package/bundles/ptsecurity-mosaic-datepicker.umd.js +0 -3357
  563. package/bundles/ptsecurity-mosaic-datepicker.umd.js.map +0 -1
  564. package/bundles/ptsecurity-mosaic-design-tokens.umd.js +0 -1872
  565. package/bundles/ptsecurity-mosaic-design-tokens.umd.js.map +0 -1
  566. package/bundles/ptsecurity-mosaic-divider.umd.js +0 -108
  567. package/bundles/ptsecurity-mosaic-divider.umd.js.map +0 -1
  568. package/bundles/ptsecurity-mosaic-dropdown.umd.js +0 -1519
  569. package/bundles/ptsecurity-mosaic-dropdown.umd.js.map +0 -1
  570. package/bundles/ptsecurity-mosaic-form-field.umd.js +0 -789
  571. package/bundles/ptsecurity-mosaic-form-field.umd.js.map +0 -1
  572. package/bundles/ptsecurity-mosaic-icon.umd.js +0 -452
  573. package/bundles/ptsecurity-mosaic-icon.umd.js.map +0 -1
  574. package/bundles/ptsecurity-mosaic-input.umd.js +0 -996
  575. package/bundles/ptsecurity-mosaic-input.umd.js.map +0 -1
  576. package/bundles/ptsecurity-mosaic-link.umd.js +0 -517
  577. package/bundles/ptsecurity-mosaic-link.umd.js.map +0 -1
  578. package/bundles/ptsecurity-mosaic-list.umd.js +0 -1250
  579. package/bundles/ptsecurity-mosaic-list.umd.js.map +0 -1
  580. package/bundles/ptsecurity-mosaic-modal.umd.js +0 -1304
  581. package/bundles/ptsecurity-mosaic-modal.umd.js.map +0 -1
  582. package/bundles/ptsecurity-mosaic-navbar.umd.js +0 -932
  583. package/bundles/ptsecurity-mosaic-navbar.umd.js.map +0 -1
  584. package/bundles/ptsecurity-mosaic-popover.umd.js +0 -655
  585. package/bundles/ptsecurity-mosaic-popover.umd.js.map +0 -1
  586. package/bundles/ptsecurity-mosaic-progress-bar.umd.js +0 -442
  587. package/bundles/ptsecurity-mosaic-progress-bar.umd.js.map +0 -1
  588. package/bundles/ptsecurity-mosaic-progress-spinner.umd.js +0 -450
  589. package/bundles/ptsecurity-mosaic-progress-spinner.umd.js.map +0 -1
  590. package/bundles/ptsecurity-mosaic-radio.umd.js +0 -903
  591. package/bundles/ptsecurity-mosaic-radio.umd.js.map +0 -1
  592. package/bundles/ptsecurity-mosaic-select.umd.js +0 -1608
  593. package/bundles/ptsecurity-mosaic-select.umd.js.map +0 -1
  594. package/bundles/ptsecurity-mosaic-sidebar.umd.js +0 -256
  595. package/bundles/ptsecurity-mosaic-sidebar.umd.js.map +0 -1
  596. package/bundles/ptsecurity-mosaic-sidepanel.umd.js +0 -950
  597. package/bundles/ptsecurity-mosaic-sidepanel.umd.js.map +0 -1
  598. package/bundles/ptsecurity-mosaic-splitter.umd.js +0 -438
  599. package/bundles/ptsecurity-mosaic-splitter.umd.js.map +0 -1
  600. package/bundles/ptsecurity-mosaic-table.umd.js +0 -83
  601. package/bundles/ptsecurity-mosaic-table.umd.js.map +0 -1
  602. package/bundles/ptsecurity-mosaic-tabs.umd.js +0 -2015
  603. package/bundles/ptsecurity-mosaic-tabs.umd.js.map +0 -1
  604. package/bundles/ptsecurity-mosaic-tags.umd.js +0 -1913
  605. package/bundles/ptsecurity-mosaic-tags.umd.js.map +0 -1
  606. package/bundles/ptsecurity-mosaic-textarea.umd.js +0 -666
  607. package/bundles/ptsecurity-mosaic-textarea.umd.js.map +0 -1
  608. package/bundles/ptsecurity-mosaic-timepicker.umd.js +0 -822
  609. package/bundles/ptsecurity-mosaic-timepicker.umd.js.map +0 -1
  610. package/bundles/ptsecurity-mosaic-toggle.umd.js +0 -559
  611. package/bundles/ptsecurity-mosaic-toggle.umd.js.map +0 -1
  612. package/bundles/ptsecurity-mosaic-tooltip.umd.js +0 -728
  613. package/bundles/ptsecurity-mosaic-tooltip.umd.js.map +0 -1
  614. package/bundles/ptsecurity-mosaic-tree-select.umd.js +0 -1370
  615. package/bundles/ptsecurity-mosaic-tree-select.umd.js.map +0 -1
  616. package/bundles/ptsecurity-mosaic-tree.umd.js +0 -2309
  617. package/bundles/ptsecurity-mosaic-tree.umd.js.map +0 -1
  618. package/bundles/ptsecurity-mosaic.umd.js +0 -11
  619. package/bundles/ptsecurity-mosaic.umd.js.map +0 -1
  620. package/esm2015/autocomplete/autocomplete.component.js +0 -163
  621. package/esm2015/button/button.component.js +0 -129
  622. package/esm2015/button/button.module.js +0 -42
  623. package/esm2015/button-toggle/button-toggle.component.js +0 -370
  624. package/esm2015/card/card.component.js +0 -88
  625. package/esm2015/checkbox/checkbox.js +0 -325
  626. package/esm2015/core/formatters/date/formatter.js +0 -287
  627. package/esm2015/core/formatters/date/templates/en-US.js +0 -280
  628. package/esm2015/core/formatters/date/templates/ru-RU.js +0 -280
  629. package/esm2015/core/formatters/number/formatter.js +0 -99
  630. package/esm2015/core/option/action.js +0 -131
  631. package/esm2015/core/option/optgroup.js +0 -40
  632. package/esm2015/core/option/option.js +0 -262
  633. package/esm2015/core/pop-up/pop-up-trigger.js +0 -273
  634. package/esm2015/core/pop-up/pop-up.js +0 -87
  635. package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.js +0 -45
  636. package/esm2015/datepicker/calendar-body.component.js +0 -114
  637. package/esm2015/datepicker/calendar.component.js +0 -377
  638. package/esm2015/datepicker/datepicker-input.directive.js +0 -885
  639. package/esm2015/datepicker/datepicker-toggle.component.js +0 -94
  640. package/esm2015/datepicker/datepicker.component.js +0 -418
  641. package/esm2015/dropdown/dropdown-item.component.js +0 -142
  642. package/esm2015/dropdown/dropdown-trigger.directive.js +0 -478
  643. package/esm2015/dropdown/dropdown.component.js +0 -302
  644. package/esm2015/form-field/cleaner.js +0 -19
  645. package/esm2015/form-field/form-field.js +0 -224
  646. package/esm2015/icon/icon.component.js +0 -51
  647. package/esm2015/input/input-number-validators.js +0 -78
  648. package/esm2015/link/link.component.js +0 -108
  649. package/esm2015/list/list-selection.component.js +0 -708
  650. package/esm2015/list/list.component.js +0 -58
  651. package/esm2015/modal/modal.component.js +0 -506
  652. package/esm2015/modal/modal.module.js +0 -70
  653. package/esm2015/modal/modal.service.js +0 -117
  654. package/esm2015/navbar/navbar-item.component.js +0 -209
  655. package/esm2015/navbar/navbar.component.js +0 -118
  656. package/esm2015/navbar/navbar.module.js +0 -76
  657. package/esm2015/navbar/vertical-navbar.component.js +0 -140
  658. package/esm2015/popover/popover.component.js +0 -219
  659. package/esm2015/popover/popover.module.js +0 -21
  660. package/esm2015/progress-bar/progress-bar.component.js +0 -50
  661. package/esm2015/progress-spinner/progress-spinner.component.js +0 -54
  662. package/esm2015/radio/radio.component.js +0 -467
  663. package/esm2015/select/select.component.js +0 -1122
  664. package/esm2015/sidebar/sidebar.component.js +0 -155
  665. package/esm2015/sidepanel/sidepanel-container.component.js +0 -113
  666. package/esm2015/sidepanel/sidepanel-directives.js +0 -155
  667. package/esm2015/sidepanel/sidepanel.module.js +0 -70
  668. package/esm2015/sidepanel/sidepanel.service.js +0 -163
  669. package/esm2015/splitter/splitter.component.js +0 -331
  670. package/esm2015/splitter/splitter.module.js +0 -38
  671. package/esm2015/tabs/paginated-tab-header.js +0 -482
  672. package/esm2015/tabs/tab-body.component.js +0 -186
  673. package/esm2015/tabs/tab-group.component.js +0 -359
  674. package/esm2015/tabs/tab-header.component.js +0 -76
  675. package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +0 -118
  676. package/esm2015/tags/tag-list.component.js +0 -732
  677. package/esm2015/tags/tag.component.js +0 -382
  678. package/esm2015/timepicker/timepicker.directive.js +0 -652
  679. package/esm2015/toggle/toggle.component.js +0 -169
  680. package/esm2015/tooltip/tooltip.component.js +0 -260
  681. package/esm2015/tree/padding.directive.js +0 -114
  682. package/esm2015/tree/toggle.js +0 -89
  683. package/esm2015/tree/tree-option.component.js +0 -238
  684. package/esm2015/tree/tree-selection.component.js +0 -541
  685. package/esm2015/tree/tree.js +0 -23
  686. package/esm2015/tree/tree.module.js +0 -56
  687. package/esm2015/tree-select/tree-select.component.js +0 -900
  688. package/fesm2015/ptsecurity-mosaic-autocomplete.js.map +0 -1
  689. package/fesm2015/ptsecurity-mosaic-button-toggle.js.map +0 -1
  690. package/fesm2015/ptsecurity-mosaic-button.js +0 -174
  691. package/fesm2015/ptsecurity-mosaic-button.js.map +0 -1
  692. package/fesm2015/ptsecurity-mosaic-card.js.map +0 -1
  693. package/fesm2015/ptsecurity-mosaic-checkbox.js.map +0 -1
  694. package/fesm2015/ptsecurity-mosaic-core.js.map +0 -1
  695. package/fesm2015/ptsecurity-mosaic-datepicker.js.map +0 -1
  696. package/fesm2015/ptsecurity-mosaic-design-tokens.js.map +0 -1
  697. package/fesm2015/ptsecurity-mosaic-divider.js +0 -68
  698. package/fesm2015/ptsecurity-mosaic-divider.js.map +0 -1
  699. package/fesm2015/ptsecurity-mosaic-dropdown.js.map +0 -1
  700. package/fesm2015/ptsecurity-mosaic-form-field.js +0 -393
  701. package/fesm2015/ptsecurity-mosaic-form-field.js.map +0 -1
  702. package/fesm2015/ptsecurity-mosaic-icon.js +0 -93
  703. package/fesm2015/ptsecurity-mosaic-icon.js.map +0 -1
  704. package/fesm2015/ptsecurity-mosaic-input.js.map +0 -1
  705. package/fesm2015/ptsecurity-mosaic-link.js.map +0 -1
  706. package/fesm2015/ptsecurity-mosaic-list.js.map +0 -1
  707. package/fesm2015/ptsecurity-mosaic-modal.js.map +0 -1
  708. package/fesm2015/ptsecurity-mosaic-navbar.js +0 -539
  709. package/fesm2015/ptsecurity-mosaic-navbar.js.map +0 -1
  710. package/fesm2015/ptsecurity-mosaic-popover.js +0 -257
  711. package/fesm2015/ptsecurity-mosaic-popover.js.map +0 -1
  712. package/fesm2015/ptsecurity-mosaic-progress-bar.js.map +0 -1
  713. package/fesm2015/ptsecurity-mosaic-progress-spinner.js +0 -88
  714. package/fesm2015/ptsecurity-mosaic-progress-spinner.js.map +0 -1
  715. package/fesm2015/ptsecurity-mosaic-radio.js.map +0 -1
  716. package/fesm2015/ptsecurity-mosaic-select.js.map +0 -1
  717. package/fesm2015/ptsecurity-mosaic-sidebar.js.map +0 -1
  718. package/fesm2015/ptsecurity-mosaic-sidepanel.js.map +0 -1
  719. package/fesm2015/ptsecurity-mosaic-splitter.js +0 -373
  720. package/fesm2015/ptsecurity-mosaic-splitter.js.map +0 -1
  721. package/fesm2015/ptsecurity-mosaic-table.js.map +0 -1
  722. package/fesm2015/ptsecurity-mosaic-tabs.js.map +0 -1
  723. package/fesm2015/ptsecurity-mosaic-tags.js.map +0 -1
  724. package/fesm2015/ptsecurity-mosaic-textarea.js.map +0 -1
  725. package/fesm2015/ptsecurity-mosaic-timepicker.js.map +0 -1
  726. package/fesm2015/ptsecurity-mosaic-toggle.js.map +0 -1
  727. package/fesm2015/ptsecurity-mosaic-tooltip.js +0 -323
  728. package/fesm2015/ptsecurity-mosaic-tooltip.js.map +0 -1
  729. package/fesm2015/ptsecurity-mosaic-tree-select.js.map +0 -1
  730. package/fesm2015/ptsecurity-mosaic-tree.js.map +0 -1
  731. package/fesm2015/ptsecurity-mosaic.js.map +0 -1
@@ -1,2309 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@ptsecurity/mosaic/core'), require('@angular/cdk/coercion'), require('@ptsecurity/mosaic/design-tokens'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/bidi'), require('@ptsecurity/cdk/keycodes'), require('@ptsecurity/mosaic/dropdown'), require('@ptsecurity/mosaic/tooltip'), require('@angular/cdk/collections'), require('@angular/forms'), require('@ptsecurity/cdk/a11y'), require('@angular/cdk/clipboard')) :
3
- typeof define === 'function' && define.amd ? define('@ptsecurity/mosaic/tree', ['exports', '@angular/common', '@angular/core', '@ptsecurity/mosaic/core', '@angular/cdk/coercion', '@ptsecurity/mosaic/design-tokens', 'rxjs', 'rxjs/operators', '@angular/cdk/bidi', '@ptsecurity/cdk/keycodes', '@ptsecurity/mosaic/dropdown', '@ptsecurity/mosaic/tooltip', '@angular/cdk/collections', '@angular/forms', '@ptsecurity/cdk/a11y', '@angular/cdk/clipboard'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ptsecurity = global.ptsecurity || {}, global.ptsecurity.mosaic = global.ptsecurity.mosaic || {}, global.ptsecurity.mosaic.tree = {}), global.ng.common, global.ng.core, global.ptsecurity.mosaic.core, global.ng.cdk.coercion, global.ptsecurity.mosaic['design-tokens'], global.rxjs, global.rxjs.operators, global.ng.cdk.bidi, global.mc.cdk.keycodes, global.ptsecurity.mosaic.dropdown, global.ptsecurity.mosaic.tooltip, global.ng.cdk.collections, global.ng.forms, global.mc.cdk.a11y, global.ng.cdk.clipboard));
5
- }(this, (function (exports, i2$1, i0, i1, coercion, designTokens, rxjs, operators, i2, keycodes, dropdown, tooltip, collections, forms, a11y, i1$1) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
19
- });
20
- }
21
- });
22
- }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
28
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
29
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
30
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
31
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
32
-
33
- /** Context provided to the tree node component. */
34
- var McTreeNodeOutletContext = /** @class */ (function () {
35
- function McTreeNodeOutletContext(data) {
36
- this.$implicit = data;
37
- }
38
- return McTreeNodeOutletContext;
39
- }());
40
- /**
41
- * Data node definition for the McTree.
42
- * Captures the node's template and a when predicate that describes when this node should be used.
43
- */
44
- var McTreeNodeDef = /** @class */ (function () {
45
- /** @docs-private */
46
- function McTreeNodeDef(template) {
47
- this.template = template;
48
- }
49
- return McTreeNodeDef;
50
- }());
51
- /** @nocollapse */ McTreeNodeDef.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeDef, deps: [{ token: i0__namespace.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
52
- /** @nocollapse */ McTreeNodeDef.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: McTreeNodeDef, selector: "[mcTreeNodeDef]", inputs: { when: ["mcTreeNodeDefWhen", "when"], data: ["mcTreeNode", "data"] }, ngImport: i0__namespace });
53
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeDef, decorators: [{
54
- type: i0.Directive,
55
- args: [{
56
- selector: '[mcTreeNodeDef]',
57
- inputs: ['when: mcTreeNodeDefWhen']
58
- }]
59
- }], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }]; }, propDecorators: { data: [{
60
- type: i0.Input,
61
- args: ['mcTreeNode']
62
- }] } });
63
-
64
- var McTreeNodeOutlet = /** @class */ (function () {
65
- function McTreeNodeOutlet(viewContainer, changeDetectorRef) {
66
- this.viewContainer = viewContainer;
67
- this.changeDetectorRef = changeDetectorRef;
68
- }
69
- return McTreeNodeOutlet;
70
- }());
71
- /** @nocollapse */ McTreeNodeOutlet.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeOutlet, deps: [{ token: i0__namespace.ViewContainerRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
72
- /** @nocollapse */ McTreeNodeOutlet.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: McTreeNodeOutlet, selector: "[mcTreeNodeOutlet]", ngImport: i0__namespace });
73
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeOutlet, decorators: [{
74
- type: i0.Directive,
75
- args: [{ selector: '[mcTreeNodeOutlet]' }]
76
- }], ctorParameters: function () { return [{ type: i0__namespace.ViewContainerRef }, { type: i0__namespace.ChangeDetectorRef }]; } });
77
-
78
- /**
79
- * Returns an error to be thrown when there is no usable data.
80
- * @docs-private
81
- */
82
- function getTreeNoValidDataSourceError() {
83
- return Error("A valid data source must be provided.");
84
- }
85
- /**
86
- * Returns an error to be thrown when there are multiple nodes that are missing a when function.
87
- * @docs-private
88
- */
89
- function getTreeMultipleDefaultNodeDefsError() {
90
- return Error("There can only be one default row without a when predicate function.");
91
- }
92
- /**
93
- * Returns an error to be thrown when there are no matching node defs for a particular set of data.
94
- * @docs-private
95
- */
96
- function getTreeMissingMatchingNodeDefError() {
97
- return Error("Could not find a matching node definition for the provided node data.");
98
- }
99
- /**
100
- * Returns an error to be thrown when there are tree control.
101
- * @docs-private
102
- */
103
- function getTreeControlMissingError() {
104
- return Error("Could not find a tree control for the tree.");
105
- }
106
- /**
107
- * Returns an error to be thrown when tree control did not implement functions for flat/nested node.
108
- * @docs-private
109
- */
110
- function getTreeControlFunctionsMissingError() {
111
- return Error("Could not find functions for nested/flat tree in tree control.");
112
- }
113
-
114
- var McTreeBase = /** @class */ (function () {
115
- function McTreeBase(differs, changeDetectorRef) {
116
- this.differs = differs;
117
- this.changeDetectorRef = changeDetectorRef;
118
- // TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange.
119
- // Remove the MAX_VALUE in viewChange
120
- /**
121
- * Stream containing the latest information on what rows are being displayed on screen.
122
- * Can be used by the data source to as a heuristic of what data should be provided.
123
- */
124
- this.viewChange = new rxjs.BehaviorSubject({ start: 0, end: Number.MAX_VALUE });
125
- /** Subject that emits when the component has been destroyed. */
126
- this.onDestroy = new rxjs.Subject();
127
- /** Level of nodes */
128
- this.levels = new Map();
129
- }
130
- Object.defineProperty(McTreeBase.prototype, "dataSource", {
131
- /**
132
- * Provides a stream containing the latest data array to render. Influenced by the tree's
133
- * stream of view window (what dataNodes are currently on screen).
134
- * Data source can be an observable of data array, or a dara array to render.
135
- */
136
- get: function () {
137
- return this._dataSource;
138
- },
139
- set: function (dataSource) {
140
- if (this._dataSource !== dataSource) {
141
- this.switchDataSource(dataSource);
142
- }
143
- },
144
- enumerable: false,
145
- configurable: true
146
- });
147
- McTreeBase.prototype.ngOnInit = function () {
148
- this.dataDiffer = this.differs.find([]).create(this.trackBy);
149
- if (!this.treeControl) {
150
- throw getTreeControlMissingError();
151
- }
152
- };
153
- McTreeBase.prototype.ngOnDestroy = function () {
154
- this.nodeOutlet.viewContainer.clear();
155
- this.onDestroy.next();
156
- this.onDestroy.complete();
157
- // tslint:disable-next-line:no-unbound-method
158
- if (this._dataSource && typeof this.dataSource.disconnect === 'function') {
159
- this.dataSource.disconnect(this);
160
- }
161
- if (this.dataSubscription) {
162
- this.dataSubscription.unsubscribe();
163
- this.dataSubscription = null;
164
- }
165
- };
166
- McTreeBase.prototype.ngAfterContentChecked = function () {
167
- var defaultNodeDefs = this.nodeDefs.filter(function (def) { return !def.when; });
168
- if (defaultNodeDefs.length > 1) {
169
- throw getTreeMultipleDefaultNodeDefsError();
170
- }
171
- this.defaultNodeDef = defaultNodeDefs[0];
172
- if (this.dataSource && this.nodeDefs && !this.dataSubscription) {
173
- this.observeRenderChanges();
174
- }
175
- };
176
- /** Check for changes made in the data and render each change (node added/removed/moved). */
177
- McTreeBase.prototype.renderNodeChanges = function (data, dataDiffer, viewContainer, parentData) {
178
- var _this = this;
179
- if (dataDiffer === void 0) { dataDiffer = this.dataDiffer; }
180
- if (viewContainer === void 0) { viewContainer = this.nodeOutlet.viewContainer; }
181
- var changes = dataDiffer.diff(data);
182
- if (!changes) {
183
- return;
184
- }
185
- changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {
186
- if (item.previousIndex == null) {
187
- _this.insertNode(data[currentIndex], currentIndex, viewContainer, parentData);
188
- }
189
- else if (currentIndex == null) {
190
- viewContainer.remove(adjustedPreviousIndex);
191
- _this.levels.delete(item.item);
192
- }
193
- else {
194
- var view = viewContainer.get(adjustedPreviousIndex);
195
- viewContainer.move(view, currentIndex);
196
- }
197
- });
198
- this.changeDetectorRef.detectChanges();
199
- };
200
- /**
201
- * Finds the matching node definition that should be used for this node data. If there is only
202
- * one node definition, it is returned. Otherwise, find the node definition that has a when
203
- * predicate that returns true with the data. If none return true, return the default node
204
- * definition.
205
- */
206
- McTreeBase.prototype.getNodeDef = function (data, i) {
207
- if (this.nodeDefs.length === 1) {
208
- return this.nodeDefs.first;
209
- }
210
- var nodeDef = this.nodeDefs.find(function (def) { return def.when && def.when(i, data); }) || this.defaultNodeDef;
211
- if (!nodeDef) {
212
- throw getTreeMissingMatchingNodeDefError();
213
- }
214
- return nodeDef;
215
- };
216
- /**
217
- * Create the embedded view for the data node template and place it in the correct index location
218
- * within the data node view container.
219
- */
220
- McTreeBase.prototype.insertNode = function (nodeData, index, viewContainer, parentData) {
221
- var node = this.getNodeDef(nodeData, index);
222
- // Node context that will be provided to created embedded view
223
- var context = new McTreeNodeOutletContext(nodeData);
224
- // If the tree is flat tree, then use the `getLevel` function in flat tree control
225
- // Otherwise, use the level of parent node.
226
- if (this.treeControl.getLevel) {
227
- context.level = this.treeControl.getLevel(nodeData);
228
- /* tslint:disable-next-line:no-typeof-undefined */
229
- }
230
- else if (typeof parentData !== 'undefined' && this.levels.has(parentData)) {
231
- context.level = this.levels.get(parentData) + 1;
232
- }
233
- else {
234
- context.level = 0;
235
- }
236
- this.levels.set(nodeData, context.level);
237
- // Use default tree nodeOutlet, or nested node's nodeOutlet
238
- var container = viewContainer ? viewContainer : this.nodeOutlet.viewContainer;
239
- container.createEmbeddedView(node.template, context, index);
240
- // Set the data to just created `McTreeNode`.
241
- // The `McTreeNode` created from `createEmbeddedView` will be saved in static variable
242
- // `mostRecentTreeNode`. We get it from static variable and pass the node data to it.
243
- if (McTreeNode.mostRecentTreeNode) {
244
- McTreeNode.mostRecentTreeNode.data = nodeData;
245
- }
246
- };
247
- /** Set up a subscription for the data provided by the data source. */
248
- McTreeBase.prototype.observeRenderChanges = function () {
249
- var _this = this;
250
- var dataStream;
251
- // Cannot use `instanceof DataSource` since the data source could be a literal with
252
- // `connect` function and may not extends DataSource.
253
- // tslint:disable-next-line:no-unbound-method
254
- if (typeof this._dataSource.connect === 'function') {
255
- dataStream = this._dataSource.connect(this);
256
- }
257
- else if (this._dataSource instanceof rxjs.Observable) {
258
- dataStream = this._dataSource;
259
- }
260
- else if (Array.isArray(this._dataSource)) {
261
- dataStream = rxjs.of(this._dataSource);
262
- }
263
- if (dataStream) {
264
- this.dataSubscription = dataStream
265
- .pipe(operators.takeUntil(this.onDestroy))
266
- .subscribe(function (data) { return _this.renderNodeChanges(data); });
267
- }
268
- else {
269
- throw getTreeNoValidDataSourceError();
270
- }
271
- };
272
- /**
273
- * Switch to the provided data source by resetting the data and unsubscribing from the current
274
- * render change subscription if one exists. If the data source is null, interpret this by
275
- * clearing the node outlet. Otherwise start listening for new data.
276
- */
277
- McTreeBase.prototype.switchDataSource = function (dataSource) {
278
- // tslint:disable-next-line:no-unbound-method
279
- if (this._dataSource && typeof this._dataSource.disconnect === 'function') {
280
- this.dataSource.disconnect(this);
281
- }
282
- if (this.dataSubscription) {
283
- this.dataSubscription.unsubscribe();
284
- this.dataSubscription = null;
285
- }
286
- // Remove the all dataNodes if there is now no data source
287
- if (!dataSource) {
288
- this.nodeOutlet.viewContainer.clear();
289
- }
290
- this._dataSource = dataSource;
291
- if (this.nodeDefs) {
292
- this.observeRenderChanges();
293
- }
294
- };
295
- return McTreeBase;
296
- }());
297
- /** @nocollapse */ McTreeBase.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeBase, deps: [{ token: i0__namespace.IterableDiffers }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
298
- /** @nocollapse */ McTreeBase.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", 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__namespace });
299
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeBase, decorators: [{
300
- type: i0.Directive
301
- }], ctorParameters: function () { return [{ type: i0__namespace.IterableDiffers }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { treeControl: [{
302
- type: i0.Input
303
- }], trackBy: [{
304
- type: i0.Input
305
- }], nodeOutlet: [{
306
- type: i0.ViewChild,
307
- args: [McTreeNodeOutlet, { static: true }]
308
- }], nodeDefs: [{
309
- type: i0.ContentChildren,
310
- args: [McTreeNodeDef]
311
- }], dataSource: [{
312
- type: i0.Input
313
- }] } });
314
- var McTreeNode = /** @class */ (function () {
315
- function McTreeNode(elementRef, tree) {
316
- this.elementRef = elementRef;
317
- this.tree = tree;
318
- this.destroyed = new rxjs.Subject();
319
- McTreeNode.mostRecentTreeNode = this;
320
- }
321
- Object.defineProperty(McTreeNode.prototype, "data", {
322
- get: function () {
323
- return this._data;
324
- },
325
- set: function (value) {
326
- this._data = value;
327
- },
328
- enumerable: false,
329
- configurable: true
330
- });
331
- Object.defineProperty(McTreeNode.prototype, "isExpanded", {
332
- get: function () {
333
- return this.tree.treeControl.isExpanded(this.data);
334
- },
335
- enumerable: false,
336
- configurable: true
337
- });
338
- Object.defineProperty(McTreeNode.prototype, "level", {
339
- get: function () {
340
- return this.tree.treeControl.getLevel ? this.tree.treeControl.getLevel(this._data) : 0;
341
- },
342
- enumerable: false,
343
- configurable: true
344
- });
345
- McTreeNode.prototype.ngOnDestroy = function () {
346
- this.destroyed.next();
347
- this.destroyed.complete();
348
- };
349
- McTreeNode.prototype.focus = function () {
350
- this.elementRef.nativeElement.focus();
351
- };
352
- return McTreeNode;
353
- }());
354
- /**
355
- * The most recently created `McTreeNode`. We save it in static variable so we can retrieve it
356
- * in `McTree` and set the data to it.
357
- */
358
- McTreeNode.mostRecentTreeNode = null;
359
- /** @nocollapse */ McTreeNode.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNode, deps: [{ token: i0__namespace.ElementRef }, { token: i0.forwardRef(function () { return McTreeBase; }) }], target: i0__namespace.ɵɵFactoryTarget.Directive });
360
- /** @nocollapse */ McTreeNode.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: McTreeNode, selector: "mc-tree-node", exportAs: ["mcTreeNode"], ngImport: i0__namespace });
361
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNode, decorators: [{
362
- type: i0.Directive,
363
- args: [{
364
- selector: 'mc-tree-node',
365
- exportAs: 'mcTreeNode'
366
- }]
367
- }], ctorParameters: function () {
368
- return [{ type: i0__namespace.ElementRef }, { type: McTreeBase, decorators: [{
369
- type: i0.Inject,
370
- args: [i0.forwardRef(function () { return McTreeBase; })]
371
- }] }];
372
- } });
373
-
374
- /** Regex used to split a string on its CSS units. */
375
- var cssUnitPattern = /([A-Za-z%]+)$/;
376
- var McTreeNodePadding = /** @class */ (function () {
377
- function McTreeNodePadding(treeNode, tree, renderer, element, dir) {
378
- var _this = this;
379
- var _a, _b;
380
- this.treeNode = treeNode;
381
- this.tree = tree;
382
- this.renderer = renderer;
383
- this.element = element;
384
- this.dir = dir;
385
- this._indent = 20;
386
- /** CSS units used for the indentation value. */
387
- this.indentUnits = 'px';
388
- this.baseLeftPadding = parseInt(designTokens.TreeSizePaddingLeft);
389
- this.iconWidth = 24;
390
- this.destroyed = new rxjs.Subject();
391
- (_b = (_a = this.dir) === null || _a === void 0 ? void 0 : _a.change) === null || _b === void 0 ? void 0 : _b.pipe(operators.takeUntil(this.destroyed)).subscribe(function () { return _this.setPadding(); });
392
- }
393
- Object.defineProperty(McTreeNodePadding.prototype, "level", {
394
- get: function () {
395
- return this._level;
396
- },
397
- set: function (value) {
398
- this.setLevelInput(value);
399
- },
400
- enumerable: false,
401
- configurable: true
402
- });
403
- Object.defineProperty(McTreeNodePadding.prototype, "indent", {
404
- get: function () {
405
- return this._indent;
406
- },
407
- set: function (indent) {
408
- this.setIndentInput(indent);
409
- },
410
- enumerable: false,
411
- configurable: true
412
- });
413
- Object.defineProperty(McTreeNodePadding.prototype, "leftPadding", {
414
- get: function () {
415
- return (this.withIcon ? 0 : this.iconWidth) + this.baseLeftPadding;
416
- },
417
- enumerable: false,
418
- configurable: true
419
- });
420
- McTreeNodePadding.prototype.ngOnInit = function () {
421
- this.withIcon = this.tree.treeControl.isExpandable(this.treeNode.data);
422
- this.setPadding();
423
- };
424
- McTreeNodePadding.prototype.ngOnDestroy = function () {
425
- this.destroyed.next();
426
- this.destroyed.complete();
427
- };
428
- McTreeNodePadding.prototype.paddingIndent = function () {
429
- var nodeLevel = (this.treeNode.data && this.tree.treeControl.getLevel)
430
- ? this.tree.treeControl.getLevel(this.treeNode.data)
431
- : 0;
432
- var level = this.level || nodeLevel;
433
- return level > 0 ? (level * this._indent) + this.leftPadding + "px" : this.leftPadding + "px";
434
- };
435
- /**
436
- * This has been extracted to a util because of TS 4 and VE.
437
- * View Engine doesn't support property rename inheritance.
438
- * TS 4.0 doesn't allow properties to override accessors or vice-versa.
439
- * @docs-private
440
- */
441
- McTreeNodePadding.prototype.setLevelInput = function (value) {
442
- // Set to null as the fallback value so that _setPadding can fall back to the node level if the
443
- // consumer set the directive as `mcTreeNodePadding=""`. We still want to take this value if
444
- // they set 0 explicitly.
445
- this._level = coercion.coerceNumberProperty(value, null);
446
- this.setPadding();
447
- };
448
- /**
449
- * This has been extracted to a util because of TS 4 and VE.
450
- * View Engine doesn't support property rename inheritance.
451
- * TS 4.0 doesn't allow properties to override accessors or vice-versa.
452
- * @docs-private
453
- */
454
- McTreeNodePadding.prototype.setIndentInput = function (indent) {
455
- var value = indent;
456
- var units = 'px';
457
- if (typeof indent === 'string') {
458
- var parts = indent.split(cssUnitPattern);
459
- value = parts[0];
460
- units = parts[1] || units;
461
- }
462
- this.indentUnits = units;
463
- this._indent = coercion.coerceNumberProperty(value);
464
- this.setPadding();
465
- };
466
- McTreeNodePadding.prototype.setPadding = function () {
467
- var _a;
468
- var padding = this.paddingIndent();
469
- var paddingProp = ((_a = this.dir) === null || _a === void 0 ? void 0 : _a.value) === 'rtl' ? 'paddingRight' : 'paddingLeft';
470
- this.renderer.setStyle(this.element.nativeElement, paddingProp, padding);
471
- };
472
- return McTreeNodePadding;
473
- }());
474
- /** @nocollapse */ McTreeNodePadding.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodePadding, deps: [{ token: McTreeNode }, { token: McTreeBase }, { token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: i2__namespace.Directionality, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive });
475
- /** @nocollapse */ McTreeNodePadding.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: McTreeNodePadding, selector: "[mcTreeNodePadding]", inputs: { level: ["mcTreeNodePadding", "level"], indent: ["mcTreeNodePaddingIndent", "indent"] }, exportAs: ["mcTreeNodePadding"], ngImport: i0__namespace });
476
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodePadding, decorators: [{
477
- type: i0.Directive,
478
- args: [{
479
- selector: '[mcTreeNodePadding]',
480
- exportAs: 'mcTreeNodePadding'
481
- }]
482
- }], ctorParameters: function () {
483
- return [{ type: McTreeNode }, { type: McTreeBase }, { type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: i2__namespace.Directionality, decorators: [{
484
- type: i0.Optional
485
- }] }];
486
- }, propDecorators: { level: [{
487
- type: i0.Input,
488
- args: ['mcTreeNodePadding']
489
- }], indent: [{
490
- type: i0.Input,
491
- args: ['mcTreeNodePaddingIndent']
492
- }] } });
493
-
494
- /*! *****************************************************************************
495
- Copyright (c) Microsoft Corporation.
496
-
497
- Permission to use, copy, modify, and/or distribute this software for any
498
- purpose with or without fee is hereby granted.
499
-
500
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
501
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
502
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
503
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
504
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
505
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
506
- PERFORMANCE OF THIS SOFTWARE.
507
- ***************************************************************************** */
508
- /* global Reflect, Promise */
509
- var extendStatics = function (d, b) {
510
- extendStatics = Object.setPrototypeOf ||
511
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
512
- function (d, b) { for (var p in b)
513
- if (Object.prototype.hasOwnProperty.call(b, p))
514
- d[p] = b[p]; };
515
- return extendStatics(d, b);
516
- };
517
- function __extends(d, b) {
518
- if (typeof b !== "function" && b !== null)
519
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
520
- extendStatics(d, b);
521
- function __() { this.constructor = d; }
522
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
523
- }
524
- var __assign = function () {
525
- __assign = Object.assign || function __assign(t) {
526
- for (var s, i = 1, n = arguments.length; i < n; i++) {
527
- s = arguments[i];
528
- for (var p in s)
529
- if (Object.prototype.hasOwnProperty.call(s, p))
530
- t[p] = s[p];
531
- }
532
- return t;
533
- };
534
- return __assign.apply(this, arguments);
535
- };
536
- function __rest(s, e) {
537
- var t = {};
538
- for (var p in s)
539
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
540
- t[p] = s[p];
541
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
542
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
543
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
544
- t[p[i]] = s[p[i]];
545
- }
546
- return t;
547
- }
548
- function __decorate(decorators, target, key, desc) {
549
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
550
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
551
- r = Reflect.decorate(decorators, target, key, desc);
552
- else
553
- for (var i = decorators.length - 1; i >= 0; i--)
554
- if (d = decorators[i])
555
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
556
- return c > 3 && r && Object.defineProperty(target, key, r), r;
557
- }
558
- function __param(paramIndex, decorator) {
559
- return function (target, key) { decorator(target, key, paramIndex); };
560
- }
561
- function __metadata(metadataKey, metadataValue) {
562
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
563
- return Reflect.metadata(metadataKey, metadataValue);
564
- }
565
- function __awaiter(thisArg, _arguments, P, generator) {
566
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
567
- return new (P || (P = Promise))(function (resolve, reject) {
568
- function fulfilled(value) { try {
569
- step(generator.next(value));
570
- }
571
- catch (e) {
572
- reject(e);
573
- } }
574
- function rejected(value) { try {
575
- step(generator["throw"](value));
576
- }
577
- catch (e) {
578
- reject(e);
579
- } }
580
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
581
- step((generator = generator.apply(thisArg, _arguments || [])).next());
582
- });
583
- }
584
- function __generator(thisArg, body) {
585
- var _ = { label: 0, sent: function () { if (t[0] & 1)
586
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
587
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
588
- function verb(n) { return function (v) { return step([n, v]); }; }
589
- function step(op) {
590
- if (f)
591
- throw new TypeError("Generator is already executing.");
592
- while (_)
593
- try {
594
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
595
- return t;
596
- if (y = 0, t)
597
- op = [op[0] & 2, t.value];
598
- switch (op[0]) {
599
- case 0:
600
- case 1:
601
- t = op;
602
- break;
603
- case 4:
604
- _.label++;
605
- return { value: op[1], done: false };
606
- case 5:
607
- _.label++;
608
- y = op[1];
609
- op = [0];
610
- continue;
611
- case 7:
612
- op = _.ops.pop();
613
- _.trys.pop();
614
- continue;
615
- default:
616
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
617
- _ = 0;
618
- continue;
619
- }
620
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
621
- _.label = op[1];
622
- break;
623
- }
624
- if (op[0] === 6 && _.label < t[1]) {
625
- _.label = t[1];
626
- t = op;
627
- break;
628
- }
629
- if (t && _.label < t[2]) {
630
- _.label = t[2];
631
- _.ops.push(op);
632
- break;
633
- }
634
- if (t[2])
635
- _.ops.pop();
636
- _.trys.pop();
637
- continue;
638
- }
639
- op = body.call(thisArg, _);
640
- }
641
- catch (e) {
642
- op = [6, e];
643
- y = 0;
644
- }
645
- finally {
646
- f = t = 0;
647
- }
648
- if (op[0] & 5)
649
- throw op[1];
650
- return { value: op[0] ? op[1] : void 0, done: true };
651
- }
652
- }
653
- var __createBinding = Object.create ? (function (o, m, k, k2) {
654
- if (k2 === undefined)
655
- k2 = k;
656
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
657
- }) : (function (o, m, k, k2) {
658
- if (k2 === undefined)
659
- k2 = k;
660
- o[k2] = m[k];
661
- });
662
- function __exportStar(m, o) {
663
- for (var p in m)
664
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
665
- __createBinding(o, m, p);
666
- }
667
- function __values(o) {
668
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
669
- if (m)
670
- return m.call(o);
671
- if (o && typeof o.length === "number")
672
- return {
673
- next: function () {
674
- if (o && i >= o.length)
675
- o = void 0;
676
- return { value: o && o[i++], done: !o };
677
- }
678
- };
679
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
680
- }
681
- function __read(o, n) {
682
- var m = typeof Symbol === "function" && o[Symbol.iterator];
683
- if (!m)
684
- return o;
685
- var i = m.call(o), r, ar = [], e;
686
- try {
687
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
688
- ar.push(r.value);
689
- }
690
- catch (error) {
691
- e = { error: error };
692
- }
693
- finally {
694
- try {
695
- if (r && !r.done && (m = i["return"]))
696
- m.call(i);
697
- }
698
- finally {
699
- if (e)
700
- throw e.error;
701
- }
702
- }
703
- return ar;
704
- }
705
- /** @deprecated */
706
- function __spread() {
707
- for (var ar = [], i = 0; i < arguments.length; i++)
708
- ar = ar.concat(__read(arguments[i]));
709
- return ar;
710
- }
711
- /** @deprecated */
712
- function __spreadArrays() {
713
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
714
- s += arguments[i].length;
715
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
716
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
717
- r[k] = a[j];
718
- return r;
719
- }
720
- function __spreadArray(to, from, pack) {
721
- if (pack || arguments.length === 2)
722
- for (var i = 0, l = from.length, ar; i < l; i++) {
723
- if (ar || !(i in from)) {
724
- if (!ar)
725
- ar = Array.prototype.slice.call(from, 0, i);
726
- ar[i] = from[i];
727
- }
728
- }
729
- return to.concat(ar || Array.prototype.slice.call(from));
730
- }
731
- function __await(v) {
732
- return this instanceof __await ? (this.v = v, this) : new __await(v);
733
- }
734
- function __asyncGenerator(thisArg, _arguments, generator) {
735
- if (!Symbol.asyncIterator)
736
- throw new TypeError("Symbol.asyncIterator is not defined.");
737
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
738
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
739
- function verb(n) { if (g[n])
740
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
741
- function resume(n, v) { try {
742
- step(g[n](v));
743
- }
744
- catch (e) {
745
- settle(q[0][3], e);
746
- } }
747
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
748
- function fulfill(value) { resume("next", value); }
749
- function reject(value) { resume("throw", value); }
750
- function settle(f, v) { if (f(v), q.shift(), q.length)
751
- resume(q[0][0], q[0][1]); }
752
- }
753
- function __asyncDelegator(o) {
754
- var i, p;
755
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
756
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
757
- }
758
- function __asyncValues(o) {
759
- if (!Symbol.asyncIterator)
760
- throw new TypeError("Symbol.asyncIterator is not defined.");
761
- var m = o[Symbol.asyncIterator], i;
762
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
763
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
764
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
765
- }
766
- function __makeTemplateObject(cooked, raw) {
767
- if (Object.defineProperty) {
768
- Object.defineProperty(cooked, "raw", { value: raw });
769
- }
770
- else {
771
- cooked.raw = raw;
772
- }
773
- return cooked;
774
- }
775
- ;
776
- var __setModuleDefault = Object.create ? (function (o, v) {
777
- Object.defineProperty(o, "default", { enumerable: true, value: v });
778
- }) : function (o, v) {
779
- o["default"] = v;
780
- };
781
- function __importStar(mod) {
782
- if (mod && mod.__esModule)
783
- return mod;
784
- var result = {};
785
- if (mod != null)
786
- for (var k in mod)
787
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
788
- __createBinding(result, mod, k);
789
- __setModuleDefault(result, mod);
790
- return result;
791
- }
792
- function __importDefault(mod) {
793
- return (mod && mod.__esModule) ? mod : { default: mod };
794
- }
795
- function __classPrivateFieldGet(receiver, state, kind, f) {
796
- if (kind === "a" && !f)
797
- throw new TypeError("Private accessor was defined without a getter");
798
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
799
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
800
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
801
- }
802
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
803
- if (kind === "m")
804
- throw new TypeError("Private method is not writable");
805
- if (kind === "a" && !f)
806
- throw new TypeError("Private accessor was defined without a setter");
807
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
808
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
809
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
810
- }
811
-
812
- var McTreeNodeToggleBase = /** @class */ (function () {
813
- function McTreeNodeToggleBase() {
814
- }
815
- return McTreeNodeToggleBase;
816
- }());
817
- // tslint:disable-next-line:naming-convention
818
- var McTreeNodeToggleMixinBase = i1.mixinDisabled(McTreeNodeToggleBase);
819
- /** @docs-private */
820
- var McTreeNodeToggleBaseDirective = /** @class */ (function (_super) {
821
- __extends(McTreeNodeToggleBaseDirective, _super);
822
- function McTreeNodeToggleBaseDirective(tree, treeNode) {
823
- var _this = _super.call(this) || this;
824
- _this.tree = tree;
825
- _this.treeNode = treeNode;
826
- _this._recursive = false;
827
- _this.tree.treeControl.filterValue
828
- .pipe(operators.map(function (value) { return (value === null || value === void 0 ? void 0 : value.length) > 0; }))
829
- .subscribe(function (state) { return _this.disabled = state; });
830
- return _this;
831
- }
832
- Object.defineProperty(McTreeNodeToggleBaseDirective.prototype, "recursive", {
833
- get: function () {
834
- return this._recursive;
835
- },
836
- set: function (value) {
837
- this._recursive = coercion.coerceBooleanProperty(value);
838
- },
839
- enumerable: false,
840
- configurable: true
841
- });
842
- Object.defineProperty(McTreeNodeToggleBaseDirective.prototype, "iconState", {
843
- get: function () {
844
- return this.tree.treeControl.isExpanded(this.node);
845
- },
846
- enumerable: false,
847
- configurable: true
848
- });
849
- McTreeNodeToggleBaseDirective.prototype.toggle = function (event) {
850
- if (this.disabled) {
851
- return;
852
- }
853
- this.recursive
854
- ? this.tree.treeControl.toggleDescendants(this.treeNode.data)
855
- : this.tree.treeControl.toggle(this.treeNode.data);
856
- event.stopPropagation();
857
- };
858
- return McTreeNodeToggleBaseDirective;
859
- }(McTreeNodeToggleMixinBase));
860
- /** @nocollapse */ McTreeNodeToggleBaseDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeToggleBaseDirective, deps: [{ token: McTreeBase }, { token: McTreeNode }], target: i0__namespace.ɵɵFactoryTarget.Directive });
861
- /** @nocollapse */ McTreeNodeToggleBaseDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: McTreeNodeToggleBaseDirective, inputs: { node: "node", recursive: ["mcTreeNodeToggleRecursive", "recursive"] }, usesInheritance: true, ngImport: i0__namespace });
862
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeToggleBaseDirective, decorators: [{
863
- type: i0.Directive
864
- }], ctorParameters: function () { return [{ type: McTreeBase }, { type: McTreeNode }]; }, propDecorators: { node: [{
865
- type: i0.Input
866
- }], recursive: [{
867
- type: i0.Input,
868
- args: ['mcTreeNodeToggleRecursive']
869
- }] } });
870
- var McTreeNodeToggleComponent = /** @class */ (function (_super) {
871
- __extends(McTreeNodeToggleComponent, _super);
872
- function McTreeNodeToggleComponent() {
873
- return _super !== null && _super.apply(this, arguments) || this;
874
- }
875
- return McTreeNodeToggleComponent;
876
- }(McTreeNodeToggleBaseDirective));
877
- /** @nocollapse */ McTreeNodeToggleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeToggleComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
878
- /** @nocollapse */ McTreeNodeToggleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: McTreeNodeToggleComponent, selector: "mc-tree-node-toggle", inputs: { disabled: "disabled" }, host: { listeners: { "click": "toggle($event)" }, properties: { "class.mc-opened": "iconState", "attr.disabled": "disabled || null" }, classAttribute: "mc-tree-node-toggle" }, exportAs: ["mcTreeNodeToggle"], usesInheritance: true, ngImport: i0__namespace, 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-opened .mc-icon{transform:rotate(0)}.mc-tree-node-toggle[disabled]{cursor:default}\n"], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
879
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeToggleComponent, decorators: [{
880
- type: i0.Component,
881
- args: [{
882
- selector: 'mc-tree-node-toggle',
883
- exportAs: 'mcTreeNodeToggle',
884
- template: "<i class=\"mc mc-icon mc-angle-down-S_16\"></i>",
885
- styleUrls: ['./toggle.scss'],
886
- host: {
887
- class: 'mc-tree-node-toggle',
888
- '[class.mc-opened]': 'iconState',
889
- '[attr.disabled]': 'disabled || null',
890
- '(click)': 'toggle($event)'
891
- },
892
- inputs: ['disabled'],
893
- encapsulation: i0.ViewEncapsulation.None,
894
- changeDetection: i0.ChangeDetectionStrategy.OnPush
895
- }]
896
- }] });
897
- var McTreeNodeToggleDirective = /** @class */ (function (_super) {
898
- __extends(McTreeNodeToggleDirective, _super);
899
- function McTreeNodeToggleDirective() {
900
- return _super !== null && _super.apply(this, arguments) || this;
901
- }
902
- return McTreeNodeToggleDirective;
903
- }(McTreeNodeToggleBaseDirective));
904
- /** @nocollapse */ McTreeNodeToggleDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeToggleDirective, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
905
- /** @nocollapse */ McTreeNodeToggleDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: McTreeNodeToggleDirective, selector: "[mcTreeNodeToggle]", host: { listeners: { "click": "toggle($event)" }, properties: { "attr.disabled": "disabled || null" } }, exportAs: ["mcTreeNodeToggle"], usesInheritance: true, ngImport: i0__namespace });
906
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeNodeToggleDirective, decorators: [{
907
- type: i0.Directive,
908
- args: [{
909
- selector: '[mcTreeNodeToggle]',
910
- exportAs: 'mcTreeNodeToggle',
911
- host: {
912
- '[attr.disabled]': 'disabled || null',
913
- '(click)': 'toggle($event)'
914
- }
915
- }]
916
- }] });
917
-
918
- var McTree = /** @class */ (function (_super) {
919
- __extends(McTree, _super);
920
- function McTree() {
921
- return _super !== null && _super.apply(this, arguments) || this;
922
- }
923
- return McTree;
924
- }(McTreeBase));
925
- /** @nocollapse */ McTree.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTree, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
926
- /** @nocollapse */ McTree.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: McTree, selector: "mc-tree", host: { classAttribute: "mc-tree" }, exportAs: ["mcTree"], usesInheritance: true, ngImport: i0__namespace, template: "<ng-container mcTreeNodeOutlet></ng-container>", isInline: true, styles: [".mc-tree{display:block}\n"], directives: [{ type: McTreeNodeOutlet, selector: "[mcTreeNodeOutlet]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
927
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTree, decorators: [{
928
- type: i0.Component,
929
- args: [{
930
- selector: 'mc-tree',
931
- exportAs: 'mcTree',
932
- template: "<ng-container mcTreeNodeOutlet></ng-container>",
933
- styleUrls: ['./tree.scss'],
934
- host: {
935
- class: 'mc-tree'
936
- },
937
- encapsulation: i0.ViewEncapsulation.None,
938
- changeDetection: i0.ChangeDetectionStrategy.OnPush
939
- }]
940
- }] });
941
-
942
- /**
943
- * Injection token used to provide the parent component to options.
944
- */
945
- var MC_TREE_OPTION_PARENT_COMPONENT = new i0.InjectionToken('MC_TREE_OPTION_PARENT_COMPONENT');
946
- var McTreeOptionChange = /** @class */ (function () {
947
- function McTreeOptionChange(source, isUserInput) {
948
- if (isUserInput === void 0) { isUserInput = false; }
949
- this.source = source;
950
- this.isUserInput = isUserInput;
951
- }
952
- return McTreeOptionChange;
953
- }());
954
- var uniqueIdCounter = 0;
955
- var McTreeOption = /** @class */ (function (_super) {
956
- __extends(McTreeOption, _super);
957
- function McTreeOption(elementRef, changeDetectorRef, ngZone, tree) {
958
- var _this = _super.call(this, elementRef, tree) || this;
959
- _this.changeDetectorRef = changeDetectorRef;
960
- _this.ngZone = ngZone;
961
- _this.tree = tree;
962
- _this.onFocus = new rxjs.Subject();
963
- _this.onBlur = new rxjs.Subject();
964
- _this._disabled = false;
965
- _this.onSelectionChange = new i0.EventEmitter();
966
- _this._selected = false;
967
- _this._id = "mc-tree-option-" + uniqueIdCounter++;
968
- _this.hasFocus = false;
969
- return _this;
970
- }
971
- Object.defineProperty(McTreeOption.prototype, "value", {
972
- get: function () {
973
- return this._value;
974
- },
975
- set: function (value) {
976
- this._value = value;
977
- },
978
- enumerable: false,
979
- configurable: true
980
- });
981
- Object.defineProperty(McTreeOption.prototype, "disabled", {
982
- get: function () {
983
- return this._disabled || this.tree.disabled;
984
- },
985
- set: function (value) {
986
- var newValue = coercion.coerceBooleanProperty(value);
987
- if (newValue !== this._disabled) {
988
- this._disabled = newValue;
989
- }
990
- },
991
- enumerable: false,
992
- configurable: true
993
- });
994
- Object.defineProperty(McTreeOption.prototype, "showCheckbox", {
995
- get: function () {
996
- return this._showCheckbox !== undefined ? this._showCheckbox : this.tree.showCheckbox;
997
- },
998
- set: function (value) {
999
- this._showCheckbox = coercion.coerceBooleanProperty(value);
1000
- },
1001
- enumerable: false,
1002
- configurable: true
1003
- });
1004
- Object.defineProperty(McTreeOption.prototype, "selected", {
1005
- get: function () {
1006
- return this._selected;
1007
- },
1008
- set: function (value) {
1009
- var isSelected = coercion.coerceBooleanProperty(value);
1010
- if (isSelected !== this._selected) {
1011
- this.setSelected(isSelected);
1012
- }
1013
- },
1014
- enumerable: false,
1015
- configurable: true
1016
- });
1017
- Object.defineProperty(McTreeOption.prototype, "id", {
1018
- get: function () {
1019
- return this._id;
1020
- },
1021
- enumerable: false,
1022
- configurable: true
1023
- });
1024
- Object.defineProperty(McTreeOption.prototype, "viewValue", {
1025
- get: function () {
1026
- // TODO: Add input property alternative for node envs.
1027
- return (this.getHostElement().textContent || '').trim();
1028
- },
1029
- enumerable: false,
1030
- configurable: true
1031
- });
1032
- Object.defineProperty(McTreeOption.prototype, "isExpandable", {
1033
- get: function () {
1034
- var _a;
1035
- return !((_a = this.toggleElement) === null || _a === void 0 ? void 0 : _a.disabled) && this.tree.treeControl.isExpandable(this.data);
1036
- },
1037
- enumerable: false,
1038
- configurable: true
1039
- });
1040
- McTreeOption.prototype.ngAfterContentInit = function () {
1041
- this.value = this.tree.treeControl.getValue(this.data);
1042
- };
1043
- McTreeOption.prototype.toggle = function () {
1044
- this.selected = !this.selected;
1045
- };
1046
- McTreeOption.prototype.setSelected = function (selected) {
1047
- if (this._selected === selected || !this.tree.selectionModel) {
1048
- return;
1049
- }
1050
- this._selected = selected;
1051
- if (selected) {
1052
- this.tree.selectionModel.select(this.data);
1053
- }
1054
- else {
1055
- this.tree.selectionModel.deselect(this.data);
1056
- }
1057
- this.changeDetectorRef.markForCheck();
1058
- };
1059
- McTreeOption.prototype.focus = function (focusOrigin) {
1060
- var _this = this;
1061
- var _a;
1062
- if (focusOrigin === 'program') {
1063
- return;
1064
- }
1065
- if (this.disabled || this.hasFocus || ((_a = this.actionButton) === null || _a === void 0 ? void 0 : _a.hasFocus)) {
1066
- return;
1067
- }
1068
- this.elementRef.nativeElement.focus();
1069
- this.onFocus.next({ option: this });
1070
- Promise.resolve().then(function () {
1071
- _this.hasFocus = true;
1072
- _this.changeDetectorRef.markForCheck();
1073
- });
1074
- };
1075
- McTreeOption.prototype.blur = function () {
1076
- var _this = this;
1077
- // When animations are enabled, Angular may end up removing the option from the DOM a little
1078
- // earlier than usual, causing it to be blurred and throwing off the logic in the tree
1079
- // that moves focus not the next item. To work around the issue, we defer marking the option
1080
- // as not focused until the next time the zone stabilizes.
1081
- this.ngZone.onStable
1082
- .asObservable()
1083
- .pipe(operators.take(1))
1084
- .subscribe(function () {
1085
- _this.ngZone.run(function () {
1086
- var _a;
1087
- _this.hasFocus = false;
1088
- if ((_a = _this.actionButton) === null || _a === void 0 ? void 0 : _a.hasFocus) {
1089
- return;
1090
- }
1091
- _this.onBlur.next({ option: _this });
1092
- });
1093
- });
1094
- };
1095
- McTreeOption.prototype.getHeight = function () {
1096
- var clientRects = this.elementRef.nativeElement.getClientRects();
1097
- if (clientRects.length) {
1098
- return clientRects[0].height;
1099
- }
1100
- return 0;
1101
- };
1102
- McTreeOption.prototype.select = function () {
1103
- if (this._selected) {
1104
- return;
1105
- }
1106
- this._selected = true;
1107
- this.changeDetectorRef.markForCheck();
1108
- this.emitSelectionChangeEvent();
1109
- };
1110
- McTreeOption.prototype.deselect = function () {
1111
- if (!this._selected) {
1112
- return;
1113
- }
1114
- this._selected = false;
1115
- this.changeDetectorRef.markForCheck();
1116
- };
1117
- McTreeOption.prototype.onKeydown = function ($event) {
1118
- if (!this.actionButton) {
1119
- return;
1120
- }
1121
- if ($event.keyCode === keycodes.TAB && !$event.shiftKey && !this.actionButton.hasFocus) {
1122
- this.actionButton.focus();
1123
- $event.preventDefault();
1124
- }
1125
- };
1126
- McTreeOption.prototype.selectViaInteraction = function ($event) {
1127
- if (this.disabled) {
1128
- return;
1129
- }
1130
- this.changeDetectorRef.markForCheck();
1131
- this.emitSelectionChangeEvent(true);
1132
- var shiftKey = $event ? keycodes.hasModifierKey($event, 'shiftKey') : false;
1133
- var ctrlKey = $event ? keycodes.hasModifierKey($event, 'ctrlKey') : false;
1134
- this.tree.setSelectedOptionsByClick(this, shiftKey, ctrlKey);
1135
- };
1136
- McTreeOption.prototype.emitSelectionChangeEvent = function (isUserInput) {
1137
- if (isUserInput === void 0) { isUserInput = false; }
1138
- this.onSelectionChange.emit(new McTreeOptionChange(this, isUserInput));
1139
- };
1140
- McTreeOption.prototype.getHostElement = function () {
1141
- return this.elementRef.nativeElement;
1142
- };
1143
- McTreeOption.prototype.markForCheck = function () {
1144
- this.changeDetectorRef.markForCheck();
1145
- };
1146
- return McTreeOption;
1147
- }(McTreeNode));
1148
- /** @nocollapse */ McTreeOption.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeOption, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: MC_TREE_OPTION_PARENT_COMPONENT }], target: i0__namespace.ɵɵFactoryTarget.Component });
1149
- /** @nocollapse */ McTreeOption.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", 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: [
1150
- { provide: McTreeNode, useExisting: McTreeOption },
1151
- { provide: i1.MC_OPTION_ACTION_PARENT, useExisting: McTreeOption }
1152
- ], queries: [{ propertyName: "toggleElement", first: true, predicate: ["mcTreeNodeToggle"], descendants: true }, { propertyName: "actionButton", first: true, predicate: i1.McOptionActionComponent, descendants: true }, { propertyName: "tooltipTrigger", first: true, predicate: tooltip.McTooltipTrigger, descendants: true }, { propertyName: "dropdownTrigger", first: true, predicate: dropdown.McDropdownTrigger, descendants: true }], exportAs: ["mcTreeOption"], usesInheritance: true, ngImport: i0__namespace, 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-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{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__namespace.McPseudoCheckbox, selector: "mc-pseudo-checkbox", inputs: ["state", "disabled"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
1153
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeOption, decorators: [{
1154
- type: i0.Component,
1155
- args: [{
1156
- selector: 'mc-tree-option',
1157
- exportAs: 'mcTreeOption',
1158
- templateUrl: './tree-option.html',
1159
- styleUrls: ['./tree-option.scss'],
1160
- host: {
1161
- class: 'mc-tree-option',
1162
- '[class.mc-selected]': 'selected',
1163
- '[class.mc-focused]': 'hasFocus',
1164
- '[class.mc-action-button-focused]': 'actionButton?.active',
1165
- '[attr.id]': 'id',
1166
- '[attr.tabindex]': '-1',
1167
- '[attr.disabled]': 'disabled || null',
1168
- '(focusin)': 'focus()',
1169
- '(blur)': 'blur()',
1170
- '(click)': 'selectViaInteraction($event)',
1171
- '(keydown)': 'onKeydown($event)'
1172
- },
1173
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1174
- encapsulation: i0.ViewEncapsulation.None,
1175
- providers: [
1176
- { provide: McTreeNode, useExisting: McTreeOption },
1177
- { provide: i1.MC_OPTION_ACTION_PARENT, useExisting: McTreeOption }
1178
- ]
1179
- }]
1180
- }], ctorParameters: function () {
1181
- return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
1182
- type: i0.Inject,
1183
- args: [MC_TREE_OPTION_PARENT_COMPONENT]
1184
- }] }];
1185
- }, propDecorators: { toggleElement: [{
1186
- type: i0.ContentChild,
1187
- args: ['mcTreeNodeToggle']
1188
- }], actionButton: [{
1189
- type: i0.ContentChild,
1190
- args: [i1.McOptionActionComponent]
1191
- }], tooltipTrigger: [{
1192
- type: i0.ContentChild,
1193
- args: [tooltip.McTooltipTrigger]
1194
- }], dropdownTrigger: [{
1195
- type: i0.ContentChild,
1196
- args: [dropdown.McDropdownTrigger]
1197
- }], disabled: [{
1198
- type: i0.Input
1199
- }], showCheckbox: [{
1200
- type: i0.Input
1201
- }], onSelectionChange: [{
1202
- type: i0.Output
1203
- }] } });
1204
-
1205
- var MC_SELECTION_TREE_VALUE_ACCESSOR = {
1206
- provide: forms.NG_VALUE_ACCESSOR,
1207
- useExisting: i0.forwardRef(function () { return McTreeSelection; }),
1208
- multi: true
1209
- };
1210
- var McTreeSelectAllEvent = /** @class */ (function () {
1211
- function McTreeSelectAllEvent(source, options) {
1212
- this.source = source;
1213
- this.options = options;
1214
- }
1215
- return McTreeSelectAllEvent;
1216
- }());
1217
- var McTreeCopyEvent = /** @class */ (function () {
1218
- function McTreeCopyEvent(source, option) {
1219
- this.source = source;
1220
- this.option = option;
1221
- }
1222
- return McTreeCopyEvent;
1223
- }());
1224
- var McTreeNavigationChange = /** @class */ (function () {
1225
- function McTreeNavigationChange(source, option) {
1226
- this.source = source;
1227
- this.option = option;
1228
- }
1229
- return McTreeNavigationChange;
1230
- }());
1231
- var McTreeSelectionChange = /** @class */ (function () {
1232
- function McTreeSelectionChange(source, option) {
1233
- this.source = source;
1234
- this.option = option;
1235
- }
1236
- return McTreeSelectionChange;
1237
- }());
1238
- var McTreeSelection = /** @class */ (function (_super) {
1239
- __extends(McTreeSelection, _super);
1240
- function McTreeSelection(elementRef, differs, changeDetectorRef, multiple, clipboard) {
1241
- var _this = _super.call(this, differs, changeDetectorRef) || this;
1242
- _this.elementRef = elementRef;
1243
- _this.clipboard = clipboard;
1244
- _this.renderedOptions = new i0.QueryList();
1245
- _this.resetFocusedItemOnBlur = true;
1246
- _this.multipleMode = null;
1247
- _this.userTabIndex = null;
1248
- _this.navigationChange = new i0.EventEmitter();
1249
- _this.selectionChange = new i0.EventEmitter();
1250
- _this.onSelectAll = new i0.EventEmitter();
1251
- _this.onCopy = new i0.EventEmitter();
1252
- _this.sortedNodes = [];
1253
- _this._autoSelect = true;
1254
- _this._noUnselectLast = true;
1255
- _this._disabled = false;
1256
- _this._tabIndex = 0;
1257
- _this.destroy = new rxjs.Subject();
1258
- /** `View -> model callback called when value changes` */
1259
- _this.onChange = function () { };
1260
- /** `View -> model callback called when select has been touched` */
1261
- _this.onTouched = function () { };
1262
- _this.updateRenderedOptions = function () {
1263
- var orderedOptions = [];
1264
- _this.sortedNodes.forEach(function (node) {
1265
- var found = _this.unorderedOptions.find(function (option) { return option.value === _this.treeControl.getValue(node); });
1266
- if (found) {
1267
- orderedOptions.push(found);
1268
- }
1269
- });
1270
- _this.renderedOptions.reset(orderedOptions);
1271
- _this.renderedOptions.notifyOnChanges();
1272
- _this.updateScrollSize();
1273
- };
1274
- if (multiple === i1.MultipleMode.CHECKBOX || multiple === i1.MultipleMode.KEYBOARD) {
1275
- _this.multipleMode = multiple;
1276
- }
1277
- else if (multiple !== null) {
1278
- _this.multipleMode = i1.MultipleMode.CHECKBOX;
1279
- }
1280
- if (_this.multipleMode === i1.MultipleMode.CHECKBOX) {
1281
- _this.autoSelect = false;
1282
- _this.noUnselectLast = false;
1283
- }
1284
- _this.selectionModel = new collections.SelectionModel(_this.multiple);
1285
- return _this;
1286
- }
1287
- Object.defineProperty(McTreeSelection.prototype, "autoSelect", {
1288
- get: function () {
1289
- return this._autoSelect;
1290
- },
1291
- set: function (value) {
1292
- this._autoSelect = coercion.coerceBooleanProperty(value);
1293
- },
1294
- enumerable: false,
1295
- configurable: true
1296
- });
1297
- Object.defineProperty(McTreeSelection.prototype, "optionFocusChanges", {
1298
- get: function () {
1299
- return rxjs.merge.apply(void 0, __spreadArray([], __read(this.renderedOptions.map(function (option) { return option.onFocus; }))));
1300
- },
1301
- enumerable: false,
1302
- configurable: true
1303
- });
1304
- Object.defineProperty(McTreeSelection.prototype, "optionBlurChanges", {
1305
- get: function () {
1306
- return rxjs.merge.apply(void 0, __spreadArray([], __read(this.renderedOptions.map(function (option) { return option.onBlur; }))));
1307
- },
1308
- enumerable: false,
1309
- configurable: true
1310
- });
1311
- Object.defineProperty(McTreeSelection.prototype, "multiple", {
1312
- get: function () {
1313
- return !!this.multipleMode;
1314
- },
1315
- enumerable: false,
1316
- configurable: true
1317
- });
1318
- Object.defineProperty(McTreeSelection.prototype, "noUnselectLast", {
1319
- get: function () {
1320
- return this._noUnselectLast;
1321
- },
1322
- set: function (value) {
1323
- this._noUnselectLast = coercion.coerceBooleanProperty(value);
1324
- },
1325
- enumerable: false,
1326
- configurable: true
1327
- });
1328
- Object.defineProperty(McTreeSelection.prototype, "disabled", {
1329
- get: function () {
1330
- return this._disabled;
1331
- },
1332
- set: function (rawValue) {
1333
- var value = coercion.coerceBooleanProperty(rawValue);
1334
- if (this._disabled !== value) {
1335
- this._disabled = value;
1336
- this.markOptionsForCheck();
1337
- }
1338
- },
1339
- enumerable: false,
1340
- configurable: true
1341
- });
1342
- Object.defineProperty(McTreeSelection.prototype, "tabIndex", {
1343
- get: function () {
1344
- return this.disabled ? -1 : this._tabIndex;
1345
- },
1346
- set: function (value) {
1347
- this._tabIndex = value;
1348
- this.userTabIndex = value;
1349
- },
1350
- enumerable: false,
1351
- configurable: true
1352
- });
1353
- Object.defineProperty(McTreeSelection.prototype, "showCheckbox", {
1354
- get: function () {
1355
- return this.multipleMode === i1.MultipleMode.CHECKBOX;
1356
- },
1357
- enumerable: false,
1358
- configurable: true
1359
- });
1360
- McTreeSelection.prototype.ngAfterContentInit = function () {
1361
- var _this = this;
1362
- this.unorderedOptions.changes
1363
- .subscribe(this.updateRenderedOptions);
1364
- this.keyManager = new a11y.FocusKeyManager(this.renderedOptions)
1365
- .withVerticalOrientation(true)
1366
- .withHorizontalOrientation(null);
1367
- this.keyManager.change
1368
- .pipe(operators.takeUntil(this.destroy))
1369
- .subscribe(function () {
1370
- if (_this.keyManager.activeItem) {
1371
- _this.emitNavigationEvent(_this.keyManager.activeItem);
1372
- // todo need check this logic
1373
- if (_this.autoSelect && !_this.keyManager.activeItem.disabled) {
1374
- _this.updateOptionsFocus();
1375
- }
1376
- }
1377
- });
1378
- this.keyManager.tabOut
1379
- .pipe(operators.takeUntil(this.destroy))
1380
- .subscribe(function () { return _this.allowFocusEscape(); });
1381
- this.selectionModel.changed
1382
- .pipe(operators.takeUntil(this.destroy))
1383
- .subscribe(function () {
1384
- _this.onChange(_this.getSelectedValues());
1385
- _this.renderedOptions.notifyOnChanges();
1386
- });
1387
- this.renderedOptions.changes
1388
- .pipe(operators.takeUntil(this.destroy), operators.delay(0))
1389
- .subscribe(function (options) {
1390
- _this.resetOptions();
1391
- // Check to see if we need to update our tab index
1392
- _this.updateTabIndex();
1393
- options.forEach(function (option) {
1394
- if (_this.getSelectedValues().includes(option.value)) {
1395
- option.select();
1396
- }
1397
- else {
1398
- option.deselect();
1399
- }
1400
- option.markForCheck();
1401
- });
1402
- });
1403
- };
1404
- McTreeSelection.prototype.ngOnDestroy = function () {
1405
- this.destroy.next();
1406
- this.destroy.complete();
1407
- };
1408
- McTreeSelection.prototype.focus = function ($event) {
1409
- if (this.renderedOptions.length === 0 || this.isFocusReceivedFromNestedOption($event)) {
1410
- return;
1411
- }
1412
- this.keyManager.setFocusOrigin('keyboard');
1413
- this.keyManager.setFirstItemActive();
1414
- this.keyManager.setFocusOrigin('program');
1415
- };
1416
- McTreeSelection.prototype.blur = function () {
1417
- if (!this.hasFocusedOption() && this.resetFocusedItemOnBlur) {
1418
- this.keyManager.setActiveItem(-1);
1419
- }
1420
- this.onTouched();
1421
- this.changeDetectorRef.markForCheck();
1422
- };
1423
- McTreeSelection.prototype.onKeyDown = function (event) {
1424
- var _a, _b;
1425
- this.keyManager.setFocusOrigin('keyboard');
1426
- // tslint:disable-next-line: deprecation
1427
- var keyCode = event.keyCode;
1428
- if ([keycodes.SPACE, keycodes.LEFT_ARROW, keycodes.RIGHT_ARROW].includes(keyCode) || keycodes.isVerticalMovement(event)) {
1429
- event.preventDefault();
1430
- }
1431
- if (this.multiple && keycodes.isSelectAll(event)) {
1432
- this.selectAllOptions();
1433
- return;
1434
- }
1435
- else if (keycodes.isCopy(event)) {
1436
- this.copyActiveOption();
1437
- return;
1438
- }
1439
- else if (keyCode === keycodes.TAB) {
1440
- this.keyManager.tabOut.next();
1441
- return;
1442
- }
1443
- else if (keyCode === keycodes.LEFT_ARROW && ((_a = this.keyManager.activeItem) === null || _a === void 0 ? void 0 : _a.isExpandable)) {
1444
- this.treeControl.collapse(this.keyManager.activeItem.data);
1445
- return;
1446
- }
1447
- else if (keyCode === keycodes.RIGHT_ARROW && ((_b = this.keyManager.activeItem) === null || _b === void 0 ? void 0 : _b.isExpandable)) {
1448
- this.treeControl.expand(this.keyManager.activeItem.data);
1449
- return;
1450
- }
1451
- else if (keyCode === keycodes.DOWN_ARROW) {
1452
- this.keyManager.setNextItemActive();
1453
- }
1454
- else if (keyCode === keycodes.UP_ARROW) {
1455
- this.keyManager.setPreviousItemActive();
1456
- }
1457
- else if ([keycodes.SPACE, keycodes.ENTER].includes(keyCode)) {
1458
- this.toggleFocusedOption();
1459
- return;
1460
- }
1461
- else if (keyCode === keycodes.HOME) {
1462
- this.keyManager.setFirstItemActive();
1463
- }
1464
- else if (keyCode === keycodes.END) {
1465
- this.keyManager.setLastItemActive();
1466
- }
1467
- else if (keyCode === keycodes.PAGE_UP) {
1468
- this.keyManager.setPreviousPageItemActive();
1469
- }
1470
- else if (keyCode === keycodes.PAGE_DOWN) {
1471
- this.keyManager.setNextPageItemActive();
1472
- }
1473
- if (this.keyManager.activeItem) {
1474
- this.setSelectedOptionsByKey(this.keyManager.activeItem, keycodes.hasModifierKey(event, 'shiftKey'), keycodes.hasModifierKey(event, 'ctrlKey'));
1475
- }
1476
- };
1477
- McTreeSelection.prototype.updateScrollSize = function () {
1478
- if (!this.renderedOptions.first) {
1479
- return;
1480
- }
1481
- this.keyManager.withScrollSize(Math.floor(this.getHeight() / this.renderedOptions.first.getHeight()));
1482
- };
1483
- McTreeSelection.prototype.setSelectedOptionsByKey = function (option, shiftKey, ctrlKey) {
1484
- if (shiftKey && this.multiple) {
1485
- this.setSelectedOptions(option);
1486
- this.emitChangeEvent(option);
1487
- }
1488
- else if (ctrlKey) {
1489
- if (!this.canDeselectLast(option)) {
1490
- return;
1491
- }
1492
- }
1493
- else if (this.autoSelect) {
1494
- this.selectionModel.clear();
1495
- this.selectionModel.toggle(option.data);
1496
- this.emitChangeEvent(option);
1497
- }
1498
- };
1499
- McTreeSelection.prototype.setSelectedOptionsByClick = function (option, shiftKey, ctrlKey) {
1500
- if (!shiftKey && !ctrlKey) {
1501
- this.keyManager.setActiveItem(option);
1502
- }
1503
- if (shiftKey && this.multiple) {
1504
- this.setSelectedOptions(option);
1505
- }
1506
- else if (ctrlKey) {
1507
- if (!this.canDeselectLast(option)) {
1508
- return;
1509
- }
1510
- this.selectionModel.toggle(option.data);
1511
- }
1512
- else if (this.autoSelect) {
1513
- this.selectionModel.clear();
1514
- this.selectionModel.toggle(option.data);
1515
- }
1516
- else {
1517
- this.selectionModel.toggle(option.data);
1518
- }
1519
- this.emitChangeEvent(option);
1520
- };
1521
- McTreeSelection.prototype.setSelectedOptions = function (option) {
1522
- var _c;
1523
- var _this = this;
1524
- var selectedOptionState = option.selected;
1525
- var fromIndex = this.keyManager.previousActiveItemIndex;
1526
- var toIndex = this.keyManager.previousActiveItemIndex = this.keyManager.activeItemIndex;
1527
- if (toIndex === fromIndex) {
1528
- return;
1529
- }
1530
- if (fromIndex > toIndex) {
1531
- _c = __read([toIndex, fromIndex], 2), fromIndex = _c[0], toIndex = _c[1];
1532
- }
1533
- this.renderedOptions
1534
- .toArray()
1535
- .slice(fromIndex, toIndex + 1)
1536
- .filter(function (item) { return !item.disabled; })
1537
- .forEach(function (renderedOption) {
1538
- var isLastRenderedOption = renderedOption === _this.keyManager.activeItem;
1539
- if (isLastRenderedOption && renderedOption.selected && _this.noUnselectLast) {
1540
- return;
1541
- }
1542
- renderedOption.setSelected(!selectedOptionState);
1543
- });
1544
- };
1545
- McTreeSelection.prototype.setFocusedOption = function (option) {
1546
- this.keyManager.setActiveItem(option);
1547
- };
1548
- McTreeSelection.prototype.toggleFocusedOption = function () {
1549
- var focusedOption = this.keyManager.activeItem;
1550
- if (focusedOption && (!focusedOption.selected || this.canDeselectLast(focusedOption))) {
1551
- focusedOption.toggle();
1552
- this.emitChangeEvent(focusedOption);
1553
- }
1554
- };
1555
- McTreeSelection.prototype.renderNodeChanges = function (data, dataDiffer, viewContainer, parentData) {
1556
- if (dataDiffer === void 0) { dataDiffer = this.dataDiffer; }
1557
- if (viewContainer === void 0) { viewContainer = this.nodeOutlet.viewContainer; }
1558
- _super.prototype.renderNodeChanges.call(this, data, dataDiffer, viewContainer, parentData);
1559
- this.sortedNodes = this.getSortedNodes(viewContainer);
1560
- this.nodeOutlet.changeDetectorRef.detectChanges();
1561
- };
1562
- McTreeSelection.prototype.emitNavigationEvent = function (option) {
1563
- this.navigationChange.emit(new McTreeNavigationChange(this, option));
1564
- };
1565
- McTreeSelection.prototype.emitChangeEvent = function (option) {
1566
- this.selectionChange.emit(new McTreeNavigationChange(this, option));
1567
- };
1568
- McTreeSelection.prototype.selectAllOptions = function () {
1569
- var optionsToSelect = this.renderedOptions
1570
- .filter(function (option) { return !option.disabled; });
1571
- optionsToSelect
1572
- .forEach(function (option) { return option.setSelected(true); });
1573
- this.onSelectAll.emit(new McTreeSelectAllEvent(this, optionsToSelect));
1574
- };
1575
- McTreeSelection.prototype.copyActiveOption = function () {
1576
- if (this.onCopy.observers.length) {
1577
- this.onCopy.emit(new McTreeCopyEvent(this, this.keyManager.activeItem));
1578
- }
1579
- else {
1580
- this.onCopyDefaultHandler();
1581
- }
1582
- };
1583
- McTreeSelection.prototype.writeValue = function (value) {
1584
- if (this.multiple && value && !Array.isArray(value)) {
1585
- throw i1.getMcSelectNonArrayValueError();
1586
- }
1587
- if (value) {
1588
- this.setOptionsFromValues(this.multiple ? value : [value]);
1589
- }
1590
- else {
1591
- this.selectionModel.clear();
1592
- }
1593
- };
1594
- McTreeSelection.prototype.registerOnChange = function (fn) {
1595
- this.onChange = fn;
1596
- };
1597
- McTreeSelection.prototype.registerOnTouched = function (fn) {
1598
- this.onTouched = fn;
1599
- };
1600
- /**
1601
- * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
1602
- */
1603
- McTreeSelection.prototype.setDisabledState = function (isDisabled) {
1604
- this._disabled = isDisabled;
1605
- this.changeDetectorRef.markForCheck();
1606
- };
1607
- McTreeSelection.prototype.setOptionsFromValues = function (values) {
1608
- var _c;
1609
- var _this = this;
1610
- this.selectionModel.clear();
1611
- var valuesToSelect = values.reduce(function (result, value) {
1612
- return _this.treeControl.hasValue(value) ? __spreadArray(__spreadArray([], __read(result)), [_this.treeControl.hasValue(value)]) : __spreadArray([], __read(result));
1613
- }, []);
1614
- (_c = this.selectionModel).select.apply(_c, __spreadArray([], __read(valuesToSelect)));
1615
- };
1616
- McTreeSelection.prototype.getSelectedValues = function () {
1617
- var _this = this;
1618
- return this.selectionModel.selected.map(function (selected) { return _this.treeControl.getValue(selected); });
1619
- };
1620
- McTreeSelection.prototype.getItemHeight = function () {
1621
- return this.renderedOptions.first ? this.renderedOptions.first.getHeight() : 0;
1622
- };
1623
- McTreeSelection.prototype.onCopyDefaultHandler = function () {
1624
- var _a;
1625
- (_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.copy(this.keyManager.activeItem.value);
1626
- };
1627
- McTreeSelection.prototype.getHeight = function () {
1628
- var clientRects = this.elementRef.nativeElement.getClientRects();
1629
- if (clientRects.length) {
1630
- return clientRects[0].height;
1631
- }
1632
- return 0;
1633
- };
1634
- McTreeSelection.prototype.updateTabIndex = function () {
1635
- this._tabIndex = this.renderedOptions.length === 0 ? -1 : 0;
1636
- };
1637
- McTreeSelection.prototype.getSortedNodes = function (viewContainer) {
1638
- var array = [];
1639
- for (var i = 0; i < viewContainer.length; i++) {
1640
- var viewRef = viewContainer.get(i);
1641
- array.push(viewRef.context.$implicit);
1642
- }
1643
- return array;
1644
- };
1645
- McTreeSelection.prototype.allowFocusEscape = function () {
1646
- var _this = this;
1647
- if (this._tabIndex !== -1) {
1648
- this._tabIndex = -1;
1649
- setTimeout(function () {
1650
- _this._tabIndex = _this.userTabIndex || 0;
1651
- _this.changeDetectorRef.markForCheck();
1652
- });
1653
- }
1654
- };
1655
- McTreeSelection.prototype.resetOptions = function () {
1656
- this.dropSubscriptions();
1657
- this.listenToOptionsFocus();
1658
- };
1659
- McTreeSelection.prototype.dropSubscriptions = function () {
1660
- if (this.optionFocusSubscription) {
1661
- this.optionFocusSubscription.unsubscribe();
1662
- this.optionFocusSubscription = null;
1663
- }
1664
- if (this.optionBlurSubscription) {
1665
- this.optionBlurSubscription.unsubscribe();
1666
- this.optionBlurSubscription = null;
1667
- }
1668
- };
1669
- McTreeSelection.prototype.listenToOptionsFocus = function () {
1670
- var _this = this;
1671
- this.optionFocusSubscription = this.optionFocusChanges
1672
- .subscribe(function (event) {
1673
- var index = _this.renderedOptions.toArray().indexOf(event.option);
1674
- _this.renderedOptions
1675
- .filter(function (option) { return option.hasFocus; })
1676
- .forEach(function (option) { return option.hasFocus = false; });
1677
- if (_this.isValidIndex(index)) {
1678
- _this.keyManager.updateActiveItem(index);
1679
- }
1680
- });
1681
- this.optionBlurSubscription = this.optionBlurChanges
1682
- .subscribe(function () { return _this.blur(); });
1683
- };
1684
- /**
1685
- * Utility to ensure all indexes are valid.
1686
- * @param index The index to be checked.
1687
- * @returns True if the index is valid for our list of options.
1688
- */
1689
- McTreeSelection.prototype.isValidIndex = function (index) {
1690
- return index >= 0 && index < this.renderedOptions.length;
1691
- };
1692
- /** Checks whether any of the options is focused. */
1693
- McTreeSelection.prototype.hasFocusedOption = function () {
1694
- return this.renderedOptions.some(function (option) { return option.hasFocus; });
1695
- };
1696
- McTreeSelection.prototype.markOptionsForCheck = function () {
1697
- this.renderedOptions.forEach(function (option) { return option.markForCheck(); });
1698
- };
1699
- McTreeSelection.prototype.updateOptionsFocus = function () {
1700
- this.renderedOptions
1701
- .filter(function (option) { return option.hasFocus; })
1702
- .forEach(function (option) { return option.hasFocus = false; });
1703
- };
1704
- McTreeSelection.prototype.canDeselectLast = function (option) {
1705
- return !(this.noUnselectLast && this.selectionModel.selected.length === 1 && option.selected);
1706
- };
1707
- McTreeSelection.prototype.isFocusReceivedFromNestedOption = function ($event) {
1708
- if (!$event || !$event.relatedTarget) {
1709
- return false;
1710
- }
1711
- return $event.relatedTarget.classList.contains('mc-tree-option');
1712
- };
1713
- return McTreeSelection;
1714
- }(McTreeBase));
1715
- /** @nocollapse */ McTreeSelection.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeSelection, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.IterableDiffers }, { token: i0__namespace.ChangeDetectorRef }, { token: 'multiple', attribute: true }, { token: i1__namespace$1.Clipboard, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
1716
- /** @nocollapse */ McTreeSelection.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", 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: [
1717
- MC_SELECTION_TREE_VALUE_ACCESSOR,
1718
- { provide: MC_TREE_OPTION_PARENT_COMPONENT, useExisting: McTreeSelection },
1719
- { provide: McTreeBase, useExisting: McTreeSelection }
1720
- ], queries: [{ propertyName: "unorderedOptions", predicate: McTreeOption }], viewQueries: [{ propertyName: "nodeOutlet", first: true, predicate: McTreeNodeOutlet, descendants: true, static: true }], exportAs: ["mcTreeSelection"], usesInheritance: true, ngImport: i0__namespace, template: '<ng-container mcTreeNodeOutlet></ng-container>', isInline: true, styles: [".mc-tree-selection{display:block}\n"], directives: [{ type: McTreeNodeOutlet, selector: "[mcTreeNodeOutlet]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
1721
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeSelection, decorators: [{
1722
- type: i0.Component,
1723
- args: [{
1724
- selector: 'mc-tree-selection',
1725
- exportAs: 'mcTreeSelection',
1726
- template: '<ng-container mcTreeNodeOutlet></ng-container>',
1727
- styleUrls: ['./tree-selection.scss'],
1728
- host: {
1729
- class: 'mc-tree-selection',
1730
- '[attr.tabindex]': 'tabIndex',
1731
- '[attr.disabled]': 'disabled || null',
1732
- '(blur)': 'blur()',
1733
- '(focus)': 'focus($event)',
1734
- '(keydown)': 'onKeyDown($event)',
1735
- '(window:resize)': 'updateScrollSize()'
1736
- },
1737
- encapsulation: i0.ViewEncapsulation.None,
1738
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
1739
- providers: [
1740
- MC_SELECTION_TREE_VALUE_ACCESSOR,
1741
- { provide: MC_TREE_OPTION_PARENT_COMPONENT, useExisting: McTreeSelection },
1742
- { provide: McTreeBase, useExisting: McTreeSelection }
1743
- ]
1744
- }]
1745
- }], ctorParameters: function () {
1746
- return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.IterableDiffers }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace.MultipleMode, decorators: [{
1747
- type: i0.Attribute,
1748
- args: ['multiple']
1749
- }] }, { type: i1__namespace$1.Clipboard, decorators: [{
1750
- type: i0.Optional
1751
- }] }];
1752
- }, propDecorators: { nodeOutlet: [{
1753
- type: i0.ViewChild,
1754
- args: [McTreeNodeOutlet, { static: true }]
1755
- }], unorderedOptions: [{
1756
- type: i0.ContentChildren,
1757
- args: [McTreeOption]
1758
- }], treeControl: [{
1759
- type: i0.Input
1760
- }], navigationChange: [{
1761
- type: i0.Output
1762
- }], selectionChange: [{
1763
- type: i0.Output
1764
- }], onSelectAll: [{
1765
- type: i0.Output
1766
- }], onCopy: [{
1767
- type: i0.Output
1768
- }], autoSelect: [{
1769
- type: i0.Input
1770
- }], noUnselectLast: [{
1771
- type: i0.Input
1772
- }], disabled: [{
1773
- type: i0.Input
1774
- }], tabIndex: [{
1775
- type: i0.Input
1776
- }] } });
1777
-
1778
- var MC_TREE_DIRECTIVES = [
1779
- McTreeNodeOutlet,
1780
- McTreeNodeDef,
1781
- McTreeNode,
1782
- McTreeNodePadding,
1783
- McTree,
1784
- McTreeSelection,
1785
- McTreeOption,
1786
- McTreeNodePadding,
1787
- McTreeNodeToggleComponent,
1788
- McTreeNodeToggleDirective
1789
- ];
1790
- var McTreeModule = /** @class */ (function () {
1791
- function McTreeModule() {
1792
- }
1793
- return McTreeModule;
1794
- }());
1795
- /** @nocollapse */ McTreeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1796
- /** @nocollapse */ McTreeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeModule, declarations: [McTreeNodeOutlet,
1797
- McTreeNodeDef,
1798
- McTreeNode,
1799
- McTreeNodePadding,
1800
- McTree,
1801
- McTreeSelection,
1802
- McTreeOption,
1803
- McTreeNodePadding,
1804
- McTreeNodeToggleComponent,
1805
- McTreeNodeToggleDirective], imports: [i2$1.CommonModule, i1.McPseudoCheckboxModule], exports: [McTreeNodeOutlet,
1806
- McTreeNodeDef,
1807
- McTreeNode,
1808
- McTreeNodePadding,
1809
- McTree,
1810
- McTreeSelection,
1811
- McTreeOption,
1812
- McTreeNodePadding,
1813
- McTreeNodeToggleComponent,
1814
- McTreeNodeToggleDirective] });
1815
- /** @nocollapse */ McTreeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeModule, imports: [[i2$1.CommonModule, i1.McPseudoCheckboxModule]] });
1816
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: McTreeModule, decorators: [{
1817
- type: i0.NgModule,
1818
- args: [{
1819
- imports: [i2$1.CommonModule, i1.McPseudoCheckboxModule],
1820
- exports: MC_TREE_DIRECTIVES,
1821
- declarations: MC_TREE_DIRECTIVES
1822
- }]
1823
- }] });
1824
-
1825
- /** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */
1826
- /* tslint:disable-next-line:naming-convention */
1827
- var BaseTreeControl = /** @class */ (function () {
1828
- function BaseTreeControl() {
1829
- /** A selection model with multi-selection to track expansion status. */
1830
- this.expansionModel = new collections.SelectionModel(true);
1831
- this.filterModel = new collections.SelectionModel(true);
1832
- this.filterValue = new rxjs.BehaviorSubject('');
1833
- }
1834
- /** Toggles one single data node's expanded/collapsed state. */
1835
- BaseTreeControl.prototype.toggle = function (dataNode) {
1836
- if (this.filterValue.value) {
1837
- return;
1838
- }
1839
- this.expansionModel.toggle(dataNode);
1840
- };
1841
- /** Expands one single data node. */
1842
- BaseTreeControl.prototype.expand = function (dataNode) {
1843
- if (this.filterValue.value) {
1844
- return;
1845
- }
1846
- this.expansionModel.select(dataNode);
1847
- };
1848
- /** Collapses one single data node. */
1849
- BaseTreeControl.prototype.collapse = function (dataNode) {
1850
- if (this.filterValue.value) {
1851
- return;
1852
- }
1853
- this.expansionModel.deselect(dataNode);
1854
- };
1855
- /** Whether a given data node is expanded or not. Returns true if the data node is expanded. */
1856
- BaseTreeControl.prototype.isExpanded = function (dataNode) {
1857
- return this.expansionModel.isSelected(dataNode);
1858
- };
1859
- /** Toggles a subtree rooted at `node` recursively. */
1860
- BaseTreeControl.prototype.toggleDescendants = function (dataNode) {
1861
- this.expansionModel.isSelected(dataNode)
1862
- ? this.collapseDescendants(dataNode)
1863
- : this.expandDescendants(dataNode);
1864
- };
1865
- /** Collapse all dataNodes in the tree. */
1866
- BaseTreeControl.prototype.collapseAll = function () {
1867
- this.expansionModel.clear();
1868
- };
1869
- /** Expands a subtree rooted at given data node recursively. */
1870
- BaseTreeControl.prototype.expandDescendants = function (dataNode) {
1871
- var _a;
1872
- var toBeProcessed = [dataNode];
1873
- toBeProcessed.push.apply(toBeProcessed, __spreadArray([], __read(this.getDescendants(dataNode))));
1874
- (_a = this.expansionModel).select.apply(_a, __spreadArray([], __read(toBeProcessed)));
1875
- };
1876
- /** Collapses a subtree rooted at given data node recursively. */
1877
- BaseTreeControl.prototype.collapseDescendants = function (dataNode) {
1878
- var _a;
1879
- var toBeProcessed = [dataNode];
1880
- toBeProcessed.push.apply(toBeProcessed, __spreadArray([], __read(this.getDescendants(dataNode))));
1881
- (_a = this.expansionModel).deselect.apply(_a, __spreadArray([], __read(toBeProcessed)));
1882
- };
1883
- return BaseTreeControl;
1884
- }());
1885
-
1886
- function defaultCompareValues(firstValue, secondValue) {
1887
- return firstValue === secondValue;
1888
- }
1889
- function defaultCompareViewValues(firstViewValue, secondViewValue) {
1890
- return RegExp(secondViewValue, 'gi').test(firstViewValue);
1891
- }
1892
- /** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */
1893
- var FlatTreeControl = /** @class */ (function (_super) {
1894
- __extends(FlatTreeControl, _super);
1895
- /** Construct with flat tree data node functions getLevel, isExpandable, getValue and getViewValue. */
1896
- function FlatTreeControl(getLevel, isExpandable,
1897
- /** getValue will be used to determine if the tree contains value or not. Used in method hasValue */
1898
- getValue,
1899
- /** getViewValue will be used for filter nodes. Returned value will be first argument in filterNodesFunction */
1900
- getViewValue,
1901
- /** compareValues will be used to comparing values. */
1902
- compareValues,
1903
- /** compareValues will be used to comparing values. */
1904
- compareViewValues) {
1905
- if (compareValues === void 0) { compareValues = defaultCompareValues; }
1906
- if (compareViewValues === void 0) { compareViewValues = defaultCompareViewValues; }
1907
- var _this = _super.call(this) || this;
1908
- _this.getLevel = getLevel;
1909
- _this.isExpandable = isExpandable;
1910
- _this.getValue = getValue;
1911
- _this.getViewValue = getViewValue;
1912
- _this.compareValues = compareValues;
1913
- _this.compareViewValues = compareViewValues;
1914
- return _this;
1915
- }
1916
- /**
1917
- * Gets a list of the data node's subtree of descendent data nodes.
1918
- *
1919
- * To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
1920
- * with correct levels.
1921
- */
1922
- FlatTreeControl.prototype.getDescendants = function (dataNode) {
1923
- var startIndex = this.dataNodes.indexOf(dataNode);
1924
- var results = [];
1925
- // Goes through flattened tree nodes in the `dataNodes` array, and get all descendants.
1926
- // The level of descendants of a tree node must be greater than the level of the given
1927
- // tree node.
1928
- // If we reach a node whose level is equal to the level of the tree node, we hit a sibling.
1929
- // If we reach a node whose level is greater than the level of the tree node, we hit a
1930
- // sibling of an ancestor.
1931
- for (var i = startIndex + 1; i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]); i++) {
1932
- results.push(this.dataNodes[i]);
1933
- }
1934
- return results;
1935
- };
1936
- /**
1937
- * Expands all data nodes in the tree.
1938
- *
1939
- * To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
1940
- * data nodes of the tree.
1941
- */
1942
- FlatTreeControl.prototype.expandAll = function () {
1943
- var _a;
1944
- (_a = this.expansionModel).select.apply(_a, __spreadArray([], __read(this.dataNodes)));
1945
- };
1946
- FlatTreeControl.prototype.getParents = function (node, result) {
1947
- if (node.parent) {
1948
- result.unshift(node.parent);
1949
- return this.getParents(node.parent, result);
1950
- }
1951
- else {
1952
- return result;
1953
- }
1954
- };
1955
- FlatTreeControl.prototype.hasValue = function (value) {
1956
- var _this = this;
1957
- return this.dataNodes.find(function (node) { return _this.compareValues(_this.getValue(node), value); });
1958
- };
1959
- FlatTreeControl.prototype.filterNodes = function (value) {
1960
- var _a;
1961
- var _this = this;
1962
- this.saveExpansionState();
1963
- this.filterModel.clear();
1964
- this.expansionModel.clear();
1965
- var filteredNodes = this.dataNodes
1966
- .filter(function (node) { return _this.compareViewValues(_this.getViewValue(node), value); });
1967
- var filteredNodesWithTheirParents = new Set();
1968
- filteredNodes.forEach(function (filteredNode) {
1969
- _this.getParents(filteredNode, [])
1970
- .forEach(function (node) {
1971
- filteredNodesWithTheirParents.add(node);
1972
- _this.expandDataNode(node);
1973
- });
1974
- filteredNodesWithTheirParents.add(filteredNode);
1975
- _this.expandDataNode(filteredNode);
1976
- if (_this.isExpandable(filteredNode)) {
1977
- var childNodeLevel_1 = _this.getLevel(filteredNode) + 1;
1978
- _this.getDescendants(filteredNode)
1979
- .filter(function (childNode) { return _this.getLevel(childNode) === childNodeLevel_1; })
1980
- .filter(function (childNode) { return !_this.isExpandable(childNode) || !_this.hasFilteredDescendant(childNode, filteredNodes); })
1981
- .forEach(function (childNode) {
1982
- filteredNodesWithTheirParents.add(childNode);
1983
- _this.expandDataNode(childNode);
1984
- });
1985
- }
1986
- });
1987
- (_a = this.filterModel).select.apply(_a, __spreadArray([], __read(Array.from(filteredNodesWithTheirParents))));
1988
- this.filterValue.next(value);
1989
- this.restoreExpansionState();
1990
- };
1991
- FlatTreeControl.prototype.expandDataNode = function (dataNode) {
1992
- if (this.isExpandable(dataNode)) {
1993
- this.expansionModel.select(dataNode);
1994
- }
1995
- };
1996
- FlatTreeControl.prototype.saveExpansionState = function () {
1997
- if (this.filterValue.value === '') {
1998
- this.expandedItemsBeforeFiltration = this.expansionModel.selected;
1999
- }
2000
- };
2001
- FlatTreeControl.prototype.restoreExpansionState = function () {
2002
- var _a;
2003
- if (this.filterValue.value === '') {
2004
- this.expansionModel.clear();
2005
- (_a = this.expansionModel).select.apply(_a, __spreadArray([], __read(this.expandedItemsBeforeFiltration)));
2006
- }
2007
- };
2008
- FlatTreeControl.prototype.hasFilteredDescendant = function (dataNode, filteredNodes) {
2009
- var _this = this;
2010
- var filteredViewValues = filteredNodes
2011
- .map(function (node) { return _this.getViewValue(node); });
2012
- return this.getDescendants(dataNode)
2013
- .filter(function (node) { return filteredViewValues.includes(_this.getViewValue(node)); })
2014
- .length > 0;
2015
- };
2016
- return FlatTreeControl;
2017
- }(BaseTreeControl));
2018
-
2019
- /** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */
2020
- var NestedTreeControl = /** @class */ (function (_super) {
2021
- __extends(NestedTreeControl, _super);
2022
- /** Construct with nested tree function getChildren. */
2023
- function NestedTreeControl(getChildren) {
2024
- var _this = _super.call(this) || this;
2025
- _this.getChildren = getChildren;
2026
- return _this;
2027
- }
2028
- /**
2029
- * Expands all dataNodes in the tree.
2030
- *
2031
- * To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
2032
- * data nodes of the tree.
2033
- */
2034
- NestedTreeControl.prototype.expandAll = function () {
2035
- var _a;
2036
- var _this = this;
2037
- this.expansionModel.clear();
2038
- var allNodes = this.dataNodes.reduce(function (accumulator, dataNode) { return __spreadArray(__spreadArray(__spreadArray([], __read(accumulator)), __read(_this.getDescendants(dataNode))), [dataNode]); }, []);
2039
- (_a = this.expansionModel).select.apply(_a, __spreadArray([], __read(allNodes)));
2040
- };
2041
- /** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */
2042
- NestedTreeControl.prototype.getDescendants = function (dataNode) {
2043
- var descendants = [];
2044
- this._getDescendants(descendants, dataNode);
2045
- return descendants.splice(1);
2046
- };
2047
- /** A helper function to get descendants recursively. */
2048
- // todo нужно придумать другое название и понять в чем отличие между getDescendants и _getDescendants
2049
- /* tslint:disable-next-line:naming-convention */
2050
- NestedTreeControl.prototype._getDescendants = function (descendants, dataNode) {
2051
- var _this = this;
2052
- descendants.push(dataNode);
2053
- this.getChildren(dataNode)
2054
- .pipe(operators.take(1))
2055
- .subscribe(function (children) {
2056
- if (children && children.length > 0) {
2057
- children.forEach(function (child) { return _this._getDescendants(descendants, child); });
2058
- }
2059
- });
2060
- };
2061
- return NestedTreeControl;
2062
- }(BaseTreeControl));
2063
-
2064
- /**
2065
- * Tree flattener to convert a normal type of node to node with children & level information.
2066
- * Transform nested nodes of type `T` to flattened nodes of type `F`.
2067
- *
2068
- * For example, the input data of type `T` is nested, and contains its children data:
2069
- * SomeNode: {
2070
- * key: 'Fruits',
2071
- * children: [
2072
- * NodeOne: {
2073
- * key: 'Apple',
2074
- * },
2075
- * NodeTwo: {
2076
- * key: 'Pear',
2077
- * }
2078
- * ]
2079
- * }
2080
- * After flattener flatten the tree, the structure will become
2081
- * SomeNode: {
2082
- * key: 'Fruits',
2083
- * expandable: true,
2084
- * level: 1
2085
- * },
2086
- * NodeOne: {
2087
- * key: 'Apple',
2088
- * expandable: false,
2089
- * level: 2
2090
- * },
2091
- * NodeTwo: {
2092
- * key: 'Pear',
2093
- * expandable: false,
2094
- * level: 2
2095
- * }
2096
- * and the output flattened type is `F` with additional information.
2097
- */
2098
- var McTreeFlattener = /** @class */ (function () {
2099
- function McTreeFlattener(transformFunction, getLevel, isExpandable, getChildren) {
2100
- this.transformFunction = transformFunction;
2101
- this.getLevel = getLevel;
2102
- this.isExpandable = isExpandable;
2103
- this.getChildren = getChildren;
2104
- }
2105
- McTreeFlattener.prototype.flattenNode = function (node, level, resultNodes, parent) {
2106
- var _this = this;
2107
- var flatNode = this.transformFunction(node, level, parent);
2108
- resultNodes.push(flatNode);
2109
- if (this.isExpandable(flatNode)) {
2110
- var childrenNodes = this.getChildren(node);
2111
- if (childrenNodes) {
2112
- if (Array.isArray(childrenNodes)) {
2113
- this.flattenChildren(childrenNodes, level, resultNodes, flatNode);
2114
- }
2115
- else {
2116
- childrenNodes
2117
- .pipe(operators.take(1))
2118
- .subscribe(function (children) {
2119
- _this.flattenChildren(children, level, resultNodes, flatNode);
2120
- });
2121
- }
2122
- }
2123
- }
2124
- return resultNodes;
2125
- };
2126
- McTreeFlattener.prototype.flattenChildren = function (children, level, resultNodes, parent) {
2127
- var _this = this;
2128
- children.forEach(function (child) {
2129
- _this.flattenNode(child, level + 1, resultNodes, parent);
2130
- });
2131
- };
2132
- /**
2133
- * Flatten a list of node type T to flattened version of node F.
2134
- * Please note that type T may be nested, and the length of `structuredData` may be different
2135
- * from that of returned list `F[]`.
2136
- */
2137
- McTreeFlattener.prototype.flattenNodes = function (structuredData) {
2138
- var _this = this;
2139
- var resultNodes = [];
2140
- structuredData.forEach(function (node) { return _this.flattenNode(node, 0, resultNodes, null); });
2141
- return resultNodes;
2142
- };
2143
- /**
2144
- * Expand flattened node with current expansion status.
2145
- * The returned list may have different length.
2146
- */
2147
- McTreeFlattener.prototype.expandFlattenedNodes = function (nodes, treeControl) {
2148
- var _this = this;
2149
- var results = [];
2150
- var currentExpand = [];
2151
- currentExpand[0] = true;
2152
- nodes.forEach(function (node) {
2153
- var expand = true;
2154
- for (var i = 0; i <= _this.getLevel(node); i++) {
2155
- expand = expand && currentExpand[i];
2156
- }
2157
- if (expand) {
2158
- results.push(node);
2159
- }
2160
- if (_this.isExpandable(node)) {
2161
- currentExpand[_this.getLevel(node) + 1] = treeControl.isExpanded(node);
2162
- }
2163
- });
2164
- return results;
2165
- };
2166
- return McTreeFlattener;
2167
- }());
2168
- var McTreeDataSourceChangeTypes;
2169
- (function (McTreeDataSourceChangeTypes) {
2170
- McTreeDataSourceChangeTypes["Expansion"] = "expansion";
2171
- McTreeDataSourceChangeTypes["Filter"] = "filter";
2172
- })(McTreeDataSourceChangeTypes || (McTreeDataSourceChangeTypes = {}));
2173
- /**
2174
- * Data source for flat tree.
2175
- * The data source need to handle expansion/collapsion of the tree node and change the data feed
2176
- * to `McTree`.
2177
- * The nested tree nodes of type `T` are flattened through `MсTreeFlattener`, and converted
2178
- * to type `F` for `McTree` to consume.
2179
- */
2180
- var McTreeFlatDataSource = /** @class */ (function (_super) {
2181
- __extends(McTreeFlatDataSource, _super);
2182
- function McTreeFlatDataSource(treeControl, treeFlattener, initialData) {
2183
- if (initialData === void 0) { initialData = []; }
2184
- var _this = _super.call(this) || this;
2185
- _this.treeControl = treeControl;
2186
- _this.treeFlattener = treeFlattener;
2187
- _this.flattenedData = new rxjs.BehaviorSubject([]);
2188
- _this.expandedData = new rxjs.BehaviorSubject([]);
2189
- _this.filteredData = new rxjs.BehaviorSubject([]);
2190
- _this._data = new rxjs.BehaviorSubject(initialData);
2191
- return _this;
2192
- }
2193
- Object.defineProperty(McTreeFlatDataSource.prototype, "data", {
2194
- get: function () {
2195
- return this._data.value;
2196
- },
2197
- set: function (value) {
2198
- this._data.next(value);
2199
- this.flattenedData.next(this.treeFlattener.flattenNodes(this.data));
2200
- this.treeControl.dataNodes = this.flattenedData.value;
2201
- },
2202
- enumerable: false,
2203
- configurable: true
2204
- });
2205
- McTreeFlatDataSource.prototype.connect = function (collectionViewer) {
2206
- var _this = this;
2207
- return rxjs.merge(collectionViewer.viewChange, this.treeControl.expansionModel.changed
2208
- .pipe(operators.map(function (value) { return ({ type: McTreeDataSourceChangeTypes.Expansion, value: value }); })), this.treeControl.filterValue
2209
- .pipe(operators.map(function (value) { return ({ type: McTreeDataSourceChangeTypes.Filter, value: value }); })), this.flattenedData)
2210
- .pipe(operators.map(function (changeObj) {
2211
- if (changeObj.type === McTreeDataSourceChangeTypes.Filter) {
2212
- if (changeObj.value && changeObj.value.length > 0) {
2213
- return _this.filterHandler();
2214
- }
2215
- else {
2216
- return _this.expansionHandler();
2217
- }
2218
- }
2219
- return _this.expansionHandler();
2220
- }));
2221
- };
2222
- McTreeFlatDataSource.prototype.filterHandler = function () {
2223
- this.filteredData.next(this.treeControl.filterModel.selected);
2224
- return this.filteredData.value;
2225
- };
2226
- McTreeFlatDataSource.prototype.expansionHandler = function () {
2227
- var expandedNodes = this.treeFlattener.expandFlattenedNodes(this.flattenedData.value, this.treeControl);
2228
- this.expandedData.next(expandedNodes);
2229
- return this.expandedData.value;
2230
- };
2231
- McTreeFlatDataSource.prototype.disconnect = function () {
2232
- // no op
2233
- };
2234
- return McTreeFlatDataSource;
2235
- }(collections.DataSource));
2236
-
2237
- /**
2238
- * Data source for nested tree.
2239
- *
2240
- * The data source for nested tree doesn't have to consider node flattener, or the way to expand
2241
- * or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node.
2242
- */
2243
- var McTreeNestedDataSource = /** @class */ (function (_super) {
2244
- __extends(McTreeNestedDataSource, _super);
2245
- function McTreeNestedDataSource() {
2246
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
2247
- /* tslint:disable-next-line:naming-convention */
2248
- _this._data = new rxjs.BehaviorSubject([]);
2249
- return _this;
2250
- }
2251
- Object.defineProperty(McTreeNestedDataSource.prototype, "data", {
2252
- get: function () {
2253
- return this._data.value;
2254
- },
2255
- set: function (value) {
2256
- this._data.next(value);
2257
- },
2258
- enumerable: false,
2259
- configurable: true
2260
- });
2261
- McTreeNestedDataSource.prototype.connect = function (collectionViewer) {
2262
- var _this = this;
2263
- return rxjs.merge.apply(void 0, [collectionViewer.viewChange, this._data]).pipe(operators.map(function () { return _this.data; }));
2264
- };
2265
- McTreeNestedDataSource.prototype.disconnect = function () {
2266
- // no op
2267
- };
2268
- return McTreeNestedDataSource;
2269
- }(collections.DataSource));
2270
-
2271
- /**
2272
- * Generated bundle index. Do not edit.
2273
- */
2274
-
2275
- exports.BaseTreeControl = BaseTreeControl;
2276
- exports.FlatTreeControl = FlatTreeControl;
2277
- exports.MC_SELECTION_TREE_VALUE_ACCESSOR = MC_SELECTION_TREE_VALUE_ACCESSOR;
2278
- exports.MC_TREE_OPTION_PARENT_COMPONENT = MC_TREE_OPTION_PARENT_COMPONENT;
2279
- exports.McTree = McTree;
2280
- exports.McTreeBase = McTreeBase;
2281
- exports.McTreeCopyEvent = McTreeCopyEvent;
2282
- exports.McTreeFlatDataSource = McTreeFlatDataSource;
2283
- exports.McTreeFlattener = McTreeFlattener;
2284
- exports.McTreeModule = McTreeModule;
2285
- exports.McTreeNavigationChange = McTreeNavigationChange;
2286
- exports.McTreeNestedDataSource = McTreeNestedDataSource;
2287
- exports.McTreeNode = McTreeNode;
2288
- exports.McTreeNodeDef = McTreeNodeDef;
2289
- exports.McTreeNodeOutlet = McTreeNodeOutlet;
2290
- exports.McTreeNodeOutletContext = McTreeNodeOutletContext;
2291
- exports.McTreeNodePadding = McTreeNodePadding;
2292
- exports.McTreeNodeToggleBase = McTreeNodeToggleBase;
2293
- exports.McTreeNodeToggleBaseDirective = McTreeNodeToggleBaseDirective;
2294
- exports.McTreeNodeToggleComponent = McTreeNodeToggleComponent;
2295
- exports.McTreeNodeToggleDirective = McTreeNodeToggleDirective;
2296
- exports.McTreeNodeToggleMixinBase = McTreeNodeToggleMixinBase;
2297
- exports.McTreeOption = McTreeOption;
2298
- exports.McTreeOptionChange = McTreeOptionChange;
2299
- exports.McTreeSelectAllEvent = McTreeSelectAllEvent;
2300
- exports.McTreeSelection = McTreeSelection;
2301
- exports.McTreeSelectionChange = McTreeSelectionChange;
2302
- exports.NestedTreeControl = NestedTreeControl;
2303
- exports.defaultCompareValues = defaultCompareValues;
2304
- exports.defaultCompareViewValues = defaultCompareViewValues;
2305
-
2306
- Object.defineProperty(exports, '__esModule', { value: true });
2307
-
2308
- })));
2309
- //# sourceMappingURL=ptsecurity-mosaic-tree.umd.js.map