@ng-matero/extensions 12.5.3 → 13.0.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/README.md +2 -16
- package/_all-color.scss +1 -1
- package/_all-theme.scss +2 -0
- package/_index.scss +3 -1
- package/_theming.scss +3 -1
- package/alert/_alert-theme.scss +2 -2
- package/alert/alert.component.d.ts +3 -0
- package/alert/alert.module.d.ts +6 -0
- package/alert/mtxAlert.d.ts +1 -0
- package/alert/package.json +5 -6
- package/button/button-loading.directive.d.ts +3 -0
- package/button/button.module.d.ts +8 -0
- package/button/mtxButton.d.ts +1 -0
- package/button/package.json +5 -6
- package/checkbox-group/checkbox-group.component.d.ts +3 -0
- package/checkbox-group/checkbox-group.module.d.ts +9 -0
- package/checkbox-group/mtxCheckboxGroup.d.ts +1 -0
- package/checkbox-group/package.json +5 -6
- package/colorpicker/_colorpicker-theme.import.scss +2 -0
- package/colorpicker/_colorpicker-theme.scss +43 -0
- package/colorpicker/colorpicker-animations.d.ts +8 -0
- package/colorpicker/colorpicker-content.scss +4 -0
- package/colorpicker/colorpicker-input.d.ts +92 -0
- package/colorpicker/colorpicker-module.d.ts +15 -0
- package/colorpicker/colorpicker-toggle.d.ts +38 -0
- package/colorpicker/colorpicker-toggle.scss +23 -0
- package/colorpicker/colorpicker.d.ts +131 -0
- package/{extensions.d.ts → colorpicker/mtxColorpicker.d.ts} +1 -0
- package/colorpicker/package.json +10 -0
- package/colorpicker/public-api.d.ts +5 -0
- package/column-resize/column-resize-directives/column-resize-flex.d.ts +3 -0
- package/column-resize/column-resize-directives/column-resize.d.ts +3 -0
- package/column-resize/column-resize-module.d.ts +6 -7
- package/column-resize/column-resize-notifier.d.ts +5 -7
- package/column-resize/column-resize.d.ts +3 -0
- package/column-resize/column-size-store.d.ts +3 -7
- package/column-resize/event-dispatcher.d.ts +3 -0
- package/column-resize/mtxColumnResize.d.ts +1 -0
- package/column-resize/overlay-handle.d.ts +3 -0
- package/column-resize/package.json +5 -6
- package/column-resize/resizable.d.ts +3 -0
- package/column-resize/resize-strategy.d.ts +7 -0
- package/core/datetime/datetime.module.d.ts +8 -0
- package/core/datetime/native-datetime-adapter.d.ts +3 -0
- package/core/density/private/_compatibility.scss +74 -0
- package/core/mtxCore.d.ts +1 -0
- package/core/package.json +5 -6
- package/{pipes/public-api.d.ts → core/pipes/index.d.ts} +0 -0
- package/core/pipes/pipes.module.d.ts +8 -0
- package/{pipes → core/pipes}/to-observable.pipe.d.ts +3 -0
- package/core/public-api.d.ts +1 -0
- package/core/style/_elevation.scss +197 -0
- package/core/style/_private.scss +41 -0
- package/core/style/_variables.scss +44 -0
- package/core/style/_vendor-prefixes.scss +60 -0
- package/core/theming/_palette.scss +746 -0
- package/core/theming/_theming.scss +430 -0
- package/core/typography/_typography-utils.scss +101 -0
- package/core/typography/_typography.scss +273 -0
- package/datetimepicker/_datetimepicker-theme.scss +17 -5
- package/datetimepicker/calendar-body.d.ts +3 -0
- package/datetimepicker/calendar-body.scss +5 -4
- package/datetimepicker/calendar.d.ts +6 -11
- package/datetimepicker/clock.d.ts +13 -9
- package/datetimepicker/datetimepicker-animations.d.ts +7 -5
- package/datetimepicker/datetimepicker-input.d.ts +7 -2
- package/datetimepicker/datetimepicker-module.d.ts +20 -0
- package/datetimepicker/datetimepicker-toggle.d.ts +20 -2
- package/datetimepicker/datetimepicker-toggle.scss +23 -0
- package/datetimepicker/datetimepicker-types.d.ts +1 -0
- package/datetimepicker/datetimepicker.d.ts +73 -25
- package/datetimepicker/month-view.d.ts +7 -4
- package/datetimepicker/mtxDatetimepicker.d.ts +1 -2
- package/datetimepicker/multi-year-view.d.ts +7 -4
- package/datetimepicker/package.json +5 -6
- package/datetimepicker/public-api.d.ts +4 -1
- package/datetimepicker/year-view.d.ts +7 -4
- package/dialog/{dialog.config.d.ts → dialog-config.d.ts} +0 -0
- package/dialog/dialog.component.d.ts +4 -1
- package/dialog/dialog.d.ts +4 -1
- package/dialog/dialog.module.d.ts +10 -0
- package/dialog/mtxDialog.d.ts +1 -0
- package/dialog/package.json +5 -6
- package/dialog/public-api.d.ts +2 -2
- package/esm2020/alert/alert.component.mjs +52 -0
- package/esm2020/alert/alert.module.mjs +18 -0
- package/{esm2015/alert/mtxAlert.js → esm2020/alert/mtxAlert.mjs} +0 -0
- package/{esm2015/alert/public-api.js → esm2020/alert/public-api.mjs} +0 -0
- package/esm2020/button/button-loading.directive.mjs +79 -0
- package/esm2020/button/button.module.mjs +20 -0
- package/{esm2015/button/mtxButton.js → esm2020/button/mtxButton.mjs} +0 -0
- package/{esm2015/button/public-api.js → esm2020/button/public-api.mjs} +0 -0
- package/esm2020/checkbox-group/checkbox-group.component.mjs +234 -0
- package/{esm2015/checkbox-group/checkbox-group.interface.js → esm2020/checkbox-group/checkbox-group.interface.mjs} +0 -0
- package/esm2020/checkbox-group/checkbox-group.module.mjs +21 -0
- package/{esm2015/checkbox-group/mtxCheckboxGroup.js → esm2020/checkbox-group/mtxCheckboxGroup.mjs} +0 -0
- package/{esm2015/checkbox-group/public-api.js → esm2020/checkbox-group/public-api.mjs} +0 -0
- package/esm2020/colorpicker/colorpicker-animations.mjs +16 -0
- package/esm2020/colorpicker/colorpicker-input.mjs +228 -0
- package/esm2020/colorpicker/colorpicker-module.mjs +65 -0
- package/esm2020/colorpicker/colorpicker-toggle.mjs +90 -0
- package/esm2020/colorpicker/colorpicker.mjs +363 -0
- package/esm2020/colorpicker/mtxColorpicker.mjs +5 -0
- package/esm2020/colorpicker/public-api.mjs +6 -0
- package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +45 -0
- package/esm2020/column-resize/column-resize-directives/column-resize.mjs +45 -0
- package/{esm2015/column-resize/column-resize-directives/constants.js → esm2020/column-resize/column-resize-directives/constants.mjs} +0 -0
- package/esm2020/column-resize/column-resize-module.mjs +28 -0
- package/esm2020/column-resize/column-resize-notifier.mjs +47 -0
- package/esm2020/column-resize/column-resize.mjs +82 -0
- package/esm2020/column-resize/column-size-store.mjs +20 -0
- package/esm2020/column-resize/event-dispatcher.mjs +67 -0
- package/{esm2015/column-resize/mtxColumnResize.js → esm2020/column-resize/mtxColumnResize.mjs} +0 -0
- package/esm2020/column-resize/overlay-handle.mjs +146 -0
- package/{esm2015/column-resize/polyfill.js → esm2020/column-resize/polyfill.mjs} +0 -0
- package/{esm2015/column-resize/public-api.js → esm2020/column-resize/public-api.mjs} +0 -0
- package/esm2020/column-resize/resizable.mjs +199 -0
- package/{esm2015/column-resize/resize-ref.js → esm2020/column-resize/resize-ref.mjs} +0 -0
- package/esm2020/column-resize/resize-strategy.mjs +232 -0
- package/{esm2015/column-resize/selectors.js → esm2020/column-resize/selectors.mjs} +0 -0
- package/{esm2015/core/datetime/datetime-adapter.js → esm2020/core/datetime/datetime-adapter.mjs} +0 -0
- package/{esm2015/core/datetime/datetime-formats.js → esm2020/core/datetime/datetime-formats.mjs} +0 -0
- package/esm2020/core/datetime/datetime.module.mjs +42 -0
- package/{esm2015/core/datetime/index.js → esm2020/core/datetime/index.mjs} +0 -0
- package/esm2020/core/datetime/native-datetime-adapter.mjs +138 -0
- package/{esm2015/core/datetime/native-datetime-formats.js → esm2020/core/datetime/native-datetime-formats.mjs} +0 -0
- package/{esm2015/core/mtxCore.js → esm2020/core/mtxCore.mjs} +0 -0
- package/esm2020/core/pipes/index.mjs +3 -0
- package/esm2020/core/pipes/pipes.module.mjs +18 -0
- package/esm2020/core/pipes/to-observable.pipe.mjs +15 -0
- package/{esm2015/core/public-api.js → esm2020/core/public-api.mjs} +2 -1
- package/esm2020/datetimepicker/calendar-body.mjs +78 -0
- package/esm2020/datetimepicker/calendar.mjs +618 -0
- package/esm2020/datetimepicker/clock.mjs +277 -0
- package/esm2020/datetimepicker/datetimepicker-animations.mjs +44 -0
- package/{esm2015/datetimepicker/datetimepicker-errors.js → esm2020/datetimepicker/datetimepicker-errors.mjs} +0 -0
- package/{esm2015/datetimepicker/datetimepicker-filtertype.js → esm2020/datetimepicker/datetimepicker-filtertype.mjs} +0 -0
- package/esm2020/datetimepicker/datetimepicker-input.mjs +344 -0
- package/esm2020/datetimepicker/datetimepicker-module.mjs +75 -0
- package/esm2020/datetimepicker/datetimepicker-toggle.mjs +94 -0
- package/esm2020/datetimepicker/datetimepicker-types.mjs +2 -0
- package/esm2020/datetimepicker/datetimepicker.mjs +492 -0
- package/esm2020/datetimepicker/month-view.mjs +148 -0
- package/esm2020/datetimepicker/mtxDatetimepicker.mjs +5 -0
- package/esm2020/datetimepicker/multi-year-view.mjs +214 -0
- package/esm2020/datetimepicker/public-api.mjs +14 -0
- package/esm2020/datetimepicker/year-view.mjs +138 -0
- package/{esm2015/dialog/dialog.config.js → esm2020/dialog/dialog-config.mjs} +1 -1
- package/esm2020/dialog/dialog.component.mjs +33 -0
- package/esm2020/dialog/dialog.mjs +74 -0
- package/esm2020/dialog/dialog.module.mjs +24 -0
- package/{esm2015/dialog/mtxDialog.js → esm2020/dialog/mtxDialog.mjs} +0 -0
- package/esm2020/dialog/public-api.mjs +5 -0
- package/esm2020/form-group/form-group.component.mjs +37 -0
- package/esm2020/form-group/form-group.module.mjs +18 -0
- package/{esm2015/form-group/mtxFormGroup.js → esm2020/form-group/mtxFormGroup.mjs} +0 -0
- package/{esm2015/form-group/public-api.js → esm2020/form-group/public-api.mjs} +0 -0
- package/esm2020/grid/cell.component.mjs +108 -0
- package/esm2020/grid/column-menu.component.mjs +95 -0
- package/esm2020/grid/column-resize/column-resize-directives/column-resize-flex.mjs +37 -0
- package/esm2020/grid/column-resize/column-resize-directives/column-resize.mjs +37 -0
- package/{esm2015/grid/column-resize/column-resize-directives/common.js → esm2020/grid/column-resize/column-resize-directives/common.mjs} +0 -0
- package/esm2020/grid/column-resize/column-resize-module.mjs +42 -0
- package/esm2020/grid/column-resize/overlay-handle.mjs +60 -0
- package/{esm2015/grid/column-resize/resizable-directives/common.js → esm2020/grid/column-resize/resizable-directives/common.mjs} +0 -0
- package/esm2020/grid/column-resize/resizable-directives/resizable.mjs +62 -0
- package/esm2020/grid/column-resize/resize-strategy.mjs +42 -0
- package/esm2020/grid/expansion-toggle.directive.mjs +64 -0
- package/esm2020/grid/grid.component.mjs +556 -0
- package/{esm2015/grid/grid.interface.js → esm2020/grid/grid.interface.mjs} +0 -0
- package/esm2020/grid/grid.module.mjs +117 -0
- package/esm2020/grid/grid.service.mjs +44 -0
- package/{esm2015/grid/mtxGrid.js → esm2020/grid/mtxGrid.mjs} +0 -0
- package/esm2020/grid/public-api.mjs +16 -0
- package/esm2020/loader/loader.component.mjs +63 -0
- package/esm2020/loader/loader.module.mjs +20 -0
- package/{esm2015/loader/mtxLoader.js → esm2020/loader/mtxLoader.mjs} +0 -0
- package/{esm2015/loader/public-api.js → esm2020/loader/public-api.mjs} +0 -0
- package/esm2020/ng-matero-extensions.mjs +5 -0
- package/{esm2015/popover/mtxPopover.js → esm2020/popover/mtxPopover.mjs} +0 -0
- package/{esm2015/popover/popover-animations.js → esm2020/popover/popover-animations.mjs} +0 -0
- package/{esm2015/popover/popover-errors.js → esm2020/popover/popover-errors.mjs} +0 -0
- package/{esm2015/popover/popover-interfaces.js → esm2020/popover/popover-interfaces.mjs} +0 -0
- package/esm2020/popover/popover-module.mjs +22 -0
- package/esm2020/popover/popover-target.mjs +17 -0
- package/esm2020/popover/popover-trigger.mjs +441 -0
- package/{esm2015/popover/popover-types.js → esm2020/popover/popover-types.mjs} +0 -0
- package/esm2020/popover/popover.mjs +334 -0
- package/{esm2015/popover/public-api.js → esm2020/popover/public-api.mjs} +0 -0
- package/{esm2015/progress/mtxProgress.js → esm2020/progress/mtxProgress.mjs} +0 -0
- package/esm2020/progress/progress.component.mjs +55 -0
- package/esm2020/progress/progress.module.mjs +18 -0
- package/{esm2015/progress/public-api.js → esm2020/progress/public-api.mjs} +0 -0
- package/esm2020/public-api.mjs +5 -0
- package/{esm2015/select/mtxSelect.js → esm2020/select/mtxSelect.mjs} +0 -0
- package/{esm2015/select/option.component.js → esm2020/select/option.component.mjs} +18 -26
- package/{esm2015/select/public-api.js → esm2020/select/public-api.mjs} +0 -0
- package/esm2020/select/select.component.mjs +458 -0
- package/esm2020/select/select.module.mjs +74 -0
- package/esm2020/select/templates.directive.mjs +124 -0
- package/{esm2015/slider/mtxSlider.js → esm2020/slider/mtxSlider.mjs} +0 -0
- package/{esm2015/slider/public-api.js → esm2020/slider/public-api.mjs} +0 -0
- package/esm2020/slider/slider-module.mjs +19 -0
- package/esm2020/slider/slider.mjs +1115 -0
- package/{esm2015/split/interface.js → esm2020/split/interface.mjs} +0 -0
- package/{esm2015/split/mtxSplit.js → esm2020/split/mtxSplit.mjs} +0 -0
- package/{esm2015/split/public-api.js → esm2020/split/public-api.mjs} +0 -0
- package/esm2020/split/split-pane.directive.mjs +149 -0
- package/esm2020/split/split.component.mjs +619 -0
- package/esm2020/split/split.module.mjs +19 -0
- package/esm2020/split/utils.mjs +222 -0
- package/{esm2015/text3d/mtxText3d.js → esm2020/text3d/mtxText3d.mjs} +0 -0
- package/{esm2015/text3d/public-api.js → esm2020/text3d/public-api.mjs} +0 -0
- package/esm2020/text3d/text3d.component.mjs +45 -0
- package/esm2020/text3d/text3d.module.mjs +18 -0
- package/{esm2015/tooltip/mtxTooltip.js → esm2020/tooltip/mtxTooltip.mjs} +0 -0
- package/{esm2015/tooltip/public-api.js → esm2020/tooltip/public-api.mjs} +0 -0
- package/{esm2015/tooltip/tooltip-animations.js → esm2020/tooltip/tooltip-animations.mjs} +0 -0
- package/esm2020/tooltip/tooltip-module.mjs +23 -0
- package/esm2020/tooltip/tooltip.mjs +674 -0
- package/fesm2015/mtxAlert.mjs +74 -0
- package/fesm2015/mtxAlert.mjs.map +1 -0
- package/fesm2015/mtxButton.mjs +102 -0
- package/fesm2015/mtxButton.mjs.map +1 -0
- package/fesm2015/mtxCheckboxGroup.mjs +257 -0
- package/fesm2015/mtxCheckboxGroup.mjs.map +1 -0
- package/fesm2015/mtxColorpicker.mjs +754 -0
- package/fesm2015/mtxColorpicker.mjs.map +1 -0
- package/fesm2015/{mtxColumnResize.js → mtxColumnResize.mjs} +108 -145
- package/fesm2015/mtxColumnResize.mjs.map +1 -0
- package/fesm2015/mtxCore.mjs +362 -0
- package/fesm2015/mtxCore.mjs.map +1 -0
- package/fesm2015/mtxDatetimepicker.mjs +2474 -0
- package/fesm2015/mtxDatetimepicker.mjs.map +1 -0
- package/fesm2015/mtxDialog.mjs +128 -0
- package/fesm2015/mtxDialog.mjs.map +1 -0
- package/fesm2015/mtxFormGroup.mjs +59 -0
- package/fesm2015/mtxFormGroup.mjs.map +1 -0
- package/fesm2015/mtxGrid.mjs +1271 -0
- package/fesm2015/mtxGrid.mjs.map +1 -0
- package/fesm2015/mtxLoader.mjs +87 -0
- package/fesm2015/mtxLoader.mjs.map +1 -0
- package/fesm2015/mtxPopover.mjs +865 -0
- package/fesm2015/mtxPopover.mjs.map +1 -0
- package/fesm2015/mtxProgress.mjs +77 -0
- package/fesm2015/mtxProgress.mjs.map +1 -0
- package/fesm2015/mtxSelect.mjs +712 -0
- package/fesm2015/mtxSelect.mjs.map +1 -0
- package/fesm2015/mtxSlider.mjs +1139 -0
- package/fesm2015/mtxSlider.mjs.map +1 -0
- package/fesm2015/{mtxSplit.js → mtxSplit.mjs} +85 -98
- package/fesm2015/mtxSplit.mjs.map +1 -0
- package/fesm2015/mtxText3d.mjs +67 -0
- package/fesm2015/mtxText3d.mjs.map +1 -0
- package/fesm2015/{mtxTooltip.js → mtxTooltip.mjs} +85 -86
- package/fesm2015/mtxTooltip.mjs.map +1 -0
- package/fesm2015/ng-matero-extensions.mjs +9 -0
- package/fesm2015/ng-matero-extensions.mjs.map +1 -0
- package/fesm2020/mtxAlert.mjs +74 -0
- package/fesm2020/mtxAlert.mjs.map +1 -0
- package/fesm2020/mtxButton.mjs +102 -0
- package/fesm2020/mtxButton.mjs.map +1 -0
- package/fesm2020/mtxCheckboxGroup.mjs +257 -0
- package/fesm2020/mtxCheckboxGroup.mjs.map +1 -0
- package/fesm2020/mtxColorpicker.mjs +750 -0
- package/fesm2020/mtxColorpicker.mjs.map +1 -0
- package/fesm2020/mtxColumnResize.mjs +953 -0
- package/fesm2020/mtxColumnResize.mjs.map +1 -0
- package/{fesm2015/mtxCore.js → fesm2020/mtxCore.mjs} +75 -42
- package/fesm2020/mtxCore.mjs.map +1 -0
- package/fesm2020/mtxDatetimepicker.mjs +2462 -0
- package/fesm2020/mtxDatetimepicker.mjs.map +1 -0
- package/fesm2020/mtxDialog.mjs +129 -0
- package/fesm2020/mtxDialog.mjs.map +1 -0
- package/fesm2020/mtxFormGroup.mjs +59 -0
- package/fesm2020/mtxFormGroup.mjs.map +1 -0
- package/fesm2020/mtxGrid.mjs +1259 -0
- package/fesm2020/mtxGrid.mjs.map +1 -0
- package/fesm2020/mtxLoader.mjs +87 -0
- package/fesm2020/mtxLoader.mjs.map +1 -0
- package/{fesm2015/mtxPopover.js → fesm2020/mtxPopover.mjs} +120 -111
- package/fesm2020/mtxPopover.mjs.map +1 -0
- package/fesm2020/mtxProgress.mjs +77 -0
- package/fesm2020/mtxProgress.mjs.map +1 -0
- package/fesm2020/mtxSelect.mjs +709 -0
- package/fesm2020/mtxSelect.mjs.map +1 -0
- package/{fesm2015/mtxSlider.js → fesm2020/mtxSlider.mjs} +97 -94
- package/fesm2020/mtxSlider.mjs.map +1 -0
- package/fesm2020/mtxSplit.mjs +1007 -0
- package/fesm2020/mtxSplit.mjs.map +1 -0
- package/fesm2020/mtxText3d.mjs +67 -0
- package/fesm2020/mtxText3d.mjs.map +1 -0
- package/fesm2020/mtxTooltip.mjs +718 -0
- package/fesm2020/mtxTooltip.mjs.map +1 -0
- package/fesm2020/ng-matero-extensions.mjs +9 -0
- package/fesm2020/ng-matero-extensions.mjs.map +1 -0
- package/form-group/_form-group-theme.scss +1 -1
- package/form-group/form-group.component.d.ts +5 -4
- package/form-group/form-group.module.d.ts +6 -0
- package/form-group/mtxFormGroup.d.ts +1 -0
- package/form-group/package.json +5 -6
- package/grid/_grid-theme.scss +1 -1
- package/grid/cell.component.d.ts +3 -0
- package/grid/column-menu.component.d.ts +3 -0
- package/grid/column-menu.component.scss +1 -1
- package/grid/column-resize/_column-resize.scss +3 -3
- package/grid/column-resize/column-resize-directives/column-resize-flex.d.ts +3 -0
- package/grid/column-resize/column-resize-directives/column-resize.d.ts +3 -0
- package/grid/column-resize/column-resize-module.d.ts +12 -7
- package/grid/column-resize/overlay-handle.d.ts +3 -0
- package/grid/column-resize/resizable-directives/resizable.d.ts +3 -0
- package/grid/column-resize/resize-strategy.d.ts +3 -0
- package/grid/expansion-toggle.directive.d.ts +3 -0
- package/grid/grid.component.d.ts +20 -1
- package/grid/grid.module.d.ts +26 -0
- package/grid/grid.service.d.ts +3 -0
- package/grid/mtxGrid.d.ts +1 -0
- package/grid/package.json +5 -6
- package/grid/public-api.d.ts +0 -1
- package/loader/_loader-theme.scss +1 -1
- package/loader/loader.component.d.ts +7 -1
- package/loader/loader.module.d.ts +8 -0
- package/loader/mtxLoader.d.ts +1 -0
- package/loader/package.json +5 -6
- package/{color-picker/mtxColorPicker.d.ts → ng-matero-extensions.d.ts} +1 -0
- package/package.json +178 -15
- package/popover/_popover-theme.scss +1 -1
- package/popover/mtxPopover.d.ts +1 -0
- package/popover/package.json +5 -6
- package/popover/popover-module.d.ts +10 -0
- package/popover/popover-target.d.ts +3 -0
- package/popover/popover-trigger.d.ts +3 -0
- package/popover/popover.d.ts +3 -0
- package/progress/_progress-theme.scss +2 -2
- package/progress/mtxProgress.d.ts +1 -0
- package/progress/package.json +5 -6
- package/progress/progress.component.d.ts +3 -0
- package/progress/progress.module.d.ts +6 -0
- package/public-api.d.ts +2 -19
- package/select/_select-theme.scss +1 -1
- package/select/mtxSelect.d.ts +1 -0
- package/select/option.component.d.ts +3 -0
- package/select/package.json +5 -6
- package/select/select.component.d.ts +3 -0
- package/select/select.component.scss +1 -1
- package/select/select.module.d.ts +10 -0
- package/select/templates.directive.d.ts +23 -0
- package/slider/_slider-theme.scss +4 -4
- package/slider/mtxSlider.d.ts +1 -0
- package/slider/package.json +5 -6
- package/slider/slider-module.d.ts +7 -0
- package/slider/slider.d.ts +4 -1
- package/slider/slider.scss +7 -7
- package/split/_split-theme.scss +10 -3
- package/split/mtxSplit.d.ts +1 -0
- package/split/package.json +5 -6
- package/split/split-pane.directive.d.ts +3 -0
- package/split/split.component.d.ts +12 -1
- package/split/split.module.d.ts +7 -0
- package/text3d/_text3d-theme.scss +2 -2
- package/text3d/mtxText3d.d.ts +1 -0
- package/text3d/package.json +5 -6
- package/text3d/text3d.component.d.ts +3 -1
- package/text3d/text3d.module.d.ts +6 -0
- package/tooltip/_tooltip-theme.scss +3 -3
- package/tooltip/mtxTooltip.d.ts +1 -0
- package/tooltip/package.json +5 -6
- package/tooltip/tooltip-module.d.ts +10 -0
- package/tooltip/tooltip.d.ts +5 -0
- package/tooltip/tooltip.scss +1 -1
- package/alert/mtxAlert.metadata.json +0 -1
- package/bundles/extensions.umd.js +0 -164
- package/bundles/extensions.umd.js.map +0 -1
- package/bundles/mtxAlert.umd.js +0 -101
- package/bundles/mtxAlert.umd.js.map +0 -1
- package/bundles/mtxButton.umd.js +0 -119
- package/bundles/mtxButton.umd.js.map +0 -1
- package/bundles/mtxCheckboxGroup.umd.js +0 -284
- package/bundles/mtxCheckboxGroup.umd.js.map +0 -1
- package/bundles/mtxColorPicker.umd.js +0 -337
- package/bundles/mtxColorPicker.umd.js.map +0 -1
- package/bundles/mtxColumnResize.umd.js +0 -1339
- package/bundles/mtxColumnResize.umd.js.map +0 -1
- package/bundles/mtxCore.umd.js +0 -670
- package/bundles/mtxCore.umd.js.map +0 -1
- package/bundles/mtxDatetimepicker.umd.js +0 -2590
- package/bundles/mtxDatetimepicker.umd.js.map +0 -1
- package/bundles/mtxDialog.umd.js +0 -160
- package/bundles/mtxDialog.umd.js.map +0 -1
- package/bundles/mtxFormGroup.umd.js +0 -80
- package/bundles/mtxFormGroup.umd.js.map +0 -1
- package/bundles/mtxGrid.umd.js +0 -1581
- package/bundles/mtxGrid.umd.js.map +0 -1
- package/bundles/mtxLoader.umd.js +0 -104
- package/bundles/mtxLoader.umd.js.map +0 -1
- package/bundles/mtxPipes.umd.js +0 -44
- package/bundles/mtxPipes.umd.js.map +0 -1
- package/bundles/mtxPopover.umd.js +0 -1260
- package/bundles/mtxPopover.umd.js.map +0 -1
- package/bundles/mtxProgress.umd.js +0 -92
- package/bundles/mtxProgress.umd.js.map +0 -1
- package/bundles/mtxSelect.umd.js +0 -1097
- package/bundles/mtxSelect.umd.js.map +0 -1
- package/bundles/mtxSlider.umd.js +0 -1551
- package/bundles/mtxSlider.umd.js.map +0 -1
- package/bundles/mtxSplit.umd.js +0 -1432
- package/bundles/mtxSplit.umd.js.map +0 -1
- package/bundles/mtxText3d.umd.js +0 -92
- package/bundles/mtxText3d.umd.js.map +0 -1
- package/bundles/mtxTooltip.umd.js +0 -1081
- package/bundles/mtxTooltip.umd.js.map +0 -1
- package/button/mtxButton.metadata.json +0 -1
- package/checkbox-group/mtxCheckboxGroup.metadata.json +0 -1
- package/color-picker/color-picker.component.d.ts +0 -120
- package/color-picker/color-picker.module.d.ts +0 -2
- package/color-picker/mtxColorPicker.metadata.json +0 -1
- package/color-picker/package.json +0 -11
- package/color-picker/public-api.d.ts +0 -2
- package/column-resize/mtxColumnResize.metadata.json +0 -1
- package/core/mtxCore.metadata.json +0 -1
- package/datetimepicker/datetimepicker.module.d.ts +0 -2
- package/datetimepicker/mtxDatetimepicker.metadata.json +0 -1
- package/dialog/mtxDialog.metadata.json +0 -1
- package/esm2015/alert/alert.component.js +0 -63
- package/esm2015/alert/alert.module.js +0 -14
- package/esm2015/button/button-loading.directive.js +0 -89
- package/esm2015/button/button.module.js +0 -16
- package/esm2015/checkbox-group/checkbox-group.component.js +0 -235
- package/esm2015/checkbox-group/checkbox-group.module.js +0 -17
- package/esm2015/color-picker/color-picker.component.js +0 -268
- package/esm2015/color-picker/color-picker.module.js +0 -26
- package/esm2015/color-picker/mtxColorPicker.js +0 -5
- package/esm2015/color-picker/public-api.js +0 -3
- package/esm2015/column-resize/column-resize-directives/column-resize-flex.js +0 -54
- package/esm2015/column-resize/column-resize-directives/column-resize.js +0 -54
- package/esm2015/column-resize/column-resize-module.js +0 -24
- package/esm2015/column-resize/column-resize-notifier.js +0 -54
- package/esm2015/column-resize/column-resize.js +0 -80
- package/esm2015/column-resize/column-size-store.js +0 -18
- package/esm2015/column-resize/event-dispatcher.js +0 -75
- package/esm2015/column-resize/overlay-handle.js +0 -144
- package/esm2015/column-resize/resizable.js +0 -197
- package/esm2015/column-resize/resize-strategy.js +0 -245
- package/esm2015/core/datetime/datetime.module.js +0 -32
- package/esm2015/core/datetime/native-datetime-adapter.js +0 -144
- package/esm2015/datetimepicker/calendar-body.js +0 -75
- package/esm2015/datetimepicker/calendar.js +0 -629
- package/esm2015/datetimepicker/clock.js +0 -283
- package/esm2015/datetimepicker/datetimepicker-animations.js +0 -30
- package/esm2015/datetimepicker/datetimepicker-input.js +0 -333
- package/esm2015/datetimepicker/datetimepicker-toggle.js +0 -81
- package/esm2015/datetimepicker/datetimepicker.js +0 -411
- package/esm2015/datetimepicker/datetimepicker.module.js +0 -49
- package/esm2015/datetimepicker/month-view.js +0 -149
- package/esm2015/datetimepicker/mtxDatetimepicker.js +0 -7
- package/esm2015/datetimepicker/multi-year-view.js +0 -214
- package/esm2015/datetimepicker/public-api.js +0 -11
- package/esm2015/datetimepicker/year-view.js +0 -140
- package/esm2015/dialog/dialog.component.js +0 -40
- package/esm2015/dialog/dialog.js +0 -81
- package/esm2015/dialog/dialog.module.js +0 -21
- package/esm2015/dialog/public-api.js +0 -5
- package/esm2015/extensions-experimental.module.js +0 -13
- package/esm2015/extensions.js +0 -5
- package/esm2015/extensions.module.js +0 -40
- package/esm2015/form-group/form-group.component.js +0 -47
- package/esm2015/form-group/form-group.module.js +0 -14
- package/esm2015/grid/cell-selection.directive.js +0 -62
- package/esm2015/grid/cell.component.js +0 -115
- package/esm2015/grid/column-menu.component.js +0 -72
- package/esm2015/grid/column-resize/column-resize-directives/column-resize-flex.js +0 -47
- package/esm2015/grid/column-resize/column-resize-directives/column-resize.js +0 -47
- package/esm2015/grid/column-resize/column-resize-module.js +0 -36
- package/esm2015/grid/column-resize/overlay-handle.js +0 -68
- package/esm2015/grid/column-resize/resizable-directives/resizable.js +0 -75
- package/esm2015/grid/column-resize/resize-strategy.js +0 -45
- package/esm2015/grid/expansion-toggle.directive.js +0 -62
- package/esm2015/grid/grid.component.js +0 -418
- package/esm2015/grid/grid.module.js +0 -69
- package/esm2015/grid/grid.service.js +0 -50
- package/esm2015/grid/public-api.js +0 -17
- package/esm2015/loader/loader.component.js +0 -66
- package/esm2015/loader/loader.module.js +0 -16
- package/esm2015/pipes/mtxPipes.js +0 -5
- package/esm2015/pipes/pipes.module.js +0 -14
- package/esm2015/pipes/public-api.js +0 -3
- package/esm2015/pipes/to-observable.pipe.js +0 -12
- package/esm2015/popover/popover-module.js +0 -18
- package/esm2015/popover/popover-target.js +0 -24
- package/esm2015/popover/popover-trigger.js +0 -434
- package/esm2015/popover/popover.js +0 -326
- package/esm2015/progress/progress.component.js +0 -54
- package/esm2015/progress/progress.module.js +0 -14
- package/esm2015/public-api.js +0 -23
- package/esm2015/select/select.component.js +0 -380
- package/esm2015/select/select.module.js +0 -46
- package/esm2015/select/templates.directive.js +0 -211
- package/esm2015/slider/slider-module.js +0 -15
- package/esm2015/slider/slider.js +0 -1115
- package/esm2015/split/split-pane.directive.js +0 -156
- package/esm2015/split/split.component.js +0 -622
- package/esm2015/split/split.module.js +0 -15
- package/esm2015/split/utils.js +0 -227
- package/esm2015/text3d/text3d.component.js +0 -53
- package/esm2015/text3d/text3d.module.js +0 -14
- package/esm2015/tooltip/tooltip-module.js +0 -20
- package/esm2015/tooltip/tooltip.js +0 -681
- package/extensions-experimental.module.d.ts +0 -2
- package/extensions.metadata.json +0 -1
- package/extensions.module.d.ts +0 -2
- package/fesm2015/extensions.js +0 -80
- package/fesm2015/extensions.js.map +0 -1
- package/fesm2015/mtxAlert.js +0 -82
- package/fesm2015/mtxAlert.js.map +0 -1
- package/fesm2015/mtxButton.js +0 -108
- package/fesm2015/mtxButton.js.map +0 -1
- package/fesm2015/mtxCheckboxGroup.js +0 -255
- package/fesm2015/mtxCheckboxGroup.js.map +0 -1
- package/fesm2015/mtxColorPicker.js +0 -295
- package/fesm2015/mtxColorPicker.js.map +0 -1
- package/fesm2015/mtxColumnResize.js.map +0 -1
- package/fesm2015/mtxCore.js.map +0 -1
- package/fesm2015/mtxDatetimepicker.js +0 -2355
- package/fesm2015/mtxDatetimepicker.js.map +0 -1
- package/fesm2015/mtxDialog.js +0 -141
- package/fesm2015/mtxDialog.js.map +0 -1
- package/fesm2015/mtxFormGroup.js +0 -66
- package/fesm2015/mtxFormGroup.js.map +0 -1
- package/fesm2015/mtxGrid.js +0 -1186
- package/fesm2015/mtxGrid.js.map +0 -1
- package/fesm2015/mtxLoader.js +0 -87
- package/fesm2015/mtxLoader.js.map +0 -1
- package/fesm2015/mtxPipes.js +0 -31
- package/fesm2015/mtxPipes.js.map +0 -1
- package/fesm2015/mtxPopover.js.map +0 -1
- package/fesm2015/mtxProgress.js +0 -73
- package/fesm2015/mtxProgress.js.map +0 -1
- package/fesm2015/mtxSelect.js +0 -700
- package/fesm2015/mtxSelect.js.map +0 -1
- package/fesm2015/mtxSlider.js.map +0 -1
- package/fesm2015/mtxSplit.js.map +0 -1
- package/fesm2015/mtxText3d.js +0 -72
- package/fesm2015/mtxText3d.js.map +0 -1
- package/fesm2015/mtxTooltip.js.map +0 -1
- package/form-group/mtxFormGroup.metadata.json +0 -1
- package/grid/cell-selection.directive.d.ts +0 -17
- package/grid/mtxGrid.metadata.json +0 -1
- package/loader/mtxLoader.metadata.json +0 -1
- package/pipes/mtxPipes.d.ts +0 -4
- package/pipes/mtxPipes.metadata.json +0 -1
- package/pipes/package.json +0 -11
- package/pipes/pipes.module.d.ts +0 -2
- package/popover/mtxPopover.metadata.json +0 -1
- package/progress/mtxProgress.metadata.json +0 -1
- package/select/mtxSelect.metadata.json +0 -1
- package/slider/mtxSlider.metadata.json +0 -1
- package/split/mtxSplit.metadata.json +0 -1
- package/text3d/mtxText3d.metadata.json +0 -1
- package/tooltip/mtxTooltip.metadata.json +0 -1
|
@@ -0,0 +1,718 @@
|
|
|
1
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
2
|
+
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
3
|
+
import * as i4 from '@angular/cdk/a11y';
|
|
4
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
5
|
+
import * as i7 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { InjectionToken, TemplateRef, Directive, Inject, Optional, Input, Component, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
9
|
+
import { MatCommonModule } from '@angular/material/core';
|
|
10
|
+
import * as i2 from '@angular/cdk/scrolling';
|
|
11
|
+
import { CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
12
|
+
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
13
|
+
import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
14
|
+
import * as i6 from '@angular/cdk/layout';
|
|
15
|
+
import { Breakpoints } from '@angular/cdk/layout';
|
|
16
|
+
import * as i3 from '@angular/cdk/platform';
|
|
17
|
+
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
18
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
19
|
+
import { Subject } from 'rxjs';
|
|
20
|
+
import { takeUntil, take } from 'rxjs/operators';
|
|
21
|
+
import { trigger, state, style, transition, animate, keyframes } from '@angular/animations';
|
|
22
|
+
import * as i5 from '@angular/cdk/bidi';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Animations used by MtxTooltip.
|
|
26
|
+
* @docs-private
|
|
27
|
+
*/
|
|
28
|
+
const mtxTooltipAnimations = {
|
|
29
|
+
/** Animation that transitions a tooltip in and out. */
|
|
30
|
+
tooltipState: trigger('state', [
|
|
31
|
+
state('initial, void, hidden', style({ opacity: 0, transform: 'scale(0)' })),
|
|
32
|
+
state('visible', style({ transform: 'scale(1)' })),
|
|
33
|
+
transition('* => visible', animate('200ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
|
|
34
|
+
style({ opacity: 0, transform: 'scale(0)', offset: 0 }),
|
|
35
|
+
style({ opacity: 0.5, transform: 'scale(0.99)', offset: 0.5 }),
|
|
36
|
+
style({ opacity: 1, transform: 'scale(1)', offset: 1 }),
|
|
37
|
+
]))),
|
|
38
|
+
transition('* => hidden', animate('100ms cubic-bezier(0, 0, 0.2, 1)', style({ opacity: 0 }))),
|
|
39
|
+
]),
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** Time in ms to throttle repositioning after scroll events. */
|
|
43
|
+
const SCROLL_THROTTLE_MS = 20;
|
|
44
|
+
/** CSS class that will be attached to the overlay panel. */
|
|
45
|
+
const TOOLTIP_PANEL_CLASS = 'mtx-tooltip-panel';
|
|
46
|
+
/** Options used to bind passive event listeners. */
|
|
47
|
+
const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
48
|
+
/**
|
|
49
|
+
* Time between the user putting the pointer on a tooltip
|
|
50
|
+
* trigger and the long press event being fired.
|
|
51
|
+
*/
|
|
52
|
+
const LONGPRESS_DELAY = 500;
|
|
53
|
+
/**
|
|
54
|
+
* Creates an error to be thrown if the user supplied an invalid tooltip position.
|
|
55
|
+
* @docs-private
|
|
56
|
+
*/
|
|
57
|
+
function getMtxTooltipInvalidPositionError(position) {
|
|
58
|
+
return Error(`Tooltip position "${position}" is invalid.`);
|
|
59
|
+
}
|
|
60
|
+
/** Injection token that determines the scroll handling while a tooltip is visible. */
|
|
61
|
+
const MTX_TOOLTIP_SCROLL_STRATEGY = new InjectionToken('mtx-tooltip-scroll-strategy');
|
|
62
|
+
/** @docs-private */
|
|
63
|
+
function MTX_TOOLTIP_SCROLL_STRATEGY_FACTORY(overlay) {
|
|
64
|
+
return () => overlay.scrollStrategies.reposition({ scrollThrottle: SCROLL_THROTTLE_MS });
|
|
65
|
+
}
|
|
66
|
+
/** @docs-private */
|
|
67
|
+
const MTX_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER = {
|
|
68
|
+
provide: MTX_TOOLTIP_SCROLL_STRATEGY,
|
|
69
|
+
deps: [Overlay],
|
|
70
|
+
useFactory: MTX_TOOLTIP_SCROLL_STRATEGY_FACTORY,
|
|
71
|
+
};
|
|
72
|
+
/** Injection token to be used to override the default options for `matTooltip`. */
|
|
73
|
+
const MTX_TOOLTIP_DEFAULT_OPTIONS = new InjectionToken('mtx-tooltip-default-options', {
|
|
74
|
+
providedIn: 'root',
|
|
75
|
+
factory: MTX_TOOLTIP_DEFAULT_OPTIONS_FACTORY,
|
|
76
|
+
});
|
|
77
|
+
/** @docs-private */
|
|
78
|
+
function MTX_TOOLTIP_DEFAULT_OPTIONS_FACTORY() {
|
|
79
|
+
return {
|
|
80
|
+
showDelay: 0,
|
|
81
|
+
hideDelay: 0,
|
|
82
|
+
touchendHideDelay: 1500,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Directive that attaches a material design tooltip to the host element. Animates the showing and
|
|
87
|
+
* hiding of a tooltip provided position (defaults to below the element).
|
|
88
|
+
*
|
|
89
|
+
* https://material.io/design/components/tooltips.html
|
|
90
|
+
*/
|
|
91
|
+
class MtxTooltip {
|
|
92
|
+
constructor(_overlay, _elementRef, _scrollDispatcher, _viewContainerRef, _ngZone, _platform, _ariaDescriber, _focusMonitor, scrollStrategy, _dir, _defaultOptions) {
|
|
93
|
+
this._overlay = _overlay;
|
|
94
|
+
this._elementRef = _elementRef;
|
|
95
|
+
this._scrollDispatcher = _scrollDispatcher;
|
|
96
|
+
this._viewContainerRef = _viewContainerRef;
|
|
97
|
+
this._ngZone = _ngZone;
|
|
98
|
+
this._platform = _platform;
|
|
99
|
+
this._ariaDescriber = _ariaDescriber;
|
|
100
|
+
this._focusMonitor = _focusMonitor;
|
|
101
|
+
this._dir = _dir;
|
|
102
|
+
this._defaultOptions = _defaultOptions;
|
|
103
|
+
this._position = 'below';
|
|
104
|
+
this._disabled = false;
|
|
105
|
+
this._viewInitialized = false;
|
|
106
|
+
this._pointerExitEventsInitialized = false;
|
|
107
|
+
/** The default delay in ms before showing the tooltip after show is called */
|
|
108
|
+
this.showDelay = this._defaultOptions.showDelay;
|
|
109
|
+
/** The default delay in ms before hiding the tooltip after hide is called */
|
|
110
|
+
this.hideDelay = this._defaultOptions.hideDelay;
|
|
111
|
+
/**
|
|
112
|
+
* How touch gestures should be handled by the tooltip. On touch devices the tooltip directive
|
|
113
|
+
* uses a long press gesture to show and hide, however it can conflict with the native browser
|
|
114
|
+
* gestures. To work around the conflict, Angular Material disables native gestures on the
|
|
115
|
+
* trigger, but that might not be desirable on particular elements (e.g. inputs and draggable
|
|
116
|
+
* elements). The different values for this option configure the touch event handling as follows:
|
|
117
|
+
* - `auto` - Enables touch gestures for all elements, but tries to avoid conflicts with native
|
|
118
|
+
* browser gestures on particular elements. In particular, it allows text selection on inputs
|
|
119
|
+
* and textareas, and preserves the native browser dragging on elements marked as `draggable`.
|
|
120
|
+
* - `on` - Enables touch gestures for all elements and disables native
|
|
121
|
+
* browser gestures with no exceptions.
|
|
122
|
+
* - `off` - Disables touch gestures. Note that this will prevent the tooltip from
|
|
123
|
+
* showing on touch devices.
|
|
124
|
+
*/
|
|
125
|
+
this.touchGestures = 'auto';
|
|
126
|
+
this._message = '';
|
|
127
|
+
/** Manually-bound passive event listeners. */
|
|
128
|
+
this._passiveListeners = [];
|
|
129
|
+
/** Emits when the component is destroyed. */
|
|
130
|
+
this._destroyed = new Subject();
|
|
131
|
+
/**
|
|
132
|
+
* Handles the keydown events on the host element.
|
|
133
|
+
* Needs to be an arrow function so that we can use it in addEventListener.
|
|
134
|
+
*/
|
|
135
|
+
this._handleKeydown = (event) => {
|
|
136
|
+
if (this._isTooltipVisible() && event.keyCode === ESCAPE && !hasModifierKey(event)) {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
event.stopPropagation();
|
|
139
|
+
this._ngZone.run(() => this.hide(0));
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
this._scrollStrategy = scrollStrategy;
|
|
143
|
+
if (_defaultOptions) {
|
|
144
|
+
if (_defaultOptions.position) {
|
|
145
|
+
this.position = _defaultOptions.position;
|
|
146
|
+
}
|
|
147
|
+
if (_defaultOptions.touchGestures) {
|
|
148
|
+
this.touchGestures = _defaultOptions.touchGestures;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
_ngZone.runOutsideAngular(() => {
|
|
152
|
+
_elementRef.nativeElement.addEventListener('keydown', this._handleKeydown);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/** Allows the user to define the position of the tooltip relative to the parent element */
|
|
156
|
+
get position() {
|
|
157
|
+
return this._position;
|
|
158
|
+
}
|
|
159
|
+
set position(value) {
|
|
160
|
+
if (value !== this._position) {
|
|
161
|
+
this._position = value;
|
|
162
|
+
if (this._overlayRef) {
|
|
163
|
+
this._updatePosition();
|
|
164
|
+
if (this._tooltipInstance) {
|
|
165
|
+
this._tooltipInstance.show(0);
|
|
166
|
+
}
|
|
167
|
+
this._overlayRef.updatePosition();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/** Disables the display of the tooltip. */
|
|
172
|
+
get disabled() {
|
|
173
|
+
return this._disabled;
|
|
174
|
+
}
|
|
175
|
+
set disabled(value) {
|
|
176
|
+
this._disabled = coerceBooleanProperty(value);
|
|
177
|
+
// If tooltip is disabled, hide immediately.
|
|
178
|
+
if (this._disabled) {
|
|
179
|
+
this.hide(0);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this._setupPointerEnterEventsIfNeeded();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/** The message to be displayed in the tooltip */
|
|
186
|
+
get message() {
|
|
187
|
+
return this._message;
|
|
188
|
+
}
|
|
189
|
+
set message(value) {
|
|
190
|
+
this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this._message);
|
|
191
|
+
// TODO: If the message is a TemplateRef, it's hard to support a11y.
|
|
192
|
+
// If the message is not a string (e.g. number), convert it to a string and trim it.
|
|
193
|
+
this._message = value instanceof TemplateRef ? value : value != null ? `${value}`.trim() : '';
|
|
194
|
+
if (!this._message && this._isTooltipVisible()) {
|
|
195
|
+
this.hide(0);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
this._setupPointerEnterEventsIfNeeded();
|
|
199
|
+
this._updateTooltipMessage();
|
|
200
|
+
this._ngZone.runOutsideAngular(() => {
|
|
201
|
+
// The `AriaDescriber` has some functionality that avoids adding a description if it's the
|
|
202
|
+
// same as the `aria-label` of an element, however we can't know whether the tooltip trigger
|
|
203
|
+
// has a data-bound `aria-label` or when it'll be set for the first time. We can avoid the
|
|
204
|
+
// issue by deferring the description by a tick so Angular has time to set the `aria-label`.
|
|
205
|
+
Promise.resolve().then(() => {
|
|
206
|
+
this._ariaDescriber.describe(this._elementRef.nativeElement, this.message);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/** Classes to be passed to the tooltip. Supports the same syntax as `ngClass`. */
|
|
212
|
+
get tooltipClass() {
|
|
213
|
+
return this._tooltipClass;
|
|
214
|
+
}
|
|
215
|
+
set tooltipClass(value) {
|
|
216
|
+
this._tooltipClass = value;
|
|
217
|
+
if (this._tooltipInstance) {
|
|
218
|
+
this._setTooltipClass(this._tooltipClass);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
ngAfterViewInit() {
|
|
222
|
+
// This needs to happen after view init so the initial values for all inputs have been set.
|
|
223
|
+
this._viewInitialized = true;
|
|
224
|
+
this._setupPointerEnterEventsIfNeeded();
|
|
225
|
+
this._focusMonitor
|
|
226
|
+
.monitor(this._elementRef)
|
|
227
|
+
.pipe(takeUntil(this._destroyed))
|
|
228
|
+
.subscribe(origin => {
|
|
229
|
+
// Note that the focus monitor runs outside the Angular zone.
|
|
230
|
+
if (!origin) {
|
|
231
|
+
this._ngZone.run(() => this.hide(0));
|
|
232
|
+
}
|
|
233
|
+
else if (origin === 'keyboard') {
|
|
234
|
+
this._ngZone.run(() => this.show());
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Dispose the tooltip when destroyed.
|
|
240
|
+
*/
|
|
241
|
+
ngOnDestroy() {
|
|
242
|
+
const nativeElement = this._elementRef.nativeElement;
|
|
243
|
+
clearTimeout(this._touchstartTimeout);
|
|
244
|
+
if (this._overlayRef) {
|
|
245
|
+
this._overlayRef.dispose();
|
|
246
|
+
this._tooltipInstance = null;
|
|
247
|
+
}
|
|
248
|
+
// Clean up the event listeners set in the constructor
|
|
249
|
+
nativeElement.removeEventListener('keydown', this._handleKeydown);
|
|
250
|
+
this._passiveListeners.forEach(([event, listener]) => {
|
|
251
|
+
nativeElement.removeEventListener(event, listener, passiveListenerOptions);
|
|
252
|
+
});
|
|
253
|
+
this._passiveListeners.length = 0;
|
|
254
|
+
this._destroyed.next();
|
|
255
|
+
this._destroyed.complete();
|
|
256
|
+
this._ariaDescriber.removeDescription(nativeElement, this.message);
|
|
257
|
+
this._focusMonitor.stopMonitoring(nativeElement);
|
|
258
|
+
}
|
|
259
|
+
/** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */
|
|
260
|
+
show(delay = this.showDelay) {
|
|
261
|
+
if (this.disabled ||
|
|
262
|
+
!this.message ||
|
|
263
|
+
(this._isTooltipVisible() &&
|
|
264
|
+
!this._tooltipInstance._showTimeoutId &&
|
|
265
|
+
!this._tooltipInstance._hideTimeoutId)) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const overlayRef = this._createOverlay();
|
|
269
|
+
this._detach();
|
|
270
|
+
this._portal = this._portal || new ComponentPortal(TooltipComponent, this._viewContainerRef);
|
|
271
|
+
this._tooltipInstance = overlayRef.attach(this._portal).instance;
|
|
272
|
+
this._tooltipInstance
|
|
273
|
+
.afterHidden()
|
|
274
|
+
.pipe(takeUntil(this._destroyed))
|
|
275
|
+
.subscribe(() => this._detach());
|
|
276
|
+
this._setTooltipClass(this._tooltipClass);
|
|
277
|
+
this._updateTooltipMessage();
|
|
278
|
+
this._tooltipInstance.show(delay);
|
|
279
|
+
}
|
|
280
|
+
/** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */
|
|
281
|
+
hide(delay = this.hideDelay) {
|
|
282
|
+
if (this._tooltipInstance) {
|
|
283
|
+
this._tooltipInstance.hide(delay);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/** Shows/hides the tooltip */
|
|
287
|
+
toggle() {
|
|
288
|
+
this._isTooltipVisible() ? this.hide() : this.show();
|
|
289
|
+
}
|
|
290
|
+
/** Returns true if the tooltip is currently visible to the user */
|
|
291
|
+
_isTooltipVisible() {
|
|
292
|
+
return !!this._tooltipInstance && this._tooltipInstance.isVisible();
|
|
293
|
+
}
|
|
294
|
+
/** Create the overlay config and position strategy */
|
|
295
|
+
_createOverlay() {
|
|
296
|
+
if (this._overlayRef) {
|
|
297
|
+
return this._overlayRef;
|
|
298
|
+
}
|
|
299
|
+
const scrollableAncestors = this._scrollDispatcher.getAncestorScrollContainers(this._elementRef);
|
|
300
|
+
// Create connected position strategy that listens for scroll events to reposition.
|
|
301
|
+
const strategy = this._overlay
|
|
302
|
+
.position()
|
|
303
|
+
.flexibleConnectedTo(this._elementRef)
|
|
304
|
+
.withTransformOriginOn('.mtx-tooltip')
|
|
305
|
+
.withFlexibleDimensions(false)
|
|
306
|
+
.withViewportMargin(8)
|
|
307
|
+
.withScrollableContainers(scrollableAncestors);
|
|
308
|
+
strategy.positionChanges.pipe(takeUntil(this._destroyed)).subscribe(change => {
|
|
309
|
+
if (this._tooltipInstance) {
|
|
310
|
+
if (change.scrollableViewProperties.isOverlayClipped && this._tooltipInstance.isVisible()) {
|
|
311
|
+
// After position changes occur and the overlay is clipped by
|
|
312
|
+
// a parent scrollable then close the tooltip.
|
|
313
|
+
this._ngZone.run(() => this.hide(0));
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
this._overlayRef = this._overlay.create({
|
|
318
|
+
direction: this._dir,
|
|
319
|
+
positionStrategy: strategy,
|
|
320
|
+
panelClass: TOOLTIP_PANEL_CLASS,
|
|
321
|
+
scrollStrategy: this._scrollStrategy(),
|
|
322
|
+
});
|
|
323
|
+
this._updatePosition();
|
|
324
|
+
this._overlayRef
|
|
325
|
+
.detachments()
|
|
326
|
+
.pipe(takeUntil(this._destroyed))
|
|
327
|
+
.subscribe(() => this._detach());
|
|
328
|
+
return this._overlayRef;
|
|
329
|
+
}
|
|
330
|
+
/** Detaches the currently-attached tooltip. */
|
|
331
|
+
_detach() {
|
|
332
|
+
if (this._overlayRef && this._overlayRef.hasAttached()) {
|
|
333
|
+
this._overlayRef.detach();
|
|
334
|
+
}
|
|
335
|
+
this._tooltipInstance = null;
|
|
336
|
+
}
|
|
337
|
+
/** Updates the position of the current tooltip. */
|
|
338
|
+
_updatePosition() {
|
|
339
|
+
const position = this._overlayRef.getConfig()
|
|
340
|
+
.positionStrategy;
|
|
341
|
+
const origin = this._getOrigin();
|
|
342
|
+
const overlay = this._getOverlayPosition();
|
|
343
|
+
position.withPositions([
|
|
344
|
+
{ ...origin.main, ...overlay.main },
|
|
345
|
+
{ ...origin.fallback, ...overlay.fallback },
|
|
346
|
+
]);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Returns the origin position and a fallback position based on the user's position preference.
|
|
350
|
+
* The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).
|
|
351
|
+
*/
|
|
352
|
+
_getOrigin() {
|
|
353
|
+
const isLtr = !this._dir || this._dir.value === 'ltr';
|
|
354
|
+
const position = this.position;
|
|
355
|
+
let originPosition;
|
|
356
|
+
if (position === 'above' || position === 'below') {
|
|
357
|
+
originPosition = { originX: 'center', originY: position === 'above' ? 'top' : 'bottom' };
|
|
358
|
+
}
|
|
359
|
+
else if (position === 'before' ||
|
|
360
|
+
(position === 'left' && isLtr) ||
|
|
361
|
+
(position === 'right' && !isLtr)) {
|
|
362
|
+
originPosition = { originX: 'start', originY: 'center' };
|
|
363
|
+
}
|
|
364
|
+
else if (position === 'after' ||
|
|
365
|
+
(position === 'right' && isLtr) ||
|
|
366
|
+
(position === 'left' && !isLtr)) {
|
|
367
|
+
originPosition = { originX: 'end', originY: 'center' };
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
throw getMtxTooltipInvalidPositionError(position);
|
|
371
|
+
}
|
|
372
|
+
const { x, y } = this._invertPosition(originPosition.originX, originPosition.originY);
|
|
373
|
+
return {
|
|
374
|
+
main: originPosition,
|
|
375
|
+
fallback: { originX: x, originY: y },
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
/** Returns the overlay position and a fallback position based on the user's preference */
|
|
379
|
+
_getOverlayPosition() {
|
|
380
|
+
const isLtr = !this._dir || this._dir.value === 'ltr';
|
|
381
|
+
const position = this.position;
|
|
382
|
+
let overlayPosition;
|
|
383
|
+
if (position === 'above') {
|
|
384
|
+
overlayPosition = { overlayX: 'center', overlayY: 'bottom' };
|
|
385
|
+
}
|
|
386
|
+
else if (position === 'below') {
|
|
387
|
+
overlayPosition = { overlayX: 'center', overlayY: 'top' };
|
|
388
|
+
}
|
|
389
|
+
else if (position === 'before' ||
|
|
390
|
+
(position === 'left' && isLtr) ||
|
|
391
|
+
(position === 'right' && !isLtr)) {
|
|
392
|
+
overlayPosition = { overlayX: 'end', overlayY: 'center' };
|
|
393
|
+
}
|
|
394
|
+
else if (position === 'after' ||
|
|
395
|
+
(position === 'right' && isLtr) ||
|
|
396
|
+
(position === 'left' && !isLtr)) {
|
|
397
|
+
overlayPosition = { overlayX: 'start', overlayY: 'center' };
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
throw getMtxTooltipInvalidPositionError(position);
|
|
401
|
+
}
|
|
402
|
+
const { x, y } = this._invertPosition(overlayPosition.overlayX, overlayPosition.overlayY);
|
|
403
|
+
return {
|
|
404
|
+
main: overlayPosition,
|
|
405
|
+
fallback: { overlayX: x, overlayY: y },
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
/** Updates the tooltip message and repositions the overlay according to the new message length */
|
|
409
|
+
_updateTooltipMessage() {
|
|
410
|
+
// Must wait for the message to be painted to the tooltip so that the overlay can properly
|
|
411
|
+
// calculate the correct positioning based on the size of the text.
|
|
412
|
+
if (this._tooltipInstance) {
|
|
413
|
+
this._tooltipInstance.message = this.message;
|
|
414
|
+
this._tooltipInstance._markForCheck();
|
|
415
|
+
this._ngZone.onMicrotaskEmpty
|
|
416
|
+
.asObservable()
|
|
417
|
+
.pipe(take(1), takeUntil(this._destroyed))
|
|
418
|
+
.subscribe(() => {
|
|
419
|
+
if (this._tooltipInstance) {
|
|
420
|
+
this._overlayRef.updatePosition();
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
/** Updates the tooltip class */
|
|
426
|
+
_setTooltipClass(tooltipClass) {
|
|
427
|
+
if (this._tooltipInstance) {
|
|
428
|
+
this._tooltipInstance.tooltipClass = tooltipClass;
|
|
429
|
+
this._tooltipInstance._markForCheck();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
/** Inverts an overlay position. */
|
|
433
|
+
_invertPosition(x, y) {
|
|
434
|
+
if (this.position === 'above' || this.position === 'below') {
|
|
435
|
+
if (y === 'top') {
|
|
436
|
+
y = 'bottom';
|
|
437
|
+
}
|
|
438
|
+
else if (y === 'bottom') {
|
|
439
|
+
y = 'top';
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
if (x === 'end') {
|
|
444
|
+
x = 'start';
|
|
445
|
+
}
|
|
446
|
+
else if (x === 'start') {
|
|
447
|
+
x = 'end';
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
return { x, y };
|
|
451
|
+
}
|
|
452
|
+
/** Binds the pointer events to the tooltip trigger. */
|
|
453
|
+
_setupPointerEnterEventsIfNeeded() {
|
|
454
|
+
// Optimization: Defer hooking up events if there's no message or the tooltip is disabled.
|
|
455
|
+
if (this._disabled ||
|
|
456
|
+
!this.message ||
|
|
457
|
+
!this._viewInitialized ||
|
|
458
|
+
this._passiveListeners.length) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
// The mouse events shouldn't be bound on mobile devices, because they can prevent the
|
|
462
|
+
// first tap from firing its click event or can cause the tooltip to open for clicks.
|
|
463
|
+
if (this._platformSupportsMouseEvents()) {
|
|
464
|
+
this._passiveListeners.push([
|
|
465
|
+
'mouseenter',
|
|
466
|
+
() => {
|
|
467
|
+
this._setupPointerExitEventsIfNeeded();
|
|
468
|
+
this.show();
|
|
469
|
+
},
|
|
470
|
+
]);
|
|
471
|
+
}
|
|
472
|
+
else if (this.touchGestures !== 'off') {
|
|
473
|
+
this._disableNativeGesturesIfNecessary();
|
|
474
|
+
this._passiveListeners.push([
|
|
475
|
+
'touchstart',
|
|
476
|
+
() => {
|
|
477
|
+
// Note that it's important that we don't `preventDefault` here,
|
|
478
|
+
// because it can prevent click events from firing on the element.
|
|
479
|
+
this._setupPointerExitEventsIfNeeded();
|
|
480
|
+
clearTimeout(this._touchstartTimeout);
|
|
481
|
+
this._touchstartTimeout = setTimeout(() => this.show(), LONGPRESS_DELAY);
|
|
482
|
+
},
|
|
483
|
+
]);
|
|
484
|
+
}
|
|
485
|
+
this._addListeners(this._passiveListeners);
|
|
486
|
+
}
|
|
487
|
+
_setupPointerExitEventsIfNeeded() {
|
|
488
|
+
if (this._pointerExitEventsInitialized) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
this._pointerExitEventsInitialized = true;
|
|
492
|
+
const exitListeners = [];
|
|
493
|
+
if (this._platformSupportsMouseEvents()) {
|
|
494
|
+
exitListeners.push(['mouseleave', () => this.hide()]);
|
|
495
|
+
}
|
|
496
|
+
else if (this.touchGestures !== 'off') {
|
|
497
|
+
this._disableNativeGesturesIfNecessary();
|
|
498
|
+
const touchendListener = () => {
|
|
499
|
+
clearTimeout(this._touchstartTimeout);
|
|
500
|
+
this.hide(this._defaultOptions.touchendHideDelay);
|
|
501
|
+
};
|
|
502
|
+
exitListeners.push(['touchend', touchendListener], ['touchcancel', touchendListener]);
|
|
503
|
+
}
|
|
504
|
+
this._addListeners(exitListeners);
|
|
505
|
+
this._passiveListeners.push(...exitListeners);
|
|
506
|
+
}
|
|
507
|
+
_addListeners(listeners) {
|
|
508
|
+
listeners.forEach(([event, listener]) => {
|
|
509
|
+
this._elementRef.nativeElement.addEventListener(event, listener, passiveListenerOptions);
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
_platformSupportsMouseEvents() {
|
|
513
|
+
return !this._platform.IOS && !this._platform.ANDROID;
|
|
514
|
+
}
|
|
515
|
+
/** Disables the native browser gestures, based on how the tooltip has been configured. */
|
|
516
|
+
_disableNativeGesturesIfNecessary() {
|
|
517
|
+
const gestures = this.touchGestures;
|
|
518
|
+
if (gestures !== 'off') {
|
|
519
|
+
const element = this._elementRef.nativeElement;
|
|
520
|
+
const style = element.style;
|
|
521
|
+
// If gestures are set to `auto`, we don't disable text selection on inputs and
|
|
522
|
+
// textareas, because it prevents the user from typing into them on iOS Safari.
|
|
523
|
+
if (gestures === 'on' || (element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA')) {
|
|
524
|
+
style.userSelect =
|
|
525
|
+
style.msUserSelect =
|
|
526
|
+
style.webkitUserSelect =
|
|
527
|
+
style.MozUserSelect =
|
|
528
|
+
'none';
|
|
529
|
+
}
|
|
530
|
+
// If we have `auto` gestures and the element uses native HTML dragging,
|
|
531
|
+
// we don't set `-webkit-user-drag` because it prevents the native behavior.
|
|
532
|
+
if (gestures === 'on' || !element.draggable) {
|
|
533
|
+
style.webkitUserDrag = 'none';
|
|
534
|
+
}
|
|
535
|
+
style.touchAction = 'none';
|
|
536
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
537
|
+
// @ts-ignore
|
|
538
|
+
style.webkitTapHighlightColor = 'transparent';
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
/** @nocollapse */ /** @nocollapse */ MtxTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MtxTooltip, deps: [{ token: i1.Overlay }, { token: i0.ElementRef }, { token: i2.ScrollDispatcher }, { token: i0.ViewContainerRef }, { token: i0.NgZone }, { token: i3.Platform }, { token: i4.AriaDescriber }, { token: i4.FocusMonitor }, { token: MTX_TOOLTIP_SCROLL_STRATEGY }, { token: i5.Directionality, optional: true }, { token: MTX_TOOLTIP_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
543
|
+
/** @nocollapse */ /** @nocollapse */ MtxTooltip.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: MtxTooltip, selector: "[mtxTooltip]", inputs: { position: ["mtxTooltipPosition", "position"], disabled: ["mtxTooltipDisabled", "disabled"], showDelay: ["mtxTooltipShowDelay", "showDelay"], hideDelay: ["mtxTooltipHideDelay", "hideDelay"], touchGestures: ["mtxTooltipTouchGestures", "touchGestures"], message: ["mtxTooltip", "message"], tooltipClass: ["mtxTooltipClass", "tooltipClass"] }, host: { classAttribute: "mtx-tooltip-trigger" }, exportAs: ["mtxTooltip"], ngImport: i0 });
|
|
544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MtxTooltip, decorators: [{
|
|
545
|
+
type: Directive,
|
|
546
|
+
args: [{
|
|
547
|
+
selector: '[mtxTooltip]',
|
|
548
|
+
exportAs: 'mtxTooltip',
|
|
549
|
+
host: {
|
|
550
|
+
class: 'mtx-tooltip-trigger',
|
|
551
|
+
},
|
|
552
|
+
}]
|
|
553
|
+
}], ctorParameters: function () { return [{ type: i1.Overlay }, { type: i0.ElementRef }, { type: i2.ScrollDispatcher }, { type: i0.ViewContainerRef }, { type: i0.NgZone }, { type: i3.Platform }, { type: i4.AriaDescriber }, { type: i4.FocusMonitor }, { type: undefined, decorators: [{
|
|
554
|
+
type: Inject,
|
|
555
|
+
args: [MTX_TOOLTIP_SCROLL_STRATEGY]
|
|
556
|
+
}] }, { type: i5.Directionality, decorators: [{
|
|
557
|
+
type: Optional
|
|
558
|
+
}] }, { type: undefined, decorators: [{
|
|
559
|
+
type: Optional
|
|
560
|
+
}, {
|
|
561
|
+
type: Inject,
|
|
562
|
+
args: [MTX_TOOLTIP_DEFAULT_OPTIONS]
|
|
563
|
+
}] }]; }, propDecorators: { position: [{
|
|
564
|
+
type: Input,
|
|
565
|
+
args: ['mtxTooltipPosition']
|
|
566
|
+
}], disabled: [{
|
|
567
|
+
type: Input,
|
|
568
|
+
args: ['mtxTooltipDisabled']
|
|
569
|
+
}], showDelay: [{
|
|
570
|
+
type: Input,
|
|
571
|
+
args: ['mtxTooltipShowDelay']
|
|
572
|
+
}], hideDelay: [{
|
|
573
|
+
type: Input,
|
|
574
|
+
args: ['mtxTooltipHideDelay']
|
|
575
|
+
}], touchGestures: [{
|
|
576
|
+
type: Input,
|
|
577
|
+
args: ['mtxTooltipTouchGestures']
|
|
578
|
+
}], message: [{
|
|
579
|
+
type: Input,
|
|
580
|
+
args: ['mtxTooltip']
|
|
581
|
+
}], tooltipClass: [{
|
|
582
|
+
type: Input,
|
|
583
|
+
args: ['mtxTooltipClass']
|
|
584
|
+
}] } });
|
|
585
|
+
/**
|
|
586
|
+
* Internal component that wraps the tooltip's content.
|
|
587
|
+
* @docs-private
|
|
588
|
+
*/
|
|
589
|
+
class TooltipComponent {
|
|
590
|
+
constructor(_changeDetectorRef, _breakpointObserver) {
|
|
591
|
+
this._changeDetectorRef = _changeDetectorRef;
|
|
592
|
+
this._breakpointObserver = _breakpointObserver;
|
|
593
|
+
/** Property watched by the animation framework to show or hide the tooltip */
|
|
594
|
+
this._visibility = 'initial';
|
|
595
|
+
/** Whether interactions on the page should close the tooltip */
|
|
596
|
+
this._closeOnInteraction = false;
|
|
597
|
+
/** Subject for notifying that the tooltip has been hidden from the view */
|
|
598
|
+
this._onHide = new Subject();
|
|
599
|
+
/** Stream that emits whether the user has a handset-sized display. */
|
|
600
|
+
this._isHandset = this._breakpointObserver.observe(Breakpoints.Handset);
|
|
601
|
+
}
|
|
602
|
+
_isTemplateRef(obj) {
|
|
603
|
+
return obj instanceof TemplateRef;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Shows the tooltip with an animation originating from the provided origin
|
|
607
|
+
* @param delay Amount of milliseconds to the delay showing the tooltip.
|
|
608
|
+
*/
|
|
609
|
+
show(delay) {
|
|
610
|
+
// Cancel the delayed hide if it is scheduled
|
|
611
|
+
if (this._hideTimeoutId) {
|
|
612
|
+
clearTimeout(this._hideTimeoutId);
|
|
613
|
+
this._hideTimeoutId = null;
|
|
614
|
+
}
|
|
615
|
+
// Body interactions should cancel the tooltip if there is a delay in showing.
|
|
616
|
+
this._closeOnInteraction = true;
|
|
617
|
+
this._showTimeoutId = setTimeout(() => {
|
|
618
|
+
this._visibility = 'visible';
|
|
619
|
+
this._showTimeoutId = null;
|
|
620
|
+
// Mark for check so if any parent component has set the
|
|
621
|
+
// ChangeDetectionStrategy to OnPush it will be checked anyways
|
|
622
|
+
this._markForCheck();
|
|
623
|
+
}, delay);
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Begins the animation to hide the tooltip after the provided delay in ms.
|
|
627
|
+
* @param delay Amount of milliseconds to delay showing the tooltip.
|
|
628
|
+
*/
|
|
629
|
+
hide(delay) {
|
|
630
|
+
// Cancel the delayed show if it is scheduled
|
|
631
|
+
if (this._showTimeoutId) {
|
|
632
|
+
clearTimeout(this._showTimeoutId);
|
|
633
|
+
this._showTimeoutId = null;
|
|
634
|
+
}
|
|
635
|
+
this._hideTimeoutId = setTimeout(() => {
|
|
636
|
+
this._visibility = 'hidden';
|
|
637
|
+
this._hideTimeoutId = null;
|
|
638
|
+
// Mark for check so if any parent component has set the
|
|
639
|
+
// ChangeDetectionStrategy to OnPush it will be checked anyways
|
|
640
|
+
this._markForCheck();
|
|
641
|
+
}, delay);
|
|
642
|
+
}
|
|
643
|
+
/** Returns an observable that notifies when the tooltip has been hidden from view. */
|
|
644
|
+
afterHidden() {
|
|
645
|
+
return this._onHide.asObservable();
|
|
646
|
+
}
|
|
647
|
+
/** Whether the tooltip is being displayed. */
|
|
648
|
+
isVisible() {
|
|
649
|
+
return this._visibility === 'visible';
|
|
650
|
+
}
|
|
651
|
+
ngOnDestroy() {
|
|
652
|
+
this._onHide.complete();
|
|
653
|
+
}
|
|
654
|
+
_animationStart() {
|
|
655
|
+
this._closeOnInteraction = false;
|
|
656
|
+
}
|
|
657
|
+
_animationDone(event) {
|
|
658
|
+
const toState = event.toState;
|
|
659
|
+
if (toState === 'hidden' && !this.isVisible()) {
|
|
660
|
+
this._onHide.next();
|
|
661
|
+
}
|
|
662
|
+
if (toState === 'visible' || toState === 'hidden') {
|
|
663
|
+
this._closeOnInteraction = true;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Interactions on the HTML body should close the tooltip immediately as defined in the
|
|
668
|
+
* material design spec.
|
|
669
|
+
* https://material.io/design/components/tooltips.html#behavior
|
|
670
|
+
*/
|
|
671
|
+
_handleBodyInteraction() {
|
|
672
|
+
if (this._closeOnInteraction) {
|
|
673
|
+
this.hide(0);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Marks that the tooltip needs to be checked in the next change detection run.
|
|
678
|
+
* Mainly used for rendering the initial text before positioning a tooltip, which
|
|
679
|
+
* can be problematic in components with OnPush change detection.
|
|
680
|
+
*/
|
|
681
|
+
_markForCheck() {
|
|
682
|
+
this._changeDetectorRef.markForCheck();
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
/** @nocollapse */ /** @nocollapse */ TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: TooltipComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i6.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
|
|
686
|
+
/** @nocollapse */ /** @nocollapse */ TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: TooltipComponent, selector: "mtx-tooltip-component", host: { attributes: { "aria-hidden": "true" }, listeners: { "body:click": "this._handleBodyInteraction()" }, properties: { "style.zoom": "_visibility === \"visible\" ? 1 : null" } }, ngImport: i0, template: "<div class=\"mtx-tooltip\"\n [ngClass]=\"tooltipClass\"\n [class.mtx-tooltip-handset]=\"(_isHandset | async)?.matches\"\n [@state]=\"_visibility\"\n (@state.start)=\"_animationStart()\"\n (@state.done)=\"_animationDone($event)\">\n <ng-template [ngIf]=\"_isTemplateRef(message)\" [ngIfElse]=\"msgStrTpl\">\n <ng-template [ngTemplateOutlet]=\"$any(message)\"></ng-template>\n </ng-template>\n <ng-template #msgStrTpl>{{message}}</ng-template>\n</div>\n", styles: [".mtx-tooltip-panel{pointer-events:none!important}.mtx-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mtx-tooltip{outline:solid 1px}.mtx-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i7.AsyncPipe }, animations: [mtxTooltipAnimations.tooltipState], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
687
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
688
|
+
type: Component,
|
|
689
|
+
args: [{ selector: 'mtx-tooltip-component', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [mtxTooltipAnimations.tooltipState], host: {
|
|
690
|
+
// Forces the element to have a layout in IE and Edge. This fixes issues where the element
|
|
691
|
+
// won't be rendered if the animations are disabled or there is no web animations polyfill.
|
|
692
|
+
'[style.zoom]': '_visibility === "visible" ? 1 : null',
|
|
693
|
+
'(body:click)': 'this._handleBodyInteraction()',
|
|
694
|
+
'aria-hidden': 'true',
|
|
695
|
+
}, template: "<div class=\"mtx-tooltip\"\n [ngClass]=\"tooltipClass\"\n [class.mtx-tooltip-handset]=\"(_isHandset | async)?.matches\"\n [@state]=\"_visibility\"\n (@state.start)=\"_animationStart()\"\n (@state.done)=\"_animationDone($event)\">\n <ng-template [ngIf]=\"_isTemplateRef(message)\" [ngIfElse]=\"msgStrTpl\">\n <ng-template [ngTemplateOutlet]=\"$any(message)\"></ng-template>\n </ng-template>\n <ng-template #msgStrTpl>{{message}}</ng-template>\n</div>\n", styles: [".mtx-tooltip-panel{pointer-events:none!important}.mtx-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mtx-tooltip{outline:solid 1px}.mtx-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"] }]
|
|
696
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i6.BreakpointObserver }]; } });
|
|
697
|
+
|
|
698
|
+
class MtxTooltipModule {
|
|
699
|
+
}
|
|
700
|
+
/** @nocollapse */ /** @nocollapse */ MtxTooltipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MtxTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
701
|
+
/** @nocollapse */ /** @nocollapse */ MtxTooltipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MtxTooltipModule, declarations: [MtxTooltip, TooltipComponent], imports: [A11yModule, CommonModule, OverlayModule, MatCommonModule], exports: [MtxTooltip, TooltipComponent, MatCommonModule, CdkScrollableModule] });
|
|
702
|
+
/** @nocollapse */ /** @nocollapse */ MtxTooltipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MtxTooltipModule, providers: [MTX_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [[A11yModule, CommonModule, OverlayModule, MatCommonModule], MatCommonModule, CdkScrollableModule] });
|
|
703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MtxTooltipModule, decorators: [{
|
|
704
|
+
type: NgModule,
|
|
705
|
+
args: [{
|
|
706
|
+
imports: [A11yModule, CommonModule, OverlayModule, MatCommonModule],
|
|
707
|
+
exports: [MtxTooltip, TooltipComponent, MatCommonModule, CdkScrollableModule],
|
|
708
|
+
declarations: [MtxTooltip, TooltipComponent],
|
|
709
|
+
providers: [MTX_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER],
|
|
710
|
+
}]
|
|
711
|
+
}] });
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Generated bundle index. Do not edit.
|
|
715
|
+
*/
|
|
716
|
+
|
|
717
|
+
export { MTX_TOOLTIP_DEFAULT_OPTIONS, MTX_TOOLTIP_DEFAULT_OPTIONS_FACTORY, MTX_TOOLTIP_SCROLL_STRATEGY, MTX_TOOLTIP_SCROLL_STRATEGY_FACTORY, MTX_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER, MtxTooltip, MtxTooltipModule, SCROLL_THROTTLE_MS, TOOLTIP_PANEL_CLASS, TooltipComponent, getMtxTooltipInvalidPositionError, mtxTooltipAnimations };
|
|
718
|
+
//# sourceMappingURL=mtxTooltip.mjs.map
|