Skip to content

Commit 9016798

Browse files
authored
merge release-7.3.0
Release 7.3.0
2 parents f2611f2 + 6877d65 commit 9016798

File tree

68 files changed

+450
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+450
-213
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [7.3.0](https://github.com/ionic-team/ionic-framework/compare/v7.2.4...v7.3.0) (2023-08-16)
7+
8+
9+
### Bug Fixes
10+
11+
* **alert:** radio and checkbox labels wrap to next line ([#27898](https://github.com/ionic-team/ionic-framework/issues/27898)) ([0d3127a](https://github.com/ionic-team/ionic-framework/commit/0d3127ad09df3c914a8c254f14931de5ca3beb31)), closes [#17269](https://github.com/ionic-team/ionic-framework/issues/17269)
12+
13+
14+
### Features
15+
16+
* **action-sheet:** add htmlAttributes property for passing attributes to buttons ([#27863](https://github.com/ionic-team/ionic-framework/issues/27863)) ([5ce4ec0](https://github.com/ionic-team/ionic-framework/commit/5ce4ec0439e4f31aba31062fd8af4a2ad792a54f))
17+
* **alert:** add htmlAttributes property for passing attributes to buttons ([#27862](https://github.com/ionic-team/ionic-framework/issues/27862)) ([06be0e5](https://github.com/ionic-team/ionic-framework/commit/06be0e511164ebdaa6af9a3747d0585260c030a9))
18+
* **toast:** add htmlAttributes property for passing attributes to buttons ([#27855](https://github.com/ionic-team/ionic-framework/issues/27855)) ([9a68588](https://github.com/ionic-team/ionic-framework/commit/9a685882b7085d911ff09eedacc367629e32348a))
19+
* **toast:** add shadow part for cancel button ([#27921](https://github.com/ionic-team/ionic-framework/issues/27921)) ([e9faf54](https://github.com/ionic-team/ionic-framework/commit/e9faf54d0a7409521706ce9c8b0d26f3fbe9ba41)), closes [#27920](https://github.com/ionic-team/ionic-framework/issues/27920)
20+
21+
22+
23+
24+
625
## [7.2.4](https://github.com/ionic-team/ionic-framework/compare/v7.2.3...v7.2.4) (2023-08-16)
726

827

core/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [7.3.0](https://github.com/ionic-team/ionic-framework/compare/v7.2.4...v7.3.0) (2023-08-16)
7+
8+
9+
### Bug Fixes
10+
11+
* **alert:** radio and checkbox labels wrap to next line ([#27898](https://github.com/ionic-team/ionic-framework/issues/27898)) ([0d3127a](https://github.com/ionic-team/ionic-framework/commit/0d3127ad09df3c914a8c254f14931de5ca3beb31)), closes [#17269](https://github.com/ionic-team/ionic-framework/issues/17269)
12+
13+
14+
### Features
15+
16+
* **action-sheet:** add htmlAttributes property for passing attributes to buttons ([#27863](https://github.com/ionic-team/ionic-framework/issues/27863)) ([5ce4ec0](https://github.com/ionic-team/ionic-framework/commit/5ce4ec0439e4f31aba31062fd8af4a2ad792a54f))
17+
* **alert:** add htmlAttributes property for passing attributes to buttons ([#27862](https://github.com/ionic-team/ionic-framework/issues/27862)) ([06be0e5](https://github.com/ionic-team/ionic-framework/commit/06be0e511164ebdaa6af9a3747d0585260c030a9))
18+
* **toast:** add htmlAttributes property for passing attributes to buttons ([#27855](https://github.com/ionic-team/ionic-framework/issues/27855)) ([9a68588](https://github.com/ionic-team/ionic-framework/commit/9a685882b7085d911ff09eedacc367629e32348a))
19+
* **toast:** add shadow part for cancel button ([#27921](https://github.com/ionic-team/ionic-framework/issues/27921)) ([e9faf54](https://github.com/ionic-team/ionic-framework/commit/e9faf54d0a7409521706ce9c8b0d26f3fbe9ba41)), closes [#27920](https://github.com/ionic-team/ionic-framework/issues/27920)
20+
21+
22+
23+
24+
625
## [7.2.4](https://github.com/ionic-team/ionic-framework/compare/v7.2.3...v7.2.4) (2023-08-16)
726

827

core/api.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,7 @@ ion-toast,css-prop,--start
14711471
ion-toast,css-prop,--white-space
14721472
ion-toast,css-prop,--width
14731473
ion-toast,part,button
1474+
ion-toast,part,button cancel
14741475
ion-toast,part,container
14751476
ion-toast,part,header
14761477
ion-toast,part,icon

core/package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/core",
3-
"version": "7.2.4",
3+
"version": "7.3.0",
44
"description": "Base components for Ionic",
55
"keywords": [
66
"ionic",
@@ -31,7 +31,7 @@
3131
"loader/"
3232
],
3333
"dependencies": {
34-
"@stencil/core": "^3.4.0",
34+
"@stencil/core": "^4.0.3",
3535
"ionicons": "7.1.0",
3636
"tslib": "^2.1.0"
3737
},

core/src/components/action-sheet/action-sheet-interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface ActionSheetButton<T = any> {
2323
icon?: string;
2424
cssClass?: string | string[];
2525
id?: string;
26+
htmlAttributes?: { [key: string]: any };
2627
handler?: () => boolean | void | Promise<boolean | void>;
2728
data?: T;
2829
}

core/src/components/action-sheet/action-sheet.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,13 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
394394
</div>
395395
)}
396396
{buttons.map((b) => (
397-
<button type="button" id={b.id} class={buttonClass(b)} onClick={() => this.buttonClick(b)}>
397+
<button
398+
{...b.htmlAttributes}
399+
type="button"
400+
id={b.id}
401+
class={buttonClass(b)}
402+
onClick={() => this.buttonClick(b)}
403+
>
398404
<span class="action-sheet-button-inner">
399405
{b.icon && <ion-icon icon={b.icon} aria-hidden="true" lazy={false} class="action-sheet-icon" />}
400406
{b.text}
@@ -406,7 +412,12 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
406412

407413
{cancelButton && (
408414
<div class="action-sheet-group action-sheet-group-cancel">
409-
<button type="button" class={buttonClass(cancelButton)} onClick={() => this.buttonClick(cancelButton)}>
415+
<button
416+
{...cancelButton.htmlAttributes}
417+
type="button"
418+
class={buttonClass(cancelButton)}
419+
onClick={() => this.buttonClick(cancelButton)}
420+
>
410421
<span class="action-sheet-button-inner">
411422
{cancelButton.icon && (
412423
<ion-icon icon={cancelButton.icon} aria-hidden="true" lazy={false} class="action-sheet-icon" />

core/src/components/action-sheet/test/a11y/action-sheet.e2e.ts

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,36 @@ const testAria = async (page: E2EPage, buttonID: string, expectedAriaLabelledBy:
1010
await button.click();
1111
await didPresent.next();
1212

13-
const alert = page.locator('ion-action-sheet');
13+
const actionSheet = page.locator('ion-action-sheet');
1414

1515
/**
1616
* expect().toHaveAttribute() can't check for a null value, so grab and check
1717
* the value manually instead.
1818
*/
19-
const ariaLabelledBy = await alert.getAttribute('aria-labelledby');
19+
const ariaLabelledBy = await actionSheet.getAttribute('aria-labelledby');
2020

2121
expect(ariaLabelledBy).toBe(expectedAriaLabelledBy);
2222
};
23+
24+
const testAriaButton = async (
25+
page: E2EPage,
26+
buttonID: string,
27+
expectedAriaLabelledBy: string,
28+
expectedAriaLabel: string
29+
) => {
30+
const didPresent = await page.spyOnEvent('ionActionSheetDidPresent');
31+
32+
const button = page.locator(`#${buttonID}`);
33+
await button.click();
34+
35+
await didPresent.next();
36+
37+
const actionSheetButton = page.locator('ion-action-sheet .action-sheet-button');
38+
39+
await expect(actionSheetButton).toHaveAttribute('aria-labelledby', expectedAriaLabelledBy);
40+
await expect(actionSheetButton).toHaveAttribute('aria-label', expectedAriaLabel);
41+
};
42+
2343
configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
2444
test.describe(title('action-sheet: a11y'), () => {
2545
test.beforeEach(async ({ page }) => {
@@ -52,5 +72,17 @@ configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
5272
test('should allow for manually specifying aria attributes', async ({ page }) => {
5373
await testAria(page, 'customAria', 'Custom title');
5474
});
75+
76+
test('should have aria-labelledby and aria-label added to the button when htmlAttributes is set', async ({
77+
page,
78+
}) => {
79+
await testAriaButton(page, 'ariaLabelButton', 'close-label', 'close button');
80+
});
81+
82+
test('should have aria-labelledby and aria-label added to the cancel button when htmlAttributes is set', async ({
83+
page,
84+
}) => {
85+
await testAriaButton(page, 'ariaLabelCancelButton', 'cancel-label', 'cancel button');
86+
});
5587
});
5688
});

core/src/components/action-sheet/test/a11y/index.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ <h1>Action Sheet - A11y</h1>
2323
<ion-button id="subHeaderOnly" expand="block" onclick="presentSubHeaderOnly()">Subheader Only</ion-button>
2424
<ion-button id="noHeaders" expand="block" onclick="presentNoHeaders()">No Headers</ion-button>
2525
<ion-button id="customAria" expand="block" onclick="presentCustomAria()">Custom Aria</ion-button>
26+
<ion-button id="ariaLabelButton" expand="block" onclick="presentAriaLabelButton()">Aria Label Button</ion-button>
27+
<ion-button id="ariaLabelCancelButton" expand="block" onclick="presentAriaLabelCancelButton()"
28+
>Aria Label Cancel Button</ion-button
29+
>
2630
</main>
2731

2832
<script>
@@ -63,6 +67,39 @@ <h1>Action Sheet - A11y</h1>
6367
},
6468
});
6569
}
70+
71+
function presentAriaLabelButton() {
72+
openActionSheet({
73+
header: 'Header',
74+
subHeader: 'Subtitle',
75+
buttons: [
76+
{
77+
text: 'Close',
78+
htmlAttributes: {
79+
'aria-label': 'close button',
80+
'aria-labelledby': 'close-label',
81+
},
82+
},
83+
],
84+
});
85+
}
86+
87+
function presentAriaLabelCancelButton() {
88+
openActionSheet({
89+
header: 'Header',
90+
subHeader: 'Subtitle',
91+
buttons: [
92+
{
93+
text: 'Cancel',
94+
role: 'cancel',
95+
htmlAttributes: {
96+
'aria-label': 'cancel button',
97+
'aria-labelledby': 'cancel-label',
98+
},
99+
},
100+
],
101+
});
102+
}
66103
</script>
67104
</body>
68105
</html>

core/src/components/alert/alert-interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export interface AlertButton {
4848
role?: 'cancel' | 'destructive' | string;
4949
cssClass?: string | string[];
5050
id?: string;
51+
htmlAttributes?: { [key: string]: any };
5152
// TODO(FW-2832): type
5253
handler?: (value: any) => AlertButtonOverlayHandler | Promise<AlertButtonOverlayHandler>;
5354
}

0 commit comments

Comments
 (0)