@ui5/webcomponents-ai 2.0.0-rc.5 → 2.0.0-rc.6
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/CHANGELOG.md +11 -0
- package/dist/PromptInput.d.ts +107 -7
- package/dist/PromptInput.js +121 -9
- package/dist/PromptInput.js.map +1 -1
- package/dist/css/themes/PromptInput.css +1 -0
- package/dist/custom-elements-internal.json +219 -4
- package/dist/custom-elements.json +193 -5
- package/dist/generated/i18n/i18n-defaults.d.ts +4 -1
- package/dist/generated/i18n/i18n-defaults.js +3 -0
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/templates/PromptInputTemplate.lit.d.ts +4 -0
- package/dist/generated/templates/PromptInputTemplate.lit.js +8 -0
- package/dist/generated/templates/PromptInputTemplate.lit.js.map +1 -0
- package/dist/generated/themes/PromptInput.css.d.ts +3 -0
- package/dist/generated/themes/PromptInput.css.js +9 -0
- package/dist/generated/themes/PromptInput.css.js.map +1 -0
- package/dist/vscode.html-custom-data.json +48 -2
- package/dist/web-types.json +123 -6
- package/package.json +7 -7
- package/src/PromptInput.hbs +31 -0
- package/src/i18n/messagebundle.properties +6 -0
- package/src/themes/PromptInput.css +30 -0
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,17 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [2.0.0-rc.6](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0-rc.5...v2.0.0-rc.6) (2024-06-17)
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* **ui5-ai-prompt-input:** initial (experimental) implementation ([#9078](https://github.com/SAP/ui5-webcomponents/issues/9078)) ([9dcdfdb](https://github.com/SAP/ui5-webcomponents/commit/9dcdfdbcf78eda087099e12301ad91e624038a17))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
6
17
|
# [2.0.0-rc.5](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0-rc.4...v2.0.0-rc.5) (2024-06-06)
|
7
18
|
|
8
19
|
**Note:** Version bump only for package @ui5/webcomponents-ai
|
package/dist/PromptInput.d.ts
CHANGED
@@ -1,25 +1,125 @@
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
|
+
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
3
|
+
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
|
4
|
+
import "@ui5/webcomponents-icons/dist/paper-plane.js";
|
5
|
+
import type { InputEventDetail } from "@ui5/webcomponents/dist/Input.js";
|
2
6
|
/**
|
3
7
|
* @class
|
4
|
-
*
|
5
8
|
* ### Overview
|
6
9
|
*
|
7
|
-
* The
|
10
|
+
* The `ui5-ai-prompt-input` component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.
|
11
|
+
*
|
12
|
+
* **Note:** The web component is in an experimental state
|
8
13
|
*
|
9
14
|
* ### ES6 Module Import
|
10
15
|
*
|
11
|
-
* `import "@ui5/webcomponents-ai/dist/PromptInput.js
|
16
|
+
* `import "@ui5/webcomponents-ai/dist/PromptInput.js
|
17
|
+
* @class
|
12
18
|
* @constructor
|
13
|
-
* @extends UI5Element
|
14
|
-
* @since 2.0
|
15
19
|
* @public
|
20
|
+
* @extends UI5Element
|
16
21
|
*/
|
17
22
|
declare class PromptInput extends UI5Element {
|
18
23
|
/**
|
19
|
-
* Defines the value of the
|
20
|
-
*
|
24
|
+
* Defines the value of the component.
|
25
|
+
*
|
21
26
|
* @default ""
|
27
|
+
* @since 2.0.0
|
28
|
+
* @public
|
22
29
|
*/
|
23
30
|
value: string;
|
31
|
+
/**
|
32
|
+
* Defines a short hint intended to aid the user with data entry when the
|
33
|
+
* component has no value.
|
34
|
+
* @default ""
|
35
|
+
* @since 2.0.0
|
36
|
+
* @public
|
37
|
+
*/
|
38
|
+
placeholder: string;
|
39
|
+
/**
|
40
|
+
* Defines the label of the input field.
|
41
|
+
*
|
42
|
+
* @default ""
|
43
|
+
* @since 2.0.0
|
44
|
+
* @public
|
45
|
+
*/
|
46
|
+
label: string;
|
47
|
+
/**
|
48
|
+
* Defines whether the clear icon of the input will be shown.
|
49
|
+
* @default false
|
50
|
+
* @public
|
51
|
+
* @since 2.0.0
|
52
|
+
*/
|
53
|
+
showClearIcon: boolean;
|
54
|
+
/**
|
55
|
+
* Determines whether the characters exceeding the maximum allowed character count are visible
|
56
|
+
* in the component.
|
57
|
+
*
|
58
|
+
* If set to `false`, the user is not allowed to enter more characters than what is set in the
|
59
|
+
* `maxlength` property.
|
60
|
+
* If set to `true` the characters exceeding the `maxlength` value are selected on
|
61
|
+
* paste and the counter below the component displays their number.
|
62
|
+
* @default false
|
63
|
+
* @public
|
64
|
+
* @since 2.0.0
|
65
|
+
*/
|
66
|
+
showExceededText: boolean;
|
67
|
+
/**
|
68
|
+
* Defines whether the component is in disabled state.
|
69
|
+
*
|
70
|
+
* **Note:** A disabled component is completely noninteractive.
|
71
|
+
* @default false
|
72
|
+
* @public
|
73
|
+
* @since 2.0.0
|
74
|
+
*/
|
75
|
+
disabled: boolean;
|
76
|
+
/**
|
77
|
+
* Defines whether the component is read-only.
|
78
|
+
*
|
79
|
+
* **Note:** A read-only component is not editable,
|
80
|
+
* but still provides visual feedback upon user interaction.
|
81
|
+
* @default false
|
82
|
+
* @public
|
83
|
+
* @since 2.0.0
|
84
|
+
*/
|
85
|
+
readonly: boolean;
|
86
|
+
/**
|
87
|
+
* Sets the maximum number of characters available in the input field.
|
88
|
+
*
|
89
|
+
* @default undefined
|
90
|
+
* @since 2.0.0
|
91
|
+
* @public
|
92
|
+
*/
|
93
|
+
maxlength?: number;
|
94
|
+
/**
|
95
|
+
* Defines the value state of the component.
|
96
|
+
* @default "None"
|
97
|
+
* @since 2.0.0
|
98
|
+
* @public
|
99
|
+
*/
|
100
|
+
valueState: `${ValueState}`;
|
101
|
+
/**
|
102
|
+
* Defines the value state message that will be displayed as pop up under the component.
|
103
|
+
* The value state message slot should contain only one root element.
|
104
|
+
*
|
105
|
+
* **Note:** If not specified, a default text (in the respective language) will be displayed.
|
106
|
+
*
|
107
|
+
* **Note:** The `valueStateMessage` would be displayed,
|
108
|
+
* when the component is in `Information`, `Critical` or `Negative` value state.
|
109
|
+
*
|
110
|
+
* @since 2.0.0
|
111
|
+
* @public
|
112
|
+
*/
|
113
|
+
valueStateMessage: Array<HTMLElement>;
|
114
|
+
static i18nBundle: I18nBundle;
|
115
|
+
static onDefine(): Promise<void>;
|
116
|
+
constructor();
|
117
|
+
_onkeydown(e: KeyboardEvent): void;
|
118
|
+
_onInnerInput(e: CustomEvent<InputEventDetail>): void;
|
119
|
+
_onInnerChange(): void;
|
120
|
+
_onButtonClick(): void;
|
121
|
+
get _exceededText(): string | undefined;
|
122
|
+
get _maxLenght(): number | undefined;
|
123
|
+
get _submitButtonDisabled(): boolean;
|
24
124
|
}
|
25
125
|
export default PromptInput;
|
package/dist/PromptInput.js
CHANGED
@@ -4,43 +4,155 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
6
|
};
|
7
|
+
var PromptInput_1;
|
7
8
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
8
9
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
10
|
+
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
11
|
+
import event from "@ui5/webcomponents-base/dist/decorators/event.js";
|
12
|
+
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
9
13
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
10
|
-
import
|
14
|
+
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
15
|
+
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
16
|
+
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
|
17
|
+
import "@ui5/webcomponents-icons/dist/paper-plane.js";
|
11
18
|
import Input from "@ui5/webcomponents/dist/Input.js";
|
19
|
+
import Label from "@ui5/webcomponents/dist/Label.js";
|
12
20
|
import Button from "@ui5/webcomponents/dist/Button.js";
|
13
|
-
import
|
21
|
+
import { isEnter, } from "@ui5/webcomponents-base/dist/Keys.js";
|
22
|
+
import { PROMPT_INPUT_CHARACTERS_LEFT, PROMPT_INPUT_CHARACTERS_EXCEEDED, } from "./generated/i18n/i18n-defaults.js";
|
23
|
+
import PromptInputTemplate from "./generated/templates/PromptInputTemplate.lit.js";
|
24
|
+
// Styles
|
25
|
+
import PromptInputCss from "./generated/themes/PromptInput.css.js";
|
14
26
|
/**
|
15
27
|
* @class
|
16
|
-
*
|
17
28
|
* ### Overview
|
18
29
|
*
|
19
|
-
* The
|
30
|
+
* The `ui5-ai-prompt-input` component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.
|
31
|
+
*
|
32
|
+
* **Note:** The web component is in an experimental state
|
20
33
|
*
|
21
34
|
* ### ES6 Module Import
|
22
35
|
*
|
23
|
-
* `import "@ui5/webcomponents-ai/dist/PromptInput.js
|
36
|
+
* `import "@ui5/webcomponents-ai/dist/PromptInput.js
|
37
|
+
* @class
|
24
38
|
* @constructor
|
25
|
-
* @extends UI5Element
|
26
|
-
* @since 2.0
|
27
39
|
* @public
|
40
|
+
* @extends UI5Element
|
28
41
|
*/
|
29
|
-
let PromptInput = class PromptInput extends UI5Element {
|
42
|
+
let PromptInput = PromptInput_1 = class PromptInput extends UI5Element {
|
43
|
+
static async onDefine() {
|
44
|
+
PromptInput_1.i18nBundle = await getI18nBundle("@ui5/webcomponents-ai");
|
45
|
+
}
|
46
|
+
constructor() {
|
47
|
+
super();
|
48
|
+
}
|
49
|
+
_onkeydown(e) {
|
50
|
+
if (isEnter(e)) {
|
51
|
+
this.fireEvent("submit");
|
52
|
+
}
|
53
|
+
}
|
54
|
+
_onInnerInput(e) {
|
55
|
+
this.value = e.target.value;
|
56
|
+
this.fireEvent("input");
|
57
|
+
}
|
58
|
+
_onInnerChange() {
|
59
|
+
this.fireEvent("change");
|
60
|
+
}
|
61
|
+
_onButtonClick() {
|
62
|
+
this.fireEvent("submit");
|
63
|
+
}
|
64
|
+
get _exceededText() {
|
65
|
+
if (this.showExceededText) {
|
66
|
+
let leftCharactersCount;
|
67
|
+
const maxLength = this.maxlength;
|
68
|
+
if (maxLength !== undefined) {
|
69
|
+
leftCharactersCount = maxLength - this.value.length;
|
70
|
+
if (leftCharactersCount >= 0) {
|
71
|
+
return PromptInput_1.i18nBundle.getText(PROMPT_INPUT_CHARACTERS_LEFT, leftCharactersCount);
|
72
|
+
}
|
73
|
+
return PromptInput_1.i18nBundle.getText(PROMPT_INPUT_CHARACTERS_EXCEEDED, Math.abs(leftCharactersCount));
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
get _maxLenght() {
|
78
|
+
return this.maxlength || undefined;
|
79
|
+
}
|
80
|
+
get _submitButtonDisabled() {
|
81
|
+
return (this.value.length <= 0) || this.disabled || this.readonly;
|
82
|
+
}
|
30
83
|
};
|
31
84
|
__decorate([
|
32
85
|
property()
|
33
86
|
], PromptInput.prototype, "value", void 0);
|
34
|
-
|
87
|
+
__decorate([
|
88
|
+
property()
|
89
|
+
], PromptInput.prototype, "placeholder", void 0);
|
90
|
+
__decorate([
|
91
|
+
property()
|
92
|
+
], PromptInput.prototype, "label", void 0);
|
93
|
+
__decorate([
|
94
|
+
property({ type: Boolean })
|
95
|
+
], PromptInput.prototype, "showClearIcon", void 0);
|
96
|
+
__decorate([
|
97
|
+
property({ type: Boolean })
|
98
|
+
], PromptInput.prototype, "showExceededText", void 0);
|
99
|
+
__decorate([
|
100
|
+
property({ type: Boolean })
|
101
|
+
], PromptInput.prototype, "disabled", void 0);
|
102
|
+
__decorate([
|
103
|
+
property({ type: Boolean })
|
104
|
+
], PromptInput.prototype, "readonly", void 0);
|
105
|
+
__decorate([
|
106
|
+
property({ validator: Integer })
|
107
|
+
], PromptInput.prototype, "maxlength", void 0);
|
108
|
+
__decorate([
|
109
|
+
property({ type: ValueState, defaultValue: ValueState.None })
|
110
|
+
], PromptInput.prototype, "valueState", void 0);
|
111
|
+
__decorate([
|
112
|
+
slot({
|
113
|
+
type: HTMLElement,
|
114
|
+
invalidateOnChildChange: true,
|
115
|
+
})
|
116
|
+
], PromptInput.prototype, "valueStateMessage", void 0);
|
117
|
+
PromptInput = PromptInput_1 = __decorate([
|
35
118
|
customElement({
|
36
119
|
tag: "ui5-ai-prompt-input",
|
37
120
|
renderer: litRender,
|
121
|
+
styles: PromptInputCss,
|
122
|
+
template: PromptInputTemplate,
|
38
123
|
dependencies: [
|
39
124
|
Input,
|
40
125
|
Label,
|
41
126
|
Button,
|
42
127
|
],
|
43
128
|
})
|
129
|
+
/**
|
130
|
+
* Fired when the input operation has finished by pressing Enter
|
131
|
+
* or AI button is clicked.
|
132
|
+
*
|
133
|
+
* @since 2.0.0
|
134
|
+
* @public
|
135
|
+
*/
|
136
|
+
,
|
137
|
+
event("submit")
|
138
|
+
/**
|
139
|
+
* Fired when the value of the component changes at each keystroke,
|
140
|
+
* and when a suggestion item has been selected.
|
141
|
+
*
|
142
|
+
* @since 2.0.0
|
143
|
+
* @public
|
144
|
+
*/
|
145
|
+
,
|
146
|
+
event("input")
|
147
|
+
/**
|
148
|
+
* Fired when the input operation has finished by pressing Enter
|
149
|
+
* or on focusout.
|
150
|
+
*
|
151
|
+
* @since 2.0.0
|
152
|
+
* @public
|
153
|
+
*/
|
154
|
+
,
|
155
|
+
event("change")
|
44
156
|
], PromptInput);
|
45
157
|
PromptInput.define();
|
46
158
|
export default PromptInput;
|
package/dist/PromptInput.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PromptInput.js","sourceRoot":"","sources":["../src/PromptInput.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"PromptInput.js","sourceRoot":"","sources":["../src/PromptInput.ts"],"names":[],"mappings":"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","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport Integer from \"@ui5/webcomponents-base/dist/types/Integer.js\";\nimport ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport \"@ui5/webcomponents-icons/dist/paper-plane.js\";\nimport type { InputEventDetail } from \"@ui5/webcomponents/dist/Input.js\";\nimport Input from \"@ui5/webcomponents/dist/Input.js\";\nimport Label from \"@ui5/webcomponents/dist/Label.js\";\nimport Button from \"@ui5/webcomponents/dist/Button.js\";\nimport {\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tPROMPT_INPUT_CHARACTERS_LEFT,\n\tPROMPT_INPUT_CHARACTERS_EXCEEDED,\n} from \"./generated/i18n/i18n-defaults.js\";\n\nimport PromptInputTemplate from \"./generated/templates/PromptInputTemplate.lit.js\";\n\n// Styles\nimport PromptInputCss from \"./generated/themes/PromptInput.css.js\";\n\n/**\n * @class\n * ### Overview\n *\n * The `ui5-ai-prompt-input` component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.\n *\n * **Note:** The web component is in an experimental state\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents-ai/dist/PromptInput.js\n * @class\n * @constructor\n * @public\n * @extends UI5Element\n */\n@customElement({\n\ttag: \"ui5-ai-prompt-input\",\n\trenderer: litRender,\n\tstyles: PromptInputCss,\n\ttemplate: PromptInputTemplate,\n\tdependencies: [\n\t\tInput,\n\t\tLabel,\n\t\tButton,\n\t],\n})\n\n/**\n * Fired when the input operation has finished by pressing Enter\n * or AI button is clicked.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"submit\")\n\n/**\n * Fired when the value of the component changes at each keystroke,\n * and when a suggestion item has been selected.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"input\")\n\n/**\n * Fired when the input operation has finished by pressing Enter\n * or on focusout.\n *\n * @since 2.0.0\n * @public\n */\n@event(\"change\")\nclass PromptInput extends UI5Element {\n\t/**\n\t * Defines the value of the component.\n\t *\n\t * @default \"\"\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tvalue!: string;\n\n\t/**\n\t * Defines a short hint intended to aid the user with data entry when the\n\t * component has no value.\n\t * @default \"\"\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tplaceholder!: string;\n\n\t/**\n\t * Defines the label of the input field.\n\t *\n\t * @default \"\"\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property()\n\tlabel!: string;\n\n\t/**\n\t * Defines whether the clear icon of the input will be shown.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tshowClearIcon!: boolean;\n\n\t/**\n\t * Determines whether the characters exceeding the maximum allowed character count are visible\n\t * in the component.\n\t *\n\t * If set to `false`, the user is not allowed to enter more characters than what is set in the\n\t * `maxlength` property.\n\t * If set to `true` the characters exceeding the `maxlength` value are selected on\n\t * paste and the counter below the component displays their number.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tshowExceededText!: boolean;\n\n\t/**\n\t * Defines whether the component is in disabled state.\n\t *\n\t * **Note:** A disabled component is completely noninteractive.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tdisabled!: boolean;\n\n\t/**\n\t * Defines whether the component is read-only.\n\t *\n\t * **Note:** A read-only component is not editable,\n\t * but still provides visual feedback upon user interaction.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\treadonly!: boolean;\n\n\t/**\n\t * Sets the maximum number of characters available in the input field.\n\t *\n\t * @default undefined\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property({ validator: Integer })\n\tmaxlength?: number;\n\n\t/**\n\t * Defines the value state of the component.\n\t * @default \"None\"\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@property({ type: ValueState, defaultValue: ValueState.None })\n\tvalueState!: `${ValueState}`;\n\n\t/**\n\t * Defines the value state message that will be displayed as pop up under the component.\n\t * The value state message slot should contain only one root element.\n\t *\n\t * **Note:** If not specified, a default text (in the respective language) will be displayed.\n\t *\n\t * **Note:** The `valueStateMessage` would be displayed,\n\t * when the component is in `Information`, `Critical` or `Negative` value state.\n\t *\n\t * @since 2.0.0\n\t * @public\n\t */\n\t@slot({\n\t\ttype: HTMLElement,\n\t\tinvalidateOnChildChange: true,\n\t})\n\tvalueStateMessage!: Array<HTMLElement>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tPromptInput.i18nBundle = await getI18nBundle(\"@ui5/webcomponents-ai\");\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireEvent(\"submit\");\n\t\t}\n\t}\n\n\t_onInnerInput(e: CustomEvent<InputEventDetail>) {\n\t\tthis.value = (e.target as Input).value;\n\n\t\tthis.fireEvent(\"input\");\n\t}\n\n\t_onInnerChange() {\n\t\tthis.fireEvent(\"change\");\n\t}\n\n\t_onButtonClick() {\n\t\tthis.fireEvent(\"submit\");\n\t}\n\n\tget _exceededText() {\n\t\tif (this.showExceededText) {\n\t\t\tlet leftCharactersCount;\n\t\t\tconst maxLength = this.maxlength;\n\n\t\t\tif (maxLength !== undefined) {\n\t\t\t\tleftCharactersCount = maxLength - this.value.length;\n\n\t\t\t\tif (leftCharactersCount >= 0) {\n\t\t\t\t\treturn PromptInput.i18nBundle.getText(PROMPT_INPUT_CHARACTERS_LEFT, leftCharactersCount);\n\t\t\t\t}\n\n\t\t\t\treturn PromptInput.i18nBundle.getText(PROMPT_INPUT_CHARACTERS_EXCEEDED, Math.abs(leftCharactersCount));\n\t\t\t}\n\t\t}\n\t}\n\n\tget _maxLenght() {\n\t\treturn this.maxlength || undefined;\n\t}\n\n\tget _submitButtonDisabled() {\n\t\treturn (this.value.length <= 0) || this.disabled || this.readonly;\n\t}\n}\n\nPromptInput.define();\n\nexport default PromptInput;\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
.ai-prompt-input-button{margin-left:.5rem;margin-top:3px}.ai-prompt-input-wrapper{display:flex;flex-direction:column;width:270px}.ai-prompt-input-form-wrapper{display:flex;flex:1}.ai-prompt-input-counter{font-size:.75rem;align-self:flex-end}#input{width:100%}.ai-prompt-inner-input-wrapper{display:flex;flex-direction:column;flex:1}
|
@@ -76,8 +76,19 @@
|
|
76
76
|
"declarations": [
|
77
77
|
{
|
78
78
|
"kind": "class",
|
79
|
-
"description": "### Overview\n\nThe
|
79
|
+
"description": "### Overview\n\nThe `ui5-ai-prompt-input` component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.\n\n**Note:** The web component is in an experimental state\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/PromptInput.js",
|
80
80
|
"name": "PromptInput",
|
81
|
+
"slots": [
|
82
|
+
{
|
83
|
+
"name": "valueStateMessage",
|
84
|
+
"description": "Defines the value state message that will be displayed as pop up under the component.\nThe value state message slot should contain only one root element.\n\n**Note:** If not specified, a default text (in the respective language) will be displayed.\n\n**Note:** The `valueStateMessage` would be displayed,\nwhen the component is in `Information`, `Critical` or `Negative` value state.",
|
85
|
+
"_ui5since": "2.0.0",
|
86
|
+
"_ui5type": {
|
87
|
+
"text": "Array<HTMLElement>"
|
88
|
+
},
|
89
|
+
"_ui5privacy": "public"
|
90
|
+
}
|
91
|
+
],
|
81
92
|
"members": [
|
82
93
|
{
|
83
94
|
"kind": "field",
|
@@ -85,21 +96,226 @@
|
|
85
96
|
"type": {
|
86
97
|
"text": "string"
|
87
98
|
},
|
88
|
-
"description": "Defines the value of the
|
99
|
+
"description": "Defines the value of the component.",
|
100
|
+
"default": "\"\"",
|
89
101
|
"privacy": "public",
|
102
|
+
"_ui5since": "2.0.0",
|
103
|
+
"_ui5validator": "String"
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"kind": "field",
|
107
|
+
"name": "placeholder",
|
108
|
+
"type": {
|
109
|
+
"text": "string"
|
110
|
+
},
|
111
|
+
"description": "Defines a short hint intended to aid the user with data entry when the\ncomponent has no value.",
|
90
112
|
"default": "\"\"",
|
113
|
+
"privacy": "public",
|
114
|
+
"_ui5since": "2.0.0",
|
91
115
|
"_ui5validator": "String"
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"kind": "field",
|
119
|
+
"name": "label",
|
120
|
+
"type": {
|
121
|
+
"text": "string"
|
122
|
+
},
|
123
|
+
"description": "Defines the label of the input field.",
|
124
|
+
"default": "\"\"",
|
125
|
+
"privacy": "public",
|
126
|
+
"_ui5since": "2.0.0",
|
127
|
+
"_ui5validator": "String"
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"kind": "field",
|
131
|
+
"name": "showClearIcon",
|
132
|
+
"type": {
|
133
|
+
"text": "boolean"
|
134
|
+
},
|
135
|
+
"description": "Defines whether the clear icon of the input will be shown.",
|
136
|
+
"default": "false",
|
137
|
+
"privacy": "public",
|
138
|
+
"_ui5since": "2.0.0",
|
139
|
+
"_ui5validator": "Boolean"
|
140
|
+
},
|
141
|
+
{
|
142
|
+
"kind": "field",
|
143
|
+
"name": "showExceededText",
|
144
|
+
"type": {
|
145
|
+
"text": "boolean"
|
146
|
+
},
|
147
|
+
"description": "Determines whether the characters exceeding the maximum allowed character count are visible\nin the component.\n\nIf set to `false`, the user is not allowed to enter more characters than what is set in the\n`maxlength` property.\nIf set to `true` the characters exceeding the `maxlength` value are selected on\npaste and the counter below the component displays their number.",
|
148
|
+
"default": "false",
|
149
|
+
"privacy": "public",
|
150
|
+
"_ui5since": "2.0.0",
|
151
|
+
"_ui5validator": "Boolean"
|
152
|
+
},
|
153
|
+
{
|
154
|
+
"kind": "field",
|
155
|
+
"name": "disabled",
|
156
|
+
"type": {
|
157
|
+
"text": "boolean"
|
158
|
+
},
|
159
|
+
"description": "Defines whether the component is in disabled state.\n\n**Note:** A disabled component is completely noninteractive.",
|
160
|
+
"default": "false",
|
161
|
+
"privacy": "public",
|
162
|
+
"_ui5since": "2.0.0",
|
163
|
+
"_ui5validator": "Boolean"
|
164
|
+
},
|
165
|
+
{
|
166
|
+
"kind": "field",
|
167
|
+
"name": "readonly",
|
168
|
+
"type": {
|
169
|
+
"text": "boolean"
|
170
|
+
},
|
171
|
+
"description": "Defines whether the component is read-only.\n\n**Note:** A read-only component is not editable,\nbut still provides visual feedback upon user interaction.",
|
172
|
+
"default": "false",
|
173
|
+
"privacy": "public",
|
174
|
+
"_ui5since": "2.0.0",
|
175
|
+
"_ui5validator": "Boolean"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"kind": "field",
|
179
|
+
"name": "maxlength",
|
180
|
+
"type": {
|
181
|
+
"text": "number | undefined"
|
182
|
+
},
|
183
|
+
"description": "Sets the maximum number of characters available in the input field.",
|
184
|
+
"default": "undefined",
|
185
|
+
"privacy": "public",
|
186
|
+
"_ui5since": "2.0.0",
|
187
|
+
"_ui5validator": "Integer"
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"kind": "field",
|
191
|
+
"name": "valueState",
|
192
|
+
"type": {
|
193
|
+
"text": "ValueState",
|
194
|
+
"references": [
|
195
|
+
{
|
196
|
+
"name": "ValueState",
|
197
|
+
"package": "@ui5/webcomponents-base",
|
198
|
+
"module": "dist/types/ValueState.js"
|
199
|
+
}
|
200
|
+
]
|
201
|
+
},
|
202
|
+
"description": "Defines the value state of the component.",
|
203
|
+
"default": "\"None\"",
|
204
|
+
"privacy": "public",
|
205
|
+
"_ui5since": "2.0.0",
|
206
|
+
"_ui5validator": "ValueState"
|
207
|
+
}
|
208
|
+
],
|
209
|
+
"events": [
|
210
|
+
{
|
211
|
+
"name": "submit",
|
212
|
+
"_ui5privacy": "public",
|
213
|
+
"type": {
|
214
|
+
"text": "CustomEvent"
|
215
|
+
},
|
216
|
+
"description": "Fired when the input operation has finished by pressing Enter\nor AI button is clicked.",
|
217
|
+
"_ui5since": "2.0.0"
|
218
|
+
},
|
219
|
+
{
|
220
|
+
"name": "input",
|
221
|
+
"_ui5privacy": "public",
|
222
|
+
"type": {
|
223
|
+
"text": "CustomEvent"
|
224
|
+
},
|
225
|
+
"description": "Fired when the value of the component changes at each keystroke,\nand when a suggestion item has been selected.",
|
226
|
+
"_ui5since": "2.0.0"
|
227
|
+
},
|
228
|
+
{
|
229
|
+
"name": "change",
|
230
|
+
"_ui5privacy": "public",
|
231
|
+
"type": {
|
232
|
+
"text": "CustomEvent"
|
233
|
+
},
|
234
|
+
"description": "Fired when the input operation has finished by pressing Enter\nor on focusout.",
|
235
|
+
"_ui5since": "2.0.0"
|
92
236
|
}
|
93
237
|
],
|
94
238
|
"attributes": [
|
95
239
|
{
|
96
|
-
"description": "Defines the value of the
|
240
|
+
"description": "Defines the value of the component.",
|
97
241
|
"name": "value",
|
98
242
|
"default": "\"\"",
|
99
243
|
"fieldName": "value",
|
100
244
|
"type": {
|
101
245
|
"text": "string"
|
102
246
|
}
|
247
|
+
},
|
248
|
+
{
|
249
|
+
"description": "Defines a short hint intended to aid the user with data entry when the\ncomponent has no value.",
|
250
|
+
"name": "placeholder",
|
251
|
+
"default": "\"\"",
|
252
|
+
"fieldName": "placeholder",
|
253
|
+
"type": {
|
254
|
+
"text": "string"
|
255
|
+
}
|
256
|
+
},
|
257
|
+
{
|
258
|
+
"description": "Defines the label of the input field.",
|
259
|
+
"name": "label",
|
260
|
+
"default": "\"\"",
|
261
|
+
"fieldName": "label",
|
262
|
+
"type": {
|
263
|
+
"text": "string"
|
264
|
+
}
|
265
|
+
},
|
266
|
+
{
|
267
|
+
"description": "Defines whether the clear icon of the input will be shown.",
|
268
|
+
"name": "show-clear-icon",
|
269
|
+
"default": "false",
|
270
|
+
"fieldName": "showClearIcon",
|
271
|
+
"type": {
|
272
|
+
"text": "boolean"
|
273
|
+
}
|
274
|
+
},
|
275
|
+
{
|
276
|
+
"description": "Determines whether the characters exceeding the maximum allowed character count are visible\nin the component.\n\nIf set to `false`, the user is not allowed to enter more characters than what is set in the\n`maxlength` property.\nIf set to `true` the characters exceeding the `maxlength` value are selected on\npaste and the counter below the component displays their number.",
|
277
|
+
"name": "show-exceeded-text",
|
278
|
+
"default": "false",
|
279
|
+
"fieldName": "showExceededText",
|
280
|
+
"type": {
|
281
|
+
"text": "boolean"
|
282
|
+
}
|
283
|
+
},
|
284
|
+
{
|
285
|
+
"description": "Defines whether the component is in disabled state.\n\n**Note:** A disabled component is completely noninteractive.",
|
286
|
+
"name": "disabled",
|
287
|
+
"default": "false",
|
288
|
+
"fieldName": "disabled",
|
289
|
+
"type": {
|
290
|
+
"text": "boolean"
|
291
|
+
}
|
292
|
+
},
|
293
|
+
{
|
294
|
+
"description": "Defines whether the component is read-only.\n\n**Note:** A read-only component is not editable,\nbut still provides visual feedback upon user interaction.",
|
295
|
+
"name": "readonly",
|
296
|
+
"default": "false",
|
297
|
+
"fieldName": "readonly",
|
298
|
+
"type": {
|
299
|
+
"text": "boolean"
|
300
|
+
}
|
301
|
+
},
|
302
|
+
{
|
303
|
+
"description": "Sets the maximum number of characters available in the input field.",
|
304
|
+
"name": "maxlength",
|
305
|
+
"default": "undefined",
|
306
|
+
"fieldName": "maxlength",
|
307
|
+
"type": {
|
308
|
+
"text": "number | undefined"
|
309
|
+
}
|
310
|
+
},
|
311
|
+
{
|
312
|
+
"description": "Defines the value state of the component.",
|
313
|
+
"name": "value-state",
|
314
|
+
"default": "\"None\"",
|
315
|
+
"fieldName": "valueState",
|
316
|
+
"type": {
|
317
|
+
"text": "\"None\" | \"Positive\" | \"Critical\" | \"Negative\" | \"Information\""
|
318
|
+
}
|
103
319
|
}
|
104
320
|
],
|
105
321
|
"superclass": {
|
@@ -109,7 +325,6 @@
|
|
109
325
|
},
|
110
326
|
"tagName": "ui5-ai-prompt-input",
|
111
327
|
"customElement": true,
|
112
|
-
"_ui5since": "2.0",
|
113
328
|
"_ui5privacy": "public"
|
114
329
|
}
|
115
330
|
],
|
@@ -73,8 +73,14 @@
|
|
73
73
|
"declarations": [
|
74
74
|
{
|
75
75
|
"kind": "class",
|
76
|
-
"description": "### Overview\n\nThe
|
76
|
+
"description": "### Overview\n\nThe `ui5-ai-prompt-input` component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.\n\n**Note:** The web component is in an experimental state\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/PromptInput.js",
|
77
77
|
"name": "PromptInput",
|
78
|
+
"slots": [
|
79
|
+
{
|
80
|
+
"name": "valueStateMessage",
|
81
|
+
"description": "Defines the value state message that will be displayed as pop up under the component.\nThe value state message slot should contain only one root element.\n\n**Note:** If not specified, a default text (in the respective language) will be displayed.\n\n**Note:** The `valueStateMessage` would be displayed,\nwhen the component is in `Information`, `Critical` or `Negative` value state."
|
82
|
+
}
|
83
|
+
],
|
78
84
|
"members": [
|
79
85
|
{
|
80
86
|
"kind": "field",
|
@@ -82,20 +88,202 @@
|
|
82
88
|
"type": {
|
83
89
|
"text": "string"
|
84
90
|
},
|
85
|
-
"description": "Defines the value of the
|
86
|
-
"
|
87
|
-
"
|
91
|
+
"description": "Defines the value of the component.",
|
92
|
+
"default": "\"\"",
|
93
|
+
"privacy": "public"
|
94
|
+
},
|
95
|
+
{
|
96
|
+
"kind": "field",
|
97
|
+
"name": "placeholder",
|
98
|
+
"type": {
|
99
|
+
"text": "string"
|
100
|
+
},
|
101
|
+
"description": "Defines a short hint intended to aid the user with data entry when the\ncomponent has no value.",
|
102
|
+
"default": "\"\"",
|
103
|
+
"privacy": "public"
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"kind": "field",
|
107
|
+
"name": "label",
|
108
|
+
"type": {
|
109
|
+
"text": "string"
|
110
|
+
},
|
111
|
+
"description": "Defines the label of the input field.",
|
112
|
+
"default": "\"\"",
|
113
|
+
"privacy": "public"
|
114
|
+
},
|
115
|
+
{
|
116
|
+
"kind": "field",
|
117
|
+
"name": "showClearIcon",
|
118
|
+
"type": {
|
119
|
+
"text": "boolean"
|
120
|
+
},
|
121
|
+
"description": "Defines whether the clear icon of the input will be shown.",
|
122
|
+
"default": "false",
|
123
|
+
"privacy": "public"
|
124
|
+
},
|
125
|
+
{
|
126
|
+
"kind": "field",
|
127
|
+
"name": "showExceededText",
|
128
|
+
"type": {
|
129
|
+
"text": "boolean"
|
130
|
+
},
|
131
|
+
"description": "Determines whether the characters exceeding the maximum allowed character count are visible\nin the component.\n\nIf set to `false`, the user is not allowed to enter more characters than what is set in the\n`maxlength` property.\nIf set to `true` the characters exceeding the `maxlength` value are selected on\npaste and the counter below the component displays their number.",
|
132
|
+
"default": "false",
|
133
|
+
"privacy": "public"
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"kind": "field",
|
137
|
+
"name": "disabled",
|
138
|
+
"type": {
|
139
|
+
"text": "boolean"
|
140
|
+
},
|
141
|
+
"description": "Defines whether the component is in disabled state.\n\n**Note:** A disabled component is completely noninteractive.",
|
142
|
+
"default": "false",
|
143
|
+
"privacy": "public"
|
144
|
+
},
|
145
|
+
{
|
146
|
+
"kind": "field",
|
147
|
+
"name": "readonly",
|
148
|
+
"type": {
|
149
|
+
"text": "boolean"
|
150
|
+
},
|
151
|
+
"description": "Defines whether the component is read-only.\n\n**Note:** A read-only component is not editable,\nbut still provides visual feedback upon user interaction.",
|
152
|
+
"default": "false",
|
153
|
+
"privacy": "public"
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"kind": "field",
|
157
|
+
"name": "maxlength",
|
158
|
+
"type": {
|
159
|
+
"text": "number | undefined"
|
160
|
+
},
|
161
|
+
"description": "Sets the maximum number of characters available in the input field.",
|
162
|
+
"default": "undefined",
|
163
|
+
"privacy": "public"
|
164
|
+
},
|
165
|
+
{
|
166
|
+
"kind": "field",
|
167
|
+
"name": "valueState",
|
168
|
+
"type": {
|
169
|
+
"text": "ValueState",
|
170
|
+
"references": [
|
171
|
+
{
|
172
|
+
"name": "ValueState",
|
173
|
+
"package": "@ui5/webcomponents-base",
|
174
|
+
"module": "dist/types/ValueState.js"
|
175
|
+
}
|
176
|
+
]
|
177
|
+
},
|
178
|
+
"description": "Defines the value state of the component.",
|
179
|
+
"default": "\"None\"",
|
180
|
+
"privacy": "public"
|
181
|
+
}
|
182
|
+
],
|
183
|
+
"events": [
|
184
|
+
{
|
185
|
+
"name": "submit",
|
186
|
+
"type": {
|
187
|
+
"text": "CustomEvent"
|
188
|
+
},
|
189
|
+
"description": "Fired when the input operation has finished by pressing Enter\nor AI button is clicked."
|
190
|
+
},
|
191
|
+
{
|
192
|
+
"name": "input",
|
193
|
+
"type": {
|
194
|
+
"text": "CustomEvent"
|
195
|
+
},
|
196
|
+
"description": "Fired when the value of the component changes at each keystroke,\nand when a suggestion item has been selected."
|
197
|
+
},
|
198
|
+
{
|
199
|
+
"name": "change",
|
200
|
+
"type": {
|
201
|
+
"text": "CustomEvent"
|
202
|
+
},
|
203
|
+
"description": "Fired when the input operation has finished by pressing Enter\nor on focusout."
|
88
204
|
}
|
89
205
|
],
|
90
206
|
"attributes": [
|
91
207
|
{
|
92
|
-
"description": "Defines the value of the
|
208
|
+
"description": "Defines the value of the component.",
|
93
209
|
"name": "value",
|
94
210
|
"default": "\"\"",
|
95
211
|
"fieldName": "value",
|
96
212
|
"type": {
|
97
213
|
"text": "string"
|
98
214
|
}
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"description": "Defines a short hint intended to aid the user with data entry when the\ncomponent has no value.",
|
218
|
+
"name": "placeholder",
|
219
|
+
"default": "\"\"",
|
220
|
+
"fieldName": "placeholder",
|
221
|
+
"type": {
|
222
|
+
"text": "string"
|
223
|
+
}
|
224
|
+
},
|
225
|
+
{
|
226
|
+
"description": "Defines the label of the input field.",
|
227
|
+
"name": "label",
|
228
|
+
"default": "\"\"",
|
229
|
+
"fieldName": "label",
|
230
|
+
"type": {
|
231
|
+
"text": "string"
|
232
|
+
}
|
233
|
+
},
|
234
|
+
{
|
235
|
+
"description": "Defines whether the clear icon of the input will be shown.",
|
236
|
+
"name": "show-clear-icon",
|
237
|
+
"default": "false",
|
238
|
+
"fieldName": "showClearIcon",
|
239
|
+
"type": {
|
240
|
+
"text": "boolean"
|
241
|
+
}
|
242
|
+
},
|
243
|
+
{
|
244
|
+
"description": "Determines whether the characters exceeding the maximum allowed character count are visible\nin the component.\n\nIf set to `false`, the user is not allowed to enter more characters than what is set in the\n`maxlength` property.\nIf set to `true` the characters exceeding the `maxlength` value are selected on\npaste and the counter below the component displays their number.",
|
245
|
+
"name": "show-exceeded-text",
|
246
|
+
"default": "false",
|
247
|
+
"fieldName": "showExceededText",
|
248
|
+
"type": {
|
249
|
+
"text": "boolean"
|
250
|
+
}
|
251
|
+
},
|
252
|
+
{
|
253
|
+
"description": "Defines whether the component is in disabled state.\n\n**Note:** A disabled component is completely noninteractive.",
|
254
|
+
"name": "disabled",
|
255
|
+
"default": "false",
|
256
|
+
"fieldName": "disabled",
|
257
|
+
"type": {
|
258
|
+
"text": "boolean"
|
259
|
+
}
|
260
|
+
},
|
261
|
+
{
|
262
|
+
"description": "Defines whether the component is read-only.\n\n**Note:** A read-only component is not editable,\nbut still provides visual feedback upon user interaction.",
|
263
|
+
"name": "readonly",
|
264
|
+
"default": "false",
|
265
|
+
"fieldName": "readonly",
|
266
|
+
"type": {
|
267
|
+
"text": "boolean"
|
268
|
+
}
|
269
|
+
},
|
270
|
+
{
|
271
|
+
"description": "Sets the maximum number of characters available in the input field.",
|
272
|
+
"name": "maxlength",
|
273
|
+
"default": "undefined",
|
274
|
+
"fieldName": "maxlength",
|
275
|
+
"type": {
|
276
|
+
"text": "number | undefined"
|
277
|
+
}
|
278
|
+
},
|
279
|
+
{
|
280
|
+
"description": "Defines the value state of the component.",
|
281
|
+
"name": "value-state",
|
282
|
+
"default": "\"None\"",
|
283
|
+
"fieldName": "valueState",
|
284
|
+
"type": {
|
285
|
+
"text": "\"None\" | \"Positive\" | \"Critical\" | \"Negative\" | \"Information\""
|
286
|
+
}
|
99
287
|
}
|
100
288
|
],
|
101
289
|
"superclass": {
|
@@ -1 +1,4 @@
|
|
1
|
-
|
1
|
+
import { I18nText } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
2
|
+
declare const PROMPT_INPUT_CHARACTERS_LEFT: I18nText;
|
3
|
+
declare const PROMPT_INPUT_CHARACTERS_EXCEEDED: I18nText;
|
4
|
+
export { PROMPT_INPUT_CHARACTERS_LEFT, PROMPT_INPUT_CHARACTERS_EXCEEDED };
|
@@ -1,2 +1,5 @@
|
|
1
1
|
import "@ui5/webcomponents-base/dist/i18nBundle.js";
|
2
|
+
const PROMPT_INPUT_CHARACTERS_LEFT = { key: "PROMPT_INPUT_CHARACTERS_LEFT", defaultText: "{0} characters remaining" };
|
3
|
+
const PROMPT_INPUT_CHARACTERS_EXCEEDED = { key: "PROMPT_INPUT_CHARACTERS_EXCEEDED", defaultText: "{0} characters over limit" };
|
4
|
+
export { PROMPT_INPUT_CHARACTERS_LEFT, PROMPT_INPUT_CHARACTERS_EXCEEDED };
|
2
5
|
//# sourceMappingURL=i18n-defaults.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18n-defaults.js","sourceRoot":"","sources":["../../../src/generated/i18n/i18n-defaults.ts"],"names":[],"mappings":"AAAA,OAAyB,4CAA4C,CAAC","sourcesContent":["import { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\
|
1
|
+
{"version":3,"file":"i18n-defaults.js","sourceRoot":"","sources":["../../../src/generated/i18n/i18n-defaults.ts"],"names":[],"mappings":"AAAA,OAAyB,4CAA4C,CAAC;AACtE,MAAM,4BAA4B,GAAa,EAAC,GAAG,EAAE,8BAA8B,EAAE,WAAW,EAAE,0BAA0B,EAAC,CAAC;AAAA,MAAM,gCAAgC,GAAa,EAAC,GAAG,EAAE,kCAAkC,EAAE,WAAW,EAAE,2BAA2B,EAAC,CAAC;AACrQ,OAAO,EAAC,4BAA4B,EAAC,gCAAgC,EAAC,CAAC","sourcesContent":["import { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nconst PROMPT_INPUT_CHARACTERS_LEFT: I18nText = {key: \"PROMPT_INPUT_CHARACTERS_LEFT\", defaultText: \"{0} characters remaining\"};const PROMPT_INPUT_CHARACTERS_EXCEEDED: I18nText = {key: \"PROMPT_INPUT_CHARACTERS_EXCEEDED\", defaultText: \"{0} characters over limit\"};\nexport {PROMPT_INPUT_CHARACTERS_LEFT,PROMPT_INPUT_CHARACTERS_EXCEEDED};"]}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
|
+
import type PromptInput from "../../PromptInput.js";
|
3
|
+
declare function block0(this: PromptInput, context: UI5Element, tags: string[], suffix: string | undefined): import("lit-html").TemplateResult;
|
4
|
+
export default block0;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/* eslint no-unused-vars: 0 */
|
2
|
+
import { html, ifDefined, scopeTag } from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
3
|
+
function block0(context, tags, suffix) { return suffix ? html `<div class="ai-prompt-input-wrapper">${this.label ? block1.call(this, context, tags, suffix) : undefined}<div class="ai-prompt-input-form-wrapper"><div class="ai-prompt-inner-input-wrapper"><${scopeTag("ui5-input", tags, suffix)} id="input" .value="${ifDefined(this.value)}" placeholder="${ifDefined(this.placeholder)}" value-state="${ifDefined(this.valueState)}" ?show-clear-icon=${this.showClearIcon} ?disabled="${this.disabled}" ?readonly="${this.readonly}" @keydown="${this._onkeydown}" @ui5-input="${ifDefined(this._onInnerInput)}" @ui5-change="${ifDefined(this._onInnerChange)}">${this.valueStateMessage.length ? block2.call(this, context, tags, suffix) : undefined}</${scopeTag("ui5-input", tags, suffix)}>${this.showExceededText ? block3.call(this, context, tags, suffix) : undefined}</div><${scopeTag("ui5-button", tags, suffix)} ?disabled=${this._submitButtonDisabled} class="ai-prompt-input-button" design="Emphasized" icon="paper-plane" @click="${this._onButtonClick}"></${scopeTag("ui5-button", tags, suffix)}></div></div>` : html `<div class="ai-prompt-input-wrapper">${this.label ? block1.call(this, context, tags, suffix) : undefined}<div class="ai-prompt-input-form-wrapper"><div class="ai-prompt-inner-input-wrapper"><ui5-input id="input" .value="${ifDefined(this.value)}" placeholder="${ifDefined(this.placeholder)}" value-state="${ifDefined(this.valueState)}" ?show-clear-icon=${this.showClearIcon} ?disabled="${this.disabled}" ?readonly="${this.readonly}" @keydown="${this._onkeydown}" @ui5-input="${ifDefined(this._onInnerInput)}" @ui5-change="${ifDefined(this._onInnerChange)}">${this.valueStateMessage.length ? block2.call(this, context, tags, suffix) : undefined}</ui5-input>${this.showExceededText ? block3.call(this, context, tags, suffix) : undefined}</div><ui5-button ?disabled=${this._submitButtonDisabled} class="ai-prompt-input-button" design="Emphasized" icon="paper-plane" @click="${this._onButtonClick}"></ui5-button></div></div>`; }
|
4
|
+
function block1(context, tags, suffix) { return suffix ? html `<${scopeTag("ui5-label", tags, suffix)} for="input">${ifDefined(this.label)}</${scopeTag("ui5-label", tags, suffix)}>` : html `<ui5-label for="input">${ifDefined(this.label)}</ui5-label>`; }
|
5
|
+
function block2(context, tags, suffix) { return html `<slot name="valueStateMessage" slot="valueStateMessage"></slot>`; }
|
6
|
+
function block3(context, tags, suffix) { return suffix ? html `<${scopeTag("ui5-label", tags, suffix)} class="ai-prompt-input-counter">${ifDefined(this._exceededText)}</${scopeTag("ui5-label", tags, suffix)}>` : html `<ui5-label class="ai-prompt-input-counter">${ifDefined(this._exceededText)}</ui5-label>`; }
|
7
|
+
export default block0;
|
8
|
+
//# sourceMappingURL=PromptInputTemplate.lit.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PromptInputTemplate.lit.js","sourceRoot":"","sources":["../../../src/generated/templates/PromptInputTemplate.lit.ts"],"names":[],"mappings":"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","sourcesContent":["/* eslint no-unused-vars: 0 */\nimport { html, svg, repeat, classMap, styleMap, ifDefined, unsafeHTML, scopeTag } from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport type UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\timport type PromptInput from \"../../PromptInput.js\";\n\timport type { ClassMapValue } from \"@ui5/webcomponents-base/dist/types.js\";\n\t\nfunction block0 (this: PromptInput, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<div class=\"ai-prompt-input-wrapper\">${ this.label ? block1.call(this, context, tags, suffix) : undefined }<div class=\"ai-prompt-input-form-wrapper\"><div class=\"ai-prompt-inner-input-wrapper\"><${scopeTag(\"ui5-input\", tags, suffix)} id=\"input\" .value=\"${ifDefined(this.value)}\" placeholder=\"${ifDefined(this.placeholder)}\" value-state=\"${ifDefined(this.valueState)}\" ?show-clear-icon=${this.showClearIcon} ?disabled=\"${this.disabled}\" ?readonly=\"${this.readonly}\" @keydown=\"${this._onkeydown}\" @ui5-input=\"${ifDefined(this._onInnerInput)}\" @ui5-change=\"${ifDefined(this._onInnerChange)}\">${ this.valueStateMessage.length ? block2.call(this, context, tags, suffix) : undefined }</${scopeTag(\"ui5-input\", tags, suffix)}>${ this.showExceededText ? block3.call(this, context, tags, suffix) : undefined }</div><${scopeTag(\"ui5-button\", tags, suffix)} ?disabled=${this._submitButtonDisabled} class=\"ai-prompt-input-button\" design=\"Emphasized\" icon=\"paper-plane\" @click=\"${this._onButtonClick}\"></${scopeTag(\"ui5-button\", tags, suffix)}></div></div>` : html`<div class=\"ai-prompt-input-wrapper\">${ this.label ? block1.call(this, context, tags, suffix) : undefined }<div class=\"ai-prompt-input-form-wrapper\"><div class=\"ai-prompt-inner-input-wrapper\"><ui5-input id=\"input\" .value=\"${ifDefined(this.value)}\" placeholder=\"${ifDefined(this.placeholder)}\" value-state=\"${ifDefined(this.valueState)}\" ?show-clear-icon=${this.showClearIcon} ?disabled=\"${this.disabled}\" ?readonly=\"${this.readonly}\" @keydown=\"${this._onkeydown}\" @ui5-input=\"${ifDefined(this._onInnerInput)}\" @ui5-change=\"${ifDefined(this._onInnerChange)}\">${ this.valueStateMessage.length ? block2.call(this, context, tags, suffix) : undefined }</ui5-input>${ this.showExceededText ? block3.call(this, context, tags, suffix) : undefined }</div><ui5-button ?disabled=${this._submitButtonDisabled} class=\"ai-prompt-input-button\" design=\"Emphasized\" icon=\"paper-plane\" @click=\"${this._onButtonClick}\"></ui5-button></div></div>`;}\nfunction block1 (this: PromptInput, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<${scopeTag(\"ui5-label\", tags, suffix)} for=\"input\">${ifDefined(this.label)}</${scopeTag(\"ui5-label\", tags, suffix)}>` : html`<ui5-label for=\"input\">${ifDefined(this.label)}</ui5-label>`;}\nfunction block2 (this: PromptInput, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<slot name=\"valueStateMessage\" slot=\"valueStateMessage\"></slot>`;}\nfunction block3 (this: PromptInput, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<${scopeTag(\"ui5-label\", tags, suffix)} class=\"ai-prompt-input-counter\">${ifDefined(this._exceededText)}</${scopeTag(\"ui5-label\", tags, suffix)}>` : html`<ui5-label class=\"ai-prompt-input-counter\">${ifDefined(this._exceededText)}</ui5-label>`;}\n\n\nexport default block0;"]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js";
|
2
|
+
import defaultThemeBase from "@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js";
|
3
|
+
import defaultTheme from "./sap_horizon/parameters-bundle.css.js";
|
4
|
+
registerThemePropertiesLoader("@ui5/webcomponents-theming", "sap_horizon", async () => defaultThemeBase);
|
5
|
+
registerThemePropertiesLoader("@ui5/webcomponents-ai", "sap_horizon", async () => defaultTheme);
|
6
|
+
const styleData = { packageName: "@ui5/webcomponents-ai", fileName: "themes/PromptInput.css.ts", content: `.ai-prompt-input-button{margin-left:.5rem;margin-top:3px}.ai-prompt-input-wrapper{display:flex;flex-direction:column;width:270px}.ai-prompt-input-form-wrapper{display:flex;flex:1}.ai-prompt-input-counter{font-size:.75rem;align-self:flex-end}#input{width:100%}.ai-prompt-inner-input-wrapper{display:flex;flex-direction:column;flex:1}
|
7
|
+
` };
|
8
|
+
export default styleData;
|
9
|
+
//# sourceMappingURL=PromptInput.css.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PromptInput.css.js","sourceRoot":"","sources":["../../../src/generated/themes/PromptInput.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yDAAyD,CAAC;AAExG,OAAO,gBAAgB,MAAM,uFAAuF,CAAC;AACrH,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAElE,6BAA6B,CAAC,4BAA4B,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;AACzG,6BAA6B,CAAC,uBAAuB,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC;AAEhG,MAAM,SAAS,GAAc,EAAC,WAAW,EAAC,uBAAuB,EAAC,QAAQ,EAAC,2BAA2B,EAAC,OAAO,EAAC;CAC9G,EAAC,CAAC;AACH,eAAe,SAAS,CAAC","sourcesContent":["import type { StyleData } from \"@ui5/webcomponents-base/dist/types.js\";\nimport { registerThemePropertiesLoader } from \"@ui5/webcomponents-base/dist/asset-registries/Themes.js\";\n\nimport defaultThemeBase from \"@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js\";\nimport defaultTheme from \"./sap_horizon/parameters-bundle.css.js\";\n\nregisterThemePropertiesLoader(\"@ui5/webcomponents-theming\", \"sap_horizon\", async () => defaultThemeBase);\nregisterThemePropertiesLoader(\"@ui5/webcomponents-ai\", \"sap_horizon\", async () => defaultTheme);\n\nconst styleData: StyleData = {packageName:\"@ui5/webcomponents-ai\",fileName:\"themes/PromptInput.css.ts\",content:`.ai-prompt-input-button{margin-left:.5rem;margin-top:3px}.ai-prompt-input-wrapper{display:flex;flex-direction:column;width:270px}.ai-prompt-input-form-wrapper{display:flex;flex:1}.ai-prompt-input-counter{font-size:.75rem;align-self:flex-end}#input{width:100%}.ai-prompt-inner-input-wrapper{display:flex;flex-direction:column;flex:1}\n`};\nexport default styleData;\n\t"]}
|
@@ -15,12 +15,58 @@
|
|
15
15
|
},
|
16
16
|
{
|
17
17
|
"name": "ui5-ai-prompt-input",
|
18
|
-
"description": "### Overview\n\nThe
|
18
|
+
"description": "### Overview\n\nThe `ui5-ai-prompt-input` component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.\n\n**Note:** The web component is in an experimental state\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/PromptInput.js\n\n\n---\n\n\n\n\n### **Events:**\n - **submit** - Fired when the input operation has finished by pressing Enter\nor AI button is clicked.\n- **input** - Fired when the value of the component changes at each keystroke,\nand when a suggestion item has been selected.\n- **change** - Fired when the input operation has finished by pressing Enter\nor on focusout.\n\n### **Slots:**\n - **valueStateMessage** - Defines the value state message that will be displayed as pop up under the component.\nThe value state message slot should contain only one root element.\n\n**Note:** If not specified, a default text (in the respective language) will be displayed.\n\n**Note:** The `valueStateMessage` would be displayed,\nwhen the component is in `Information`, `Critical` or `Negative` value state.",
|
19
19
|
"attributes": [
|
20
20
|
{
|
21
21
|
"name": "value",
|
22
|
-
"description": "Defines the value of the
|
22
|
+
"description": "Defines the value of the component.",
|
23
23
|
"values": []
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"name": "placeholder",
|
27
|
+
"description": "Defines a short hint intended to aid the user with data entry when the\ncomponent has no value.",
|
28
|
+
"values": []
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"name": "label",
|
32
|
+
"description": "Defines the label of the input field.",
|
33
|
+
"values": []
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"name": "show-clear-icon",
|
37
|
+
"description": "Defines whether the clear icon of the input will be shown.",
|
38
|
+
"values": []
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"name": "show-exceeded-text",
|
42
|
+
"description": "Determines whether the characters exceeding the maximum allowed character count are visible\nin the component.\n\nIf set to `false`, the user is not allowed to enter more characters than what is set in the\n`maxlength` property.\nIf set to `true` the characters exceeding the `maxlength` value are selected on\npaste and the counter below the component displays their number.",
|
43
|
+
"values": []
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"name": "disabled",
|
47
|
+
"description": "Defines whether the component is in disabled state.\n\n**Note:** A disabled component is completely noninteractive.",
|
48
|
+
"values": []
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "readonly",
|
52
|
+
"description": "Defines whether the component is read-only.\n\n**Note:** A read-only component is not editable,\nbut still provides visual feedback upon user interaction.",
|
53
|
+
"values": []
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"name": "maxlength",
|
57
|
+
"description": "Sets the maximum number of characters available in the input field.",
|
58
|
+
"values": []
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"name": "value-state",
|
62
|
+
"description": "Defines the value state of the component.",
|
63
|
+
"values": [
|
64
|
+
{ "name": "None" },
|
65
|
+
{ "name": "Positive" },
|
66
|
+
{ "name": "Critical" },
|
67
|
+
{ "name": "Negative" },
|
68
|
+
{ "name": "Information" }
|
69
|
+
]
|
24
70
|
}
|
25
71
|
],
|
26
72
|
"references": []
|
package/dist/web-types.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
3
3
|
"name": "@ui5/webcomponents-ai",
|
4
|
-
"version": "2.0.0-rc.
|
4
|
+
"version": "2.0.0-rc.6",
|
5
5
|
"description-markup": "markdown",
|
6
6
|
"contributions": {
|
7
7
|
"html": {
|
@@ -31,25 +31,142 @@
|
|
31
31
|
},
|
32
32
|
{
|
33
33
|
"name": "ui5-ai-prompt-input",
|
34
|
-
"description": "### Overview\n\nThe
|
34
|
+
"description": "### Overview\n\nThe `ui5-ai-prompt-input` component allows the user to write custom instructions in natural language, so that AI is guided to generate content tailored to user needs.\n\n**Note:** The web component is in an experimental state\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/PromptInput.js\n---\n\n\n### **Events:**\n - **submit** - Fired when the input operation has finished by pressing Enter\nor AI button is clicked.\n- **input** - Fired when the value of the component changes at each keystroke,\nand when a suggestion item has been selected.\n- **change** - Fired when the input operation has finished by pressing Enter\nor on focusout.\n\n### **Slots:**\n - **valueStateMessage** - Defines the value state message that will be displayed as pop up under the component.\nThe value state message slot should contain only one root element.\n\n**Note:** If not specified, a default text (in the respective language) will be displayed.\n\n**Note:** The `valueStateMessage` would be displayed,\nwhen the component is in `Information`, `Critical` or `Negative` value state.",
|
35
35
|
"doc-url": "",
|
36
36
|
"attributes": [
|
37
37
|
{
|
38
38
|
"name": "value",
|
39
|
-
"description": "Defines the value of the
|
39
|
+
"description": "Defines the value of the component.",
|
40
40
|
"value": { "type": "string", "default": "\"\"" }
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"name": "placeholder",
|
44
|
+
"description": "Defines a short hint intended to aid the user with data entry when the\ncomponent has no value.",
|
45
|
+
"value": { "type": "string", "default": "\"\"" }
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"name": "label",
|
49
|
+
"description": "Defines the label of the input field.",
|
50
|
+
"value": { "type": "string", "default": "\"\"" }
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"name": "show-clear-icon",
|
54
|
+
"description": "Defines whether the clear icon of the input will be shown.",
|
55
|
+
"value": { "type": "boolean", "default": "false" }
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"name": "show-exceeded-text",
|
59
|
+
"description": "Determines whether the characters exceeding the maximum allowed character count are visible\nin the component.\n\nIf set to `false`, the user is not allowed to enter more characters than what is set in the\n`maxlength` property.\nIf set to `true` the characters exceeding the `maxlength` value are selected on\npaste and the counter below the component displays their number.",
|
60
|
+
"value": { "type": "boolean", "default": "false" }
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"name": "disabled",
|
64
|
+
"description": "Defines whether the component is in disabled state.\n\n**Note:** A disabled component is completely noninteractive.",
|
65
|
+
"value": { "type": "boolean", "default": "false" }
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"name": "readonly",
|
69
|
+
"description": "Defines whether the component is read-only.\n\n**Note:** A read-only component is not editable,\nbut still provides visual feedback upon user interaction.",
|
70
|
+
"value": { "type": "boolean", "default": "false" }
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"name": "maxlength",
|
74
|
+
"description": "Sets the maximum number of characters available in the input field.",
|
75
|
+
"value": { "type": "number | undefined", "default": "undefined" }
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"name": "value-state",
|
79
|
+
"description": "Defines the value state of the component.",
|
80
|
+
"value": {
|
81
|
+
"type": "\"None\" | \"Positive\" | \"Critical\" | \"Negative\" | \"Information\"",
|
82
|
+
"default": "\"None\""
|
83
|
+
}
|
84
|
+
}
|
85
|
+
],
|
86
|
+
"slots": [
|
87
|
+
{
|
88
|
+
"name": "valueStateMessage",
|
89
|
+
"description": "Defines the value state message that will be displayed as pop up under the component.\nThe value state message slot should contain only one root element.\n\n**Note:** If not specified, a default text (in the respective language) will be displayed.\n\n**Note:** The `valueStateMessage` would be displayed,\nwhen the component is in `Information`, `Critical` or `Negative` value state."
|
90
|
+
}
|
91
|
+
],
|
92
|
+
"events": [
|
93
|
+
{
|
94
|
+
"name": "submit",
|
95
|
+
"description": "Fired when the input operation has finished by pressing Enter\nor AI button is clicked."
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"name": "input",
|
99
|
+
"description": "Fired when the value of the component changes at each keystroke,\nand when a suggestion item has been selected."
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"name": "change",
|
103
|
+
"description": "Fired when the input operation has finished by pressing Enter\nor on focusout."
|
41
104
|
}
|
42
105
|
],
|
43
|
-
"events": [],
|
44
106
|
"js": {
|
45
107
|
"properties": [
|
46
108
|
{
|
47
109
|
"name": "value",
|
48
|
-
"description": "Defines the value of the
|
110
|
+
"description": "Defines the value of the component.",
|
111
|
+
"value": { "type": "string" }
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"name": "placeholder",
|
115
|
+
"description": "Defines a short hint intended to aid the user with data entry when the\ncomponent has no value.",
|
116
|
+
"value": { "type": "string" }
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"name": "label",
|
120
|
+
"description": "Defines the label of the input field.",
|
49
121
|
"value": { "type": "string" }
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"name": "show-clear-icon",
|
125
|
+
"description": "Defines whether the clear icon of the input will be shown.",
|
126
|
+
"value": { "type": "boolean" }
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"name": "show-exceeded-text",
|
130
|
+
"description": "Determines whether the characters exceeding the maximum allowed character count are visible\nin the component.\n\nIf set to `false`, the user is not allowed to enter more characters than what is set in the\n`maxlength` property.\nIf set to `true` the characters exceeding the `maxlength` value are selected on\npaste and the counter below the component displays their number.",
|
131
|
+
"value": { "type": "boolean" }
|
132
|
+
},
|
133
|
+
{
|
134
|
+
"name": "disabled",
|
135
|
+
"description": "Defines whether the component is in disabled state.\n\n**Note:** A disabled component is completely noninteractive.",
|
136
|
+
"value": { "type": "boolean" }
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"name": "readonly",
|
140
|
+
"description": "Defines whether the component is read-only.\n\n**Note:** A read-only component is not editable,\nbut still provides visual feedback upon user interaction.",
|
141
|
+
"value": { "type": "boolean" }
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"name": "maxlength",
|
145
|
+
"description": "Sets the maximum number of characters available in the input field.",
|
146
|
+
"value": { "type": "number | undefined" }
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"name": "value-state",
|
150
|
+
"description": "Defines the value state of the component.",
|
151
|
+
"value": {
|
152
|
+
"type": "\"None\" | \"Positive\" | \"Critical\" | \"Negative\" | \"Information\""
|
153
|
+
}
|
50
154
|
}
|
51
155
|
],
|
52
|
-
"events": [
|
156
|
+
"events": [
|
157
|
+
{
|
158
|
+
"name": "submit",
|
159
|
+
"description": "Fired when the input operation has finished by pressing Enter\nor AI button is clicked."
|
160
|
+
},
|
161
|
+
{
|
162
|
+
"name": "input",
|
163
|
+
"description": "Fired when the value of the component changes at each keystroke,\nand when a suggestion item has been selected."
|
164
|
+
},
|
165
|
+
{
|
166
|
+
"name": "change",
|
167
|
+
"description": "Fired when the input operation has finished by pressing Enter\nor on focusout."
|
168
|
+
}
|
169
|
+
]
|
53
170
|
}
|
54
171
|
}
|
55
172
|
]
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-ai",
|
3
|
-
"version": "2.0.0-rc.
|
3
|
+
"version": "2.0.0-rc.6",
|
4
4
|
"description": "UI5 Web Components: webcomponents.ai",
|
5
5
|
"ui5": {
|
6
6
|
"webComponentsPackage": true
|
@@ -45,14 +45,14 @@
|
|
45
45
|
"directory": "packages/ai"
|
46
46
|
},
|
47
47
|
"dependencies": {
|
48
|
-
"@ui5/webcomponents": "2.0.0-rc.
|
49
|
-
"@ui5/webcomponents-base": "2.0.0-rc.
|
50
|
-
"@ui5/webcomponents-icons": "2.0.0-rc.
|
51
|
-
"@ui5/webcomponents-theming": "2.0.0-rc.
|
48
|
+
"@ui5/webcomponents": "2.0.0-rc.6",
|
49
|
+
"@ui5/webcomponents-base": "2.0.0-rc.6",
|
50
|
+
"@ui5/webcomponents-icons": "2.0.0-rc.6",
|
51
|
+
"@ui5/webcomponents-theming": "2.0.0-rc.6"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
|
-
"@ui5/webcomponents-tools": "2.0.0-rc.
|
54
|
+
"@ui5/webcomponents-tools": "2.0.0-rc.6",
|
55
55
|
"chromedriver": "^125.0.0"
|
56
56
|
},
|
57
|
-
"gitHead": "
|
57
|
+
"gitHead": "19380fe3b367d021be5caf60e531ff50be91feef"
|
58
58
|
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div class="ai-prompt-input-wrapper">
|
2
|
+
{{#if label}}
|
3
|
+
<ui5-label for="input">{{label}}</ui5-label>
|
4
|
+
{{/if}}
|
5
|
+
|
6
|
+
<div class="ai-prompt-input-form-wrapper">
|
7
|
+
<div class="ai-prompt-inner-input-wrapper">
|
8
|
+
<ui5-input
|
9
|
+
id="input"
|
10
|
+
.value="{{value}}"
|
11
|
+
placeholder="{{placeholder}}"
|
12
|
+
value-state="{{valueState}}"
|
13
|
+
?show-clear-icon={{showClearIcon}}
|
14
|
+
?disabled="{{disabled}}"
|
15
|
+
?readonly="{{readonly}}"
|
16
|
+
@keydown="{{_onkeydown}}"
|
17
|
+
@ui5-input="{{_onInnerInput}}"
|
18
|
+
@ui5-change="{{_onInnerChange}}"
|
19
|
+
>
|
20
|
+
{{#if valueStateMessage.length}}
|
21
|
+
<slot name="valueStateMessage" slot="valueStateMessage"></slot>
|
22
|
+
{{/if}}
|
23
|
+
</ui5-input>
|
24
|
+
|
25
|
+
{{#if showExceededText}}
|
26
|
+
<ui5-label class="ai-prompt-input-counter">{{_exceededText}}</ui5-label>
|
27
|
+
{{/if}}
|
28
|
+
</div>
|
29
|
+
<ui5-button ?disabled={{_submitButtonDisabled}} class="ai-prompt-input-button" design="Emphasized" icon="paper-plane" @click="{{_onButtonClick}}"></ui5-button>
|
30
|
+
</div>
|
31
|
+
</div>
|
@@ -1,2 +1,8 @@
|
|
1
1
|
#This is the resource bundle for the UI5 Web Components
|
2
2
|
#__ldi.translation.uuid=96bea51a-d5e3-46f0-b1d1-514d97be02ec
|
3
|
+
|
4
|
+
#XTXT: Text for characters left
|
5
|
+
PROMPT_INPUT_CHARACTERS_LEFT={0} characters remaining
|
6
|
+
|
7
|
+
#XTXT: Text for characters over
|
8
|
+
PROMPT_INPUT_CHARACTERS_EXCEEDED={0} characters over limit
|
@@ -0,0 +1,30 @@
|
|
1
|
+
.ai-prompt-input-button {
|
2
|
+
margin-left: .5rem;
|
3
|
+
margin-top: 3px;
|
4
|
+
}
|
5
|
+
|
6
|
+
.ai-prompt-input-wrapper {
|
7
|
+
display: flex;
|
8
|
+
flex-direction: column;
|
9
|
+
width: 270px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.ai-prompt-input-form-wrapper {
|
13
|
+
display: flex;
|
14
|
+
flex: 1;
|
15
|
+
}
|
16
|
+
|
17
|
+
.ai-prompt-input-counter {
|
18
|
+
font-size: .75rem;
|
19
|
+
align-self: flex-end;
|
20
|
+
}
|
21
|
+
|
22
|
+
#input {
|
23
|
+
width: 100%;
|
24
|
+
}
|
25
|
+
|
26
|
+
.ai-prompt-inner-input-wrapper {
|
27
|
+
display: flex;
|
28
|
+
flex-direction: column;
|
29
|
+
flex: 1;
|
30
|
+
}
|