@ui5/webcomponents-ai 0.0.0-9261ac932
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/.env.production +1 -0
- package/.env.testing +4 -0
- package/.npsrc.json +3 -0
- package/CHANGELOG.md +216 -0
- package/README.md +37 -0
- package/dist/Assets.d.ts +3 -0
- package/dist/Assets.js +6 -0
- package/dist/Assets.js.map +1 -0
- package/dist/Button.d.ts +114 -0
- package/dist/Button.js +233 -0
- package/dist/Button.js.map +1 -0
- package/dist/ButtonState.d.ts +60 -0
- package/dist/ButtonState.js +51 -0
- package/dist/ButtonState.js.map +1 -0
- package/dist/PromptInput.d.ts +150 -0
- package/dist/PromptInput.js +236 -0
- package/dist/PromptInput.js.map +1 -0
- package/dist/bundle.esm.d.ts +3 -0
- package/dist/bundle.esm.js +9 -0
- package/dist/bundle.esm.js.map +1 -0
- package/dist/bundle.scoped.config.d.ts +1 -0
- package/dist/bundle.scoped.config.js +3 -0
- package/dist/bundle.scoped.config.js.map +1 -0
- package/dist/bundle.scoped.esm.d.ts +2 -0
- package/dist/bundle.scoped.esm.js +3 -0
- package/dist/bundle.scoped.esm.js.map +1 -0
- package/dist/css/themes/Button.css +1 -0
- package/dist/css/themes/PromptInput.css +1 -0
- package/dist/css/themes/sap_horizon/parameters-bundle.css +0 -0
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +0 -0
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +0 -0
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +0 -0
- package/dist/custom-elements-internal.json +583 -0
- package/dist/custom-elements.json +517 -0
- package/dist/generated/assets/i18n/messagebundle_ar.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_bg.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ca.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_cy.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_da.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_de.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_el.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_es.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_et.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_hi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_hr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_hu.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_iw.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ja.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_kk.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ko.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_lt.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_mk.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ms.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_nl.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_no.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_pl.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ru.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sh.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sk.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sl.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sv.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_th.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_tr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_uk.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_vi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -0
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -0
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -0
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -0
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -0
- package/dist/generated/i18n/i18n-defaults.d.ts +4 -0
- package/dist/generated/i18n/i18n-defaults.js +4 -0
- package/dist/generated/i18n/i18n-defaults.js.map +1 -0
- package/dist/generated/json-imports/Themes-fetch.d.ts +1 -0
- package/dist/generated/json-imports/Themes-fetch.js +21 -0
- package/dist/generated/json-imports/Themes-fetch.js.map +1 -0
- package/dist/generated/json-imports/Themes.d.ts +1 -0
- package/dist/generated/json-imports/Themes.js +21 -0
- package/dist/generated/json-imports/Themes.js.map +1 -0
- package/dist/generated/json-imports/i18n-fetch.d.ts +1 -0
- package/dist/generated/json-imports/i18n-fetch.js +118 -0
- package/dist/generated/json-imports/i18n-fetch.js.map +1 -0
- package/dist/generated/json-imports/i18n.d.ts +1 -0
- package/dist/generated/json-imports/i18n.js +118 -0
- package/dist/generated/json-imports/i18n.js.map +1 -0
- package/dist/generated/templates/ButtonTemplate.lit.d.ts +4 -0
- package/dist/generated/templates/ButtonTemplate.lit.js +6 -0
- package/dist/generated/templates/ButtonTemplate.lit.js.map +1 -0
- 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/Button.css.d.ts +3 -0
- package/dist/generated/themes/Button.css.js +9 -0
- package/dist/generated/themes/Button.css.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/generated/themes/sap_horizon/parameters-bundle.css.d.ts +3 -0
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +3 -0
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -0
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +3 -0
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +3 -0
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -0
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.d.ts +3 -0
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +3 -0
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -0
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +3 -0
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +3 -0
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/vscode.html-custom-data.json +124 -0
- package/dist/web-types.json +287 -0
- package/jsconfig.json +11 -0
- package/package-scripts.cjs +15 -0
- package/package.json +57 -0
- package/src/Button.hbs +17 -0
- package/src/PromptInput.hbs +36 -0
- package/src/i18n/messagebundle.properties +8 -0
- package/src/i18n/messagebundle_ar.properties +4 -0
- package/src/i18n/messagebundle_bg.properties +4 -0
- package/src/i18n/messagebundle_ca.properties +4 -0
- package/src/i18n/messagebundle_cnr.properties +4 -0
- package/src/i18n/messagebundle_cs.properties +4 -0
- package/src/i18n/messagebundle_cy.properties +4 -0
- package/src/i18n/messagebundle_da.properties +4 -0
- package/src/i18n/messagebundle_de.properties +4 -0
- package/src/i18n/messagebundle_el.properties +4 -0
- package/src/i18n/messagebundle_en.properties +4 -0
- package/src/i18n/messagebundle_en_GB.properties +4 -0
- package/src/i18n/messagebundle_en_US_sappsd.properties +4 -0
- package/src/i18n/messagebundle_en_US_saprigi.properties +4 -0
- package/src/i18n/messagebundle_en_US_saptrc.properties +4 -0
- package/src/i18n/messagebundle_es.properties +4 -0
- package/src/i18n/messagebundle_es_MX.properties +4 -0
- package/src/i18n/messagebundle_et.properties +4 -0
- package/src/i18n/messagebundle_fi.properties +4 -0
- package/src/i18n/messagebundle_fr.properties +4 -0
- package/src/i18n/messagebundle_fr_CA.properties +4 -0
- package/src/i18n/messagebundle_hi.properties +4 -0
- package/src/i18n/messagebundle_hr.properties +4 -0
- package/src/i18n/messagebundle_hu.properties +4 -0
- package/src/i18n/messagebundle_id.properties +4 -0
- package/src/i18n/messagebundle_it.properties +4 -0
- package/src/i18n/messagebundle_iw.properties +4 -0
- package/src/i18n/messagebundle_ja.properties +4 -0
- package/src/i18n/messagebundle_kk.properties +4 -0
- package/src/i18n/messagebundle_ko.properties +4 -0
- package/src/i18n/messagebundle_lt.properties +4 -0
- package/src/i18n/messagebundle_lv.properties +4 -0
- package/src/i18n/messagebundle_mk.properties +4 -0
- package/src/i18n/messagebundle_ms.properties +4 -0
- package/src/i18n/messagebundle_nl.properties +4 -0
- package/src/i18n/messagebundle_no.properties +4 -0
- package/src/i18n/messagebundle_pl.properties +4 -0
- package/src/i18n/messagebundle_pt.properties +4 -0
- package/src/i18n/messagebundle_pt_PT.properties +4 -0
- package/src/i18n/messagebundle_ro.properties +4 -0
- package/src/i18n/messagebundle_ru.properties +4 -0
- package/src/i18n/messagebundle_sh.properties +4 -0
- package/src/i18n/messagebundle_sk.properties +4 -0
- package/src/i18n/messagebundle_sl.properties +4 -0
- package/src/i18n/messagebundle_sr.properties +4 -0
- package/src/i18n/messagebundle_sv.properties +4 -0
- package/src/i18n/messagebundle_th.properties +4 -0
- package/src/i18n/messagebundle_tr.properties +4 -0
- package/src/i18n/messagebundle_uk.properties +4 -0
- package/src/i18n/messagebundle_vi.properties +4 -0
- package/src/i18n/messagebundle_zh_CN.properties +4 -0
- package/src/i18n/messagebundle_zh_TW.properties +4 -0
- package/src/themes/Button.css +88 -0
- package/src/themes/PromptInput.css +30 -0
- package/src/themes/base/Button-parameters.css +2 -0
- package/src/themes/sap_horizon/parameters-bundle.css +1 -0
- package/src/themes/sap_horizon_dark/parameters-bundle.css +1 -0
- package/src/themes/sap_horizon_hcb/parameters-bundle.css +1 -0
- package/src/themes/sap_horizon_hcw/parameters-bundle.css +1 -0
- package/tsconfig.json +36 -0
package/.env.production
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
VITE_BUNDLE_PATH="../../dist/bundle.esm.js"
|
package/.env.testing
ADDED
package/.npsrc.json
ADDED
package/CHANGELOG.md
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
|
+
|
6
|
+
# [2.4.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.3.1-rc.0...v2.4.0-rc.0) (2024-10-10)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **ui5-ai-button:** reset button width after animations ([#9923](https://github.com/SAP/ui5-webcomponents/issues/9923)) ([2a5c7db](https://github.com/SAP/ui5-webcomponents/commit/2a5c7db734b08f629f41b586f4aa0f39b20de632))
|
12
|
+
|
13
|
+
|
14
|
+
### Features
|
15
|
+
|
16
|
+
* enhance `[@event](https://github.com/event)` decorator ([#9944](https://github.com/SAP/ui5-webcomponents/issues/9944)) ([fe1d816](https://github.com/SAP/ui5-webcomponents/commit/fe1d816f512400b839fd4ce1b9af1506d0cb4c9a))
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
## [2.3.1-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0...v2.3.1-rc.0) (2024-10-03)
|
23
|
+
|
24
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
# [2.3.0](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.3...v2.3.0) (2024-10-02)
|
31
|
+
|
32
|
+
|
33
|
+
### Features
|
34
|
+
|
35
|
+
* **framework:** introduce the `i18n` decorator and the `cldr` option ([#9897](https://github.com/SAP/ui5-webcomponents/issues/9897)) ([1f29d23](https://github.com/SAP/ui5-webcomponents/commit/1f29d231fe892a850871e7f73afca93c730ecffd))
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
# [2.3.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.2...v2.3.0-rc.3) (2024-09-26)
|
42
|
+
|
43
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
# [2.3.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.1...v2.3.0-rc.2) (2024-09-19)
|
50
|
+
|
51
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
# [2.3.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.0...v2.3.0-rc.1) (2024-09-12)
|
58
|
+
|
59
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
# [2.3.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0...v2.3.0-rc.0) (2024-09-05)
|
66
|
+
|
67
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
# [2.2.0](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0-rc.3...v2.2.0) (2024-09-03)
|
74
|
+
|
75
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
# [2.2.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0-rc.2...v2.2.0-rc.3) (2024-08-29)
|
82
|
+
|
83
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
# [2.2.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0-rc.1...v2.2.0-rc.2) (2024-08-22)
|
90
|
+
|
91
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
# [2.2.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.2.0-rc.0...v2.2.0-rc.1) (2024-08-15)
|
98
|
+
|
99
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
# [2.2.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.1.1...v2.2.0-rc.0) (2024-08-08)
|
106
|
+
|
107
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
## [2.1.1](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0...v2.1.1) (2024-08-02)
|
114
|
+
|
115
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
# [2.1.0](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0-rc.3...v2.1.0) (2024-08-02)
|
122
|
+
|
123
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
# [2.1.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0-rc.2...v2.1.0-rc.3) (2024-08-01)
|
130
|
+
|
131
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
# [2.1.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0-rc.1...v2.1.0-rc.2) (2024-07-25)
|
138
|
+
|
139
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
# [2.1.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.1.0-rc.0...v2.1.0-rc.1) (2024-07-18)
|
146
|
+
|
147
|
+
|
148
|
+
### Features
|
149
|
+
|
150
|
+
* **ui5-prompt-input:** implement suggestions ([#9390](https://github.com/SAP/ui5-webcomponents/issues/9390)) ([a261cfb](https://github.com/SAP/ui5-webcomponents/commit/a261cfbfa06328e1f496a8a2acd1e4b22e78243d))
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
# [2.1.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v2.0.1...v2.1.0-rc.0) (2024-07-11)
|
157
|
+
|
158
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
## [2.0.1](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0...v2.0.1) (2024-07-05)
|
165
|
+
|
166
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
# [2.0.0](https://github.com/SAP/ui5-webcomponents/compare/v2.0.0-rc.6...v2.0.0) (2024-07-03)
|
173
|
+
|
174
|
+
|
175
|
+
### Features
|
176
|
+
|
177
|
+
* add property initializers ([#8846](https://github.com/SAP/ui5-webcomponents/issues/8846)) ([eef0cc9](https://github.com/SAP/ui5-webcomponents/commit/eef0cc9b663fda6268b98e516ed46439435fa2b0))
|
178
|
+
* **ui5-ai-button:** initial implementation ([b39548f](https://github.com/SAP/ui5-webcomponents/commit/b39548f7af9e0dd76543327d5bab5242d9ef15a0))
|
179
|
+
|
180
|
+
|
181
|
+
### BREAKING CHANGES
|
182
|
+
|
183
|
+
* @property decorator must be adapted according to new type parameter
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
# [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)
|
190
|
+
|
191
|
+
|
192
|
+
### Features
|
193
|
+
|
194
|
+
* **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))
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
# [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)
|
201
|
+
|
202
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
# [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)
|
209
|
+
|
210
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
# Change Log
|
package/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# UI5 Web Components - AI
|
2
|
+
|
3
|
+
[](https://www.npmjs.com/package/@ui5/webcomponents)
|
4
|
+
|
5
|
+
Provides web components implementing AI-related visual and interaction.
|
6
|
+
|
7
|
+
|
8
|
+
**Note:** The package is available since 2.0 and experimental
|
9
|
+
|
10
|
+
|
11
|
+
## Provided components
|
12
|
+
|
13
|
+
| Web Component | Tag name | Module import |
|
14
|
+
|--------------------------|-----------------------------|------------------------------------------------------------|
|
15
|
+
|
16
|
+
|
17
|
+
## Provided assets
|
18
|
+
|
19
|
+
|
20
|
+
| Assets | Module | Notes
|
21
|
+
|------------|-----------|-----------
|
22
|
+
| `i18n`, `themes` | `@ui5/webcomponents-compat/dist/Assets.js` | Theming parameters and translations for the components
|
23
|
+
|
24
|
+
|
25
|
+
## Resources
|
26
|
+
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md)
|
27
|
+
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/)
|
28
|
+
|
29
|
+
## Support
|
30
|
+
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://ui5-slack-invite.cfapps.eu10.hana.ondemand.com/).
|
31
|
+
|
32
|
+
## Contribute
|
33
|
+
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md).
|
34
|
+
|
35
|
+
## License
|
36
|
+
Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
|
37
|
+
This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/main/LICENSE.txt) file.
|
package/dist/Assets.d.ts
ADDED
package/dist/Assets.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Assets.js","sourceRoot":"","sources":["../src/Assets.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,mCAAmC,CAAC;AAE3C,wBAAwB;AACxB,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC","sourcesContent":["// main package assets (transitively base, theming and icons)\nimport \"@ui5/webcomponents/dist/Assets.js\";\n\n// own ai package assets\nimport \"./generated/json-imports/Themes.js\";\nimport \"./generated/json-imports/i18n.js\";\n"]}
|
package/dist/Button.d.ts
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
|
+
import MainButton from "@ui5/webcomponents/dist/Button.js";
|
3
|
+
import type ButtonDesign from "@ui5/webcomponents/dist/types/ButtonDesign.js";
|
4
|
+
import ButtonState from "./ButtonState.js";
|
5
|
+
/**
|
6
|
+
* @class
|
7
|
+
*
|
8
|
+
* ### Overview
|
9
|
+
*
|
10
|
+
* The `ui5-ai-button` component represents a button used in AI-related scenarios.
|
11
|
+
* It enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing
|
12
|
+
* certain keyboard keys, such as Enter.
|
13
|
+
*
|
14
|
+
* ### Usage
|
15
|
+
*
|
16
|
+
* 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.
|
17
|
+
* Each state have a name that identifies it and can have text, icon and end icon defined (in any combination) depending on the state purpose.
|
18
|
+
*
|
19
|
+
* You can choose from a set of predefined designs (the same as for regular `ui5-button` component) that allow different styling to correspond to the triggered action.
|
20
|
+
*
|
21
|
+
* `ui5-ai-button` can be activated by clicking or tapping it. The state can be changed in `click` event handler.
|
22
|
+
*
|
23
|
+
* ### ES6 Module Import
|
24
|
+
*
|
25
|
+
* `import "@ui5/webcomponents-ai/dist/Button.js";`
|
26
|
+
*
|
27
|
+
* @constructor
|
28
|
+
* @extends UI5Element
|
29
|
+
* @since 2.0.0
|
30
|
+
* @public
|
31
|
+
* @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.
|
32
|
+
*/
|
33
|
+
declare class Button extends UI5Element {
|
34
|
+
/**
|
35
|
+
* Defines the component design.
|
36
|
+
* @default "Default"
|
37
|
+
* @public
|
38
|
+
*/
|
39
|
+
design?: `${ButtonDesign}`;
|
40
|
+
/**
|
41
|
+
* Defines whether the component is disabled.
|
42
|
+
* A disabled component can't be pressed or
|
43
|
+
* focused, and it is not in the tab chain.
|
44
|
+
* @default false
|
45
|
+
* @public
|
46
|
+
*/
|
47
|
+
disabled: boolean;
|
48
|
+
/**
|
49
|
+
* Defines the current state of the component.
|
50
|
+
*
|
51
|
+
* @default undefined
|
52
|
+
* @public
|
53
|
+
*/
|
54
|
+
state?: string;
|
55
|
+
/**
|
56
|
+
* Keeps the current state object of the component.
|
57
|
+
* @private
|
58
|
+
*/
|
59
|
+
_currentStateObject?: ButtonState;
|
60
|
+
/**
|
61
|
+
* Initiates button elements fade-out phase.
|
62
|
+
* @default false
|
63
|
+
* @private
|
64
|
+
*/
|
65
|
+
fadeOut: boolean;
|
66
|
+
/**
|
67
|
+
* Initiates button fade middle phase.
|
68
|
+
* @default false
|
69
|
+
* @private
|
70
|
+
*/
|
71
|
+
fadeMid: boolean;
|
72
|
+
/**
|
73
|
+
* Initiates button elements fade-in phase.
|
74
|
+
* @default false
|
75
|
+
* @private
|
76
|
+
*/
|
77
|
+
fadeIn: boolean;
|
78
|
+
/**
|
79
|
+
* Defines the available states of the component.
|
80
|
+
* **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use `ui5-ai-button-state` components in order to preserve the intended design.
|
81
|
+
* @public
|
82
|
+
*/
|
83
|
+
states: Array<ButtonState>;
|
84
|
+
onBeforeRendering(): void;
|
85
|
+
/**
|
86
|
+
* Starts the fade-out animation.
|
87
|
+
* @private
|
88
|
+
*/
|
89
|
+
_fadeOut(): Promise<void>;
|
90
|
+
/**
|
91
|
+
* Starts the fade-in animation.
|
92
|
+
* @private
|
93
|
+
*/
|
94
|
+
_fadeIn(): void;
|
95
|
+
/**
|
96
|
+
* Resets the fade phases when the animation is completed.
|
97
|
+
* @private
|
98
|
+
*/
|
99
|
+
_resetFade(): void;
|
100
|
+
/**
|
101
|
+
* Handles the click event.
|
102
|
+
* @private
|
103
|
+
*/
|
104
|
+
_onclick(e: MouseEvent): void;
|
105
|
+
get _mainButton(): MainButton;
|
106
|
+
get _effectiveState(): string;
|
107
|
+
get _effectiveStateObject(): ButtonState | undefined;
|
108
|
+
get _stateIconOnly(): boolean;
|
109
|
+
get _stateText(): string | undefined;
|
110
|
+
get _stateIcon(): string | undefined;
|
111
|
+
get _stateEndIcon(): string | undefined;
|
112
|
+
get _hasText(): boolean;
|
113
|
+
}
|
114
|
+
export default Button;
|
package/dist/Button.js
ADDED
@@ -0,0 +1,233 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
8
|
+
import { renderFinished } from "@ui5/webcomponents-base/dist/Render.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 MainButton from "@ui5/webcomponents/dist/Button.js";
|
15
|
+
import Icon from "@ui5/webcomponents/dist/Icon.js";
|
16
|
+
import ButtonState from "./ButtonState.js";
|
17
|
+
import ButtonTemplate from "./generated/templates/ButtonTemplate.lit.js";
|
18
|
+
// Styles
|
19
|
+
import ButtonCss from "./generated/themes/Button.css.js";
|
20
|
+
/**
|
21
|
+
* @class
|
22
|
+
*
|
23
|
+
* ### Overview
|
24
|
+
*
|
25
|
+
* The `ui5-ai-button` component represents a button used in AI-related scenarios.
|
26
|
+
* It enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing
|
27
|
+
* certain keyboard keys, such as Enter.
|
28
|
+
*
|
29
|
+
* ### Usage
|
30
|
+
*
|
31
|
+
* 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.
|
32
|
+
* Each state have a name that identifies it and can have text, icon and end icon defined (in any combination) depending on the state purpose.
|
33
|
+
*
|
34
|
+
* You can choose from a set of predefined designs (the same as for regular `ui5-button` component) that allow different styling to correspond to the triggered action.
|
35
|
+
*
|
36
|
+
* `ui5-ai-button` can be activated by clicking or tapping it. The state can be changed in `click` event handler.
|
37
|
+
*
|
38
|
+
* ### ES6 Module Import
|
39
|
+
*
|
40
|
+
* `import "@ui5/webcomponents-ai/dist/Button.js";`
|
41
|
+
*
|
42
|
+
* @constructor
|
43
|
+
* @extends UI5Element
|
44
|
+
* @since 2.0.0
|
45
|
+
* @public
|
46
|
+
* @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.
|
47
|
+
*/
|
48
|
+
let Button = class Button extends UI5Element {
|
49
|
+
constructor() {
|
50
|
+
super(...arguments);
|
51
|
+
/**
|
52
|
+
* Defines the component design.
|
53
|
+
* @default "Default"
|
54
|
+
* @public
|
55
|
+
*/
|
56
|
+
this.design = "Default";
|
57
|
+
/**
|
58
|
+
* Defines whether the component is disabled.
|
59
|
+
* A disabled component can't be pressed or
|
60
|
+
* focused, and it is not in the tab chain.
|
61
|
+
* @default false
|
62
|
+
* @public
|
63
|
+
*/
|
64
|
+
this.disabled = false;
|
65
|
+
/**
|
66
|
+
* Initiates button elements fade-out phase.
|
67
|
+
* @default false
|
68
|
+
* @private
|
69
|
+
*/
|
70
|
+
this.fadeOut = false;
|
71
|
+
/**
|
72
|
+
* Initiates button fade middle phase.
|
73
|
+
* @default false
|
74
|
+
* @private
|
75
|
+
*/
|
76
|
+
this.fadeMid = false;
|
77
|
+
/**
|
78
|
+
* Initiates button elements fade-in phase.
|
79
|
+
* @default false
|
80
|
+
* @private
|
81
|
+
*/
|
82
|
+
this.fadeIn = false;
|
83
|
+
}
|
84
|
+
onBeforeRendering() {
|
85
|
+
if (this.fadeOut || this.fadeIn) {
|
86
|
+
return;
|
87
|
+
}
|
88
|
+
if (!this._currentStateObject?.name) {
|
89
|
+
this._currentStateObject = this._effectiveStateObject;
|
90
|
+
}
|
91
|
+
const currentStateName = this._currentStateObject?.name || "";
|
92
|
+
if (currentStateName !== "" && currentStateName !== this._effectiveState) {
|
93
|
+
this._fadeOut();
|
94
|
+
}
|
95
|
+
}
|
96
|
+
/**
|
97
|
+
* Starts the fade-out animation.
|
98
|
+
* @private
|
99
|
+
*/
|
100
|
+
async _fadeOut() {
|
101
|
+
const fadeOutDuration = 180;
|
102
|
+
const button = this._mainButton;
|
103
|
+
const newStateObject = this._effectiveStateObject;
|
104
|
+
if (!newStateObject) {
|
105
|
+
// eslint-disable-next-line no-console
|
106
|
+
console.warn(`State with name="${this.state}" doesn't exist!`);
|
107
|
+
}
|
108
|
+
else if (button) {
|
109
|
+
const buttonWidth = button.offsetWidth;
|
110
|
+
const hiddenButton = this.shadowRoot?.querySelector(".ui5-ai-button-hidden");
|
111
|
+
button.style.width = `${buttonWidth}px`;
|
112
|
+
hiddenButton.icon = newStateObject.icon;
|
113
|
+
hiddenButton.endIcon = newStateObject.endIcon;
|
114
|
+
hiddenButton.textContent = newStateObject.text || null;
|
115
|
+
await renderFinished();
|
116
|
+
const hiddenButtonWidth = hiddenButton.offsetWidth;
|
117
|
+
this.fadeOut = true;
|
118
|
+
button.style.width = `${hiddenButtonWidth}px`;
|
119
|
+
setTimeout(() => {
|
120
|
+
this.fadeMid = true;
|
121
|
+
this._currentStateObject = newStateObject;
|
122
|
+
this._fadeIn();
|
123
|
+
}, fadeOutDuration);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
/**
|
127
|
+
* Starts the fade-in animation.
|
128
|
+
* @private
|
129
|
+
*/
|
130
|
+
_fadeIn() {
|
131
|
+
const fadeInDuration = 60;
|
132
|
+
setTimeout(() => {
|
133
|
+
this.fadeIn = true;
|
134
|
+
this._resetFade();
|
135
|
+
}, fadeInDuration);
|
136
|
+
}
|
137
|
+
/**
|
138
|
+
* Resets the fade phases when the animation is completed.
|
139
|
+
* @private
|
140
|
+
*/
|
141
|
+
_resetFade() {
|
142
|
+
const fadeResetDuration = 160;
|
143
|
+
setTimeout(() => {
|
144
|
+
this.fadeOut = false;
|
145
|
+
this.fadeMid = false;
|
146
|
+
this.fadeIn = false;
|
147
|
+
}, fadeResetDuration);
|
148
|
+
// reset the button's width after animations
|
149
|
+
const button = this._mainButton;
|
150
|
+
if (button) {
|
151
|
+
button.style.width = "";
|
152
|
+
}
|
153
|
+
}
|
154
|
+
/**
|
155
|
+
* Handles the click event.
|
156
|
+
* @private
|
157
|
+
*/
|
158
|
+
_onclick(e) {
|
159
|
+
e.stopImmediatePropagation();
|
160
|
+
this.fireDecoratorEvent("click");
|
161
|
+
}
|
162
|
+
get _mainButton() {
|
163
|
+
return this.shadowRoot?.querySelector("[ui5-button]");
|
164
|
+
}
|
165
|
+
get _effectiveState() {
|
166
|
+
return this.state || (this.states.length && this.states[0].name) || "";
|
167
|
+
}
|
168
|
+
get _effectiveStateObject() {
|
169
|
+
return this.states.find(state => state.name === this._effectiveState);
|
170
|
+
}
|
171
|
+
get _stateIconOnly() {
|
172
|
+
return !this._stateText && !!this._stateIcon;
|
173
|
+
}
|
174
|
+
get _stateText() {
|
175
|
+
return this._currentStateObject?.text;
|
176
|
+
}
|
177
|
+
get _stateIcon() {
|
178
|
+
return this._currentStateObject?.icon;
|
179
|
+
}
|
180
|
+
get _stateEndIcon() {
|
181
|
+
return this._currentStateObject?.endIcon;
|
182
|
+
}
|
183
|
+
get _hasText() {
|
184
|
+
return !!this._stateText;
|
185
|
+
}
|
186
|
+
};
|
187
|
+
__decorate([
|
188
|
+
property()
|
189
|
+
], Button.prototype, "design", void 0);
|
190
|
+
__decorate([
|
191
|
+
property({ type: Boolean })
|
192
|
+
], Button.prototype, "disabled", void 0);
|
193
|
+
__decorate([
|
194
|
+
property()
|
195
|
+
], Button.prototype, "state", void 0);
|
196
|
+
__decorate([
|
197
|
+
property({ type: Object })
|
198
|
+
], Button.prototype, "_currentStateObject", void 0);
|
199
|
+
__decorate([
|
200
|
+
property({ type: Boolean })
|
201
|
+
], Button.prototype, "fadeOut", void 0);
|
202
|
+
__decorate([
|
203
|
+
property({ type: Boolean })
|
204
|
+
], Button.prototype, "fadeMid", void 0);
|
205
|
+
__decorate([
|
206
|
+
property({ type: Boolean })
|
207
|
+
], Button.prototype, "fadeIn", void 0);
|
208
|
+
__decorate([
|
209
|
+
slot({ type: HTMLElement, "default": true })
|
210
|
+
], Button.prototype, "states", void 0);
|
211
|
+
Button = __decorate([
|
212
|
+
customElement({
|
213
|
+
tag: "ui5-ai-button",
|
214
|
+
languageAware: true,
|
215
|
+
renderer: litRender,
|
216
|
+
template: ButtonTemplate,
|
217
|
+
styles: ButtonCss,
|
218
|
+
dependencies: [MainButton, Icon, ButtonState],
|
219
|
+
shadowRootOptions: { delegatesFocus: true },
|
220
|
+
})
|
221
|
+
/**
|
222
|
+
* Fired when the component is activated either with a
|
223
|
+
* mouse/tap or by using the Enter or Space key.
|
224
|
+
* @public
|
225
|
+
*/
|
226
|
+
,
|
227
|
+
event("click", {
|
228
|
+
bubbles: true,
|
229
|
+
})
|
230
|
+
], Button);
|
231
|
+
Button.define();
|
232
|
+
export default Button;
|
233
|
+
//# sourceMappingURL=Button.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAC3D,OAAO,IAAI,MAAM,iCAAiC,CAAC;AAEnD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAE3C,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAEzE,SAAS;AACT,OAAO,SAAS,MAAM,kCAAkC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAoBH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QACC;;;;WAIG;QAEH,WAAM,GAAuB,SAAS,CAAA;QAEtC;;;;;;WAMG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAkBjB;;;;WAIG;QAEH,YAAO,GAAG,KAAK,CAAC;QAEhB;;;;WAIG;QAEH,YAAO,GAAG,KAAK,CAAC;QAEhB;;;;WAIG;QAEH,WAAM,GAAG,KAAK,CAAC;IAqIhB,CAAC;IA3HA,iBAAiB;QAChB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjC,OAAO;QACR,CAAC;QAED,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B,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,CAAC;QAC7C,iBAAiB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;KAC3C,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;GACI,MAAM,CA8LX;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.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport MainButton from \"@ui5/webcomponents/dist/Button.js\";\nimport Icon from \"@ui5/webcomponents/dist/Icon.js\";\nimport type ButtonDesign from \"@ui5/webcomponents/dist/types/ButtonDesign.js\";\nimport ButtonState from \"./ButtonState.js\";\n\nimport ButtonTemplate from \"./generated/templates/ButtonTemplate.lit.js\";\n\n// Styles\nimport ButtonCss 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 name that identifies it and can have text, icon and end icon defined (in any combination) depending on the state purpose.\n *\n * You can choose from a set of predefined designs (the same as for regular `ui5-button` component) that allow different styling to correspond to the triggered action.\n *\n * `ui5-ai-button` can be activated by clicking or tapping it. The state can be changed in `click` event handler.\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: litRender,\n\ttemplate: ButtonTemplate,\n\tstyles: ButtonCss,\n\tdependencies: [MainButton, Icon, ButtonState],\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})\nclass Button extends UI5Element {\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 * 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 * Initiates button elements fade-out phase.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfadeOut = false;\n\n\t/**\n\t * Initiates button fade middle phase.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfadeMid = false;\n\n\t/**\n\t * Initiates button elements fade-in phase.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfadeIn = 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 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\tonBeforeRendering(): void {\n\t\tif (this.fadeOut || this.fadeIn) {\n\t\t\treturn;\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\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\n\t\tconst button = this._mainButton;\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} else if (button) {\n\t\t\tconst buttonWidth = button.offsetWidth;\n\t\t\tconst hiddenButton = this.shadowRoot?.querySelector(\".ui5-ai-button-hidden\") as MainButton;\n\t\t\tbutton.style.width = `${buttonWidth}px`;\n\t\t\thiddenButton.icon = newStateObject.icon;\n\t\t\thiddenButton.endIcon = newStateObject.endIcon;\n\t\t\thiddenButton.textContent = newStateObject.text || null;\n\n\t\t\tawait renderFinished();\n\t\t\tconst hiddenButtonWidth = hiddenButton.offsetWidth;\n\t\t\tthis.fadeOut = true;\n\t\t\tbutton.style.width = `${hiddenButtonWidth}px`;\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.fadeMid = true;\n\t\t\t\tthis._currentStateObject = newStateObject;\n\t\t\t\tthis._fadeIn();\n\t\t\t}, fadeOutDuration);\n\t\t}\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 = 60;\n\n\t\tsetTimeout(() => {\n\t\t\tthis.fadeIn = true;\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.fadeOut = false;\n\t\t\tthis.fadeMid = false;\n\t\t\tthis.fadeIn = false;\n\t\t}, fadeResetDuration);\n\n\t\t// reset the button's width after animations\n\t\tconst button = this._mainButton;\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: MouseEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\tget _mainButton() {\n\t\treturn this.shadowRoot?.querySelector(\"[ui5-button]\") as MainButton;\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\treturn this._currentStateObject?.endIcon;\n\t}\n\n\tget _hasText() {\n\t\treturn !!this._stateText;\n\t}\n}\n\nButton.define();\nexport default Button;\n"]}
|