@ui5/webcomponents-ai 2.0.0-rc.4 → 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 +19 -0
- package/LICENSE.txt +201 -0
- package/dist/Button.d.ts +31 -0
- package/dist/Button.js +26 -0
- package/dist/Button.js.map +1 -1
- package/dist/PromptInput.d.ts +125 -0
- package/dist/PromptInput.js +159 -0
- package/dist/PromptInput.js.map +1 -0
- package/dist/bundle.esm.js +1 -0
- package/dist/bundle.esm.js.map +1 -1
- package/dist/css/themes/PromptInput.css +1 -0
- package/dist/custom-elements-internal.json +292 -5
- package/dist/custom-elements.json +260 -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 +66 -2
- package/dist/web-types.json +160 -5
- package/package.json +8 -7
- package/src/PromptInput.hbs +31 -0
- package/src/i18n/messagebundle.properties +6 -0
- package/src/themes/PromptInput.css +30 -0
- package/dist/PromtInput.d.ts +0 -10
- package/dist/PromtInput.js +0 -34
- package/dist/PromtInput.js.map +0 -1
@@ -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"]}
|
@@ -1,10 +1,74 @@
|
|
1
1
|
{
|
2
2
|
"version": 1.1,
|
3
3
|
"tags": [
|
4
|
+
{
|
5
|
+
"name": "ui5-ai-button",
|
6
|
+
"description": "### Overview\n\nThe `ui5-ai-button` component represents a button used in AI-related scenarios.\nIt enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing\ncertain keyboard keys, such as Enter.\n\n### Usage\n\nFor the `ui5-ai-button` UI, you can define one or more states of the button by placing `ai-button-state` components in its default slot.\nEach state have a key that identifies it and can have text, icon, end icon, next state and hasPopup type defined (in any combination) depending on the state purpose.\n\nYou can choose from a set of predefined designs that offer different styling to correspond to the triggered action.\n\nYou can set the `ui5-ai-button` as enabled or disabled. An enabled `ui5-ai-button` can be pressed by clicking or tapping it. On press `ui5-ai-button` changes its state to the next one (if defined).\nthe mouse cursor. A disabled `ui5-ai-button` appears inactive and cannot be pressed.\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/Button.js\";`\n\n\n---\n\n\n",
|
7
|
+
"attributes": [
|
8
|
+
{
|
9
|
+
"name": "disabled",
|
10
|
+
"description": "Defines whether the component is disabled.\nA disabled component can't be pressed or\nfocused, and it is not in the tab chain.",
|
11
|
+
"values": []
|
12
|
+
}
|
13
|
+
],
|
14
|
+
"references": []
|
15
|
+
},
|
4
16
|
{
|
5
17
|
"name": "ui5-ai-prompt-input",
|
6
|
-
"description": "\n\n\n---\n\n\n",
|
7
|
-
"attributes": [
|
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
|
+
"attributes": [
|
20
|
+
{
|
21
|
+
"name": "value",
|
22
|
+
"description": "Defines the value of the component.",
|
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
|
+
]
|
70
|
+
}
|
71
|
+
],
|
8
72
|
"references": []
|
9
73
|
}
|
10
74
|
]
|
package/dist/web-types.json
CHANGED
@@ -1,18 +1,173 @@
|
|
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": {
|
8
8
|
"elements": [
|
9
9
|
{
|
10
|
-
"name": "ui5-ai-
|
11
|
-
"description": "\n---\n",
|
10
|
+
"name": "ui5-ai-button",
|
11
|
+
"description": "### Overview\n\nThe `ui5-ai-button` component represents a button used in AI-related scenarios.\nIt enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing\ncertain keyboard keys, such as Enter.\n\n### Usage\n\nFor the `ui5-ai-button` UI, you can define one or more states of the button by placing `ai-button-state` components in its default slot.\nEach state have a key that identifies it and can have text, icon, end icon, next state and hasPopup type defined (in any combination) depending on the state purpose.\n\nYou can choose from a set of predefined designs that offer different styling to correspond to the triggered action.\n\nYou can set the `ui5-ai-button` as enabled or disabled. An enabled `ui5-ai-button` can be pressed by clicking or tapping it. On press `ui5-ai-button` changes its state to the next one (if defined).\nthe mouse cursor. A disabled `ui5-ai-button` appears inactive and cannot be pressed.\n\n### ES6 Module Import\n\n`import \"@ui5/webcomponents-ai/dist/Button.js\";`\n---\n",
|
12
12
|
"doc-url": "",
|
13
|
-
"attributes": [
|
13
|
+
"attributes": [
|
14
|
+
{
|
15
|
+
"name": "disabled",
|
16
|
+
"description": "Defines whether the component is disabled.\nA disabled component can't be pressed or\nfocused, and it is not in the tab chain.",
|
17
|
+
"value": { "type": "boolean", "default": "false" }
|
18
|
+
}
|
19
|
+
],
|
14
20
|
"events": [],
|
15
|
-
"js": {
|
21
|
+
"js": {
|
22
|
+
"properties": [
|
23
|
+
{
|
24
|
+
"name": "disabled",
|
25
|
+
"description": "Defines whether the component is disabled.\nA disabled component can't be pressed or\nfocused, and it is not in the tab chain.",
|
26
|
+
"value": { "type": "boolean" }
|
27
|
+
}
|
28
|
+
],
|
29
|
+
"events": []
|
30
|
+
}
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "ui5-ai-prompt-input",
|
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
|
+
"doc-url": "",
|
36
|
+
"attributes": [
|
37
|
+
{
|
38
|
+
"name": "value",
|
39
|
+
"description": "Defines the value of the component.",
|
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."
|
104
|
+
}
|
105
|
+
],
|
106
|
+
"js": {
|
107
|
+
"properties": [
|
108
|
+
{
|
109
|
+
"name": "value",
|
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.",
|
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
|
+
}
|
154
|
+
}
|
155
|
+
],
|
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
|
+
]
|
170
|
+
}
|
16
171
|
}
|
17
172
|
]
|
18
173
|
},
|
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,13 +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": "19380fe3b367d021be5caf60e531ff50be91feef"
|
57
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
|
+
}
|
package/dist/PromtInput.d.ts
DELETED
package/dist/PromtInput.js
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
8
|
-
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
9
|
-
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
10
|
-
import Label from "@ui5/webcomponents/dist/Label.js";
|
11
|
-
import Input from "@ui5/webcomponents/dist/Input.js";
|
12
|
-
import Button from "@ui5/webcomponents/dist/Button.js";
|
13
|
-
/**
|
14
|
-
* @class
|
15
|
-
* @constructor
|
16
|
-
* @public
|
17
|
-
* @extends UI5Element
|
18
|
-
*/
|
19
|
-
let PromptInput = class PromptInput extends UI5Element {
|
20
|
-
};
|
21
|
-
PromptInput = __decorate([
|
22
|
-
customElement({
|
23
|
-
tag: "ui5-ai-prompt-input",
|
24
|
-
renderer: litRender,
|
25
|
-
dependencies: [
|
26
|
-
Input,
|
27
|
-
Label,
|
28
|
-
Button,
|
29
|
-
],
|
30
|
-
})
|
31
|
-
], PromptInput);
|
32
|
-
PromptInput.define();
|
33
|
-
export default PromptInput;
|
34
|
-
//# sourceMappingURL=PromtInput.js.map
|
package/dist/PromtInput.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"PromtInput.js","sourceRoot":"","sources":["../src/PromtInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAE7E,OAAO,KAAK,MAAM,kCAAkC,CAAC;AACrD,OAAO,KAAK,MAAM,kCAAkC,CAAC;AACrD,OAAO,MAAM,MAAM,mCAAmC,CAAC;AAEvD;;;;;GAKG;AAUH,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;CACnC,CAAA;AADK,WAAW;IAThB,aAAa,CAAC;QACd,GAAG,EAAE,qBAAqB;QAC1B,QAAQ,EAAE,SAAS;QACnB,YAAY,EAAE;YACb,KAAK;YACL,KAAK;YACL,MAAM;SACN;KACD,CAAC;GACI,WAAW,CAChB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\n\nimport Label from \"@ui5/webcomponents/dist/Label.js\";\nimport Input from \"@ui5/webcomponents/dist/Input.js\";\nimport Button from \"@ui5/webcomponents/dist/Button.js\";\n\n/**\n * @class\n * @constructor\n * @public\n * @extends UI5Element\n */\n@customElement({\n\ttag: \"ui5-ai-prompt-input\",\n\trenderer: litRender,\n\tdependencies: [\n\t\tInput,\n\t\tLabel,\n\t\tButton,\n\t],\n})\nclass PromptInput extends UI5Element {\n}\n\nPromptInput.define();\n\nexport default PromptInput;"]}
|