@siemens/element-ng 49.14.0 → 51.0.0-rc.5
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 +58 -40
- 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 +15 -12
- package/fesm2022/siemens-element-ng-ag-grid.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-application-header.mjs +176 -166
- 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 +31 -21
- 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 +71 -46
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-carousel.mjs +57 -33
- package/fesm2022/siemens-element-ng-carousel.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +181 -117
- 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 +26 -17
- package/fesm2022/siemens-element-ng-color-picker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs +56 -35
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-common.mjs +12 -12
- 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 +36 -27
- 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 +335 -221
- package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datatable.mjs +8 -8
- package/fesm2022/siemens-element-ng-datatable.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +119 -72
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datepicker.mjs +376 -244
- 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 +32 -24
- package/fesm2022/siemens-element-ng-filter-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filtered-search.mjs +251 -153
- 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 +345 -113
- 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 +222 -316
- 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 +5 -5
- package/fesm2022/siemens-element-ng-help-button.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-icon.mjs +46 -47
- 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 +25 -25
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-landing-page.mjs +120 -74
- 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 +76 -56
- package/fesm2022/siemens-element-ng-list-details.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-loading-spinner.mjs +46 -63
- 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 +47 -30
- package/fesm2022/siemens-element-ng-main-detail-container.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-maplibre.mjs +42 -0
- package/fesm2022/siemens-element-ng-maplibre.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs +6 -5
- package/fesm2022/siemens-element-ng-markdown-renderer.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-menu.mjs +56 -48
- 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 +249 -204
- package/fesm2022/siemens-element-ng-navbar-vertical-next.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-navbar-vertical.mjs +120 -83
- 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 +40 -28
- 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 +32 -23
- package/fesm2022/siemens-element-ng-password-strength.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-password-toggle.mjs +18 -13
- package/fesm2022/siemens-element-ng-password-toggle.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-phone-number.mjs +123 -139
- package/fesm2022/siemens-element-ng-phone-number.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-photo-upload.mjs +84 -51
- package/fesm2022/siemens-element-ng-photo-upload.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-pills-input.mjs +63 -58
- 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 -31
- package/fesm2022/siemens-element-ng-search-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-select.mjs +218 -163
- package/fesm2022/siemens-element-ng-select.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-shadow-root.mjs +3 -3
- package/fesm2022/siemens-element-ng-side-panel.mjs +128 -86
- 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 +44 -29
- package/fesm2022/siemens-element-ng-slider.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-split.mjs +273 -293
- package/fesm2022/siemens-element-ng-split.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-status-bar.mjs +65 -51
- 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 +11 -8
- 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 +73 -70
- 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 +60 -41
- package/fesm2022/siemens-element-ng-threshold.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-toast-notification.mjs +45 -40
- package/fesm2022/siemens-element-ng-toast-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tooltip.mjs +105 -82
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tour.mjs +24 -18
- 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 +96 -75
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-typeahead.mjs +76 -70
- package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-wizard.mjs +72 -48
- 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 +715 -0
- package/package.json +37 -23
- 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/element-class-changes.js +1 -28
- package/schematics/migrations/data/element-migration-data.js +2 -0
- package/schematics/migrations/data/element-selectors.js +1 -11
- package/schematics/migrations/data/index.js +0 -4
- package/schematics/migrations/data/migration-test-data.js +9 -6
- package/schematics/migrations/data/provider-function-removals.js +7 -0
- package/schematics/migrations/data/symbol-removals.js +7 -7
- package/schematics/migrations/data/symbol-renaming.js +1 -48
- package/schematics/migrations/element-migration/element-migration.js +3 -6
- package/schematics/migrations/utilities/import-removal.js +39 -0
- package/schematics/migrations/utilities/index.js +2 -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-split-sizes.js +105 -0
- package/schematics/ng-update/{migrate-to-v49.js → migrate-to-v51.js} +5 -3
- package/template-i18n.json +45 -47
- package/types/siemens-element-ng-application-header.d.ts +8 -28
- package/types/siemens-element-ng-breadcrumb.d.ts +1 -1
- package/types/siemens-element-ng-chat-messages.d.ts +11 -9
- 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-date-range-filter.d.ts +1 -1
- package/types/siemens-element-ng-datepicker.d.ts +3 -14
- 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 +180 -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-ip-input.d.ts +1 -1
- package/types/siemens-element-ng-landing-page.d.ts +2 -2
- package/types/siemens-element-ng-loading-spinner.d.ts +7 -17
- package/types/siemens-element-ng-maplibre.d.ts +26 -0
- package/types/siemens-element-ng-navbar-vertical-next.d.ts +86 -38
- 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 +5 -8
- 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 +1 -1
- package/types/siemens-element-ng-select.d.ts +1 -1
- package/types/siemens-element-ng-side-panel.d.ts +3 -3
- package/types/siemens-element-ng-split.d.ts +99 -70
- 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-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 +2 -5
- 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-sort-bar.mjs +0 -99
- package/fesm2022/siemens-element-ng-sort-bar.mjs.map +0 -1
- package/icon-status/package.json +0 -4
- 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-sort-bar.d.ts +0 -59
- /package/{LICENSE.md → LICENSE} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-element-ng-markdown-renderer.mjs","sources":["../../../../projects/element-ng/markdown-renderer/markdown-renderer.ts","../../../../projects/element-ng/markdown-renderer/si-markdown-renderer.component.ts","../../../../projects/element-ng/markdown-renderer/index.ts","../../../../projects/element-ng/markdown-renderer/siemens-element-ng-markdown-renderer.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { SecurityContext } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\n/**\n * Returns a markdown renderer function which_\n * - Transforms markdown text into formatted HTML.\n * - Returns a DOM node containing the formatted content.\n *\n * **Warning:** The returned Node is inserted without additional sanitization.\n * Input content is sanitized before processing.\n *\n * @experimental\n * @param sanitizer - Angular DomSanitizer instance\n * @returns A function taking the markdown text to transform and returning a DOM div element containing the formatted HTML\n */\nexport const getMarkdownRenderer = (sanitizer: DomSanitizer): ((text: string) => Node) => {\n return (text: string): Node => {\n const div = document.createElement('div');\n div.className = 'markdown-content text-break';\n\n if (!text) {\n return div;\n }\n\n // Generate a random placeholder for newlines to preserve them during HTML sanitization\n const newlinePlaceholder = `--NEWLINE-${Math.random().toString(36).substring(2, 15)}--`;\n\n // Replace newlines with placeholder before sanitization\n const valueWithPlaceholders = text.replace(/\\n/g, newlinePlaceholder);\n\n // Sanitize the input using Angular's HTML sanitizer\n const sanitizedInput = sanitizer.sanitize(SecurityContext.HTML, valueWithPlaceholders) ?? '';\n\n // Restore newlines from placeholder for markdown processing.\n let html = sanitizedInput.replace(new RegExp(newlinePlaceholder, 'g'), '\\n');\n\n // Process tables first\n html = html\n // Remove table separator lines first\n .replace(/^\\|\\s*[-:]+.*\\|\\s*$/gm, '')\n // Process table rows\n .replace(/^\\|(.+)\\|\\s*$/gm, (_match, htmlContent) => {\n // Handle escaped pipes by temporarily replacing them\n const escapedPipePlaceholder = `--ESCAPED-PIPE-${Math.random().toString(36).substring(2, 15)}--`;\n const contentWithPlaceholders = htmlContent.replace(/\\\\\\|/g, escapedPipePlaceholder);\n const cells = contentWithPlaceholders.split('|').map((cell: string) => {\n const trimmedCell = cell.trim();\n // Restore escaped pipes\n const cellWithPipes = trimmedCell.replace(new RegExp(escapedPipePlaceholder, 'g'), '|');\n\n return cellWithPipes;\n });\n // Make cell ready for markdown processing by replacing code blocks with inline code and <br> with newlines\n const cellsWithNewlines = cells.map((cell: string) => {\n // Replace multiline code blocks with single line code blocks\n const cellWithoutMultilineCode = cell.replace(\n /```([\\s\\S]*?)```/g,\n (_innerMatch, inlineCodeContent) => {\n return '`' + inlineCodeContent.replace(/`/g, '') + '`';\n }\n );\n // Temporarily replace single line code blocks to avoid replacing <br> inside them\n const tableInlineCodeBrPlaceholder = `--INLINE-CODE-BR--${Math.random().toString(36).substring(2, 15)}--`;\n const cellWithPlaceholders = cellWithoutMultilineCode.replace(\n /(`[^`]*`)/g,\n inlineCodeMatch => {\n return inlineCodeMatch.replace(/<br>/g, tableInlineCodeBrPlaceholder);\n }\n );\n // Replace <br> with newlines\n const cellWithNewlines = cellWithPlaceholders.replace(/<br\\s*\\/?>/gi, '\\n');\n // Restore <br> in inline code placeholders\n const preProcessedCell = cellWithNewlines.replace(\n new RegExp(tableInlineCodeBrPlaceholder, 'g'),\n '<br>'\n );\n return preProcessedCell;\n });\n\n // Recursively process cell content for markdown formatting\n const processedCells = cellsWithNewlines.map((cell: string) => {\n return transformMarkdownText(cell, false, sanitizer);\n });\n\n return `<tr>${processedCells.map((cell: string) => `<td>${cell}</td>`).join('')}</tr>`;\n })\n // Wrap table rows in table elements\n .replace(/(<tr>.*?<\\/tr>)/gs, '<table class=\"table table-hover\">$1</table>')\n // Remove duplicate table tags\n .replace(/<\\/table>\\s*<table class=\"table table-hover\">/g, '');\n\n html = transformMarkdownText(html, true, sanitizer);\n\n div.innerHTML = html;\n return div;\n };\n};\n\nconst transformMarkdownText = (\n html: string,\n keepAdditionalNewlines = true,\n sanitizer: DomSanitizer\n): string => {\n // Generate a random placeholder for inner code blocks to prevent markdown processing inside them\n const innerCodeQuotePlaceholder = `--INNER-CODE-${Math.random().toString(36).substring(2, 15)}--`;\n const codeSectionPlaceholderMap = new Map<string, string>();\n\n const escapedAsteriskPlaceholder = `--ASTERISK-${Math.random().toString(36).substring(2, 15)}--`;\n const escapedUnderscorePlaceholder = `--UNDERSCORE-${Math.random().toString(36).substring(2, 15)}--`;\n\n // Apply markdown transformations to the sanitized content\n html = html\n // Multiline code blocks ```code``` with placeholder\n .replace(/```[^\\n]*\\n?([\\s\\S]*?)\\n?```/g, (match, content) => {\n // Escape HTML special characters in code blocks (not for security, but for correct display) and preserve inner backticks\n const code = `<pre><code>${content.replace(/</g, '<').replace(/>/g, '>').replace(/`/g, innerCodeQuotePlaceholder)}</code></pre>`;\n const codePlaceholder = `--CODE-BLOCK-${Math.random().toString(36).substring(2, 15)}--`;\n codeSectionPlaceholderMap.set(codePlaceholder, code);\n return codePlaceholder;\n })\n\n // Inline code `text`\n .replace(/`(.*?)`/g, (match, content) => {\n // Escape HTML special characters in inline code (not for security, but for correct display)\n const code = `<code>${content.replace(/</g, '<').replace(/>/g, '>')}</code>`;\n const codePlaceholder = `--INLINE-CODE-${Math.random().toString(36).substring(2, 15)}--`;\n codeSectionPlaceholderMap.set(codePlaceholder, code);\n return codePlaceholder;\n })\n\n // Images \n .replace(/!\\[([^\\]]*)\\]\\(([^)]+)\\)/g, (_match, alt, url) => {\n const sanitizedUrl = sanitizeUrl(url, sanitizer);\n const escapedAlt = alt\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n return `<img src=\"${sanitizedUrl}\" alt=\"${escapedAlt}\">`;\n })\n\n // Links [text](url)\n .replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, (_match, text, url) => {\n const sanitizedUrl = sanitizeUrl(url, sanitizer);\n return `<a href=\"${sanitizedUrl}\" target=\"_blank\" rel=\"noopener noreferrer\">${text}</a>`;\n })\n\n // Auto-detect URLs and convert to links\n .replace(/(?<![\"'=(])\\b(https?:\\/\\/[^\\s<]+[^\\s<.,;!?\"')\\]])/g, match => {\n const sanitizedUrl = sanitizeUrl(match, sanitizer);\n return `<a href=\"${sanitizedUrl}\" target=\"_blank\" rel=\"noopener noreferrer\">${match}</a>`;\n })\n\n .replace(/(?<!\\\\)\\\\\\*/g, escapedAsteriskPlaceholder)\n .replace(/(?<!\\\\)\\\\_/g, escapedUnderscorePlaceholder)\n\n // Bold **text** or __text__\n .replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>')\n .replace(/__(.*?)__/g, '<strong>$1</strong>')\n\n // Italic *text* or _text_\n .replace(/\\*(.*?)\\*/g, '<em>$1</em>')\n .replace(/_(.*?)_/g, '<em>$1</em>')\n\n .replace(new RegExp(escapedAsteriskPlaceholder, 'g'), '*')\n .replace(new RegExp(escapedUnderscorePlaceholder, 'g'), '_')\n\n // Headings #, ##, ###, etc.\n .replace(/^###### (.*$)/gm, '<strong>$1</strong>')\n .replace(/^##### (.*$)/gm, '<h5>$1</h5>')\n .replace(/^#### (.*$)/gm, '<h4>$1</h4>')\n .replace(/^### (.*$)/gm, '<h3>$1</h3>')\n .replace(/^## (.*$)/gm, '<h2>$1</h2>')\n .replace(/^# (.*$)/gm, '<h2><strong>$1</strong></h2>');\n\n html = html\n // Bullet points - handle each type separately (• gets converted to • by sanitizer)\n .replace(/^• (.*$)/gm, '<li class=\"unordered\">$1</li>')\n .replace(/^- (.*$)/gm, '<li class=\"unordered\">$1</li>')\n .replace(/^\\* (.*$)/gm, '<li class=\"unordered\">$1</li>')\n\n // Ordered list items (1., 2., 3., etc.)\n .replace(/^\\d+\\. (.*$)/gm, '<li class=\"ordered\">$1</li>');\n\n html = html.replace(/^\\s*(?:>|>)\\s*(.*)$/gm, '<blockquote>$1</blockquote>');\n\n // Generate a random placeholder for newlines to differentiate them from those used for paragraphs\n const finalNewlinePlaceholder = `--NEWLINE-${Math.random().toString(36).substring(2, 15)}--`;\n\n html = html\n // Wrap ordered lists\n .replace(/(<li class=\"ordered\">.*?<\\/li>)/gs, '<ol>$1</ol>')\n\n // Wrap unordered lists\n .replace(/(<li class=\"unordered\">.*?<\\/li>)/gs, '<ul>$1</ul>')\n\n // Remove duplicate ol/ul tags\n .replace(/<\\/ol>\\s*<ol>/g, '')\n .replace(/<\\/ul>\\s*<ul>/g, '')\n\n // Clean up class attributes\n .replace(/ class=\"ordered\"/g, '')\n .replace(/ class=\"unordered\"/g, '');\n\n html = html\n // Convert double newlines to paragraphs (before single line breaks)\n .split(/\\n{2}/g)\n // Wrap non-block elements in <p> tags\n .map(segment => {\n // If the segment starts with a block element, return as is\n if (!segment.trim() || /^\\s*<(h[1-6]|pre|blockquote|ul|ol)/.test(segment.trim())) {\n // Replace newlines inside blocks with the placeholder\n return segment.replace(/\\n/g, finalNewlinePlaceholder);\n }\n // Otherwise, wrap in <p> tags\n return `<p>${segment}</p>`;\n })\n // Use newline placeholder again so as not to replace newlines between blocks\n .join(finalNewlinePlaceholder)\n // Convert remaining newlines to line breaks (do this LAST)\n .replace(/\\n/g, '<br>')\n // Restore newline placeholders\n .replace(new RegExp(finalNewlinePlaceholder, 'g'), keepAdditionalNewlines ? '\\n' : ' ');\n\n // Restore code placeholders\n codeSectionPlaceholderMap.forEach((code, placeholder) => {\n html = html.replace(new RegExp(placeholder, 'g'), code);\n });\n\n // Restore inner code block placeholders\n html = html.replace(new RegExp(innerCodeQuotePlaceholder, 'g'), '`');\n\n return html;\n};\n\n/**\n * Sanitizes a URL to prevent XSS attacks\n * @param url - The URL to sanitize\n * @param sanitizer - Angular DomSanitizer instance\n * @returns The sanitized URL or '#' if invalid\n */\nconst sanitizeUrl = (url: string, sanitizer: DomSanitizer): string => {\n // Remove any whitespace\n url = url.trim();\n\n // Allow only http, https, and mailto protocols\n const allowed = /^(https?:\\/\\/|mailto:|\\/(?!\\/)|\\.{1,2}\\/|#)/i;\n\n // Sanitize the URL using Angular's sanitizer\n if (!allowed.test(url)) {\n return '#';\n }\n\n // Sanitize the URL using Angular's sanitizer\n const sanitized = sanitizer.sanitize(SecurityContext.URL, url);\n\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n return sanitized || '#';\n};\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {\n Component,\n effect,\n inject,\n input,\n ElementRef,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { getMarkdownRenderer } from './markdown-renderer';\n\n/**\n * Component to display markdown text, uses the {@link getMarkdownRenderer} function internally, relies on `markdown-content` theme class.\n * @experimental\n */\n@Component({\n selector: 'si-markdown-renderer',\n template: ``,\n changeDetection: ChangeDetectionStrategy.Default\n})\nexport class SiMarkdownRendererComponent {\n private sanitizer = inject(DomSanitizer);\n private hostElement = inject(ElementRef<HTMLElement>);\n private markdownRenderer = getMarkdownRenderer(this.sanitizer);\n\n /**\n * The markdown text to transform and display\n * @defaultValue ''\n */\n readonly text = input<string | undefined>();\n\n constructor() {\n effect(() => {\n const contentValue = this.text();\n const containerEl = this.hostElement.nativeElement;\n\n if (containerEl) {\n const formattedNode = this.markdownRenderer(contentValue ?? '');\n containerEl.innerHTML = '';\n containerEl.appendChild(formattedNode);\n }\n });\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-markdown-renderer.component';\nexport * from './markdown-renderer';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;;;;;;;;;;;AAWG;AACI,MAAM,mBAAmB,GAAG,CAAC,SAAuB,KAA8B;IACvF,OAAO,CAAC,IAAY,KAAU;QAC5B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACzC,QAAA,GAAG,CAAC,SAAS,GAAG,6BAA6B;QAE7C,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,OAAO,GAAG;QACZ;;QAGA,MAAM,kBAAkB,GAAG,CAAA,UAAA,EAAa,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAA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AA,EAAA,2BAA2B,iNAH5B,CAAA,CAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,OAAA,EAAA,CAAA;;2FAGD,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBALvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,QAAQ,EAAE,CAAA,CAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC;AAC1C,iBAAA;;;ACxBD;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"siemens-element-ng-markdown-renderer.mjs","sources":["../../../../projects/element-ng/markdown-renderer/markdown-renderer.ts","../../../../projects/element-ng/markdown-renderer/si-markdown-renderer.component.ts","../../../../projects/element-ng/markdown-renderer/index.ts","../../../../projects/element-ng/markdown-renderer/siemens-element-ng-markdown-renderer.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { SecurityContext } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\n/**\n * Returns a markdown renderer function which_\n * - Transforms markdown text into formatted HTML.\n * - Returns a DOM node containing the formatted content.\n *\n * **Warning:** The returned Node is inserted without additional sanitization.\n * Input content is sanitized before processing.\n *\n * @experimental\n * @param sanitizer - Angular DomSanitizer instance\n * @returns A function taking the markdown text to transform and returning a DOM div element containing the formatted HTML\n */\nexport const getMarkdownRenderer = (sanitizer: DomSanitizer): ((text: string) => Node) => {\n return (text: string): Node => {\n const div = document.createElement('div');\n div.className = 'markdown-content text-break';\n\n if (!text) {\n return div;\n }\n\n // Generate a random placeholder for newlines to preserve them during HTML sanitization\n const newlinePlaceholder = `--NEWLINE-${Math.random().toString(36).substring(2, 15)}--`;\n\n // Replace newlines with placeholder before sanitization\n const valueWithPlaceholders = text.replace(/\\n/g, newlinePlaceholder);\n\n // Sanitize the input using Angular's HTML sanitizer\n const sanitizedInput = sanitizer.sanitize(SecurityContext.HTML, valueWithPlaceholders) ?? '';\n\n // Restore newlines from placeholder for markdown processing.\n let html = sanitizedInput.replace(new RegExp(newlinePlaceholder, 'g'), '\\n');\n\n // Process tables first\n html = html\n // Remove table separator lines first\n .replace(/^\\|\\s*[-:]+.*\\|\\s*$/gm, '')\n // Process table rows\n .replace(/^\\|(.+)\\|\\s*$/gm, (_match, htmlContent) => {\n // Handle escaped pipes by temporarily replacing them\n const escapedPipePlaceholder = `--ESCAPED-PIPE-${Math.random().toString(36).substring(2, 15)}--`;\n const contentWithPlaceholders = htmlContent.replace(/\\\\\\|/g, escapedPipePlaceholder);\n const cells = contentWithPlaceholders.split('|').map((cell: string) => {\n const trimmedCell = cell.trim();\n // Restore escaped pipes\n const cellWithPipes = trimmedCell.replace(new RegExp(escapedPipePlaceholder, 'g'), '|');\n\n return cellWithPipes;\n });\n // Make cell ready for markdown processing by replacing code blocks with inline code and <br> with newlines\n const cellsWithNewlines = cells.map((cell: string) => {\n // Replace multiline code blocks with single line code blocks\n const cellWithoutMultilineCode = cell.replace(\n /```([\\s\\S]*?)```/g,\n (_innerMatch, inlineCodeContent) => {\n return '`' + inlineCodeContent.replace(/`/g, '') + '`';\n }\n );\n // Temporarily replace single line code blocks to avoid replacing <br> inside them\n const tableInlineCodeBrPlaceholder = `--INLINE-CODE-BR--${Math.random().toString(36).substring(2, 15)}--`;\n const cellWithPlaceholders = cellWithoutMultilineCode.replace(\n /(`[^`]*`)/g,\n inlineCodeMatch => {\n return inlineCodeMatch.replace(/<br>/g, tableInlineCodeBrPlaceholder);\n }\n );\n // Replace <br> with newlines\n const cellWithNewlines = cellWithPlaceholders.replace(/<br\\s*\\/?>/gi, '\\n');\n // Restore <br> in inline code placeholders\n const preProcessedCell = cellWithNewlines.replace(\n new RegExp(tableInlineCodeBrPlaceholder, 'g'),\n '<br>'\n );\n return preProcessedCell;\n });\n\n // Recursively process cell content for markdown formatting\n const processedCells = cellsWithNewlines.map((cell: string) => {\n return transformMarkdownText(cell, false, sanitizer);\n });\n\n return `<tr>${processedCells.map((cell: string) => `<td>${cell}</td>`).join('')}</tr>`;\n })\n // Wrap table rows in table elements\n .replace(/(<tr>.*?<\\/tr>)/gs, '<table class=\"table table-hover\">$1</table>')\n // Remove duplicate table tags\n .replace(/<\\/table>\\s*<table class=\"table table-hover\">/g, '');\n\n html = transformMarkdownText(html, true, sanitizer);\n\n div.innerHTML = html;\n return div;\n };\n};\n\nconst transformMarkdownText = (\n html: string,\n keepAdditionalNewlines = true,\n sanitizer: DomSanitizer\n): string => {\n // Generate a random placeholder for inner code blocks to prevent markdown processing inside them\n const innerCodeQuotePlaceholder = `--INNER-CODE-${Math.random().toString(36).substring(2, 15)}--`;\n const codeSectionPlaceholderMap = new Map<string, string>();\n\n const escapedAsteriskPlaceholder = `--ASTERISK-${Math.random().toString(36).substring(2, 15)}--`;\n const escapedUnderscorePlaceholder = `--UNDERSCORE-${Math.random().toString(36).substring(2, 15)}--`;\n\n // Apply markdown transformations to the sanitized content\n html = html\n // Multiline code blocks ```code``` with placeholder\n .replace(/```[^\\n]*\\n?([\\s\\S]*?)\\n?```/g, (match, content) => {\n // Escape HTML special characters in code blocks (not for security, but for correct display) and preserve inner backticks\n const code = `<pre><code>${content.replace(/</g, '<').replace(/>/g, '>').replace(/`/g, innerCodeQuotePlaceholder)}</code></pre>`;\n const codePlaceholder = `--CODE-BLOCK-${Math.random().toString(36).substring(2, 15)}--`;\n codeSectionPlaceholderMap.set(codePlaceholder, code);\n return codePlaceholder;\n })\n\n // Inline code `text`\n .replace(/`(.*?)`/g, (match, content) => {\n // Escape HTML special characters in inline code (not for security, but for correct display)\n const code = `<code>${content.replace(/</g, '<').replace(/>/g, '>')}</code>`;\n const codePlaceholder = `--INLINE-CODE-${Math.random().toString(36).substring(2, 15)}--`;\n codeSectionPlaceholderMap.set(codePlaceholder, code);\n return codePlaceholder;\n })\n\n // Images \n .replace(/!\\[([^\\]]*)\\]\\(([^)]+)\\)/g, (_match, alt, url) => {\n const sanitizedUrl = sanitizeUrl(url, sanitizer);\n const escapedAlt = alt\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n return `<img src=\"${sanitizedUrl}\" alt=\"${escapedAlt}\">`;\n })\n\n // Links [text](url)\n .replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, (_match, text, url) => {\n const sanitizedUrl = sanitizeUrl(url, sanitizer);\n return `<a href=\"${sanitizedUrl}\" target=\"_blank\" rel=\"noopener noreferrer\">${text}</a>`;\n })\n\n // Auto-detect URLs and convert to links\n .replace(/(?<![\"'=(])\\b(https?:\\/\\/[^\\s<]+[^\\s<.,;!?\"')\\]])/g, match => {\n const sanitizedUrl = sanitizeUrl(match, sanitizer);\n return `<a href=\"${sanitizedUrl}\" target=\"_blank\" rel=\"noopener noreferrer\">${match}</a>`;\n })\n\n .replace(/(?<!\\\\)\\\\\\*/g, escapedAsteriskPlaceholder)\n .replace(/(?<!\\\\)\\\\_/g, escapedUnderscorePlaceholder)\n\n // Bold **text** or __text__\n .replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>')\n .replace(/__(.*?)__/g, '<strong>$1</strong>')\n\n // Italic *text* or _text_\n .replace(/\\*(.*?)\\*/g, '<em>$1</em>')\n .replace(/_(.*?)_/g, '<em>$1</em>')\n\n .replace(new RegExp(escapedAsteriskPlaceholder, 'g'), '*')\n .replace(new RegExp(escapedUnderscorePlaceholder, 'g'), '_')\n\n // Headings #, ##, ###, etc.\n .replace(/^###### (.*$)/gm, '<strong>$1</strong>')\n .replace(/^##### (.*$)/gm, '<h5>$1</h5>')\n .replace(/^#### (.*$)/gm, '<h4>$1</h4>')\n .replace(/^### (.*$)/gm, '<h3>$1</h3>')\n .replace(/^## (.*$)/gm, '<h2>$1</h2>')\n .replace(/^# (.*$)/gm, '<h2><strong>$1</strong></h2>');\n\n html = html\n // Bullet points - handle each type separately (• gets converted to • by sanitizer)\n .replace(/^• (.*$)/gm, '<li class=\"unordered\">$1</li>')\n .replace(/^- (.*$)/gm, '<li class=\"unordered\">$1</li>')\n .replace(/^\\* (.*$)/gm, '<li class=\"unordered\">$1</li>')\n\n // Ordered list items (1., 2., 3., etc.)\n .replace(/^\\d+\\. (.*$)/gm, '<li class=\"ordered\">$1</li>');\n\n html = html.replace(/^\\s*(?:>|>)\\s*(.*)$/gm, '<blockquote>$1</blockquote>');\n\n // Generate a random placeholder for newlines to differentiate them from those used for paragraphs\n const finalNewlinePlaceholder = `--NEWLINE-${Math.random().toString(36).substring(2, 15)}--`;\n\n html = html\n // Wrap ordered lists\n .replace(/(<li class=\"ordered\">.*?<\\/li>)/gs, '<ol>$1</ol>')\n\n // Wrap unordered lists\n .replace(/(<li class=\"unordered\">.*?<\\/li>)/gs, '<ul>$1</ul>')\n\n // Remove duplicate ol/ul tags\n .replace(/<\\/ol>\\s*<ol>/g, '')\n .replace(/<\\/ul>\\s*<ul>/g, '')\n\n // Clean up class attributes\n .replace(/ class=\"ordered\"/g, '')\n .replace(/ class=\"unordered\"/g, '');\n\n html = html\n // Convert double newlines to paragraphs (before single line breaks)\n .split(/\\n{2}/g)\n // Wrap non-block elements in <p> tags\n .map(segment => {\n // If the segment starts with a block element, return as is\n if (!segment.trim() || /^\\s*<(h[1-6]|pre|blockquote|ul|ol)/.test(segment.trim())) {\n // Replace newlines inside blocks with the placeholder\n return segment.replace(/\\n/g, finalNewlinePlaceholder);\n }\n // Otherwise, wrap in <p> tags\n return `<p>${segment}</p>`;\n })\n // Use newline placeholder again so as not to replace newlines between blocks\n .join(finalNewlinePlaceholder)\n // Convert remaining newlines to line breaks (do this LAST)\n .replace(/\\n/g, '<br>')\n // Restore newline placeholders\n .replace(new RegExp(finalNewlinePlaceholder, 'g'), keepAdditionalNewlines ? '\\n' : ' ');\n\n // Restore code placeholders\n codeSectionPlaceholderMap.forEach((code, placeholder) => {\n html = html.replace(new RegExp(placeholder, 'g'), code);\n });\n\n // Restore inner code block placeholders\n html = html.replace(new RegExp(innerCodeQuotePlaceholder, 'g'), '`');\n\n return html;\n};\n\n/**\n * Sanitizes a URL to prevent XSS attacks\n * @param url - The URL to sanitize\n * @param sanitizer - Angular DomSanitizer instance\n * @returns The sanitized URL or '#' if invalid\n */\nconst sanitizeUrl = (url: string, sanitizer: DomSanitizer): string => {\n // Remove any whitespace\n url = url.trim();\n\n // Allow only http, https, and mailto protocols\n const allowed = /^(https?:\\/\\/|mailto:|\\/(?!\\/)|\\.{1,2}\\/|#)/i;\n\n // Sanitize the URL using Angular's sanitizer\n if (!allowed.test(url)) {\n return '#';\n }\n\n // Sanitize the URL using Angular's sanitizer\n const sanitized = sanitizer.sanitize(SecurityContext.URL, url);\n\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n return sanitized || '#';\n};\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {\n Component,\n effect,\n inject,\n input,\n ElementRef,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { getMarkdownRenderer } from './markdown-renderer';\n\n/**\n * Component to display markdown text, uses the {@link getMarkdownRenderer} function internally, relies on `markdown-content` theme class.\n * @experimental\n */\n@Component({\n selector: 'si-markdown-renderer',\n template: ``,\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class SiMarkdownRendererComponent {\n private sanitizer = inject(DomSanitizer);\n private hostElement = inject(ElementRef<HTMLElement>);\n private markdownRenderer = getMarkdownRenderer(this.sanitizer);\n\n /**\n * The markdown text to transform and display\n * @defaultValue ''\n */\n readonly text = input<string | undefined>();\n\n constructor() {\n effect(() => {\n const contentValue = this.text();\n const containerEl = this.hostElement.nativeElement;\n\n if (containerEl) {\n const formattedNode = this.markdownRenderer(contentValue ?? '');\n containerEl.innerHTML = '';\n containerEl.appendChild(formattedNode);\n }\n });\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-markdown-renderer.component';\nexport * from './markdown-renderer';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;;;;;;;;;;;AAWG;AACI,MAAM,mBAAmB,GAAG,CAAC,SAAuB,KAA8B;IACvF,OAAO,CAAC,IAAY,KAAU;QAC5B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACzC,QAAA,GAAG,CAAC,SAAS,GAAG,6BAA6B;QAE7C,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,OAAO,GAAG;QACZ;;QAGA,MAAM,kBAAkB,GAAG,CAAA,UAAA,EAAa,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI;;QAGvF,MAAM,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC;;AAGrE,QAAA,MAAM,cAAc,GAAG,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,qBAAqB,CAAC,IAAI,EAAE;;AAG5F,QAAA,IAAI,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,kBAAkB,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC;;AAG5E,QAAA,IAAI,GAAG;;AAEJ,aAAA,OAAO,CAAC,uBAAuB,EAAE,EAAE;;aAEnC,OAAO,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAI;;YAElD,MAAM,sBAAsB,GAAG,CAAA,eAAA,EAAkB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI;YAChG,MAAM,uBAAuB,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,sBAAsB,CAAC;AACpF,YAAA,MAAM,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,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,IAAI,EAAE,CAAC;AAC/D,gBAAA,WAAW,CAAC,SAAS,GAAG,EAAE;AAC1B,gBAAA,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC;YACxC;AACF,QAAA,CAAC,CAAC;IACJ;uGAtBW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,2BAA2B,iNAH5B,CAAA,CAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA;;2FAGD,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBALvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,QAAQ,EAAE,CAAA,CAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC;AAC1C,iBAAA;;;ACxBD;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, Directive, booleanAttribute, computed,
|
|
2
|
+
import { inject, input, Directive, booleanAttribute, computed, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/cdk/menu';
|
|
4
4
|
import { CdkMenuBar, CdkTargetMenuAim, CdkMenuItemCheckbox, CDK_MENU, CdkMenuTrigger, CdkMenuItemRadio, CdkMenuItem, CdkMenu, CdkMenuGroup } from '@angular/cdk/menu';
|
|
5
5
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -22,11 +22,12 @@ class SiMenuBarDirective {
|
|
|
22
22
|
/**
|
|
23
23
|
* Sets the menu-bar disabled, i.e. sets tabindex="-1"
|
|
24
24
|
*/
|
|
25
|
-
disabled = input(
|
|
26
|
-
|
|
27
|
-
static
|
|
25
|
+
disabled = input(/* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [undefined, { debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuBarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
28
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: SiMenuBarDirective, isStandalone: true, selector: "si-menu-bar", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "tabindex": "tabIndex" }, styleAttribute: "gap: 1px", classAttribute: "d-inline-flex" }, hostDirectives: [{ directive: i1.CdkMenuBar }, { directive: i1.CdkTargetMenuAim }], ngImport: i0 });
|
|
28
29
|
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuBarDirective, decorators: [{
|
|
30
31
|
type: Directive,
|
|
31
32
|
args: [{
|
|
32
33
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -45,10 +46,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
45
46
|
* SPDX-License-Identifier: MIT
|
|
46
47
|
*/
|
|
47
48
|
class SiMenuDividerDirective {
|
|
48
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
49
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuDividerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
50
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SiMenuDividerDirective, isStandalone: true, selector: "si-menu-divider", host: { classAttribute: "d-block dropdown-divider" }, ngImport: i0 });
|
|
50
51
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuDividerDirective, decorators: [{
|
|
52
53
|
type: Directive,
|
|
53
54
|
args: [{
|
|
54
55
|
// violating eslint rule, to a have clean API
|
|
@@ -76,10 +77,10 @@ class SiMenuFactoryItemGuardDirective {
|
|
|
76
77
|
static ngTemplateContextGuard(dir, ctx) {
|
|
77
78
|
return true;
|
|
78
79
|
}
|
|
79
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
80
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuFactoryItemGuardDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
81
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SiMenuFactoryItemGuardDirective, isStandalone: true, selector: "[siMenuFactoryItemGuard]", ngImport: i0 });
|
|
81
82
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuFactoryItemGuardDirective, decorators: [{
|
|
83
84
|
type: Directive,
|
|
84
85
|
args: [{ selector: '[siMenuFactoryItemGuard]' }]
|
|
85
86
|
}] });
|
|
@@ -89,10 +90,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
89
90
|
* SPDX-License-Identifier: MIT
|
|
90
91
|
*/
|
|
91
92
|
class SiMenuHeaderDirective {
|
|
92
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
93
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
94
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SiMenuHeaderDirective, isStandalone: true, selector: "si-menu-header", host: { classAttribute: "dropdown-item-text dropdown-header" }, ngImport: i0 });
|
|
94
95
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuHeaderDirective, decorators: [{
|
|
96
97
|
type: Directive,
|
|
97
98
|
args: [{
|
|
98
99
|
// violating eslint rule, to a have clean API
|
|
@@ -109,23 +110,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
109
110
|
* SPDX-License-Identifier: MIT
|
|
110
111
|
*/
|
|
111
112
|
class SiMenuItemBase {
|
|
112
|
-
badge = input(
|
|
113
|
+
badge = input(/* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [undefined, { debugName: "badge" }] : /* istanbul ignore next */ []));
|
|
113
115
|
/**
|
|
114
116
|
* @defaultValue 'secondary'
|
|
115
117
|
*/
|
|
116
|
-
badgeColor = input('secondary',
|
|
117
|
-
|
|
118
|
+
badgeColor = input('secondary', /* @ts-ignore */
|
|
119
|
+
...(ngDevMode ? [{ debugName: "badgeColor" }] : /* istanbul ignore next */ []));
|
|
120
|
+
icon = input(/* @ts-ignore */
|
|
121
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
118
122
|
/** @defaultValue false */
|
|
119
|
-
iconBadgeDot = input(false,
|
|
123
|
+
iconBadgeDot = input(false, /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "iconBadgeDot" }] : /* istanbul ignore next */ []));
|
|
120
125
|
/** @defaultValue false */
|
|
121
|
-
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
126
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
122
127
|
badgeDotHasContent = computed(() => {
|
|
123
128
|
return typeof this.iconBadgeDot() === 'string' || typeof this.iconBadgeDot() === 'number';
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
static
|
|
129
|
+
}, /* @ts-ignore */
|
|
130
|
+
...(ngDevMode ? [{ debugName: "badgeDotHasContent" }] : /* istanbul ignore next */ []));
|
|
131
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuItemBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
132
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: SiMenuItemBase, isStandalone: true, inputs: { badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgeColor: { classPropertyName: "badgeColor", publicName: "badgeColor", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconBadgeDot: { classPropertyName: "iconBadgeDot", publicName: "iconBadgeDot", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.disabled": "disabled()" }, classAttribute: "dropdown-item d-flex focus-inside" }, ngImport: i0 });
|
|
127
133
|
}
|
|
128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuItemBase, decorators: [{
|
|
129
135
|
type: Directive,
|
|
130
136
|
args: [{
|
|
131
137
|
host: {
|
|
@@ -146,12 +152,12 @@ class SiMenuItemCheckboxComponent extends SiMenuItemBase {
|
|
|
146
152
|
get checked() {
|
|
147
153
|
return this.cdkMenuItemCheckbox.checked;
|
|
148
154
|
}
|
|
149
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
150
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuItemCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
156
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: SiMenuItemCheckboxComponent, isStandalone: true, selector: "si-menu-item-checkbox, button[si-menu-item-checkbox]", usesInheritance: true, hostDirectives: [{ directive: i1.CdkMenuItemCheckbox, inputs: ["cdkMenuItemChecked", "checked", "cdkMenuItemDisabled", "disabled"], outputs: ["cdkMenuItemTriggered", "triggered"] }, { directive: i1.CdkMenuTrigger }], ngImport: i0, template: "<div class=\"item-wrapper\">\n @let iconValue = icon();\n @if (iconValue && !badgeDotHasContent()) {\n <si-icon class=\"icon\" [class.badge-dot]=\"iconBadgeDot()\" [icon]=\"iconValue\" />\n } @else if (iconValue && badgeDotHasContent()) {\n <si-icon class=\"icon badge-dot\" [icon]=\"iconValue\" />\n <span class=\"badge-text\">{{ iconBadgeDot() }}</span>\n }\n <span class=\"item-title\">\n <ng-content />\n </span>\n <div class=\"item-end ms-2 d-flex me-n3 gap-1\">\n @if (badge()) {\n <span class=\"mx-0 badge\" [class]=\"`bg-${badgeColor()}`\">{{ badge() }}</span>\n }\n @if (checked && !hideCheckmark) {\n <si-icon class=\"icon\" [icon]=\"icons.elementOk\" />\n }\n </div>\n</div>\n", styles: [".item-wrapper{display:flex;align-items:center;flex:1;min-inline-size:1.25rem}.item-title:empty,.item-end:empty{display:none!important}:host-context(si-menu-bar,si-content-action-bar){color:var(--element-action-secondary-text);background:var(--element-base-1);padding-inline:8px}:host-context(si-menu-bar,si-content-action-bar) .item-wrapper{justify-content:center}:host-context(si-menu-bar,si-content-action-bar) .icon{margin-inline:0}:host-context(si-menu-bar,si-content-action-bar) .item-end{margin-inline-end:0!important}:host-context(si-menu-bar,si-content-action-bar) .item-title{padding-inline-start:0;flex:0 1 auto}:host-context(si-menu-bar,si-content-action-bar) .item-title:empty+.item-end .submenu{display:none}:host-context(si-menu-bar,si-content-action-bar) .icon+.item-title{padding-inline-start:4px}:host-context(si-menu-bar,si-content-action-bar) .item-end .submenu{transform:rotate(90deg)}:host-context(si-menu-bar,si-content-action-bar)[aria-expanded=true] .item-end .submenu{transform:rotate(270deg)}:host-context(si-menu-bar,si-content-action-bar)[aria-haspopup] .icon{margin-inline:0}:host-context(si-menu-bar,si-content-action-bar)[aria-haspopup] .item-title{padding-inline-start:4px!important}:host-context(si-menu-bar,si-content-action-bar):focus,:host-context(si-menu-bar,si-content-action-bar).focus{color:var(--element-action-secondary-text);background:var(--element-base-1)}:host-context(si-menu-bar,si-content-action-bar):hover,:host-context(si-menu-bar,si-content-action-bar).hover{color:var(--element-action-secondary-text-hover);background:var(--element-action-secondary-hover)}:host-context(si-menu-bar,si-content-action-bar):active,:host-context(si-menu-bar,si-content-action-bar).active,:host-context(si-menu-bar,si-content-action-bar)[aria-expanded=true]{color:var(--element-action-primary-active);background:var(--element-action-secondary-active)}:host-context(si-menu-bar,si-content-action-bar):disabled,:host-context(si-menu-bar,si-content-action-bar).disabled{opacity:var(--element-action-disabled-opacity);color:var(--element-action-secondary-text);background:var(--element-base-1)}:host-context(.card-outline){background:transparent}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }] });
|
|
151
157
|
}
|
|
152
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuItemCheckboxComponent, decorators: [{
|
|
153
159
|
type: Component,
|
|
154
|
-
args: [{ selector: 'si-menu-item-checkbox, button[si-menu-item-checkbox]', imports: [SiIconComponent],
|
|
160
|
+
args: [{ selector: 'si-menu-item-checkbox, button[si-menu-item-checkbox]', imports: [SiIconComponent], hostDirectives: [
|
|
155
161
|
{
|
|
156
162
|
directive: CdkMenuItemCheckbox,
|
|
157
163
|
inputs: ['cdkMenuItemChecked: checked', 'cdkMenuItemDisabled: disabled'],
|
|
@@ -171,12 +177,12 @@ class SiMenuItemRadioComponent extends SiMenuItemBase {
|
|
|
171
177
|
get checked() {
|
|
172
178
|
return this.cdkMenuItemRadio.checked;
|
|
173
179
|
}
|
|
174
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
175
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
180
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuItemRadioComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: SiMenuItemRadioComponent, isStandalone: true, selector: "si-menu-item-radio", usesInheritance: true, hostDirectives: [{ directive: i1.CdkMenuItemRadio, inputs: ["cdkMenuItemChecked", "checked", "cdkMenuItemDisabled", "disabled"], outputs: ["cdkMenuItemTriggered", "triggered"] }, { directive: i1.CdkMenuTrigger }], ngImport: i0, template: "<div class=\"item-wrapper\">\n @let iconValue = icon();\n @if (iconValue && !badgeDotHasContent()) {\n <si-icon class=\"icon\" [class.badge-dot]=\"iconBadgeDot()\" [icon]=\"iconValue\" />\n } @else if (iconValue && badgeDotHasContent()) {\n <si-icon class=\"icon badge-dot\" [icon]=\"iconValue\" />\n <span class=\"badge-text\">{{ iconBadgeDot() }}</span>\n }\n <span class=\"item-title\">\n <ng-content />\n </span>\n <div class=\"item-end ms-2 d-flex me-n3 gap-1\">\n @if (badge()) {\n <span class=\"mx-0 badge\" [class]=\"`bg-${badgeColor()}`\">{{ badge() }}</span>\n }\n @if (checked) {\n <si-icon class=\"icon-sm me-1\" [icon]=\"icons.elementRecordFilled\" />\n }\n </div>\n</div>\n", styles: [".item-wrapper{display:flex;align-items:center;flex:1;min-inline-size:1.25rem}.item-title:empty,.item-end:empty{display:none!important}:host-context(si-menu-bar,si-content-action-bar){color:var(--element-action-secondary-text);background:var(--element-base-1);padding-inline:8px}:host-context(si-menu-bar,si-content-action-bar) .item-wrapper{justify-content:center}:host-context(si-menu-bar,si-content-action-bar) .icon{margin-inline:0}:host-context(si-menu-bar,si-content-action-bar) .item-end{margin-inline-end:0!important}:host-context(si-menu-bar,si-content-action-bar) .item-title{padding-inline-start:0;flex:0 1 auto}:host-context(si-menu-bar,si-content-action-bar) .item-title:empty+.item-end .submenu{display:none}:host-context(si-menu-bar,si-content-action-bar) .icon+.item-title{padding-inline-start:4px}:host-context(si-menu-bar,si-content-action-bar) .item-end .submenu{transform:rotate(90deg)}:host-context(si-menu-bar,si-content-action-bar)[aria-expanded=true] .item-end .submenu{transform:rotate(270deg)}:host-context(si-menu-bar,si-content-action-bar)[aria-haspopup] .icon{margin-inline:0}:host-context(si-menu-bar,si-content-action-bar)[aria-haspopup] .item-title{padding-inline-start:4px!important}:host-context(si-menu-bar,si-content-action-bar):focus,:host-context(si-menu-bar,si-content-action-bar).focus{color:var(--element-action-secondary-text);background:var(--element-base-1)}:host-context(si-menu-bar,si-content-action-bar):hover,:host-context(si-menu-bar,si-content-action-bar).hover{color:var(--element-action-secondary-text-hover);background:var(--element-action-secondary-hover)}:host-context(si-menu-bar,si-content-action-bar):active,:host-context(si-menu-bar,si-content-action-bar).active,:host-context(si-menu-bar,si-content-action-bar)[aria-expanded=true]{color:var(--element-action-primary-active);background:var(--element-action-secondary-active)}:host-context(si-menu-bar,si-content-action-bar):disabled,:host-context(si-menu-bar,si-content-action-bar).disabled{opacity:var(--element-action-disabled-opacity);color:var(--element-action-secondary-text);background:var(--element-base-1)}:host-context(.card-outline){background:transparent}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }] });
|
|
176
182
|
}
|
|
177
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuItemRadioComponent, decorators: [{
|
|
178
184
|
type: Component,
|
|
179
|
-
args: [{ selector: 'si-menu-item-radio', imports: [SiIconComponent],
|
|
185
|
+
args: [{ selector: 'si-menu-item-radio', imports: [SiIconComponent], hostDirectives: [
|
|
180
186
|
{
|
|
181
187
|
directive: CdkMenuItemRadio,
|
|
182
188
|
inputs: ['cdkMenuItemChecked: checked', 'cdkMenuItemDisabled: disabled'],
|
|
@@ -196,12 +202,12 @@ class SiMenuItemComponent extends SiMenuItemBase {
|
|
|
196
202
|
get hasSubmenu() {
|
|
197
203
|
return !!this.menuTrigger?.menuTemplateRef;
|
|
198
204
|
}
|
|
199
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
200
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
205
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
206
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: SiMenuItemComponent, isStandalone: true, selector: "si-menu-item, a[si-menu-item], button[si-menu-item]", usesInheritance: true, hostDirectives: [{ directive: i1.CdkMenuItem, inputs: ["cdkMenuItemDisabled", "disabled"], outputs: ["cdkMenuItemTriggered", "triggered"] }], ngImport: i0, template: "<div class=\"item-wrapper\">\n @let iconValue = icon();\n @if (iconValue && !badgeDotHasContent()) {\n <si-icon class=\"icon\" [class.badge-dot]=\"iconBadgeDot()\" [icon]=\"iconValue\" />\n } @else if (iconValue && badgeDotHasContent()) {\n <si-icon class=\"icon badge-dot\" [icon]=\"iconValue\" />\n <span class=\"badge-text\">{{ iconBadgeDot() }}</span>\n }\n <span class=\"item-title\">\n <ng-content />\n </span>\n <div class=\"item-end ms-2 d-flex me-n3 gap-1\">\n @if (badge()) {\n <span class=\"mx-0 badge\" [class]=\"`bg-${badgeColor()}`\">{{ badge() }}</span>\n }\n <ng-content select=\".end\" />\n @if (hasSubmenu) {\n <si-icon class=\"icon submenu\" [icon]=\"icons.elementRight2\" />\n }\n </div>\n</div>\n", styles: [".item-wrapper{display:flex;align-items:center;flex:1;min-inline-size:1.25rem}.item-title:empty,.item-end:empty{display:none!important}:host-context(si-menu-bar,si-content-action-bar){color:var(--element-action-secondary-text);background:var(--element-base-1);padding-inline:8px}:host-context(si-menu-bar,si-content-action-bar) .item-wrapper{justify-content:center}:host-context(si-menu-bar,si-content-action-bar) .icon{margin-inline:0}:host-context(si-menu-bar,si-content-action-bar) .item-end{margin-inline-end:0!important}:host-context(si-menu-bar,si-content-action-bar) .item-title{padding-inline-start:0;flex:0 1 auto}:host-context(si-menu-bar,si-content-action-bar) .item-title:empty+.item-end .submenu{display:none}:host-context(si-menu-bar,si-content-action-bar) .icon+.item-title{padding-inline-start:4px}:host-context(si-menu-bar,si-content-action-bar) .item-end .submenu{transform:rotate(90deg)}:host-context(si-menu-bar,si-content-action-bar)[aria-expanded=true] .item-end .submenu{transform:rotate(270deg)}:host-context(si-menu-bar,si-content-action-bar)[aria-haspopup] .icon{margin-inline:0}:host-context(si-menu-bar,si-content-action-bar)[aria-haspopup] .item-title{padding-inline-start:4px!important}:host-context(si-menu-bar,si-content-action-bar):focus,:host-context(si-menu-bar,si-content-action-bar).focus{color:var(--element-action-secondary-text);background:var(--element-base-1)}:host-context(si-menu-bar,si-content-action-bar):hover,:host-context(si-menu-bar,si-content-action-bar).hover{color:var(--element-action-secondary-text-hover);background:var(--element-action-secondary-hover)}:host-context(si-menu-bar,si-content-action-bar):active,:host-context(si-menu-bar,si-content-action-bar).active,:host-context(si-menu-bar,si-content-action-bar)[aria-expanded=true]{color:var(--element-action-primary-active);background:var(--element-action-secondary-active)}:host-context(si-menu-bar,si-content-action-bar):disabled,:host-context(si-menu-bar,si-content-action-bar).disabled{opacity:var(--element-action-disabled-opacity);color:var(--element-action-secondary-text);background:var(--element-base-1)}:host-context(.card-outline){background:transparent}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }] });
|
|
201
207
|
}
|
|
202
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuItemComponent, decorators: [{
|
|
203
209
|
type: Component,
|
|
204
|
-
args: [{ selector: 'si-menu-item, a[si-menu-item], button[si-menu-item]', imports: [SiIconComponent],
|
|
210
|
+
args: [{ selector: 'si-menu-item, a[si-menu-item], button[si-menu-item]', imports: [SiIconComponent], hostDirectives: [
|
|
205
211
|
{
|
|
206
212
|
directive: CdkMenuItem,
|
|
207
213
|
inputs: ['cdkMenuItemDisabled: disabled'],
|
|
@@ -215,10 +221,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
215
221
|
* SPDX-License-Identifier: MIT
|
|
216
222
|
*/
|
|
217
223
|
class SiMenuDirective {
|
|
218
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
219
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
224
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
225
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: SiMenuDirective, isStandalone: true, selector: "si-menu", host: { classAttribute: "d-block dropdown-menu position-static" }, hostDirectives: [{ directive: i1.CdkMenu }, { directive: i1.CdkTargetMenuAim }], ngImport: i0 });
|
|
220
226
|
}
|
|
221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuDirective, decorators: [{
|
|
222
228
|
type: Directive,
|
|
223
229
|
args: [{
|
|
224
230
|
// violating eslint rule, to a have clean API
|
|
@@ -236,8 +242,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
236
242
|
* SPDX-License-Identifier: MIT
|
|
237
243
|
*/
|
|
238
244
|
class SiMenuFactoryComponent {
|
|
239
|
-
items = input(
|
|
240
|
-
|
|
245
|
+
items = input(/* @ts-ignore */
|
|
246
|
+
...(ngDevMode ? [undefined, { debugName: "items" }] : /* istanbul ignore next */ []));
|
|
247
|
+
actionParam = input(/* @ts-ignore */
|
|
248
|
+
...(ngDevMode ? [undefined, { debugName: "actionParam" }] : /* istanbul ignore next */ []));
|
|
241
249
|
linkActionService = inject(SiLinkActionService, { optional: true });
|
|
242
250
|
menuActionService = inject(SiMenuActionService, { optional: true });
|
|
243
251
|
isNewItemStyle(item) {
|
|
@@ -262,10 +270,10 @@ class SiMenuFactoryComponent {
|
|
|
262
270
|
this.menuActionService?.actionTriggered(item, this.actionParam());
|
|
263
271
|
}
|
|
264
272
|
}
|
|
265
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
266
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuFactoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
274
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: SiMenuFactoryComponent, isStandalone: true, selector: "si-menu-factory", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<si-menu>\n @for (item of items(); track item) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\" />\n }\n <ng-template #itemTemplate let-item siMenuFactoryItemGuard>\n @if (isNewItemStyle(item)) {\n @switch (item.type) {\n @case ('group') {\n <si-menu-item\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [cdkMenuTriggerFor]=\"submenu\"\n [cdkMenuTriggerData]=\"{ $implicit: item.children }\"\n >{{ item.label | translate }}\n </si-menu-item>\n <ng-template #submenu>\n <si-menu-factory [items]=\"item.children\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @case ('action') {\n <si-menu-item\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n (triggered)=\"runAction(item)\"\n >{{ item.label | translate }}\n </si-menu-item>\n }\n @case ('router-link') {\n <a\n si-menu-item\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [routerLink]=\"item.routerLink\"\n [queryParams]=\"item.extras?.queryParams\"\n [queryParamsHandling]=\"item.extras?.queryParamsHandling\"\n [fragment]=\"item.extras?.fragment\"\n [state]=\"item.extras?.state\"\n [relativeTo]=\"item.extras?.relativeTo\"\n [preserveFragment]=\"item.extras?.preserveFragment\"\n [skipLocationChange]=\"item.extras?.skipLocationChange\"\n [replaceUrl]=\"item.extras?.replaceUrl\"\n >{{ item.label | translate }}\n </a>\n }\n @case ('link') {\n <a\n si-menu-item\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [href]=\"item.href\"\n [target]=\"item.target\"\n >{{ item.label | translate }}\n </a>\n }\n @case ('radio-group') {\n <div cdkMenuGroup>\n @for (radioItem of item.children; track radioItem) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: radioItem }\" />\n }\n </div>\n }\n @case ('radio') {\n <si-menu-item-radio\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [checked]=\"item.checked\"\n (triggered)=\"runAction(item)\"\n >{{ item.label | translate }}\n </si-menu-item-radio>\n }\n @case ('checkbox') {\n <si-menu-item-checkbox\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [checked]=\"item.checked\"\n (triggered)=\"runAction(item)\"\n >{{ item.label | translate }}\n </si-menu-item-checkbox>\n }\n @case ('header') {\n <si-menu-header>{{ item.label | translate }}</si-menu-header>\n }\n @case ('divider') {\n <si-menu-divider />\n }\n }\n } @else if (isLegacyItemStyle(item)) {\n @switch (item.type) {\n @case ('radio') {\n <si-menu-item-radio\n [attr.data-id]=\"item.id\"\n [checked]=\"item.selectionState === 'radio'\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [icon]=\"item.icon\"\n [disabled]=\"item.disabled\"\n [iconBadgeDot]=\"item.badgeDot\"\n (triggered)=\"radioOrCheckboxTriggered(item)\"\n >\n {{ item.title | translate }}\n </si-menu-item-radio>\n }\n @case ('check') {\n <si-menu-item-checkbox\n [attr.data-id]=\"item.id\"\n [checked]=\"item.selectionState === 'check'\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [icon]=\"item.icon\"\n [disabled]=\"item.disabled\"\n [iconBadgeDot]=\"item.badgeDot\"\n (triggered)=\"radioOrCheckboxTriggered(item)\"\n >\n {{ item.title | translate }}\n </si-menu-item-checkbox>\n }\n @default {\n @if (item.isHeading) {\n <div class=\"dropdown-item-text dropdown-header\">\n {{ item.title | translate }}\n </div>\n } @else {\n @if (item.title !== '-') {\n <a\n si-menu-item\n activeClass=\"active\"\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [icon]=\"item.icon\"\n [disabled]=\"item.disabled\"\n [siLink]=\"item\"\n [iconBadgeDot]=\"item.badgeDot\"\n [actionParam]=\"actionParam()\"\n [cdkMenuTriggerFor]=\"item.items ? submenu : null\"\n [cdkMenuTriggerData]=\"item\"\n >\n {{ item.title | translate }}\n </a>\n <ng-template #submenu>\n <si-menu-factory [items]=\"item.items!\" [actionParam]=\"actionParam()\" />\n </ng-template>\n } @else {\n <div class=\"dropdown-divider\"></div>\n }\n }\n }\n }\n }\n </ng-template>\n</si-menu>\n", dependencies: [{ kind: "component", type: SiMenuFactoryComponent, selector: "si-menu-factory", inputs: ["items", "actionParam"] }, { kind: "directive", type: SiMenuDirective, selector: "si-menu" }, { kind: "component", type: SiMenuItemComponent, selector: "si-menu-item, a[si-menu-item], button[si-menu-item]" }, { kind: "component", type: SiMenuItemRadioComponent, selector: "si-menu-item-radio" }, { kind: "component", type: SiMenuItemCheckboxComponent, selector: "si-menu-item-checkbox, button[si-menu-item-checkbox]" }, { kind: "directive", type: SiMenuHeaderDirective, selector: "si-menu-header" }, { kind: "directive", type: SiMenuDividerDirective, selector: "si-menu-divider" }, { kind: "ngmodule", type: SiLinkModule }, { kind: "directive", type: i1$1.SiLinkDirective, selector: "[siLink]", inputs: ["siLink", "siLinkDefaultTarget", "actionParam", "activeClass", "exactMatch", "ariaCurrent"], outputs: ["activeChange"], exportAs: ["siLink"] }, { kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData", "cdkMenuTriggerTransformOriginOn"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "directive", type: CdkMenuGroup, selector: "[cdkMenuGroup]", exportAs: ["cdkMenuGroup"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: SiMenuFactoryItemGuardDirective, selector: "[siMenuFactoryItemGuard]" }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
267
275
|
}
|
|
268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuFactoryComponent, decorators: [{
|
|
269
277
|
type: Component,
|
|
270
278
|
args: [{ selector: 'si-menu-factory', imports: [
|
|
271
279
|
SiMenuDirective,
|
|
@@ -281,7 +289,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
281
289
|
NgTemplateOutlet,
|
|
282
290
|
RouterLink,
|
|
283
291
|
SiMenuFactoryItemGuardDirective
|
|
284
|
-
], changeDetection: ChangeDetectionStrategy.
|
|
292
|
+
], changeDetection: ChangeDetectionStrategy.Eager, template: "<si-menu>\n @for (item of items(); track item) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\" />\n }\n <ng-template #itemTemplate let-item siMenuFactoryItemGuard>\n @if (isNewItemStyle(item)) {\n @switch (item.type) {\n @case ('group') {\n <si-menu-item\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [cdkMenuTriggerFor]=\"submenu\"\n [cdkMenuTriggerData]=\"{ $implicit: item.children }\"\n >{{ item.label | translate }}\n </si-menu-item>\n <ng-template #submenu>\n <si-menu-factory [items]=\"item.children\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @case ('action') {\n <si-menu-item\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n (triggered)=\"runAction(item)\"\n >{{ item.label | translate }}\n </si-menu-item>\n }\n @case ('router-link') {\n <a\n si-menu-item\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [routerLink]=\"item.routerLink\"\n [queryParams]=\"item.extras?.queryParams\"\n [queryParamsHandling]=\"item.extras?.queryParamsHandling\"\n [fragment]=\"item.extras?.fragment\"\n [state]=\"item.extras?.state\"\n [relativeTo]=\"item.extras?.relativeTo\"\n [preserveFragment]=\"item.extras?.preserveFragment\"\n [skipLocationChange]=\"item.extras?.skipLocationChange\"\n [replaceUrl]=\"item.extras?.replaceUrl\"\n >{{ item.label | translate }}\n </a>\n }\n @case ('link') {\n <a\n si-menu-item\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [href]=\"item.href\"\n [target]=\"item.target\"\n >{{ item.label | translate }}\n </a>\n }\n @case ('radio-group') {\n <div cdkMenuGroup>\n @for (radioItem of item.children; track radioItem) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: radioItem }\" />\n }\n </div>\n }\n @case ('radio') {\n <si-menu-item-radio\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [checked]=\"item.checked\"\n (triggered)=\"runAction(item)\"\n >{{ item.label | translate }}\n </si-menu-item-radio>\n }\n @case ('checkbox') {\n <si-menu-item-checkbox\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [disabled]=\"item.disabled\"\n [icon]=\"item.icon\"\n [iconBadgeDot]=\"item.iconBadge\"\n [checked]=\"item.checked\"\n (triggered)=\"runAction(item)\"\n >{{ item.label | translate }}\n </si-menu-item-checkbox>\n }\n @case ('header') {\n <si-menu-header>{{ item.label | translate }}</si-menu-header>\n }\n @case ('divider') {\n <si-menu-divider />\n }\n }\n } @else if (isLegacyItemStyle(item)) {\n @switch (item.type) {\n @case ('radio') {\n <si-menu-item-radio\n [attr.data-id]=\"item.id\"\n [checked]=\"item.selectionState === 'radio'\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [icon]=\"item.icon\"\n [disabled]=\"item.disabled\"\n [iconBadgeDot]=\"item.badgeDot\"\n (triggered)=\"radioOrCheckboxTriggered(item)\"\n >\n {{ item.title | translate }}\n </si-menu-item-radio>\n }\n @case ('check') {\n <si-menu-item-checkbox\n [attr.data-id]=\"item.id\"\n [checked]=\"item.selectionState === 'check'\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [icon]=\"item.icon\"\n [disabled]=\"item.disabled\"\n [iconBadgeDot]=\"item.badgeDot\"\n (triggered)=\"radioOrCheckboxTriggered(item)\"\n >\n {{ item.title | translate }}\n </si-menu-item-checkbox>\n }\n @default {\n @if (item.isHeading) {\n <div class=\"dropdown-item-text dropdown-header\">\n {{ item.title | translate }}\n </div>\n } @else {\n @if (item.title !== '-') {\n <a\n si-menu-item\n activeClass=\"active\"\n [attr.data-id]=\"item.id\"\n [badge]=\"item.badge\"\n [badgeColor]=\"item.badgeColor ?? 'secondary'\"\n [icon]=\"item.icon\"\n [disabled]=\"item.disabled\"\n [siLink]=\"item\"\n [iconBadgeDot]=\"item.badgeDot\"\n [actionParam]=\"actionParam()\"\n [cdkMenuTriggerFor]=\"item.items ? submenu : null\"\n [cdkMenuTriggerData]=\"item\"\n >\n {{ item.title | translate }}\n </a>\n <ng-template #submenu>\n <si-menu-factory [items]=\"item.items!\" [actionParam]=\"actionParam()\" />\n </ng-template>\n } @else {\n <div class=\"dropdown-divider\"></div>\n }\n }\n }\n }\n }\n </ng-template>\n</si-menu>\n" }]
|
|
285
293
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }] } });
|
|
286
294
|
|
|
287
295
|
/**
|
|
@@ -289,8 +297,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
289
297
|
* SPDX-License-Identifier: MIT
|
|
290
298
|
*/
|
|
291
299
|
class SiMenuModule {
|
|
292
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
293
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
300
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
301
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.7", ngImport: i0, type: SiMenuModule, imports: [SiMenuBarDirective,
|
|
294
302
|
SiMenuDirective,
|
|
295
303
|
SiMenuDividerDirective,
|
|
296
304
|
SiMenuFactoryComponent,
|
|
@@ -305,12 +313,12 @@ class SiMenuModule {
|
|
|
305
313
|
SiMenuItemCheckboxComponent,
|
|
306
314
|
SiMenuItemComponent,
|
|
307
315
|
SiMenuItemRadioComponent] });
|
|
308
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
316
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuModule, imports: [SiMenuFactoryComponent,
|
|
309
317
|
SiMenuItemCheckboxComponent,
|
|
310
318
|
SiMenuItemComponent,
|
|
311
319
|
SiMenuItemRadioComponent] });
|
|
312
320
|
}
|
|
313
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: SiMenuModule, decorators: [{
|
|
314
322
|
type: NgModule,
|
|
315
323
|
args: [{
|
|
316
324
|
imports: [
|