@ui5/webcomponents-ai 2.13.0-rc.1 → 2.13.0-rc.3
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/.tsbuildinfo +1 -1
- package/dist/Button.d.ts +34 -0
- package/dist/Button.js +52 -2
- package/dist/Button.js.map +1 -1
- package/dist/ButtonTemplate.js +1 -1
- package/dist/ButtonTemplate.js.map +1 -1
- package/dist/css/themes/Button.css +1 -1
- package/dist/custom-elements-internal.json +27 -0
- package/dist/custom-elements.json +26 -0
- package/dist/generated/i18n/i18n-defaults.d.ts +2 -1
- package/dist/generated/i18n/i18n-defaults.js +2 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- 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 +5 -0
- package/dist/web-types.json +14 -1
- package/package.json +7 -7
- package/src/ButtonTemplate.tsx +1 -0
- package/src/i18n/messagebundle.properties +5 -1
- package/src/i18n/messagebundle_en.properties +1 -1
package/dist/Button.d.ts
CHANGED
@@ -3,6 +3,14 @@ import type SplitButton from "@ui5/webcomponents/dist/SplitButton.js";
|
|
3
3
|
import type ButtonDesign from "@ui5/webcomponents/dist/types/ButtonDesign.js";
|
4
4
|
import type ButtonState from "./ButtonState.js";
|
5
5
|
import "./ButtonState.js";
|
6
|
+
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
7
|
+
import type { AccessibilityAttributes } from "@ui5/webcomponents-base/dist/types.js";
|
8
|
+
type AIButtonRootAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup" | "roleDescription" | "title">;
|
9
|
+
type AIButtonArrowButtonAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup" | "expanded" | "title">;
|
10
|
+
type AIButtonAccessibilityAttributes = {
|
11
|
+
root?: AIButtonRootAccessibilityAttributes;
|
12
|
+
arrowButton?: AIButtonArrowButtonAccessibilityAttributes;
|
13
|
+
};
|
6
14
|
/**
|
7
15
|
* @class
|
8
16
|
*
|
@@ -69,6 +77,29 @@ declare class Button extends UI5Element {
|
|
69
77
|
* @since 2.6.0
|
70
78
|
*/
|
71
79
|
arrowButtonPressed: boolean;
|
80
|
+
/**
|
81
|
+
* Defines the additional accessibility attributes that will be applied to the component.
|
82
|
+
*
|
83
|
+
* This property allows for fine-tuned control of ARIA attributes for screen reader support.
|
84
|
+
* It accepts an object with the following optional fields:
|
85
|
+
*
|
86
|
+
* - **root**: Accessibility attributes that will be applied to the root element.
|
87
|
+
* - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).
|
88
|
+
* Accepts string values: `"dialog"`, `"grid"`, `"listbox"`, `"menu"`, or `"tree"`.
|
89
|
+
* - **roleDescription**: Defines a human-readable description for the button's role.
|
90
|
+
* Accepts any string value.
|
91
|
+
*
|
92
|
+
* - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.
|
93
|
+
* - **hasPopup**: Indicates the type of popup triggered by the arrow button.
|
94
|
+
* Accepts string values: `"dialog"`, `"grid"`, `"listbox"`, `"menu"`, or `"tree"`.
|
95
|
+
* - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.
|
96
|
+
* Accepts boolean values: `true` or `false`.
|
97
|
+
*
|
98
|
+
* @public
|
99
|
+
* @since 2.6.0
|
100
|
+
* @default {}
|
101
|
+
*/
|
102
|
+
accessibilityAttributes: AIButtonAccessibilityAttributes;
|
72
103
|
/**
|
73
104
|
* Keeps the current state object of the component.
|
74
105
|
* @private
|
@@ -90,6 +121,7 @@ declare class Button extends UI5Element {
|
|
90
121
|
states: Array<ButtonState>;
|
91
122
|
_splitButton?: SplitButton;
|
92
123
|
_hiddenSplitButton?: SplitButton;
|
124
|
+
static i18nBundle: I18nBundle;
|
93
125
|
get _hideArrowButton(): boolean;
|
94
126
|
get _effectiveState(): string;
|
95
127
|
get _effectiveStateObject(): ButtonState | undefined;
|
@@ -124,5 +156,7 @@ declare class Button extends UI5Element {
|
|
124
156
|
* @private
|
125
157
|
*/
|
126
158
|
_onArrowClick(e: CustomEvent): void;
|
159
|
+
get _computedAccessibilityAttributes(): AIButtonAccessibilityAttributes;
|
127
160
|
}
|
128
161
|
export default Button;
|
162
|
+
export type { AIButtonAccessibilityAttributes, };
|
package/dist/Button.js
CHANGED
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
6
|
};
|
7
|
+
var Button_1;
|
7
8
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
8
9
|
import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js";
|
9
10
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
@@ -12,10 +13,13 @@ import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
12
13
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
13
14
|
import query from "@ui5/webcomponents-base/dist/decorators/query.js";
|
14
15
|
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
16
|
+
import { BUTTON_TOOLTIP_TEXT } from "./generated/i18n/i18n-defaults.js";
|
15
17
|
import "./ButtonState.js";
|
16
18
|
import ButtonTemplate from "./ButtonTemplate.js";
|
19
|
+
import { getEffectiveAriaLabelText, getAssociatedLabelForTexts, getAllAccessibleNameRefTexts, } from "@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js";
|
17
20
|
// Styles
|
18
21
|
import ButtonCss from "./generated/themes/Button.css.js";
|
22
|
+
import { i18n } from "@ui5/webcomponents-base/dist/decorators.js";
|
19
23
|
/**
|
20
24
|
* @class
|
21
25
|
*
|
@@ -47,7 +51,7 @@ import ButtonCss from "./generated/themes/Button.css.js";
|
|
47
51
|
* @public
|
48
52
|
* @experimental The Button and ButtonState web components are availabe since 2.0 under an experimental flag and their API and behaviour are subject to change.
|
49
53
|
*/
|
50
|
-
let Button = class Button extends UI5Element {
|
54
|
+
let Button = Button_1 = class Button extends UI5Element {
|
51
55
|
constructor() {
|
52
56
|
super(...arguments);
|
53
57
|
/**
|
@@ -73,6 +77,29 @@ let Button = class Button extends UI5Element {
|
|
73
77
|
* @since 2.6.0
|
74
78
|
*/
|
75
79
|
this.arrowButtonPressed = false;
|
80
|
+
/**
|
81
|
+
* Defines the additional accessibility attributes that will be applied to the component.
|
82
|
+
*
|
83
|
+
* This property allows for fine-tuned control of ARIA attributes for screen reader support.
|
84
|
+
* It accepts an object with the following optional fields:
|
85
|
+
*
|
86
|
+
* - **root**: Accessibility attributes that will be applied to the root element.
|
87
|
+
* - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).
|
88
|
+
* Accepts string values: `"dialog"`, `"grid"`, `"listbox"`, `"menu"`, or `"tree"`.
|
89
|
+
* - **roleDescription**: Defines a human-readable description for the button's role.
|
90
|
+
* Accepts any string value.
|
91
|
+
*
|
92
|
+
* - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.
|
93
|
+
* - **hasPopup**: Indicates the type of popup triggered by the arrow button.
|
94
|
+
* Accepts string values: `"dialog"`, `"grid"`, `"listbox"`, `"menu"`, or `"tree"`.
|
95
|
+
* - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.
|
96
|
+
* Accepts boolean values: `true` or `false`.
|
97
|
+
*
|
98
|
+
* @public
|
99
|
+
* @since 2.6.0
|
100
|
+
* @default {}
|
101
|
+
*/
|
102
|
+
this.accessibilityAttributes = {};
|
76
103
|
/**
|
77
104
|
* Determines if the button is in icon-only mode.
|
78
105
|
* This property is animation related only.
|
@@ -208,6 +235,23 @@ let Button = class Button extends UI5Element {
|
|
208
235
|
e.stopImmediatePropagation();
|
209
236
|
this.fireDecoratorEvent("arrow-button-click");
|
210
237
|
}
|
238
|
+
get _computedAccessibilityAttributes() {
|
239
|
+
const labelRefTexts = getAllAccessibleNameRefTexts(this) || getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || "";
|
240
|
+
const mainTitle = this._hasText ? Button_1.i18nBundle.getText(BUTTON_TOOLTIP_TEXT, this._stateText) : "";
|
241
|
+
const title = `${mainTitle} ${labelRefTexts}`.trim();
|
242
|
+
return {
|
243
|
+
root: {
|
244
|
+
hasPopup: this.accessibilityAttributes?.root?.hasPopup || "false",
|
245
|
+
roleDescription: this.accessibilityAttributes?.root?.roleDescription,
|
246
|
+
title: this.accessibilityAttributes?.root?.title || title,
|
247
|
+
},
|
248
|
+
arrowButton: {
|
249
|
+
hasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup,
|
250
|
+
expanded: this.accessibilityAttributes?.arrowButton?.expanded,
|
251
|
+
title: this.accessibilityAttributes?.arrowButton?.title,
|
252
|
+
},
|
253
|
+
};
|
254
|
+
}
|
211
255
|
};
|
212
256
|
__decorate([
|
213
257
|
property()
|
@@ -221,6 +265,9 @@ __decorate([
|
|
221
265
|
__decorate([
|
222
266
|
property({ type: Boolean, noAttribute: true })
|
223
267
|
], Button.prototype, "arrowButtonPressed", void 0);
|
268
|
+
__decorate([
|
269
|
+
property({ type: Object })
|
270
|
+
], Button.prototype, "accessibilityAttributes", void 0);
|
224
271
|
__decorate([
|
225
272
|
property({ type: Object })
|
226
273
|
], Button.prototype, "_currentStateObject", void 0);
|
@@ -236,7 +283,10 @@ __decorate([
|
|
236
283
|
__decorate([
|
237
284
|
query(".ui5-ai-button-hidden[ui5-split-button]")
|
238
285
|
], Button.prototype, "_hiddenSplitButton", void 0);
|
239
|
-
|
286
|
+
__decorate([
|
287
|
+
i18n("@ui5/webcomponents")
|
288
|
+
], Button, "i18nBundle", void 0);
|
289
|
+
Button = Button_1 = __decorate([
|
240
290
|
customElement({
|
241
291
|
tag: "ui5-ai-button",
|
242
292
|
languageAware: true,
|
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;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;AAI/E,OAAO,kBAAkB,CAAC;AAE1B,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,SAAS;AACT,OAAO,SAAS,MAAM,kCAAkC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA8BH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QAKC;;;;WAIG;QAEH,WAAM,GAAuB,SAAS,CAAA;QAEtC;;;;;;WAMG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAWjB;;;;;;;WAOG;QAEH,uBAAkB,GAAG,KAAK,CAAC;QAS3B;;;;;WAKG;QAEH,aAAQ,GAAI,KAAK,CAAC;IA4KnB,CAAC;IA3JA,IAAI,gBAAgB;QACnB,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,eAAe,CAAC;IACrD,CAAC;IAED,IAAI,eAAe;QAClB,OAAO,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACxE,CAAC;IAED,IAAI,qBAAqB;QACxB,OAAO,IAAI,CAAC,MAAM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M,EAAE,SAAS;QACjB,iBAAiB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;KAC3C,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,oBAAoB,EAAE;QAC5B,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,MAAM,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 type SplitButton from \"@ui5/webcomponents/dist/SplitButton.js\";\nimport type ButtonDesign from \"@ui5/webcomponents/dist/types/ButtonDesign.js\";\nimport type ButtonState from \"./ButtonState.js\";\nimport \"./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\tshadowRootOptions: { delegatesFocus: true },\n})\n\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the component is in split mode and after the arrow button\n * is activated either by clicking or tapping it or by using the [Arrow Up] / [Arrow Down],\n * [Alt] + [Arrow Up]/ [Arrow Down], or [F4] keyboard keys.\n * @public\n */\n@event(\"arrow-button-click\", {\n\tbubbles: true,\n})\n\nclass Button extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": void;\n\t\t\"arrow-button-click\": void;\n\t}\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign?: `${ButtonDesign}` = \"Default\"\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the current state of the component.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tstate?: string;\n\n\t/**\n\t * Defines the active state of the arrow button in split mode.\n\t * Set to true when the button is in split mode and a menu with additional options\n\t * is opened by the arrow button. Set back to false when the menu is closed.\n\t * @default false\n\t * @public\n\t * @since 2.6.0\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tarrowButtonPressed = false;\n\n\t/**\n\t * 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?.showArrowButton;\n\t}\n\n\tget _effectiveState() {\n\t\treturn this.state || (this.states.length && this.states[0].name) || \"\";\n\t}\n\n\tget _effectiveStateObject() {\n\t\treturn this.states.find(state => state.name === this._effectiveState);\n\t}\n\n\tget _stateIconOnly() {\n\t\treturn !this._stateText && !!this._stateIcon;\n\t}\n\n\tget _stateText() {\n\t\treturn this._currentStateObject?.text;\n\t}\n\n\tget _stateIcon() {\n\t\treturn this._currentStateObject?.icon;\n\t}\n\n\tget _stateEndIcon() {\n\t\tconst endIcon = this._effectiveStateObject?.showArrowButton ? \"\" : this._effectiveStateObject?.endIcon;\n\t\treturn endIcon;\n\t}\n\n\tget _hasText() {\n\t\treturn !!this._stateText;\n\t}\n\n\tonBeforeRendering(): void {\n\t\tconst splitButton = this._splitButton;\n\n\t\tif (splitButton) {\n\t\t\tsplitButton.activeArrowButton = this.arrowButtonPressed;\n\t\t}\n\n\t\tif (!this._currentStateObject?.name) {\n\t\t\tthis._currentStateObject = this._effectiveStateObject;\n\t\t}\n\n\t\tconst currentStateName = this._currentStateObject?.name || \"\";\n\n\t\tthis.iconOnly = this._stateIconOnly;\n\t\tif (currentStateName !== \"\" && currentStateName !== this._effectiveState) {\n\t\t\tthis._fadeOut();\n\t\t}\n\t}\n\n\t/**\n\t * Starts the fade-out animation.\n\t * @private\n\t */\n\tasync _fadeOut(): Promise<void> {\n\t\tconst fadeOutDuration = 180;\n\t\tconst button = this._splitButton;\n\t\tconst hiddenButton = this._hiddenSplitButton;\n\t\tconst newStateObject = this._effectiveStateObject;\n\n\t\tif (!newStateObject) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`State with name=\"${this.state}\" doesn't exist!`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!button || !hiddenButton) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttonWidth = button.offsetWidth;\n\t\tconst currentState: Partial<ButtonState> = this._currentStateObject || {};\n\n\t\tif ((!currentState.showArrowButton && newStateObject.showArrowButton) || (!currentState.endIcon && !!newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-button-to-menu\");\n\t\t}\n\t\tif ((currentState.showArrowButton && !newStateObject.showArrowButton) || (!!currentState.endIcon && !newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-menu-to-button\");\n\t\t}\n\n\t\tthis.style.width = `${buttonWidth}px`;\n\t\thiddenButton.icon = newStateObject.icon;\n\t\thiddenButton._endIcon = newStateObject.endIcon;\n\t\thiddenButton.textContent = newStateObject.text || null;\n\t\thiddenButton._hideArrowButton = this._hideArrowButton;\n\n\t\tawait renderFinished();\n\t\tconst hiddenButtonWidth = hiddenButton.offsetWidth;\n\t\tthis.style.width = `${hiddenButtonWidth}px`;\n\t\tthis.classList.add(\"ui5-ai-button-fade-out\");\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-mid\");\n\t\t\tbutton._hideArrowButton = this._hideArrowButton;\n\t\t\tthis._fadeIn();\n\t\t}, fadeOutDuration);\n\t}\n\n\t/**\n\t * Starts the fade-in animation.\n\t * @private\n\t */\n\t_fadeIn(): void {\n\t\tconst fadeInDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tconst newStateObject = this._effectiveStateObject;\n\t\t\tthis._currentStateObject = newStateObject;\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-in\");\n\t\t\tthis._resetFade();\n\t\t}, fadeInDuration);\n\t}\n\n\t/**\n\t * Resets the fade phases when the animation is completed.\n\t * @private\n\t */\n\t_resetFade(): void {\n\t\tconst fadeResetDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-out\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-mid\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-in\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-button-to-menu\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-menu-to-button\");\n\t\t}, fadeResetDuration);\n\n\t\t// reset the button's width after animations\n\t\tconst button = this._splitButton;\n\n\t\tif (button) {\n\t\t\tbutton.style.width = \"\";\n\t\t}\n\t}\n\n\t/**\n\t * Handles the click event.\n\t * @private\n\t */\n\t_onClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t/**\n\t * Handles the arrow-button-click event when `ui5-ai-button` is in split mode.\n\t * @private\n\t */\n\t_onArrowClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"arrow-button-click\");\n\t}\n}\n\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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AE;QAC5B,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,MAAM,CAqRX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport query from \"@ui5/webcomponents-base/dist/decorators/query.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type SplitButton from \"@ui5/webcomponents/dist/SplitButton.js\";\nimport type ButtonDesign from \"@ui5/webcomponents/dist/types/ButtonDesign.js\";\nimport type ButtonState from \"./ButtonState.js\";\nimport { BUTTON_TOOLTIP_TEXT } from \"./generated/i18n/i18n-defaults.js\";\nimport \"./ButtonState.js\";\nimport ButtonTemplate from \"./ButtonTemplate.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetAllAccessibleNameRefTexts,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\n\n// Styles\nimport ButtonCss from \"./generated/themes/Button.css.js\";\nimport { i18n } from \"@ui5/webcomponents-base/dist/decorators.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\n\ntype AIButtonRootAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"roleDescription\" | \"title\">;\ntype AIButtonArrowButtonAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\" | \"title\">;\ntype AIButtonAccessibilityAttributes = { root?: AIButtonRootAccessibilityAttributes, arrowButton?: AIButtonArrowButtonAccessibilityAttributes}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button`\n * or by pressing keyboard keys like [Enter] or [Space].\n *\n * ### Usage\n *\n * For the `ui5-ai-button` user interface, you can define one or more button states by placing `ui5-ai-button-state` components in their default slot.\n * Each state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose.\n * You can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions.\n *\n * You can choose from a set of predefined designs for `ui5-ai-button` (as in `ui5-button`) to match the desired styling.\n *\n * The `ui5-ai-button` can be activated by clicking or tapping it. You can change the button state in the click event handler. When the button is\n * in split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space].\n * You can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4].\n * To display additional actions, you can attach a menu to the arrow button.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents-ai/dist/Button.js\";`\n *\n * @constructor\n * @extends UI5Element\n * @since 2.0.0\n * @public\n * @experimental The Button and ButtonState web components are availabe since 2.0 under an experimental flag and their API and behaviour are subject to change.\n */\n\n@customElement({\n\ttag: \"ui5-ai-button\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ButtonTemplate,\n\tstyles: ButtonCss,\n\tshadowRootOptions: { delegatesFocus: true },\n})\n\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the component is in split mode and after the arrow button\n * is activated either by clicking or tapping it or by using the [Arrow Up] / [Arrow Down],\n * [Alt] + [Arrow Up]/ [Arrow Down], or [F4] keyboard keys.\n * @public\n */\n@event(\"arrow-button-click\", {\n\tbubbles: true,\n})\n\nclass Button extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": void;\n\t\t\"arrow-button-click\": void;\n\t}\n\t/**\n\t * Defines the component design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign?: `${ButtonDesign}` = \"Default\"\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the current state of the component.\n\t *\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tstate?: string;\n\n\t/**\n\t * Defines the active state of the arrow button in split mode.\n\t * Set to true when the button is in split mode and a menu with additional options\n\t * is opened by the arrow button. Set back to false when the menu is closed.\n\t * @default false\n\t * @public\n\t * @since 2.6.0\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tarrowButtonPressed = false;\n\n\t/**\n \t * Defines the additional accessibility attributes that will be applied to the component.\n\t *\n\t * This property allows for fine-tuned control of ARIA attributes for screen reader support.\n\t * It accepts an object with the following optional fields:\n\t *\n\t * - **root**: Accessibility attributes that will be applied to the root element.\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **roleDescription**: Defines a human-readable description for the button's role.\n\t * Accepts any string value.\n\t *\n\t * - **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n\t * - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n\t * Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n\t * - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n\t * Accepts boolean values: `true` or `false`.\n\t *\n\t * @public\n\t * @since 2.6.0\n\t * @default {}\n \t*/\n\t@property({ type: Object })\n\taccessibilityAttributes: AIButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Keeps the current state object of the component.\n\t * @private\n\t */\n\t@property({ type: Object })\n\t_currentStateObject?: ButtonState;\n\n\t/**\n\t * Determines if the button is in icon-only mode.\n\t * This property is animation related only.\n\t * @default false\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly? = false;\n\n\t/**\n\t * Defines the available states of the component.\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that\n\t * you only use `ui5-ai-button-state` components in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\tstates!: Array<ButtonState>;\n\n\t@query(\"[ui5-split-button]\")\n\t_splitButton?: SplitButton;\n\n\t@query(\".ui5-ai-button-hidden[ui5-split-button]\")\n\t_hiddenSplitButton?: SplitButton;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tget _hideArrowButton() {\n\t\treturn !this._effectiveStateObject?.showArrowButton;\n\t}\n\n\tget _effectiveState() {\n\t\treturn this.state || (this.states.length && this.states[0].name) || \"\";\n\t}\n\n\tget _effectiveStateObject() {\n\t\treturn this.states.find(state => state.name === this._effectiveState);\n\t}\n\n\tget _stateIconOnly() {\n\t\treturn !this._stateText && !!this._stateIcon;\n\t}\n\n\tget _stateText() {\n\t\treturn this._currentStateObject?.text;\n\t}\n\n\tget _stateIcon() {\n\t\treturn this._currentStateObject?.icon;\n\t}\n\n\tget _stateEndIcon() {\n\t\tconst endIcon = this._effectiveStateObject?.showArrowButton ? \"\" : this._effectiveStateObject?.endIcon;\n\t\treturn endIcon;\n\t}\n\n\tget _hasText() {\n\t\treturn !!this._stateText;\n\t}\n\n\tonBeforeRendering(): void {\n\t\tconst splitButton = this._splitButton;\n\n\t\tif (splitButton) {\n\t\t\tsplitButton.activeArrowButton = this.arrowButtonPressed;\n\t\t}\n\n\t\tif (!this._currentStateObject?.name) {\n\t\t\tthis._currentStateObject = this._effectiveStateObject;\n\t\t}\n\n\t\tconst currentStateName = this._currentStateObject?.name || \"\";\n\n\t\tthis.iconOnly = this._stateIconOnly;\n\t\tif (currentStateName !== \"\" && currentStateName !== this._effectiveState) {\n\t\t\tthis._fadeOut();\n\t\t}\n\t}\n\n\t/**\n\t * Starts the fade-out animation.\n\t * @private\n\t */\n\tasync _fadeOut(): Promise<void> {\n\t\tconst fadeOutDuration = 180;\n\t\tconst button = this._splitButton;\n\t\tconst hiddenButton = this._hiddenSplitButton;\n\t\tconst newStateObject = this._effectiveStateObject;\n\n\t\tif (!newStateObject) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`State with name=\"${this.state}\" doesn't exist!`);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!button || !hiddenButton) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst buttonWidth = button.offsetWidth;\n\t\tconst currentState: Partial<ButtonState> = this._currentStateObject || {};\n\n\t\tif ((!currentState.showArrowButton && newStateObject.showArrowButton) || (!currentState.endIcon && !!newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-button-to-menu\");\n\t\t}\n\t\tif ((currentState.showArrowButton && !newStateObject.showArrowButton) || (!!currentState.endIcon && !newStateObject.endIcon)) {\n\t\t\tthis.classList.add(\"ui5-ai-button-menu-to-button\");\n\t\t}\n\n\t\tthis.style.width = `${buttonWidth}px`;\n\t\thiddenButton.icon = newStateObject.icon;\n\t\thiddenButton._endIcon = newStateObject.endIcon;\n\t\thiddenButton.textContent = newStateObject.text || null;\n\t\thiddenButton._hideArrowButton = this._hideArrowButton;\n\n\t\tawait renderFinished();\n\t\tconst hiddenButtonWidth = hiddenButton.offsetWidth;\n\t\tthis.style.width = `${hiddenButtonWidth}px`;\n\t\tthis.classList.add(\"ui5-ai-button-fade-out\");\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-mid\");\n\t\t\tbutton._hideArrowButton = this._hideArrowButton;\n\t\t\tthis._fadeIn();\n\t\t}, fadeOutDuration);\n\t}\n\n\t/**\n\t * Starts the fade-in animation.\n\t * @private\n\t */\n\t_fadeIn(): void {\n\t\tconst fadeInDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tconst newStateObject = this._effectiveStateObject;\n\t\t\tthis._currentStateObject = newStateObject;\n\t\t\tthis.classList.add(\"ui5-ai-button-fade-in\");\n\t\t\tthis._resetFade();\n\t\t}, fadeInDuration);\n\t}\n\n\t/**\n\t * Resets the fade phases when the animation is completed.\n\t * @private\n\t */\n\t_resetFade(): void {\n\t\tconst fadeResetDuration = 160;\n\n\t\tsetTimeout(() => {\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-out\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-mid\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-fade-in\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-button-to-menu\");\n\t\t\tthis.classList.remove(\"ui5-ai-button-menu-to-button\");\n\t\t}, fadeResetDuration);\n\n\t\t// reset the button's width after animations\n\t\tconst button = this._splitButton;\n\n\t\tif (button) {\n\t\t\tbutton.style.width = \"\";\n\t\t}\n\t}\n\n\t/**\n\t * Handles the click event.\n\t * @private\n\t */\n\t_onClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t/**\n\t * Handles the arrow-button-click event when `ui5-ai-button` is in split mode.\n\t * @private\n\t */\n\t_onArrowClick(e: CustomEvent): void {\n\t\te.stopImmediatePropagation();\n\t\tthis.fireDecoratorEvent(\"arrow-button-click\");\n\t}\n\n\tget _computedAccessibilityAttributes(): AIButtonAccessibilityAttributes {\n\t\tconst labelRefTexts = getAllAccessibleNameRefTexts(this) || getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || \"\";\n\n\t\tconst mainTitle = this._hasText ? Button.i18nBundle.getText(BUTTON_TOOLTIP_TEXT, this._stateText as string) : \"\";\n\t\tconst title = `${mainTitle} ${labelRefTexts}`.trim();\n\n\t\treturn {\n\t\t\troot: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.root?.hasPopup || \"false\",\n\t\t\t\troleDescription: this.accessibilityAttributes?.root?.roleDescription,\n\t\t\t\ttitle: this.accessibilityAttributes?.root?.title || title,\n\t\t\t},\n\t\t\tarrowButton: {\n\t\t\t\thasPopup: this.accessibilityAttributes?.arrowButton?.hasPopup,\n\t\t\t\texpanded: this.accessibilityAttributes?.arrowButton?.expanded,\n\t\t\t\ttitle: this.accessibilityAttributes?.arrowButton?.title,\n\t\t\t},\n\t\t};\n\t}\n}\n\nButton.define();\nexport default Button;\nexport type {\n\tAIButtonAccessibilityAttributes,\n};\n"]}
|
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
2
|
import SplitButton from "@ui5/webcomponents/dist/SplitButton.js";
|
3
3
|
export default function ButtonTemplate() {
|
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 })] }));
|
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, accessibilityAttributes: this._computedAccessibilityAttributes, 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,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,
|
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,EAChC,uBAAuB,EAAE,IAAI,CAAC,gCAAgC,YAE7D,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\taccessibilityAttributes={this._computedAccessibilityAttributes}\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 .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-13-0-rc-
|
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-13-0-rc-3_button_base_min_width)!important;max-width:var(--_ui5-v2-13-0-rc-3_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-13-0-rc-3_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(button){max-width:var(--_ui5-v2-13-0-rc-3_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-13-0-rc-3_button_base_min_width);max-width:var(--_ui5-v2-13-0-rc-3_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}
|
@@ -95,6 +95,24 @@
|
|
95
95
|
"privacy": "public",
|
96
96
|
"_ui5since": "2.6.0",
|
97
97
|
"_ui5noAttribute": true
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"kind": "field",
|
101
|
+
"name": "accessibilityAttributes",
|
102
|
+
"type": {
|
103
|
+
"text": "AIButtonAccessibilityAttributes",
|
104
|
+
"references": [
|
105
|
+
{
|
106
|
+
"name": "AIButtonAccessibilityAttributes",
|
107
|
+
"package": "@ui5/webcomponents-ai",
|
108
|
+
"module": "dist/Button.js"
|
109
|
+
}
|
110
|
+
]
|
111
|
+
},
|
112
|
+
"default": "{}",
|
113
|
+
"description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
|
114
|
+
"privacy": "public",
|
115
|
+
"_ui5since": "2.6.0"
|
98
116
|
}
|
99
117
|
],
|
100
118
|
"events": [
|
@@ -157,6 +175,15 @@
|
|
157
175
|
"type": {
|
158
176
|
"text": "boolean"
|
159
177
|
}
|
178
|
+
},
|
179
|
+
{
|
180
|
+
"description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
|
181
|
+
"name": "accessibility-attributes",
|
182
|
+
"default": "{}",
|
183
|
+
"fieldName": "accessibilityAttributes",
|
184
|
+
"type": {
|
185
|
+
"text": "AIButtonAccessibilityAttributes"
|
186
|
+
}
|
160
187
|
}
|
161
188
|
],
|
162
189
|
"superclass": {
|
@@ -81,6 +81,23 @@
|
|
81
81
|
"default": "false",
|
82
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
83
|
"privacy": "public"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"kind": "field",
|
87
|
+
"name": "accessibilityAttributes",
|
88
|
+
"type": {
|
89
|
+
"text": "AIButtonAccessibilityAttributes",
|
90
|
+
"references": [
|
91
|
+
{
|
92
|
+
"name": "AIButtonAccessibilityAttributes",
|
93
|
+
"package": "@ui5/webcomponents-ai",
|
94
|
+
"module": "dist/Button.js"
|
95
|
+
}
|
96
|
+
]
|
97
|
+
},
|
98
|
+
"default": "{}",
|
99
|
+
"description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
|
100
|
+
"privacy": "public"
|
84
101
|
}
|
85
102
|
],
|
86
103
|
"events": [
|
@@ -135,6 +152,15 @@
|
|
135
152
|
"type": {
|
136
153
|
"text": "boolean"
|
137
154
|
}
|
155
|
+
},
|
156
|
+
{
|
157
|
+
"description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
|
158
|
+
"name": "accessibility-attributes",
|
159
|
+
"default": "{}",
|
160
|
+
"fieldName": "accessibilityAttributes",
|
161
|
+
"type": {
|
162
|
+
"text": "AIButtonAccessibilityAttributes"
|
163
|
+
}
|
138
164
|
}
|
139
165
|
],
|
140
166
|
"superclass": {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { I18nText } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
2
2
|
declare const PROMPT_INPUT_CHARACTERS_LEFT: I18nText;
|
3
3
|
declare const PROMPT_INPUT_CHARACTERS_EXCEEDED: I18nText;
|
4
|
-
|
4
|
+
declare const BUTTON_TOOLTIP_TEXT: I18nText;
|
5
|
+
export { PROMPT_INPUT_CHARACTERS_LEFT, PROMPT_INPUT_CHARACTERS_EXCEEDED, BUTTON_TOOLTIP_TEXT };
|
@@ -1,4 +1,5 @@
|
|
1
1
|
const PROMPT_INPUT_CHARACTERS_LEFT = { key: "PROMPT_INPUT_CHARACTERS_LEFT", defaultText: "{0} characters remaining" };
|
2
2
|
const PROMPT_INPUT_CHARACTERS_EXCEEDED = { key: "PROMPT_INPUT_CHARACTERS_EXCEEDED", defaultText: "{0} characters over limit" };
|
3
|
-
|
3
|
+
const BUTTON_TOOLTIP_TEXT = { key: "BUTTON_TOOLTIP_TEXT", defaultText: "{0} with Artificial Intelligence" };
|
4
|
+
export { PROMPT_INPUT_CHARACTERS_LEFT, PROMPT_INPUT_CHARACTERS_EXCEEDED, BUTTON_TOOLTIP_TEXT };
|
4
5
|
//# sourceMappingURL=i18n-defaults.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18n-defaults.js","sourceRoot":"","sources":["../../../src/generated/i18n/i18n-defaults.ts"],"names":[],"mappings":"AACA,MAAM,4BAA4B,GAAa,EAAC,GAAG,EAAE,8BAA8B,EAAE,WAAW,EAAE,0BAA0B,EAAC,CAAC;AAAA,MAAM,gCAAgC,GAAa,EAAC,GAAG,EAAE,kCAAkC,EAAE,WAAW,EAAE,2BAA2B,EAAC,CAAC;
|
1
|
+
{"version":3,"file":"i18n-defaults.js","sourceRoot":"","sources":["../../../src/generated/i18n/i18n-defaults.ts"],"names":[],"mappings":"AACA,MAAM,4BAA4B,GAAa,EAAC,GAAG,EAAE,8BAA8B,EAAE,WAAW,EAAE,0BAA0B,EAAC,CAAC;AAAA,MAAM,gCAAgC,GAAa,EAAC,GAAG,EAAE,kCAAkC,EAAE,WAAW,EAAE,2BAA2B,EAAC,CAAC;AAAA,MAAM,mBAAmB,GAAa,EAAC,GAAG,EAAE,qBAAqB,EAAE,WAAW,EAAE,kCAAkC,EAAC,CAAC;AACzX,OAAO,EAAC,4BAA4B,EAAC,gCAAgC,EAAC,mBAAmB,EAAC,CAAC","sourcesContent":["import type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nconst PROMPT_INPUT_CHARACTERS_LEFT: I18nText = {key: \"PROMPT_INPUT_CHARACTERS_LEFT\", defaultText: \"{0} characters remaining\"};const PROMPT_INPUT_CHARACTERS_EXCEEDED: I18nText = {key: \"PROMPT_INPUT_CHARACTERS_EXCEEDED\", defaultText: \"{0} characters over limit\"};const BUTTON_TOOLTIP_TEXT: I18nText = {key: \"BUTTON_TOOLTIP_TEXT\", defaultText: \"{0} with Artificial Intelligence\"};\nexport {PROMPT_INPUT_CHARACTERS_LEFT,PROMPT_INPUT_CHARACTERS_EXCEEDED,BUTTON_TOOLTIP_TEXT};"]}
|
@@ -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 .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-13-0-rc-
|
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-13-0-rc-3_button_base_min_width)!important;max-width:var(--_ui5-v2-13-0-rc-3_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-13-0-rc-3_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=\"\"]::part(button){max-width:var(--_ui5-v2-13-0-rc-3_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-13-0-rc-3_button_base_min_width);max-width:var(--_ui5-v2-13-0-rc-3_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 .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-13-0-rc-
|
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-13-0-rc-3_button_base_min_width)!important;max-width:var(--_ui5-v2-13-0-rc-3_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-13-0-rc-3_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=""]::part(button){max-width:var(--_ui5-v2-13-0-rc-3_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-13-0-rc-3_button_base_min_width);max-width:var(--_ui5-v2-13-0-rc-3_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 .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-13-0-rc-
|
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-13-0-rc-3_button_base_min_width)!important;max-width:var(--_ui5-v2-13-0-rc-3_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-13-0-rc-3_button_base_padding)}:host(.ui5-ai-button-fade-in[icon-only]) .ui5-ai-button-inner[_end-icon=\"\"]::part(button){max-width:var(--_ui5-v2-13-0-rc-3_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-13-0-rc-3_button_base_min_width);max-width:var(--_ui5-v2-13-0-rc-3_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`"]}
|
@@ -31,6 +31,11 @@
|
|
31
31
|
"name": "arrow-button-pressed",
|
32
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
33
|
"values": []
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"name": "accessibility-attributes",
|
37
|
+
"description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
|
38
|
+
"values": [{ "name": "AIButtonAccessibilityAttributes" }]
|
34
39
|
}
|
35
40
|
],
|
36
41
|
"references": []
|
package/dist/web-types.json
CHANGED
@@ -1,7 +1,7 @@
|
|
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.13.0-rc.
|
4
|
+
"version": "2.13.0-rc.3",
|
5
5
|
"description-markup": "markdown",
|
6
6
|
"contributions": {
|
7
7
|
"html": {
|
@@ -33,6 +33,14 @@
|
|
33
33
|
"name": "arrow-button-pressed",
|
34
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
35
|
"value": { "type": "boolean", "default": "false" }
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"name": "accessibility-attributes",
|
39
|
+
"description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
|
40
|
+
"value": {
|
41
|
+
"type": "AIButtonAccessibilityAttributes",
|
42
|
+
"default": "{}"
|
43
|
+
}
|
36
44
|
}
|
37
45
|
],
|
38
46
|
"slots": [
|
@@ -74,6 +82,11 @@
|
|
74
82
|
"name": "arrow-button-pressed",
|
75
83
|
"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
84
|
"value": { "type": "boolean" }
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"name": "accessibility-attributes",
|
88
|
+
"description": "Defines the additional accessibility attributes that will be applied to the component.\n\nThis property allows for fine-tuned control of ARIA attributes for screen reader support.\nIt accepts an object with the following optional fields:\n\n- **root**: Accessibility attributes that will be applied to the root element.\n - **hasPopup**: Indicates the availability and type of interactive popup element (such as a menu or dialog).\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **roleDescription**: Defines a human-readable description for the button's role.\n Accepts any string value.\n\n- **arrowButton**: Accessibility attributes that will be applied to the arrow (split) button element.\n - **hasPopup**: Indicates the type of popup triggered by the arrow button.\n Accepts string values: `\"dialog\"`, `\"grid\"`, `\"listbox\"`, `\"menu\"`, or `\"tree\"`.\n - **expanded**: Indicates whether the popup controlled by the arrow button is currently expanded.\n Accepts boolean values: `true` or `false`.",
|
89
|
+
"value": { "type": "AIButtonAccessibilityAttributes" }
|
77
90
|
}
|
78
91
|
],
|
79
92
|
"events": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-ai",
|
3
|
-
"version": "2.13.0-rc.
|
3
|
+
"version": "2.13.0-rc.3",
|
4
4
|
"description": "UI5 Web Components: webcomponents.ai",
|
5
5
|
"ui5": {
|
6
6
|
"webComponentsPackage": true
|
@@ -48,15 +48,15 @@
|
|
48
48
|
"directory": "packages/ai"
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
|
-
"@ui5/webcomponents": "2.13.0-rc.
|
52
|
-
"@ui5/webcomponents-base": "2.13.0-rc.
|
53
|
-
"@ui5/webcomponents-icons": "2.13.0-rc.
|
54
|
-
"@ui5/webcomponents-theming": "2.13.0-rc.
|
51
|
+
"@ui5/webcomponents": "2.13.0-rc.3",
|
52
|
+
"@ui5/webcomponents-base": "2.13.0-rc.3",
|
53
|
+
"@ui5/webcomponents-icons": "2.13.0-rc.3",
|
54
|
+
"@ui5/webcomponents-theming": "2.13.0-rc.3"
|
55
55
|
},
|
56
56
|
"devDependencies": {
|
57
57
|
"@ui5/cypress-internal": "0.0.0",
|
58
|
-
"@ui5/webcomponents-tools": "2.13.0-rc.
|
58
|
+
"@ui5/webcomponents-tools": "2.13.0-rc.3",
|
59
59
|
"chromedriver": "^137.0.4"
|
60
60
|
},
|
61
|
-
"gitHead": "
|
61
|
+
"gitHead": "f8c87eefa1d3cf69cd319ef9c72c01391978c008"
|
62
62
|
}
|
package/src/ButtonTemplate.tsx
CHANGED
@@ -12,6 +12,7 @@ export default function ButtonTemplate(this: Button) {
|
|
12
12
|
_hideArrowButton={this._hideArrowButton}
|
13
13
|
onClick={this._onClick}
|
14
14
|
onArrowClick={this._onArrowClick}
|
15
|
+
accessibilityAttributes={this._computedAccessibilityAttributes}
|
15
16
|
>
|
16
17
|
{this._hasText && (
|
17
18
|
<div class="ui5-ai-button-text">{this._stateText}</div>
|
@@ -5,4 +5,8 @@
|
|
5
5
|
PROMPT_INPUT_CHARACTERS_LEFT={0} characters remaining
|
6
6
|
|
7
7
|
#XTXT: Text for characters over
|
8
|
-
PROMPT_INPUT_CHARACTERS_EXCEEDED={0} characters over limit
|
8
|
+
PROMPT_INPUT_CHARACTERS_EXCEEDED={0} characters over limit
|
9
|
+
|
10
|
+
#XTXT: Text for
|
11
|
+
BUTTON_TOOLTIP_TEXT={0} with Artificial Intelligence
|
12
|
+
|