@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
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,25 @@
|
|
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
|
+
|
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)
|
18
|
+
|
19
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
6
25
|
# [2.0.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0-rc.3...v2.0.0-rc.4) (2024-05-29)
|
7
26
|
|
8
27
|
**Note:** Version bump only for package @ui5/webcomponents-ai
|
package/LICENSE.txt
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2020-21 SAP SE or an SAP affiliate company and OpenUI5 contributors
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
package/dist/Button.d.ts
CHANGED
@@ -1,10 +1,41 @@
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
2
|
/**
|
3
3
|
* @class
|
4
|
+
*
|
5
|
+
* ### Overview
|
6
|
+
*
|
7
|
+
* The `ui5-ai-button` component represents a button used in AI-related scenarios.
|
8
|
+
* It enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing
|
9
|
+
* certain keyboard keys, such as Enter.
|
10
|
+
*
|
11
|
+
* ### Usage
|
12
|
+
*
|
13
|
+
* For 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.
|
14
|
+
* Each 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.
|
15
|
+
*
|
16
|
+
* You can choose from a set of predefined designs that offer different styling to correspond to the triggered action.
|
17
|
+
*
|
18
|
+
* You 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).
|
19
|
+
* the mouse cursor. A disabled `ui5-ai-button` appears inactive and cannot be pressed.
|
20
|
+
*
|
21
|
+
* ### ES6 Module Import
|
22
|
+
*
|
23
|
+
* `import "@ui5/webcomponents-ai/dist/Button.js";`
|
24
|
+
*
|
4
25
|
* @constructor
|
5
26
|
* @extends UI5Element
|
27
|
+
* @since 2.0
|
28
|
+
* @public
|
6
29
|
*/
|
7
30
|
declare class Button extends UI5Element {
|
31
|
+
/**
|
32
|
+
* Defines whether the component is disabled.
|
33
|
+
* A disabled component can't be pressed or
|
34
|
+
* focused, and it is not in the tab chain.
|
35
|
+
* @default false
|
36
|
+
* @public
|
37
|
+
*/
|
38
|
+
disabled: boolean;
|
8
39
|
icon: string;
|
9
40
|
endIcon: string;
|
10
41
|
}
|
package/dist/Button.js
CHANGED
@@ -16,11 +16,37 @@ import template from "./generated/templates/ButtonTemplate.lit.js";
|
|
16
16
|
import styles from "./generated/themes/Button.css.js";
|
17
17
|
/**
|
18
18
|
* @class
|
19
|
+
*
|
20
|
+
* ### Overview
|
21
|
+
*
|
22
|
+
* The `ui5-ai-button` component represents a button used in AI-related scenarios.
|
23
|
+
* It enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing
|
24
|
+
* certain keyboard keys, such as Enter.
|
25
|
+
*
|
26
|
+
* ### Usage
|
27
|
+
*
|
28
|
+
* For 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.
|
29
|
+
* Each 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.
|
30
|
+
*
|
31
|
+
* You can choose from a set of predefined designs that offer different styling to correspond to the triggered action.
|
32
|
+
*
|
33
|
+
* You 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).
|
34
|
+
* the mouse cursor. A disabled `ui5-ai-button` appears inactive and cannot be pressed.
|
35
|
+
*
|
36
|
+
* ### ES6 Module Import
|
37
|
+
*
|
38
|
+
* `import "@ui5/webcomponents-ai/dist/Button.js";`
|
39
|
+
*
|
19
40
|
* @constructor
|
20
41
|
* @extends UI5Element
|
42
|
+
* @since 2.0
|
43
|
+
* @public
|
21
44
|
*/
|
22
45
|
let Button = class Button extends UI5Element {
|
23
46
|
};
|
47
|
+
__decorate([
|
48
|
+
property({ type: Boolean })
|
49
|
+
], Button.prototype, "disabled", void 0);
|
24
50
|
__decorate([
|
25
51
|
property()
|
26
52
|
], Button.prototype, "icon", void 0);
|
package/dist/Button.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAE7E,OAAO;AACP,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAE3D,WAAW;AACX,OAAO,QAAQ,MAAM,6CAA6C,CAAC;AAEnE,SAAS;AACT,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAEtD
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAE7E,OAAO;AACP,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAE3D,WAAW;AACX,OAAO,QAAQ,MAAM,6CAA6C,CAAC;AAEnE,SAAS;AACT,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAQH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;CAgB9B,CAAA;AAPA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACT;AAGnB;IADC,QAAQ,EAAE;oCACG;AAGd;IADC,QAAQ,EAAE;uCACM;AAfZ,MAAM;IAPX,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,QAAQ,EAAE,SAAS;QACnB,QAAQ;QACR,MAAM;QACN,YAAY,EAAE,CAAC,UAAU,CAAC;KAC1B,CAAC;GACI,MAAM,CAgBX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","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 litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\n\n// Deps\nimport MainButton from \"@ui5/webcomponents/dist/Button.js\";\n\n// Template\nimport template from \"./generated/templates/ButtonTemplate.lit.js\";\n\n// Styles\nimport styles from \"./generated/themes/Button.css.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-button` component represents a button used in AI-related scenarios.\n * It enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing\n * certain keyboard keys, such as Enter.\n *\n * ### Usage\n *\n * For 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.\n * Each 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 *\n * You can choose from a set of predefined designs that offer different styling to correspond to the triggered action.\n *\n * You 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).\n * the 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 * @constructor\n * @extends UI5Element\n * @since 2.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-ai-button\",\n\trenderer: litRender,\n\ttemplate,\n\tstyles,\n\tdependencies: [MainButton],\n})\nclass Button extends UI5Element {\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled!: boolean;\n\n\t@property()\n\ticon!: string;\n\n\t@property()\n\tendIcon!: string;\n}\n\nButton.define();\n\nexport default Button;\n"]}
|
@@ -0,0 +1,125 @@
|
|
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";
|
6
|
+
/**
|
7
|
+
* @class
|
8
|
+
* ### Overview
|
9
|
+
*
|
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
|
13
|
+
*
|
14
|
+
* ### ES6 Module Import
|
15
|
+
*
|
16
|
+
* `import "@ui5/webcomponents-ai/dist/PromptInput.js
|
17
|
+
* @class
|
18
|
+
* @constructor
|
19
|
+
* @public
|
20
|
+
* @extends UI5Element
|
21
|
+
*/
|
22
|
+
declare class PromptInput extends UI5Element {
|
23
|
+
/**
|
24
|
+
* Defines the value of the component.
|
25
|
+
*
|
26
|
+
* @default ""
|
27
|
+
* @since 2.0.0
|
28
|
+
* @public
|
29
|
+
*/
|
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;
|
124
|
+
}
|
125
|
+
export default PromptInput;
|
@@ -0,0 +1,159 @@
|
|
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
|
+
var PromptInput_1;
|
8
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
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";
|
13
|
+
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
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";
|
18
|
+
import Input from "@ui5/webcomponents/dist/Input.js";
|
19
|
+
import Label from "@ui5/webcomponents/dist/Label.js";
|
20
|
+
import Button from "@ui5/webcomponents/dist/Button.js";
|
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";
|
26
|
+
/**
|
27
|
+
* @class
|
28
|
+
* ### Overview
|
29
|
+
*
|
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
|
33
|
+
*
|
34
|
+
* ### ES6 Module Import
|
35
|
+
*
|
36
|
+
* `import "@ui5/webcomponents-ai/dist/PromptInput.js
|
37
|
+
* @class
|
38
|
+
* @constructor
|
39
|
+
* @public
|
40
|
+
* @extends UI5Element
|
41
|
+
*/
|
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
|
+
}
|
83
|
+
};
|
84
|
+
__decorate([
|
85
|
+
property()
|
86
|
+
], PromptInput.prototype, "value", void 0);
|
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([
|
118
|
+
customElement({
|
119
|
+
tag: "ui5-ai-prompt-input",
|
120
|
+
renderer: litRender,
|
121
|
+
styles: PromptInputCss,
|
122
|
+
template: PromptInputTemplate,
|
123
|
+
dependencies: [
|
124
|
+
Input,
|
125
|
+
Label,
|
126
|
+
Button,
|
127
|
+
],
|
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")
|
156
|
+
], PromptInput);
|
157
|
+
PromptInput.define();
|
158
|
+
export default PromptInput;
|
159
|
+
//# sourceMappingURL=PromptInput.js.map
|
@@ -0,0 +1 @@
|
|
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"]}
|
package/dist/bundle.esm.js
CHANGED
package/dist/bundle.esm.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bundle.esm.js","sourceRoot":"","sources":["../src/bundle.esm.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,UAAU,MAAM,uCAAuC,CAAC;AAE/D,YAAY;AACZ,OAAO,aAAa,CAAC;AAErB,OAAmB,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"bundle.esm.js","sourceRoot":"","sources":["../src/bundle.esm.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,UAAU,MAAM,uCAAuC,CAAC;AAE/D,YAAY;AACZ,OAAO,aAAa,CAAC;AAErB,OAAmB,aAAa,CAAC;AACjC,OAAwB,kBAAkB,CAAC;AAE3C,eAAe,UAAU,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport testAssets from \"@ui5/webcomponents/dist/bundle.esm.js\";\n\n// AI assets\nimport \"./Assets.js\";\n\nimport Button from \"./Button.js\";\nimport PromptInput from \"./PromptInput.js\";\n\nexport default testAssets;\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}
|