@taiga-ui/core 2.40.0 → 2.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{taiga-ui-core-modules-notifications.umd.js → taiga-ui-core-components-alert.umd.js} +102 -135
- package/bundles/taiga-ui-core-components-alert.umd.js.map +1 -0
- package/bundles/taiga-ui-core-components-alert.umd.min.js +16 -0
- package/bundles/taiga-ui-core-components-alert.umd.min.js.map +1 -0
- package/bundles/taiga-ui-core-components-button.umd.js +1 -1
- package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-button.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-button.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.js +3 -3
- package/bundles/taiga-ui-core-components-data-list.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.min.js +2 -2
- package/bundles/taiga-ui-core-components-data-list.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.js +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.js +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.js +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-hints-host.umd.js +2 -2
- package/bundles/taiga-ui-core-components-hints-host.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hints-host.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-hints-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-label.umd.js +1 -1
- package/bundles/taiga-ui-core-components-label.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-label.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-label.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-calendar.umd.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-calendar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-calendar.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-calendar.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +4 -4
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.js +14 -18
- package/bundles/taiga-ui-core-components-root.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.min.js +2 -2
- package/bundles/taiga-ui-core-components-root.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-scroll-controls.umd.js +3 -3
- package/bundles/taiga-ui-core-components-scroll-controls.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components.umd.js +12 -4
- package/bundles/taiga-ui-core-components.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components.umd.min.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-core-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js.map +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.min.js +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-core-tokens.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core.umd.js +4 -12
- package/bundles/taiga-ui-core.umd.js.map +1 -1
- package/bundles/taiga-ui-core.umd.min.js +1 -1
- package/components/alert/alert.component.d.ts +35 -0
- package/components/alert/alert.module.d.ts +5 -0
- package/components/alert/alert.service.d.ts +18 -0
- package/components/alert/index.d.ts +3 -0
- package/components/alert/package.json +13 -0
- package/{modules/notifications/taiga-ui-core-modules-notifications.d.ts → components/alert/taiga-ui-core-components-alert.d.ts} +0 -0
- package/components/alert/taiga-ui-core-components-alert.metadata.json +1 -0
- package/components/button/taiga-ui-core-components-button.metadata.json +1 -1
- package/components/data-list/taiga-ui-core-components-data-list.metadata.json +1 -1
- package/components/dialog/taiga-ui-core-components-dialog.metadata.json +1 -1
- package/components/dropdown-box/taiga-ui-core-components-dropdown-box.metadata.json +1 -1
- package/components/expand/taiga-ui-core-components-expand.metadata.json +1 -1
- package/components/hints-host/taiga-ui-core-components-hints-host.metadata.json +1 -1
- package/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.metadata.json +1 -1
- package/components/index.d.ts +1 -0
- package/components/label/taiga-ui-core-components-label.metadata.json +1 -1
- package/components/primitive-calendar/taiga-ui-core-components-primitive-calendar.metadata.json +1 -1
- package/components/primitive-checkbox/taiga-ui-core-components-primitive-checkbox.metadata.json +1 -1
- package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
- package/components/root/root.component.d.ts +3 -4
- package/components/root/taiga-ui-core-components-root.metadata.json +1 -1
- package/components/scroll-controls/taiga-ui-core-components-scroll-controls.metadata.json +1 -1
- package/components/taiga-ui-core-components.metadata.json +1 -1
- package/constants/taiga-ui-core-constants.metadata.json +1 -1
- package/constants/version.d.ts +1 -1
- package/esm2015/components/alert/alert.component.js +91 -0
- package/esm2015/components/alert/alert.module.js +34 -0
- package/esm2015/components/alert/alert.service.js +49 -0
- package/esm2015/components/alert/index.js +4 -0
- package/esm2015/components/alert/taiga-ui-core-components-alert.js +5 -0
- package/esm2015/components/button/button.component.js +2 -2
- package/esm2015/components/data-list/data-list-dropdown-manager.directive.js +2 -2
- package/esm2015/components/data-list/data-list.component.js +2 -2
- package/esm2015/components/data-list/option/option.component.js +2 -2
- package/esm2015/components/dialog/dialog.component.js +2 -2
- package/esm2015/components/dropdown-box/dropdown-box.component.js +2 -2
- package/esm2015/components/expand/expand.component.js +2 -2
- package/esm2015/components/hints-host/hint-box/hint-box.component.js +2 -2
- package/esm2015/components/hints-host/hints-host.component.js +2 -2
- package/esm2015/components/hosted-dropdown/hosted-dropdown.component.js +2 -2
- package/esm2015/components/index.js +2 -1
- package/esm2015/components/label/label.component.js +2 -2
- package/esm2015/components/primitive-calendar/primitive-calendar.component.js +2 -2
- package/esm2015/components/primitive-checkbox/primitive-checkbox.component.js +2 -2
- package/esm2015/components/primitive-textfield/primitive-textfield.component.js +3 -3
- package/esm2015/components/primitive-textfield/textfield/textfield.component.js +1 -1
- package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +2 -2
- package/esm2015/components/root/root.component.js +11 -17
- package/esm2015/components/root/root.module.js +3 -2
- package/esm2015/components/scroll-controls/scroll-controls.component.js +2 -2
- package/esm2015/components/scroll-controls/scrollbar.directive.js +3 -3
- package/esm2015/constants/version.js +2 -2
- package/esm2015/index.js +1 -2
- package/esm2015/interfaces/alert-options.js +1 -0
- package/esm2015/interfaces/index.js +1 -1
- package/esm2015/interfaces/notification-options.js +1 -1
- package/esm2015/internal/svg-defs-host/svg-defs-host.component.js +2 -2
- package/esm2015/tokens/notification-options.js +1 -1
- package/esm5/components/alert/alert.component.js +98 -0
- package/esm5/components/alert/alert.module.js +40 -0
- package/esm5/components/alert/alert.service.js +54 -0
- package/esm5/components/alert/index.js +4 -0
- package/esm5/components/alert/taiga-ui-core-components-alert.js +5 -0
- package/esm5/components/button/button.component.js +2 -2
- package/esm5/components/data-list/data-list-dropdown-manager.directive.js +2 -2
- package/esm5/components/data-list/data-list.component.js +2 -2
- package/esm5/components/data-list/option/option.component.js +2 -2
- package/esm5/components/dialog/dialog.component.js +2 -2
- package/esm5/components/dropdown-box/dropdown-box.component.js +2 -2
- package/esm5/components/expand/expand.component.js +2 -2
- package/esm5/components/hints-host/hint-box/hint-box.component.js +2 -2
- package/esm5/components/hints-host/hints-host.component.js +2 -2
- package/esm5/components/hosted-dropdown/hosted-dropdown.component.js +2 -2
- package/esm5/components/index.js +2 -1
- package/esm5/components/label/label.component.js +2 -2
- package/esm5/components/primitive-calendar/primitive-calendar.component.js +2 -2
- package/esm5/components/primitive-checkbox/primitive-checkbox.component.js +2 -2
- package/esm5/components/primitive-textfield/primitive-textfield.component.js +3 -3
- package/esm5/components/primitive-textfield/textfield/textfield.component.js +1 -1
- package/esm5/components/primitive-textfield/value-decoration/value-decoration.component.js +2 -2
- package/esm5/components/root/root.component.js +11 -17
- package/esm5/components/root/root.module.js +3 -2
- package/esm5/components/scroll-controls/scroll-controls.component.js +2 -2
- package/esm5/components/scroll-controls/scrollbar.directive.js +3 -3
- package/esm5/constants/version.js +2 -2
- package/esm5/index.js +1 -2
- package/esm5/interfaces/alert-options.js +1 -0
- package/esm5/interfaces/index.js +1 -1
- package/esm5/interfaces/notification-options.js +1 -1
- package/esm5/internal/svg-defs-host/svg-defs-host.component.js +2 -2
- package/esm5/tokens/notification-options.js +1 -1
- package/fesm2015/taiga-ui-core-components-alert.js +162 -0
- package/fesm2015/taiga-ui-core-components-alert.js.map +1 -0
- package/fesm2015/taiga-ui-core-components-button.js +1 -1
- package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-data-list.js +3 -3
- package/fesm2015/taiga-ui-core-components-data-list.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dialog.js +1 -1
- package/fesm2015/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dropdown-box.js +1 -1
- package/fesm2015/taiga-ui-core-components-dropdown-box.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hints-host.js +2 -2
- package/fesm2015/taiga-ui-core-components-hints-host.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-label.js +1 -1
- package/fesm2015/taiga-ui-core-components-label.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-calendar.js +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-calendar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js +4 -4
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-root.js +12 -17
- package/fesm2015/taiga-ui-core-components-root.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-scroll-controls.js +3 -3
- package/fesm2015/taiga-ui-core-components-scroll-controls.js.map +1 -1
- package/fesm2015/taiga-ui-core-components.js +1 -0
- package/fesm2015/taiga-ui-core-components.js.map +1 -1
- package/fesm2015/taiga-ui-core-constants.js +1 -1
- package/fesm2015/taiga-ui-core-constants.js.map +1 -1
- package/fesm2015/taiga-ui-core-internal-svg-defs-host.js +1 -1
- package/fesm2015/taiga-ui-core-internal-svg-defs-host.js.map +1 -1
- package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-core.js +0 -1
- package/fesm2015/taiga-ui-core.js.map +1 -1
- package/fesm5/taiga-ui-core-components-alert.js +180 -0
- package/fesm5/taiga-ui-core-components-alert.js.map +1 -0
- package/fesm5/taiga-ui-core-components-button.js +1 -1
- package/fesm5/taiga-ui-core-components-button.js.map +1 -1
- package/fesm5/taiga-ui-core-components-data-list.js +3 -3
- package/fesm5/taiga-ui-core-components-data-list.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dialog.js +1 -1
- package/fesm5/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dropdown-box.js +1 -1
- package/fesm5/taiga-ui-core-components-dropdown-box.js.map +1 -1
- package/fesm5/taiga-ui-core-components-expand.js +1 -1
- package/fesm5/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm5/taiga-ui-core-components-hints-host.js +2 -2
- package/fesm5/taiga-ui-core-components-hints-host.js.map +1 -1
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js +1 -1
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm5/taiga-ui-core-components-label.js +1 -1
- package/fesm5/taiga-ui-core-components-label.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-calendar.js +1 -1
- package/fesm5/taiga-ui-core-components-primitive-calendar.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-checkbox.js +1 -1
- package/fesm5/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-textfield.js +4 -4
- package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm5/taiga-ui-core-components-root.js +12 -17
- package/fesm5/taiga-ui-core-components-root.js.map +1 -1
- package/fesm5/taiga-ui-core-components-scroll-controls.js +3 -3
- package/fesm5/taiga-ui-core-components-scroll-controls.js.map +1 -1
- package/fesm5/taiga-ui-core-components.js +1 -0
- package/fesm5/taiga-ui-core-components.js.map +1 -1
- package/fesm5/taiga-ui-core-constants.js +1 -1
- package/fesm5/taiga-ui-core-constants.js.map +1 -1
- package/fesm5/taiga-ui-core-internal-svg-defs-host.js +1 -1
- package/fesm5/taiga-ui-core-internal-svg-defs-host.js.map +1 -1
- package/fesm5/taiga-ui-core-tokens.js.map +1 -1
- package/fesm5/taiga-ui-core.js +0 -1
- package/fesm5/taiga-ui-core.js.map +1 -1
- package/index.d.ts +0 -1
- package/interfaces/alert-options.d.ts +12 -0
- package/interfaces/index.d.ts +1 -0
- package/interfaces/notification-options.d.ts +3 -0
- package/interfaces/taiga-ui-core-interfaces.metadata.json +1 -1
- package/internal/svg-defs-host/taiga-ui-core-internal-svg-defs-host.metadata.json +1 -1
- package/package.json +7 -7
- package/styles/markup/tui-group.less +1 -1
- package/styles/mixins/mixins.less +1 -0
- package/styles/mixins/slider.less +17 -0
- package/styles/taiga-ui-stackblitz.less +7 -0
- package/styles/theme/wrapper/accent.less +1 -1
- package/styles/theme/wrapper/base.less +1 -1
- package/styles/theme/wrapper/icon.less +1 -1
- package/styles/theme/wrapper/none.less +6 -0
- package/styles/theme/wrapper/outline.less +1 -1
- package/styles/theme/wrapper/whiteblock.less +1 -1
- package/styles/theme/wrapper.less +1 -1
- package/taiga-ui-core.metadata.json +1 -1
- package/tokens/notification-options.d.ts +2 -10
- package/tokens/taiga-ui-core-tokens.metadata.json +1 -1
- package/bundles/taiga-ui-core-modules-notifications.umd.js.map +0 -1
- package/bundles/taiga-ui-core-modules-notifications.umd.min.js +0 -16
- package/bundles/taiga-ui-core-modules-notifications.umd.min.js.map +0 -1
- package/bundles/taiga-ui-core-modules.umd.js +0 -23
- package/bundles/taiga-ui-core-modules.umd.js.map +0 -1
- package/bundles/taiga-ui-core-modules.umd.min.js +0 -2
- package/bundles/taiga-ui-core-modules.umd.min.js.map +0 -1
- package/esm2015/modules/index.js +0 -2
- package/esm2015/modules/notifications/index.js +0 -7
- package/esm2015/modules/notifications/notification-alert/Notification-alert.js +0 -22
- package/esm2015/modules/notifications/notification-alert/notification-alert.component.js +0 -74
- package/esm2015/modules/notifications/notification-alert/notification-alert.module.js +0 -17
- package/esm2015/modules/notifications/notification-content-context.js +0 -1
- package/esm2015/modules/notifications/notifications-host/notifications-host.component.js +0 -35
- package/esm2015/modules/notifications/notifications.module.js +0 -26
- package/esm2015/modules/notifications/notifications.service.js +0 -38
- package/esm2015/modules/notifications/taiga-ui-core-modules-notifications.js +0 -5
- package/esm2015/modules/taiga-ui-core-modules.js +0 -5
- package/esm5/modules/index.js +0 -2
- package/esm5/modules/notifications/index.js +0 -7
- package/esm5/modules/notifications/notification-alert/Notification-alert.js +0 -24
- package/esm5/modules/notifications/notification-alert/notification-alert.component.js +0 -81
- package/esm5/modules/notifications/notification-alert/notification-alert.module.js +0 -20
- package/esm5/modules/notifications/notification-content-context.js +0 -1
- package/esm5/modules/notifications/notifications-host/notifications-host.component.js +0 -36
- package/esm5/modules/notifications/notifications.module.js +0 -29
- package/esm5/modules/notifications/notifications.service.js +0 -41
- package/esm5/modules/notifications/taiga-ui-core-modules-notifications.js +0 -5
- package/esm5/modules/taiga-ui-core-modules.js +0 -5
- package/fesm2015/taiga-ui-core-modules-notifications.js +0 -192
- package/fesm2015/taiga-ui-core-modules-notifications.js.map +0 -1
- package/fesm2015/taiga-ui-core-modules.js +0 -6
- package/fesm2015/taiga-ui-core-modules.js.map +0 -1
- package/fesm5/taiga-ui-core-modules-notifications.js +0 -210
- package/fesm5/taiga-ui-core-modules-notifications.js.map +0 -1
- package/fesm5/taiga-ui-core-modules.js +0 -6
- package/fesm5/taiga-ui-core-modules.js.map +0 -1
- package/modules/index.d.ts +0 -1
- package/modules/notifications/index.d.ts +0 -7
- package/modules/notifications/notification-alert/Notification-alert.d.ts +0 -19
- package/modules/notifications/notification-alert/notification-alert.component.d.ts +0 -17
- package/modules/notifications/notification-alert/notification-alert.module.d.ts +0 -2
- package/modules/notifications/notification-content-context.d.ts +0 -10
- package/modules/notifications/notifications-host/notifications-host.component.d.ts +0 -9
- package/modules/notifications/notifications.module.d.ts +0 -4
- package/modules/notifications/notifications.service.d.ts +0 -15
- package/modules/notifications/package.json +0 -13
- package/modules/notifications/taiga-ui-core-modules-notifications.metadata.json +0 -1
- package/modules/package.json +0 -13
- package/modules/taiga-ui-core-modules.d.ts +0 -4
- package/modules/taiga-ui-core-modules.metadata.json +0 -1
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { NgModule } from '@angular/core';
|
|
4
|
-
import { TuiNotificationModule } from '@taiga-ui/core/components/notification';
|
|
5
|
-
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
6
|
-
import { TuiNotificationAlertComponent } from './notification-alert.component';
|
|
7
|
-
var TuiNotificationAlertModule = /** @class */ (function () {
|
|
8
|
-
function TuiNotificationAlertModule() {
|
|
9
|
-
}
|
|
10
|
-
TuiNotificationAlertModule = __decorate([
|
|
11
|
-
NgModule({
|
|
12
|
-
imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],
|
|
13
|
-
declarations: [TuiNotificationAlertComponent],
|
|
14
|
-
exports: [TuiNotificationAlertComponent],
|
|
15
|
-
})
|
|
16
|
-
], TuiNotificationAlertModule);
|
|
17
|
-
return TuiNotificationAlertModule;
|
|
18
|
-
}());
|
|
19
|
-
export { TuiNotificationAlertModule };
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90aWZpY2F0aW9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XMnO1xuXG5leHBvcnQgaW50ZXJmYWNlIFR1aU5vdGlmaWNhdGlvbkNvbnRlbnRDb250ZXh0PE8gPSB2b2lkLCBJID0gdW5kZWZpbmVkPlxuICAgIGV4dGVuZHMgVHVpQ29udGV4dFdpdGhJbXBsaWNpdDxUdWlOb3RpZmljYXRpb24+IHtcbiAgICBsYWJlbDogUG9seW1vcnBoZXVzQ29udGVudDxUdWlDb250ZXh0V2l0aEltcGxpY2l0PFR1aU5vdGlmaWNhdGlvbj4+O1xuICAgIGRhdGE6IEk7XG4gICAgY2xvc2VIb29rOiAoKSA9PiB2b2lkO1xuICAgIGVtaXRIb29rOiAoZGF0YTogTykgPT4gdm9pZDtcbiAgICBlbWl0QW5kQ2xvc2VIb29rOiAoZGF0YTogTykgPT4gdm9pZDtcbn1cbiJdfQ==
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { __assign, __decorate, __param } from "tslib";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
|
3
|
-
import { tuiPure } from '@taiga-ui/cdk';
|
|
4
|
-
import { tuiFadeInList, tuiHeightCollapseList, tuiSlideInRightList, } from '@taiga-ui/core/animations';
|
|
5
|
-
import { TUI_ANIMATION_OPTIONS } from '@taiga-ui/core/tokens';
|
|
6
|
-
import { TuiNotificationsService } from '../notifications.service';
|
|
7
|
-
var TuiNotificationsHostComponent = /** @class */ (function () {
|
|
8
|
-
function TuiNotificationsHostComponent(options, service) {
|
|
9
|
-
this.options = options;
|
|
10
|
-
this.service = service;
|
|
11
|
-
}
|
|
12
|
-
TuiNotificationsHostComponent.prototype.getAnimation = function (value) {
|
|
13
|
-
return __assign({ value: String(value) }, this.options);
|
|
14
|
-
};
|
|
15
|
-
TuiNotificationsHostComponent.ctorParameters = function () { return [
|
|
16
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_ANIMATION_OPTIONS,] }] },
|
|
17
|
-
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] }
|
|
18
|
-
]; };
|
|
19
|
-
__decorate([
|
|
20
|
-
tuiPure
|
|
21
|
-
], TuiNotificationsHostComponent.prototype, "getAnimation", null);
|
|
22
|
-
TuiNotificationsHostComponent = __decorate([
|
|
23
|
-
Component({
|
|
24
|
-
selector: 'tui-notifications-host',
|
|
25
|
-
template: "<ng-container *tuiLet=\"service.items$ | async as items\">\n <div\n *ngIf=\"items.length\"\n class=\"t-wrapper\"\n [@tuiFadeInList]=\"getAnimation(items.length)\"\n [@tuiHeightCollapseList]=\"getAnimation(items.length)\"\n [@tuiSlideInRightList]=\"getAnimation(items.length)\"\n >\n <tui-notification-alert\n *ngFor=\"let item of items\"\n role=\"alert\"\n class=\"t-alert\"\n [item]=\"item\"\n ></tui-notification-alert>\n </div>\n</ng-container>\n",
|
|
26
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
-
animations: [tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList],
|
|
28
|
-
styles: [":host{position:fixed;top:0;left:0;width:100%;height:0}.t-wrapper{width:18rem;margin-left:auto;padding:2rem 3rem 0 0;pointer-events:none}:host-context(tui-root._mobile) .t-wrapper{padding:1rem 1rem 0 0}@media screen and (min-width:80em){.t-wrapper{width:23rem}}.t-alert{pointer-events:auto}.t-alert:not(:first-child){margin-top:.75rem}"]
|
|
29
|
-
}),
|
|
30
|
-
__param(0, Inject(TUI_ANIMATION_OPTIONS)),
|
|
31
|
-
__param(1, Inject(TuiNotificationsService))
|
|
32
|
-
], TuiNotificationsHostComponent);
|
|
33
|
-
return TuiNotificationsHostComponent;
|
|
34
|
-
}());
|
|
35
|
-
export { TuiNotificationsHostComponent };
|
|
36
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90aWZpY2F0aW9ucy1ob3N0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWlnYS11aS9jb3JlL21vZHVsZXMvbm90aWZpY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HlsZVVybHM6IFsnLi9ub3RpZmljYXRpb25zLWhvc3Quc3R5bGUubGVzcyddLFxuICAgIGNoYW5nZURldGVjdGlvbjogQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3kuT25QdXNoLFxuICAgIGFuaW1hdGlvbnM6IFt0dWlGYWRlSW5MaXN0LCB0dWlTbGlkZUluUmlnaHRMaXN0LCB0dWlIZWlnaHRDb2xsYXBzZUxpc3RdLFxufSlcbmV4cG9ydCBjbGFzcyBUdWlOb3RpZmljYXRpb25zSG9zdENvbXBvbmVudCB7XG4gICAgY29uc3RydWN0b3IoXG4gICAgICAgIEBJbmplY3QoVFVJX0FOSU1BVElPTl9PUFRJT05TKSBwcml2YXRlIHJlYWRvbmx5IG9wdGlvbnM6IEFuaW1hdGlvbk9wdGlvbnMsXG4gICAgICAgIEBJbmplY3QoVHVpTm90aWZpY2F0aW9uc1NlcnZpY2UpIHJlYWRvbmx5IHNlcnZpY2U6IFR1aU5vdGlmaWNhdGlvbnNTZXJ2aWNlLFxuICAgICkge31cblxuICAgIEB0dWlQdXJlXG4gICAgZ2V0QW5pbWF0aW9uKHZhbHVlOiBudW1iZXIpOiBUdWlBbmltYXRpb25PcHRpb25zIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiBTdHJpbmcodmFsdWUpLFxuICAgICAgICAgICAgLi4udGhpcy5vcHRpb25zLFxuICAgICAgICB9O1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { NgModule } from '@angular/core';
|
|
4
|
-
import { TuiLetModule } from '@taiga-ui/cdk';
|
|
5
|
-
import { TuiNotificationAlertModule } from './notification-alert/notification-alert.module';
|
|
6
|
-
import { TuiNotificationsHostComponent } from './notifications-host/notifications-host.component';
|
|
7
|
-
// TODO: remove in ivy compilation
|
|
8
|
-
export var NOTIFICATIONS_HOST = TuiNotificationsHostComponent;
|
|
9
|
-
var TuiNotificationsModule = /** @class */ (function () {
|
|
10
|
-
function TuiNotificationsModule() {
|
|
11
|
-
}
|
|
12
|
-
TuiNotificationsModule = __decorate([
|
|
13
|
-
NgModule({
|
|
14
|
-
imports: [CommonModule, TuiNotificationAlertModule, TuiLetModule],
|
|
15
|
-
declarations: [TuiNotificationsHostComponent],
|
|
16
|
-
exports: [TuiNotificationsHostComponent],
|
|
17
|
-
entryComponents: [TuiNotificationsHostComponent],
|
|
18
|
-
providers: [
|
|
19
|
-
{
|
|
20
|
-
provide: TuiNotificationsHostComponent,
|
|
21
|
-
useValue: NOTIFICATIONS_HOST,
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
})
|
|
25
|
-
], TuiNotificationsModule);
|
|
26
|
-
return TuiNotificationsModule;
|
|
27
|
-
}());
|
|
28
|
-
export { TuiNotificationsModule };
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90aWZpY2F0aW9ucy5tb2R1bGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdGFpZ2EtdWkvY29yZS9tb2R1bGVzL25vdGlmaWNhdGlvbnMvIiwic291cmNlcyI6WyJub3RpZmljYXRpb25zLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGlCQUFpQixDQUFDO0FBQzdDLE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDdkMsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUUzQyxPQUFPLEVBQUMsMEJBQTBCLEVBQUMsTUFBTSxnREFBZ0QsQ0FBQztBQUMxRixPQUFPLEVBQUMsNkJBQTZCLEVBQUMsTUFBTSxtREFBbUQsQ0FBQztBQUVoRyxrQ0FBa0M7QUFDbEMsTUFBTSxD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U19IT1NUID0gVHVpTm90aWZpY2F0aW9uc0hvc3RDb21wb25lbnQ7XG5cbkBOZ01vZHVsZSh7XG4gICAgaW1wb3J0czogW0NvbW1vbk1vZHVsZSwgVHVpTm90aWZpY2F0aW9uQWxlcnRNb2R1bGUsIFR1aUxldE1vZHVsZV0sXG4gICAgZGVjbGFyYXRpb25zOiBbVHVpTm90aWZpY2F0aW9uc0hvc3RDb21wb25lbnRdLFxuICAgIGV4cG9ydHM6IFtUdWlOb3RpZmljYXRpb25zSG9zdENvbXBvbmVudF0sXG4gICAgZW50cnlDb21wb25lbnRzOiBbVHVpTm90aWZpY2F0aW9uc0hvc3RDb21wb25lbnRdLFxuICAgIHByb3ZpZGVyczogW1xuICAgICAgICB7XG4gICAgICAgICAgICBwcm92aWRlOiBUdWlOb3RpZmljYXRpb25zSG9zdENvbXBvbmVudCxcbiAgICAgICAgICAgIHVzZVZhbHVlOiBOT1RJRklDQVRJT05TX0hPU1QsXG4gICAgICAgIH0sXG4gICAgXSxcbn0pXG5leHBvcnQgY2xhc3MgVHVpTm90aWZpY2F0aW9uc01vZHVsZSB7fVxuIl19
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { __assign, __decorate, __param, __read, __spread } from "tslib";
|
|
2
|
-
import { Inject, Injectable } from '@angular/core';
|
|
3
|
-
import { tuiAssert } from '@taiga-ui/cdk';
|
|
4
|
-
import { TUI_NOTIFICATION_OPTIONS, } from '@taiga-ui/core/tokens';
|
|
5
|
-
import { BehaviorSubject, Observable } from 'rxjs';
|
|
6
|
-
import { NotificationAlert } from './notification-alert/Notification-alert';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
import * as i1 from "@taiga-ui/core/tokens";
|
|
9
|
-
var NO_HOST = 'Notifications are disabled, enable support by adding TuiNotificationsModule to your main app module';
|
|
10
|
-
var TuiNotificationsService = /** @class */ (function () {
|
|
11
|
-
function TuiNotificationsService(options) {
|
|
12
|
-
this.options = options;
|
|
13
|
-
/** @internal */
|
|
14
|
-
this.items$ = new BehaviorSubject([]);
|
|
15
|
-
}
|
|
16
|
-
TuiNotificationsService.prototype.show = function (content, options) {
|
|
17
|
-
var _this = this;
|
|
18
|
-
if (options === void 0) { options = {}; }
|
|
19
|
-
return new Observable(function (observer) {
|
|
20
|
-
tuiAssert.assert(!!_this.items$.observers.length, NO_HOST);
|
|
21
|
-
var notification = new NotificationAlert(observer, content, __assign(__assign({}, _this.options), options));
|
|
22
|
-
_this.items$.next(__spread(_this.items$.value, [notification]));
|
|
23
|
-
return function () {
|
|
24
|
-
_this.items$.next(_this.items$.value.filter(function (item) { return item !== notification; }));
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
TuiNotificationsService.ctorParameters = function () { return [
|
|
29
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_NOTIFICATION_OPTIONS,] }] }
|
|
30
|
-
]; };
|
|
31
|
-
TuiNotificationsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TuiNotificationsService_Factory() { return new TuiNotificationsService(i0.ɵɵinject(i1.TUI_NOTIFICATION_OPTIONS)); }, token: TuiNotificationsService, providedIn: "root" });
|
|
32
|
-
TuiNotificationsService = __decorate([
|
|
33
|
-
Injectable({
|
|
34
|
-
providedIn: 'root',
|
|
35
|
-
}),
|
|
36
|
-
__param(0, Inject(TUI_NOTIFICATION_OPTIONS))
|
|
37
|
-
], TuiNotificationsService);
|
|
38
|
-
return TuiNotificationsService;
|
|
39
|
-
}());
|
|
40
|
-
export { TuiNotificationsService };
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90aWZpY2F0aW9ucy5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHRhaWdhLXVpL2NvcmUvbW9kdWxlcy9ub3RpZmljYXRpb25zLyIsInNvdXJjZXMiOlsibm90aWZpY2F0aW9ucy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSw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AgICAgICAgICAgIHJldHVybiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5pdGVtcyQubmV4dCh0aGlzLml0ZW1zJC52YWx1ZS5maWx0ZXIoaXRlbSA9PiBpdGVtICE9PSBub3RpZmljYXRpb24pKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './index';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFpZ2EtdWktY29yZS1tb2R1bGVzLW5vdGlmaWNhdGlvbnMuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdGFpZ2EtdWkvY29yZS9tb2R1bGVzL25vdGlmaWNhdGlvbnMvIiwic291cmNlcyI6WyJ0YWlnYS11aS1jb3JlLW1vZHVsZXMtbm90aWZpY2F0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './index';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFpZ2EtdWktY29yZS1tb2R1bGVzLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHRhaWdhLXVpL2NvcmUvbW9kdWxlcy8iLCJzb3VyY2VzIjpbInRhaWdhLXVpLWNvcmUtbW9kdWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from 'tslib';
|
|
2
|
-
import { ElementRef, Inject, Input, Component, ChangeDetectionStrategy, NgModule, ɵɵdefineInjectable, ɵɵinject, Injectable } from '@angular/core';
|
|
3
|
-
import { isNumber, TuiDestroyService, tuiPure, tuiAssert, TuiLetModule } from '@taiga-ui/cdk';
|
|
4
|
-
import { TUI_NOTIFICATION_OPTIONS, TUI_ANIMATION_OPTIONS } from '@taiga-ui/core/tokens';
|
|
5
|
-
import { timer, fromEvent, BehaviorSubject, Observable } from 'rxjs';
|
|
6
|
-
import { takeUntil, repeatWhen } from 'rxjs/operators';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
import { TuiNotificationModule } from '@taiga-ui/core/components/notification';
|
|
9
|
-
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
10
|
-
import { tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList } from '@taiga-ui/core/animations';
|
|
11
|
-
|
|
12
|
-
class NotificationAlert {
|
|
13
|
-
constructor(observer, content, options) {
|
|
14
|
-
this.observer = observer;
|
|
15
|
-
this.content = content;
|
|
16
|
-
this.options = options;
|
|
17
|
-
this.status = this.options.status;
|
|
18
|
-
this.hasIcon = this.options.hasIcon;
|
|
19
|
-
this.hasCloseButton = this.options.hasCloseButton;
|
|
20
|
-
this.label = this.options.label;
|
|
21
|
-
this.autoClose =
|
|
22
|
-
typeof this.options.autoClose === 'function'
|
|
23
|
-
? this.options.autoClose(this.options.status)
|
|
24
|
-
: this.options.autoClose;
|
|
25
|
-
if (options && this.withData(options)) {
|
|
26
|
-
this.data = options.data;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
withData(options) {
|
|
30
|
-
return 'data' in options;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
let TuiNotificationAlertComponent = class TuiNotificationAlertComponent {
|
|
35
|
-
constructor(elementRef, destroy$, options) {
|
|
36
|
-
this.elementRef = elementRef;
|
|
37
|
-
this.destroy$ = destroy$;
|
|
38
|
-
this.options = options;
|
|
39
|
-
}
|
|
40
|
-
ngOnInit() {
|
|
41
|
-
this.initAutoClose();
|
|
42
|
-
}
|
|
43
|
-
get context() {
|
|
44
|
-
return this.calculateContext(this.item);
|
|
45
|
-
}
|
|
46
|
-
closeNotification() {
|
|
47
|
-
this.item.observer.complete();
|
|
48
|
-
}
|
|
49
|
-
calculateContext({ status, data, label, observer, }) {
|
|
50
|
-
return {
|
|
51
|
-
$implicit: status,
|
|
52
|
-
data: data,
|
|
53
|
-
label: label,
|
|
54
|
-
closeHook: () => {
|
|
55
|
-
observer.complete();
|
|
56
|
-
},
|
|
57
|
-
emitHook: (data) => {
|
|
58
|
-
observer.next(data);
|
|
59
|
-
},
|
|
60
|
-
emitAndCloseHook: (data) => {
|
|
61
|
-
observer.next(data);
|
|
62
|
-
observer.complete();
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
initAutoClose() {
|
|
67
|
-
if (!this.item.autoClose) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
timer(isNumber(this.item.autoClose)
|
|
71
|
-
? this.item.autoClose
|
|
72
|
-
: this.options.defaultAutoCloseTime)
|
|
73
|
-
.pipe(takeUntil(fromEvent(this.elementRef.nativeElement, 'mouseenter')), repeatWhen(() => fromEvent(this.elementRef.nativeElement, 'mouseleave')), takeUntil(this.destroy$))
|
|
74
|
-
.subscribe(() => this.closeNotification());
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
TuiNotificationAlertComponent.ctorParameters = () => [
|
|
78
|
-
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
|
79
|
-
{ type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
80
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_NOTIFICATION_OPTIONS,] }] }
|
|
81
|
-
];
|
|
82
|
-
__decorate([
|
|
83
|
-
Input()
|
|
84
|
-
], TuiNotificationAlertComponent.prototype, "item", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
tuiPure
|
|
87
|
-
], TuiNotificationAlertComponent.prototype, "calculateContext", null);
|
|
88
|
-
TuiNotificationAlertComponent = __decorate([
|
|
89
|
-
Component({
|
|
90
|
-
selector: 'tui-notification-alert',
|
|
91
|
-
template: "<tui-notification\n *ngIf=\"item.hasCloseButton; else noClose\"\n [status]=\"item.status\"\n [hasIcon]=\"item.hasIcon\"\n (close)=\"closeNotification()\"\n>\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"heading\"\n [content]=\"item.label\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"content\"\n [content]=\"item.content\"\n [context]=\"context\"\n ></div>\n</tui-notification>\n<ng-template #noClose>\n <tui-notification [status]=\"item.status\" [hasIcon]=\"item.hasIcon\">\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"heading\"\n [content]=\"item.label\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"content\"\n [content]=\"item.content\"\n [context]=\"context\"\n ></div>\n </tui-notification>\n</ng-template>\n",
|
|
92
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
93
|
-
providers: [TuiDestroyService],
|
|
94
|
-
styles: [":host{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);display:block;border-radius:var(--tui-radius-m)}.heading{font:var(--tui-font-text-m);line-height:1.25rem;font-weight:700;margin:0}.content{color:var(--tui-text-01);word-wrap:break-word}.content:empty{display:none}"]
|
|
95
|
-
}),
|
|
96
|
-
__param(0, Inject(ElementRef)),
|
|
97
|
-
__param(1, Inject(TuiDestroyService)),
|
|
98
|
-
__param(2, Inject(TUI_NOTIFICATION_OPTIONS))
|
|
99
|
-
], TuiNotificationAlertComponent);
|
|
100
|
-
|
|
101
|
-
let TuiNotificationAlertModule = class TuiNotificationAlertModule {
|
|
102
|
-
};
|
|
103
|
-
TuiNotificationAlertModule = __decorate([
|
|
104
|
-
NgModule({
|
|
105
|
-
imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],
|
|
106
|
-
declarations: [TuiNotificationAlertComponent],
|
|
107
|
-
exports: [TuiNotificationAlertComponent],
|
|
108
|
-
})
|
|
109
|
-
], TuiNotificationAlertModule);
|
|
110
|
-
|
|
111
|
-
const NO_HOST = 'Notifications are disabled, enable support by adding TuiNotificationsModule to your main app module';
|
|
112
|
-
let TuiNotificationsService = class TuiNotificationsService {
|
|
113
|
-
constructor(options) {
|
|
114
|
-
this.options = options;
|
|
115
|
-
/** @internal */
|
|
116
|
-
this.items$ = new BehaviorSubject([]);
|
|
117
|
-
}
|
|
118
|
-
show(content, options = {}) {
|
|
119
|
-
return new Observable((observer) => {
|
|
120
|
-
tuiAssert.assert(!!this.items$.observers.length, NO_HOST);
|
|
121
|
-
const notification = new NotificationAlert(observer, content, Object.assign(Object.assign({}, this.options), options));
|
|
122
|
-
this.items$.next([...this.items$.value, notification]);
|
|
123
|
-
return () => {
|
|
124
|
-
this.items$.next(this.items$.value.filter(item => item !== notification));
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
TuiNotificationsService.ctorParameters = () => [
|
|
130
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_NOTIFICATION_OPTIONS,] }] }
|
|
131
|
-
];
|
|
132
|
-
TuiNotificationsService.ɵprov = ɵɵdefineInjectable({ factory: function TuiNotificationsService_Factory() { return new TuiNotificationsService(ɵɵinject(TUI_NOTIFICATION_OPTIONS)); }, token: TuiNotificationsService, providedIn: "root" });
|
|
133
|
-
TuiNotificationsService = __decorate([
|
|
134
|
-
Injectable({
|
|
135
|
-
providedIn: 'root',
|
|
136
|
-
}),
|
|
137
|
-
__param(0, Inject(TUI_NOTIFICATION_OPTIONS))
|
|
138
|
-
], TuiNotificationsService);
|
|
139
|
-
|
|
140
|
-
let TuiNotificationsHostComponent = class TuiNotificationsHostComponent {
|
|
141
|
-
constructor(options, service) {
|
|
142
|
-
this.options = options;
|
|
143
|
-
this.service = service;
|
|
144
|
-
}
|
|
145
|
-
getAnimation(value) {
|
|
146
|
-
return Object.assign({ value: String(value) }, this.options);
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
TuiNotificationsHostComponent.ctorParameters = () => [
|
|
150
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_ANIMATION_OPTIONS,] }] },
|
|
151
|
-
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] }
|
|
152
|
-
];
|
|
153
|
-
__decorate([
|
|
154
|
-
tuiPure
|
|
155
|
-
], TuiNotificationsHostComponent.prototype, "getAnimation", null);
|
|
156
|
-
TuiNotificationsHostComponent = __decorate([
|
|
157
|
-
Component({
|
|
158
|
-
selector: 'tui-notifications-host',
|
|
159
|
-
template: "<ng-container *tuiLet=\"service.items$ | async as items\">\n <div\n *ngIf=\"items.length\"\n class=\"t-wrapper\"\n [@tuiFadeInList]=\"getAnimation(items.length)\"\n [@tuiHeightCollapseList]=\"getAnimation(items.length)\"\n [@tuiSlideInRightList]=\"getAnimation(items.length)\"\n >\n <tui-notification-alert\n *ngFor=\"let item of items\"\n role=\"alert\"\n class=\"t-alert\"\n [item]=\"item\"\n ></tui-notification-alert>\n </div>\n</ng-container>\n",
|
|
160
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
161
|
-
animations: [tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList],
|
|
162
|
-
styles: [":host{position:fixed;top:0;left:0;width:100%;height:0}.t-wrapper{width:18rem;margin-left:auto;padding:2rem 3rem 0 0;pointer-events:none}:host-context(tui-root._mobile) .t-wrapper{padding:1rem 1rem 0 0}@media screen and (min-width:80em){.t-wrapper{width:23rem}}.t-alert{pointer-events:auto}.t-alert:not(:first-child){margin-top:.75rem}"]
|
|
163
|
-
}),
|
|
164
|
-
__param(0, Inject(TUI_ANIMATION_OPTIONS)),
|
|
165
|
-
__param(1, Inject(TuiNotificationsService))
|
|
166
|
-
], TuiNotificationsHostComponent);
|
|
167
|
-
|
|
168
|
-
// TODO: remove in ivy compilation
|
|
169
|
-
const NOTIFICATIONS_HOST = TuiNotificationsHostComponent;
|
|
170
|
-
let TuiNotificationsModule = class TuiNotificationsModule {
|
|
171
|
-
};
|
|
172
|
-
TuiNotificationsModule = __decorate([
|
|
173
|
-
NgModule({
|
|
174
|
-
imports: [CommonModule, TuiNotificationAlertModule, TuiLetModule],
|
|
175
|
-
declarations: [TuiNotificationsHostComponent],
|
|
176
|
-
exports: [TuiNotificationsHostComponent],
|
|
177
|
-
entryComponents: [TuiNotificationsHostComponent],
|
|
178
|
-
providers: [
|
|
179
|
-
{
|
|
180
|
-
provide: TuiNotificationsHostComponent,
|
|
181
|
-
useValue: NOTIFICATIONS_HOST,
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
})
|
|
185
|
-
], TuiNotificationsModule);
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Generated bundle index. Do not edit.
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
|
-
export { NOTIFICATIONS_HOST, NotificationAlert, TuiNotificationAlertComponent, TuiNotificationAlertModule, TuiNotificationsHostComponent, TuiNotificationsModule, TuiNotificationsService };
|
|
192
|
-
//# sourceMappingURL=taiga-ui-core-modules-notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-modules-notifications.js","sources":["ng://@taiga-ui/core/modules/notifications/notification-alert/Notification-alert.ts","ng://@taiga-ui/core/modules/notifications/notification-alert/notification-alert.component.ts","ng://@taiga-ui/core/modules/notifications/notification-alert/notification-alert.module.ts","ng://@taiga-ui/core/modules/notifications/notifications.service.ts","ng://@taiga-ui/core/modules/notifications/notifications-host/notifications-host.component.ts","ng://@taiga-ui/core/modules/notifications/notifications.module.ts","ng://@taiga-ui/core/modules/notifications/taiga-ui-core-modules-notifications.ts"],"sourcesContent":["import {TuiContextWithImplicit} from '@taiga-ui/cdk';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observer} from 'rxjs';\n\nimport {TuiNotificationContentContext} from '../notification-content-context';\n\nexport class NotificationAlert<O, I> {\n readonly status = this.options.status;\n\n readonly hasIcon = this.options.hasIcon;\n\n readonly autoClose: boolean | number;\n\n readonly hasCloseButton = this.options.hasCloseButton;\n\n readonly label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>> =\n this.options.label;\n\n readonly data!: I;\n\n constructor(\n readonly observer: Observer<O>,\n readonly content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n private readonly options: Required<\n TuiNotificationOptions | TuiNotificationOptionsWithData<I>\n >,\n ) {\n this.autoClose =\n typeof this.options.autoClose === 'function'\n ? this.options.autoClose(this.options.status)\n : this.options.autoClose;\n\n if (options && this.withData(options)) {\n this.data = options.data;\n }\n }\n\n private withData(\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I>,\n ): options is TuiNotificationOptionsWithData<I> {\n return 'data' in options;\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n Input,\n OnInit,\n} from '@angular/core';\nimport {isNumber, TuiDestroyService, tuiPure} from '@taiga-ui/cdk';\nimport {\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {fromEvent, timer} from 'rxjs';\nimport {repeatWhen, takeUntil} from 'rxjs/operators';\n\nimport {TuiNotificationContentContext} from '../notification-content-context';\nimport {NotificationAlert} from './Notification-alert';\n\n@Component({\n selector: 'tui-notification-alert',\n templateUrl: './notification-alert.template.html',\n styleUrls: ['./notification-alert.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n})\nexport class TuiNotificationAlertComponent<O, I> implements OnInit {\n @Input()\n item!: NotificationAlert<O, I>;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n readonly options: TuiNotificationDefaultOptions,\n ) {}\n\n ngOnInit() {\n this.initAutoClose();\n }\n\n get context(): TuiNotificationContentContext<O, I> {\n return this.calculateContext(this.item);\n }\n\n closeNotification() {\n this.item.observer.complete();\n }\n\n @tuiPure\n private calculateContext({\n status,\n data,\n label,\n observer,\n }: NotificationAlert<O, I>): TuiNotificationContentContext<O, I> {\n return {\n $implicit: status,\n data: data,\n label: label,\n closeHook: () => {\n observer.complete();\n },\n emitHook: (data: O) => {\n observer.next(data);\n },\n emitAndCloseHook: (data: O) => {\n observer.next(data);\n observer.complete();\n },\n };\n }\n\n private initAutoClose() {\n if (!this.item.autoClose) {\n return;\n }\n\n timer(\n isNumber(this.item.autoClose)\n ? this.item.autoClose\n : this.options.defaultAutoCloseTime,\n )\n .pipe(\n takeUntil(fromEvent(this.elementRef.nativeElement, 'mouseenter')),\n repeatWhen(() => fromEvent(this.elementRef.nativeElement, 'mouseleave')),\n takeUntil(this.destroy$),\n )\n .subscribe(() => this.closeNotification());\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiNotificationModule} from '@taiga-ui/core/components/notification';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiNotificationAlertComponent} from './notification-alert.component';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],\n declarations: [TuiNotificationAlertComponent],\n exports: [TuiNotificationAlertComponent],\n})\nexport class TuiNotificationAlertModule {}\n","import {Inject, Injectable} from '@angular/core';\nimport {tuiAssert} from '@taiga-ui/cdk';\nimport {\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {BehaviorSubject, Observable, Observer} from 'rxjs';\n\nimport {NotificationAlert} from './notification-alert/Notification-alert';\nimport {TuiNotificationContentContext} from './notification-content-context';\n\nconst NO_HOST =\n 'Notifications are disabled, enable support by adding TuiNotificationsModule to your main app module';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiNotificationsService {\n /** @internal */\n readonly items$ = new BehaviorSubject<ReadonlyArray<NotificationAlert<any, any>>>([]);\n\n constructor(\n @Inject(TUI_NOTIFICATION_OPTIONS)\n readonly options: TuiNotificationDefaultOptions,\n ) {}\n\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n ): Observable<O>;\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n options: TuiNotificationOptions,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptionsWithData<I>,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I> = {},\n ): Observable<O> {\n return new Observable((observer: Observer<O>) => {\n tuiAssert.assert(!!this.items$.observers.length, NO_HOST);\n\n const notification = new NotificationAlert(observer, content, {\n ...this.options,\n ...options,\n });\n\n this.items$.next([...this.items$.value, notification]);\n\n return () => {\n this.items$.next(this.items$.value.filter(item => item !== notification));\n };\n });\n }\n}\n","import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, Inject} from '@angular/core';\nimport {tuiPure} from '@taiga-ui/cdk';\nimport {\n tuiFadeInList,\n tuiHeightCollapseList,\n tuiSlideInRightList,\n} from '@taiga-ui/core/animations';\nimport {TuiAnimationOptions} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS} from '@taiga-ui/core/tokens';\n\nimport {TuiNotificationsService} from '../notifications.service';\n\n@Component({\n selector: 'tui-notifications-host',\n templateUrl: './notifications-host.template.html',\n styleUrls: ['./notifications-host.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList],\n})\nexport class TuiNotificationsHostComponent {\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(TuiNotificationsService) readonly service: TuiNotificationsService,\n ) {}\n\n @tuiPure\n getAnimation(value: number): TuiAnimationOptions {\n return {\n value: String(value),\n ...this.options,\n };\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLetModule} from '@taiga-ui/cdk';\n\nimport {TuiNotificationAlertModule} from './notification-alert/notification-alert.module';\nimport {TuiNotificationsHostComponent} from './notifications-host/notifications-host.component';\n\n// TODO: remove in ivy compilation\nexport const NOTIFICATIONS_HOST = TuiNotificationsHostComponent;\n\n@NgModule({\n imports: [CommonModule, TuiNotificationAlertModule, TuiLetModule],\n declarations: [TuiNotificationsHostComponent],\n exports: [TuiNotificationsHostComponent],\n entryComponents: [TuiNotificationsHostComponent],\n providers: [\n {\n provide: TuiNotificationsHostComponent,\n useValue: NOTIFICATIONS_HOST,\n },\n ],\n})\nexport class TuiNotificationsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */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CAAC;QAChD,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,6BAA6B;gBACtC,QAAQ,EAAE,kBAAkB;aAC/B;SACJ;KACJ,CAAC;GACW,sBAAsB,CAAG;;ACtBtC;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-modules.js","sources":["ng://@taiga-ui/core/modules/taiga-ui-core-modules.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;"}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param, __assign, __spread } from 'tslib';
|
|
2
|
-
import { ElementRef, Inject, Input, Component, ChangeDetectionStrategy, NgModule, ɵɵdefineInjectable, ɵɵinject, Injectable } from '@angular/core';
|
|
3
|
-
import { isNumber, TuiDestroyService, tuiPure, tuiAssert, TuiLetModule } from '@taiga-ui/cdk';
|
|
4
|
-
import { TUI_NOTIFICATION_OPTIONS, TUI_ANIMATION_OPTIONS } from '@taiga-ui/core/tokens';
|
|
5
|
-
import { timer, fromEvent, BehaviorSubject, Observable } from 'rxjs';
|
|
6
|
-
import { takeUntil, repeatWhen } from 'rxjs/operators';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
import { TuiNotificationModule } from '@taiga-ui/core/components/notification';
|
|
9
|
-
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
10
|
-
import { tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList } from '@taiga-ui/core/animations';
|
|
11
|
-
|
|
12
|
-
var NotificationAlert = /** @class */ (function () {
|
|
13
|
-
function NotificationAlert(observer, content, options) {
|
|
14
|
-
this.observer = observer;
|
|
15
|
-
this.content = content;
|
|
16
|
-
this.options = options;
|
|
17
|
-
this.status = this.options.status;
|
|
18
|
-
this.hasIcon = this.options.hasIcon;
|
|
19
|
-
this.hasCloseButton = this.options.hasCloseButton;
|
|
20
|
-
this.label = this.options.label;
|
|
21
|
-
this.autoClose =
|
|
22
|
-
typeof this.options.autoClose === 'function'
|
|
23
|
-
? this.options.autoClose(this.options.status)
|
|
24
|
-
: this.options.autoClose;
|
|
25
|
-
if (options && this.withData(options)) {
|
|
26
|
-
this.data = options.data;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
NotificationAlert.prototype.withData = function (options) {
|
|
30
|
-
return 'data' in options;
|
|
31
|
-
};
|
|
32
|
-
return NotificationAlert;
|
|
33
|
-
}());
|
|
34
|
-
|
|
35
|
-
var TuiNotificationAlertComponent = /** @class */ (function () {
|
|
36
|
-
function TuiNotificationAlertComponent(elementRef, destroy$, options) {
|
|
37
|
-
this.elementRef = elementRef;
|
|
38
|
-
this.destroy$ = destroy$;
|
|
39
|
-
this.options = options;
|
|
40
|
-
}
|
|
41
|
-
TuiNotificationAlertComponent.prototype.ngOnInit = function () {
|
|
42
|
-
this.initAutoClose();
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(TuiNotificationAlertComponent.prototype, "context", {
|
|
45
|
-
get: function () {
|
|
46
|
-
return this.calculateContext(this.item);
|
|
47
|
-
},
|
|
48
|
-
enumerable: true,
|
|
49
|
-
configurable: true
|
|
50
|
-
});
|
|
51
|
-
TuiNotificationAlertComponent.prototype.closeNotification = function () {
|
|
52
|
-
this.item.observer.complete();
|
|
53
|
-
};
|
|
54
|
-
TuiNotificationAlertComponent.prototype.calculateContext = function (_a) {
|
|
55
|
-
var status = _a.status, data = _a.data, label = _a.label, observer = _a.observer;
|
|
56
|
-
return {
|
|
57
|
-
$implicit: status,
|
|
58
|
-
data: data,
|
|
59
|
-
label: label,
|
|
60
|
-
closeHook: function () {
|
|
61
|
-
observer.complete();
|
|
62
|
-
},
|
|
63
|
-
emitHook: function (data) {
|
|
64
|
-
observer.next(data);
|
|
65
|
-
},
|
|
66
|
-
emitAndCloseHook: function (data) {
|
|
67
|
-
observer.next(data);
|
|
68
|
-
observer.complete();
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
TuiNotificationAlertComponent.prototype.initAutoClose = function () {
|
|
73
|
-
var _this = this;
|
|
74
|
-
if (!this.item.autoClose) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
timer(isNumber(this.item.autoClose)
|
|
78
|
-
? this.item.autoClose
|
|
79
|
-
: this.options.defaultAutoCloseTime)
|
|
80
|
-
.pipe(takeUntil(fromEvent(this.elementRef.nativeElement, 'mouseenter')), repeatWhen(function () { return fromEvent(_this.elementRef.nativeElement, 'mouseleave'); }), takeUntil(this.destroy$))
|
|
81
|
-
.subscribe(function () { return _this.closeNotification(); });
|
|
82
|
-
};
|
|
83
|
-
TuiNotificationAlertComponent.ctorParameters = function () { return [
|
|
84
|
-
{ type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
|
|
85
|
-
{ type: TuiDestroyService, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
86
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_NOTIFICATION_OPTIONS,] }] }
|
|
87
|
-
]; };
|
|
88
|
-
__decorate([
|
|
89
|
-
Input()
|
|
90
|
-
], TuiNotificationAlertComponent.prototype, "item", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
tuiPure
|
|
93
|
-
], TuiNotificationAlertComponent.prototype, "calculateContext", null);
|
|
94
|
-
TuiNotificationAlertComponent = __decorate([
|
|
95
|
-
Component({
|
|
96
|
-
selector: 'tui-notification-alert',
|
|
97
|
-
template: "<tui-notification\n *ngIf=\"item.hasCloseButton; else noClose\"\n [status]=\"item.status\"\n [hasIcon]=\"item.hasIcon\"\n (close)=\"closeNotification()\"\n>\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"heading\"\n [content]=\"item.label\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"content\"\n [content]=\"item.content\"\n [context]=\"context\"\n ></div>\n</tui-notification>\n<ng-template #noClose>\n <tui-notification [status]=\"item.status\" [hasIcon]=\"item.hasIcon\">\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"heading\"\n [content]=\"item.label\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"content\"\n [content]=\"item.content\"\n [context]=\"context\"\n ></div>\n </tui-notification>\n</ng-template>\n",
|
|
98
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
99
|
-
providers: [TuiDestroyService],
|
|
100
|
-
styles: [":host{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);display:block;border-radius:var(--tui-radius-m)}.heading{font:var(--tui-font-text-m);line-height:1.25rem;font-weight:700;margin:0}.content{color:var(--tui-text-01);word-wrap:break-word}.content:empty{display:none}"]
|
|
101
|
-
}),
|
|
102
|
-
__param(0, Inject(ElementRef)),
|
|
103
|
-
__param(1, Inject(TuiDestroyService)),
|
|
104
|
-
__param(2, Inject(TUI_NOTIFICATION_OPTIONS))
|
|
105
|
-
], TuiNotificationAlertComponent);
|
|
106
|
-
return TuiNotificationAlertComponent;
|
|
107
|
-
}());
|
|
108
|
-
|
|
109
|
-
var TuiNotificationAlertModule = /** @class */ (function () {
|
|
110
|
-
function TuiNotificationAlertModule() {
|
|
111
|
-
}
|
|
112
|
-
TuiNotificationAlertModule = __decorate([
|
|
113
|
-
NgModule({
|
|
114
|
-
imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],
|
|
115
|
-
declarations: [TuiNotificationAlertComponent],
|
|
116
|
-
exports: [TuiNotificationAlertComponent],
|
|
117
|
-
})
|
|
118
|
-
], TuiNotificationAlertModule);
|
|
119
|
-
return TuiNotificationAlertModule;
|
|
120
|
-
}());
|
|
121
|
-
|
|
122
|
-
var NO_HOST = 'Notifications are disabled, enable support by adding TuiNotificationsModule to your main app module';
|
|
123
|
-
var TuiNotificationsService = /** @class */ (function () {
|
|
124
|
-
function TuiNotificationsService(options) {
|
|
125
|
-
this.options = options;
|
|
126
|
-
/** @internal */
|
|
127
|
-
this.items$ = new BehaviorSubject([]);
|
|
128
|
-
}
|
|
129
|
-
TuiNotificationsService.prototype.show = function (content, options) {
|
|
130
|
-
var _this = this;
|
|
131
|
-
if (options === void 0) { options = {}; }
|
|
132
|
-
return new Observable(function (observer) {
|
|
133
|
-
tuiAssert.assert(!!_this.items$.observers.length, NO_HOST);
|
|
134
|
-
var notification = new NotificationAlert(observer, content, __assign(__assign({}, _this.options), options));
|
|
135
|
-
_this.items$.next(__spread(_this.items$.value, [notification]));
|
|
136
|
-
return function () {
|
|
137
|
-
_this.items$.next(_this.items$.value.filter(function (item) { return item !== notification; }));
|
|
138
|
-
};
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
TuiNotificationsService.ctorParameters = function () { return [
|
|
142
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_NOTIFICATION_OPTIONS,] }] }
|
|
143
|
-
]; };
|
|
144
|
-
TuiNotificationsService.ɵprov = ɵɵdefineInjectable({ factory: function TuiNotificationsService_Factory() { return new TuiNotificationsService(ɵɵinject(TUI_NOTIFICATION_OPTIONS)); }, token: TuiNotificationsService, providedIn: "root" });
|
|
145
|
-
TuiNotificationsService = __decorate([
|
|
146
|
-
Injectable({
|
|
147
|
-
providedIn: 'root',
|
|
148
|
-
}),
|
|
149
|
-
__param(0, Inject(TUI_NOTIFICATION_OPTIONS))
|
|
150
|
-
], TuiNotificationsService);
|
|
151
|
-
return TuiNotificationsService;
|
|
152
|
-
}());
|
|
153
|
-
|
|
154
|
-
var TuiNotificationsHostComponent = /** @class */ (function () {
|
|
155
|
-
function TuiNotificationsHostComponent(options, service) {
|
|
156
|
-
this.options = options;
|
|
157
|
-
this.service = service;
|
|
158
|
-
}
|
|
159
|
-
TuiNotificationsHostComponent.prototype.getAnimation = function (value) {
|
|
160
|
-
return __assign({ value: String(value) }, this.options);
|
|
161
|
-
};
|
|
162
|
-
TuiNotificationsHostComponent.ctorParameters = function () { return [
|
|
163
|
-
{ type: undefined, decorators: [{ type: Inject, args: [TUI_ANIMATION_OPTIONS,] }] },
|
|
164
|
-
{ type: TuiNotificationsService, decorators: [{ type: Inject, args: [TuiNotificationsService,] }] }
|
|
165
|
-
]; };
|
|
166
|
-
__decorate([
|
|
167
|
-
tuiPure
|
|
168
|
-
], TuiNotificationsHostComponent.prototype, "getAnimation", null);
|
|
169
|
-
TuiNotificationsHostComponent = __decorate([
|
|
170
|
-
Component({
|
|
171
|
-
selector: 'tui-notifications-host',
|
|
172
|
-
template: "<ng-container *tuiLet=\"service.items$ | async as items\">\n <div\n *ngIf=\"items.length\"\n class=\"t-wrapper\"\n [@tuiFadeInList]=\"getAnimation(items.length)\"\n [@tuiHeightCollapseList]=\"getAnimation(items.length)\"\n [@tuiSlideInRightList]=\"getAnimation(items.length)\"\n >\n <tui-notification-alert\n *ngFor=\"let item of items\"\n role=\"alert\"\n class=\"t-alert\"\n [item]=\"item\"\n ></tui-notification-alert>\n </div>\n</ng-container>\n",
|
|
173
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
174
|
-
animations: [tuiFadeInList, tuiSlideInRightList, tuiHeightCollapseList],
|
|
175
|
-
styles: [":host{position:fixed;top:0;left:0;width:100%;height:0}.t-wrapper{width:18rem;margin-left:auto;padding:2rem 3rem 0 0;pointer-events:none}:host-context(tui-root._mobile) .t-wrapper{padding:1rem 1rem 0 0}@media screen and (min-width:80em){.t-wrapper{width:23rem}}.t-alert{pointer-events:auto}.t-alert:not(:first-child){margin-top:.75rem}"]
|
|
176
|
-
}),
|
|
177
|
-
__param(0, Inject(TUI_ANIMATION_OPTIONS)),
|
|
178
|
-
__param(1, Inject(TuiNotificationsService))
|
|
179
|
-
], TuiNotificationsHostComponent);
|
|
180
|
-
return TuiNotificationsHostComponent;
|
|
181
|
-
}());
|
|
182
|
-
|
|
183
|
-
// TODO: remove in ivy compilation
|
|
184
|
-
var NOTIFICATIONS_HOST = TuiNotificationsHostComponent;
|
|
185
|
-
var TuiNotificationsModule = /** @class */ (function () {
|
|
186
|
-
function TuiNotificationsModule() {
|
|
187
|
-
}
|
|
188
|
-
TuiNotificationsModule = __decorate([
|
|
189
|
-
NgModule({
|
|
190
|
-
imports: [CommonModule, TuiNotificationAlertModule, TuiLetModule],
|
|
191
|
-
declarations: [TuiNotificationsHostComponent],
|
|
192
|
-
exports: [TuiNotificationsHostComponent],
|
|
193
|
-
entryComponents: [TuiNotificationsHostComponent],
|
|
194
|
-
providers: [
|
|
195
|
-
{
|
|
196
|
-
provide: TuiNotificationsHostComponent,
|
|
197
|
-
useValue: NOTIFICATIONS_HOST,
|
|
198
|
-
},
|
|
199
|
-
],
|
|
200
|
-
})
|
|
201
|
-
], TuiNotificationsModule);
|
|
202
|
-
return TuiNotificationsModule;
|
|
203
|
-
}());
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Generated bundle index. Do not edit.
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
export { NOTIFICATIONS_HOST, NotificationAlert, TuiNotificationAlertComponent, TuiNotificationAlertModule, TuiNotificationsHostComponent, TuiNotificationsModule, TuiNotificationsService };
|
|
210
|
-
//# sourceMappingURL=taiga-ui-core-modules-notifications.js.map
|