@ui5/webcomponents 2.25.0-rc.0 → 2.25.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/CarouselTemplate.js +1 -1
  4. package/dist/CarouselTemplate.js.map +1 -1
  5. package/dist/DynamicDateRange.d.ts +11 -0
  6. package/dist/DynamicDateRange.js +12 -0
  7. package/dist/DynamicDateRange.js.map +1 -1
  8. package/dist/DynamicDateRangeInputTemplate.js +1 -1
  9. package/dist/DynamicDateRangeInputTemplate.js.map +1 -1
  10. package/dist/IToolbarArrowNavProvider.d.ts +32 -0
  11. package/dist/IToolbarArrowNavProvider.js +4 -0
  12. package/dist/IToolbarArrowNavProvider.js.map +1 -0
  13. package/dist/Input.d.ts +3 -1
  14. package/dist/Input.js +26 -0
  15. package/dist/Input.js.map +1 -1
  16. package/dist/InputIcon.d.ts +105 -0
  17. package/dist/InputIcon.js +189 -0
  18. package/dist/InputIcon.js.map +1 -0
  19. package/dist/InputIconTemplate.d.ts +2 -0
  20. package/dist/InputIconTemplate.js +13 -0
  21. package/dist/InputIconTemplate.js.map +1 -0
  22. package/dist/ListItemCustom.js.map +1 -1
  23. package/dist/MenuItem.js +1 -1
  24. package/dist/MenuItem.js.map +1 -1
  25. package/dist/MenuSeparator.d.ts +7 -14
  26. package/dist/MenuSeparator.js +5 -24
  27. package/dist/MenuSeparator.js.map +1 -1
  28. package/dist/MenuSeparatorTemplate.js +1 -2
  29. package/dist/MenuSeparatorTemplate.js.map +1 -1
  30. package/dist/MultiComboBoxItem.d.ts +1 -0
  31. package/dist/MultiComboBoxItem.js +7 -1
  32. package/dist/MultiComboBoxItem.js.map +1 -1
  33. package/dist/MultiComboBoxItemTemplate.js +4 -2
  34. package/dist/MultiComboBoxItemTemplate.js.map +1 -1
  35. package/dist/RatingIndicator.d.ts +2 -0
  36. package/dist/RatingIndicator.js +2 -0
  37. package/dist/RatingIndicator.js.map +1 -1
  38. package/dist/SliderTemplate.js +1 -1
  39. package/dist/SliderTemplate.js.map +1 -1
  40. package/dist/Table.js +4 -2
  41. package/dist/Table.js.map +1 -1
  42. package/dist/Toolbar.d.ts +40 -3
  43. package/dist/Toolbar.js +225 -6
  44. package/dist/Toolbar.js.map +1 -1
  45. package/dist/ToolbarItem.d.ts +30 -0
  46. package/dist/ToolbarItem.js +202 -0
  47. package/dist/ToolbarItem.js.map +1 -1
  48. package/dist/ToolbarItemBase.d.ts +10 -0
  49. package/dist/ToolbarItemBase.js +19 -0
  50. package/dist/ToolbarItemBase.js.map +1 -1
  51. package/dist/ToolbarSelect.d.ts +4 -2
  52. package/dist/ToolbarSelect.js +7 -4
  53. package/dist/ToolbarSelect.js.map +1 -1
  54. package/dist/ToolbarSelectOption.d.ts +7 -0
  55. package/dist/ToolbarSelectOption.js +4 -1
  56. package/dist/ToolbarSelectOption.js.map +1 -1
  57. package/dist/ToolbarSelectTemplate.js +1 -1
  58. package/dist/ToolbarSelectTemplate.js.map +1 -1
  59. package/dist/TreeItemBase.js.map +1 -1
  60. package/dist/bundle.esm.js +1 -0
  61. package/dist/bundle.esm.js.map +1 -1
  62. package/dist/css/themes/ColorPalette.css +1 -1
  63. package/dist/css/themes/ComboBox.css +1 -1
  64. package/dist/css/themes/DatePicker.css +1 -1
  65. package/dist/css/themes/DynamicDateRange.css +1 -1
  66. package/dist/css/themes/FileUploader.css +1 -1
  67. package/dist/css/themes/Input.css +1 -1
  68. package/dist/css/themes/InputIcon.css +1 -1
  69. package/dist/css/themes/MultiComboBox.css +1 -1
  70. package/dist/css/themes/MultiComboBoxItem.css +1 -1
  71. package/dist/css/themes/MultiInput.css +1 -1
  72. package/dist/css/themes/Select.css +1 -1
  73. package/dist/css/themes/StepInput.css +1 -1
  74. package/dist/css/themes/TimePicker.css +1 -1
  75. package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
  76. package/dist/css/themes/sap_horizon_auto/parameters-bundle.css +1 -1
  77. package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
  78. package/dist/custom-elements-internal.json +240 -40
  79. package/dist/custom-elements.json +223 -25
  80. package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
  81. package/dist/generated/assets/themes/sap_horizon_auto/parameters-bundle.css.json +1 -1
  82. package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
  83. package/dist/generated/themes/ColorPalette.css.d.ts +1 -1
  84. package/dist/generated/themes/ColorPalette.css.js +1 -1
  85. package/dist/generated/themes/ColorPalette.css.js.map +1 -1
  86. package/dist/generated/themes/ComboBox.css.d.ts +1 -1
  87. package/dist/generated/themes/ComboBox.css.js +1 -1
  88. package/dist/generated/themes/ComboBox.css.js.map +1 -1
  89. package/dist/generated/themes/DatePicker.css.d.ts +1 -1
  90. package/dist/generated/themes/DatePicker.css.js +1 -1
  91. package/dist/generated/themes/DatePicker.css.js.map +1 -1
  92. package/dist/generated/themes/DynamicDateRange.css.d.ts +1 -1
  93. package/dist/generated/themes/DynamicDateRange.css.js +1 -1
  94. package/dist/generated/themes/DynamicDateRange.css.js.map +1 -1
  95. package/dist/generated/themes/FileUploader.css.d.ts +1 -1
  96. package/dist/generated/themes/FileUploader.css.js +1 -1
  97. package/dist/generated/themes/FileUploader.css.js.map +1 -1
  98. package/dist/generated/themes/Input.css.d.ts +1 -1
  99. package/dist/generated/themes/Input.css.js +1 -1
  100. package/dist/generated/themes/Input.css.js.map +1 -1
  101. package/dist/generated/themes/InputIcon.css.d.ts +1 -1
  102. package/dist/generated/themes/InputIcon.css.js +1 -1
  103. package/dist/generated/themes/InputIcon.css.js.map +1 -1
  104. package/dist/generated/themes/MultiComboBox.css.d.ts +1 -1
  105. package/dist/generated/themes/MultiComboBox.css.js +1 -1
  106. package/dist/generated/themes/MultiComboBox.css.js.map +1 -1
  107. package/dist/generated/themes/MultiComboBoxItem.css.d.ts +1 -1
  108. package/dist/generated/themes/MultiComboBoxItem.css.js +1 -1
  109. package/dist/generated/themes/MultiComboBoxItem.css.js.map +1 -1
  110. package/dist/generated/themes/MultiInput.css.d.ts +1 -1
  111. package/dist/generated/themes/MultiInput.css.js +1 -1
  112. package/dist/generated/themes/MultiInput.css.js.map +1 -1
  113. package/dist/generated/themes/Select.css.d.ts +1 -1
  114. package/dist/generated/themes/Select.css.js +1 -1
  115. package/dist/generated/themes/Select.css.js.map +1 -1
  116. package/dist/generated/themes/StepInput.css.d.ts +1 -1
  117. package/dist/generated/themes/StepInput.css.js +1 -1
  118. package/dist/generated/themes/StepInput.css.js.map +1 -1
  119. package/dist/generated/themes/TimePicker.css.d.ts +1 -1
  120. package/dist/generated/themes/TimePicker.css.js +1 -1
  121. package/dist/generated/themes/TimePicker.css.js.map +1 -1
  122. package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +1 -1
  123. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
  124. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
  125. package/dist/generated/themes/sap_horizon_auto/parameters-bundle.css.d.ts +1 -1
  126. package/dist/generated/themes/sap_horizon_auto/parameters-bundle.css.js +1 -1
  127. package/dist/generated/themes/sap_horizon_auto/parameters-bundle.css.js.map +1 -1
  128. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +1 -1
  129. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
  130. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
  131. package/dist/vscode.html-custom-data.json +57 -4
  132. package/dist/web-types.json +117 -22
  133. package/package.json +11 -11
  134. package/src/CarouselTemplate.tsx +0 -1
  135. package/src/DynamicDateRangeInputTemplate.tsx +1 -0
  136. package/src/InputIconTemplate.tsx +42 -0
  137. package/src/MenuSeparatorTemplate.tsx +2 -4
  138. package/src/MultiComboBoxItemTemplate.tsx +4 -1
  139. package/src/SliderTemplate.tsx +1 -0
  140. package/src/ToolbarSelectTemplate.tsx +1 -0
  141. package/src/i18n/messagebundle.properties +1 -1
  142. package/src/themes/ColorPalette.css +1 -0
  143. package/src/themes/DatePicker.css +1 -2
  144. package/src/themes/Input.css +4 -0
  145. package/src/themes/InputIcon.css +104 -3
  146. package/src/themes/MultiComboBoxItem.css +2 -0
  147. package/src/themes/sap_horizon/Card-parameters.css +1 -1
  148. package/src/themes/sap_horizon_dark/Card-parameters.css +1 -1
@@ -8,9 +8,13 @@ var ToolbarItem_1;
8
8
  import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
9
9
  import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
10
10
  import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
11
+ import getActiveElement from "@ui5/webcomponents-base/dist/util/getActiveElement.js";
12
+ import { instanceOfUI5Element } from "@ui5/webcomponents-base/dist/UI5Element.js";
13
+ import { isLeft, isRight, isHome, isEnd, } from "@ui5/webcomponents-base/dist/Keys.js";
11
14
  import ToolbarItemTemplate from "./ToolbarItemTemplate.js";
12
15
  import ToolbarItemCss from "./generated/themes/ToolbarItem.css.js";
13
16
  import ToolbarItemBase from "./ToolbarItemBase.js";
17
+ import { isToolbarArrowNavProvider } from "./IToolbarArrowNavProvider.js";
14
18
  /**
15
19
  * @class
16
20
  *
@@ -41,6 +45,7 @@ let ToolbarItem = ToolbarItem_1 = class ToolbarItem extends ToolbarItemBase {
41
45
  this._maxWidth = 0;
42
46
  this._wrapperChecked = false;
43
47
  this.fireCloseOverflowRef = this.fireCloseOverflow.bind(this);
48
+ this._onMultiChildKeydownRef = this._onMultiChildKeydown.bind(this);
44
49
  this.closeOverflowSet = {
45
50
  "ui5-button": ["click"],
46
51
  "ui5-select": ["change"],
@@ -57,9 +62,16 @@ let ToolbarItem = ToolbarItem_1 = class ToolbarItem extends ToolbarItemBase {
57
62
  onBeforeRendering() {
58
63
  this.checkForWrapper();
59
64
  this.attachCloseOverflowHandlers();
65
+ if (this.item.length > 1) {
66
+ this.addEventListener("keydown", this._onMultiChildKeydownRef, true);
67
+ }
68
+ else {
69
+ this.removeEventListener("keydown", this._onMultiChildKeydownRef, true);
70
+ }
60
71
  }
61
72
  onExitDOM() {
62
73
  this.detachCloseOverflowHandlers();
74
+ this.removeEventListener("keydown", this._onMultiChildKeydownRef, true);
63
75
  }
64
76
  // Method called by ui5-toolbar to inform about the existing toolbar wrapper
65
77
  checkForWrapper() {
@@ -107,9 +119,199 @@ let ToolbarItem = ToolbarItem_1 = class ToolbarItem extends ToolbarItemBase {
107
119
  const ctor = this.getSlottedNodes("item")[0]?.constructor;
108
120
  return ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.getSlottedNodes("item")[0]?.tagName;
109
121
  }
122
+ get isInteractive() {
123
+ return this._getNavigationTargets().some(target => this._isFocusable(target));
124
+ }
125
+ _isFocusable(el) {
126
+ const target = this._resolveFocusableTarget(el);
127
+ // A disabled control reports tabIndex 0 but isn't focusable.
128
+ if ("disabled" in target && !!target.disabled) {
129
+ return false;
130
+ }
131
+ // A bare <a> with no href reports tabIndex 0 but isn't focusable, UNLESS it
132
+ // opts in via an explicit tabindex attribute (e.g. ui5-link rendered as a
133
+ // button - <a role="button" tabindex="0"> with no href, used by the
134
+ // Breadcrumbs overflow arrow).
135
+ if (target.matches("a:not([href]):not([tabindex])")) {
136
+ return false;
137
+ }
138
+ // tabIndex >= 0 covers focusable-by-default elements and explicit tabindex;
139
+ // static content (div, span, ui5-text's focus ref) reports -1.
140
+ return target.tabIndex >= 0;
141
+ }
142
+ _resolveFocusableTarget(el) {
143
+ // Drill through UI5 hosts that delegate focus (date-picker ->
144
+ // datetime-input -> native input); each host reports tabIndex -1.
145
+ let current = el;
146
+ const seen = new Set();
147
+ while (instanceOfUI5Element(current) && !seen.has(current)) {
148
+ seen.add(current);
149
+ const next = current.getFocusDomRef();
150
+ if (!next || next === current) {
151
+ break;
152
+ }
153
+ current = next;
154
+ }
155
+ return current;
156
+ }
110
157
  get hasOverflow() {
111
158
  return this.item[0]?.hasOverflow ?? false;
112
159
  }
160
+ getFocusDomRef() {
161
+ const child = this.item[0];
162
+ if (child) {
163
+ return this._resolveChildFocusTarget(child);
164
+ }
165
+ return super.getFocusDomRef();
166
+ }
167
+ /**
168
+ * Resolves the element that should receive focus for a slotted child:
169
+ * the child's own focus DOM ref when it is a UI5 component, otherwise the
170
+ * first tabbable descendant, falling back to the child itself.
171
+ */
172
+ _resolveChildFocusTarget(child) {
173
+ const withFocusRef = child;
174
+ if (typeof withFocusRef.getFocusDomRef === "function") {
175
+ return withFocusRef.getFocusDomRef() || child;
176
+ }
177
+ return this._getFirstTabbableDescendant(child) || child;
178
+ }
179
+ _getFirstTabbableDescendant(root) {
180
+ return root.querySelector("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])");
181
+ }
182
+ getFocusDomRefForNavigation(forward) {
183
+ const targets = this._getNavigationTargets();
184
+ if (!targets.length) {
185
+ return this.getFocusDomRef();
186
+ }
187
+ return forward ? targets[0] : targets[targets.length - 1];
188
+ }
189
+ _handleNavigationTarget(target) {
190
+ const hostTarget = this._resolveNavigationHost(target);
191
+ if (this._isRadioButtonHost(hostTarget)) {
192
+ const radio = hostTarget;
193
+ hostTarget.focus();
194
+ if (!radio.disabled && !radio.readonly && !radio.checked) {
195
+ radio.click();
196
+ }
197
+ return;
198
+ }
199
+ hostTarget.focus();
200
+ }
201
+ _resolveNavigationHost(target) {
202
+ if (this._isUI5Host(target)) {
203
+ return target;
204
+ }
205
+ const root = target.getRootNode();
206
+ if (root instanceof ShadowRoot && root.host instanceof HTMLElement) {
207
+ return root.host;
208
+ }
209
+ return target;
210
+ }
211
+ _isUI5Host(target) {
212
+ const ctor = target.constructor;
213
+ return typeof ctor.getMetadata === "function";
214
+ }
215
+ _isRadioButtonHost(target) {
216
+ return target.hasAttribute("ui5-radio-button");
217
+ }
218
+ _matchesNavigationTarget(target, candidate) {
219
+ if (target === candidate || target.contains(candidate) || !!target.shadowRoot?.contains(candidate)) {
220
+ return true;
221
+ }
222
+ const host = this._resolveNavigationHost(candidate);
223
+ return target === host || target.contains(host) || !!target.shadowRoot?.contains(host);
224
+ }
225
+ _getNavigationTargets() {
226
+ return this.item
227
+ .filter(child => !("disabled" in child && !!child.disabled))
228
+ .map(child => this._resolveChildFocusTarget(child));
229
+ }
230
+ _getCurrentNavigationState() {
231
+ const items = this._getNavigationTargets();
232
+ const active = getActiveElement();
233
+ const current = active
234
+ ? items.find(item => this._matchesNavigationTarget(item, active))
235
+ : undefined;
236
+ const currentIndex = current ? items.indexOf(current) : -1;
237
+ return {
238
+ items,
239
+ current,
240
+ currentIndex,
241
+ };
242
+ }
243
+ _onMultiChildKeydown(e) {
244
+ const isForward = this.effectiveDir === "rtl" ? isLeft(e) : isRight(e);
245
+ const isBackward = this.effectiveDir === "rtl" ? isRight(e) : isLeft(e);
246
+ const isHomeKey = isHome(e);
247
+ const isEndKey = isEnd(e);
248
+ if (!isForward && !isBackward && !isHomeKey && !isEndKey) {
249
+ return;
250
+ }
251
+ const { items, currentIndex } = this._getCurrentNavigationState();
252
+ if (currentIndex === -1) {
253
+ return;
254
+ }
255
+ // Home/End jump to the first/last child within the group.
256
+ let nextIndex;
257
+ if (isHomeKey) {
258
+ nextIndex = 0;
259
+ }
260
+ else if (isEndKey) {
261
+ nextIndex = items.length - 1;
262
+ }
263
+ else {
264
+ nextIndex = isForward ? currentIndex + 1 : currentIndex - 1;
265
+ }
266
+ if (nextIndex === currentIndex || nextIndex < 0 || nextIndex >= items.length) {
267
+ return;
268
+ }
269
+ e.preventDefault();
270
+ e.stopPropagation();
271
+ this._handleNavigationTarget(items[nextIndex]);
272
+ }
273
+ getArrowNavState() {
274
+ const child = this.item[0];
275
+ if (!child) {
276
+ return undefined;
277
+ }
278
+ // Priority 1: ItemNavigation-based components (e.g. Breadcrumbs, SegmentedButton)
279
+ const itemNavOwner = child;
280
+ if (typeof itemNavOwner._itemNavigation?._getCurrentItem === "function"
281
+ && typeof itemNavOwner._getFocusableItems === "function") {
282
+ const items = itemNavOwner._getFocusableItems();
283
+ const current = itemNavOwner._itemNavigation._getCurrentItem();
284
+ const currentIndex = current
285
+ ? items.findIndex(item => (item.getFocusDomRef ? item.getFocusDomRef() : item) === current)
286
+ : -1;
287
+ if (currentIndex !== -1) {
288
+ return {
289
+ atLeftEnd: currentIndex === 0,
290
+ atRightEnd: currentIndex === items.length - 1,
291
+ };
292
+ }
293
+ }
294
+ // Priority 2: IToolbarArrowNavProvider interface (e.g. Input)
295
+ if (isToolbarArrowNavProvider(child)) {
296
+ return child.getArrowNavState();
297
+ }
298
+ // Priority 3: proprietary multi-child fallback (e.g. bare checkbox group)
299
+ if (this.item.length <= 1) {
300
+ return undefined;
301
+ }
302
+ const { items, currentIndex } = this._getCurrentNavigationState();
303
+ if (currentIndex === -1) {
304
+ return undefined;
305
+ }
306
+ return {
307
+ atLeftEnd: currentIndex === 0,
308
+ atRightEnd: currentIndex === items.length - 1,
309
+ };
310
+ }
311
+ focusForToolbarNavigation(isForward) {
312
+ const target = this.getFocusDomRefForNavigation(isForward);
313
+ target?.focus();
314
+ }
113
315
  };
114
316
  __decorate([
115
317
  slot({
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../src/ToolbarItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAC3D,OAAO,cAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAgBnD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,eAAe;IAAzC;;QACC,cAAS,GAAG,CAAC,CAA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CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAsB,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;IAC5H,CAAC;IAED,IAAI,WAAW;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,IAAI,KAAK,CAAC;IAC3C,CAAC;CACD,CAAA;AA5DA;IAHC,IAAI,CAAC;QACL,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI;KACjE,CAAC;yCACsC;AArCnC,WAAW;IAPhB,aAAa,CAAC;QACd,GAAG,EAAE,kBAAkB;QACvB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,cAAc;KACtB,CAAC;GACI,WAAW,CAiGhB;AAKD,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport ToolbarItemTemplate from \"./ToolbarItemTemplate.js\";\nimport ToolbarItemCss from \"./generated/themes/ToolbarItem.css.js\";\nimport ToolbarItemBase from \"./ToolbarItemBase.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base\";\n\n/**\n * Interface for the slotted item in `ui5-toolbar-item`.\n *\n * It could be any HTMLElement or UI5 Web Component with option to specify custom overflow closing events and overflow behavior.\n *\n * @public\n * @since 2.20.0\n */\ninterface IToolbarItemContent extends HTMLElement {\n\toverflowCloseEvents?: string[];\n\thasOverflow?: boolean;\n}\n\n/**\n * @class\n *\n * ### Overview\n * The `ui5-toolbar-item` is a wrapper component used to integrate UI5 Web Components into the `ui5-toolbar`.\n * It renders within the toolbar's shadow DOM and manages the lifecycle\n * and overflow behavior of its child component.\n *\n * ### Structure\n * The toolbar item wraps a single UI5 Web Component (such as CheckBox, Title, etc.) and handles:\n * - Overflow management (determining if the item should be displayed in the main toolbar or overflow popover)\n * - Automatic popover closing on interaction\n * - CSS custom state exposure for styling based on overflow state\n *\n * ### Usage\n * The `ui5-toolbar-item` is typically used implicitly when adding components to a toolbar,\n * but specialized wrappers like `ui5-toolbar-button` provide\n * component-specific functionality and should be preferred when available.\n *\n * @constructor\n * @extends ToolbarItemBase\n * @public\n * @since 2.20.0\n */\n@customElement({\n\ttag: \"ui5-toolbar-item\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ToolbarItemTemplate,\n\tstyles: ToolbarItemCss,\n})\nclass ToolbarItem extends ToolbarItemBase {\n\t_maxWidth = 0;\n\t_wrapperChecked = false;\n\tfireCloseOverflowRef = this.fireCloseOverflow.bind(this);\n\n\tcloseOverflowSet = {\n\t\t\"ui5-button\": [\"click\"],\n\t\t\"ui5-select\": [\"change\"],\n\t\t\"ui5-combobox\": [\"change\"],\n\t\t\"ui5-multi-combobox\": [\"selection-change\"],\n\t\t\"ui5-date-picker\": [\"change\"],\n\t\t\"ui5-switch\": [\"change\"],\n\t}\n\n\tpredefinedWrapperSet = {\n\t\t\"ui5-button\": \"ToolbarButton\",\n\t\t\"ui5-select\": \"ToolbarSelect\",\n\t}\n\n\tonBeforeRendering(): void {\n\t\tthis.checkForWrapper();\n\t\tthis.attachCloseOverflowHandlers();\n\t}\n\n\tonExitDOM(): void {\n\t\tthis.detachCloseOverflowHandlers();\n\t}\n\n\t/**\n\t * Wrapped component slot.\n\t * @public\n\t * @since 2.20.0\n\t */\n\n\t@slot({\n\t\t\"default\": true, type: HTMLElement, invalidateOnChildChange: true,\n\t})\n\titem!: DefaultSlot<IToolbarItemContent>;\n\n\t// Method called by ui5-toolbar to inform about the existing toolbar wrapper\n\tcheckForWrapper() {\n\t\tif (this._wrapperChecked) {\n\t\t\treturn;\n\t\t}\n\t\tthis._wrapperChecked = true;\n\n\t\tconst tagName = this.itemTagName as keyof typeof this.predefinedWrapperSet;\n\t\tconst ctor = this.constructor as typeof ToolbarItem;\n\t\tconst wrapperName = ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.tagName;\n\t\tif (wrapperName === \"ui5-toolbar-item\"\n\t\t\t&& this.predefinedWrapperSet[tagName]) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`This UI5 web component has its predefined toolbar wrapper called ${this.predefinedWrapperSet[tagName]}.`);\n\t\t}\n\t}\n\n\t// We want to close the overflow popover, when closing event is being executed\n\tgetClosingEvents(): string[] {\n\t\tconst item = this.item[0];\n\n\t\tconst closeEvents = this.closeOverflowSet[this.itemTagName as keyof typeof this.closeOverflowSet] || [];\n\t\tif (!item) {\n\t\t\treturn [...closeEvents];\n\t\t}\n\t\tconst overflowCloseEvents = item.overflowCloseEvents ? item.overflowCloseEvents : [];\n\n\t\treturn [...closeEvents, ...overflowCloseEvents];\n\t}\n\n\tattachCloseOverflowHandlers() {\n\t\tconst closingEvents = this.getClosingEvents();\n\t\tclosingEvents.forEach(clEvent => {\n\t\t\tif (!this.preventOverflowClosing) {\n\t\t\t\tthis.addEventListener(clEvent, this.fireCloseOverflowRef);\n\t\t\t}\n\t\t});\n\t}\n\n\tdetachCloseOverflowHandlers() {\n\t\tconst closingEvents = this.getClosingEvents();\n\t\tclosingEvents.forEach(clEvent => {\n\t\t\tthis.removeEventListener(clEvent, this.fireCloseOverflowRef);\n\t\t});\n\t}\n\n\tfireCloseOverflow() {\n\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t}\n\n\tget itemTagName() {\n\t\tconst ctor = this.getSlottedNodes<IToolbarItemContent>(\"item\")[0]?.constructor as typeof ToolbarItem;\n\t\treturn ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.getSlottedNodes<IToolbarItemContent>(\"item\")[0]?.tagName;\n\t}\n\n\tget hasOverflow(): boolean {\n\t\treturn this.item[0]?.hasOverflow ?? false;\n\t}\n}\n\nexport type {\n\tIToolbarItemContent,\n};\nToolbarItem.define();\n\nexport default ToolbarItem;\n"]}
1
+ {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../src/ToolbarItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,KAAK,GACL,MAAM,sCAAsC,CAAC;AAC9C,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAC3D,OAAO,cAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAyB1E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,eAAe;IAAzC;;QACC,cAAS,GAAG,CAAC,CAAC;QACd,oBAAe,GAAG,KAAK,CAAC;QACxB,yBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzD,4BAAuB,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/D,qBAAgB,GAAG;YAClB,YAAY,EAAE,CAAC,OAAO,CAAC;YACvB,YAAY,EAAE,CAAC,QAAQ,CAAC;YACxB,cAAc,EAAE,CAAC,QAAQ,CAAC;YAC1B,oBAAoB,EAAE,CAAC,kBAAkB,CAAC;YAC1C,iBAAiB,EAAE,CAAC,QAAQ,CAAC;YAC7B,YAAY,EAAE,CAAC,QAAQ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AAI,CAAC,2BAA2B,CAAC,SAAS,CAAC,CAAC;QAC3D,MAAM,EAAE,KAAK,EAAE,CAAC;IACjB,CAAC;CACD,CAAA;AAnSA;IAHC,IAAI,CAAC;QACL,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI;KACjE,CAAC;yCACsC;AA5CnC,WAAW;IAPhB,aAAa,CAAC;QACd,GAAG,EAAE,kBAAkB;QACvB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,cAAc;KACtB,CAAC;GACI,WAAW,CA+UhB;AAKD,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\nimport { instanceOfUI5Element } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisHome,\n\tisEnd,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport ToolbarItemTemplate from \"./ToolbarItemTemplate.js\";\nimport ToolbarItemCss from \"./generated/themes/ToolbarItem.css.js\";\nimport ToolbarItemBase from \"./ToolbarItemBase.js\";\nimport type { ToolbarArrowNavState } from \"./IToolbarArrowNavProvider.js\";\nimport { isToolbarArrowNavProvider } from \"./IToolbarArrowNavProvider.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base\";\n\n/**\n * Interface for the slotted item in `ui5-toolbar-item`.\n *\n * It could be any HTMLElement or UI5 Web Component with option to specify custom overflow closing events and overflow behavior.\n * Components that also implement `IToolbarArrowNavProvider` can report their internal navigation boundary\n * state to the toolbar for caret-aware arrow-key handling.\n *\n * @public\n * @since 2.20.0\n */\ninterface IToolbarItemContent extends HTMLElement {\n\toverflowCloseEvents?: string[];\n\thasOverflow?: boolean;\n}\n\ninterface IItemNavigationOwner extends HTMLElement {\n\t_itemNavigation?: {\n\t\t_getCurrentItem: () => HTMLElement | undefined;\n\t};\n\t_getFocusableItems?: () => Array<{ getFocusDomRef?: () => HTMLElement }>;\n}\n\n/**\n * @class\n *\n * ### Overview\n * The `ui5-toolbar-item` is a wrapper component used to integrate UI5 Web Components into the `ui5-toolbar`.\n * It renders within the toolbar's shadow DOM and manages the lifecycle\n * and overflow behavior of its child component.\n *\n * ### Structure\n * The toolbar item wraps a single UI5 Web Component (such as CheckBox, Title, etc.) and handles:\n * - Overflow management (determining if the item should be displayed in the main toolbar or overflow popover)\n * - Automatic popover closing on interaction\n * - CSS custom state exposure for styling based on overflow state\n *\n * ### Usage\n * The `ui5-toolbar-item` is typically used implicitly when adding components to a toolbar,\n * but specialized wrappers like `ui5-toolbar-button` provide\n * component-specific functionality and should be preferred when available.\n *\n * @constructor\n * @extends ToolbarItemBase\n * @public\n * @since 2.20.0\n */\n@customElement({\n\ttag: \"ui5-toolbar-item\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ToolbarItemTemplate,\n\tstyles: ToolbarItemCss,\n})\nclass ToolbarItem extends ToolbarItemBase {\n\t_maxWidth = 0;\n\t_wrapperChecked = false;\n\tfireCloseOverflowRef = this.fireCloseOverflow.bind(this);\n\t_onMultiChildKeydownRef = this._onMultiChildKeydown.bind(this);\n\n\tcloseOverflowSet = {\n\t\t\"ui5-button\": [\"click\"],\n\t\t\"ui5-select\": [\"change\"],\n\t\t\"ui5-combobox\": [\"change\"],\n\t\t\"ui5-multi-combobox\": [\"selection-change\"],\n\t\t\"ui5-date-picker\": [\"change\"],\n\t\t\"ui5-switch\": [\"change\"],\n\t}\n\n\tpredefinedWrapperSet = {\n\t\t\"ui5-button\": \"ToolbarButton\",\n\t\t\"ui5-select\": \"ToolbarSelect\",\n\t}\n\n\tonBeforeRendering(): void {\n\t\tthis.checkForWrapper();\n\t\tthis.attachCloseOverflowHandlers();\n\t\tif (this.item.length > 1) {\n\t\t\tthis.addEventListener(\"keydown\", this._onMultiChildKeydownRef, true);\n\t\t} else {\n\t\t\tthis.removeEventListener(\"keydown\", this._onMultiChildKeydownRef, true);\n\t\t}\n\t}\n\n\tonExitDOM(): void {\n\t\tthis.detachCloseOverflowHandlers();\n\t\tthis.removeEventListener(\"keydown\", this._onMultiChildKeydownRef, true);\n\t}\n\n\t/**\n\t * Wrapped component slot.\n\t * @public\n\t * @since 2.20.0\n\t */\n\n\t@slot({\n\t\t\"default\": true, type: HTMLElement, invalidateOnChildChange: true,\n\t})\n\titem!: DefaultSlot<IToolbarItemContent>;\n\n\t// Method called by ui5-toolbar to inform about the existing toolbar wrapper\n\tcheckForWrapper() {\n\t\tif (this._wrapperChecked) {\n\t\t\treturn;\n\t\t}\n\t\tthis._wrapperChecked = true;\n\n\t\tconst tagName = this.itemTagName as keyof typeof this.predefinedWrapperSet;\n\t\tconst ctor = this.constructor as typeof ToolbarItem;\n\t\tconst wrapperName = ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.tagName;\n\t\tif (wrapperName === \"ui5-toolbar-item\"\n\t\t\t&& this.predefinedWrapperSet[tagName]) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`This UI5 web component has its predefined toolbar wrapper called ${this.predefinedWrapperSet[tagName]}.`);\n\t\t}\n\t}\n\n\t// We want to close the overflow popover, when closing event is being executed\n\tgetClosingEvents(): string[] {\n\t\tconst item = this.item[0];\n\n\t\tconst closeEvents = this.closeOverflowSet[this.itemTagName as keyof typeof this.closeOverflowSet] || [];\n\t\tif (!item) {\n\t\t\treturn [...closeEvents];\n\t\t}\n\t\tconst overflowCloseEvents = item.overflowCloseEvents ? item.overflowCloseEvents : [];\n\n\t\treturn [...closeEvents, ...overflowCloseEvents];\n\t}\n\n\tattachCloseOverflowHandlers() {\n\t\tconst closingEvents = this.getClosingEvents();\n\t\tclosingEvents.forEach(clEvent => {\n\t\t\tif (!this.preventOverflowClosing) {\n\t\t\t\tthis.addEventListener(clEvent, this.fireCloseOverflowRef);\n\t\t\t}\n\t\t});\n\t}\n\n\tdetachCloseOverflowHandlers() {\n\t\tconst closingEvents = this.getClosingEvents();\n\t\tclosingEvents.forEach(clEvent => {\n\t\t\tthis.removeEventListener(clEvent, this.fireCloseOverflowRef);\n\t\t});\n\t}\n\n\tfireCloseOverflow() {\n\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t}\n\n\tget itemTagName() {\n\t\tconst ctor = this.getSlottedNodes<IToolbarItemContent>(\"item\")[0]?.constructor as typeof ToolbarItem;\n\t\treturn ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.getSlottedNodes<IToolbarItemContent>(\"item\")[0]?.tagName;\n\t}\n\n\tget isInteractive(): boolean {\n\t\treturn this._getNavigationTargets().some(target => this._isFocusable(target));\n\t}\n\n\t_isFocusable(el: HTMLElement): boolean {\n\t\tconst target = this._resolveFocusableTarget(el);\n\t\t// A disabled control reports tabIndex 0 but isn't focusable.\n\t\tif (\"disabled\" in target && !!(target as { disabled?: boolean }).disabled) {\n\t\t\treturn false;\n\t\t}\n\t\t// A bare <a> with no href reports tabIndex 0 but isn't focusable, UNLESS it\n\t\t// opts in via an explicit tabindex attribute (e.g. ui5-link rendered as a\n\t\t// button - <a role=\"button\" tabindex=\"0\"> with no href, used by the\n\t\t// Breadcrumbs overflow arrow).\n\t\tif (target.matches(\"a:not([href]):not([tabindex])\")) {\n\t\t\treturn false;\n\t\t}\n\t\t// tabIndex >= 0 covers focusable-by-default elements and explicit tabindex;\n\t\t// static content (div, span, ui5-text's focus ref) reports -1.\n\t\treturn target.tabIndex >= 0;\n\t}\n\n\t_resolveFocusableTarget(el: HTMLElement): HTMLElement {\n\t\t// Drill through UI5 hosts that delegate focus (date-picker ->\n\t\t// datetime-input -> native input); each host reports tabIndex -1.\n\t\tlet current: HTMLElement = el;\n\t\tconst seen = new Set<HTMLElement>();\n\t\twhile (instanceOfUI5Element(current) && !seen.has(current)) {\n\t\t\tseen.add(current);\n\t\t\tconst next = current.getFocusDomRef();\n\t\t\tif (!next || next === current) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcurrent = next;\n\t\t}\n\t\treturn current;\n\t}\n\n\tget hasOverflow(): boolean {\n\t\treturn this.item[0]?.hasOverflow ?? false;\n\t}\n\n\tgetFocusDomRef(): HTMLElement | undefined {\n\t\tconst child = this.item[0];\n\t\tif (child) {\n\t\t\treturn this._resolveChildFocusTarget(child);\n\t\t}\n\n\t\treturn super.getFocusDomRef();\n\t}\n\n\t/**\n\t * Resolves the element that should receive focus for a slotted child:\n\t * the child's own focus DOM ref when it is a UI5 component, otherwise the\n\t * first tabbable descendant, falling back to the child itself.\n\t */\n\t_resolveChildFocusTarget(child: HTMLElement): HTMLElement {\n\t\tconst withFocusRef = child as HTMLElement & { getFocusDomRef?: () => HTMLElement };\n\t\tif (typeof withFocusRef.getFocusDomRef === \"function\") {\n\t\t\treturn withFocusRef.getFocusDomRef() || child;\n\t\t}\n\n\t\treturn this._getFirstTabbableDescendant(child) || child;\n\t}\n\n\t_getFirstTabbableDescendant(root: HTMLElement): HTMLElement | null {\n\t\treturn root.querySelector<HTMLElement>(\"a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])\");\n\t}\n\n\tgetFocusDomRefForNavigation(forward: boolean): HTMLElement | undefined {\n\t\tconst targets = this._getNavigationTargets();\n\t\tif (!targets.length) {\n\t\t\treturn this.getFocusDomRef();\n\t\t}\n\n\t\treturn forward ? targets[0] : targets[targets.length - 1];\n\t}\n\n\t_handleNavigationTarget(target: HTMLElement) {\n\t\tconst hostTarget = this._resolveNavigationHost(target);\n\n\t\tif (this._isRadioButtonHost(hostTarget)) {\n\t\t\tconst radio = hostTarget as HTMLElement & {\n\t\t\t\tdisabled?: boolean;\n\t\t\t\treadonly?: boolean;\n\t\t\t\tchecked?: boolean;\n\t\t\t\tclick: () => void;\n\t\t\t};\n\n\t\t\thostTarget.focus();\n\n\t\t\tif (!radio.disabled && !radio.readonly && !radio.checked) {\n\t\t\t\tradio.click();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\thostTarget.focus();\n\t}\n\n\t_resolveNavigationHost(target: HTMLElement): HTMLElement {\n\t\tif (this._isUI5Host(target)) {\n\t\t\treturn target;\n\t\t}\n\n\t\tconst root = target.getRootNode();\n\t\tif (root instanceof ShadowRoot && root.host instanceof HTMLElement) {\n\t\t\treturn root.host;\n\t\t}\n\n\t\treturn target;\n\t}\n\n\t_isUI5Host(target: HTMLElement): boolean {\n\t\tconst ctor = target.constructor as { getMetadata?: () => unknown };\n\t\treturn typeof ctor.getMetadata === \"function\";\n\t}\n\n\t_isRadioButtonHost(target: HTMLElement): boolean {\n\t\treturn target.hasAttribute(\"ui5-radio-button\");\n\t}\n\n\t_matchesNavigationTarget(target: HTMLElement, candidate: HTMLElement): boolean {\n\t\tif (target === candidate || target.contains(candidate) || !!target.shadowRoot?.contains(candidate)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst host = this._resolveNavigationHost(candidate);\n\t\treturn target === host || target.contains(host) || !!target.shadowRoot?.contains(host);\n\t}\n\n\t_getNavigationTargets(): HTMLElement[] {\n\t\treturn this.item\n\t\t\t.filter(child => !(\"disabled\" in child && !!(child as { disabled?: boolean }).disabled))\n\t\t\t.map(child => this._resolveChildFocusTarget(child));\n\t}\n\n\t_getCurrentNavigationState() {\n\t\tconst items = this._getNavigationTargets();\n\t\tconst active = getActiveElement() as HTMLElement | null;\n\t\tconst current = active\n\t\t\t? items.find(item => this._matchesNavigationTarget(item, active))\n\t\t\t: undefined;\n\t\tconst currentIndex = current ? items.indexOf(current) : -1;\n\n\t\treturn {\n\t\t\titems,\n\t\t\tcurrent,\n\t\t\tcurrentIndex,\n\t\t};\n\t}\n\n\t_onMultiChildKeydown(e: KeyboardEvent) {\n\t\tconst isForward = this.effectiveDir === \"rtl\" ? isLeft(e) : isRight(e);\n\t\tconst isBackward = this.effectiveDir === \"rtl\" ? isRight(e) : isLeft(e);\n\t\tconst isHomeKey = isHome(e);\n\t\tconst isEndKey = isEnd(e);\n\t\tif (!isForward && !isBackward && !isHomeKey && !isEndKey) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { items, currentIndex } = this._getCurrentNavigationState();\n\t\tif (currentIndex === -1) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Home/End jump to the first/last child within the group.\n\t\tlet nextIndex: number;\n\t\tif (isHomeKey) {\n\t\t\tnextIndex = 0;\n\t\t} else if (isEndKey) {\n\t\t\tnextIndex = items.length - 1;\n\t\t} else {\n\t\t\tnextIndex = isForward ? currentIndex + 1 : currentIndex - 1;\n\t\t}\n\n\t\tif (nextIndex === currentIndex || nextIndex < 0 || nextIndex >= items.length) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tthis._handleNavigationTarget(items[nextIndex]);\n\t}\n\n\tgetArrowNavState(): ToolbarArrowNavState | undefined {\n\t\tconst child = this.item[0] as IToolbarItemContent | undefined;\n\t\tif (!child) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Priority 1: ItemNavigation-based components (e.g. Breadcrumbs, SegmentedButton)\n\t\tconst itemNavOwner = child as IItemNavigationOwner;\n\t\tif (typeof itemNavOwner._itemNavigation?._getCurrentItem === \"function\"\n\t\t\t&& typeof itemNavOwner._getFocusableItems === \"function\") {\n\t\t\tconst items = itemNavOwner._getFocusableItems();\n\t\t\tconst current = itemNavOwner._itemNavigation._getCurrentItem();\n\t\t\tconst currentIndex = current\n\t\t\t\t? items.findIndex(item => (item.getFocusDomRef ? item.getFocusDomRef() : item) === current)\n\t\t\t\t: -1;\n\t\t\tif (currentIndex !== -1) {\n\t\t\t\treturn {\n\t\t\t\t\tatLeftEnd: currentIndex === 0,\n\t\t\t\t\tatRightEnd: currentIndex === items.length - 1,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Priority 2: IToolbarArrowNavProvider interface (e.g. Input)\n\t\tif (isToolbarArrowNavProvider(child)) {\n\t\t\treturn child.getArrowNavState();\n\t\t}\n\n\t\t// Priority 3: proprietary multi-child fallback (e.g. bare checkbox group)\n\t\tif (this.item.length <= 1) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { items, currentIndex } = this._getCurrentNavigationState();\n\t\tif (currentIndex === -1) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tatLeftEnd: currentIndex === 0,\n\t\t\tatRightEnd: currentIndex === items.length - 1,\n\t\t};\n\t}\n\n\tfocusForToolbarNavigation(isForward: boolean) {\n\t\tconst target = this.getFocusDomRefForNavigation(isForward);\n\t\ttarget?.focus();\n\t}\n}\n\nexport type {\n\tIToolbarItemContent,\n};\nToolbarItem.define();\n\nexport default ToolbarItem;\n"]}
@@ -1,5 +1,6 @@
1
1
  import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
2
  import type ToolbarItemOverflowBehavior from "./types/ToolbarItemOverflowBehavior.js";
3
+ import type { ToolbarArrowNavState } from "./IToolbarArrowNavProvider.js";
3
4
  type ToolbarItemEventDetail = {
4
5
  targetRef: HTMLElement;
5
6
  };
@@ -21,6 +22,14 @@ declare class ToolbarItemBase extends UI5Element {
21
22
  * @public
22
23
  */
23
24
  preventOverflowClosing: boolean;
25
+ _getNavigationTargets(): HTMLElement[];
26
+ /**
27
+ * Focus entry point when toolbar navigates into this item.
28
+ * Override in complex items (e.g., Breadcrumbs) to handle direction-aware entry.
29
+ * @private
30
+ */
31
+ focusForToolbarNavigation(isForward: boolean): void;
32
+ getArrowNavState(): ToolbarArrowNavState | undefined;
24
33
  _isOverflowed: boolean;
25
34
  get isOverflowed(): boolean;
26
35
  /**
@@ -51,6 +60,7 @@ declare class ToolbarItemBase extends UI5Element {
51
60
  * @protected
52
61
  */
53
62
  get isInteractive(): boolean;
63
+ get isToolbarNavigatable(): boolean;
54
64
  get hasOverflow(): boolean;
55
65
  /**
56
66
  * Returns if the item is separator.
@@ -43,6 +43,22 @@ class ToolbarItemBase extends UI5Element {
43
43
  this._maxWidth = 0;
44
44
  this._isRendering = true;
45
45
  }
46
+ _getNavigationTargets() {
47
+ const ref = this.getFocusDomRef();
48
+ return ref ? [ref] : [];
49
+ }
50
+ /**
51
+ * Focus entry point when toolbar navigates into this item.
52
+ * Override in complex items (e.g., Breadcrumbs) to handle direction-aware entry.
53
+ * @private
54
+ */
55
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
56
+ focusForToolbarNavigation(isForward) {
57
+ this.getFocusDomRef()?.focus();
58
+ }
59
+ getArrowNavState() {
60
+ return undefined;
61
+ }
46
62
  get isOverflowed() {
47
63
  return this._isOverflowed;
48
64
  }
@@ -88,6 +104,9 @@ class ToolbarItemBase extends UI5Element {
88
104
  get isInteractive() {
89
105
  return true;
90
106
  }
107
+ get isToolbarNavigatable() {
108
+ return this.isInteractive && !this.hidden && !("disabled" in this && !!this.disabled);
109
+ }
91
110
  get hasOverflow() {
92
111
  return false;
93
112
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItemBase.js","sourceRoot":"","sources":["../src/ToolbarItemBase.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAyB5E,IAAM,eAAe;AAdrB;;;;;;;;;;;;;GAaG;AACH,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAKC;;;;;UAKE;QAEF,qBAAgB,GAAqC,SAAS,CAAC;QAE/D;;;;;WAKG;QAEH,2BAAsB,GAAG,KAAK,CAAC;QAE/B,kBAAa,GAAY,KAAK,CAAC;QAuB/B,cAAS,GAAG,CAAC,CAAC;QACd,iBAAY,GAAG,IAAI,CAAC;I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,EAAE,OAAO,EAAE,CAAC;+DACG;AAe/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAS3B;AA5CI,eAAe;IAjBpB,KAAK,CAAC,gBAAgB,EAAE;QACxB,OAAO,EAAE,IAAI;KACb,CAAC;IACF;;;;;;;;;;;;;OAaG;GACG,eAAe,CAsHpB;AAKD,eAAe,eAAe,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\n\nimport type ToolbarItemOverflowBehavior from \"./types/ToolbarItemOverflowBehavior.js\";\n\ntype ToolbarItemEventDetail = {\n\ttargetRef: HTMLElement;\n}\n\n@event(\"close-overflow\", {\n\tbubbles: true,\n})\n/**\n * @class\n * Represents an abstract base class for items used in the `ui5-toolbar`.\n *\n *\n * @cssState overflowed - When the item is displayed in the overflow popover.\n * Use this state to apply different styles when the item is overflowed.\n * Available since 2.20.0.\n * @constructor\n * @extends UI5Element\n * @abstract\n * @public\n * @since 1.17.0\n */\nclass ToolbarItemBase extends UI5Element {\n\teventDetails!: {\n\t\t\"close-overflow\": void;\n\t}\n\n\t/**\n\t* Property used to define the access of the item to the overflow Popover. If \"NeverOverflow\" option is set,\n\t* the item never goes in the Popover, if \"AlwaysOverflow\" - it never comes out of it.\n\t* @public\n\t* @default \"Default\"\n\t*/\n\t@property()\n\toverflowPriority: `${ToolbarItemOverflowBehavior}` = \"Default\";\n\n\t/**\n\t * Defines if the toolbar overflow popup should close upon interaction with the item.\n\t * It will close by default.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tpreventOverflowClosing = false;\n\n\t_isOverflowed: boolean = false;\n\n\tget isOverflowed(): boolean {\n\t\treturn this._isOverflowed;\n\t}\n\n\t/**\n\t * Defines if the toolbar item is overflowed.\n\t * @default false\n\t * @protected\n\t * @since 2.11.0\n\t */\n\t@property({ type: Boolean })\n\tset isOverflowed(value: boolean) {\n\t\tthis._isOverflowed = value;\n\n\t\tif (value) {\n\t\t\tthis._internals.states.add(\"overflowed\");\n\t\t} else {\n\t\t\tthis._internals.states.delete(\"overflowed\");\n\t\t}\n\t}\n\n\t_maxWidth = 0;\n\t_isRendering = true;\n\n\tonAfterRendering(): void {\n\t\tthis._isRendering = false;\n\t}\n\t/**\n\t* Defines if the width of the item should be ignored in calculating the whole width of the toolbar\n\t* @protected\n\t*/\n\tget ignoreSpace(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is flexible. An item that is returning true for this property will make\n\t * the toolbar expand to fill the 100% width of its container.\n\t * @protected\n\t */\n\tget hasFlexibleWidth(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is interactive.\n\t * This value is used to determinate if the toolbar should have its accessibility role and attributes set.\n\t * At least two interactive items are needed for the toolbar to have the role=\"toolbar\" attribute set.\n\t * @protected\n\t */\n\tget isInteractive(): boolean {\n\t\treturn true;\n\t}\n\n\tget hasOverflow(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is separator.\n\t * @protected\n\t */\n\tget isSeparator() {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is a spacer.\n\t * A spacer item is an item that takes space in the toolbar, but does not render any content.\n\t * @protected\n\t * @since 2.21.0\n\t */\n\n\tget isSpacer() {\n\t\treturn false;\n\t}\n\n\tget stableDomRef() {\n\t\treturn this.getAttribute(\"stable-dom-ref\") || `${this._id}-stable-dom-ref`;\n\t}\n\n\tget classes() {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t\"ui5-tb-popover-item\": this.isOverflowed,\n\t\t\t\t\"ui5-tb-item\": true,\n\t\t\t},\n\t\t};\n\t}\n\n\tget styles() {\n\t\treturn {};\n\t}\n}\n\nexport type {\n\tToolbarItemEventDetail,\n};\nexport default ToolbarItemBase;\n"]}
1
+ {"version":3,"file":"ToolbarItemBase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sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\n\nimport type ToolbarItemOverflowBehavior from \"./types/ToolbarItemOverflowBehavior.js\";\nimport type { ToolbarArrowNavState } from \"./IToolbarArrowNavProvider.js\";\n\ntype ToolbarItemEventDetail = {\n\ttargetRef: HTMLElement;\n}\n\n@event(\"close-overflow\", {\n\tbubbles: true,\n})\n/**\n * @class\n * Represents an abstract base class for items used in the `ui5-toolbar`.\n *\n *\n * @cssState overflowed - When the item is displayed in the overflow popover.\n * Use this state to apply different styles when the item is overflowed.\n * Available since 2.20.0.\n * @constructor\n * @extends UI5Element\n * @abstract\n * @public\n * @since 1.17.0\n */\nclass ToolbarItemBase extends UI5Element {\n\teventDetails!: {\n\t\t\"close-overflow\": void;\n\t}\n\n\t/**\n\t* Property used to define the access of the item to the overflow Popover. If \"NeverOverflow\" option is set,\n\t* the item never goes in the Popover, if \"AlwaysOverflow\" - it never comes out of it.\n\t* @public\n\t* @default \"Default\"\n\t*/\n\t@property()\n\toverflowPriority: `${ToolbarItemOverflowBehavior}` = \"Default\";\n\n\t/**\n\t * Defines if the toolbar overflow popup should close upon interaction with the item.\n\t * It will close by default.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tpreventOverflowClosing = false;\n\n\t_getNavigationTargets(): HTMLElement[] {\n\t\tconst ref = this.getFocusDomRef();\n\t\treturn ref ? [ref] : [];\n\t}\n\n\t/**\n\t * Focus entry point when toolbar navigates into this item.\n\t * Override in complex items (e.g., Breadcrumbs) to handle direction-aware entry.\n\t * @private\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tfocusForToolbarNavigation(isForward: boolean) {\n\t\tthis.getFocusDomRef()?.focus();\n\t}\n\n\tgetArrowNavState(): ToolbarArrowNavState | undefined {\n\t\treturn undefined;\n\t}\n\n\t_isOverflowed: boolean = false;\n\n\tget isOverflowed(): boolean {\n\t\treturn this._isOverflowed;\n\t}\n\n\t/**\n\t * Defines if the toolbar item is overflowed.\n\t * @default false\n\t * @protected\n\t * @since 2.11.0\n\t */\n\t@property({ type: Boolean })\n\tset isOverflowed(value: boolean) {\n\t\tthis._isOverflowed = value;\n\n\t\tif (value) {\n\t\t\tthis._internals.states.add(\"overflowed\");\n\t\t} else {\n\t\t\tthis._internals.states.delete(\"overflowed\");\n\t\t}\n\t}\n\n\t_maxWidth = 0;\n\t_isRendering = true;\n\n\tonAfterRendering(): void {\n\t\tthis._isRendering = false;\n\t}\n\t/**\n\t* Defines if the width of the item should be ignored in calculating the whole width of the toolbar\n\t* @protected\n\t*/\n\tget ignoreSpace(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is flexible. An item that is returning true for this property will make\n\t * the toolbar expand to fill the 100% width of its container.\n\t * @protected\n\t */\n\tget hasFlexibleWidth(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is interactive.\n\t * This value is used to determinate if the toolbar should have its accessibility role and attributes set.\n\t * At least two interactive items are needed for the toolbar to have the role=\"toolbar\" attribute set.\n\t * @protected\n\t */\n\tget isInteractive(): boolean {\n\t\treturn true;\n\t}\n\n\tget isToolbarNavigatable(): boolean {\n\t\treturn this.isInteractive && !this.hidden && !(\"disabled\" in this && !!(this as { disabled?: boolean }).disabled);\n\t}\n\n\tget hasOverflow(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is separator.\n\t * @protected\n\t */\n\tget isSeparator() {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is a spacer.\n\t * A spacer item is an item that takes space in the toolbar, but does not render any content.\n\t * @protected\n\t * @since 2.21.0\n\t */\n\n\tget isSpacer() {\n\t\treturn false;\n\t}\n\n\tget stableDomRef() {\n\t\treturn this.getAttribute(\"stable-dom-ref\") || `${this._id}-stable-dom-ref`;\n\t}\n\n\tget classes() {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t\"ui5-tb-popover-item\": this.isOverflowed,\n\t\t\t\t\"ui5-tb-item\": true,\n\t\t\t},\n\t\t};\n\t}\n\n\tget styles() {\n\t\treturn {};\n\t}\n}\n\nexport type {\n\tToolbarItemEventDetail,\n};\nexport default ToolbarItemBase;\n"]}
@@ -5,7 +5,9 @@ import type { ToolbarItemEventDetail } from "./ToolbarItemBase.js";
5
5
  import type ToolbarSelectOption from "./ToolbarSelectOption.js";
6
6
  import type { SelectChangeEventDetail } from "./Select.js";
7
7
  import type { DefaultSlot, Slot } from "@ui5/webcomponents-base/dist/UI5Element.js";
8
- type ToolbarSelectChangeEventDetail = ToolbarItemEventDetail & SelectChangeEventDetail;
8
+ type ToolbarSelectChangeEventDetail = ToolbarItemEventDetail & SelectChangeEventDetail & {
9
+ selectedToolbarOption: ToolbarSelectOption | undefined;
10
+ };
9
11
  /**
10
12
  * @class
11
13
  *
@@ -96,7 +98,7 @@ declare class ToolbarSelect extends ToolbarItemBase {
96
98
  onOpen(e: Event): void;
97
99
  onClose(e: Event): void;
98
100
  onChange(e: CustomEvent<SelectChangeEventDetail>): void;
99
- _syncOptions(selectedOption: HTMLElement): void;
101
+ _syncOptions(selectedOptionIndex: number): void;
100
102
  get styles(): {
101
103
  width: string | undefined;
102
104
  };
@@ -92,14 +92,15 @@ let ToolbarSelect = class ToolbarSelect extends ToolbarItemBase {
92
92
  }
93
93
  onChange(e) {
94
94
  e.stopImmediatePropagation();
95
- const prevented = !this.fireDecoratorEvent("change", { ...e.detail, targetRef: e.target });
95
+ const selectedOptionIndex = Number(e.detail.selectedOption?.getAttribute("data-ui5-external-action-item-index"));
96
+ const selectedToolbarOption = this.options[selectedOptionIndex];
97
+ const prevented = !this.fireDecoratorEvent("change", { ...e.detail, targetRef: e.target, selectedToolbarOption });
96
98
  if (!prevented) {
97
99
  this.fireDecoratorEvent("close-overflow");
98
100
  }
99
- this._syncOptions(e.detail.selectedOption);
101
+ this._syncOptions(selectedOptionIndex);
100
102
  }
101
- _syncOptions(selectedOption) {
102
- const selectedOptionIndex = Number(selectedOption?.getAttribute("data-ui5-external-action-item-index"));
103
+ _syncOptions(selectedOptionIndex) {
103
104
  this.options.forEach((option, index) => {
104
105
  option.selected = index === selectedOptionIndex;
105
106
  });
@@ -151,6 +152,8 @@ ToolbarSelect = __decorate([
151
152
  /**
152
153
  * Fired when the selected option changes.
153
154
  * @param {HTMLElement} selectedOption the selected option.
155
+ * @param {HTMLElement} selectedToolbarOption the original toolbar select option.
156
+ * @since 2.25.0
154
157
  * @public
155
158
  */
156
159
  ,
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarSelect.js","sourceRoot":"","sources":["../src/ToolbarSelect.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAE5E,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AAGvE,YAAY;AACZ,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAQnD;;;;;;;;;;;;;;;;GAgBG;AA+BH,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,eAAe;IAA3C;;QA2CC;;;;WAIG;QAEH,eAAU,GAAoB,MAAM,CAAC;QAErC;;;;;;WAMG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAyCjB,qGAAqG;QACrG,WAAM,GAAW,EAAE,CAAC;IAoDrB,CAAC;IA5EA;;;;;;OAMG;IAEH,IAAI,KAAK,CAAC,QAAgB;QACzB,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,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CAAC;+CACX;AAQjB;IADC,QAAQ,EAAE;qDACY;AAQvB;IADC,QAAQ,EAAE;wDACgB;AAU3B;IADC,QAAQ,EAAE;0CAMV;AA1FI,aAAa;IA9BlB,aAAa,CAAC;QACd,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,qBAAqB;QAC/B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,gBAAgB;KACxB,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,QAAQ,EAAE;QAChB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,OAAO,CAAC;GACT,aAAa,CAyJlB;AAED,aAAa,CAAC,MAAM,EAAE,CAAC;AAEvB,eAAe,aAAa,CAAC","sourcesContent":["import jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport type ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport ToolbarSelectCss from \"./generated/themes/ToolbarSelect.css.js\";\nimport type Select from \"./Select.js\";\n\n// Templates\nimport ToolbarSelectTemplate from \"./ToolbarSelectTemplate.js\";\nimport ToolbarItemBase from \"./ToolbarItemBase.js\";\nimport type { ToolbarItemEventDetail } from \"./ToolbarItemBase.js\";\nimport type ToolbarSelectOption from \"./ToolbarSelectOption.js\";\nimport type { SelectChangeEventDetail } from \"./Select.js\";\nimport type { DefaultSlot, Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\ntype ToolbarSelectChangeEventDetail = ToolbarItemEventDetail & SelectChangeEventDetail;\n\n/**\n * @class\n *\n * ### Overview\n * The `ui5-toolbar-select` component is used to create a toolbar drop-down list.\n * The items inside the `ui5-toolbar-select` define the available options by using the `ui5-toolbar-select-option` component.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/ToolbarSelect.js\";`\n *\n * `import \"@ui5/webcomponents/dist/ToolbarSelectOption.js\";` (comes with `ui5-toolbar-select`)\n * @constructor\n * @abstract\n * @extends ToolbarItemBase\n * @public\n * @since 1.17.0\n */\n@customElement({\n\ttag: \"ui5-toolbar-select\",\n\ttemplate: ToolbarSelectTemplate,\n\trenderer: jsxRenderer,\n\tstyles: ToolbarSelectCss,\n})\n\n/**\n * Fired when the selected option changes.\n * @param {HTMLElement} selectedOption the selected option.\n * @public\n */\n@event(\"change\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\n/**\n * Fired after the component's dropdown menu opens.\n * @public\n */\n@event(\"open\", {\n\tbubbles: true,\n})\n\n/**\n * Fired after the component's dropdown menu closes.\n * @public\n */\n@event(\"close\")\nclass ToolbarSelect extends ToolbarItemBase {\n\teventDetails!: ToolbarItemBase[\"eventDetails\"] & {\n\t\tchange: ToolbarSelectChangeEventDetail;\n\t\topen: ToolbarItemEventDetail;\n\t\tclose: ToolbarItemEventDetail;\n\t\t\"click\": ToolbarItemEventDetail;\n\t}\n\n\t/**\n\t * Defines the width of the select.\n\t *\n\t * **Note:** all CSS sizes are supported - 'percentage', 'px', 'rem', 'auto', etc.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\twidth?: string;\n\n\t/**\n\t * Defines the component options.\n\t *\n\t * **Note:** Only one selected option is allowed.\n\t * If more than one option is defined as selected, the last one would be considered as the selected one.\n\t *\n\t * **Note:** Use the `ui5-toolbar-select-option` component to define the desired options.\n\t * @public\n\t */\n\t@slot({\n\t\t\"default\": true,\n\t\ttype: HTMLElement,\n\t\tinvalidateOnChildChange: true,\n\t})\n\toptions!: DefaultSlot<ToolbarSelectOption>;\n\n\t/**\n\t * Defines the HTML element that will be displayed in the component input part,\n\t * representing the selected option.\n\t * @public\n\t * @since 2.15.0\n\t*/\n\t@slot()\n\tlabel!: Slot<HTMLElement>;\n\n\t/**\n\t * Defines the value state of the component.\n\t * @default \"None\"\n\t * @public\n\t */\n\t@property()\n\tvalueState: `${ValueState}` = \"None\";\n\n\t/**\n\t * Defines whether the component is in disabled state.\n\t *\n\t * **Note:** A disabled component is noninteractive.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @public\n\t * @default undefined\n\t */\n\t@property()\n\taccessibleName?: string\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the select.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the value of the component:\n\t *\n\t * @public\n\t * @default \"\"\n\t * @since 2.15.0\n\t */\n\t@property()\n\tset value(newValue: string) {\n\t\tif (this.select && this.select.value !== newValue) {\n\t\t\tthis.select.value = newValue;\n\t\t}\n\t\tthis._value = newValue;\n\t}\n\n\tget value(): string | undefined {\n\t\treturn this.select ? this.select.value : this._value;\n\t}\n\n\tget select(): Select | null {\n\t\treturn this.shadowRoot!.querySelector<Select>(\"[ui5-select]\");\n\t}\n\n\t// Internal value storage, in case the composite select is not rendered on the the assignment happens\n\t_value: string = \"\";\n\n\tonClick(e: Event): void {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"click\", { targetRef: e.target as HTMLElement });\n\t\tif (prevented && !this.preventOverflowClosing) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\t}\n\n\tonOpen(e: Event): void {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"open\", { targetRef: e.target as HTMLElement });\n\t\tif (prevented) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\t}\n\n\tonClose(e: Event): void {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"close\", { targetRef: e.target as HTMLElement });\n\t\tif (prevented) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\t}\n\n\tonChange(e: CustomEvent<SelectChangeEventDetail>): void {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"change\", { ...e.detail, targetRef: e.target as HTMLElement });\n\t\tif (!prevented) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\n\t\tthis._syncOptions(e.detail.selectedOption);\n\t}\n\n\t_syncOptions(selectedOption: HTMLElement): void {\n\t\tconst selectedOptionIndex = Number(selectedOption?.getAttribute(\"data-ui5-external-action-item-index\"));\n\t\tthis.options.forEach((option: ToolbarSelectOption, index: number) => {\n\t\t\toption.selected = index === selectedOptionIndex;\n\t\t});\n\t}\n\n\tget styles() {\n\t\treturn {\n\t\t\twidth: this.isOverflowed ? undefined : this.width,\n\t\t};\n\t}\n\n\tget hasCustomLabel() {\n\t\treturn !!this.label.length;\n\t}\n}\n\nToolbarSelect.define();\n\nexport default ToolbarSelect;\n\nexport type {\n\tToolbarSelectChangeEventDetail,\n};\n"]}
1
+ {"version":3,"file":"ToolbarSelect.js","sourceRoot":"","sources":["../src/ToolbarSelect.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAE5E,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AAGvE,YAAY;AACZ,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAUnD;;;;;;;;;;;;;;;;GAgBG;AAiCH,IAAM,aAAa,GAAn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CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;SACjD,CAAC;IACH,CAAC;IAED,IAAI,cAAc;QACjB,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC5B,CAAC;CACD,CAAA;AA1IA;IADC,QAAQ,EAAE;4CACI;AAgBf;IALC,IAAI,CAAC;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,WAAW;QACjB,uBAAuB,EAAE,IAAI;KAC7B,CAAC;8CACyC;AAS3C;IADC,IAAI,EAAE;4CACmB;AAQ1B;IADC,QAAQ,EAAE;iDAC0B;AAUrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACX;AAQjB;IADC,QAAQ,EAAE;qDACY;AAQvB;IADC,QAAQ,EAAE;wDACgB;AAU3B;IADC,QAAQ,EAAE;0CAMV;AA1FI,aAAa;IAhClB,aAAa,CAAC;QACd,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,qBAAqB;QAC/B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,gBAAgB;KACxB,CAAC;IAEF;;;;;;OAMG;;IACF,KAAK,CAAC,QAAQ,EAAE;QAChB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,OAAO,CAAC;GACT,aAAa,CA0JlB;AAED,aAAa,CAAC,MAAM,EAAE,CAAC;AAEvB,eAAe,aAAa,CAAC","sourcesContent":["import jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport type ValueState from \"@ui5/webcomponents-base/dist/types/ValueState.js\";\nimport ToolbarSelectCss from \"./generated/themes/ToolbarSelect.css.js\";\nimport type Select from \"./Select.js\";\n\n// Templates\nimport ToolbarSelectTemplate from \"./ToolbarSelectTemplate.js\";\nimport ToolbarItemBase from \"./ToolbarItemBase.js\";\nimport type { ToolbarItemEventDetail } from \"./ToolbarItemBase.js\";\nimport type ToolbarSelectOption from \"./ToolbarSelectOption.js\";\nimport type { SelectChangeEventDetail } from \"./Select.js\";\nimport type { DefaultSlot, Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\ntype ToolbarSelectChangeEventDetail = ToolbarItemEventDetail & SelectChangeEventDetail & {\n\tselectedToolbarOption: ToolbarSelectOption | undefined;\n};\n\n/**\n * @class\n *\n * ### Overview\n * The `ui5-toolbar-select` component is used to create a toolbar drop-down list.\n * The items inside the `ui5-toolbar-select` define the available options by using the `ui5-toolbar-select-option` component.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/ToolbarSelect.js\";`\n *\n * `import \"@ui5/webcomponents/dist/ToolbarSelectOption.js\";` (comes with `ui5-toolbar-select`)\n * @constructor\n * @abstract\n * @extends ToolbarItemBase\n * @public\n * @since 1.17.0\n */\n@customElement({\n\ttag: \"ui5-toolbar-select\",\n\ttemplate: ToolbarSelectTemplate,\n\trenderer: jsxRenderer,\n\tstyles: ToolbarSelectCss,\n})\n\n/**\n * Fired when the selected option changes.\n * @param {HTMLElement} selectedOption the selected option.\n * @param {HTMLElement} selectedToolbarOption the original toolbar select option.\n * @since 2.25.0\n * @public\n */\n@event(\"change\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\n/**\n * Fired after the component's dropdown menu opens.\n * @public\n */\n@event(\"open\", {\n\tbubbles: true,\n})\n\n/**\n * Fired after the component's dropdown menu closes.\n * @public\n */\n@event(\"close\")\nclass ToolbarSelect extends ToolbarItemBase {\n\teventDetails!: ToolbarItemBase[\"eventDetails\"] & {\n\t\tchange: ToolbarSelectChangeEventDetail;\n\t\topen: ToolbarItemEventDetail;\n\t\tclose: ToolbarItemEventDetail;\n\t\t\"click\": ToolbarItemEventDetail;\n\t}\n\n\t/**\n\t * Defines the width of the select.\n\t *\n\t * **Note:** all CSS sizes are supported - 'percentage', 'px', 'rem', 'auto', etc.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\twidth?: string;\n\n\t/**\n\t * Defines the component options.\n\t *\n\t * **Note:** Only one selected option is allowed.\n\t * If more than one option is defined as selected, the last one would be considered as the selected one.\n\t *\n\t * **Note:** Use the `ui5-toolbar-select-option` component to define the desired options.\n\t * @public\n\t */\n\t@slot({\n\t\t\"default\": true,\n\t\ttype: HTMLElement,\n\t\tinvalidateOnChildChange: true,\n\t})\n\toptions!: DefaultSlot<ToolbarSelectOption>;\n\n\t/**\n\t * Defines the HTML element that will be displayed in the component input part,\n\t * representing the selected option.\n\t * @public\n\t * @since 2.15.0\n\t*/\n\t@slot()\n\tlabel!: Slot<HTMLElement>;\n\n\t/**\n\t * Defines the value state of the component.\n\t * @default \"None\"\n\t * @public\n\t */\n\t@property()\n\tvalueState: `${ValueState}` = \"None\";\n\n\t/**\n\t * Defines whether the component is in disabled state.\n\t *\n\t * **Note:** A disabled component is noninteractive.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @public\n\t * @default undefined\n\t */\n\t@property()\n\taccessibleName?: string\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the select.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the value of the component:\n\t *\n\t * @public\n\t * @default \"\"\n\t * @since 2.15.0\n\t */\n\t@property()\n\tset value(newValue: string) {\n\t\tif (this.select && this.select.value !== newValue) {\n\t\t\tthis.select.value = newValue;\n\t\t}\n\t\tthis._value = newValue;\n\t}\n\n\tget value(): string | undefined {\n\t\treturn this.select ? this.select.value : this._value;\n\t}\n\n\tget select(): Select | null {\n\t\treturn this.shadowRoot!.querySelector<Select>(\"[ui5-select]\");\n\t}\n\n\t// Internal value storage, in case the composite select is not rendered on the the assignment happens\n\t_value: string = \"\";\n\n\tonClick(e: Event): void {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"click\", { targetRef: e.target as HTMLElement });\n\t\tif (prevented && !this.preventOverflowClosing) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\t}\n\n\tonOpen(e: Event): void {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"open\", { targetRef: e.target as HTMLElement });\n\t\tif (prevented) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\t}\n\n\tonClose(e: Event): void {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"close\", { targetRef: e.target as HTMLElement });\n\t\tif (prevented) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\t}\n\n\tonChange(e: CustomEvent<SelectChangeEventDetail>): void {\n\t\te.stopImmediatePropagation();\n\t\tconst selectedOptionIndex = Number(e.detail.selectedOption?.getAttribute(\"data-ui5-external-action-item-index\"));\n\t\tconst selectedToolbarOption = this.options[selectedOptionIndex];\n\t\tconst prevented = !this.fireDecoratorEvent(\"change\", { ...e.detail, targetRef: e.target as HTMLElement, selectedToolbarOption });\n\t\tif (!prevented) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\n\t\tthis._syncOptions(selectedOptionIndex);\n\t}\n\n\t_syncOptions(selectedOptionIndex: number): void {\n\t\tthis.options.forEach((option: ToolbarSelectOption, index: number) => {\n\t\t\toption.selected = index === selectedOptionIndex;\n\t\t});\n\t}\n\n\tget styles() {\n\t\treturn {\n\t\t\twidth: this.isOverflowed ? undefined : this.width,\n\t\t};\n\t}\n\n\tget hasCustomLabel() {\n\t\treturn !!this.label.length;\n\t}\n}\n\nToolbarSelect.define();\n\nexport default ToolbarSelect;\n\nexport type {\n\tToolbarSelectChangeEventDetail,\n};\n"]}
@@ -13,6 +13,13 @@ import type { DefaultSlot } from "@ui5/webcomponents-base/dist/UI5Element.js";
13
13
  * @since 1.17.0
14
14
  */
15
15
  declare class ToolbarSelectOption extends UI5Element {
16
+ /**
17
+ * Defines the value of the component.
18
+ * @default undefined
19
+ * @public
20
+ * @since 2.25.0
21
+ */
22
+ value?: string;
16
23
  /**
17
24
  * Defines the selected state of the component.
18
25
  * @default false
@@ -47,11 +47,14 @@ let ToolbarSelectOption = class ToolbarSelectOption extends UI5Element {
47
47
  }
48
48
  });
49
49
  if (parent.select) {
50
- parent.select.value = this.textContent || "";
50
+ parent.select.value = this.value !== undefined && this.value !== "" ? this.value : (this.textContent || "");
51
51
  }
52
52
  }
53
53
  }
54
54
  };
55
+ __decorate([
56
+ property()
57
+ ], ToolbarSelectOption.prototype, "value", void 0);
55
58
  __decorate([
56
59
  property({ type: Boolean })
57
60
  ], ToolbarSelectOption.prototype, "selected", null);
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarSelectOption.js","sourceRoot":"","sources":["../src/ToolbarSelectOption.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAG3E;;;;;;;;;;;GAWG;AAEH,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IAC3C;;;;OAIG;IAEH,IAAI,QAAQ,CAAC,KAAc;QAC1B,IAAI,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAClC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC9B,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAED,qBAAqB;QACpB,MAAM,MAAM,GAAG,IAAI,CAAC,aAA8B,CAAC;QACnD,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE;gBAChC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;oBACrB,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;gBACpC,CAAC;YACF,CAAC,CAAC,CAAC;YACH,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBACnB,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;CAUD,CAAA;AAnCA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAQ3B;AA2BD;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;iDAC5C;AAzCpB,mBAAmB;IADxB,aAAa,CAAC,2BAA2B,CAAC;GACrC,mBAAmB,CA0CxB;AAED,mBAAmB,CAAC,MAAM,EAAE,CAAC;AAE7B,eAAe,mBAAmB,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type ToolbarSelect from \"./ToolbarSelect.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-toolbar-select-option` component defines the content of an option in the `ui5-toolbar-select`.\n * @constructor\n * @extends UI5Element\n * @abstract\n * @public\n * @since 1.17.0\n */\n@customElement(\"ui5-toolbar-select-option\")\nclass ToolbarSelectOption extends UI5Element {\n\t/**\n\t * Defines the selected state of the component.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tset selected(value: boolean) {\n\t\tif (value) {\n\t\t\tthis.setAttribute(\"selected\", \"\");\n\t\t\tthis._clearSiblingsAndSync();\n\t\t} else {\n\t\t\tthis.removeAttribute(\"selected\");\n\t\t}\n\t}\n\n\tget selected(): boolean {\n\t\treturn this.hasAttribute(\"selected\");\n\t}\n\n\t_clearSiblingsAndSync(): void {\n\t\tconst parent = this.parentElement as ToolbarSelect;\n\t\tif (parent) {\n\t\t\tparent.options?.forEach(option => {\n\t\t\t\tif (option !== this) {\n\t\t\t\t\toption.removeAttribute(\"selected\");\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (parent.select) {\n\t\t\t\tparent.select.value = this.textContent || \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true, invalidateOnChildChange: true })\n\ttext!: DefaultSlot<Node>;\n}\n\nToolbarSelectOption.define();\n\nexport default ToolbarSelectOption;\n"]}
1
+ {"version":3,"file":"ToolbarSelectOption.js","sourceRoot":"","sources":["../src/ToolbarSelectOption.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAG3E;;;;;;;;;;;GAWG;AAEH,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IA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BAAmB,CAAC,MAAM,EAAE,CAAC;AAE7B,eAAe,mBAAmB,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type ToolbarSelect from \"./ToolbarSelect.js\";\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-toolbar-select-option` component defines the content of an option in the `ui5-toolbar-select`.\n * @constructor\n * @extends UI5Element\n * @abstract\n * @public\n * @since 1.17.0\n */\n@customElement(\"ui5-toolbar-select-option\")\nclass ToolbarSelectOption extends UI5Element {\n\t/**\n\t * Defines the value of the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.25.0\n\t */\n\t@property()\n\tvalue?: string;\n\n\t/**\n\t * Defines the selected state of the component.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tset selected(value: boolean) {\n\t\tif (value) {\n\t\t\tthis.setAttribute(\"selected\", \"\");\n\t\t\tthis._clearSiblingsAndSync();\n\t\t} else {\n\t\t\tthis.removeAttribute(\"selected\");\n\t\t}\n\t}\n\n\tget selected(): boolean {\n\t\treturn this.hasAttribute(\"selected\");\n\t}\n\n\t_clearSiblingsAndSync(): void {\n\t\tconst parent = this.parentElement as ToolbarSelect;\n\t\tif (parent) {\n\t\t\tparent.options?.forEach(option => {\n\t\t\t\tif (option !== this) {\n\t\t\t\t\toption.removeAttribute(\"selected\");\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (parent.select) {\n\t\t\t\tparent.select.value = this.value !== undefined && this.value !== \"\" ? this.value : (this.textContent || \"\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true, invalidateOnChildChange: true })\n\ttext!: DefaultSlot<Node>;\n}\n\nToolbarSelectOption.define();\n\nexport default ToolbarSelectOption;\n"]}
@@ -3,6 +3,6 @@ import Select from "./Select.js";
3
3
  import Option from "./Option.js";
4
4
  export default function ToolbarSelectTemplate() {
5
5
  return (_jsxs(Select, { class: this.classes.root, style: this.styles, value: this.value, "data-ui5-external-action-item-id": this._id, valueState: this.valueState, disabled: this.disabled, accessibleName: this.accessibleName, accessibleNameRef: this.accessibleNameRef, onClick: (...args) => this.onClick(...args), onClose: (...args) => this.onClose(...args), onOpen: (...args) => this.onOpen(...args), onChange: (...args) => this.onChange(...args), children: [this.hasCustomLabel &&
6
- _jsx("slot", { name: "label", slot: "label" }), this.options.map((option, index) => (_jsx(Option, { selected: option.selected, "data-ui5-external-action-item-index": index, children: option.textContent })))] }));
6
+ _jsx("slot", { name: "label", slot: "label" }), this.options.map((option, index) => (_jsx(Option, { selected: option.selected, value: option.value, "data-ui5-external-action-item-index": index, children: option.textContent })))] }));
7
7
  }
8
8
  //# sourceMappingURL=ToolbarSelectTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarSelectTemplate.js","sourceRoot":"","sources":["../src/ToolbarSelectTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC5C,OAAO,CACN,MAAC,MAAM,IACN,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EACxB,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,sCACiB,IAAI,CAAC,GAAG,EAC1C,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EAC3C,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EAC3C,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EACzC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,aAE5C,IAAI,CAAC,cAAc;gBACnB,eAAM,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,GACxB,EAEP,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,KAAC,MAAM,IACN,QAAQ,EAAE,MAAM,CAAC,QAAQ,yCACY,KAAK,YAEzC,MAAM,CAAC,WAAW,GACX,CACT,CAAC,IACM,CAAC,CAAC;AACb,CAAC","sourcesContent":["import type ToolbarSelect from \"./ToolbarSelect.js\";\nimport Select from \"./Select.js\";\nimport Option from \"./Option.js\";\n\nexport default function ToolbarSelectTemplate(this: ToolbarSelect) {\n\treturn (\n\t\t<Select\n\t\t\tclass={this.classes.root}\n\t\t\tstyle={this.styles}\n\t\t\tvalue={this.value}\n\t\t\tdata-ui5-external-action-item-id={this._id}\n\t\t\tvalueState={this.valueState}\n\t\t\tdisabled={this.disabled}\n\t\t\taccessibleName={this.accessibleName}\n\t\t\taccessibleNameRef={this.accessibleNameRef}\n\t\t\tonClick={(...args) => this.onClick(...args)}\n\t\t\tonClose={(...args) => this.onClose(...args)}\n\t\t\tonOpen={(...args) => this.onOpen(...args)}\n\t\t\tonChange={(...args) => this.onChange(...args)}\n\t\t>\n\t\t\t{this.hasCustomLabel &&\n\t\t\t\t<slot name=\"label\" slot=\"label\">\n\t\t\t\t</slot>\n\t\t\t}\n\t\t\t{this.options.map((option, index) => (\n\t\t\t\t<Option\n\t\t\t\t\tselected={option.selected}\n\t\t\t\t\tdata-ui5-external-action-item-index={index}\n\t\t\t\t>\n\t\t\t\t\t{option.textContent}\n\t\t\t\t</Option>\n\t\t\t))}\n\t\t</Select>);\n}\n"]}
1
+ {"version":3,"file":"ToolbarSelectTemplate.js","sourceRoot":"","sources":["../src/ToolbarSelectTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,qBAAqB;IAC5C,OAAO,CACN,MAAC,MAAM,IACN,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EACxB,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,sCACiB,IAAI,CAAC,GAAG,EAC1C,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EAC3C,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,EAC3C,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EACzC,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,aAE5C,IAAI,CAAC,cAAc;gBACnB,eAAM,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,GACxB,EAEP,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,KAAC,MAAM,IACN,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,KAAK,EAAE,MAAM,CAAC,KAAK,yCACkB,KAAK,YAEzC,MAAM,CAAC,WAAW,GACX,CACT,CAAC,IACM,CAAC,CAAC;AACb,CAAC","sourcesContent":["import type ToolbarSelect from \"./ToolbarSelect.js\";\nimport Select from \"./Select.js\";\nimport Option from \"./Option.js\";\n\nexport default function ToolbarSelectTemplate(this: ToolbarSelect) {\n\treturn (\n\t\t<Select\n\t\t\tclass={this.classes.root}\n\t\t\tstyle={this.styles}\n\t\t\tvalue={this.value}\n\t\t\tdata-ui5-external-action-item-id={this._id}\n\t\t\tvalueState={this.valueState}\n\t\t\tdisabled={this.disabled}\n\t\t\taccessibleName={this.accessibleName}\n\t\t\taccessibleNameRef={this.accessibleNameRef}\n\t\t\tonClick={(...args) => this.onClick(...args)}\n\t\t\tonClose={(...args) => this.onClose(...args)}\n\t\t\tonOpen={(...args) => this.onOpen(...args)}\n\t\t\tonChange={(...args) => this.onChange(...args)}\n\t\t>\n\t\t\t{this.hasCustomLabel &&\n\t\t\t\t<slot name=\"label\" slot=\"label\">\n\t\t\t\t</slot>\n\t\t\t}\n\t\t\t{this.options.map((option, index) => (\n\t\t\t\t<Option\n\t\t\t\t\tselected={option.selected}\n\t\t\t\t\tvalue={option.value}\n\t\t\t\t\tdata-ui5-external-action-item-index={index}\n\t\t\t\t>\n\t\t\t\t\t{option.textContent}\n\t\t\t\t</Option>\n\t\t\t))}\n\t\t</Select>);\n}\n"]}