@ui5/webcomponents-ai 0.0.0-c42896b6b → 0.0.0-ccb0705ac

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.
Files changed (231) hide show
  1. package/.ui5-cem-aliases.json +4 -0
  2. package/CHANGELOG.md +316 -1
  3. package/LICENSE.txt +201 -0
  4. package/README.md +11 -10
  5. package/dist/.tsbuildinfo +1 -1
  6. package/dist/Assets-fetch.js +1 -1
  7. package/dist/Assets-fetch.js.map +1 -1
  8. package/dist/Assets-node.js +1 -1
  9. package/dist/Assets-node.js.map +1 -1
  10. package/dist/Button.d.ts +9 -4
  11. package/dist/Button.js +11 -6
  12. package/dist/Button.js.map +1 -1
  13. package/dist/ButtonState.d.ts +2 -1
  14. package/dist/ButtonState.js +2 -1
  15. package/dist/ButtonState.js.map +1 -1
  16. package/dist/Input.d.ts +146 -0
  17. package/dist/Input.js +291 -0
  18. package/dist/Input.js.map +1 -0
  19. package/dist/InputTemplate.d.ts +10 -0
  20. package/dist/InputTemplate.js +28 -0
  21. package/dist/InputTemplate.js.map +1 -0
  22. package/dist/PromptInput.d.ts +4 -2
  23. package/dist/PromptInput.js +2 -1
  24. package/dist/PromptInput.js.map +1 -1
  25. package/dist/TextArea.d.ts +125 -0
  26. package/dist/TextArea.js +272 -0
  27. package/dist/TextArea.js.map +1 -0
  28. package/dist/TextAreaTemplate.d.ts +2 -0
  29. package/dist/TextAreaTemplate.js +13 -0
  30. package/dist/TextAreaTemplate.js.map +1 -0
  31. package/dist/ToolbarLabel.d.ts +39 -0
  32. package/dist/ToolbarLabel.js +67 -0
  33. package/dist/ToolbarLabel.js.map +1 -0
  34. package/dist/ToolbarLabelTemplate.d.ts +2 -0
  35. package/dist/ToolbarLabelTemplate.js +5 -0
  36. package/dist/ToolbarLabelTemplate.js.map +1 -0
  37. package/dist/Versioning.d.ts +95 -0
  38. package/dist/Versioning.js +187 -0
  39. package/dist/Versioning.js.map +1 -0
  40. package/dist/VersioningTemplate.d.ts +4 -0
  41. package/dist/VersioningTemplate.js +9 -0
  42. package/dist/VersioningTemplate.js.map +1 -0
  43. package/dist/WritingAssistant.d.ts +101 -0
  44. package/dist/WritingAssistant.js +201 -0
  45. package/dist/WritingAssistant.js.map +1 -0
  46. package/dist/WritingAssistantTemplate.d.ts +2 -0
  47. package/dist/WritingAssistantTemplate.js +12 -0
  48. package/dist/WritingAssistantTemplate.js.map +1 -0
  49. package/dist/bundle.esm.js +2 -0
  50. package/dist/bundle.esm.js.map +1 -1
  51. package/dist/css/themes/Button.css +1 -1
  52. package/dist/css/themes/Input.css +1 -0
  53. package/dist/css/themes/PromptInput.css +1 -1
  54. package/dist/css/themes/TextArea.css +1 -0
  55. package/dist/css/themes/Versioning.css +1 -0
  56. package/dist/css/themes/WritingAssistant.css +1 -0
  57. package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -0
  58. package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -0
  59. package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -0
  60. package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -0
  61. package/dist/custom-elements-internal.json +421 -8
  62. package/dist/custom-elements.json +339 -2
  63. package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
  64. package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
  65. package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
  66. package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -1
  67. package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
  68. package/dist/generated/assets/i18n/messagebundle_cy.json +1 -1
  69. package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
  70. package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
  71. package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
  72. package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
  73. package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -1
  74. package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
  75. package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
  76. package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
  77. package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
  78. package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -1
  79. package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
  80. package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
  81. package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
  82. package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -1
  83. package/dist/generated/assets/i18n/messagebundle_hi.json +1 -1
  84. package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
  85. package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
  86. package/dist/generated/assets/i18n/messagebundle_id.json +1 -1
  87. package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
  88. package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
  89. package/dist/generated/assets/i18n/messagebundle_ja.json +1 -1
  90. package/dist/generated/assets/i18n/messagebundle_kk.json +1 -1
  91. package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
  92. package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
  93. package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
  94. package/dist/generated/assets/i18n/messagebundle_mk.json +1 -1
  95. package/dist/generated/assets/i18n/messagebundle_ms.json +1 -1
  96. package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
  97. package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
  98. package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
  99. package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
  100. package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -1
  101. package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
  102. package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
  103. package/dist/generated/assets/i18n/messagebundle_sh.json +1 -1
  104. package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
  105. package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
  106. package/dist/generated/assets/i18n/messagebundle_sr.json +1 -1
  107. package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
  108. package/dist/generated/assets/i18n/messagebundle_th.json +1 -1
  109. package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
  110. package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
  111. package/dist/generated/assets/i18n/messagebundle_vi.json +1 -1
  112. package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
  113. package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -1
  114. package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
  115. package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
  116. package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
  117. package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
  118. package/dist/generated/i18n/i18n-defaults.d.ts +14 -1
  119. package/dist/generated/i18n/i18n-defaults.js +14 -1
  120. package/dist/generated/i18n/i18n-defaults.js.map +1 -1
  121. package/dist/generated/json-imports/Themes-fetch.js +1 -1
  122. package/dist/generated/json-imports/Themes-fetch.js.map +1 -1
  123. package/dist/generated/json-imports/Themes-node.js +1 -1
  124. package/dist/generated/json-imports/Themes-node.js.map +1 -1
  125. package/dist/generated/json-imports/Themes.js +1 -1
  126. package/dist/generated/json-imports/Themes.js.map +1 -1
  127. package/dist/generated/json-imports/i18n-fetch.js +1 -1
  128. package/dist/generated/json-imports/i18n-fetch.js.map +1 -1
  129. package/dist/generated/json-imports/i18n-node.js +1 -1
  130. package/dist/generated/json-imports/i18n-node.js.map +1 -1
  131. package/dist/generated/json-imports/i18n.js +1 -1
  132. package/dist/generated/json-imports/i18n.js.map +1 -1
  133. package/dist/generated/themes/Button.css.d.ts +1 -1
  134. package/dist/generated/themes/Button.css.js +3 -3
  135. package/dist/generated/themes/Button.css.js.map +1 -1
  136. package/dist/generated/themes/Input.css.d.ts +2 -0
  137. package/dist/generated/themes/Input.css.js +8 -0
  138. package/dist/generated/themes/Input.css.js.map +1 -0
  139. package/dist/generated/themes/PromptInput.css.d.ts +1 -1
  140. package/dist/generated/themes/PromptInput.css.js +3 -3
  141. package/dist/generated/themes/PromptInput.css.js.map +1 -1
  142. package/dist/generated/themes/TextArea.css.d.ts +2 -0
  143. package/dist/generated/themes/TextArea.css.js +8 -0
  144. package/dist/generated/themes/TextArea.css.js.map +1 -0
  145. package/dist/generated/themes/Versioning.css.d.ts +2 -0
  146. package/dist/generated/themes/Versioning.css.js +8 -0
  147. package/dist/generated/themes/Versioning.css.js.map +1 -0
  148. package/dist/generated/themes/WritingAssistant.css.d.ts +2 -0
  149. package/dist/generated/themes/WritingAssistant.css.js +8 -0
  150. package/dist/generated/themes/WritingAssistant.css.js.map +1 -0
  151. package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +1 -1
  152. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
  153. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
  154. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +1 -1
  155. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
  156. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
  157. package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.d.ts +1 -1
  158. package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -1
  159. package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
  160. package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +1 -1
  161. package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -1
  162. package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
  163. package/dist/vscode.html-custom-data.json +50 -1
  164. package/dist/web-types.json +163 -3
  165. package/package-scripts.cjs +1 -1
  166. package/package.json +22 -21
  167. package/src/InputTemplate.tsx +197 -0
  168. package/src/TextArea.css +25 -0
  169. package/src/TextAreaTemplate.tsx +91 -0
  170. package/src/ToolbarLabelTemplate.tsx +9 -0
  171. package/src/VersioningTemplate.tsx +34 -0
  172. package/src/WritingAssistantTemplate.tsx +51 -0
  173. package/src/i18n/messagebundle.properties +38 -0
  174. package/src/i18n/messagebundle_ar.properties +28 -0
  175. package/src/i18n/messagebundle_bg.properties +28 -0
  176. package/src/i18n/messagebundle_ca.properties +28 -0
  177. package/src/i18n/messagebundle_cnr.properties +28 -0
  178. package/src/i18n/messagebundle_cs.properties +28 -0
  179. package/src/i18n/messagebundle_cy.properties +28 -0
  180. package/src/i18n/messagebundle_da.properties +28 -0
  181. package/src/i18n/messagebundle_de.properties +28 -0
  182. package/src/i18n/messagebundle_el.properties +28 -0
  183. package/src/i18n/messagebundle_en.properties +26 -5
  184. package/src/i18n/messagebundle_en_GB.properties +28 -0
  185. package/src/i18n/messagebundle_en_US_sappsd.properties +28 -0
  186. package/src/i18n/messagebundle_en_US_saprigi.properties +25 -0
  187. package/src/i18n/messagebundle_en_US_saptrc.properties +28 -0
  188. package/src/i18n/messagebundle_es.properties +28 -0
  189. package/src/i18n/messagebundle_es_MX.properties +29 -1
  190. package/src/i18n/messagebundle_et.properties +28 -0
  191. package/src/i18n/messagebundle_fi.properties +28 -0
  192. package/src/i18n/messagebundle_fr.properties +28 -0
  193. package/src/i18n/messagebundle_fr_CA.properties +28 -0
  194. package/src/i18n/messagebundle_hi.properties +28 -0
  195. package/src/i18n/messagebundle_hr.properties +30 -2
  196. package/src/i18n/messagebundle_hu.properties +28 -0
  197. package/src/i18n/messagebundle_id.properties +28 -0
  198. package/src/i18n/messagebundle_it.properties +28 -0
  199. package/src/i18n/messagebundle_iw.properties +28 -0
  200. package/src/i18n/messagebundle_ja.properties +28 -0
  201. package/src/i18n/messagebundle_kk.properties +28 -0
  202. package/src/i18n/messagebundle_ko.properties +28 -0
  203. package/src/i18n/messagebundle_lt.properties +28 -0
  204. package/src/i18n/messagebundle_lv.properties +28 -0
  205. package/src/i18n/messagebundle_mk.properties +28 -0
  206. package/src/i18n/messagebundle_ms.properties +28 -0
  207. package/src/i18n/messagebundle_nl.properties +28 -0
  208. package/src/i18n/messagebundle_no.properties +28 -0
  209. package/src/i18n/messagebundle_pl.properties +28 -0
  210. package/src/i18n/messagebundle_pt.properties +28 -0
  211. package/src/i18n/messagebundle_pt_PT.properties +28 -0
  212. package/src/i18n/messagebundle_ro.properties +28 -0
  213. package/src/i18n/messagebundle_ru.properties +28 -0
  214. package/src/i18n/messagebundle_sh.properties +28 -0
  215. package/src/i18n/messagebundle_sk.properties +28 -0
  216. package/src/i18n/messagebundle_sl.properties +28 -0
  217. package/src/i18n/messagebundle_sr.properties +28 -0
  218. package/src/i18n/messagebundle_sv.properties +28 -0
  219. package/src/i18n/messagebundle_th.properties +30 -2
  220. package/src/i18n/messagebundle_tr.properties +28 -0
  221. package/src/i18n/messagebundle_uk.properties +28 -0
  222. package/src/i18n/messagebundle_vi.properties +28 -0
  223. package/src/i18n/messagebundle_zh_CN.properties +28 -0
  224. package/src/i18n/messagebundle_zh_TW.properties +28 -0
  225. package/src/themes/Input.css +83 -0
  226. package/src/themes/PromptInput.css +5 -1
  227. package/src/themes/TextArea.css +45 -0
  228. package/src/themes/Versioning.css +20 -0
  229. package/src/themes/WritingAssistant.css +23 -0
  230. package/src/themes/base/Button-parameters.css +1 -1
  231. package/tsconfig.json +6 -0
@@ -1,6 +1,6 @@
1
1
  // main package assets (transitively base, theming and icons)
2
2
  import "@ui5/webcomponents/dist/Assets-fetch.js";
3
- // own fiori package assets
3
+ // own ai package assets
4
4
  import "./generated/json-imports/Themes-fetch.js";
5
5
  import "./generated/json-imports/i18n-fetch.js";
6
6
  //# sourceMappingURL=Assets-fetch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Assets-fetch.js","sourceRoot":"","sources":["../src/Assets-fetch.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,yCAAyC,CAAC;AAEjD,2BAA2B;AAC3B,OAAO,0CAA0C,CAAC;AAClD,OAAO,wCAAwC,CAAC","sourcesContent":["// main package assets (transitively base, theming and icons)\nimport \"@ui5/webcomponents/dist/Assets-fetch.js\";\n\n// own fiori package assets\nimport \"./generated/json-imports/Themes-fetch.js\";\nimport \"./generated/json-imports/i18n-fetch.js\";\n"]}
1
+ {"version":3,"file":"Assets-fetch.js","sourceRoot":"","sources":["../src/Assets-fetch.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,yCAAyC,CAAC;AAEjD,wBAAwB;AACxB,OAAO,0CAA0C,CAAC;AAClD,OAAO,wCAAwC,CAAC","sourcesContent":["// main package assets (transitively base, theming and icons)\nimport \"@ui5/webcomponents/dist/Assets-fetch.js\";\n\n// own ai package assets\nimport \"./generated/json-imports/Themes-fetch.js\";\nimport \"./generated/json-imports/i18n-fetch.js\";\n"]}
@@ -11,7 +11,7 @@
11
11
  */
12
12
  // main package assets (transitively base, theming and icons)
13
13
  import "@ui5/webcomponents/dist/Assets-node.js";
14
- // own fiori package assets
14
+ // own ai package assets
15
15
  import "./generated/json-imports/Themes-node.js";
16
16
  import "./generated/json-imports/i18n-node.js";
17
17
  //# sourceMappingURL=Assets-node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Assets-node.js","sourceRoot":"","sources":["../src/Assets-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,6DAA6D;AAC7D,OAAO,wCAAwC,CAAC;AAEhD,2BAA2B;AAC3B,OAAO,yCAAyC,CAAC;AACjD,OAAO,uCAAuC,CAAC","sourcesContent":["/**\n * The `Assets-node` entry point is used to import all CLDR, theming, and i18n assets.\n *\n * It serves as an alternative to the `Assets` and `Assets-fetch` modules and supports the\n * `with: { type: 'json' }` import attribute for loading JSON files.\n *\n * This import attribute is required in some environments, such as Node.js with server-side rendering (SSR).\n *\n * Example usage:\n * await import(\"../assets/i18n/messagebundle_bg.json\", { with: { type: 'json' } })\n */\n\n// main package assets (transitively base, theming and icons)\nimport \"@ui5/webcomponents/dist/Assets-node.js\";\n\n// own fiori package assets\nimport \"./generated/json-imports/Themes-node.js\";\nimport \"./generated/json-imports/i18n-node.js\";\n"]}
1
+ {"version":3,"file":"Assets-node.js","sourceRoot":"","sources":["../src/Assets-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,6DAA6D;AAC7D,OAAO,wCAAwC,CAAC;AAEhD,wBAAwB;AACxB,OAAO,yCAAyC,CAAC;AACjD,OAAO,uCAAuC,CAAC","sourcesContent":["/**\n * The `Assets-node` entry point is used to import all CLDR, theming, and i18n assets.\n *\n * It serves as an alternative to the `Assets` and `Assets-fetch` modules and supports the\n * `with: { type: 'json' }` import attribute for loading JSON files.\n *\n * This import attribute is required in some environments, such as Node.js with server-side rendering (SSR).\n *\n * Example usage:\n * await import(\"../assets/i18n/messagebundle_bg.json\", { with: { type: 'json' } })\n */\n\n// main package assets (transitively base, theming and icons)\nimport \"@ui5/webcomponents/dist/Assets-node.js\";\n\n// own ai package assets\nimport \"./generated/json-imports/Themes-node.js\";\nimport \"./generated/json-imports/i18n-node.js\";\n"]}
package/dist/Button.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
+ import type { DefaultSlot } from "@ui5/webcomponents-base/dist/UI5Element.js";
2
3
  import type SplitButton from "@ui5/webcomponents/dist/SplitButton.js";
3
4
  import type ButtonDesign from "@ui5/webcomponents/dist/types/ButtonDesign.js";
4
5
  import type ButtonState from "./ButtonState.js";
5
6
  import "./ButtonState.js";
6
7
  import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
7
8
  import type { AccessibilityAttributes } from "@ui5/webcomponents-base/dist/types.js";
8
- type AIButtonRootAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup" | "roleDescription" | "title">;
9
+ type AIButtonRootAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup" | "roleDescription" | "title" | "ariaKeyShortcuts">;
9
10
  type AIButtonArrowButtonAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup" | "expanded" | "title">;
10
11
  type AIButtonAccessibilityAttributes = {
11
12
  root?: AIButtonRootAccessibilityAttributes;
@@ -40,7 +41,8 @@ type AIButtonAccessibilityAttributes = {
40
41
  * @extends UI5Element
41
42
  * @since 2.0.0
42
43
  * @public
43
- * @experimental The Button and ButtonState web components are availabe since 2.0 under an experimental flag and their API and behaviour are subject to change.
44
+ * @experimental The **@ui5/webcomponents-ai** package (including Button and ButtonState) is under active development and considered experimental. Component APIs are subject to change.
45
+ * Furthermore, the package supports **Horizon** themes only.
44
46
  */
45
47
  declare class Button extends UI5Element {
46
48
  eventDetails: {
@@ -88,6 +90,9 @@ declare class Button extends UI5Element {
88
90
  * Accepts string values: `"dialog"`, `"grid"`, `"listbox"`, `"menu"`, or `"tree"`.
89
91
  * - **roleDescription**: Defines a human-readable description for the button's role.
90
92
  * Accepts any string value.
93
+ * - **title**: Specifies a tooltip or description for screen readers.
94
+ * Accepts any string value.
95
+ * - **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or focus the button.
91
96
  *
92
97
  * - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.
93
98
  * - **hasPopup**: Indicates the type of popup triggered by the arrow button.
@@ -118,10 +123,10 @@ declare class Button extends UI5Element {
118
123
  * you only use `ui5-ai-button-state` components in order to preserve the intended design.
119
124
  * @public
120
125
  */
121
- states: Array<ButtonState>;
126
+ states: DefaultSlot<ButtonState>;
122
127
  _splitButton?: SplitButton;
123
128
  _hiddenSplitButton?: SplitButton;
124
- static i18nBundle: I18nBundle;
129
+ static i18nBundleAi: I18nBundle;
125
130
  get _hideArrowButton(): boolean;
126
131
  get _effectiveState(): string;
127
132
  get _effectiveStateObject(): ButtonState | undefined;
package/dist/Button.js CHANGED
@@ -9,8 +9,9 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
9
9
  import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js";
10
10
  import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
11
11
  import property from "@ui5/webcomponents-base/dist/decorators/property.js";
12
+ import { i18n } from "@ui5/webcomponents-base/dist/decorators.js";
12
13
  import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
13
- import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
14
+ import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
14
15
  import query from "@ui5/webcomponents-base/dist/decorators/query.js";
15
16
  import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
16
17
  import { BUTTON_TOOLTIP_TEXT } from "./generated/i18n/i18n-defaults.js";
@@ -19,7 +20,6 @@ import ButtonTemplate from "./ButtonTemplate.js";
19
20
  import { getEffectiveAriaLabelText, getAssociatedLabelForTexts, getAllAccessibleNameRefTexts, } from "@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js";
20
21
  // Styles
21
22
  import ButtonCss from "./generated/themes/Button.css.js";
22
- import { i18n } from "@ui5/webcomponents-base/dist/decorators.js";
23
23
  /**
24
24
  * @class
25
25
  *
@@ -49,7 +49,8 @@ import { i18n } from "@ui5/webcomponents-base/dist/decorators.js";
49
49
  * @extends UI5Element
50
50
  * @since 2.0.0
51
51
  * @public
52
- * @experimental The Button and ButtonState web components are availabe since 2.0 under an experimental flag and their API and behaviour are subject to change.
52
+ * @experimental The **@ui5/webcomponents-ai** package (including Button and ButtonState) is under active development and considered experimental. Component APIs are subject to change.
53
+ * Furthermore, the package supports **Horizon** themes only.
53
54
  */
54
55
  let Button = Button_1 = class Button extends UI5Element {
55
56
  constructor() {
@@ -88,6 +89,9 @@ let Button = Button_1 = class Button extends UI5Element {
88
89
  * Accepts string values: `"dialog"`, `"grid"`, `"listbox"`, `"menu"`, or `"tree"`.
89
90
  * - **roleDescription**: Defines a human-readable description for the button's role.
90
91
  * Accepts any string value.
92
+ * - **title**: Specifies a tooltip or description for screen readers.
93
+ * Accepts any string value.
94
+ * - **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or focus the button.
91
95
  *
92
96
  * - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.
93
97
  * - **hasPopup**: Indicates the type of popup triggered by the arrow button.
@@ -237,13 +241,14 @@ let Button = Button_1 = class Button extends UI5Element {
237
241
  }
238
242
  get _computedAccessibilityAttributes() {
239
243
  const labelRefTexts = getAllAccessibleNameRefTexts(this) || getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || "";
240
- const mainTitle = this._hasText ? Button_1.i18nBundle.getText(BUTTON_TOOLTIP_TEXT, this._stateText) : "";
244
+ const mainTitle = this._hasText ? Button_1.i18nBundleAi.getText(BUTTON_TOOLTIP_TEXT, this._stateText) : "";
241
245
  const title = `${mainTitle} ${labelRefTexts}`.trim();
242
246
  return {
243
247
  root: {
244
248
  hasPopup: this.accessibilityAttributes?.root?.hasPopup || "false",
245
249
  roleDescription: this.accessibilityAttributes?.root?.roleDescription,
246
250
  title: this.accessibilityAttributes?.root?.title || title,
251
+ ariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,
247
252
  },
248
253
  arrowButton: {
249
254
  hasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup,
@@ -284,8 +289,8 @@ __decorate([
284
289
  query(".ui5-ai-button-hidden[ui5-split-button]")
285
290
  ], Button.prototype, "_hiddenSplitButton", void 0);
286
291
  __decorate([
287
- i18n("@ui5/webcomponents")
288
- ], Button, "i18nBundle", void 0);
292
+ i18n("@ui5/webcomponents-ai")
293
+ ], Button, "i18nBundleAi", void 0);
289
294
  Button = Button_1 = __decorate([
290
295
  customElement({
291
296
  tag: "ui5-ai-button",
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MA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AAE,IAAI;KACb,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,oBAAoB,EAAE;QAC5B,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,MAAM,CAqRX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.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-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport query from \"@ui5/webcomponents-base/dist/decorators/query.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type SplitButton from \"@ui5/webcomponents/dist/SplitButton.js\";\nimport type ButtonDesign from \"@ui5/webcomponents/dist/types/ButtonDesign.js\";\nimport type ButtonState from \"./ButtonState.js\";\nimport { BUTTON_TOOLTIP_TEXT } from \"./generated/i18n/i18n-defaults.js\";\nimport \"./ButtonState.js\";\nimport ButtonTemplate from \"./ButtonTemplate.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetAllAccessibleNameRefTexts,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\n\n// Styles\nimport ButtonCss from \"./generated/themes/Button.css.js\";\nimport { i18n } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\n\ntype AIButtonRootAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"roleDescription\" | \"title\">;\ntype AIButtonArrowButtonAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype AIButtonAccessibilityAttributes = { root?: AIButtonRootAccessibilityAttributes, arrowButton?: AIButtonArrowButtonAccessibilityAttributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\n * or by pressing keyboard keys like [Enter] or [Space].\n *\n * ### Usage\n *\n * For the `ui5-ai-button` user interface, you can define one or more button states by placing `ui5-ai-button-state` components in their default slot.\n * Each state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\n * You can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n *\n * You can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n *\n * The `ui5-ai-button` can be activated by clicking or tapping it. You can change the button state in the click event handler. When the button is\n * in split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\n * You can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\n * To display additional actions, you can attach a menu to the arrow button.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents-ai/dist/Button.js\";`\n *\n * @constructor\n * @extends UI5Element\n * @since 2.0.0\n * @public\n * @experimental The Button and ButtonState web components are availabe since 2.0 under an experimental flag and their API and behaviour are subject to change.\n */\n\n@customElement({\n\ttag: \"ui5-ai-button\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ButtonTemplate,\n\tstyles: ButtonCss,\n\tshadowRootOptions: { delegatesFocus: true },\n})\n\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the component is in split mode and after the arrow button\n * is activated either by clicking or tapping it or by using the [Arrow Up] / [Arrow Down],\n * [Alt] + [Arrow Up]/ [Arrow Down], or [F4] keyboard keys.\n * @public\n */\n@event(\"arrow-button-click\", {\n\tbubbles: true,\n})\n\nclass Button extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": void;\n\t\t\"arrow-button-click\": void;\n\t}\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign?: `${ButtonDesign}` = \"Default\"\n\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 = false;\n\n\t/**\n\t * Defines the current state of the component.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tstate?: string;\n\n\t/**\n\t * Defines the active state of the arrow button in split mode.\n\t * Set to true when the button is in split mode and a menu with additional options\n\t * is opened by the arrow button. Set back to false when the menu is closed.\n\t * @default false\n\t * @public\n\t * @since 2.6.0\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tarrowButtonPressed = false;\n\n\t/**\n \t * Defines the additional accessibility attributes that will be applied to the component.\n\t *\n\t * This property allows for fine-tuned control of ARIA attributes for screen reader support.\n\t * It accepts an object with the following optional fields:\n\t *\n\t * - **root**: Accessibility attributes that will be applied to the root element.\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **roleDescription**: Defines a human-readable description for the button's role.\n\t * Accepts any string value.\n\t *\n\t * - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n\t * - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @public\n\t * @since 2.6.0\n\t * @default {}\n \t*/\n\t@property({ type: Object })\n\taccessibilityAttributes: AIButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Keeps the current state object of the component.\n\t * @private\n\t */\n\t@property({ type: Object })\n\t_currentStateObject?: ButtonState;\n\n\t/**\n\t * Determines if the button is in icon-only mode.\n\t * This property is animation related only.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly? = false;\n\n\t/**\n\t * Defines the available states of the component.\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that\n\t * you only use `ui5-ai-button-state` components in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\tstates!: Array<ButtonState>;\n\n\t@query(\"[ui5-split-button]\")\n\t_splitButton?: SplitButton;\n\n\t@query(\".ui5-ai-button-hidden[ui5-split-button]\")\n\t_hiddenSplitButton?: SplitButton;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tget _hideArrowButton() {\n\t\treturn !this._effectiveStateObject?.showArrowButton;\n\t}\n\n\tget _effectiveState() {\n\t\treturn this.state || (this.states.length && this.states[0].name) || \"\";\n\t}\n\n\tget _effectiveStateObject() {\n\t\treturn this.states.find(state => state.name === this._effectiveState);\n\t}\n\n\tget _stateIconOnly() {\n\t\treturn !this._stateText && !!this._stateIcon;\n\t}\n\n\tget _stateText() {\n\t\treturn this._currentStateObject?.text;\n\t}\n\n\tget _stateIcon() {\n\t\treturn this._currentStateObject?.icon;\n\t}\n\n\tget _stateEndIcon() {\n\t\tconst endIcon = this._effectiveStateObject?.showArrowButton ? \"\" : this._effectiveStateObject?.endIcon;\n\t\treturn endIcon;\n\t}\n\n\tget _hasText() {\n\t\treturn !!this._stateText;\n\t}\n\n\tonBeforeRendering(): void {\n\t\tconst splitButton = this._splitButton;\n\n\t\tif (splitButton) {\n\t\t\tsplitButton.activeArrowButton = this.arrowButtonPressed;\n\t\t}\n\n\t\tif (!this._currentStateObject?.name) {\n\t\t\tthis._currentStateObject = this._effectiveStateObject;\n\t\t}\n\n\t\tconst currentStateName = this._currentStateObject?.name || \"\";\n\n\t\tthis.iconOnly = this._stateIconOnly;\n\t\tif (currentStateName !== \"\" && currentStateName !== this._effectiveState) {\n\t\t\tthis._fadeOut();\n\t\t}\n\t}\n\n\t/**\n\t * Starts the fade-out animation.\n\t * @private\n\t */\n\tasync _fadeOut(): Promise<void> {\n\t\tconst fadeOutDuration = 180;\n\t\tconst button = this._splitButton;\n\t\tconst hiddenButton = this._hiddenSplitButton;\n\t\tconst newStateObject = this._effectiveStateObject;\n\n\t\tif (!newStateObject) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`State with name=\"${this.state}\" doesn't exist!`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!button || !hiddenButton) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttonWidth = button.offsetWidth;\n\t\tconst currentState: Partial<ButtonState> = this._currentStateObject || {};\n\n\t\tif ((!currentState.showArrowButton && newStateObject.showArrowButton) || (!currentState.endIcon && !!newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-button-to-menu\");\n\t\t}\n\t\tif ((currentState.showArrowButton && !newStateObject.showArrowButton) || (!!currentState.endIcon && !newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-menu-to-button\");\n\t\t}\n\n\t\tthis.style.width = `${buttonWidth}px`;\n\t\thiddenButton.icon = newStateObject.icon;\n\t\thiddenButton._endIcon = newStateObject.endIcon;\n\t\thiddenButton.textContent = newStateObject.text || null;\n\t\thiddenButton._hideArrowButton = this._hideArrowButton;\n\n\t\tawait renderFinished();\n\t\tconst hiddenButtonWidth = hiddenButton.offsetWidth;\n\t\tthis.style.width = `${hiddenButtonWidth}px`;\n\t\tthis.classList.add(\"ui5-ai-button-fade-out\");\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-mid\");\n\t\t\tbutton._hideArrowButton = this._hideArrowButton;\n\t\t\tthis._fadeIn();\n\t\t}, fadeOutDuration);\n\t}\n\n\t/**\n\t * Starts the fade-in animation.\n\t * @private\n\t */\n\t_fadeIn(): void {\n\t\tconst fadeInDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tconst newStateObject = this._effectiveStateObject;\n\t\t\tthis._currentStateObject = newStateObject;\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-in\");\n\t\t\tthis._resetFade();\n\t\t}, fadeInDuration);\n\t}\n\n\t/**\n\t * Resets the fade phases when the animation is completed.\n\t * @private\n\t */\n\t_resetFade(): void {\n\t\tconst fadeResetDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-out\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-mid\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-in\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-button-to-menu\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-menu-to-button\");\n\t\t}, fadeResetDuration);\n\n\t\t// reset the button's width after animations\n\t\tconst button = this._splitButton;\n\n\t\tif (button) {\n\t\t\tbutton.style.width = \"\";\n\t\t}\n\t}\n\n\t/**\n\t * Handles the click event.\n\t * @private\n\t */\n\t_onClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t/**\n\t * Handles the arrow-button-click event when `ui5-ai-button` is in split mode.\n\t * @private\n\t */\n\t_onArrowClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"arrow-button-click\");\n\t}\n\n\tget _computedAccessibilityAttributes(): AIButtonAccessibilityAttributes {\n\t\tconst labelRefTexts = getAllAccessibleNameRefTexts(this) || getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || \"\";\n\n\t\tconst mainTitle = this._hasText ? Button.i18nBundle.getText(BUTTON_TOOLTIP_TEXT, this._stateText as string) : \"\";\n\t\tconst title = `${mainTitle} ${labelRefTexts}`.trim();\n\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup || \"false\",\n\t\t\t\troleDescription: this.accessibilityAttributes?.root?.roleDescription,\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title || title,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title,\n\t\t\t},\n\t\t};\n\t}\n}\n\nButton.define();\nexport default Button;\nexport type {\n\tAIButtonAccessibilityAttributes,\n};\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAClE,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAI/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,GAC5B,MAAM,+DAA+D,CAAC;AAIvE,SAAS;AACT,OAAO,SAAS,MAAM,kCAAkC,CAAC;AAMzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AA8BH,IAAM,MAAM,cAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QAKC;;;;WAIG;QAEH,WAAM,GAAuB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AQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACV;AASlB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;sCACX;AAGlC;IADC,KAAK,CAAC,oBAAoB,CAAC;4CACD;AAG3B;IADC,KAAK,CAAC,yCAAyC,CAAC;kDAChB;AAG1B;IADN,IAAI,CAAC,uBAAuB,CAAC;kCACE;AAvG3B,MAAM;IA5BX,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,SAAS;QACjB,iBAAiB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;KAC3C,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,oBAAoB,EAAE;QAC5B,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,MAAM,CAyRX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport { i18n } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport query from \"@ui5/webcomponents-base/dist/decorators/query.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type SplitButton from \"@ui5/webcomponents/dist/SplitButton.js\";\nimport type ButtonDesign from \"@ui5/webcomponents/dist/types/ButtonDesign.js\";\nimport type ButtonState from \"./ButtonState.js\";\nimport { BUTTON_TOOLTIP_TEXT } from \"./generated/i18n/i18n-defaults.js\";\nimport \"./ButtonState.js\";\nimport ButtonTemplate from \"./ButtonTemplate.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetAllAccessibleNameRefTexts,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\n\n// Styles\nimport ButtonCss from \"./generated/themes/Button.css.js\";\n\ntype AIButtonRootAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"roleDescription\" | \"title\" | \"ariaKeyShortcuts\">;\ntype AIButtonArrowButtonAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype AIButtonAccessibilityAttributes = { root?: AIButtonRootAccessibilityAttributes, arrowButton?: AIButtonArrowButtonAccessibilityAttributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\n * or by pressing keyboard keys like [Enter] or [Space].\n *\n * ### Usage\n *\n * For the `ui5-ai-button` user interface, you can define one or more button states by placing `ui5-ai-button-state` components in their default slot.\n * Each state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\n * You can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n *\n * You can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n *\n * The `ui5-ai-button` can be activated by clicking or tapping it. You can change the button state in the click event handler. When the button is\n * in split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\n * You can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\n * To display additional actions, you can attach a menu to the arrow button.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents-ai/dist/Button.js\";`\n *\n * @constructor\n * @extends UI5Element\n * @since 2.0.0\n * @public\n * @experimental The **@ui5/webcomponents-ai** package (including Button and ButtonState) is under active development and considered experimental. Component APIs are subject to change.\n * Furthermore, the package supports **Horizon** themes only.\n */\n\n@customElement({\n\ttag: \"ui5-ai-button\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ButtonTemplate,\n\tstyles: ButtonCss,\n\tshadowRootOptions: { delegatesFocus: true },\n})\n\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the component is in split mode and after the arrow button\n * is activated either by clicking or tapping it or by using the [Arrow Up] / [Arrow Down],\n * [Alt] + [Arrow Up]/ [Arrow Down], or [F4] keyboard keys.\n * @public\n */\n@event(\"arrow-button-click\", {\n\tbubbles: true,\n})\n\nclass Button extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": void;\n\t\t\"arrow-button-click\": void;\n\t}\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign?: `${ButtonDesign}` = \"Default\"\n\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 = false;\n\n\t/**\n\t * Defines the current state of the component.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tstate?: string;\n\n\t/**\n\t * Defines the active state of the arrow button in split mode.\n\t * Set to true when the button is in split mode and a menu with additional options\n\t * is opened by the arrow button. Set back to false when the menu is closed.\n\t * @default false\n\t * @public\n\t * @since 2.6.0\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tarrowButtonPressed = false;\n\n\t/**\n \t * Defines the additional accessibility attributes that will be applied to the component.\n\t *\n\t * This property allows for fine-tuned control of ARIA attributes for screen reader support.\n\t * It accepts an object with the following optional fields:\n\t *\n\t * - **root**: Accessibility attributes that will be applied to the root element.\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **roleDescription**: Defines a human-readable description for the button's role.\n\t * Accepts any string value.\n\t * - **title**: Specifies a tooltip or description for screen readers.\n\t * Accepts any string value.\n\t * - **ariaKeyShortcuts**: Defines keyboard shortcuts that activate or focus the button.\n\t *\n\t * - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n\t * - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @public\n\t * @since 2.6.0\n\t * @default {}\n \t*/\n\t@property({ type: Object })\n\taccessibilityAttributes: AIButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Keeps the current state object of the component.\n\t * @private\n\t */\n\t@property({ type: Object })\n\t_currentStateObject?: ButtonState;\n\n\t/**\n\t * Determines if the button is in icon-only mode.\n\t * This property is animation related only.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly? = false;\n\n\t/**\n\t * Defines the available states of the component.\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that\n\t * you only use `ui5-ai-button-state` components in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\tstates!: DefaultSlot<ButtonState>;\n\n\t@query(\"[ui5-split-button]\")\n\t_splitButton?: SplitButton;\n\n\t@query(\".ui5-ai-button-hidden[ui5-split-button]\")\n\t_hiddenSplitButton?: SplitButton;\n\n\t@i18n(\"@ui5/webcomponents-ai\")\n\tstatic i18nBundleAi: I18nBundle;\n\n\tget _hideArrowButton() {\n\t\treturn !this._effectiveStateObject?.showArrowButton;\n\t}\n\n\tget _effectiveState() {\n\t\treturn this.state || (this.states.length && this.states[0].name) || \"\";\n\t}\n\n\tget _effectiveStateObject() {\n\t\treturn this.states.find(state => state.name === this._effectiveState);\n\t}\n\n\tget _stateIconOnly() {\n\t\treturn !this._stateText && !!this._stateIcon;\n\t}\n\n\tget _stateText() {\n\t\treturn this._currentStateObject?.text;\n\t}\n\n\tget _stateIcon() {\n\t\treturn this._currentStateObject?.icon;\n\t}\n\n\tget _stateEndIcon() {\n\t\tconst endIcon = this._effectiveStateObject?.showArrowButton ? \"\" : this._effectiveStateObject?.endIcon;\n\t\treturn endIcon;\n\t}\n\n\tget _hasText() {\n\t\treturn !!this._stateText;\n\t}\n\n\tonBeforeRendering(): void {\n\t\tconst splitButton = this._splitButton;\n\n\t\tif (splitButton) {\n\t\t\tsplitButton.activeArrowButton = this.arrowButtonPressed;\n\t\t}\n\n\t\tif (!this._currentStateObject?.name) {\n\t\t\tthis._currentStateObject = this._effectiveStateObject;\n\t\t}\n\n\t\tconst currentStateName = this._currentStateObject?.name || \"\";\n\n\t\tthis.iconOnly = this._stateIconOnly;\n\t\tif (currentStateName !== \"\" && currentStateName !== this._effectiveState) {\n\t\t\tthis._fadeOut();\n\t\t}\n\t}\n\n\t/**\n\t * Starts the fade-out animation.\n\t * @private\n\t */\n\tasync _fadeOut(): Promise<void> {\n\t\tconst fadeOutDuration = 180;\n\t\tconst button = this._splitButton;\n\t\tconst hiddenButton = this._hiddenSplitButton;\n\t\tconst newStateObject = this._effectiveStateObject;\n\n\t\tif (!newStateObject) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`State with name=\"${this.state}\" doesn't exist!`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!button || !hiddenButton) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttonWidth = button.offsetWidth;\n\t\tconst currentState: Partial<ButtonState> = this._currentStateObject || {};\n\n\t\tif ((!currentState.showArrowButton && newStateObject.showArrowButton) || (!currentState.endIcon && !!newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-button-to-menu\");\n\t\t}\n\t\tif ((currentState.showArrowButton && !newStateObject.showArrowButton) || (!!currentState.endIcon && !newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-menu-to-button\");\n\t\t}\n\n\t\tthis.style.width = `${buttonWidth}px`;\n\t\thiddenButton.icon = newStateObject.icon;\n\t\thiddenButton._endIcon = newStateObject.endIcon;\n\t\thiddenButton.textContent = newStateObject.text || null;\n\t\thiddenButton._hideArrowButton = this._hideArrowButton;\n\n\t\tawait renderFinished();\n\t\tconst hiddenButtonWidth = hiddenButton.offsetWidth;\n\t\tthis.style.width = `${hiddenButtonWidth}px`;\n\t\tthis.classList.add(\"ui5-ai-button-fade-out\");\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-mid\");\n\t\t\tbutton._hideArrowButton = this._hideArrowButton;\n\t\t\tthis._fadeIn();\n\t\t}, fadeOutDuration);\n\t}\n\n\t/**\n\t * Starts the fade-in animation.\n\t * @private\n\t */\n\t_fadeIn(): void {\n\t\tconst fadeInDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tconst newStateObject = this._effectiveStateObject;\n\t\t\tthis._currentStateObject = newStateObject;\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-in\");\n\t\t\tthis._resetFade();\n\t\t}, fadeInDuration);\n\t}\n\n\t/**\n\t * Resets the fade phases when the animation is completed.\n\t * @private\n\t */\n\t_resetFade(): void {\n\t\tconst fadeResetDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-out\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-mid\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-in\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-button-to-menu\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-menu-to-button\");\n\t\t}, fadeResetDuration);\n\n\t\t// reset the button's width after animations\n\t\tconst button = this._splitButton;\n\n\t\tif (button) {\n\t\t\tbutton.style.width = \"\";\n\t\t}\n\t}\n\n\t/**\n\t * Handles the click event.\n\t * @private\n\t */\n\t_onClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t/**\n\t * Handles the arrow-button-click event when `ui5-ai-button` is in split mode.\n\t * @private\n\t */\n\t_onArrowClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"arrow-button-click\");\n\t}\n\n\tget _computedAccessibilityAttributes(): AIButtonAccessibilityAttributes {\n\t\tconst labelRefTexts = getAllAccessibleNameRefTexts(this) || getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || \"\";\n\n\t\tconst mainTitle = this._hasText ? Button.i18nBundleAi.getText(BUTTON_TOOLTIP_TEXT, this._stateText as string) : \"\";\n\t\tconst title = `${mainTitle} ${labelRefTexts}`.trim();\n\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup || \"false\",\n\t\t\t\troleDescription: this.accessibilityAttributes?.root?.roleDescription,\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title || title,\n\t\t\t\tariaKeyShortcuts: this.accessibilityAttributes?.root?.ariaKeyShortcuts,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title,\n\t\t\t},\n\t\t};\n\t}\n}\n\nButton.define();\nexport default Button;\nexport type {\n\tAIButtonAccessibilityAttributes,\n};\n"]}
@@ -19,7 +19,8 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
19
19
  * @abstract
20
20
  * @since 2.0.0
21
21
  * @public
22
- * @experimental The Button and ButtonState web components are available since 2.0 under an experimental flag and their API and behaviour are subject to change.
22
+ * @experimental The **@ui5/webcomponents-ai** package (including ButtonState) is under active development and considered experimental. Component APIs are subject to change.
23
+ * Furthermore, the package supports **Horizon** themes only.
23
24
  */
24
25
  declare class ButtonState extends UI5Element {
25
26
  /**
@@ -27,7 +27,8 @@ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
27
27
  * @abstract
28
28
  * @since 2.0.0
29
29
  * @public
30
- * @experimental The Button and ButtonState web components are available since 2.0 under an experimental flag and their API and behaviour are subject to change.
30
+ * @experimental The **@ui5/webcomponents-ai** package (including ButtonState) is under active development and considered experimental. Component APIs are subject to change.
31
+ * Furthermore, the package supports **Horizon** themes only.
31
32
  */
32
33
  let ButtonState = class ButtonState extends UI5Element {
33
34
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonState.js","sourceRoot":"","sources":["../src/ButtonState.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QA2CC;;;;;WAKG;QAEH,oBAAe,GAAG,KAAK,CAAC;IACzB,CAAC;CAAA,CAAA;AA5CA;IADC,QAAQ,EAAE;yCACG;AAQd;IADC,QAAQ,EAAE;yCACG;AAad;IADC,QAAQ,EAAE;yCACG;AAad;IADC,QAAQ,EAAE;4CACM;AASjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACJ;AAlDnB,WAAW;IADhB,aAAa,CAAC,qBAAqB,CAAC;GAC/B,WAAW,CAmDhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AACrB,eAAe,WAAW,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\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-ai-button-state` is the item to use for defining states of `ui5-ai-button` components.\n *\n * ### Usage\n *\n * `ui5-ai-button-state` is an abstract element, representing a state of `ui5-ai-button`. It is meant to be used in the `default` slot\n * of `ui5-ai-button` and should not be used as standalone component.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/AiButtonState.js\";`\n * @constructor\n * @extends UI5Element\n * @abstract\n * @since 2.0.0\n * @public\n * @experimental The Button and ButtonState web components are available since 2.0 under an experimental flag and their API and behaviour are subject to change.\n */\n@customElement(\"ui5-ai-button-state\")\nclass ButtonState extends UI5Element {\n\t/**\n\t * Defines the name of the button state.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tname?: string;\n\n\t/**\n\t * Defines the text of the button in this state.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component before the text.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component after the text.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tendIcon?: string;\n\n\t/**\n\t * Defines if the component is in split button mode.\n\t * @default false\n\t * @since 2.6.0\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowArrowButton = false;\n}\n\nButtonState.define();\nexport default ButtonState;\n"]}
1
+ {"version":3,"file":"ButtonState.js","sourceRoot":"","sources":["../src/ButtonState.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QA2CC;;;;;WAKG;QAEH,oBAAe,GAAG,KAAK,CAAC;IACzB,CAAC;CAAA,CAAA;AA5CA;IADC,QAAQ,EAAE;yCACG;AAQd;IADC,QAAQ,EAAE;yCACG;AAad;IADC,QAAQ,EAAE;yCACG;AAad;IADC,QAAQ,EAAE;4CACM;AASjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACJ;AAlDnB,WAAW;IADhB,aAAa,CAAC,qBAAqB,CAAC;GAC/B,WAAW,CAmDhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AACrB,eAAe,WAAW,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\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-ai-button-state` is the item to use for defining states of `ui5-ai-button` components.\n *\n * ### Usage\n *\n * `ui5-ai-button-state` is an abstract element, representing a state of `ui5-ai-button`. It is meant to be used in the `default` slot\n * of `ui5-ai-button` and should not be used as standalone component.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/AiButtonState.js\";`\n * @constructor\n * @extends UI5Element\n * @abstract\n * @since 2.0.0\n * @public\n * @experimental The **@ui5/webcomponents-ai** package (including ButtonState) is under active development and considered experimental. Component APIs are subject to change.\n * Furthermore, the package supports **Horizon** themes only.\n */\n@customElement(\"ui5-ai-button-state\")\nclass ButtonState extends UI5Element {\n\t/**\n\t * Defines the name of the button state.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tname?: string;\n\n\t/**\n\t * Defines the text of the button in this state.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component before the text.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component after the text.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * **Example:**\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tendIcon?: string;\n\n\t/**\n\t * Defines if the component is in split button mode.\n\t * @default false\n\t * @since 2.6.0\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tshowArrowButton = false;\n}\n\nButtonState.define();\nexport default ButtonState;\n"]}
@@ -0,0 +1,146 @@
1
+ import BaseInput from "@ui5/webcomponents/dist/Input.js";
2
+ import type Menu from "@ui5/webcomponents/dist/Menu.js";
3
+ import type { MenuItemClickEventDetail } from "@ui5/webcomponents/dist/Menu.js";
4
+ import type { Slot } from "@ui5/webcomponents-base/dist/UI5Element.js";
5
+ type InputVersionChangeEventDetail = {
6
+ backwards: boolean;
7
+ };
8
+ type InputItemClickEventDetail = MenuItemClickEventDetail;
9
+ /**
10
+ * @class
11
+ *
12
+ * ### Overview
13
+ *
14
+ * The `ui5-ai-input` component extends the standard `ui5-input` with **AI Writing Assistant** capabilities.
15
+ *
16
+ * ### Structure
17
+ *
18
+ * The `ui5-ai-input` consists of the following main parts:
19
+ *
20
+ * - **Input Field** – Inherits all standard Input behaviors.
21
+ * - **AI Action Button** – Appears when focused or loading, providing access to AI-related actions or stopping generation.
22
+ *
23
+ * The component automatically determines which elements to render based on its internal state:
24
+ * - The AI Button is only shown when there are available `actions`.
25
+ * - The version navigation appears only when `totalVersions > 1`.
26
+ *
27
+ * ### Keyboard Support
28
+ *
29
+ * - **Shift + F4** — Opens the AI menu.
30
+ * - **Ctrl + Shift + Z / Y** — Navigates backward/forward between AI-generated versions.
31
+ *
32
+ * ### ES6 Module Import
33
+ *
34
+ * `import "@ui5/webcomponents-ai/dist/Input.js";`
35
+ *
36
+ * @constructor
37
+ * @extends BaseInput
38
+ * @since 2.16.0
39
+ * @experimental The **@ui5/webcomponents-ai** package is under active development and considered experimental. Component APIs are subject to change.
40
+ * Furthermore, the package supports **Horizon** themes only.
41
+ * @public
42
+ */
43
+ declare class Input extends BaseInput {
44
+ eventDetails: BaseInput["eventDetails"] & {
45
+ "version-change": InputVersionChangeEventDetail;
46
+ "stop-generation": void;
47
+ "button-click": void;
48
+ "item-click": InputItemClickEventDetail;
49
+ };
50
+ /**
51
+ * Indicates the index of the currently displayed version.
52
+ *
53
+ * @default 0
54
+ * @public
55
+ */
56
+ currentVersion: number;
57
+ /**
58
+ * Indicates the total number of result versions available.
59
+ *
60
+ * When not set or set to 0, the versioning will be hidden.
61
+ *
62
+ * @default 0
63
+ * @public
64
+ */
65
+ totalVersions: number;
66
+ /**
67
+ * Defines whether the AI Writing Assistant is currently loading.
68
+ *
69
+ * When `true`, indicates that an AI action is in progress.
70
+ *
71
+ * @default false
72
+ * @public
73
+ */
74
+ loading: boolean;
75
+ /**
76
+ * Indicates if the menu is open.
77
+ * @default 0
78
+ * @private
79
+ */
80
+ _isMenuOpen: boolean;
81
+ /**
82
+ * Defines the items of the menu for the component.
83
+ * @public
84
+ */
85
+ actions: Slot<HTMLElement>;
86
+ _previousCurrentStep: number;
87
+ _previousTotalSteps: number;
88
+ isFocused: boolean;
89
+ _onfocusin(e: FocusEvent): void;
90
+ _onfocusout(e: FocusEvent): void;
91
+ /**
92
+ * Manages the focus when the navigation buttons become disabled/enabled.
93
+ * Automatically moves the focus to the available button when the user reaches the boundaries.
94
+ * @private
95
+ */
96
+ _manageVersionButtonsFocus(): void;
97
+ /**
98
+ * Handles the click event for the AI generate Button.
99
+ * Fires the appropriate event based on the AI Button state.
100
+ * @private
101
+ */
102
+ _handleAIButtonClick(e: Event): void;
103
+ /**
104
+ * Handles the escape event for the AI generate Button.
105
+ * @private
106
+ */
107
+ _handleAIButtonKeydown: (e: KeyboardEvent) => void;
108
+ /**
109
+ * Handles the version change event from the versioning component.
110
+ *
111
+ * @param {CustomEvent} e - The version change event
112
+ */
113
+ _handleVersionChange(e: CustomEvent<{
114
+ backwards: boolean;
115
+ }>): void;
116
+ /**
117
+ * Handles the click event for the "Previous Version" button.
118
+ * Updates the current version index and syncs content.
119
+ * @private
120
+ */
121
+ _handlePreviousButtonClick(): void;
122
+ /**
123
+ * Handles the click event for the "Next Version" button.
124
+ * Updates the current version index and syncs content.
125
+ * @private
126
+ */
127
+ _handleNextButtonClick(): void;
128
+ _onMenuIconClick(e: CustomEvent<InputItemClickEventDetail>): void;
129
+ /**
130
+ * Handles keydown events for keyboard shortcuts.
131
+ * @private
132
+ */
133
+ _onkeydown(e: KeyboardEvent): void;
134
+ /**
135
+ * Handles visibility of the Writing Assistant Button.
136
+ * If there are no items, the Writing Assistant Button would not be rendered.
137
+ */
138
+ get hasActions(): boolean;
139
+ get ariaLabel(): string;
140
+ get stopGeneratingTooltip(): string;
141
+ get nextButtonAccessibleName(): string;
142
+ get previousButtonAccessibleName(): string;
143
+ get menu(): Menu;
144
+ }
145
+ export type { InputVersionChangeEventDetail, InputItemClickEventDetail, };
146
+ export default Input;