@ui5/webcomponents-ai 2.6.0-rc.2 → 2.6.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/Button.d.ts +42 -32
- package/dist/Button.js +116 -76
- package/dist/Button.js.map +1 -1
- package/dist/ButtonState.d.ts +7 -0
- package/dist/ButtonState.js +13 -0
- package/dist/ButtonState.js.map +1 -1
- package/dist/ButtonTemplate.js +2 -2
- package/dist/ButtonTemplate.js.map +1 -1
- package/dist/css/themes/Button.css +1 -1
- package/dist/custom-elements-internal.json +54 -2
- package/dist/custom-elements.json +47 -2
- package/dist/generated/themes/Button.css.d.ts +1 -1
- package/dist/generated/themes/Button.css.js +1 -1
- package/dist/generated/themes/Button.css.js.map +1 -1
- package/dist/vscode.html-custom-data.json +11 -1
- package/dist/web-types.json +31 -3
- package/package.json +7 -7
- package/src/ButtonTemplate.tsx +8 -6
- package/src/themes/Button.css +75 -21
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,25 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
# [2.6.0-rc.4](https://github.com/SAP/ui5-webcomponents/compare/v2.6.0-rc.3...v2.6.0-rc.4) (2025-01-02)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @ui5/webcomponents-ai
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
# [2.6.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v2.6.0-rc.2...v2.6.0-rc.3) (2024-12-26)
|
15
|
+
|
16
|
+
|
17
|
+
### Features
|
18
|
+
|
19
|
+
* **ui5-ai-button:** implement split button functionality ([#10242](https://github.com/SAP/ui5-webcomponents/issues/10242)) ([55c9e4d](https://github.com/SAP/ui5-webcomponents/commit/55c9e4d67800d82a0d357eda8859b78d69dc25ab))
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
6
25
|
# [2.6.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.6.0-rc.1...v2.6.0-rc.2) (2024-12-19)
|
7
26
|
|
8
27
|
**Note:** Version bump only for package @ui5/webcomponents-ai
|
package/dist/Button.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
2
|
-
import
|
2
|
+
import SplitButton from "@ui5/webcomponents/dist/SplitButton.js";
|
3
3
|
import type ButtonDesign from "@ui5/webcomponents/dist/types/ButtonDesign.js";
|
4
4
|
import ButtonState from "./ButtonState.js";
|
5
5
|
/**
|
@@ -7,18 +7,21 @@ import ButtonState from "./ButtonState.js";
|
|
7
7
|
*
|
8
8
|
* ### Overview
|
9
9
|
*
|
10
|
-
* The `ui5-ai-button` component
|
11
|
-
*
|
12
|
-
* certain keyboard keys, such as Enter.
|
10
|
+
* 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`
|
11
|
+
* or by pressing keyboard keys like [Enter] or [Space].
|
13
12
|
*
|
14
13
|
* ### Usage
|
15
14
|
*
|
16
|
-
* For the `ui5-ai-button`
|
17
|
-
* Each state
|
15
|
+
* 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.
|
16
|
+
* Each state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.
|
17
|
+
* You can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.
|
18
18
|
*
|
19
|
-
* You can choose from a set of predefined designs
|
19
|
+
* You can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.
|
20
20
|
*
|
21
|
-
* `ui5-ai-button` can be activated by clicking or tapping it.
|
21
|
+
* 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
|
22
|
+
* in split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].
|
23
|
+
* You can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].
|
24
|
+
* To display additional actions, you can attach a menu to the arrow button.
|
22
25
|
*
|
23
26
|
* ### ES6 Module Import
|
24
27
|
*
|
@@ -32,7 +35,8 @@ import ButtonState from "./ButtonState.js";
|
|
32
35
|
*/
|
33
36
|
declare class Button extends UI5Element {
|
34
37
|
eventDetails: {
|
35
|
-
click: void;
|
38
|
+
"click": void;
|
39
|
+
"arrow-click": void;
|
36
40
|
};
|
37
41
|
/**
|
38
42
|
* Defines the component design.
|
@@ -56,34 +60,43 @@ declare class Button extends UI5Element {
|
|
56
60
|
*/
|
57
61
|
state?: string;
|
58
62
|
/**
|
59
|
-
*
|
60
|
-
*
|
61
|
-
|
62
|
-
_currentStateObject?: ButtonState;
|
63
|
-
/**
|
64
|
-
* Initiates button elements fade-out phase.
|
63
|
+
* Defines the active state of the arrow button in split mode.
|
64
|
+
* Set to true when the button is in split mode and a menu with additional options
|
65
|
+
* is opened by the arrow button. Set back to false when the menu is closed.
|
65
66
|
* @default false
|
66
|
-
* @
|
67
|
+
* @public
|
68
|
+
* @since 2.6.0
|
67
69
|
*/
|
68
|
-
|
70
|
+
activeArrowButton: boolean;
|
69
71
|
/**
|
70
|
-
*
|
71
|
-
* @default false
|
72
|
+
* Keeps the current state object of the component.
|
72
73
|
* @private
|
73
74
|
*/
|
74
|
-
|
75
|
+
_currentStateObject?: ButtonState;
|
75
76
|
/**
|
76
|
-
*
|
77
|
+
* Determines if the button is in icon-only mode.
|
78
|
+
* This property is animation related only.
|
77
79
|
* @default false
|
78
80
|
* @private
|
79
81
|
*/
|
80
|
-
|
82
|
+
iconOnly?: boolean | undefined;
|
81
83
|
/**
|
82
84
|
* Defines the available states of the component.
|
83
|
-
* **Note:** Although this slot accepts HTML Elements, it is strongly recommended that
|
85
|
+
* **Note:** Although this slot accepts HTML Elements, it is strongly recommended that
|
86
|
+
* you only use `ui5-ai-button-state` components in order to preserve the intended design.
|
84
87
|
* @public
|
85
88
|
*/
|
86
89
|
states: Array<ButtonState>;
|
90
|
+
_splitButton?: SplitButton;
|
91
|
+
_hiddenSplitButton?: SplitButton;
|
92
|
+
get _hideArrowButton(): boolean;
|
93
|
+
get _effectiveState(): string;
|
94
|
+
get _effectiveStateObject(): ButtonState | undefined;
|
95
|
+
get _stateIconOnly(): boolean;
|
96
|
+
get _stateText(): string | undefined;
|
97
|
+
get _stateIcon(): string | undefined;
|
98
|
+
get _stateEndIcon(): string | undefined;
|
99
|
+
get _hasText(): boolean;
|
87
100
|
onBeforeRendering(): void;
|
88
101
|
/**
|
89
102
|
* Starts the fade-out animation.
|
@@ -104,14 +117,11 @@ declare class Button extends UI5Element {
|
|
104
117
|
* Handles the click event.
|
105
118
|
* @private
|
106
119
|
*/
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
get _stateIcon(): string | undefined;
|
114
|
-
get _stateEndIcon(): string | undefined;
|
115
|
-
get _hasText(): boolean;
|
120
|
+
_onClick(e: CustomEvent): void;
|
121
|
+
/**
|
122
|
+
* Handles the arrow-click event when `ui5-ai-button` is in split mode.
|
123
|
+
* @private
|
124
|
+
*/
|
125
|
+
_onArrowClick(e: CustomEvent): void;
|
116
126
|
}
|
117
127
|
export default Button;
|
package/dist/Button.js
CHANGED
@@ -10,8 +10,9 @@ import customElement from "@ui5/webcomponents-base/dist/decorators/customElement
|
|
10
10
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
11
11
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
12
12
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
13
|
+
import query from "@ui5/webcomponents-base/dist/decorators/query.js";
|
13
14
|
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
14
|
-
import
|
15
|
+
import SplitButton from "@ui5/webcomponents/dist/SplitButton.js";
|
15
16
|
import Icon from "@ui5/webcomponents/dist/Icon.js";
|
16
17
|
import ButtonState from "./ButtonState.js";
|
17
18
|
import ButtonTemplate from "./ButtonTemplate.js";
|
@@ -22,18 +23,21 @@ import ButtonCss from "./generated/themes/Button.css.js";
|
|
22
23
|
*
|
23
24
|
* ### Overview
|
24
25
|
*
|
25
|
-
* The `ui5-ai-button` component
|
26
|
-
*
|
27
|
-
* certain keyboard keys, such as Enter.
|
26
|
+
* 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`
|
27
|
+
* or by pressing keyboard keys like [Enter] or [Space].
|
28
28
|
*
|
29
29
|
* ### Usage
|
30
30
|
*
|
31
|
-
* For the `ui5-ai-button`
|
32
|
-
* Each state
|
31
|
+
* 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.
|
32
|
+
* Each state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.
|
33
|
+
* You can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.
|
33
34
|
*
|
34
|
-
* You can choose from a set of predefined designs
|
35
|
+
* You can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.
|
35
36
|
*
|
36
|
-
* `ui5-ai-button` can be activated by clicking or tapping it.
|
37
|
+
* 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
|
38
|
+
* in split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].
|
39
|
+
* You can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].
|
40
|
+
* To display additional actions, you can attach a menu to the arrow button.
|
37
41
|
*
|
38
42
|
* ### ES6 Module Import
|
39
43
|
*
|
@@ -63,32 +67,57 @@ let Button = class Button extends UI5Element {
|
|
63
67
|
*/
|
64
68
|
this.disabled = false;
|
65
69
|
/**
|
66
|
-
*
|
70
|
+
* Defines the active state of the arrow button in split mode.
|
71
|
+
* Set to true when the button is in split mode and a menu with additional options
|
72
|
+
* is opened by the arrow button. Set back to false when the menu is closed.
|
67
73
|
* @default false
|
68
|
-
* @
|
69
|
-
|
70
|
-
this.fadeOut = false;
|
71
|
-
/**
|
72
|
-
* Initiates button fade middle phase.
|
73
|
-
* @default false
|
74
|
-
* @private
|
74
|
+
* @public
|
75
|
+
* @since 2.6.0
|
75
76
|
*/
|
76
|
-
this.
|
77
|
+
this.activeArrowButton = false;
|
77
78
|
/**
|
78
|
-
*
|
79
|
+
* Determines if the button is in icon-only mode.
|
80
|
+
* This property is animation related only.
|
79
81
|
* @default false
|
80
82
|
* @private
|
81
83
|
*/
|
82
|
-
this.
|
84
|
+
this.iconOnly = false;
|
85
|
+
}
|
86
|
+
get _hideArrowButton() {
|
87
|
+
return !this._effectiveStateObject?.splitMode;
|
88
|
+
}
|
89
|
+
get _effectiveState() {
|
90
|
+
return this.state || (this.states.length && this.states[0].name) || "";
|
91
|
+
}
|
92
|
+
get _effectiveStateObject() {
|
93
|
+
return this.states.find(state => state.name === this._effectiveState);
|
94
|
+
}
|
95
|
+
get _stateIconOnly() {
|
96
|
+
return !this._stateText && !!this._stateIcon;
|
97
|
+
}
|
98
|
+
get _stateText() {
|
99
|
+
return this._currentStateObject?.text;
|
100
|
+
}
|
101
|
+
get _stateIcon() {
|
102
|
+
return this._currentStateObject?.icon;
|
103
|
+
}
|
104
|
+
get _stateEndIcon() {
|
105
|
+
const endIcon = this._effectiveStateObject?.splitMode ? "" : this._effectiveStateObject?.endIcon;
|
106
|
+
return endIcon;
|
107
|
+
}
|
108
|
+
get _hasText() {
|
109
|
+
return !!this._stateText;
|
83
110
|
}
|
84
111
|
onBeforeRendering() {
|
85
|
-
|
86
|
-
|
112
|
+
const splitButton = this._splitButton;
|
113
|
+
if (splitButton) {
|
114
|
+
splitButton.activeArrowButton = this.activeArrowButton;
|
87
115
|
}
|
88
116
|
if (!this._currentStateObject?.name) {
|
89
117
|
this._currentStateObject = this._effectiveStateObject;
|
90
118
|
}
|
91
119
|
const currentStateName = this._currentStateObject?.name || "";
|
120
|
+
this.iconOnly = this._stateIconOnly;
|
92
121
|
if (currentStateName !== "" && currentStateName !== this._effectiveState) {
|
93
122
|
this._fadeOut();
|
94
123
|
}
|
@@ -99,38 +128,50 @@ let Button = class Button extends UI5Element {
|
|
99
128
|
*/
|
100
129
|
async _fadeOut() {
|
101
130
|
const fadeOutDuration = 180;
|
102
|
-
const button = this.
|
131
|
+
const button = this._splitButton;
|
132
|
+
const hiddenButton = this._hiddenSplitButton;
|
103
133
|
const newStateObject = this._effectiveStateObject;
|
104
134
|
if (!newStateObject) {
|
105
135
|
// eslint-disable-next-line no-console
|
106
136
|
console.warn(`State with name="${this.state}" doesn't exist!`);
|
137
|
+
return;
|
138
|
+
}
|
139
|
+
if (!button || !hiddenButton) {
|
140
|
+
return;
|
107
141
|
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
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);
|
142
|
+
const buttonWidth = button.offsetWidth;
|
143
|
+
const currentState = this._currentStateObject || {};
|
144
|
+
if ((!currentState.splitMode && newStateObject.splitMode) || (!currentState.endIcon && !!newStateObject.endIcon)) {
|
145
|
+
this.classList.add("ui5-ai-button-button-to-menu");
|
124
146
|
}
|
147
|
+
if ((currentState.splitMode && !newStateObject.splitMode) || (!!currentState.endIcon && !newStateObject.endIcon)) {
|
148
|
+
this.classList.add("ui5-ai-button-menu-to-button");
|
149
|
+
}
|
150
|
+
this.style.width = `${buttonWidth}px`;
|
151
|
+
hiddenButton.icon = newStateObject.icon;
|
152
|
+
hiddenButton._endIcon = newStateObject.endIcon;
|
153
|
+
hiddenButton.textContent = newStateObject.text || null;
|
154
|
+
hiddenButton._hideArrowButton = this._hideArrowButton;
|
155
|
+
await renderFinished();
|
156
|
+
const hiddenButtonWidth = hiddenButton.offsetWidth;
|
157
|
+
this.style.width = `${hiddenButtonWidth}px`;
|
158
|
+
this.classList.add("ui5-ai-button-fade-out");
|
159
|
+
setTimeout(() => {
|
160
|
+
this.classList.add("ui5-ai-button-fade-mid");
|
161
|
+
button._hideArrowButton = this._hideArrowButton;
|
162
|
+
this._fadeIn();
|
163
|
+
}, fadeOutDuration);
|
125
164
|
}
|
126
165
|
/**
|
127
166
|
* Starts the fade-in animation.
|
128
167
|
* @private
|
129
168
|
*/
|
130
169
|
_fadeIn() {
|
131
|
-
const fadeInDuration =
|
170
|
+
const fadeInDuration = 160;
|
132
171
|
setTimeout(() => {
|
133
|
-
|
172
|
+
const newStateObject = this._effectiveStateObject;
|
173
|
+
this._currentStateObject = newStateObject;
|
174
|
+
this.classList.add("ui5-ai-button-fade-in");
|
134
175
|
this._resetFade();
|
135
176
|
}, fadeInDuration);
|
136
177
|
}
|
@@ -141,12 +182,14 @@ let Button = class Button extends UI5Element {
|
|
141
182
|
_resetFade() {
|
142
183
|
const fadeResetDuration = 160;
|
143
184
|
setTimeout(() => {
|
144
|
-
this.
|
145
|
-
this.
|
146
|
-
this.
|
185
|
+
this.classList.remove("ui5-ai-button-fade-out");
|
186
|
+
this.classList.remove("ui5-ai-button-fade-mid");
|
187
|
+
this.classList.remove("ui5-ai-button-fade-in");
|
188
|
+
this.classList.remove("ui5-ai-button-button-to-menu");
|
189
|
+
this.classList.remove("ui5-ai-button-menu-to-button");
|
147
190
|
}, fadeResetDuration);
|
148
191
|
// reset the button's width after animations
|
149
|
-
const button = this.
|
192
|
+
const button = this._splitButton;
|
150
193
|
if (button) {
|
151
194
|
button.style.width = "";
|
152
195
|
}
|
@@ -155,33 +198,17 @@ let Button = class Button extends UI5Element {
|
|
155
198
|
* Handles the click event.
|
156
199
|
* @private
|
157
200
|
*/
|
158
|
-
|
201
|
+
_onClick(e) {
|
159
202
|
e.stopImmediatePropagation();
|
160
203
|
this.fireDecoratorEvent("click");
|
161
204
|
}
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
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;
|
205
|
+
/**
|
206
|
+
* Handles the arrow-click event when `ui5-ai-button` is in split mode.
|
207
|
+
* @private
|
208
|
+
*/
|
209
|
+
_onArrowClick(e) {
|
210
|
+
e.stopImmediatePropagation();
|
211
|
+
this.fireDecoratorEvent("arrow-click");
|
185
212
|
}
|
186
213
|
};
|
187
214
|
__decorate([
|
@@ -193,21 +220,24 @@ __decorate([
|
|
193
220
|
__decorate([
|
194
221
|
property()
|
195
222
|
], Button.prototype, "state", void 0);
|
223
|
+
__decorate([
|
224
|
+
property({ type: Boolean, noAttribute: true })
|
225
|
+
], Button.prototype, "activeArrowButton", void 0);
|
196
226
|
__decorate([
|
197
227
|
property({ type: Object })
|
198
228
|
], Button.prototype, "_currentStateObject", void 0);
|
199
229
|
__decorate([
|
200
230
|
property({ type: Boolean })
|
201
|
-
], Button.prototype, "
|
202
|
-
__decorate([
|
203
|
-
property({ type: Boolean })
|
204
|
-
], Button.prototype, "fadeMid", void 0);
|
205
|
-
__decorate([
|
206
|
-
property({ type: Boolean })
|
207
|
-
], Button.prototype, "fadeIn", void 0);
|
231
|
+
], Button.prototype, "iconOnly", void 0);
|
208
232
|
__decorate([
|
209
233
|
slot({ type: HTMLElement, "default": true })
|
210
234
|
], Button.prototype, "states", void 0);
|
235
|
+
__decorate([
|
236
|
+
query("[ui5-split-button]")
|
237
|
+
], Button.prototype, "_splitButton", void 0);
|
238
|
+
__decorate([
|
239
|
+
query(".ui5-ai-button-hidden[ui5-split-button]")
|
240
|
+
], Button.prototype, "_hiddenSplitButton", void 0);
|
211
241
|
Button = __decorate([
|
212
242
|
customElement({
|
213
243
|
tag: "ui5-ai-button",
|
@@ -215,7 +245,7 @@ Button = __decorate([
|
|
215
245
|
renderer: jsxRenderer,
|
216
246
|
template: ButtonTemplate,
|
217
247
|
styles: ButtonCss,
|
218
|
-
dependencies: [
|
248
|
+
dependencies: [SplitButton, Icon, ButtonState],
|
219
249
|
shadowRootOptions: { delegatesFocus: true },
|
220
250
|
})
|
221
251
|
/**
|
@@ -227,6 +257,16 @@ Button = __decorate([
|
|
227
257
|
event("click", {
|
228
258
|
bubbles: true,
|
229
259
|
})
|
260
|
+
/**
|
261
|
+
* Fired when the component is in split mode and after the arrow button
|
262
|
+
* is activated either by clicking or tapping it or by using the [Arrow Up] / [Arrow Down],
|
263
|
+
* [Alt] + [Arrow Up]/ [Arrow Down], or [F4] keyboard keys.
|
264
|
+
* @public
|
265
|
+
*/
|
266
|
+
,
|
267
|
+
event("arrow-click", {
|
268
|
+
bubbles: true,
|
269
|
+
})
|
230
270
|
], Button);
|
231
271
|
Button.define();
|
232
272
|
export default Button;
|
package/dist/Button.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;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ent":["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 jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.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 \"./ButtonTemplate.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: jsxRenderer,\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\teventDetails!: {\n\t\tclick: 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 * 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"]}
|
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,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,IAAI,MAAM,iCAAiC,CAAC;AAEnD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAE3C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,SAAS;AACT,OAAO,SAAS,MAAM,kCAAkC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO,EAAE,CAAC;wCACX;AASjB;IADC,QAAQ,EAAE;qCACI;AAWf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;iDACrB;AAO1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACO;AASlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACV;AASlB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;sCACjB;AAG5B;IADC,KAAK,CAAC,oBAAoB,CAAC;4CACD;AAG3B;IADC,KAAK,CAAC,yCAAyC,CAAC;kDAChB;AAxE5B,MAAM;IA7BX,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,WAAW,CAAC;QAC9C,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,aAAa,EAAE;QACrB,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,MAAM,CAqOX;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 SplitButton from \"@ui5/webcomponents/dist/SplitButton.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 \"./ButtonTemplate.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 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\tdependencies: [SplitButton, 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})\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-click\", {\n\tbubbles: true,\n})\n\nclass Button extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": void;\n\t\t\"arrow-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\tactiveArrowButton = false;\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\tget _hideArrowButton() {\n\t\treturn !this._effectiveStateObject?.splitMode;\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?.splitMode ? \"\" : 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.activeArrowButton;\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.splitMode && newStateObject.splitMode) || (!currentState.endIcon && !!newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-button-to-menu\");\n\t\t}\n\t\tif ((currentState.splitMode && !newStateObject.splitMode) || (!!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-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-click\");\n\t}\n}\n\nButton.define();\nexport default Button;\n"]}
|
package/dist/ButtonState.d.ts
CHANGED
@@ -56,5 +56,12 @@ declare class ButtonState extends UI5Element {
|
|
56
56
|
* @public
|
57
57
|
*/
|
58
58
|
endIcon?: string;
|
59
|
+
/**
|
60
|
+
* Defines if the component is in split button mode.
|
61
|
+
* @default false
|
62
|
+
* @since 2.6.0
|
63
|
+
* @public
|
64
|
+
*/
|
65
|
+
splitMode: boolean;
|
59
66
|
}
|
60
67
|
export default ButtonState;
|
package/dist/ButtonState.js
CHANGED
@@ -30,6 +30,16 @@ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
30
30
|
* @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.
|
31
31
|
*/
|
32
32
|
let ButtonState = class ButtonState extends UI5Element {
|
33
|
+
constructor() {
|
34
|
+
super(...arguments);
|
35
|
+
/**
|
36
|
+
* Defines if the component is in split button mode.
|
37
|
+
* @default false
|
38
|
+
* @since 2.6.0
|
39
|
+
* @public
|
40
|
+
*/
|
41
|
+
this.splitMode = false;
|
42
|
+
}
|
33
43
|
};
|
34
44
|
__decorate([
|
35
45
|
property()
|
@@ -43,6 +53,9 @@ __decorate([
|
|
43
53
|
__decorate([
|
44
54
|
property()
|
45
55
|
], ButtonState.prototype, "endIcon", void 0);
|
56
|
+
__decorate([
|
57
|
+
property({ type: Boolean })
|
58
|
+
], ButtonState.prototype, "splitMode", void 0);
|
46
59
|
ButtonState = __decorate([
|
47
60
|
customElement("ui5-ai-button-state")
|
48
61
|
], ButtonState);
|
package/dist/ButtonState.js.map
CHANGED
@@ -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;
|
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,cAAS,GAAG,KAAK,CAAC;IACnB,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;8CACV;AAlDb,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-si-button-state` is an abstract element, representing a state of `ui5-ai-button`. It is meant to be used in the `states` slot\n * of `ui5-ai-button` and should 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 availabe 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\tsplitMode = false;\n}\n\nButtonState.define();\nexport default ButtonState;\n"]}
|
package/dist/ButtonTemplate.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
|
2
|
-
import
|
2
|
+
import SplitButton from "@ui5/webcomponents/dist/SplitButton.js";
|
3
3
|
export default function ButtonTemplate() {
|
4
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
4
|
+
return (_jsxs(_Fragment, { children: [_jsx(SplitButton, { class: "ui5-ai-button-inner", design: this.design, icon: this._stateIcon, disabled: this.disabled, _endIcon: this._stateEndIcon, _hideArrowButton: this._hideArrowButton, onClick: this._onClick, onArrowClick: this._onArrowClick, children: this._hasText && (_jsx("div", { class: "ui5-ai-button-text", children: this._stateText })) }), _jsx(SplitButton, { class: "ui5-ai-button-hidden", design: this.design })] }));
|
5
5
|
}
|
6
6
|
//# sourceMappingURL=ButtonTemplate.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ButtonTemplate.js","sourceRoot":"","sources":["../src/ButtonTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
1
|
+
{"version":3,"file":"ButtonTemplate.js","sourceRoot":"","sources":["../src/ButtonTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,wCAAwC,CAAC;AAGjE,MAAM,CAAC,OAAO,UAAU,cAAc;IACrC,OAAO,CAAC,8BACP,KAAC,WAAW,IACX,KAAK,EAAC,qBAAqB,EAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAE,IAAI,CAAC,UAAU,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAC5B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,YAAY,EAAE,IAAI,CAAC,aAAa,YAE/B,IAAI,CAAC,QAAQ,IAAI,CACjB,cAAK,KAAK,EAAC,oBAAoB,YAAE,IAAI,CAAC,UAAU,GAAO,CACvD,GACY,EAEd,KAAC,WAAW,IACX,KAAK,EAAC,sBAAsB,EAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,GAClB,IACA,CAAC,CAAC;AACN,CAAC","sourcesContent":["import SplitButton from \"@ui5/webcomponents/dist/SplitButton.js\";\nimport type Button from \"./Button.js\";\n\nexport default function ButtonTemplate(this: Button) {\n\treturn (<>\n\t\t<SplitButton\n\t\t\tclass=\"ui5-ai-button-inner\"\n\t\t\tdesign={this.design}\n\t\t\ticon={this._stateIcon}\n\t\t\tdisabled={this.disabled}\n\t\t\t_endIcon={this._stateEndIcon}\n\t\t\t_hideArrowButton={this._hideArrowButton}\n\t\t\tonClick={this._onClick}\n\t\t\tonArrowClick={this._onArrowClick}\n\t\t>\n\t\t\t{this._hasText && (\n\t\t\t\t<div class=\"ui5-ai-button-text\">{this._stateText}</div>\n\t\t\t)}\n\t\t</SplitButton>\n\n\t\t<SplitButton\n\t\t\tclass=\"ui5-ai-button-hidden\"\n\t\t\tdesign={this.design}\n\t\t/>\n\t</>);\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
:host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host
|
1
|
+
:host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host .ui5-ai-button-inner{width:100%}:host{width:auto;position:relative;transition:width .18s cubic-bezier(.67,1,.95,1.3) .12s}:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)!important;max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)!important}:host(.ui5-ai-button-menu-to-button) .ui5-ai-button-inner::part(button),:host(.ui5-ai-button-fade-out:not([icon-only])) .ui5-ai-button-inner::part(button){justify-content:flex-start}:host([icon-only]) .ui5-ai-button-inner[_end-icon]:not([_end-icon=""])::part(button),:host([icon-only]) .ui5-ai-button-inner[_hide-arrow-button]::part(button){justify-content:flex-start;padding-inline-start:var(--_ui5-v2-6-0-rc-4_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(button){max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)}:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width);max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)}:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) .ui5-ai-button-text,:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(endIcon),:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(arrowButton){opacity:1;transform:translateY(0)}:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(endIcon),:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(arrowButton){display:none;transform:translateY(0);opacity:0}:host(.ui5-ai-button-fade-out) .ui5-ai-button-text{opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-out) ::part(icon){opacity:0;transform:translateY(-1rem);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-out) ::part(endIcon){opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-mid) .ui5-ai-button-text,:host(.ui5-ai-button-fade-mid) ::part(icon),:host(.ui5-ai-button-fade-mid) ::part(endIcon),:host(.ui5-ai-button-fade-mid) ::part(arrowButton){opacity:0;transform:translateY(1rem);transition:none}:host(.ui5-ai-button-fade-in) .ui5-ai-button-text{opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-in) ::part(icon){opacity:1;transform:translateY(0);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-in) ::part(endIcon){opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}
|
@@ -14,12 +14,12 @@
|
|
14
14
|
"declarations": [
|
15
15
|
{
|
16
16
|
"kind": "class",
|
17
|
-
"description": "### Overview\n\nThe `ui5-ai-button` component
|
17
|
+
"description": "### Overview\n\nThe `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\nor by pressing keyboard keys like [Enter] or [Space].\n\n### Usage\n\nFor 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.\nEach state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\nYou can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n\nYou can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n\nThe `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\nin split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\nYou can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\nTo 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\";`",
|
18
18
|
"name": "Button",
|
19
19
|
"slots": [
|
20
20
|
{
|
21
21
|
"name": "default",
|
22
|
-
"description": "Defines the available states of the component.\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that
|
22
|
+
"description": "Defines the available states of the component.\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that\nyou only use `ui5-ai-button-state` components in order to preserve the intended design.",
|
23
23
|
"_ui5propertyName": "states",
|
24
24
|
"_ui5type": {
|
25
25
|
"text": "Array<ButtonState>",
|
@@ -71,6 +71,18 @@
|
|
71
71
|
"description": "Defines the current state of the component.",
|
72
72
|
"default": "undefined",
|
73
73
|
"privacy": "public"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"kind": "field",
|
77
|
+
"name": "activeArrowButton",
|
78
|
+
"type": {
|
79
|
+
"text": "boolean"
|
80
|
+
},
|
81
|
+
"default": "false",
|
82
|
+
"description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
|
83
|
+
"privacy": "public",
|
84
|
+
"_ui5since": "2.6.0",
|
85
|
+
"_ui5noAttribute": true
|
74
86
|
}
|
75
87
|
],
|
76
88
|
"events": [
|
@@ -84,6 +96,17 @@
|
|
84
96
|
"_ui5Cancelable": false,
|
85
97
|
"_ui5allowPreventDefault": false,
|
86
98
|
"_ui5Bubbles": true
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"name": "arrow-click",
|
102
|
+
"_ui5privacy": "public",
|
103
|
+
"type": {
|
104
|
+
"text": "CustomEvent"
|
105
|
+
},
|
106
|
+
"description": "Fired when the component is in split mode and after the arrow button\nis 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.",
|
107
|
+
"_ui5Cancelable": false,
|
108
|
+
"_ui5allowPreventDefault": false,
|
109
|
+
"_ui5Bubbles": true
|
87
110
|
}
|
88
111
|
],
|
89
112
|
"attributes": [
|
@@ -113,6 +136,15 @@
|
|
113
136
|
"type": {
|
114
137
|
"text": "string | undefined"
|
115
138
|
}
|
139
|
+
},
|
140
|
+
{
|
141
|
+
"description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
|
142
|
+
"name": "active-arrow-button",
|
143
|
+
"default": "false",
|
144
|
+
"fieldName": "activeArrowButton",
|
145
|
+
"type": {
|
146
|
+
"text": "boolean"
|
147
|
+
}
|
116
148
|
}
|
117
149
|
],
|
118
150
|
"superclass": {
|
@@ -194,6 +226,17 @@
|
|
194
226
|
"description": "Defines the icon to be displayed as graphical element within the component after the text.\nThe SAP-icons font provides numerous options.\n\n**Example:**\n\nSee all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).",
|
195
227
|
"default": "undefined",
|
196
228
|
"privacy": "public"
|
229
|
+
},
|
230
|
+
{
|
231
|
+
"kind": "field",
|
232
|
+
"name": "splitMode",
|
233
|
+
"type": {
|
234
|
+
"text": "boolean"
|
235
|
+
},
|
236
|
+
"default": "false",
|
237
|
+
"description": "Defines if the component is in split button mode.",
|
238
|
+
"privacy": "public",
|
239
|
+
"_ui5since": "2.6.0"
|
197
240
|
}
|
198
241
|
],
|
199
242
|
"attributes": [
|
@@ -232,6 +275,15 @@
|
|
232
275
|
"type": {
|
233
276
|
"text": "string | undefined"
|
234
277
|
}
|
278
|
+
},
|
279
|
+
{
|
280
|
+
"description": "Defines if the component is in split button mode.",
|
281
|
+
"name": "split-mode",
|
282
|
+
"default": "false",
|
283
|
+
"fieldName": "splitMode",
|
284
|
+
"type": {
|
285
|
+
"text": "boolean"
|
286
|
+
}
|
235
287
|
}
|
236
288
|
],
|
237
289
|
"superclass": {
|
@@ -14,12 +14,12 @@
|
|
14
14
|
"declarations": [
|
15
15
|
{
|
16
16
|
"kind": "class",
|
17
|
-
"description": "### Overview\n\nThe `ui5-ai-button` component
|
17
|
+
"description": "### Overview\n\nThe `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\nor by pressing keyboard keys like [Enter] or [Space].\n\n### Usage\n\nFor 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.\nEach state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\nYou can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n\nYou can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n\nThe `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\nin split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\nYou can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\nTo 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\";`",
|
18
18
|
"name": "Button",
|
19
19
|
"slots": [
|
20
20
|
{
|
21
21
|
"name": "default",
|
22
|
-
"description": "Defines the available states of the component.\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that
|
22
|
+
"description": "Defines the available states of the component.\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that\nyou only use `ui5-ai-button-state` components in order to preserve the intended design."
|
23
23
|
}
|
24
24
|
],
|
25
25
|
"members": [
|
@@ -59,6 +59,16 @@
|
|
59
59
|
"description": "Defines the current state of the component.",
|
60
60
|
"default": "undefined",
|
61
61
|
"privacy": "public"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"kind": "field",
|
65
|
+
"name": "activeArrowButton",
|
66
|
+
"type": {
|
67
|
+
"text": "boolean"
|
68
|
+
},
|
69
|
+
"default": "false",
|
70
|
+
"description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
|
71
|
+
"privacy": "public"
|
62
72
|
}
|
63
73
|
],
|
64
74
|
"events": [
|
@@ -68,6 +78,13 @@
|
|
68
78
|
"text": "CustomEvent"
|
69
79
|
},
|
70
80
|
"description": "Fired when the component is activated either with a\nmouse/tap or by using the Enter or Space key."
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"name": "arrow-click",
|
84
|
+
"type": {
|
85
|
+
"text": "CustomEvent"
|
86
|
+
},
|
87
|
+
"description": "Fired when the component is in split mode and after the arrow button\nis 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."
|
71
88
|
}
|
72
89
|
],
|
73
90
|
"attributes": [
|
@@ -97,6 +114,15 @@
|
|
97
114
|
"type": {
|
98
115
|
"text": "string | undefined"
|
99
116
|
}
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
|
120
|
+
"name": "active-arrow-button",
|
121
|
+
"default": "false",
|
122
|
+
"fieldName": "activeArrowButton",
|
123
|
+
"type": {
|
124
|
+
"text": "boolean"
|
125
|
+
}
|
100
126
|
}
|
101
127
|
],
|
102
128
|
"superclass": {
|
@@ -175,6 +201,16 @@
|
|
175
201
|
"description": "Defines the icon to be displayed as graphical element within the component after the text.\nThe SAP-icons font provides numerous options.\n\n**Example:**\n\nSee all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).",
|
176
202
|
"default": "undefined",
|
177
203
|
"privacy": "public"
|
204
|
+
},
|
205
|
+
{
|
206
|
+
"kind": "field",
|
207
|
+
"name": "splitMode",
|
208
|
+
"type": {
|
209
|
+
"text": "boolean"
|
210
|
+
},
|
211
|
+
"default": "false",
|
212
|
+
"description": "Defines if the component is in split button mode.",
|
213
|
+
"privacy": "public"
|
178
214
|
}
|
179
215
|
],
|
180
216
|
"attributes": [
|
@@ -213,6 +249,15 @@
|
|
213
249
|
"type": {
|
214
250
|
"text": "string | undefined"
|
215
251
|
}
|
252
|
+
},
|
253
|
+
{
|
254
|
+
"description": "Defines if the component is in split button mode.",
|
255
|
+
"name": "split-mode",
|
256
|
+
"default": "false",
|
257
|
+
"fieldName": "splitMode",
|
258
|
+
"type": {
|
259
|
+
"text": "boolean"
|
260
|
+
}
|
216
261
|
}
|
217
262
|
],
|
218
263
|
"superclass": {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: ":host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host
|
1
|
+
declare const _default: ":host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host .ui5-ai-button-inner{width:100%}:host{width:auto;position:relative;transition:width .18s cubic-bezier(.67,1,.95,1.3) .12s}:host([icon-only]) .ui5-ai-button-inner[_end-icon=\"\"]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)!important;max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)!important}:host(.ui5-ai-button-menu-to-button) .ui5-ai-button-inner::part(button),:host(.ui5-ai-button-fade-out:not([icon-only])) .ui5-ai-button-inner::part(button){justify-content:flex-start}:host([icon-only]) .ui5-ai-button-inner[_end-icon]:not([_end-icon=\"\"])::part(button),:host([icon-only]) .ui5-ai-button-inner[_hide-arrow-button]::part(button){justify-content:flex-start;padding-inline-start:var(--_ui5-v2-6-0-rc-4_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=\"\"]::part(button){max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)}:host([icon-only]) .ui5-ai-button-inner[_end-icon=\"\"]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width);max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)}:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) .ui5-ai-button-text,:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(endIcon),:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(arrowButton){opacity:1;transform:translateY(0)}:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(endIcon),:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(arrowButton){display:none;transform:translateY(0);opacity:0}:host(.ui5-ai-button-fade-out) .ui5-ai-button-text{opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-out) ::part(icon){opacity:0;transform:translateY(-1rem);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-out) ::part(endIcon){opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-mid) .ui5-ai-button-text,:host(.ui5-ai-button-fade-mid) ::part(icon),:host(.ui5-ai-button-fade-mid) ::part(endIcon),:host(.ui5-ai-button-fade-mid) ::part(arrowButton){opacity:0;transform:translateY(1rem);transition:none}:host(.ui5-ai-button-fade-in) .ui5-ai-button-text{opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-in) ::part(icon){opacity:1;transform:translateY(0);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-in) ::part(endIcon){opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}\n";
|
2
2
|
export default _default;
|
@@ -3,6 +3,6 @@ import defaultThemeBase from "@ui5/webcomponents-theming/dist/generated/themes/s
|
|
3
3
|
import defaultTheme from "./sap_horizon/parameters-bundle.css.js";
|
4
4
|
registerThemePropertiesLoader("@ui5/webcomponents-theming", "sap_horizon", async () => defaultThemeBase);
|
5
5
|
registerThemePropertiesLoader("@ui5/webcomponents-ai", "sap_horizon", async () => defaultTheme);
|
6
|
-
export default `:host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host
|
6
|
+
export default `:host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host .ui5-ai-button-inner{width:100%}:host{width:auto;position:relative;transition:width .18s cubic-bezier(.67,1,.95,1.3) .12s}:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)!important;max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)!important}:host(.ui5-ai-button-menu-to-button) .ui5-ai-button-inner::part(button),:host(.ui5-ai-button-fade-out:not([icon-only])) .ui5-ai-button-inner::part(button){justify-content:flex-start}:host([icon-only]) .ui5-ai-button-inner[_end-icon]:not([_end-icon=""])::part(button),:host([icon-only]) .ui5-ai-button-inner[_hide-arrow-button]::part(button){justify-content:flex-start;padding-inline-start:var(--_ui5-v2-6-0-rc-4_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(button){max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)}:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width);max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)}:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) .ui5-ai-button-text,:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(endIcon),:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(arrowButton){opacity:1;transform:translateY(0)}:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(endIcon),:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(arrowButton){display:none;transform:translateY(0);opacity:0}:host(.ui5-ai-button-fade-out) .ui5-ai-button-text{opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-out) ::part(icon){opacity:0;transform:translateY(-1rem);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-out) ::part(endIcon){opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-mid) .ui5-ai-button-text,:host(.ui5-ai-button-fade-mid) ::part(icon),:host(.ui5-ai-button-fade-mid) ::part(endIcon),:host(.ui5-ai-button-fade-mid) ::part(arrowButton){opacity:0;transform:translateY(1rem);transition:none}:host(.ui5-ai-button-fade-in) .ui5-ai-button-text{opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-in) ::part(icon){opacity:1;transform:translateY(0);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-in) ::part(endIcon){opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}
|
7
7
|
`;
|
8
8
|
//# sourceMappingURL=Button.css.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.css.js","sourceRoot":"","sources":["../../../src/generated/themes/Button.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yDAAyD,CAAC;AAExG,OAAO,gBAAgB,MAAM,uFAAuF,CAAC;AACrH,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAElE,6BAA6B,CAAC,4BAA4B,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;AACzG,6BAA6B,CAAC,uBAAuB,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC;AAChG,eAAe;CACd,CAAA","sourcesContent":["import { registerThemePropertiesLoader } from \"@ui5/webcomponents-base/dist/asset-registries/Themes.js\";\n\nimport defaultThemeBase from \"@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js\";\nimport defaultTheme from \"./sap_horizon/parameters-bundle.css.js\";\n\nregisterThemePropertiesLoader(\"@ui5/webcomponents-theming\", \"sap_horizon\", async () => defaultThemeBase);\nregisterThemePropertiesLoader(\"@ui5/webcomponents-ai\", \"sap_horizon\", async () => defaultTheme);\nexport default `:host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host
|
1
|
+
{"version":3,"file":"Button.css.js","sourceRoot":"","sources":["../../../src/generated/themes/Button.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yDAAyD,CAAC;AAExG,OAAO,gBAAgB,MAAM,uFAAuF,CAAC;AACrH,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAElE,6BAA6B,CAAC,4BAA4B,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;AACzG,6BAA6B,CAAC,uBAAuB,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC;AAChG,eAAe;CACd,CAAA","sourcesContent":["import { registerThemePropertiesLoader } from \"@ui5/webcomponents-base/dist/asset-registries/Themes.js\";\n\nimport defaultThemeBase from \"@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js\";\nimport defaultTheme from \"./sap_horizon/parameters-bundle.css.js\";\n\nregisterThemePropertiesLoader(\"@ui5/webcomponents-theming\", \"sap_horizon\", async () => defaultThemeBase);\nregisterThemePropertiesLoader(\"@ui5/webcomponents-ai\", \"sap_horizon\", async () => defaultTheme);\nexport default `:host{display:inline-block}:host([disabled]){pointer-events:none}.ui5-ai-button-text{display:inline-block}:host([icon-only]) .ui5-ai-button-text{min-width:0;margin-inline-start:0}.ui5-ai-button-hidden{position:absolute;top:-10000px;left:-10000px;visibility:hidden;display:block;width:fit-content}:host .ui5-ai-button-inner{width:100%}:host{width:auto;position:relative;transition:width .18s cubic-bezier(.67,1,.95,1.3) .12s}:host([icon-only]) .ui5-ai-button-inner[_end-icon=\"\"]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)!important;max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)!important}:host(.ui5-ai-button-menu-to-button) .ui5-ai-button-inner::part(button),:host(.ui5-ai-button-fade-out:not([icon-only])) .ui5-ai-button-inner::part(button){justify-content:flex-start}:host([icon-only]) .ui5-ai-button-inner[_end-icon]:not([_end-icon=\"\"])::part(button),:host([icon-only]) .ui5-ai-button-inner[_hide-arrow-button]::part(button){justify-content:flex-start;padding-inline-start:var(--_ui5-v2-6-0-rc-4_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=\"\"]::part(button){max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)}:host([icon-only]) .ui5-ai-button-inner[_end-icon=\"\"]::part(textButton),:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton){min-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width);max-width:var(--_ui5-v2-6-0-rc-4_button_base_min_width)}:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) .ui5-ai-button-text,:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(endIcon),:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(arrowButton){opacity:1;transform:translateY(0)}:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(endIcon),:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(arrowButton){display:none;transform:translateY(0);opacity:0}:host(.ui5-ai-button-fade-out) .ui5-ai-button-text{opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-out) ::part(icon){opacity:0;transform:translateY(-1rem);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-out) ::part(endIcon){opacity:0;transform:translateY(-1rem);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-mid) .ui5-ai-button-text,:host(.ui5-ai-button-fade-mid) ::part(icon),:host(.ui5-ai-button-fade-mid) ::part(endIcon),:host(.ui5-ai-button-fade-mid) ::part(arrowButton){opacity:0;transform:translateY(1rem);transition:none}:host(.ui5-ai-button-fade-in) .ui5-ai-button-text{opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}:host(.ui5-ai-button-fade-in) ::part(icon){opacity:1;transform:translateY(0);transition:opacity .05s ease-in-out 25ms,transform .1s ease-in-out 0s}:host(.ui5-ai-button-fade-in) ::part(endIcon){opacity:1;transform:translateY(0);transition:opacity .06s ease-in-out .12s,transform .08s ease-in-out .12s}\n`"]}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"tags": [
|
4
4
|
{
|
5
5
|
"name": "ui5-ai-button",
|
6
|
-
"description": "### Overview\n\nThe `ui5-ai-button` component
|
6
|
+
"description": "### Overview\n\nThe `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\nor by pressing keyboard keys like [Enter] or [Space].\n\n### Usage\n\nFor 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.\nEach state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\nYou can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n\nYou can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n\nThe `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\nin split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\nYou can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\nTo 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\n---\n\n\n\n\n### **Events:**\n - **click** - Fired when the component is activated either with a\nmouse/tap or by using the Enter or Space key.\n- **arrow-click** - Fired when the component is in split mode and after the arrow button\nis 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\n### **Slots:**\n - **default** - Defines the available states of the component.\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that\nyou only use `ui5-ai-button-state` components in order to preserve the intended design.",
|
7
7
|
"attributes": [
|
8
8
|
{
|
9
9
|
"name": "design",
|
@@ -26,6 +26,11 @@
|
|
26
26
|
"name": "state",
|
27
27
|
"description": "Defines the current state of the component.",
|
28
28
|
"values": []
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"name": "active-arrow-button",
|
32
|
+
"description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
|
33
|
+
"values": []
|
29
34
|
}
|
30
35
|
],
|
31
36
|
"references": []
|
@@ -53,6 +58,11 @@
|
|
53
58
|
"name": "end-icon",
|
54
59
|
"description": "Defines the icon to be displayed as graphical element within the component after the text.\nThe SAP-icons font provides numerous options.\n\n**Example:**\n\nSee all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).",
|
55
60
|
"values": []
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"name": "split-mode",
|
64
|
+
"description": "Defines if the component is in split button mode.",
|
65
|
+
"values": []
|
56
66
|
}
|
57
67
|
],
|
58
68
|
"references": []
|
package/dist/web-types.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
3
3
|
"name": "@ui5/webcomponents-ai",
|
4
|
-
"version": "2.6.0-rc.
|
4
|
+
"version": "2.6.0-rc.4",
|
5
5
|
"description-markup": "markdown",
|
6
6
|
"contributions": {
|
7
7
|
"html": {
|
8
8
|
"elements": [
|
9
9
|
{
|
10
10
|
"name": "ui5-ai-button",
|
11
|
-
"description": "### Overview\n\nThe `ui5-ai-button` component
|
11
|
+
"description": "### Overview\n\nThe `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\nor by pressing keyboard keys like [Enter] or [Space].\n\n### Usage\n\nFor 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.\nEach state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\nYou can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n\nYou can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n\nThe `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\nin split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\nYou can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\nTo 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\n\n### **Events:**\n - **click** - Fired when the component is activated either with a\nmouse/tap or by using the Enter or Space key.\n- **arrow-click** - Fired when the component is in split mode and after the arrow button\nis 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\n### **Slots:**\n - **default** - Defines the available states of the component.\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that\nyou only use `ui5-ai-button-state` components in order to preserve the intended design.",
|
12
12
|
"doc-url": "",
|
13
13
|
"attributes": [
|
14
14
|
{
|
@@ -28,18 +28,27 @@
|
|
28
28
|
"name": "state",
|
29
29
|
"description": "Defines the current state of the component.",
|
30
30
|
"value": { "type": "string | undefined", "default": "undefined" }
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "active-arrow-button",
|
34
|
+
"description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
|
35
|
+
"value": { "type": "boolean", "default": "false" }
|
31
36
|
}
|
32
37
|
],
|
33
38
|
"slots": [
|
34
39
|
{
|
35
40
|
"name": "default",
|
36
|
-
"description": "Defines the available states of the component.\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that
|
41
|
+
"description": "Defines the available states of the component.\n**Note:** Although this slot accepts HTML Elements, it is strongly recommended that\nyou only use `ui5-ai-button-state` components in order to preserve the intended design."
|
37
42
|
}
|
38
43
|
],
|
39
44
|
"events": [
|
40
45
|
{
|
41
46
|
"name": "click",
|
42
47
|
"description": "Fired when the component is activated either with a\nmouse/tap or by using the Enter or Space key."
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"name": "arrow-click",
|
51
|
+
"description": "Fired when the component is in split mode and after the arrow button\nis 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."
|
43
52
|
}
|
44
53
|
],
|
45
54
|
"js": {
|
@@ -60,12 +69,21 @@
|
|
60
69
|
"name": "state",
|
61
70
|
"description": "Defines the current state of the component.",
|
62
71
|
"value": { "type": "string | undefined" }
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"name": "active-arrow-button",
|
75
|
+
"description": "Defines the active state of the arrow button in split mode.\nSet to true when the button is in split mode and a menu with additional options\nis opened by the arrow button. Set back to false when the menu is closed.",
|
76
|
+
"value": { "type": "boolean" }
|
63
77
|
}
|
64
78
|
],
|
65
79
|
"events": [
|
66
80
|
{
|
67
81
|
"name": "click",
|
68
82
|
"description": "Fired when the component is activated either with a\nmouse/tap or by using the Enter or Space key."
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"name": "arrow-click",
|
86
|
+
"description": "Fired when the component is in split mode and after the arrow button\nis 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."
|
69
87
|
}
|
70
88
|
]
|
71
89
|
}
|
@@ -94,6 +112,11 @@
|
|
94
112
|
"name": "end-icon",
|
95
113
|
"description": "Defines the icon to be displayed as graphical element within the component after the text.\nThe SAP-icons font provides numerous options.\n\n**Example:**\n\nSee all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).",
|
96
114
|
"value": { "type": "string | undefined", "default": "undefined" }
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"name": "split-mode",
|
118
|
+
"description": "Defines if the component is in split button mode.",
|
119
|
+
"value": { "type": "boolean", "default": "false" }
|
97
120
|
}
|
98
121
|
],
|
99
122
|
"events": [],
|
@@ -118,6 +141,11 @@
|
|
118
141
|
"name": "end-icon",
|
119
142
|
"description": "Defines the icon to be displayed as graphical element within the component after the text.\nThe SAP-icons font provides numerous options.\n\n**Example:**\n\nSee all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).",
|
120
143
|
"value": { "type": "string | undefined" }
|
144
|
+
},
|
145
|
+
{
|
146
|
+
"name": "split-mode",
|
147
|
+
"description": "Defines if the component is in split button mode.",
|
148
|
+
"value": { "type": "boolean" }
|
121
149
|
}
|
122
150
|
],
|
123
151
|
"events": []
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-ai",
|
3
|
-
"version": "2.6.0-rc.
|
3
|
+
"version": "2.6.0-rc.4",
|
4
4
|
"description": "UI5 Web Components: webcomponents.ai",
|
5
5
|
"ui5": {
|
6
6
|
"webComponentsPackage": true
|
@@ -45,14 +45,14 @@
|
|
45
45
|
"directory": "packages/ai"
|
46
46
|
},
|
47
47
|
"dependencies": {
|
48
|
-
"@ui5/webcomponents": "2.6.0-rc.
|
49
|
-
"@ui5/webcomponents-base": "2.6.0-rc.
|
50
|
-
"@ui5/webcomponents-icons": "2.6.0-rc.
|
51
|
-
"@ui5/webcomponents-theming": "2.6.0-rc.
|
48
|
+
"@ui5/webcomponents": "2.6.0-rc.4",
|
49
|
+
"@ui5/webcomponents-base": "2.6.0-rc.4",
|
50
|
+
"@ui5/webcomponents-icons": "2.6.0-rc.4",
|
51
|
+
"@ui5/webcomponents-theming": "2.6.0-rc.4"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
|
-
"@ui5/webcomponents-tools": "2.6.0-rc.
|
54
|
+
"@ui5/webcomponents-tools": "2.6.0-rc.4",
|
55
55
|
"chromedriver": "^131.0.0"
|
56
56
|
},
|
57
|
-
"gitHead": "
|
57
|
+
"gitHead": "4111a62df398a150c35a35658a515dd9ca840e69"
|
58
58
|
}
|
package/src/ButtonTemplate.tsx
CHANGED
@@ -1,22 +1,24 @@
|
|
1
|
-
import
|
1
|
+
import SplitButton from "@ui5/webcomponents/dist/SplitButton.js";
|
2
2
|
import type Button from "./Button.js";
|
3
3
|
|
4
4
|
export default function ButtonTemplate(this: Button) {
|
5
5
|
return (<>
|
6
|
-
<
|
6
|
+
<SplitButton
|
7
7
|
class="ui5-ai-button-inner"
|
8
8
|
design={this.design}
|
9
9
|
icon={this._stateIcon}
|
10
|
-
endIcon={this._stateEndIcon}
|
11
10
|
disabled={this.disabled}
|
12
|
-
|
11
|
+
_endIcon={this._stateEndIcon}
|
12
|
+
_hideArrowButton={this._hideArrowButton}
|
13
|
+
onClick={this._onClick}
|
14
|
+
onArrowClick={this._onArrowClick}
|
13
15
|
>
|
14
16
|
{this._hasText && (
|
15
17
|
<div class="ui5-ai-button-text">{this._stateText}</div>
|
16
18
|
)}
|
17
|
-
</
|
19
|
+
</SplitButton>
|
18
20
|
|
19
|
-
<
|
21
|
+
<SplitButton
|
20
22
|
class="ui5-ai-button-hidden"
|
21
23
|
design={this.design}
|
22
24
|
/>
|
package/src/themes/Button.css
CHANGED
@@ -24,64 +24,118 @@
|
|
24
24
|
width: fit-content;
|
25
25
|
}
|
26
26
|
|
27
|
+
:host .ui5-ai-button-inner {
|
28
|
+
width: 100%;
|
29
|
+
}
|
30
|
+
|
27
31
|
/* Animated parts */
|
28
32
|
|
29
|
-
:host
|
33
|
+
:host {
|
30
34
|
width: auto;
|
31
35
|
position: relative;
|
32
36
|
transition: width 0.18s cubic-bezier(0.67, 1, 0.95, 1.3) 0.12s;
|
33
37
|
}
|
34
38
|
|
35
|
-
:host ::part(
|
36
|
-
|
37
|
-
|
39
|
+
:host(.ui5-ai-button-menu-to-button) .ui5-ai-button-inner::part(button),
|
40
|
+
:host(.ui5-ai-button-fade-out:not([icon-only])) .ui5-ai-button-inner::part(button) {
|
41
|
+
justify-content: flex-start;
|
42
|
+
}
|
43
|
+
|
44
|
+
:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),
|
45
|
+
:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton) {
|
46
|
+
min-width: var(--_ui5_button_base_min_width) !important;
|
47
|
+
max-width: var(--_ui5_button_base_min_width) !important;
|
48
|
+
}
|
49
|
+
|
50
|
+
:host(.ui5-ai-button-menu-to-button) .ui5-ai-button-inner::part(button),
|
51
|
+
:host(.ui5-ai-button-fade-out:not([icon-only])) .ui5-ai-button-inner::part(button) {
|
52
|
+
justify-content: flex-start;
|
38
53
|
}
|
39
54
|
|
40
|
-
:host(
|
41
|
-
:host(
|
55
|
+
:host([icon-only]) .ui5-ai-button-inner[_end-icon]:not([_end-icon=""])::part(button),
|
56
|
+
:host([icon-only]) .ui5-ai-button-inner[_hide-arrow-button]::part(button) {
|
57
|
+
justify-content: flex-start;
|
58
|
+
padding-inline-start: var(--_ui5_button_base_padding);
|
59
|
+
}
|
60
|
+
|
61
|
+
:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(button) {
|
62
|
+
max-width: var(--_ui5_button_base_min_width);
|
63
|
+
}
|
64
|
+
|
65
|
+
:host([icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(textButton),
|
66
|
+
:host(.ui5-ai-button-menu-to-button[icon-only]) .ui5-ai-button-inner::part(textButton) {
|
67
|
+
min-width: var(--_ui5_button_base_min_width);
|
68
|
+
max-width: var(--_ui5_button_base_min_width);
|
69
|
+
}
|
70
|
+
|
71
|
+
:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) .ui5-ai-button-text,
|
72
|
+
:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(endIcon),
|
73
|
+
:host(:not(.ui5-ai-button-fade-out):not(.ui5-ai-button-fade-mid):not(.ui5-ai-button-fade-in)) ::part(arrowButton) {
|
42
74
|
opacity: 1;
|
43
75
|
transform: translateY(0);
|
44
76
|
}
|
45
77
|
|
46
|
-
|
78
|
+
:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(endIcon),
|
79
|
+
:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(arrowButton) {
|
80
|
+
display: none;
|
81
|
+
transform: translateY(0);
|
82
|
+
opacity: 0;
|
83
|
+
}
|
47
84
|
|
48
|
-
:host(
|
85
|
+
:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(endIcon),
|
86
|
+
:host(.ui5-ai-button-button-to-menu) .ui5-ai-button-inner::part(arrowButton) {
|
87
|
+
display: none;
|
88
|
+
transform: translateY(0);
|
49
89
|
opacity: 0;
|
50
|
-
transform: translateY(-1rem);
|
51
|
-
transition: opacity 0.05s ease-in-out 0.025s, transform 0.10s ease-in-out 0s;
|
52
90
|
}
|
53
91
|
|
54
|
-
|
55
|
-
|
92
|
+
/* Fade out phase */
|
93
|
+
|
94
|
+
:host(.ui5-ai-button-fade-out) .ui5-ai-button-text {
|
56
95
|
opacity: 0;
|
57
96
|
transform: translateY(-1rem);
|
58
97
|
transition: opacity 0.06s ease-in-out 0.12s, transform 0.08s ease-in-out 0.12s;
|
59
98
|
}
|
60
99
|
|
61
|
-
|
100
|
+
:host(.ui5-ai-button-fade-out) ::part(icon)
|
101
|
+
{
|
102
|
+
opacity: 0;
|
103
|
+
transform: translateY(-1rem);
|
104
|
+
transition: opacity 0.05s ease-in-out 0.025s, transform 0.10s ease-in-out 0s;
|
105
|
+
}
|
62
106
|
|
63
|
-
:host(
|
107
|
+
:host(.ui5-ai-button-fade-out) ::part(endIcon) {
|
64
108
|
opacity: 0;
|
65
|
-
transform: translateY(1rem);
|
109
|
+
transform: translateY(-1rem);
|
110
|
+
transition: opacity 0.06s ease-in-out 0.12s, transform 0.08s ease-in-out 0.12s;
|
66
111
|
}
|
67
112
|
|
68
|
-
|
69
|
-
|
113
|
+
/* Fade middle phase */
|
114
|
+
|
115
|
+
:host(.ui5-ai-button-fade-mid) .ui5-ai-button-text,
|
116
|
+
:host(.ui5-ai-button-fade-mid) ::part(icon),
|
117
|
+
:host(.ui5-ai-button-fade-mid) ::part(endIcon),
|
118
|
+
:host(.ui5-ai-button-fade-mid) ::part(arrowButton) {
|
70
119
|
opacity: 0;
|
71
120
|
transform: translateY(1rem);
|
72
121
|
transition: none;
|
73
122
|
}
|
74
123
|
|
75
|
-
/* Fade in */
|
124
|
+
/* Fade in phase */
|
125
|
+
|
126
|
+
:host(.ui5-ai-button-fade-in) .ui5-ai-button-text {
|
127
|
+
opacity: 1;
|
128
|
+
transform: translateY(0);
|
129
|
+
transition: opacity 0.06s ease-in-out 0.12s, transform 0.08s ease-in-out 0.12s;
|
130
|
+
}
|
76
131
|
|
77
|
-
:host(
|
132
|
+
:host(.ui5-ai-button-fade-in) ::part(icon) {
|
78
133
|
opacity: 1;
|
79
134
|
transform: translateY(0);
|
80
135
|
transition: opacity 0.05s ease-in-out 0.025s, transform 0.10s ease-in-out 0s;
|
81
136
|
}
|
82
137
|
|
83
|
-
:host(
|
84
|
-
:host([fade-in]) ::part(endIcon) {
|
138
|
+
:host(.ui5-ai-button-fade-in) ::part(endIcon) {
|
85
139
|
opacity: 1;
|
86
140
|
transform: translateY(0);
|
87
141
|
transition: opacity 0.06s ease-in-out 0.12s, transform 0.08s ease-in-out 0.12s;
|