@ui5/webcomponents-base 2.11.0-rc.1 → 2.11.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 (45) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/.tsbuildinfobuild +1 -1
  3. package/dist/custom-elements-internal.json +17 -17
  4. package/dist/custom-elements.json +17 -17
  5. package/dist/features/OpenUI5Support.d.ts +1 -0
  6. package/dist/features/OpenUI5Support.js +30 -27
  7. package/dist/features/OpenUI5Support.js.map +1 -1
  8. package/dist/generated/VersionInfo.js +3 -3
  9. package/dist/generated/VersionInfo.js.map +1 -1
  10. package/dist/prod/features/OpenUI5Support.js +1 -1
  11. package/dist/prod/features/OpenUI5Support.js.map +2 -2
  12. package/dist/prod/generated/VersionInfo.js +1 -1
  13. package/dist/prod/generated/VersionInfo.js.map +1 -1
  14. package/dist/prod/util/getEffectiveScrollbarStyle.js +3 -1
  15. package/dist/prod/util/getEffectiveScrollbarStyle.js.map +2 -2
  16. package/dist/util/getEffectiveScrollbarStyle.d.ts +1 -1
  17. package/dist/util/getEffectiveScrollbarStyle.js +3 -1
  18. package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
  19. package/package.json +3 -3
  20. package/cypress/specs/Accessor.cy.tsx +0 -79
  21. package/cypress/specs/Boot.cy.tsx +0 -19
  22. package/cypress/specs/ConfigurationChange.cy.tsx +0 -41
  23. package/cypress/specs/ConfigurationScript.cy.tsx +0 -133
  24. package/cypress/specs/ConfigurationURL.cy.tsx +0 -201
  25. package/cypress/specs/CustomMount.cy.tsx +0 -9
  26. package/cypress/specs/CustomTheme.cy.tsx +0 -36
  27. package/cypress/specs/EventProvider.cy.tsx +0 -59
  28. package/cypress/specs/Events.cy.tsx +0 -28
  29. package/cypress/specs/SystemDOMElements.cy.tsx +0 -8
  30. package/cypress/specs/Theming.cy.tsx +0 -74
  31. package/cypress/specs/UI5ElementInvalidation.cy.tsx +0 -252
  32. package/cypress/specs/UI5ElementLifecycle.cy.tsx +0 -82
  33. package/cypress/specs/UI5ElementListenForChildPropChanges.cy.tsx +0 -83
  34. package/cypress/specs/UI5ElementMetadataExt.cy.tsx +0 -42
  35. package/cypress/specs/UI5ElementPropertyValidation.cy.tsx +0 -16
  36. package/cypress/specs/UI5ElementPropsAndAttrs.cy.tsx +0 -113
  37. package/cypress/specs/UI5ElementShadowDOM.cy.tsx +0 -30
  38. package/cypress/specs/UI5ElementSlots.cy.tsx +0 -136
  39. package/cypress/specs/WithComplexTemplate.cy.tsx +0 -32
  40. package/cypress/specs/i18n_texts.cy.tsx +0 -129
  41. package/cypress/specs/util/FocusableElements.cy.tsx +0 -48
  42. package/cypress/support/commands.ts +0 -39
  43. package/cypress/support/component-index.html +0 -12
  44. package/cypress/support/component.ts +0 -17
  45. package/cypress/tsconfig.json +0 -21
@@ -1,136 +0,0 @@
1
- import Generic from "../../test/test-elements/Generic.js";
2
-
3
- describe("Slots work properly", () => {
4
- it("Tests that properties exist on the element for each slot", () => {
5
- cy.mount(
6
- <Generic>
7
- Default slot text
8
- <span>Default slot content</span>
9
- <span slot="other">Other slot content 1</span>
10
- <span slot="other">Other slot content 2</span>
11
- <span slot="individual">Individual slot content 1</span>
12
- <span slot="individual">Individual slot content 2</span>
13
- <span slot="named">Item in slot with propertyName</span>
14
- <span slot="named">Item in slot with propertyName</span>
15
- <span slot="row-header">Item in slot row-header</span>
16
- <span slot="row-header">Item in slot row-header</span>
17
- </Generic>
18
- );
19
-
20
- cy.get<Generic>("[ui5-test-generic]")
21
- .should($el => {
22
- expect($el[0].getDomRef()).to.exist;
23
- });
24
-
25
- cy.get("[ui5-test-generic]")
26
- .as("testGeneric");
27
-
28
- cy.get("@testGeneric")
29
- .invoke("prop", "content")
30
- .then(value => {
31
- return (value as Array<unknown>).length;
32
- })
33
- .should("be.greaterThan", 0);
34
-
35
- cy.get("@testGeneric")
36
- .invoke("prop", "other")
37
- .should("have.length", 2);
38
-
39
- cy.get("@testGeneric")
40
- .invoke("prop", "individual")
41
- .should("have.length", 2);
42
-
43
- cy.get("@testGeneric")
44
- .invoke("prop", "row-header")
45
- .should("have.length", 2);
46
-
47
- cy.get("@testGeneric")
48
- .invoke("prop", "named")
49
- .should("be.undefined");
50
- });
51
-
52
- it("Tests that properties exist on the element for each slot", () => {
53
- cy.mount(
54
- <Generic>
55
- <span slot="individual">Individual slot content 1</span>
56
- <span slot="individual">Individual slot content 2</span>
57
- </Generic>
58
- );
59
-
60
- cy.get<Generic>("[ui5-test-generic]")
61
- .should($el => {
62
- expect($el[0].getDomRef()).to.exist;
63
- });
64
-
65
- cy.get("[ui5-test-generic]");
66
-
67
- cy.get("[slot=individual]")
68
- .should("not.exist");
69
-
70
- cy.get("[slot=individual-1]")
71
- .should("exist");
72
-
73
- cy.get("[slot=individual-2]")
74
- .should("exist");
75
- });
76
-
77
- it("Tests that changing the slot attribute of children redistributes them across slot accessors", () => {
78
- let defaultSlotLength = 0;
79
-
80
- cy.mount(
81
- <Generic>
82
- <span>Default slot content</span>
83
- <span slot="other" id="o1">Other slot content 1</span>
84
- <span slot="other" id="o2">Other slot content 2</span>
85
- <span slot="named">Item in slot with propertyName</span>
86
- <span slot="named">Item in slot with propertyName</span>
87
- </Generic>
88
- );
89
-
90
- cy.get<Generic>("[ui5-test-generic]")
91
- .should($el => {
92
- expect($el[0].getDomRef()).to.exist;
93
- });
94
-
95
- cy.get("[ui5-test-generic]")
96
- .as("testGeneric");
97
-
98
- cy.get("@testGeneric")
99
- .invoke("prop", "content")
100
- .then(value => {
101
- defaultSlotLength = value.length;
102
-
103
- return defaultSlotLength;
104
- })
105
- .should("be.greaterThan", 0);
106
-
107
- cy.get("@testGeneric")
108
- .invoke("prop", "other")
109
- .should("have.length", 2);
110
-
111
- cy.get("@testGeneric")
112
- .invoke("prop", "items")
113
- .should("have.length", 2);
114
-
115
- cy.get("#o1")
116
- .invoke("removeAttr", "slot");
117
-
118
- cy.get("#o2")
119
- .invoke("attr", "slot", "named");
120
-
121
- cy.get("@testGeneric")
122
- .then($testGeneric => {
123
- cy.wrap($testGeneric)
124
- .invoke("prop", "content")
125
- .should("have.length", defaultSlotLength + 1);
126
- });
127
-
128
- cy.get("@testGeneric")
129
- .invoke("prop", "other")
130
- .should("have.length", 0);
131
-
132
- cy.get("@testGeneric")
133
- .invoke("prop", "items")
134
- .should("have.length", 3);
135
- });
136
- });
@@ -1,32 +0,0 @@
1
- import WithComplexTemplate from "../../test/test-elements/WithComplexTemplate.js";
2
-
3
- describe("Complex templates", () => {
4
- it("Tests context maintained in the HBS template before, after and inside 'each' statements", () => {
5
- const EXPTECTED_LOOP_CONTENT = "Root text: root, Item text: positives";
6
- const EXPTECTED_NESTED_LOOP_CONTENT = "Root Text: root, Word text: word1_good";
7
-
8
- cy.mount(<WithComplexTemplate />);
9
-
10
- cy.get("[ui5-test-complex-template]")
11
- .shadow()
12
- .find(".before-each-content--start--0")
13
- .should("have.text", EXPTECTED_LOOP_CONTENT);
14
-
15
- cy.get("[ui5-test-complex-template]")
16
- .shadow()
17
- .find(".nested-each-content--0--0")
18
- .first()
19
- .should("have.text", EXPTECTED_NESTED_LOOP_CONTENT);
20
-
21
- cy.get("[ui5-test-complex-template]")
22
- .shadow()
23
- .find(".nested-each-content--0--1")
24
- .first()
25
- .should("have.text", EXPTECTED_NESTED_LOOP_CONTENT);
26
-
27
- cy.get("[ui5-test-complex-template]")
28
- .shadow()
29
- .find(".after-each-content--end--0")
30
- .should("have.text", EXPTECTED_LOOP_CONTENT);
31
- });
32
- });
@@ -1,129 +0,0 @@
1
- import { setLanguage } from "../../src/config/Language.js";
2
- import { registerI18nLoader, getI18nBundle } from "../../src/i18nBundle.js";
3
- import parseProperties from "../../src/PropertiesFileFormat.js";
4
- import I18nParent from "../../test/test-elements/I18nParent.js";
5
- import I18nChild from "../../test/test-elements/I18nChild.js";
6
- import I18nChild2 from "../../test/test-elements/I18nChild2.js";
7
-
8
- const props = `PLEASE_WAIT=Patientez.
9
- TEST_1=Text '{0}
10
- TEST_2=Text ''{0}
11
- TEST_3=Text ''{0}''
12
- TEST_4=Text
13
- TEST_5=Text '
14
- TEST_6=Text ''
15
- TEST_7=Text {0}
16
- TEST_8=Text '{0}'
17
- TEST_9=Text '{0}''`;
18
-
19
- const texts = [
20
- { key: "TEST_1", result: "Text {0}" },
21
- { key: "TEST_2", result: "Text 'test" },
22
- { key: "TEST_3", result: "Text 'test'" },
23
- { key: "TEST_4", result: "Text" },
24
- { key: "TEST_5", result: "Text '" },
25
- { key: "TEST_6", result: "Text '" },
26
- { key: "TEST_7", result: "Text test" },
27
- { key: "TEST_8", result: "Text {0}" },
28
- { key: "TEST_9", result: "Text {0}'" }
29
- ];
30
-
31
- describe("i18n texts", () => {
32
- beforeEach(() => {
33
- cy.wrap({ setLanguage, registerI18nLoader, getI18nBundle })
34
- .then(async api => {
35
- // eslint-disable-next-line @typescript-eslint/require-await
36
- api.registerI18nLoader("myApp", "fr", async () => {
37
- return parseProperties(props);
38
- });
39
-
40
- await api.setLanguage("fr");
41
- });
42
- });
43
-
44
- it("Getting text from current language", () => {
45
- cy.wrap({ getI18nBundle })
46
- .then(async api => {
47
- const bundle = await api.getI18nBundle("myApp");
48
-
49
- return bundle.getText("PLEASE_WAIT");
50
- })
51
- .should("equal", "Patientez.");
52
-
53
- cy.wrap({ setLanguage })
54
- .then(async api => {
55
- await api.setLanguage("bg");
56
- });
57
-
58
- cy.wrap({ getI18nBundle })
59
- .then(async api => {
60
- const bundle = await api.getI18nBundle("myApp");
61
-
62
- return bundle.getText("PLEASE_WAIT");
63
- })
64
- .should("equal", "PLEASE_WAIT");
65
- });
66
-
67
- // Single quote ' escape some symbols after it. For example: "Text '{0}" will result in "Text {0}". To use single
68
- // quote you have to use: ''
69
- it("Single quote '", () => {
70
- texts.forEach(textData => {
71
- cy.wrap({ getI18nBundle })
72
- .then(async api => {
73
- const bundle = await api.getI18nBundle("myApp");
74
-
75
- return bundle.getText(textData.key, "test");
76
- })
77
- .should("equal", textData.result);
78
- });
79
- });
80
- });
81
-
82
- describe("i18n decorator", () => {
83
- beforeEach(() => {
84
- cy.wrap({ setLanguage, registerI18nLoader })
85
- .then(async api => {
86
- // eslint-disable-next-line @typescript-eslint/require-await
87
- api.registerI18nLoader("custom-language", "bg", async () => {
88
- return parseProperties(`PLEASE_WAIT=Моля изчакайте`);
89
- });
90
-
91
- // eslint-disable-next-line @typescript-eslint/require-await
92
- api.registerI18nLoader("another-custom-language", "bg", async () => {
93
- return parseProperties(`SOME_KEY=Някакъв ключ`);
94
- });
95
-
96
- await api.setLanguage("bg");
97
- });
98
- });
99
-
100
- it("Bundle is accessed from every class", () => {
101
- cy.mount(<>
102
- <I18nParent />
103
- <I18nChild />
104
- </>);
105
-
106
- cy.get("[i18n-parent]")
107
- .invoke("prop", "i18nText")
108
- .should("be.equal", "Моля изчакайте");
109
-
110
- cy.get("[i18n-child]")
111
- .invoke("prop", "i18nText")
112
- .should("be.equal", "Моля изчакайте");
113
- });
114
-
115
- it("Bundle storage works correctly", () => {
116
- cy.mount(<>
117
- <I18nParent />
118
- <I18nChild2 />
119
- </>);
120
-
121
- cy.get("[i18n-parent]")
122
- .invoke("prop", "i18nText")
123
- .should("be.equal", "Моля изчакайте");
124
-
125
- cy.get("[i18n-child2]")
126
- .invoke("prop", "i18nText")
127
- .should("be.equal", "Някакъв ключ");
128
- });
129
- });
@@ -1,48 +0,0 @@
1
- import { getFirstFocusableElement } from "@ui5/webcomponents-base/dist/util/FocusableElements.js";
2
- import SideNavigation from "@ui5/webcomponents-fiori/dist/SideNavigation.js";
3
- import SideNavigationItem from "@ui5/webcomponents-fiori/dist/SideNavigationItem.js";
4
- import SideNavigationSubItem from "@ui5/webcomponents-fiori/dist/SideNavigationSubItem.js";
5
- import Button from "@ui5/webcomponents/dist/Button.js";
6
- import Input from "@ui5/webcomponents/dist/Input.js";
7
-
8
- describe("FocusableElements", () => {
9
- it("Tests first focusable element", () => {
10
- cy.mount(
11
- <>
12
- <div id="container">
13
- <Input tabindex="-1"></Input>
14
- <br/>
15
- <SideNavigation>
16
- <SideNavigationItem
17
- text="Home"
18
- icon="home"
19
- href="#home"
20
- title="Home tooltip"></SideNavigationItem>
21
- <SideNavigationItem text="People" href="#people" expanded icon="group">
22
- <SideNavigationSubItem
23
- id="subItem1"
24
- selected
25
- text="Should be Focused When Open"></SideNavigationSubItem>
26
- <SideNavigationSubItem text="Sub Item 2"></SideNavigationSubItem>
27
- </SideNavigationItem>
28
- </SideNavigation>
29
- <br/>
30
- <Button id="buttonId">Close</Button>
31
- </div>
32
- </>
33
- );
34
-
35
- cy.get("#subItem1")
36
- .shadow()
37
- .find(".ui5-sn-item")
38
- .should("have.attr", "tabindex", "0");
39
-
40
- cy.get("#container").then( async ($container) => {
41
- const firstFocusable = await getFirstFocusableElement($container.get(0));
42
- await firstFocusable?.focus();
43
- });
44
-
45
- cy.get("#subItem1")
46
- .should("have.focus");
47
- });
48
- });
@@ -1,39 +0,0 @@
1
- /// <reference types="cypress" />
2
- // ***********************************************
3
- // This example commands.ts shows you how to
4
- // create various custom commands and overwrite
5
- // existing commands.
6
- //
7
- // For more comprehensive examples of custom
8
- // commands please read more here:
9
- // https://on.cypress.io/custom-commands
10
- // ***********************************************
11
- //
12
- //
13
- // -- This is a parent command --
14
- // Cypress.Commands.add('login', (email, password) => { ... })
15
- //
16
- //
17
- // -- This is a child command --
18
- // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19
- //
20
- //
21
- // -- This is a dual command --
22
- // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23
- //
24
- //
25
- // -- This will overwrite an existing command --
26
- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27
- //
28
- // declare global {
29
- // namespace Cypress {
30
- // interface Chainable {
31
- // login(email: string, password: string): Chainable<void>
32
- // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33
- // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34
- // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35
- // }
36
- // }
37
- // }
38
-
39
- import "@ui5/cypress-internal/commands.js";
@@ -1,12 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
- <title>Components App</title>
8
- </head>
9
- <body>
10
- <div data-cy-root></div>
11
- </body>
12
- </html>
@@ -1,17 +0,0 @@
1
- // ***********************************************************
2
- // This example support/component.ts is processed and
3
- // loaded automatically before your test files.
4
- //
5
- // This is a great place to put global configuration and
6
- // behavior that modifies Cypress.
7
- //
8
- // You can change the location of this file or turn off
9
- // automatically serving support files with the
10
- // 'supportFile' configuration option.
11
- //
12
- // You can read more here:
13
- // https://on.cypress.io/configuration
14
- // ***********************************************************
15
-
16
- // Import commands.js using ES2015 syntax:
17
- import './commands'
@@ -1,21 +0,0 @@
1
- {
2
- "extends": "@ui5/webcomponents-tools/tsconfig.json",
3
- "include": [
4
- "./**/*"
5
- ],
6
- "compilerOptions": {
7
- "outDir": "dist",
8
- "composite": true,
9
- "tsBuildInfoFile": "dist/.tsbuildinfobuild",
10
- "module": "NodeNext",
11
- "moduleResolution": "nodenext",
12
- },
13
- "references": [
14
- {
15
- "path": "../"
16
- },
17
- {
18
- "path": "../test/"
19
- },
20
- ]
21
- }