@siemens/element-ng 49.0.0-rc.2 → 49.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/siemens-element-ng-accordion.mjs +2 -2
- package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +23 -13
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-datepicker.mjs +6 -7
- package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-filter-bar.mjs +6 -3
- package/fesm2022/siemens-element-ng-filter-bar.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-form.mjs +4 -2
- package/fesm2022/siemens-element-ng-form.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-inline-notification.mjs +2 -2
- package/fesm2022/siemens-element-ng-inline-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ip-input.mjs +18 -3
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-landing-page.mjs +3 -12
- package/fesm2022/siemens-element-ng-landing-page.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-modal.mjs +7 -12
- package/fesm2022/siemens-element-ng-modal.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-toast-notification.mjs +5 -4
- package/fesm2022/siemens-element-ng-toast-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tooltip.mjs +34 -22
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/package.json +3 -3
- package/schematics/collection.json +1 -13
- package/schematics/migration.json +2 -7
- package/schematics/migrations/data/class-member-replacement.js +18 -0
- package/schematics/migrations/data/component-property-names.js +25 -0
- package/schematics/migrations/data/element-class-changes.js +32 -0
- package/schematics/migrations/data/index.js +8 -4
- package/schematics/migrations/data/migration-test-data.js +95 -6
- package/schematics/migrations/data/symbol-removals.js +5 -0
- package/schematics/migrations/data/{component-names.js → symbol-renaming.js} +1 -1
- package/schematics/migrations/element-migration/element-migration.js +19 -79
- package/schematics/migrations/icon-path-migration/icon-path-migration.js +95 -0
- package/schematics/migrations/icon-path-migration/index.js +5 -0
- package/schematics/migrations/index.js +4 -13
- package/schematics/migrations/ngx-translate/index.js +52 -4
- package/schematics/migrations/utilities/attribute-selector.migration.js +51 -0
- package/schematics/migrations/utilities/class-member-replacement.migration.js +77 -0
- package/schematics/migrations/utilities/component-property-name.migration.js +90 -0
- package/schematics/migrations/utilities/element-class-change.migration.js +96 -0
- package/schematics/migrations/utilities/element-selector.migration.js +67 -0
- package/schematics/migrations/utilities/index.js +12 -0
- package/schematics/migrations/utilities/migration.interface.js +0 -0
- package/schematics/migrations/utilities/symbol-removal.migration.js +66 -0
- package/schematics/migrations/utilities/symbol-renaming.migration.js +128 -0
- package/schematics/ng-update/index.js +3 -9
- package/schematics/utils/index.js +1 -0
- package/schematics/utils/project-utils.js +50 -13
- package/schematics/utils/template-utils.js +4 -138
- package/schematics/utils/testing.js +2 -1
- package/schematics/utils/ts-compiler-host.js +70 -0
- package/schematics/utils/ts-utils.js +0 -105
- package/template-i18n.json +0 -1
- package/types/siemens-element-ng-chat-messages.d.ts +5 -1
- package/types/siemens-element-ng-filter-bar.d.ts +1 -0
- package/types/siemens-element-ng-landing-page.d.ts +1 -10
- package/types/siemens-element-ng-tooltip.d.ts +12 -4
- package/types/siemens-element-ng-translate.d.ts +0 -1
- package/schematics/migrations/data/output-names.js +0 -1
- package/schematics/migrations/schema.json +0 -16
- package/schematics/ng-update/schema.json +0 -15
- package/schematics/simpl-siemens-migration/index.js +0 -14
- package/schematics/simpl-siemens-migration/schema.json +0 -16
|
@@ -182,7 +182,7 @@ class SiCollapsiblePanelComponent {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiCollapsiblePanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
185
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiCollapsiblePanelComponent, isStandalone: true, selector: "si-collapsible-panel", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, headerCssClasses: { classPropertyName: "headerCssClasses", publicName: "headerCssClasses", isSignal: true, isRequired: false, transformFunction: null }, contentBgClasses: { classPropertyName: "contentBgClasses", publicName: "contentBgClasses", isSignal: true, isRequired: false, transformFunction: null }, contentCssClasses: { classPropertyName: "contentCssClasses", publicName: "contentCssClasses", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgeColor: { classPropertyName: "badgeColor", publicName: "badgeColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "openedChange", panelToggle: "panelToggle" }, host: { properties: { "class": "colorVariant()", "class.opened": "opened()", "class.hcollapsed": "hcollapsed()", "class.full-height": "fullHeight()", "style.--element-animations-enabled": "disableAnimation() ? \"0\" : undefined" } }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n role=\"button\"\n placement=\"start\"\n [siTooltip]=\"hcollapsed() && heading() ? (heading()! | translate) : ''\"\n [class]=\"`collapsible-header focus-inside px-6 ${headerCssClasses()}`\"\n [attr.tabindex]=\"disabled() ? '' : '0'\"\n [id]=\"headerId\"\n [class.open]=\"opened()\"\n [class.disabled]=\"disabled()\"\n [attr.aria-expanded]=\"opened() && !hcollapsed()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-controls]=\"controlId\"\n [attr.aria-label]=\"hcollapsed() ? (heading() | translate) : ''\"\n (keydown)=\"keydown($event)\"\n (click)=\"doToggle($event)\"\n>\n @let headerIcon = icon();\n @if (headerIcon) {\n <si-icon class=\"icon ms-n2 me-2\" [icon]=\"headerIcon\" [class.collapsed-icon]=\"isHCollapsible\" />\n }\n @if (icon() && badge() !== undefined && badge() !== '') {\n <span class=\"badge-text\">\n {{ badge() }}\n </span>\n }\n <div class=\"si-h5 autohide\">\n {{ heading() | translate }}\n <ng-content select=\"[si-panel-heading]\" />\n </div>\n\n @if (badge() !== undefined && badge() !== '') {\n <span [class]=\"'badge autohide' + (badgeColor() ? ' bg-' + badgeColor() : '')\">\n {{ badge() }}\n </span>\n }\n <span class=\"ms-auto overflow-hidden\">\n <si-icon class=\"icon dropdown-caret\" [icon]=\"icons.elementDown2\" />\n </span>\n</div>\n<div\n #content\n role=\"region\"\n [id]=\"controlId\"\n [class]=\"`collapsible-content ${contentBgClasses()}`\"\n [attr.aria-labelledby]=\"headerId\"\n [class.full-height]=\"fullHeight()\"\n>\n @if (opened()) {\n <div class=\"content-motion\" animate.leave=\"content-leave\">\n <div class=\"overflow-hidden\">\n <div [class]=\"contentCssClasses()\">\n <ng-content />\n </div>\n </div>\n </div>\n }\n</div>\n", styles: [":host{--__radius: var(--si-accordion-radius, var(--element-button-radius));display:flex;flex-direction:column;background:var(--element-base-0);padding-block-end:2px}:host:not(.hcollapsed) .collapsed-icon,:host:not(.hcollapsed) .badge-text{display:none}:host.hcollapsed{background:var(--element-base-1)}:host.hcollapsed .collapsible-header .autohide,:host.hcollapsed .collapsible-content{display:none}:host.hcollapsed .collapsible-header{padding-block:8px}:host.hcollapsed .collapsible-header:hover{background:var(--element-base-1-hover)}:host.full-height{transition:flex-grow calc(.5s * var(--element-animations-enabled, 1))}:host.full-height.opened,:host.full-height .collapsible-content{flex:1 1 0}:host.full-height .collapsible-content>div{flex:1 0 0}.collapsible-header{display:flex;align-items:center;background:var(--element-base-1);color:var(--element-text-primary);padding-block:12px;border-radius:var(--__radius)}.collapsible-header.disabled{color:var(--element-text-disabled);cursor:default}.collapsible-header.open{border-end-start-radius:0;border-end-end-radius:0}.collapsible-header:not(.disabled){cursor:pointer}.collapsible-header:not(.disabled):hover{text-decoration:none;background:var(--element-base-1-hover)}.dropdown-caret{transition:transform calc(.5s * var(--element-animations-enabled, 1));color:var(--element-ui-1)}.open .dropdown-caret{transform:rotate(180deg)}.collapsible-content{overflow:hidden;background:var(--element-base-1);border-end-start-radius:var(--__radius);border-end-end-radius:var(--__radius)}.collapsible-content.full-height{overflow:auto}.content-motion{display:grid;grid-template-rows:1fr;transition:grid-template-rows calc(.5s * var(--element-animations-enabled, 1))
|
|
185
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiCollapsiblePanelComponent, isStandalone: true, selector: "si-collapsible-panel", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, headerCssClasses: { classPropertyName: "headerCssClasses", publicName: "headerCssClasses", isSignal: true, isRequired: false, transformFunction: null }, contentBgClasses: { classPropertyName: "contentBgClasses", publicName: "contentBgClasses", isSignal: true, isRequired: false, transformFunction: null }, contentCssClasses: { classPropertyName: "contentCssClasses", publicName: "contentCssClasses", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, colorVariant: { classPropertyName: "colorVariant", publicName: "colorVariant", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgeColor: { classPropertyName: "badgeColor", publicName: "badgeColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "openedChange", panelToggle: "panelToggle" }, host: { properties: { "class": "colorVariant()", "class.opened": "opened()", "class.hcollapsed": "hcollapsed()", "class.full-height": "fullHeight()", "style.--element-animations-enabled": "disableAnimation() ? \"0\" : undefined" } }, viewQueries: [{ propertyName: "contentRef", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n role=\"button\"\n placement=\"start\"\n [siTooltip]=\"hcollapsed() && heading() ? (heading()! | translate) : ''\"\n [class]=\"`collapsible-header focus-inside px-6 ${headerCssClasses()}`\"\n [attr.tabindex]=\"disabled() ? '' : '0'\"\n [id]=\"headerId\"\n [class.open]=\"opened()\"\n [class.disabled]=\"disabled()\"\n [attr.aria-expanded]=\"opened() && !hcollapsed()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-controls]=\"controlId\"\n [attr.aria-label]=\"hcollapsed() ? (heading() | translate) : ''\"\n (keydown)=\"keydown($event)\"\n (click)=\"doToggle($event)\"\n>\n @let headerIcon = icon();\n @if (headerIcon) {\n <si-icon class=\"icon ms-n2 me-2\" [icon]=\"headerIcon\" [class.collapsed-icon]=\"isHCollapsible\" />\n }\n @if (icon() && badge() !== undefined && badge() !== '') {\n <span class=\"badge-text\">\n {{ badge() }}\n </span>\n }\n <div class=\"si-h5 autohide\">\n {{ heading() | translate }}\n <ng-content select=\"[si-panel-heading]\" />\n </div>\n\n @if (badge() !== undefined && badge() !== '') {\n <span [class]=\"'badge autohide' + (badgeColor() ? ' bg-' + badgeColor() : '')\">\n {{ badge() }}\n </span>\n }\n <span class=\"ms-auto overflow-hidden\">\n <si-icon class=\"icon dropdown-caret\" [icon]=\"icons.elementDown2\" />\n </span>\n</div>\n<div\n #content\n role=\"region\"\n [id]=\"controlId\"\n [class]=\"`collapsible-content ${contentBgClasses()}`\"\n [attr.aria-labelledby]=\"headerId\"\n [class.full-height]=\"fullHeight()\"\n>\n @if (opened()) {\n <div class=\"content-motion\" animate.leave=\"content-leave\">\n <div class=\"overflow-hidden\">\n <div [class]=\"contentCssClasses()\">\n <ng-content />\n </div>\n </div>\n </div>\n }\n</div>\n", styles: [":host{--__radius: var(--si-accordion-radius, var(--element-button-radius));display:flex;flex-direction:column;background:var(--element-base-0);padding-block-end:2px}:host:not(.hcollapsed) .collapsed-icon,:host:not(.hcollapsed) .badge-text{display:none}:host.hcollapsed{background:var(--element-base-1)}:host.hcollapsed .collapsible-header .autohide,:host.hcollapsed .collapsible-content{display:none}:host.hcollapsed .collapsible-header{padding-block:8px}:host.hcollapsed .collapsible-header:hover{background:var(--element-base-1-hover)}:host.full-height{transition:flex-grow calc(.5s * var(--element-animations-enabled, 1))}:host.full-height.opened,:host.full-height .collapsible-content{flex:1 1 0}:host.full-height .collapsible-content>div{flex:1 0 0}.collapsible-header{display:flex;align-items:center;background:var(--element-base-1);color:var(--element-text-primary);padding-block:12px;border-radius:var(--__radius)}.collapsible-header.disabled{color:var(--element-text-disabled);cursor:default}.collapsible-header.open{border-end-start-radius:0;border-end-end-radius:0}.collapsible-header:not(.disabled){cursor:pointer}.collapsible-header:not(.disabled):hover{text-decoration:none;background:var(--element-base-1-hover)}.dropdown-caret{transition:transform calc(.5s * var(--element-animations-enabled, 1));color:var(--element-ui-1)}.open .dropdown-caret{transform:rotate(180deg)}.collapsible-content{overflow:hidden;background:var(--element-base-1);border-end-start-radius:var(--__radius);border-end-end-radius:var(--__radius)}.collapsible-content.full-height{overflow:auto}.content-motion{display:grid;grid-template-rows:1fr;transition:grid-template-rows calc(.5s * var(--element-animations-enabled, 1))}@starting-style{.content-motion{grid-template-rows:0fr}}.content-motion.content-leave{grid-template-rows:0fr}:host(.full-height) .content-motion{display:flex}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "directive", type: SiTooltipDirective, selector: "[siTooltip]", inputs: ["siTooltip", "placement", "isDisabled", "tooltipContext"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
186
186
|
}
|
|
187
187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiCollapsiblePanelComponent, decorators: [{
|
|
188
188
|
type: Component,
|
|
@@ -192,7 +192,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
192
192
|
'[class.hcollapsed]': 'hcollapsed()',
|
|
193
193
|
'[class.full-height]': 'fullHeight()',
|
|
194
194
|
'[style.--element-animations-enabled]': 'disableAnimation() ? "0" : undefined'
|
|
195
|
-
}, template: "<div\n role=\"button\"\n placement=\"start\"\n [siTooltip]=\"hcollapsed() && heading() ? (heading()! | translate) : ''\"\n [class]=\"`collapsible-header focus-inside px-6 ${headerCssClasses()}`\"\n [attr.tabindex]=\"disabled() ? '' : '0'\"\n [id]=\"headerId\"\n [class.open]=\"opened()\"\n [class.disabled]=\"disabled()\"\n [attr.aria-expanded]=\"opened() && !hcollapsed()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-controls]=\"controlId\"\n [attr.aria-label]=\"hcollapsed() ? (heading() | translate) : ''\"\n (keydown)=\"keydown($event)\"\n (click)=\"doToggle($event)\"\n>\n @let headerIcon = icon();\n @if (headerIcon) {\n <si-icon class=\"icon ms-n2 me-2\" [icon]=\"headerIcon\" [class.collapsed-icon]=\"isHCollapsible\" />\n }\n @if (icon() && badge() !== undefined && badge() !== '') {\n <span class=\"badge-text\">\n {{ badge() }}\n </span>\n }\n <div class=\"si-h5 autohide\">\n {{ heading() | translate }}\n <ng-content select=\"[si-panel-heading]\" />\n </div>\n\n @if (badge() !== undefined && badge() !== '') {\n <span [class]=\"'badge autohide' + (badgeColor() ? ' bg-' + badgeColor() : '')\">\n {{ badge() }}\n </span>\n }\n <span class=\"ms-auto overflow-hidden\">\n <si-icon class=\"icon dropdown-caret\" [icon]=\"icons.elementDown2\" />\n </span>\n</div>\n<div\n #content\n role=\"region\"\n [id]=\"controlId\"\n [class]=\"`collapsible-content ${contentBgClasses()}`\"\n [attr.aria-labelledby]=\"headerId\"\n [class.full-height]=\"fullHeight()\"\n>\n @if (opened()) {\n <div class=\"content-motion\" animate.leave=\"content-leave\">\n <div class=\"overflow-hidden\">\n <div [class]=\"contentCssClasses()\">\n <ng-content />\n </div>\n </div>\n </div>\n }\n</div>\n", styles: [":host{--__radius: var(--si-accordion-radius, var(--element-button-radius));display:flex;flex-direction:column;background:var(--element-base-0);padding-block-end:2px}:host:not(.hcollapsed) .collapsed-icon,:host:not(.hcollapsed) .badge-text{display:none}:host.hcollapsed{background:var(--element-base-1)}:host.hcollapsed .collapsible-header .autohide,:host.hcollapsed .collapsible-content{display:none}:host.hcollapsed .collapsible-header{padding-block:8px}:host.hcollapsed .collapsible-header:hover{background:var(--element-base-1-hover)}:host.full-height{transition:flex-grow calc(.5s * var(--element-animations-enabled, 1))}:host.full-height.opened,:host.full-height .collapsible-content{flex:1 1 0}:host.full-height .collapsible-content>div{flex:1 0 0}.collapsible-header{display:flex;align-items:center;background:var(--element-base-1);color:var(--element-text-primary);padding-block:12px;border-radius:var(--__radius)}.collapsible-header.disabled{color:var(--element-text-disabled);cursor:default}.collapsible-header.open{border-end-start-radius:0;border-end-end-radius:0}.collapsible-header:not(.disabled){cursor:pointer}.collapsible-header:not(.disabled):hover{text-decoration:none;background:var(--element-base-1-hover)}.dropdown-caret{transition:transform calc(.5s * var(--element-animations-enabled, 1));color:var(--element-ui-1)}.open .dropdown-caret{transform:rotate(180deg)}.collapsible-content{overflow:hidden;background:var(--element-base-1);border-end-start-radius:var(--__radius);border-end-end-radius:var(--__radius)}.collapsible-content.full-height{overflow:auto}.content-motion{display:grid;grid-template-rows:1fr;transition:grid-template-rows calc(.5s * var(--element-animations-enabled, 1))
|
|
195
|
+
}, template: "<div\n role=\"button\"\n placement=\"start\"\n [siTooltip]=\"hcollapsed() && heading() ? (heading()! | translate) : ''\"\n [class]=\"`collapsible-header focus-inside px-6 ${headerCssClasses()}`\"\n [attr.tabindex]=\"disabled() ? '' : '0'\"\n [id]=\"headerId\"\n [class.open]=\"opened()\"\n [class.disabled]=\"disabled()\"\n [attr.aria-expanded]=\"opened() && !hcollapsed()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-controls]=\"controlId\"\n [attr.aria-label]=\"hcollapsed() ? (heading() | translate) : ''\"\n (keydown)=\"keydown($event)\"\n (click)=\"doToggle($event)\"\n>\n @let headerIcon = icon();\n @if (headerIcon) {\n <si-icon class=\"icon ms-n2 me-2\" [icon]=\"headerIcon\" [class.collapsed-icon]=\"isHCollapsible\" />\n }\n @if (icon() && badge() !== undefined && badge() !== '') {\n <span class=\"badge-text\">\n {{ badge() }}\n </span>\n }\n <div class=\"si-h5 autohide\">\n {{ heading() | translate }}\n <ng-content select=\"[si-panel-heading]\" />\n </div>\n\n @if (badge() !== undefined && badge() !== '') {\n <span [class]=\"'badge autohide' + (badgeColor() ? ' bg-' + badgeColor() : '')\">\n {{ badge() }}\n </span>\n }\n <span class=\"ms-auto overflow-hidden\">\n <si-icon class=\"icon dropdown-caret\" [icon]=\"icons.elementDown2\" />\n </span>\n</div>\n<div\n #content\n role=\"region\"\n [id]=\"controlId\"\n [class]=\"`collapsible-content ${contentBgClasses()}`\"\n [attr.aria-labelledby]=\"headerId\"\n [class.full-height]=\"fullHeight()\"\n>\n @if (opened()) {\n <div class=\"content-motion\" animate.leave=\"content-leave\">\n <div class=\"overflow-hidden\">\n <div [class]=\"contentCssClasses()\">\n <ng-content />\n </div>\n </div>\n </div>\n }\n</div>\n", styles: [":host{--__radius: var(--si-accordion-radius, var(--element-button-radius));display:flex;flex-direction:column;background:var(--element-base-0);padding-block-end:2px}:host:not(.hcollapsed) .collapsed-icon,:host:not(.hcollapsed) .badge-text{display:none}:host.hcollapsed{background:var(--element-base-1)}:host.hcollapsed .collapsible-header .autohide,:host.hcollapsed .collapsible-content{display:none}:host.hcollapsed .collapsible-header{padding-block:8px}:host.hcollapsed .collapsible-header:hover{background:var(--element-base-1-hover)}:host.full-height{transition:flex-grow calc(.5s * var(--element-animations-enabled, 1))}:host.full-height.opened,:host.full-height .collapsible-content{flex:1 1 0}:host.full-height .collapsible-content>div{flex:1 0 0}.collapsible-header{display:flex;align-items:center;background:var(--element-base-1);color:var(--element-text-primary);padding-block:12px;border-radius:var(--__radius)}.collapsible-header.disabled{color:var(--element-text-disabled);cursor:default}.collapsible-header.open{border-end-start-radius:0;border-end-end-radius:0}.collapsible-header:not(.disabled){cursor:pointer}.collapsible-header:not(.disabled):hover{text-decoration:none;background:var(--element-base-1-hover)}.dropdown-caret{transition:transform calc(.5s * var(--element-animations-enabled, 1));color:var(--element-ui-1)}.open .dropdown-caret{transform:rotate(180deg)}.collapsible-content{overflow:hidden;background:var(--element-base-1);border-end-start-radius:var(--__radius);border-end-end-radius:var(--__radius)}.collapsible-content.full-height{overflow:auto}.content-motion{display:grid;grid-template-rows:1fr;transition:grid-template-rows calc(.5s * var(--element-animations-enabled, 1))}@starting-style{.content-motion{grid-template-rows:0fr}}.content-motion.content-leave{grid-template-rows:0fr}:host(.full-height) .content-motion{display:flex}\n"] }]
|
|
196
196
|
}], ctorParameters: () => [], propDecorators: { heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: false }] }], headerCssClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerCssClasses", required: false }] }], contentBgClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentBgClasses", required: false }] }], contentCssClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentCssClasses", required: false }] }], opened: [{ type: i0.Input, args: [{ isSignal: true, alias: "opened", required: false }] }, { type: i0.Output, args: ["openedChange"] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], colorVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorVariant", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], badgeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeColor", required: false }] }], panelToggle: [{ type: i0.Output, args: ["panelToggle"] }], contentRef: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }] } });
|
|
197
197
|
|
|
198
198
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-element-ng-accordion.mjs","sources":["../../../../projects/element-ng/accordion/si-accordion-hcollapse.service.ts","../../../../projects/element-ng/accordion/si-accordion.service.ts","../../../../projects/element-ng/accordion/si-collapsible-panel.component.ts","../../../../projects/element-ng/accordion/si-collapsible-panel.component.html","../../../../projects/element-ng/accordion/si-accordion.component.ts","../../../../projects/element-ng/accordion/si-accordion.module.ts","../../../../projects/element-ng/accordion/index.ts","../../../../projects/element-ng/accordion/siemens-element-ng-accordion.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Injectable, signal } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/** @internal */\n@Injectable({\n providedIn: null\n})\nexport class SiAccordionHCollapseService {\n /**\n * Emitting the current horizontal collapsed state.\n *\n * @defaultValue undefined\n */\n readonly hcollapsed = signal<boolean | undefined>(undefined);\n /**\n * Subject to emit to open the accordion.\n */\n readonly open$ = new Subject();\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Injectable, signal } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/** @internal */\n@Injectable({\n providedIn: null\n})\nexport class SiAccordionService {\n /**\n * Emit an item in the accordion which should be toggled.\n */\n readonly toggle$ = new Subject<any>();\n /**\n * Subject to emit when the items should be expanded to their full height or restored to normal height.\n *\n * @defaultValue null\n */\n readonly fullHeight = signal<boolean | null>(null);\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal,\n viewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { elementDown2 } from '@siemens/element-icons';\nimport { BackgroundColorVariant } from '@siemens/element-ng/common';\nimport { addIcons, SiIconComponent } from '@siemens/element-ng/icon';\nimport { SiTooltipDirective } from '@siemens/element-ng/tooltip';\nimport { SiTranslatePipe, TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { filter } from 'rxjs';\n\nimport { SiAccordionHCollapseService } from './si-accordion-hcollapse.service';\nimport { SiAccordionService } from './si-accordion.service';\n\nlet controlIdCounter = 1;\n\n@Component({\n selector: 'si-collapsible-panel',\n imports: [SiIconComponent, SiTranslatePipe, SiTooltipDirective],\n templateUrl: './si-collapsible-panel.component.html',\n styleUrl: './si-collapsible-panel.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'colorVariant()',\n '[class.opened]': 'opened()',\n '[class.hcollapsed]': 'hcollapsed()',\n '[class.full-height]': 'fullHeight()',\n '[style.--element-animations-enabled]': 'disableAnimation() ? \"0\" : undefined'\n }\n})\nexport class SiCollapsiblePanelComponent {\n /**\n * Heading for the collapsible panel.\n */\n readonly heading = input<TranslatableString>();\n /**\n * Additional CSS classes for the top element.\n *\n * @defaultValue ''\n */\n readonly headerCssClasses = input('');\n /**\n * Additional CSS classes for the collapsible content region.\n *\n * @defaultValue ''\n */\n readonly contentBgClasses = input('');\n /**\n * Additional CSS classes for the wrapping content element.\n *\n * @defaultValue ''\n */\n readonly contentCssClasses = input('');\n /**\n * Expand/collapse the panel.\n *\n * @defaultValue false\n */\n readonly opened = model(false);\n /**\n * The icon to be displayed besides the heading.\n */\n readonly icon = input<string>();\n /**\n * Whether the si-collapsible-panel is disabled.\n *\n * @defaultValue false\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n /**\n * Color variant for component background.\n *\n * @deprecated This input has no effect on the component styling.\n */\n readonly colorVariant = input<BackgroundColorVariant>();\n /**\n * Defines the content of the optional badge. Should be a number or something like \"100+\".\n * if undefined or empty string, no badge is displayed\n */\n readonly badge = input<string | number>();\n /**\n * Defines the background color of the badge. Default is specific to Element flavour.\n */\n readonly badgeColor = input<string>();\n\n /**\n * An event emitted when the user triggered expand/collapse and emit with the new open state.\n * The event is emitted before the animation happens.\n */\n readonly panelToggle = output<boolean>();\n\n protected readonly hcollapsed = computed(\n () => this.accordionHCollapseService?.hcollapsed() ?? false\n );\n protected readonly fullHeight = computed(() => this.accordionService?.fullHeight() ?? false);\n protected controlId = '__si-collapsible-' + controlIdCounter++;\n protected headerId = this.controlId + '-header';\n protected isHCollapsible = false;\n protected readonly icons = addIcons({ elementDown2 });\n protected readonly disableAnimation = signal(false);\n\n private readonly accordionService = inject(SiAccordionService, { optional: true });\n private readonly accordionHCollapseService = inject(SiAccordionHCollapseService, {\n optional: true\n });\n /** Restore the content scroll position between open/close of the panel. */\n private lastScrollPos = 0;\n private readonly contentRef = viewChild.required<ElementRef<HTMLElement>>('content');\n\n constructor() {\n this.isHCollapsible = !!this.accordionHCollapseService;\n this.accordionService?.toggle$\n .pipe(\n takeUntilDestroyed(),\n filter(item => item !== this)\n )\n .subscribe(() => this.openClose(false));\n }\n\n /**\n * Expand/collapse panel.\n * @param open - indicate the panel shall open or close\n * @param enableAnimation - with animation\n */\n openClose(open: boolean, enableAnimation = true): void {\n this.opened.set(open);\n this.disableAnimation.set(!enableAnimation);\n\n if (open) {\n // Restore scroll position after opening\n setTimeout(() => {\n this.contentRef().nativeElement.scrollTop = this.lastScrollPos;\n });\n } else {\n // Save scroll position before closing\n this.lastScrollPos = this.contentRef().nativeElement.scrollTop;\n }\n }\n\n protected doToggle(event?: Event): void {\n if (this.disabled()) {\n return;\n }\n\n event?.preventDefault();\n const opened = this.opened();\n this.panelToggle.emit(!opened);\n this.openClose(this.hcollapsed() || !opened);\n this.accordionService?.toggle$.next(this);\n if (this.hcollapsed()) {\n this.accordionHCollapseService?.open$.next(this);\n }\n }\n\n protected keydown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === 'Space' || event.key === ' ') {\n this.doToggle(undefined);\n }\n }\n}\n","<div\n role=\"button\"\n placement=\"start\"\n [siTooltip]=\"hcollapsed() && heading() ? (heading()! | translate) : ''\"\n [class]=\"`collapsible-header focus-inside px-6 ${headerCssClasses()}`\"\n [attr.tabindex]=\"disabled() ? '' : '0'\"\n [id]=\"headerId\"\n [class.open]=\"opened()\"\n [class.disabled]=\"disabled()\"\n [attr.aria-expanded]=\"opened() && !hcollapsed()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-controls]=\"controlId\"\n [attr.aria-label]=\"hcollapsed() ? (heading() | translate) : ''\"\n (keydown)=\"keydown($event)\"\n (click)=\"doToggle($event)\"\n>\n @let headerIcon = icon();\n @if (headerIcon) {\n <si-icon class=\"icon ms-n2 me-2\" [icon]=\"headerIcon\" [class.collapsed-icon]=\"isHCollapsible\" />\n }\n @if (icon() && badge() !== undefined && badge() !== '') {\n <span class=\"badge-text\">\n {{ badge() }}\n </span>\n }\n <div class=\"si-h5 autohide\">\n {{ heading() | translate }}\n <ng-content select=\"[si-panel-heading]\" />\n </div>\n\n @if (badge() !== undefined && badge() !== '') {\n <span [class]=\"'badge autohide' + (badgeColor() ? ' bg-' + badgeColor() : '')\">\n {{ badge() }}\n </span>\n }\n <span class=\"ms-auto overflow-hidden\">\n <si-icon class=\"icon dropdown-caret\" [icon]=\"icons.elementDown2\" />\n </span>\n</div>\n<div\n #content\n role=\"region\"\n [id]=\"controlId\"\n [class]=\"`collapsible-content ${contentBgClasses()}`\"\n [attr.aria-labelledby]=\"headerId\"\n [class.full-height]=\"fullHeight()\"\n>\n @if (opened()) {\n <div class=\"content-motion\" animate.leave=\"content-leave\">\n <div class=\"overflow-hidden\">\n <div [class]=\"contentCssClasses()\">\n <ng-content />\n </div>\n </div>\n </div>\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n DestroyRef,\n ElementRef,\n inject,\n input,\n OnChanges\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ResizeObserverService } from '@siemens/element-ng/resize-observer';\n\nimport { SiAccordionHCollapseService } from './si-accordion-hcollapse.service';\nimport { SiAccordionService } from './si-accordion.service';\nimport { SiCollapsiblePanelComponent } from './si-collapsible-panel.component';\n\nconst PANEL_MIN_HEIGHT = 100;\n\n@Component({\n selector: 'si-accordion',\n template: '<div><ng-content /></div>',\n styleUrl: './si-accordion.component.scss',\n providers: [SiAccordionService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.full-height]': 'fullHeight()',\n '[class.hcollapsed]': 'collapsed()'\n }\n})\nexport class SiAccordionComponent implements AfterContentInit, OnChanges {\n /** @defaultValue true */\n readonly expandFirstPanel = input(true, { transform: booleanAttribute });\n /** @defaultValue false */\n readonly fullHeight = input(false, { transform: booleanAttribute });\n /** @defaultValue false */\n readonly hcollapsed = input(false);\n /**\n * Indicate whether the accordion is collapsed.\n * @internal\n */\n readonly collapsed = computed(\n () => this.accordionHCollapseService?.hcollapsed() ?? this.hcollapsed()\n );\n\n private readonly panels = contentChildren(SiCollapsiblePanelComponent);\n private responsive = false;\n private destroyer = inject(DestroyRef);\n private service = inject(SiAccordionService);\n private resizeObserver = inject(ResizeObserverService);\n private element = inject(ElementRef);\n private accordionHCollapseService = inject(SiAccordionHCollapseService, { optional: true });\n\n ngOnChanges(): void {\n this.service.fullHeight.set(this.fullHeight() && !this.responsive);\n }\n\n ngAfterContentInit(): void {\n this.resizeObserver\n .observe(this.element.nativeElement, 100, true, true)\n .pipe(takeUntilDestroyed(this.destroyer))\n .subscribe(() => this.calcFullHeight());\n\n this.panels().at(0)?.openClose(this.expandFirstPanel(), false);\n }\n\n private calcFullHeight(): void {\n if (this.panels?.length) {\n const height = (this.element.nativeElement as HTMLElement).offsetHeight;\n this.responsive = !this.hcollapsed() && height < this.panels.length * PANEL_MIN_HEIGHT;\n this.service.fullHeight.set(this.fullHeight() && !this.responsive);\n }\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiAccordionComponent } from './si-accordion.component';\nimport { SiCollapsiblePanelComponent } from './si-collapsible-panel.component';\n\n@NgModule({\n imports: [SiAccordionComponent, SiCollapsiblePanelComponent],\n exports: [SiAccordionComponent, SiCollapsiblePanelComponent]\n})\nexport class SiAccordionModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-collapsible-panel.component';\nexport * from './si-accordion.component';\nexport * from './si-accordion.service';\nexport * from './si-accordion-hcollapse.service';\nexport * from './si-accordion.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;AAGG;AAIH;MAIa,2BAA2B,CAAA;AACtC;;;;AAIG;AACM,IAAA,UAAU,GAAG,MAAM,CAAsB,SAAS,sDAAC;AAC5D;;AAEG;AACM,IAAA,KAAK,GAAG,IAAI,OAAO,EAAE;uGAVnB,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cAF1B,IAAI,EAAA,CAAA;;2FAEL,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EA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hcollapse.service.ts","../../../../projects/element-ng/accordion/si-accordion.service.ts","../../../../projects/element-ng/accordion/si-collapsible-panel.component.ts","../../../../projects/element-ng/accordion/si-collapsible-panel.component.html","../../../../projects/element-ng/accordion/si-accordion.component.ts","../../../../projects/element-ng/accordion/si-accordion.module.ts","../../../../projects/element-ng/accordion/index.ts","../../../../projects/element-ng/accordion/siemens-element-ng-accordion.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Injectable, signal } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/** @internal */\n@Injectable({\n providedIn: null\n})\nexport class SiAccordionHCollapseService {\n /**\n * Emitting the current horizontal collapsed state.\n *\n * @defaultValue undefined\n */\n readonly hcollapsed = signal<boolean | undefined>(undefined);\n /**\n * Subject to emit to open the accordion.\n */\n readonly open$ = new Subject();\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { Injectable, signal } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n/** @internal */\n@Injectable({\n providedIn: null\n})\nexport class SiAccordionService {\n /**\n * Emit an item in the accordion which should be toggled.\n */\n readonly toggle$ = new Subject<any>();\n /**\n * Subject to emit when the items should be expanded to their full height or restored to normal height.\n *\n * @defaultValue null\n */\n readonly fullHeight = signal<boolean | null>(null);\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal,\n viewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { elementDown2 } from '@siemens/element-icons';\nimport { BackgroundColorVariant } from '@siemens/element-ng/common';\nimport { addIcons, SiIconComponent } from '@siemens/element-ng/icon';\nimport { SiTooltipDirective } from '@siemens/element-ng/tooltip';\nimport { SiTranslatePipe, TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { filter } from 'rxjs';\n\nimport { SiAccordionHCollapseService } from './si-accordion-hcollapse.service';\nimport { SiAccordionService } from './si-accordion.service';\n\nlet controlIdCounter = 1;\n\n@Component({\n selector: 'si-collapsible-panel',\n imports: [SiIconComponent, SiTranslatePipe, SiTooltipDirective],\n templateUrl: './si-collapsible-panel.component.html',\n styleUrl: './si-collapsible-panel.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'colorVariant()',\n '[class.opened]': 'opened()',\n '[class.hcollapsed]': 'hcollapsed()',\n '[class.full-height]': 'fullHeight()',\n '[style.--element-animations-enabled]': 'disableAnimation() ? \"0\" : undefined'\n }\n})\nexport class SiCollapsiblePanelComponent {\n /**\n * Heading for the collapsible panel.\n */\n readonly heading = input<TranslatableString>();\n /**\n * Additional CSS classes for the top element.\n *\n * @defaultValue ''\n */\n readonly headerCssClasses = input('');\n /**\n * Additional CSS classes for the collapsible content region.\n *\n * @defaultValue ''\n */\n readonly contentBgClasses = input('');\n /**\n * Additional CSS classes for the wrapping content element.\n *\n * @defaultValue ''\n */\n readonly contentCssClasses = input('');\n /**\n * Expand/collapse the panel.\n *\n * @defaultValue false\n */\n readonly opened = model(false);\n /**\n * The icon to be displayed besides the heading.\n */\n readonly icon = input<string>();\n /**\n * Whether the si-collapsible-panel is disabled.\n *\n * @defaultValue false\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n /**\n * Color variant for component background.\n *\n * @deprecated This input has no effect on the component styling.\n */\n readonly colorVariant = input<BackgroundColorVariant>();\n /**\n * Defines the content of the optional badge. Should be a number or something like \"100+\".\n * if undefined or empty string, no badge is displayed\n */\n readonly badge = input<string | number>();\n /**\n * Defines the background color of the badge. Default is specific to Element flavour.\n */\n readonly badgeColor = input<string>();\n\n /**\n * An event emitted when the user triggered expand/collapse and emit with the new open state.\n * The event is emitted before the animation happens.\n */\n readonly panelToggle = output<boolean>();\n\n protected readonly hcollapsed = computed(\n () => this.accordionHCollapseService?.hcollapsed() ?? false\n );\n protected readonly fullHeight = computed(() => this.accordionService?.fullHeight() ?? false);\n protected controlId = '__si-collapsible-' + controlIdCounter++;\n protected headerId = this.controlId + '-header';\n protected isHCollapsible = false;\n protected readonly icons = addIcons({ elementDown2 });\n protected readonly disableAnimation = signal(false);\n\n private readonly accordionService = inject(SiAccordionService, { optional: true });\n private readonly accordionHCollapseService = inject(SiAccordionHCollapseService, {\n optional: true\n });\n /** Restore the content scroll position between open/close of the panel. */\n private lastScrollPos = 0;\n private readonly contentRef = viewChild.required<ElementRef<HTMLElement>>('content');\n\n constructor() {\n this.isHCollapsible = !!this.accordionHCollapseService;\n this.accordionService?.toggle$\n .pipe(\n takeUntilDestroyed(),\n filter(item => item !== this)\n )\n .subscribe(() => this.openClose(false));\n }\n\n /**\n * Expand/collapse panel.\n * @param open - indicate the panel shall open or close\n * @param enableAnimation - with animation\n */\n openClose(open: boolean, enableAnimation = true): void {\n this.opened.set(open);\n this.disableAnimation.set(!enableAnimation);\n\n if (open) {\n // Restore scroll position after opening\n setTimeout(() => {\n this.contentRef().nativeElement.scrollTop = this.lastScrollPos;\n });\n } else {\n // Save scroll position before closing\n this.lastScrollPos = this.contentRef().nativeElement.scrollTop;\n }\n }\n\n protected doToggle(event?: Event): void {\n if (this.disabled()) {\n return;\n }\n\n event?.preventDefault();\n const opened = this.opened();\n this.panelToggle.emit(!opened);\n this.openClose(this.hcollapsed() || !opened);\n this.accordionService?.toggle$.next(this);\n if (this.hcollapsed()) {\n this.accordionHCollapseService?.open$.next(this);\n }\n }\n\n protected keydown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === 'Space' || event.key === ' ') {\n this.doToggle(undefined);\n }\n }\n}\n","<div\n role=\"button\"\n placement=\"start\"\n [siTooltip]=\"hcollapsed() && heading() ? (heading()! | translate) : ''\"\n [class]=\"`collapsible-header focus-inside px-6 ${headerCssClasses()}`\"\n [attr.tabindex]=\"disabled() ? '' : '0'\"\n [id]=\"headerId\"\n [class.open]=\"opened()\"\n [class.disabled]=\"disabled()\"\n [attr.aria-expanded]=\"opened() && !hcollapsed()\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-controls]=\"controlId\"\n [attr.aria-label]=\"hcollapsed() ? (heading() | translate) : ''\"\n (keydown)=\"keydown($event)\"\n (click)=\"doToggle($event)\"\n>\n @let headerIcon = icon();\n @if (headerIcon) {\n <si-icon class=\"icon ms-n2 me-2\" [icon]=\"headerIcon\" [class.collapsed-icon]=\"isHCollapsible\" />\n }\n @if (icon() && badge() !== undefined && badge() !== '') {\n <span class=\"badge-text\">\n {{ badge() }}\n </span>\n }\n <div class=\"si-h5 autohide\">\n {{ heading() | translate }}\n <ng-content select=\"[si-panel-heading]\" />\n </div>\n\n @if (badge() !== undefined && badge() !== '') {\n <span [class]=\"'badge autohide' + (badgeColor() ? ' bg-' + badgeColor() : '')\">\n {{ badge() }}\n </span>\n }\n <span class=\"ms-auto overflow-hidden\">\n <si-icon class=\"icon dropdown-caret\" [icon]=\"icons.elementDown2\" />\n </span>\n</div>\n<div\n #content\n role=\"region\"\n [id]=\"controlId\"\n [class]=\"`collapsible-content ${contentBgClasses()}`\"\n [attr.aria-labelledby]=\"headerId\"\n [class.full-height]=\"fullHeight()\"\n>\n @if (opened()) {\n <div class=\"content-motion\" animate.leave=\"content-leave\">\n <div class=\"overflow-hidden\">\n <div [class]=\"contentCssClasses()\">\n <ng-content />\n </div>\n </div>\n </div>\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n DestroyRef,\n ElementRef,\n inject,\n input,\n OnChanges\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ResizeObserverService } from '@siemens/element-ng/resize-observer';\n\nimport { SiAccordionHCollapseService } from './si-accordion-hcollapse.service';\nimport { SiAccordionService } from './si-accordion.service';\nimport { SiCollapsiblePanelComponent } from './si-collapsible-panel.component';\n\nconst PANEL_MIN_HEIGHT = 100;\n\n@Component({\n selector: 'si-accordion',\n template: '<div><ng-content /></div>',\n styleUrl: './si-accordion.component.scss',\n providers: [SiAccordionService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.full-height]': 'fullHeight()',\n '[class.hcollapsed]': 'collapsed()'\n }\n})\nexport class SiAccordionComponent implements AfterContentInit, OnChanges {\n /** @defaultValue true */\n readonly expandFirstPanel = input(true, { transform: booleanAttribute });\n /** @defaultValue false */\n readonly fullHeight = input(false, { transform: booleanAttribute });\n /** @defaultValue false */\n readonly hcollapsed = input(false);\n /**\n * Indicate whether the accordion is collapsed.\n * @internal\n */\n readonly collapsed = computed(\n () => this.accordionHCollapseService?.hcollapsed() ?? this.hcollapsed()\n );\n\n private readonly panels = contentChildren(SiCollapsiblePanelComponent);\n private responsive = false;\n private destroyer = inject(DestroyRef);\n private service = inject(SiAccordionService);\n private resizeObserver = inject(ResizeObserverService);\n private element = inject(ElementRef);\n private accordionHCollapseService = inject(SiAccordionHCollapseService, { optional: true });\n\n ngOnChanges(): void {\n this.service.fullHeight.set(this.fullHeight() && !this.responsive);\n }\n\n ngAfterContentInit(): void {\n this.resizeObserver\n .observe(this.element.nativeElement, 100, true, true)\n .pipe(takeUntilDestroyed(this.destroyer))\n .subscribe(() => this.calcFullHeight());\n\n this.panels().at(0)?.openClose(this.expandFirstPanel(), false);\n }\n\n private calcFullHeight(): void {\n if (this.panels?.length) {\n const height = (this.element.nativeElement as HTMLElement).offsetHeight;\n this.responsive = !this.hcollapsed() && height < this.panels.length * PANEL_MIN_HEIGHT;\n this.service.fullHeight.set(this.fullHeight() && !this.responsive);\n }\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiAccordionComponent } from './si-accordion.component';\nimport { SiCollapsiblePanelComponent } from './si-collapsible-panel.component';\n\n@NgModule({\n imports: [SiAccordionComponent, SiCollapsiblePanelComponent],\n exports: [SiAccordionComponent, SiCollapsiblePanelComponent]\n})\nexport class SiAccordionModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-collapsible-panel.component';\nexport * from './si-accordion.component';\nexport * from './si-accordion.service';\nexport * from './si-accordion-hcollapse.service';\nexport * from './si-accordion.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;AAGG;AAIH;MAIa,2BAA2B,CAAA;AACtC;;;;AAIG;AACM,IAAA,UAAU,GAAG,MAAM,CAAsB,SAAS,sDAAC;AAC5D;;AAEG;AACM,IAAA,KAAK,GAAG,IAAI,OAAO,EAAE;uGAVnB,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cAF1B,IAAI,EAAA,CAAA;;2FAEL,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACVD;;;AAGG;AAIH;MAIa,kBAAkB,CAAA;AAC7B;;AAEG;AACM,IAAA,OAAO,GAAG,IAAI,OAAO,EAAO;AACrC;;;;AAIG;AACM,IAAA,UAAU,GAAG,MAAM,CAAiB,IAAI,sDAAC;uGAVvC,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA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BAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAHlB,oBAAoB,EAAE,2BAA2B,CAAA,EAAA,OAAA,EAAA,CACjD,oBAAoB,EAAE,2BAA2B,CAAA,EAAA,CAAA;AAEhD,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAHI,2BAA2B,CAAA,EAAA,CAAA;;2FAGhD,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,2BAA2B,CAAC;AAC5D,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,2BAA2B;AAC5D,iBAAA;;;ACZD;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CdkMenuTrigger } from '@angular/cdk/menu';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Directive, input, Component, viewChild, signal, effect, booleanAttribute, inject, output, PLATFORM_ID, model, computed } from '@angular/core';
|
|
4
|
-
import {
|
|
4
|
+
import { elementOptionsVertical, elementDocument, elementDelete, elementStopFilled, elementSendFilled, elementAttachment } from '@siemens/element-icons';
|
|
5
|
+
import { addIcons, SiIconComponent } from '@siemens/element-ng/icon';
|
|
5
6
|
import { SiMenuFactoryComponent } from '@siemens/element-ng/menu';
|
|
6
7
|
import { t, SiTranslatePipe } from '@siemens/element-translate-ng/translate';
|
|
7
8
|
import * as i1 from '@siemens/element-ng/resize-observer';
|
|
@@ -134,6 +135,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
134
135
|
*/
|
|
135
136
|
class SiAiMessageComponent {
|
|
136
137
|
formattedContent = viewChild('formattedContent', ...(ngDevMode ? [{ debugName: "formattedContent" }] : []));
|
|
138
|
+
icons = addIcons({ elementOptionsVertical });
|
|
137
139
|
/**
|
|
138
140
|
* The AI-generated message content
|
|
139
141
|
* @defaultValue ''
|
|
@@ -204,7 +206,7 @@ class SiAiMessageComponent {
|
|
|
204
206
|
*/
|
|
205
207
|
secondaryActionsLabel = input(t(() => $localize `:@@SI_AI_MESSAGE.SECONDARY_ACTIONS:More actions`), ...(ngDevMode ? [{ debugName: "secondaryActionsLabel" }] : []));
|
|
206
208
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiAiMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
207
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiAiMessageComponent, isStandalone: true, selector: "si-ai-message", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, contentFormatter: { classPropertyName: "contentFormatter", publicName: "contentFormatter", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "formattedContent", first: true, predicate: ["formattedContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<si-chat-message alignment=\"start\" actionsPosition=\"bottom\" [loading]=\"loading()\">\n @if (content()) {\n @let content = textContent();\n @if (content) {\n <span class=\"text-pre-wrap\">{{ content }}</span>\n } @else {\n <div #formattedContent> </div>\n }\n }\n\n @if ((actions()?.length ?? 0 > 0) || (secondaryActions()?.length ?? 0 > 0)) {\n <div class=\"d-flex gap-4 ai-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions()?.length ?? 0 > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon icon=\"
|
|
209
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiAiMessageComponent, isStandalone: true, selector: "si-ai-message", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, contentFormatter: { classPropertyName: "contentFormatter", publicName: "contentFormatter", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "formattedContent", first: true, predicate: ["formattedContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<si-chat-message alignment=\"start\" actionsPosition=\"bottom\" [loading]=\"loading()\">\n @if (content()) {\n @let content = textContent();\n @if (content) {\n <span class=\"text-pre-wrap\">{{ content }}</span>\n } @else {\n <div #formattedContent> </div>\n }\n }\n\n @if ((actions()?.length ?? 0 > 0) || (secondaryActions()?.length ?? 0 > 0)) {\n <div class=\"d-flex gap-4 ai-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions()?.length ?? 0 > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementOptionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n </div>\n }\n</si-chat-message>\n", styles: [":host{display:block}si-chat-message{--chat-message-bubble-bg: transparent;--chat-message-bubble-padding: 0;margin-block-end:-4px}.ai-message-actions{margin-block-start:8px}:host ::ng-deep si-loading-spinner{--loading-spinner-size: 1.5em}\n"], dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData", "cdkMenuTriggerTransformOriginOn"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "component", type: SiChatMessageComponent, selector: "si-chat-message", inputs: ["loading", "alignment", "actionsPosition"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiMenuFactoryComponent, selector: "si-menu-factory", inputs: ["items", "actionParam"] }, { kind: "directive", type: SiChatMessageActionDirective, selector: "[siChatMessageAction]" }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
208
210
|
}
|
|
209
211
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiAiMessageComponent, decorators: [{
|
|
210
212
|
type: Component,
|
|
@@ -215,7 +217,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
215
217
|
SiMenuFactoryComponent,
|
|
216
218
|
SiChatMessageActionDirective,
|
|
217
219
|
SiTranslatePipe
|
|
218
|
-
], template: "<si-chat-message alignment=\"start\" actionsPosition=\"bottom\" [loading]=\"loading()\">\n @if (content()) {\n @let content = textContent();\n @if (content) {\n <span class=\"text-pre-wrap\">{{ content }}</span>\n } @else {\n <div #formattedContent> </div>\n }\n }\n\n @if ((actions()?.length ?? 0 > 0) || (secondaryActions()?.length ?? 0 > 0)) {\n <div class=\"d-flex gap-4 ai-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions()?.length ?? 0 > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon icon=\"
|
|
220
|
+
], template: "<si-chat-message alignment=\"start\" actionsPosition=\"bottom\" [loading]=\"loading()\">\n @if (content()) {\n @let content = textContent();\n @if (content) {\n <span class=\"text-pre-wrap\">{{ content }}</span>\n } @else {\n <div #formattedContent> </div>\n }\n }\n\n @if ((actions()?.length ?? 0 > 0) || (secondaryActions()?.length ?? 0 > 0)) {\n <div class=\"d-flex gap-4 ai-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions()?.length ?? 0 > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementOptionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n </div>\n }\n</si-chat-message>\n", styles: [":host{display:block}si-chat-message{--chat-message-bubble-bg: transparent;--chat-message-bubble-padding: 0;margin-block-end:-4px}.ai-message-actions{margin-block-start:8px}:host ::ng-deep si-loading-spinner{--loading-spinner-size: 1.5em}\n"] }]
|
|
219
221
|
}], ctorParameters: () => [], propDecorators: { formattedContent: [{ type: i0.ViewChild, args: ['formattedContent', { isSignal: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], contentFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentFormatter", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], secondaryActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActions", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }] } });
|
|
220
222
|
|
|
221
223
|
/**
|
|
@@ -246,6 +248,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
246
248
|
*/
|
|
247
249
|
class SiAttachmentListComponent {
|
|
248
250
|
modalService = inject(SiModalService);
|
|
251
|
+
icons = addIcons({ elementDelete, elementDocument });
|
|
249
252
|
/**
|
|
250
253
|
* List of attachments to display
|
|
251
254
|
* @defaultValue []
|
|
@@ -293,14 +296,14 @@ class SiAttachmentListComponent {
|
|
|
293
296
|
}
|
|
294
297
|
getFileIcon(name) {
|
|
295
298
|
// TODO: Accept map and default it in file upload directive.
|
|
296
|
-
return
|
|
299
|
+
return this.icons.elementDocument;
|
|
297
300
|
}
|
|
298
301
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiAttachmentListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
299
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiAttachmentListComponent, isStandalone: true, selector: "si-attachment-list", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { remove: "remove" }, ngImport: i0, template: "<div class=\"d-flex flex-wrap gap-4\" [class.justify-content-end]=\"alignment() === 'end'\">\n @for (attachment of attachments(); track $index) {\n <div class=\"attachment-item d-flex align-items-stretch\" role=\"group\">\n @if (attachment.previewTemplate) {\n <button\n type=\"button\"\n class=\"attachment-main focus-inside d-flex align-items-center flex-grow-1 min-width-0\"\n [attr.title]=\"attachment.name\"\n [attr.aria-label]=\"attachment.name\"\n (click)=\"openPreview($event, attachment)\"\n (keydown.enter)=\"openPreview($event, attachment)\"\n (keydown.space)=\"openPreview($event, attachment)\"\n >\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 mx-1\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body-2 d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </button>\n } @else {\n <div class=\"attachment-main--static d-flex align-items-center flex-grow-1 min-width-0\">\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 mx-1\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body-2 d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </div>\n }\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon expand-button flex-shrink-0 ms-auto align-self-center focus-inside\"\n [attr.aria-label]=\"(removeLabel() | translate) + ' ' + attachment.name\"\n (click)=\"remove.emit(attachment); $event.stopPropagation()\"\n >\n <si-icon class=\"icon\" icon=\"
|
|
302
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiAttachmentListComponent, isStandalone: true, selector: "si-attachment-list", inputs: { attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { remove: "remove" }, ngImport: i0, template: "<div class=\"d-flex flex-wrap gap-4\" [class.justify-content-end]=\"alignment() === 'end'\">\n @for (attachment of attachments(); track $index) {\n <div class=\"attachment-item d-flex align-items-stretch\" role=\"group\">\n @if (attachment.previewTemplate) {\n <button\n type=\"button\"\n class=\"attachment-main focus-inside d-flex align-items-center flex-grow-1 min-width-0\"\n [attr.title]=\"attachment.name\"\n [attr.aria-label]=\"attachment.name\"\n (click)=\"openPreview($event, attachment)\"\n (keydown.enter)=\"openPreview($event, attachment)\"\n (keydown.space)=\"openPreview($event, attachment)\"\n >\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 mx-1\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body-2 d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </button>\n } @else {\n <div class=\"attachment-main--static d-flex align-items-center flex-grow-1 min-width-0\">\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 mx-1\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body-2 d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </div>\n }\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon expand-button flex-shrink-0 ms-auto align-self-center focus-inside\"\n [attr.aria-label]=\"(removeLabel() | translate) + ' ' + attachment.name\"\n (click)=\"remove.emit(attachment); $event.stopPropagation()\"\n >\n <si-icon class=\"icon\" [icon]=\"icons.elementDelete\" />\n </button>\n }\n </div>\n }\n</div>\n", styles: [":host{--attachment-list-bg: var(--element-base-1-hover);--attachment-name-color: var(--element-text-primary)}.attachment-item{border-radius:var(--element-radius-2);overflow:hidden;background-color:var(--attachment-list-bg);color:var(--attachment-name-color)}.attachment-main{appearance:none;border:0;background:none;padding:0;margin:0;inline-size:100%;text-align:inherit;color:inherit;cursor:pointer}.attachment-icon{display:flex;align-items:center;justify-content:center}.attachment-info{display:flex;flex-direction:column;gap:2px;min-inline-size:0}.attachment-info .attachment-name{line-height:1.2}.attachment-info .attachment-size{line-height:1}.expand-button{border-radius:0}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
300
303
|
}
|
|
301
304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiAttachmentListComponent, decorators: [{
|
|
302
305
|
type: Component,
|
|
303
|
-
args: [{ selector: 'si-attachment-list', imports: [SiIconComponent, SiTranslatePipe], template: "<div class=\"d-flex flex-wrap gap-4\" [class.justify-content-end]=\"alignment() === 'end'\">\n @for (attachment of attachments(); track $index) {\n <div class=\"attachment-item d-flex align-items-stretch\" role=\"group\">\n @if (attachment.previewTemplate) {\n <button\n type=\"button\"\n class=\"attachment-main focus-inside d-flex align-items-center flex-grow-1 min-width-0\"\n [attr.title]=\"attachment.name\"\n [attr.aria-label]=\"attachment.name\"\n (click)=\"openPreview($event, attachment)\"\n (keydown.enter)=\"openPreview($event, attachment)\"\n (keydown.space)=\"openPreview($event, attachment)\"\n >\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 mx-1\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body-2 d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </button>\n } @else {\n <div class=\"attachment-main--static d-flex align-items-center flex-grow-1 min-width-0\">\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 mx-1\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body-2 d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </div>\n }\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon expand-button flex-shrink-0 ms-auto align-self-center focus-inside\"\n [attr.aria-label]=\"(removeLabel() | translate) + ' ' + attachment.name\"\n (click)=\"remove.emit(attachment); $event.stopPropagation()\"\n >\n <si-icon class=\"icon\" icon=\"
|
|
306
|
+
args: [{ selector: 'si-attachment-list', imports: [SiIconComponent, SiTranslatePipe], template: "<div class=\"d-flex flex-wrap gap-4\" [class.justify-content-end]=\"alignment() === 'end'\">\n @for (attachment of attachments(); track $index) {\n <div class=\"attachment-item d-flex align-items-stretch\" role=\"group\">\n @if (attachment.previewTemplate) {\n <button\n type=\"button\"\n class=\"attachment-main focus-inside d-flex align-items-center flex-grow-1 min-width-0\"\n [attr.title]=\"attachment.name\"\n [attr.aria-label]=\"attachment.name\"\n (click)=\"openPreview($event, attachment)\"\n (keydown.enter)=\"openPreview($event, attachment)\"\n (keydown.space)=\"openPreview($event, attachment)\"\n >\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 mx-1\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body-2 d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </button>\n } @else {\n <div class=\"attachment-main--static d-flex align-items-center flex-grow-1 min-width-0\">\n <si-icon\n class=\"attachment-icon icon flex-shrink-0 mx-1\"\n [icon]=\"getFileIcon(attachment.name)\"\n />\n <div class=\"attachment-info flex-grow-1 min-width-0\">\n <span\n class=\"attachment-name me-4 text-truncate si-body-2 d-block\"\n [title]=\"attachment.name\"\n >\n {{ attachment.name }}\n </span>\n </div>\n </div>\n }\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon expand-button flex-shrink-0 ms-auto align-self-center focus-inside\"\n [attr.aria-label]=\"(removeLabel() | translate) + ' ' + attachment.name\"\n (click)=\"remove.emit(attachment); $event.stopPropagation()\"\n >\n <si-icon class=\"icon\" [icon]=\"icons.elementDelete\" />\n </button>\n }\n </div>\n }\n</div>\n", styles: [":host{--attachment-list-bg: var(--element-base-1-hover);--attachment-name-color: var(--element-text-primary)}.attachment-item{border-radius:var(--element-radius-2);overflow:hidden;background-color:var(--attachment-list-bg);color:var(--attachment-name-color)}.attachment-main{appearance:none;border:0;background:none;padding:0;margin:0;inline-size:100%;text-align:inherit;color:inherit;cursor:pointer}.attachment-icon{display:flex;align-items:center;justify-content:center}.attachment-info{display:flex;flex-direction:column;gap:2px;min-inline-size:0}.attachment-info .attachment-name{line-height:1.2}.attachment-info .attachment-size{line-height:1}.expand-button{border-radius:0}\n"] }]
|
|
304
307
|
}], propDecorators: { attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: false }] }], alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }] } });
|
|
305
308
|
|
|
306
309
|
/**
|
|
@@ -550,6 +553,12 @@ class SiChatInputComponent {
|
|
|
550
553
|
textInput = viewChild('textInput', ...(ngDevMode ? [{ debugName: "textInput" }] : []));
|
|
551
554
|
projectedContent = viewChild('projected', ...(ngDevMode ? [{ debugName: "projectedContent" }] : []));
|
|
552
555
|
fileUploadDirective = viewChild(SiFileUploadDirective, ...(ngDevMode ? [{ debugName: "fileUploadDirective" }] : []));
|
|
556
|
+
icons = addIcons({
|
|
557
|
+
elementAttachment,
|
|
558
|
+
elementOptionsVertical,
|
|
559
|
+
elementSendFilled,
|
|
560
|
+
elementStopFilled
|
|
561
|
+
});
|
|
553
562
|
/**
|
|
554
563
|
* Current input value
|
|
555
564
|
* @defaultValue ''
|
|
@@ -645,9 +654,9 @@ class SiChatInputComponent {
|
|
|
645
654
|
/**
|
|
646
655
|
* Send button icon
|
|
647
656
|
*
|
|
648
|
-
* @defaultValue
|
|
657
|
+
* @defaultValue this.icons.elementSendFilled
|
|
649
658
|
*/
|
|
650
|
-
sendButtonIcon = input(
|
|
659
|
+
sendButtonIcon = input(this.icons.elementSendFilled, ...(ngDevMode ? [{ debugName: "sendButtonIcon" }] : []));
|
|
651
660
|
/**
|
|
652
661
|
* Interrupt button label
|
|
653
662
|
*
|
|
@@ -714,7 +723,7 @@ class SiChatInputComponent {
|
|
|
714
723
|
}
|
|
715
724
|
return !this.canSend();
|
|
716
725
|
}, ...(ngDevMode ? [{ debugName: "buttonDisabled" }] : []));
|
|
717
|
-
buttonIcon = computed(() => this.showInterruptButton() ?
|
|
726
|
+
buttonIcon = computed(() => this.showInterruptButton() ? this.icons.elementStopFilled : this.sendButtonIcon(), ...(ngDevMode ? [{ debugName: "buttonIcon" }] : []));
|
|
718
727
|
buttonLabel = computed(() => this.showInterruptButton() ? this.interruptButtonLabel() : this.sendButtonLabel(), ...(ngDevMode ? [{ debugName: "buttonLabel" }] : []));
|
|
719
728
|
dragOver = false;
|
|
720
729
|
get attachmentList() {
|
|
@@ -849,7 +858,7 @@ class SiChatInputComponent {
|
|
|
849
858
|
textarea.style.height = finalHeight + 'px';
|
|
850
859
|
}
|
|
851
860
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiChatInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
852
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiChatInputComponent, isStandalone: true, selector: "si-chat-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, sending: { classPropertyName: "sending", publicName: "sending", isSignal: true, isRequired: false, transformFunction: null }, interruptible: { classPropertyName: "interruptible", publicName: "interruptible", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, disclaimer: { classPropertyName: "disclaimer", publicName: "disclaimer", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, allowAttachments: { classPropertyName: "allowAttachments", publicName: "allowAttachments", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, sendButtonLabel: { classPropertyName: "sendButtonLabel", publicName: "sendButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, sendButtonIcon: { classPropertyName: "sendButtonIcon", publicName: "sendButtonIcon", isSignal: true, isRequired: false, transformFunction: null }, interruptButtonLabel: { classPropertyName: "interruptButtonLabel", publicName: "interruptButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, attachFileLabel: { classPropertyName: "attachFileLabel", publicName: "attachFileLabel", isSignal: true, isRequired: false, transformFunction: null }, removeAttachmentLabel: { classPropertyName: "removeAttachmentLabel", publicName: "removeAttachmentLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", attachments: "attachmentsChange", send: "send", interrupt: "interrupt", fileError: "fileError" }, viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true, isSignal: true }, { propertyName: "projectedContent", first: true, predicate: ["projected"], descendants: true, isSignal: true }, { propertyName: "fileUploadDirective", first: true, predicate: SiFileUploadDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"input-wrapper border rounded-3 bg-body\"\n [class.drag-over]=\"dragOver\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver = false\"\n>\n @if (hasAttachments()) {\n <div class=\"p-4 pb-0\">\n <si-attachment-list\n [attachments]=\"attachmentList\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n </div>\n }\n\n <div class=\"p-4 pe-2 pb-0 si-body-2\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0 p-2\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between px-4 ps-5 pb-2\">\n <div class=\"d-flex align-items-center gap-4\">\n @if (allowAttachments()) {\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n siFileUpload\n [accept]=\"accept()\"\n [maxFileSize]=\"maxFileSize()\"\n [multiple]=\"true\"\n (validFiles)=\"onFilesAdded($event)\"\n (fileError)=\"onFileError($event)\"\n />\n\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n [disabled]=\"disabled()\"\n (click)=\"fileInput.click()\"\n >\n <si-icon icon=\"element-attachment\" />\n </button>\n }\n\n @if (hasActions() || hasSecondaryActions()) {\n <div class=\"d-flex gap-4 ai-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions().length > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon icon=\"element-optionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n </div>\n }\n <div #projected class=\"d-flex flex-wrap align-items-start gap-4\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-primary\" [icon]=\"buttonIcon()\" />\n </button>\n </div>\n</div>\n\n<div class=\"disclaimer-wrapper text-center mt-4 px-3\">\n @if (disclaimer()) {\n <span class=\"si-caption text-secondary d-block\">{{ disclaimer() | translate }}</span>\n }\n <ng-content select=\"[siChatInputDisclaimer]\" />\n</div>\n", styles: [":host{max-inline-size:720px}.input-wrapper{border-color:var(--element-ui-4);background-color:var(--element-base-input-experimental)}.input-wrapper.drag-over{border:1px solid var(--element-focus-default);box-shadow:0 0 0 1px var(--element-focus-default)}.chat-textarea{min-block-size:1.7142857143em;font-family:inherit;outline:none;resize:none;background-color:transparent!important}.chat-textarea::placeholder{color:var(--element-text-secondary)}.chat-textarea:disabled{background-color:transparent!important;color:var(--element-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--element-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--element-button-focus-width) solid var(--element-focus-default);outline-offset:var(--element-button-focus-overlay-width);border-color:var(--element-ui-1)}.disclaimer-wrapper:empty{display:none}\n"], dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData", "cdkMenuTriggerTransformOriginOn"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiAttachmentListComponent, selector: "si-attachment-list", inputs: ["attachments", "alignment", "removable", "removeLabel"], outputs: ["remove"] }, { kind: "component", type: SiMenuFactoryComponent, selector: "si-menu-factory", inputs: ["items", "actionParam"] }, { kind: "directive", type: SiFileUploadDirective, selector: "input[type=\"file\"][siFileUpload]", inputs: ["errorTextFileType", "errorTextFileMaxSize", "accept", "maxFileSize", "multiple", "directoryUpload"], outputs: ["validFiles", "filesAdded", "fileError"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
861
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiChatInputComponent, isStandalone: true, selector: "si-chat-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, sending: { classPropertyName: "sending", publicName: "sending", isSignal: true, isRequired: false, transformFunction: null }, interruptible: { classPropertyName: "interruptible", publicName: "interruptible", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, disclaimer: { classPropertyName: "disclaimer", publicName: "disclaimer", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, allowAttachments: { classPropertyName: "allowAttachments", publicName: "allowAttachments", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, sendButtonLabel: { classPropertyName: "sendButtonLabel", publicName: "sendButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, sendButtonIcon: { classPropertyName: "sendButtonIcon", publicName: "sendButtonIcon", isSignal: true, isRequired: false, transformFunction: null }, interruptButtonLabel: { classPropertyName: "interruptButtonLabel", publicName: "interruptButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, attachFileLabel: { classPropertyName: "attachFileLabel", publicName: "attachFileLabel", isSignal: true, isRequired: false, transformFunction: null }, removeAttachmentLabel: { classPropertyName: "removeAttachmentLabel", publicName: "removeAttachmentLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", attachments: "attachmentsChange", send: "send", interrupt: "interrupt", fileError: "fileError" }, viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true, isSignal: true }, { propertyName: "projectedContent", first: true, predicate: ["projected"], descendants: true, isSignal: true }, { propertyName: "fileUploadDirective", first: true, predicate: SiFileUploadDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"input-wrapper border rounded-3 bg-body\"\n [class.drag-over]=\"dragOver\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver = false\"\n>\n @if (hasAttachments()) {\n <div class=\"p-4 pb-0\">\n <si-attachment-list\n [attachments]=\"attachmentList\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n </div>\n }\n\n <div class=\"p-4 pe-2 pb-0 si-body-2\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0 p-2\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between px-4 ps-5 pb-2\">\n <div class=\"d-flex align-items-center gap-4\">\n @if (allowAttachments()) {\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n siFileUpload\n [accept]=\"accept()\"\n [maxFileSize]=\"maxFileSize()\"\n [multiple]=\"true\"\n (validFiles)=\"onFilesAdded($event)\"\n (fileError)=\"onFileError($event)\"\n />\n\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n [disabled]=\"disabled()\"\n (click)=\"fileInput.click()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasActions() || hasSecondaryActions()) {\n <div class=\"d-flex gap-4 ai-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions().length > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementOptionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n </div>\n }\n <div #projected class=\"d-flex flex-wrap align-items-start gap-4\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-primary\" [icon]=\"buttonIcon()\" />\n </button>\n </div>\n</div>\n\n<div class=\"disclaimer-wrapper text-center mt-4 px-3\">\n @if (disclaimer()) {\n <span class=\"si-caption text-secondary d-block\">{{ disclaimer() | translate }}</span>\n }\n <ng-content select=\"[siChatInputDisclaimer]\" />\n</div>\n", styles: [":host{max-inline-size:720px}.input-wrapper{border-color:var(--element-ui-4);background-color:var(--element-base-input-experimental)}.input-wrapper.drag-over{border:1px solid var(--element-focus-default);box-shadow:0 0 0 1px var(--element-focus-default)}.chat-textarea{min-block-size:1.7142857143em;font-family:inherit;outline:none;resize:none;background-color:transparent!important}.chat-textarea::placeholder{color:var(--element-text-secondary)}.chat-textarea:disabled{background-color:transparent!important;color:var(--element-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--element-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--element-button-focus-width) solid var(--element-focus-default);outline-offset:var(--element-button-focus-overlay-width);border-color:var(--element-ui-1)}.disclaimer-wrapper:empty{display:none}\n"], dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData", "cdkMenuTriggerTransformOriginOn"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiAttachmentListComponent, selector: "si-attachment-list", inputs: ["attachments", "alignment", "removable", "removeLabel"], outputs: ["remove"] }, { kind: "component", type: SiMenuFactoryComponent, selector: "si-menu-factory", inputs: ["items", "actionParam"] }, { kind: "directive", type: SiFileUploadDirective, selector: "input[type=\"file\"][siFileUpload]", inputs: ["errorTextFileType", "errorTextFileMaxSize", "accept", "maxFileSize", "multiple", "directoryUpload"], outputs: ["validFiles", "filesAdded", "fileError"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
853
862
|
}
|
|
854
863
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiChatInputComponent, decorators: [{
|
|
855
864
|
type: Component,
|
|
@@ -861,7 +870,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
861
870
|
SiAttachmentListComponent,
|
|
862
871
|
SiMenuFactoryComponent,
|
|
863
872
|
SiFileUploadDirective
|
|
864
|
-
], template: "<div\n class=\"input-wrapper border rounded-3 bg-body\"\n [class.drag-over]=\"dragOver\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver = false\"\n>\n @if (hasAttachments()) {\n <div class=\"p-4 pb-0\">\n <si-attachment-list\n [attachments]=\"attachmentList\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n </div>\n }\n\n <div class=\"p-4 pe-2 pb-0 si-body-2\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0 p-2\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between px-4 ps-5 pb-2\">\n <div class=\"d-flex align-items-center gap-4\">\n @if (allowAttachments()) {\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n siFileUpload\n [accept]=\"accept()\"\n [maxFileSize]=\"maxFileSize()\"\n [multiple]=\"true\"\n (validFiles)=\"onFilesAdded($event)\"\n (fileError)=\"onFileError($event)\"\n />\n\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n [disabled]=\"disabled()\"\n (click)=\"fileInput.click()\"\n >\n <si-icon icon=\"
|
|
873
|
+
], template: "<div\n class=\"input-wrapper border rounded-3 bg-body\"\n [class.drag-over]=\"dragOver\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver = false\"\n>\n @if (hasAttachments()) {\n <div class=\"p-4 pb-0\">\n <si-attachment-list\n [attachments]=\"attachmentList\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n </div>\n }\n\n <div class=\"p-4 pe-2 pb-0 si-body-2\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0 p-2\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (keydown)=\"onKeyDown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between px-4 ps-5 pb-2\">\n <div class=\"d-flex align-items-center gap-4\">\n @if (allowAttachments()) {\n <input\n #fileInput\n type=\"file\"\n class=\"d-none\"\n siFileUpload\n [accept]=\"accept()\"\n [maxFileSize]=\"maxFileSize()\"\n [multiple]=\"true\"\n (validFiles)=\"onFilesAdded($event)\"\n (fileError)=\"onFileError($event)\"\n />\n\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n [disabled]=\"disabled()\"\n (click)=\"fileInput.click()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasActions() || hasSecondaryActions()) {\n <div class=\"d-flex gap-4 ai-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions().length > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementOptionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n </div>\n }\n <div #projected class=\"d-flex flex-wrap align-items-start gap-4\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-primary\" [icon]=\"buttonIcon()\" />\n </button>\n </div>\n</div>\n\n<div class=\"disclaimer-wrapper text-center mt-4 px-3\">\n @if (disclaimer()) {\n <span class=\"si-caption text-secondary d-block\">{{ disclaimer() | translate }}</span>\n }\n <ng-content select=\"[siChatInputDisclaimer]\" />\n</div>\n", styles: [":host{max-inline-size:720px}.input-wrapper{border-color:var(--element-ui-4);background-color:var(--element-base-input-experimental)}.input-wrapper.drag-over{border:1px solid var(--element-focus-default);box-shadow:0 0 0 1px var(--element-focus-default)}.chat-textarea{min-block-size:1.7142857143em;font-family:inherit;outline:none;resize:none;background-color:transparent!important}.chat-textarea::placeholder{color:var(--element-text-secondary)}.chat-textarea:disabled{background-color:transparent!important;color:var(--element-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--element-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--element-button-focus-width) solid var(--element-focus-default);outline-offset:var(--element-button-focus-overlay-width);border-color:var(--element-ui-1)}.disclaimer-wrapper:empty{display:none}\n"] }]
|
|
865
874
|
}], propDecorators: { textInput: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], projectedContent: [{ type: i0.ViewChild, args: ['projected', { isSignal: true }] }], fileUploadDirective: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiFileUploadDirective), { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], sending: [{ type: i0.Input, args: [{ isSignal: true, alias: "sending", required: false }] }], interruptible: [{ type: i0.Input, args: [{ isSignal: true, alias: "interruptible", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], disclaimer: [{ type: i0.Input, args: [{ isSignal: true, alias: "disclaimer", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], secondaryActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActions", required: false }] }], allowAttachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowAttachments", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: false }] }, { type: i0.Output, args: ["attachmentsChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }], sendButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonLabel", required: false }] }], sendButtonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "sendButtonIcon", required: false }] }], interruptButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "interruptButtonLabel", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], attachFileLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachFileLabel", required: false }] }], removeAttachmentLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeAttachmentLabel", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }], send: [{ type: i0.Output, args: ["send"] }], interrupt: [{ type: i0.Output, args: ["interrupt"] }], fileError: [{ type: i0.Output, args: ["fileError"] }] } });
|
|
866
875
|
|
|
867
876
|
/**
|
|
@@ -924,6 +933,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
924
933
|
*/
|
|
925
934
|
class SiUserMessageComponent {
|
|
926
935
|
formattedContent = viewChild('formattedContent', ...(ngDevMode ? [{ debugName: "formattedContent" }] : []));
|
|
936
|
+
icons = addIcons({ elementOptionsVertical });
|
|
927
937
|
/**
|
|
928
938
|
* The user message content
|
|
929
939
|
* @defaultValue ''
|
|
@@ -995,7 +1005,7 @@ class SiUserMessageComponent {
|
|
|
995
1005
|
});
|
|
996
1006
|
}
|
|
997
1007
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiUserMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
998
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiUserMessageComponent, isStandalone: true, selector: "si-user-message", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, contentFormatter: { classPropertyName: "contentFormatter", publicName: "contentFormatter", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "formattedContent", first: true, predicate: ["formattedContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<si-chat-message alignment=\"end\" actionsPosition=\"bottom\" [loading]=\"false\">\n @if (hasAttachments()) {\n <si-attachment-list alignment=\"end\" [attachments]=\"attachments()\" [removable]=\"false\" />\n }\n\n @if (content()) {\n @let content = textContent();\n @if (content) {\n <span class=\"text-pre-wrap\">{{ content }}</span>\n } @else {\n <div #formattedContent> </div>\n }\n }\n @if ((actions()?.length ?? 0 > 0) || (secondaryActions()?.length ?? 0 > 0)) {\n <div class=\"d-flex gap-4 user-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions()?.length ?? 0 > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon icon=\"
|
|
1008
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiUserMessageComponent, isStandalone: true, selector: "si-user-message", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, contentFormatter: { classPropertyName: "contentFormatter", publicName: "contentFormatter", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, secondaryActions: { classPropertyName: "secondaryActions", publicName: "secondaryActions", isSignal: true, isRequired: false, transformFunction: null }, attachments: { classPropertyName: "attachments", publicName: "attachments", isSignal: true, isRequired: false, transformFunction: null }, actionParam: { classPropertyName: "actionParam", publicName: "actionParam", isSignal: true, isRequired: false, transformFunction: null }, secondaryActionsLabel: { classPropertyName: "secondaryActionsLabel", publicName: "secondaryActionsLabel", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "formattedContent", first: true, predicate: ["formattedContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<si-chat-message alignment=\"end\" actionsPosition=\"bottom\" [loading]=\"false\">\n @if (hasAttachments()) {\n <si-attachment-list alignment=\"end\" [attachments]=\"attachments()\" [removable]=\"false\" />\n }\n\n @if (content()) {\n @let content = textContent();\n @if (content) {\n <span class=\"text-pre-wrap\">{{ content }}</span>\n } @else {\n <div #formattedContent> </div>\n }\n }\n @if ((actions()?.length ?? 0 > 0) || (secondaryActions()?.length ?? 0 > 0)) {\n <div class=\"d-flex gap-4 user-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions()?.length ?? 0 > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementOptionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n </div>\n }\n</si-chat-message>\n", styles: [":host{display:block}:host:not(:has([siChatMessageAction])) si-chat-message{padding-block-end:36px!important}.user-message-actions{opacity:0;transition:opacity .2s ease}si-chat-message{--chat-message-bubble-bg: var(--element-base-input-experimental);max-inline-size:600px;margin-inline-start:auto}:host:hover .user-message-actions,.user-message-actions:hover,.user-message-actions:has(::ng-deep [aria-expanded=true]),:host-context(.si-container-xs,.si-container-sm) .user-message-actions:active{opacity:1}\n"], dependencies: [{ kind: "directive", type: CdkMenuTrigger, selector: "[cdkMenuTriggerFor]", inputs: ["cdkMenuTriggerFor", "cdkMenuPosition", "cdkMenuTriggerData", "cdkMenuTriggerTransformOriginOn"], outputs: ["cdkMenuOpened", "cdkMenuClosed"], exportAs: ["cdkMenuTriggerFor"] }, { kind: "component", type: SiAttachmentListComponent, selector: "si-attachment-list", inputs: ["attachments", "alignment", "removable", "removeLabel"], outputs: ["remove"] }, { kind: "component", type: SiChatMessageComponent, selector: "si-chat-message", inputs: ["loading", "alignment", "actionsPosition"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "component", type: SiMenuFactoryComponent, selector: "si-menu-factory", inputs: ["items", "actionParam"] }, { kind: "directive", type: SiChatMessageActionDirective, selector: "[siChatMessageAction]" }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
999
1009
|
}
|
|
1000
1010
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiUserMessageComponent, decorators: [{
|
|
1001
1011
|
type: Component,
|
|
@@ -1007,7 +1017,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1007
1017
|
SiMenuFactoryComponent,
|
|
1008
1018
|
SiChatMessageActionDirective,
|
|
1009
1019
|
SiTranslatePipe
|
|
1010
|
-
], template: "<si-chat-message alignment=\"end\" actionsPosition=\"bottom\" [loading]=\"false\">\n @if (hasAttachments()) {\n <si-attachment-list alignment=\"end\" [attachments]=\"attachments()\" [removable]=\"false\" />\n }\n\n @if (content()) {\n @let content = textContent();\n @if (content) {\n <span class=\"text-pre-wrap\">{{ content }}</span>\n } @else {\n <div #formattedContent> </div>\n }\n }\n @if ((actions()?.length ?? 0 > 0) || (secondaryActions()?.length ?? 0 > 0)) {\n <div class=\"d-flex gap-4 user-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions()?.length ?? 0 > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon icon=\"
|
|
1020
|
+
], template: "<si-chat-message alignment=\"end\" actionsPosition=\"bottom\" [loading]=\"false\">\n @if (hasAttachments()) {\n <si-attachment-list alignment=\"end\" [attachments]=\"attachments()\" [removable]=\"false\" />\n }\n\n @if (content()) {\n @let content = textContent();\n @if (content) {\n <span class=\"text-pre-wrap\">{{ content }}</span>\n } @else {\n <div #formattedContent> </div>\n }\n }\n @if ((actions()?.length ?? 0 > 0) || (secondaryActions()?.length ?? 0 > 0)) {\n <div class=\"d-flex gap-4 user-message-actions\" siChatMessageAction>\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"action.action(actionParam(), action)\"\n >\n <si-icon [icon]=\"action.icon\" />\n </button>\n }\n\n @if (secondaryActions()?.length ?? 0 > 0) {\n <button\n type=\"button\"\n class=\"btn btn-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"secondaryActionsMenu\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n [attr.title]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementOptionsVertical\" />\n </button>\n\n <ng-template #secondaryActionsMenu>\n <si-menu-factory [items]=\"secondaryActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n </div>\n }\n</si-chat-message>\n", styles: [":host{display:block}:host:not(:has([siChatMessageAction])) si-chat-message{padding-block-end:36px!important}.user-message-actions{opacity:0;transition:opacity .2s ease}si-chat-message{--chat-message-bubble-bg: var(--element-base-input-experimental);max-inline-size:600px;margin-inline-start:auto}:host:hover .user-message-actions,.user-message-actions:hover,.user-message-actions:has(::ng-deep [aria-expanded=true]),:host-context(.si-container-xs,.si-container-sm) .user-message-actions:active{opacity:1}\n"] }]
|
|
1011
1021
|
}], ctorParameters: () => [], propDecorators: { formattedContent: [{ type: i0.ViewChild, args: ['formattedContent', { isSignal: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], contentFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentFormatter", required: false }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], secondaryActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActions", required: false }] }], attachments: [{ type: i0.Input, args: [{ isSignal: true, alias: "attachments", required: false }] }], actionParam: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionParam", required: false }] }], secondaryActionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryActionsLabel", required: false }] }] } });
|
|
1012
1022
|
|
|
1013
1023
|
/**
|