@siemens/element-ng 49.16.0 → 51.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/fesm2022/siemens-element-ng-about.mjs +41 -25
- package/fesm2022/siemens-element-ng-about.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-accordion.mjs +59 -41
- package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-action-modal.mjs +83 -53
- package/fesm2022/siemens-element-ng-action-modal.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ag-grid.mjs +143 -148
- package/fesm2022/siemens-element-ng-ag-grid.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-application-header.mjs +180 -188
- package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-auto-collapsable-list.mjs +34 -28
- package/fesm2022/siemens-element-ng-auto-collapsable-list.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-autocomplete.mjs +27 -22
- package/fesm2022/siemens-element-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-avatar.mjs +34 -24
- package/fesm2022/siemens-element-ng-avatar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-badge.mjs +9 -8
- package/fesm2022/siemens-element-ng-badge.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-breadcrumb-router.mjs +17 -14
- package/fesm2022/siemens-element-ng-breadcrumb-router.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-breadcrumb.mjs +21 -17
- package/fesm2022/siemens-element-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-card.mjs +72 -47
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-carousel.mjs +58 -34
- package/fesm2022/siemens-element-ng-carousel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +323 -215
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-circle-status.mjs +39 -25
- package/fesm2022/siemens-element-ng-circle-status.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-color-picker.mjs +44 -34
- package/fesm2022/siemens-element-ng-color-picker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs +58 -37
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-common.mjs +22 -22
- package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-connection-strength.mjs +14 -12
- package/fesm2022/siemens-element-ng-connection-strength.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-content-action-bar.mjs +37 -28
- package/fesm2022/siemens-element-ng-content-action-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-copyright-notice.mjs +19 -14
- package/fesm2022/siemens-element-ng-copyright-notice.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-dashboard.mjs +337 -223
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datatable.mjs +12 -15
- package/fesm2022/siemens-element-ng-datatable.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +126 -76
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datepicker.mjs +393 -251
- package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-electron-titlebar.mjs +22 -17
- package/fesm2022/siemens-element-ng-electron-titlebar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-empty-state.mjs +15 -12
- package/fesm2022/siemens-element-ng-empty-state.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-file-uploader.mjs +105 -91
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filter-bar.mjs +33 -25
- package/fesm2022/siemens-element-ng-filter-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +274 -165
- package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-footer.mjs +12 -10
- package/fesm2022/siemens-element-ng-footer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-form.mjs +361 -116
- package/fesm2022/siemens-element-ng-form.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-formly-legacy.mjs +99 -0
- package/fesm2022/siemens-element-ng-formly-legacy.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-formly.mjs +224 -318
- package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-header-dropdown.mjs +40 -30
- package/fesm2022/siemens-element-ng-header-dropdown.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-help-button.mjs +6 -6
- package/fesm2022/siemens-element-ng-help-button.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-icon.mjs +56 -57
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-info-page.mjs +17 -11
- package/fesm2022/siemens-element-ng-info-page.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-inline-notification.mjs +19 -14
- package/fesm2022/siemens-element-ng-inline-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ip-input.mjs +19 -15
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-landing-page.mjs +121 -75
- package/fesm2022/siemens-element-ng-landing-page.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-language-switcher.mjs +16 -12
- package/fesm2022/siemens-element-ng-language-switcher.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-link.mjs +31 -21
- package/fesm2022/siemens-element-ng-link.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-list-details.mjs +132 -66
- package/fesm2022/siemens-element-ng-list-details.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-loading-spinner.mjs +51 -64
- package/fesm2022/siemens-element-ng-loading-spinner.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-localization.mjs +14 -12
- package/fesm2022/siemens-element-ng-localization.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-main-detail-container.mjs +116 -51
- package/fesm2022/siemens-element-ng-main-detail-container.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-maplibre.mjs +401 -0
- package/fesm2022/siemens-element-ng-maplibre.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-markdown-directives-tabs.mjs +70 -0
- package/fesm2022/siemens-element-ng-markdown-directives-tabs.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-markdown-extensions-citations.mjs +215 -0
- package/fesm2022/siemens-element-ng-markdown-extensions-citations.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-markdown-extensions-katex.mjs +76 -0
- package/fesm2022/siemens-element-ng-markdown-extensions-katex.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-markdown-extensions-mermaid.mjs +86 -0
- package/fesm2022/siemens-element-ng-markdown-extensions-mermaid.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-markdown-hightlighter-highlightjs.mjs +130 -0
- package/fesm2022/siemens-element-ng-markdown-hightlighter-highlightjs.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-markdown.mjs +800 -0
- package/fesm2022/siemens-element-ng-markdown.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-menu.mjs +71 -57
- package/fesm2022/siemens-element-ng-menu.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-modal.mjs +14 -11
- package/fesm2022/siemens-element-ng-modal.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical-next.mjs +251 -206
- package/fesm2022/siemens-element-ng-navbar-vertical-next.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs +123 -86
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar.mjs +72 -45
- package/fesm2022/siemens-element-ng-navbar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-notification-item.mjs +19 -11
- package/fesm2022/siemens-element-ng-notification-item.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-number-input.mjs +41 -29
- package/fesm2022/siemens-element-ng-number-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-pagination.mjs +31 -20
- package/fesm2022/siemens-element-ng-pagination.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-password-strength.mjs +33 -24
- package/fesm2022/siemens-element-ng-password-strength.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-password-toggle.mjs +19 -14
- package/fesm2022/siemens-element-ng-password-toggle.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-phone-number.mjs +144 -139
- package/fesm2022/siemens-element-ng-phone-number.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-photo-upload.mjs +85 -52
- package/fesm2022/siemens-element-ng-photo-upload.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-pills-input.mjs +56 -41
- package/fesm2022/siemens-element-ng-pills-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-popover-legacy.mjs +43 -28
- package/fesm2022/siemens-element-ng-popover-legacy.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-popover.mjs +35 -27
- package/fesm2022/siemens-element-ng-popover.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-progressbar.mjs +23 -16
- package/fesm2022/siemens-element-ng-progressbar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-resize-observer.mjs +32 -43
- package/fesm2022/siemens-element-ng-resize-observer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-result-details-list.mjs +12 -10
- package/fesm2022/siemens-element-ng-result-details-list.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-search-bar.mjs +38 -37
- package/fesm2022/siemens-element-ng-search-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-select.mjs +265 -170
- package/fesm2022/siemens-element-ng-select.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-shadow-root.mjs +4 -4
- package/fesm2022/siemens-element-ng-shadow-root.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-side-panel.mjs +181 -104
- package/fesm2022/siemens-element-ng-side-panel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-skip-links.mjs +21 -24
- package/fesm2022/siemens-element-ng-skip-links.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-slider.mjs +45 -30
- package/fesm2022/siemens-element-ng-slider.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-source-chip.mjs +79 -0
- package/fesm2022/siemens-element-ng-source-chip.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-split.mjs +290 -306
- package/fesm2022/siemens-element-ng-split.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-bar.mjs +66 -52
- package/fesm2022/siemens-element-ng-status-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-counter.mjs +15 -11
- package/fesm2022/siemens-element-ng-status-counter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-toggle.mjs +26 -16
- package/fesm2022/siemens-element-ng-status-toggle.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-summary-chip.mjs +25 -16
- package/fesm2022/siemens-element-ng-summary-chip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-summary-widget.mjs +27 -17
- package/fesm2022/siemens-element-ng-summary-widget.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-system-banner.mjs +13 -10
- package/fesm2022/siemens-element-ng-system-banner.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs +20 -17
- package/fesm2022/siemens-element-ng-tabs-legacy.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tabs.mjs +156 -131
- package/fesm2022/siemens-element-ng-tabs.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-theme.mjs +29 -6
- package/fesm2022/siemens-element-ng-theme.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-threshold.mjs +62 -42
- package/fesm2022/siemens-element-ng-threshold.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-toast-notification.mjs +59 -40
- package/fesm2022/siemens-element-ng-toast-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tooltip.mjs +108 -82
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tour.mjs +36 -19
- package/fesm2022/siemens-element-ng-tour.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs +0 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +113 -84
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-typeahead.mjs +69 -49
- package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-wizard.mjs +95 -54
- package/fesm2022/siemens-element-ng-wizard.mjs.map +1 -1
- package/formly-legacy/package.json +4 -0
- package/maplibre/package.json +4 -0
- package/maplibre/styles/_index.scss +1 -0
- package/maplibre/styles/maplibre-gl.scss +724 -0
- package/markdown/directives/tabs/package.json +4 -0
- package/markdown/extensions/citations/package.json +4 -0
- package/markdown/extensions/katex/package.json +4 -0
- package/markdown/extensions/mermaid/package.json +4 -0
- package/markdown/hightlighter/highlightjs/package.json +4 -0
- package/markdown/package.json +4 -0
- package/package.json +96 -25
- package/schematics/collection.json +5 -0
- package/schematics/{migrations/icon-path-migration → migrate-tabs-legacy}/index.js +1 -1
- package/schematics/migrate-tabs-legacy/migrate-tabs-legacy-rule.js +675 -0
- package/schematics/migrate-tabs-legacy/schema.json +14 -0
- package/schematics/migration.json +4 -4
- package/schematics/migrations/data/class-member-replacement.js +1 -19
- package/schematics/migrations/data/component-property-names.js +1 -25
- package/schematics/migrations/data/component-property-to-child.js +11 -0
- package/schematics/migrations/data/css-custom-properties.js +224 -0
- package/schematics/migrations/data/element-class-changes.js +116 -18
- package/schematics/migrations/data/element-migration-data.js +6 -0
- package/schematics/migrations/data/element-selectors.js +1 -9
- package/schematics/migrations/data/index.js +0 -4
- package/schematics/migrations/data/migration-test-data.js +49 -6
- package/schematics/migrations/data/provider-function-removals.js +7 -0
- package/schematics/migrations/data/symbol-removals.js +17 -7
- package/schematics/migrations/data/symbol-renaming.js +3 -44
- package/schematics/migrations/element-migration/element-migration.js +6 -6
- package/schematics/migrations/utilities/component-property-to-child.migration.js +73 -0
- package/schematics/migrations/utilities/css-custom-property.migration.js +51 -0
- package/schematics/migrations/utilities/element-class-change.migration.js +10 -5
- package/schematics/migrations/utilities/import-removal.js +39 -0
- package/schematics/migrations/utilities/index.js +4 -0
- package/schematics/migrations/utilities/provider-function-removal.migration.js +116 -0
- package/schematics/ng-update/index.js +1 -1
- package/schematics/ng-update/migrate-content-formatter.js +288 -0
- package/schematics/ng-update/migrate-list-details-units.js +86 -0
- package/schematics/ng-update/migrate-main-detail-units.js +89 -0
- package/schematics/ng-update/migrate-markdown-renderer.js +106 -0
- package/schematics/ng-update/migrate-spacers.js +32 -0
- package/schematics/ng-update/migrate-split-collapse.js +276 -0
- package/schematics/ng-update/migrate-split-scale.js +524 -0
- package/schematics/ng-update/migrate-split-sizes.js +107 -0
- package/schematics/ng-update/migrate-to-v51.js +35 -0
- package/schematics/utils/index.js +1 -0
- package/schematics/utils/template-edit-utils.js +35 -0
- package/schematics/utils/template-utils.js +31 -45
- package/source-chip/package.json +4 -0
- package/template-i18n.json +78 -47
- package/types/siemens-element-ng-application-header.d.ts +7 -33
- package/types/siemens-element-ng-avatar.d.ts +1 -1
- package/types/siemens-element-ng-breadcrumb.d.ts +1 -1
- package/types/siemens-element-ng-chat-messages.d.ts +118 -70
- package/types/siemens-element-ng-circle-status.d.ts +1 -1
- package/types/siemens-element-ng-content-action-bar.d.ts +1 -1
- package/types/siemens-element-ng-dashboard.d.ts +2 -2
- package/types/siemens-element-ng-datatable.d.ts +5 -56
- package/types/siemens-element-ng-date-range-filter.d.ts +1 -1
- package/types/siemens-element-ng-datepicker.d.ts +8 -15
- package/types/siemens-element-ng-electron-titlebar.d.ts +1 -1
- package/types/siemens-element-ng-file-uploader.d.ts +13 -31
- package/types/siemens-element-ng-filter-bar.d.ts +1 -1
- package/types/siemens-element-ng-filtered-search.d.ts +4 -4
- package/types/siemens-element-ng-form.d.ts +183 -44
- package/types/siemens-element-ng-formly-legacy.d.ts +40 -0
- package/types/siemens-element-ng-formly.d.ts +34 -167
- package/types/siemens-element-ng-icon.d.ts +2 -19
- package/types/siemens-element-ng-landing-page.d.ts +2 -2
- package/types/siemens-element-ng-list-details.d.ts +25 -3
- package/types/siemens-element-ng-loading-spinner.d.ts +11 -17
- package/types/siemens-element-ng-main-detail-container.d.ts +23 -3
- package/types/siemens-element-ng-maplibre.d.ts +190 -0
- package/types/siemens-element-ng-markdown-directives-tabs.d.ts +10 -0
- package/types/siemens-element-ng-markdown-extensions-citations.d.ts +11 -0
- package/types/siemens-element-ng-markdown-extensions-katex.d.ts +19 -0
- package/types/siemens-element-ng-markdown-extensions-mermaid.d.ts +11 -0
- package/types/siemens-element-ng-markdown-hightlighter-highlightjs.d.ts +48 -0
- package/types/siemens-element-ng-markdown.d.ts +367 -0
- package/types/siemens-element-ng-menu.d.ts +2 -0
- package/types/siemens-element-ng-navbar-vertical-next.d.ts +87 -39
- package/types/siemens-element-ng-navbar-vertical.d.ts +1 -1
- package/types/siemens-element-ng-navbar.d.ts +3 -3
- package/types/siemens-element-ng-notification-item.d.ts +12 -0
- package/types/siemens-element-ng-phone-number.d.ts +28 -10
- package/types/siemens-element-ng-photo-upload.d.ts +4 -4
- package/types/siemens-element-ng-resize-observer.d.ts +0 -17
- package/types/siemens-element-ng-search-bar.d.ts +2 -9
- package/types/siemens-element-ng-select.d.ts +32 -5
- package/types/siemens-element-ng-side-panel.d.ts +25 -11
- package/types/siemens-element-ng-source-chip.d.ts +53 -0
- package/types/siemens-element-ng-split.d.ts +101 -78
- package/types/siemens-element-ng-status-bar.d.ts +5 -13
- package/types/siemens-element-ng-status-counter.d.ts +1 -1
- package/types/siemens-element-ng-system-banner.d.ts +2 -2
- package/types/siemens-element-ng-tabs.d.ts +1 -2
- package/types/siemens-element-ng-theme.d.ts +12 -2
- package/types/siemens-element-ng-threshold.d.ts +1 -1
- package/types/siemens-element-ng-toast-notification.d.ts +0 -1
- package/types/siemens-element-ng-tooltip.d.ts +7 -7
- package/types/siemens-element-ng-translate.d.ts +35 -5
- package/types/siemens-element-ng-tree-view.d.ts +3 -0
- package/types/siemens-element-ng-wizard.d.ts +18 -3
- package/fesm2022/siemens-element-ng-icon-status.mjs +0 -46
- package/fesm2022/siemens-element-ng-icon-status.mjs.map +0 -1
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs +0 -263
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs.map +0 -1
- package/fesm2022/siemens-element-ng-sort-bar.mjs +0 -99
- package/fesm2022/siemens-element-ng-sort-bar.mjs.map +0 -1
- package/icon-status/package.json +0 -4
- package/markdown-renderer/package.json +0 -4
- package/schematics/migrations/icon-path-migration/icon-path-migration.js +0 -95
- package/schematics/ng-update/migrate-to-v49.js +0 -21
- package/schematics/vitest-setup.js +0 -5
- package/sort-bar/package.json +0 -4
- package/types/siemens-element-ng-icon-status.d.ts +0 -25
- package/types/siemens-element-ng-markdown-renderer.d.ts +0 -36
- package/types/siemens-element-ng-sort-bar.d.ts +0 -59
- /package/{LICENSE.md → LICENSE} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Component, input, booleanAttribute, model, viewChild, signal, computed, inject } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
import { elementStateExclamationMark, elementCircleFilled, elementCancel } from '@siemens/element-icons';
|
|
@@ -15,12 +15,12 @@ import { ImageCropperComponent } from 'ngx-image-cropper';
|
|
|
15
15
|
* SPDX-License-Identifier: MIT
|
|
16
16
|
*/
|
|
17
17
|
class SiImageCropperStyleComponent {
|
|
18
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
19
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiImageCropperStyleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: SiImageCropperStyleComponent, isStandalone: true, selector: "si-image-cropper-style", ngImport: i0, template: '<ng-content />', isInline: true, styles: [":host ::ng-deep image-cropper{max-block-size:70vb;--image-cropper-outline-color: var(--si-sys-effects-backdrop);--cropper-outline-color: var(--image-cropper-outline-color);--cropper-overlay-color: var(--si-sys-text-inverse)}:host ::ng-deep image-cropper .ngx-ic-square{background:var(--si-sys-border-accent)!important}:host ::ng-deep image-cropper .ngx-ic-cropper.ngx-ic-cropper{outline:2px solid var(--si-sys-border-accent)!important}:host ::ng-deep image-cropper .ngx-ic-cropper.ngx-ic-cropper:after{z-index:0;border:unset;box-shadow:0 0 0 9999px var(--cropper-outline-color)}:host ::ng-deep image-cropper .ngx-ic-cropper.ngx-ic-cropper .ngx-ic-move.ngx-ic-move{position:relative;overflow:hidden;border:0}\n"] });
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiImageCropperStyleComponent, decorators: [{
|
|
22
22
|
type: Component,
|
|
23
|
-
args: [{ selector: 'si-image-cropper-style', template: '<ng-content />',
|
|
23
|
+
args: [{ selector: 'si-image-cropper-style', template: '<ng-content />', styles: [":host ::ng-deep image-cropper{max-block-size:70vb;--image-cropper-outline-color: var(--si-sys-effects-backdrop);--cropper-outline-color: var(--image-cropper-outline-color);--cropper-overlay-color: var(--si-sys-text-inverse)}:host ::ng-deep image-cropper .ngx-ic-square{background:var(--si-sys-border-accent)!important}:host ::ng-deep image-cropper .ngx-ic-cropper.ngx-ic-cropper{outline:2px solid var(--si-sys-border-accent)!important}:host ::ng-deep image-cropper .ngx-ic-cropper.ngx-ic-cropper:after{z-index:0;border:unset;box-shadow:0 0 0 9999px var(--cropper-outline-color)}:host ::ng-deep image-cropper .ngx-ic-cropper.ngx-ic-cropper .ngx-ic-move.ngx-ic-move{position:relative;overflow:hidden;border:0}\n"] }]
|
|
24
24
|
}] });
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -41,13 +41,13 @@ class SiPhotoUploadComponent {
|
|
|
41
41
|
*
|
|
42
42
|
* @defaultValue false
|
|
43
43
|
*/
|
|
44
|
-
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : {}), transform: booleanAttribute });
|
|
44
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
45
45
|
/**
|
|
46
46
|
* Optionally disable image cropping.
|
|
47
47
|
*
|
|
48
48
|
* @defaultValue false
|
|
49
49
|
*/
|
|
50
|
-
disabledCropping = input(false, { ...(ngDevMode ? { debugName: "disabledCropping" } : {}), transform: booleanAttribute });
|
|
50
|
+
disabledCropping = input(false, { ...(ngDevMode ? { debugName: "disabledCropping" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
51
51
|
/**
|
|
52
52
|
* Accepted image formats for the file selection dialog.
|
|
53
53
|
*
|
|
@@ -57,13 +57,15 @@ class SiPhotoUploadComponent {
|
|
|
57
57
|
*
|
|
58
58
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-accept
|
|
59
59
|
*/
|
|
60
|
-
acceptedUploadFormats = input('.png, .jpg, .jpeg',
|
|
60
|
+
acceptedUploadFormats = input('.png, .jpg, .jpeg', /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "acceptedUploadFormats" }] : /* istanbul ignore next */ []));
|
|
61
62
|
/**
|
|
62
63
|
* Maximum allowed file size of the uploaded file in kilobytes.
|
|
63
64
|
*
|
|
64
65
|
* @defaultValue 2048
|
|
65
66
|
*/
|
|
66
|
-
maxFileSize = input(2048,
|
|
67
|
+
maxFileSize = input(2048, /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "maxFileSize" }] : /* istanbul ignore next */ []));
|
|
67
69
|
/**
|
|
68
70
|
* If the uploaded file is of an unsupported type, this
|
|
69
71
|
* error message will be displayed to the user.
|
|
@@ -73,30 +75,34 @@ class SiPhotoUploadComponent {
|
|
|
73
75
|
* t(() => $localize`:@@SI_PHOTO_UPLOAD.ERROR_FILE_TYPE:The image file is not valid. Please upload a PNG or JP(E)G.`)
|
|
74
76
|
* ```
|
|
75
77
|
*/
|
|
76
|
-
uploadErrorWrongType = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.ERROR_FILE_TYPE:The image file is not valid. Please upload a PNG or JP(E)G.`),
|
|
78
|
+
uploadErrorWrongType = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.ERROR_FILE_TYPE:The image file is not valid. Please upload a PNG or JP(E)G.`), /* @ts-ignore */
|
|
79
|
+
...(ngDevMode ? [{ debugName: "uploadErrorWrongType" }] : /* istanbul ignore next */ []));
|
|
77
80
|
/**
|
|
78
81
|
* If the uploaded file exceeds the allowed upload size, this
|
|
79
82
|
* error message will be displayed to the user.
|
|
80
83
|
*
|
|
81
84
|
* @defaultValue
|
|
82
85
|
* ```
|
|
83
|
-
* t(() => $localize`:@@SI_PHOTO_UPLOAD.ERROR_FILE_SIZE_EXCEEDED:
|
|
86
|
+
* t(() => $localize`:@@SI_PHOTO_UPLOAD.ERROR_FILE_SIZE_EXCEEDED:Current file size of {{mb}} MB exceeds file size of max. {{maxSizeMb}} MB`)
|
|
84
87
|
* ```
|
|
85
88
|
*/
|
|
86
|
-
uploadErrorTooBig = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.ERROR_FILE_SIZE_EXCEEDED:
|
|
89
|
+
uploadErrorTooBig = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.ERROR_FILE_SIZE_EXCEEDED:Current file size of {{mb}} MB exceeds file size of max. {{maxSizeMb}} MB`), /* @ts-ignore */
|
|
90
|
+
...(ngDevMode ? [{ debugName: "uploadErrorTooBig" }] : /* istanbul ignore next */ []));
|
|
87
91
|
/**
|
|
88
92
|
* Alternative text for the photo.
|
|
89
93
|
*
|
|
90
94
|
* @defaultValue ''
|
|
91
95
|
*/
|
|
92
|
-
photoAltText = input('',
|
|
96
|
+
photoAltText = input('', /* @ts-ignore */
|
|
97
|
+
...(ngDevMode ? [{ debugName: "photoAltText" }] : /* istanbul ignore next */ []));
|
|
93
98
|
/**
|
|
94
99
|
* Alternative text for the photo´s placeholder.
|
|
95
100
|
* The value will be used to calculate the background color when `autoColor` is true.
|
|
96
101
|
*
|
|
97
102
|
* @defaultValue ''
|
|
98
103
|
*/
|
|
99
|
-
placeholderAltText = input('',
|
|
104
|
+
placeholderAltText = input('', /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "placeholderAltText" }] : /* istanbul ignore next */ []));
|
|
100
106
|
/**
|
|
101
107
|
* Text for the button changing the photo.
|
|
102
108
|
*
|
|
@@ -105,25 +111,28 @@ class SiPhotoUploadComponent {
|
|
|
105
111
|
* t(() => $localize`:@@SI_PHOTO_UPLOAD.CHANGE_PHOTO:Change`)
|
|
106
112
|
* ```
|
|
107
113
|
*/
|
|
108
|
-
changePhotoText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.CHANGE_PHOTO:Change`),
|
|
114
|
+
changePhotoText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.CHANGE_PHOTO:Change`), /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "changePhotoText" }] : /* istanbul ignore next */ []));
|
|
109
116
|
/**
|
|
110
117
|
* Cropper frame aria label.
|
|
111
118
|
*
|
|
112
119
|
* @defaultValue
|
|
113
120
|
* ```
|
|
114
|
-
* t(() => $localize`:@@SI_PHOTO_UPLOAD.CROPPER_FRAME_LABEL:Crop
|
|
121
|
+
* t(() => $localize`:@@SI_PHOTO_UPLOAD.CROPPER_FRAME_LABEL:Crop picture`)
|
|
115
122
|
* ```
|
|
116
123
|
*/
|
|
117
|
-
cropperFrameAriaLabel = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.CROPPER_FRAME_LABEL:Crop
|
|
124
|
+
cropperFrameAriaLabel = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.CROPPER_FRAME_LABEL:Crop picture`), /* @ts-ignore */
|
|
125
|
+
...(ngDevMode ? [{ debugName: "cropperFrameAriaLabel" }] : /* istanbul ignore next */ []));
|
|
118
126
|
/**
|
|
119
127
|
* Text for the button uploading a photo.
|
|
120
128
|
*
|
|
121
129
|
* @defaultValue
|
|
122
130
|
* ```
|
|
123
|
-
* t(() => $localize`:@@SI_PHOTO_UPLOAD.UPLOAD_PHOTO:Upload
|
|
131
|
+
* t(() => $localize`:@@SI_PHOTO_UPLOAD.UPLOAD_PHOTO:Upload picture`)
|
|
124
132
|
* ```
|
|
125
133
|
*/
|
|
126
|
-
uploadPhotoText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.UPLOAD_PHOTO:Upload
|
|
134
|
+
uploadPhotoText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.UPLOAD_PHOTO:Upload picture`), /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "uploadPhotoText" }] : /* istanbul ignore next */ []));
|
|
127
136
|
/**
|
|
128
137
|
* Text for the button removing the photo.
|
|
129
138
|
*
|
|
@@ -132,7 +141,8 @@ class SiPhotoUploadComponent {
|
|
|
132
141
|
* t(() => $localize`:@@SI_PHOTO_UPLOAD.REMOVE:Remove`)
|
|
133
142
|
* ```
|
|
134
143
|
*/
|
|
135
|
-
removePhotoText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.REMOVE:Remove`),
|
|
144
|
+
removePhotoText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.REMOVE:Remove`), /* @ts-ignore */
|
|
145
|
+
...(ngDevMode ? [{ debugName: "removePhotoText" }] : /* istanbul ignore next */ []));
|
|
136
146
|
/**
|
|
137
147
|
* Text for the button cancelling the editing process.
|
|
138
148
|
*
|
|
@@ -141,7 +151,8 @@ class SiPhotoUploadComponent {
|
|
|
141
151
|
* t(() => $localize`:@@SI_PHOTO_UPLOAD.CANCEL:Cancel`)
|
|
142
152
|
* ```
|
|
143
153
|
*/
|
|
144
|
-
cancelEditText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.CANCEL:Cancel`),
|
|
154
|
+
cancelEditText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.CANCEL:Cancel`), /* @ts-ignore */
|
|
155
|
+
...(ngDevMode ? [{ debugName: "cancelEditText" }] : /* istanbul ignore next */ []));
|
|
145
156
|
/**
|
|
146
157
|
* Text for the button applying the edited photo.
|
|
147
158
|
*
|
|
@@ -150,39 +161,44 @@ class SiPhotoUploadComponent {
|
|
|
150
161
|
* t(() => $localize`:@@SI_PHOTO_UPLOAD.APPLY_PHOTO:Apply`)
|
|
151
162
|
* ```
|
|
152
163
|
*/
|
|
153
|
-
applyEditText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.APPLY_PHOTO:Apply`),
|
|
164
|
+
applyEditText = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.APPLY_PHOTO:Apply`), /* @ts-ignore */
|
|
165
|
+
...(ngDevMode ? [{ debugName: "applyEditText" }] : /* istanbul ignore next */ []));
|
|
154
166
|
/**
|
|
155
167
|
* Text displayed as header of the editing modal.
|
|
156
168
|
*
|
|
157
169
|
* @defaultValue
|
|
158
170
|
* ```
|
|
159
|
-
* t(() => $localize`:@@SI_PHOTO_UPLOAD.MODAL_TITLE:
|
|
171
|
+
* t(() => $localize`:@@SI_PHOTO_UPLOAD.MODAL_TITLE:Profile picture`)
|
|
160
172
|
* ```
|
|
161
173
|
*/
|
|
162
|
-
modalHeader = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.MODAL_TITLE:
|
|
174
|
+
modalHeader = input(t(() => $localize `:@@SI_PHOTO_UPLOAD.MODAL_TITLE:Profile picture`), /* @ts-ignore */
|
|
175
|
+
...(ngDevMode ? [{ debugName: "modalHeader" }] : /* istanbul ignore next */ []));
|
|
163
176
|
/**
|
|
164
177
|
* Text displayed as description of the editing modal.
|
|
165
178
|
*/
|
|
166
|
-
modalDescription = input(
|
|
179
|
+
modalDescription = input(/* @ts-ignore */
|
|
180
|
+
...(ngDevMode ? [undefined, { debugName: "modalDescription" }] : /* istanbul ignore next */ []));
|
|
167
181
|
/**
|
|
168
182
|
* Output format of the edited image.
|
|
169
183
|
*
|
|
170
184
|
* @defaultValue 'jpeg'
|
|
171
185
|
*/
|
|
172
|
-
cropperImageFormat = input('jpeg',
|
|
186
|
+
cropperImageFormat = input('jpeg', /* @ts-ignore */
|
|
187
|
+
...(ngDevMode ? [{ debugName: "cropperImageFormat" }] : /* istanbul ignore next */ []));
|
|
173
188
|
/**
|
|
174
189
|
* The width / height ratio (e.g. 1 / 1 for a square, 4 / 3, 16 / 9 ...).
|
|
175
190
|
*
|
|
176
191
|
* @defaultValue 1
|
|
177
192
|
*/
|
|
178
|
-
cropperAspectRatio = input(1,
|
|
193
|
+
cropperAspectRatio = input(1, /* @ts-ignore */
|
|
194
|
+
...(ngDevMode ? [{ debugName: "cropperAspectRatio" }] : /* istanbul ignore next */ []));
|
|
179
195
|
/**
|
|
180
196
|
* Whether to keep the width and height of the cropped image equal according
|
|
181
197
|
* to the aspectRatio.
|
|
182
198
|
*
|
|
183
199
|
* @defaultValue true
|
|
184
200
|
*/
|
|
185
|
-
cropperMaintainAspectRatio = input(true, { ...(ngDevMode ? { debugName: "cropperMaintainAspectRatio" } : {}), transform: booleanAttribute });
|
|
201
|
+
cropperMaintainAspectRatio = input(true, { ...(ngDevMode ? { debugName: "cropperMaintainAspectRatio" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
186
202
|
/**
|
|
187
203
|
* When set to true, padding will be added around the image to make it fit to
|
|
188
204
|
* the aspect ratio. Be aware that this transformation will cause the loaded
|
|
@@ -190,14 +206,15 @@ class SiPhotoUploadComponent {
|
|
|
190
206
|
*
|
|
191
207
|
* @defaultValue false
|
|
192
208
|
*/
|
|
193
|
-
cropperContainWithinAspectRatio = input(false, { ...(ngDevMode ? { debugName: "cropperContainWithinAspectRatio" } : {}), transform: booleanAttribute });
|
|
209
|
+
cropperContainWithinAspectRatio = input(false, { ...(ngDevMode ? { debugName: "cropperContainWithinAspectRatio" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
194
210
|
/**
|
|
195
211
|
* The cropper´s width cannot be made smaller than this number of pixels
|
|
196
212
|
* (relative to original image´s size). (0 = disabled).
|
|
197
213
|
*
|
|
198
214
|
* @defaultValue 50
|
|
199
215
|
*/
|
|
200
|
-
cropperMinWidth = input(50,
|
|
216
|
+
cropperMinWidth = input(50, /* @ts-ignore */
|
|
217
|
+
...(ngDevMode ? [{ debugName: "cropperMinWidth" }] : /* istanbul ignore next */ []));
|
|
201
218
|
/**
|
|
202
219
|
* The cropper´s height cannot be made smaller than this number of pixels
|
|
203
220
|
* (relative to original image´s size). Will be ignored if
|
|
@@ -205,21 +222,24 @@ class SiPhotoUploadComponent {
|
|
|
205
222
|
*
|
|
206
223
|
* @defaultValue 50
|
|
207
224
|
*/
|
|
208
|
-
cropperMinHeight = input(50,
|
|
225
|
+
cropperMinHeight = input(50, /* @ts-ignore */
|
|
226
|
+
...(ngDevMode ? [{ debugName: "cropperMinHeight" }] : /* istanbul ignore next */ []));
|
|
209
227
|
/**
|
|
210
228
|
* The cropper´s width cannot be made bigger than this number of pixels.
|
|
211
229
|
* Default is 0 (disabled).
|
|
212
230
|
*
|
|
213
231
|
* @defaultValue 0
|
|
214
232
|
*/
|
|
215
|
-
cropperMaxWidth = input(0,
|
|
233
|
+
cropperMaxWidth = input(0, /* @ts-ignore */
|
|
234
|
+
...(ngDevMode ? [{ debugName: "cropperMaxWidth" }] : /* istanbul ignore next */ []));
|
|
216
235
|
/**
|
|
217
236
|
* The cropper´s height cannot be made bigger than this number of pixels.
|
|
218
237
|
* Default is 0 (disabled).
|
|
219
238
|
*
|
|
220
239
|
* @defaultValue 0
|
|
221
240
|
*/
|
|
222
|
-
cropperMaxHeight = input(0,
|
|
241
|
+
cropperMaxHeight = input(0, /* @ts-ignore */
|
|
242
|
+
...(ngDevMode ? [{ debugName: "cropperMaxHeight" }] : /* istanbul ignore next */ []));
|
|
223
243
|
/**
|
|
224
244
|
* Set this to true for a round cropper. Resulting image will still
|
|
225
245
|
* be square, but visually clipped with a border-radius: 50% on the
|
|
@@ -227,45 +247,58 @@ class SiPhotoUploadComponent {
|
|
|
227
247
|
*
|
|
228
248
|
* @defaultValue true
|
|
229
249
|
*/
|
|
230
|
-
roundImage = input(true, { ...(ngDevMode ? { debugName: "roundImage" } : {}), transform: booleanAttribute });
|
|
250
|
+
roundImage = input(true, { ...(ngDevMode ? { debugName: "roundImage" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
231
251
|
/**
|
|
232
252
|
* The input photo to be used for cropping. A string in [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) format
|
|
233
253
|
* with base64 encoding.
|
|
234
254
|
*/
|
|
235
|
-
sourcePhoto = model(
|
|
255
|
+
sourcePhoto = model(/* @ts-ignore */
|
|
256
|
+
...(ngDevMode ? [undefined, { debugName: "sourcePhoto" }] : /* istanbul ignore next */ []));
|
|
236
257
|
/**
|
|
237
258
|
* URL to a photo to be used for cropping.
|
|
238
259
|
*/
|
|
239
|
-
sourcePhotoUrl = input(
|
|
260
|
+
sourcePhotoUrl = input(/* @ts-ignore */
|
|
261
|
+
...(ngDevMode ? [undefined, { debugName: "sourcePhotoUrl" }] : /* istanbul ignore next */ []));
|
|
240
262
|
/**
|
|
241
263
|
* The photo to be displayed and edited (when not readonly).
|
|
242
264
|
*/
|
|
243
|
-
croppedPhoto = model(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
265
|
+
croppedPhoto = model(/* @ts-ignore */
|
|
266
|
+
...(ngDevMode ? [undefined, { debugName: "croppedPhoto" }] : /* istanbul ignore next */ []));
|
|
267
|
+
editPhotoTemplate = viewChild.required('editPhotoTemplate', /* @ts-ignore */
|
|
268
|
+
...(ngDevMode ? [{ debugName: "editPhotoTemplate" }] : /* istanbul ignore next */ []));
|
|
269
|
+
fileInput = viewChild.required('fileInput', /* @ts-ignore */
|
|
270
|
+
...(ngDevMode ? [{ debugName: "fileInput" }] : /* istanbul ignore next */ []));
|
|
271
|
+
imageCropper = viewChild('imageCropper', /* @ts-ignore */
|
|
272
|
+
...(ngDevMode ? [{ debugName: "imageCropper" }] : /* istanbul ignore next */ []));
|
|
247
273
|
// used to label the dialog
|
|
248
274
|
titleId = `__si-photo-upload-${SiPhotoUploadComponent.idCounter++}`;
|
|
249
275
|
/**
|
|
250
276
|
* The trusted photo url string which is used to display the photo.
|
|
251
277
|
*/
|
|
252
|
-
sanitizedPhotoUrl = signal(undefined,
|
|
278
|
+
sanitizedPhotoUrl = signal(undefined, /* @ts-ignore */
|
|
279
|
+
...(ngDevMode ? [{ debugName: "sanitizedPhotoUrl" }] : /* istanbul ignore next */ []));
|
|
253
280
|
/**
|
|
254
281
|
* The appropriate error message displayed to the user. Might be
|
|
255
282
|
* `uploadErrorWrongType` or `uploadErrorTooBig`.
|
|
256
283
|
*/
|
|
257
|
-
uploadErrorMessage = signal(undefined,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
284
|
+
uploadErrorMessage = signal(undefined, /* @ts-ignore */
|
|
285
|
+
...(ngDevMode ? [{ debugName: "uploadErrorMessage" }] : /* istanbul ignore next */ []));
|
|
286
|
+
editButtonText = computed(() => this.sanitizedPhotoUrl() ? this.changePhotoText() : this.uploadPhotoText(), /* @ts-ignore */
|
|
287
|
+
...(ngDevMode ? [{ debugName: "editButtonText" }] : /* istanbul ignore next */ []));
|
|
288
|
+
currentFileSizeKilobytes = signal(-1, /* @ts-ignore */
|
|
289
|
+
...(ngDevMode ? [{ debugName: "currentFileSizeKilobytes" }] : /* istanbul ignore next */ []));
|
|
290
|
+
currentFileSizeMegabytes = signal(-1, /* @ts-ignore */
|
|
291
|
+
...(ngDevMode ? [{ debugName: "currentFileSizeMegabytes" }] : /* istanbul ignore next */ []));
|
|
292
|
+
maxSizeMb = computed(() => this.maxFileSize() / 1024, /* @ts-ignore */
|
|
293
|
+
...(ngDevMode ? [{ debugName: "maxSizeMb" }] : /* istanbul ignore next */ []));
|
|
262
294
|
/**
|
|
263
295
|
* The photo instance to be used in the image cropper. We need a different
|
|
264
296
|
* reference than `sourcePhoto` to support the cancel after uploading
|
|
265
297
|
* a new photo. While `sourcePhoto` is A and image cropper uploads B,
|
|
266
298
|
* we should not replace `sourcePhoto` A until user presses apply.
|
|
267
299
|
*/
|
|
268
|
-
imageCropperPhoto = signal(undefined,
|
|
300
|
+
imageCropperPhoto = signal(undefined, /* @ts-ignore */
|
|
301
|
+
...(ngDevMode ? [{ debugName: "imageCropperPhoto" }] : /* istanbul ignore next */ []));
|
|
269
302
|
icons = addIcons({
|
|
270
303
|
elementCancel,
|
|
271
304
|
elementCircleFilled,
|
|
@@ -447,10 +480,10 @@ class SiPhotoUploadComponent {
|
|
|
447
480
|
this.resetErrorMessage();
|
|
448
481
|
this.sanitizedPhotoUrl.set(photo ? this.sanitizer.bypassSecurityTrustResourceUrl(photo) : undefined);
|
|
449
482
|
}
|
|
450
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
451
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiPhotoUploadComponent, isStandalone: true, selector: "si-photo-upload", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabledCropping: { classPropertyName: "disabledCropping", publicName: "disabledCropping", isSignal: true, isRequired: false, transformFunction: null }, acceptedUploadFormats: { classPropertyName: "acceptedUploadFormats", publicName: "acceptedUploadFormats", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, uploadErrorWrongType: { classPropertyName: "uploadErrorWrongType", publicName: "uploadErrorWrongType", isSignal: true, isRequired: false, transformFunction: null }, uploadErrorTooBig: { classPropertyName: "uploadErrorTooBig", publicName: "uploadErrorTooBig", isSignal: true, isRequired: false, transformFunction: null }, photoAltText: { classPropertyName: "photoAltText", publicName: "photoAltText", isSignal: true, isRequired: false, transformFunction: null }, placeholderAltText: { classPropertyName: "placeholderAltText", publicName: "placeholderAltText", isSignal: true, isRequired: false, transformFunction: null }, changePhotoText: { classPropertyName: "changePhotoText", publicName: "changePhotoText", isSignal: true, isRequired: false, transformFunction: null }, cropperFrameAriaLabel: { classPropertyName: "cropperFrameAriaLabel", publicName: "cropperFrameAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, uploadPhotoText: { classPropertyName: "uploadPhotoText", publicName: "uploadPhotoText", isSignal: true, isRequired: false, transformFunction: null }, removePhotoText: { classPropertyName: "removePhotoText", publicName: "removePhotoText", isSignal: true, isRequired: false, transformFunction: null }, cancelEditText: { classPropertyName: "cancelEditText", publicName: "cancelEditText", isSignal: true, isRequired: false, transformFunction: null }, applyEditText: { classPropertyName: "applyEditText", publicName: "applyEditText", isSignal: true, isRequired: false, transformFunction: null }, modalHeader: { classPropertyName: "modalHeader", publicName: "modalHeader", isSignal: true, isRequired: false, transformFunction: null }, modalDescription: { classPropertyName: "modalDescription", publicName: "modalDescription", isSignal: true, isRequired: false, transformFunction: null }, cropperImageFormat: { classPropertyName: "cropperImageFormat", publicName: "cropperImageFormat", isSignal: true, isRequired: false, transformFunction: null }, cropperAspectRatio: { classPropertyName: "cropperAspectRatio", publicName: "cropperAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, cropperMaintainAspectRatio: { classPropertyName: "cropperMaintainAspectRatio", publicName: "cropperMaintainAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, cropperContainWithinAspectRatio: { classPropertyName: "cropperContainWithinAspectRatio", publicName: "cropperContainWithinAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, cropperMinWidth: { classPropertyName: "cropperMinWidth", publicName: "cropperMinWidth", isSignal: true, isRequired: false, transformFunction: null }, cropperMinHeight: { classPropertyName: "cropperMinHeight", publicName: "cropperMinHeight", isSignal: true, isRequired: false, transformFunction: null }, cropperMaxWidth: { classPropertyName: "cropperMaxWidth", publicName: "cropperMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, cropperMaxHeight: { classPropertyName: "cropperMaxHeight", publicName: "cropperMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, roundImage: { classPropertyName: "roundImage", publicName: "roundImage", isSignal: true, isRequired: false, transformFunction: null }, sourcePhoto: { classPropertyName: "sourcePhoto", publicName: "sourcePhoto", isSignal: true, isRequired: false, transformFunction: null }, sourcePhotoUrl: { classPropertyName: "sourcePhotoUrl", publicName: "sourcePhotoUrl", isSignal: true, isRequired: false, transformFunction: null }, croppedPhoto: { classPropertyName: "croppedPhoto", publicName: "croppedPhoto", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sourcePhoto: "sourcePhotoChange", croppedPhoto: "croppedPhotoChange" }, viewQueries: [{ propertyName: "editPhotoTemplate", first: true, predicate: ["editPhotoTemplate"], descendants: true, isSignal: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "imageCropper", first: true, predicate: ["imageCropper"], descendants: true, isSignal: true }], usesOnChanges: true, hostDirectives: [{ directive: i1.SiAvatarBackgroundColorDirective, inputs: ["color", "color", "autoColor", "autoColor"] }], ngImport: i0, template: "<div class=\"photo-upload d-flex flex-column p-6\">\n <!-- File upload -->\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n [accept]=\"acceptedUploadFormats()\"\n (change)=\"fileUpload($event)\"\n />\n\n <!-- Image -->\n @if (sanitizedPhotoUrl()) {\n <img\n class=\"photo-upload-photo\"\n [class.round]=\"roundImage()\"\n [src]=\"sanitizedPhotoUrl()\"\n [alt]=\"photoAltText() | translate\"\n />\n } @else {\n <span\n class=\"photo-upload-placeholder d-flex align-items-center justify-content-center flex-none\"\n [class.round]=\"roundImage()\"\n >\n {{ placeholderAltText() | translate }}\n </span>\n }\n <!-- Buttons -->\n @if (!readonly()) {\n <div class=\"d-flex justify-content-center gap-6 mt-8\">\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n (click)=\"\n (sourcePhoto() || sourcePhotoUrl()) && !disabledCropping()\n ? showCroppingDialog()\n : fileInput.click()\n \"\n >\n {{ editButtonText() | translate }}\n </button>\n @if (sanitizedPhotoUrl()) {\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"removePhoto()\">\n {{ removePhotoText() | translate }}\n </button>\n }\n </div>\n }\n\n <!-- Error message -->\n @if (uploadErrorMessage() && !modalRef) {\n <div class=\"mt-6\">\n <ng-container [ngTemplateOutlet]=\"errorMessageTemplate\" />\n </div>\n }\n</div>\n\n<!-- Template: modal -->\n<ng-template #editPhotoTemplate>\n <!-- Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" [id]=\"titleId\">{{ modalHeader() | translate }}</h4>\n <button\n type=\"button\"\n class=\"btn btn-circle btn-tertiary-ghost\"\n [attr.aria-label]=\"cancelEditText() | translate\"\n (click)=\"imageCropperCanceled()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n <!-- Content -->\n <div class=\"modal-body\">\n @if (modalDescription()) {\n <div class=\"mb-4\">\n <span class=\"text-secondary\">{{ modalDescription() | translate }}</span>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"imageCropperTemplate\" />\n @if (uploadErrorMessage()) {\n <div class=\"d-flex mt-4\">\n <ng-container [ngTemplateOutlet]=\"errorMessageTemplate\" />\n </div>\n }\n </div>\n <!-- Footer -->\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary me-auto\" (click)=\"fileInput.click()\">\n {{ changePhotoText() | translate }}\n </button>\n <div class=\"d-flex gap-6\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"imageCropperCanceled()\">\n {{ cancelEditText() | translate }}\n </button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"imageCropperApplied()\">\n {{ applyEditText() | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<!-- Template: error message -->\n<ng-template #errorMessageTemplate>\n <div class=\"d-flex align-items-center\">\n <span class=\"icon-sm icon-stack d-inline-block my-n2 me-2\">\n <si-icon class=\"status-danger\" [icon]=\"icons.elementCircleFilled\" />\n <si-icon class=\"status-danger-contrast\" [icon]=\"icons.elementStateExclamationMark\" />\n </span>\n <span class=\"text-danger\">{{\n uploadErrorMessage()\n | translate\n : {\n mb: currentFileSizeMegabytes(),\n kb: currentFileSizeKilobytes(),\n maxSizeMb: maxSizeMb()\n }\n }}</span>\n </div>\n</ng-template>\n\n<!-- Template: image cropper -->\n<ng-template #imageCropperTemplate>\n <si-image-cropper-style>\n <image-cropper\n #imageCropper\n output=\"base64\"\n [aspectRatio]=\"cropperAspectRatio()\"\n [containWithinAspectRatio]=\"cropperContainWithinAspectRatio()\"\n [cropperMinWidth]=\"cropperMinWidth()\"\n [cropperMinHeight]=\"cropperMinHeight()\"\n [cropperMaxWidth]=\"cropperMaxWidth()\"\n [cropperMaxHeight]=\"cropperMaxHeight()\"\n [cropperFrameAriaLabel]=\"cropperFrameAriaLabel() | translate\"\n [format]=\"cropperImageFormat()\"\n [imageBase64]=\"imageCropperPhoto()\"\n [imageURL]=\"sourcePhotoUrl()\"\n [maintainAspectRatio]=\"cropperMaintainAspectRatio()\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"roundImage()\"\n (cropperReady)=\"cropperReady()\"\n (imageCropped)=\"cropperImageCropped($event)\"\n />\n </si-image-cropper-style>\n</ng-template>\n", styles: [":host{--si-photo-upload-photo-width: 200px;--si-photo-upload-photo-height: 200px}.photo-upload{box-sizing:content-box;max-inline-size:var(--si-photo-upload-photo-width)}.photo-upload-photo,.photo-upload-placeholder{display:block;margin:auto;inline-size:var(--si-photo-upload-photo-width);max-inline-size:100%;block-size:var(--si-photo-upload-photo-height);object-fit:cover}.photo-upload-photo.round,.photo-upload-placeholder.round{border-radius:50%}.photo-upload-placeholder{background-color:var(--background);color:var(--element-ui-5);font-size:3rem;text-align:center;overflow:hidden;word-break:break-all;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "options", "cropperFrameAriaLabel", "output", "format", "autoCrop", "cropper", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "checkImageType", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange", "cropperChange"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiImageCropperStyleComponent, selector: "si-image-cropper-style" }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
483
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiPhotoUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
484
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiPhotoUploadComponent, isStandalone: true, selector: "si-photo-upload", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabledCropping: { classPropertyName: "disabledCropping", publicName: "disabledCropping", isSignal: true, isRequired: false, transformFunction: null }, acceptedUploadFormats: { classPropertyName: "acceptedUploadFormats", publicName: "acceptedUploadFormats", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, uploadErrorWrongType: { classPropertyName: "uploadErrorWrongType", publicName: "uploadErrorWrongType", isSignal: true, isRequired: false, transformFunction: null }, uploadErrorTooBig: { classPropertyName: "uploadErrorTooBig", publicName: "uploadErrorTooBig", isSignal: true, isRequired: false, transformFunction: null }, photoAltText: { classPropertyName: "photoAltText", publicName: "photoAltText", isSignal: true, isRequired: false, transformFunction: null }, placeholderAltText: { classPropertyName: "placeholderAltText", publicName: "placeholderAltText", isSignal: true, isRequired: false, transformFunction: null }, changePhotoText: { classPropertyName: "changePhotoText", publicName: "changePhotoText", isSignal: true, isRequired: false, transformFunction: null }, cropperFrameAriaLabel: { classPropertyName: "cropperFrameAriaLabel", publicName: "cropperFrameAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, uploadPhotoText: { classPropertyName: "uploadPhotoText", publicName: "uploadPhotoText", isSignal: true, isRequired: false, transformFunction: null }, removePhotoText: { classPropertyName: "removePhotoText", publicName: "removePhotoText", isSignal: true, isRequired: false, transformFunction: null }, cancelEditText: { classPropertyName: "cancelEditText", publicName: "cancelEditText", isSignal: true, isRequired: false, transformFunction: null }, applyEditText: { classPropertyName: "applyEditText", publicName: "applyEditText", isSignal: true, isRequired: false, transformFunction: null }, modalHeader: { classPropertyName: "modalHeader", publicName: "modalHeader", isSignal: true, isRequired: false, transformFunction: null }, modalDescription: { classPropertyName: "modalDescription", publicName: "modalDescription", isSignal: true, isRequired: false, transformFunction: null }, cropperImageFormat: { classPropertyName: "cropperImageFormat", publicName: "cropperImageFormat", isSignal: true, isRequired: false, transformFunction: null }, cropperAspectRatio: { classPropertyName: "cropperAspectRatio", publicName: "cropperAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, cropperMaintainAspectRatio: { classPropertyName: "cropperMaintainAspectRatio", publicName: "cropperMaintainAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, cropperContainWithinAspectRatio: { classPropertyName: "cropperContainWithinAspectRatio", publicName: "cropperContainWithinAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, cropperMinWidth: { classPropertyName: "cropperMinWidth", publicName: "cropperMinWidth", isSignal: true, isRequired: false, transformFunction: null }, cropperMinHeight: { classPropertyName: "cropperMinHeight", publicName: "cropperMinHeight", isSignal: true, isRequired: false, transformFunction: null }, cropperMaxWidth: { classPropertyName: "cropperMaxWidth", publicName: "cropperMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, cropperMaxHeight: { classPropertyName: "cropperMaxHeight", publicName: "cropperMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, roundImage: { classPropertyName: "roundImage", publicName: "roundImage", isSignal: true, isRequired: false, transformFunction: null }, sourcePhoto: { classPropertyName: "sourcePhoto", publicName: "sourcePhoto", isSignal: true, isRequired: false, transformFunction: null }, sourcePhotoUrl: { classPropertyName: "sourcePhotoUrl", publicName: "sourcePhotoUrl", isSignal: true, isRequired: false, transformFunction: null }, croppedPhoto: { classPropertyName: "croppedPhoto", publicName: "croppedPhoto", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sourcePhoto: "sourcePhotoChange", croppedPhoto: "croppedPhotoChange" }, viewQueries: [{ propertyName: "editPhotoTemplate", first: true, predicate: ["editPhotoTemplate"], descendants: true, isSignal: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }, { propertyName: "imageCropper", first: true, predicate: ["imageCropper"], descendants: true, isSignal: true }], usesOnChanges: true, hostDirectives: [{ directive: i1.SiAvatarBackgroundColorDirective, inputs: ["color", "color", "autoColor", "autoColor"] }], ngImport: i0, template: "<div class=\"photo-upload d-flex flex-column p-6\">\n <!-- File upload -->\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n [accept]=\"acceptedUploadFormats()\"\n (change)=\"fileUpload($event)\"\n />\n\n <!-- Image -->\n @if (sanitizedPhotoUrl()) {\n <img\n class=\"photo-upload-photo\"\n [class.round]=\"roundImage()\"\n [src]=\"sanitizedPhotoUrl()\"\n [alt]=\"photoAltText() | translate\"\n />\n } @else {\n <span\n class=\"photo-upload-placeholder d-flex align-items-center justify-content-center flex-none\"\n [class.round]=\"roundImage()\"\n >\n {{ placeholderAltText() | translate }}\n </span>\n }\n <!-- Buttons -->\n @if (!readonly()) {\n <div class=\"d-flex justify-content-center gap-6 mt-8\">\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n (click)=\"\n (sourcePhoto() || sourcePhotoUrl()) && !disabledCropping()\n ? showCroppingDialog()\n : fileInput.click()\n \"\n >\n {{ editButtonText() | translate }}\n </button>\n @if (sanitizedPhotoUrl()) {\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"removePhoto()\">\n {{ removePhotoText() | translate }}\n </button>\n }\n </div>\n }\n\n <!-- Error message -->\n @if (uploadErrorMessage() && !modalRef) {\n <div class=\"mt-6\">\n <ng-container [ngTemplateOutlet]=\"errorMessageTemplate\" />\n </div>\n }\n</div>\n\n<!-- Template: modal -->\n<ng-template #editPhotoTemplate>\n <!-- Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" [id]=\"titleId\">{{ modalHeader() | translate }}</h4>\n <button\n type=\"button\"\n class=\"btn btn-circle btn-tertiary-ghost\"\n [attr.aria-label]=\"cancelEditText() | translate\"\n (click)=\"imageCropperCanceled()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n <!-- Content -->\n <div class=\"modal-body\">\n @if (modalDescription()) {\n <div class=\"mb-4\">\n <span class=\"text-secondary\">{{ modalDescription() | translate }}</span>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"imageCropperTemplate\" />\n @if (uploadErrorMessage()) {\n <div class=\"d-flex mt-4\">\n <ng-container [ngTemplateOutlet]=\"errorMessageTemplate\" />\n </div>\n }\n </div>\n <!-- Footer -->\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary me-auto\" (click)=\"fileInput.click()\">\n {{ changePhotoText() | translate }}\n </button>\n <div class=\"d-flex gap-6\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"imageCropperCanceled()\">\n {{ cancelEditText() | translate }}\n </button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"imageCropperApplied()\">\n {{ applyEditText() | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<!-- Template: error message -->\n<ng-template #errorMessageTemplate>\n <div class=\"d-flex align-items-center\">\n <span class=\"icon-sm icon-stack d-inline-block my-n2 me-2\">\n <si-icon class=\"status-danger\" [icon]=\"icons.elementCircleFilled\" />\n <si-icon class=\"status-danger-contrast\" [icon]=\"icons.elementStateExclamationMark\" />\n </span>\n <span class=\"text-danger\">{{\n uploadErrorMessage()\n | translate\n : {\n mb: currentFileSizeMegabytes(),\n kb: currentFileSizeKilobytes(),\n maxSizeMb: maxSizeMb()\n }\n }}</span>\n </div>\n</ng-template>\n\n<!-- Template: image cropper -->\n<ng-template #imageCropperTemplate>\n <si-image-cropper-style>\n <image-cropper\n #imageCropper\n output=\"base64\"\n [aspectRatio]=\"cropperAspectRatio()\"\n [containWithinAspectRatio]=\"cropperContainWithinAspectRatio()\"\n [cropperMinWidth]=\"cropperMinWidth()\"\n [cropperMinHeight]=\"cropperMinHeight()\"\n [cropperMaxWidth]=\"cropperMaxWidth()\"\n [cropperMaxHeight]=\"cropperMaxHeight()\"\n [cropperFrameAriaLabel]=\"cropperFrameAriaLabel() | translate\"\n [format]=\"cropperImageFormat()\"\n [imageBase64]=\"imageCropperPhoto()\"\n [imageURL]=\"sourcePhotoUrl()\"\n [maintainAspectRatio]=\"cropperMaintainAspectRatio()\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"roundImage()\"\n (cropperReady)=\"cropperReady()\"\n (imageCropped)=\"cropperImageCropped($event)\"\n />\n </si-image-cropper-style>\n</ng-template>\n", styles: [":host{--si-photo-upload-photo-width: 200px;--si-photo-upload-photo-height: 200px}.photo-upload{box-sizing:content-box;max-inline-size:var(--si-photo-upload-photo-width)}.photo-upload-photo,.photo-upload-placeholder{display:block;margin:auto;inline-size:var(--si-photo-upload-photo-width);max-inline-size:100%;block-size:var(--si-photo-upload-photo-height);object-fit:cover}.photo-upload-photo.round,.photo-upload-placeholder.round{border-radius:50%}.photo-upload-placeholder{background-color:var(--background);color:var(--si-sys-text-inverse);font-size:3rem;text-align:center;overflow:hidden;word-break:break-all;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "options", "cropperFrameAriaLabel", "output", "format", "autoCrop", "cropper", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "checkImageType", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange", "cropperChange"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiImageCropperStyleComponent, selector: "si-image-cropper-style" }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
452
485
|
}
|
|
453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
486
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiPhotoUploadComponent, decorators: [{
|
|
454
487
|
type: Component,
|
|
455
488
|
args: [{ selector: 'si-photo-upload', imports: [
|
|
456
489
|
NgTemplateOutlet,
|
|
@@ -458,12 +491,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
458
491
|
SiIconComponent,
|
|
459
492
|
SiImageCropperStyleComponent,
|
|
460
493
|
SiTranslatePipe
|
|
461
|
-
],
|
|
494
|
+
], hostDirectives: [
|
|
462
495
|
{
|
|
463
496
|
directive: SiAvatarBackgroundColorDirective,
|
|
464
497
|
inputs: ['color', 'autoColor']
|
|
465
498
|
}
|
|
466
|
-
], template: "<div class=\"photo-upload d-flex flex-column p-6\">\n <!-- File upload -->\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n [accept]=\"acceptedUploadFormats()\"\n (change)=\"fileUpload($event)\"\n />\n\n <!-- Image -->\n @if (sanitizedPhotoUrl()) {\n <img\n class=\"photo-upload-photo\"\n [class.round]=\"roundImage()\"\n [src]=\"sanitizedPhotoUrl()\"\n [alt]=\"photoAltText() | translate\"\n />\n } @else {\n <span\n class=\"photo-upload-placeholder d-flex align-items-center justify-content-center flex-none\"\n [class.round]=\"roundImage()\"\n >\n {{ placeholderAltText() | translate }}\n </span>\n }\n <!-- Buttons -->\n @if (!readonly()) {\n <div class=\"d-flex justify-content-center gap-6 mt-8\">\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n (click)=\"\n (sourcePhoto() || sourcePhotoUrl()) && !disabledCropping()\n ? showCroppingDialog()\n : fileInput.click()\n \"\n >\n {{ editButtonText() | translate }}\n </button>\n @if (sanitizedPhotoUrl()) {\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"removePhoto()\">\n {{ removePhotoText() | translate }}\n </button>\n }\n </div>\n }\n\n <!-- Error message -->\n @if (uploadErrorMessage() && !modalRef) {\n <div class=\"mt-6\">\n <ng-container [ngTemplateOutlet]=\"errorMessageTemplate\" />\n </div>\n }\n</div>\n\n<!-- Template: modal -->\n<ng-template #editPhotoTemplate>\n <!-- Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" [id]=\"titleId\">{{ modalHeader() | translate }}</h4>\n <button\n type=\"button\"\n class=\"btn btn-circle btn-tertiary-ghost\"\n [attr.aria-label]=\"cancelEditText() | translate\"\n (click)=\"imageCropperCanceled()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n <!-- Content -->\n <div class=\"modal-body\">\n @if (modalDescription()) {\n <div class=\"mb-4\">\n <span class=\"text-secondary\">{{ modalDescription() | translate }}</span>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"imageCropperTemplate\" />\n @if (uploadErrorMessage()) {\n <div class=\"d-flex mt-4\">\n <ng-container [ngTemplateOutlet]=\"errorMessageTemplate\" />\n </div>\n }\n </div>\n <!-- Footer -->\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary me-auto\" (click)=\"fileInput.click()\">\n {{ changePhotoText() | translate }}\n </button>\n <div class=\"d-flex gap-6\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"imageCropperCanceled()\">\n {{ cancelEditText() | translate }}\n </button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"imageCropperApplied()\">\n {{ applyEditText() | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<!-- Template: error message -->\n<ng-template #errorMessageTemplate>\n <div class=\"d-flex align-items-center\">\n <span class=\"icon-sm icon-stack d-inline-block my-n2 me-2\">\n <si-icon class=\"status-danger\" [icon]=\"icons.elementCircleFilled\" />\n <si-icon class=\"status-danger-contrast\" [icon]=\"icons.elementStateExclamationMark\" />\n </span>\n <span class=\"text-danger\">{{\n uploadErrorMessage()\n | translate\n : {\n mb: currentFileSizeMegabytes(),\n kb: currentFileSizeKilobytes(),\n maxSizeMb: maxSizeMb()\n }\n }}</span>\n </div>\n</ng-template>\n\n<!-- Template: image cropper -->\n<ng-template #imageCropperTemplate>\n <si-image-cropper-style>\n <image-cropper\n #imageCropper\n output=\"base64\"\n [aspectRatio]=\"cropperAspectRatio()\"\n [containWithinAspectRatio]=\"cropperContainWithinAspectRatio()\"\n [cropperMinWidth]=\"cropperMinWidth()\"\n [cropperMinHeight]=\"cropperMinHeight()\"\n [cropperMaxWidth]=\"cropperMaxWidth()\"\n [cropperMaxHeight]=\"cropperMaxHeight()\"\n [cropperFrameAriaLabel]=\"cropperFrameAriaLabel() | translate\"\n [format]=\"cropperImageFormat()\"\n [imageBase64]=\"imageCropperPhoto()\"\n [imageURL]=\"sourcePhotoUrl()\"\n [maintainAspectRatio]=\"cropperMaintainAspectRatio()\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"roundImage()\"\n (cropperReady)=\"cropperReady()\"\n (imageCropped)=\"cropperImageCropped($event)\"\n />\n </si-image-cropper-style>\n</ng-template>\n", styles: [":host{--si-photo-upload-photo-width: 200px;--si-photo-upload-photo-height: 200px}.photo-upload{box-sizing:content-box;max-inline-size:var(--si-photo-upload-photo-width)}.photo-upload-photo,.photo-upload-placeholder{display:block;margin:auto;inline-size:var(--si-photo-upload-photo-width);max-inline-size:100%;block-size:var(--si-photo-upload-photo-height);object-fit:cover}.photo-upload-photo.round,.photo-upload-placeholder.round{border-radius:50%}.photo-upload-placeholder{background-color:var(--background);color:var(--
|
|
499
|
+
], template: "<div class=\"photo-upload d-flex flex-column p-6\">\n <!-- File upload -->\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n [accept]=\"acceptedUploadFormats()\"\n (change)=\"fileUpload($event)\"\n />\n\n <!-- Image -->\n @if (sanitizedPhotoUrl()) {\n <img\n class=\"photo-upload-photo\"\n [class.round]=\"roundImage()\"\n [src]=\"sanitizedPhotoUrl()\"\n [alt]=\"photoAltText() | translate\"\n />\n } @else {\n <span\n class=\"photo-upload-placeholder d-flex align-items-center justify-content-center flex-none\"\n [class.round]=\"roundImage()\"\n >\n {{ placeholderAltText() | translate }}\n </span>\n }\n <!-- Buttons -->\n @if (!readonly()) {\n <div class=\"d-flex justify-content-center gap-6 mt-8\">\n <button\n type=\"button\"\n class=\"btn btn-secondary\"\n (click)=\"\n (sourcePhoto() || sourcePhotoUrl()) && !disabledCropping()\n ? showCroppingDialog()\n : fileInput.click()\n \"\n >\n {{ editButtonText() | translate }}\n </button>\n @if (sanitizedPhotoUrl()) {\n <button type=\"button\" class=\"btn btn-danger\" (click)=\"removePhoto()\">\n {{ removePhotoText() | translate }}\n </button>\n }\n </div>\n }\n\n <!-- Error message -->\n @if (uploadErrorMessage() && !modalRef) {\n <div class=\"mt-6\">\n <ng-container [ngTemplateOutlet]=\"errorMessageTemplate\" />\n </div>\n }\n</div>\n\n<!-- Template: modal -->\n<ng-template #editPhotoTemplate>\n <!-- Header -->\n <div class=\"modal-header\">\n <h4 class=\"modal-title\" [id]=\"titleId\">{{ modalHeader() | translate }}</h4>\n <button\n type=\"button\"\n class=\"btn btn-circle btn-tertiary-ghost\"\n [attr.aria-label]=\"cancelEditText() | translate\"\n (click)=\"imageCropperCanceled()\"\n >\n <si-icon [icon]=\"icons.elementCancel\" />\n </button>\n </div>\n <!-- Content -->\n <div class=\"modal-body\">\n @if (modalDescription()) {\n <div class=\"mb-4\">\n <span class=\"text-secondary\">{{ modalDescription() | translate }}</span>\n </div>\n }\n <ng-container [ngTemplateOutlet]=\"imageCropperTemplate\" />\n @if (uploadErrorMessage()) {\n <div class=\"d-flex mt-4\">\n <ng-container [ngTemplateOutlet]=\"errorMessageTemplate\" />\n </div>\n }\n </div>\n <!-- Footer -->\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary me-auto\" (click)=\"fileInput.click()\">\n {{ changePhotoText() | translate }}\n </button>\n <div class=\"d-flex gap-6\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"imageCropperCanceled()\">\n {{ cancelEditText() | translate }}\n </button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"imageCropperApplied()\">\n {{ applyEditText() | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<!-- Template: error message -->\n<ng-template #errorMessageTemplate>\n <div class=\"d-flex align-items-center\">\n <span class=\"icon-sm icon-stack d-inline-block my-n2 me-2\">\n <si-icon class=\"status-danger\" [icon]=\"icons.elementCircleFilled\" />\n <si-icon class=\"status-danger-contrast\" [icon]=\"icons.elementStateExclamationMark\" />\n </span>\n <span class=\"text-danger\">{{\n uploadErrorMessage()\n | translate\n : {\n mb: currentFileSizeMegabytes(),\n kb: currentFileSizeKilobytes(),\n maxSizeMb: maxSizeMb()\n }\n }}</span>\n </div>\n</ng-template>\n\n<!-- Template: image cropper -->\n<ng-template #imageCropperTemplate>\n <si-image-cropper-style>\n <image-cropper\n #imageCropper\n output=\"base64\"\n [aspectRatio]=\"cropperAspectRatio()\"\n [containWithinAspectRatio]=\"cropperContainWithinAspectRatio()\"\n [cropperMinWidth]=\"cropperMinWidth()\"\n [cropperMinHeight]=\"cropperMinHeight()\"\n [cropperMaxWidth]=\"cropperMaxWidth()\"\n [cropperMaxHeight]=\"cropperMaxHeight()\"\n [cropperFrameAriaLabel]=\"cropperFrameAriaLabel() | translate\"\n [format]=\"cropperImageFormat()\"\n [imageBase64]=\"imageCropperPhoto()\"\n [imageURL]=\"sourcePhotoUrl()\"\n [maintainAspectRatio]=\"cropperMaintainAspectRatio()\"\n [onlyScaleDown]=\"true\"\n [roundCropper]=\"roundImage()\"\n (cropperReady)=\"cropperReady()\"\n (imageCropped)=\"cropperImageCropped($event)\"\n />\n </si-image-cropper-style>\n</ng-template>\n", styles: [":host{--si-photo-upload-photo-width: 200px;--si-photo-upload-photo-height: 200px}.photo-upload{box-sizing:content-box;max-inline-size:var(--si-photo-upload-photo-width)}.photo-upload-photo,.photo-upload-placeholder{display:block;margin:auto;inline-size:var(--si-photo-upload-photo-width);max-inline-size:100%;block-size:var(--si-photo-upload-photo-height);object-fit:cover}.photo-upload-photo.round,.photo-upload-placeholder.round{border-radius:50%}.photo-upload-placeholder{background-color:var(--background);color:var(--si-sys-text-inverse);font-size:3rem;text-align:center;overflow:hidden;word-break:break-all;-webkit-user-select:none;user-select:none}\n"] }]
|
|
467
500
|
}], propDecorators: { readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabledCropping: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledCropping", required: false }] }], acceptedUploadFormats: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptedUploadFormats", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], uploadErrorWrongType: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadErrorWrongType", required: false }] }], uploadErrorTooBig: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadErrorTooBig", required: false }] }], photoAltText: [{ type: i0.Input, args: [{ isSignal: true, alias: "photoAltText", required: false }] }], placeholderAltText: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderAltText", required: false }] }], changePhotoText: [{ type: i0.Input, args: [{ isSignal: true, alias: "changePhotoText", required: false }] }], cropperFrameAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperFrameAriaLabel", required: false }] }], uploadPhotoText: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadPhotoText", required: false }] }], removePhotoText: [{ type: i0.Input, args: [{ isSignal: true, alias: "removePhotoText", required: false }] }], cancelEditText: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelEditText", required: false }] }], applyEditText: [{ type: i0.Input, args: [{ isSignal: true, alias: "applyEditText", required: false }] }], modalHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalHeader", required: false }] }], modalDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalDescription", required: false }] }], cropperImageFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperImageFormat", required: false }] }], cropperAspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperAspectRatio", required: false }] }], cropperMaintainAspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperMaintainAspectRatio", required: false }] }], cropperContainWithinAspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperContainWithinAspectRatio", required: false }] }], cropperMinWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperMinWidth", required: false }] }], cropperMinHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperMinHeight", required: false }] }], cropperMaxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperMaxWidth", required: false }] }], cropperMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "cropperMaxHeight", required: false }] }], roundImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "roundImage", required: false }] }], sourcePhoto: [{ type: i0.Input, args: [{ isSignal: true, alias: "sourcePhoto", required: false }] }, { type: i0.Output, args: ["sourcePhotoChange"] }], sourcePhotoUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "sourcePhotoUrl", required: false }] }], croppedPhoto: [{ type: i0.Input, args: [{ isSignal: true, alias: "croppedPhoto", required: false }] }, { type: i0.Output, args: ["croppedPhotoChange"] }], editPhotoTemplate: [{ type: i0.ViewChild, args: ['editPhotoTemplate', { isSignal: true }] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], imageCropper: [{ type: i0.ViewChild, args: ['imageCropper', { isSignal: true }] }] } });
|
|
468
501
|
|
|
469
502
|
/**
|