Skip to content

Commit 086a92a

Browse files
authored
feat(ui5-select): adds new prop textSeparator
1 parent e50d4c7 commit 086a92a

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

packages/main/cypress/specs/Select.cy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,9 @@ describe("Select - Properties", () => {
617617
cy.get("[ui5-select]").should("have.prop", "formFormattedValue", "");
618618
});
619619

620-
it("Should show the selected two-column-separator when select is read-only", () => {
620+
it("Should show the selected text-separator when select is read-only", () => {
621621
cy.mount(
622-
<Select readonly two-column-separator="VerticalLine">
622+
<Select readonly text-separator="VerticalLine">
623623
<Option additionalText="Additional1" selected>First</Option>
624624
<Option additionalText="Additional2">Second</Option>
625625
</Select>

packages/main/src/Select.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
getEffectiveAriaDescriptionText,
2727
} from "@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js";
2828
import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
29-
import SelectTwoColumnSeparator from "./types/SelectTwoColumnSeparator.js";
29+
import SelectTextSeparator from "./types/SelectTextSeparator.js";
3030
import "@ui5/webcomponents-icons/dist/error.js";
3131
import "@ui5/webcomponents-icons/dist/alert.js";
3232
import "@ui5/webcomponents-icons/dist/sys-enter-2.js";
@@ -346,7 +346,7 @@ class Select extends UI5Element implements IFormInputElement {
346346
* @since 2.16.0
347347
*/
348348
@property()
349-
twoColumnSeparator: `${SelectTwoColumnSeparator}` = "Dash";
349+
textSeparator: `${SelectTextSeparator}` = "Dash";
350350

351351
/**
352352
* Constantly updated value of texts collected from the associated description texts
@@ -647,12 +647,12 @@ class Select extends UI5Element implements IFormInputElement {
647647
}
648648

649649
get _separatorSymbol(): string {
650-
switch (this.twoColumnSeparator) {
651-
case SelectTwoColumnSeparator.Bullet:
650+
switch (this.textSeparator) {
651+
case SelectTextSeparator.Bullet:
652652
return "·"; // Middle dot (U+00B7)
653-
case SelectTwoColumnSeparator.VerticalLine:
653+
case SelectTextSeparator.VerticalLine:
654654
return "|"; // Vertical line (U+007C)
655-
case SelectTwoColumnSeparator.Dash:
655+
case SelectTextSeparator.Dash:
656656
default:
657657
return "–"; // En dash (U+2013)
658658
}

packages/main/src/types/SelectTwoColumnSeparator.ts renamed to packages/main/src/types/SelectTextSeparator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @public
44
* @since 2.16.0
55
*/
6-
enum SelectTwoColumnSeparator {
6+
enum SelectTextSeparator {
77
/**
88
* Will show bullet(·) as separator on two columns layout when Select is in read-only mode.
99
* @public
@@ -23,4 +23,4 @@ enum SelectTwoColumnSeparator {
2323
VerticalLine = "VerticalLine",
2424
}
2525

26-
export default SelectTwoColumnSeparator;
26+
export default SelectTextSeparator;

packages/main/test/pages/Select.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ <h2>icon prop</h2>
304304
<section>
305305
<h3>Separator configuration</h3>
306306
<div>
307-
<span>Two column separator:</span>
307+
<span>Text separator:</span>
308308
<ui5-select id="selectSeparators">
309309
<ui5-option selected>Dash</ui5-option>
310310
<ui5-option>Bullet</ui5-option>
@@ -317,7 +317,7 @@ <h3>Separator configuration</h3>
317317
<ui5-switch id="editableSwitch" checked text-on="Yes" text-off="No"></ui5-switch>
318318
</div>
319319

320-
<ui5-select id="selectWithSeparator" readonly="false" two-column-separator="VerticalLine">
320+
<ui5-select id="selectWithSeparator" readonly="false" text-separator="VerticalLine">
321321
<ui5-option additional-text="DZ">Algeria</ui5-option>
322322
<ui5-option selected additional-text="AR">Argentina</ui5-option>
323323
<ui5-option additional-text="AU">Australia</ui5-option>
@@ -478,7 +478,7 @@ <h3>Separator configuration</h3>
478478

479479
selectSeparators.addEventListener('ui5-change', function(e) {
480480
const selectedSeparator = e.detail.selectedOption.textContent;
481-
selectWithSeparator.setAttribute('two-column-separator', selectedSeparator);
481+
selectWithSeparator.setAttribute('text-separator', selectedSeparator);
482482
});
483483

484484
editableSwitch.addEventListener('ui5-change', function(e) {

0 commit comments

Comments
 (0)