merge release-6.2.1

Release 6.2.1
This commit is contained in:
Liam DeBeasi
2022-08-03 10:04:37 -04:00
committed by GitHub
37 changed files with 4851 additions and 4469 deletions

View File

@ -61,4 +61,21 @@ jobs:
git add .
git commit -m "chore(): update package lock files"
git push
# Purge the JSDeliver CDN cache so
# component playgrounds always load
# the latest version of Ionic.
- name: Purge JSDelivr Cache
run: |
curl -X POST \
https://purge.jsdelivr.net/ \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"path": [
"/npm/@ionic/core@6/dist/ionic/ionic.esm.js",
"/npm/@ionic/core@latest/dist/ionic/ionic.esm.js",
"/npm/@ionic/core@6/css/ionic.bundle.css,
"/npm/@ionic/core@latest/css/ionic.bundle.css
]}'

View File

@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic-framework/compare/v6.2.0...v6.2.1) (2022-08-03)
### Bug Fixes
* **datetime:** display time in user's timezone after selection ([#25694](https://github.com/ionic-team/ionic-framework/issues/25694)) ([11c69c8](https://github.com/ionic-team/ionic-framework/commit/11c69c8df50b75440c9e876b4d99d469d16e144f)), closes [#25693](https://github.com/ionic-team/ionic-framework/issues/25693)
* **datetime:** selecting today with multiple date select now works ([#25699](https://github.com/ionic-team/ionic-framework/issues/25699)) ([86b7000](https://github.com/ionic-team/ionic-framework/commit/86b7000bcd1b4519e8c20907050e15ba7c99bab0))
* **nav:** exclude nav from custom dialog ([#25689](https://github.com/ionic-team/ionic-framework/issues/25689)) ([d1e517b](https://github.com/ionic-team/ionic-framework/commit/d1e517bfef03b822dfa7651681013277762eda08)), closes [#25677](https://github.com/ionic-team/ionic-framework/issues/25677) [#25688](https://github.com/ionic-team/ionic-framework/issues/25688)
* **react:** IonNav apply properties to page components ([#25603](https://github.com/ionic-team/ionic-framework/issues/25603)) ([61e4ffe](https://github.com/ionic-team/ionic-framework/commit/61e4ffe47f73034808b65ee37342f540ee5a6a97)), closes [#25602](https://github.com/ionic-team/ionic-framework/issues/25602)
# [6.2.0](https://github.com/ionic-team/ionic-framework/compare/v6.1.15...v6.2.0) (2022-07-27)

View File

@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic/compare/v6.2.0...v6.2.1) (2022-08-03)
**Note:** Version bump only for package @ionic/angular
# [6.2.0](https://github.com/ionic-team/ionic/compare/v6.1.15...v6.2.0) (2022-07-27)

View File

@ -1,15 +1,15 @@
{
"name": "@ionic/angular",
"version": "6.2.0",
"version": "6.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/angular",
"version": "6.2.0",
"version": "6.2.1",
"license": "MIT",
"dependencies": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"jsonc-parser": "^3.0.0",
"tslib": "^2.0.0"
},
@ -1023,9 +1023,9 @@
"dev": true
},
"node_modules/@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"dependencies": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@ -7939,9 +7939,9 @@
"dev": true
},
"@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"requires": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",

View File

@ -1,6 +1,6 @@
{
"name": "@ionic/angular",
"version": "6.2.0",
"version": "6.2.1",
"description": "Angular specific wrappers for @ionic/core",
"keywords": [
"ionic",
@ -44,7 +44,7 @@
"validate": "npm i && npm run lint && npm run test && npm run build"
},
"dependencies": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"jsonc-parser": "^3.0.0",
"tslib": "^2.0.0"
},

View File

@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic/compare/v6.2.0...v6.2.1) (2022-08-03)
### Bug Fixes
* **datetime:** display time in user's timezone after selection ([#25694](https://github.com/ionic-team/ionic/issues/25694)) ([11c69c8](https://github.com/ionic-team/ionic/commit/11c69c8df50b75440c9e876b4d99d469d16e144f)), closes [#25693](https://github.com/ionic-team/ionic/issues/25693)
* **datetime:** selecting today with multiple date select now works ([#25699](https://github.com/ionic-team/ionic/issues/25699)) ([86b7000](https://github.com/ionic-team/ionic/commit/86b7000bcd1b4519e8c20907050e15ba7c99bab0))
* **nav:** exclude nav from custom dialog ([#25689](https://github.com/ionic-team/ionic/issues/25689)) ([d1e517b](https://github.com/ionic-team/ionic/commit/d1e517bfef03b822dfa7651681013277762eda08)), closes [#25677](https://github.com/ionic-team/ionic/issues/25677) [#25688](https://github.com/ionic-team/ionic/issues/25688)
# [6.2.0 Chromium](https://github.com/ionic-team/ionic-framework/compare/v6.1.15...v6.2.0) (2022-07-27)

View File

@ -1,12 +1,12 @@
{
"name": "@ionic/core",
"version": "6.2.0",
"version": "6.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/core",
"version": "6.2.0",
"version": "6.2.1",
"license": "MIT",
"dependencies": {
"@stencil/core": "^2.16.0",

View File

@ -1,6 +1,6 @@
{
"name": "@ionic/core",
"version": "6.2.0",
"version": "6.2.1",
"description": "Base components for Ionic",
"keywords": [
"ionic",

View File

@ -1929,7 +1929,7 @@ export class Datetime implements ComponentInterface {
day,
year,
},
isActive
isActive && highlightActiveParts
);
} else {
this.setActiveParts({

View File

@ -5,6 +5,7 @@ import {
addTimePadding,
getMonthAndYear,
getLocalizedDayPeriod,
getLocalizedTime,
} from '../utils/format';
describe('generateDayAriaLabel()', () => {
@ -99,3 +100,59 @@ describe('getLocalizedDayPeriod', () => {
expect(getLocalizedDayPeriod('en-US', 'pm'));
});
});
describe('getLocalizedTime', () => {
describe('with a timezone offset', () => {
it('should ignore the offset and localize the time to PM', () => {
const datetimeParts = {
day: 1,
month: 1,
year: 2022,
hour: 13,
minute: 40,
tzOffset: -240,
};
expect(getLocalizedTime('en-US', datetimeParts, false)).toEqual('1:40 PM');
});
it('should ignore the offset and localize the time to AM', () => {
const datetimeParts = {
day: 1,
month: 1,
year: 2022,
hour: 9,
minute: 40,
tzOffset: -240,
};
expect(getLocalizedTime('en-US', datetimeParts, false)).toEqual('9:40 AM');
});
});
it('should localize the time to PM', () => {
const datetimeParts = {
day: 1,
month: 1,
year: 2022,
hour: 13,
minute: 40,
tzOffset: 0,
};
expect(getLocalizedTime('en-US', datetimeParts, false)).toEqual('1:40 PM');
});
it('should localize the time to AM', () => {
const datetimeParts = {
day: 1,
month: 1,
year: 2022,
hour: 9,
minute: 40,
tzOffset: 0,
};
expect(getLocalizedTime('en-US', datetimeParts, false)).toEqual('9:40 AM');
});
});

View File

@ -20,7 +20,15 @@ export const getLocalizedTime = (locale: string, refParts: DatetimeParts, use24H
minute: 'numeric',
timeZone: 'UTC',
hour12: !use24Hour,
}).format(new Date(convertDataToISO(refParts)));
}).format(
new Date(
convertDataToISO({
...refParts,
// TODO: FW-1831 will remove the need to manually set the tzOffset to undefined
tzOffset: undefined,
})
)
);
};
/**

View File

@ -170,7 +170,7 @@ html.ios ion-modal.modal-card .ion-page {
* These changes allow certain dimension values
* such as fit-content to work correctly.
*/
ion-modal .ion-page {
ion-modal .ion-page:not(ion-nav .ion-page) {
position: relative;
contain: layout style;

View File

@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic-docs/compare/v6.2.0...v6.2.1) (2022-08-03)
**Note:** Version bump only for package @ionic/docs
# [6.2.0](https://github.com/ionic-team/ionic-docs/compare/v6.1.15...v6.2.0) (2022-07-27)
**Note:** Version bump only for package @ionic/docs

View File

@ -1,12 +1,12 @@
{
"name": "@ionic/docs",
"version": "6.2.0",
"version": "6.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/docs",
"version": "6.2.0",
"version": "6.2.1",
"license": "MIT"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@ionic/docs",
"version": "6.2.0",
"version": "6.2.1",
"description": "Pre-packaged API documentation for the Ionic docs.",
"main": "core.json",
"types": "core.d.ts",

View File

@ -5,5 +5,5 @@
"angular",
"packages/*"
],
"version": "6.2.0"
"version": "6.2.1"
}

8757
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
"private": true,
"description": "Ionic mono-repo root package.json, used mainly to execute build scripts. This package is not published to npm.",
"devDependencies": {
"lerna": "^4.0.0",
"lerna": "^5.3.0",
"semver": "^5.5.0"
},
"engines": {

View File

@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic/compare/v6.2.0...v6.2.1) (2022-08-03)
**Note:** Version bump only for package @ionic/angular-server
# [6.2.0](https://github.com/ionic-team/ionic/compare/v6.1.15...v6.2.0) (2022-07-27)
**Note:** Version bump only for package @ionic/angular-server

View File

@ -1,12 +1,12 @@
{
"name": "@ionic/angular-server",
"version": "6.2.0",
"version": "6.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/angular-server",
"version": "6.2.0",
"version": "6.2.1",
"license": "MIT",
"devDependencies": {
"@angular-eslint/eslint-plugin": "^12.6.1",
@ -18,7 +18,7 @@
"@angular/platform-browser": "^12.0.0",
"@angular/platform-browser-dynamic": "^12.2.10",
"@angular/platform-server": "^12.0.0",
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"@ionic/eslint-config": "^0.3.0",
"@ionic/prettier-config": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^5.2.0",
@ -786,9 +786,9 @@
"license": "BSD-3-Clause"
},
"node_modules/@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"dev": true,
"dependencies": {
"@stencil/core": "^2.16.0",
@ -7103,9 +7103,9 @@
"dev": true
},
"@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"dev": true,
"requires": {
"@stencil/core": "^2.16.0",

View File

@ -1,6 +1,6 @@
{
"name": "@ionic/angular-server",
"version": "6.2.0",
"version": "6.2.1",
"description": "Angular SSR Module for Ionic",
"keywords": [
"ionic",
@ -56,7 +56,7 @@
"@angular/platform-browser": "^12.0.0",
"@angular/platform-browser-dynamic": "^12.2.10",
"@angular/platform-server": "^12.0.0",
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"@ionic/eslint-config": "^0.3.0",
"@ionic/prettier-config": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^5.2.0",

View File

@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic/compare/v6.2.0...v6.2.1) (2022-08-03)
**Note:** Version bump only for package @ionic/react-router
# [6.2.0](https://github.com/ionic-team/ionic/compare/v6.1.15...v6.2.0) (2022-07-27)
**Note:** Version bump only for package @ionic/react-router

View File

@ -1,15 +1,15 @@
{
"name": "@ionic/react-router",
"version": "6.2.0",
"version": "6.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/react-router",
"version": "6.2.0",
"version": "6.2.1",
"license": "MIT",
"dependencies": {
"@ionic/react": "^6.2.0",
"@ionic/react": "^6.2.1",
"tslib": "*"
},
"devDependencies": {
@ -147,9 +147,9 @@
}
},
"node_modules/@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"dependencies": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@ -157,11 +157,11 @@
}
},
"node_modules/@ionic/react": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/react/-/react-6.2.0.tgz",
"integrity": "sha512-6RJrMpivslHszazxDV7Shmqbmgi7ki0RsqTklAXKKk40+Gglfx/fm+9H7PRJMGJ17ueGRFKN4ZWLahnzl6Y6ag==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/react/-/react-6.2.1.tgz",
"integrity": "sha512-zHqoGeEm4QwzCijBvcYZQifrCvFXSRChh8ey5lsYUixxKwgl2j9y3kKLckLiipR/g+mbC5lVjno0UlIlBvsulQ==",
"dependencies": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"ionicons": "^6.0.2",
"tslib": "*"
},
@ -207,9 +207,9 @@
}
},
"node_modules/@stencil/core": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.1.tgz",
"integrity": "sha512-ErjQsNALgZQ9SYeBHhqwL1UO+Zbptwl3kwrRJC2tGlc3G/T6UvPuaKr+PGsqI+CZGia+0+R5EELQvFu74mYeIg==",
"version": "2.17.3",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.3.tgz",
"integrity": "sha512-qw2DZzOpyaltLLEfYRTj3n+XbvRtkmv4QQimYDJubC6jMY0NXK9r6H2+VyszdbbVmvK1D9GqZtyvY0NmOrztsg==",
"bin": {
"stencil": "bin/stencil"
},
@ -1157,9 +1157,9 @@
}
},
"@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"requires": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@ -1167,11 +1167,11 @@
}
},
"@ionic/react": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/react/-/react-6.2.0.tgz",
"integrity": "sha512-6RJrMpivslHszazxDV7Shmqbmgi7ki0RsqTklAXKKk40+Gglfx/fm+9H7PRJMGJ17ueGRFKN4ZWLahnzl6Y6ag==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/react/-/react-6.2.1.tgz",
"integrity": "sha512-zHqoGeEm4QwzCijBvcYZQifrCvFXSRChh8ey5lsYUixxKwgl2j9y3kKLckLiipR/g+mbC5lVjno0UlIlBvsulQ==",
"requires": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"ionicons": "^6.0.2",
"tslib": "*"
}
@ -1199,9 +1199,9 @@
}
},
"@stencil/core": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.1.tgz",
"integrity": "sha512-ErjQsNALgZQ9SYeBHhqwL1UO+Zbptwl3kwrRJC2tGlc3G/T6UvPuaKr+PGsqI+CZGia+0+R5EELQvFu74mYeIg=="
"version": "2.17.3",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.3.tgz",
"integrity": "sha512-qw2DZzOpyaltLLEfYRTj3n+XbvRtkmv4QQimYDJubC6jMY0NXK9r6H2+VyszdbbVmvK1D9GqZtyvY0NmOrztsg=="
},
"@types/estree": {
"version": "0.0.39",

View File

@ -1,6 +1,6 @@
{
"name": "@ionic/react-router",
"version": "6.2.0",
"version": "6.2.1",
"description": "React Router wrapper for @ionic/react",
"keywords": [
"ionic",
@ -37,7 +37,7 @@
"dist/"
],
"dependencies": {
"@ionic/react": "^6.2.0",
"@ionic/react": "^6.2.1",
"tslib": "*"
},
"peerDependencies": {

View File

@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic/compare/v6.2.0...v6.2.1) (2022-08-03)
### Bug Fixes
* **react:** IonNav apply properties to page components ([#25603](https://github.com/ionic-team/ionic/issues/25603)) ([61e4ffe](https://github.com/ionic-team/ionic/commit/61e4ffe47f73034808b65ee37342f540ee5a6a97)), closes [#25602](https://github.com/ionic-team/ionic/issues/25602)
# [6.2.0](https://github.com/ionic-team/ionic/compare/v6.1.15...v6.2.0) (2022-07-27)

View File

@ -1,15 +1,15 @@
{
"name": "@ionic/react",
"version": "6.2.0",
"version": "6.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/react",
"version": "6.2.0",
"version": "6.2.1",
"license": "MIT",
"dependencies": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"ionicons": "^6.0.2",
"tslib": "*"
},
@ -607,9 +607,9 @@
}
},
"node_modules/@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"dependencies": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@ -9522,9 +9522,9 @@
}
},
"@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"requires": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",

View File

@ -1,6 +1,6 @@
{
"name": "@ionic/react",
"version": "6.2.0",
"version": "6.2.1",
"description": "React specific wrapper for @ionic/core",
"keywords": [
"ionic",
@ -41,7 +41,7 @@
"css/"
],
"dependencies": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"ionicons": "^6.0.2",
"tslib": "*"
},

View File

@ -4,27 +4,34 @@ import React, { useState } from 'react';
import { ReactDelegate } from '../../framework-delegate';
import { createReactComponent } from '../react-component-lib';
import { createForwardRef } from '../utils';
const IonNavInner = createReactComponent<
JSX.IonNav & { delegate: FrameworkDelegate },
HTMLIonNavElement
>('ion-nav', undefined, undefined, defineCustomElement);
export const IonNav: React.FC<JSX.IonNav> = ({ children, ...restOfProps }) => {
const [views, setViews] = useState<React.ReactPortal[]>([]);
type IonNavProps = JSX.IonNav & {
forwardedRef?: React.ForwardedRef<HTMLIonNavElement>;
};
const IonNavInternal: React.FC<IonNavProps> = ({ children, forwardedRef, ...restOfProps }) => {
const [views, setViews] = useState<React.ReactElement[]>([]);
/**
* Allows us to create React components that are rendered within
* the context of the IonNav component.
*/
const addView = (view: React.ReactPortal) => setViews([...views, view]);
const removeView = (view: React.ReactPortal) => setViews(views.filter((v) => v !== view));
const addView = (view: React.ReactElement) => setViews([...views, view]);
const removeView = (view: React.ReactElement) => setViews(views.filter((v) => v !== view));
const delegate = ReactDelegate(addView, removeView);
return (
<IonNavInner delegate={delegate} {...restOfProps}>
<IonNavInner delegate={delegate} ref={forwardedRef} {...restOfProps}>
{views}
</IonNavInner>
);
};
export const IonNav = createForwardRef<IonNavProps, HTMLIonNavElement>(IonNavInternal, 'IonNav');

View File

@ -1,15 +1,17 @@
import { FrameworkDelegate } from '@ionic/core/components';
import { createPortal } from 'react-dom';
type ReactComponent = (props?: any) => JSX.Element;
export const ReactDelegate = (
addView: (view: React.ReactPortal) => void,
removeView: (view: React.ReactPortal) => void
addView: (view: React.ReactElement) => void,
removeView: (view: React.ReactElement) => void
): FrameworkDelegate => {
let Component: React.ReactPortal;
const refMap = new WeakMap<ReactComponent, React.ReactElement>();
const attachViewToDom = async (
parentElement: HTMLElement,
component: () => JSX.Element,
component: ReactComponent,
propsOrDataObj?: any,
cssClasses?: string[]
): Promise<any> => {
@ -17,17 +19,20 @@ export const ReactDelegate = (
cssClasses && div.classList.add(...cssClasses);
parentElement.appendChild(div);
Component = createPortal(component(), div);
const componentWithProps = component(propsOrDataObj);
const hostComponent = createPortal(componentWithProps, div);
Component.props = propsOrDataObj;
refMap.set(component, hostComponent);
addView(Component);
addView(hostComponent);
return Promise.resolve(div);
};
const removeViewFromDom = (): Promise<void> => {
Component && removeView(Component);
const removeViewFromDom = (_container: any, component: ReactComponent): Promise<void> => {
const hostComponent = refMap.get(component);
hostComponent && removeView(hostComponent);
return Promise.resolve();
};

View File

@ -7,6 +7,10 @@ describe('IonNav', () => {
cy.get('ion-nav').contains('Page one content');
});
it('should have a ref defined', () => {
cy.get('#navRef').should('have.text', 'Nav ref is defined: true');
});
it('should push a page', () => {
cy.get('ion-button').contains('Go to Page Two').click();
cy.get('#pageTwoContent').should('be.visible');
@ -25,4 +29,16 @@ describe('IonNav', () => {
cy.get('ion-nav').contains('Page one content');
});
it('should pass params to the page', () => {
cy.get('#pageOneProps').should('have.text', '{"someString":"Hello","someNumber":3,"someBoolean":true}');
});
it('should pass componentProps to sub pages', () => {
cy.get('ion-button').contains('Go to Page Two').click();
cy.get('#pageTwoContent').should('be.visible');
cy.get('#pageTwoProps').should('have.text', '{"someValue":"Hello"}');
});
});

View File

@ -11,13 +11,17 @@ import {
IonBackButton,
IonPage,
} from '@ionic/react';
import React from 'react';
import React, { useRef } from 'react';
const NavComponent: React.FC = () => {
return (
<IonPage>
<IonNav
root={() => {
const PageOne = ({
nav,
...restOfProps
}: {
someString: string;
someNumber: number;
someBoolean: boolean;
nav: React.MutableRefObject<HTMLIonNavElement>;
}) => {
return (
<>
<IonHeader>
@ -30,9 +34,21 @@ const NavComponent: React.FC = () => {
</IonHeader>
<IonContent id="pageOneContent">
<IonLabel>Page one content</IonLabel>
<div id="pageOneProps">{JSON.stringify(restOfProps)}</div>
<div id="navRef">Nav ref is defined: {nav.current !== null ? 'true' : 'false'}</div>
<IonNavLink
routerDirection="forward"
component={() => {
component={PageTwo}
componentProps={{ someValue: 'Hello' }}
>
<IonButton>Go to Page Two</IonButton>
</IonNavLink>
</IonContent>
</>
);
};
const PageTwo = (props?: { someValue: string }) => {
return (
<>
<IonHeader>
@ -45,9 +61,17 @@ const NavComponent: React.FC = () => {
</IonHeader>
<IonContent id="pageTwoContent">
<IonLabel>Page two content</IonLabel>
<IonNavLink
routerDirection="forward"
component={() => (
<div id="pageTwoProps">{JSON.stringify(props)}</div>
<IonNavLink routerDirection="forward" component={PageThree}>
<IonButton>Go to Page Three</IonButton>
</IonNavLink>
</IonContent>
</>
);
};
const PageThree = () => {
return (
<>
<IonHeader>
<IonToolbar>
@ -61,22 +85,23 @@ const NavComponent: React.FC = () => {
<IonLabel>Page three content</IonLabel>
</IonContent>
</>
)}
>
<IonButton>Go to Page Three</IonButton>
</IonNavLink>
</IonContent>
</>
);
};
const NavComponent: React.FC = () => {
const ref = useRef<any>();
return (
<IonPage>
<IonNav
ref={ref}
root={PageOne}
rootParams={{
someString: 'Hello',
someNumber: 3,
someBoolean: true,
nav: ref,
}}
>
<IonButton>Go to Page Two</IonButton>
</IonNavLink>
</IonContent>
</>
);
}}
></IonNav>
/>
</IonPage>
);
};

View File

@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic/compare/v6.2.0...v6.2.1) (2022-08-03)
**Note:** Version bump only for package @ionic/vue-router
# [6.2.0](https://github.com/ionic-team/ionic/compare/v6.1.15...v6.2.0) (2022-07-27)
**Note:** Version bump only for package @ionic/vue-router

View File

@ -1,15 +1,15 @@
{
"name": "@ionic/vue-router",
"version": "6.2.0",
"version": "6.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/vue-router",
"version": "6.2.0",
"version": "6.2.1",
"license": "MIT",
"dependencies": {
"@ionic/vue": "^6.2.0"
"@ionic/vue": "^6.2.1"
},
"devDependencies": {
"@types/jest": "^28.1.1",
@ -578,9 +578,9 @@
"dev": true
},
"node_modules/@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"dependencies": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@ -588,11 +588,11 @@
}
},
"node_modules/@ionic/vue": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/vue/-/vue-6.2.0.tgz",
"integrity": "sha512-tF+922bNLBTrN204CRUBDDRc6E+ygkMExxH2RX/QlXyRaVbSbmVlYXFe56nCu8caZgFlX711lHhHL1D+FsnOng==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/vue/-/vue-6.2.1.tgz",
"integrity": "sha512-buVKw5ZAeNCBa1PmSZWkUDaNJgRSjp2iBzYH6/8MQC/bniTRb1QV6LebTAw3xt+6QhHqCeiBedZtwYCSlr510Q==",
"dependencies": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"ionicons": "^6.0.2"
}
},
@ -1005,9 +1005,9 @@
}
},
"node_modules/@stencil/core": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.1.tgz",
"integrity": "sha512-ErjQsNALgZQ9SYeBHhqwL1UO+Zbptwl3kwrRJC2tGlc3G/T6UvPuaKr+PGsqI+CZGia+0+R5EELQvFu74mYeIg==",
"version": "2.17.3",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.3.tgz",
"integrity": "sha512-qw2DZzOpyaltLLEfYRTj3n+XbvRtkmv4QQimYDJubC6jMY0NXK9r6H2+VyszdbbVmvK1D9GqZtyvY0NmOrztsg==",
"bin": {
"stencil": "bin/stencil"
},
@ -5233,9 +5233,9 @@
"dev": true
},
"@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"requires": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@ -5243,11 +5243,11 @@
}
},
"@ionic/vue": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/vue/-/vue-6.2.0.tgz",
"integrity": "sha512-tF+922bNLBTrN204CRUBDDRc6E+ygkMExxH2RX/QlXyRaVbSbmVlYXFe56nCu8caZgFlX711lHhHL1D+FsnOng==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/vue/-/vue-6.2.1.tgz",
"integrity": "sha512-buVKw5ZAeNCBa1PmSZWkUDaNJgRSjp2iBzYH6/8MQC/bniTRb1QV6LebTAw3xt+6QhHqCeiBedZtwYCSlr510Q==",
"requires": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"ionicons": "^6.0.2"
}
},
@ -5580,9 +5580,9 @@
}
},
"@stencil/core": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.1.tgz",
"integrity": "sha512-ErjQsNALgZQ9SYeBHhqwL1UO+Zbptwl3kwrRJC2tGlc3G/T6UvPuaKr+PGsqI+CZGia+0+R5EELQvFu74mYeIg=="
"version": "2.17.3",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.3.tgz",
"integrity": "sha512-qw2DZzOpyaltLLEfYRTj3n+XbvRtkmv4QQimYDJubC6jMY0NXK9r6H2+VyszdbbVmvK1D9GqZtyvY0NmOrztsg=="
},
"@tootallnate/once": {
"version": "2.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@ionic/vue-router",
"version": "6.2.0",
"version": "6.2.1",
"description": "Vue Router integration for @ionic/vue",
"scripts": {
"prepublishOnly": "npm run build",
@ -44,7 +44,7 @@
},
"homepage": "https://github.com/ionic-team/ionic#readme",
"dependencies": {
"@ionic/vue": "^6.2.0"
"@ionic/vue": "^6.2.1"
},
"devDependencies": {
"@types/jest": "^28.1.1",

View File

@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.1](https://github.com/ionic-team/ionic/compare/v6.2.0...v6.2.1) (2022-08-03)
**Note:** Version bump only for package @ionic/vue
# [6.2.0](https://github.com/ionic-team/ionic/compare/v6.1.15...v6.2.0) (2022-07-27)

View File

@ -1,15 +1,15 @@
{
"name": "@ionic/vue",
"version": "6.2.0",
"version": "6.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/vue",
"version": "6.2.0",
"version": "6.2.1",
"license": "MIT",
"dependencies": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"ionicons": "^6.0.2"
},
"devDependencies": {
@ -59,9 +59,9 @@
}
},
"node_modules/@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"dependencies": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@ -768,9 +768,9 @@
}
},
"@ionic/core": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.0.tgz",
"integrity": "sha512-3qUNsVcSAdrjhIhPr5M2RRnh+1xuc9RFaxoeUgI9xQ0YjTmn2FWiH4urDCXuE/rZAwnvHF4X17P0L2EqCPSfWA==",
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"requires": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",

View File

@ -1,6 +1,6 @@
{
"name": "@ionic/vue",
"version": "6.2.0",
"version": "6.2.1",
"description": "Vue specific wrapper for @ionic/core",
"scripts": {
"prepublishOnly": "npm run build",
@ -61,7 +61,7 @@
"vue-router": "^4.0.16"
},
"dependencies": {
"@ionic/core": "^6.2.0",
"@ionic/core": "^6.2.1",
"ionicons": "^6.0.2"
},
"vetur": {