@siemens/element-ng 51.7.0 → 51.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/siemens-element-ng-card.mjs +16 -10
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-chat-messages.mjs +21 -19
- package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-tree-view.mjs +2 -2
- package/fesm2022/siemens-element-ng-tree-view.mjs.map +1 -1
- package/package.json +4 -4
- package/types/siemens-element-ng-card.d.ts +15 -9
- package/types/siemens-element-ng-chat-messages.d.ts +1 -3
|
@@ -191,42 +191,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
191
191
|
* SPDX-License-Identifier: MIT
|
|
192
192
|
*/
|
|
193
193
|
/**
|
|
194
|
-
* An action card component that
|
|
195
|
-
*
|
|
194
|
+
* An action card component that supports actions and selection on native buttons,
|
|
195
|
+
* and navigation on native anchors.
|
|
196
|
+
*
|
|
197
|
+
* **Important:** The `selectable` and `selected` inputs are supported only on button action cards. Do not
|
|
198
|
+
* use them with an anchor.
|
|
196
199
|
*
|
|
197
200
|
* Usage:
|
|
198
|
-
* as selectable card:
|
|
201
|
+
* as a selectable button card:
|
|
199
202
|
* `<button si-action-card selectable type="button" [(selected)]="isSelected">...</button>`
|
|
200
203
|
*
|
|
201
|
-
* or as an action card:
|
|
204
|
+
* or as an action button card:
|
|
202
205
|
* `<button si-action-card type="button" (click)="doSomeAction()">...</button>`
|
|
206
|
+
*
|
|
207
|
+
* or as a navigation card:
|
|
208
|
+
* `<a si-action-card href="/details">...</a>`
|
|
209
|
+
* `<a si-action-card routerLink="/details" routerLinkActive="selected">...</a>`
|
|
203
210
|
*/
|
|
204
211
|
class SiActionCardComponent extends SiCardBaseDirective {
|
|
205
212
|
static idCounter = 0;
|
|
206
213
|
id = `__si-action-card-${SiActionCardComponent.idCounter++}`;
|
|
207
214
|
/**
|
|
208
|
-
* Makes
|
|
215
|
+
* Makes a button action card selectable.
|
|
209
216
|
*
|
|
210
217
|
* @defaultValue false
|
|
211
218
|
*/
|
|
212
219
|
selectable = input(false, { ...(ngDevMode ? { debugName: "selectable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
213
220
|
/**
|
|
214
|
-
* Indicates
|
|
215
|
-
* Ignored when `selectable` is not set to `true`.
|
|
221
|
+
* Indicates whether a selectable button action card is selected.
|
|
216
222
|
*
|
|
217
223
|
* @defaultValue false
|
|
218
|
-
|
|
224
|
+
*/
|
|
219
225
|
selected = model(false, /* @ts-ignore */
|
|
220
226
|
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
221
227
|
headingId = `${this.id}-heading`;
|
|
222
228
|
subHeadingId = `${this.id}-subHeading`;
|
|
223
229
|
contentId = `${this.id}-content`;
|
|
224
230
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiActionCardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
225
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiActionCardComponent, isStandalone: true, selector: "button[si-action-card]", inputs: { selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, host: { listeners: { "click": "selectable() ? selected.set(!selected()) : null" }, properties: { "attr.aria-pressed": "selectable() ? (selected() ? \"true\" : \"false\") : undefined", "attr.aria-labelledby": "heading() ? headingId : undefined", "attr.aria-describedby": "subHeading() ? `${subHeadingId} ${contentId}` : contentId", "class.selected": "selectable() && selected()" }, classAttribute: "action-card" }, usesInheritance: true, ngImport: i0, template: "@if (imgSrc()) {\n <img\n class=\"card-content-split\"\n [class.card-img-top]=\"imgDir() !== 'horizontal'\"\n [class.card-img-start]=\"imgDir() === 'horizontal'\"\n [attr.src]=\"imgSrc()\"\n [attr.alt]=\"imgAlt() | translate\"\n />\n}\n\n<div class=\"content-container\" [class.card-content-split]=\"imgSrc()\">\n @if (heading()) {\n <si-card-header\n [heading]=\"heading()\"\n [subHeading]=\"subHeading()\"\n [headingId]=\"headingId\"\n [subHeadingId]=\"subHeadingId\"\n >\n <ng-content select=\"[headerIcon]\" ngProjectAs=\"[headerIcon]\" />\n </si-card-header>\n }\n <div class=\"d-contents\" [id]=\"contentId\">\n <ng-content #cardBody select=\"[body]\" />\n <ng-content #cardFooter select=\"[footer]\" />\n </div>\n</div>\n", styles: [":host.card-horizontal{flex-direction:row}.card-img-top{block-size:50%;inline-size:auto;object-fit:var(--si-card-img-object-fit, scale-down);object-position:var(--si-card-img-object-position, center top)}.card-img-start{block-size:auto;inline-size:50%;object-fit:var(--si-card-img-object-fit, scale-down);object-position:var(--si-card-img-object-position, left center)}.card-content-split{flex:0 0 50%}.content-container{overflow:hidden;position:relative;display:flex;flex-direction:column;flex:1 1 auto;min-inline-size:0;word-wrap:break-word;border-radius:inherit}\n"], dependencies: [{ kind: "component", type: SiCardHeaderComponent, selector: "si-card-header", inputs: ["heading", "subHeading", "headingId", "subHeadingId", "primaryActions", "secondaryActions", "actionParam", "actionBarViewType", "actionBarTitle"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
231
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiActionCardComponent, isStandalone: true, selector: "button[si-action-card], a[si-action-card]", inputs: { selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, host: { listeners: { "click": "selectable() ? selected.set(!selected()) : null" }, properties: { "attr.aria-pressed": "selectable() ? (selected() ? \"true\" : \"false\") : undefined", "attr.aria-labelledby": "heading() ? headingId : undefined", "attr.aria-describedby": "subHeading() ? `${subHeadingId} ${contentId}` : contentId", "class.selected": "selectable() && selected()" }, classAttribute: "action-card" }, usesInheritance: true, ngImport: i0, template: "@if (imgSrc()) {\n <img\n class=\"card-content-split\"\n [class.card-img-top]=\"imgDir() !== 'horizontal'\"\n [class.card-img-start]=\"imgDir() === 'horizontal'\"\n [attr.src]=\"imgSrc()\"\n [attr.alt]=\"imgAlt() | translate\"\n />\n}\n\n<div class=\"content-container\" [class.card-content-split]=\"imgSrc()\">\n @if (heading()) {\n <si-card-header\n [heading]=\"heading()\"\n [subHeading]=\"subHeading()\"\n [headingId]=\"headingId\"\n [subHeadingId]=\"subHeadingId\"\n >\n <ng-content select=\"[headerIcon]\" ngProjectAs=\"[headerIcon]\" />\n </si-card-header>\n }\n <div class=\"d-contents\" [id]=\"contentId\">\n <ng-content #cardBody select=\"[body]\" />\n <ng-content #cardFooter select=\"[footer]\" />\n </div>\n</div>\n", styles: [":host.card-horizontal{flex-direction:row}.card-img-top{block-size:50%;inline-size:auto;object-fit:var(--si-card-img-object-fit, scale-down);object-position:var(--si-card-img-object-position, center top)}.card-img-start{block-size:auto;inline-size:50%;object-fit:var(--si-card-img-object-fit, scale-down);object-position:var(--si-card-img-object-position, left center)}.card-content-split{flex:0 0 50%}.content-container{overflow:hidden;position:relative;display:flex;flex-direction:column;flex:1 1 auto;min-inline-size:0;word-wrap:break-word;border-radius:inherit}\n"], dependencies: [{ kind: "component", type: SiCardHeaderComponent, selector: "si-card-header", inputs: ["heading", "subHeading", "headingId", "subHeadingId", "primaryActions", "secondaryActions", "actionParam", "actionBarViewType", "actionBarTitle"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
226
232
|
}
|
|
227
233
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiActionCardComponent, decorators: [{
|
|
228
234
|
type: Component,
|
|
229
|
-
args: [{ selector: 'button[si-action-card]', imports: [SiCardHeaderComponent, SiTranslatePipe], host: {
|
|
235
|
+
args: [{ selector: 'button[si-action-card], a[si-action-card]', imports: [SiCardHeaderComponent, SiTranslatePipe], host: {
|
|
230
236
|
class: 'action-card',
|
|
231
237
|
'[attr.aria-pressed]': 'selectable() ? (selected() ? "true" : "false") : undefined',
|
|
232
238
|
'[attr.aria-labelledby]': 'heading() ? headingId : undefined',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-element-ng-card.mjs","sources":["../../../../projects/element-ng/card/si-card-base.directive.ts","../../../../projects/element-ng/card/si-card-header.component.ts","../../../../projects/element-ng/card/si-card-header.component.html","../../../../projects/element-ng/card/si-card.component.ts","../../../../projects/element-ng/card/si-card.component.html","../../../../projects/element-ng/card/si-action-card.component.ts","../../../../projects/element-ng/card/si-action-card.component.html","../../../../projects/element-ng/card/si-card.module.ts","../../../../projects/element-ng/card/index.ts","../../../../projects/element-ng/card/siemens-element-ng-card.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { computed, Directive, input } from '@angular/core';\nimport { TranslatableString } from '@siemens/element-translate-ng/translate';\n\n@Directive({\n host: {\n class: 'card',\n '[class.card-horizontal]': 'classCardHorizontal()',\n '[style.--si-card-img-object-fit]': 'imgObjectFit()',\n '[style.--si-card-img-object-position]': 'imgObjectPosition()'\n }\n})\nexport abstract class SiCardBaseDirective {\n /**\n * Card header text.\n */\n readonly heading = input<TranslatableString>();\n /**\n * Card secondary header text.\n */\n readonly subHeading = input<TranslatableString>();\n /**\n * Image source for the card.\n */\n readonly imgSrc = input<string>();\n /**\n * Alt text for a provided image.\n */\n readonly imgAlt = input<TranslatableString>();\n /**\n * Defines if an image is placed on top or start (left) of the card.\n *\n * @defaultValue 'vertical'\n */\n readonly imgDir = input<('horizontal' | 'vertical') | undefined>('vertical');\n /**\n * Sets the image [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property.\n *\n * @defaultValue 'scale-down'\n */\n readonly imgObjectFit = input<('contain' | 'cover' | 'fill' | 'none' | 'scale-down') | undefined>(\n 'scale-down'\n );\n /**\n * Sets the image [object-position](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) CSS property.\n */\n readonly imgObjectPosition = input<string>();\n /**\n * In case the card uses an image and horizontal direction is used we set flex row direction.\n */\n protected readonly classCardHorizontal = computed(\n () => !!this.imgSrc() && this.imgDir() === 'horizontal'\n );\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Component, computed, input } from '@angular/core';\nimport { MenuItem as MenuItemLegacy } from '@siemens/element-ng/common';\nimport {\n ContentActionBarMainItem,\n SiContentActionBarComponent,\n ViewType\n} from '@siemens/element-ng/content-action-bar';\nimport { MenuItem } from '@siemens/element-ng/menu';\nimport { SiTooltipOverflowDirective } from '@siemens/element-ng/tooltip';\nimport { SiTranslatePipe, TranslatableString } from '@siemens/element-translate-ng/translate';\n\n/**\n * Shared card header used internally by `SiCardComponent`, `SiActionCardComponent`,\n * and `SiDashboardCardComponent`. Not intended for direct use by consuming applications.\n *\n * @internal\n */\n@Component({\n selector: 'si-card-header',\n imports: [SiContentActionBarComponent, SiTranslatePipe, SiTooltipOverflowDirective],\n templateUrl: './si-card-header.component.html',\n styleUrl: './si-card-header.component.scss',\n host: {\n class: 'card-header d-flex justify-content-between'\n }\n})\nexport class SiCardHeaderComponent {\n /** The primary title text displayed in the card header. */\n readonly heading = input<TranslatableString>();\n /** The secondary title text displayed below the main heading. */\n readonly subHeading = input<TranslatableString>();\n /** HTML `id` applied to the heading element, used to associate `aria-labelledby` attributes. */\n readonly headingId = input<string>();\n /** HTML `id` applied to the sub-heading element, used to associate `aria-labelledby` attributes. */\n readonly subHeadingId = input<string>();\n /**\n * Primary action items rendered as buttons in the content action bar.\n * @defaultValue []\n */\n readonly primaryActions = input<(MenuItemLegacy | ContentActionBarMainItem)[]>([]);\n /**\n * Secondary action items rendered in the content action bar overflow menu.\n * @defaultValue []\n */\n readonly secondaryActions = input<(MenuItemLegacy | MenuItem)[]>([]);\n /** Optional parameter passed to action item callbacks when an action is triggered. */\n readonly actionParam = input<unknown>();\n /**\n * Controls how the content action bar renders its actions.\n * @defaultValue 'collapsible'\n */\n readonly actionBarViewType = input<ViewType>('collapsible');\n /**\n * Accessible title for the content action bar, used as an `aria-label`.\n * @defaultValue ''\n */\n readonly actionBarTitle = input<TranslatableString>('');\n\n readonly displayContentActionBar = computed(\n () => this.primaryActions()?.length > 0 || this.secondaryActions()?.length > 0\n );\n}\n","<ng-content select=\"[headerIcon]\" />\n<div class=\"heading\">\n @if (heading()) {\n <div class=\"text-truncate si-h5\" siTooltipOverflow [attr.id]=\"headingId()\">\n {{ heading() | translate }}\n </div>\n }\n @if (subHeading()) {\n <div\n class=\"text-truncate si-body text-secondary pt-2\"\n siTooltipOverflow\n [attr.id]=\"subHeadingId()\"\n >\n {{ subHeading() | translate }}\n </div>\n }\n</div>\n\n<div class=\"cab d-flex ms-6 my-n4 me-n5\">\n @if (displayContentActionBar()) {\n <si-content-action-bar\n class=\"ms-auto\"\n [primaryActions]=\"primaryActions()\"\n [secondaryActions]=\"secondaryActions()\"\n [actionParam]=\"actionParam()\"\n [viewType]=\"actionBarViewType()\"\n [attr.title]=\"actionBarTitle() | translate\"\n />\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Component, computed, input } from '@angular/core';\nimport { MenuItem as MenuItemLegacy } from '@siemens/element-ng/common';\nimport { ContentActionBarMainItem, ViewType } from '@siemens/element-ng/content-action-bar';\nimport { MenuItem } from '@siemens/element-ng/menu';\nimport { SiTranslatePipe, TranslatableString } from '@siemens/element-translate-ng/translate';\n\nimport { SiCardBaseDirective } from './si-card-base.directive';\nimport { SiCardHeaderComponent } from './si-card-header.component';\n\n@Component({\n selector: 'si-card',\n imports: [SiCardHeaderComponent, SiTranslatePipe],\n templateUrl: './si-card.component.html',\n styleUrl: './si-card.component.scss'\n})\nexport class SiCardComponent extends SiCardBaseDirective {\n /**\n * Input list of primary action items. Supports up to **4** actions and omits additional ones.\n *\n * @defaultValue []\n */\n readonly primaryActions = input<(MenuItemLegacy | ContentActionBarMainItem)[]>([]);\n /**\n * Input list of secondary action items.\n *\n * @defaultValue []\n */\n readonly secondaryActions = input<(MenuItemLegacy | MenuItem)[]>([]);\n /**\n * A param that will be passed to the `action` in the primary/secondary actions.\n * This allows to re-use the same primary/secondary action arrays across rows\n * in a table.\n */\n readonly actionParam = input<any>();\n /**\n * The view type of the content action bar of the card. Default is `collapsible`\n * for dashboards. However, in some cases you might need to change to `expanded`\n * or `mobile`.\n *\n * @defaultValue 'collapsible'\n */\n readonly actionBarViewType = input<ViewType>('collapsible');\n /**\n * Optional setting of html title attribute for the content action bar.\n * Helpful for a11y when only one action is configured in expand mode.\n *\n * @defaultValue ''\n */\n readonly actionBarTitle = input<TranslatableString>('');\n /**\n * Returns `true` when primary or secondary actions are set.\n */\n readonly displayContentActionBar = computed(\n () => this.primaryActions()?.length > 0 || this.secondaryActions()?.length > 0\n );\n}\n","@if (imgSrc()) {\n <img\n class=\"card-content-split\"\n [class.card-img-top]=\"imgDir() !== 'horizontal'\"\n [class.card-img-start]=\"imgDir() === 'horizontal'\"\n [attr.src]=\"imgSrc()\"\n [attr.alt]=\"imgAlt() | translate\"\n />\n}\n\n<div class=\"content-container\" [class.card-content-split]=\"imgSrc()\">\n @if (heading() || displayContentActionBar()) {\n <si-card-header\n [heading]=\"heading()\"\n [subHeading]=\"subHeading()\"\n [primaryActions]=\"primaryActions()\"\n [secondaryActions]=\"secondaryActions()\"\n [actionParam]=\"actionParam()\"\n [actionBarViewType]=\"actionBarViewType()\"\n [actionBarTitle]=\"actionBarTitle()\"\n >\n <ng-content select=\"[headerIcon]\" ngProjectAs=\"[headerIcon]\" />\n </si-card-header>\n }\n <ng-content #cardBody select=\"[body]\" />\n <ng-content #cardFooter select=\"[footer]\" />\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { booleanAttribute, Component, input, model } from '@angular/core';\nimport { SiTranslatePipe } from '@siemens/element-translate-ng/translate';\n\nimport { SiCardBaseDirective } from './si-card-base.directive';\nimport { SiCardHeaderComponent } from './si-card-header.component';\n\n/**\n * An action card component that extends the base card component with option to\n * either select the whole card or trigger an action.\n *\n * Usage:\n * as selectable card:\n * `<button si-action-card selectable type=\"button\" [(selected)]=\"isSelected\">...</button>`\n *\n * or as an action card:\n * `<button si-action-card type=\"button\" (click)=\"doSomeAction()\">...</button>`\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[si-action-card]',\n imports: [SiCardHeaderComponent, SiTranslatePipe],\n templateUrl: './si-action-card.component.html',\n styleUrl: './si-card.component.scss',\n host: {\n class: 'action-card',\n '[attr.aria-pressed]': 'selectable() ? (selected() ? \"true\" : \"false\") : undefined',\n '[attr.aria-labelledby]': 'heading() ? headingId : undefined',\n '[attr.aria-describedby]': 'subHeading() ? `${subHeadingId} ${contentId}` : contentId',\n '[class.selected]': 'selectable() && selected()',\n '(click)': 'selectable() ? selected.set(!selected()) : null'\n }\n})\nexport class SiActionCardComponent extends SiCardBaseDirective {\n private static idCounter = 0;\n private id = `__si-action-card-${SiActionCardComponent.idCounter++}`;\n /**\n * Makes whole card selectable.\n *\n * @defaultValue false\n */\n readonly selectable = input(false, {\n transform: booleanAttribute\n });\n /**\n * Indicates if the card is selected.\n * Ignored when `selectable` is not set to `true`.\n *\n * @defaultValue false\n * */\n readonly selected = model(false);\n\n protected headingId = `${this.id}-heading`;\n protected subHeadingId = `${this.id}-subHeading`;\n protected contentId = `${this.id}-content`;\n}\n","@if (imgSrc()) {\n <img\n class=\"card-content-split\"\n [class.card-img-top]=\"imgDir() !== 'horizontal'\"\n [class.card-img-start]=\"imgDir() === 'horizontal'\"\n [attr.src]=\"imgSrc()\"\n [attr.alt]=\"imgAlt() | translate\"\n />\n}\n\n<div class=\"content-container\" [class.card-content-split]=\"imgSrc()\">\n @if (heading()) {\n <si-card-header\n [heading]=\"heading()\"\n [subHeading]=\"subHeading()\"\n [headingId]=\"headingId\"\n [subHeadingId]=\"subHeadingId\"\n >\n <ng-content select=\"[headerIcon]\" ngProjectAs=\"[headerIcon]\" />\n </si-card-header>\n }\n <div class=\"d-contents\" [id]=\"contentId\">\n <ng-content #cardBody select=\"[body]\" />\n <ng-content #cardFooter select=\"[footer]\" />\n </div>\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiCardComponent } from './si-card.component';\n\n@NgModule({\n imports: [SiCardComponent],\n exports: [SiCardComponent]\n})\nexport class SiCardModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-card.component';\nexport * from './si-card-header.component';\nexport * from './si-action-card.component';\nexport * from './si-card.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;MAYmB,mBAAmB,CAAA;AACvC;;AAEG;AACM,IAAA,OAAO,GAAG,KAAK;2FAAsB;AAC9C;;AAEG;AACM,IAAA,UAAU,GAAG,KAAK;8FAAsB;AACjD;;AAEG;AACM,IAAA,MAAM,GAAG,KAAK;0FAAU;AACjC;;AAEG;AACM,IAAA,MAAM,GAAG,KAAK;0FAAsB;AAC7C;;;;AAIG;IACM,MAAM,GAAG,KAAK,CAA0C,UAAU;+EAAC;AAC5E;;;;AAIG;IACM,YAAY,GAAG,KAAK,CAC3B,YAAY;qFACb;AACD;;AAEG;AACM,IAAA,iBAAiB,GAAG,KAAK;qGAAU;AAC5C;;AAEG;AACgB,IAAA,mBAAmB,GAAG,QAAQ,CAC/C,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,IAA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MASU,YAAY,CAAA;uGAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAZ,YAAY,EAAA,OAAA,EAAA,CAHb,eAAe,CAAA,EAAA,OAAA,EAAA,CACf,eAAe,CAAA,EAAA,CAAA;AAEd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAHb,eAAe,CAAA,EAAA,CAAA;;2FAGd,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;oBAC1B,OAAO,EAAE,CAAC,eAAe;AAC1B,iBAAA;;;ACXD;;;AAGG;;ACHH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"siemens-element-ng-card.mjs","sources":["../../../../projects/element-ng/card/si-card-base.directive.ts","../../../../projects/element-ng/card/si-card-header.component.ts","../../../../projects/element-ng/card/si-card-header.component.html","../../../../projects/element-ng/card/si-card.component.ts","../../../../projects/element-ng/card/si-card.component.html","../../../../projects/element-ng/card/si-action-card.component.ts","../../../../projects/element-ng/card/si-action-card.component.html","../../../../projects/element-ng/card/si-card.module.ts","../../../../projects/element-ng/card/index.ts","../../../../projects/element-ng/card/siemens-element-ng-card.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { computed, Directive, input } from '@angular/core';\nimport { TranslatableString } from '@siemens/element-translate-ng/translate';\n\n@Directive({\n host: {\n class: 'card',\n '[class.card-horizontal]': 'classCardHorizontal()',\n '[style.--si-card-img-object-fit]': 'imgObjectFit()',\n '[style.--si-card-img-object-position]': 'imgObjectPosition()'\n }\n})\nexport abstract class SiCardBaseDirective {\n /**\n * Card header text.\n */\n readonly heading = input<TranslatableString>();\n /**\n * Card secondary header text.\n */\n readonly subHeading = input<TranslatableString>();\n /**\n * Image source for the card.\n */\n readonly imgSrc = input<string>();\n /**\n * Alt text for a provided image.\n */\n readonly imgAlt = input<TranslatableString>();\n /**\n * Defines if an image is placed on top or start (left) of the card.\n *\n * @defaultValue 'vertical'\n */\n readonly imgDir = input<('horizontal' | 'vertical') | undefined>('vertical');\n /**\n * Sets the image [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property.\n *\n * @defaultValue 'scale-down'\n */\n readonly imgObjectFit = input<('contain' | 'cover' | 'fill' | 'none' | 'scale-down') | undefined>(\n 'scale-down'\n );\n /**\n * Sets the image [object-position](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) CSS property.\n */\n readonly imgObjectPosition = input<string>();\n /**\n * In case the card uses an image and horizontal direction is used we set flex row direction.\n */\n protected readonly classCardHorizontal = computed(\n () => !!this.imgSrc() && this.imgDir() === 'horizontal'\n );\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Component, computed, input } from '@angular/core';\nimport { MenuItem as MenuItemLegacy } from '@siemens/element-ng/common';\nimport {\n ContentActionBarMainItem,\n SiContentActionBarComponent,\n ViewType\n} from '@siemens/element-ng/content-action-bar';\nimport { MenuItem } from '@siemens/element-ng/menu';\nimport { SiTooltipOverflowDirective } from '@siemens/element-ng/tooltip';\nimport { SiTranslatePipe, TranslatableString } from '@siemens/element-translate-ng/translate';\n\n/**\n * Shared card header used internally by `SiCardComponent`, `SiActionCardComponent`,\n * and `SiDashboardCardComponent`. Not intended for direct use by consuming applications.\n *\n * @internal\n */\n@Component({\n selector: 'si-card-header',\n imports: [SiContentActionBarComponent, SiTranslatePipe, SiTooltipOverflowDirective],\n templateUrl: './si-card-header.component.html',\n styleUrl: './si-card-header.component.scss',\n host: {\n class: 'card-header d-flex justify-content-between'\n }\n})\nexport class SiCardHeaderComponent {\n /** The primary title text displayed in the card header. */\n readonly heading = input<TranslatableString>();\n /** The secondary title text displayed below the main heading. */\n readonly subHeading = input<TranslatableString>();\n /** HTML `id` applied to the heading element, used to associate `aria-labelledby` attributes. */\n readonly headingId = input<string>();\n /** HTML `id` applied to the sub-heading element, used to associate `aria-labelledby` attributes. */\n readonly subHeadingId = input<string>();\n /**\n * Primary action items rendered as buttons in the content action bar.\n * @defaultValue []\n */\n readonly primaryActions = input<(MenuItemLegacy | ContentActionBarMainItem)[]>([]);\n /**\n * Secondary action items rendered in the content action bar overflow menu.\n * @defaultValue []\n */\n readonly secondaryActions = input<(MenuItemLegacy | MenuItem)[]>([]);\n /** Optional parameter passed to action item callbacks when an action is triggered. */\n readonly actionParam = input<unknown>();\n /**\n * Controls how the content action bar renders its actions.\n * @defaultValue 'collapsible'\n */\n readonly actionBarViewType = input<ViewType>('collapsible');\n /**\n * Accessible title for the content action bar, used as an `aria-label`.\n * @defaultValue ''\n */\n readonly actionBarTitle = input<TranslatableString>('');\n\n readonly displayContentActionBar = computed(\n () => this.primaryActions()?.length > 0 || this.secondaryActions()?.length > 0\n );\n}\n","<ng-content select=\"[headerIcon]\" />\n<div class=\"heading\">\n @if (heading()) {\n <div class=\"text-truncate si-h5\" siTooltipOverflow [attr.id]=\"headingId()\">\n {{ heading() | translate }}\n </div>\n }\n @if (subHeading()) {\n <div\n class=\"text-truncate si-body text-secondary pt-2\"\n siTooltipOverflow\n [attr.id]=\"subHeadingId()\"\n >\n {{ subHeading() | translate }}\n </div>\n }\n</div>\n\n<div class=\"cab d-flex ms-6 my-n4 me-n5\">\n @if (displayContentActionBar()) {\n <si-content-action-bar\n class=\"ms-auto\"\n [primaryActions]=\"primaryActions()\"\n [secondaryActions]=\"secondaryActions()\"\n [actionParam]=\"actionParam()\"\n [viewType]=\"actionBarViewType()\"\n [attr.title]=\"actionBarTitle() | translate\"\n />\n }\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Component, computed, input } from '@angular/core';\nimport { MenuItem as MenuItemLegacy } from '@siemens/element-ng/common';\nimport { ContentActionBarMainItem, ViewType } from '@siemens/element-ng/content-action-bar';\nimport { MenuItem } from '@siemens/element-ng/menu';\nimport { SiTranslatePipe, TranslatableString } from '@siemens/element-translate-ng/translate';\n\nimport { SiCardBaseDirective } from './si-card-base.directive';\nimport { SiCardHeaderComponent } from './si-card-header.component';\n\n@Component({\n selector: 'si-card',\n imports: [SiCardHeaderComponent, SiTranslatePipe],\n templateUrl: './si-card.component.html',\n styleUrl: './si-card.component.scss'\n})\nexport class SiCardComponent extends SiCardBaseDirective {\n /**\n * Input list of primary action items. Supports up to **4** actions and omits additional ones.\n *\n * @defaultValue []\n */\n readonly primaryActions = input<(MenuItemLegacy | ContentActionBarMainItem)[]>([]);\n /**\n * Input list of secondary action items.\n *\n * @defaultValue []\n */\n readonly secondaryActions = input<(MenuItemLegacy | MenuItem)[]>([]);\n /**\n * A param that will be passed to the `action` in the primary/secondary actions.\n * This allows to re-use the same primary/secondary action arrays across rows\n * in a table.\n */\n readonly actionParam = input<any>();\n /**\n * The view type of the content action bar of the card. Default is `collapsible`\n * for dashboards. However, in some cases you might need to change to `expanded`\n * or `mobile`.\n *\n * @defaultValue 'collapsible'\n */\n readonly actionBarViewType = input<ViewType>('collapsible');\n /**\n * Optional setting of html title attribute for the content action bar.\n * Helpful for a11y when only one action is configured in expand mode.\n *\n * @defaultValue ''\n */\n readonly actionBarTitle = input<TranslatableString>('');\n /**\n * Returns `true` when primary or secondary actions are set.\n */\n readonly displayContentActionBar = computed(\n () => this.primaryActions()?.length > 0 || this.secondaryActions()?.length > 0\n );\n}\n","@if (imgSrc()) {\n <img\n class=\"card-content-split\"\n [class.card-img-top]=\"imgDir() !== 'horizontal'\"\n [class.card-img-start]=\"imgDir() === 'horizontal'\"\n [attr.src]=\"imgSrc()\"\n [attr.alt]=\"imgAlt() | translate\"\n />\n}\n\n<div class=\"content-container\" [class.card-content-split]=\"imgSrc()\">\n @if (heading() || displayContentActionBar()) {\n <si-card-header\n [heading]=\"heading()\"\n [subHeading]=\"subHeading()\"\n [primaryActions]=\"primaryActions()\"\n [secondaryActions]=\"secondaryActions()\"\n [actionParam]=\"actionParam()\"\n [actionBarViewType]=\"actionBarViewType()\"\n [actionBarTitle]=\"actionBarTitle()\"\n >\n <ng-content select=\"[headerIcon]\" ngProjectAs=\"[headerIcon]\" />\n </si-card-header>\n }\n <ng-content #cardBody select=\"[body]\" />\n <ng-content #cardFooter select=\"[footer]\" />\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { booleanAttribute, Component, input, model } from '@angular/core';\nimport { SiTranslatePipe } from '@siemens/element-translate-ng/translate';\n\nimport { SiCardBaseDirective } from './si-card-base.directive';\nimport { SiCardHeaderComponent } from './si-card-header.component';\n\n/**\n * An action card component that supports actions and selection on native buttons,\n * and navigation on native anchors.\n *\n * **Important:** The `selectable` and `selected` inputs are supported only on button action cards. Do not\n * use them with an anchor.\n *\n * Usage:\n * as a selectable button card:\n * `<button si-action-card selectable type=\"button\" [(selected)]=\"isSelected\">...</button>`\n *\n * or as an action button card:\n * `<button si-action-card type=\"button\" (click)=\"doSomeAction()\">...</button>`\n *\n * or as a navigation card:\n * `<a si-action-card href=\"/details\">...</a>`\n * `<a si-action-card routerLink=\"/details\" routerLinkActive=\"selected\">...</a>`\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[si-action-card], a[si-action-card]',\n imports: [SiCardHeaderComponent, SiTranslatePipe],\n templateUrl: './si-action-card.component.html',\n styleUrl: './si-card.component.scss',\n host: {\n class: 'action-card',\n '[attr.aria-pressed]': 'selectable() ? (selected() ? \"true\" : \"false\") : undefined',\n '[attr.aria-labelledby]': 'heading() ? headingId : undefined',\n '[attr.aria-describedby]': 'subHeading() ? `${subHeadingId} ${contentId}` : contentId',\n '[class.selected]': 'selectable() && selected()',\n '(click)': 'selectable() ? selected.set(!selected()) : null'\n }\n})\nexport class SiActionCardComponent extends SiCardBaseDirective {\n private static idCounter = 0;\n private id = `__si-action-card-${SiActionCardComponent.idCounter++}`;\n /**\n * Makes a button action card selectable.\n *\n * @defaultValue false\n */\n readonly selectable = input(false, {\n transform: booleanAttribute\n });\n /**\n * Indicates whether a selectable button action card is selected.\n *\n * @defaultValue false\n */\n readonly selected = model(false);\n\n protected headingId = `${this.id}-heading`;\n protected subHeadingId = `${this.id}-subHeading`;\n protected contentId = `${this.id}-content`;\n}\n","@if (imgSrc()) {\n <img\n class=\"card-content-split\"\n [class.card-img-top]=\"imgDir() !== 'horizontal'\"\n [class.card-img-start]=\"imgDir() === 'horizontal'\"\n [attr.src]=\"imgSrc()\"\n [attr.alt]=\"imgAlt() | translate\"\n />\n}\n\n<div class=\"content-container\" [class.card-content-split]=\"imgSrc()\">\n @if (heading()) {\n <si-card-header\n [heading]=\"heading()\"\n [subHeading]=\"subHeading()\"\n [headingId]=\"headingId\"\n [subHeadingId]=\"subHeadingId\"\n >\n <ng-content select=\"[headerIcon]\" ngProjectAs=\"[headerIcon]\" />\n </si-card-header>\n }\n <div class=\"d-contents\" [id]=\"contentId\">\n <ng-content #cardBody select=\"[body]\" />\n <ng-content #cardFooter select=\"[footer]\" />\n </div>\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiCardComponent } from './si-card.component';\n\n@NgModule({\n imports: [SiCardComponent],\n exports: [SiCardComponent]\n})\nexport class SiCardModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-card.component';\nexport * from './si-card-header.component';\nexport * from './si-action-card.component';\nexport * from './si-card.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;MAYmB,mBAAmB,CAAA;AACvC;;AAEG;AACM,IAAA,OAAO,G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,EAAA,UAAA,EAAA,CAAA;kBAfjC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,2CAA2C,WAC5C,CAAC,qBAAqB,EAAE,eAAe,CAAC,EAAA,IAAA,EAG3C;AACJ,wBAAA,KAAK,EAAE,aAAa;AACpB,wBAAA,qBAAqB,EAAE,4DAA4D;AACnF,wBAAA,wBAAwB,EAAE,mCAAmC;AAC7D,wBAAA,yBAAyB,EAAE,2DAA2D;AACtF,wBAAA,kBAAkB,EAAE,4BAA4B;AAChD,wBAAA,SAAS,EAAE;AACZ,qBAAA,EAAA,QAAA,EAAA,uxBAAA,EAAA,MAAA,EAAA,CAAA,wjBAAA,CAAA,EAAA;;;AEzCH;;;AAGG;MASU,YAAY,CAAA;uGAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAZ,YAAY,EAAA,OAAA,EAAA,CAHb,eAAe,CAAA,EAAA,OAAA,EAAA,CACf,eAAe,CAAA,EAAA,CAAA;AAEd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAHb,eAAe,CAAA,EAAA,CAAA;;2FAGd,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;oBAC1B,OAAO,EAAE,CAAC,eAAe;AAC1B,iBAAA;;;ACXD;;;AAGG;;ACHH;;AAEG;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, inject, input, Component, booleanAttribute, output, model, viewChild, PLATFORM_ID, effect, InjectionToken, computed, signal,
|
|
2
|
+
import { Directive, inject, input, Component, booleanAttribute, output, model, viewChild, PLATFORM_ID, effect, InjectionToken, afterRenderEffect, computed, signal, contentChild, isSignal } from '@angular/core';
|
|
3
3
|
import { SiSourceChipComponent } from '@siemens/element-ng/source-chip';
|
|
4
4
|
import { t, SiTranslatePipe } from '@siemens/element-translate-ng/translate';
|
|
5
5
|
import { CdkMenuTrigger } from '@angular/cdk/menu';
|
|
@@ -726,6 +726,14 @@ class SiChatInputComponent {
|
|
|
726
726
|
this.interruptible.set(parent.inputInterruptible());
|
|
727
727
|
}
|
|
728
728
|
});
|
|
729
|
+
afterRenderEffect(() => {
|
|
730
|
+
const value = this.value();
|
|
731
|
+
const textarea = this.textInput()?.nativeElement;
|
|
732
|
+
if (textarea) {
|
|
733
|
+
textarea.value = value;
|
|
734
|
+
this.setTextareaHeight(textarea);
|
|
735
|
+
}
|
|
736
|
+
});
|
|
729
737
|
}
|
|
730
738
|
/**
|
|
731
739
|
* Current input value
|
|
@@ -957,7 +965,6 @@ class SiChatInputComponent {
|
|
|
957
965
|
...(ngDevMode ? [{ debugName: "buttonLabel" }] : /* istanbul ignore next */ []));
|
|
958
966
|
dragOver = signal(false, /* @ts-ignore */
|
|
959
967
|
...(ngDevMode ? [{ debugName: "dragOver" }] : /* istanbul ignore next */ []));
|
|
960
|
-
injector = inject(Injector);
|
|
961
968
|
menuActionService = inject(SiMenuActionService, { optional: true });
|
|
962
969
|
runAction(action) {
|
|
963
970
|
if (typeof action.action === 'function') {
|
|
@@ -967,18 +974,9 @@ class SiChatInputComponent {
|
|
|
967
974
|
this.menuActionService?.actionTriggered(action, this.actionParam());
|
|
968
975
|
}
|
|
969
976
|
}
|
|
970
|
-
onInputChange(value) {
|
|
971
|
-
this.value.set(value);
|
|
972
|
-
}
|
|
973
977
|
selectFollowUpPrompt(prompt) {
|
|
974
978
|
this.followUpPromptSelected.emit(prompt);
|
|
975
979
|
this.focus();
|
|
976
|
-
afterNextRender(() => {
|
|
977
|
-
const textarea = this.textInput();
|
|
978
|
-
if (textarea?.nativeElement) {
|
|
979
|
-
this.setTextareaHeight(textarea.nativeElement);
|
|
980
|
-
}
|
|
981
|
-
}, { injector: this.injector });
|
|
982
980
|
}
|
|
983
981
|
onSend() {
|
|
984
982
|
if (this.canSend()) {
|
|
@@ -1000,8 +998,14 @@ class SiChatInputComponent {
|
|
|
1000
998
|
}
|
|
1001
999
|
}
|
|
1002
1000
|
onKeyDown(event) {
|
|
1001
|
+
if (event.isComposing) {
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1003
1004
|
if (event.key === 'Enter' && !event.shiftKey) {
|
|
1004
1005
|
event.preventDefault();
|
|
1006
|
+
if (event.repeat) {
|
|
1007
|
+
return;
|
|
1008
|
+
}
|
|
1005
1009
|
if (!this.canSend()) {
|
|
1006
1010
|
return;
|
|
1007
1011
|
}
|
|
@@ -1011,6 +1015,9 @@ class SiChatInputComponent {
|
|
|
1011
1015
|
this.onSend();
|
|
1012
1016
|
}
|
|
1013
1017
|
}
|
|
1018
|
+
onInput(event) {
|
|
1019
|
+
this.setTextareaHeight(event.target);
|
|
1020
|
+
}
|
|
1014
1021
|
onFilesAdded(uploadFiles) {
|
|
1015
1022
|
const validFiles = uploadFiles.filter(uploadFile => uploadFile.status === 'added');
|
|
1016
1023
|
validFiles.forEach(uploadFile => {
|
|
@@ -1048,7 +1055,6 @@ class SiChatInputComponent {
|
|
|
1048
1055
|
ngAfterViewInit() {
|
|
1049
1056
|
const textarea = this.textInput();
|
|
1050
1057
|
if (textarea?.nativeElement) {
|
|
1051
|
-
this.setTextareaHeight(textarea.nativeElement);
|
|
1052
1058
|
if (this.autoFocus()) {
|
|
1053
1059
|
// Use setTimeout to ensure the element is fully rendered
|
|
1054
1060
|
setTimeout(() => {
|
|
@@ -1057,10 +1063,6 @@ class SiChatInputComponent {
|
|
|
1057
1063
|
}
|
|
1058
1064
|
}
|
|
1059
1065
|
}
|
|
1060
|
-
adjustTextareaHeight(event) {
|
|
1061
|
-
const textarea = event.target;
|
|
1062
|
-
this.setTextareaHeight(textarea);
|
|
1063
|
-
}
|
|
1064
1066
|
/**
|
|
1065
1067
|
* Focus the textarea input
|
|
1066
1068
|
*/
|
|
@@ -1106,7 +1108,7 @@ class SiChatInputComponent {
|
|
|
1106
1108
|
textarea.style.height = finalHeight + 'px';
|
|
1107
1109
|
}
|
|
1108
1110
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1109
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.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 }, followUpPrompts: { classPropertyName: "followUpPrompts", publicName: "followUpPrompts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", sending: "sendingChange", interruptible: "interruptibleChange", attachments: "attachmentsChange", followUpPromptSelected: "followUpPromptSelected", send: "send", interrupt: "interrupt", fileError: "fileError" }, viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true, isSignal: true }, { propertyName: "fileUploadDirective", first: true, predicate: SiFileUploadDirective, descendants: true, isSignal: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (followUpPrompts().length) {\n <div class=\"follow-up-prompts d-flex flex-wrap gap-4 mb-4\">\n @for (prompt of followUpPrompts(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-secondary-ghost fw-normal\"\n [disabled]=\"disabled() || sending()\"\n (click)=\"selectFollowUpPrompt(prompt)\"\n >{{ prompt }}</button\n >\n }\n </div>\n}\n\n<div\n class=\"input-wrapper border rounded-3\"\n [class.drag-over]=\"dragOver()\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver.set(false)\"\n>\n @if (hasAttachments()) {\n <si-attachment-list\n [attachments]=\"attachments()\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n }\n\n <div class=\"si-body-paragraph\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0\"\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\">\n <div class=\"d-flex align-items-center gap-0\">\n <div class=\"btn-group\" role=\"group\">\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\n @if (allowAttachments() && !hasSecondaryActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"disabled()\"\n [siTooltip]=\"attachFileLabel() | translate\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n (click)=\"triggerFileInput()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasMenuActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"allActionsMenu\"\n [siTooltip]=\"secondaryActionsLabel() | translate\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementPlus\" />\n </button>\n\n <ng-template #allActionsMenu>\n <si-menu-factory [items]=\"combinedMenuActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @if (hasActions()) {\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost\"\n [class.btn-icon]=\"!!action.icon\"\n [disabled]=\"action.disabled\"\n [siTooltip]=\"action.label | translate\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"runAction(action)\"\n >\n @if (action.icon) {\n <si-icon [icon]=\"action.icon\" />\n } @else {\n {{ action.label | translate }}\n }\n </button>\n }\n }\n </div>\n <div class=\"d-flex align-items-center gap-0\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-tertiary btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-accent\" [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-body-sm 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(--si-sys-color-border-4);background-color:var(--si-sys-color-background-1);padding-block:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-y-40);padding-inline:var(--si-sys-sizing-spacing-x-50);display:flex;flex-direction:column;gap:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-x-50)}.input-wrapper:hover,.input-wrapper:active,.input-wrapper:focus-within{background-color:var(--si-sys-color-background-4);border-color:var(--si-sys-color-border-1)}.input-wrapper.drag-over{border:1px solid var(--si-sys-color-effects-focus);box-shadow:0 0 0 1px var(--si-sys-color-effects-focus)}.chat-textarea{min-block-size:1lh;font-family:inherit;padding-block:0;display:block;outline:none;resize:none;background-color:transparent}.chat-textarea::placeholder{color:var(--si-sys-color-text-secondary)}.chat-textarea:disabled{background-color:transparent;color:var(--si-sys-color-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--si-sys-color-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--si-sys-sizing-focus-ring-width) solid var(--si-sys-color-effects-focus);outline-offset:var(--si-sys-sizing-focus-ring-offset)}.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]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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: "directive", type: SiTooltipDirective, selector: "[siTooltip]", inputs: ["siTooltip", "placement", "isDisabled", "tooltipScrollStrategy", "tooltipContext"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1111
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.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 }, followUpPrompts: { classPropertyName: "followUpPrompts", publicName: "followUpPrompts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", sending: "sendingChange", interruptible: "interruptibleChange", attachments: "attachmentsChange", followUpPromptSelected: "followUpPromptSelected", send: "send", interrupt: "interrupt", fileError: "fileError" }, viewQueries: [{ propertyName: "textInput", first: true, predicate: ["textInput"], descendants: true, isSignal: true }, { propertyName: "fileUploadDirective", first: true, predicate: SiFileUploadDirective, descendants: true, isSignal: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (followUpPrompts().length) {\n <div class=\"follow-up-prompts d-flex flex-wrap gap-4 mb-4\">\n @for (prompt of followUpPrompts(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-secondary-ghost fw-normal\"\n [disabled]=\"disabled() || sending()\"\n (click)=\"selectFollowUpPrompt(prompt)\"\n >{{ prompt }}</button\n >\n }\n </div>\n}\n\n<div\n class=\"input-wrapper border rounded-3\"\n [class.drag-over]=\"dragOver()\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver.set(false)\"\n>\n @if (hasAttachments()) {\n <si-attachment-list\n [attachments]=\"attachments()\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n }\n\n <div class=\"si-body-paragraph\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeyDown($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between\">\n <div class=\"d-flex align-items-center gap-0\">\n <div class=\"btn-group\" role=\"group\">\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\n @if (allowAttachments() && !hasSecondaryActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"disabled()\"\n [siTooltip]=\"attachFileLabel() | translate\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n (click)=\"triggerFileInput()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasMenuActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"allActionsMenu\"\n [siTooltip]=\"secondaryActionsLabel() | translate\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementPlus\" />\n </button>\n\n <ng-template #allActionsMenu>\n <si-menu-factory [items]=\"combinedMenuActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @if (hasActions()) {\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost\"\n [class.btn-icon]=\"!!action.icon\"\n [disabled]=\"action.disabled\"\n [siTooltip]=\"action.label | translate\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"runAction(action)\"\n >\n @if (action.icon) {\n <si-icon [icon]=\"action.icon\" />\n } @else {\n {{ action.label | translate }}\n }\n </button>\n }\n }\n </div>\n <div class=\"d-flex align-items-center gap-0\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-tertiary btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-accent\" [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-body-sm 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(--si-sys-color-border-4);background-color:var(--si-sys-color-background-1);padding-block:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-y-40);padding-inline:var(--si-sys-sizing-spacing-x-50);display:flex;flex-direction:column;gap:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-x-50)}.input-wrapper:hover,.input-wrapper:active,.input-wrapper:focus-within{background-color:var(--si-sys-color-background-4);border-color:var(--si-sys-color-border-1)}.input-wrapper.drag-over{border:1px solid var(--si-sys-color-effects-focus);box-shadow:0 0 0 1px var(--si-sys-color-effects-focus)}.chat-textarea{min-block-size:1lh;font-family:inherit;padding-block:0;display:block;outline:none;resize:none;background-color:transparent}.chat-textarea::placeholder{color:var(--si-sys-color-text-secondary)}.chat-textarea:disabled{background-color:transparent;color:var(--si-sys-color-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--si-sys-color-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--si-sys-sizing-focus-ring-width) solid var(--si-sys-color-effects-focus);outline-offset:var(--si-sys-sizing-focus-ring-offset)}.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]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[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: "directive", type: SiTooltipDirective, selector: "[siTooltip]", inputs: ["siTooltip", "placement", "isDisabled", "tooltipScrollStrategy", "tooltipContext"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
|
|
1110
1112
|
}
|
|
1111
1113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiChatInputComponent, decorators: [{
|
|
1112
1114
|
type: Component,
|
|
@@ -1119,7 +1121,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1119
1121
|
SiMenuFactoryComponent,
|
|
1120
1122
|
SiFileUploadDirective,
|
|
1121
1123
|
SiTooltipDirective
|
|
1122
|
-
], template: "@if (followUpPrompts().length) {\n <div class=\"follow-up-prompts d-flex flex-wrap gap-4 mb-4\">\n @for (prompt of followUpPrompts(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-secondary-ghost fw-normal\"\n [disabled]=\"disabled() || sending()\"\n (click)=\"selectFollowUpPrompt(prompt)\"\n >{{ prompt }}</button\n >\n }\n </div>\n}\n\n<div\n class=\"input-wrapper border rounded-3\"\n [class.drag-over]=\"dragOver()\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver.set(false)\"\n>\n @if (hasAttachments()) {\n <si-attachment-list\n [attachments]=\"attachments()\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n }\n\n <div class=\"si-body-paragraph\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (
|
|
1124
|
+
], template: "@if (followUpPrompts().length) {\n <div class=\"follow-up-prompts d-flex flex-wrap gap-4 mb-4\">\n @for (prompt of followUpPrompts(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-secondary-ghost fw-normal\"\n [disabled]=\"disabled() || sending()\"\n (click)=\"selectFollowUpPrompt(prompt)\"\n >{{ prompt }}</button\n >\n }\n </div>\n}\n\n<div\n class=\"input-wrapper border rounded-3\"\n [class.drag-over]=\"dragOver()\"\n (click)=\"onContainerClick($event)\"\n (drop)=\"dropHandler($event)\"\n (dragover)=\"dragOverHandler($event)\"\n (dragleave)=\"dragOver.set(false)\"\n>\n @if (hasAttachments()) {\n <si-attachment-list\n [attachments]=\"attachments()\"\n [removeLabel]=\"removeAttachmentLabel()\"\n [removable]=\"true\"\n (remove)=\"removeAttachment($event)\"\n />\n }\n\n <div class=\"si-body-paragraph\">\n <label class=\"form-label d-none\" [for]=\"id\">{{ label() | translate }}</label>\n <textarea\n #textInput\n class=\"chat-textarea w-100 border-0\"\n rows=\"1\"\n [id]=\"id\"\n [placeholder]=\"placeholder() | translate\"\n [disabled]=\"disabled()\"\n [maxlength]=\"maxLength() || null\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeyDown($event)\"\n ></textarea>\n </div>\n\n <div class=\"d-flex align-items-center justify-content-between\">\n <div class=\"d-flex align-items-center gap-0\">\n <div class=\"btn-group\" role=\"group\">\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\n @if (allowAttachments() && !hasSecondaryActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [disabled]=\"disabled()\"\n [siTooltip]=\"attachFileLabel() | translate\"\n [attr.aria-label]=\"attachFileLabel() | translate\"\n (click)=\"triggerFileInput()\"\n >\n <si-icon [icon]=\"icons.elementAttachment\" />\n </button>\n }\n\n @if (hasMenuActions()) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost btn-icon\"\n [cdkMenuTriggerFor]=\"allActionsMenu\"\n [siTooltip]=\"secondaryActionsLabel() | translate\"\n [attr.aria-label]=\"secondaryActionsLabel() | translate\"\n >\n <si-icon [icon]=\"icons.elementPlus\" />\n </button>\n\n <ng-template #allActionsMenu>\n <si-menu-factory [items]=\"combinedMenuActions()\" [actionParam]=\"actionParam()\" />\n </ng-template>\n }\n @if (hasActions()) {\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n class=\"btn btn-tertiary-ghost\"\n [class.btn-icon]=\"!!action.icon\"\n [disabled]=\"action.disabled\"\n [siTooltip]=\"action.label | translate\"\n [attr.aria-label]=\"action.label | translate\"\n (click)=\"runAction(action)\"\n >\n @if (action.icon) {\n <si-icon [icon]=\"action.icon\" />\n } @else {\n {{ action.label | translate }}\n }\n </button>\n }\n }\n </div>\n <div class=\"d-flex align-items-center gap-0\">\n <ng-content />\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"btn btn-tertiary btn-icon\"\n [disabled]=\"buttonDisabled()\"\n [attr.aria-label]=\"buttonLabel() | translate\"\n (click)=\"onButtonClick()\"\n >\n <si-icon class=\"text-accent\" [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-body-sm 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(--si-sys-color-border-4);background-color:var(--si-sys-color-background-1);padding-block:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-y-40);padding-inline:var(--si-sys-sizing-spacing-x-50);display:flex;flex-direction:column;gap:var(--si-sys-sizing-spacing-y-50) var(--si-sys-sizing-spacing-x-50)}.input-wrapper:hover,.input-wrapper:active,.input-wrapper:focus-within{background-color:var(--si-sys-color-background-4);border-color:var(--si-sys-color-border-1)}.input-wrapper.drag-over{border:1px solid var(--si-sys-color-effects-focus);box-shadow:0 0 0 1px var(--si-sys-color-effects-focus)}.chat-textarea{min-block-size:1lh;font-family:inherit;padding-block:0;display:block;outline:none;resize:none;background-color:transparent}.chat-textarea::placeholder{color:var(--si-sys-color-text-secondary)}.chat-textarea:disabled{background-color:transparent;color:var(--si-sys-color-text-disabled);cursor:not-allowed}.chat-textarea:disabled::placeholder{color:var(--si-sys-color-text-disabled)}.input-wrapper:has(.chat-textarea:focus-visible){outline:var(--si-sys-sizing-focus-ring-width) solid var(--si-sys-color-effects-focus);outline-offset:var(--si-sys-sizing-focus-ring-offset)}.disclaimer-wrapper:empty{display:none}\n"] }]
|
|
1123
1125
|
}], ctorParameters: () => [], propDecorators: { textInput: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], fileUploadDirective: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SiFileUploadDirective), { isSignal: true }] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { 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 }] }, { type: i0.Output, args: ["sendingChange"] }], interruptible: [{ type: i0.Input, args: [{ isSignal: true, alias: "interruptible", required: false }] }, { type: i0.Output, args: ["interruptibleChange"] }], 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 }] }], followUpPrompts: [{ type: i0.Input, args: [{ isSignal: true, alias: "followUpPrompts", required: false }] }], followUpPromptSelected: [{ type: i0.Output, args: ["followUpPromptSelected"] }], send: [{ type: i0.Output, args: ["send"] }], interrupt: [{ type: i0.Output, args: ["interrupt"] }], fileError: [{ type: i0.Output, args: ["fileError"] }] } });
|
|
1124
1126
|
|
|
1125
1127
|
/**
|
|
@@ -1284,7 +1286,7 @@ class SiAiWelcomeScreenComponent {
|
|
|
1284
1286
|
this.promptSelected.emit(suggestion);
|
|
1285
1287
|
}
|
|
1286
1288
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAiWelcomeScreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1287
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAiWelcomeScreenComponent, isStandalone: true, selector: "si-ai-welcome-screen", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, selectedCategory: { classPropertyName: "selectedCategory", publicName: "selectedCategory", isSignal: true, isRequired: false, transformFunction: null }, promptSuggestions: { classPropertyName: "promptSuggestions", publicName: "promptSuggestions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedCategory: "selectedCategoryChange", promptSelected: "promptSelected" }, host: { classAttribute: "d-block" }, ngImport: i0, template: "<div class=\"d-flex flex-column gap-13 align-items-center w-100\">\n <!-- Welcome Header -->\n <div class=\"welcome-header d-flex flex-column gap-4 w-100 pt-13 pb-8\">\n <ng-content />\n </div>\n\n <!-- Prompt Categories and Suggestions -->\n <div class=\"prompt-suggestions d-flex flex-column gap-6 align-items-center w-100\">\n @if (categories().length > 0) {\n <div class=\"d-flex gap-4 align-items-center w-100\">\n @for (category of categories(); track $index) {\n <si-summary-chip\n class=\"user-select-none\"\n [label]=\"category.label\"\n [selected]=\"selectedCategory() === category.label\"\n (selectedChange)=\"onCategoryClick(category.label)\"\n />\n }\n </div>\n }\n\n @if (promptSuggestions().length > 0) {\n <div class=\"d-flex flex-column gap-4 w-100\">\n @for (suggestion of promptSuggestions(); track $index) {\n <button si-action-card type=\"button\" class=\"w-100\" (click)=\"onPromptClick(suggestion)\">\n <div body class=\"card-body card-text\">\n {{ suggestion.text }}\n </div>\n </button>\n }\n </div>\n }\n </div>\n</div>\n", styles: [".welcome-header{max-inline-size:720px;overflow-x:visible;position:relative}.welcome-header:before{position:absolute;content:\"\";inset-inline-start:-104px;inset-block-start:50%;transform:translateY(-50%);inline-size:168px;block-size:168px;background-image:var(--element-brand-ai-key-visual);background-size:contain;background-repeat:no-repeat;background-position:center}:host{container-type:inline-size}@container (max-width: 767.98px){:host .welcome-header:before{display:none}}.prompt-suggestions{max-inline-size:720px}.prompt-suggestions>div:first-child{flex-wrap:wrap}:host{inline-size:100%}::ng-deep button[si-action-card]{background-color:transparent;border-radius:var(--si-sys-sizing-border-radius-sm);border:1px solid var(--si-sys-color-border-4)}\n"], dependencies: [{ kind: "component", type: SiActionCardComponent, selector: "button[si-action-card]", inputs: ["selectable", "selected"], outputs: ["selectedChange"] }, { kind: "component", type: SiSummaryChipComponent, selector: "si-summary-chip", inputs: ["status", "icon", "color", "stackedIcon", "stackedColor", "label", "value", "selected", "disabled", "hideLabel"], outputs: ["selectedChange"] }] });
|
|
1289
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: SiAiWelcomeScreenComponent, isStandalone: true, selector: "si-ai-welcome-screen", inputs: { categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, selectedCategory: { classPropertyName: "selectedCategory", publicName: "selectedCategory", isSignal: true, isRequired: false, transformFunction: null }, promptSuggestions: { classPropertyName: "promptSuggestions", publicName: "promptSuggestions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedCategory: "selectedCategoryChange", promptSelected: "promptSelected" }, host: { classAttribute: "d-block" }, ngImport: i0, template: "<div class=\"d-flex flex-column gap-13 align-items-center w-100\">\n <!-- Welcome Header -->\n <div class=\"welcome-header d-flex flex-column gap-4 w-100 pt-13 pb-8\">\n <ng-content />\n </div>\n\n <!-- Prompt Categories and Suggestions -->\n <div class=\"prompt-suggestions d-flex flex-column gap-6 align-items-center w-100\">\n @if (categories().length > 0) {\n <div class=\"d-flex gap-4 align-items-center w-100\">\n @for (category of categories(); track $index) {\n <si-summary-chip\n class=\"user-select-none\"\n [label]=\"category.label\"\n [selected]=\"selectedCategory() === category.label\"\n (selectedChange)=\"onCategoryClick(category.label)\"\n />\n }\n </div>\n }\n\n @if (promptSuggestions().length > 0) {\n <div class=\"d-flex flex-column gap-4 w-100\">\n @for (suggestion of promptSuggestions(); track $index) {\n <button si-action-card type=\"button\" class=\"w-100\" (click)=\"onPromptClick(suggestion)\">\n <div body class=\"card-body card-text\">\n {{ suggestion.text }}\n </div>\n </button>\n }\n </div>\n }\n </div>\n</div>\n", styles: [".welcome-header{max-inline-size:720px;overflow-x:visible;position:relative}.welcome-header:before{position:absolute;content:\"\";inset-inline-start:-104px;inset-block-start:50%;transform:translateY(-50%);inline-size:168px;block-size:168px;background-image:var(--element-brand-ai-key-visual);background-size:contain;background-repeat:no-repeat;background-position:center}:host{container-type:inline-size}@container (max-width: 767.98px){:host .welcome-header:before{display:none}}.prompt-suggestions{max-inline-size:720px}.prompt-suggestions>div:first-child{flex-wrap:wrap}:host{inline-size:100%}::ng-deep button[si-action-card]{background-color:transparent;border-radius:var(--si-sys-sizing-border-radius-sm);border:1px solid var(--si-sys-color-border-4)}\n"], dependencies: [{ kind: "component", type: SiActionCardComponent, selector: "button[si-action-card], a[si-action-card]", inputs: ["selectable", "selected"], outputs: ["selectedChange"] }, { kind: "component", type: SiSummaryChipComponent, selector: "si-summary-chip", inputs: ["status", "icon", "color", "stackedIcon", "stackedColor", "label", "value", "selected", "disabled", "hideLabel"], outputs: ["selectedChange"] }] });
|
|
1288
1290
|
}
|
|
1289
1291
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SiAiWelcomeScreenComponent, decorators: [{
|
|
1290
1292
|
type: Component,
|