Skip to content

Commit 605912f

Browse files
Merge remote-tracking branch 'origin/main' into popover_resize
2 parents a49c512 + ba10757 commit 605912f

4 files changed

Lines changed: 96 additions & 0 deletions

File tree

packages/ai/.ui5-cem-aliases.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"BaseTextArea": "TextArea",
3+
"BaseInput": "Input"
4+
}

packages/fiori/cypress/specs/Wizard.cy.tsx

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,4 +633,76 @@ describe("Wizard inside Dialog", () => {
633633
.find("[ui5-responsive-popover]")
634634
.should("be.visible");
635635
});
636+
});
637+
638+
describe("Wizard - getFocusDomRef Method", () => {
639+
it("should focus the last focused wizard tab on wizard focus", () => {
640+
const onButtonClick = () => {
641+
document.getElementById("wizard").focus();
642+
}
643+
cy.mount(
644+
<>
645+
<Wizard id="wizard">
646+
<WizardStep icon="sap-icon://product" titleText="Product type">
647+
<MessageStrip>
648+
The Wizard control is supposed to break down large tasks.
649+
</MessageStrip>
650+
</WizardStep>
651+
<WizardStep titleText="Product Information" selected />
652+
<WizardStep titleText="Product Text" />
653+
</Wizard>
654+
<Button>Dummy Btn</Button>
655+
<Button onClick={onButtonClick}>Focus Wizard</Button>
656+
</>
657+
);
658+
659+
cy.get("[ui5-wizard]")
660+
.shadow()
661+
.find("[ui5-wizard-tab]")
662+
.eq(2)
663+
.realClick();
664+
665+
cy.get("[ui5-button]")
666+
.eq(0)
667+
.realClick();
668+
669+
cy.get("[ui5-button]")
670+
.eq(1)
671+
.realClick();
672+
673+
cy.get("[ui5-wizard]")
674+
.shadow()
675+
.find("[ui5-wizard-tab]")
676+
.eq(2)
677+
.shadow()
678+
.find(".ui5-wiz-step-root")
679+
.should("be.focused");
680+
});
681+
682+
it("should focus the first wizard tab if no tab was focused before ", () => {
683+
const onButtonClick = () => {
684+
document.getElementById("wizard").focus();
685+
}
686+
cy.mount(
687+
<>
688+
<Wizard id="wizard">
689+
<WizardStep icon="sap-icon://product" titleText="Product type"></WizardStep>
690+
<WizardStep titleText="Product Information" />
691+
<WizardStep titleText="Product Text" />
692+
</Wizard>
693+
<Button onClick={onButtonClick}>Focus Wizard</Button>
694+
</>
695+
);
696+
697+
cy.get("[ui5-button]")
698+
.realClick();
699+
700+
cy.get("[ui5-wizard]")
701+
.shadow()
702+
.find("[ui5-wizard-tab]")
703+
.eq(0)
704+
.shadow()
705+
.find(".ui5-wiz-step-root")
706+
.should("be.focused");
707+
});
636708
});

packages/fiori/src/Wizard.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,10 @@ class Wizard extends UI5Element {
694694
return contentHeight;
695695
}
696696

697+
getFocusDomRef() {
698+
return this._itemNavigation._getCurrentItem();
699+
}
700+
697701
getStepAriaLabelText(step: WizardStep, ariaLabel: string) {
698702
return Wizard.i18nBundle.getText(WIZARD_STEP_ARIA_LABEL, ariaLabel);
699703
}

packages/tools/lib/cem/custom-elements-manifest.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ import { generateCustomData } from "cem-plugin-vs-code-custom-data-generator";
2727
import { customElementJetBrainsPlugin } from "custom-element-jet-brains-integration";
2828

2929
const packageJSON = JSON.parse(fs.readFileSync("./package.json"));
30+
let aliasMap = {};
31+
3032
const devMode = process.env.UI5_CEM_MODE === "dev";
33+
try {
34+
aliasMap = JSON.parse(fs.readFileSync("./.ui5-cem-aliases.json"));
35+
} catch (e) {
36+
if (devMode) {
37+
console.warn("No .ui5-cem-aliases.json file found. Continuing without aliases.");
38+
}
39+
}
40+
3141

3242
const extractClassNodeJSDoc = node => {
3343
const fileContent = node.getFullText();
@@ -486,6 +496,12 @@ export default {
486496
}
487497
}
488498

499+
moduleDoc.declarations.forEach(declaration => {
500+
if (declaration.superclass?.name && aliasMap[declaration.superclass.name]) {
501+
declaration.superclass.name = aliasMap[declaration.superclass.name];
502+
}
503+
})
504+
489505
const typeReferences = new Set();
490506
const registerTypeReference = reference => typeReferences.add(JSON.stringify(reference))
491507

0 commit comments

Comments
 (0)