@siemens/element-ng 48.10.0 → 49.0.0-rc.2
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/about/package.json +2 -1
- package/accordion/package.json +2 -1
- package/action-modal/package.json +2 -1
- package/ag-grid/package.json +2 -1
- package/application-header/package.json +2 -1
- package/auto-collapsable-list/package.json +2 -1
- package/autocomplete/package.json +2 -1
- package/avatar/package.json +2 -1
- package/badge/package.json +2 -1
- package/breadcrumb/package.json +2 -1
- package/breadcrumb-router/package.json +2 -1
- package/card/package.json +2 -1
- package/chat-messages/package.json +2 -1
- package/circle-status/package.json +2 -1
- package/color-picker/package.json +2 -1
- package/column-selection-dialog/package.json +2 -1
- package/common/package.json +2 -1
- package/connection-strength/package.json +2 -1
- package/content-action-bar/package.json +2 -1
- package/copyright-notice/package.json +2 -1
- package/dashboard/package.json +2 -1
- package/datatable/package.json +2 -1
- package/date-range-filter/package.json +2 -1
- package/datepicker/package.json +2 -1
- package/electron-titlebar/package.json +2 -1
- package/empty-state/package.json +2 -1
- package/fesm2022/siemens-element-ng-about.mjs +25 -24
- package/fesm2022/siemens-element-ng-about.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-accordion.mjs +49 -75
- package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-action-modal.mjs +59 -55
- package/fesm2022/siemens-element-ng-action-modal.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ag-grid.mjs +33 -37
- package/fesm2022/siemens-element-ng-ag-grid.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-application-header.mjs +122 -150
- package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-auto-collapsable-list.mjs +30 -32
- package/fesm2022/siemens-element-ng-auto-collapsable-list.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-autocomplete.mjs +34 -48
- package/fesm2022/siemens-element-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-avatar.mjs +23 -24
- package/fesm2022/siemens-element-ng-avatar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-badge.mjs +6 -6
- package/fesm2022/siemens-element-ng-badge.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-breadcrumb-router.mjs +16 -16
- package/fesm2022/siemens-element-ng-breadcrumb-router.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-breadcrumb.mjs +18 -17
- package/fesm2022/siemens-element-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-card.mjs +32 -34
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +204 -109
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-circle-status.mjs +26 -26
- package/fesm2022/siemens-element-ng-circle-status.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-color-picker.mjs +18 -17
- package/fesm2022/siemens-element-ng-color-picker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs +36 -35
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-common.mjs +13 -38
- package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-connection-strength.mjs +11 -11
- package/fesm2022/siemens-element-ng-connection-strength.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-content-action-bar.mjs +33 -30
- package/fesm2022/siemens-element-ng-content-action-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-copyright-notice.mjs +13 -13
- package/fesm2022/siemens-element-ng-copyright-notice.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-dashboard.mjs +161 -169
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datatable.mjs +9 -9
- package/fesm2022/siemens-element-ng-datatable.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +128 -149
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datepicker.mjs +260 -271
- package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-electron-titlebar.mjs +19 -18
- package/fesm2022/siemens-element-ng-electron-titlebar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-empty-state.mjs +11 -11
- package/fesm2022/siemens-element-ng-empty-state.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-file-uploader.mjs +66 -69
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filter-bar.mjs +23 -23
- package/fesm2022/siemens-element-ng-filter-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +141 -159
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-footer.mjs +10 -10
- package/fesm2022/siemens-element-ng-footer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-form.mjs +99 -85
- package/fesm2022/siemens-element-ng-form.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-formly.mjs +96 -94
- package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-header-dropdown.mjs +33 -33
- package/fesm2022/siemens-element-ng-header-dropdown.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-help-button.mjs +7 -6
- package/fesm2022/siemens-element-ng-help-button.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-icon-status.mjs +4 -4
- package/fesm2022/siemens-element-ng-icon.mjs +53 -135
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-info-page.mjs +11 -12
- package/fesm2022/siemens-element-ng-info-page.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-inline-notification.mjs +15 -16
- package/fesm2022/siemens-element-ng-inline-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ip-input.mjs +16 -16
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-landing-page.mjs +71 -71
- package/fesm2022/siemens-element-ng-landing-page.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-language-switcher.mjs +13 -13
- package/fesm2022/siemens-element-ng-language-switcher.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-link.mjs +22 -23
- package/fesm2022/siemens-element-ng-link.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-list-details.mjs +68 -86
- package/fesm2022/siemens-element-ng-list-details.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-loading-spinner.mjs +38 -52
- package/fesm2022/siemens-element-ng-loading-spinner.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-localization.mjs +14 -11
- package/fesm2022/siemens-element-ng-localization.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-main-detail-container.mjs +30 -30
- package/fesm2022/siemens-element-ng-main-detail-container.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs +5 -5
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-menu.mjs +55 -54
- package/fesm2022/siemens-element-ng-menu.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-modal.mjs +10 -13
- package/fesm2022/siemens-element-ng-modal.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs +183 -298
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar.mjs +43 -43
- package/fesm2022/siemens-element-ng-navbar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-notification-item.mjs +14 -13
- package/fesm2022/siemens-element-ng-notification-item.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-number-input.mjs +32 -32
- package/fesm2022/siemens-element-ng-number-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-pagination.mjs +21 -20
- package/fesm2022/siemens-element-ng-pagination.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-password-strength.mjs +21 -21
- package/fesm2022/siemens-element-ng-password-strength.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-password-toggle.mjs +19 -15
- package/fesm2022/siemens-element-ng-password-toggle.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-phone-number.mjs +56 -50
- package/fesm2022/siemens-element-ng-phone-number.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-photo-upload.mjs +48 -47
- package/fesm2022/siemens-element-ng-photo-upload.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-pills-input.mjs +45 -44
- package/fesm2022/siemens-element-ng-pills-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-popover-legacy.mjs +31 -31
- package/fesm2022/siemens-element-ng-popover-legacy.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-popover.mjs +29 -29
- package/fesm2022/siemens-element-ng-popover.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-progressbar.mjs +15 -15
- package/fesm2022/siemens-element-ng-progressbar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-resize-observer.mjs +25 -61
- package/fesm2022/siemens-element-ng-resize-observer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-result-details-list.mjs +13 -12
- package/fesm2022/siemens-element-ng-result-details-list.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-search-bar.mjs +25 -24
- package/fesm2022/siemens-element-ng-search-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-select.mjs +204 -347
- package/fesm2022/siemens-element-ng-select.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-shadow-root.mjs +3 -3
- package/fesm2022/siemens-element-ng-shadow-root.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-side-panel.mjs +144 -69
- package/fesm2022/siemens-element-ng-side-panel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-skip-links.mjs +13 -13
- package/fesm2022/siemens-element-ng-skip-links.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-slider.mjs +30 -29
- package/fesm2022/siemens-element-ng-slider.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-sort-bar.mjs +14 -13
- package/fesm2022/siemens-element-ng-sort-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-split.mjs +26 -28
- package/fesm2022/siemens-element-ng-split.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-bar.mjs +42 -43
- package/fesm2022/siemens-element-ng-status-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-counter.mjs +11 -12
- package/fesm2022/siemens-element-ng-status-counter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-toggle.mjs +15 -16
- package/fesm2022/siemens-element-ng-status-toggle.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-summary-chip.mjs +16 -17
- package/fesm2022/siemens-element-ng-summary-chip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-summary-widget.mjs +16 -16
- package/fesm2022/siemens-element-ng-summary-widget.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-system-banner.mjs +7 -7
- package/fesm2022/siemens-element-ng-system-banner.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs +16 -16
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs.mjs +44 -47
- package/fesm2022/siemens-element-ng-tabs.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-theme.mjs +4 -4
- package/fesm2022/siemens-element-ng-theme.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-threshold.mjs +51 -71
- package/fesm2022/siemens-element-ng-threshold.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-toast-notification.mjs +26 -52
- package/fesm2022/siemens-element-ng-toast-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tooltip.mjs +60 -68
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tour.mjs +20 -20
- package/fesm2022/siemens-element-ng-tour.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +92 -117
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-typeahead.mjs +46 -62
- package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-wizard.mjs +49 -48
- package/fesm2022/siemens-element-ng-wizard.mjs.map +1 -1
- package/file-uploader/package.json +2 -1
- package/filter-bar/package.json +2 -1
- package/filtered-search/package.json +2 -1
- package/footer/package.json +2 -1
- package/form/package.json +2 -1
- package/formly/package.json +2 -1
- package/header-dropdown/package.json +2 -1
- package/help-button/package.json +2 -1
- package/icon/package.json +2 -1
- package/icon-status/package.json +2 -1
- package/info-page/package.json +2 -1
- package/inline-notification/package.json +2 -1
- package/ip-input/package.json +2 -1
- package/landing-page/package.json +2 -1
- package/language-switcher/package.json +2 -1
- package/link/package.json +2 -1
- package/list-details/package.json +2 -1
- package/loading-spinner/package.json +2 -1
- package/localization/package.json +2 -1
- package/main-detail-container/package.json +2 -1
- package/markdown-renderer/package.json +2 -1
- package/menu/package.json +2 -1
- package/modal/package.json +2 -1
- package/navbar/package.json +2 -1
- package/navbar-vertical/package.json +2 -1
- package/notification-item/package.json +2 -1
- package/number-input/package.json +2 -1
- package/package.json +115 -107
- package/pagination/package.json +2 -1
- package/password-strength/package.json +2 -1
- package/password-toggle/package.json +2 -1
- package/phone-number/package.json +2 -1
- package/photo-upload/package.json +2 -1
- package/pills-input/package.json +2 -1
- package/popover/package.json +2 -1
- package/popover-legacy/package.json +2 -1
- package/progressbar/package.json +2 -1
- package/resize-observer/package.json +2 -1
- package/result-details-list/package.json +2 -1
- package/schematics/collection.json +0 -12
- package/schematics/migration.json +15 -0
- package/schematics/migrations/data/attribute-selectors.js +1 -6
- package/schematics/migrations/data/component-names.js +9 -68
- package/schematics/migrations/data/element-selectors.js +9 -8
- package/schematics/migrations/data/index.js +0 -1
- package/schematics/migrations/data/migration-test-data.js +167 -0
- package/schematics/migrations/data/output-names.js +1 -7
- package/schematics/migrations/data/symbol-removals.js +4 -45
- package/schematics/migrations/element-migration/element-migration.js +1 -3
- package/schematics/migrations/index.js +15 -5
- package/schematics/migrations/ngx-translate/index.js +93 -0
- package/schematics/ng-update/index.js +17 -0
- package/schematics/ng-update/schema.json +15 -0
- package/schematics/simpl-siemens-migration/index.js +1 -5
- package/schematics/utils/ts-utils.js +135 -0
- package/search-bar/package.json +2 -1
- package/select/package.json +2 -1
- package/shadow-root/package.json +2 -1
- package/side-panel/package.json +2 -1
- package/skip-links/package.json +2 -1
- package/slider/package.json +2 -1
- package/sort-bar/package.json +2 -1
- package/split/package.json +2 -1
- package/status-bar/package.json +2 -1
- package/status-counter/package.json +2 -1
- package/status-toggle/package.json +2 -1
- package/summary-chip/package.json +2 -1
- package/summary-widget/package.json +2 -1
- package/system-banner/package.json +2 -1
- package/tabs/package.json +2 -1
- package/tabs-legacy/package.json +2 -1
- package/template-i18n.json +32 -25
- package/test-styles.scss +5 -0
- package/theme/package.json +2 -1
- package/threshold/package.json +2 -1
- package/toast-notification/package.json +2 -1
- package/tooltip/package.json +2 -1
- package/tour/package.json +2 -1
- package/translate/package.json +2 -1
- package/tree-view/package.json +2 -1
- package/typeahead/package.json +2 -1
- package/{accordion/index.d.ts → types/siemens-element-ng-accordion.d.ts} +2 -3
- package/{application-header/index.d.ts → types/siemens-element-ng-application-header.d.ts} +19 -18
- package/{autocomplete/index.d.ts → types/siemens-element-ng-autocomplete.d.ts} +1 -3
- package/{breadcrumb/index.d.ts → types/siemens-element-ng-breadcrumb.d.ts} +2 -2
- package/{chat-messages/index.d.ts → types/siemens-element-ng-chat-messages.d.ts} +72 -10
- package/{common/index.d.ts → types/siemens-element-ng-common.d.ts} +2 -30
- package/{content-action-bar/index.d.ts → types/siemens-element-ng-content-action-bar.d.ts} +2 -2
- package/{dashboard/index.d.ts → types/siemens-element-ng-dashboard.d.ts} +6 -6
- package/{date-range-filter/index.d.ts → types/siemens-element-ng-date-range-filter.d.ts} +28 -27
- package/{datepicker/index.d.ts → types/siemens-element-ng-datepicker.d.ts} +5 -6
- package/{electron-titlebar/index.d.ts → types/siemens-element-ng-electron-titlebar.d.ts} +4 -4
- package/{file-uploader/index.d.ts → types/siemens-element-ng-file-uploader.d.ts} +26 -26
- package/{filter-bar/index.d.ts → types/siemens-element-ng-filter-bar.d.ts} +4 -4
- package/{filtered-search/index.d.ts → types/siemens-element-ng-filtered-search.d.ts} +6 -21
- package/{form/index.d.ts → types/siemens-element-ng-form.d.ts} +4 -6
- package/{formly/index.d.ts → types/siemens-element-ng-formly.d.ts} +1 -1
- package/types/siemens-element-ng-icon.d.ts +203 -0
- package/{landing-page/index.d.ts → types/siemens-element-ng-landing-page.d.ts} +15 -15
- package/{language-switcher/index.d.ts → types/siemens-element-ng-language-switcher.d.ts} +1 -2
- package/{list-details/index.d.ts → types/siemens-element-ng-list-details.d.ts} +4 -11
- package/{loading-spinner/index.d.ts → types/siemens-element-ng-loading-spinner.d.ts} +2 -3
- package/{modal/index.d.ts → types/siemens-element-ng-modal.d.ts} +0 -6
- package/{navbar-vertical/index.d.ts → types/siemens-element-ng-navbar-vertical.d.ts} +12 -7
- package/{navbar/index.d.ts → types/siemens-element-ng-navbar.d.ts} +11 -11
- package/{notification-item/index.d.ts → types/siemens-element-ng-notification-item.d.ts} +15 -3
- package/{pagination/index.d.ts → types/siemens-element-ng-pagination.d.ts} +4 -4
- package/{password-toggle/index.d.ts → types/siemens-element-ng-password-toggle.d.ts} +6 -4
- package/{phone-number/index.d.ts → types/siemens-element-ng-phone-number.d.ts} +8 -11
- package/{pills-input/index.d.ts → types/siemens-element-ng-pills-input.d.ts} +3 -3
- package/{popover/index.d.ts → types/siemens-element-ng-popover.d.ts} +2 -2
- package/{resize-observer/index.d.ts → types/siemens-element-ng-resize-observer.d.ts} +0 -30
- package/{search-bar/index.d.ts → types/siemens-element-ng-search-bar.d.ts} +2 -2
- package/{select/index.d.ts → types/siemens-element-ng-select.d.ts} +18 -97
- package/{side-panel/index.d.ts → types/siemens-element-ng-side-panel.d.ts} +26 -5
- package/{slider/index.d.ts → types/siemens-element-ng-slider.d.ts} +4 -4
- package/{split/index.d.ts → types/siemens-element-ng-split.d.ts} +1 -3
- package/{status-bar/index.d.ts → types/siemens-element-ng-status-bar.d.ts} +6 -6
- package/{tabs-legacy/index.d.ts → types/siemens-element-ng-tabs-legacy.d.ts} +5 -0
- package/{threshold/index.d.ts → types/siemens-element-ng-threshold.d.ts} +7 -7
- package/{toast-notification/index.d.ts → types/siemens-element-ng-toast-notification.d.ts} +3 -4
- package/{tooltip/index.d.ts → types/siemens-element-ng-tooltip.d.ts} +3 -6
- package/{tour/index.d.ts → types/siemens-element-ng-tour.d.ts} +1 -10
- package/{translate/index.d.ts → types/siemens-element-ng-translate.d.ts} +8 -1
- package/{tree-view/index.d.ts → types/siemens-element-ng-tree-view.d.ts} +0 -1
- package/{typeahead/index.d.ts → types/siemens-element-ng-typeahead.d.ts} +0 -2
- package/{wizard/index.d.ts → types/siemens-element-ng-wizard.d.ts} +6 -6
- package/wizard/package.json +2 -1
- package/fesm2022/siemens-element-ng-unauthorized-page.mjs +0 -75
- package/fesm2022/siemens-element-ng-unauthorized-page.mjs.map +0 -1
- package/icon/index.d.ts +0 -285
- package/schematics/migrations/action-modal-migration/action-modal-migration.js +0 -162
- package/schematics/migrations/action-modal-migration/action-modal.mappings.js +0 -98
- package/schematics/migrations/action-modal-migration/index.js +0 -5
- package/schematics/migrations/wizard-migration/index.js +0 -80
- package/schematics/scss-import-to-siemens-migration/index.js +0 -101
- package/schematics/scss-import-to-siemens-migration/schema.json +0 -16
- package/schematics/scss-import-to-siemens-migration/style-mappings.js +0 -62
- package/schematics/ts-import-to-siemens-migration/index.js +0 -230
- package/schematics/ts-import-to-siemens-migration/mappings/charts-ng-mappings.js +0 -71
- package/schematics/ts-import-to-siemens-migration/mappings/dashboards-ng-mappings.js +0 -54
- package/schematics/ts-import-to-siemens-migration/mappings/element-ng-mappings.js +0 -705
- package/schematics/ts-import-to-siemens-migration/mappings/element-translate-ng-mappings.js +0 -21
- package/schematics/ts-import-to-siemens-migration/mappings/index.js +0 -10
- package/schematics/ts-import-to-siemens-migration/mappings/maps-ng-mappings.js +0 -47
- package/schematics/ts-import-to-siemens-migration/mappings/native-charts-ng-mappings.js +0 -33
- package/schematics/ts-import-to-siemens-migration/model.js +0 -4
- package/schematics/ts-import-to-siemens-migration/schema.json +0 -16
- package/unauthorized-page/index.d.ts +0 -44
- package/unauthorized-page/package.json +0 -3
- /package/{about/index.d.ts → types/siemens-element-ng-about.d.ts} +0 -0
- /package/{action-modal/index.d.ts → types/siemens-element-ng-action-modal.d.ts} +0 -0
- /package/{ag-grid/index.d.ts → types/siemens-element-ng-ag-grid.d.ts} +0 -0
- /package/{auto-collapsable-list/index.d.ts → types/siemens-element-ng-auto-collapsable-list.d.ts} +0 -0
- /package/{avatar/index.d.ts → types/siemens-element-ng-avatar.d.ts} +0 -0
- /package/{badge/index.d.ts → types/siemens-element-ng-badge.d.ts} +0 -0
- /package/{breadcrumb-router/index.d.ts → types/siemens-element-ng-breadcrumb-router.d.ts} +0 -0
- /package/{card/index.d.ts → types/siemens-element-ng-card.d.ts} +0 -0
- /package/{circle-status/index.d.ts → types/siemens-element-ng-circle-status.d.ts} +0 -0
- /package/{color-picker/index.d.ts → types/siemens-element-ng-color-picker.d.ts} +0 -0
- /package/{column-selection-dialog/index.d.ts → types/siemens-element-ng-column-selection-dialog.d.ts} +0 -0
- /package/{connection-strength/index.d.ts → types/siemens-element-ng-connection-strength.d.ts} +0 -0
- /package/{copyright-notice/index.d.ts → types/siemens-element-ng-copyright-notice.d.ts} +0 -0
- /package/{datatable/index.d.ts → types/siemens-element-ng-datatable.d.ts} +0 -0
- /package/{empty-state/index.d.ts → types/siemens-element-ng-empty-state.d.ts} +0 -0
- /package/{footer/index.d.ts → types/siemens-element-ng-footer.d.ts} +0 -0
- /package/{header-dropdown/index.d.ts → types/siemens-element-ng-header-dropdown.d.ts} +0 -0
- /package/{help-button/index.d.ts → types/siemens-element-ng-help-button.d.ts} +0 -0
- /package/{icon-status/index.d.ts → types/siemens-element-ng-icon-status.d.ts} +0 -0
- /package/{info-page/index.d.ts → types/siemens-element-ng-info-page.d.ts} +0 -0
- /package/{inline-notification/index.d.ts → types/siemens-element-ng-inline-notification.d.ts} +0 -0
- /package/{ip-input/index.d.ts → types/siemens-element-ng-ip-input.d.ts} +0 -0
- /package/{link/index.d.ts → types/siemens-element-ng-link.d.ts} +0 -0
- /package/{localization/index.d.ts → types/siemens-element-ng-localization.d.ts} +0 -0
- /package/{main-detail-container/index.d.ts → types/siemens-element-ng-main-detail-container.d.ts} +0 -0
- /package/{markdown-renderer/index.d.ts → types/siemens-element-ng-markdown-renderer.d.ts} +0 -0
- /package/{menu/index.d.ts → types/siemens-element-ng-menu.d.ts} +0 -0
- /package/{number-input/index.d.ts → types/siemens-element-ng-number-input.d.ts} +0 -0
- /package/{password-strength/index.d.ts → types/siemens-element-ng-password-strength.d.ts} +0 -0
- /package/{photo-upload/index.d.ts → types/siemens-element-ng-photo-upload.d.ts} +0 -0
- /package/{popover-legacy/index.d.ts → types/siemens-element-ng-popover-legacy.d.ts} +0 -0
- /package/{progressbar/index.d.ts → types/siemens-element-ng-progressbar.d.ts} +0 -0
- /package/{result-details-list/index.d.ts → types/siemens-element-ng-result-details-list.d.ts} +0 -0
- /package/{shadow-root/index.d.ts → types/siemens-element-ng-shadow-root.d.ts} +0 -0
- /package/{skip-links/index.d.ts → types/siemens-element-ng-skip-links.d.ts} +0 -0
- /package/{sort-bar/index.d.ts → types/siemens-element-ng-sort-bar.d.ts} +0 -0
- /package/{status-counter/index.d.ts → types/siemens-element-ng-status-counter.d.ts} +0 -0
- /package/{status-toggle/index.d.ts → types/siemens-element-ng-status-toggle.d.ts} +0 -0
- /package/{summary-chip/index.d.ts → types/siemens-element-ng-summary-chip.d.ts} +0 -0
- /package/{summary-widget/index.d.ts → types/siemens-element-ng-summary-widget.d.ts} +0 -0
- /package/{system-banner/index.d.ts → types/siemens-element-ng-system-banner.d.ts} +0 -0
- /package/{tabs/index.d.ts → types/siemens-element-ng-tabs.d.ts} +0 -0
- /package/{theme/index.d.ts → types/siemens-element-ng-theme.d.ts} +0 -0
- /package/{index.d.ts → types/siemens-element-ng.d.ts} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Overlay } from '@angular/cdk/overlay';
|
|
2
2
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
3
|
-
import {
|
|
3
|
+
import { AsyncPipe, isPlatformBrowser } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { inject, input, computed, signal, output, HostListener, Component, ChangeDetectionStrategy, Injector, PLATFORM_ID, Injectable } from '@angular/core';
|
|
6
6
|
import { t, SiTranslatePipe, SiTranslateService, SiNoTranslateService } from '@siemens/element-translate-ng/translate';
|
|
7
7
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
8
|
-
import { trigger, transition, style, animate } from '@angular/animations';
|
|
9
8
|
import { areAnimationsDisabled } from '@siemens/element-ng/common';
|
|
10
|
-
import {
|
|
9
|
+
import { elementCancel } from '@siemens/element-icons';
|
|
10
|
+
import { STATUS_ICON_CONFIG, addIcons, SiIconComponent, SiStatusIconComponent } from '@siemens/element-ng/icon';
|
|
11
11
|
import * as i1 from '@siemens/element-ng/link';
|
|
12
12
|
import { SiLinkModule } from '@siemens/element-ng/link';
|
|
13
13
|
|
|
@@ -19,25 +19,20 @@ const SI_TOAST_AUTO_HIDE_DELAY = 6000;
|
|
|
19
19
|
*/
|
|
20
20
|
class SiToastNotificationComponent {
|
|
21
21
|
statusIcons = inject(STATUS_ICON_CONFIG);
|
|
22
|
-
toast = input.required();
|
|
22
|
+
toast = input.required(...(ngDevMode ? [{ debugName: "toast" }] : []));
|
|
23
23
|
closeAriaLabelDefault = t(() => $localize `:@@SI_TOAST.CLOSE:Close`);
|
|
24
|
-
closeAriaLabel = computed(() => this.toast().closeAriaLabel ?? this.closeAriaLabelDefault);
|
|
24
|
+
closeAriaLabel = computed(() => this.toast().closeAriaLabel ?? this.closeAriaLabelDefault, ...(ngDevMode ? [{ debugName: "closeAriaLabel" }] : []));
|
|
25
25
|
icons = addIcons({ elementCancel });
|
|
26
26
|
status = computed(() => {
|
|
27
27
|
const toast = this.toast();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
else {
|
|
32
|
-
return Object.keys(this.statusIcons).includes(toast.state) ? toast.state : 'info';
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
statusColor = computed(() => this.statusIcons[this.status()].color);
|
|
28
|
+
return Object.keys(this.statusIcons).includes(toast.state) ? toast.state : 'info';
|
|
29
|
+
}, ...(ngDevMode ? [{ debugName: "status" }] : []));
|
|
30
|
+
statusColor = computed(() => this.statusIcons[this.status()].color, ...(ngDevMode ? [{ debugName: "statusColor" }] : []));
|
|
36
31
|
toastTimeoutInSeconds = computed(() => {
|
|
37
32
|
const toast = this.toast();
|
|
38
33
|
return toast.timeout ? toast.timeout / 1000 : SI_TOAST_AUTO_HIDE_DELAY / 1000;
|
|
39
|
-
});
|
|
40
|
-
animationMode = signal('running');
|
|
34
|
+
}, ...(ngDevMode ? [{ debugName: "toastTimeoutInSeconds" }] : []));
|
|
35
|
+
animationMode = signal('running', ...(ngDevMode ? [{ debugName: "animationMode" }] : []));
|
|
41
36
|
paused = output();
|
|
42
37
|
resumed = output();
|
|
43
38
|
onMouseEnter() {
|
|
@@ -55,13 +50,13 @@ class SiToastNotificationComponent {
|
|
|
55
50
|
close() {
|
|
56
51
|
this.toast().close();
|
|
57
52
|
}
|
|
58
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
59
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiToastNotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiToastNotificationComponent, isStandalone: true, selector: "si-toast-notification", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { paused: "paused", resumed: "resumed" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0, template: "@let toastValue = toast();\n@let autoClose = !toastValue.disableAutoClose;\n@let manualClose = !toastValue.disableManualClose;\n<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"autoClose\">\n @if (autoClose) {\n <div\n class=\"si-toast-timer-bar\"\n [style.--play-state]=\"animationMode()\"\n [style.--toast-timer-duration.s]=\"toastTimeoutInSeconds()\"\n ></div>\n }\n <div [class]=\"`bar ${statusColor()}`\"></div>\n <si-status-icon class=\"icon\" [status]=\"status()\" />\n\n <div class=\"toast-content px-4\">\n <p class=\"toast-title\"\n ><b>{{ toastValue.title | translate: toastValue.translationParams }}</b></p\n >\n @if (toastValue.message) {\n <p class=\"mt-4\">{{ toastValue.message | translate: toastValue.translationParams }}</p>\n }\n @if (toastValue.action) {\n <p [class.mt-3]=\"toastValue.message\" [class.mt-4]=\"!toastValue.message\">\n <a [siLink]=\"toastValue.action\">{{\n toastValue.action!.title | translate: toastValue.translationParams\n }}</a>\n </p>\n }\n </div>\n @if (manualClose) {\n <button\n type=\"button\"\n tabindex=\"0\"\n class=\"btn btn-icon btn-ghost mt-n2 me-n2\"\n [attr.aria-label]=\"closeAriaLabel() | translate\"\n (keydown.enter)=\"close()\"\n (click)=\"close()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n }\n</div>\n", styles: [".si-toast-timer-bar,.si-toast.si-toast-auto-close:before{position:absolute;inset-block-end:0;inset-inline-start:0;block-size:2px}:host{display:block}.si-toast{block-size:auto;position:relative;display:flex;align-items:flex-start;color:var(--element-text-primary);background:var(--element-base-3);border-radius:var(--element-radius-2);padding-inline:12px 8px;padding-block:8px;margin-block-end:20px;font-size:1rem;pointer-events:all;overflow:hidden;min-inline-size:250px;max-inline-size:calc(100vw - 40px)}@media(min-width:768px){.si-toast{max-inline-size:400px}}.si-toast.si-toast-auto-close{padding-block-end:10px}.si-toast.si-toast-auto-close:before{content:\"\";background:var(--element-ui-4);inset-inline-end:0}.bar{inset-block-start:0;inset-inline-start:0;position:absolute;inline-size:4px;block-size:100%;background:currentColor}@keyframes si-toast-auto-close-animation{0%{inline-size:100%}to{inline-size:0}}.si-toast-timer-bar{animation:si-toast-auto-close-animation var(--toast-timer-duration, 4s) linear forwards;animation-play-state:var(--play-state, running);background-color:var(--element-ui-0)}.toast-content{flex:1;overflow:hidden;white-space:nowrap}.toast-content p{margin-block:0;line-height:1.125rem;white-space:pre-line;overflow-wrap:break-word;word-wrap:break-word}.toast-content .toast-title{line-height:1.25rem}\n"], dependencies: [{ kind: "ngmodule", type: SiLinkModule }, { kind: "directive", type: i1.SiLinkDirective, selector: "[siLink]", inputs: ["siLink", "siLinkDefaultTarget", "actionParam", "activeClass", "exactMatch", "ariaCurrent"], outputs: ["activeChange"], exportAs: ["siLink"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiStatusIconComponent, selector: "si-status-icon", inputs: ["status"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
60
55
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiToastNotificationComponent, decorators: [{
|
|
62
57
|
type: Component,
|
|
63
|
-
args: [{ selector: 'si-toast-notification', imports: [
|
|
64
|
-
}], propDecorators: { onMouseEnter: [{
|
|
58
|
+
args: [{ selector: 'si-toast-notification', imports: [SiLinkModule, SiIconComponent, SiStatusIconComponent, SiTranslatePipe], template: "@let toastValue = toast();\n@let autoClose = !toastValue.disableAutoClose;\n@let manualClose = !toastValue.disableManualClose;\n<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"autoClose\">\n @if (autoClose) {\n <div\n class=\"si-toast-timer-bar\"\n [style.--play-state]=\"animationMode()\"\n [style.--toast-timer-duration.s]=\"toastTimeoutInSeconds()\"\n ></div>\n }\n <div [class]=\"`bar ${statusColor()}`\"></div>\n <si-status-icon class=\"icon\" [status]=\"status()\" />\n\n <div class=\"toast-content px-4\">\n <p class=\"toast-title\"\n ><b>{{ toastValue.title | translate: toastValue.translationParams }}</b></p\n >\n @if (toastValue.message) {\n <p class=\"mt-4\">{{ toastValue.message | translate: toastValue.translationParams }}</p>\n }\n @if (toastValue.action) {\n <p [class.mt-3]=\"toastValue.message\" [class.mt-4]=\"!toastValue.message\">\n <a [siLink]=\"toastValue.action\">{{\n toastValue.action!.title | translate: toastValue.translationParams\n }}</a>\n </p>\n }\n </div>\n @if (manualClose) {\n <button\n type=\"button\"\n tabindex=\"0\"\n class=\"btn btn-icon btn-ghost mt-n2 me-n2\"\n [attr.aria-label]=\"closeAriaLabel() | translate\"\n (keydown.enter)=\"close()\"\n (click)=\"close()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n }\n</div>\n", styles: [".si-toast-timer-bar,.si-toast.si-toast-auto-close:before{position:absolute;inset-block-end:0;inset-inline-start:0;block-size:2px}:host{display:block}.si-toast{block-size:auto;position:relative;display:flex;align-items:flex-start;color:var(--element-text-primary);background:var(--element-base-3);border-radius:var(--element-radius-2);padding-inline:12px 8px;padding-block:8px;margin-block-end:20px;font-size:1rem;pointer-events:all;overflow:hidden;min-inline-size:250px;max-inline-size:calc(100vw - 40px)}@media(min-width:768px){.si-toast{max-inline-size:400px}}.si-toast.si-toast-auto-close{padding-block-end:10px}.si-toast.si-toast-auto-close:before{content:\"\";background:var(--element-ui-4);inset-inline-end:0}.bar{inset-block-start:0;inset-inline-start:0;position:absolute;inline-size:4px;block-size:100%;background:currentColor}@keyframes si-toast-auto-close-animation{0%{inline-size:100%}to{inline-size:0}}.si-toast-timer-bar{animation:si-toast-auto-close-animation var(--toast-timer-duration, 4s) linear forwards;animation-play-state:var(--play-state, running);background-color:var(--element-ui-0)}.toast-content{flex:1;overflow:hidden;white-space:nowrap}.toast-content p{margin-block:0;line-height:1.125rem;white-space:pre-line;overflow-wrap:break-word;word-wrap:break-word}.toast-content .toast-title{line-height:1.25rem}\n"] }]
|
|
59
|
+
}], propDecorators: { toast: [{ type: i0.Input, args: [{ isSignal: true, alias: "toast", required: true }] }], paused: [{ type: i0.Output, args: ["paused"] }], resumed: [{ type: i0.Output, args: ["resumed"] }], onMouseEnter: [{
|
|
65
60
|
type: HostListener,
|
|
66
61
|
args: ['mouseenter']
|
|
67
62
|
}], onMouseLeave: [{
|
|
@@ -74,41 +69,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
74
69
|
* SPDX-License-Identifier: MIT
|
|
75
70
|
*/
|
|
76
71
|
class SiToastNotificationDrawerComponent {
|
|
77
|
-
toasts = input();
|
|
72
|
+
toasts = input(...(ngDevMode ? [undefined, { debugName: "toasts" }] : []));
|
|
78
73
|
paused = output();
|
|
79
74
|
resumed = output();
|
|
80
75
|
animationsDisabled = areAnimationsDisabled();
|
|
81
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
82
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
83
|
-
trigger('toastTrigger', [
|
|
84
|
-
transition(':enter', [
|
|
85
|
-
style({ opacity: 0, transform: 'translateY(100%)' }),
|
|
86
|
-
animate('500ms cubic-bezier(0.175, 0.885, 0.32, 1.275)', style({ opacity: 1, transform: 'translateY(0%)' }))
|
|
87
|
-
]),
|
|
88
|
-
transition(':leave', [
|
|
89
|
-
style({ 'opacity': 1, 'inset-inline-end': '0%' }),
|
|
90
|
-
animate('300ms', style({ 'opacity': 0, 'inset-inline-end': '-100%' }))
|
|
91
|
-
])
|
|
92
|
-
])
|
|
93
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiToastNotificationDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
77
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiToastNotificationDrawerComponent, isStandalone: true, selector: "si-toast-notification-drawer", inputs: { toasts: { classPropertyName: "toasts", publicName: "toasts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { paused: "paused", resumed: "resumed" }, host: { attributes: { "aria-live": "polite" }, properties: { "class.animations-disabled": "animationsDisabled" } }, ngImport: i0, template: "@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n class=\"position-relative\"\n animate.enter=\"toast-enter\"\n animate.leave=\"toast-leave\"\n [toast]=\"toast\"\n (paused)=\"paused.emit(toast)\"\n (resumed)=\"resumed.emit(toast)\"\n />\n}\n", styles: ["::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer){z-index:2000}si-toast-notification{inset-inline-end:0}.toast-enter{transition-property:opacity,transform;transition-duration:.5s;transition-timing-function:cubic-bezier(.175,.885,.32,1.275);opacity:1;transform:translateY(0)}@starting-style{.toast-enter{opacity:0;transform:translateY(100%)}}.toast-leave{transition-property:opacity,transform;transition-duration:.3s;transition-timing-function:cubic-bezier(.175,.885,.32,1.275);opacity:0;transform:translate(100%)}:host.animations-disabled si-toast-notification{transition:none}:host.animations-disabled si-toast-notification.toast-enter,:host.animations-disabled si-toast-notification.toast-leave{transition:none}\n"], dependencies: [{ kind: "component", type: SiToastNotificationComponent, selector: "si-toast-notification", inputs: ["toast"], outputs: ["paused", "resumed"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
94
78
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiToastNotificationDrawerComponent, decorators: [{
|
|
96
80
|
type: Component,
|
|
97
81
|
args: [{ selector: 'si-toast-notification-drawer', imports: [AsyncPipe, SiToastNotificationComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
98
|
-
'aria-live': 'polite'
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
style({ opacity: 0, transform: 'translateY(100%)' }),
|
|
103
|
-
animate('500ms cubic-bezier(0.175, 0.885, 0.32, 1.275)', style({ opacity: 1, transform: 'translateY(0%)' }))
|
|
104
|
-
]),
|
|
105
|
-
transition(':leave', [
|
|
106
|
-
style({ 'opacity': 1, 'inset-inline-end': '0%' }),
|
|
107
|
-
animate('300ms', style({ 'opacity': 0, 'inset-inline-end': '-100%' }))
|
|
108
|
-
])
|
|
109
|
-
])
|
|
110
|
-
], template: "@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n @toastTrigger\n class=\"position-relative\"\n [toast]=\"toast\"\n [@.disabled]=\"animationsDisabled\"\n (paused)=\"paused.emit(toast)\"\n (resumed)=\"resumed.emit(toast)\"\n />\n}\n", styles: ["::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer){z-index:2000}\n"] }]
|
|
111
|
-
}] });
|
|
82
|
+
'aria-live': 'polite',
|
|
83
|
+
'[class.animations-disabled]': 'animationsDisabled'
|
|
84
|
+
}, template: "@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n class=\"position-relative\"\n animate.enter=\"toast-enter\"\n animate.leave=\"toast-leave\"\n [toast]=\"toast\"\n (paused)=\"paused.emit(toast)\"\n (resumed)=\"resumed.emit(toast)\"\n />\n}\n", styles: ["::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer){z-index:2000}si-toast-notification{inset-inline-end:0}.toast-enter{transition-property:opacity,transform;transition-duration:.5s;transition-timing-function:cubic-bezier(.175,.885,.32,1.275);opacity:1;transform:translateY(0)}@starting-style{.toast-enter{opacity:0;transform:translateY(100%)}}.toast-leave{transition-property:opacity,transform;transition-duration:.3s;transition-timing-function:cubic-bezier(.175,.885,.32,1.275);opacity:0;transform:translate(100%)}:host.animations-disabled si-toast-notification{transition:none}:host.animations-disabled si-toast-notification.toast-enter,:host.animations-disabled si-toast-notification.toast-leave{transition:none}\n"] }]
|
|
85
|
+
}], propDecorators: { toasts: [{ type: i0.Input, args: [{ isSignal: true, alias: "toasts", required: false }] }], paused: [{ type: i0.Output, args: ["paused"] }], resumed: [{ type: i0.Output, args: ["resumed"] }] } });
|
|
112
86
|
|
|
113
87
|
/**
|
|
114
88
|
* Copyright (c) Siemens 2016 - 2025
|
|
@@ -248,10 +222,10 @@ class SiToastNotificationService {
|
|
|
248
222
|
}
|
|
249
223
|
return injector;
|
|
250
224
|
}
|
|
251
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
252
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
225
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiToastNotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
226
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiToastNotificationService, providedIn: 'root' });
|
|
253
227
|
}
|
|
254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiToastNotificationService, decorators: [{
|
|
255
229
|
type: Injectable,
|
|
256
230
|
args: [{ providedIn: 'root' }]
|
|
257
231
|
}], ctorParameters: () => [] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-element-ng-toast-notification.mjs","sources":["../../../../projects/element-ng/toast-notification/si-toast.model.ts","../../../../projects/element-ng/toast-notification/si-toast-notification/si-toast-notification.component.ts","../../../../projects/element-ng/toast-notification/si-toast-notification/si-toast-notification.component.html","../../../../projects/element-ng/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.ts","../../../../projects/element-ng/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.html","../../../../projects/element-ng/toast-notification/si-toast-notification.service.ts","../../../../projects/element-ng/toast-notification/index.ts","../../../../projects/element-ng/toast-notification/siemens-element-ng-toast-notification.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { StatusType } from '@siemens/element-ng/common';\nimport { Link } from '@siemens/element-ng/link';\nimport { TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { Subject } from 'rxjs';\n\nexport interface SiToast {\n state: ToastStateName;\n title: TranslatableString;\n message: TranslatableString;\n disableManualClose?: boolean;\n disableAutoClose?: boolean;\n timeout?: number;\n action?: Link;\n close?: () => void;\n translationParams?: { [key: string]: any };\n hidden?: Subject<void>;\n closeAriaLabel?: TranslatableString;\n}\n\nexport type ToastStateName = StatusType | 'connection';\n\nexport const SI_TOAST_AUTO_HIDE_DELAY = 6000;\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { NgClass } from '@angular/common';\nimport { Component, computed, HostListener, inject, input, output, signal } from '@angular/core';\nimport {\n addIcons,\n elementCancel,\n SiIconComponent,\n SiStatusIconComponent,\n STATUS_ICON_CONFIG\n} from '@siemens/element-ng/icon';\nimport { SiLinkModule } from '@siemens/element-ng/link';\nimport { SiTranslatePipe, t } from '@siemens/element-translate-ng/translate';\n\nimport { SI_TOAST_AUTO_HIDE_DELAY, SiToast } from '../si-toast.model';\n\n@Component({\n selector: 'si-toast-notification',\n imports: [NgClass, SiLinkModule, SiIconComponent, SiStatusIconComponent, SiTranslatePipe],\n templateUrl: './si-toast-notification.component.html',\n styleUrl: './si-toast-notification.component.scss'\n})\nexport class SiToastNotificationComponent {\n private readonly statusIcons = inject(STATUS_ICON_CONFIG);\n readonly toast = input.required<SiToast>();\n\n private closeAriaLabelDefault = t(() => $localize`:@@SI_TOAST.CLOSE:Close`);\n protected readonly closeAriaLabel = computed(\n () => this.toast().closeAriaLabel ?? this.closeAriaLabelDefault\n );\n protected readonly icons = addIcons({ elementCancel });\n protected readonly status = computed(() => {\n const toast = this.toast();\n if (toast.state === 'connection') {\n return 'danger';\n } else {\n return Object.keys(this.statusIcons).includes(toast.state) ? toast.state : 'info';\n }\n });\n protected readonly statusColor = computed(() => this.statusIcons[this.status()].color);\n protected readonly toastTimeoutInSeconds = computed(() => {\n const toast = this.toast();\n return toast.timeout ? toast.timeout / 1000 : SI_TOAST_AUTO_HIDE_DELAY / 1000;\n });\n protected readonly animationMode = signal('running');\n readonly paused = output<void>();\n readonly resumed = output<void>();\n\n @HostListener('mouseenter')\n protected onMouseEnter(): void {\n if (!this.toast().disableAutoClose) {\n this.animationMode.set('paused');\n this.paused.emit();\n }\n }\n\n @HostListener('mouseleave')\n protected onMouseLeave(): void {\n if (!this.toast().disableAutoClose) {\n this.animationMode.set('running');\n this.resumed.emit();\n }\n }\n\n protected close(): void {\n this.toast().close!();\n }\n}\n","@let toastValue = toast();\n@let autoClose = !toastValue.disableAutoClose;\n@let manualClose = !toastValue.disableManualClose;\n<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"autoClose\">\n @if (autoClose) {\n <div\n class=\"si-toast-timer-bar\"\n [style.--play-state]=\"animationMode()\"\n [style.--toast-timer-duration.s]=\"toastTimeoutInSeconds()\"\n ></div>\n }\n <div class=\"bar\" [ngClass]=\"statusColor()\"></div>\n <si-status-icon class=\"icon\" [status]=\"status()\" />\n\n <div class=\"toast-content px-4\">\n <p class=\"toast-title\"\n ><b>{{ toastValue.title | translate: toastValue.translationParams }}</b></p\n >\n @if (toastValue.message) {\n <p class=\"mt-4\">{{ toastValue.message | translate: toastValue.translationParams }}</p>\n }\n @if (toastValue.action) {\n <p [class.mt-3]=\"toastValue.message\" [class.mt-4]=\"!toastValue.message\">\n <a [siLink]=\"toastValue.action\">{{\n toastValue.action!.title | translate: toastValue.translationParams\n }}</a>\n </p>\n }\n </div>\n @if (manualClose) {\n <button\n type=\"button\"\n tabindex=\"0\"\n class=\"btn btn-circle btn-sm btn-ghost mt-n2 me-n2\"\n [attr.aria-label]=\"closeAriaLabel() | translate\"\n (keydown.enter)=\"close()\"\n (click)=\"close()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { animate, style, transition, trigger } from '@angular/animations';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { areAnimationsDisabled } from '@siemens/element-ng/common';\nimport { Observable } from 'rxjs';\n\nimport { SiToastNotificationComponent } from '../si-toast-notification/si-toast-notification.component';\nimport { SiToast } from '../si-toast.model';\n\n@Component({\n selector: 'si-toast-notification-drawer',\n imports: [AsyncPipe, SiToastNotificationComponent],\n templateUrl: './si-toast-notification-drawer.component.html',\n // workaround for cdk-overlay not supporting the order of overlays\n styles: `\n ::ng-deep .cdk-global-overlay-wrapper:has(si-toast-notification-drawer) {\n z-index: 2000;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'aria-live': 'polite'\n },\n animations: [\n trigger('toastTrigger', [\n transition(':enter', [\n style({ opacity: 0, transform: 'translateY(100%)' }),\n animate(\n '500ms cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n style({ opacity: 1, transform: 'translateY(0%)' })\n )\n ]),\n transition(':leave', [\n style({ 'opacity': 1, 'inset-inline-end': '0%' }),\n animate('300ms', style({ 'opacity': 0, 'inset-inline-end': '-100%' }))\n ])\n ])\n ]\n})\nexport class SiToastNotificationDrawerComponent {\n readonly toasts = input<Observable<SiToast[]>>();\n readonly paused = output<SiToast>();\n readonly resumed = output<SiToast>();\n\n protected animationsDisabled = areAnimationsDisabled();\n}\n","@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n @toastTrigger\n class=\"position-relative\"\n [toast]=\"toast\"\n [@.disabled]=\"animationsDisabled\"\n (paused)=\"paused.emit(toast)\"\n (resumed)=\"resumed.emit(toast)\"\n />\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport { ComponentRef, inject, Injectable, Injector, OnDestroy, PLATFORM_ID } from '@angular/core';\nimport { Link } from '@siemens/element-ng/link';\nimport { SiNoTranslateService, SiTranslateService } from '@siemens/element-translate-ng/translate';\nimport { ReplaySubject, Subject } from 'rxjs';\n\nimport { SiToastNotificationDrawerComponent } from './si-toast-notification-drawer/si-toast-notification-drawer.component';\nimport { SI_TOAST_AUTO_HIDE_DELAY, SiToast, ToastStateName } from './si-toast.model';\n\n@Injectable({ providedIn: 'root' })\nexport class SiToastNotificationService implements OnDestroy {\n /**\n * List of currently active toasts to see details or close them.\n *\n * @defaultValue []\n */\n activeToasts: SiToast[] = [];\n\n private activeToastsSubject = new ReplaySubject<SiToast[]>(1);\n private queuedToastSubject = new Subject<SiToast>();\n private readonly maxToasts = 3;\n\n private componentRef?: ComponentRef<SiToastNotificationDrawerComponent>;\n private overlayRef?: OverlayRef;\n\n private injector = inject(Injector);\n private overlay = inject(Overlay);\n private toastTimeoutMap = new Map<SiToast, any>();\n private toastTimerDefaults = new Map<\n SiToast,\n { pendingTimeout: number; initializeTime: number }\n >();\n\n constructor() {\n const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n this.queuedToastSubject.subscribe((toast: SiToast) => {\n this.activeToasts.push(toast);\n if (this.activeToasts.length > this.maxToasts) {\n this.hideToastNotification(this.activeToasts[0]);\n }\n this.activeToastsSubject.next(this.activeToasts);\n if (!toast.disableAutoClose && toast.timeout) {\n this.toastTimerDefaults.set(toast, {\n pendingTimeout: toast.timeout,\n initializeTime: Date.now()\n });\n this.toastTimeoutMap.set(\n toast,\n setTimeout(() => this.hideToastNotification(toast), toast.timeout)\n );\n }\n });\n\n if (isBrowser) {\n this.addToastDrawer();\n }\n }\n\n ngOnDestroy(): void {\n this.overlayRef?.dispose();\n this.componentRef?.destroy();\n }\n\n /**\n * Queue a new toast to be shown.\n * @param action - Passing a Link object will optionally add a clickable link to the toast which can contain an action.\n * @returns the toast object\n */\n queueToastNotification(\n state: ToastStateName,\n title: string,\n message: string,\n disableAutoClose?: boolean,\n disableManualClose?: boolean,\n action?: Link\n ): SiToast {\n const toast: SiToast = {\n state,\n title,\n message,\n disableAutoClose,\n disableManualClose,\n action,\n hidden: new Subject()\n };\n return this.showToastNotification(toast);\n }\n\n /**\n * Show a toast notification\n * @param toast - The toast object of the toast to be shown, can also be constructed while calling this.\n */\n showToastNotification(toast: SiToast): SiToast {\n toast.timeout ??= SI_TOAST_AUTO_HIDE_DELAY;\n toast.hidden ??= new Subject();\n toast.close = () => this.hideToastNotification(toast);\n this.queuedToastSubject.next(toast);\n return toast;\n }\n\n /**\n * Hide a toast notification\n * @param toast - The toast object of the toast to be hidden, can be retrieved from {@link activeToasts} and is returned by {@link queueToastNotification}.\n */\n hideToastNotification(toast?: SiToast): void {\n const hiddenToasts: SiToast[] = [];\n const activeToasts: SiToast[] = [];\n this.activeToasts.forEach(item => {\n if (!toast || item === toast) {\n hiddenToasts.push(item);\n } else {\n activeToasts.push(item);\n }\n });\n\n this.activeToasts = activeToasts;\n this.activeToastsSubject.next(this.activeToasts);\n\n hiddenToasts.forEach(item => {\n item.hidden?.next();\n item.hidden?.complete();\n this.toastTimerDefaults.delete(item);\n this.toastTimeoutMap.delete(item);\n });\n }\n\n private pauseToastNotification(toast: SiToast): void {\n if (!toast.disableAutoClose) {\n clearTimeout(this.toastTimeoutMap.get(toast));\n\n const initialTimeout = this.toastTimerDefaults.get(toast)?.initializeTime;\n const elapsedTime = initialTimeout ? Date.now() - initialTimeout : 0;\n this.toastTimerDefaults.get(toast)!.pendingTimeout -= elapsedTime;\n }\n }\n\n private resumeToastNotification(toast: SiToast): void {\n if (!toast.disableAutoClose) {\n this.toastTimerDefaults.get(toast)!.initializeTime = Date.now();\n this.toastTimeoutMap.set(\n toast,\n setTimeout(() => {\n this.hideToastNotification(this.activeToasts.find(t => t === toast));\n }, this.toastTimerDefaults.get(toast)!.pendingTimeout)\n );\n }\n }\n\n private addToastDrawer(): void {\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay.position().global().end('20px').bottom()\n });\n const portal = new ComponentPortal(\n SiToastNotificationDrawerComponent,\n null,\n this.buildInjector()\n );\n this.componentRef = this.overlayRef.attach(portal);\n this.componentRef.setInput('toasts', this.activeToastsSubject);\n this.componentRef.instance.paused.subscribe(toast => {\n this.pauseToastNotification(toast);\n });\n this.componentRef.instance.resumed.subscribe(toast => {\n this.resumeToastNotification(toast);\n });\n }\n\n // TODO remove once translation must be defined at application start\n // Notification service is provided in 'root'. If no translation is defined, SiNoTranslateService is not provided\n private buildInjector(): Injector {\n let injector = this.injector;\n if (!injector.get(SiTranslateService, null)) {\n injector = Injector.create({\n providers: [{ provide: SiTranslateService, useClass: SiNoTranslateService, deps: [] }],\n parent: this.injector\n });\n }\n return injector;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-toast.model';\nexport * from './si-toast-notification.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyBO,MAAM,wBAAwB,GAAG;;ACzBxC;;;AAGG;MAqBU,4BAA4B,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sB,CAAC,KAAK,CAAC;AACpC,SAAC,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,IAAG;AACnD,YAAA,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;AACrC,SAAC,CAAC;;;;IAKI,aAAa,GAAA;AACnB,QAAA,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ;QAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE;AAC3C,YAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC;AACzB,gBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;gBACtF,MAAM,EAAE,IAAI,CAAC;AACd,aAAA,CAAC;;AAEJ,QAAA,OAAO,QAAQ;;uGAvKN,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAA1B,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA;;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACflC;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"siemens-element-ng-toast-notification.mjs","sources":["../../../../projects/element-ng/toast-notification/si-toast.model.ts","../../../../projects/element-ng/toast-notification/si-toast-notification/si-toast-notification.component.ts","../../../../projects/element-ng/toast-notification/si-toast-notification/si-toast-notification.component.html","../../../../projects/element-ng/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.ts","../../../../projects/element-ng/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.html","../../../../projects/element-ng/toast-notification/si-toast-notification.service.ts","../../../../projects/element-ng/toast-notification/index.ts","../../../../projects/element-ng/toast-notification/siemens-element-ng-toast-notification.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { StatusType } from '@siemens/element-ng/common';\nimport { Link } from '@siemens/element-ng/link';\nimport { TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { Subject } from 'rxjs';\n\nexport interface SiToast {\n state: StatusType;\n title: TranslatableString;\n message: TranslatableString;\n disableManualClose?: boolean;\n disableAutoClose?: boolean;\n timeout?: number;\n action?: Link;\n close?: () => void;\n translationParams?: { [key: string]: any };\n hidden?: Subject<void>;\n closeAriaLabel?: TranslatableString;\n}\n\nexport const SI_TOAST_AUTO_HIDE_DELAY = 6000;\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Component, computed, HostListener, inject, input, output, signal } from '@angular/core';\nimport { elementCancel } from '@siemens/element-icons';\nimport {\n addIcons,\n SiIconComponent,\n SiStatusIconComponent,\n STATUS_ICON_CONFIG\n} from '@siemens/element-ng/icon';\nimport { SiLinkModule } from '@siemens/element-ng/link';\nimport { SiTranslatePipe, t } from '@siemens/element-translate-ng/translate';\n\nimport { SI_TOAST_AUTO_HIDE_DELAY, SiToast } from '../si-toast.model';\n\n@Component({\n selector: 'si-toast-notification',\n imports: [SiLinkModule, SiIconComponent, SiStatusIconComponent, SiTranslatePipe],\n templateUrl: './si-toast-notification.component.html',\n styleUrl: './si-toast-notification.component.scss'\n})\nexport class SiToastNotificationComponent {\n private readonly statusIcons = inject(STATUS_ICON_CONFIG);\n readonly toast = input.required<SiToast>();\n\n private closeAriaLabelDefault = t(() => $localize`:@@SI_TOAST.CLOSE:Close`);\n protected readonly closeAriaLabel = computed(\n () => this.toast().closeAriaLabel ?? this.closeAriaLabelDefault\n );\n protected readonly icons = addIcons({ elementCancel });\n protected readonly status = computed(() => {\n const toast = this.toast();\n return Object.keys(this.statusIcons).includes(toast.state) ? toast.state : 'info';\n });\n protected readonly statusColor = computed(() => this.statusIcons[this.status()].color);\n protected readonly toastTimeoutInSeconds = computed(() => {\n const toast = this.toast();\n return toast.timeout ? toast.timeout / 1000 : SI_TOAST_AUTO_HIDE_DELAY / 1000;\n });\n protected readonly animationMode = signal('running');\n readonly paused = output<void>();\n readonly resumed = output<void>();\n\n @HostListener('mouseenter')\n protected onMouseEnter(): void {\n if (!this.toast().disableAutoClose) {\n this.animationMode.set('paused');\n this.paused.emit();\n }\n }\n\n @HostListener('mouseleave')\n protected onMouseLeave(): void {\n if (!this.toast().disableAutoClose) {\n this.animationMode.set('running');\n this.resumed.emit();\n }\n }\n\n protected close(): void {\n this.toast().close!();\n }\n}\n","@let toastValue = toast();\n@let autoClose = !toastValue.disableAutoClose;\n@let manualClose = !toastValue.disableManualClose;\n<div class=\"si-toast elevation-2\" [class.si-toast-auto-close]=\"autoClose\">\n @if (autoClose) {\n <div\n class=\"si-toast-timer-bar\"\n [style.--play-state]=\"animationMode()\"\n [style.--toast-timer-duration.s]=\"toastTimeoutInSeconds()\"\n ></div>\n }\n <div [class]=\"`bar ${statusColor()}`\"></div>\n <si-status-icon class=\"icon\" [status]=\"status()\" />\n\n <div class=\"toast-content px-4\">\n <p class=\"toast-title\"\n ><b>{{ toastValue.title | translate: toastValue.translationParams }}</b></p\n >\n @if (toastValue.message) {\n <p class=\"mt-4\">{{ toastValue.message | translate: toastValue.translationParams }}</p>\n }\n @if (toastValue.action) {\n <p [class.mt-3]=\"toastValue.message\" [class.mt-4]=\"!toastValue.message\">\n <a [siLink]=\"toastValue.action\">{{\n toastValue.action!.title | translate: toastValue.translationParams\n }}</a>\n </p>\n }\n </div>\n @if (manualClose) {\n <button\n type=\"button\"\n tabindex=\"0\"\n class=\"btn btn-icon btn-ghost mt-n2 me-n2\"\n [attr.aria-label]=\"closeAriaLabel() | translate\"\n (keydown.enter)=\"close()\"\n (click)=\"close()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { areAnimationsDisabled } from '@siemens/element-ng/common';\nimport { Observable } from 'rxjs';\n\nimport { SiToastNotificationComponent } from '../si-toast-notification/si-toast-notification.component';\nimport { SiToast } from '../si-toast.model';\n\n@Component({\n selector: 'si-toast-notification-drawer',\n imports: [AsyncPipe, SiToastNotificationComponent],\n templateUrl: './si-toast-notification-drawer.component.html',\n styleUrl: './si-toast-notification-drawer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'aria-live': 'polite',\n '[class.animations-disabled]': 'animationsDisabled'\n }\n})\nexport class SiToastNotificationDrawerComponent {\n readonly toasts = input<Observable<SiToast[]>>();\n readonly paused = output<SiToast>();\n readonly resumed = output<SiToast>();\n\n protected animationsDisabled = areAnimationsDisabled();\n}\n","@for (toast of toasts() | async; track toast) {\n <si-toast-notification\n class=\"position-relative\"\n animate.enter=\"toast-enter\"\n animate.leave=\"toast-leave\"\n [toast]=\"toast\"\n (paused)=\"paused.emit(toast)\"\n (resumed)=\"resumed.emit(toast)\"\n />\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport { ComponentRef, inject, Injectable, Injector, OnDestroy, PLATFORM_ID } from '@angular/core';\nimport { StatusType } from '@siemens/element-ng/common';\nimport { Link } from '@siemens/element-ng/link';\nimport { SiNoTranslateService, SiTranslateService } from '@siemens/element-translate-ng/translate';\nimport { ReplaySubject, Subject } from 'rxjs';\n\nimport { SiToastNotificationDrawerComponent } from './si-toast-notification-drawer/si-toast-notification-drawer.component';\nimport { SI_TOAST_AUTO_HIDE_DELAY, SiToast } from './si-toast.model';\n\n@Injectable({ providedIn: 'root' })\nexport class SiToastNotificationService implements OnDestroy {\n /**\n * List of currently active toasts to see details or close them.\n *\n * @defaultValue []\n */\n activeToasts: SiToast[] = [];\n\n private activeToastsSubject = new ReplaySubject<SiToast[]>(1);\n private queuedToastSubject = new Subject<SiToast>();\n private readonly maxToasts = 3;\n\n private componentRef?: ComponentRef<SiToastNotificationDrawerComponent>;\n private overlayRef?: OverlayRef;\n\n private injector = inject(Injector);\n private overlay = inject(Overlay);\n private toastTimeoutMap = new Map<SiToast, any>();\n private toastTimerDefaults = new Map<\n SiToast,\n { pendingTimeout: number; initializeTime: number }\n >();\n\n constructor() {\n const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n this.queuedToastSubject.subscribe((toast: SiToast) => {\n this.activeToasts.push(toast);\n if (this.activeToasts.length > this.maxToasts) {\n this.hideToastNotification(this.activeToasts[0]);\n }\n this.activeToastsSubject.next(this.activeToasts);\n if (!toast.disableAutoClose && toast.timeout) {\n this.toastTimerDefaults.set(toast, {\n pendingTimeout: toast.timeout,\n initializeTime: Date.now()\n });\n this.toastTimeoutMap.set(\n toast,\n setTimeout(() => this.hideToastNotification(toast), toast.timeout)\n );\n }\n });\n\n if (isBrowser) {\n this.addToastDrawer();\n }\n }\n\n ngOnDestroy(): void {\n this.overlayRef?.dispose();\n this.componentRef?.destroy();\n }\n\n /**\n * Queue a new toast to be shown.\n * @param action - Passing a Link object will optionally add a clickable link to the toast which can contain an action.\n * @returns the toast object\n */\n queueToastNotification(\n state: StatusType,\n title: string,\n message: string,\n disableAutoClose?: boolean,\n disableManualClose?: boolean,\n action?: Link\n ): SiToast {\n const toast: SiToast = {\n state,\n title,\n message,\n disableAutoClose,\n disableManualClose,\n action,\n hidden: new Subject()\n };\n return this.showToastNotification(toast);\n }\n\n /**\n * Show a toast notification\n * @param toast - The toast object of the toast to be shown, can also be constructed while calling this.\n */\n showToastNotification(toast: SiToast): SiToast {\n toast.timeout ??= SI_TOAST_AUTO_HIDE_DELAY;\n toast.hidden ??= new Subject();\n toast.close = () => this.hideToastNotification(toast);\n this.queuedToastSubject.next(toast);\n return toast;\n }\n\n /**\n * Hide a toast notification\n * @param toast - The toast object of the toast to be hidden, can be retrieved from {@link activeToasts} and is returned by {@link queueToastNotification}.\n */\n hideToastNotification(toast?: SiToast): void {\n const hiddenToasts: SiToast[] = [];\n const activeToasts: SiToast[] = [];\n this.activeToasts.forEach(item => {\n if (!toast || item === toast) {\n hiddenToasts.push(item);\n } else {\n activeToasts.push(item);\n }\n });\n\n this.activeToasts = activeToasts;\n this.activeToastsSubject.next(this.activeToasts);\n\n hiddenToasts.forEach(item => {\n item.hidden?.next();\n item.hidden?.complete();\n this.toastTimerDefaults.delete(item);\n this.toastTimeoutMap.delete(item);\n });\n }\n\n private pauseToastNotification(toast: SiToast): void {\n if (!toast.disableAutoClose) {\n clearTimeout(this.toastTimeoutMap.get(toast));\n\n const initialTimeout = this.toastTimerDefaults.get(toast)?.initializeTime;\n const elapsedTime = initialTimeout ? Date.now() - initialTimeout : 0;\n this.toastTimerDefaults.get(toast)!.pendingTimeout -= elapsedTime;\n }\n }\n\n private resumeToastNotification(toast: SiToast): void {\n if (!toast.disableAutoClose) {\n this.toastTimerDefaults.get(toast)!.initializeTime = Date.now();\n this.toastTimeoutMap.set(\n toast,\n setTimeout(() => {\n this.hideToastNotification(this.activeToasts.find(t => t === toast));\n }, this.toastTimerDefaults.get(toast)!.pendingTimeout)\n );\n }\n }\n\n private addToastDrawer(): void {\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay.position().global().end('20px').bottom()\n });\n const portal = new ComponentPortal(\n SiToastNotificationDrawerComponent,\n null,\n this.buildInjector()\n );\n this.componentRef = this.overlayRef.attach(portal);\n this.componentRef.setInput('toasts', this.activeToastsSubject);\n this.componentRef.instance.paused.subscribe(toast => {\n this.pauseToastNotification(toast);\n });\n this.componentRef.instance.resumed.subscribe(toast => {\n this.resumeToastNotification(toast);\n });\n }\n\n // TODO remove once translation must be defined at application start\n // Notification service is provided in 'root'. If no translation is defined, SiNoTranslateService is not provided\n private buildInjector(): Injector {\n let injector = this.injector;\n if (!injector.get(SiTranslateService, null)) {\n injector = Injector.create({\n providers: [{ provide: SiTranslateService, useClass: SiNoTranslateService, deps: [] }],\n parent: this.injector\n });\n }\n return injector;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-toast.model';\nexport * from './si-toast-notification.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAuBO,MAAM,wBAAwB,GAAG;;ACvBxC;;;AAGG;MAoBU,4BAA4B,CAAA;AACtB,IAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAChD,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAW;IAElC,qBAAqB,GAAG,CAAC,CAAC,MAAM,SAAS,CAAA,CAAA,uBAAA,CAAyB,CAAC;AACxD,IAAA,cAAc,GAAG,QAAQ,CAC1C,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,cAAc,IAAI,IAAI,CAAC,qBAAqB,0DAChE;AACkB,IAAA,KAAK,GAAG,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;AACnC,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAK;AACxC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;QAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,MAAM;AACnF,IAAA,CAAC,kDAAC;AACiB,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,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AO,QAAQ;IACjB;uGAxKW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAA1B,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA;;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;AChBlC;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, signal, inject, ElementRef, computed, TemplateRef, Component, Injectable, booleanAttribute,
|
|
2
|
+
import { input, signal, inject, ElementRef, computed, TemplateRef, Component, Injectable, booleanAttribute, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
5
5
|
import { calculateOverlayArrowPosition, getPositionStrategy, getOverlay } from '@siemens/element-ng/common';
|
|
6
|
-
import {
|
|
6
|
+
import { NgTemplateOutlet, NgComponentOutlet } from '@angular/common';
|
|
7
7
|
import { SiTranslatePipe } from '@siemens/element-translate-ng/translate';
|
|
8
8
|
|
|
9
9
|
class TooltipComponent {
|
|
10
10
|
/** @defaultValue '' */
|
|
11
|
-
tooltip = input('');
|
|
12
|
-
tooltipPositionClass = signal('');
|
|
13
|
-
arrowPos = signal(undefined);
|
|
11
|
+
tooltip = input('', ...(ngDevMode ? [{ debugName: "tooltip" }] : []));
|
|
12
|
+
tooltipPositionClass = signal('', ...(ngDevMode ? [{ debugName: "tooltipPositionClass" }] : []));
|
|
13
|
+
arrowPos = signal(undefined, ...(ngDevMode ? [{ debugName: "arrowPos" }] : []));
|
|
14
14
|
/** @internal */
|
|
15
|
-
id = input('');
|
|
16
|
-
tooltipContext = input();
|
|
15
|
+
id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
16
|
+
tooltipContext = input(...(ngDevMode ? [undefined, { debugName: "tooltipContext" }] : []));
|
|
17
17
|
elementRef = inject(ElementRef);
|
|
18
18
|
tooltipText = computed(() => {
|
|
19
19
|
const tooltip = this.tooltip();
|
|
20
20
|
return typeof tooltip === 'string' ? tooltip : null;
|
|
21
|
-
});
|
|
21
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipText" }] : []));
|
|
22
22
|
tooltipTemplate = computed(() => {
|
|
23
23
|
const tooltip = this.tooltip();
|
|
24
24
|
return tooltip instanceof TemplateRef ? tooltip : null;
|
|
25
|
-
});
|
|
25
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : []));
|
|
26
26
|
tooltipComponent = computed(() => {
|
|
27
27
|
const tooltip = this.tooltip();
|
|
28
28
|
return !(tooltip instanceof TemplateRef) && typeof tooltip !== 'string' ? tooltip : null;
|
|
29
|
-
});
|
|
29
|
+
}, ...(ngDevMode ? [{ debugName: "tooltipComponent" }] : []));
|
|
30
30
|
/** @internal */
|
|
31
31
|
updateTooltipPosition(change, anchor) {
|
|
32
32
|
const arrowClassTooltip = `tooltip-${change.connectionPair.overlayX}-${change.connectionPair.overlayY}`;
|
|
@@ -37,13 +37,15 @@ class TooltipComponent {
|
|
|
37
37
|
const arrowPos = calculateOverlayArrowPosition(change, this.elementRef, anchor);
|
|
38
38
|
this.arrowPos.set(arrowPos);
|
|
39
39
|
}
|
|
40
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
41
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
41
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: TooltipComponent, isStandalone: true, selector: "si-tooltip", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, tooltipContext: { classPropertyName: "tooltipContext", publicName: "tooltipContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "animate.leave": "tooltip-leave" } }, ngImport: i0, template: "<div\n class=\"tooltip show position-relative\"\n role=\"tooltip\"\n [id]=\"id()\"\n [class]=\"tooltipPositionClass()\"\n>\n <div\n class=\"tooltip-arrow\"\n [style.left.px]=\"arrowPos()?.left\"\n [style.right.px]=\"arrowPos()?.right\"\n ></div>\n <div class=\"tooltip-inner\">\n @if (tooltipText()) {\n <div class=\"si-body\">{{ tooltipText() | translate }}</div>\n } @else if (tooltipTemplate()) {\n <ng-template\n [ngTemplateOutlet]=\"tooltipTemplate()\"\n [ngTemplateOutletContext]=\"tooltipContext()\"\n />\n } @else if (tooltipComponent()) {\n <ng-container [ngComponentOutlet]=\"tooltipComponent()\" />\n }\n </div>\n</div>\n", styles: [":host .tooltip,:host{transition:opacity calc(.15s * var(--element-animations-enabled, 1)) ease-out,transform calc(.15s * var(--element-animations-enabled, 1)) ease-out}:host{opacity:1;transform:scale(1)}:host.tooltip-leave{opacity:0;transform:scale(.8)}@starting-style{:host .tooltip{opacity:0;transform:scale(.8)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
42
42
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
44
44
|
type: Component,
|
|
45
|
-
args: [{ selector: 'si-tooltip', imports: [
|
|
46
|
-
|
|
45
|
+
args: [{ selector: 'si-tooltip', imports: [NgTemplateOutlet, SiTranslatePipe, NgComponentOutlet], host: {
|
|
46
|
+
'animate.leave': 'tooltip-leave'
|
|
47
|
+
}, template: "<div\n class=\"tooltip show position-relative\"\n role=\"tooltip\"\n [id]=\"id()\"\n [class]=\"tooltipPositionClass()\"\n>\n <div\n class=\"tooltip-arrow\"\n [style.left.px]=\"arrowPos()?.left\"\n [style.right.px]=\"arrowPos()?.right\"\n ></div>\n <div class=\"tooltip-inner\">\n @if (tooltipText()) {\n <div class=\"si-body\">{{ tooltipText() | translate }}</div>\n } @else if (tooltipTemplate()) {\n <ng-template\n [ngTemplateOutlet]=\"tooltipTemplate()\"\n [ngTemplateOutletContext]=\"tooltipContext()\"\n />\n } @else if (tooltipComponent()) {\n <ng-container [ngComponentOutlet]=\"tooltipComponent()\" />\n }\n </div>\n</div>\n", styles: [":host .tooltip,:host{transition:opacity calc(.15s * var(--element-animations-enabled, 1)) ease-out,transform calc(.15s * var(--element-animations-enabled, 1)) ease-out}:host{opacity:1;transform:scale(1)}:host.tooltip-leave{opacity:0;transform:scale(.8)}@starting-style{:host .tooltip{opacity:0;transform:scale(.8)}}\n"] }]
|
|
48
|
+
}], propDecorators: { tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], tooltipContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipContext", required: false }] }] } });
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
* Copyright (c) Siemens 2016 - 2025
|
|
@@ -102,10 +104,10 @@ class SiTooltipService {
|
|
|
102
104
|
createTooltip(config) {
|
|
103
105
|
return new TooltipRef(getOverlay(config.element, this.overlay, false, config.placement), config.element, config.describedBy, config.injector);
|
|
104
106
|
}
|
|
105
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
106
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
107
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
108
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipService });
|
|
107
109
|
}
|
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipService, decorators: [{
|
|
109
111
|
type: Injectable
|
|
110
112
|
}] });
|
|
111
113
|
|
|
@@ -120,103 +122,93 @@ class SiTooltipDirective {
|
|
|
120
122
|
*
|
|
121
123
|
* @defaultValue ''
|
|
122
124
|
*/
|
|
123
|
-
siTooltip = input('');
|
|
125
|
+
siTooltip = input('', ...(ngDevMode ? [{ debugName: "siTooltip" }] : []));
|
|
124
126
|
/**
|
|
125
127
|
* The placement of the tooltip. One of 'top', 'start', end', 'bottom'
|
|
126
128
|
*
|
|
127
129
|
* @defaultValue 'auto'
|
|
128
130
|
*/
|
|
129
|
-
placement = input('auto');
|
|
130
|
-
/**
|
|
131
|
-
* The trigger event on which the tooltip shall be displayed
|
|
132
|
-
*/
|
|
133
|
-
triggers = input();
|
|
131
|
+
placement = input('auto', ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
134
132
|
/**
|
|
135
133
|
* Allows the tooltip to be disabled
|
|
136
134
|
*
|
|
137
135
|
* @defaultValue false
|
|
138
136
|
*/
|
|
139
|
-
isDisabled = input(false, { transform: booleanAttribute });
|
|
137
|
+
isDisabled = input(false, { ...(ngDevMode ? { debugName: "isDisabled" } : {}), transform: booleanAttribute });
|
|
140
138
|
/**
|
|
141
139
|
* The context for the attached template
|
|
142
140
|
*/
|
|
143
|
-
tooltipContext = input();
|
|
141
|
+
tooltipContext = input(...(ngDevMode ? [undefined, { debugName: "tooltipContext" }] : []));
|
|
144
142
|
describedBy = `__tooltip_${SiTooltipDirective.idCounter++}`;
|
|
145
143
|
tooltipRef;
|
|
144
|
+
showTimeout;
|
|
146
145
|
tooltipService = inject(SiTooltipService);
|
|
147
146
|
elementRef = inject(ElementRef);
|
|
148
147
|
ngOnDestroy() {
|
|
148
|
+
this.clearShowTimeout();
|
|
149
149
|
this.tooltipRef?.destroy();
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
clearShowTimeout() {
|
|
152
|
+
if (this.showTimeout) {
|
|
153
|
+
clearTimeout(this.showTimeout);
|
|
154
|
+
this.showTimeout = undefined;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
showTooltip(immediate = false) {
|
|
152
158
|
const siTooltip = this.siTooltip();
|
|
153
159
|
if (this.isDisabled() || !siTooltip) {
|
|
154
160
|
return;
|
|
155
161
|
}
|
|
156
|
-
this.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
+
this.clearShowTimeout();
|
|
163
|
+
const delay = immediate ? 0 : 500;
|
|
164
|
+
this.showTimeout = setTimeout(() => {
|
|
165
|
+
this.tooltipRef ??= this.tooltipService.createTooltip({
|
|
166
|
+
describedBy: this.describedBy,
|
|
167
|
+
element: this.elementRef,
|
|
168
|
+
placement: this.placement()
|
|
169
|
+
});
|
|
170
|
+
this.tooltipRef.show(this.siTooltip(), this.tooltipContext());
|
|
171
|
+
}, delay);
|
|
162
172
|
}
|
|
163
173
|
focusIn() {
|
|
164
|
-
this.showTooltip();
|
|
174
|
+
this.showTooltip(true);
|
|
165
175
|
}
|
|
166
176
|
show() {
|
|
167
|
-
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
this.showTooltip();
|
|
177
|
+
this.showTooltip(false);
|
|
171
178
|
}
|
|
172
179
|
hide() {
|
|
180
|
+
this.clearShowTimeout();
|
|
173
181
|
this.tooltipRef?.hide();
|
|
174
182
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
this.hide();
|
|
180
|
-
}
|
|
181
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: SiTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
182
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.6", type: SiTooltipDirective, isStandalone: true, selector: "[siTooltip]", inputs: { siTooltip: { classPropertyName: "siTooltip", publicName: "siTooltip", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, triggers: { classPropertyName: "triggers", publicName: "triggers", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipContext: { classPropertyName: "tooltipContext", publicName: "tooltipContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "focusIn()", "mouseenter": "show()", "touchstart": "hide()", "focusout": "hide()", "mouseleave": "mouseOut()" }, properties: { "attr.aria-describedby": "describedBy" } }, providers: [SiTooltipService], ngImport: i0 });
|
|
183
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
184
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.8", type: SiTooltipDirective, isStandalone: true, selector: "[siTooltip]", inputs: { siTooltip: { classPropertyName: "siTooltip", publicName: "siTooltip", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipContext: { classPropertyName: "tooltipContext", publicName: "tooltipContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "focusIn()", "mouseenter": "show()", "touchstart": "hide()", "focusout": "hide()", "mouseleave": "hide()" }, properties: { "attr.aria-describedby": "describedBy" } }, providers: [SiTooltipService], ngImport: i0 });
|
|
183
185
|
}
|
|
184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipDirective, decorators: [{
|
|
185
187
|
type: Directive,
|
|
186
188
|
args: [{
|
|
187
189
|
selector: '[siTooltip]',
|
|
188
190
|
providers: [SiTooltipService],
|
|
189
191
|
host: {
|
|
190
|
-
'[attr.aria-describedby]': 'describedBy'
|
|
192
|
+
'[attr.aria-describedby]': 'describedBy',
|
|
193
|
+
'(focus)': 'focusIn()',
|
|
194
|
+
'(mouseenter)': 'show()',
|
|
195
|
+
'(touchstart)': 'hide()',
|
|
196
|
+
'(focusout)': 'hide()',
|
|
197
|
+
'(mouseleave)': 'hide()'
|
|
191
198
|
}
|
|
192
199
|
}]
|
|
193
|
-
}], propDecorators: {
|
|
194
|
-
type: HostListener,
|
|
195
|
-
args: ['focus']
|
|
196
|
-
}], show: [{
|
|
197
|
-
type: HostListener,
|
|
198
|
-
args: ['mouseenter']
|
|
199
|
-
}], hide: [{
|
|
200
|
-
type: HostListener,
|
|
201
|
-
args: ['touchstart']
|
|
202
|
-
}, {
|
|
203
|
-
type: HostListener,
|
|
204
|
-
args: ['focusout']
|
|
205
|
-
}], mouseOut: [{
|
|
206
|
-
type: HostListener,
|
|
207
|
-
args: ['mouseleave']
|
|
208
|
-
}] } });
|
|
200
|
+
}], propDecorators: { siTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "siTooltip", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], isDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDisabled", required: false }] }], tooltipContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipContext", required: false }] }] } });
|
|
209
201
|
|
|
210
202
|
/**
|
|
211
203
|
* Copyright (c) Siemens 2016 - 2025
|
|
212
204
|
* SPDX-License-Identifier: MIT
|
|
213
205
|
*/
|
|
214
206
|
class SiTooltipModule {
|
|
215
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
216
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
217
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
207
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
208
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipModule, imports: [SiTooltipDirective], exports: [SiTooltipDirective] });
|
|
209
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipModule });
|
|
218
210
|
}
|
|
219
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTooltipModule, decorators: [{
|
|
220
212
|
type: NgModule,
|
|
221
213
|
args: [{
|
|
222
214
|
imports: [SiTooltipDirective],
|