@fundamental-ngx/ui5-webcomponents-ai 0.64.2-rc.8 → 0.64.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-button-state.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-button.mjs +8 -3
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-button.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-input.mjs +8 -3
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-input.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-prompt-input.mjs +8 -3
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-prompt-input.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-text-area.mjs +8 -3
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-text-area.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-toolbar-label.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-versioning.mjs +8 -3
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-versioning.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-writing-assistant.mjs +8 -3
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai-writing-assistant.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai.mjs +43 -13
- package/fesm2022/fundamental-ngx-ui5-webcomponents-ai.mjs.map +1 -1
- package/package.json +5 -5
- package/types/fundamental-ngx-ui5-webcomponents-ai-button.d.ts +1 -0
- package/types/fundamental-ngx-ui5-webcomponents-ai-input.d.ts +1 -0
- package/types/fundamental-ngx-ui5-webcomponents-ai-prompt-input.d.ts +1 -0
- package/types/fundamental-ngx-ui5-webcomponents-ai-text-area.d.ts +1 -0
- package/types/fundamental-ngx-ui5-webcomponents-ai-versioning.d.ts +1 -0
- package/types/fundamental-ngx-ui5-webcomponents-ai-writing-assistant.d.ts +1 -0
- package/types/fundamental-ngx-ui5-webcomponents-ai.d.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fundamental-ngx-ui5-webcomponents-ai-toolbar-label.mjs","sources":["../../../../libs/ui5-webcomponents-ai/toolbar-label/index.ts","../../../../libs/ui5-webcomponents-ai/toolbar-label/fundamental-ngx-ui5-webcomponents-ai-toolbar-label.ts"],"sourcesContent":["\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n output,\n AfterViewInit,\n effect,\n runInInjectionContext,\n inject,\n Injector,\n booleanAttribute,\n computed,\n signal\n} from '@angular/core';\nimport '@ui5/webcomponents-ai/dist/ToolbarLabel.js';\nimport { default as _ToolbarLabel } from '@ui5/webcomponents-ai/dist/ToolbarLabel.js';\nimport { UI5CustomEvent } from '@ui5/webcomponents-base';\nimport {\n ContentDensityObserver,\n contentDensityObserverProviders,\n ContentDensityMode\n} from '@fundamental-ngx/core/content-density';\n\nimport { default as ToolbarItemOverflowBehavior } from '@ui5/webcomponents/dist/types/ToolbarItemOverflowBehavior.js';\n\n@Component({\n standalone: true,\n selector: 'ui5-ai-toolbar-label, [ui5-ai-toolbar-label]',\n template: '<ng-content></ng-content>',\n exportAs: 'ui5ToolbarLabel',\n providers: [\n contentDensityObserverProviders({\n supportedContentDensity: [ContentDensityMode.COMPACT, ContentDensityMode.COZY]\n })\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ToolbarLabel implements AfterViewInit {\n\n /**\n * Defines the text of the label.\n */\n text = input<typeof _ToolbarLabel.prototype.text | undefined>(\"\");\n\n /**\n * Property used to define the access of the item to the overflow Popover. If \"NeverOverflow\" option is set,\nthe item never goes in the Popover, if \"AlwaysOverflow\" - it never comes out of it.\n */\n overflowPriority = input<typeof _ToolbarLabel.prototype.overflowPriority | undefined>(\"Default\");\n\n /**\n * Defines if the toolbar overflow popup should close upon interaction with the item.\nIt will close by default.\n */\n preventOverflowClosing = input(false, { transform: booleanAttribute }); // className is now passed\n\n\n\n\n /**\n * Available slots for content projection in this component.\n *\n * Slots allow you to insert custom content into predefined areas of the web component.\n * Use the `slot` attribute on child elements to target specific slots.\n *\n * - **(default)**: Wrapped component slot.\n *\n * @example\n * ```html\n * <ui5-ai-toolbar-label>\n * <div slot=\"header\">Custom header content</div>\n * <p>Default slot content</p>\n * </ui5-ai-toolbar-label>\n * ```\n *\n * @readonly\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots | MDN Web Components Slots}\n */\n readonly slots = [\n {\n \"name\": \"default\",\n \"description\": \"Wrapped component slot.\",\n \"since\": \"2.20.0\"\n }\n ];\n\n\n public elementRef: ElementRef<_ToolbarLabel> = inject(ElementRef);\n public injector = inject(Injector);\n\n /**\n * Content density observer is injected to activate automatic CSS class and\n * UI5 attribute application. The observer self-initializes, no explicit subscribe() needed.\n * @private\n */\n private readonly _contentDensityObserver = inject(ContentDensityObserver);\n\n get element(): _ToolbarLabel {\n return this.elementRef.nativeElement;\n }\n\n ngAfterViewInit(): void {\n const wcElement = this.element;\n \n const inputsToSync = [\n 'text',\n 'overflowPriority',\n 'preventOverflowClosing',\n ];\n \n // Synchronize inputs (properties)\n for (const inputName of inputsToSync) {\n // Find the corresponding camelCase signal property on the Angular component\n const signalName = inputName.replace(/-./g, (x: string) => x[1].toUpperCase());\n\n // Use the Injector to run the effect in the correct context\n if (this[signalName] && typeof this[signalName] === 'function') {\n runInInjectionContext(this.injector, () => {\n effect(() => {\n // Read the signal value\n const value = this[signalName]();\n if (wcElement) {\n // Skip writes when the signal is undefined and the property is already truthy\n // This prevents clobbering imperatively-set values (e.g., from RouterLink)\n if (value === undefined && wcElement[inputName]) {\n return;\n }\n // Write the value to the Web Component's property\n wcElement[inputName] = value;\n }\n });\n });\n }\n }\n \n \n \n\n }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"fundamental-ngx-ui5-webcomponents-ai-toolbar-label.mjs","sources":["../../../../libs/ui5-webcomponents-ai/toolbar-label/index.ts","../../../../libs/ui5-webcomponents-ai/toolbar-label/fundamental-ngx-ui5-webcomponents-ai-toolbar-label.ts"],"sourcesContent":["\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n output,\n AfterViewInit,\n effect,\n runInInjectionContext,\n inject,\n Injector,\n booleanAttribute,\n computed,\n signal\n} from '@angular/core';\nimport '@ui5/webcomponents-ai/dist/ToolbarLabel.js';\nimport { default as _ToolbarLabel } from '@ui5/webcomponents-ai/dist/ToolbarLabel.js';\nimport { UI5CustomEvent } from '@ui5/webcomponents-base';\nimport {\n ContentDensityObserver,\n contentDensityObserverProviders,\n ContentDensityMode\n} from '@fundamental-ngx/core/content-density';\n\n\nimport { default as ToolbarItemOverflowBehavior } from '@ui5/webcomponents/dist/types/ToolbarItemOverflowBehavior.js';\n\n@Component({\n standalone: true,\n selector: 'ui5-ai-toolbar-label, [ui5-ai-toolbar-label]',\n template: '<ng-content></ng-content>',\n exportAs: 'ui5ToolbarLabel',\n providers: [\n contentDensityObserverProviders({\n supportedContentDensity: [ContentDensityMode.COMPACT, ContentDensityMode.COZY]\n })\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ToolbarLabel implements AfterViewInit {\n\n /**\n * Defines the text of the label.\n */\n text = input<typeof _ToolbarLabel.prototype.text | undefined>(\"\");\n\n /**\n * Property used to define the access of the item to the overflow Popover. If \"NeverOverflow\" option is set,\nthe item never goes in the Popover, if \"AlwaysOverflow\" - it never comes out of it.\n */\n overflowPriority = input<typeof _ToolbarLabel.prototype.overflowPriority | undefined>(\"Default\");\n\n /**\n * Defines if the toolbar overflow popup should close upon interaction with the item.\nIt will close by default.\n */\n preventOverflowClosing = input(false, { transform: booleanAttribute }); // className is now passed\n\n\n\n\n /**\n * Available slots for content projection in this component.\n *\n * Slots allow you to insert custom content into predefined areas of the web component.\n * Use the `slot` attribute on child elements to target specific slots.\n *\n * - **(default)**: Wrapped component slot.\n *\n * @example\n * ```html\n * <ui5-ai-toolbar-label>\n * <div slot=\"header\">Custom header content</div>\n * <p>Default slot content</p>\n * </ui5-ai-toolbar-label>\n * ```\n *\n * @readonly\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots | MDN Web Components Slots}\n */\n readonly slots = [\n {\n \"name\": \"default\",\n \"description\": \"Wrapped component slot.\",\n \"since\": \"2.20.0\"\n }\n ];\n\n\n public elementRef: ElementRef<_ToolbarLabel> = inject(ElementRef);\n public injector = inject(Injector);\n\n /**\n * Content density observer is injected to activate automatic CSS class and\n * UI5 attribute application. The observer self-initializes, no explicit subscribe() needed.\n * @private\n */\n private readonly _contentDensityObserver = inject(ContentDensityObserver);\n\n get element(): _ToolbarLabel {\n return this.elementRef.nativeElement;\n }\n\n ngAfterViewInit(): void {\n const wcElement = this.element;\n \n const inputsToSync = [\n 'text',\n 'overflowPriority',\n 'preventOverflowClosing',\n ];\n \n // Synchronize inputs (properties)\n for (const inputName of inputsToSync) {\n // Find the corresponding camelCase signal property on the Angular component\n const signalName = inputName.replace(/-./g, (x: string) => x[1].toUpperCase());\n\n // Use the Injector to run the effect in the correct context\n if (this[signalName] && typeof this[signalName] === 'function') {\n runInInjectionContext(this.injector, (): void => {\n effect((): void => {\n // Read the signal value\n const value = this[signalName]();\n if (wcElement) {\n // Skip writes when the signal is undefined and the property is already truthy\n // This prevents clobbering imperatively-set values (e.g., from RouterLink)\n if (value === undefined && wcElement[inputName]) {\n return;\n }\n // Write the value to the Web Component's property\n wcElement[inputName] = value;\n }\n });\n });\n }\n }\n \n \n \n\n }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAwCa,YAAY,CAAA;AAZzB,IAAA,WAAA,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,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI;aAC9E;AACF,SAAA,EAAA,QAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EANS,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAS1B,YAAY,EAAA,UAAA,EAAA,CAAA;kBAZxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,8CAA8C;AACxD,oBAAA,QAAQ,EAAE,2BAA2B;AACrC,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,SAAS,EAAE;AACT,wBAAA,+BAA+B,CAAC;4BAC9B,uBAAuB,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI;yBAC9E;AACF,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;;ACvCD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output, inject, ElementRef, Injector, runInInjectionContext, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, inject, ElementRef, Injector, DestroyRef, runInInjectionContext, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import '@ui5/webcomponents-ai/dist/Versioning.js';
|
|
4
4
|
import { ContentDensityObserver, contentDensityObserverProviders, ContentDensityMode } from '@fundamental-ngx/core/content-density';
|
|
5
5
|
|
|
@@ -68,6 +68,7 @@ class Versioning {
|
|
|
68
68
|
* @private
|
|
69
69
|
*/
|
|
70
70
|
this._contentDensityObserver = inject(ContentDensityObserver);
|
|
71
|
+
this._destroyRef = inject(DestroyRef);
|
|
71
72
|
}
|
|
72
73
|
get element() {
|
|
73
74
|
return this.elementRef.nativeElement;
|
|
@@ -107,17 +108,21 @@ class Versioning {
|
|
|
107
108
|
'ui5VersionChange',
|
|
108
109
|
];
|
|
109
110
|
// Synchronize outputs (events)
|
|
111
|
+
const _listeners = [];
|
|
110
112
|
for (const outputName of outputsToSync) {
|
|
111
113
|
// Map Angular output name to UI5 web component event name
|
|
112
114
|
const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
|
|
113
115
|
// Ensure the output property exists and has an emit function before adding listener
|
|
114
116
|
if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
|
|
115
117
|
// Cast the listener to the correct type to satisfy TypeScript
|
|
116
|
-
|
|
118
|
+
const listener = (e) => {
|
|
117
119
|
this[outputName].emit(e);
|
|
118
|
-
}
|
|
120
|
+
};
|
|
121
|
+
wcElement.addEventListener(eventName, listener);
|
|
122
|
+
_listeners.push(() => wcElement.removeEventListener(eventName, listener));
|
|
119
123
|
}
|
|
120
124
|
}
|
|
125
|
+
this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));
|
|
121
126
|
}
|
|
122
127
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Versioning, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
123
128
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Versioning, isStandalone: true, selector: "ui5-ai-versioning, [ui5-ai-versioning]", inputs: { currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: false, transformFunction: null }, totalSteps: { classPropertyName: "totalSteps", publicName: "totalSteps", isSignal: true, isRequired: false, transformFunction: null }, overflowPriority: { classPropertyName: "overflowPriority", publicName: "overflowPriority", isSignal: true, isRequired: false, transformFunction: null }, preventOverflowClosing: { classPropertyName: "preventOverflowClosing", publicName: "preventOverflowClosing", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5VersionChange: "ui5VersionChange" }, providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fundamental-ngx-ui5-webcomponents-ai-versioning.mjs","sources":["../../../../libs/ui5-webcomponents-ai/versioning/index.ts","../../../../libs/ui5-webcomponents-ai/versioning/fundamental-ngx-ui5-webcomponents-ai-versioning.ts"],"sourcesContent":["\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n output,\n AfterViewInit,\n effect,\n runInInjectionContext,\n inject,\n Injector,\n booleanAttribute,\n computed,\n signal\n} from '@angular/core';\nimport '@ui5/webcomponents-ai/dist/Versioning.js';\nimport { default as _Versioning } from '@ui5/webcomponents-ai/dist/Versioning.js';\nimport { UI5CustomEvent } from '@ui5/webcomponents-base';\nimport {\n ContentDensityObserver,\n contentDensityObserverProviders,\n ContentDensityMode\n} from '@fundamental-ngx/core/content-density';\n\nimport { default as ToolbarItemOverflowBehavior } from '@ui5/webcomponents/dist/types/ToolbarItemOverflowBehavior.js';\n\n@Component({\n standalone: true,\n selector: 'ui5-ai-versioning, [ui5-ai-versioning]',\n template: '<ng-content></ng-content>',\n exportAs: 'ui5Versioning',\n providers: [\n contentDensityObserverProviders({\n supportedContentDensity: [ContentDensityMode.COMPACT, ContentDensityMode.COZY]\n })\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Versioning implements AfterViewInit {\n\n /**\n * Indicates the index of the currently displayed result version.\n\nThis property represents the current position in the version history.\n */\n currentStep = input<typeof _Versioning.prototype.currentStep | undefined>(0);\n\n /**\n * The total number of available result versions.\n\nNote: Versioning is hidden if the value is `0`.\n */\n totalSteps = input<typeof _Versioning.prototype.totalSteps | undefined>(0);\n\n /**\n * Property used to define the access of the item to the overflow Popover. If \"NeverOverflow\" option is set,\nthe item never goes in the Popover, if \"AlwaysOverflow\" - it never comes out of it.\n */\n overflowPriority = input<typeof _Versioning.prototype.overflowPriority | undefined>(\"Default\");\n\n /**\n * Defines if the toolbar overflow popup should close upon interaction with the item.\nIt will close by default.\n */\n preventOverflowClosing = input(false, { transform: booleanAttribute }); // className is now passed\n\n\n\n /**\n * Fired when the user clicks on version navigation buttons.\n */\n ui5VersionChange = output<UI5CustomEvent<_Versioning, 'version-change'>>();\n\n /**\n * Available slots for content projection in this component.\n *\n * Slots allow you to insert custom content into predefined areas of the web component.\n * Use the `slot` attribute on child elements to target specific slots.\n *\n * - **(default)**: Wrapped component slot.\n *\n * @example\n * ```html\n * <ui5-ai-versioning>\n * <div slot=\"header\">Custom header content</div>\n * <p>Default slot content</p>\n * </ui5-ai-versioning>\n * ```\n *\n * @readonly\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots | MDN Web Components Slots}\n */\n readonly slots = [\n {\n \"name\": \"default\",\n \"description\": \"Wrapped component slot.\",\n \"since\": \"2.20.0\"\n }\n ];\n\n\n public elementRef: ElementRef<_Versioning> = inject(ElementRef);\n public injector = inject(Injector);\n\n /**\n * Content density observer is injected to activate automatic CSS class and\n * UI5 attribute application. The observer self-initializes, no explicit subscribe() needed.\n * @private\n */\n private readonly _contentDensityObserver = inject(ContentDensityObserver);\n\n get element(): _Versioning {\n return this.elementRef.nativeElement;\n }\n\n ngAfterViewInit(): void {\n const wcElement = this.element;\n \n const inputsToSync = [\n 'currentStep',\n 'totalSteps',\n 'overflowPriority',\n 'preventOverflowClosing',\n ];\n \n // Synchronize inputs (properties)\n for (const inputName of inputsToSync) {\n // Find the corresponding camelCase signal property on the Angular component\n const signalName = inputName.replace(/-./g, (x: string) => x[1].toUpperCase());\n\n // Use the Injector to run the effect in the correct context\n if (this[signalName] && typeof this[signalName] === 'function') {\n runInInjectionContext(this.injector, () => {\n effect(() => {\n // Read the signal value\n const value = this[signalName]();\n if (wcElement) {\n // Skip writes when the signal is undefined and the property is already truthy\n // This prevents clobbering imperatively-set values (e.g., from RouterLink)\n if (value === undefined && wcElement[inputName]) {\n return;\n }\n // Write the value to the Web Component's property\n wcElement[inputName] = value;\n }\n });\n });\n }\n }\n \n \n const outputsToSync = [\n 'ui5VersionChange',\n ];\n \n // Synchronize outputs (events)\n for (const outputName of outputsToSync) {\n // Map Angular output name to UI5 web component event name\n const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);\n // Ensure the output property exists and has an emit function before adding listener\n if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {\n // Cast the listener to the correct type to satisfy TypeScript\n wcElement.addEventListener(eventName, (e) => {\n\n this[outputName].emit(e as CustomEvent<any>);\n });\n }\n }\n \n\n }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAuCa,UAAU,CAAA;AAZvB,IAAA,WAAA,GAAA;AAcE;;;;AAIG;QACH,IAAA,CAAA,WAAW,GAAG,KAAK,CAAuD,CAAC;wFAAC;AAE5E;;;;AAIG;QACH,IAAA,CAAA,UAAU,GAAG,KAAK,CAAsD,CAAC;uFAAC;AAE1E;;;AAGG;QACH,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAA4D,SAAS;6FAAC;AAE9F;;;AAGG;QACH,IAAA,CAAA,sBAAsB,GAAG,KAAK,CAAC,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,wBAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG,CAAC;AAIvE;;AAEG;QACH,IAAA,CAAA,gBAAgB,GAAG,MAAM,EAAiD;AAE1E;;;;;;;;;;;;;;;;;;AAkBG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG;AACb,YAAA;AACI,gBAAA,MAAM,EAAE,SAAS;AACjB,gBAAA,aAAa,EAAE,yBAAyB;AACxC,gBAAA,OAAO,EAAE;AACZ;SACJ;AAGM,QAAA,IAAA,CAAA,UAAU,GAA4B,MAAM,CAAC,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,QAAQ,G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AAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,SAAA,EAPV;AACT,YAAA,+BAA+B,CAAC;gBAC9B,uBAAuB,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI;aAC9E;AACF,SAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EANS,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAS1B,UAAU,EAAA,UAAA,EAAA,CAAA;kBAZtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,wCAAwC;AAClD,oBAAA,QAAQ,EAAE,2BAA2B;AACrC,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE;AACT,wBAAA,+BAA+B,CAAC;4BAC9B,uBAAuB,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI;yBAC9E;AACF,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;;ACtCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"fundamental-ngx-ui5-webcomponents-ai-versioning.mjs","sources":["../../../../libs/ui5-webcomponents-ai/versioning/index.ts","../../../../libs/ui5-webcomponents-ai/versioning/fundamental-ngx-ui5-webcomponents-ai-versioning.ts"],"sourcesContent":["\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n output,\n AfterViewInit,\n effect,\n runInInjectionContext,\n inject,\n Injector,\n booleanAttribute,\n computed,\n signal,\n DestroyRef\n} from '@angular/core';\nimport '@ui5/webcomponents-ai/dist/Versioning.js';\nimport { default as _Versioning } from '@ui5/webcomponents-ai/dist/Versioning.js';\nimport { UI5CustomEvent } from '@ui5/webcomponents-base';\nimport {\n ContentDensityObserver,\n contentDensityObserverProviders,\n ContentDensityMode\n} from '@fundamental-ngx/core/content-density';\n\n\nimport { default as ToolbarItemOverflowBehavior } from '@ui5/webcomponents/dist/types/ToolbarItemOverflowBehavior.js';\n\n@Component({\n standalone: true,\n selector: 'ui5-ai-versioning, [ui5-ai-versioning]',\n template: '<ng-content></ng-content>',\n exportAs: 'ui5Versioning',\n providers: [\n contentDensityObserverProviders({\n supportedContentDensity: [ContentDensityMode.COMPACT, ContentDensityMode.COZY]\n })\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Versioning implements AfterViewInit {\n\n /**\n * Indicates the index of the currently displayed result version.\n\nThis property represents the current position in the version history.\n */\n currentStep = input<typeof _Versioning.prototype.currentStep | undefined>(0);\n\n /**\n * The total number of available result versions.\n\nNote: Versioning is hidden if the value is `0`.\n */\n totalSteps = input<typeof _Versioning.prototype.totalSteps | undefined>(0);\n\n /**\n * Property used to define the access of the item to the overflow Popover. If \"NeverOverflow\" option is set,\nthe item never goes in the Popover, if \"AlwaysOverflow\" - it never comes out of it.\n */\n overflowPriority = input<typeof _Versioning.prototype.overflowPriority | undefined>(\"Default\");\n\n /**\n * Defines if the toolbar overflow popup should close upon interaction with the item.\nIt will close by default.\n */\n preventOverflowClosing = input(false, { transform: booleanAttribute }); // className is now passed\n\n\n\n /**\n * Fired when the user clicks on version navigation buttons.\n */\n ui5VersionChange = output<UI5CustomEvent<_Versioning, 'version-change'>>();\n\n /**\n * Available slots for content projection in this component.\n *\n * Slots allow you to insert custom content into predefined areas of the web component.\n * Use the `slot` attribute on child elements to target specific slots.\n *\n * - **(default)**: Wrapped component slot.\n *\n * @example\n * ```html\n * <ui5-ai-versioning>\n * <div slot=\"header\">Custom header content</div>\n * <p>Default slot content</p>\n * </ui5-ai-versioning>\n * ```\n *\n * @readonly\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots | MDN Web Components Slots}\n */\n readonly slots = [\n {\n \"name\": \"default\",\n \"description\": \"Wrapped component slot.\",\n \"since\": \"2.20.0\"\n }\n ];\n\n\n public elementRef: ElementRef<_Versioning> = inject(ElementRef);\n public injector = inject(Injector);\n\n /**\n * Content density observer is injected to activate automatic CSS class and\n * UI5 attribute application. The observer self-initializes, no explicit subscribe() needed.\n * @private\n */\n private readonly _contentDensityObserver = inject(ContentDensityObserver);\n private readonly _destroyRef = inject(DestroyRef);\n\n get element(): _Versioning {\n return this.elementRef.nativeElement;\n }\n\n ngAfterViewInit(): void {\n const wcElement = this.element;\n \n const inputsToSync = [\n 'currentStep',\n 'totalSteps',\n 'overflowPriority',\n 'preventOverflowClosing',\n ];\n \n // Synchronize inputs (properties)\n for (const inputName of inputsToSync) {\n // Find the corresponding camelCase signal property on the Angular component\n const signalName = inputName.replace(/-./g, (x: string) => x[1].toUpperCase());\n\n // Use the Injector to run the effect in the correct context\n if (this[signalName] && typeof this[signalName] === 'function') {\n runInInjectionContext(this.injector, (): void => {\n effect((): void => {\n // Read the signal value\n const value = this[signalName]();\n if (wcElement) {\n // Skip writes when the signal is undefined and the property is already truthy\n // This prevents clobbering imperatively-set values (e.g., from RouterLink)\n if (value === undefined && wcElement[inputName]) {\n return;\n }\n // Write the value to the Web Component's property\n wcElement[inputName] = value;\n }\n });\n });\n }\n }\n \n \n const outputsToSync = [\n 'ui5VersionChange',\n ];\n \n // Synchronize outputs (events)\n const _listeners: Array<() => void> = [];\n for (const outputName of outputsToSync) {\n // Map Angular output name to UI5 web component event name\n const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);\n // Ensure the output property exists and has an emit function before adding listener\n if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {\n // Cast the listener to the correct type to satisfy TypeScript\n const listener = (e: Event): void => {\n\n this[outputName].emit(e as CustomEvent<any>);\n };\n wcElement.addEventListener(eventName, listener);\n _listeners.push(() => wcElement.removeEventListener(eventName, listener));\n }\n }\n this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));\n \n\n }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAyCa,UAAU,CAAA;AAZvB,IAAA,WAAA,GAAA;AAcE;;;;AAIG;QACH,IAAA,CAAA,WAAW,GAAG,KAAK,CAAuD,CAAC;wFAAC;AAE5E;;;;AAIG;QACH,IAAA,CAAA,UAAU,GAAG,KAAK,CAAsD,CAAC;uFAAC;AAE1E;;;AAGG;QACH,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAA4D,SAAS;6FAAC;AAE9F;;;AAGG;QACH,IAAA,CAAA,sBAAsB,GAAG,KAAK,CAAC,KAAK,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,wBAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG,CAAC;AAIvE;;AAEG;QACH,IAAA,CAAA,gBAAgB,GAAG,MAAM,EAAiD;AAE1E;;;;;;;;;;;;;;;;;;AAkBG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG;AACb,YAAA;AACI,gBAAA,MAAM,EAAE,SAAS;AACjB,gBAAA,aAAa,EAAE,yBAAyB;AACxC,gBAAA,OAAO,EAAE;AACZ;SACJ;AAGM,QAAA,IAAA,CAAA,UAAU,GAA4B,MAAM,CAAC,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAElC;;;;AAIG;AACc,QAAA,IAAA,CAAA,uBAAuB,GAAG,MAAM,CAAC,sBAAsB,CAAC;AACxD,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAkElD,IAAA;AAhEC,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa;IACtC;IAEA,eAAe,GAAA;AACb,QAAA,M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A,wBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,SAAA,EAPV;AACT,YAAA,+BAA+B,CAAC;gBAC9B,uBAAuB,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI;aAC9E;AACF,SAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EANS,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAS1B,UAAU,EAAA,UAAA,EAAA,CAAA;kBAZtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,wCAAwC;AAClD,oBAAA,QAAQ,EAAE,2BAA2B;AACrC,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE;AACT,wBAAA,+BAA+B,CAAC;4BAC9B,uBAAuB,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,IAAI;yBAC9E;AACF,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;;ACxCD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, inject, ElementRef, Injector, runInInjectionContext, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, output, inject, ElementRef, Injector, DestroyRef, runInInjectionContext, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import '@ui5/webcomponents-ai/dist/WritingAssistant.js';
|
|
4
4
|
import { ContentDensityObserver, contentDensityObserverProviders, ContentDensityMode } from '@fundamental-ngx/core/content-density';
|
|
5
5
|
|
|
@@ -49,6 +49,7 @@ class WritingAssistant {
|
|
|
49
49
|
* @private
|
|
50
50
|
*/
|
|
51
51
|
this._contentDensityObserver = inject(ContentDensityObserver);
|
|
52
|
+
this._destroyRef = inject(DestroyRef);
|
|
52
53
|
}
|
|
53
54
|
get element() {
|
|
54
55
|
return this.elementRef.nativeElement;
|
|
@@ -89,17 +90,21 @@ class WritingAssistant {
|
|
|
89
90
|
'ui5VersionChange',
|
|
90
91
|
];
|
|
91
92
|
// Synchronize outputs (events)
|
|
93
|
+
const _listeners = [];
|
|
92
94
|
for (const outputName of outputsToSync) {
|
|
93
95
|
// Map Angular output name to UI5 web component event name
|
|
94
96
|
const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
|
|
95
97
|
// Ensure the output property exists and has an emit function before adding listener
|
|
96
98
|
if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
|
|
97
99
|
// Cast the listener to the correct type to satisfy TypeScript
|
|
98
|
-
|
|
100
|
+
const listener = (e) => {
|
|
99
101
|
this[outputName].emit(e);
|
|
100
|
-
}
|
|
102
|
+
};
|
|
103
|
+
wcElement.addEventListener(eventName, listener);
|
|
104
|
+
_listeners.push(() => wcElement.removeEventListener(eventName, listener));
|
|
101
105
|
}
|
|
102
106
|
}
|
|
107
|
+
this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));
|
|
103
108
|
}
|
|
104
109
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WritingAssistant, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
105
110
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: WritingAssistant, isStandalone: true, selector: "ui5-ai-writing-assistant, [ui5-ai-writing-assistant]", inputs: { currentVersion: { classPropertyName: "currentVersion", publicName: "currentVersion", isSignal: true, isRequired: false, transformFunction: null }, promptDescription: { classPropertyName: "promptDescription", publicName: "promptDescription", isSignal: true, isRequired: false, transformFunction: null }, totalVersions: { classPropertyName: "totalVersions", publicName: "totalVersions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5ButtonClick: "ui5ButtonClick", ui5StopGeneration: "ui5StopGeneration", ui5VersionChange: "ui5VersionChange" }, providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fundamental-ngx-ui5-webcomponents-ai-writing-assistant.mjs","sources":["../../../../libs/ui5-webcomponents-ai/writing-assistant/index.ts","../../../../libs/ui5-webcomponents-ai/writing-assistant/fundamental-ngx-ui5-webcomponents-ai-writing-assistant.ts"],"sourcesContent":["\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n output,\n AfterViewInit,\n effect,\n runInInjectionContext,\n inject,\n Injector,\n booleanAttribute,\n computed,\n signal\n} from '@angular/core';\nimport '@ui5/webcomponents-ai/dist/WritingAssistant.js';\nimport { default as _WritingAssistant } from '@ui5/webcomponents-ai/dist/WritingAssistant.js';\nimport { UI5CustomEvent } from '@ui5/webcomponents-base';\nimport {\n ContentDensityObserver,\n contentDensityObserverProviders,\n ContentDensityMode\n} from '@fundamental-ngx/core/content-density';\n\n\n\n@Component({\n standalone: true,\n selector: 'ui5-ai-writing-assistant, [ui5-ai-writing-assistant]',\n template: '<ng-content></ng-content>',\n exportAs: 'ui5WritingAssistant',\n providers: [\n contentDensityObserverProviders({\n supportedContentDensity: [ContentDensityMode.COMPACT, ContentDensityMode.COZY]\n })\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WritingAssistant implements AfterViewInit {\n\n /**\n * Indicates the index of the currently displayed result version.\n\nThe index is **0-based** (i.e. `0` represents the first result).\nThis property is synchronized with the parent AI TextArea component.\n */\n currentVersion = input<typeof _WritingAssistant.prototype.currentVersion | undefined>(0);\n\n /**\n * Defines the prompt description of the Writing Assistant.\n\nThis text is displayed in the toolbar to indicate the current or last\nperformed AI action (e.g., \"Generated text\", \"Simplified text\").\n */\n promptDescription = input<typeof _WritingAssistant.prototype.promptDescription | undefined>(\"\");\n\n /**\n * Indicates the total number of result versions available.\n\nThis property determines whether version navigation controls are displayed.\nWhen totalVersions > 0, previous/next buttons become available.\n */\n totalVersions = input<typeof _WritingAssistant.prototype.totalVersions | undefined>(0); // className is now passed\n\n\n\n /**\n * Fired when the user clicks on the AI button.\n */\n ui5ButtonClick = output<UI5CustomEvent<_WritingAssistant, 'button-click'>>();\n\n /**\n * Fired when the user clicks on the \"Stop\" button to stop ongoing AI text generation.\n */\n ui5StopGeneration = output<UI5CustomEvent<_WritingAssistant, 'stop-generation'>>();\n\n /**\n * Fired when the user clicks on version navigation buttons.\n */\n ui5VersionChange = output<UI5CustomEvent<_WritingAssistant, 'version-change'>>();\n\n\n public elementRef: ElementRef<_WritingAssistant> = inject(ElementRef);\n public injector = inject(Injector);\n\n /**\n * Content density observer is injected to activate automatic CSS class and\n * UI5 attribute application. The observer self-initializes, no explicit subscribe() needed.\n * @private\n */\n private readonly _contentDensityObserver = inject(ContentDensityObserver);\n\n get element(): _WritingAssistant {\n return this.elementRef.nativeElement;\n }\n\n ngAfterViewInit(): void {\n const wcElement = this.element;\n \n const inputsToSync = [\n 'currentVersion',\n 'promptDescription',\n 'totalVersions',\n ];\n \n // Synchronize inputs (properties)\n for (const inputName of inputsToSync) {\n // Find the corresponding camelCase signal property on the Angular component\n const signalName = inputName.replace(/-./g, (x: string) => x[1].toUpperCase());\n\n // Use the Injector to run the effect in the correct context\n if (this[signalName] && typeof this[signalName] === 'function') {\n runInInjectionContext(this.injector, () => {\n effect(() => {\n // Read the signal value\n const value = this[signalName]();\n if (wcElement) {\n // Skip writes when the signal is undefined and the property is already truthy\n // This prevents clobbering imperatively-set values (e.g., from RouterLink)\n if (value === undefined && wcElement[inputName]) {\n return;\n }\n // Write the value to the Web Component's property\n wcElement[inputName] = value;\n }\n });\n });\n }\n }\n \n \n const outputsToSync = [\n 'ui5ButtonClick',\n 'ui5StopGeneration',\n 'ui5VersionChange',\n ];\n \n // Synchronize outputs (events)\n for (const outputName of outputsToSync) {\n // Map Angular output name to UI5 web component event name\n const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);\n // Ensure the output property exists and has an emit function before adding listener\n if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {\n // Cast the listener to the correct type to satisfy TypeScript\n
|
|
1
|
+
{"version":3,"file":"fundamental-ngx-ui5-webcomponents-ai-writing-assistant.mjs","sources":["../../../../libs/ui5-webcomponents-ai/writing-assistant/index.ts","../../../../libs/ui5-webcomponents-ai/writing-assistant/fundamental-ngx-ui5-webcomponents-ai-writing-assistant.ts"],"sourcesContent":["\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n output,\n AfterViewInit,\n effect,\n runInInjectionContext,\n inject,\n Injector,\n booleanAttribute,\n computed,\n signal,\n DestroyRef\n} from '@angular/core';\nimport '@ui5/webcomponents-ai/dist/WritingAssistant.js';\nimport { default as _WritingAssistant } from '@ui5/webcomponents-ai/dist/WritingAssistant.js';\nimport { UI5CustomEvent } from '@ui5/webcomponents-base';\nimport {\n ContentDensityObserver,\n contentDensityObserverProviders,\n ContentDensityMode\n} from '@fundamental-ngx/core/content-density';\n\n\n\n\n@Component({\n standalone: true,\n selector: 'ui5-ai-writing-assistant, [ui5-ai-writing-assistant]',\n template: '<ng-content></ng-content>',\n exportAs: 'ui5WritingAssistant',\n providers: [\n contentDensityObserverProviders({\n supportedContentDensity: [ContentDensityMode.COMPACT, ContentDensityMode.COZY]\n })\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WritingAssistant implements AfterViewInit {\n\n /**\n * Indicates the index of the currently displayed result version.\n\nThe index is **0-based** (i.e. `0` represents the first result).\nThis property is synchronized with the parent AI TextArea component.\n */\n currentVersion = input<typeof _WritingAssistant.prototype.currentVersion | undefined>(0);\n\n /**\n * Defines the prompt description of the Writing Assistant.\n\nThis text is displayed in the toolbar to indicate the current or last\nperformed AI action (e.g., \"Generated text\", \"Simplified text\").\n */\n promptDescription = input<typeof _WritingAssistant.prototype.promptDescription | undefined>(\"\");\n\n /**\n * Indicates the total number of result versions available.\n\nThis property determines whether version navigation controls are displayed.\nWhen totalVersions > 0, previous/next buttons become available.\n */\n totalVersions = input<typeof _WritingAssistant.prototype.totalVersions | undefined>(0); // className is now passed\n\n\n\n /**\n * Fired when the user clicks on the AI button.\n */\n ui5ButtonClick = output<UI5CustomEvent<_WritingAssistant, 'button-click'>>();\n\n /**\n * Fired when the user clicks on the \"Stop\" button to stop ongoing AI text generation.\n */\n ui5StopGeneration = output<UI5CustomEvent<_WritingAssistant, 'stop-generation'>>();\n\n /**\n * Fired when the user clicks on version navigation buttons.\n */\n ui5VersionChange = output<UI5CustomEvent<_WritingAssistant, 'version-change'>>();\n\n\n public elementRef: ElementRef<_WritingAssistant> = inject(ElementRef);\n public injector = inject(Injector);\n\n /**\n * Content density observer is injected to activate automatic CSS class and\n * UI5 attribute application. The observer self-initializes, no explicit subscribe() needed.\n * @private\n */\n private readonly _contentDensityObserver = inject(ContentDensityObserver);\n private readonly _destroyRef = inject(DestroyRef);\n\n get element(): _WritingAssistant {\n return this.elementRef.nativeElement;\n }\n\n ngAfterViewInit(): void {\n const wcElement = this.element;\n \n const inputsToSync = [\n 'currentVersion',\n 'promptDescription',\n 'totalVersions',\n ];\n \n // Synchronize inputs (properties)\n for (const inputName of inputsToSync) {\n // Find the corresponding camelCase signal property on the Angular component\n const signalName = inputName.replace(/-./g, (x: string) => x[1].toUpperCase());\n\n // Use the Injector to run the effect in the correct context\n if (this[signalName] && typeof this[signalName] === 'function') {\n runInInjectionContext(this.injector, (): void => {\n effect((): void => {\n // Read the signal value\n const value = this[signalName]();\n if (wcElement) {\n // Skip writes when the signal is undefined and the property is already truthy\n // This prevents clobbering imperatively-set values (e.g., from RouterLink)\n if (value === undefined && wcElement[inputName]) {\n return;\n }\n // Write the value to the Web Component's property\n wcElement[inputName] = value;\n }\n });\n });\n }\n }\n \n \n const outputsToSync = [\n 'ui5ButtonClick',\n 'ui5StopGeneration',\n 'ui5VersionChange',\n ];\n \n // Synchronize outputs (events)\n const _listeners: Array<() => void> = [];\n for (const outputName of outputsToSync) {\n // Map Angular output name to UI5 web component event name\n const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);\n // Ensure the output property exists and has an emit function before adding listener\n if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {\n // Cast the listener to the correct type to satisfy TypeScript\n const listener = (e: Event): void => {\n\n this[outputName].emit(e as CustomEvent<any>);\n };\n wcElement.addEventListener(eventName, listener);\n _listeners.push(() => wcElement.removeEventListener(eventName, listener));\n }\n }\n this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));\n \n\n }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAyCa,gBAAgB,CAAA;AAZ7B,IAAA,WAAA,GAAA;AAcE;;;;;AAKG;QACH,IAAA,CAAA,cAAc,GAAG,KAAK,CAAgE,CAAC;2FAAC;AAExF;;;;;AAKG;QACH,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAmE,EAAE;8FAAC;AAE/F;;;;;AAKG;QACH,IAAA,CAAA,aAAa,GAAG,KAAK,CAA+D,CAAC;AAAC,QAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,eAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAA,CAAC;AAIvF;;AAEG;QACH,IAAA,CAAA,cAAc,GAAG,MAAM,EAAqD;AAE5E;;AAEG;QACH,IAAA,CAAA,iBAAiB,GAAG,MAAM,EAAwD;AAElF;;AAEG;QACH,IAAA,CAAA,gBAAgB,GAAG,MAAM,EAAuD;AAGzE,QAAA,IAAA,CAAA,UAAU,GAAkC,MAAM,CAAC,UAAU,CAAC;AAC9D,QAAA,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ken, inject, ElementRef, ChangeDetectorRef, forwardRef, Directive, input, booleanAttribute, output, Injector, runInInjectionContext, effect, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, ElementRef, ChangeDetectorRef, forwardRef, Directive, input, booleanAttribute, output, Injector, DestroyRef, runInInjectionContext, effect, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import '@ui5/webcomponents-ai/dist/Button.js';
|
|
5
5
|
import { ContentDensityObserver, contentDensityObserverProviders, ContentDensityMode } from '@fundamental-ngx/core/content-density';
|
|
@@ -257,6 +257,7 @@ class Button {
|
|
|
257
257
|
* @private
|
|
258
258
|
*/
|
|
259
259
|
this._contentDensityObserver = inject(ContentDensityObserver);
|
|
260
|
+
this._destroyRef = inject(DestroyRef);
|
|
260
261
|
}
|
|
261
262
|
get element() {
|
|
262
263
|
return this.elementRef.nativeElement;
|
|
@@ -298,17 +299,21 @@ class Button {
|
|
|
298
299
|
'ui5Click',
|
|
299
300
|
];
|
|
300
301
|
// Synchronize outputs (events)
|
|
302
|
+
const _listeners = [];
|
|
301
303
|
for (const outputName of outputsToSync) {
|
|
302
304
|
// Map Angular output name to UI5 web component event name
|
|
303
305
|
const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
|
|
304
306
|
// Ensure the output property exists and has an emit function before adding listener
|
|
305
307
|
if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
|
|
306
308
|
// Cast the listener to the correct type to satisfy TypeScript
|
|
307
|
-
|
|
309
|
+
const listener = (e) => {
|
|
308
310
|
this[outputName].emit(e);
|
|
309
|
-
}
|
|
311
|
+
};
|
|
312
|
+
wcElement.addEventListener(eventName, listener);
|
|
313
|
+
_listeners.push(() => wcElement.removeEventListener(eventName, listener));
|
|
310
314
|
}
|
|
311
315
|
}
|
|
316
|
+
this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));
|
|
312
317
|
}
|
|
313
318
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
314
319
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Button, isStandalone: true, selector: "ui5-ai-button, [ui5-ai-button]", inputs: { accessibilityAttributes: { classPropertyName: "accessibilityAttributes", publicName: "accessibilityAttributes", isSignal: true, isRequired: false, transformFunction: null }, arrowButtonPressed: { classPropertyName: "arrowButtonPressed", publicName: "arrowButtonPressed", isSignal: true, isRequired: false, transformFunction: null }, design: { classPropertyName: "design", publicName: "design", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5ArrowButtonClick: "ui5ArrowButtonClick", ui5Click: "ui5Click" }, providers: [
|
|
@@ -669,6 +674,7 @@ class Input {
|
|
|
669
674
|
* @private
|
|
670
675
|
*/
|
|
671
676
|
this._contentDensityObserver = inject(ContentDensityObserver);
|
|
677
|
+
this._destroyRef = inject(DestroyRef);
|
|
672
678
|
}
|
|
673
679
|
get element() {
|
|
674
680
|
return this.elementRef.nativeElement;
|
|
@@ -734,17 +740,21 @@ class Input {
|
|
|
734
740
|
'ui5SelectionChange',
|
|
735
741
|
];
|
|
736
742
|
// Synchronize outputs (events)
|
|
743
|
+
const _listeners = [];
|
|
737
744
|
for (const outputName of outputsToSync) {
|
|
738
745
|
// Map Angular output name to UI5 web component event name
|
|
739
746
|
const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
|
|
740
747
|
// Ensure the output property exists and has an emit function before adding listener
|
|
741
748
|
if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
|
|
742
749
|
// Cast the listener to the correct type to satisfy TypeScript
|
|
743
|
-
|
|
750
|
+
const listener = (e) => {
|
|
744
751
|
this[outputName].emit(e);
|
|
745
|
-
}
|
|
752
|
+
};
|
|
753
|
+
wcElement.addEventListener(eventName, listener);
|
|
754
|
+
_listeners.push(() => wcElement.removeEventListener(eventName, listener));
|
|
746
755
|
}
|
|
747
756
|
}
|
|
757
|
+
this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));
|
|
748
758
|
}
|
|
749
759
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Input, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
750
760
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Input, isStandalone: true, selector: "ui5-ai-input, [ui5-ai-input]", inputs: { currentVersion: { classPropertyName: "currentVersion", publicName: "currentVersion", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, totalVersions: { classPropertyName: "totalVersions", publicName: "totalVersions", isSignal: true, isRequired: false, transformFunction: null }, accessibleDescription: { classPropertyName: "accessibleDescription", publicName: "accessibleDescription", isSignal: true, isRequired: false, transformFunction: null }, accessibleDescriptionRef: { classPropertyName: "accessibleDescriptionRef", publicName: "accessibleDescriptionRef", isSignal: true, isRequired: false, transformFunction: null }, accessibleName: { classPropertyName: "accessibleName", publicName: "accessibleName", isSignal: true, isRequired: false, transformFunction: null }, accessibleNameRef: { classPropertyName: "accessibleNameRef", publicName: "accessibleNameRef", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, noTypeahead: { classPropertyName: "noTypeahead", publicName: "noTypeahead", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, showClearIcon: { classPropertyName: "showClearIcon", publicName: "showClearIcon", isSignal: true, isRequired: false, transformFunction: null }, showSuggestions: { classPropertyName: "showSuggestions", publicName: "showSuggestions", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueState: { classPropertyName: "valueState", publicName: "valueState", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5ButtonClick: "ui5ButtonClick", ui5ItemClick: "ui5ItemClick", ui5StopGeneration: "ui5StopGeneration", ui5VersionChange: "ui5VersionChange", ui5Change: "ui5Change", ui5Close: "ui5Close", ui5Input: "ui5Input", ui5Open: "ui5Open", ui5Select: "ui5Select", ui5SelectionChange: "ui5SelectionChange" }, providers: [
|
|
@@ -910,6 +920,7 @@ class PromptInput {
|
|
|
910
920
|
* @private
|
|
911
921
|
*/
|
|
912
922
|
this._contentDensityObserver = inject(ContentDensityObserver);
|
|
923
|
+
this._destroyRef = inject(DestroyRef);
|
|
913
924
|
}
|
|
914
925
|
get element() {
|
|
915
926
|
return this.elementRef.nativeElement;
|
|
@@ -957,17 +968,21 @@ class PromptInput {
|
|
|
957
968
|
'ui5Submit',
|
|
958
969
|
];
|
|
959
970
|
// Synchronize outputs (events)
|
|
971
|
+
const _listeners = [];
|
|
960
972
|
for (const outputName of outputsToSync) {
|
|
961
973
|
// Map Angular output name to UI5 web component event name
|
|
962
974
|
const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
|
|
963
975
|
// Ensure the output property exists and has an emit function before adding listener
|
|
964
976
|
if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
|
|
965
977
|
// Cast the listener to the correct type to satisfy TypeScript
|
|
966
|
-
|
|
978
|
+
const listener = (e) => {
|
|
967
979
|
this[outputName].emit(e);
|
|
968
|
-
}
|
|
980
|
+
};
|
|
981
|
+
wcElement.addEventListener(eventName, listener);
|
|
982
|
+
_listeners.push(() => wcElement.removeEventListener(eventName, listener));
|
|
969
983
|
}
|
|
970
984
|
}
|
|
985
|
+
this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));
|
|
971
986
|
}
|
|
972
987
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PromptInput, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
973
988
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: PromptInput, isStandalone: true, selector: "ui5-ai-prompt-input, [ui5-ai-prompt-input]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showClearIcon: { classPropertyName: "showClearIcon", publicName: "showClearIcon", isSignal: true, isRequired: false, transformFunction: null }, showExceededText: { classPropertyName: "showExceededText", publicName: "showExceededText", isSignal: true, isRequired: false, transformFunction: null }, showSuggestions: { classPropertyName: "showSuggestions", publicName: "showSuggestions", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueState: { classPropertyName: "valueState", publicName: "valueState", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5Change: "ui5Change", ui5Input: "ui5Input", ui5Submit: "ui5Submit" }, providers: [
|
|
@@ -1184,6 +1199,7 @@ class TextArea {
|
|
|
1184
1199
|
* @private
|
|
1185
1200
|
*/
|
|
1186
1201
|
this._contentDensityObserver = inject(ContentDensityObserver);
|
|
1202
|
+
this._destroyRef = inject(DestroyRef);
|
|
1187
1203
|
}
|
|
1188
1204
|
get element() {
|
|
1189
1205
|
return this.elementRef.nativeElement;
|
|
@@ -1244,17 +1260,21 @@ class TextArea {
|
|
|
1244
1260
|
'ui5Select',
|
|
1245
1261
|
];
|
|
1246
1262
|
// Synchronize outputs (events)
|
|
1263
|
+
const _listeners = [];
|
|
1247
1264
|
for (const outputName of outputsToSync) {
|
|
1248
1265
|
// Map Angular output name to UI5 web component event name
|
|
1249
1266
|
const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
|
|
1250
1267
|
// Ensure the output property exists and has an emit function before adding listener
|
|
1251
1268
|
if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
|
|
1252
1269
|
// Cast the listener to the correct type to satisfy TypeScript
|
|
1253
|
-
|
|
1270
|
+
const listener = (e) => {
|
|
1254
1271
|
this[outputName].emit(e);
|
|
1255
|
-
}
|
|
1272
|
+
};
|
|
1273
|
+
wcElement.addEventListener(eventName, listener);
|
|
1274
|
+
_listeners.push(() => wcElement.removeEventListener(eventName, listener));
|
|
1256
1275
|
}
|
|
1257
1276
|
}
|
|
1277
|
+
this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));
|
|
1258
1278
|
}
|
|
1259
1279
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TextArea, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1260
1280
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: TextArea, isStandalone: true, selector: "ui5-ai-textarea, [ui5-ai-textarea]", inputs: { currentVersion: { classPropertyName: "currentVersion", publicName: "currentVersion", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, promptDescription: { classPropertyName: "promptDescription", publicName: "promptDescription", isSignal: true, isRequired: false, transformFunction: null }, totalVersions: { classPropertyName: "totalVersions", publicName: "totalVersions", isSignal: true, isRequired: false, transformFunction: null }, accessibleDescription: { classPropertyName: "accessibleDescription", publicName: "accessibleDescription", isSignal: true, isRequired: false, transformFunction: null }, accessibleDescriptionRef: { classPropertyName: "accessibleDescriptionRef", publicName: "accessibleDescriptionRef", isSignal: true, isRequired: false, transformFunction: null }, accessibleName: { classPropertyName: "accessibleName", publicName: "accessibleName", isSignal: true, isRequired: false, transformFunction: null }, accessibleNameRef: { classPropertyName: "accessibleNameRef", publicName: "accessibleNameRef", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, growing: { classPropertyName: "growing", publicName: "growing", isSignal: true, isRequired: false, transformFunction: null }, growingMaxRows: { classPropertyName: "growingMaxRows", publicName: "growingMaxRows", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, showExceededText: { classPropertyName: "showExceededText", publicName: "showExceededText", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueState: { classPropertyName: "valueState", publicName: "valueState", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5StopGeneration: "ui5StopGeneration", ui5VersionChange: "ui5VersionChange", ui5Change: "ui5Change", ui5Input: "ui5Input", ui5Scroll: "ui5Scroll", ui5Select: "ui5Select" }, providers: [
|
|
@@ -1471,6 +1491,7 @@ class Versioning {
|
|
|
1471
1491
|
* @private
|
|
1472
1492
|
*/
|
|
1473
1493
|
this._contentDensityObserver = inject(ContentDensityObserver);
|
|
1494
|
+
this._destroyRef = inject(DestroyRef);
|
|
1474
1495
|
}
|
|
1475
1496
|
get element() {
|
|
1476
1497
|
return this.elementRef.nativeElement;
|
|
@@ -1510,17 +1531,21 @@ class Versioning {
|
|
|
1510
1531
|
'ui5VersionChange',
|
|
1511
1532
|
];
|
|
1512
1533
|
// Synchronize outputs (events)
|
|
1534
|
+
const _listeners = [];
|
|
1513
1535
|
for (const outputName of outputsToSync) {
|
|
1514
1536
|
// Map Angular output name to UI5 web component event name
|
|
1515
1537
|
const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
|
|
1516
1538
|
// Ensure the output property exists and has an emit function before adding listener
|
|
1517
1539
|
if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
|
|
1518
1540
|
// Cast the listener to the correct type to satisfy TypeScript
|
|
1519
|
-
|
|
1541
|
+
const listener = (e) => {
|
|
1520
1542
|
this[outputName].emit(e);
|
|
1521
|
-
}
|
|
1543
|
+
};
|
|
1544
|
+
wcElement.addEventListener(eventName, listener);
|
|
1545
|
+
_listeners.push(() => wcElement.removeEventListener(eventName, listener));
|
|
1522
1546
|
}
|
|
1523
1547
|
}
|
|
1548
|
+
this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));
|
|
1524
1549
|
}
|
|
1525
1550
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Versioning, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1526
1551
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Versioning, isStandalone: true, selector: "ui5-ai-versioning, [ui5-ai-versioning]", inputs: { currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: false, transformFunction: null }, totalSteps: { classPropertyName: "totalSteps", publicName: "totalSteps", isSignal: true, isRequired: false, transformFunction: null }, overflowPriority: { classPropertyName: "overflowPriority", publicName: "overflowPriority", isSignal: true, isRequired: false, transformFunction: null }, preventOverflowClosing: { classPropertyName: "preventOverflowClosing", publicName: "preventOverflowClosing", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5VersionChange: "ui5VersionChange" }, providers: [
|
|
@@ -1591,6 +1616,7 @@ class WritingAssistant {
|
|
|
1591
1616
|
* @private
|
|
1592
1617
|
*/
|
|
1593
1618
|
this._contentDensityObserver = inject(ContentDensityObserver);
|
|
1619
|
+
this._destroyRef = inject(DestroyRef);
|
|
1594
1620
|
}
|
|
1595
1621
|
get element() {
|
|
1596
1622
|
return this.elementRef.nativeElement;
|
|
@@ -1631,17 +1657,21 @@ class WritingAssistant {
|
|
|
1631
1657
|
'ui5VersionChange',
|
|
1632
1658
|
];
|
|
1633
1659
|
// Synchronize outputs (events)
|
|
1660
|
+
const _listeners = [];
|
|
1634
1661
|
for (const outputName of outputsToSync) {
|
|
1635
1662
|
// Map Angular output name to UI5 web component event name
|
|
1636
1663
|
const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
|
|
1637
1664
|
// Ensure the output property exists and has an emit function before adding listener
|
|
1638
1665
|
if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
|
|
1639
1666
|
// Cast the listener to the correct type to satisfy TypeScript
|
|
1640
|
-
|
|
1667
|
+
const listener = (e) => {
|
|
1641
1668
|
this[outputName].emit(e);
|
|
1642
|
-
}
|
|
1669
|
+
};
|
|
1670
|
+
wcElement.addEventListener(eventName, listener);
|
|
1671
|
+
_listeners.push(() => wcElement.removeEventListener(eventName, listener));
|
|
1643
1672
|
}
|
|
1644
1673
|
}
|
|
1674
|
+
this._destroyRef.onDestroy(() => _listeners.forEach((fn) => fn()));
|
|
1645
1675
|
}
|
|
1646
1676
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WritingAssistant, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1647
1677
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: WritingAssistant, isStandalone: true, selector: "ui5-ai-writing-assistant, [ui5-ai-writing-assistant]", inputs: { currentVersion: { classPropertyName: "currentVersion", publicName: "currentVersion", isSignal: true, isRequired: false, transformFunction: null }, promptDescription: { classPropertyName: "promptDescription", publicName: "promptDescription", isSignal: true, isRequired: false, transformFunction: null }, totalVersions: { classPropertyName: "totalVersions", publicName: "totalVersions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5ButtonClick: "ui5ButtonClick", ui5StopGeneration: "ui5StopGeneration", ui5VersionChange: "ui5VersionChange" }, providers: [
|