@sapudex/web-components 2.0.0 → 2.1.0
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/cypress/specs/CountrySelector.cy.tsx +215 -0
- package/cypress/specs/Table.cy.tsx +361 -0
- package/cypress/specs/Upload.cy.tsx +17 -0
- package/dist/AssetsVariables.js +1 -1
- package/dist/AssetsVariables.js.map +1 -1
- package/dist/FilterMenu.d.ts +7 -0
- package/dist/FilterMenu.js +3 -0
- package/dist/FilterMenu.js.map +1 -1
- package/dist/MastheadItem.d.ts +21 -2
- package/dist/MastheadItem.js +95 -13
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadMenu.d.ts +1 -0
- package/dist/MastheadMenu.js +11 -5
- package/dist/MastheadMenu.js.map +1 -1
- package/dist/MastheadMobileMenu.d.ts +8 -2
- package/dist/MastheadMobileMenu.js +8 -2
- package/dist/MastheadMobileMenu.js.map +1 -1
- package/dist/MastheadShell.d.ts +24 -12
- package/dist/MastheadShell.js +75 -26
- package/dist/MastheadShell.js.map +1 -1
- package/dist/SecondaryNavigation.d.ts +6 -5
- package/dist/SecondaryNavigation.js +8 -6
- package/dist/SecondaryNavigation.js.map +1 -1
- package/dist/SecondaryNavigationItem.d.ts +9 -6
- package/dist/SecondaryNavigationItem.js +19 -13
- package/dist/SecondaryNavigationItem.js.map +1 -1
- package/dist/SecondaryNavigationSubItem.d.ts +8 -4
- package/dist/SecondaryNavigationSubItem.js +6 -5
- package/dist/SecondaryNavigationSubItem.js.map +1 -1
- package/dist/Table.d.ts +1 -1
- package/dist/Table.js +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/Upload.d.ts +12 -2
- package/dist/Upload.js +25 -1
- package/dist/Upload.js.map +1 -1
- package/dist/assets/{InputSuggestions-pMcXiozG.js → InputSuggestions-DoWo0hwS.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-BoB9C9hl.js → ListItemStandardExpandableTextTemplate-BymOTLVD.js} +1 -1
- package/dist/assets/{bundle.esm-4ejJpC9l.js → bundle.esm-D10tX-qa.js} +196 -196
- package/dist/assets/messagebundle_en-CVKgy_9L.js +1 -0
- package/dist/css/themes/MastheadItem.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/css/themes/Upload.css +1 -1
- package/dist/custom-elements-internal.json +132 -11
- package/dist/custom-elements.json +93 -7
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +4 -1
- package/dist/generated/i18n/i18n-defaults.js +4 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/templates/FilterMenuTemplate.lit.js +1 -1
- package/dist/generated/templates/FilterMenuTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadItemTemplate.lit.js +2 -2
- package/dist/generated/templates/MastheadItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadMenuTemplate.lit.js +1 -1
- package/dist/generated/templates/MastheadMenuTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadMobileMenuTemplate.lit.js +2 -2
- package/dist/generated/templates/MastheadMobileMenuTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadShellTemplate.lit.js +6 -5
- package/dist/generated/templates/MastheadShellTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.js +1 -1
- package/dist/generated/templates/SecondaryNavigationItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/UploadTemplate.lit.js +2 -2
- package/dist/generated/templates/UploadTemplate.lit.js.map +1 -1
- package/dist/generated/themes/MastheadItem.css.d.ts +1 -1
- package/dist/generated/themes/MastheadItem.css.js +1 -1
- package/dist/generated/themes/MastheadItem.css.js.map +1 -1
- package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
- package/dist/generated/themes/RatingIndicator.css.js +1 -1
- package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
- package/dist/generated/themes/Slider.css.d.ts +1 -1
- package/dist/generated/themes/Slider.css.js +1 -1
- package/dist/generated/themes/Slider.css.js.map +1 -1
- package/dist/generated/themes/Upload.css.d.ts +1 -1
- package/dist/generated/themes/Upload.css.js +1 -1
- package/dist/generated/themes/Upload.css.js.map +1 -1
- package/dist/messagebundle.properties +9 -1
- package/dist/messagebundle_en.properties +4 -1
- package/dist/vscode.html-custom-data.json +14 -4
- package/dist/web-types.json +80 -11
- package/package.json +1 -1
- package/src/AssetsVariables.ts +1 -1
- package/src/FilterMenu.hbs +1 -0
- package/src/FilterMenu.ts +8 -0
- package/src/MastheadItem.hbs +2 -2
- package/src/MastheadItem.ts +119 -15
- package/src/MastheadMenu.hbs +4 -1
- package/src/MastheadMenu.ts +12 -5
- package/src/MastheadMobileMenu.hbs +2 -2
- package/src/MastheadMobileMenu.ts +16 -3
- package/src/MastheadShell.hbs +14 -3
- package/src/MastheadShell.ts +98 -36
- package/src/SecondaryNavigation.ts +14 -10
- package/src/SecondaryNavigationItem.hbs +1 -1
- package/src/SecondaryNavigationItem.ts +25 -16
- package/src/SecondaryNavigationSubItem.ts +13 -7
- package/src/Table.ts +2 -2
- package/src/Upload.hbs +4 -4
- package/src/Upload.ts +24 -3
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/templates/FilterMenuTemplate.lit.ts +1 -1
- package/src/generated/templates/MastheadItemTemplate.lit.ts +2 -2
- package/src/generated/templates/MastheadMenuTemplate.lit.ts +1 -1
- package/src/generated/templates/MastheadMobileMenuTemplate.lit.ts +2 -2
- package/src/generated/templates/MastheadShellTemplate.lit.ts +6 -5
- package/src/generated/templates/SecondaryNavigationItemTemplate.lit.ts +1 -1
- package/src/generated/templates/UploadTemplate.lit.ts +2 -2
- package/src/generated/themes/MastheadItem.css.ts +1 -1
- package/src/generated/themes/RatingIndicator.css.ts +1 -1
- package/src/generated/themes/Slider.css.ts +1 -1
- package/src/generated/themes/Upload.css.ts +1 -1
- package/src/i18n/messagebundle.properties +9 -1
- package/src/i18n/messagebundle_en.properties +4 -1
- package/src/themes/MastheadItem.css +9 -3
- package/src/themes/Upload.css +10 -2
- package/dist/assets/messagebundle_en-BYIX4tmE.js +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import UDExCountrySelector from "../../src/CountrySelector.js";
|
|
2
|
+
|
|
3
|
+
const defaultCountrySelector = <UDExCountrySelector id="default"
|
|
4
|
+
searchPlaceholder="Search Countries and Regions"
|
|
5
|
+
label="Countries"
|
|
6
|
+
blockedCountryCodes="PL">
|
|
7
|
+
</UDExCountrySelector>
|
|
8
|
+
|
|
9
|
+
const countrySelectorWithoutFlags = <UDExCountrySelector id="country-selector-no-flags"
|
|
10
|
+
searchPlaceholder="Search Countries and Regions"
|
|
11
|
+
blockedCountry-Codes="PL"
|
|
12
|
+
hideFlagImages>
|
|
13
|
+
</UDExCountrySelector>
|
|
14
|
+
|
|
15
|
+
const countrySelectorWithSupportingText = <UDExCountrySelector
|
|
16
|
+
id="country-selector-supporting-text"
|
|
17
|
+
supportingText="Test supporting text"
|
|
18
|
+
searchPlaceholder="Search Countries and Regions"
|
|
19
|
+
height="400px">
|
|
20
|
+
</UDExCountrySelector>
|
|
21
|
+
|
|
22
|
+
describe("CountrySelector", () => {
|
|
23
|
+
const blockedCountryIsoCode = 'PL';
|
|
24
|
+
const initialCountryData = {
|
|
25
|
+
iso: 'FR',
|
|
26
|
+
phoneFmt: "+xxxx xxxx xxxx",
|
|
27
|
+
countryName: "France",
|
|
28
|
+
localName: "France",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const countrySelectorNoFlagClass = "udex-country-selector__dropdown--hide-flag";
|
|
32
|
+
const countrySelectorDisabledClass = "udex-country-selector__trigger--disabled";
|
|
33
|
+
const countrySelectorReadOnlyClass = "udex-country-selector__trigger--readonly";
|
|
34
|
+
const countrySelectorDisplayOnlyClass = "udex-country-selector__trigger--displayonly";
|
|
35
|
+
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
cy.mount(defaultCountrySelector)
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("is correctly rendered", () => {
|
|
41
|
+
cy.get("#default").shadow().find(".udex-country-selector__dropdown").should("be.visible")
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("renders flag icon when no country is selected", () => {
|
|
45
|
+
cy.get("#default").shadow().find(".udex-country-selector__image").should("be.visible")
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("renders label", () => {
|
|
49
|
+
cy.get("#default").shadow().find("udex-text-field").shadow().find(".udex-text-field__label").should("have.text", "Countries")
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("renders placeholder in the dropdown's search", () => {
|
|
53
|
+
cy.get("#default").shadow().find(".udex-country-selector__dropdown").find("udex-search").shadow().find("input").should("have.attr", "placeholder", "Search Countries and Regions")
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("renders supporting text", () => {
|
|
57
|
+
cy.mount(countrySelectorWithSupportingText)
|
|
58
|
+
cy.get("#country-selector-supporting-text").shadow().find("udex-status-message").shadow().find(".udex-status-message__supporting-text").should("have.text", "Test supporting text")
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("renders Standard valueState by default", () => {
|
|
62
|
+
cy.mount(countrySelectorWithSupportingText)
|
|
63
|
+
cy.get("#country-selector-supporting-text").should("have.attr", "value-state", "Standard")
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("renders Error valueState", () => {
|
|
67
|
+
cy.mount(<UDExCountrySelector valueState="Error"></UDExCountrySelector>)
|
|
68
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").should("have.attr", "value-state", "Error")
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("renders Warning valueState", () => {
|
|
72
|
+
cy.mount(<UDExCountrySelector valueState="Warning"></UDExCountrySelector>)
|
|
73
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").should("have.attr", "value-state", "Warning")
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("renders Success valueState", () => {
|
|
77
|
+
cy.mount(<UDExCountrySelector valueState="Success"></UDExCountrySelector>)
|
|
78
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").should("have.attr", "value-state", "Success")
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('opens the dropdown on trigger click', () => {
|
|
82
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
83
|
+
cy.get("#default").shadow().find("#dropdown").should("have.attr", "open")
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('closes the dropdown on trigger click', () => {
|
|
87
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
88
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
89
|
+
cy.get("#default").shadow().find("#dropdown").should("not.have.attr", "open")
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('closes the dropdown on outside click', () => {
|
|
93
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
94
|
+
cy.get("body").click()
|
|
95
|
+
cy.get("#default").shadow().find("#dropdown").should("not.have.attr", "open")
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('closes the dropdown on country selection', () => {
|
|
99
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
100
|
+
cy.get("#default").shadow().find("#dropdown").find("udex-list")
|
|
101
|
+
.find("udex-list-item").first().click()
|
|
102
|
+
cy.get("#default").shadow().find("#dropdown").should("not.have.attr", "open")
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('opens the dropdown on trigger icon click', () => {
|
|
106
|
+
cy.get("#default").shadow().find("#udexTextField").shadow().find("udex-control-button").click()
|
|
107
|
+
cy.get("#default").shadow().find("#dropdown").should("have.attr", "open")
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('doesnt render blocked country', () => {
|
|
111
|
+
cy.get("#default").shadow().find("#dropdown").find("udex-list-item[id='PL']").should("not.exist")
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('renders readonly country selector', () => {
|
|
115
|
+
cy.mount(<UDExCountrySelector readonly></UDExCountrySelector>)
|
|
116
|
+
cy.get("[udex-country-selector]").shadow().find(".udex-country-selector__trigger").should("have.class", countrySelectorReadOnlyClass)
|
|
117
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").shadow().find("input").should("have.attr", "readonly")
|
|
118
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").shadow().find("input").should("have.attr", "aria-readonly", "true")
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('renders disabled country selector', () => {
|
|
122
|
+
cy.mount(<UDExCountrySelector disabled></UDExCountrySelector>)
|
|
123
|
+
cy.get("[udex-country-selector]").shadow().find(".udex-country-selector__trigger").should("have.class", countrySelectorDisabledClass)
|
|
124
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").shadow().find("input").should("have.attr", "disabled")
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('renders displayonly country selector', () => {
|
|
128
|
+
cy.mount(<UDExCountrySelector displayonly></UDExCountrySelector>)
|
|
129
|
+
cy.get("[udex-country-selector]").shadow().find(".udex-country-selector__trigger").should("have.class", countrySelectorDisplayOnlyClass)
|
|
130
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").shadow().find("input").should("have.attr", "readonly")
|
|
131
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").shadow().find("input").should("have.attr", "aria-readonly", "true")
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('hides trigger icon when displayonly', () => {
|
|
135
|
+
cy.mount(<UDExCountrySelector displayonly></UDExCountrySelector>)
|
|
136
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").shadow().find("udex-control-button").should("not.be.visible")
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('add special class when hideFlagImages is true', () => {
|
|
140
|
+
cy.mount(countrySelectorWithoutFlags)
|
|
141
|
+
cy.get("#country-selector-no-flags").shadow().find("#dropdown").find("udex-list")
|
|
142
|
+
.find("udex-list-item").first().find(".udex-country-selector-item__image").should("not.exist")
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('renders initially selected country', () => {
|
|
146
|
+
cy.mount(<UDExCountrySelector id="country-selector-preselected" preselectedCountry="PL"></UDExCountrySelector>)
|
|
147
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").should("have.attr", "value", "Poland (Polska)")
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it("emits open/close when dropdown opened/closed", () => {
|
|
151
|
+
const openHandler = cy.stub().as("openHandler")
|
|
152
|
+
const closeHandler = cy.stub().as("closeHandler")
|
|
153
|
+
cy.mount(<UDExCountrySelector onOpen={openHandler} onClose={closeHandler}></UDExCountrySelector>)
|
|
154
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").click()
|
|
155
|
+
cy.get("@openHandler").should("have.been.called")
|
|
156
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").click()
|
|
157
|
+
cy.get("@closeHandler").should("have.been.called")
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('emits change-search when search field typing', () => {
|
|
161
|
+
const changeHandler = cy.stub().as("changeHandler")
|
|
162
|
+
document.addEventListener("change-search", changeHandler)
|
|
163
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
164
|
+
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__field").click().realPress("p").realPress("o").realPress("l").realPress("a")
|
|
165
|
+
cy.get("@changeHandler").should("have.been.called")
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("emits reset-search when search reset button is clicked", () => {
|
|
169
|
+
const resetHandler = cy.stub().as("resetHandler")
|
|
170
|
+
document.addEventListener("reset-search", resetHandler)
|
|
171
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
172
|
+
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__field").click().realPress("p").realPress("o").realPress("l").realPress("a")
|
|
173
|
+
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__reset-button").click()
|
|
174
|
+
cy.get("@resetHandler").should("have.been.called")
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('emits submit-search when user presses Enter key in the search', () => {
|
|
178
|
+
const submitHandler = cy.stub().as("submitHandler")
|
|
179
|
+
document.addEventListener("submit-search", submitHandler)
|
|
180
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
181
|
+
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__field").click().realPress("p").realPress("o").realPress("l").realPress("a").realPress("Enter")
|
|
182
|
+
cy.get("@submitHandler").should("have.been.called")
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('emits selection-change when list item is clicked', () => {
|
|
186
|
+
const selectionHandler = cy.stub().as("selectionHandler")
|
|
187
|
+
cy.mount(<UDExCountrySelector onSelectionChange={selectionHandler}></UDExCountrySelector>)
|
|
188
|
+
cy.get("[udex-country-selector]").shadow().find("#udexTextField").click()
|
|
189
|
+
cy.get("[udex-country-selector]").shadow().find("#dropdown").find("udex-list")
|
|
190
|
+
.find("udex-list-item").first().click()
|
|
191
|
+
|
|
192
|
+
cy.get("@selectionHandler").should("have.been.called")
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('focus on element with corresponding starting letter', () => {
|
|
196
|
+
cy.get("#default").shadow().find("#udexTextField").click().realPress("Tab").realPress("a").realPress("a").realPress("Enter")
|
|
197
|
+
cy.get("#default").shadow().find("#udexTextField").should("have.attr", "value", "Albania (Shqipëria)")
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it('focus on element with corresponding starting letter filtered by search value', () => {
|
|
201
|
+
cy.get("#default").shadow().find("#udexTextField").click()
|
|
202
|
+
cy.get("#default").shadow().find("udex-search").shadow().find(".udex-search__field").click().realPress("p").realPress("o").realPress("l").realPress("a").realPress("Tab").realPress("Tab").realPress("Enter")
|
|
203
|
+
cy.get("#default").shadow().find("#udexTextField").should("have.attr", "value", "Afghanistan (افغانستان)")
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('keyboard focus navigation for `ArrowDown`', () => {
|
|
207
|
+
cy.get("#default").shadow().find("#udexTextField").click().realPress("Tab").realPress("a").realPress("{downarrow}").realPress("Enter")
|
|
208
|
+
cy.get("#default").shadow().find("#udexTextField").should("have.attr", "value", "Albania (Shqipëria)")
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('keyboard focus navigation for `ArrowUp`', () => {
|
|
212
|
+
cy.get("#default").shadow().find("#udexTextField").click().realPress("Tab").realPress("a").realPress("{downarrow}").realPress("{downarrow}").realPress("{uparrow}").realPress("Enter")
|
|
213
|
+
cy.get("#default").shadow().find("#udexTextField").should("have.attr", "value", "Albania (Shqipëria)")
|
|
214
|
+
});
|
|
215
|
+
});
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import UDExTable from "../../src/Table.js";
|
|
2
|
+
import UDExTableHeaderRow from "../../src/TableHeaderRow.js";
|
|
3
|
+
import UDExTableHeaderCell from "../../src/TableHeaderCell.js";
|
|
4
|
+
import UDExTableRow from "../../src/TableRow.js";
|
|
5
|
+
import UDExTableGroupRow from "../../src/TableGroupRow.js";
|
|
6
|
+
import UDExTableCell from "../../src/TableCell.js";
|
|
7
|
+
import UDExButton from "../../src/Button.js";
|
|
8
|
+
import UDExLink from "../../src/Link.js";
|
|
9
|
+
import UDExRatingIndicator from "../../src/RatingIndicator.js";
|
|
10
|
+
|
|
11
|
+
const defaultTable = <UDExTable
|
|
12
|
+
id="table"
|
|
13
|
+
sticky-header
|
|
14
|
+
heading="Microsoft Surface and Apple MacBook"
|
|
15
|
+
accessibleName="table devices"
|
|
16
|
+
maxHeight="200px">
|
|
17
|
+
<UDExTableHeaderRow id="tableHeaderRow" slot="headerRow">
|
|
18
|
+
<UDExTableHeaderCell
|
|
19
|
+
id="tableHeaderCell"
|
|
20
|
+
icon-start="sap-icon://bell"
|
|
21
|
+
icon-end="sap-icon://accessibility"
|
|
22
|
+
highlighted>
|
|
23
|
+
Product
|
|
24
|
+
</UDExTableHeaderCell>
|
|
25
|
+
<UDExTableHeaderCell>Processor</UDExTableHeaderCell>
|
|
26
|
+
<UDExTableHeaderCell>Display</UDExTableHeaderCell>
|
|
27
|
+
<UDExTableHeaderCell>Resolution</UDExTableHeaderCell>
|
|
28
|
+
<UDExTableHeaderCell>RAM</UDExTableHeaderCell>
|
|
29
|
+
<UDExTableHeaderCell>Storage</UDExTableHeaderCell>
|
|
30
|
+
<UDExTableHeaderCell>Rating</UDExTableHeaderCell>
|
|
31
|
+
<UDExTableHeaderCell highlighted>Price</UDExTableHeaderCell>
|
|
32
|
+
<UDExTableHeaderCell>Action</UDExTableHeaderCell>
|
|
33
|
+
</UDExTableHeaderRow>
|
|
34
|
+
<UDExTableRow id="table-row">
|
|
35
|
+
<UDExTableCell id="table-cell" icon="sap-icon://bell">
|
|
36
|
+
<i><UDExLink id="link-row1">SURFACE PRO4</UDExLink></i>
|
|
37
|
+
</UDExTableCell>
|
|
38
|
+
<UDExTableCell><UDExButton id="button-row1" size="Small">Intel Core M3, i5</UDExButton></UDExTableCell>
|
|
39
|
+
<UDExTableCell>12.3 inches</UDExTableCell>
|
|
40
|
+
<UDExTableCell>2736 x 1824</UDExTableCell>
|
|
41
|
+
<UDExTableCell>4GB, 8GB, 16GB</UDExTableCell>
|
|
42
|
+
<UDExTableCell>256GB, 512GB, 1TB</UDExTableCell>
|
|
43
|
+
<UDExTableCell><UDExRatingIndicator id="rating-row1" class="rating-indicator" value={5} max={5} readonly display="Desktop"></UDExRatingIndicator></UDExTableCell>
|
|
44
|
+
<UDExTableCell _highlighted><span class="price">$899</span></UDExTableCell>
|
|
45
|
+
<UDExTableCell><UDExButton size="Small">Buy now</UDExButton></UDExTableCell>
|
|
46
|
+
</UDExTableRow>
|
|
47
|
+
<UDExTableRow>
|
|
48
|
+
<UDExTableCell><UDExButton id="button-row2" size="Small">SURFACE PRO3</UDExButton></UDExTableCell>
|
|
49
|
+
<UDExTableCell><UDExLink id="link-row2">Intel Core i3, Core i7</UDExLink></UDExTableCell>
|
|
50
|
+
<UDExTableCell>12 inches</UDExTableCell>
|
|
51
|
+
<UDExTableCell>2160 x 1440</UDExTableCell>
|
|
52
|
+
<UDExTableCell>4GB, 8GB</UDExTableCell>
|
|
53
|
+
<UDExTableCell>128GB, 256GB, 512GB</UDExTableCell>
|
|
54
|
+
<UDExTableCell><UDExRatingIndicator class="rating-indicator" value={5} max={5} readonly display="Desktop"></UDExRatingIndicator></UDExTableCell>
|
|
55
|
+
<UDExTableCell _highlighted><span class="sale">$799</span></UDExTableCell>
|
|
56
|
+
<UDExTableCell><UDExButton size="Small">Buy now</UDExButton></UDExTableCell>
|
|
57
|
+
</UDExTableRow>
|
|
58
|
+
<UDExTableRow>
|
|
59
|
+
<UDExTableCell><i>MACBOOK AIR</i></UDExTableCell>
|
|
60
|
+
<UDExTableCell>Intel Core i5 or i7</UDExTableCell>
|
|
61
|
+
<UDExTableCell>13.3 inches</UDExTableCell>
|
|
62
|
+
<UDExTableCell>1440 x 900</UDExTableCell>
|
|
63
|
+
<UDExTableCell>8GB</UDExTableCell>
|
|
64
|
+
<UDExTableCell>128GB, 256GB, 512GB</UDExTableCell>
|
|
65
|
+
<UDExTableCell><UDExRatingIndicator class="rating-indicator" value={5} max={5} readonly display="Desktop"></UDExRatingIndicator></UDExTableCell>
|
|
66
|
+
<UDExTableCell _highlighted><span class="price">$899</span></UDExTableCell>
|
|
67
|
+
<UDExTableCell><UDExButton size="Small">Buy now</UDExButton></UDExTableCell>
|
|
68
|
+
</UDExTableRow>
|
|
69
|
+
<UDExTableRow>
|
|
70
|
+
<UDExTableCell><i>MACBOOK PRO</i></UDExTableCell>
|
|
71
|
+
<UDExTableCell>Intel Core i5 or i7</UDExTableCell>
|
|
72
|
+
<UDExTableCell>13.3 inches</UDExTableCell>
|
|
73
|
+
<UDExTableCell>2560 x 1600</UDExTableCell>
|
|
74
|
+
<UDExTableCell>8GB, 16GB</UDExTableCell>
|
|
75
|
+
<UDExTableCell>256GB, 512GB, 1TB</UDExTableCell>
|
|
76
|
+
<UDExTableCell><UDExRatingIndicator class="rating-indicator" value={5} max={5} readonly display="Desktop"></UDExRatingIndicator></UDExTableCell>
|
|
77
|
+
<UDExTableCell _highlighted><span class="price">$1,299</span></UDExTableCell>
|
|
78
|
+
<UDExTableCell><UDExButton size="Small">Buy now</UDExButton></UDExTableCell>
|
|
79
|
+
</UDExTableRow>
|
|
80
|
+
<UDExTableGroupRow
|
|
81
|
+
id="table-group-row"
|
|
82
|
+
group-title="Apple MacBook"
|
|
83
|
+
collapsible>
|
|
84
|
+
<UDExTableRow>
|
|
85
|
+
<UDExTableCell><i>MACBOOK AIR</i></UDExTableCell>
|
|
86
|
+
<UDExTableCell>Intel Core i5 or i7</UDExTableCell>
|
|
87
|
+
<UDExTableCell>13.3 inches</UDExTableCell>
|
|
88
|
+
<UDExTableCell>1440 x 900</UDExTableCell>
|
|
89
|
+
<UDExTableCell>8GB</UDExTableCell>
|
|
90
|
+
<UDExTableCell>128GB, 256GB, 512GB</UDExTableCell>
|
|
91
|
+
<UDExTableCell><UDExRatingIndicator class="rating-indicator" value={5} max={5} readonly display="Desktop"></UDExRatingIndicator></UDExTableCell>
|
|
92
|
+
<UDExTableCell><span class="price">$899</span></UDExTableCell>
|
|
93
|
+
<UDExTableCell><UDExButton size="Small">Buy now</UDExButton></UDExTableCell>
|
|
94
|
+
</UDExTableRow>
|
|
95
|
+
<UDExTableRow>
|
|
96
|
+
<UDExTableCell><i>MACBOOK PRO</i></UDExTableCell>
|
|
97
|
+
<UDExTableCell>Intel Core i5 or i7</UDExTableCell>
|
|
98
|
+
<UDExTableCell>13.3 inches</UDExTableCell>
|
|
99
|
+
<UDExTableCell>2560 x 1600</UDExTableCell>
|
|
100
|
+
<UDExTableCell>8GB, 16GB</UDExTableCell>
|
|
101
|
+
<UDExTableCell>256GB, 512GB, 1TB</UDExTableCell>
|
|
102
|
+
<UDExTableCell><UDExRatingIndicator class="rating-indicator" value={5} max={5} readonly display="Desktop"></UDExRatingIndicator></UDExTableCell>
|
|
103
|
+
<UDExTableCell><span class="price">$1,299</span></UDExTableCell>
|
|
104
|
+
<UDExTableCell><UDExButton size="Small">Buy now</UDExButton></UDExTableCell>
|
|
105
|
+
</UDExTableRow>
|
|
106
|
+
<UDExTableRow>
|
|
107
|
+
<UDExTableCell><i>MACBOOK AIR</i></UDExTableCell>
|
|
108
|
+
<UDExTableCell>Intel Core i5 or i7</UDExTableCell>
|
|
109
|
+
<UDExTableCell>13.3 inches</UDExTableCell>
|
|
110
|
+
<UDExTableCell>1440 x 900</UDExTableCell>
|
|
111
|
+
<UDExTableCell>8GB</UDExTableCell>
|
|
112
|
+
<UDExTableCell>128GB, 256GB, 512GB</UDExTableCell>
|
|
113
|
+
<UDExTableCell><UDExRatingIndicator class="rating-indicator" value={5} max={5} readonly display="Desktop"></UDExRatingIndicator></UDExTableCell>
|
|
114
|
+
<UDExTableCell><span class="price">$899</span></UDExTableCell>
|
|
115
|
+
<UDExTableCell><UDExButton size="Small">Buy now</UDExButton></UDExTableCell>
|
|
116
|
+
</UDExTableRow>
|
|
117
|
+
</UDExTableGroupRow>
|
|
118
|
+
<UDExButton size="Small" icon="sap-icon://retail-store" design="Secondary" slot="actions">Back to Store</UDExButton>
|
|
119
|
+
<UDExButton size="Small" design="Tertiary" icon="sap-icon://cart" slot="actions">Cart</UDExButton>
|
|
120
|
+
<div class="footnotes" slot="footnotes">
|
|
121
|
+
<p><UDExLink id="UDExLink-example" href="/" design="Default">Microsoft Surface</UDExLink>: It's a line of touchscreen-based personal computers and interactive whiteboards designed and developed by Microsoft.</p>
|
|
122
|
+
<p><UDExLink id="UDExLink-example" href="/" design="Default">Apple MacBook</UDExLink>: It's known for its sleek design, high-quality performance, and integration with the macOS operating system.</p>
|
|
123
|
+
</div>
|
|
124
|
+
</UDExTable>
|
|
125
|
+
|
|
126
|
+
const noDataTableDefault = <UDExTable
|
|
127
|
+
id="table-no-data-default">
|
|
128
|
+
<UDExTableHeaderRow slot="headerRow">
|
|
129
|
+
<UDExTableHeaderCell
|
|
130
|
+
id="tableHeaderCell"
|
|
131
|
+
icon-start="sap-icon://bell"
|
|
132
|
+
icon-end="sap-icon://accessibility"
|
|
133
|
+
highlighted>
|
|
134
|
+
Product
|
|
135
|
+
</UDExTableHeaderCell>
|
|
136
|
+
<UDExTableHeaderCell>Processor</UDExTableHeaderCell>
|
|
137
|
+
<UDExTableHeaderCell>Display</UDExTableHeaderCell>
|
|
138
|
+
<UDExTableHeaderCell>Resolution</UDExTableHeaderCell>
|
|
139
|
+
<UDExTableHeaderCell>RAM</UDExTableHeaderCell>
|
|
140
|
+
<UDExTableHeaderCell>Storage</UDExTableHeaderCell>
|
|
141
|
+
<UDExTableHeaderCell>Rating</UDExTableHeaderCell>
|
|
142
|
+
<UDExTableHeaderCell highlighted>Price</UDExTableHeaderCell>
|
|
143
|
+
<UDExTableHeaderCell>Action</UDExTableHeaderCell>
|
|
144
|
+
</UDExTableHeaderRow>
|
|
145
|
+
</UDExTable>
|
|
146
|
+
|
|
147
|
+
const noDataTable = <UDExTable
|
|
148
|
+
id="table-no-data">
|
|
149
|
+
<UDExTableHeaderRow slot="headerRow">
|
|
150
|
+
<UDExTableHeaderCell
|
|
151
|
+
id="tableHeaderCell"
|
|
152
|
+
icon-start="sap-icon://bell"
|
|
153
|
+
icon-end="sap-icon://accessibility"
|
|
154
|
+
highlighted>
|
|
155
|
+
Product
|
|
156
|
+
</UDExTableHeaderCell>
|
|
157
|
+
<UDExTableHeaderCell>Processor</UDExTableHeaderCell>
|
|
158
|
+
<UDExTableHeaderCell>Display</UDExTableHeaderCell>
|
|
159
|
+
<UDExTableHeaderCell>Resolution</UDExTableHeaderCell>
|
|
160
|
+
<UDExTableHeaderCell>RAM</UDExTableHeaderCell>
|
|
161
|
+
<UDExTableHeaderCell>Storage</UDExTableHeaderCell>
|
|
162
|
+
<UDExTableHeaderCell>Rating</UDExTableHeaderCell>
|
|
163
|
+
<UDExTableHeaderCell highlighted>Price</UDExTableHeaderCell>
|
|
164
|
+
<UDExTableHeaderCell>Action</UDExTableHeaderCell>
|
|
165
|
+
</UDExTableHeaderRow>
|
|
166
|
+
<p id="customNoData" slot="noData">No custom data found</p>
|
|
167
|
+
</UDExTable>
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
const loadingTable = <UDExTable loading={true}
|
|
171
|
+
id="table-loading">
|
|
172
|
+
<UDExTableHeaderRow slot="headerRow">
|
|
173
|
+
<UDExTableHeaderCell
|
|
174
|
+
id="tableHeaderCell"
|
|
175
|
+
icon-start="sap-icon://bell"
|
|
176
|
+
icon-end="sap-icon://accessibility"
|
|
177
|
+
highlighted>
|
|
178
|
+
Product
|
|
179
|
+
</UDExTableHeaderCell>
|
|
180
|
+
<UDExTableHeaderCell>Processor</UDExTableHeaderCell>
|
|
181
|
+
<UDExTableHeaderCell>Display</UDExTableHeaderCell>
|
|
182
|
+
<UDExTableHeaderCell>Resolution</UDExTableHeaderCell>
|
|
183
|
+
<UDExTableHeaderCell>RAM</UDExTableHeaderCell>
|
|
184
|
+
<UDExTableHeaderCell>Storage</UDExTableHeaderCell>
|
|
185
|
+
<UDExTableHeaderCell>Rating</UDExTableHeaderCell>
|
|
186
|
+
<UDExTableHeaderCell highlighted>Price</UDExTableHeaderCell>
|
|
187
|
+
<UDExTableHeaderCell>Action</UDExTableHeaderCell>
|
|
188
|
+
</UDExTableHeaderRow>
|
|
189
|
+
</UDExTable>
|
|
190
|
+
|
|
191
|
+
const customWidthTable = <UDExTable customColumns="50px 50px 50px"
|
|
192
|
+
id="table-custom-width">
|
|
193
|
+
<UDExTableHeaderRow slot="headerRow">
|
|
194
|
+
<UDExTableHeaderCell
|
|
195
|
+
id="tableHeaderCell"
|
|
196
|
+
icon-start="sap-icon://bell"
|
|
197
|
+
icon-end="sap-icon://accessibility"
|
|
198
|
+
highlighted>
|
|
199
|
+
Product
|
|
200
|
+
</UDExTableHeaderCell>
|
|
201
|
+
<UDExTableHeaderCell>Processor</UDExTableHeaderCell>
|
|
202
|
+
<UDExTableHeaderCell>Display</UDExTableHeaderCell>
|
|
203
|
+
<UDExTableHeaderCell>Resolution</UDExTableHeaderCell>
|
|
204
|
+
</UDExTableHeaderRow>
|
|
205
|
+
<UDExTableRow>
|
|
206
|
+
<UDExTableCell>Cell1</UDExTableCell>
|
|
207
|
+
<UDExTableCell>Cell2</UDExTableCell>
|
|
208
|
+
<UDExTableCell>Cell3</UDExTableCell>
|
|
209
|
+
</UDExTableRow>
|
|
210
|
+
<UDExTableRow>
|
|
211
|
+
<UDExTableCell>Cell3</UDExTableCell>
|
|
212
|
+
<UDExTableCell>Cell4</UDExTableCell>
|
|
213
|
+
<UDExTableCell>Cell5</UDExTableCell>
|
|
214
|
+
</UDExTableRow>
|
|
215
|
+
</UDExTable>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
describe("Table", () => {
|
|
219
|
+
beforeEach(() => {
|
|
220
|
+
cy.mount(defaultTable)
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it("is correctly rendered", () => {
|
|
224
|
+
cy.get("#table").shadow().find(".udex-table").should("be.visible")
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it("renders rows slot", () => {
|
|
228
|
+
cy.get("#table").shadow().find("slot").should("have.length", 4)
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it("renders header row slot", () => {
|
|
232
|
+
cy.get("#table").shadow().find('slot[name="headerRow"]').should("have.length", 1)
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it("renders actions slot", () => {
|
|
236
|
+
cy.get("#table").shadow().find('.udex-table-toolbar__actions > slot[name="actions"]').should("have.length", 1)
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it("renders footnotes slot", () => {
|
|
240
|
+
cy.get("#table").shadow().find('.udex-table-footnotes > slot[name="footnotes"]').should("have.length", 1)
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it("renders default no data content", () => {
|
|
244
|
+
cy.mount(noDataTableDefault)
|
|
245
|
+
cy.get("#table-no-data-default").shadow().find(".udex-table__no-data").should("have.text", "No data found")
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
it("renders custom no data slot", () => {
|
|
249
|
+
cy.mount(noDataTable)
|
|
250
|
+
cy.get("#table-no-data").shadow().find('.udex-table__no-data > slot[name="noData"]').should("have.length", 1)
|
|
251
|
+
expect(cy.get("#table-no-data").find("#customNoData").should("be.visible"))
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it("renders header", () => {
|
|
255
|
+
cy.get("#table").shadow().find(".udex-table-toolbar__title").should("have.text", "Microsoft Surface and Apple MacBook")
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it("tests render the right maximum height", () => {
|
|
259
|
+
cy.get("#table").shadow().find(".udex-table").then($tableWrap => {
|
|
260
|
+
const { maxHeight: tableMaxHeight } = window.getComputedStyle($tableWrap[0], "max-height")
|
|
261
|
+
expect(tableMaxHeight).eqls("200px")
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it("tests render the sticky header", () => {
|
|
266
|
+
cy.get("#table").shadow().find(".udex-table__header-holder").then($tableHeaderWrap => {
|
|
267
|
+
const { position: tableHeaderPosition } = window.getComputedStyle($tableHeaderWrap[0], "position")
|
|
268
|
+
expect(tableHeaderPosition).eqls("sticky")
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it("renders the loading indicator", () => {
|
|
273
|
+
cy.mount(loadingTable)
|
|
274
|
+
cy.get("#table-loading").shadow().find("ui5-busy-indicator").should("be.visible")
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it("renders accessible name", () => {
|
|
278
|
+
cy.get("#table").shadow().find(".udex-table").should("have.attr", "aria-label", "table devices")
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
it("renders the right amount of header rows", () => {
|
|
282
|
+
cy.get("#table").find("udex-table-header-row").should("have.length", 1)
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it("renders correct number of table-header-row-cell", () => {
|
|
286
|
+
cy.get("#table").find("#tableHeaderRow").find("udex-table-header-cell").should("have.length", 9)
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it("renders correct number of table-row-cell", () => {
|
|
290
|
+
cy.get("#table").find("#table-row").find("udex-table-cell").should("have.length", 9)
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it("renders correct number of rows of group", () => {
|
|
294
|
+
cy.get("#table").find("#table-group-row").find("udex-table-row").should("have.length", 3)
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it("renders correct title of group button", () => {
|
|
298
|
+
cy.get("#table").find("#table-group-row").shadow().find(".udex-table-grow-btn").should("have.text", "Apple MacBook")
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
it("test hidden rows of group", () => {
|
|
302
|
+
cy.get("#table").find("#table-group-row").find(".udex-table-grow-rows").should("not.exist")
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it("renders correct content in the header cell", () => {
|
|
306
|
+
cy.get("#table").find("#tableHeaderRow").find("udex-table-header-cell").first().should("have.text", "Product")
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
it("renders correct content in the cell", () => {
|
|
310
|
+
cy.get("#table").find("#table-row").find("udex-table-cell").first().should("have.text", "SURFACE PRO4")
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
it("renders icons in the header cell", () => {
|
|
314
|
+
cy.get("#table").find("#tableHeaderCell").shadow().find("ui5-icon").first().should("have.attr", "name", "sap-icon://bell")
|
|
315
|
+
cy.get("#table").find("#tableHeaderCell").shadow().find("ui5-icon").eq(1).should("have.attr", "name", "sap-icon://accessibility")
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
it("renders icons in the cell", () => {
|
|
319
|
+
cy.get("#table").find("#table-cell").shadow().find(".udex-table-cell__icon").should("have.attr", "name", "sap-icon://bell")
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("renders columns with custom width when specified", () => {
|
|
323
|
+
cy.mount(customWidthTable)
|
|
324
|
+
cy.get("#table-custom-width").find("udex-table-row").find("udex-table-cell").then($tableCell => {
|
|
325
|
+
const { width: cellWidth } = window.getComputedStyle($tableCell[0], "width")
|
|
326
|
+
expect(cellWidth).eqls("50px")
|
|
327
|
+
})
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
it("moves focus to previous interactive element after \"Arrow Left\" press", () => {
|
|
331
|
+
cy.get("#table").find("#table-row").find("udex-table-cell").eq(6).find("#rating-row1").click({force: true}).realPress("{leftarrow}")
|
|
332
|
+
cy.get("#table").find("#table-row").find("udex-table-cell").eq(1).find("#button-row1").shadow().find("button").then($button => {
|
|
333
|
+
const { borderColor: buttonBorder } = window.getComputedStyle($button[0], "::after");
|
|
334
|
+
expect(buttonBorder).eqls("rgb(255, 255, 255)")
|
|
335
|
+
})
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
it("moves focus to next interactive element after \"Arrow Right\" press", () => {
|
|
339
|
+
cy.get("#table").find("#table-row").find("udex-table-cell").eq(0).find("#link-row1").click({force: true}).realPress("{rightarrow}")
|
|
340
|
+
cy.get("#table").find("#table-row").find("udex-table-cell").eq(1).find("#button-row1").shadow().find("button").then($button => {
|
|
341
|
+
const { borderColor: buttonBorder } = window.getComputedStyle($button[0], "::after");
|
|
342
|
+
expect(buttonBorder).eqls("rgb(255, 255, 255)")
|
|
343
|
+
})
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
it("moves focus to next interactive element below after \"Arrow Down\" press", () => {
|
|
347
|
+
cy.get("#table").find("#table-row").find("udex-table-cell").eq(0).find("#link-row1").click({force: true}).realPress("{downarrow}")
|
|
348
|
+
cy.get("#table").find("udex-table-row").eq(1).find("udex-table-cell").eq(0).find("#button-row2").shadow().find("button").then($button => {
|
|
349
|
+
const { borderColor: buttonBorder } = window.getComputedStyle($button[0], "::after");
|
|
350
|
+
expect(buttonBorder).eqls("rgb(255, 255, 255)")
|
|
351
|
+
})
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it("moves focus to next interactive element above after \"Arrow Up\" press", () => {
|
|
355
|
+
cy.get("#table").find("udex-table-row").eq(1).find("udex-table-cell").eq(0).find("#button-row2").click({force: true}).realPress("{uparrow}")
|
|
356
|
+
cy.get("#table").find("#table-row").find("udex-table-cell").eq(0).find("#link-row1").shadow().find("a").then($link => {
|
|
357
|
+
const { outlineColor } = window.getComputedStyle($link[0]);
|
|
358
|
+
expect(outlineColor).eqls("rgb(34, 53, 72)")
|
|
359
|
+
})
|
|
360
|
+
});
|
|
361
|
+
});
|
|
@@ -18,6 +18,15 @@ const requiredUpload = <UDExUpload
|
|
|
18
18
|
required>
|
|
19
19
|
</UDExUpload>
|
|
20
20
|
|
|
21
|
+
const disabledUpload = <UDExUpload
|
|
22
|
+
id="disabledUpload"
|
|
23
|
+
additionalText="Max 10MB files are allowed. Only support .jpg, .png and .svg files"
|
|
24
|
+
uploadButtonText="Choose file(s)"
|
|
25
|
+
uploadTitle="Upload title"
|
|
26
|
+
multiple={false}
|
|
27
|
+
disabled>
|
|
28
|
+
</UDExUpload>
|
|
29
|
+
|
|
21
30
|
const singleUpload = <UDExUpload
|
|
22
31
|
id="singleUpload"
|
|
23
32
|
additionalText="Max 10MB files are allowed. Only support .jpg, .png and .svg files"
|
|
@@ -59,6 +68,14 @@ describe("Upload", () => {
|
|
|
59
68
|
});
|
|
60
69
|
})
|
|
61
70
|
|
|
71
|
+
describe("Disabled", () => {
|
|
72
|
+
it("correctly disabled button for uploading when specified", () => {
|
|
73
|
+
cy.mount(disabledUpload)
|
|
74
|
+
cy.get("#disabledUpload").shadow().find("udex-button").should("have.attr", "disabled")
|
|
75
|
+
cy.get("#disabledUpload").shadow().find("udex-button").should("have.attr", "aria-disabled", "true")
|
|
76
|
+
});
|
|
77
|
+
})
|
|
78
|
+
|
|
62
79
|
describe("Single", () => {
|
|
63
80
|
beforeEach(() => {
|
|
64
81
|
cy.mount(singleUpload)
|
package/dist/AssetsVariables.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getScopedVarName } from "@ui5/webcomponents-base/dist/CustomElementsScope.js";
|
|
2
2
|
const variablesOverwrite = `:root {
|
|
3
3
|
/* Browser Scrollbar */
|
|
4
|
-
${getScopedVarName("browser_scrollbar_border_radius")}: var(--udexRadiusM, 8px);
|
|
4
|
+
${getScopedVarName("--browser_scrollbar_border_radius")}: var(--udexRadiusM, 8px);
|
|
5
5
|
|
|
6
6
|
/* Tooltip */
|
|
7
7
|
${getScopedVarName("--_ui5_popover_box_shadow")}: 0px 0px 0px 1px var(--udexColorGrey4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsVariables.js","sourceRoot":"","sources":["../src/AssetsVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAEvF,MAAM,kBAAkB,GAAG;;IAEvB,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"AssetsVariables.js","sourceRoot":"","sources":["../src/AssetsVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAEvF,MAAM,kBAAkB,GAAG;;IAEvB,gBAAgB,CAAC,mCAAmC,CAAC;;;IAGrD,gBAAgB,CAAC,2BAA2B,CAAC;;;IAG7C,gBAAgB,CAAC,0BAA0B,CAAC;;;IAG5C,gBAAgB,CAAC,sCAAsC,CAAC;IACxD,gBAAgB,CAAC,kCAAkC,CAAC;;;IAGpD,gBAAgB,CAAC,4CAA4C,CAAC;IAC9D,gBAAgB,CAAC,gCAAgC,CAAC;IAClD,gBAAgB,CAAC,wCAAwC,CAAC;IAC1D,gBAAgB,CAAC,uCAAuC,CAAC;IACzD,gBAAgB,CAAC,6CAA6C,CAAC;IAC/D,gBAAgB,CAAC,oDAAoD,CAAC;IACtE,gBAAgB,CAAC,gDAAgD,CAAC;IAClE,gBAAgB,CAAC,gCAAgC,CAAC;;;MAGhD,gBAAgB,CAAC,4CAA4C,CAAC;;;;;;;MAO9D,gBAAgB,CAAC,uBAAuB,CAAC;MACzC,gBAAgB,CAAC,wBAAwB,CAAC;MAC1C,gBAAgB,CAAC,oCAAoC,CAAC;MACtD,gBAAgB,CAAC,oCAAoC,CAAC;MACtD,gBAAgB,CAAC,+BAA+B,CAAC;MACjD,gBAAgB,CAAC,2CAA2C,CAAC;MAC7D,gBAAgB,CAAC,8BAA8B,CAAC;MAChD,gBAAgB,CAAC,+BAA+B,CAAC;MACjD,gBAAgB,CAAC,iCAAiC,CAAC;MACnD,gBAAgB,CAAC,uCAAuC,CAAC;MACzD,gBAAgB,CAAC,iCAAiC,CAAC;MACnD,gBAAgB,CAAC,gCAAgC,CAAC;MAClD,gBAAgB,CAAC,gCAAgC,CAAC;MAClD,gBAAgB,CAAC,+BAA+B,CAAC;;CAEtD,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { getScopedVarName } from \"@ui5/webcomponents-base/dist/CustomElementsScope.js\";\n\nconst variablesOverwrite = `:root {\n /* Browser Scrollbar */\n ${getScopedVarName(\"--browser_scrollbar_border_radius\")}: var(--udexRadiusM, 8px);\n\n /* Tooltip */\n ${getScopedVarName(\"--_ui5_popover_box_shadow\")}: 0px 0px 0px 1px var(--udexColorGrey4);\n\n /* Tokenizer */\n ${getScopedVarName(\"--_ui5_tokenizer_padding\")}: var(--udexSpacer12, 12px);\n\n /* Carousel */\n ${getScopedVarName(\"--ui5_carousel_active_dot_background\")}: var(--udexColorBlue8, #0057D2);\n ${getScopedVarName(\"--ui5_carousel_active_dot_border\")}: 1px solid var(--udexColorBlue8, #0057D2);\n\n /* Calendar & Date Picker */\n ${getScopedVarName(\"--_ui5_daypicker_daynames_container_height\")}: 42px;\n ${getScopedVarName(\"--_ui5_daypicker_dayname_color\")}: var(--udexColorGrey6, #5B738B);\n ${getScopedVarName(\"--_ui5_daypicker_item_now_border_color\")}: var(--udexColorPink8, #A100C2);\n ${getScopedVarName(\"--_ui5_daypicker_item_weeekend_filter\")}: none;\n ${getScopedVarName(\"--_ui5_daypicker_item_select_between_border\")}: 1px solid var(--udexColorBlue9, #0040B0);\n ${getScopedVarName(\"--_ui5_calendar_header_middle_button_focus_outline\")}: 1px solid var(--udexColorBlue9, #0040B0);\n ${getScopedVarName(\"--_ui5_calendar_header_arrow_button_box_shadow\")}: none;\n ${getScopedVarName(\"--_ui5_calendar_header_padding\")}: 0;\n\n udex-search {\n ${getScopedVarName(\"--_ui5_button_pressed_focused_border_color\")}: transparent;\n }\n\n .sapUiSizeCompact,\n .ui5-content-density-compact,\n [data-ui5-compact-size] {\n /* Calendar & Date Picker */\n ${getScopedVarName(\"--_ui5_calendar_width\")}: 371px;\n ${getScopedVarName(\"--_ui5_calendar_height\")}: auto;\n ${getScopedVarName(\"--_ui5_calendar_top_bottom_padding\")}: var(--udexSpacer8, 8px);\n ${getScopedVarName(\"--_ui5_calendar_left_right_padding\")}: var(--udexSpacer8, 8px);\n ${getScopedVarName(\"--_ui5_calendar_header_height\")}: 42px;\n ${getScopedVarName(\"--_ui5_calendar_header_arrow_button_width\")}: 42px;\n ${getScopedVarName(\"--_ui5_day_picker_item_width\")}: 42px;\n ${getScopedVarName(\"--_ui5_day_picker_item_height\")}: 42px;\n ${getScopedVarName(\"--_ui5_daypicker_weekname_color\")}: var(--udexColorGrey6, #5B738B);\n ${getScopedVarName(\"--_ui5_daypicker_item_weeekend_filter\")}: none;\n ${getScopedVarName(\"--_ui5_month_picker_item_height\")}: 36px;\n ${getScopedVarName(\"--_ui5_monthpicker_item_margin\")}: -8px 0 var(--udexSpacer16, 16px) 0;\n ${getScopedVarName(\"--_ui5_year_picker_item_height\")}: 36px;\n ${getScopedVarName(\"--_ui5_yearpicker_item_margin\")}: -8px 0 var(--udexSpacer16, 16px) 0;\n }\n`;\n\nexport default variablesOverwrite;\n"]}
|
package/dist/FilterMenu.d.ts
CHANGED
|
@@ -148,6 +148,13 @@ declare class UDExFilterMenu extends UDExSearchableListBase {
|
|
|
148
148
|
* @public
|
|
149
149
|
*/
|
|
150
150
|
accessibleName?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Defines id (or many ids) of the elements that contain the ARIA name of the component.
|
|
153
|
+
*
|
|
154
|
+
* @default ""
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
accessibleNameRef: string;
|
|
151
158
|
/**
|
|
152
159
|
* Allows setting a custom role.
|
|
153
160
|
* @default "None"
|