@lucca-front/ng 21.2.2 → 21.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/lucca-front-ng-a11y.mjs +4 -4
- package/fesm2022/lucca-front-ng-a11y.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-activity-feed.mjs +26 -21
- package/fesm2022/lucca-front-ng-activity-feed.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-api.mjs +46 -41
- package/fesm2022/lucca-front-ng-api.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-app-layout.mjs +4 -4
- package/fesm2022/lucca-front-ng-app-layout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-box.mjs +7 -7
- package/fesm2022/lucca-front-ng-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-breadcrumbs.mjs +10 -10
- package/fesm2022/lucca-front-ng-breadcrumbs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-bubble-icon.mjs +18 -12
- package/fesm2022/lucca-front-ng-bubble-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-bubble-illustration.mjs +16 -11
- package/fesm2022/lucca-front-ng-bubble-illustration.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-callout.mjs +76 -70
- package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-chip.mjs +22 -16
- package/fesm2022/lucca-front-ng-chip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-clear.mjs +15 -10
- package/fesm2022/lucca-front-ng-clear.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-code.mjs +5 -5
- package/fesm2022/lucca-front-ng-code.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-color.mjs +13 -8
- package/fesm2022/lucca-front-ng-color.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-comment.mjs +37 -32
- package/fesm2022/lucca-front-ng-comment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-container.mjs +13 -8
- package/fesm2022/lucca-front-ng-container.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-api.mjs +13 -13
- package/fesm2022/lucca-front-ng-core-select-api.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-department.mjs +21 -15
- package/fesm2022/lucca-front-ng-core-select-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-establishment.mjs +15 -15
- package/fesm2022/lucca-front-ng-core-select-establishment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs +9 -9
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-occupation-category.mjs +6 -6
- package/fesm2022/lucca-front-ng-core-select-occupation-category.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-user.mjs +50 -45
- package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select.mjs +90 -90
- package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core.mjs +18 -18
- package/fesm2022/lucca-front-ng-core.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-data-table.mjs +95 -80
- package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date.mjs +42 -42
- package/fesm2022/lucca-front-ng-date.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date2.mjs +133 -126
- package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-department.mjs +25 -25
- package/fesm2022/lucca-front-ng-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dialog.mjs +61 -43
- package/fesm2022/lucca-front-ng-dialog.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-divider.mjs +14 -9
- package/fesm2022/lucca-front-ng-divider.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dropdown.mjs +43 -43
- package/fesm2022/lucca-front-ng-dropdown.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-empty-state.mjs +41 -35
- package/fesm2022/lucca-front-ng-empty-state.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-error-page.mjs +12 -7
- package/fesm2022/lucca-front-ng-error-page.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-establishment.mjs +34 -34
- package/fesm2022/lucca-front-ng-establishment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-fancy-box.mjs +16 -11
- package/fesm2022/lucca-front-ng-fancy-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-file-upload.mjs +84 -64
- package/fesm2022/lucca-front-ng-file-upload.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-filter-pills.mjs +61 -88
- package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-footer.mjs +17 -11
- package/fesm2022/lucca-front-ng-footer.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-field.mjs +94 -76
- package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-header.mjs +10 -5
- package/fesm2022/lucca-front-ng-form-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-label.mjs +18 -13
- package/fesm2022/lucca-front-ng-form-label.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form.mjs +11 -8
- package/fesm2022/lucca-front-ng-form.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-formly.mjs +58 -58
- package/fesm2022/lucca-front-ng-formly.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs +46 -41
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-html.mjs +3 -3
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-html.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs +8 -9
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-markdown.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs +3 -3
- package/fesm2022/lucca-front-ng-forms-rich-text-input-formatters-plain-text.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +94 -92
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms.mjs +212 -153
- package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-gauge.mjs +19 -19
- package/fesm2022/lucca-front-ng-gauge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-grid.mjs +38 -26
- package/fesm2022/lucca-front-ng-grid.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-highlight-data.mjs +39 -17
- package/fesm2022/lucca-front-ng-highlight-data.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-highlight-text.mjs +26 -0
- package/fesm2022/lucca-front-ng-highlight-text.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs +165 -20
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-impersonation.mjs +119 -0
- package/fesm2022/lucca-front-ng-impersonation.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-index-table.mjs +69 -63
- package/fesm2022/lucca-front-ng-index-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-inline-message.mjs +15 -8
- package/fesm2022/lucca-front-ng-inline-message.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-input.mjs +22 -22
- package/fesm2022/lucca-front-ng-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-link.mjs +12 -12
- package/fesm2022/lucca-front-ng-link.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listbox.mjs +32 -27
- package/fesm2022/lucca-front-ng-listbox.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listing.mjs +21 -21
- package/fesm2022/lucca-front-ng-listing.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-loading.mjs +14 -9
- package/fesm2022/lucca-front-ng-loading.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-main-layout.mjs +9 -9
- package/fesm2022/lucca-front-ng-main-layout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-mobile-push.mjs +5 -5
- package/fesm2022/lucca-front-ng-mobile-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-modal.mjs +23 -23
- package/fesm2022/lucca-front-ng-modal.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-multi-select.mjs +113 -95
- package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-new-badge.mjs +4 -4
- package/fesm2022/lucca-front-ng-new-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-number-format.mjs +10 -10
- package/fesm2022/lucca-front-ng-number-format.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-number.mjs +7 -7
- package/fesm2022/lucca-front-ng-number.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-numeric-badge.mjs +18 -13
- package/fesm2022/lucca-front-ng-numeric-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-option.mjs +130 -130
- package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-page-header.mjs +9 -9
- package/fesm2022/lucca-front-ng-page-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-pagination.mjs +17 -12
- package/fesm2022/lucca-front-ng-pagination.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-plg-push.mjs +9 -9
- package/fesm2022/lucca-front-ng-plg-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover.mjs +17 -17
- package/fesm2022/lucca-front-ng-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover2.mjs +16 -16
- package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popup.mjs +10 -10
- package/fesm2022/lucca-front-ng-popup.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-progress-bar.mjs +13 -8
- package/fesm2022/lucca-front-ng-progress-bar.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-progress-stepper.mjs +18 -13
- package/fesm2022/lucca-front-ng-progress-stepper.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-read-more.mjs +24 -19
- package/fesm2022/lucca-front-ng-read-more.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-resource-card.mjs +28 -22
- package/fesm2022/lucca-front-ng-resource-card.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-safe-content.mjs +10 -10
- package/fesm2022/lucca-front-ng-safe-content.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-scroll-box.mjs +6 -6
- package/fesm2022/lucca-front-ng-scroll-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-scroll.mjs +8 -8
- package/fesm2022/lucca-front-ng-scroll.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs +22 -16
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control.mjs +11 -11
- package/fesm2022/lucca-front-ng-segmented-control.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-select.mjs +14 -14
- package/fesm2022/lucca-front-ng-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-sidepanel.mjs +7 -7
- package/fesm2022/lucca-front-ng-sidepanel.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-simple-select.mjs +37 -36
- package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-skeleton.mjs +82 -56
- package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs +84 -0
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-software-icon.mjs +34 -23
- package/fesm2022/lucca-front-ng-software-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-sortable-list.mjs +14 -14
- package/fesm2022/lucca-front-ng-sortable-list.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-status-badge.mjs +13 -8
- package/fesm2022/lucca-front-ng-status-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-table-of-content.mjs +7 -7
- package/fesm2022/lucca-front-ng-table-of-content.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tag.mjs +19 -14
- package/fesm2022/lucca-front-ng-tag.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-text-flow.mjs +4 -4
- package/fesm2022/lucca-front-ng-text-flow.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-time.mjs +362 -115
- package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-title.mjs +10 -10
- package/fesm2022/lucca-front-ng-title.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-toast.mjs +14 -14
- package/fesm2022/lucca-front-ng-toast.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tooltip.mjs +35 -35
- package/fesm2022/lucca-front-ng-tooltip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tree-select.mjs +16 -16
- package/fesm2022/lucca-front-ng-tree-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user-popover.mjs +22 -21
- package/fesm2022/lucca-front-ng-user-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user.mjs +122 -100
- package/fesm2022/lucca-front-ng-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs +27 -27
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs.map +1 -1
- package/package.json +18 -5
- package/schematics/lib/local-deps/package-lock.json +17 -79
- package/schematics/lib/local-deps/package.json +1 -1
- package/schematics/palettes/index.js +1 -0
- package/src/components/_picker.scss +2 -1
- package/types/lucca-front-ng-activity-feed.d.ts +8 -1
- package/types/lucca-front-ng-api.d.ts +22 -16
- package/types/lucca-front-ng-bubble-icon.d.ts +10 -1
- package/types/lucca-front-ng-bubble-illustration.d.ts +10 -4
- package/types/lucca-front-ng-callout.d.ts +21 -13
- package/types/lucca-front-ng-chip.d.ts +10 -1
- package/types/lucca-front-ng-clear.d.ts +8 -2
- package/types/lucca-front-ng-color.d.ts +8 -1
- package/types/lucca-front-ng-comment.d.ts +8 -1
- package/types/lucca-front-ng-container.d.ts +8 -1
- package/types/lucca-front-ng-core-select-department.d.ts +4 -0
- package/types/lucca-front-ng-core-select-user.d.ts +3 -2
- package/types/lucca-front-ng-core-select.d.ts +6 -6
- package/types/lucca-front-ng-core.d.ts +1 -1
- package/types/lucca-front-ng-data-table.d.ts +12 -1
- package/types/lucca-front-ng-date2.d.ts +17 -9
- package/types/lucca-front-ng-dialog.d.ts +14 -3
- package/types/lucca-front-ng-divider.d.ts +8 -1
- package/types/lucca-front-ng-empty-state.d.ts +15 -7
- package/types/lucca-front-ng-error-page.d.ts +9 -4
- package/types/lucca-front-ng-fancy-box.d.ts +8 -1
- package/types/lucca-front-ng-file-upload.d.ts +20 -4
- package/types/lucca-front-ng-filter-pills.d.ts +4 -9
- package/types/lucca-front-ng-footer.d.ts +11 -2
- package/types/lucca-front-ng-form-field.d.ts +35 -18
- package/types/lucca-front-ng-form-header.d.ts +8 -1
- package/types/lucca-front-ng-form-label.d.ts +8 -1
- package/types/lucca-front-ng-form.d.ts +2 -0
- package/types/lucca-front-ng-forms-phone-number-input.d.ts +19 -12
- package/types/lucca-front-ng-forms-rich-text-input.d.ts +1 -0
- package/types/lucca-front-ng-forms.d.ts +82 -30
- package/types/lucca-front-ng-grid.d.ts +23 -8
- package/types/lucca-front-ng-highlight-data.d.ts +16 -1
- package/types/lucca-front-ng-highlight-text.d.ts +12 -0
- package/types/lucca-front-ng-horizontal-navigation.d.ts +40 -3
- package/types/lucca-front-ng-impersonation.d.ts +33 -0
- package/types/lucca-front-ng-index-table.d.ts +10 -1
- package/types/lucca-front-ng-inline-message.d.ts +11 -4
- package/types/lucca-front-ng-listbox.d.ts +8 -1
- package/types/lucca-front-ng-loading.d.ts +8 -1
- package/types/lucca-front-ng-multi-select.d.ts +3 -1
- package/types/lucca-front-ng-numeric-badge.d.ts +8 -1
- package/types/lucca-front-ng-pagination.d.ts +8 -1
- package/types/lucca-front-ng-progress-bar.d.ts +9 -2
- package/types/lucca-front-ng-progress-stepper.d.ts +8 -1
- package/types/lucca-front-ng-read-more.d.ts +8 -1
- package/types/lucca-front-ng-resource-card.d.ts +10 -1
- package/types/lucca-front-ng-segmented-control-tabs.d.ts +2 -0
- package/types/lucca-front-ng-segmented-control.d.ts +4 -2
- package/types/lucca-front-ng-simple-select.d.ts +3 -2
- package/types/lucca-front-ng-skeleton.d.ts +30 -10
- package/types/lucca-front-ng-software-icon-wrapper.d.ts +31 -0
- package/types/lucca-front-ng-software-icon.d.ts +17 -6
- package/types/lucca-front-ng-status-badge.d.ts +8 -1
- package/types/lucca-front-ng-tag.d.ts +8 -1
- package/types/lucca-front-ng-time.d.ts +87 -8
- package/types/lucca-front-ng-user.d.ts +19 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-title.mjs","sources":["../../../packages/ng/title/title-translate.service.ts","../../../packages/ng/title/title.model.ts","../../../packages/ng/title/title.service.ts","../../../packages/ng/title/title.module.ts","../../../packages/ng/title/title.strategy.ts","../../../packages/ng/title/lucca-front-ng-title.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nexport const LU_TITLE_TRANSLATE_SERVICE = new InjectionToken<ILuTitleTranslateService>('LU_TITLE_TRANSLATE_SERVICE');\n\nexport interface ILuTitleTranslateService {\n\ttranslate(key: string, args?: Record<string, unknown>): string | Observable<string>;\n}\n","export type PageTitle = { title: string; params?: { [param: string]: string } };\nexport const TitleSeparator = ' – ';\n","import { Inject, Injectable } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, ActivationEnd, Router } from '@angular/router';\nimport { BehaviorSubject, combineLatest, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, filter, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\n/**\n * @deprecated use Title strategy instead\n */\n@Injectable()\nexport class LuTitleService {\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>(['Lucca']);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t);\n\n\tconstructor(\n\t\tprivate router: Router,\n\t\tprivate title: Title,\n\t\t@Inject(LU_TITLE_TRANSLATE_SERVICE) private translateService: ILuTitleTranslateService,\n\t) {}\n\n\tinit(applicationNameTranslationKey: string) {\n\t\tthis.router.events\n\t\t\t.pipe(\n\t\t\t\tfilter((event) => {\n\t\t\t\t\treturn event instanceof ActivationEnd && event.snapshot.children.length === 0;\n\t\t\t\t}),\n\t\t\t\tmap((event: ActivationEnd) => getPageTitleParts(event.snapshot)),\n\t\t\t\tmap((titleParts) => uniqTitle(titleParts)),\n\t\t\t\tmap((titleParts) => titleParts.filter(({ title }) => title !== '').map(({ title, params }) => this.translateService.translate(title, params))),\n\t\t\t\tmap((titleParts: Array<string>) => [...titleParts, this.translateService.translate(applicationNameTranslationKey, {}), 'Lucca'].filter((x) => !!x)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap((titleParts) => this.titlePartsSubject.next(titleParts)),\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n}\n\nfunction getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\tconst pageTitle: PageTitle = {\n\t\ttitle: (snapshot.data?.['title'] || '') as string,\n\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t};\n\treturn snapshot.parent ? [pageTitle, ...getPageTitleParts(snapshot.parent)] : [pageTitle];\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { LuTitleService } from './title.service';\n\n/**\n * @deprecated use title streatgy instead\n */\n@NgModule({\n\timports: [RouterModule],\n\tproviders: [LuTitleService],\n})\nexport class LuTitleModule {}\n","import { inject, Injectable, InjectionToken, Provider } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot, TitleStrategy } from '@angular/router';\nimport { BehaviorSubject, combineLatest, isObservable, Observable, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\nexport const ɵAPP_TITLE = new InjectionToken<string | Observable<string>>('APP_TITLE');\nexport type LuTitleNamingStrategy = 'product' | 'other';\nexport const ɵNAMING_STRATEGY = new InjectionToken<LuTitleNamingStrategy>('NAMING_STRATEGY', { factory: () => 'product' });\n\n/**\n * @deprecated Use `provideLuTitleStrategy` instead.\n */\nexport const APP_TITLE = ɵAPP_TITLE;\n\nconst Lucca = 'Lucca';\n\n@Injectable({ providedIn: 'root' })\nexport class LuTitleStrategy extends TitleStrategy {\n\tprivate title = inject(Title);\n\tprivate translateService = inject<ILuTitleTranslateService>(LU_TITLE_TRANSLATE_SERVICE, { optional: true });\n\tprivate appTitle = inject(ɵAPP_TITLE);\n\tprivate namingStrategy = inject(ɵNAMING_STRATEGY);\n\n\tprivate luccaTitle$ = isObservable(this.appTitle) ? this.appTitle.pipe(map((title) => this.#luccaTitle(title))) : of(this.#luccaTitle(this.appTitle));\n\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>([Lucca]);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t\tdistinctUntilChanged(),\n\t);\n\tconstructor() {\n\t\tsuper();\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\toverride updateTitle(routerState: RouterStateSnapshot) {\n\t\t// Title page is display from child to root\n\t\tconst pageTitles = this.#getPageTitleParts(routerState.root).reverse();\n\t\tconst translatedPageTitles = uniqTitle(pageTitles)\n\t\t\t.filter(({ title }) => title !== '')\n\t\t\t.map(({ title, params }) => (this.translateService ? this.translateService.translate(title, params) : title));\n\t\t// Add the name app\n\t\tconst titleParts = [...translatedPageTitles, this.luccaTitle$].filter((x) => !!x);\n\t\tthis.titlePartsSubject.next(titleParts);\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n\n\t#getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\t\tconst pageTitle: PageTitle = {\n\t\t\ttitle: this.getResolvedTitleForRoute(snapshot) as string,\n\t\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t\t};\n\t\treturn snapshot.firstChild ? [pageTitle, ...this.#getPageTitleParts(snapshot.firstChild)] : [pageTitle];\n\t}\n\n\t#luccaTitle(appTitle: string) {\n\t\tif (appTitle.includes(Lucca)) {\n\t\t\treturn appTitle;\n\t\t}\n\t\tif (this.namingStrategy === 'product') {\n\t\t\treturn `${Lucca} ${appTitle}`;\n\t\t}\n\t\treturn `${appTitle}${TitleSeparator}${Lucca}`;\n\t}\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n\nexport interface LuTitleStrategyOptions {\n\tappTitle?: () => string | Observable<string>;\n\ttranslateService?: () => ILuTitleTranslateService;\n\tnamingStrategy?: LuTitleNamingStrategy;\n}\n\nexport function provideLuTitleStrategy(options: LuTitleStrategyOptions): Provider[] {\n\tconst providers: Provider[] = [{ provide: TitleStrategy, useClass: LuTitleStrategy }];\n\n\tif (options.appTitle) {\n\t\tproviders.push({ provide: ɵAPP_TITLE, useFactory: options.appTitle });\n\t}\n\tif (options.translateService) {\n\t\tproviders.push({ provide: LU_TITLE_TRANSLATE_SERVICE, useFactory: options.translateService });\n\t}\n\tif (options.namingStrategy) {\n\t\tproviders.push({ provide: ɵNAMING_STRATEGY, useValue: options.namingStrategy });\n\t}\n\n\treturn providers;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uniqTitle"],"mappings":";;;;;;;;;MAGa,0BAA0B,GAAG,IAAI,cAAc,CAA2B,4BAA4B;;ACF5G,MAAM,cAAc,GAAG;;ACO9B;;AAEG;MAEU,cAAc,CAAA;AAQ1B,IAAA,WAAA,CACS,MAAc,EACd,KAAY,EACwB,gBAA0C,EAAA;QAF9E,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,KAAK,GAAL,KAAK;QAC+B,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAVrD,IAAA,CAAA,iBAAiB,GAAG,IAAI,eAAe,CAA0C,CAAC,OAAO,CAAC,CAAC;AACnG,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C,SAAS,KAAK,SAAS,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,KAAK,CAAC;AACzH;AAQM,SAAU,sBAAsB,CAAC,OAA+B,EAAA;AACrE,IAAA,MAAM,SAAS,GAAe,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAErF,IAAA,IAAI,OAAO,CAAC,QAAQ,EAAE;AACrB,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IACtE;AACA,IAAA,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAC7B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAC9F;AACA,IAAA,IAAI,OAAO,CAAC,cAAc,EAAE;AAC3B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;IAChF;AAEA,IAAA,OAAO,SAAS;AACjB;;ACtGA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-title.mjs","sources":["../../../packages/ng/title/title-translate.service.ts","../../../packages/ng/title/title.model.ts","../../../packages/ng/title/title.service.ts","../../../packages/ng/title/title.module.ts","../../../packages/ng/title/title.strategy.ts","../../../packages/ng/title/lucca-front-ng-title.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nexport const LU_TITLE_TRANSLATE_SERVICE = new InjectionToken<ILuTitleTranslateService>('LU_TITLE_TRANSLATE_SERVICE');\n\nexport interface ILuTitleTranslateService {\n\ttranslate(key: string, args?: Record<string, unknown>): string | Observable<string>;\n}\n","export type PageTitle = { title: string; params?: { [param: string]: string } };\nexport const TitleSeparator = ' – ';\n","import { Inject, Injectable } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, ActivationEnd, Router } from '@angular/router';\nimport { BehaviorSubject, combineLatest, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, filter, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\n/**\n * @deprecated use Title strategy instead\n */\n@Injectable()\nexport class LuTitleService {\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>(['Lucca']);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t);\n\n\tconstructor(\n\t\tprivate router: Router,\n\t\tprivate title: Title,\n\t\t@Inject(LU_TITLE_TRANSLATE_SERVICE) private translateService: ILuTitleTranslateService,\n\t) {}\n\n\tinit(applicationNameTranslationKey: string) {\n\t\tthis.router.events\n\t\t\t.pipe(\n\t\t\t\tfilter((event) => {\n\t\t\t\t\treturn event instanceof ActivationEnd && event.snapshot.children.length === 0;\n\t\t\t\t}),\n\t\t\t\tmap((event: ActivationEnd) => getPageTitleParts(event.snapshot)),\n\t\t\t\tmap((titleParts) => uniqTitle(titleParts)),\n\t\t\t\tmap((titleParts) => titleParts.filter(({ title }) => title !== '').map(({ title, params }) => this.translateService.translate(title, params))),\n\t\t\t\tmap((titleParts: Array<string>) => [...titleParts, this.translateService.translate(applicationNameTranslationKey, {}), 'Lucca'].filter((x) => !!x)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap((titleParts) => this.titlePartsSubject.next(titleParts)),\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n}\n\nfunction getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\tconst pageTitle: PageTitle = {\n\t\ttitle: (snapshot.data?.['title'] || '') as string,\n\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t};\n\treturn snapshot.parent ? [pageTitle, ...getPageTitleParts(snapshot.parent)] : [pageTitle];\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { LuTitleService } from './title.service';\n\n/**\n * @deprecated use title streatgy instead\n */\n@NgModule({\n\timports: [RouterModule],\n\tproviders: [LuTitleService],\n})\nexport class LuTitleModule {}\n","import { inject, Injectable, InjectionToken, Provider } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot, TitleStrategy } from '@angular/router';\nimport { BehaviorSubject, combineLatest, isObservable, Observable, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\nexport const ɵAPP_TITLE = new InjectionToken<string | Observable<string>>('APP_TITLE');\nexport type LuTitleNamingStrategy = 'product' | 'other';\nexport const ɵNAMING_STRATEGY = new InjectionToken<LuTitleNamingStrategy>('NAMING_STRATEGY', { factory: () => 'product' });\n\n/**\n * @deprecated Use `provideLuTitleStrategy` instead.\n */\nexport const APP_TITLE = ɵAPP_TITLE;\n\nconst Lucca = 'Lucca';\n\n@Injectable({ providedIn: 'root' })\nexport class LuTitleStrategy extends TitleStrategy {\n\tprivate title = inject(Title);\n\tprivate translateService = inject<ILuTitleTranslateService>(LU_TITLE_TRANSLATE_SERVICE, { optional: true });\n\tprivate appTitle = inject(ɵAPP_TITLE);\n\tprivate namingStrategy = inject(ɵNAMING_STRATEGY);\n\n\tprivate luccaTitle$ = isObservable(this.appTitle) ? this.appTitle.pipe(map((title) => this.#luccaTitle(title))) : of(this.#luccaTitle(this.appTitle));\n\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>([Lucca]);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t\tdistinctUntilChanged(),\n\t);\n\tconstructor() {\n\t\tsuper();\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\toverride updateTitle(routerState: RouterStateSnapshot) {\n\t\t// Title page is display from child to root\n\t\tconst pageTitles = this.#getPageTitleParts(routerState.root).reverse();\n\t\tconst translatedPageTitles = uniqTitle(pageTitles)\n\t\t\t.filter(({ title }) => title !== '')\n\t\t\t.map(({ title, params }) => (this.translateService ? this.translateService.translate(title, params) : title));\n\t\t// Add the name app\n\t\tconst titleParts = [...translatedPageTitles, this.luccaTitle$].filter((x) => !!x);\n\t\tthis.titlePartsSubject.next(titleParts);\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n\n\t#getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\t\tconst pageTitle: PageTitle = {\n\t\t\ttitle: this.getResolvedTitleForRoute(snapshot) as string,\n\t\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t\t};\n\t\treturn snapshot.firstChild ? [pageTitle, ...this.#getPageTitleParts(snapshot.firstChild)] : [pageTitle];\n\t}\n\n\t#luccaTitle(appTitle: string) {\n\t\tif (appTitle.includes(Lucca)) {\n\t\t\treturn appTitle;\n\t\t}\n\t\tif (this.namingStrategy === 'product') {\n\t\t\treturn `${Lucca} ${appTitle}`;\n\t\t}\n\t\treturn `${appTitle}${TitleSeparator}${Lucca}`;\n\t}\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n\nexport interface LuTitleStrategyOptions {\n\tappTitle?: () => string | Observable<string>;\n\ttranslateService?: () => ILuTitleTranslateService;\n\tnamingStrategy?: LuTitleNamingStrategy;\n}\n\nexport function provideLuTitleStrategy(options: LuTitleStrategyOptions): Provider[] {\n\tconst providers: Provider[] = [{ provide: TitleStrategy, useClass: LuTitleStrategy }];\n\n\tif (options.appTitle) {\n\t\tproviders.push({ provide: ɵAPP_TITLE, useFactory: options.appTitle });\n\t}\n\tif (options.translateService) {\n\t\tproviders.push({ provide: LU_TITLE_TRANSLATE_SERVICE, useFactory: options.translateService });\n\t}\n\tif (options.namingStrategy) {\n\t\tproviders.push({ provide: ɵNAMING_STRATEGY, useValue: options.namingStrategy });\n\t}\n\n\treturn providers;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uniqTitle"],"mappings":";;;;;;;;;MAGa,0BAA0B,GAAG,IAAI,cAAc,CAA2B,4BAA4B;;ACF5G,MAAM,cAAc,GAAG;;ACO9B;;AAEG;MAEU,cAAc,CAAA;AAQ1B,IAAA,WAAA,CACS,MAAc,EACd,KAAY,EACwB,gBAA0C,EAAA;QAF9E,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,KAAK,GAAL,KAAK;QAC+B,IAAA,CAAA,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,IAAA,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,KAAK,CAAC;AACzH;AAQM,SAAU,sBAAsB,CAAC,OAA+B,EAAA;AACrE,IAAA,MAAM,SAAS,GAAe,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAErF,IAAA,IAAI,OAAO,CAAC,QAAQ,EAAE;AACrB,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IACtE;AACA,IAAA,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAC7B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAC9F;AACA,IAAA,IAAI,OAAO,CAAC,cAAc,EAAE;AAC3B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;IAChF;AAEA,IAAA,OAAO,SAAS;AACjB;;ACtGA;;AAEG;;;;"}
|
|
@@ -31,10 +31,10 @@ class LuToastsService {
|
|
|
31
31
|
const randomString = Math.random().toString(36).substring(2, 9);
|
|
32
32
|
return `_${randomString}`;
|
|
33
33
|
}
|
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
35
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuToastsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
35
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuToastsService, providedIn: 'root' }); }
|
|
36
36
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuToastsService, decorators: [{
|
|
38
38
|
type: Injectable,
|
|
39
39
|
args: [{ providedIn: 'root' }]
|
|
40
40
|
}] });
|
|
@@ -75,10 +75,10 @@ class LuToastsComponent {
|
|
|
75
75
|
#toastsService;
|
|
76
76
|
constructor() {
|
|
77
77
|
this.#toastsService = inject(LuToastsService);
|
|
78
|
-
this.bottom = input(false, ...(ngDevMode ? [{ debugName: "bottom" }] : []));
|
|
79
|
-
this.sources = input(...(ngDevMode ? [undefined, { debugName: "sources" }] : []));
|
|
78
|
+
this.bottom = input(false, ...(ngDevMode ? [{ debugName: "bottom" }] : /* istanbul ignore next */ []));
|
|
79
|
+
this.sources = input(...(ngDevMode ? [undefined, { debugName: "sources" }] : /* istanbul ignore next */ []));
|
|
80
80
|
this.toasts$ = this.#toastsService.toasts$;
|
|
81
|
-
this.intl = input(...intlInputOptions(LU_TOAST_TRANSLATIONS), ...(ngDevMode ? [{ debugName: "intl" }] : []));
|
|
81
|
+
this.intl = input(...intlInputOptions(LU_TOAST_TRANSLATIONS), ...(ngDevMode ? [{ debugName: "intl" }] : /* istanbul ignore next */ []));
|
|
82
82
|
this.iconClassByToastType = {
|
|
83
83
|
Info: 'icon-signInfo',
|
|
84
84
|
Success: 'icon-signSuccess',
|
|
@@ -109,23 +109,23 @@ class LuToastsComponent {
|
|
|
109
109
|
isOnlyDismissibleManually(toast) {
|
|
110
110
|
return this.#toastsService.isOnlyDismissibleManually(toast);
|
|
111
111
|
}
|
|
112
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
113
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuToastsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
113
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: LuToastsComponent, isStandalone: true, selector: "lu-toasts", inputs: { bottom: { classPropertyName: "bottom", publicName: "bottom", isSignal: true, isRequired: false, transformFunction: null }, sources: { classPropertyName: "sources", publicName: "sources", isSignal: true, isRequired: false, transformFunction: null }, intl: { classPropertyName: "intl", publicName: "intl", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"toasts\" aria-live=\"polite\" [class.mod-bottom]=\"bottom()\">\n\t@for (toast of toasts$ | async; track toast.id) {\n\t\t<div class=\"toasts-item\" [class]=\"paletteClassByToastType[toast.type]\">\n\t\t\t@if (toast.type) {\n\t\t\t\t<span class=\"toast-item-icon lucca-icon\" aria-hidden=\"true\" [class]=\"iconClassByToastType[toast.type]\"></span>\n\t\t\t}\n\t\t\t<div class=\"toast-item-content\">\n\t\t\t\t@if (toast.title) {\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ toast.title }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (isStringPortalContent(toast.message)) {\n\t\t\t\t\t<p class=\"toast-item-content-description\" [innerHtml]=\"toast.message\"></p>\n\t\t\t\t} @else {\n\t\t\t\t\t<ng-container *luPortal=\"toast.message\" />\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"toasts-item-kill button\"\n\t\t\t\t(click)=\"removeToast(toast)\"\n\t\t\t\t(animationend)=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? removeToast(toast) : null\"\n\t\t\t\t[style.animation-duration]=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? toast.duration + 'ms' : null\"\n\t\t\t>\n\t\t\t\t<span class=\"lucca-icon icon-signClose\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"pr-u-mask\">{{ intl().close }}</span>\n\t\t\t</button>\n\t\t</div>\n\t}\n</div>\n", styles: ["@layer components{.toasts{--components-toasts-color: var(--pr-t-color-text-reverse);--components-toasts-top: var(--pr-t-spacings-300);--components-toasts-right: calc(var(--pr-t-spacings-300) + var(--commons-pushPanel-inlineSize));--components-toasts-left: var(--pr-t-spacings-300);--components-toasts-bottom: var(--pr-t-spacings-300);--components-toasts-margin-bottom: var(--pr-t-spacings-50);--components-toasts-maxwidth: min(22.5rem, calc(100dvw - (var(--components-toasts-right) * 2)));--components-toasts-inset: var(--components-toasts-top) var(--components-toasts-right) auto auto;--components-toasts-footerHeight: 4.5rem;--components-toasts-background: var(--palettes-neutral-800);--components-toasts-padding: var(--pr-t-spacings-100) var(--pr-t-spacings-200);max-inline-size:var(--components-toasts-maxwidth);display:flex;flex-direction:column;align-items:flex-end;position:fixed;z-index:9999;inset:var(--components-toasts-inset)}html:has(.main-content .footer.mod-sticky,.dialog.mod-drawer .dialog-inside-footer) .toasts{--components-toasts-bottom: calc(var(--components-toasts-footerHeight) + var(--pr-t-spacings-300))}.toasts-item{display:flex;gap:var(--pr-t-spacings-50);color:var(--components-toasts-color);padding:var(--pr-t-spacings-50);margin-block-end:var(--components-toasts-margin-bottom);background-color:var(--palettes-neutral-800);animation-name:toastsItem;animation-duration:var(--commons-animations-durations-standard);animation-iteration-count:1;border-radius:var(--pr-t-border-radius-structure);overflow:hidden;position:relative;transform-origin:top}@keyframes toastsItem{0%{transform:translateY(var(--pr-t-spacings-200));opacity:0}to{opacity:1}}.toasts-item:hover .toasts-item-kill,.toasts-item:focus-within .toasts-item-kill{animation-play-state:paused}.toast-item-icon{background:var(--palettes-700, var(--palettes-product-700));border-radius:var(--pr-t-border-radius-default);padding-block:var(--pr-t-spacings-100);padding-inline:var(--pr-t-spacings-50)}.toast-item-content{display:flex;flex-grow:1;flex-direction:column;gap:var(--pr-t-spacings-50);padding-block:var(--pr-t-spacings-100);padding-inline:var(--pr-t-spacings-100) 0}.toast-item-content-description{margin:0;overflow-wrap:anywhere}.toasts-item-kill.button,.toasts-item-kill:not(.button){align-self:flex-start;border-radius:var(--pr-t-border-radius-default);animation-name:timer;--components-button-padding: var(--pr-t-spacings-100);--components-button-backgroundColor: transparent;--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-boxShadow: none}.toasts-item-kill.button:hover,.toasts-item-kill.button:focus-visible,.toasts-item-kill:not(.button):hover,.toasts-item-kill:not(.button):focus-visible{--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50))}.toasts-item-kill.button:active,.toasts-item-kill:not(.button):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.toasts-item-kill.button:disabled,.toasts-item-kill:not(.button):disabled{--components-button-backgroundColor: transparent;--components-button-color: var(--pr-t-color-text-disabled)}.toasts-item-kill.button,.toasts-item-kill:not(.button){--components-button-color: var(--palettes-neutral-0)}.toasts-item-kill.button:hover,.toasts-item-kill.button:focus-visible,.toasts-item-kill:not(.button):hover,.toasts-item-kill:not(.button):focus-visible{--components-button-color: var(--palettes-neutral-0);--components-button-backgroundColor: var(--palettes-neutral-900)}.toasts-item-kill.button:active,.toasts-item-kill:not(.button):active{--components-button-backgroundColor: var(--palettes-neutral-700)}@keyframes timer{}}@layer mods{.toasts.mod-bottom{--components-toasts-inset: auto var(--components-toasts-right) var(--components-toasts-bottom) auto}}\n"], dependencies: [{ kind: "directive", type: PortalDirective, selector: "[luPortal]", inputs: ["luPortal", "luPortalContext"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
114
114
|
}
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuToastsComponent, decorators: [{
|
|
116
116
|
type: Component,
|
|
117
|
-
args: [{ selector: 'lu-toasts', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, PortalDirective], template: "<div class=\"toasts\" aria-live=\"polite\" [class.mod-bottom]=\"bottom()\">\n\t@for (toast of toasts$ | async; track toast.id) {\n\t\t<div class=\"toasts-item\" [class]=\"paletteClassByToastType[toast.type]\">\n\t\t\t@if (toast.type) {\n\t\t\t\t<span class=\"toast-item-icon lucca-icon\" aria-hidden=\"true\" [class]=\"iconClassByToastType[toast.type]\"></span>\n\t\t\t}\n\t\t\t<div class=\"toast-item-content\">\n\t\t\t\t@if (toast.title) {\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ toast.title }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (isStringPortalContent(toast.message)) {\n\t\t\t\t\t<p class=\"toast-item-content-description\" [innerHtml]=\"toast.message\"></p>\n\t\t\t\t} @else {\n\t\t\t\t\t<ng-container *luPortal=\"toast.message\" />\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"toasts-item-kill button\"\n\t\t\t\t(click)=\"removeToast(toast)\"\n\t\t\t\t(animationend)=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? removeToast(toast) : null\"\n\t\t\t\t[style.animation-duration]=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? toast.duration + 'ms' : null\"\n\t\t\t>\n\t\t\t\t<span class=\"lucca-icon icon-signClose\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"pr-u-mask\">{{ intl().close }}</span>\n\t\t\t</button>\n\t\t</div>\n\t}\n</div>\n", styles: ["@layer components{.toasts{--components-toasts-color: var(--pr-t-color-text-reverse);--components-toasts-top: var(--pr-t-spacings-300);--components-toasts-right: calc(var(--pr-t-spacings-300) + var(--commons-pushPanel-inlineSize));--components-toasts-left: var(--pr-t-spacings-300);--components-toasts-bottom: var(--pr-t-spacings-300);--components-toasts-margin-bottom: var(--pr-t-spacings-50);--components-toasts-maxwidth: min(22.5rem, calc(100dvw - (var(--components-toasts-right) * 2)));--components-toasts-inset: var(--components-toasts-top) var(--components-toasts-right) auto auto;--components-toasts-footerHeight: 4.5rem;--components-toasts-background: var(--palettes-neutral-800);--components-toasts-padding: var(--pr-t-spacings-100) var(--pr-t-spacings-200);max-inline-size:var(--components-toasts-maxwidth);display:flex;flex-direction:column;align-items:flex-end;position:fixed;z-index:9999;inset:var(--components-toasts-inset)}html:has(.main-content .footer.mod-sticky,.dialog.mod-drawer .dialog-inside-footer) .toasts{--components-toasts-bottom: calc(var(--components-toasts-footerHeight) + var(--pr-t-spacings-300))}.toasts-item{display:flex;gap:var(--pr-t-spacings-50);color:var(--components-toasts-color);padding:var(--pr-t-spacings-50);margin-block-end:var(--components-toasts-margin-bottom);background-color:var(--palettes-neutral-800);animation-name:toastsItem;animation-duration:var(--commons-animations-durations-standard);animation-iteration-count:1;border-radius:var(--pr-t-border-radius-structure);overflow:hidden;position:relative;transform-origin:top}@keyframes toastsItem{0%{transform:translateY(var(--pr-t-spacings-200));opacity:0}to{opacity:1}}.toasts-item:hover .toasts-item-kill,.toasts-item:focus-within .toasts-item-kill{animation-play-state:paused}.toast-item-icon{background:var(--palettes-700, var(--palettes-product-700));border-radius:var(--pr-t-border-radius-default);padding-block:var(--pr-t-spacings-100);padding-inline:var(--pr-t-spacings-50)}.toast-item-content{display:flex;flex-grow:1;flex-direction:column;gap:var(--pr-t-spacings-50);padding-block:var(--pr-t-spacings-100);padding-inline:var(--pr-t-spacings-100) 0}.toast-item-content-description{margin:0}.toasts-item-kill.button,.toasts-item-kill:not(.button){align-self:flex-start;border-radius:var(--pr-t-border-radius-default);animation-name:timer;--components-button-padding: var(--pr-t-spacings-100);--components-button-backgroundColor: transparent;--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-boxShadow: none}.toasts-item-kill.button:hover,.toasts-item-kill.button:focus-visible,.toasts-item-kill:not(.button):hover,.toasts-item-kill:not(.button):focus-visible{--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50))}.toasts-item-kill.button:active,.toasts-item-kill:not(.button):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.toasts-item-kill.button:disabled,.toasts-item-kill:not(.button):disabled{--components-button-backgroundColor: transparent;--components-button-color: var(--pr-t-color-text-disabled)}.toasts-item-kill.button,.toasts-item-kill:not(.button){--components-button-color: var(--palettes-neutral-0)}.toasts-item-kill.button:hover,.toasts-item-kill.button:focus-visible,.toasts-item-kill:not(.button):hover,.toasts-item-kill:not(.button):focus-visible{--components-button-color: var(--palettes-neutral-0);--components-button-backgroundColor: var(--palettes-neutral-900)}.toasts-item-kill.button:active,.toasts-item-kill:not(.button):active{--components-button-backgroundColor: var(--palettes-neutral-700)}@keyframes timer{}}@layer mods{.toasts.mod-bottom{--components-toasts-inset: auto var(--components-toasts-right) var(--components-toasts-bottom) auto}}\n"] }]
|
|
117
|
+
args: [{ selector: 'lu-toasts', changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, PortalDirective], template: "<div class=\"toasts\" aria-live=\"polite\" [class.mod-bottom]=\"bottom()\">\n\t@for (toast of toasts$ | async; track toast.id) {\n\t\t<div class=\"toasts-item\" [class]=\"paletteClassByToastType[toast.type]\">\n\t\t\t@if (toast.type) {\n\t\t\t\t<span class=\"toast-item-icon lucca-icon\" aria-hidden=\"true\" [class]=\"iconClassByToastType[toast.type]\"></span>\n\t\t\t}\n\t\t\t<div class=\"toast-item-content\">\n\t\t\t\t@if (toast.title) {\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ toast.title }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (isStringPortalContent(toast.message)) {\n\t\t\t\t\t<p class=\"toast-item-content-description\" [innerHtml]=\"toast.message\"></p>\n\t\t\t\t} @else {\n\t\t\t\t\t<ng-container *luPortal=\"toast.message\" />\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"toasts-item-kill button\"\n\t\t\t\t(click)=\"removeToast(toast)\"\n\t\t\t\t(animationend)=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? removeToast(toast) : null\"\n\t\t\t\t[style.animation-duration]=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? toast.duration + 'ms' : null\"\n\t\t\t>\n\t\t\t\t<span class=\"lucca-icon icon-signClose\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"pr-u-mask\">{{ intl().close }}</span>\n\t\t\t</button>\n\t\t</div>\n\t}\n</div>\n", styles: ["@layer components{.toasts{--components-toasts-color: var(--pr-t-color-text-reverse);--components-toasts-top: var(--pr-t-spacings-300);--components-toasts-right: calc(var(--pr-t-spacings-300) + var(--commons-pushPanel-inlineSize));--components-toasts-left: var(--pr-t-spacings-300);--components-toasts-bottom: var(--pr-t-spacings-300);--components-toasts-margin-bottom: var(--pr-t-spacings-50);--components-toasts-maxwidth: min(22.5rem, calc(100dvw - (var(--components-toasts-right) * 2)));--components-toasts-inset: var(--components-toasts-top) var(--components-toasts-right) auto auto;--components-toasts-footerHeight: 4.5rem;--components-toasts-background: var(--palettes-neutral-800);--components-toasts-padding: var(--pr-t-spacings-100) var(--pr-t-spacings-200);max-inline-size:var(--components-toasts-maxwidth);display:flex;flex-direction:column;align-items:flex-end;position:fixed;z-index:9999;inset:var(--components-toasts-inset)}html:has(.main-content .footer.mod-sticky,.dialog.mod-drawer .dialog-inside-footer) .toasts{--components-toasts-bottom: calc(var(--components-toasts-footerHeight) + var(--pr-t-spacings-300))}.toasts-item{display:flex;gap:var(--pr-t-spacings-50);color:var(--components-toasts-color);padding:var(--pr-t-spacings-50);margin-block-end:var(--components-toasts-margin-bottom);background-color:var(--palettes-neutral-800);animation-name:toastsItem;animation-duration:var(--commons-animations-durations-standard);animation-iteration-count:1;border-radius:var(--pr-t-border-radius-structure);overflow:hidden;position:relative;transform-origin:top}@keyframes toastsItem{0%{transform:translateY(var(--pr-t-spacings-200));opacity:0}to{opacity:1}}.toasts-item:hover .toasts-item-kill,.toasts-item:focus-within .toasts-item-kill{animation-play-state:paused}.toast-item-icon{background:var(--palettes-700, var(--palettes-product-700));border-radius:var(--pr-t-border-radius-default);padding-block:var(--pr-t-spacings-100);padding-inline:var(--pr-t-spacings-50)}.toast-item-content{display:flex;flex-grow:1;flex-direction:column;gap:var(--pr-t-spacings-50);padding-block:var(--pr-t-spacings-100);padding-inline:var(--pr-t-spacings-100) 0}.toast-item-content-description{margin:0;overflow-wrap:anywhere}.toasts-item-kill.button,.toasts-item-kill:not(.button){align-self:flex-start;border-radius:var(--pr-t-border-radius-default);animation-name:timer;--components-button-padding: var(--pr-t-spacings-100);--components-button-backgroundColor: transparent;--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-boxShadow: none}.toasts-item-kill.button:hover,.toasts-item-kill.button:focus-visible,.toasts-item-kill:not(.button):hover,.toasts-item-kill:not(.button):focus-visible{--components-button-color: var(--palettes-700, var(--pr-t-color-text-subtle));--components-button-backgroundColor: var(--palettes-50, var(--palettes-neutral-50))}.toasts-item-kill.button:active,.toasts-item-kill:not(.button):active{--components-button-backgroundColor: var(--palettes-100, var(--palettes-neutral-100))}.toasts-item-kill.button:disabled,.toasts-item-kill:not(.button):disabled{--components-button-backgroundColor: transparent;--components-button-color: var(--pr-t-color-text-disabled)}.toasts-item-kill.button,.toasts-item-kill:not(.button){--components-button-color: var(--palettes-neutral-0)}.toasts-item-kill.button:hover,.toasts-item-kill.button:focus-visible,.toasts-item-kill:not(.button):hover,.toasts-item-kill:not(.button):focus-visible{--components-button-color: var(--palettes-neutral-0);--components-button-backgroundColor: var(--palettes-neutral-900)}.toasts-item-kill.button:active,.toasts-item-kill:not(.button):active{--components-button-backgroundColor: var(--palettes-neutral-700)}@keyframes timer{}}@layer mods{.toasts.mod-bottom{--components-toasts-inset: auto var(--components-toasts-right) var(--components-toasts-bottom) auto}}\n"] }]
|
|
118
118
|
}], ctorParameters: () => [], propDecorators: { bottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "bottom", required: false }] }], sources: [{ type: i0.Input, args: [{ isSignal: true, alias: "sources", required: false }] }], intl: [{ type: i0.Input, args: [{ isSignal: true, alias: "intl", required: false }] }] } });
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
121
|
* @deprecated use `LuToastsComponent` instead
|
|
122
122
|
*/
|
|
123
123
|
class LuToastsModule {
|
|
124
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
125
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.
|
|
126
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.
|
|
124
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuToastsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
125
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.15", ngImport: i0, type: LuToastsModule, imports: [LuToastsComponent], exports: [LuToastsComponent] }); }
|
|
126
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuToastsModule }); }
|
|
127
127
|
}
|
|
128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuToastsModule, decorators: [{
|
|
129
129
|
type: NgModule,
|
|
130
130
|
args: [{
|
|
131
131
|
imports: [LuToastsComponent],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-toast.mjs","sources":["../../../packages/ng/toast/toasts.model.ts","../../../packages/ng/toast/toasts.service.ts","../../../packages/ng/toast/translations.ts","../../../packages/ng/toast/toasts.translate.ts","../../../packages/ng/toast/toasts.component.ts","../../../packages/ng/toast/toasts.component.html","../../../packages/ng/toast/toasts.module.ts","../../../packages/ng/toast/public-api.ts","../../../packages/ng/toast/lucca-front-ng-toast.ts"],"sourcesContent":["import { PortalContent } from '@lucca-front/ng/core';\n\nexport type LuToastType = 'Info' | 'Error' | 'Success' | 'Warning';\n\nexport const defaultToastDuration = 5000;\n\nexport interface LuToastInput {\n\t/**\n\t * InnerHTML supported.\n\t */\n\tmessage: PortalContent;\n\t/**\n\t * Bold title.\n\t * InnerHTML not supported.\n\t */\n\ttitle?: string;\n\ttype?: LuToastType;\n\t/**\n\t * Auto kill default duration is 5000ms.\n\t * Null means manual dismiss only.\n\t */\n\tduration?: number | null;\n}\n\nexport interface LuToast extends LuToastInput {\n\tid: string;\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { defaultToastDuration, LuToast, LuToastInput } from './toasts.model';\n\n@Injectable({ providedIn: 'root' })\nexport class LuToastsService {\n\tpublic toasts$ = new BehaviorSubject<LuToast[]>([]);\n\n\tpublic addToast(toastInput: LuToastInput): LuToast {\n\t\tconst toast = this.getToast(toastInput);\n\n\t\tthis.toasts$.next([...this.toasts$.value, toast]);\n\n\t\treturn toast;\n\t}\n\n\tpublic removeToast(toast: LuToast): void {\n\t\tconst updatedToasts = this.toasts$.value.filter(({ id }) => id !== toast.id);\n\t\tthis.toasts$.next(updatedToasts);\n\t}\n\n\tpublic isOnlyDismissibleManually({ duration }: LuToastInput): boolean {\n\t\treturn duration === null;\n\t}\n\n\tprivate getToast(toastInput: LuToastInput): LuToast {\n\t\tconst id = this.generateId();\n\t\tconst duration = this.isOnlyDismissibleManually(toastInput) ? toastInput.duration : (toastInput.duration ?? defaultToastDuration);\n\n\t\treturn { ...toastInput, id, duration };\n\t}\n\n\tprivate generateId(): string {\n\t\tconst randomString = Math.random().toString(36).substring(2, 9);\n\t\treturn `_${randomString}`;\n\t}\n}\n","export const Translations = {\n\tpt: {\n\t\tclose: 'Fechar',\n\t},\n\t'nl-BE': {\n\t\tclose: 'Sluiten',\n\t},\n\tnl: {\n\t\tclose: 'Sluiten',\n\t},\n\tit: {\n\t\tclose: 'Chiudere',\n\t},\n\tde: {\n\t\tclose: 'Schließen',\n\t},\n\tfr: {\n\t\tclose: 'Fermer',\n\t},\n\tes: {\n\t\tclose: 'Cerrar',\n\t},\n\ten: {\n\t\tclose: 'Close',\n\t},\n};\n","import { InjectionToken } from '@angular/core';\nimport { LuTranslation } from '@lucca-front/ng/core';\nimport { Translations } from './translations';\n\nexport const LU_TOAST_TRANSLATIONS = new InjectionToken('LuToastTranslations', {\n\tfactory: () => luToastTranslations,\n});\n\nexport interface ILuToastLabel {\n\tclose: string;\n}\n\nexport const luToastTranslations: LuTranslation<ILuToastLabel> = Translations;\n","import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';\nimport { intlInputOptions, isNotNil, PortalContent, PortalDirective, ɵeffectWithDeps } from '@lucca-front/ng/core';\nimport { merge, Observable } from 'rxjs';\nimport { LuToast, LuToastInput, LuToastType } from './toasts.model';\nimport { LuToastsService } from './toasts.service';\nimport { LU_TOAST_TRANSLATIONS } from './toasts.translate';\n\n@Component({\n\tselector: 'lu-toasts',\n\ttemplateUrl: './toasts.component.html',\n\tstyleUrl: './toasts.component.scss',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\timports: [AsyncPipe, PortalDirective],\n})\nexport class LuToastsComponent {\n\treadonly #toastsService = inject(LuToastsService);\n\n\treadonly bottom = input(false);\n\treadonly sources = input<Array<Observable<LuToastInput>>>();\n\n\tconstructor() {\n\t\tɵeffectWithDeps([this.sources], (sources, onCleanup) => {\n\t\t\tif (isNotNil(sources)) {\n\t\t\t\tconst sub = merge(...sources).subscribe((toast) => this.#toastsService.addToast(toast));\n\n\t\t\t\tonCleanup(() => {\n\t\t\t\t\tsub.unsubscribe();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\treadonly toasts$ = this.#toastsService.toasts$;\n\n\treadonly intl = input(...intlInputOptions(LU_TOAST_TRANSLATIONS));\n\n\treadonly iconClassByToastType: Record<LuToastType, string> = {\n\t\tInfo: 'icon-signInfo',\n\t\tSuccess: 'icon-signSuccess',\n\t\tError: 'icon-signError',\n\t\tWarning: 'icon-signWarning',\n\t};\n\n\treadonly paletteClassByToastType: Record<LuToastType, string> = {\n\t\tInfo: '',\n\t\tSuccess: 'palette-success',\n\t\tError: 'palette-error',\n\t\tWarning: 'palette-warning',\n\t};\n\n\tisStringPortalContent(message: PortalContent): message is string {\n\t\treturn typeof message === 'string';\n\t}\n\n\tremoveToast(toast: LuToast): void {\n\t\tthis.#toastsService.removeToast(toast);\n\t}\n\n\tisOnlyDismissibleManually(toast: LuToast): boolean {\n\t\treturn this.#toastsService.isOnlyDismissibleManually(toast);\n\t}\n}\n","<div class=\"toasts\" aria-live=\"polite\" [class.mod-bottom]=\"bottom()\">\n\t@for (toast of toasts$ | async; track toast.id) {\n\t\t<div class=\"toasts-item\" [class]=\"paletteClassByToastType[toast.type]\">\n\t\t\t@if (toast.type) {\n\t\t\t\t<span class=\"toast-item-icon lucca-icon\" aria-hidden=\"true\" [class]=\"iconClassByToastType[toast.type]\"></span>\n\t\t\t}\n\t\t\t<div class=\"toast-item-content\">\n\t\t\t\t@if (toast.title) {\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ toast.title }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (isStringPortalContent(toast.message)) {\n\t\t\t\t\t<p class=\"toast-item-content-description\" [innerHtml]=\"toast.message\"></p>\n\t\t\t\t} @else {\n\t\t\t\t\t<ng-container *luPortal=\"toast.message\" />\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"toasts-item-kill button\"\n\t\t\t\t(click)=\"removeToast(toast)\"\n\t\t\t\t(animationend)=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? removeToast(toast) : null\"\n\t\t\t\t[style.animation-duration]=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? toast.duration + 'ms' : null\"\n\t\t\t>\n\t\t\t\t<span class=\"lucca-icon icon-signClose\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"pr-u-mask\">{{ intl().close }}</span>\n\t\t\t</button>\n\t\t</div>\n\t}\n</div>\n","import { NgModule } from '@angular/core';\nimport { LuToastsComponent } from './toasts.component';\n\n/**\n * @deprecated use `LuToastsComponent` instead\n */\n@NgModule({\n\timports: [LuToastsComponent],\n\texports: [LuToastsComponent],\n})\nexport class LuToastsModule {}\n","/*\n * Public API Surface of toast\n */\n\nexport * from './toasts.component';\nexport * from './toasts.model';\nexport * from './toasts.module';\nexport * from './toasts.service';\nexport * from './toasts.translate';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ɵeffectWithDeps"],"mappings":";;;;;;AAIO,MAAM,oBAAoB,GAAG;;MCCvB,eAAe,CAAA;AAD5B,IAAA,WAAA,GAAA;AAEQ,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAAY,EAAE,CAAC;AA8BnD,IAAA;AA5BO,IAAA,QAAQ,CAAC,UAAwB,EAAA;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;AAEvC,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEjD,QAAA,OAAO,KAAK;IACb;AAEO,IAA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AAA,CAHhB,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;+GAEf,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC5B,iBAAA;;;ACTD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-toast.mjs","sources":["../../../packages/ng/toast/toasts.model.ts","../../../packages/ng/toast/toasts.service.ts","../../../packages/ng/toast/translations.ts","../../../packages/ng/toast/toasts.translate.ts","../../../packages/ng/toast/toasts.component.ts","../../../packages/ng/toast/toasts.component.html","../../../packages/ng/toast/toasts.module.ts","../../../packages/ng/toast/public-api.ts","../../../packages/ng/toast/lucca-front-ng-toast.ts"],"sourcesContent":["import { PortalContent } from '@lucca-front/ng/core';\n\nexport type LuToastType = 'Info' | 'Error' | 'Success' | 'Warning';\n\nexport const defaultToastDuration = 5000;\n\nexport interface LuToastInput {\n\t/**\n\t * InnerHTML supported.\n\t */\n\tmessage: PortalContent;\n\t/**\n\t * Bold title.\n\t * InnerHTML not supported.\n\t */\n\ttitle?: string;\n\ttype?: LuToastType;\n\t/**\n\t * Auto kill default duration is 5000ms.\n\t * Null means manual dismiss only.\n\t */\n\tduration?: number | null;\n}\n\nexport interface LuToast extends LuToastInput {\n\tid: string;\n}\n","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\nimport { defaultToastDuration, LuToast, LuToastInput } from './toasts.model';\n\n@Injectable({ providedIn: 'root' })\nexport class LuToastsService {\n\tpublic toasts$ = new BehaviorSubject<LuToast[]>([]);\n\n\tpublic addToast(toastInput: LuToastInput): LuToast {\n\t\tconst toast = this.getToast(toastInput);\n\n\t\tthis.toasts$.next([...this.toasts$.value, toast]);\n\n\t\treturn toast;\n\t}\n\n\tpublic removeToast(toast: LuToast): void {\n\t\tconst updatedToasts = this.toasts$.value.filter(({ id }) => id !== toast.id);\n\t\tthis.toasts$.next(updatedToasts);\n\t}\n\n\tpublic isOnlyDismissibleManually({ duration }: LuToastInput): boolean {\n\t\treturn duration === null;\n\t}\n\n\tprivate getToast(toastInput: LuToastInput): LuToast {\n\t\tconst id = this.generateId();\n\t\tconst duration = this.isOnlyDismissibleManually(toastInput) ? toastInput.duration : (toastInput.duration ?? defaultToastDuration);\n\n\t\treturn { ...toastInput, id, duration };\n\t}\n\n\tprivate generateId(): string {\n\t\tconst randomString = Math.random().toString(36).substring(2, 9);\n\t\treturn `_${randomString}`;\n\t}\n}\n","export const Translations = {\n\tpt: {\n\t\tclose: 'Fechar',\n\t},\n\t'nl-BE': {\n\t\tclose: 'Sluiten',\n\t},\n\tnl: {\n\t\tclose: 'Sluiten',\n\t},\n\tit: {\n\t\tclose: 'Chiudere',\n\t},\n\tde: {\n\t\tclose: 'Schließen',\n\t},\n\tfr: {\n\t\tclose: 'Fermer',\n\t},\n\tes: {\n\t\tclose: 'Cerrar',\n\t},\n\ten: {\n\t\tclose: 'Close',\n\t},\n};\n","import { InjectionToken } from '@angular/core';\nimport { LuTranslation } from '@lucca-front/ng/core';\nimport { Translations } from './translations';\n\nexport const LU_TOAST_TRANSLATIONS = new InjectionToken('LuToastTranslations', {\n\tfactory: () => luToastTranslations,\n});\n\nexport interface ILuToastLabel {\n\tclose: string;\n}\n\nexport const luToastTranslations: LuTranslation<ILuToastLabel> = Translations;\n","import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';\nimport { intlInputOptions, isNotNil, PortalContent, PortalDirective, ɵeffectWithDeps } from '@lucca-front/ng/core';\nimport { merge, Observable } from 'rxjs';\nimport { LuToast, LuToastInput, LuToastType } from './toasts.model';\nimport { LuToastsService } from './toasts.service';\nimport { LU_TOAST_TRANSLATIONS } from './toasts.translate';\n\n@Component({\n\tselector: 'lu-toasts',\n\ttemplateUrl: './toasts.component.html',\n\tstyleUrl: './toasts.component.scss',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\timports: [AsyncPipe, PortalDirective],\n})\nexport class LuToastsComponent {\n\treadonly #toastsService = inject(LuToastsService);\n\n\treadonly bottom = input(false);\n\treadonly sources = input<Array<Observable<LuToastInput>>>();\n\n\tconstructor() {\n\t\tɵeffectWithDeps([this.sources], (sources, onCleanup) => {\n\t\t\tif (isNotNil(sources)) {\n\t\t\t\tconst sub = merge(...sources).subscribe((toast) => this.#toastsService.addToast(toast));\n\n\t\t\t\tonCleanup(() => {\n\t\t\t\t\tsub.unsubscribe();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\treadonly toasts$ = this.#toastsService.toasts$;\n\n\treadonly intl = input(...intlInputOptions(LU_TOAST_TRANSLATIONS));\n\n\treadonly iconClassByToastType: Record<LuToastType, string> = {\n\t\tInfo: 'icon-signInfo',\n\t\tSuccess: 'icon-signSuccess',\n\t\tError: 'icon-signError',\n\t\tWarning: 'icon-signWarning',\n\t};\n\n\treadonly paletteClassByToastType: Record<LuToastType, string> = {\n\t\tInfo: '',\n\t\tSuccess: 'palette-success',\n\t\tError: 'palette-error',\n\t\tWarning: 'palette-warning',\n\t};\n\n\tisStringPortalContent(message: PortalContent): message is string {\n\t\treturn typeof message === 'string';\n\t}\n\n\tremoveToast(toast: LuToast): void {\n\t\tthis.#toastsService.removeToast(toast);\n\t}\n\n\tisOnlyDismissibleManually(toast: LuToast): boolean {\n\t\treturn this.#toastsService.isOnlyDismissibleManually(toast);\n\t}\n}\n","<div class=\"toasts\" aria-live=\"polite\" [class.mod-bottom]=\"bottom()\">\n\t@for (toast of toasts$ | async; track toast.id) {\n\t\t<div class=\"toasts-item\" [class]=\"paletteClassByToastType[toast.type]\">\n\t\t\t@if (toast.type) {\n\t\t\t\t<span class=\"toast-item-icon lucca-icon\" aria-hidden=\"true\" [class]=\"iconClassByToastType[toast.type]\"></span>\n\t\t\t}\n\t\t\t<div class=\"toast-item-content\">\n\t\t\t\t@if (toast.title) {\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ toast.title }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (isStringPortalContent(toast.message)) {\n\t\t\t\t\t<p class=\"toast-item-content-description\" [innerHtml]=\"toast.message\"></p>\n\t\t\t\t} @else {\n\t\t\t\t\t<ng-container *luPortal=\"toast.message\" />\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"toasts-item-kill button\"\n\t\t\t\t(click)=\"removeToast(toast)\"\n\t\t\t\t(animationend)=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? removeToast(toast) : null\"\n\t\t\t\t[style.animation-duration]=\"!isOnlyDismissibleManually(toast) && toast.duration > 0 ? toast.duration + 'ms' : null\"\n\t\t\t>\n\t\t\t\t<span class=\"lucca-icon icon-signClose\" aria-hidden=\"true\"></span>\n\t\t\t\t<span class=\"pr-u-mask\">{{ intl().close }}</span>\n\t\t\t</button>\n\t\t</div>\n\t}\n</div>\n","import { NgModule } from '@angular/core';\nimport { LuToastsComponent } from './toasts.component';\n\n/**\n * @deprecated use `LuToastsComponent` instead\n */\n@NgModule({\n\timports: [LuToastsComponent],\n\texports: [LuToastsComponent],\n})\nexport class LuToastsModule {}\n","/*\n * Public API Surface of toast\n */\n\nexport * from './toasts.component';\nexport * from './toasts.model';\nexport * from './toasts.module';\nexport * from './toasts.service';\nexport * from './toasts.translate';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["ɵeffectWithDeps"],"mappings":";;;;;;AAIO,MAAM,oBAAoB,GAAG;;MCCvB,eAAe,CAAA;AAD5B,IAAA,WAAA,GAAA;AAEQ,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAAY,EAAE,CAAC;AA8BnD,IAAA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SAAS,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,yzCAAA,EAAA,MAAA,EAAA,CAAA,o0HAAA,CAAA,EAAA;;;AEVtC;;AAEG;MAKU,cAAc,CAAA;+GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAd,cAAc,EAAA,OAAA,EAAA,CAHhB,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;gHAEf,cAAc,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC5B,iBAAA;;;ACTD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -29,8 +29,8 @@ class LuTooltipPanelComponent {
|
|
|
29
29
|
this.destroyRef = inject(DestroyRef);
|
|
30
30
|
this.mouseEnter$ = new Subject();
|
|
31
31
|
this.mouseLeave$ = new Subject();
|
|
32
|
-
this.content = signal(null, ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
33
|
-
this.contentPositionClasses = signal({}, ...(ngDevMode ? [{ debugName: "contentPositionClasses" }] : []));
|
|
32
|
+
this.content = signal(null, ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
33
|
+
this.contentPositionClasses = signal({}, ...(ngDevMode ? [{ debugName: "contentPositionClasses" }] : /* istanbul ignore next */ []));
|
|
34
34
|
}
|
|
35
35
|
setPanelPosition(posX, posY) {
|
|
36
36
|
this.contentPositionClasses.set({
|
|
@@ -40,10 +40,10 @@ class LuTooltipPanelComponent {
|
|
|
40
40
|
'is-below': posY === 'top',
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
44
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
44
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: LuTooltipPanelComponent, isStandalone: true, selector: "lu-tooltip-panel", host: { attributes: { "role": "tooltip" }, listeners: { "mouseenter": "mouseEnter$.next()", "mouseleave": "mouseLeave$.next()" } }, ngImport: i0, template: "@if (content(); as content) {\n\t<div class=\"tooltip\" [class]=\"contentPositionClasses()\" [innerHtml]=\"content\"></div>\n}\n", styles: ["@layer components{.tooltip{--components-tooltip-background-color: var(--palettes-neutral-900);--components-tooltip-color: var(--pr-t-color-text-reverse);--components-tooltip-max-width: 15rem;--components-tooltip-transformOrigin: center;--components-tooltip-margin: 0;background-color:var(--components-tooltip-background-color);color:var(--components-tooltip-color);padding-block:var(--pr-t-spacings-50);padding-inline:var(--pr-t-spacings-100);max-inline-size:var(--components-tooltip-max-width);border-radius:var(--pr-t-border-radius-default);font:var(--pr-t-font-body-XS);transform-origin:var(--components-tooltip-transformOrigin);margin:var(--components-tooltip-margin);text-align:center;inline-size:fit-content;animation-name:scaleIn;animation-duration:var(--commons-animations-durations-fast);animation-iteration-count:1;overflow-wrap:break-word}@keyframes scaleIn{0%{transform:scale(0)}to{transform:scale(1)}}.tooltip:empty{display:none}@supports (background-image: -webkit-named-image(i)){@media(hover:hover){[luTooltipWhenEllipsis]:after{content:\"\";display:block}}}}@layer mods{.tooltip.is-above{--components-tooltip-transformOrigin: bottom center}.tooltip.is-below{--components-tooltip-transformOrigin: top center}.tooltip.is-before{--components-tooltip-transformOrigin: center right}.tooltip.is-before.is-above{--components-tooltip-transformOrigin: bottom right}.tooltip.is-before.is-below{--components-tooltip-transformOrigin: top right}.tooltip.is-after{--components-tooltip-transformOrigin: center left}.tooltip.is-after.is-above{--components-tooltip-transformOrigin: bottom left}.tooltip.is-after.is-below{--components-tooltip-transformOrigin: top left}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
45
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipPanelComponent, decorators: [{
|
|
47
47
|
type: Component,
|
|
48
48
|
args: [{ selector: 'lu-tooltip-panel', host: {
|
|
49
49
|
role: 'tooltip',
|
|
@@ -111,10 +111,10 @@ class EllipsisRuler {
|
|
|
111
111
|
#nextFrame() {
|
|
112
112
|
return new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
113
113
|
}
|
|
114
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
115
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: EllipsisRuler, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
115
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: EllipsisRuler, providedIn: 'root' }); }
|
|
116
116
|
}
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: EllipsisRuler, decorators: [{
|
|
118
118
|
type: Injectable,
|
|
119
119
|
args: [{ providedIn: 'root' }]
|
|
120
120
|
}], ctorParameters: () => [] });
|
|
@@ -140,33 +140,33 @@ class LuTooltipTriggerDirective {
|
|
|
140
140
|
this.#ruler = inject(EllipsisRuler);
|
|
141
141
|
this.#injector = inject(Injector);
|
|
142
142
|
this.#destroyRef = inject(DestroyRef);
|
|
143
|
-
this.luTooltipInput = input('', { ...(ngDevMode ? { debugName: "luTooltipInput" } : {}), alias: 'luTooltip' });
|
|
144
|
-
this.luTooltip = linkedSignal(() => this.luTooltipInput(), ...(ngDevMode ? [{ debugName: "luTooltip" }] : []));
|
|
145
|
-
this.luTooltipEnterDelay = input(300, { ...(ngDevMode ? { debugName: "luTooltipEnterDelay" } : {}), transform: numberAttribute });
|
|
146
|
-
this.luTooltipLeaveDelay = input(100, { ...(ngDevMode ? { debugName: "luTooltipLeaveDelay" } : {}), transform: numberAttribute });
|
|
147
|
-
this.luTooltipDisabled = input(false, { ...(ngDevMode ? { debugName: "luTooltipDisabled" } : {}), transform: booleanAttribute });
|
|
148
|
-
this.luTooltipOnlyForDisplay = input(false, { ...(ngDevMode ? { debugName: "luTooltipOnlyForDisplay" } : {}), transform: booleanAttribute });
|
|
149
|
-
this.luTooltipPosition = input('above', ...(ngDevMode ? [{ debugName: "luTooltipPosition" }] : []));
|
|
150
|
-
this.luTooltipWhenEllipsisInput = input(false, { ...(ngDevMode ? { debugName: "luTooltipWhenEllipsisInput" } : {}), alias: 'luTooltipWhenEllipsis', transform: booleanAttribute });
|
|
151
|
-
this.luTooltipWhenEllipsis = linkedSignal(() => this.luTooltipWhenEllipsisInput(), ...(ngDevMode ? [{ debugName: "luTooltipWhenEllipsis" }] : []));
|
|
152
|
-
this.luTooltipAnchor = input(this.#host, ...(ngDevMode ? [{ debugName: "luTooltipAnchor" }] : []));
|
|
153
|
-
this.id = input(`${this.#host.nativeElement.tagName.toLowerCase()}-tooltip-${nextId++}`, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
143
|
+
this.luTooltipInput = input('', { ...(ngDevMode ? { debugName: "luTooltipInput" } : /* istanbul ignore next */ {}), alias: 'luTooltip' });
|
|
144
|
+
this.luTooltip = linkedSignal(() => this.luTooltipInput(), ...(ngDevMode ? [{ debugName: "luTooltip" }] : /* istanbul ignore next */ []));
|
|
145
|
+
this.luTooltipEnterDelay = input(300, { ...(ngDevMode ? { debugName: "luTooltipEnterDelay" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
146
|
+
this.luTooltipLeaveDelay = input(100, { ...(ngDevMode ? { debugName: "luTooltipLeaveDelay" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
147
|
+
this.luTooltipDisabled = input(false, { ...(ngDevMode ? { debugName: "luTooltipDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
148
|
+
this.luTooltipOnlyForDisplay = input(false, { ...(ngDevMode ? { debugName: "luTooltipOnlyForDisplay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
149
|
+
this.luTooltipPosition = input('above', ...(ngDevMode ? [{ debugName: "luTooltipPosition" }] : /* istanbul ignore next */ []));
|
|
150
|
+
this.luTooltipWhenEllipsisInput = input(false, { ...(ngDevMode ? { debugName: "luTooltipWhenEllipsisInput" } : /* istanbul ignore next */ {}), alias: 'luTooltipWhenEllipsis', transform: booleanAttribute });
|
|
151
|
+
this.luTooltipWhenEllipsis = linkedSignal(() => this.luTooltipWhenEllipsisInput(), ...(ngDevMode ? [{ debugName: "luTooltipWhenEllipsis" }] : /* istanbul ignore next */ []));
|
|
152
|
+
this.luTooltipAnchor = input(this.#host, ...(ngDevMode ? [{ debugName: "luTooltipAnchor" }] : /* istanbul ignore next */ []));
|
|
153
|
+
this.id = input(`${this.#host.nativeElement.tagName.toLowerCase()}-tooltip-${nextId++}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
154
154
|
this.ariaDescribedBy = computed(() => {
|
|
155
155
|
if (this.luTooltipDisabled() || this.luTooltipWhenEllipsis() || this.luTooltipOnlyForDisplay()) {
|
|
156
156
|
return null;
|
|
157
157
|
}
|
|
158
158
|
return `${this.id()}-panel`;
|
|
159
|
-
}, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : []));
|
|
160
|
-
this.#isVisible = signal(false, ...(ngDevMode ? [{ debugName: "#isVisible" }] : []));
|
|
161
|
-
this.#ellipsisTrigger = signal(0, ...(ngDevMode ? [{ debugName: "#ellipsisTrigger" }] : []));
|
|
159
|
+
}, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
160
|
+
this.#isVisible = signal(false, ...(ngDevMode ? [{ debugName: "#isVisible" }] : /* istanbul ignore next */ []));
|
|
161
|
+
this.#ellipsisTrigger = signal(0, ...(ngDevMode ? [{ debugName: "#ellipsisTrigger" }] : /* istanbul ignore next */ []));
|
|
162
162
|
this.#hasEllipsis = toSignal(toObservable(this.#ellipsisTrigger).pipe(debounceTime(150), switchMap(() => {
|
|
163
163
|
if (!this.luTooltipWhenEllipsis() || this.luTooltipDisabled()) {
|
|
164
164
|
return of(false);
|
|
165
165
|
}
|
|
166
166
|
return from(this.#ruler.hasEllipsis(this.#host.nativeElement));
|
|
167
167
|
})), { initialValue: false });
|
|
168
|
-
this.#action = signal(null, ...(ngDevMode ? [{ debugName: "#action" }] : []));
|
|
169
|
-
this.#realAction = linkedSignal({ ...(ngDevMode ? { debugName: "#realAction" } : {}), source: this.#action,
|
|
168
|
+
this.#action = signal(null, ...(ngDevMode ? [{ debugName: "#action" }] : /* istanbul ignore next */ []));
|
|
169
|
+
this.#realAction = linkedSignal({ ...(ngDevMode ? { debugName: "#realAction" } : /* istanbul ignore next */ {}), source: this.#action,
|
|
170
170
|
computation: (action, previous) => {
|
|
171
171
|
if (!action || action === 'close') {
|
|
172
172
|
return action;
|
|
@@ -415,10 +415,10 @@ class LuTooltipTriggerDirective {
|
|
|
415
415
|
}
|
|
416
416
|
return x;
|
|
417
417
|
}
|
|
418
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
419
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
418
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
419
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.15", type: LuTooltipTriggerDirective, isStandalone: true, selector: "[luTooltip]", inputs: { luTooltipInput: { classPropertyName: "luTooltipInput", publicName: "luTooltip", isSignal: true, isRequired: false, transformFunction: null }, luTooltipEnterDelay: { classPropertyName: "luTooltipEnterDelay", publicName: "luTooltipEnterDelay", isSignal: true, isRequired: false, transformFunction: null }, luTooltipLeaveDelay: { classPropertyName: "luTooltipLeaveDelay", publicName: "luTooltipLeaveDelay", isSignal: true, isRequired: false, transformFunction: null }, luTooltipDisabled: { classPropertyName: "luTooltipDisabled", publicName: "luTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, luTooltipOnlyForDisplay: { classPropertyName: "luTooltipOnlyForDisplay", publicName: "luTooltipOnlyForDisplay", isSignal: true, isRequired: false, transformFunction: null }, luTooltipPosition: { classPropertyName: "luTooltipPosition", publicName: "luTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, luTooltipWhenEllipsisInput: { classPropertyName: "luTooltipWhenEllipsisInput", publicName: "luTooltipWhenEllipsis", isSignal: true, isRequired: false, transformFunction: null }, luTooltipAnchor: { classPropertyName: "luTooltipAnchor", publicName: "luTooltipAnchor", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focus": "onFocus()", "blur": "onBlur()" }, properties: { "attr.aria-describedby": "ariaDescribedBy()", "attr.id": "id()" } }, exportAs: ["luTooltip"], ngImport: i0 }); }
|
|
420
420
|
}
|
|
421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipTriggerDirective, decorators: [{
|
|
422
422
|
type: Directive,
|
|
423
423
|
args: [{
|
|
424
424
|
selector: '[luTooltip]',
|
|
@@ -438,11 +438,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
438
438
|
* @deprecated use `LuTooltipTriggerDirective, OverlayModule` instead
|
|
439
439
|
*/
|
|
440
440
|
class LuTooltipTriggerModule {
|
|
441
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
442
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.
|
|
443
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.
|
|
441
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipTriggerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
442
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipTriggerModule, imports: [LuTooltipTriggerDirective, OverlayModule], exports: [LuTooltipTriggerDirective] }); }
|
|
443
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipTriggerModule, imports: [OverlayModule] }); }
|
|
444
444
|
}
|
|
445
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
445
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipTriggerModule, decorators: [{
|
|
446
446
|
type: NgModule,
|
|
447
447
|
args: [{
|
|
448
448
|
imports: [LuTooltipTriggerDirective, OverlayModule],
|
|
@@ -454,11 +454,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
454
454
|
* @deprecated use `LuTooltipTriggerDirective, OverlayModule, LuTooltipPanelComponent` instead
|
|
455
455
|
*/
|
|
456
456
|
class LuTooltipModule {
|
|
457
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
458
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.
|
|
459
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.
|
|
457
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
458
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipModule, imports: [LuTooltipTriggerModule, LuTooltipPanelComponent], exports: [LuTooltipTriggerModule, LuTooltipPanelComponent] }); }
|
|
459
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipModule, imports: [LuTooltipTriggerModule, LuTooltipTriggerModule] }); }
|
|
460
460
|
}
|
|
461
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: LuTooltipModule, decorators: [{
|
|
462
462
|
type: NgModule,
|
|
463
463
|
args: [{
|
|
464
464
|
imports: [LuTooltipTriggerModule, LuTooltipPanelComponent],
|