Skip to content

Commit b8f506b

Browse files
committed
Merge remote-tracking branch 'origin/feature-6.2' into FW-225
2 parents e81cf64 + 7b3ebd8 commit b8f506b

File tree

92 files changed

+231
-115
lines changed

Some content is hidden

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

92 files changed

+231
-115
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions

angular/CHANGELOG.md

Lines changed: 11 additions & 0 deletions

angular/package-lock.json

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

angular/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/angular",
3-
"version": "6.1.8",
3+
"version": "6.1.9",
44
"description": "Angular specific wrappers for @ionic/core",
55
"keywords": [
66
"ionic",
@@ -44,7 +44,7 @@
4444
"validate": "npm i && npm run lint && npm run test && npm run build"
4545
},
4646
"dependencies": {
47-
"@ionic/core": "^6.1.8",
47+
"@ionic/core": "^6.1.9",
4848
"jsonc-parser": "^3.0.0",
4949
"tslib": "^2.0.0"
5050
},

core/CHANGELOG.md

Lines changed: 14 additions & 0 deletions

core/package-lock.json

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

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/core",
3-
"version": "6.1.8",
3+
"version": "6.1.9",
44
"description": "Base components for Ionic",
55
"keywords": [
66
"ionic",

core/src/components.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,10 @@ export namespace Components {
851851
* Where to align the fab horizontally in the viewport.
852852
*/
853853
"horizontal"?: 'start' | 'end' | 'center';
854+
/**
855+
* Opens/Closes the FAB list container.
856+
*/
857+
"toggle": () => Promise<void>;
854858
/**
855859
* Where to align the fab vertically in the viewport.
856860
*/

core/src/components/fab-button/fab-button.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { createColorClasses, hostContext, openURL } from '../../utils/theme';
2222
shadow: true,
2323
})
2424
export class FabButton implements ComponentInterface, AnchorInterface, ButtonInterface {
25+
private fab: HTMLIonFabElement | null = null;
26+
2527
@Element() el!: HTMLElement;
2628

2729
/**
@@ -119,6 +121,10 @@ export class FabButton implements ComponentInterface, AnchorInterface, ButtonInt
119121
*/
120122
@Event() ionBlur!: EventEmitter<void>;
121123

124+
connectedCallback() {
125+
this.fab = this.el.closest('ion-fab');
126+
}
127+
122128
private onFocus = () => {
123129
this.ionFocus.emit();
124130
};
@@ -127,6 +133,15 @@ export class FabButton implements ComponentInterface, AnchorInterface, ButtonInt
127133
this.ionBlur.emit();
128134
};
129135

136+
private onClick = () => {
137+
const { fab } = this;
138+
if (!fab) {
139+
return;
140+
}
141+
142+
fab.toggle();
143+
};
144+
130145
render() {
131146
const { el, disabled, color, href, activated, show, translucent, size } = this;
132147
const inList = hostContext('ion-fab-list', el);
@@ -144,6 +159,7 @@ export class FabButton implements ComponentInterface, AnchorInterface, ButtonInt
144159

145160
return (
146161
<Host
162+
onClick={this.onClick}
147163
aria-disabled={disabled ? 'true' : null}
148164
class={createColorClasses(color, {
149165
[mode]: true,

core/src/components/fab/fab.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,23 @@ export class Fab implements ComponentInterface {
6262
return this.el.querySelector('ion-fab-button');
6363
}
6464

65-
private onClick = () => {
65+
/**
66+
* Opens/Closes the FAB list container.
67+
* @internal
68+
*/
69+
@Method()
70+
async toggle() {
6671
const hasList = !!this.el.querySelector('ion-fab-list');
67-
const getButton = this.getFab();
68-
const isButtonDisabled = getButton?.disabled;
69-
70-
if (hasList && !isButtonDisabled) {
72+
if (hasList) {
7173
this.activated = !this.activated;
7274
}
73-
};
75+
}
7476

7577
render() {
7678
const { horizontal, vertical, edge } = this;
7779
const mode = getIonMode(this);
7880
return (
7981
<Host
80-
onClick={this.onClick}
8182
class={{
8283
[mode]: true,
8384
[`fab-horizontal-${horizontal}`]: horizontal !== undefined,

core/src/components/range/test/basic/range.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ test.describe('range: basic', () => {
1010
expect(await page.screenshot()).toMatchSnapshot(`range-diff-${page.getSnapshotSettings()}.png`);
1111
});
1212

13-
test('should emit start/end events', async ({ page }) => {
13+
test('should emit start/end events', async ({ page }, testInfo) => {
1414
await page.setContent(`<ion-range value="20"></ion-range>`);
1515

1616
const rangeStart = await page.spyOnEvent('ionKnobMoveStart');
1717
const rangeEnd = await page.spyOnEvent('ionKnobMoveEnd');
1818

1919
const rangeEl = page.locator('ion-range');
2020

21-
await dragElementBy(rangeEl, page, 300, 0);
21+
await dragElementBy(rangeEl, page, testInfo.project.metadata.rtl ? -300 : 300, 0);
2222
await page.waitForChanges();
2323

2424
/**

core/src/utils/test/playwright/page/utils/set-content.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Page } from '@playwright/test';
1+
import type { Page, TestInfo } from '@playwright/test';
22

33
/**
44
* Overwrites the default Playwright page.setContent method.
@@ -8,8 +8,9 @@ import type { Page } from '@playwright/test';
88
*
99
* @param page The Playwright page object.
1010
* @param html The HTML content to set on the page.
11+
* @param testInfo The TestInfo associated with the current test run.
1112
*/
12-
export const setContent = async (page: Page, html: string) => {
13+
export const setContent = async (page: Page, html: string, testInfo: TestInfo) => {
1314
if (page.isClosed()) {
1415
throw new Error('setContent unavailable: page is already closed');
1516
}
@@ -18,15 +19,21 @@ export const setContent = async (page: Page, html: string) => {
1819

1920
const output = `
2021
<!DOCTYPE html>
21-
<html>
22+
<html dir="${testInfo.project.metadata.rtl ? 'rtl' : 'ltr'}">
2223
<head>
2324
<meta charset="UTF-8" />
2425
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
2526
<link href="${baseUrl}/css/ionic.bundle.css" rel="stylesheet" />
2627
<link href="${baseUrl}/scripts/testing/styles.css" rel="stylesheet" />
2728
<script src="${baseUrl}/scripts/testing/scripts.js"></script>
2829
<script type="module" src="${baseUrl}/dist/ionic/ionic.esm.js"></script>
29-
30+
<script>
31+
window.Ionic = {
32+
config: {
33+
mode: '${testInfo.project.metadata.mode}'
34+
}
35+
}
36+
</script>
3037
</head>
3138
<body>
3239
${html}

core/src/utils/test/playwright/playwright-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function extendPageFixture(page: E2EPage, testInfo: TestInfo) {
4343

4444
// Overridden Playwright methods
4545
page.goto = (url: string, options) => goToPage(page, url, options, testInfo, originalGoto);
46-
page.setContent = (html: string) => setContent(page, html);
46+
page.setContent = (html: string) => setContent(page, html, testInfo);
4747
page.locator = (selector: string, options?: LocatorOptions) => locator(page, originalLocator, selector, options);
4848

4949
// Custom Ionic methods

docs/CHANGELOG.md

Lines changed: 8 additions & 0 deletions

docs/package-lock.json

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

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/docs",
3-
"version": "6.1.8",
3+
"version": "6.1.9",
44
"description": "Pre-packaged API documentation for the Ionic docs.",
55
"main": "core.json",
66
"types": "core.d.ts",

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"angular",
66
"packages/*"
77
],
8-
"version": "6.1.8"
8+
"version": "6.1.9"
99
}

packages/angular-server/CHANGELOG.md

Lines changed: 8 additions & 0 deletions

0 commit comments

Comments
 (0)