@ptsecurity/mosaic 11.6.0 → 12.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_theming.scss +407 -99
- package/_visual.scss +63 -26
- package/autocomplete/autocomplete-origin.directive.d.ts +3 -0
- package/autocomplete/autocomplete-trigger.directive.d.ts +3 -0
- package/autocomplete/autocomplete.component.d.ts +3 -0
- package/autocomplete/autocomplete.module.d.ts +10 -0
- package/autocomplete/package.json +0 -1
- package/autocomplete/ptsecurity-mosaic-autocomplete.d.ts +1 -0
- package/bundles/ptsecurity-mosaic-autocomplete.umd.js +178 -114
- package/bundles/ptsecurity-mosaic-autocomplete.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-button-toggle.umd.js +107 -71
- package/bundles/ptsecurity-mosaic-button-toggle.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-button.umd.js +106 -77
- package/bundles/ptsecurity-mosaic-button.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-card.umd.js +74 -43
- package/bundles/ptsecurity-mosaic-card.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-checkbox.umd.js +114 -69
- package/bundles/ptsecurity-mosaic-checkbox.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-core.umd.js +804 -256
- package/bundles/ptsecurity-mosaic-core.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-datepicker.umd.js +599 -420
- package/bundles/ptsecurity-mosaic-datepicker.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-design-tokens.umd.js +108 -26
- package/bundles/ptsecurity-mosaic-design-tokens.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-divider.umd.js +55 -28
- package/bundles/ptsecurity-mosaic-divider.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-dropdown.umd.js +263 -187
- package/bundles/ptsecurity-mosaic-dropdown.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-form-field.umd.js +200 -125
- package/bundles/ptsecurity-mosaic-form-field.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-icon.umd.js +79 -41
- package/bundles/ptsecurity-mosaic-icon.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-input.umd.js +222 -124
- package/bundles/ptsecurity-mosaic-input.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-link.umd.js +76 -45
- package/bundles/ptsecurity-mosaic-link.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-list.umd.js +344 -200
- package/bundles/ptsecurity-mosaic-list.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-modal.umd.js +324 -220
- package/bundles/ptsecurity-mosaic-modal.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-navbar.umd.js +289 -208
- package/bundles/ptsecurity-mosaic-navbar.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-popover.umd.js +346 -640
- package/bundles/ptsecurity-mosaic-popover.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-progress-bar.umd.js +69 -40
- package/bundles/ptsecurity-mosaic-progress-bar.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-progress-spinner.umd.js +69 -40
- package/bundles/ptsecurity-mosaic-progress-spinner.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-radio.umd.js +126 -81
- package/bundles/ptsecurity-mosaic-radio.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-select.umd.js +276 -154
- package/bundles/ptsecurity-mosaic-select.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-sidebar.umd.js +105 -68
- package/bundles/ptsecurity-mosaic-sidebar.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-sidepanel.umd.js +236 -158
- package/bundles/ptsecurity-mosaic-sidepanel.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-splitter.umd.js +112 -83
- package/bundles/ptsecurity-mosaic-splitter.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-table.umd.js +77 -44
- package/bundles/ptsecurity-mosaic-table.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-tabs.umd.js +894 -687
- package/bundles/ptsecurity-mosaic-tabs.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-tags.umd.js +313 -209
- package/bundles/ptsecurity-mosaic-tags.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-textarea.umd.js +107 -53
- package/bundles/ptsecurity-mosaic-textarea.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-timepicker.umd.js +116 -71
- package/bundles/ptsecurity-mosaic-timepicker.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-toggle.umd.js +97 -58
- package/bundles/ptsecurity-mosaic-toggle.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-tooltip.umd.js +347 -615
- package/bundles/ptsecurity-mosaic-tooltip.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-tree-select.umd.js +223 -118
- package/bundles/ptsecurity-mosaic-tree-select.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic-tree.umd.js +1162 -344
- package/bundles/ptsecurity-mosaic-tree.umd.js.map +1 -1
- package/bundles/ptsecurity-mosaic.umd.js +2 -2
- package/button/button.component.d.ts +7 -0
- package/button/button.module.d.ts +8 -0
- package/button/package.json +0 -1
- package/button/ptsecurity-mosaic-button.d.ts +1 -0
- package/button-toggle/button-toggle.component.d.ts +5 -0
- package/button-toggle/button-toggle.module.d.ts +7 -0
- package/button-toggle/package.json +0 -1
- package/button-toggle/ptsecurity-mosaic-button-toggle.d.ts +1 -0
- package/card/card.component.d.ts +3 -0
- package/card/card.module.d.ts +8 -0
- package/card/package.json +0 -1
- package/card/ptsecurity-mosaic-card.d.ts +1 -0
- package/checkbox/checkbox-module.d.ts +7 -0
- package/checkbox/checkbox-required-validator.d.ts +3 -0
- package/checkbox/checkbox.d.ts +3 -0
- package/checkbox/package.json +0 -1
- package/checkbox/ptsecurity-mosaic-checkbox.d.ts +1 -0
- package/core/common-behaviors/color.d.ts +3 -3
- package/core/common-behaviors/common-module.d.ts +5 -0
- package/core/common-behaviors/disabled.d.ts +4 -3
- package/core/common-behaviors/tabindex.d.ts +2 -1
- package/core/error/error-options.d.ts +5 -0
- package/core/formatters/date/formatter.d.ts +3 -0
- package/core/formatters/index.d.ts +5 -0
- package/core/formatters/number/formatter.d.ts +4 -0
- package/core/forms/forms-module.d.ts +5 -0
- package/core/forms/forms.directive.d.ts +5 -0
- package/core/highlight/highlight.pipe.d.ts +3 -0
- package/core/highlight/index.d.ts +6 -0
- package/core/line/line.d.ts +6 -0
- package/core/option/action.d.ts +42 -0
- package/core/option/index.d.ts +1 -0
- package/core/option/optgroup.d.ts +3 -0
- package/core/option/option-module.d.ts +9 -0
- package/core/option/option.d.ts +3 -0
- package/core/overlay/overlay-position-map.d.ts +0 -4
- package/core/package.json +0 -1
- package/core/pop-up/constants.d.ts +29 -0
- package/core/pop-up/index.d.ts +3 -0
- package/core/pop-up/pop-up-trigger.d.ts +70 -0
- package/core/pop-up/pop-up.d.ts +35 -0
- package/core/ptsecurity-mosaic-core.d.ts +1 -1
- package/core/public-api.d.ts +1 -0
- package/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts +3 -0
- package/core/selection/pseudo-checkbox/pseudo-checkbox.module.d.ts +6 -0
- package/core/services/measure-scrollbar.service.d.ts +3 -0
- package/datepicker/calendar-body.component.d.ts +5 -6
- package/datepicker/calendar.component.d.ts +5 -0
- package/datepicker/datepicker-input.directive.d.ts +6 -2
- package/datepicker/datepicker-intl.d.ts +3 -0
- package/datepicker/datepicker-module.d.ts +18 -0
- package/datepicker/datepicker-toggle.component.d.ts +5 -0
- package/datepicker/datepicker.component.d.ts +5 -0
- package/datepicker/month-view.component.d.ts +3 -0
- package/datepicker/multi-year-view.component.d.ts +3 -0
- package/datepicker/package.json +0 -1
- package/datepicker/ptsecurity-mosaic-datepicker.d.ts +1 -0
- package/datepicker/year-view.component.d.ts +3 -0
- package/design-tokens/package.json +0 -1
- package/design-tokens/ptsecurity-mosaic-design-tokens.d.ts +1 -0
- package/design-tokens/tokens/components/list.json5 +0 -4
- package/design-tokens/tokens/components/popover.json5 +32 -4
- package/design-tokens/tokens/components/tooltip.json5 +49 -3
- package/design-tokens/tokens/components/tree.json5 +3 -3
- package/design-tokens/tokens/properties/globals.json5 +1 -1
- package/design-tokens/tokens.d.ts +56 -15
- package/divider/divider.component.d.ts +3 -0
- package/divider/divider.module.d.ts +6 -0
- package/divider/package.json +0 -1
- package/divider/ptsecurity-mosaic-divider.d.ts +1 -0
- package/dropdown/dropdown-content.directive.d.ts +3 -0
- package/dropdown/dropdown-item.component.d.ts +3 -0
- package/dropdown/dropdown-trigger.directive.d.ts +6 -8
- package/dropdown/dropdown.component.d.ts +5 -1
- package/dropdown/dropdown.module.d.ts +11 -0
- package/dropdown/package.json +0 -1
- package/dropdown/ptsecurity-mosaic-dropdown.d.ts +1 -0
- package/esm2015/autocomplete/autocomplete-origin.directive.js +11 -11
- package/esm2015/autocomplete/autocomplete-trigger.directive.js +53 -38
- package/esm2015/autocomplete/autocomplete.component.js +56 -37
- package/esm2015/autocomplete/autocomplete.module.js +25 -15
- package/esm2015/button/button.component.js +52 -56
- package/esm2015/button/button.module.js +35 -20
- package/esm2015/button-toggle/button-toggle.component.js +76 -55
- package/esm2015/button-toggle/button-toggle.module.js +13 -8
- package/esm2015/card/card.component.js +32 -30
- package/esm2015/card/card.module.js +23 -12
- package/esm2015/checkbox/checkbox-module.js +13 -8
- package/esm2015/checkbox/checkbox-required-validator.js +12 -8
- package/esm2015/checkbox/checkbox.js +61 -44
- package/esm2015/core/common-behaviors/color.js +2 -5
- package/esm2015/core/common-behaviors/common-module.js +17 -11
- package/esm2015/core/common-behaviors/disabled.js +1 -1
- package/esm2015/core/common-behaviors/tabindex.js +4 -13
- package/esm2015/core/error/error-options.js +12 -8
- package/esm2015/core/formatters/date/formatter.js +13 -10
- package/esm2015/core/formatters/index.js +13 -8
- package/esm2015/core/formatters/number/formatter.js +16 -10
- package/esm2015/core/forms/forms-module.js +20 -13
- package/esm2015/core/forms/forms.directive.js +32 -29
- package/esm2015/core/highlight/highlight.pipe.js +8 -4
- package/esm2015/core/highlight/index.js +13 -8
- package/esm2015/core/line/line.js +22 -14
- package/esm2015/core/option/action.js +131 -0
- package/esm2015/core/option/index.js +2 -1
- package/esm2015/core/option/optgroup.js +22 -19
- package/esm2015/core/option/option-module.js +14 -8
- package/esm2015/core/option/option.js +44 -35
- package/esm2015/core/overlay/overlay-position-map.js +16 -18
- package/esm2015/core/pop-up/constants.js +34 -0
- package/esm2015/core/pop-up/index.js +4 -0
- package/esm2015/core/pop-up/pop-up-trigger.js +241 -0
- package/esm2015/core/pop-up/pop-up.js +87 -0
- package/esm2015/core/ptsecurity-mosaic-core.js +1 -2
- package/esm2015/core/public-api.js +2 -1
- package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.js +25 -21
- package/esm2015/core/selection/pseudo-checkbox/pseudo-checkbox.module.js +13 -8
- package/esm2015/core/services/measure-scrollbar.service.js +12 -12
- package/esm2015/datepicker/calendar-body.component.js +39 -32
- package/esm2015/datepicker/calendar.component.js +92 -58
- package/esm2015/datepicker/datepicker-input.directive.js +92 -61
- package/esm2015/datepicker/datepicker-intl.js +7 -5
- package/esm2015/datepicker/datepicker-module.js +89 -48
- package/esm2015/datepicker/datepicker-toggle.component.js +44 -32
- package/esm2015/datepicker/datepicker.component.js +88 -63
- package/esm2015/datepicker/month-view.component.js +48 -29
- package/esm2015/datepicker/multi-year-view.component.js +40 -27
- package/esm2015/datepicker/year-view.component.js +45 -28
- package/esm2015/design-tokens/tokens.js +57 -16
- package/esm2015/divider/divider.component.js +24 -20
- package/esm2015/divider/divider.module.js +13 -8
- package/esm2015/dropdown/dropdown-content.directive.js +13 -15
- package/esm2015/dropdown/dropdown-item.component.js +40 -30
- package/esm2015/dropdown/dropdown-trigger.directive.js +75 -67
- package/esm2015/dropdown/dropdown.component.js +63 -38
- package/esm2015/dropdown/dropdown.module.js +40 -23
- package/esm2015/form-field/cleaner.js +20 -11
- package/esm2015/form-field/form-field.js +77 -53
- package/esm2015/form-field/form-field.module.js +41 -24
- package/esm2015/form-field/hint.js +16 -13
- package/esm2015/form-field/prefix.js +10 -6
- package/esm2015/form-field/stepper.js +22 -11
- package/esm2015/form-field/suffix.js +10 -6
- package/esm2015/icon/icon.component.js +27 -22
- package/esm2015/icon/icon.module.js +31 -18
- package/esm2015/input/input-number-validators.js +48 -29
- package/esm2015/input/input-number.js +42 -28
- package/esm2015/input/input.js +94 -52
- package/esm2015/input/input.module.js +13 -8
- package/esm2015/link/link.component.js +38 -34
- package/esm2015/link/link.module.js +20 -11
- package/esm2015/list/list-selection.component.js +224 -122
- package/esm2015/list/list.component.js +35 -32
- package/esm2015/list/list.module.js +47 -25
- package/esm2015/modal/css-unit.pipe.js +10 -6
- package/esm2015/modal/modal-control.service.js +11 -8
- package/esm2015/modal/modal.component.js +107 -61
- package/esm2015/modal/modal.directive.js +43 -30
- package/esm2015/modal/modal.module.js +59 -31
- package/esm2015/modal/modal.service.js +9 -9
- package/esm2015/modal/ptsecurity-mosaic-modal.js +1 -3
- package/esm2015/navbar/navbar-item.component.js +111 -95
- package/esm2015/navbar/navbar.component.js +40 -30
- package/esm2015/navbar/navbar.module.js +66 -35
- package/esm2015/navbar/ptsecurity-mosaic-navbar.js +1 -2
- package/esm2015/navbar/vertical-navbar.component.js +68 -46
- package/esm2015/popover/popover-confirm.component.js +115 -0
- package/esm2015/popover/popover.component.js +180 -587
- package/esm2015/popover/popover.module.js +18 -12
- package/esm2015/popover/public-api.js +2 -1
- package/esm2015/progress-bar/progress-bar.component.js +26 -24
- package/esm2015/progress-bar/progress-bar.module.js +24 -15
- package/esm2015/progress-spinner/progress-spinner.component.js +26 -24
- package/esm2015/progress-spinner/progress-spinner.module.js +24 -15
- package/esm2015/radio/radio.component.js +87 -67
- package/esm2015/radio/radio.module.js +13 -8
- package/esm2015/select/select.component.js +181 -105
- package/esm2015/select/select.module.js +54 -28
- package/esm2015/sidebar/ptsecurity-mosaic-sidebar.js +1 -2
- package/esm2015/sidebar/sidebar.component.js +61 -50
- package/esm2015/sidebar/sidebar.module.js +25 -16
- package/esm2015/sidepanel/ptsecurity-mosaic-sidepanel.js +1 -2
- package/esm2015/sidepanel/sidepanel-container.component.js +46 -40
- package/esm2015/sidepanel/sidepanel-directives.js +87 -57
- package/esm2015/sidepanel/sidepanel.module.js +63 -30
- package/esm2015/sidepanel/sidepanel.service.js +20 -12
- package/esm2015/splitter/splitter.component.js +62 -64
- package/esm2015/splitter/splitter.module.js +32 -19
- package/esm2015/table/table.component.js +13 -9
- package/esm2015/table/table.module.js +23 -12
- package/esm2015/tabs/paginated-tab-header.js +20 -18
- package/esm2015/tabs/ptsecurity-mosaic-tabs.js +1 -6
- package/esm2015/tabs/tab-body.component.js +52 -42
- package/esm2015/tabs/tab-content.directive.js +8 -8
- package/esm2015/tabs/tab-group.component.js +145 -74
- package/esm2015/tabs/tab-header.component.js +50 -36
- package/esm2015/tabs/tab-label-wrapper.directive.js +30 -16
- package/esm2015/tabs/tab-label.directive.js +11 -7
- package/esm2015/tabs/tab-nav-bar/tab-nav-bar.js +46 -46
- package/esm2015/tabs/tab.component.js +67 -33
- package/esm2015/tabs/tabs.module.js +87 -45
- package/esm2015/tags/tag-input.js +48 -34
- package/esm2015/tags/tag-list.component.js +93 -56
- package/esm2015/tags/tag.component.js +90 -73
- package/esm2015/tags/tag.module.js +46 -29
- package/esm2015/textarea/textarea.component.js +70 -41
- package/esm2015/textarea/textarea.module.js +13 -8
- package/esm2015/timepicker/timepicker.directive.js +64 -52
- package/esm2015/timepicker/timepicker.module.js +26 -13
- package/esm2015/toggle/toggle.component.js +65 -47
- package/esm2015/toggle/toggle.module.js +13 -8
- package/esm2015/tooltip/tooltip.animations.js +19 -0
- package/esm2015/tooltip/tooltip.component.js +239 -555
- package/esm2015/tooltip/tooltip.module.js +38 -11
- package/esm2015/tree/control/base-tree-control.js +60 -0
- package/esm2015/tree/control/flat-tree-control.js +123 -0
- package/esm2015/tree/control/nested-tree-control.js +41 -0
- package/esm2015/tree/control/tree-control.js +2 -0
- package/esm2015/tree/data-source/flat-data-source.js +1 -1
- package/esm2015/tree/node.js +31 -0
- package/esm2015/tree/outlet.js +15 -0
- package/esm2015/tree/padding.directive.js +98 -25
- package/esm2015/tree/public-api.js +9 -2
- package/esm2015/tree/toggle.js +65 -70
- package/esm2015/tree/tree-base.js +243 -0
- package/esm2015/tree/tree-errors.js +36 -0
- package/esm2015/tree/tree-option.component.js +102 -56
- package/esm2015/tree/tree-selection.component.js +180 -115
- package/esm2015/tree/tree.js +23 -0
- package/esm2015/tree/tree.module.js +38 -12
- package/esm2015/tree-select/tree-select.component.js +153 -85
- package/esm2015/tree-select/tree-select.module.js +33 -18
- package/fesm2015/ptsecurity-mosaic-autocomplete.js +140 -102
- package/fesm2015/ptsecurity-mosaic-autocomplete.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-button-toggle.js +87 -63
- package/fesm2015/ptsecurity-mosaic-button-toggle.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-button.js +86 -76
- package/fesm2015/ptsecurity-mosaic-button.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-card.js +54 -42
- package/fesm2015/ptsecurity-mosaic-card.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-checkbox.js +82 -59
- package/fesm2015/ptsecurity-mosaic-checkbox.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-core.js +758 -239
- package/fesm2015/ptsecurity-mosaic-core.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-datepicker.js +544 -376
- package/fesm2015/ptsecurity-mosaic-datepicker.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-design-tokens.js +57 -16
- package/fesm2015/ptsecurity-mosaic-design-tokens.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-divider.js +34 -26
- package/fesm2015/ptsecurity-mosaic-divider.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-dropdown.js +219 -171
- package/fesm2015/ptsecurity-mosaic-dropdown.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-form-field.js +184 -119
- package/fesm2015/ptsecurity-mosaic-form-field.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-icon.js +56 -39
- package/fesm2015/ptsecurity-mosaic-icon.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-input.js +191 -116
- package/fesm2015/ptsecurity-mosaic-input.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-link.js +57 -45
- package/fesm2015/ptsecurity-mosaic-link.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-list.js +301 -177
- package/fesm2015/ptsecurity-mosaic-list.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-modal.js +243 -159
- package/fesm2015/ptsecurity-mosaic-modal.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-navbar.js +280 -205
- package/fesm2015/ptsecurity-mosaic-navbar.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-popover.js +297 -597
- package/fesm2015/ptsecurity-mosaic-popover.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-progress-bar.js +48 -38
- package/fesm2015/ptsecurity-mosaic-progress-bar.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-progress-spinner.js +48 -38
- package/fesm2015/ptsecurity-mosaic-progress-spinner.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-radio.js +99 -76
- package/fesm2015/ptsecurity-mosaic-radio.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-select.js +236 -136
- package/fesm2015/ptsecurity-mosaic-select.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-sidebar.js +85 -66
- package/fesm2015/ptsecurity-mosaic-sidebar.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-sidepanel.js +207 -139
- package/fesm2015/ptsecurity-mosaic-sidepanel.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-splitter.js +92 -82
- package/fesm2015/ptsecurity-mosaic-splitter.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-table.js +33 -19
- package/fesm2015/ptsecurity-mosaic-table.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tabs.js +557 -387
- package/fesm2015/ptsecurity-mosaic-tabs.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tags.js +273 -192
- package/fesm2015/ptsecurity-mosaic-tags.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-textarea.js +83 -50
- package/fesm2015/ptsecurity-mosaic-textarea.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-timepicker.js +87 -64
- package/fesm2015/ptsecurity-mosaic-timepicker.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-toggle.js +77 -55
- package/fesm2015/ptsecurity-mosaic-toggle.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tooltip.js +293 -566
- package/fesm2015/ptsecurity-mosaic-tooltip.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tree-select.js +188 -106
- package/fesm2015/ptsecurity-mosaic-tree-select.js.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tree.js +1001 -279
- package/fesm2015/ptsecurity-mosaic-tree.js.map +1 -1
- package/form-field/cleaner.d.ts +5 -0
- package/form-field/form-field.d.ts +5 -0
- package/form-field/form-field.module.d.ts +12 -0
- package/form-field/hint.d.ts +3 -0
- package/form-field/package.json +0 -1
- package/form-field/prefix.d.ts +3 -0
- package/form-field/ptsecurity-mosaic-form-field.d.ts +1 -0
- package/form-field/stepper.d.ts +3 -0
- package/form-field/suffix.d.ts +3 -0
- package/icon/icon.component.d.ts +5 -0
- package/icon/icon.module.d.ts +8 -0
- package/icon/package.json +0 -1
- package/icon/ptsecurity-mosaic-icon.d.ts +1 -0
- package/input/input-number-validators.d.ts +7 -2
- package/input/input-number.d.ts +3 -0
- package/input/input.d.ts +5 -0
- package/input/input.module.d.ts +11 -0
- package/input/package.json +0 -1
- package/input/ptsecurity-mosaic-input.d.ts +1 -0
- package/link/link.component.d.ts +3 -0
- package/link/link.module.d.ts +7 -0
- package/link/package.json +0 -1
- package/link/ptsecurity-mosaic-link.d.ts +1 -0
- package/list/list-selection.component.d.ts +30 -3
- package/list/list.component.d.ts +5 -0
- package/list/list.module.d.ts +9 -0
- package/list/package.json +0 -1
- package/list/ptsecurity-mosaic-list.d.ts +1 -0
- package/modal/css-unit.pipe.d.ts +3 -0
- package/modal/modal-control.service.d.ts +3 -0
- package/modal/modal.component.d.ts +5 -0
- package/modal/modal.directive.d.ts +9 -0
- package/modal/modal.module.d.ts +12 -0
- package/modal/modal.service.d.ts +3 -0
- package/modal/package.json +0 -1
- package/modal/ptsecurity-mosaic-modal.d.ts +1 -2
- package/navbar/navbar-item.component.d.ts +13 -0
- package/navbar/navbar.component.d.ts +5 -0
- package/navbar/navbar.module.d.ts +11 -0
- package/navbar/package.json +0 -1
- package/navbar/ptsecurity-mosaic-navbar.d.ts +1 -1
- package/navbar/vertical-navbar.component.d.ts +5 -0
- package/package.json +8 -9
- package/popover/package.json +0 -1
- package/popover/popover-confirm.component.d.ts +33 -0
- package/popover/popover.component.d.ts +50 -136
- package/popover/popover.module.d.ts +9 -0
- package/popover/ptsecurity-mosaic-popover.d.ts +1 -0
- package/popover/public-api.d.ts +1 -0
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/default-theme.css +1 -1
- package/prebuilt-visual/default-visual.css +1 -0
- package/progress-bar/package.json +0 -1
- package/progress-bar/progress-bar.component.d.ts +3 -0
- package/progress-bar/progress-bar.module.d.ts +7 -0
- package/progress-bar/ptsecurity-mosaic-progress-bar.d.ts +1 -0
- package/progress-spinner/package.json +0 -1
- package/progress-spinner/progress-spinner.component.d.ts +3 -0
- package/progress-spinner/progress-spinner.module.d.ts +7 -0
- package/progress-spinner/ptsecurity-mosaic-progress-spinner.d.ts +1 -0
- package/ptsecurity-mosaic.d.ts +1 -0
- package/radio/package.json +0 -1
- package/radio/ptsecurity-mosaic-radio.d.ts +1 -0
- package/radio/radio.component.d.ts +5 -0
- package/radio/radio.module.d.ts +8 -0
- package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js +6 -3
- package/schematics/ng-update/update-9.0.0/secondary-entry-points-migration.js.map +1 -1
- package/select/package.json +0 -1
- package/select/ptsecurity-mosaic-select.d.ts +1 -0
- package/select/select.component.d.ts +11 -7
- package/select/select.module.d.ts +11 -0
- package/sidebar/package.json +0 -1
- package/sidebar/ptsecurity-mosaic-sidebar.d.ts +1 -1
- package/sidebar/sidebar.component.d.ts +7 -0
- package/sidebar/sidebar.module.d.ts +6 -0
- package/sidepanel/package.json +0 -1
- package/sidepanel/ptsecurity-mosaic-sidepanel.d.ts +1 -1
- package/sidepanel/sidepanel-container.component.d.ts +3 -0
- package/sidepanel/sidepanel-directives.d.ts +13 -0
- package/sidepanel/sidepanel.module.d.ts +13 -0
- package/sidepanel/sidepanel.service.d.ts +3 -0
- package/splitter/package.json +0 -1
- package/splitter/ptsecurity-mosaic-splitter.d.ts +1 -0
- package/splitter/splitter.component.d.ts +7 -0
- package/splitter/splitter.module.d.ts +7 -0
- package/table/package.json +0 -1
- package/table/ptsecurity-mosaic-table.d.ts +1 -0
- package/table/table.component.d.ts +3 -0
- package/table/table.module.d.ts +8 -0
- package/tabs/package.json +0 -1
- package/tabs/paginated-tab-header.d.ts +3 -0
- package/tabs/ptsecurity-mosaic-tabs.d.ts +1 -5
- package/tabs/tab-body.component.d.ts +5 -0
- package/tabs/tab-content.directive.d.ts +3 -0
- package/tabs/tab-group.component.d.ts +24 -4
- package/tabs/tab-header.component.d.ts +3 -0
- package/tabs/tab-label-wrapper.directive.d.ts +9 -0
- package/tabs/tab-label.directive.d.ts +3 -0
- package/tabs/tab-nav-bar/tab-nav-bar.d.ts +5 -0
- package/tabs/tab.component.d.ts +12 -3
- package/tabs/tabs.module.d.ts +18 -0
- package/tags/package.json +0 -1
- package/tags/ptsecurity-mosaic-tags.d.ts +1 -0
- package/tags/tag-input.d.ts +3 -0
- package/tags/tag-list.component.d.ts +3 -0
- package/tags/tag.component.d.ts +9 -0
- package/tags/tag.module.d.ts +9 -0
- package/textarea/package.json +0 -1
- package/textarea/ptsecurity-mosaic-textarea.d.ts +1 -0
- package/textarea/textarea.component.d.ts +3 -0
- package/textarea/textarea.module.d.ts +9 -0
- package/timepicker/package.json +0 -1
- package/timepicker/ptsecurity-mosaic-timepicker.d.ts +1 -0
- package/timepicker/timepicker.directive.d.ts +5 -2
- package/timepicker/timepicker.module.d.ts +9 -0
- package/toggle/package.json +0 -1
- package/toggle/ptsecurity-mosaic-toggle.d.ts +1 -0
- package/toggle/toggle.component.d.ts +3 -0
- package/toggle/toggle.module.d.ts +8 -0
- package/tooltip/package.json +0 -1
- package/tooltip/ptsecurity-mosaic-tooltip.d.ts +1 -0
- package/tooltip/tooltip.animations.d.ts +8 -0
- package/tooltip/tooltip.component.d.ts +74 -134
- package/tooltip/tooltip.module.d.ts +7 -0
- package/tree/control/base-tree-control.d.ts +40 -0
- package/tree/control/flat-tree-control.d.ts +48 -0
- package/tree/control/nested-tree-control.d.ts +19 -0
- package/tree/control/tree-control.d.ts +44 -0
- package/tree/data-source/flat-data-source.d.ts +2 -1
- package/tree/node.d.ts +34 -0
- package/tree/outlet.d.ts +9 -0
- package/tree/package.json +0 -1
- package/tree/padding.directive.d.ts +36 -5
- package/tree/ptsecurity-mosaic-tree.d.ts +1 -0
- package/tree/public-api.d.ts +8 -1
- package/tree/toggle.d.ts +20 -15
- package/tree/tree-base.d.ts +97 -0
- package/tree/tree-errors.d.ts +25 -0
- package/tree/tree-option.component.d.ts +15 -4
- package/tree/tree-selection.component.d.ts +46 -24
- package/tree/tree.d.ts +6 -0
- package/tree/tree.module.d.ts +14 -0
- package/tree-select/package.json +0 -1
- package/tree-select/ptsecurity-mosaic-tree-select.d.ts +1 -0
- package/tree-select/tree-select.component.d.ts +8 -8
- package/tree-select/tree-select.module.d.ts +11 -0
- package/autocomplete/ptsecurity-mosaic-autocomplete.metadata.json +0 -1
- package/bundles/ptsecurity-mosaic-autocomplete.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-autocomplete.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-button-toggle.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-button-toggle.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-button.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-button.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-card.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-card.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-checkbox.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-checkbox.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-core.umd.min.js +0 -17
- package/bundles/ptsecurity-mosaic-core.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-datepicker.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-datepicker.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-design-tokens.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-design-tokens.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-divider.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-divider.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-dropdown.umd.min.js +0 -17
- package/bundles/ptsecurity-mosaic-dropdown.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-form-field.umd.min.js +0 -17
- package/bundles/ptsecurity-mosaic-form-field.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-icon.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-icon.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-input.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-input.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-link.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-link.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-list.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-list.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-modal.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-modal.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-navbar.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-navbar.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-popover.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-popover.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-progress-bar.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-progress-bar.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-progress-spinner.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-progress-spinner.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-radio.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-radio.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-select.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-select.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-sidebar.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-sidebar.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-sidepanel.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-sidepanel.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-splitter.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-splitter.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-table.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-table.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tabs.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-tabs.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tags.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-tags.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-textarea.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-textarea.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-timepicker.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic-timepicker.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-toggle.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-toggle.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tooltip.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-tooltip.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tree-select.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-tree-select.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic-tree.umd.min.js +0 -16
- package/bundles/ptsecurity-mosaic-tree.umd.min.js.map +0 -1
- package/bundles/ptsecurity-mosaic.umd.min.js +0 -2
- package/bundles/ptsecurity-mosaic.umd.min.js.map +0 -1
- package/button/ptsecurity-mosaic-button.metadata.json +0 -1
- package/button-toggle/ptsecurity-mosaic-button-toggle.metadata.json +0 -1
- package/card/ptsecurity-mosaic-card.metadata.json +0 -1
- package/checkbox/ptsecurity-mosaic-checkbox.metadata.json +0 -1
- package/core/ptsecurity-mosaic-core.metadata.json +0 -1
- package/datepicker/ptsecurity-mosaic-datepicker.metadata.json +0 -1
- package/design-tokens/ptsecurity-mosaic-design-tokens.metadata.json +0 -1
- package/divider/ptsecurity-mosaic-divider.metadata.json +0 -1
- package/dropdown/ptsecurity-mosaic-dropdown.metadata.json +0 -1
- package/esm2015/tree/node.directive.js +0 -15
- package/form-field/ptsecurity-mosaic-form-field.metadata.json +0 -1
- package/icon/ptsecurity-mosaic-icon.metadata.json +0 -1
- package/input/ptsecurity-mosaic-input.metadata.json +0 -1
- package/link/ptsecurity-mosaic-link.metadata.json +0 -1
- package/list/ptsecurity-mosaic-list.metadata.json +0 -1
- package/modal/ptsecurity-mosaic-modal.metadata.json +0 -1
- package/navbar/ptsecurity-mosaic-navbar.metadata.json +0 -1
- package/popover/ptsecurity-mosaic-popover.metadata.json +0 -1
- package/progress-bar/ptsecurity-mosaic-progress-bar.metadata.json +0 -1
- package/progress-spinner/ptsecurity-mosaic-progress-spinner.metadata.json +0 -1
- package/ptsecurity-mosaic.metadata.json +0 -1
- package/radio/ptsecurity-mosaic-radio.metadata.json +0 -1
- package/select/ptsecurity-mosaic-select.metadata.json +0 -1
- package/sidebar/ptsecurity-mosaic-sidebar.metadata.json +0 -1
- package/sidepanel/ptsecurity-mosaic-sidepanel.metadata.json +0 -1
- package/splitter/ptsecurity-mosaic-splitter.metadata.json +0 -1
- package/table/ptsecurity-mosaic-table.metadata.json +0 -1
- package/tabs/ptsecurity-mosaic-tabs.metadata.json +0 -1
- package/tags/ptsecurity-mosaic-tags.metadata.json +0 -1
- package/textarea/ptsecurity-mosaic-textarea.metadata.json +0 -1
- package/timepicker/ptsecurity-mosaic-timepicker.metadata.json +0 -1
- package/toggle/ptsecurity-mosaic-toggle.metadata.json +0 -1
- package/tooltip/ptsecurity-mosaic-tooltip.metadata.json +0 -1
- package/tree/node.directive.d.ts +0 -4
- package/tree/ptsecurity-mosaic-tree.metadata.json +0 -1
- package/tree-select/ptsecurity-mosaic-tree-select.metadata.json +0 -1
@@ -1,8 +1,490 @@
|
|
1
1
|
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@ptsecurity/cdk/
|
3
|
-
typeof define === 'function' && define.amd ? define('@ptsecurity/mosaic/tree', ['exports', '@angular/common', '@angular/core', '@ptsecurity/cdk/
|
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.
|
5
|
-
}(this, (function (exports,
|
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 () { return e[k]; }
|
17
|
+
});
|
18
|
+
}
|
19
|
+
});
|
20
|
+
}
|
21
|
+
n["default"] = e;
|
22
|
+
return Object.freeze(n);
|
23
|
+
}
|
24
|
+
|
25
|
+
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
26
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
27
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
28
|
+
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
29
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
30
|
+
|
31
|
+
/** Context provided to the tree node component. */
|
32
|
+
var McTreeNodeOutletContext = /** @class */ (function () {
|
33
|
+
function McTreeNodeOutletContext(data) {
|
34
|
+
this.$implicit = data;
|
35
|
+
}
|
36
|
+
return McTreeNodeOutletContext;
|
37
|
+
}());
|
38
|
+
/**
|
39
|
+
* Data node definition for the McTree.
|
40
|
+
* Captures the node's template and a when predicate that describes when this node should be used.
|
41
|
+
*/
|
42
|
+
var McTreeNodeDef = /** @class */ (function () {
|
43
|
+
/** @docs-private */
|
44
|
+
function McTreeNodeDef(template) {
|
45
|
+
this.template = template;
|
46
|
+
}
|
47
|
+
return McTreeNodeDef;
|
48
|
+
}());
|
49
|
+
/** @nocollapse */ McTreeNodeDef.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeDef, deps: [{ token: i0__namespace.TemplateRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
50
|
+
/** @nocollapse */ McTreeNodeDef.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: McTreeNodeDef, selector: "[mcTreeNodeDef]", inputs: { when: ["mcTreeNodeDefWhen", "when"], data: ["mcTreeNode", "data"] }, ngImport: i0__namespace });
|
51
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeDef, decorators: [{
|
52
|
+
type: i0.Directive,
|
53
|
+
args: [{
|
54
|
+
selector: '[mcTreeNodeDef]',
|
55
|
+
inputs: ['when: mcTreeNodeDefWhen']
|
56
|
+
}]
|
57
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.TemplateRef }]; }, propDecorators: { data: [{
|
58
|
+
type: i0.Input,
|
59
|
+
args: ['mcTreeNode']
|
60
|
+
}] } });
|
61
|
+
|
62
|
+
var McTreeNodeOutlet = /** @class */ (function () {
|
63
|
+
function McTreeNodeOutlet(viewContainer, changeDetectorRef) {
|
64
|
+
this.viewContainer = viewContainer;
|
65
|
+
this.changeDetectorRef = changeDetectorRef;
|
66
|
+
}
|
67
|
+
return McTreeNodeOutlet;
|
68
|
+
}());
|
69
|
+
/** @nocollapse */ McTreeNodeOutlet.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeOutlet, deps: [{ token: i0__namespace.ViewContainerRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
70
|
+
/** @nocollapse */ McTreeNodeOutlet.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: McTreeNodeOutlet, selector: "[mcTreeNodeOutlet]", ngImport: i0__namespace });
|
71
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeOutlet, decorators: [{
|
72
|
+
type: i0.Directive,
|
73
|
+
args: [{ selector: '[mcTreeNodeOutlet]' }]
|
74
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ViewContainerRef }, { type: i0__namespace.ChangeDetectorRef }]; } });
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Returns an error to be thrown when there is no usable data.
|
78
|
+
* @docs-private
|
79
|
+
*/
|
80
|
+
function getTreeNoValidDataSourceError() {
|
81
|
+
return Error("A valid data source must be provided.");
|
82
|
+
}
|
83
|
+
/**
|
84
|
+
* Returns an error to be thrown when there are multiple nodes that are missing a when function.
|
85
|
+
* @docs-private
|
86
|
+
*/
|
87
|
+
function getTreeMultipleDefaultNodeDefsError() {
|
88
|
+
return Error("There can only be one default row without a when predicate function.");
|
89
|
+
}
|
90
|
+
/**
|
91
|
+
* Returns an error to be thrown when there are no matching node defs for a particular set of data.
|
92
|
+
* @docs-private
|
93
|
+
*/
|
94
|
+
function getTreeMissingMatchingNodeDefError() {
|
95
|
+
return Error("Could not find a matching node definition for the provided node data.");
|
96
|
+
}
|
97
|
+
/**
|
98
|
+
* Returns an error to be thrown when there are tree control.
|
99
|
+
* @docs-private
|
100
|
+
*/
|
101
|
+
function getTreeControlMissingError() {
|
102
|
+
return Error("Could not find a tree control for the tree.");
|
103
|
+
}
|
104
|
+
/**
|
105
|
+
* Returns an error to be thrown when tree control did not implement functions for flat/nested node.
|
106
|
+
* @docs-private
|
107
|
+
*/
|
108
|
+
function getTreeControlFunctionsMissingError() {
|
109
|
+
return Error("Could not find functions for nested/flat tree in tree control.");
|
110
|
+
}
|
111
|
+
|
112
|
+
var McTreeBase = /** @class */ (function () {
|
113
|
+
function McTreeBase(differs, changeDetectorRef) {
|
114
|
+
this.differs = differs;
|
115
|
+
this.changeDetectorRef = changeDetectorRef;
|
116
|
+
// TODO(tinayuangao): Setup a listener for scrolling, emit the calculated view to viewChange.
|
117
|
+
// Remove the MAX_VALUE in viewChange
|
118
|
+
/**
|
119
|
+
* Stream containing the latest information on what rows are being displayed on screen.
|
120
|
+
* Can be used by the data source to as a heuristic of what data should be provided.
|
121
|
+
*/
|
122
|
+
this.viewChange = new rxjs.BehaviorSubject({ start: 0, end: Number.MAX_VALUE });
|
123
|
+
/** Subject that emits when the component has been destroyed. */
|
124
|
+
this.onDestroy = new rxjs.Subject();
|
125
|
+
/** Level of nodes */
|
126
|
+
this.levels = new Map();
|
127
|
+
}
|
128
|
+
Object.defineProperty(McTreeBase.prototype, "dataSource", {
|
129
|
+
/**
|
130
|
+
* Provides a stream containing the latest data array to render. Influenced by the tree's
|
131
|
+
* stream of view window (what dataNodes are currently on screen).
|
132
|
+
* Data source can be an observable of data array, or a dara array to render.
|
133
|
+
*/
|
134
|
+
get: function () {
|
135
|
+
return this._dataSource;
|
136
|
+
},
|
137
|
+
set: function (dataSource) {
|
138
|
+
if (this._dataSource !== dataSource) {
|
139
|
+
this.switchDataSource(dataSource);
|
140
|
+
}
|
141
|
+
},
|
142
|
+
enumerable: false,
|
143
|
+
configurable: true
|
144
|
+
});
|
145
|
+
McTreeBase.prototype.ngOnInit = function () {
|
146
|
+
this.dataDiffer = this.differs.find([]).create(this.trackBy);
|
147
|
+
if (!this.treeControl) {
|
148
|
+
throw getTreeControlMissingError();
|
149
|
+
}
|
150
|
+
};
|
151
|
+
McTreeBase.prototype.ngOnDestroy = function () {
|
152
|
+
this.nodeOutlet.viewContainer.clear();
|
153
|
+
this.onDestroy.next();
|
154
|
+
this.onDestroy.complete();
|
155
|
+
// tslint:disable-next-line:no-unbound-method
|
156
|
+
if (this._dataSource && typeof this.dataSource.disconnect === 'function') {
|
157
|
+
this.dataSource.disconnect(this);
|
158
|
+
}
|
159
|
+
if (this.dataSubscription) {
|
160
|
+
this.dataSubscription.unsubscribe();
|
161
|
+
this.dataSubscription = null;
|
162
|
+
}
|
163
|
+
};
|
164
|
+
McTreeBase.prototype.ngAfterContentChecked = function () {
|
165
|
+
var defaultNodeDefs = this.nodeDefs.filter(function (def) { return !def.when; });
|
166
|
+
if (defaultNodeDefs.length > 1) {
|
167
|
+
throw getTreeMultipleDefaultNodeDefsError();
|
168
|
+
}
|
169
|
+
this.defaultNodeDef = defaultNodeDefs[0];
|
170
|
+
if (this.dataSource && this.nodeDefs && !this.dataSubscription) {
|
171
|
+
this.observeRenderChanges();
|
172
|
+
}
|
173
|
+
};
|
174
|
+
/** Check for changes made in the data and render each change (node added/removed/moved). */
|
175
|
+
McTreeBase.prototype.renderNodeChanges = function (data, dataDiffer, viewContainer, parentData) {
|
176
|
+
var _this = this;
|
177
|
+
if (dataDiffer === void 0) { dataDiffer = this.dataDiffer; }
|
178
|
+
if (viewContainer === void 0) { viewContainer = this.nodeOutlet.viewContainer; }
|
179
|
+
var changes = dataDiffer.diff(data);
|
180
|
+
if (!changes) {
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
changes.forEachOperation(function (item, adjustedPreviousIndex, currentIndex) {
|
184
|
+
if (item.previousIndex == null) {
|
185
|
+
_this.insertNode(data[currentIndex], currentIndex, viewContainer, parentData);
|
186
|
+
}
|
187
|
+
else if (currentIndex == null) {
|
188
|
+
viewContainer.remove(adjustedPreviousIndex);
|
189
|
+
_this.levels.delete(item.item);
|
190
|
+
}
|
191
|
+
else {
|
192
|
+
var view = viewContainer.get(adjustedPreviousIndex);
|
193
|
+
viewContainer.move(view, currentIndex);
|
194
|
+
}
|
195
|
+
});
|
196
|
+
this.changeDetectorRef.detectChanges();
|
197
|
+
};
|
198
|
+
/**
|
199
|
+
* Finds the matching node definition that should be used for this node data. If there is only
|
200
|
+
* one node definition, it is returned. Otherwise, find the node definition that has a when
|
201
|
+
* predicate that returns true with the data. If none return true, return the default node
|
202
|
+
* definition.
|
203
|
+
*/
|
204
|
+
McTreeBase.prototype.getNodeDef = function (data, i) {
|
205
|
+
if (this.nodeDefs.length === 1) {
|
206
|
+
return this.nodeDefs.first;
|
207
|
+
}
|
208
|
+
var nodeDef = this.nodeDefs.find(function (def) { return def.when && def.when(i, data); }) || this.defaultNodeDef;
|
209
|
+
if (!nodeDef) {
|
210
|
+
throw getTreeMissingMatchingNodeDefError();
|
211
|
+
}
|
212
|
+
return nodeDef;
|
213
|
+
};
|
214
|
+
/**
|
215
|
+
* Create the embedded view for the data node template and place it in the correct index location
|
216
|
+
* within the data node view container.
|
217
|
+
*/
|
218
|
+
McTreeBase.prototype.insertNode = function (nodeData, index, viewContainer, parentData) {
|
219
|
+
var node = this.getNodeDef(nodeData, index);
|
220
|
+
// Node context that will be provided to created embedded view
|
221
|
+
var context = new McTreeNodeOutletContext(nodeData);
|
222
|
+
// If the tree is flat tree, then use the `getLevel` function in flat tree control
|
223
|
+
// Otherwise, use the level of parent node.
|
224
|
+
if (this.treeControl.getLevel) {
|
225
|
+
context.level = this.treeControl.getLevel(nodeData);
|
226
|
+
/* tslint:disable-next-line:no-typeof-undefined */
|
227
|
+
}
|
228
|
+
else if (typeof parentData !== 'undefined' && this.levels.has(parentData)) {
|
229
|
+
context.level = this.levels.get(parentData) + 1;
|
230
|
+
}
|
231
|
+
else {
|
232
|
+
context.level = 0;
|
233
|
+
}
|
234
|
+
this.levels.set(nodeData, context.level);
|
235
|
+
// Use default tree nodeOutlet, or nested node's nodeOutlet
|
236
|
+
var container = viewContainer ? viewContainer : this.nodeOutlet.viewContainer;
|
237
|
+
container.createEmbeddedView(node.template, context, index);
|
238
|
+
// Set the data to just created `McTreeNode`.
|
239
|
+
// The `McTreeNode` created from `createEmbeddedView` will be saved in static variable
|
240
|
+
// `mostRecentTreeNode`. We get it from static variable and pass the node data to it.
|
241
|
+
if (McTreeNode.mostRecentTreeNode) {
|
242
|
+
McTreeNode.mostRecentTreeNode.data = nodeData;
|
243
|
+
}
|
244
|
+
};
|
245
|
+
/** Set up a subscription for the data provided by the data source. */
|
246
|
+
McTreeBase.prototype.observeRenderChanges = function () {
|
247
|
+
var _this = this;
|
248
|
+
var dataStream;
|
249
|
+
// Cannot use `instanceof DataSource` since the data source could be a literal with
|
250
|
+
// `connect` function and may not extends DataSource.
|
251
|
+
// tslint:disable-next-line:no-unbound-method
|
252
|
+
if (typeof this._dataSource.connect === 'function') {
|
253
|
+
dataStream = this._dataSource.connect(this);
|
254
|
+
}
|
255
|
+
else if (this._dataSource instanceof rxjs.Observable) {
|
256
|
+
dataStream = this._dataSource;
|
257
|
+
}
|
258
|
+
else if (Array.isArray(this._dataSource)) {
|
259
|
+
dataStream = rxjs.of(this._dataSource);
|
260
|
+
}
|
261
|
+
if (dataStream) {
|
262
|
+
this.dataSubscription = dataStream
|
263
|
+
.pipe(operators.takeUntil(this.onDestroy))
|
264
|
+
.subscribe(function (data) { return _this.renderNodeChanges(data); });
|
265
|
+
}
|
266
|
+
else {
|
267
|
+
throw getTreeNoValidDataSourceError();
|
268
|
+
}
|
269
|
+
};
|
270
|
+
/**
|
271
|
+
* Switch to the provided data source by resetting the data and unsubscribing from the current
|
272
|
+
* render change subscription if one exists. If the data source is null, interpret this by
|
273
|
+
* clearing the node outlet. Otherwise start listening for new data.
|
274
|
+
*/
|
275
|
+
McTreeBase.prototype.switchDataSource = function (dataSource) {
|
276
|
+
// tslint:disable-next-line:no-unbound-method
|
277
|
+
if (this._dataSource && typeof this._dataSource.disconnect === 'function') {
|
278
|
+
this.dataSource.disconnect(this);
|
279
|
+
}
|
280
|
+
if (this.dataSubscription) {
|
281
|
+
this.dataSubscription.unsubscribe();
|
282
|
+
this.dataSubscription = null;
|
283
|
+
}
|
284
|
+
// Remove the all dataNodes if there is now no data source
|
285
|
+
if (!dataSource) {
|
286
|
+
this.nodeOutlet.viewContainer.clear();
|
287
|
+
}
|
288
|
+
this._dataSource = dataSource;
|
289
|
+
if (this.nodeDefs) {
|
290
|
+
this.observeRenderChanges();
|
291
|
+
}
|
292
|
+
};
|
293
|
+
return McTreeBase;
|
294
|
+
}());
|
295
|
+
/** @nocollapse */ McTreeBase.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeBase, deps: [{ token: i0__namespace.IterableDiffers }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
296
|
+
/** @nocollapse */ McTreeBase.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", 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 });
|
297
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeBase, decorators: [{
|
298
|
+
type: i0.Directive
|
299
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.IterableDiffers }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { treeControl: [{
|
300
|
+
type: i0.Input
|
301
|
+
}], trackBy: [{
|
302
|
+
type: i0.Input
|
303
|
+
}], nodeOutlet: [{
|
304
|
+
type: i0.ViewChild,
|
305
|
+
args: [McTreeNodeOutlet, { static: true }]
|
306
|
+
}], nodeDefs: [{
|
307
|
+
type: i0.ContentChildren,
|
308
|
+
args: [McTreeNodeDef]
|
309
|
+
}], dataSource: [{
|
310
|
+
type: i0.Input
|
311
|
+
}] } });
|
312
|
+
var McTreeNode = /** @class */ (function () {
|
313
|
+
function McTreeNode(elementRef, tree) {
|
314
|
+
this.elementRef = elementRef;
|
315
|
+
this.tree = tree;
|
316
|
+
this.destroyed = new rxjs.Subject();
|
317
|
+
McTreeNode.mostRecentTreeNode = this;
|
318
|
+
}
|
319
|
+
Object.defineProperty(McTreeNode.prototype, "data", {
|
320
|
+
get: function () {
|
321
|
+
return this._data;
|
322
|
+
},
|
323
|
+
set: function (value) {
|
324
|
+
this._data = value;
|
325
|
+
},
|
326
|
+
enumerable: false,
|
327
|
+
configurable: true
|
328
|
+
});
|
329
|
+
Object.defineProperty(McTreeNode.prototype, "isExpanded", {
|
330
|
+
get: function () {
|
331
|
+
return this.tree.treeControl.isExpanded(this.data);
|
332
|
+
},
|
333
|
+
enumerable: false,
|
334
|
+
configurable: true
|
335
|
+
});
|
336
|
+
Object.defineProperty(McTreeNode.prototype, "level", {
|
337
|
+
get: function () {
|
338
|
+
return this.tree.treeControl.getLevel ? this.tree.treeControl.getLevel(this._data) : 0;
|
339
|
+
},
|
340
|
+
enumerable: false,
|
341
|
+
configurable: true
|
342
|
+
});
|
343
|
+
McTreeNode.prototype.ngOnDestroy = function () {
|
344
|
+
this.destroyed.next();
|
345
|
+
this.destroyed.complete();
|
346
|
+
};
|
347
|
+
McTreeNode.prototype.focus = function () {
|
348
|
+
this.elementRef.nativeElement.focus();
|
349
|
+
};
|
350
|
+
return McTreeNode;
|
351
|
+
}());
|
352
|
+
/**
|
353
|
+
* The most recently created `McTreeNode`. We save it in static variable so we can retrieve it
|
354
|
+
* in `McTree` and set the data to it.
|
355
|
+
*/
|
356
|
+
McTreeNode.mostRecentTreeNode = null;
|
357
|
+
/** @nocollapse */ McTreeNode.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNode, deps: [{ token: i0__namespace.ElementRef }, { token: i0.forwardRef(function () { return McTreeBase; }) }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
358
|
+
/** @nocollapse */ McTreeNode.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: McTreeNode, selector: "mc-tree-node", exportAs: ["mcTreeNode"], ngImport: i0__namespace });
|
359
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNode, decorators: [{
|
360
|
+
type: i0.Directive,
|
361
|
+
args: [{
|
362
|
+
selector: 'mc-tree-node',
|
363
|
+
exportAs: 'mcTreeNode'
|
364
|
+
}]
|
365
|
+
}], ctorParameters: function () {
|
366
|
+
return [{ type: i0__namespace.ElementRef }, { type: McTreeBase, decorators: [{
|
367
|
+
type: i0.Inject,
|
368
|
+
args: [i0.forwardRef(function () { return McTreeBase; })]
|
369
|
+
}] }];
|
370
|
+
} });
|
371
|
+
|
372
|
+
/** Regex used to split a string on its CSS units. */
|
373
|
+
var cssUnitPattern = /([A-Za-z%]+)$/;
|
374
|
+
var McTreeNodePadding = /** @class */ (function () {
|
375
|
+
function McTreeNodePadding(treeNode, tree, renderer, element, dir) {
|
376
|
+
var _this = this;
|
377
|
+
var _a, _b;
|
378
|
+
this.treeNode = treeNode;
|
379
|
+
this.tree = tree;
|
380
|
+
this.renderer = renderer;
|
381
|
+
this.element = element;
|
382
|
+
this.dir = dir;
|
383
|
+
this._indent = 20;
|
384
|
+
/** CSS units used for the indentation value. */
|
385
|
+
this.indentUnits = 'px';
|
386
|
+
this.baseLeftPadding = parseInt(designTokens.TreeSizePaddingLeft);
|
387
|
+
this.iconWidth = 24;
|
388
|
+
this.destroyed = new rxjs.Subject();
|
389
|
+
(_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(); });
|
390
|
+
}
|
391
|
+
Object.defineProperty(McTreeNodePadding.prototype, "level", {
|
392
|
+
get: function () {
|
393
|
+
return this._level;
|
394
|
+
},
|
395
|
+
set: function (value) {
|
396
|
+
this.setLevelInput(value);
|
397
|
+
},
|
398
|
+
enumerable: false,
|
399
|
+
configurable: true
|
400
|
+
});
|
401
|
+
Object.defineProperty(McTreeNodePadding.prototype, "indent", {
|
402
|
+
get: function () {
|
403
|
+
return this._indent;
|
404
|
+
},
|
405
|
+
set: function (indent) {
|
406
|
+
this.setIndentInput(indent);
|
407
|
+
},
|
408
|
+
enumerable: false,
|
409
|
+
configurable: true
|
410
|
+
});
|
411
|
+
Object.defineProperty(McTreeNodePadding.prototype, "leftPadding", {
|
412
|
+
get: function () {
|
413
|
+
return (this.withIcon ? 0 : this.iconWidth) + this.baseLeftPadding;
|
414
|
+
},
|
415
|
+
enumerable: false,
|
416
|
+
configurable: true
|
417
|
+
});
|
418
|
+
McTreeNodePadding.prototype.ngOnInit = function () {
|
419
|
+
this.withIcon = this.tree.treeControl.isExpandable(this.treeNode.data);
|
420
|
+
this.setPadding();
|
421
|
+
};
|
422
|
+
McTreeNodePadding.prototype.ngOnDestroy = function () {
|
423
|
+
this.destroyed.next();
|
424
|
+
this.destroyed.complete();
|
425
|
+
};
|
426
|
+
McTreeNodePadding.prototype.paddingIndent = function () {
|
427
|
+
var nodeLevel = (this.treeNode.data && this.tree.treeControl.getLevel)
|
428
|
+
? this.tree.treeControl.getLevel(this.treeNode.data)
|
429
|
+
: 0;
|
430
|
+
var level = this.level || nodeLevel;
|
431
|
+
return level > 0 ? (level * this._indent) + this.leftPadding + "px" : this.leftPadding + "px";
|
432
|
+
};
|
433
|
+
/**
|
434
|
+
* This has been extracted to a util because of TS 4 and VE.
|
435
|
+
* View Engine doesn't support property rename inheritance.
|
436
|
+
* TS 4.0 doesn't allow properties to override accessors or vice-versa.
|
437
|
+
* @docs-private
|
438
|
+
*/
|
439
|
+
McTreeNodePadding.prototype.setLevelInput = function (value) {
|
440
|
+
// Set to null as the fallback value so that _setPadding can fall back to the node level if the
|
441
|
+
// consumer set the directive as `mcTreeNodePadding=""`. We still want to take this value if
|
442
|
+
// they set 0 explicitly.
|
443
|
+
this._level = coercion.coerceNumberProperty(value, null);
|
444
|
+
this.setPadding();
|
445
|
+
};
|
446
|
+
/**
|
447
|
+
* This has been extracted to a util because of TS 4 and VE.
|
448
|
+
* View Engine doesn't support property rename inheritance.
|
449
|
+
* TS 4.0 doesn't allow properties to override accessors or vice-versa.
|
450
|
+
* @docs-private
|
451
|
+
*/
|
452
|
+
McTreeNodePadding.prototype.setIndentInput = function (indent) {
|
453
|
+
var value = indent;
|
454
|
+
var units = 'px';
|
455
|
+
if (typeof indent === 'string') {
|
456
|
+
var parts = indent.split(cssUnitPattern);
|
457
|
+
value = parts[0];
|
458
|
+
units = parts[1] || units;
|
459
|
+
}
|
460
|
+
this.indentUnits = units;
|
461
|
+
this._indent = coercion.coerceNumberProperty(value);
|
462
|
+
this.setPadding();
|
463
|
+
};
|
464
|
+
McTreeNodePadding.prototype.setPadding = function () {
|
465
|
+
var _a;
|
466
|
+
var padding = this.paddingIndent();
|
467
|
+
var paddingProp = ((_a = this.dir) === null || _a === void 0 ? void 0 : _a.value) === 'rtl' ? 'paddingRight' : 'paddingLeft';
|
468
|
+
this.renderer.setStyle(this.element.nativeElement, paddingProp, padding);
|
469
|
+
};
|
470
|
+
return McTreeNodePadding;
|
471
|
+
}());
|
472
|
+
/** @nocollapse */ McTreeNodePadding.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", 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 });
|
473
|
+
/** @nocollapse */ McTreeNodePadding.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: McTreeNodePadding, selector: "[mcTreeNodePadding]", inputs: { indent: ["mcTreeNodePaddingIndent", "indent"] }, exportAs: ["mcTreeNodePadding"], ngImport: i0__namespace });
|
474
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodePadding, decorators: [{
|
475
|
+
type: i0.Directive,
|
476
|
+
args: [{
|
477
|
+
selector: '[mcTreeNodePadding]',
|
478
|
+
exportAs: 'mcTreeNodePadding'
|
479
|
+
}]
|
480
|
+
}], ctorParameters: function () {
|
481
|
+
return [{ type: McTreeNode }, { type: McTreeBase }, { type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: i2__namespace.Directionality, decorators: [{
|
482
|
+
type: i0.Optional
|
483
|
+
}] }];
|
484
|
+
}, propDecorators: { indent: [{
|
485
|
+
type: i0.Input,
|
486
|
+
args: ['mcTreeNodePaddingIndent']
|
487
|
+
}] } });
|
6
488
|
|
7
489
|
/*! *****************************************************************************
|
8
490
|
Copyright (c) Microsoft Corporation.
|
@@ -322,184 +804,140 @@
|
|
322
804
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
323
805
|
}
|
324
806
|
|
325
|
-
var
|
326
|
-
|
327
|
-
function McTreeNodeDef() {
|
328
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
329
|
-
}
|
330
|
-
return McTreeNodeDef;
|
331
|
-
}(tree.CdkTreeNodeDef));
|
332
|
-
McTreeNodeDef.decorators = [
|
333
|
-
{ type: core.Directive, args: [{
|
334
|
-
selector: '[mcTreeNodeDef]',
|
335
|
-
inputs: ['when: mcTreeNodeDefWhen'],
|
336
|
-
providers: [{ provide: tree.CdkTreeNodeDef, useExisting: McTreeNodeDef }]
|
337
|
-
},] }
|
338
|
-
];
|
339
|
-
McTreeNodeDef.propDecorators = {
|
340
|
-
data: [{ type: core.Input, args: ['mcTreeNode',] }]
|
341
|
-
};
|
342
|
-
|
343
|
-
var McTreeNodePadding = /** @class */ (function (_super) {
|
344
|
-
__extends(McTreeNodePadding, _super);
|
345
|
-
function McTreeNodePadding() {
|
346
|
-
var _this = _super.apply(this, __spread(arguments)) || this;
|
347
|
-
_this.baseLeftPadding = 12;
|
348
|
-
_this.iconWidth = 20;
|
349
|
-
return _this;
|
807
|
+
var McTreeNodeToggleBase = /** @class */ (function () {
|
808
|
+
function McTreeNodeToggleBase() {
|
350
809
|
}
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
get: function () {
|
365
|
-
return (this.withIcon ? 0 : this.iconWidth) + this.baseLeftPadding;
|
366
|
-
},
|
367
|
-
enumerable: false,
|
368
|
-
configurable: true
|
369
|
-
});
|
370
|
-
McTreeNodePadding.prototype.paddingIndent = function () {
|
371
|
-
var nodeLevel = (this.treeNode.data && this.tree.treeControl.getLevel)
|
372
|
-
? this.tree.treeControl.getLevel(this.treeNode.data)
|
373
|
-
: 0;
|
374
|
-
var level = this.level || nodeLevel;
|
375
|
-
return level > 0 ? (level * this._indent) + this.leftPadding + "px" : this.leftPadding + "px";
|
376
|
-
};
|
377
|
-
McTreeNodePadding.prototype.ngOnInit = function () {
|
378
|
-
this.withIcon = this.tree.treeControl.isExpandable(this.treeNode.data);
|
379
|
-
this.setPadding();
|
380
|
-
};
|
381
|
-
return McTreeNodePadding;
|
382
|
-
}(tree.CdkTreeNodePadding));
|
383
|
-
McTreeNodePadding.decorators = [
|
384
|
-
{ type: core.Directive, args: [{
|
385
|
-
selector: '[mcTreeNodePadding]',
|
386
|
-
providers: [{ provide: tree.CdkTreeNodePadding, useExisting: McTreeNodePadding }]
|
387
|
-
},] }
|
388
|
-
];
|
389
|
-
McTreeNodePadding.propDecorators = {
|
390
|
-
level: [{ type: core.Input, args: ['mcTreeNodePadding',] }],
|
391
|
-
indent: [{ type: core.Input, args: ['mcTreeNodePaddingIndent',] }]
|
392
|
-
};
|
393
|
-
|
394
|
-
var McTreeNodeToggleComponent = /** @class */ (function () {
|
395
|
-
function McTreeNodeToggleComponent(tree, treeNode) {
|
396
|
-
var _this = this;
|
397
|
-
this.tree = tree;
|
398
|
-
this.treeNode = treeNode;
|
399
|
-
this.disabled = false;
|
400
|
-
this._recursive = false;
|
401
|
-
this.tree.treeControl.filterValue
|
810
|
+
return McTreeNodeToggleBase;
|
811
|
+
}());
|
812
|
+
// tslint:disable-next-line:naming-convention
|
813
|
+
var McTreeNodeToggleMixinBase = i1.mixinDisabled(McTreeNodeToggleBase);
|
814
|
+
/** @docs-private */
|
815
|
+
var McTreeNodeToggleBaseDirective = /** @class */ (function (_super) {
|
816
|
+
__extends(McTreeNodeToggleBaseDirective, _super);
|
817
|
+
function McTreeNodeToggleBaseDirective(tree, treeNode) {
|
818
|
+
var _this = _super.call(this) || this;
|
819
|
+
_this.tree = tree;
|
820
|
+
_this.treeNode = treeNode;
|
821
|
+
_this._recursive = false;
|
822
|
+
_this.tree.treeControl.filterValue
|
402
823
|
.pipe(operators.map(function (value) { return (value === null || value === void 0 ? void 0 : value.length) > 0; }))
|
403
824
|
.subscribe(function (state) { return _this.disabled = state; });
|
825
|
+
return _this;
|
404
826
|
}
|
405
|
-
Object.defineProperty(
|
827
|
+
Object.defineProperty(McTreeNodeToggleBaseDirective.prototype, "recursive", {
|
406
828
|
get: function () {
|
407
829
|
return this._recursive;
|
408
830
|
},
|
409
831
|
set: function (value) {
|
410
|
-
this._recursive = value;
|
832
|
+
this._recursive = coercion.coerceBooleanProperty(value);
|
411
833
|
},
|
412
834
|
enumerable: false,
|
413
835
|
configurable: true
|
414
836
|
});
|
415
|
-
Object.defineProperty(
|
837
|
+
Object.defineProperty(McTreeNodeToggleBaseDirective.prototype, "iconState", {
|
416
838
|
get: function () {
|
417
|
-
return this.
|
839
|
+
return this.tree.treeControl.isExpanded(this.node);
|
418
840
|
},
|
419
841
|
enumerable: false,
|
420
842
|
configurable: true
|
421
843
|
});
|
422
|
-
|
844
|
+
McTreeNodeToggleBaseDirective.prototype.toggle = function (event) {
|
845
|
+
if (this.disabled) {
|
846
|
+
return;
|
847
|
+
}
|
423
848
|
this.recursive
|
424
849
|
? this.tree.treeControl.toggleDescendants(this.treeNode.data)
|
425
850
|
: this.tree.treeControl.toggle(this.treeNode.data);
|
426
851
|
event.stopPropagation();
|
427
852
|
};
|
853
|
+
return McTreeNodeToggleBaseDirective;
|
854
|
+
}(McTreeNodeToggleMixinBase));
|
855
|
+
/** @nocollapse */ McTreeNodeToggleBaseDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeToggleBaseDirective, deps: [{ token: McTreeBase }, { token: McTreeNode }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
856
|
+
/** @nocollapse */ McTreeNodeToggleBaseDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: McTreeNodeToggleBaseDirective, inputs: { node: "node", recursive: ["mcTreeNodeToggleRecursive", "recursive"] }, usesInheritance: true, ngImport: i0__namespace });
|
857
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeToggleBaseDirective, decorators: [{
|
858
|
+
type: i0.Directive
|
859
|
+
}], ctorParameters: function () { return [{ type: McTreeBase }, { type: McTreeNode }]; }, propDecorators: { node: [{
|
860
|
+
type: i0.Input
|
861
|
+
}], recursive: [{
|
862
|
+
type: i0.Input,
|
863
|
+
args: ['mcTreeNodeToggleRecursive']
|
864
|
+
}] } });
|
865
|
+
var McTreeNodeToggleComponent = /** @class */ (function (_super) {
|
866
|
+
__extends(McTreeNodeToggleComponent, _super);
|
867
|
+
function McTreeNodeToggleComponent() {
|
868
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
869
|
+
}
|
428
870
|
return McTreeNodeToggleComponent;
|
429
|
-
}());
|
430
|
-
McTreeNodeToggleComponent
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
var _this = this;
|
455
|
-
this.tree = tree;
|
456
|
-
this.treeNode = treeNode;
|
457
|
-
this.disabled = false;
|
458
|
-
this._recursive = false;
|
459
|
-
this.tree.treeControl.filterValue
|
460
|
-
.pipe(operators.map(function (value) { return value.length > 0; }))
|
461
|
-
.subscribe(function (state) { return _this.disabled = state; });
|
871
|
+
}(McTreeNodeToggleBaseDirective));
|
872
|
+
/** @nocollapse */ McTreeNodeToggleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeToggleComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
873
|
+
/** @nocollapse */ McTreeNodeToggleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", 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 });
|
874
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeToggleComponent, decorators: [{
|
875
|
+
type: i0.Component,
|
876
|
+
args: [{
|
877
|
+
selector: 'mc-tree-node-toggle',
|
878
|
+
exportAs: 'mcTreeNodeToggle',
|
879
|
+
template: "<i class=\"mc mc-icon mc-angle-down-S_16\"></i>",
|
880
|
+
styleUrls: ['./toggle.scss'],
|
881
|
+
host: {
|
882
|
+
class: 'mc-tree-node-toggle',
|
883
|
+
'[class.mc-opened]': 'iconState',
|
884
|
+
'[attr.disabled]': 'disabled || null',
|
885
|
+
'(click)': 'toggle($event)'
|
886
|
+
},
|
887
|
+
inputs: ['disabled'],
|
888
|
+
encapsulation: i0.ViewEncapsulation.None,
|
889
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
890
|
+
}]
|
891
|
+
}] });
|
892
|
+
var McTreeNodeToggleDirective = /** @class */ (function (_super) {
|
893
|
+
__extends(McTreeNodeToggleDirective, _super);
|
894
|
+
function McTreeNodeToggleDirective() {
|
895
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
462
896
|
}
|
463
|
-
Object.defineProperty(McTreeNodeToggleDirective.prototype, "recursive", {
|
464
|
-
get: function () {
|
465
|
-
return this._recursive;
|
466
|
-
},
|
467
|
-
set: function (value) {
|
468
|
-
this._recursive = value;
|
469
|
-
},
|
470
|
-
enumerable: false,
|
471
|
-
configurable: true
|
472
|
-
});
|
473
|
-
McTreeNodeToggleDirective.prototype.toggle = function (event) {
|
474
|
-
this.recursive
|
475
|
-
? this.tree.treeControl.toggleDescendants(this.treeNode.data)
|
476
|
-
: this.tree.treeControl.toggle(this.treeNode.data);
|
477
|
-
event.stopPropagation();
|
478
|
-
};
|
479
897
|
return McTreeNodeToggleDirective;
|
480
|
-
}());
|
481
|
-
McTreeNodeToggleDirective
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
898
|
+
}(McTreeNodeToggleBaseDirective));
|
899
|
+
/** @nocollapse */ McTreeNodeToggleDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeToggleDirective, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
|
900
|
+
/** @nocollapse */ McTreeNodeToggleDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: McTreeNodeToggleDirective, selector: "[mcTreeNodeToggle]", host: { listeners: { "click": "toggle($event)" }, properties: { "attr.disabled": "disabled || null" } }, exportAs: ["mcTreeNodeToggle"], usesInheritance: true, ngImport: i0__namespace });
|
901
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeNodeToggleDirective, decorators: [{
|
902
|
+
type: i0.Directive,
|
903
|
+
args: [{
|
904
|
+
selector: '[mcTreeNodeToggle]',
|
905
|
+
exportAs: 'mcTreeNodeToggle',
|
906
|
+
host: {
|
907
|
+
'[attr.disabled]': 'disabled || null',
|
908
|
+
'(click)': 'toggle($event)'
|
909
|
+
}
|
910
|
+
}]
|
911
|
+
}] });
|
912
|
+
|
913
|
+
var McTree = /** @class */ (function (_super) {
|
914
|
+
__extends(McTree, _super);
|
915
|
+
function McTree() {
|
916
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
917
|
+
}
|
918
|
+
return McTree;
|
919
|
+
}(McTreeBase));
|
920
|
+
/** @nocollapse */ McTree.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTree, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
921
|
+
/** @nocollapse */ McTree.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", 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 });
|
922
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTree, decorators: [{
|
923
|
+
type: i0.Component,
|
924
|
+
args: [{
|
925
|
+
selector: 'mc-tree',
|
926
|
+
exportAs: 'mcTree',
|
927
|
+
template: "<ng-container mcTreeNodeOutlet></ng-container>",
|
928
|
+
styleUrls: ['./tree.scss'],
|
929
|
+
host: {
|
930
|
+
class: 'mc-tree'
|
931
|
+
},
|
932
|
+
encapsulation: i0.ViewEncapsulation.None,
|
933
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
934
|
+
}]
|
935
|
+
}] });
|
498
936
|
|
499
937
|
/**
|
500
938
|
* Injection token used to provide the parent component to options.
|
501
939
|
*/
|
502
|
-
var MC_TREE_OPTION_PARENT_COMPONENT = new
|
940
|
+
var MC_TREE_OPTION_PARENT_COMPONENT = new i0.InjectionToken('MC_TREE_OPTION_PARENT_COMPONENT');
|
503
941
|
var McTreeOptionChange = /** @class */ (function () {
|
504
942
|
function McTreeOptionChange(source, isUserInput) {
|
505
943
|
if (isUserInput === void 0) { isUserInput = false; }
|
@@ -519,7 +957,7 @@
|
|
519
957
|
_this.onFocus = new rxjs.Subject();
|
520
958
|
_this.onBlur = new rxjs.Subject();
|
521
959
|
_this._disabled = false;
|
522
|
-
_this.onSelectionChange = new
|
960
|
+
_this.onSelectionChange = new i0.EventEmitter();
|
523
961
|
_this._selected = false;
|
524
962
|
_this._id = "mc-tree-option-" + uniqueIdCounter++;
|
525
963
|
_this.hasFocus = false;
|
@@ -537,7 +975,7 @@
|
|
537
975
|
});
|
538
976
|
Object.defineProperty(McTreeOption.prototype, "disabled", {
|
539
977
|
get: function () {
|
540
|
-
return this._disabled ||
|
978
|
+
return this._disabled || this.tree.disabled;
|
541
979
|
},
|
542
980
|
set: function (value) {
|
543
981
|
var newValue = coercion.coerceBooleanProperty(value);
|
@@ -578,17 +1016,18 @@
|
|
578
1016
|
enumerable: false,
|
579
1017
|
configurable: true
|
580
1018
|
});
|
581
|
-
Object.defineProperty(McTreeOption.prototype, "
|
1019
|
+
Object.defineProperty(McTreeOption.prototype, "viewValue", {
|
582
1020
|
get: function () {
|
583
|
-
|
1021
|
+
// TODO: Add input property alternative for node envs.
|
1022
|
+
return (this.getHostElement().textContent || '').trim();
|
584
1023
|
},
|
585
1024
|
enumerable: false,
|
586
1025
|
configurable: true
|
587
1026
|
});
|
588
|
-
Object.defineProperty(McTreeOption.prototype, "
|
1027
|
+
Object.defineProperty(McTreeOption.prototype, "isExpandable", {
|
589
1028
|
get: function () {
|
590
|
-
|
591
|
-
return (this.
|
1029
|
+
var _a;
|
1030
|
+
return !((_a = this.toggleElement) === null || _a === void 0 ? void 0 : _a.disabled) && this.tree.treeControl.isExpandable(this.data);
|
592
1031
|
},
|
593
1032
|
enumerable: false,
|
594
1033
|
configurable: true
|
@@ -614,10 +1053,11 @@
|
|
614
1053
|
};
|
615
1054
|
McTreeOption.prototype.focus = function (focusOrigin) {
|
616
1055
|
var _this = this;
|
1056
|
+
var _a;
|
617
1057
|
if (focusOrigin === 'program') {
|
618
1058
|
return;
|
619
1059
|
}
|
620
|
-
if (this.disabled || this.hasFocus) {
|
1060
|
+
if (this.disabled || this.hasFocus || ((_a = this.actionButton) === null || _a === void 0 ? void 0 : _a.hasFocus)) {
|
621
1061
|
return;
|
622
1062
|
}
|
623
1063
|
this.elementRef.nativeElement.focus();
|
@@ -638,7 +1078,11 @@
|
|
638
1078
|
.pipe(operators.take(1))
|
639
1079
|
.subscribe(function () {
|
640
1080
|
_this.ngZone.run(function () {
|
1081
|
+
var _a;
|
641
1082
|
_this.hasFocus = false;
|
1083
|
+
if ((_a = _this.actionButton) === null || _a === void 0 ? void 0 : _a.hasFocus) {
|
1084
|
+
return;
|
1085
|
+
}
|
642
1086
|
_this.onBlur.next({ option: _this });
|
643
1087
|
});
|
644
1088
|
});
|
@@ -651,26 +1095,38 @@
|
|
651
1095
|
return 0;
|
652
1096
|
};
|
653
1097
|
McTreeOption.prototype.select = function () {
|
654
|
-
if (
|
655
|
-
|
656
|
-
this.changeDetectorRef.markForCheck();
|
657
|
-
this.emitSelectionChangeEvent();
|
1098
|
+
if (this._selected) {
|
1099
|
+
return;
|
658
1100
|
}
|
1101
|
+
this._selected = true;
|
1102
|
+
this.changeDetectorRef.markForCheck();
|
1103
|
+
this.emitSelectionChangeEvent();
|
659
1104
|
};
|
660
1105
|
McTreeOption.prototype.deselect = function () {
|
661
|
-
if (this._selected) {
|
662
|
-
|
663
|
-
|
1106
|
+
if (!this._selected) {
|
1107
|
+
return;
|
1108
|
+
}
|
1109
|
+
this._selected = false;
|
1110
|
+
this.changeDetectorRef.markForCheck();
|
1111
|
+
};
|
1112
|
+
McTreeOption.prototype.onKeydown = function ($event) {
|
1113
|
+
if (!this.actionButton) {
|
1114
|
+
return;
|
1115
|
+
}
|
1116
|
+
if ($event.keyCode === keycodes.TAB && !$event.shiftKey && !this.actionButton.hasFocus) {
|
1117
|
+
this.actionButton.focus();
|
1118
|
+
$event.preventDefault();
|
664
1119
|
}
|
665
1120
|
};
|
666
1121
|
McTreeOption.prototype.selectViaInteraction = function ($event) {
|
667
|
-
if (
|
668
|
-
|
669
|
-
this.emitSelectionChangeEvent(true);
|
670
|
-
var shiftKey = $event ? keycodes.hasModifierKey($event, 'shiftKey') : false;
|
671
|
-
var ctrlKey = $event ? keycodes.hasModifierKey($event, 'ctrlKey') : false;
|
672
|
-
this.tree.setSelectedOptionsByClick(this, shiftKey, ctrlKey);
|
1122
|
+
if (this.disabled) {
|
1123
|
+
return;
|
673
1124
|
}
|
1125
|
+
this.changeDetectorRef.markForCheck();
|
1126
|
+
this.emitSelectionChangeEvent(true);
|
1127
|
+
var shiftKey = $event ? keycodes.hasModifierKey($event, 'shiftKey') : false;
|
1128
|
+
var ctrlKey = $event ? keycodes.hasModifierKey($event, 'ctrlKey') : false;
|
1129
|
+
this.tree.setSelectedOptionsByClick(this, shiftKey, ctrlKey);
|
674
1130
|
};
|
675
1131
|
McTreeOption.prototype.emitSelectionChangeEvent = function (isUserInput) {
|
676
1132
|
if (isUserInput === void 0) { isUserInput = false; }
|
@@ -683,46 +1139,83 @@
|
|
683
1139
|
this.changeDetectorRef.markForCheck();
|
684
1140
|
};
|
685
1141
|
return McTreeOption;
|
686
|
-
}(
|
687
|
-
McTreeOption
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
1142
|
+
}(McTreeNode));
|
1143
|
+
/** @nocollapse */ McTreeOption.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", 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 });
|
1144
|
+
/** @nocollapse */ McTreeOption.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", 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: [
|
1145
|
+
{ provide: McTreeNode, useExisting: McTreeOption },
|
1146
|
+
{ provide: i1.MC_OPTION_ACTION_PARENT, useExisting: McTreeOption }
|
1147
|
+
], 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-checkbox\"></ng-content>\n\n<ng-content select=\"[mc-icon]\"></ng-content>\n\n<span class=\"mc-option-text mc-no-select\"><ng-content></ng-content></span>\n\n<ng-content select=\"mc-option-action\"></ng-content>\n\n<div class=\"mc-option-overlay\"></div>\n", styles: [".mc-tree-option{box-sizing:border-box;display:flex;align-items:center;height:32px;height:var(--mc-tree-size-node-height, 32px);word-wrap:break-word;border:2px solid transparent}.mc-tree-option .mc-option-text{display:inline-block;flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:16px;margin-right:var(--mc-tree-size-padding-right, 16px)}.mc-tree-option>.mc-icon{margin-right:8px;cursor:pointer}.mc-tree-option:focus{outline:none}.mc-tree-option:not([disabled]){cursor:pointer}.mc-tree-option>.mc-pseudo-checkbox,.mc-tree-option>.mc-checkbox{margin-right:8px}.mc-tree-option .mc-option-action{display:none}.mc-tree-option:not([disabled]):hover .mc-option-action,.mc-tree-option:not([disabled]).mc-focused .mc-option-action,.mc-tree-option:not([disabled]).mc-action-button-focused .mc-option-action{display:flex}\n"], components: [{ type: i1__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 });
|
1148
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeOption, decorators: [{
|
1149
|
+
type: i0.Component,
|
1150
|
+
args: [{
|
1151
|
+
selector: 'mc-tree-option',
|
1152
|
+
exportAs: 'mcTreeOption',
|
1153
|
+
templateUrl: './tree-option.html',
|
1154
|
+
styleUrls: ['./tree-option.scss'],
|
1155
|
+
host: {
|
1156
|
+
class: 'mc-tree-option',
|
1157
|
+
'[class.mc-selected]': 'selected',
|
1158
|
+
'[class.mc-focused]': 'hasFocus',
|
1159
|
+
'[class.mc-action-button-focused]': 'actionButton?.active',
|
1160
|
+
'[attr.id]': 'id',
|
1161
|
+
'[attr.tabindex]': '-1',
|
1162
|
+
'[attr.disabled]': 'disabled || null',
|
1163
|
+
'(focusin)': 'focus()',
|
1164
|
+
'(blur)': 'blur()',
|
1165
|
+
'(click)': 'selectViaInteraction($event)',
|
1166
|
+
'(keydown)': 'onKeydown($event)'
|
1167
|
+
},
|
1168
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1169
|
+
encapsulation: i0.ViewEncapsulation.None,
|
1170
|
+
providers: [
|
1171
|
+
{ provide: McTreeNode, useExisting: McTreeOption },
|
1172
|
+
{ provide: i1.MC_OPTION_ACTION_PARENT, useExisting: McTreeOption }
|
1173
|
+
]
|
1174
|
+
}]
|
1175
|
+
}], ctorParameters: function () {
|
1176
|
+
return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
|
1177
|
+
type: i0.Inject,
|
1178
|
+
args: [MC_TREE_OPTION_PARENT_COMPONENT]
|
1179
|
+
}] }];
|
1180
|
+
}, propDecorators: { toggleElement: [{
|
1181
|
+
type: i0.ContentChild,
|
1182
|
+
args: ['mcTreeNodeToggle']
|
1183
|
+
}], actionButton: [{
|
1184
|
+
type: i0.ContentChild,
|
1185
|
+
args: [i1.McOptionActionComponent]
|
1186
|
+
}], tooltipTrigger: [{
|
1187
|
+
type: i0.ContentChild,
|
1188
|
+
args: [tooltip.McTooltipTrigger]
|
1189
|
+
}], dropdownTrigger: [{
|
1190
|
+
type: i0.ContentChild,
|
1191
|
+
args: [dropdown.McDropdownTrigger]
|
1192
|
+
}], disabled: [{
|
1193
|
+
type: i0.Input
|
1194
|
+
}], showCheckbox: [{
|
1195
|
+
type: i0.Input
|
1196
|
+
}], onSelectionChange: [{
|
1197
|
+
type: i0.Output
|
1198
|
+
}] } });
|
720
1199
|
|
721
1200
|
var MC_SELECTION_TREE_VALUE_ACCESSOR = {
|
722
1201
|
provide: forms.NG_VALUE_ACCESSOR,
|
723
|
-
useExisting:
|
1202
|
+
useExisting: i0.forwardRef(function () { return McTreeSelection; }),
|
724
1203
|
multi: true
|
725
1204
|
};
|
1205
|
+
var McTreeSelectAllEvent = /** @class */ (function () {
|
1206
|
+
function McTreeSelectAllEvent(source, options) {
|
1207
|
+
this.source = source;
|
1208
|
+
this.options = options;
|
1209
|
+
}
|
1210
|
+
return McTreeSelectAllEvent;
|
1211
|
+
}());
|
1212
|
+
var McTreeCopyEvent = /** @class */ (function () {
|
1213
|
+
function McTreeCopyEvent(source, option) {
|
1214
|
+
this.source = source;
|
1215
|
+
this.option = option;
|
1216
|
+
}
|
1217
|
+
return McTreeCopyEvent;
|
1218
|
+
}());
|
726
1219
|
var McTreeNavigationChange = /** @class */ (function () {
|
727
1220
|
function McTreeNavigationChange(source, option) {
|
728
1221
|
this.source = source;
|
@@ -739,15 +1232,18 @@
|
|
739
1232
|
}());
|
740
1233
|
var McTreeSelection = /** @class */ (function (_super) {
|
741
1234
|
__extends(McTreeSelection, _super);
|
742
|
-
function McTreeSelection(elementRef, differs, changeDetectorRef, multiple) {
|
1235
|
+
function McTreeSelection(elementRef, differs, changeDetectorRef, multiple, clipboard) {
|
743
1236
|
var _this = _super.call(this, differs, changeDetectorRef) || this;
|
744
1237
|
_this.elementRef = elementRef;
|
745
|
-
_this.
|
1238
|
+
_this.clipboard = clipboard;
|
1239
|
+
_this.renderedOptions = new i0.QueryList();
|
746
1240
|
_this.resetFocusedItemOnBlur = true;
|
747
|
-
_this.navigationChange = new core.EventEmitter();
|
748
|
-
_this.selectionChange = new core.EventEmitter();
|
749
1241
|
_this.multipleMode = null;
|
750
1242
|
_this.userTabIndex = null;
|
1243
|
+
_this.navigationChange = new i0.EventEmitter();
|
1244
|
+
_this.selectionChange = new i0.EventEmitter();
|
1245
|
+
_this.onSelectAll = new i0.EventEmitter();
|
1246
|
+
_this.onCopy = new i0.EventEmitter();
|
751
1247
|
_this.sortedNodes = [];
|
752
1248
|
_this._autoSelect = true;
|
753
1249
|
_this._noUnselectLast = true;
|
@@ -768,14 +1264,15 @@
|
|
768
1264
|
});
|
769
1265
|
_this.renderedOptions.reset(orderedOptions);
|
770
1266
|
_this.renderedOptions.notifyOnChanges();
|
1267
|
+
_this.updateScrollSize();
|
771
1268
|
};
|
772
|
-
if (multiple ===
|
1269
|
+
if (multiple === i1.MultipleMode.CHECKBOX || multiple === i1.MultipleMode.KEYBOARD) {
|
773
1270
|
_this.multipleMode = multiple;
|
774
1271
|
}
|
775
1272
|
else if (multiple !== null) {
|
776
|
-
_this.multipleMode =
|
1273
|
+
_this.multipleMode = i1.MultipleMode.CHECKBOX;
|
777
1274
|
}
|
778
|
-
if (_this.multipleMode ===
|
1275
|
+
if (_this.multipleMode === i1.MultipleMode.CHECKBOX) {
|
779
1276
|
_this.autoSelect = false;
|
780
1277
|
_this.noUnselectLast = false;
|
781
1278
|
}
|
@@ -794,14 +1291,14 @@
|
|
794
1291
|
});
|
795
1292
|
Object.defineProperty(McTreeSelection.prototype, "optionFocusChanges", {
|
796
1293
|
get: function () {
|
797
|
-
return rxjs.merge.apply(void 0,
|
1294
|
+
return rxjs.merge.apply(void 0, __spreadArray([], __read(this.renderedOptions.map(function (option) { return option.onFocus; }))));
|
798
1295
|
},
|
799
1296
|
enumerable: false,
|
800
1297
|
configurable: true
|
801
1298
|
});
|
802
1299
|
Object.defineProperty(McTreeSelection.prototype, "optionBlurChanges", {
|
803
1300
|
get: function () {
|
804
|
-
return rxjs.merge.apply(void 0,
|
1301
|
+
return rxjs.merge.apply(void 0, __spreadArray([], __read(this.renderedOptions.map(function (option) { return option.onBlur; }))));
|
805
1302
|
},
|
806
1303
|
enumerable: false,
|
807
1304
|
configurable: true
|
@@ -850,14 +1347,15 @@
|
|
850
1347
|
});
|
851
1348
|
Object.defineProperty(McTreeSelection.prototype, "showCheckbox", {
|
852
1349
|
get: function () {
|
853
|
-
return this.multipleMode ===
|
1350
|
+
return this.multipleMode === i1.MultipleMode.CHECKBOX;
|
854
1351
|
},
|
855
1352
|
enumerable: false,
|
856
1353
|
configurable: true
|
857
1354
|
});
|
858
1355
|
McTreeSelection.prototype.ngAfterContentInit = function () {
|
859
1356
|
var _this = this;
|
860
|
-
this.unorderedOptions.changes
|
1357
|
+
this.unorderedOptions.changes
|
1358
|
+
.subscribe(this.updateRenderedOptions);
|
861
1359
|
this.keyManager = new a11y.FocusKeyManager(this.renderedOptions)
|
862
1360
|
.withVerticalOrientation(true)
|
863
1361
|
.withHorizontalOrientation(null);
|
@@ -882,20 +1380,19 @@
|
|
882
1380
|
_this.renderedOptions.notifyOnChanges();
|
883
1381
|
});
|
884
1382
|
this.renderedOptions.changes
|
885
|
-
.pipe(operators.takeUntil(this.destroy))
|
1383
|
+
.pipe(operators.takeUntil(this.destroy), operators.delay(0))
|
886
1384
|
.subscribe(function (options) {
|
887
1385
|
_this.resetOptions();
|
888
1386
|
// Check to see if we need to update our tab index
|
889
1387
|
_this.updateTabIndex();
|
890
|
-
// todo need to do optimisation
|
891
1388
|
options.forEach(function (option) {
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
}
|
898
|
-
option.
|
1389
|
+
if (_this.getSelectedValues().includes(option.value)) {
|
1390
|
+
option.select();
|
1391
|
+
}
|
1392
|
+
else {
|
1393
|
+
option.deselect();
|
1394
|
+
}
|
1395
|
+
option.markForCheck();
|
899
1396
|
});
|
900
1397
|
});
|
901
1398
|
};
|
@@ -907,7 +1404,9 @@
|
|
907
1404
|
if (this.renderedOptions.length === 0 || this.isFocusReceivedFromNestedOption($event)) {
|
908
1405
|
return;
|
909
1406
|
}
|
1407
|
+
this.keyManager.setFocusOrigin('keyboard');
|
910
1408
|
this.keyManager.setFirstItemActive();
|
1409
|
+
this.keyManager.setFocusOrigin('program');
|
911
1410
|
};
|
912
1411
|
McTreeSelection.prototype.blur = function () {
|
913
1412
|
if (!this.hasFocusedOption() && this.resetFocusedItemOnBlur) {
|
@@ -917,51 +1416,54 @@
|
|
917
1416
|
this.changeDetectorRef.markForCheck();
|
918
1417
|
};
|
919
1418
|
McTreeSelection.prototype.onKeyDown = function (event) {
|
1419
|
+
var _a, _b;
|
920
1420
|
this.keyManager.setFocusOrigin('keyboard');
|
921
1421
|
// tslint:disable-next-line: deprecation
|
922
1422
|
var keyCode = event.keyCode;
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
1423
|
+
if ([keycodes.SPACE, keycodes.LEFT_ARROW, keycodes.RIGHT_ARROW].includes(keyCode) || keycodes.isVerticalMovement(event)) {
|
1424
|
+
event.preventDefault();
|
1425
|
+
}
|
1426
|
+
if (this.multiple && keycodes.isSelectAll(event)) {
|
1427
|
+
this.selectAllOptions();
|
1428
|
+
return;
|
1429
|
+
}
|
1430
|
+
else if (keycodes.isCopy(event)) {
|
1431
|
+
this.copyActiveOption();
|
1432
|
+
return;
|
1433
|
+
}
|
1434
|
+
else if (keyCode === keycodes.TAB) {
|
1435
|
+
this.keyManager.tabOut.next();
|
1436
|
+
return;
|
1437
|
+
}
|
1438
|
+
else if (keyCode === keycodes.LEFT_ARROW && ((_a = this.keyManager.activeItem) === null || _a === void 0 ? void 0 : _a.isExpandable)) {
|
1439
|
+
this.treeControl.collapse(this.keyManager.activeItem.data);
|
1440
|
+
return;
|
1441
|
+
}
|
1442
|
+
else if (keyCode === keycodes.RIGHT_ARROW && ((_b = this.keyManager.activeItem) === null || _b === void 0 ? void 0 : _b.isExpandable)) {
|
1443
|
+
this.treeControl.expand(this.keyManager.activeItem.data);
|
1444
|
+
return;
|
1445
|
+
}
|
1446
|
+
else if (keyCode === keycodes.DOWN_ARROW) {
|
1447
|
+
this.keyManager.setNextItemActive();
|
1448
|
+
}
|
1449
|
+
else if (keyCode === keycodes.UP_ARROW) {
|
1450
|
+
this.keyManager.setPreviousItemActive();
|
1451
|
+
}
|
1452
|
+
else if ([keycodes.SPACE, keycodes.ENTER].includes(keyCode)) {
|
1453
|
+
this.toggleFocusedOption();
|
1454
|
+
return;
|
1455
|
+
}
|
1456
|
+
else if (keyCode === keycodes.HOME) {
|
1457
|
+
this.keyManager.setFirstItemActive();
|
1458
|
+
}
|
1459
|
+
else if (keyCode === keycodes.END) {
|
1460
|
+
this.keyManager.setLastItemActive();
|
1461
|
+
}
|
1462
|
+
else if (keyCode === keycodes.PAGE_UP) {
|
1463
|
+
this.keyManager.setPreviousPageItemActive();
|
1464
|
+
}
|
1465
|
+
else if (keyCode === keycodes.PAGE_DOWN) {
|
1466
|
+
this.keyManager.setNextPageItemActive();
|
965
1467
|
}
|
966
1468
|
if (this.keyManager.activeItem) {
|
967
1469
|
this.setSelectedOptionsByKey(this.keyManager.activeItem, keycodes.hasModifierKey(event, 'shiftKey'), keycodes.hasModifierKey(event, 'ctrlKey'));
|
@@ -976,6 +1478,7 @@
|
|
976
1478
|
McTreeSelection.prototype.setSelectedOptionsByKey = function (option, shiftKey, ctrlKey) {
|
977
1479
|
if (shiftKey && this.multiple) {
|
978
1480
|
this.setSelectedOptions(option);
|
1481
|
+
this.emitChangeEvent(option);
|
979
1482
|
}
|
980
1483
|
else if (ctrlKey) {
|
981
1484
|
if (!this.canDeselectLast(option)) {
|
@@ -985,8 +1488,8 @@
|
|
985
1488
|
else if (this.autoSelect) {
|
986
1489
|
this.selectionModel.clear();
|
987
1490
|
this.selectionModel.toggle(option.data);
|
1491
|
+
this.emitChangeEvent(option);
|
988
1492
|
}
|
989
|
-
this.emitChangeEvent(option);
|
990
1493
|
};
|
991
1494
|
McTreeSelection.prototype.setSelectedOptionsByClick = function (option, shiftKey, ctrlKey) {
|
992
1495
|
if (!shiftKey && !ctrlKey) {
|
@@ -1011,7 +1514,7 @@
|
|
1011
1514
|
this.emitChangeEvent(option);
|
1012
1515
|
};
|
1013
1516
|
McTreeSelection.prototype.setSelectedOptions = function (option) {
|
1014
|
-
var
|
1517
|
+
var _c;
|
1015
1518
|
var _this = this;
|
1016
1519
|
var selectedOptionState = option.selected;
|
1017
1520
|
var fromIndex = this.keyManager.previousActiveItemIndex;
|
@@ -1020,7 +1523,7 @@
|
|
1020
1523
|
return;
|
1021
1524
|
}
|
1022
1525
|
if (fromIndex > toIndex) {
|
1023
|
-
|
1526
|
+
_c = __read([toIndex, fromIndex], 2), fromIndex = _c[0], toIndex = _c[1];
|
1024
1527
|
}
|
1025
1528
|
this.renderedOptions
|
1026
1529
|
.toArray()
|
@@ -1049,28 +1552,32 @@
|
|
1049
1552
|
if (viewContainer === void 0) { viewContainer = this.nodeOutlet.viewContainer; }
|
1050
1553
|
_super.prototype.renderNodeChanges.call(this, data, dataDiffer, viewContainer, parentData);
|
1051
1554
|
this.sortedNodes = this.getSortedNodes(viewContainer);
|
1052
|
-
this.updateScrollSize();
|
1053
1555
|
this.nodeOutlet.changeDetectorRef.detectChanges();
|
1054
1556
|
};
|
1055
|
-
McTreeSelection.prototype.getHeight = function () {
|
1056
|
-
var clientRects = this.elementRef.nativeElement.getClientRects();
|
1057
|
-
if (clientRects.length) {
|
1058
|
-
return clientRects[0].height;
|
1059
|
-
}
|
1060
|
-
return 0;
|
1061
|
-
};
|
1062
|
-
McTreeSelection.prototype.getItemHeight = function () {
|
1063
|
-
return this.renderedOptions.first ? this.renderedOptions.first.getHeight() : 0;
|
1064
|
-
};
|
1065
1557
|
McTreeSelection.prototype.emitNavigationEvent = function (option) {
|
1066
1558
|
this.navigationChange.emit(new McTreeNavigationChange(this, option));
|
1067
1559
|
};
|
1068
1560
|
McTreeSelection.prototype.emitChangeEvent = function (option) {
|
1069
1561
|
this.selectionChange.emit(new McTreeNavigationChange(this, option));
|
1070
1562
|
};
|
1563
|
+
McTreeSelection.prototype.selectAllOptions = function () {
|
1564
|
+
var optionsToSelect = this.renderedOptions
|
1565
|
+
.filter(function (option) { return !option.disabled; });
|
1566
|
+
optionsToSelect
|
1567
|
+
.forEach(function (option) { return option.setSelected(true); });
|
1568
|
+
this.onSelectAll.emit(new McTreeSelectAllEvent(this, optionsToSelect));
|
1569
|
+
};
|
1570
|
+
McTreeSelection.prototype.copyActiveOption = function () {
|
1571
|
+
if (this.onCopy.observers.length) {
|
1572
|
+
this.onCopy.emit(new McTreeCopyEvent(this, this.keyManager.activeItem));
|
1573
|
+
}
|
1574
|
+
else {
|
1575
|
+
this.onCopyDefaultHandler();
|
1576
|
+
}
|
1577
|
+
};
|
1071
1578
|
McTreeSelection.prototype.writeValue = function (value) {
|
1072
1579
|
if (this.multiple && value && !Array.isArray(value)) {
|
1073
|
-
throw
|
1580
|
+
throw i1.getMcSelectNonArrayValueError();
|
1074
1581
|
}
|
1075
1582
|
if (value) {
|
1076
1583
|
this.setOptionsFromValues(this.multiple ? value : [value]);
|
@@ -1093,18 +1600,32 @@
|
|
1093
1600
|
this.changeDetectorRef.markForCheck();
|
1094
1601
|
};
|
1095
1602
|
McTreeSelection.prototype.setOptionsFromValues = function (values) {
|
1096
|
-
var
|
1603
|
+
var _c;
|
1097
1604
|
var _this = this;
|
1098
1605
|
this.selectionModel.clear();
|
1099
1606
|
var valuesToSelect = values.reduce(function (result, value) {
|
1100
|
-
return _this.treeControl.hasValue(value) ?
|
1607
|
+
return _this.treeControl.hasValue(value) ? __spreadArray(__spreadArray([], __read(result)), [_this.treeControl.hasValue(value)]) : __spreadArray([], __read(result));
|
1101
1608
|
}, []);
|
1102
|
-
(
|
1609
|
+
(_c = this.selectionModel).select.apply(_c, __spreadArray([], __read(valuesToSelect)));
|
1103
1610
|
};
|
1104
1611
|
McTreeSelection.prototype.getSelectedValues = function () {
|
1105
1612
|
var _this = this;
|
1106
1613
|
return this.selectionModel.selected.map(function (selected) { return _this.treeControl.getValue(selected); });
|
1107
1614
|
};
|
1615
|
+
McTreeSelection.prototype.getItemHeight = function () {
|
1616
|
+
return this.renderedOptions.first ? this.renderedOptions.first.getHeight() : 0;
|
1617
|
+
};
|
1618
|
+
McTreeSelection.prototype.onCopyDefaultHandler = function () {
|
1619
|
+
var _a;
|
1620
|
+
(_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.copy(this.keyManager.activeItem.value);
|
1621
|
+
};
|
1622
|
+
McTreeSelection.prototype.getHeight = function () {
|
1623
|
+
var clientRects = this.elementRef.nativeElement.getClientRects();
|
1624
|
+
if (clientRects.length) {
|
1625
|
+
return clientRects[0].height;
|
1626
|
+
}
|
1627
|
+
return 0;
|
1628
|
+
};
|
1108
1629
|
McTreeSelection.prototype.updateTabIndex = function () {
|
1109
1630
|
this._tabIndex = this.renderedOptions.length === 0 ? -1 : 0;
|
1110
1631
|
};
|
@@ -1185,55 +1706,78 @@
|
|
1185
1706
|
return $event.relatedTarget.classList.contains('mc-tree-option');
|
1186
1707
|
};
|
1187
1708
|
return McTreeSelection;
|
1188
|
-
}(
|
1189
|
-
McTreeSelection
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1709
|
+
}(McTreeBase));
|
1710
|
+
/** @nocollapse */ McTreeSelection.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", 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 });
|
1711
|
+
/** @nocollapse */ McTreeSelection.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", 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: [
|
1712
|
+
MC_SELECTION_TREE_VALUE_ACCESSOR,
|
1713
|
+
{ provide: MC_TREE_OPTION_PARENT_COMPONENT, useExisting: McTreeSelection },
|
1714
|
+
{ provide: McTreeBase, useExisting: McTreeSelection }
|
1715
|
+
], 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 });
|
1716
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeSelection, decorators: [{
|
1717
|
+
type: i0.Component,
|
1718
|
+
args: [{
|
1719
|
+
selector: 'mc-tree-selection',
|
1720
|
+
exportAs: 'mcTreeSelection',
|
1721
|
+
template: '<ng-container mcTreeNodeOutlet></ng-container>',
|
1722
|
+
styleUrls: ['./tree-selection.scss'],
|
1723
|
+
host: {
|
1724
|
+
class: 'mc-tree-selection',
|
1725
|
+
'[attr.tabindex]': 'tabIndex',
|
1726
|
+
'[attr.disabled]': 'disabled || null',
|
1727
|
+
'(blur)': 'blur()',
|
1728
|
+
'(focus)': 'focus($event)',
|
1729
|
+
'(keydown)': 'onKeyDown($event)',
|
1730
|
+
'(window:resize)': 'updateScrollSize()'
|
1731
|
+
},
|
1732
|
+
encapsulation: i0.ViewEncapsulation.None,
|
1733
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1734
|
+
providers: [
|
1735
|
+
MC_SELECTION_TREE_VALUE_ACCESSOR,
|
1736
|
+
{ provide: MC_TREE_OPTION_PARENT_COMPONENT, useExisting: McTreeSelection },
|
1737
|
+
{ provide: McTreeBase, useExisting: McTreeSelection }
|
1738
|
+
]
|
1739
|
+
}]
|
1740
|
+
}], ctorParameters: function () {
|
1741
|
+
return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.IterableDiffers }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace.MultipleMode, decorators: [{
|
1742
|
+
type: i0.Attribute,
|
1743
|
+
args: ['multiple']
|
1744
|
+
}] }, { type: i1__namespace$1.Clipboard, decorators: [{
|
1745
|
+
type: i0.Optional
|
1746
|
+
}] }];
|
1747
|
+
}, propDecorators: { nodeOutlet: [{
|
1748
|
+
type: i0.ViewChild,
|
1749
|
+
args: [McTreeNodeOutlet, { static: true }]
|
1750
|
+
}], unorderedOptions: [{
|
1751
|
+
type: i0.ContentChildren,
|
1752
|
+
args: [McTreeOption]
|
1753
|
+
}], treeControl: [{
|
1754
|
+
type: i0.Input
|
1755
|
+
}], navigationChange: [{
|
1756
|
+
type: i0.Output
|
1757
|
+
}], selectionChange: [{
|
1758
|
+
type: i0.Output
|
1759
|
+
}], onSelectAll: [{
|
1760
|
+
type: i0.Output
|
1761
|
+
}], onCopy: [{
|
1762
|
+
type: i0.Output
|
1763
|
+
}], autoSelect: [{
|
1764
|
+
type: i0.Input
|
1765
|
+
}], noUnselectLast: [{
|
1766
|
+
type: i0.Input
|
1767
|
+
}], disabled: [{
|
1768
|
+
type: i0.Input
|
1769
|
+
}], tabIndex: [{
|
1770
|
+
type: i0.Input
|
1771
|
+
}] } });
|
1231
1772
|
|
1232
1773
|
var MC_TREE_DIRECTIVES = [
|
1233
|
-
|
1234
|
-
McTreeOption,
|
1774
|
+
McTreeNodeOutlet,
|
1235
1775
|
McTreeNodeDef,
|
1776
|
+
McTreeNode,
|
1236
1777
|
McTreeNodePadding,
|
1778
|
+
McTree,
|
1779
|
+
McTreeSelection,
|
1780
|
+
McTreeOption,
|
1237
1781
|
McTreeNodeToggleComponent,
|
1238
1782
|
McTreeNodeToggleDirective
|
1239
1783
|
];
|
@@ -1242,13 +1786,272 @@
|
|
1242
1786
|
}
|
1243
1787
|
return McTreeModule;
|
1244
1788
|
}());
|
1245
|
-
McTreeModule
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1789
|
+
/** @nocollapse */ McTreeModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
1790
|
+
/** @nocollapse */ McTreeModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeModule, declarations: [McTreeNodeOutlet,
|
1791
|
+
McTreeNodeDef,
|
1792
|
+
McTreeNode,
|
1793
|
+
McTreeNodePadding,
|
1794
|
+
McTree,
|
1795
|
+
McTreeSelection,
|
1796
|
+
McTreeOption,
|
1797
|
+
McTreeNodeToggleComponent,
|
1798
|
+
McTreeNodeToggleDirective], imports: [i2$1.CommonModule, i1.McPseudoCheckboxModule], exports: [McTreeNodeOutlet,
|
1799
|
+
McTreeNodeDef,
|
1800
|
+
McTreeNode,
|
1801
|
+
McTreeNodePadding,
|
1802
|
+
McTree,
|
1803
|
+
McTreeSelection,
|
1804
|
+
McTreeOption,
|
1805
|
+
McTreeNodeToggleComponent,
|
1806
|
+
McTreeNodeToggleDirective] });
|
1807
|
+
/** @nocollapse */ McTreeModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeModule, imports: [[i2$1.CommonModule, i1.McPseudoCheckboxModule]] });
|
1808
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0__namespace, type: McTreeModule, decorators: [{
|
1809
|
+
type: i0.NgModule,
|
1810
|
+
args: [{
|
1811
|
+
imports: [i2$1.CommonModule, i1.McPseudoCheckboxModule],
|
1812
|
+
exports: MC_TREE_DIRECTIVES,
|
1813
|
+
declarations: MC_TREE_DIRECTIVES
|
1814
|
+
}]
|
1815
|
+
}] });
|
1816
|
+
|
1817
|
+
/** Base tree control. It has basic toggle/expand/collapse operations on a single data node. */
|
1818
|
+
/* tslint:disable-next-line:naming-convention */
|
1819
|
+
var BaseTreeControl = /** @class */ (function () {
|
1820
|
+
function BaseTreeControl() {
|
1821
|
+
/** A selection model with multi-selection to track expansion status. */
|
1822
|
+
this.expansionModel = new collections.SelectionModel(true);
|
1823
|
+
this.filterModel = new collections.SelectionModel(true);
|
1824
|
+
this.filterValue = new rxjs.BehaviorSubject('');
|
1825
|
+
}
|
1826
|
+
/** Toggles one single data node's expanded/collapsed state. */
|
1827
|
+
BaseTreeControl.prototype.toggle = function (dataNode) {
|
1828
|
+
if (this.filterValue.value) {
|
1829
|
+
return;
|
1830
|
+
}
|
1831
|
+
this.expansionModel.toggle(dataNode);
|
1832
|
+
};
|
1833
|
+
/** Expands one single data node. */
|
1834
|
+
BaseTreeControl.prototype.expand = function (dataNode) {
|
1835
|
+
if (this.filterValue.value) {
|
1836
|
+
return;
|
1837
|
+
}
|
1838
|
+
this.expansionModel.select(dataNode);
|
1839
|
+
};
|
1840
|
+
/** Collapses one single data node. */
|
1841
|
+
BaseTreeControl.prototype.collapse = function (dataNode) {
|
1842
|
+
if (this.filterValue.value) {
|
1843
|
+
return;
|
1844
|
+
}
|
1845
|
+
this.expansionModel.deselect(dataNode);
|
1846
|
+
};
|
1847
|
+
/** Whether a given data node is expanded or not. Returns true if the data node is expanded. */
|
1848
|
+
BaseTreeControl.prototype.isExpanded = function (dataNode) {
|
1849
|
+
return this.expansionModel.isSelected(dataNode);
|
1850
|
+
};
|
1851
|
+
/** Toggles a subtree rooted at `node` recursively. */
|
1852
|
+
BaseTreeControl.prototype.toggleDescendants = function (dataNode) {
|
1853
|
+
this.expansionModel.isSelected(dataNode)
|
1854
|
+
? this.collapseDescendants(dataNode)
|
1855
|
+
: this.expandDescendants(dataNode);
|
1856
|
+
};
|
1857
|
+
/** Collapse all dataNodes in the tree. */
|
1858
|
+
BaseTreeControl.prototype.collapseAll = function () {
|
1859
|
+
this.expansionModel.clear();
|
1860
|
+
};
|
1861
|
+
/** Expands a subtree rooted at given data node recursively. */
|
1862
|
+
BaseTreeControl.prototype.expandDescendants = function (dataNode) {
|
1863
|
+
var _a;
|
1864
|
+
var toBeProcessed = [dataNode];
|
1865
|
+
toBeProcessed.push.apply(toBeProcessed, __spreadArray([], __read(this.getDescendants(dataNode))));
|
1866
|
+
(_a = this.expansionModel).select.apply(_a, __spreadArray([], __read(toBeProcessed)));
|
1867
|
+
};
|
1868
|
+
/** Collapses a subtree rooted at given data node recursively. */
|
1869
|
+
BaseTreeControl.prototype.collapseDescendants = function (dataNode) {
|
1870
|
+
var _a;
|
1871
|
+
var toBeProcessed = [dataNode];
|
1872
|
+
toBeProcessed.push.apply(toBeProcessed, __spreadArray([], __read(this.getDescendants(dataNode))));
|
1873
|
+
(_a = this.expansionModel).deselect.apply(_a, __spreadArray([], __read(toBeProcessed)));
|
1874
|
+
};
|
1875
|
+
return BaseTreeControl;
|
1876
|
+
}());
|
1877
|
+
|
1878
|
+
function defaultCompareValues(firstValue, secondValue) {
|
1879
|
+
return firstValue === secondValue;
|
1880
|
+
}
|
1881
|
+
function defaultCompareViewValues(firstViewValue, secondViewValue) {
|
1882
|
+
return RegExp(secondViewValue, 'gi').test(firstViewValue);
|
1883
|
+
}
|
1884
|
+
/** Flat tree control. Able to expand/collapse a subtree recursively for flattened tree. */
|
1885
|
+
var FlatTreeControl = /** @class */ (function (_super) {
|
1886
|
+
__extends(FlatTreeControl, _super);
|
1887
|
+
/** Construct with flat tree data node functions getLevel, isExpandable, getValue and getViewValue. */
|
1888
|
+
function FlatTreeControl(getLevel, isExpandable,
|
1889
|
+
/** getValue will be used to determine if the tree contains value or not. Used in method hasValue */
|
1890
|
+
getValue,
|
1891
|
+
/** getViewValue will be used for filter nodes. Returned value will be first argument in filterNodesFunction */
|
1892
|
+
getViewValue,
|
1893
|
+
/** compareValues will be used to comparing values. */
|
1894
|
+
compareValues,
|
1895
|
+
/** compareValues will be used to comparing values. */
|
1896
|
+
compareViewValues) {
|
1897
|
+
if (compareValues === void 0) { compareValues = defaultCompareValues; }
|
1898
|
+
if (compareViewValues === void 0) { compareViewValues = defaultCompareViewValues; }
|
1899
|
+
var _this = _super.call(this) || this;
|
1900
|
+
_this.getLevel = getLevel;
|
1901
|
+
_this.isExpandable = isExpandable;
|
1902
|
+
_this.getValue = getValue;
|
1903
|
+
_this.getViewValue = getViewValue;
|
1904
|
+
_this.compareValues = compareValues;
|
1905
|
+
_this.compareViewValues = compareViewValues;
|
1906
|
+
return _this;
|
1907
|
+
}
|
1908
|
+
/**
|
1909
|
+
* Gets a list of the data node's subtree of descendent data nodes.
|
1910
|
+
*
|
1911
|
+
* To make this working, the `dataNodes` of the TreeControl must be flattened tree nodes
|
1912
|
+
* with correct levels.
|
1913
|
+
*/
|
1914
|
+
FlatTreeControl.prototype.getDescendants = function (dataNode) {
|
1915
|
+
var startIndex = this.dataNodes.indexOf(dataNode);
|
1916
|
+
var results = [];
|
1917
|
+
// Goes through flattened tree nodes in the `dataNodes` array, and get all descendants.
|
1918
|
+
// The level of descendants of a tree node must be greater than the level of the given
|
1919
|
+
// tree node.
|
1920
|
+
// If we reach a node whose level is equal to the level of the tree node, we hit a sibling.
|
1921
|
+
// If we reach a node whose level is greater than the level of the tree node, we hit a
|
1922
|
+
// sibling of an ancestor.
|
1923
|
+
for (var i = startIndex + 1; i < this.dataNodes.length && this.getLevel(dataNode) < this.getLevel(this.dataNodes[i]); i++) {
|
1924
|
+
results.push(this.dataNodes[i]);
|
1925
|
+
}
|
1926
|
+
return results;
|
1927
|
+
};
|
1928
|
+
/**
|
1929
|
+
* Expands all data nodes in the tree.
|
1930
|
+
*
|
1931
|
+
* To make this working, the `dataNodes` variable of the TreeControl must be set to all flattened
|
1932
|
+
* data nodes of the tree.
|
1933
|
+
*/
|
1934
|
+
FlatTreeControl.prototype.expandAll = function () {
|
1935
|
+
var _a;
|
1936
|
+
(_a = this.expansionModel).select.apply(_a, __spreadArray([], __read(this.dataNodes)));
|
1937
|
+
};
|
1938
|
+
FlatTreeControl.prototype.getParents = function (node, result) {
|
1939
|
+
if (node.parent) {
|
1940
|
+
result.unshift(node.parent);
|
1941
|
+
return this.getParents(node.parent, result);
|
1942
|
+
}
|
1943
|
+
else {
|
1944
|
+
return result;
|
1945
|
+
}
|
1946
|
+
};
|
1947
|
+
FlatTreeControl.prototype.hasValue = function (value) {
|
1948
|
+
var _this = this;
|
1949
|
+
return this.dataNodes.find(function (node) { return _this.compareValues(_this.getValue(node), value); });
|
1950
|
+
};
|
1951
|
+
FlatTreeControl.prototype.filterNodes = function (value) {
|
1952
|
+
var _a;
|
1953
|
+
var _this = this;
|
1954
|
+
this.saveExpansionState();
|
1955
|
+
this.filterModel.clear();
|
1956
|
+
this.expansionModel.clear();
|
1957
|
+
var filteredNodes = this.dataNodes
|
1958
|
+
.filter(function (node) { return _this.compareViewValues(_this.getViewValue(node), value); });
|
1959
|
+
var filteredNodesWithTheirParents = new Set();
|
1960
|
+
filteredNodes.forEach(function (filteredNode) {
|
1961
|
+
_this.getParents(filteredNode, [])
|
1962
|
+
.forEach(function (node) {
|
1963
|
+
filteredNodesWithTheirParents.add(node);
|
1964
|
+
_this.expandDataNode(node);
|
1965
|
+
});
|
1966
|
+
filteredNodesWithTheirParents.add(filteredNode);
|
1967
|
+
_this.expandDataNode(filteredNode);
|
1968
|
+
if (_this.isExpandable(filteredNode)) {
|
1969
|
+
var childNodeLevel_1 = _this.getLevel(filteredNode) + 1;
|
1970
|
+
_this.getDescendants(filteredNode)
|
1971
|
+
.filter(function (childNode) { return _this.getLevel(childNode) === childNodeLevel_1; })
|
1972
|
+
.filter(function (childNode) { return !_this.isExpandable(childNode) || !_this.hasFilteredDescendant(childNode, filteredNodes); })
|
1973
|
+
.forEach(function (childNode) {
|
1974
|
+
filteredNodesWithTheirParents.add(childNode);
|
1975
|
+
_this.expandDataNode(childNode);
|
1976
|
+
});
|
1977
|
+
}
|
1978
|
+
});
|
1979
|
+
(_a = this.filterModel).select.apply(_a, __spreadArray([], __read(Array.from(filteredNodesWithTheirParents))));
|
1980
|
+
this.filterValue.next(value);
|
1981
|
+
this.restoreExpansionState();
|
1982
|
+
};
|
1983
|
+
FlatTreeControl.prototype.expandDataNode = function (dataNode) {
|
1984
|
+
if (this.isExpandable(dataNode)) {
|
1985
|
+
this.expansionModel.select(dataNode);
|
1986
|
+
}
|
1987
|
+
};
|
1988
|
+
FlatTreeControl.prototype.saveExpansionState = function () {
|
1989
|
+
if (this.filterValue.value === '') {
|
1990
|
+
this.expandedItemsBeforeFiltration = this.expansionModel.selected;
|
1991
|
+
}
|
1992
|
+
};
|
1993
|
+
FlatTreeControl.prototype.restoreExpansionState = function () {
|
1994
|
+
var _a;
|
1995
|
+
if (this.filterValue.value === '') {
|
1996
|
+
this.expansionModel.clear();
|
1997
|
+
(_a = this.expansionModel).select.apply(_a, __spreadArray([], __read(this.expandedItemsBeforeFiltration)));
|
1998
|
+
}
|
1999
|
+
};
|
2000
|
+
FlatTreeControl.prototype.hasFilteredDescendant = function (dataNode, filteredNodes) {
|
2001
|
+
var _this = this;
|
2002
|
+
var filteredViewValues = filteredNodes
|
2003
|
+
.map(function (node) { return _this.getViewValue(node); });
|
2004
|
+
return this.getDescendants(dataNode)
|
2005
|
+
.filter(function (node) { return filteredViewValues.includes(_this.getViewValue(node)); })
|
2006
|
+
.length > 0;
|
2007
|
+
};
|
2008
|
+
return FlatTreeControl;
|
2009
|
+
}(BaseTreeControl));
|
2010
|
+
|
2011
|
+
/** Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type. */
|
2012
|
+
var NestedTreeControl = /** @class */ (function (_super) {
|
2013
|
+
__extends(NestedTreeControl, _super);
|
2014
|
+
/** Construct with nested tree function getChildren. */
|
2015
|
+
function NestedTreeControl(getChildren) {
|
2016
|
+
var _this = _super.call(this) || this;
|
2017
|
+
_this.getChildren = getChildren;
|
2018
|
+
return _this;
|
2019
|
+
}
|
2020
|
+
/**
|
2021
|
+
* Expands all dataNodes in the tree.
|
2022
|
+
*
|
2023
|
+
* To make this working, the `dataNodes` variable of the TreeControl must be set to all root level
|
2024
|
+
* data nodes of the tree.
|
2025
|
+
*/
|
2026
|
+
NestedTreeControl.prototype.expandAll = function () {
|
2027
|
+
var _a;
|
2028
|
+
var _this = this;
|
2029
|
+
this.expansionModel.clear();
|
2030
|
+
var allNodes = this.dataNodes.reduce(function (accumulator, dataNode) { return __spreadArray(__spreadArray(__spreadArray([], __read(accumulator)), __read(_this.getDescendants(dataNode))), [dataNode]); }, []);
|
2031
|
+
(_a = this.expansionModel).select.apply(_a, __spreadArray([], __read(allNodes)));
|
2032
|
+
};
|
2033
|
+
/** Gets a list of descendant dataNodes of a subtree rooted at given data node recursively. */
|
2034
|
+
NestedTreeControl.prototype.getDescendants = function (dataNode) {
|
2035
|
+
var descendants = [];
|
2036
|
+
this._getDescendants(descendants, dataNode);
|
2037
|
+
return descendants.splice(1);
|
2038
|
+
};
|
2039
|
+
/** A helper function to get descendants recursively. */
|
2040
|
+
// todo нужно придумать другое название и понять в чем отличие между getDescendants и _getDescendants
|
2041
|
+
/* tslint:disable-next-line:naming-convention */
|
2042
|
+
NestedTreeControl.prototype._getDescendants = function (descendants, dataNode) {
|
2043
|
+
var _this = this;
|
2044
|
+
descendants.push(dataNode);
|
2045
|
+
this.getChildren(dataNode)
|
2046
|
+
.pipe(operators.take(1))
|
2047
|
+
.subscribe(function (children) {
|
2048
|
+
if (children && children.length > 0) {
|
2049
|
+
children.forEach(function (child) { return _this._getDescendants(descendants, child); });
|
2050
|
+
}
|
2051
|
+
});
|
2052
|
+
};
|
2053
|
+
return NestedTreeControl;
|
2054
|
+
}(BaseTreeControl));
|
1252
2055
|
|
1253
2056
|
/**
|
1254
2057
|
* Tree flattener to convert a normal type of node to node with children & level information.
|
@@ -1432,7 +2235,7 @@
|
|
1432
2235
|
var McTreeNestedDataSource = /** @class */ (function (_super) {
|
1433
2236
|
__extends(McTreeNestedDataSource, _super);
|
1434
2237
|
function McTreeNestedDataSource() {
|
1435
|
-
var _this = _super.apply(this,
|
2238
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
1436
2239
|
/* tslint:disable-next-line:naming-convention */
|
1437
2240
|
_this._data = new rxjs.BehaviorSubject([]);
|
1438
2241
|
return _this;
|
@@ -1449,7 +2252,7 @@
|
|
1449
2252
|
});
|
1450
2253
|
McTreeNestedDataSource.prototype.connect = function (collectionViewer) {
|
1451
2254
|
var _this = this;
|
1452
|
-
return rxjs.merge.apply(void 0,
|
2255
|
+
return rxjs.merge.apply(void 0, [collectionViewer.viewChange, this._data]).pipe(operators.map(function () { return _this.data; }));
|
1453
2256
|
};
|
1454
2257
|
McTreeNestedDataSource.prototype.disconnect = function () {
|
1455
2258
|
// no op
|
@@ -1461,23 +2264,38 @@
|
|
1461
2264
|
* Generated bundle index. Do not edit.
|
1462
2265
|
*/
|
1463
2266
|
|
2267
|
+
exports.BaseTreeControl = BaseTreeControl;
|
2268
|
+
exports.FlatTreeControl = FlatTreeControl;
|
1464
2269
|
exports.MC_SELECTION_TREE_VALUE_ACCESSOR = MC_SELECTION_TREE_VALUE_ACCESSOR;
|
1465
2270
|
exports.MC_TREE_OPTION_PARENT_COMPONENT = MC_TREE_OPTION_PARENT_COMPONENT;
|
2271
|
+
exports.McTree = McTree;
|
2272
|
+
exports.McTreeBase = McTreeBase;
|
2273
|
+
exports.McTreeCopyEvent = McTreeCopyEvent;
|
1466
2274
|
exports.McTreeFlatDataSource = McTreeFlatDataSource;
|
1467
2275
|
exports.McTreeFlattener = McTreeFlattener;
|
1468
2276
|
exports.McTreeModule = McTreeModule;
|
1469
2277
|
exports.McTreeNavigationChange = McTreeNavigationChange;
|
1470
2278
|
exports.McTreeNestedDataSource = McTreeNestedDataSource;
|
2279
|
+
exports.McTreeNode = McTreeNode;
|
1471
2280
|
exports.McTreeNodeDef = McTreeNodeDef;
|
2281
|
+
exports.McTreeNodeOutlet = McTreeNodeOutlet;
|
2282
|
+
exports.McTreeNodeOutletContext = McTreeNodeOutletContext;
|
1472
2283
|
exports.McTreeNodePadding = McTreeNodePadding;
|
2284
|
+
exports.McTreeNodeToggleBase = McTreeNodeToggleBase;
|
2285
|
+
exports.McTreeNodeToggleBaseDirective = McTreeNodeToggleBaseDirective;
|
1473
2286
|
exports.McTreeNodeToggleComponent = McTreeNodeToggleComponent;
|
1474
2287
|
exports.McTreeNodeToggleDirective = McTreeNodeToggleDirective;
|
2288
|
+
exports.McTreeNodeToggleMixinBase = McTreeNodeToggleMixinBase;
|
1475
2289
|
exports.McTreeOption = McTreeOption;
|
1476
2290
|
exports.McTreeOptionChange = McTreeOptionChange;
|
2291
|
+
exports.McTreeSelectAllEvent = McTreeSelectAllEvent;
|
1477
2292
|
exports.McTreeSelection = McTreeSelection;
|
1478
2293
|
exports.McTreeSelectionChange = McTreeSelectionChange;
|
2294
|
+
exports.NestedTreeControl = NestedTreeControl;
|
2295
|
+
exports.defaultCompareValues = defaultCompareValues;
|
2296
|
+
exports.defaultCompareViewValues = defaultCompareViewValues;
|
1479
2297
|
|
1480
2298
|
Object.defineProperty(exports, '__esModule', { value: true });
|
1481
2299
|
|
1482
|
-
}))
|
2300
|
+
}));
|
1483
2301
|
//# sourceMappingURL=ptsecurity-mosaic-tree.umd.js.map
|