mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3796e8f653 | ||
|
|
4083e32e10 | ||
|
|
1c0b3003a3 | ||
|
|
e099fbec05 | ||
|
|
4434d8702e | ||
|
|
772fbd8ed3 | ||
|
|
7fce517e85 |
@@ -1,4 +1,4 @@
|
||||
version: 2.1
|
||||
version: 2
|
||||
|
||||
aliases:
|
||||
- &restore-cache
|
||||
@@ -31,29 +31,10 @@ aliases:
|
||||
|
||||
defaults: &defaults
|
||||
docker:
|
||||
- image: circleci/node:latest-browsers
|
||||
- image: circleci/node:10-browsers
|
||||
working_directory: /tmp/workspace
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
|
||||
jobs:
|
||||
puppeteer-dependencies:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- run:
|
||||
name: Install headless Chrome dependencies
|
||||
command: |
|
||||
sudo apt-get install -yq \
|
||||
gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
|
||||
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
|
||||
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \
|
||||
libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates \
|
||||
fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
|
||||
- run:
|
||||
name: Install Puppeteer with Chromium
|
||||
command: |
|
||||
npm i puppeteer
|
||||
|
||||
build:
|
||||
<<: *defaults
|
||||
steps:
|
||||
@@ -330,14 +311,13 @@ jobs:
|
||||
command: npm install
|
||||
working_directory: /tmp/workspace/angular/test/test-app
|
||||
- run:
|
||||
command: npm run test -- --protractor-config=e2e/protractor-ci.conf.js
|
||||
command: npm test
|
||||
working_directory: /tmp/workspace/angular/test/test-app
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- puppeteer-dependencies
|
||||
- build
|
||||
- build-core:
|
||||
requires: [build]
|
||||
@@ -346,7 +326,7 @@ workflows:
|
||||
- test-core-lint:
|
||||
requires: [build-core]
|
||||
- test-core-e2e:
|
||||
requires: [puppeteer-dependencies, build-core]
|
||||
requires: [build-core]
|
||||
- test-core-spec:
|
||||
requires: [build-core]
|
||||
- test-core-treeshake:
|
||||
|
||||
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -19,8 +19,7 @@ assignees: ''
|
||||
**Ionic version:**
|
||||
<!-- (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) -->
|
||||
<!-- (For Ionic 2.x & 3.x issues, please use https://github.com/ionic-team/ionic-v3) -->
|
||||
[ ] **4.x**
|
||||
[x] **5.x**
|
||||
[x] **4.x**
|
||||
|
||||
**Current behavior:**
|
||||
<!-- Describe how the bug manifests. -->
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -64,4 +64,3 @@ core/loader/
|
||||
core/www/
|
||||
.stencil/
|
||||
angular/build/
|
||||
core/components/
|
||||
|
||||
@@ -209,13 +209,6 @@ function prepareDevPackage(tasks, package, version) {
|
||||
title: `${pkg.name}: npm link @ionic/core`,
|
||||
task: () => execa('npm', ['link', '@ionic/core'], { cwd: projectRoot })
|
||||
});
|
||||
|
||||
if (package === 'packages/react-router') {
|
||||
projectTasks.push({
|
||||
title: `${pkg.name}: npm link @ionic/react`,
|
||||
task: () => execa('npm', ['link', '@ionic/react'], { cwd: projectRoot })
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
projectTasks.push({
|
||||
|
||||
@@ -78,9 +78,6 @@ async function setPackageVersionChanges(packages, version) {
|
||||
if (package !== 'core') {
|
||||
const pkg = common.readPkg(package);
|
||||
common.updateDependency(pkg, '@ionic/core', version);
|
||||
if(package === 'packages/react-router') {
|
||||
common.updateDependency(pkg, '@ionic/react', version);
|
||||
}
|
||||
common.writePkg(package, pkg);
|
||||
}
|
||||
const projectRoot = common.projectPath(package);
|
||||
|
||||
@@ -132,7 +132,7 @@ async function publishGithub(version, gitTag, changelog, npmTag) {
|
||||
|
||||
await octokit.repos.createRelease({
|
||||
owner: 'ionic-team',
|
||||
repo: 'ionic-framework',
|
||||
repo: 'ionic',
|
||||
target_commitish: branch,
|
||||
tag_name: gitTag,
|
||||
name: version,
|
||||
|
||||
81
CHANGELOG.md
81
CHANGELOG.md
@@ -1,84 +1,3 @@
|
||||
## [5.3.2](https://github.com/ionic-team/ionic/compare/v5.3.1...v5.3.2) (2020-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **input:** improve reliability of scroll assist when accessory bar is enabled ([#21936](https://github.com/ionic-team/ionic/issues/21936)) ([22477fb](https://github.com/ionic-team/ionic/commit/22477fb9bf7c0637aa5c8d0aab34c8ccc521b0b9)), closes [#21912](https://github.com/ionic-team/ionic/issues/21912)
|
||||
* **input:** properly focus the input when clicking the item padding in WebKit ([#21930](https://github.com/ionic-team/ionic/issues/21930)) ([e4964ff](https://github.com/ionic-team/ionic/commit/e4964ff77b317c92b201cf7c265787b55bdde4d4)), closes [#21509](https://github.com/ionic-team/ionic/issues/21509)
|
||||
* **input:** remain focused in the input after pressing the clear button ([#21985](https://github.com/ionic-team/ionic/issues/21985)) ([6878fb9](https://github.com/ionic-team/ionic/commit/6878fb9eb99c17908f5630019efaa762b5b006e0)), closes [#21549](https://github.com/ionic-team/ionic/issues/21549)
|
||||
* **label:** use translateY so input caret shows up due to webkit issue ([#21949](https://github.com/ionic-team/ionic/issues/21949)) ([00eac33](https://github.com/ionic-team/ionic/commit/00eac33053f49dbebf22ef95fddcb66570ed117a)), closes [#21943](https://github.com/ionic-team/ionic/issues/21943)
|
||||
* **overlays:** prevent focus from being stolen when presenting another overlay from within a modal ([#21856](https://github.com/ionic-team/ionic/issues/21856)) ([5c177d7](https://github.com/ionic-team/ionic/commit/5c177d756f7755e766d5b619d49825c4799aee47)), closes [#21840](https://github.com/ionic-team/ionic/issues/21840)
|
||||
* **range:** properly display stacked labels in an item with a range ([#21944](https://github.com/ionic-team/ionic/issues/21944)) ([9f4b01e](https://github.com/ionic-team/ionic/commit/9f4b01e17fd2f5e742d32bc9e080b6b394c43d37)), closes [#21625](https://github.com/ionic-team/ionic/issues/21625)
|
||||
* **react:** export correct animation types ([#21950](https://github.com/ionic-team/ionic/issues/21950)) ([36e4bf7](https://github.com/ionic-team/ionic/commit/36e4bf7dd76e396f910d28445566b5503cc84c8c))
|
||||
* **react:** removed exporting of ionRenderToString to decrease bundle size, closes [#21917](https://github.com/ionic-team/ionic/issues/21917) ([#21928](https://github.com/ionic-team/ionic/issues/21928)) ([434befe](https://github.com/ionic-team/ionic/commit/434befea5f31aa599ee5b1b7edf29238912c23d9))
|
||||
* **react:** setting active tab properly on mount, closes [#21830](https://github.com/ionic-team/ionic/issues/21830) ([#21833](https://github.com/ionic-team/ionic/issues/21833)) ([f58424f](https://github.com/ionic-team/ionic/commit/f58424f62596b9eb82bebb8e07c211e1725c025a))
|
||||
* **reat:** fix tab currentHref when changing tabs, closes [#21834](https://github.com/ionic-team/ionic/issues/21834) ([#21835](https://github.com/ionic-team/ionic/issues/21835)) ([74468ab](https://github.com/ionic-team/ionic/commit/74468ab7972b174ba85bf239306c27080f253a4a))
|
||||
|
||||
|
||||
|
||||
## [5.3.1](https://github.com/ionic-team/ionic/compare/v5.3.0...v5.3.1) (2020-07-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **react:** properly extend HTMLElement for tabs ([bfddb17](https://github.com/ionic-team/ionic/commit/bfddb170659224d0f826762744dfe44a85813d36)), closes [#21803](https://github.com/ionic-team/ionic/issues/21803)
|
||||
|
||||
|
||||
|
||||
# [5.3.0 Phosphorus](https://github.com/ionic-team/ionic/compare/v5.2.3...v5.3.0) (2020-07-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **angular:** per-page animations now work with swipe to go back ([#21706](https://github.com/ionic-team/ionic/issues/21706)) ([2664587](https://github.com/ionic-team/ionic/commit/2664587749e45100a04f70796733de162b26cdf7)), closes [#21692](https://github.com/ionic-team/ionic/issues/21692)
|
||||
* **datetime:** remove unneeded combobox role ([#21708](https://github.com/ionic-team/ionic/issues/21708)) ([f00ad8a](https://github.com/ionic-team/ionic/commit/f00ad8a8357ccd7fe85631dad0c841f2d4c72487))
|
||||
* **input:** clear button can now be tabbed to ([#21633](https://github.com/ionic-team/ionic/issues/21633)) ([1dcd9de](https://github.com/ionic-team/ionic/commit/1dcd9de50ae16bfa102e98120a022de5b0287baa))
|
||||
* **ios:** improve scroll assist reliability on password inputs ([#21703](https://github.com/ionic-team/ionic/issues/21703)) ([3cbf9e7](https://github.com/ionic-team/ionic/commit/3cbf9e7c4c225d6b02237d8ea8f16fb924ba360e)), closes [#21688](https://github.com/ionic-team/ionic/issues/21688)
|
||||
* **keyboard:** keyboard events now consistently fire on android ([#21741](https://github.com/ionic-team/ionic/issues/21741)) ([020f3cc](https://github.com/ionic-team/ionic/commit/020f3cc56cb6dac23dd8766a3802422500b510e2)), closes [#21734](https://github.com/ionic-team/ionic/issues/21734)
|
||||
* **nav:** insertPages method correctly inserts multiple pages with props ([#21725](https://github.com/ionic-team/ionic/issues/21725)) ([eb592b8](https://github.com/ionic-team/ionic/commit/eb592b8917b8a7412d8c346f41b47d3b79002b95)), closes [#21724](https://github.com/ionic-team/ionic/issues/21724)
|
||||
* **overlays:** trap focus inside overlay components except toast ([#21716](https://github.com/ionic-team/ionic/issues/21716)) ([fff4aec](https://github.com/ionic-team/ionic/commit/fff4aec6cfbd48566594a05f4af57dd0578977a8)), closes [#21647](https://github.com/ionic-team/ionic/issues/21647)
|
||||
* **segment-button:** allow min-width to be overridden ([#21722](https://github.com/ionic-team/ionic/issues/21722)) ([88f1828](https://github.com/ionic-team/ionic/commit/88f1828bd8f6b9a1c1f3dcb220d93067bed7f404)), closes [#21105](https://github.com/ionic-team/ionic/issues/21105)
|
||||
* **title:** allow overriding of large title transform-origin ([#21770](https://github.com/ionic-team/ionic/issues/21770)) ([dbe6853](https://github.com/ionic-team/ionic/commit/dbe6853884bd76c3d8e229cd58e1571d9b3a7249)), closes [#21761](https://github.com/ionic-team/ionic/issues/21761)
|
||||
* **virtual-scroll:** properly calculate top offset when nested ([#21581](https://github.com/ionic-team/ionic/issues/21581)) ([d297ecb](https://github.com/ionic-team/ionic/commit/d297ecb87ad3e1c8f0988f0571a475081ce368f8))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **card:** expose global card css variables ([#21756](https://github.com/ionic-team/ionic/issues/21756)) ([096eef4](https://github.com/ionic-team/ionic/commit/096eef4a79c2d05c37eb224466c6d7d512d2be20)), closes [#21694](https://github.com/ionic-team/ionic/issues/21694)
|
||||
* **input:** accept datetime-local, month, and week type values ([#21758](https://github.com/ionic-team/ionic/issues/21758)) ([fa93dff](https://github.com/ionic-team/ionic/commit/fa93dffdb4f350e8db8acc7f06b06761974eea8e)), closes [#21757](https://github.com/ionic-team/ionic/issues/21757)
|
||||
* **input, textarea:** expose native events for ionBlur and ionFocus ([#21777](https://github.com/ionic-team/ionic/issues/21777)) ([a625c83](https://github.com/ionic-team/ionic/commit/a625c837a60abc07ad71c696196a89f1a25a4c27)), closes [#17363](https://github.com/ionic-team/ionic/issues/17363)
|
||||
* **react:** add custom history to IonReactRouter ([#21775](https://github.com/ionic-team/ionic/issues/21775)) ([d4a5fbd](https://github.com/ionic-team/ionic/commit/d4a5fbd955e8ecccba8b77491943d81fdf5a5ef4)), closes [#20297](https://github.com/ionic-team/ionic/issues/20297)
|
||||
* **react:** add new react router ([#21693](https://github.com/ionic-team/ionic/issues/21693)) ([c171ccb](https://github.com/ionic-team/ionic/commit/c171ccbd37c1ee4b4934758a3a759170ff357cb2))
|
||||
* **router:** add navigation hooks ([#21709](https://github.com/ionic-team/ionic/issues/21709)) ([77464ef](https://github.com/ionic-team/ionic/commit/77464ef21aaaa5afa7a02e5417f3ec295b240601))
|
||||
* **segment-button, toast:** expose additional shadow parts ([#21532](https://github.com/ionic-team/ionic/issues/21532)) ([a5e4669](https://github.com/ionic-team/ionic/commit/a5e4669c4bcbcb2cdd605ed17c35e42438bd5596))
|
||||
* **select:** add optional generic typings ([#21514](https://github.com/ionic-team/ionic/issues/21514)) ([7c2d0c9](https://github.com/ionic-team/ionic/commit/7c2d0c981ab91930478c4b76220ce4ec4ed4e471))
|
||||
|
||||
|
||||
|
||||
## [5.2.3](https://github.com/ionic-team/ionic/compare/v5.2.2...v5.2.3) (2020-07-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **angular:** expose createAnimation in addition to AnimationController ([#21616](https://github.com/ionic-team/ionic/issues/21616)) ([a5b3750](https://github.com/ionic-team/ionic/commit/a5b3750ee2a7c005f80f8453b03c67dd1a5622ca)), closes [#21615](https://github.com/ionic-team/ionic/issues/21615)
|
||||
* **select:** change role to listbox ([#21609](https://github.com/ionic-team/ionic/issues/21609)) ([8c79e2c](https://github.com/ionic-team/ionic/commit/8c79e2c5b58ad562967f2d559c6b548e57536936))
|
||||
* **slides:** enable keyboard integration ([#21608](https://github.com/ionic-team/ionic/issues/21608)) ([26674f1](https://github.com/ionic-team/ionic/commit/26674f1dfa8c9a28f5525f1b16070e8ec494c232)), closes [#21554](https://github.com/ionic-team/ionic/issues/21554)
|
||||
* **textarea:** add aria-labelledby to native textarea ([#21606](https://github.com/ionic-team/ionic/issues/21606)) ([88f23b1](https://github.com/ionic-team/ionic/commit/88f23b1626eb400336f2f52a3e0d34ac3c161e64)), closes [#21600](https://github.com/ionic-team/ionic/issues/21600)
|
||||
|
||||
|
||||
|
||||
## [5.2.2](https://github.com/ionic-team/ionic/compare/v5.2.1...v5.2.2) (2020-06-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **action-sheet, alert:** resolve double click issue when running in iOS mode on chrome ([#21506](https://github.com/ionic-team/ionic/issues/21506)) ([bcccc21](https://github.com/ionic-team/ionic/commit/bcccc217b8833a284a1781e287db5e46043b3548)), closes [#21503](https://github.com/ionic-team/ionic/issues/21503)
|
||||
* **angular:** fix issue where navAnimation was being incorrectly overridden ([#21508](https://github.com/ionic-team/ionic/issues/21508)) ([e968bd0](https://github.com/ionic-team/ionic/commit/e968bd029a4fb37b4001d96a490c6091a948785a)), closes [#21495](https://github.com/ionic-team/ionic/issues/21495)
|
||||
* **input:** add aria-label to clear button ([#21538](https://github.com/ionic-team/ionic/issues/21538)) ([d8b377f](https://github.com/ionic-team/ionic/commit/d8b377ffeb88eaae23b33eadeae5c8e54e1bc77c)), closes [#21537](https://github.com/ionic-team/ionic/issues/21537)
|
||||
* **ios:** respect toolbar opacity when doing nav transition ([#21512](https://github.com/ionic-team/ionic/issues/21512)) ([24cfdc3](https://github.com/ionic-team/ionic/commit/24cfdc308f63b7a55969ac58806eafd67116b017))
|
||||
* **segment:** ensure checked classes get set after not having a value ([#21547](https://github.com/ionic-team/ionic/issues/21547)) ([17308f2](https://github.com/ionic-team/ionic/commit/17308f247f8750029ece39548c9f457e15326189)), closes [#21546](https://github.com/ionic-team/ionic/issues/21546)
|
||||
|
||||
|
||||
## [5.2.1](https://github.com/ionic-team/ionic/compare/v5.2.0...v5.2.1) (2020-06-11)
|
||||
|
||||
|
||||
|
||||
@@ -1,129 +1,11 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
As contributors and maintainers of the Ionic project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
|
||||
|
||||
## Our Pledge
|
||||
Communication through any of Ionic's channels (GitHub, Slack, Forum, IRC, mailing lists, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Ionic project to do the same.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
If any member of the community violates this code of conduct, the maintainers of the Ionic project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
[contact@ionic.io](mailto:contact@ionic.io).
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [hi@ionicframework.com](mailto:hi@ionicframework.com).
|
||||
|
||||
10
README.md
10
README.md
@@ -1,9 +1,9 @@
|
||||
# Ionic Framework
|
||||
# Ionic
|
||||
|
||||
[Ionic Framework](https://ionicframework.com/) is the open-source mobile app development framework that makes it easy to
|
||||
[Ionic](https://ionicframework.com/) is the open-source mobile app development framework that makes it easy to
|
||||
build top quality native and progressive web apps with web technologies.
|
||||
|
||||
Ionic Framework is based on [Web Components](https://www.webcomponents.org/introduction) and comes with many significant performance, usability, and feature improvements over the past versions.
|
||||
Ionic is based on [Web Components](https://www.webcomponents.org/introduction) and comes with many significant performance, usability, and feature improvements over the past versions.
|
||||
|
||||
|
||||
### Packages
|
||||
@@ -31,8 +31,6 @@ Thanks for your interest in contributing! Read up on our guidelines for
|
||||
and then look through our issues with a [help wanted](https://github.com/ionic-team/ionic/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
|
||||
label.
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/ionic-team/ionic/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -42,7 +40,7 @@ It is the perfect starting point for learning and building your own app.
|
||||
|
||||
### Future Goals
|
||||
|
||||
As Ionic Framework components migrate to the web component standard, a goal of ours is to have Ionic Framework easily work within all of the popular frameworks.
|
||||
As Ionic components migrate to the web component standard, a goal of ours is to have Ionic components easily work within all of the popular frameworks.
|
||||
|
||||
### Earlier Versions
|
||||
|
||||
|
||||
1
angular/.npmrc
Normal file
1
angular/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
package-lock=false
|
||||
4072
angular/package-lock.json
generated
4072
angular/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ionic/angular",
|
||||
"version": "5.3.2",
|
||||
"version": "5.2.1",
|
||||
"description": "Angular specific wrappers for @ionic/core",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
@@ -42,7 +42,7 @@
|
||||
"validate": "npm i && npm run lint && npm run test && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ionic/core": "5.3.2",
|
||||
"@ionic/core": "5.2.1",
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -67,12 +67,12 @@
|
||||
"ng-packagr": "^9.1.5",
|
||||
"rollup": "~1.17.0",
|
||||
"rollup-plugin-node-resolve": "~5.2.0",
|
||||
"rxjs": "^6.6.2",
|
||||
"tsickle": "^0.39.1",
|
||||
"rxjs": "^6.5.2",
|
||||
"tsickle": "^0.34.0",
|
||||
"tslint": "^5.12.1",
|
||||
"tslint-ionic-rules": "0.0.21",
|
||||
"typescript": "3.4.5",
|
||||
"zone.js": "^0.11.1"
|
||||
"zone.js": "^0.8.28"
|
||||
},
|
||||
"schematics": "./schematics/collection.json",
|
||||
"ngPackage": {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
|
||||
export default {
|
||||
input: 'build/es2015/core.js',
|
||||
|
||||
@@ -127,7 +127,7 @@ export class StackController {
|
||||
* Save any custom animation so that navigating
|
||||
* back will use this custom animation by default.
|
||||
*/
|
||||
if (leavingView) {
|
||||
if (animationBuilder !== undefined && leavingView) {
|
||||
leavingView.animationBuilder = animationBuilder;
|
||||
}
|
||||
|
||||
@@ -190,16 +190,13 @@ export class StackController {
|
||||
if (leavingView) {
|
||||
const views = this.getStack(leavingView.stackId);
|
||||
const enteringView = views[views.length - 2];
|
||||
const customAnimation = enteringView.animationBuilder;
|
||||
|
||||
return this.wait(() => {
|
||||
return this.transition(
|
||||
enteringView, // entering view
|
||||
leavingView, // leaving view
|
||||
'back',
|
||||
this.canGoBack(2),
|
||||
true,
|
||||
customAnimation
|
||||
true
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export * from './types/ionic-lifecycle-hooks';
|
||||
export { IonicModule } from './ionic-module';
|
||||
|
||||
// UTILS
|
||||
export { IonicSafeString, getPlatforms, isPlatform, createAnimation } from '@ionic/core';
|
||||
export { IonicSafeString, getPlatforms, isPlatform } from '@ionic/core';
|
||||
|
||||
// CORE TYPES
|
||||
export { Animation, AnimationBuilder, AnimationCallbackOptions, AnimationDirection, AnimationFill, AnimationKeyFrames, AnimationLifecycle, Gesture, GestureConfig, GestureDetail, mdTransitionAnimation, iosTransitionAnimation, NavComponentWithProps } from '@ionic/core';
|
||||
export { Animation, AnimationBuilder, AnimationCallbackOptions, AnimationDirection, AnimationFill, AnimationKeyFrames, AnimationLifecycle, Gesture, GestureConfig, GestureDetail, mdTransitionAnimation, iosTransitionAnimation } from '@ionic/core';
|
||||
|
||||
1
angular/test/test-app/.npmrc
Normal file
1
angular/test/test-app/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
package-lock=false
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
// Protractor CI configuration file, see link for more information
|
||||
// https://angular.io/guide/testing#configure-cli-for-ci-testing-in-chrome
|
||||
|
||||
const config = require('./protractor.conf').config;
|
||||
|
||||
config.capabilities = {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
args: ['--headless', '--no-sandbox', '--window-size=1920,1080']
|
||||
}
|
||||
};
|
||||
|
||||
exports.config = config;
|
||||
@@ -1,4 +1,4 @@
|
||||
// @ts-check
|
||||
// @ts-check
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@ describe('form', () => {
|
||||
await testStatus('INVALID');
|
||||
expect(await getText('#submit')).toEqual('false');
|
||||
await testData({
|
||||
datetime: '2010-08-20',
|
||||
select: null,
|
||||
toggle: false,
|
||||
input: '',
|
||||
input2: 'Default Value',
|
||||
checkbox: false,
|
||||
range: 5
|
||||
'datetime': '2010-08-20',
|
||||
'select': null,
|
||||
'toggle': false,
|
||||
'input': '',
|
||||
'input2': 'Default Value',
|
||||
'checkbox': false,
|
||||
'range': 5
|
||||
});
|
||||
});
|
||||
|
||||
@@ -49,39 +49,39 @@ describe('form', () => {
|
||||
await setProperty('ion-range', 'value', 40);
|
||||
await testStatus('VALID');
|
||||
await testData({
|
||||
datetime: '2010-08-20',
|
||||
select: 'nes',
|
||||
toggle: false,
|
||||
input: 'Some value',
|
||||
input2: 'Default Value',
|
||||
checkbox: false,
|
||||
range: 40
|
||||
'datetime': '2010-08-20',
|
||||
'select': 'nes',
|
||||
'toggle': false,
|
||||
'input': 'Some value',
|
||||
'input2': 'Default Value',
|
||||
'checkbox': false,
|
||||
'range': 40
|
||||
});
|
||||
});
|
||||
|
||||
it('ion-toggle should change', async () => {
|
||||
await element(by.css('form ion-toggle')).click();
|
||||
await testData({
|
||||
datetime: '2010-08-20',
|
||||
select: null,
|
||||
toggle: true,
|
||||
input: '',
|
||||
input2: 'Default Value',
|
||||
checkbox: false,
|
||||
range: 5
|
||||
'datetime': '2010-08-20',
|
||||
'select': null,
|
||||
'toggle': true,
|
||||
'input': '',
|
||||
'input2': 'Default Value',
|
||||
'checkbox': false,
|
||||
'range': 5
|
||||
});
|
||||
});
|
||||
|
||||
it('ion-checkbox should change', async () => {
|
||||
await element(by.css('ion-checkbox')).click();
|
||||
await testData({
|
||||
datetime: '2010-08-20',
|
||||
select: null,
|
||||
toggle: false,
|
||||
input: '',
|
||||
input2: 'Default Value',
|
||||
checkbox: true,
|
||||
range: 5
|
||||
'datetime': '2010-08-20',
|
||||
'select': null,
|
||||
'toggle': false,
|
||||
'input': '',
|
||||
'input2': 'Default Value',
|
||||
'checkbox': true,
|
||||
'range': 5
|
||||
});
|
||||
});
|
||||
|
||||
@@ -102,23 +102,23 @@ describe('form', () => {
|
||||
it('ion-toggle should change only after blur', async () => {
|
||||
await element(by.css('form ion-toggle')).click();
|
||||
await testData({
|
||||
datetime: '2010-08-20',
|
||||
select: null,
|
||||
toggle: false,
|
||||
input: '',
|
||||
input2: 'Default Value',
|
||||
checkbox: false,
|
||||
range: 5
|
||||
'datetime': '2010-08-20',
|
||||
'select': null,
|
||||
'toggle': false,
|
||||
'input': '',
|
||||
'input2': 'Default Value',
|
||||
'checkbox': false,
|
||||
'range': 5
|
||||
});
|
||||
await element(by.css('ion-checkbox')).click();
|
||||
await testData({
|
||||
datetime: '2010-08-20',
|
||||
select: null,
|
||||
toggle: true,
|
||||
input: '',
|
||||
input2: 'Default Value',
|
||||
checkbox: false,
|
||||
range: 5
|
||||
'datetime': '2010-08-20',
|
||||
'select': null,
|
||||
'toggle': true,
|
||||
'input': '',
|
||||
'input2': 'Default Value',
|
||||
'checkbox': false,
|
||||
'range': 5
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -149,7 +149,7 @@ describe('tabs', () => {
|
||||
|
||||
it('should set root when clicking on an active tab to navigate to the root', async () => {
|
||||
const expectNestedTabUrlToContain = 'search=hello#fragment';
|
||||
const tab = await getSelectedTab() as ElementFinder;
|
||||
let tab = await getSelectedTab() as ElementFinder;
|
||||
const initialUrl = await browser.getCurrentUrl();
|
||||
await tab.$('#goto-nested-page1-with-query-params').click();
|
||||
await testTabTitle('Tab 1 - Page 2 (1)');
|
||||
@@ -176,7 +176,7 @@ describe('tabs', () => {
|
||||
it('should preserve root url navigation extras when clicking on an active tab to navigate to the root', async () => {
|
||||
await browser.get(rootUrl);
|
||||
|
||||
const tab = await getSelectedTab() as ElementFinder;
|
||||
let tab = await getSelectedTab() as ElementFinder;
|
||||
await tab.$('#goto-nested-page1-with-query-params').click();
|
||||
await testTabTitle('Tab 1 - Page 2 (1)');
|
||||
await testUrlContains(expectNestedTabUrlToContain);
|
||||
|
||||
@@ -37,7 +37,7 @@ export interface LifeCycleCount {
|
||||
}
|
||||
|
||||
export function handleErrorMessages() {
|
||||
return browser.manage().logs().get('browser').then(browserLog => {
|
||||
return browser.manage().logs().get('browser').then(function (browserLog) {
|
||||
for (let i = 0; i <= browserLog.length - 1; i++) {
|
||||
if (browserLog[i].level.name_ === 'SEVERE') {
|
||||
fail(browserLog[i].message);
|
||||
|
||||
@@ -26,12 +26,6 @@ module.exports = function (config) {
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
customLaunchers: {
|
||||
ChromeHeadlessCI: {
|
||||
base: 'ChromeHeadless',
|
||||
flags: ['--no-sandbox']
|
||||
}
|
||||
},
|
||||
singleRun: false,
|
||||
restartOnFileChange: true
|
||||
});
|
||||
|
||||
14734
angular/test/test-app/package-lock.json
generated
14734
angular/test/test-app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -18,49 +18,46 @@
|
||||
"prerender": "ng run test-app:prerender"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "^9.1.12",
|
||||
"@angular/common": "^9.1.12",
|
||||
"@angular/compiler": "^9.1.12",
|
||||
"@angular/core": "^9.1.12",
|
||||
"@angular/forms": "^9.1.12",
|
||||
"@angular/platform-browser": "^9.1.12",
|
||||
"@angular/platform-browser-dynamic": "^9.1.12",
|
||||
"@angular/platform-server": "^9.1.12",
|
||||
"@angular/router": "^9.1.12",
|
||||
"@ionic/angular": "^5.3.1",
|
||||
"@ionic/angular-server": "^5.3.1",
|
||||
"@angular/animations": "^9.0.0-rc.2",
|
||||
"@angular/common": "^9.0.0-rc.2",
|
||||
"@angular/compiler": "^9.0.0-rc.2",
|
||||
"@angular/core": "^9.0.0-rc.2",
|
||||
"@angular/forms": "^9.0.0-rc.2",
|
||||
"@angular/platform-browser": "^9.0.0-rc.2",
|
||||
"@angular/platform-browser-dynamic": "^9.0.0-rc.2",
|
||||
"@angular/platform-server": "^9.0.0-rc.2",
|
||||
"@angular/router": "^9.0.0-rc.2",
|
||||
"@ionic/angular": "^4.7.0",
|
||||
"@ionic/angular-server": "^0.0.2",
|
||||
"@nguniversal/express-engine": "9.0.0-next.9",
|
||||
"angular-in-memory-web-api": "^0.11.0",
|
||||
"core-js": "^2.6.11",
|
||||
"core-js": "^2.6.2",
|
||||
"express": "^4.15.2",
|
||||
"jasmine-marbles": "^0.6.0",
|
||||
"rxjs": "^6.5.5",
|
||||
"tslib": "^1.13.0",
|
||||
"zone.js": "^0.10.3"
|
||||
"rxjs": "^6.5.3",
|
||||
"tslib": "^1.10.0",
|
||||
"zone.js": "~0.10.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^0.901.12",
|
||||
"@angular/cli": "^9.1.12",
|
||||
"@angular/compiler-cli": "^9.1.12",
|
||||
"@angular/language-service": "^9.1.12",
|
||||
"@angular-devkit/build-angular": "~0.900.0-rc.2",
|
||||
"@angular/cli": "^9.0.0-rc.2",
|
||||
"@angular/compiler-cli": "^9.0.0-rc.2",
|
||||
"@angular/language-service": "^9.0.0-rc.2",
|
||||
"@nguniversal/builders": "9.0.0-next.9",
|
||||
"@types/express": "^4.17.7",
|
||||
"@types/jasmine": "^3.5.13",
|
||||
"@types/jasminewd2": "^2.0.8",
|
||||
"@types/node": "^12.12.54",
|
||||
"codelyzer": "^5.2.2",
|
||||
"jasmine-core": "^3.5.0",
|
||||
"jasmine-spec-reporter": "^4.2.1",
|
||||
"karma": "^4.4.1",
|
||||
"karma-chrome-launcher": "^3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "^2.1.1",
|
||||
"karma-jasmine": "^3.0.3",
|
||||
"karma-jasmine-html-reporter": "^1.5.4",
|
||||
"protractor": "^5.4.4",
|
||||
"ts-loader": "^6.2.2",
|
||||
"ts-node": "^8.3.0",
|
||||
"tslint": "^6.1.3",
|
||||
"typescript": "^3.8.3",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"@types/express": "^4.17.0",
|
||||
"@types/jasmine": "3.4.1",
|
||||
"@types/node": "^12.11.1",
|
||||
"codelyzer": "^5.1.2",
|
||||
"jasmine-core": "~3.5.0",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~4.3.0",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "~2.1.0",
|
||||
"karma-jasmine": "~2.0.1",
|
||||
"karma-jasmine-html-reporter": "^1.4.2",
|
||||
"protractor": "~5.4.2",
|
||||
"ts-loader": "^6.1.2",
|
||||
"ts-node": "8.4.1",
|
||||
"tslint": "~5.18.0",
|
||||
"typescript": "~3.6.4",
|
||||
"webpack-cli": "^3.3.9"
|
||||
}
|
||||
}
|
||||
|
||||
1
core/.npmrc
Normal file
1
core/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
package-lock=false
|
||||
121
core/CONTRIBUTING.md
Normal file
121
core/CONTRIBUTING.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# Contribution guide
|
||||
|
||||
## Contribute to Ionic Core
|
||||
|
||||
Ionic Core is the fundation of Ionic v4. It's based in [Stencil](https://stenciljs.com) and consist in a set of web components a long of JS and CSS utils.
|
||||
|
||||
|
||||
### Installing dependencies
|
||||
|
||||
Before you can build ionic, we assume the following list of software is already installed in your system
|
||||
|
||||
- Git
|
||||
- Node 8 or higher
|
||||
- Npm 6.0 or higher
|
||||
|
||||
|
||||
### Fork repository
|
||||
|
||||
In order to contributo to Ionic, you must have a github account so you can push code and create a new Pull Request (PR).
|
||||
|
||||
Once you are all setup, following the Github's guide of how to fork a repository: https://guides.github.com/activities/forking/
|
||||
|
||||
|
||||
### Build Ionic Core
|
||||
|
||||
```bash
|
||||
# Clone your Github repository:
|
||||
git clone https://github.com/<github username>/ionic.git
|
||||
|
||||
# Go to the core directory:
|
||||
cd ionic/core
|
||||
|
||||
# Install npm dependencies
|
||||
npm install
|
||||
|
||||
# Run Ionic dev server
|
||||
npm start
|
||||
```
|
||||
|
||||
### Development Workflow
|
||||
|
||||
#### 1. Run Dev Server
|
||||
|
||||
```bash
|
||||
# Move to the core folder
|
||||
cd core
|
||||
|
||||
# Run dev server
|
||||
npm start
|
||||
```
|
||||
|
||||
You should be able to navigate to `http://localhost:3333` which will look like a file browser.
|
||||
|
||||
E2E tests are located inside the `src/components` folder, in the following way: `http://localhost:3333/src/components/{COMPONENT}/test/`
|
||||
|
||||
|
||||
**Path examples:**
|
||||
|
||||
- ActionSheet basic test: http://localhost:3333/src/components/action-sheet/test/basic
|
||||
- Nav basic test: http://localhost:3333/src/components/nav/test/basic
|
||||
- Button basic test:
|
||||
http://localhost:3333/src/components/button/test/basic
|
||||
|
||||
|
||||
**IMPORTANT**
|
||||
|
||||
Leave the dev server running in the background while you make changes. The dev server listen for changes and automatically recompile Ionic for you.
|
||||
|
||||
|
||||
|
||||
#### 2. Open `core` folder in your IDE
|
||||
|
||||
Components implementations live inside the `core/src/components` folder.
|
||||
|
||||
You can find each ionic component inside their directory.
|
||||
|
||||
|
||||
#### 3. Run test suite
|
||||
|
||||
Before commiting your changes make sure tests are passing:
|
||||
|
||||
```
|
||||
npm run validate
|
||||
```
|
||||
|
||||
#### 4. Create a branch and commit
|
||||
|
||||
```bash
|
||||
# Create a git branch
|
||||
git checkout -b my-improvement
|
||||
|
||||
# Add changes
|
||||
git add .
|
||||
|
||||
# Create commit
|
||||
git commit -m "fix(component): message"
|
||||
```
|
||||
|
||||
Create a PR:
|
||||
https://guides.github.com/activities/forking/
|
||||
|
||||
|
||||
### Summary
|
||||
|
||||
```bash
|
||||
# Clone repo
|
||||
git clone git@github.com:ionic-team/ionic.git
|
||||
|
||||
# Move to ionic/core folder
|
||||
cd ionic/core
|
||||
|
||||
# Install npm dependencies
|
||||
npm i
|
||||
|
||||
# Run dev server
|
||||
npm start
|
||||
|
||||
# Run test suite
|
||||
npm run validate
|
||||
```
|
||||
|
||||
23
core/api.txt
23
core/api.txt
@@ -475,13 +475,13 @@ ion-input,prop,required,boolean,false,false,false
|
||||
ion-input,prop,size,number | undefined,undefined,false,false
|
||||
ion-input,prop,spellcheck,boolean,false,false,false
|
||||
ion-input,prop,step,string | undefined,undefined,false,false
|
||||
ion-input,prop,type,"date" | "datetime-local" | "email" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week",'text',false,false
|
||||
ion-input,prop,type,"date" | "email" | "number" | "password" | "search" | "tel" | "text" | "time" | "url",'text',false,false
|
||||
ion-input,prop,value,null | number | string | undefined,'',false,false
|
||||
ion-input,method,getInputElement,getInputElement() => Promise<HTMLInputElement>
|
||||
ion-input,method,setFocus,setFocus() => Promise<void>
|
||||
ion-input,event,ionBlur,FocusEvent,true
|
||||
ion-input,event,ionBlur,void,true
|
||||
ion-input,event,ionChange,InputChangeEventDetail,true
|
||||
ion-input,event,ionFocus,FocusEvent,true
|
||||
ion-input,event,ionFocus,void,true
|
||||
ion-input,event,ionInput,KeyboardEvent,true
|
||||
ion-input,css-prop,--background
|
||||
ion-input,css-prop,--color
|
||||
@@ -745,13 +745,13 @@ ion-nav,method,getActive,getActive() => Promise<ViewController | undefined>
|
||||
ion-nav,method,getByIndex,getByIndex(index: number) => Promise<ViewController | undefined>
|
||||
ion-nav,method,getPrevious,getPrevious(view?: ViewController | undefined) => Promise<ViewController | undefined>
|
||||
ion-nav,method,insert,insert<T extends NavComponent>(insertIndex: number, component: T, componentProps?: ComponentProps<T> | null | undefined, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,insertPages,insertPages(insertIndex: number, insertComponents: NavComponent[] | NavComponentWithProps[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,insertPages,insertPages(insertIndex: number, insertComponents: NavComponent[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,pop,pop(opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,popTo,popTo(indexOrViewCtrl: number | ViewController, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,popToRoot,popToRoot(opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,push,push<T extends NavComponent>(component: T, componentProps?: ComponentProps<T> | null | undefined, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,removeIndex,removeIndex(startIndex: number, removeCount?: number, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,setPages,setPages(views: NavComponent[] | NavComponentWithProps[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,setPages,setPages(views: any[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,method,setRoot,setRoot<T extends NavComponent>(component: T, componentProps?: ComponentProps<T> | null | undefined, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>
|
||||
ion-nav,event,ionNavDidChange,void,false
|
||||
ion-nav,event,ionNavWillChange,void,false
|
||||
@@ -933,8 +933,6 @@ ion-ripple-effect,prop,type,"bounded" | "unbounded",'bounded',false,false
|
||||
ion-ripple-effect,method,addRipple,addRipple(x: number, y: number) => Promise<() => void>
|
||||
|
||||
ion-route,none
|
||||
ion-route,prop,beforeEnter,(() => boolean | NavigationHookOptions | Promise<NavigationHookResult>) | undefined,undefined,false,false
|
||||
ion-route,prop,beforeLeave,(() => boolean | NavigationHookOptions | Promise<NavigationHookResult>) | undefined,undefined,false,false
|
||||
ion-route,prop,component,string,undefined,true,false
|
||||
ion-route,prop,componentProps,undefined | { [key: string]: any; },undefined,false,false
|
||||
ion-route,prop,url,string,'',false,false
|
||||
@@ -1053,7 +1051,6 @@ ion-segment-button,css-prop,--padding-start
|
||||
ion-segment-button,css-prop,--padding-top
|
||||
ion-segment-button,css-prop,--transition
|
||||
ion-segment-button,part,indicator
|
||||
ion-segment-button,part,indicator-background
|
||||
ion-segment-button,part,native
|
||||
|
||||
ion-select,shadow
|
||||
@@ -1072,7 +1069,7 @@ ion-select,prop,value,any,undefined,false,false
|
||||
ion-select,method,open,open(event?: UIEvent | undefined) => Promise<any>
|
||||
ion-select,event,ionBlur,void,true
|
||||
ion-select,event,ionCancel,void,true
|
||||
ion-select,event,ionChange,SelectChangeEventDetail<any>,true
|
||||
ion-select,event,ionChange,SelectChangeEventDetail,true
|
||||
ion-select,event,ionFocus,void,true
|
||||
ion-select,css-prop,--padding-bottom
|
||||
ion-select,css-prop,--padding-end
|
||||
@@ -1229,9 +1226,9 @@ ion-textarea,prop,value,null | string | undefined,'',false,false
|
||||
ion-textarea,prop,wrap,"hard" | "off" | "soft" | undefined,undefined,false,false
|
||||
ion-textarea,method,getInputElement,getInputElement() => Promise<HTMLTextAreaElement>
|
||||
ion-textarea,method,setFocus,setFocus() => Promise<void>
|
||||
ion-textarea,event,ionBlur,FocusEvent,true
|
||||
ion-textarea,event,ionBlur,void,true
|
||||
ion-textarea,event,ionChange,TextareaChangeEventDetail,true
|
||||
ion-textarea,event,ionFocus,FocusEvent,true
|
||||
ion-textarea,event,ionFocus,void,true
|
||||
ion-textarea,event,ionInput,KeyboardEvent,true
|
||||
ion-textarea,css-prop,--background
|
||||
ion-textarea,css-prop,--border-radius
|
||||
@@ -1293,10 +1290,6 @@ ion-toast,css-prop,--min-width
|
||||
ion-toast,css-prop,--start
|
||||
ion-toast,css-prop,--white-space
|
||||
ion-toast,css-prop,--width
|
||||
ion-toast,part,button
|
||||
ion-toast,part,container
|
||||
ion-toast,part,header
|
||||
ion-toast,part,message
|
||||
|
||||
ion-toggle,shadow
|
||||
ion-toggle,prop,checked,boolean,false,false,false
|
||||
|
||||
12260
core/package-lock.json
generated
12260
core/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ionic/core",
|
||||
"version": "5.3.2",
|
||||
"version": "5.2.1",
|
||||
"description": "Base components for Ionic",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
@@ -30,38 +30,38 @@
|
||||
"loader/"
|
||||
],
|
||||
"dependencies": {
|
||||
"ionicons": "^5.1.2",
|
||||
"ionicons": "^5.0.1",
|
||||
"tslib": "^1.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-node-resolve": "^8.4.0",
|
||||
"@rollup/plugin-virtual": "^2.0.3",
|
||||
"@stencil/core": "1.17.3",
|
||||
"@stencil/sass": "1.3.2",
|
||||
"@types/jest": "^26.0.10",
|
||||
"@types/node": "^14.6.0",
|
||||
"@types/puppeteer": "3.0.1",
|
||||
"@types/swiper": "5.4.0",
|
||||
"aws-sdk": "^2.738.0",
|
||||
"@stencil/core": "1.14.0",
|
||||
"@stencil/sass": "1.3.1",
|
||||
"@types/jest": "24.9.1",
|
||||
"@types/node": "12.12.3",
|
||||
"@types/puppeteer": "1.19.1",
|
||||
"@types/swiper": "5.3.1",
|
||||
"aws-sdk": "^2.497.0",
|
||||
"clean-css-cli": "^4.1.11",
|
||||
"domino": "^2.1.6",
|
||||
"fs-extra": "^9.0.1",
|
||||
"jest": "^26.4.1",
|
||||
"jest-cli": "^26.4.1",
|
||||
"np": "^6.4.0",
|
||||
"domino": "^2.1.3",
|
||||
"fs-extra": "^8.0.1",
|
||||
"jest": "24.9.0",
|
||||
"jest-cli": "24.9.0",
|
||||
"np": "^5.0.3",
|
||||
"pixelmatch": "4.0.2",
|
||||
"puppeteer": "^5.2.1",
|
||||
"rollup": "^2.26.4",
|
||||
"sass": "^1.26.10",
|
||||
"stylelint": "^13.6.1",
|
||||
"stylelint-order": "^4.1.0",
|
||||
"puppeteer": "1.20.0",
|
||||
"rollup": "1.32.0",
|
||||
"rollup-plugin-node-resolve": "5.2.0",
|
||||
"rollup-plugin-virtual": "^1.0.1",
|
||||
"sass": "^1.22.9",
|
||||
"stylelint": "10.1.0",
|
||||
"stylelint-order": "3.0.1",
|
||||
"swiper": "5.4.1",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint": "^5.10.0",
|
||||
"tslint-ionic-rules": "0.0.21",
|
||||
"tslint-react": "^5.0.0"
|
||||
"tslint-react": "^3.6.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run clean && npm run build.css && npm run build.vendor && stencil build --docs --es5 && npm run cdnloader",
|
||||
"build": "npm run clean && npm run build.css && npm run build.vendor && stencil build --docs && npm run cdnloader",
|
||||
"build.vendor": "rollup --config ./scripts/swiper.rollup.config.js",
|
||||
"build.css": "npm run css.sass && npm run css.minify",
|
||||
"build.debug": "npm run clean && stencil build --debug",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
|
||||
export default {
|
||||
input: 'src/components/slides/swiper/swiper.js',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
const path = require('path');
|
||||
const { rollup } = require('rollup');
|
||||
const virtual = require('@rollup/plugin-virtual');
|
||||
const virtual = require('rollup-plugin-virtual');
|
||||
const fs = require('fs');
|
||||
|
||||
function main() {
|
||||
|
||||
50
core/src/components.d.ts
vendored
50
core/src/components.d.ts
vendored
@@ -5,9 +5,8 @@
|
||||
* It contains typing information for all components that exist in this project.
|
||||
*/
|
||||
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
|
||||
import { ActionSheetButton, AlertButton, AlertInput, AnimationBuilder, AutocompleteTypes, CheckboxChangeEventDetail, Color, ComponentProps, ComponentRef, DatetimeChangeEventDetail, DatetimeOptions, DomRenderFn, FooterHeightFn, FrameworkDelegate, HeaderFn, HeaderHeightFn, InputChangeEventDetail, ItemHeightFn, ItemRenderFn, ItemReorderEventDetail, MenuChangeEventDetail, NavComponent, NavComponentWithProps, NavOptions, OverlayEventDetail, PickerButton, PickerColumn, RadioGroupChangeEventDetail, RangeChangeEventDetail, RangeValue, RefresherEventDetail, RouteID, RouterDirection, RouterEventDetail, RouterOutletOptions, RouteWrite, ScrollBaseDetail, ScrollDetail, SearchbarChangeEventDetail, SegmentButtonLayout, SegmentChangeEventDetail, SelectChangeEventDetail, SelectInterface, SelectPopoverOption, Side, SpinnerTypes, StyleEventDetail, SwipeGestureHandler, TabBarChangedEventDetail, TabButtonClickEventDetail, TabButtonLayout, TextareaChangeEventDetail, TextFieldTypes, ToastButton, ToggleChangeEventDetail, TransitionDoneFn, TransitionInstruction, ViewController } from "./interface";
|
||||
import { ActionSheetButton, AlertButton, AlertInput, AnimationBuilder, AutocompleteTypes, CheckboxChangeEventDetail, Color, ComponentProps, ComponentRef, DatetimeChangeEventDetail, DatetimeOptions, DomRenderFn, FooterHeightFn, FrameworkDelegate, HeaderFn, HeaderHeightFn, InputChangeEventDetail, ItemHeightFn, ItemRenderFn, ItemReorderEventDetail, MenuChangeEventDetail, NavComponent, NavOptions, OverlayEventDetail, PickerButton, PickerColumn, RadioGroupChangeEventDetail, RangeChangeEventDetail, RangeValue, RefresherEventDetail, RouteID, RouterDirection, RouterEventDetail, RouterOutletOptions, RouteWrite, ScrollBaseDetail, ScrollDetail, SearchbarChangeEventDetail, SegmentButtonLayout, SegmentChangeEventDetail, SelectChangeEventDetail, SelectInterface, SelectPopoverOption, Side, SpinnerTypes, StyleEventDetail, SwipeGestureHandler, TabBarChangedEventDetail, TabButtonClickEventDetail, TabButtonLayout, TextareaChangeEventDetail, TextFieldTypes, ToastButton, ToggleChangeEventDetail, TransitionDoneFn, TransitionInstruction, ViewController } from "./interface";
|
||||
import { IonicSafeString } from "./utils/sanitization";
|
||||
import { NavigationHookCallback } from "./components/route/route-interface";
|
||||
import { SelectCompareFn } from "./components/select/select-interface";
|
||||
export namespace Components {
|
||||
interface IonActionSheet {
|
||||
@@ -869,10 +868,6 @@ export namespace Components {
|
||||
* A hint to the browser for which enter key to display. Possible values: `"enter"`, `"done"`, `"go"`, `"next"`, `"previous"`, `"search"`, and `"send"`.
|
||||
*/
|
||||
"enterkeyhint"?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
||||
/**
|
||||
* This is required for a WebKit bug which requires us to blur and focus an input to properly focus the input in an item with delegatesFocus. It will no longer be needed with iOS 14.
|
||||
*/
|
||||
"fireFocusEvents": boolean;
|
||||
/**
|
||||
* Returns the native `<input>` element used under the hood.
|
||||
*/
|
||||
@@ -926,11 +921,7 @@ export namespace Components {
|
||||
*/
|
||||
"required": boolean;
|
||||
/**
|
||||
* Sets blur on the native `input` in `ion-input`. Use this method instead of the global `input.blur()`.
|
||||
*/
|
||||
"setBlur": () => Promise<void>;
|
||||
/**
|
||||
* Sets focus on the native `input` in `ion-input`. Use this method instead of the global `input.focus()`.
|
||||
* Sets focus on the specified `ion-input`. Use this method instead of the global `input.focus()`.
|
||||
*/
|
||||
"setFocus": () => Promise<void>;
|
||||
/**
|
||||
@@ -1421,7 +1412,7 @@ export namespace Components {
|
||||
* @param opts The navigation options.
|
||||
* @param done The transition complete function.
|
||||
*/
|
||||
"insertPages": (insertIndex: number, insertComponents: NavComponent[] | NavComponentWithProps[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>;
|
||||
"insertPages": (insertIndex: number, insertComponents: NavComponent[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>;
|
||||
/**
|
||||
* Pop a component off of the navigation stack. Navigates back from the current component.
|
||||
* @param opts The navigation options.
|
||||
@@ -1471,7 +1462,7 @@ export namespace Components {
|
||||
* @param opts The navigation options.
|
||||
* @param done The transition complete function.
|
||||
*/
|
||||
"setPages": (views: NavComponent[] | NavComponentWithProps[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>;
|
||||
"setPages": (views: any[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>;
|
||||
/**
|
||||
* Set the root for the current navigation stack to a component.
|
||||
* @param component The component to set as the root of the navigation stack.
|
||||
@@ -1858,14 +1849,6 @@ export namespace Components {
|
||||
"type": 'bounded' | 'unbounded';
|
||||
}
|
||||
interface IonRoute {
|
||||
/**
|
||||
* A navigation hook that is fired when the route tries to enter. Returning `true` allows the navigation to proceed, while returning `false` causes it to be cancelled. Returning a `NavigationHookOptions` object causes the router to redirect to the path specified.
|
||||
*/
|
||||
"beforeEnter"?: NavigationHookCallback;
|
||||
/**
|
||||
* A navigation hook that is fired when the route tries to leave. Returning `true` allows the navigation to proceed, while returning `false` causes it to be cancelled. Returning a `NavigationHookOptions` object causes the router to redirect to the path specified.
|
||||
*/
|
||||
"beforeLeave"?: NavigationHookCallback;
|
||||
/**
|
||||
* Name of the component to load/select in the navigation outlet (`ion-tabs`, `ion-nav`) when the route matches. The value of this property is not always the tagname of the component to load, in `ion-tabs` it actually refers to the name of the `ion-tab` to select.
|
||||
*/
|
||||
@@ -1894,7 +1877,6 @@ export namespace Components {
|
||||
* Go back to previous page in the window.history.
|
||||
*/
|
||||
"back": () => Promise<void>;
|
||||
"canTransition": () => Promise<string | boolean>;
|
||||
"navChanged": (direction: RouterDirection) => Promise<boolean>;
|
||||
"printDebug": () => Promise<void>;
|
||||
/**
|
||||
@@ -2142,7 +2124,7 @@ export namespace Components {
|
||||
}
|
||||
interface IonSelectOption {
|
||||
/**
|
||||
* If `true`, the user cannot interact with the select option. This property does not apply when `interface="action-sheet"` as `ion-action-sheet` does not allow for disabled buttons.
|
||||
* If `true`, the user cannot interact with the select option.
|
||||
*/
|
||||
"disabled": boolean;
|
||||
/**
|
||||
@@ -4198,10 +4180,6 @@ declare namespace LocalJSX {
|
||||
* A hint to the browser for which enter key to display. Possible values: `"enter"`, `"done"`, `"go"`, `"next"`, `"previous"`, `"search"`, and `"send"`.
|
||||
*/
|
||||
"enterkeyhint"?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
||||
/**
|
||||
* This is required for a WebKit bug which requires us to blur and focus an input to properly focus the input in an item with delegatesFocus. It will no longer be needed with iOS 14.
|
||||
*/
|
||||
"fireFocusEvents"?: boolean;
|
||||
/**
|
||||
* A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
|
||||
*/
|
||||
@@ -4237,7 +4215,7 @@ declare namespace LocalJSX {
|
||||
/**
|
||||
* Emitted when the input loses focus.
|
||||
*/
|
||||
"onIonBlur"?: (event: CustomEvent<FocusEvent>) => void;
|
||||
"onIonBlur"?: (event: CustomEvent<void>) => void;
|
||||
/**
|
||||
* Emitted when the value has changed.
|
||||
*/
|
||||
@@ -4245,7 +4223,7 @@ declare namespace LocalJSX {
|
||||
/**
|
||||
* Emitted when the input has focus.
|
||||
*/
|
||||
"onIonFocus"?: (event: CustomEvent<FocusEvent>) => void;
|
||||
"onIonFocus"?: (event: CustomEvent<void>) => void;
|
||||
/**
|
||||
* Emitted when a keyboard input occurred.
|
||||
*/
|
||||
@@ -5117,14 +5095,6 @@ declare namespace LocalJSX {
|
||||
"type"?: 'bounded' | 'unbounded';
|
||||
}
|
||||
interface IonRoute {
|
||||
/**
|
||||
* A navigation hook that is fired when the route tries to enter. Returning `true` allows the navigation to proceed, while returning `false` causes it to be cancelled. Returning a `NavigationHookOptions` object causes the router to redirect to the path specified.
|
||||
*/
|
||||
"beforeEnter"?: NavigationHookCallback;
|
||||
/**
|
||||
* A navigation hook that is fired when the route tries to leave. Returning `true` allows the navigation to proceed, while returning `false` causes it to be cancelled. Returning a `NavigationHookOptions` object causes the router to redirect to the path specified.
|
||||
*/
|
||||
"beforeLeave"?: NavigationHookCallback;
|
||||
/**
|
||||
* Name of the component to load/select in the navigation outlet (`ion-tabs`, `ion-nav`) when the route matches. The value of this property is not always the tagname of the component to load, in `ion-tabs` it actually refers to the name of the `ion-tab` to select.
|
||||
*/
|
||||
@@ -5451,7 +5421,7 @@ declare namespace LocalJSX {
|
||||
}
|
||||
interface IonSelectOption {
|
||||
/**
|
||||
* If `true`, the user cannot interact with the select option. This property does not apply when `interface="action-sheet"` as `ion-action-sheet` does not allow for disabled buttons.
|
||||
* If `true`, the user cannot interact with the select option.
|
||||
*/
|
||||
"disabled"?: boolean;
|
||||
/**
|
||||
@@ -5761,7 +5731,7 @@ declare namespace LocalJSX {
|
||||
/**
|
||||
* Emitted when the input loses focus.
|
||||
*/
|
||||
"onIonBlur"?: (event: CustomEvent<FocusEvent>) => void;
|
||||
"onIonBlur"?: (event: CustomEvent<void>) => void;
|
||||
/**
|
||||
* Emitted when the input value has changed.
|
||||
*/
|
||||
@@ -5769,7 +5739,7 @@ declare namespace LocalJSX {
|
||||
/**
|
||||
* Emitted when the input has focus.
|
||||
*/
|
||||
"onIonFocus"?: (event: CustomEvent<FocusEvent>) => void;
|
||||
"onIonFocus"?: (event: CustomEvent<void>) => void;
|
||||
/**
|
||||
* Emitted when a keyboard input occurred.
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,6 @@ import { mdLeaveAnimation } from './animations/md.leave';
|
||||
export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
|
||||
presented = false;
|
||||
lastFocus?: HTMLElement;
|
||||
animation?: any;
|
||||
private wrapperEl?: HTMLElement;
|
||||
private groupEl?: HTMLElement;
|
||||
@@ -118,7 +117,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
return present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
constructor() {
|
||||
prepareOverlay(this.el);
|
||||
}
|
||||
|
||||
@@ -198,7 +197,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
componentDidUnload() {
|
||||
if (this.gesture) {
|
||||
this.gesture.destroy();
|
||||
this.gesture = undefined;
|
||||
@@ -251,10 +250,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
onIonBackdropTap={this.onBackdropTap}
|
||||
>
|
||||
<ion-backdrop tappable={this.backdropDismiss}/>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
|
||||
<div class="action-sheet-wrapper ion-overlay-wrapper" role="dialog" ref={el => this.wrapperEl = el}>
|
||||
<div class="action-sheet-wrapper" role="dialog" ref={el => this.wrapperEl = el}>
|
||||
<div class="action-sheet-container">
|
||||
<div class="action-sheet-group" ref={el => this.groupEl = el}>
|
||||
{this.header !== undefined &&
|
||||
@@ -296,8 +292,6 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,40 +1,6 @@
|
||||
import { testActionSheet, testActionSheetAlert, testActionSheetBackdrop } from '../test.utils';
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
const DIRECTORY = 'basic';
|
||||
const getActiveElementText = async (page) => {
|
||||
const activeElement = await page.evaluateHandle(() => document.activeElement);
|
||||
return await page.evaluate(el => el && el.textContent, activeElement);
|
||||
}
|
||||
|
||||
test('action-sheet: focus trap', async () => {
|
||||
const page = await newE2EPage({ url: '/src/components/action-sheet/test/basic?ionic:_testing=true' });
|
||||
|
||||
await page.click('#basic');
|
||||
await page.waitForSelector('#basic');
|
||||
|
||||
let actionSheet = await page.find('ion-action-sheet');
|
||||
|
||||
expect(actionSheet).not.toBe(null);
|
||||
await actionSheet.waitForVisible();
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementText = await getActiveElementText(page);
|
||||
expect(activeElementText).toEqual('Delete');
|
||||
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.keyboard.up('Shift');
|
||||
|
||||
const activeElementTextTwo = await getActiveElementText(page);
|
||||
expect(activeElementTextTwo).toEqual('Cancel');
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementTextThree = await getActiveElementText(page);
|
||||
expect(activeElementTextThree).toEqual('Delete');
|
||||
});
|
||||
|
||||
test('action-sheet: basic', async () => {
|
||||
await testActionSheet(DIRECTORY, '#basic');
|
||||
|
||||
@@ -34,7 +34,6 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
private gesture?: Gesture;
|
||||
|
||||
presented = false;
|
||||
lastFocus?: HTMLElement;
|
||||
|
||||
@Element() el!: HTMLIonAlertElement;
|
||||
|
||||
@@ -168,7 +167,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
}) as AlertInput);
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
constructor() {
|
||||
prepareOverlay(this.el);
|
||||
}
|
||||
|
||||
@@ -177,7 +176,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
this.buttonsChanged();
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
componentDidUnload() {
|
||||
if (this.gesture) {
|
||||
this.gesture.destroy();
|
||||
this.gesture = undefined;
|
||||
@@ -515,9 +514,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
|
||||
<ion-backdrop tappable={this.backdropDismiss}/>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
|
||||
<div class="alert-wrapper ion-overlay-wrapper" ref={el => this.wrapperEl = el}>
|
||||
<div class="alert-wrapper" ref={el => this.wrapperEl = el}>
|
||||
|
||||
<div class="alert-head">
|
||||
{header && <h2 id={hdrId} class="alert-title">{header}</h2>}
|
||||
@@ -530,8 +527,6 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
||||
{this.renderAlertButtons()}
|
||||
|
||||
</div>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,40 +1,6 @@
|
||||
import { testAlert } from '../test.utils';
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
const DIRECTORY = 'basic';
|
||||
const getActiveElementText = async (page) => {
|
||||
const activeElement = await page.evaluateHandle(() => document.activeElement);
|
||||
return await page.evaluate(el => el && el.textContent, activeElement);
|
||||
}
|
||||
|
||||
test('alert: focus trap', async () => {
|
||||
const page = await newE2EPage({ url: '/src/components/alert/test/basic?ionic:_testing=true' });
|
||||
|
||||
await page.click('#multipleButtons');
|
||||
await page.waitForSelector('#multipleButtons');
|
||||
|
||||
let alert = await page.find('ion-alert');
|
||||
|
||||
expect(alert).not.toBe(null);
|
||||
await alert.waitForVisible();
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementText = await getActiveElementText(page);
|
||||
expect(activeElementText).toEqual('Open Modal');
|
||||
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.keyboard.up('Shift');
|
||||
|
||||
const activeElementTextTwo = await getActiveElementText(page);
|
||||
expect(activeElementTextTwo).toEqual('Cancel');
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementTextThree = await getActiveElementText(page);
|
||||
expect(activeElementTextThree).toEqual('Open Modal');
|
||||
});
|
||||
|
||||
test(`alert: basic`, async () => {
|
||||
await testAlert(DIRECTORY, '#basic');
|
||||
|
||||
@@ -40,7 +40,7 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
/**
|
||||
* If `true`, the user cannot interact with the button.
|
||||
*/
|
||||
@Prop({ reflect: true }) disabled = false;
|
||||
@Prop({ reflectToAttr: true }) disabled = false;
|
||||
|
||||
/**
|
||||
* The icon name to use for the back button.
|
||||
@@ -122,8 +122,10 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
return (
|
||||
<Host
|
||||
onClick={this.onClick}
|
||||
class={createColorClasses(color, {
|
||||
class={{
|
||||
...createColorClasses(color),
|
||||
[mode]: true,
|
||||
|
||||
'button': true, // ion-buttons target .button
|
||||
'back-button-disabled': disabled,
|
||||
'back-button-has-icon-only': hasIconOnly,
|
||||
@@ -132,7 +134,7 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
'ion-activatable': true,
|
||||
'ion-focusable': true,
|
||||
'show-back-button': showBackButton
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<button
|
||||
type={type}
|
||||
|
||||
@@ -27,9 +27,10 @@ export class Badge implements ComponentInterface {
|
||||
const mode = getIonMode(this);
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<slot></slot>
|
||||
</Host>
|
||||
|
||||
@@ -46,20 +46,20 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
/**
|
||||
* If `true`, the user cannot interact with the button.
|
||||
*/
|
||||
@Prop({ reflect: true }) disabled = false;
|
||||
@Prop({ reflectToAttr: true }) disabled = false;
|
||||
|
||||
/**
|
||||
* Set to `"block"` for a full-width button or to `"full"` for a full-width button
|
||||
* without left and right borders.
|
||||
*/
|
||||
@Prop({ reflect: true }) expand?: 'full' | 'block';
|
||||
@Prop({ reflectToAttr: true }) expand?: 'full' | 'block';
|
||||
|
||||
/**
|
||||
* Set to `"clear"` for a transparent button, to `"outline"` for a transparent
|
||||
* button with a border, or to `"solid"`. The default style is `"solid"` except inside of
|
||||
* a toolbar, where the default is `"clear"`.
|
||||
*/
|
||||
@Prop({ reflect: true, mutable: true }) fill?: 'clear' | 'outline' | 'solid' | 'default';
|
||||
@Prop({ reflectToAttr: true, mutable: true }) fill?: 'clear' | 'outline' | 'solid' | 'default';
|
||||
|
||||
/**
|
||||
* When using a router, it specifies the transition direction when navigating to
|
||||
@@ -96,12 +96,12 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
/**
|
||||
* The button shape.
|
||||
*/
|
||||
@Prop({ reflect: true }) shape?: 'round';
|
||||
@Prop({ reflectToAttr: true }) shape?: 'round';
|
||||
|
||||
/**
|
||||
* The button size.
|
||||
*/
|
||||
@Prop({ reflect: true }) size?: 'small' | 'default' | 'large';
|
||||
@Prop({ reflectToAttr: true }) size?: 'small' | 'default' | 'large';
|
||||
|
||||
/**
|
||||
* If `true`, activates a button with a heavier font weight.
|
||||
@@ -204,7 +204,8 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
<Host
|
||||
onClick={this.handleClick}
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
class={createColorClasses(color, {
|
||||
class={{
|
||||
...createColorClasses(color),
|
||||
[mode]: true,
|
||||
[buttonType]: true,
|
||||
[`${buttonType}-${expand}`]: expand !== undefined,
|
||||
@@ -218,7 +219,7 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
|
||||
'button-disabled': disabled,
|
||||
'ion-activatable': true,
|
||||
'ion-focusable': true,
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<TagType
|
||||
{...attrs}
|
||||
|
||||
@@ -34,11 +34,12 @@ export class CardHeader implements ComponentInterface {
|
||||
const mode = getIonMode(this);
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
'card-header-translucent': this.translucent,
|
||||
'ion-inherit-color': true,
|
||||
[mode]: true
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<slot></slot>
|
||||
</Host>
|
||||
|
||||
@@ -29,10 +29,11 @@ export class CardSubtitle implements ComponentInterface {
|
||||
<Host
|
||||
role="heading"
|
||||
aria-level="3"
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
'ion-inherit-color': true,
|
||||
[mode]: true
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<slot></slot>
|
||||
</Host>
|
||||
|
||||
@@ -29,10 +29,11 @@ export class CardTitle implements ComponentInterface {
|
||||
<Host
|
||||
role="heading"
|
||||
aria-level="2"
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
'ion-inherit-color': true,
|
||||
[mode]: true
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<slot></slot>
|
||||
</Host>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// --------------------------------------------------
|
||||
|
||||
:host {
|
||||
--background: #{$card-ios-background};
|
||||
--color: #{$card-ios-color};
|
||||
--background: #{$item-ios-background};
|
||||
--color: #{$card-ios-text-color};
|
||||
|
||||
@include margin($card-ios-margin-top, $card-ios-margin-end, $card-ios-margin-bottom, $card-ios-margin-start);
|
||||
@include border-radius($card-ios-border-radius);
|
||||
@@ -22,4 +22,4 @@
|
||||
|
||||
:host(.ion-activated) {
|
||||
transform: #{$card-ios-transform-activated};
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,9 @@ $card-ios-margin-bottom: $card-ios-margin-top !default;
|
||||
/// @prop - Margin start of the card
|
||||
$card-ios-margin-start: 16px !default;
|
||||
|
||||
/// @prop - Background color of the card
|
||||
$card-ios-background-color: $item-ios-background !default;
|
||||
|
||||
/// @prop - Box shadow color of the card
|
||||
$card-ios-box-shadow-color: rgba(0, 0, 0, .12) !default;
|
||||
|
||||
@@ -27,8 +30,11 @@ $card-ios-border-radius: 8px !default;
|
||||
/// @prop - Font size of the card
|
||||
$card-ios-font-size: 14px !default;
|
||||
|
||||
/// @prop - Color of the card text
|
||||
$card-ios-text-color: $text-color-step-400 !default;
|
||||
|
||||
/// @prop - Transition timing function of the card
|
||||
$card-ios-transition-timing-function: cubic-bezier(0.12, 0.72, 0.29, 1) !default;
|
||||
|
||||
/// @prop - Transform of the card on activate
|
||||
$card-ios-transform-activated: scale3d(.97, .97, 1) !default;
|
||||
$card-ios-transform-activated: scale3d(.97, .97, 1) !default;
|
||||
@@ -5,8 +5,8 @@
|
||||
// --------------------------------------------------
|
||||
|
||||
:host {
|
||||
--background: #{$card-md-background};
|
||||
--color: #{$card-md-color};
|
||||
--background: #{$item-md-background};
|
||||
--color: #{$card-md-text-color};
|
||||
|
||||
@include margin($card-md-margin-top, $card-md-margin-end, $card-md-margin-bottom, $card-md-margin-start);
|
||||
@include border-radius($card-md-border-radius);
|
||||
|
||||
@@ -15,6 +15,9 @@ $card-md-margin-bottom: 10px !default;
|
||||
/// @prop - Margin start of the card
|
||||
$card-md-margin-start: 10px !default;
|
||||
|
||||
/// @prop - Background color of the card
|
||||
$card-md-background-color: $item-md-background !default;
|
||||
|
||||
/// @prop - Box shadow of the card
|
||||
$card-md-box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12) !default;
|
||||
|
||||
@@ -26,3 +29,6 @@ $card-md-font-size: 14px !default;
|
||||
|
||||
/// @prop - Line height of the card
|
||||
$card-md-line-height: 1.5 !default;
|
||||
|
||||
/// @prop - Color of the card text
|
||||
$card-md-text-color: $text-color-step-450 !default;
|
||||
|
||||
@@ -122,11 +122,13 @@ export class Card implements ComponentInterface, AnchorInterface, ButtonInterfac
|
||||
const mode = getIonMode(this);
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
[mode]: true,
|
||||
|
||||
...createColorClasses(this.color),
|
||||
'card-disabled': this.disabled,
|
||||
'ion-activatable': this.isClickable()
|
||||
})}
|
||||
}}
|
||||
>
|
||||
{this.renderCard(mode)}
|
||||
</Host>
|
||||
|
||||
@@ -155,14 +155,15 @@ export class Checkbox implements ComponentInterface {
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
aria-checked={`${checked}`}
|
||||
aria-labelledby={labelId}
|
||||
class={createColorClasses(color, {
|
||||
class={{
|
||||
...createColorClasses(color),
|
||||
[mode]: true,
|
||||
'in-item': hostContext('ion-item', el),
|
||||
'checkbox-checked': checked,
|
||||
'checkbox-disabled': disabled,
|
||||
'checkbox-indeterminate': indeterminate,
|
||||
'interactive': true
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<svg class="checkbox-icon" viewBox="0 0 24 24" part="container">
|
||||
{path}
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
}
|
||||
|
||||
:host(.chip-outline) {
|
||||
|
||||
border-color: rgba(0, 0, 0, .32);
|
||||
|
||||
background: transparent;
|
||||
|
||||
@@ -33,11 +33,12 @@ export class Chip implements ComponentInterface {
|
||||
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
'chip-outline': this.outline,
|
||||
'ion-activatable': true,
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<slot></slot>
|
||||
{mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
}
|
||||
|
||||
.transition-effect {
|
||||
|
||||
display: none;
|
||||
position: absolute;
|
||||
|
||||
|
||||
@@ -313,11 +313,12 @@ export class Content implements ComponentInterface {
|
||||
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
'content-sizing': hostContext('ion-popover', this.el),
|
||||
'overscroll': forceOverscroll,
|
||||
})}
|
||||
}}
|
||||
style={{
|
||||
'--offset-top': `${this.cTop}px`,
|
||||
'--offset-bottom': `${this.cBottom}px`,
|
||||
|
||||
@@ -632,6 +632,7 @@ export class Datetime implements ComponentInterface {
|
||||
return (
|
||||
<Host
|
||||
onClick={this.onClick}
|
||||
role="combobox"
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
aria-expanded={`${isExpanded}`}
|
||||
aria-haspopup="true"
|
||||
|
||||
@@ -1,42 +1,5 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
const getActiveElementText = async (page) => {
|
||||
const activeElement = await page.evaluateHandle(() => document.activeElement);
|
||||
return await page.evaluate(el => el && el.textContent, activeElement);
|
||||
}
|
||||
|
||||
test('datetime/picker: focus trap', async () => {
|
||||
const page = await newE2EPage({ url: '/src/components/datetime/test/basic?ionic:_testing=true' });
|
||||
|
||||
await page.click('#datetime-part');
|
||||
await page.waitForSelector('#datetime-part');
|
||||
|
||||
let datetime = await page.find('ion-datetime');
|
||||
|
||||
expect(datetime).not.toBe(null);
|
||||
await datetime.waitForVisible();
|
||||
|
||||
// TODO fix
|
||||
await page.waitFor(100);
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementText = await getActiveElementText(page);
|
||||
expect(activeElementText).toEqual('Cancel');
|
||||
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.keyboard.up('Shift');
|
||||
|
||||
const activeElementTextTwo = await getActiveElementText(page);
|
||||
expect(activeElementTextTwo).toEqual('1920');
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementTextThree = await getActiveElementText(page);
|
||||
expect(activeElementTextThree).toEqual('Cancel');
|
||||
});
|
||||
|
||||
test('datetime: basic', async () => {
|
||||
const page = await newE2EPage({
|
||||
url: '/src/components/datetime/test/basic?ionic:_testing=true'
|
||||
|
||||
@@ -142,7 +142,8 @@ export class FabButton implements ComponentInterface, AnchorInterface, ButtonInt
|
||||
return (
|
||||
<Host
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
class={createColorClasses(color, {
|
||||
class={{
|
||||
...createColorClasses(color),
|
||||
[mode]: true,
|
||||
'fab-button-in-list': inList,
|
||||
'fab-button-translucent-in-list': inList && translucent,
|
||||
@@ -153,7 +154,7 @@ export class FabButton implements ComponentInterface, AnchorInterface, ButtonInt
|
||||
'ion-activatable': true,
|
||||
'ion-focusable': true,
|
||||
[`fab-button-${size}`]: size !== undefined,
|
||||
})}
|
||||
}}
|
||||
>
|
||||
|
||||
<TagType
|
||||
|
||||
@@ -49,7 +49,7 @@ export class Header implements ComponentInterface {
|
||||
await this.checkCollapsibleHeader();
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
componentDidUnload() {
|
||||
this.destroyCollapsibleHeader();
|
||||
}
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ export const scaleLargeTitles = (toolbars: ToolbarIndex[] = [], scale = 1, trans
|
||||
const titleDiv = toolbar.innerTitleEl;
|
||||
if (!ionTitle || ionTitle.size !== 'large') { return; }
|
||||
|
||||
titleDiv.style.transformOrigin = 'left center';
|
||||
titleDiv.style.transition = (transition) ? TRANSITION : '';
|
||||
titleDiv.style.transform = `scale3d(${scale}, ${scale}, 1)`;
|
||||
});
|
||||
|
||||
@@ -147,11 +147,7 @@
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.input-clear-icon:focus {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
:host(.has-value) .input-clear-icon {
|
||||
:host(.has-focus.has-value) .input-clear-icon {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,16 +23,6 @@ export class Input implements ComponentInterface {
|
||||
private didBlurAfterEdit = false;
|
||||
private tabindex?: string | number;
|
||||
|
||||
/**
|
||||
* This is required for a WebKit bug which requires us to
|
||||
* blur and focus an input to properly focus the input in
|
||||
* an item with delegatesFocus. It will no longer be needed
|
||||
* with iOS 14.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
@Prop() fireFocusEvents = true;
|
||||
|
||||
@State() hasFocus = false;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
@@ -211,12 +201,12 @@ export class Input implements ComponentInterface {
|
||||
/**
|
||||
* Emitted when the input loses focus.
|
||||
*/
|
||||
@Event() ionBlur!: EventEmitter<FocusEvent>;
|
||||
@Event() ionBlur!: EventEmitter<void>;
|
||||
|
||||
/**
|
||||
* Emitted when the input has focus.
|
||||
*/
|
||||
@Event() ionFocus!: EventEmitter<FocusEvent>;
|
||||
@Event() ionFocus!: EventEmitter<void>;
|
||||
|
||||
/**
|
||||
* Emitted when the styles change.
|
||||
@@ -254,7 +244,7 @@ export class Input implements ComponentInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets focus on the native `input` in `ion-input`. Use this method instead of the global
|
||||
* Sets focus on the specified `ion-input`. Use this method instead of the global
|
||||
* `input.focus()`.
|
||||
*/
|
||||
@Method()
|
||||
@@ -264,18 +254,6 @@ export class Input implements ComponentInterface {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets blur on the native `input` in `ion-input`. Use this method instead of the global
|
||||
* `input.blur()`.
|
||||
* @internal
|
||||
*/
|
||||
@Method()
|
||||
async setBlur() {
|
||||
if (this.nativeInput) {
|
||||
this.nativeInput.blur();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the native `<input>` element used under the hood.
|
||||
*/
|
||||
@@ -315,24 +293,20 @@ export class Input implements ComponentInterface {
|
||||
this.ionInput.emit(ev as KeyboardEvent);
|
||||
}
|
||||
|
||||
private onBlur = (ev: FocusEvent) => {
|
||||
private onBlur = () => {
|
||||
this.hasFocus = false;
|
||||
this.focusChanged();
|
||||
this.emitStyle();
|
||||
|
||||
if (this.fireFocusEvents) {
|
||||
this.ionBlur.emit(ev);
|
||||
}
|
||||
this.ionBlur.emit();
|
||||
}
|
||||
|
||||
private onFocus = (ev: FocusEvent) => {
|
||||
private onFocus = () => {
|
||||
this.hasFocus = true;
|
||||
this.focusChanged();
|
||||
this.emitStyle();
|
||||
|
||||
if (this.fireFocusEvents) {
|
||||
this.ionFocus.emit(ev);
|
||||
}
|
||||
this.ionFocus.emit();
|
||||
}
|
||||
|
||||
private onKeydown = (ev: KeyboardEvent) => {
|
||||
@@ -349,17 +323,10 @@ export class Input implements ComponentInterface {
|
||||
}
|
||||
}
|
||||
|
||||
private clearTextOnEnter = (ev: KeyboardEvent) => {
|
||||
if (ev.key === 'Enter') { this.clearTextInput(ev); }
|
||||
}
|
||||
|
||||
private clearTextInput = (ev?: Event) => {
|
||||
if (this.clearInput && !this.readonly && !this.disabled && ev) {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
|
||||
// Attempt to focus input again after pressing clear button
|
||||
this.setFocus();
|
||||
}
|
||||
|
||||
this.value = '';
|
||||
@@ -397,11 +364,12 @@ export class Input implements ComponentInterface {
|
||||
return (
|
||||
<Host
|
||||
aria-disabled={this.disabled ? 'true' : null}
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
'has-value': this.hasValue(),
|
||||
'has-focus': this.hasFocus
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<input
|
||||
class="native-input"
|
||||
@@ -437,12 +405,11 @@ export class Input implements ComponentInterface {
|
||||
onKeyDown={this.onKeydown}
|
||||
/>
|
||||
{(this.clearInput && !this.readonly && !this.disabled) && <button
|
||||
aria-label="reset"
|
||||
type="button"
|
||||
class="input-clear-icon"
|
||||
tabindex="-1"
|
||||
onTouchStart={this.clearTextInput}
|
||||
onMouseDown={this.clearTextInput}
|
||||
onKeyDown={this.clearTextOnEnter}
|
||||
/>}
|
||||
</Host>
|
||||
);
|
||||
|
||||
@@ -317,7 +317,7 @@ export class InputExample {
|
||||
| `size` | `size` | The initial size of the control. This value is in pixels unless the value of the type attribute is `"text"` or `"password"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `"text"`, `"search"`, `"tel"`, `"url"`, `"email"`, or `"password"`, otherwise it is ignored. | `number \| undefined` | `undefined` |
|
||||
| `spellcheck` | `spellcheck` | If `true`, the element will have its spelling and grammar checked. | `boolean` | `false` |
|
||||
| `step` | `step` | Works with the min and max attributes to limit the increments at which a value can be set. Possible values are: `"any"` or a positive floating point number. | `string \| undefined` | `undefined` |
|
||||
| `type` | `type` | The type of control to display. The default type is text. | `"date" \| "datetime-local" \| "email" \| "month" \| "number" \| "password" \| "search" \| "tel" \| "text" \| "time" \| "url" \| "week"` | `'text'` |
|
||||
| `type` | `type` | The type of control to display. The default type is text. | `"date" \| "email" \| "number" \| "password" \| "search" \| "tel" \| "text" \| "time" \| "url"` | `'text'` |
|
||||
| `value` | `value` | The value of the input. | `null \| number \| string \| undefined` | `''` |
|
||||
|
||||
|
||||
@@ -325,9 +325,9 @@ export class InputExample {
|
||||
|
||||
| Event | Description | Type |
|
||||
| ----------- | --------------------------------------- | ------------------------------------- |
|
||||
| `ionBlur` | Emitted when the input loses focus. | `CustomEvent<FocusEvent>` |
|
||||
| `ionBlur` | Emitted when the input loses focus. | `CustomEvent<void>` |
|
||||
| `ionChange` | Emitted when the value has changed. | `CustomEvent<InputChangeEventDetail>` |
|
||||
| `ionFocus` | Emitted when the input has focus. | `CustomEvent<FocusEvent>` |
|
||||
| `ionFocus` | Emitted when the input has focus. | `CustomEvent<void>` |
|
||||
| `ionInput` | Emitted when a keyboard input occurred. | `CustomEvent<KeyboardEvent>` |
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ Type: `Promise<HTMLInputElement>`
|
||||
|
||||
### `setFocus() => Promise<void>`
|
||||
|
||||
Sets focus on the native `input` in `ion-input`. Use this method instead of the global
|
||||
Sets focus on the specified `ion-input`. Use this method instead of the global
|
||||
`input.focus()`.
|
||||
|
||||
#### Returns
|
||||
|
||||
@@ -136,7 +136,6 @@
|
||||
</ion-content>
|
||||
|
||||
<script>
|
||||
document.querySelector('ion-input').addEventListener('ionBlur', (ev) => { console.log(ev)})
|
||||
function toggleBoolean(id, prop) {
|
||||
var el = document.getElementById(id);
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
<ion-item tabindex="1">
|
||||
<ion-label position="stacked">Tab 1st</ion-label>
|
||||
<ion-input></ion-input>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
</ion-content>
|
||||
|
||||
@@ -70,11 +69,6 @@
|
||||
.md div {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
ion-item {
|
||||
--background: #f6f6f6;
|
||||
--padding-start: 40px;
|
||||
}
|
||||
</style>
|
||||
</ion-app>
|
||||
</body>
|
||||
|
||||
@@ -43,11 +43,12 @@ export class ItemDivider implements ComponentInterface {
|
||||
const mode = getIonMode(this);
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
'item-divider-sticky': this.sticky,
|
||||
'item': true,
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<slot name="start"></slot>
|
||||
<div class="item-divider-inner">
|
||||
|
||||
@@ -100,12 +100,14 @@ export class ItemOption implements ComponentInterface, AnchorInterface, ButtonIn
|
||||
return (
|
||||
<Host
|
||||
onClick={this.onClick}
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
|
||||
'item-option-disabled': disabled,
|
||||
'item-option-expandable': expandable,
|
||||
'ion-activatable': true,
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<TagType
|
||||
{...attrs}
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Component, ComponentInterface, Element, Host, Listen, Prop, State, forc
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { AnimationBuilder, Color, CssClassMap, RouterDirection, StyleEventDetail } from '../../interface';
|
||||
import { AnchorInterface, ButtonInterface } from '../../utils/element-interface';
|
||||
import { raf } from '../../utils/helpers';
|
||||
import { createColorClasses, hostContext, openURL } from '../../utils/theme';
|
||||
|
||||
/**
|
||||
@@ -177,30 +176,6 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac
|
||||
return (this.isClickable() || this.hasCover());
|
||||
}
|
||||
|
||||
private hasInputs(): boolean {
|
||||
const inputs = this.el.querySelectorAll('ion-input');
|
||||
return inputs.length > 0;
|
||||
}
|
||||
|
||||
// This is needed for WebKit due to a delegatesFocus bug where
|
||||
// clicking on the left padding of an item is not focusing the input
|
||||
// but is opening the keyboard. It will no longer be needed with
|
||||
// iOS 14.
|
||||
@Listen('click')
|
||||
delegateFocus() {
|
||||
if (this.hasInputs()) {
|
||||
const input = this.el.querySelector('ion-input');
|
||||
if (input) {
|
||||
input.fireFocusEvents = false;
|
||||
input.setBlur();
|
||||
input.setFocus();
|
||||
raf(() => {
|
||||
input.fireFocusEvents = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { detail, detailIcon, download, lines, disabled, href, rel, target, routerAnimation, routerDirection } = this;
|
||||
const childStyles = {};
|
||||
@@ -226,16 +201,15 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
class={{
|
||||
...childStyles,
|
||||
...createColorClasses(this.color, {
|
||||
'item': true,
|
||||
[mode]: true,
|
||||
[`item-lines-${lines}`]: lines !== undefined,
|
||||
'item-disabled': disabled,
|
||||
'in-list': hostContext('ion-list', this.el),
|
||||
'item-multiple-inputs': this.multipleInputs,
|
||||
'ion-activatable': canActivate,
|
||||
'ion-focusable': true,
|
||||
})
|
||||
...createColorClasses(this.color),
|
||||
'item': true,
|
||||
[mode]: true,
|
||||
[`item-lines-${lines}`]: lines !== undefined,
|
||||
'item-disabled': disabled,
|
||||
'in-list': hostContext('ion-list', this.el),
|
||||
'item-multiple-inputs': this.multipleInputs,
|
||||
'ion-activatable': canActivate,
|
||||
'ion-focusable': true,
|
||||
}}
|
||||
>
|
||||
<TagType
|
||||
|
||||
@@ -179,19 +179,6 @@
|
||||
clickableItem.color = color === undefined ? 'primary' : undefined;
|
||||
});
|
||||
|
||||
const inputs = document.querySelectorAll('ion-input');
|
||||
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
const input = inputs[i];
|
||||
|
||||
input.addEventListener('ionBlur', function() {
|
||||
console.log('Listen ionBlur: fired');
|
||||
});
|
||||
|
||||
input.addEventListener('ionFocus', function() {
|
||||
console.log('Listen ionFocus: fired');
|
||||
});
|
||||
}
|
||||
|
||||
function toggleDisabled() {
|
||||
isDisabled = !isDisabled;
|
||||
|
||||
@@ -13,19 +13,15 @@
|
||||
// Material Design Stacked & Floating Labels
|
||||
// --------------------------------------------------
|
||||
|
||||
/**
|
||||
* When translating the label, we need to use translateY
|
||||
* instead of translate3d due to a WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=215731
|
||||
*/
|
||||
:host(.label-stacked) {
|
||||
@include transform-origin(start, top);
|
||||
@include transform(translateY(50%), scale(.75));
|
||||
@include transform(translate3d(0, 50%, 0), scale(.75));
|
||||
|
||||
transition: color 150ms $label-md-transition-timing-function;
|
||||
}
|
||||
|
||||
:host(.label-floating) {
|
||||
@include transform(translateY(96%));
|
||||
@include transform(translate3d(0, 96%, 0));
|
||||
@include transform-origin(start, top);
|
||||
|
||||
transition:
|
||||
@@ -45,7 +41,7 @@
|
||||
:host-context(.item-has-focus).label-floating,
|
||||
:host-context(.item-has-placeholder).label-floating,
|
||||
:host-context(.item-has-value).label-floating {
|
||||
@include transform(translateY(50%), scale(.75));
|
||||
@include transform(translate3d(0, 50%, 0), scale(.75));
|
||||
}
|
||||
|
||||
:host-context(.item-has-focus).label-stacked,
|
||||
|
||||
@@ -16,8 +16,6 @@ import { createColorClasses } from '../../utils/theme';
|
||||
scoped: true
|
||||
})
|
||||
export class Label implements ComponentInterface {
|
||||
private inRange = false;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
/**
|
||||
@@ -41,7 +39,6 @@ export class Label implements ComponentInterface {
|
||||
@State() noAnimate = false;
|
||||
|
||||
componentWillLoad() {
|
||||
this.inRange = !!this.el.closest('ion-range');
|
||||
this.noAnimate = (this.position === 'floating');
|
||||
this.emitStyle();
|
||||
}
|
||||
@@ -60,17 +57,11 @@ export class Label implements ComponentInterface {
|
||||
}
|
||||
|
||||
private emitStyle() {
|
||||
const { inRange, position } = this;
|
||||
|
||||
// If the label is inside of a range we don't want
|
||||
// to override the classes added by the label that
|
||||
// is a direct child of the item
|
||||
if (!inRange) {
|
||||
this.ionStyle.emit({
|
||||
'label': true,
|
||||
[`label-${position}`]: position !== undefined
|
||||
});
|
||||
}
|
||||
const position = this.position;
|
||||
this.ionStyle.emit({
|
||||
'label': true,
|
||||
[`label-${position}`]: position !== undefined
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -78,11 +69,12 @@ export class Label implements ComponentInterface {
|
||||
const mode = getIonMode(this);
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
[`label-${position}`]: position !== undefined,
|
||||
[`label-no-animate`]: (this.noAnimate)
|
||||
})}
|
||||
}}
|
||||
>
|
||||
</Host>
|
||||
);
|
||||
|
||||
@@ -35,11 +35,11 @@ export class ListHeader implements ComponentInterface {
|
||||
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
[`list-header-lines-${lines}`]: lines !== undefined,
|
||||
}
|
||||
)}
|
||||
}}
|
||||
>
|
||||
<div class="list-header-inner">
|
||||
<slot></slot>
|
||||
|
||||
@@ -27,7 +27,6 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
private durationTimeout: any;
|
||||
|
||||
presented = false;
|
||||
lastFocus?: HTMLElement;
|
||||
|
||||
@Element() el!: HTMLIonLoadingElement;
|
||||
|
||||
@@ -112,7 +111,7 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
*/
|
||||
@Event({ eventName: 'ionLoadingDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
|
||||
|
||||
connectedCallback() {
|
||||
constructor() {
|
||||
prepareOverlay(this.el);
|
||||
}
|
||||
|
||||
@@ -195,10 +194,7 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
}}
|
||||
>
|
||||
<ion-backdrop visible={this.showBackdrop} tappable={this.backdropDismiss} />
|
||||
|
||||
<div tabindex="0"></div>
|
||||
|
||||
<div class="loading-wrapper ion-overlay-wrapper" role="dialog">
|
||||
<div class="loading-wrapper" role="dialog">
|
||||
{spinner && (
|
||||
<div class="loading-spinner">
|
||||
<ion-spinner name={spinner} aria-hidden="true" />
|
||||
@@ -207,8 +203,6 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
|
||||
{message && <div class="loading-content" innerHTML={sanitizeDOMString(message)}></div>}
|
||||
</div>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ export class LoadingExample {
|
||||
|
||||
async presentLoadingWithOptions() {
|
||||
const loading = await this.loadingController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
spinner: null,
|
||||
duration: 5000,
|
||||
message: 'Click the backdrop to dismiss early...',
|
||||
@@ -112,6 +113,7 @@ async function presentLoading() {
|
||||
async function presentLoadingWithOptions() {
|
||||
const loading = document.createElement('ion-loading');
|
||||
|
||||
loading.cssClass = 'my-custom-class';
|
||||
loading.spinner = null;
|
||||
loading.duration = 5000;
|
||||
loading.message = 'Click the backdrop to dismiss early...';
|
||||
@@ -183,6 +185,7 @@ export class LoadingExample {
|
||||
|
||||
async presentLoadingWithOptions() {
|
||||
const loading = await loadingController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
spinner: null,
|
||||
duration: 5000,
|
||||
message: 'Click the backdrop to dismiss early...',
|
||||
@@ -242,6 +245,7 @@ export default {
|
||||
presentLoadingWithOptions() {
|
||||
return this.$ionic.loadingController
|
||||
.create({
|
||||
cssClass: 'my-custom-class',
|
||||
spinner: null,
|
||||
duration: this.timeout,
|
||||
message: 'Click the backdrop to dismiss early...',
|
||||
|
||||
@@ -1,40 +1,6 @@
|
||||
import { testLoading } from '../test.utils';
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
const DIRECTORY = 'basic';
|
||||
const getActiveElementText = async (page) => {
|
||||
const activeElement = await page.evaluateHandle(() => document.activeElement);
|
||||
return await page.evaluate(el => el && el.textContent, activeElement);
|
||||
}
|
||||
|
||||
test('loading: focus trap', async () => {
|
||||
const page = await newE2EPage({ url: '/src/components/loading/test/basic?ionic:_testing=true' });
|
||||
|
||||
await page.click('#html-content-loading');
|
||||
await page.waitForSelector('#html-content-loading');
|
||||
|
||||
let loading = await page.find('ion-loading');
|
||||
|
||||
expect(loading).not.toBe(null);
|
||||
await loading.waitForVisible();
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementText = await getActiveElementText(page);
|
||||
expect(activeElementText).toEqual('Click impatiently to load faster');
|
||||
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.keyboard.up('Shift');
|
||||
|
||||
const activeElementTextTwo = await getActiveElementText(page);
|
||||
expect(activeElementTextTwo).toEqual('Click impatiently to load faster');
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementTextThree = await getActiveElementText(page);
|
||||
expect(activeElementTextThree).toEqual('Click impatiently to load faster');
|
||||
});
|
||||
|
||||
test('loading: basic', async () => {
|
||||
await testLoading(DIRECTORY, '#basic-loading');
|
||||
|
||||
@@ -24,6 +24,7 @@ export class LoadingExample {
|
||||
|
||||
async presentLoadingWithOptions() {
|
||||
const loading = await this.loadingController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
spinner: null,
|
||||
duration: 5000,
|
||||
message: 'Click the backdrop to dismiss early...',
|
||||
|
||||
@@ -16,6 +16,7 @@ async function presentLoading() {
|
||||
async function presentLoadingWithOptions() {
|
||||
const loading = document.createElement('ion-loading');
|
||||
|
||||
loading.cssClass = 'my-custom-class';
|
||||
loading.spinner = null;
|
||||
loading.duration = 5000;
|
||||
loading.message = 'Click the backdrop to dismiss early...';
|
||||
|
||||
@@ -22,6 +22,7 @@ export class LoadingExample {
|
||||
|
||||
async presentLoadingWithOptions() {
|
||||
const loading = await loadingController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
spinner: null,
|
||||
duration: 5000,
|
||||
message: 'Click the backdrop to dismiss early...',
|
||||
|
||||
@@ -30,6 +30,7 @@ export default {
|
||||
presentLoadingWithOptions() {
|
||||
return this.$ionic.loadingController
|
||||
.create({
|
||||
cssClass: 'my-custom-class',
|
||||
spinner: null,
|
||||
duration: this.timeout,
|
||||
message: 'Click the backdrop to dismiss early...',
|
||||
|
||||
@@ -83,8 +83,11 @@ export class MenuButton implements ComponentInterface, ButtonInterface {
|
||||
onClick={this.onClick}
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
aria-hidden={hidden ? 'true' : null}
|
||||
class={createColorClasses(color, {
|
||||
class={{
|
||||
[mode]: true,
|
||||
|
||||
...createColorClasses(color),
|
||||
|
||||
'button': true, // ion-buttons target .button
|
||||
'menu-button-hidden': hidden,
|
||||
'menu-button-disabled': disabled,
|
||||
@@ -92,7 +95,7 @@ export class MenuButton implements ComponentInterface, ButtonInterface {
|
||||
'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
||||
'ion-activatable': true,
|
||||
'ion-focusable': true
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<button
|
||||
{...attrs}
|
||||
|
||||
@@ -48,12 +48,12 @@ export class Menu implements ComponentInterface, MenuI {
|
||||
/**
|
||||
* The content's id the menu should use.
|
||||
*/
|
||||
@Prop({ reflect: true }) contentId?: string;
|
||||
@Prop({ reflectToAttr: true }) contentId?: string;
|
||||
|
||||
/**
|
||||
* An id for the menu.
|
||||
*/
|
||||
@Prop({ reflect: true }) menuId?: string;
|
||||
@Prop({ reflectToAttr: true }) menuId?: string;
|
||||
|
||||
/**
|
||||
* The display type of the menu.
|
||||
@@ -96,7 +96,7 @@ export class Menu implements ComponentInterface, MenuI {
|
||||
/**
|
||||
* Which side of the view the menu should be placed.
|
||||
*/
|
||||
@Prop({ reflect: true }) side: Side = 'start';
|
||||
@Prop({ reflectToAttr: true }) side: Side = 'start';
|
||||
|
||||
@Watch('side')
|
||||
protected sideChanged() {
|
||||
|
||||
@@ -34,7 +34,6 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
// Whether or not modal is being dismissed via gesture
|
||||
private gestureAnimationDismissing = false;
|
||||
presented = false;
|
||||
lastFocus?: HTMLElement;
|
||||
animation?: Animation;
|
||||
|
||||
@Element() el!: HTMLIonModalElement;
|
||||
@@ -131,7 +130,7 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
}
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
constructor() {
|
||||
prepareOverlay(this.el);
|
||||
}
|
||||
|
||||
@@ -290,16 +289,11 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
<ion-backdrop visible={this.showBackdrop} tappable={this.backdropDismiss}/>
|
||||
|
||||
{mode === 'ios' && <div class="modal-shadow"></div>}
|
||||
|
||||
<div tabindex="0"></div>
|
||||
|
||||
<div
|
||||
role="dialog"
|
||||
class="modal-wrapper ion-overlay-wrapper"
|
||||
class="modal-wrapper"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,8 +173,6 @@ export class CalendarComponentModule {}
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
||||
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
|
||||
|
||||
If you are creating an application that uses `ion-tabs`, it is recommended that you get the parent `ion-router-outlet` using `this.routerOutlet.parentOutlet.nativeEl`, otherwise the tabbar will not scale down when the modal opens.
|
||||
|
||||
```javascript
|
||||
@@ -304,8 +302,6 @@ console.log(data);
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
||||
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
|
||||
|
||||
```javascript
|
||||
const modalElement = document.createElement('ion-modal');
|
||||
modalElement.component = 'modal-page';
|
||||
@@ -350,51 +346,19 @@ export const ModalExample: React.FC = () => {
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
||||
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
|
||||
|
||||
```tsx
|
||||
const App: React.FC = () => {
|
||||
const routerRef = useRef<HTMLIonRouterOutletElement | null>(null);
|
||||
|
||||
return (
|
||||
<IonApp>
|
||||
<IonReactRouter>
|
||||
<IonRouterOutlet ref={routerRef}>
|
||||
<Route path="/home" render={() => <Home router={routerRef.current} />} exact={true} />
|
||||
</IonRouterOutlet>
|
||||
</IonReactRouter>
|
||||
</IonApp>
|
||||
)
|
||||
};
|
||||
|
||||
...
|
||||
|
||||
interface HomePageProps {
|
||||
router: HTMLIonRouterOutletElement | null;
|
||||
}
|
||||
|
||||
const Home: React.FC<HomePageProps> = ({ router }) => {
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
|
||||
return (
|
||||
...
|
||||
|
||||
<IonModal
|
||||
isOpen={showModal}
|
||||
cssClass='my-custom-class'
|
||||
swipeToClose={true}
|
||||
presentingElement={router || undefined}
|
||||
onDidDismiss={() => setShowModal(false)}>
|
||||
<p>This is modal content</p>
|
||||
</IonModal>
|
||||
|
||||
...
|
||||
);
|
||||
};
|
||||
|
||||
<IonModal
|
||||
isOpen={showModal}
|
||||
cssClass='my-custom-class'
|
||||
swipeToClose={true}
|
||||
presentingElement={pageRef.current}
|
||||
onDidDismiss={() => setShowModal(false)}>
|
||||
<p>This is modal content</p>
|
||||
<IonButton onClick={() => setShowModal(false)}>Close Modal</IonButton>
|
||||
</IonModal>
|
||||
```
|
||||
|
||||
In most scenarios, setting a ref on `IonRouterOutlet` and passing that ref's `current` value to `presentingElement` is fine. In cases where you are presenting a card-style modal from within another modal, you should pass in the top-most `ion-modal` ref as the `presentingElement`.
|
||||
In most scenarios, setting a ref on `IonPage` and passing that ref's `current` value to `presentingElement` is fine. In cases where you are presenting a card-style modal from within another modal, you should pass in the top-most `ion-modal` ref as the `presentingElement`.
|
||||
|
||||
```tsx
|
||||
<IonModal
|
||||
@@ -402,7 +366,7 @@ In most scenarios, setting a ref on `IonRouterOutlet` and passing that ref's `cu
|
||||
isOpen={showModal}
|
||||
cssClass='my-custom-class'
|
||||
swipeToClose={true}
|
||||
presentingElement={router || undefined}
|
||||
presentingElement={pageRef.current}
|
||||
onDidDismiss={() => setShowModal(false)}>
|
||||
<p>This is modal content</p>
|
||||
<IonButton onClick={() => setShow2ndModal(true)}>Show 2nd Modal</IonButton>
|
||||
@@ -532,8 +496,6 @@ console.log(data);
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
||||
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
|
||||
|
||||
```tsx
|
||||
import { Component, Element, h } from '@stencil/core';
|
||||
|
||||
|
||||
@@ -1,43 +1,6 @@
|
||||
import { testModal } from '../test.utils';
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
const DIRECTORY = 'basic';
|
||||
const getActiveElementText = async (page) => {
|
||||
const activeElement = await page.evaluateHandle(() => document.activeElement);
|
||||
return await page.evaluate(el => el && el.textContent, activeElement);
|
||||
}
|
||||
|
||||
test('modal: focus trap', async () => {
|
||||
const page = await newE2EPage({ url: '/src/components/modal/test/basic?ionic:_testing=true' });
|
||||
|
||||
await page.click('#basic-modal');
|
||||
await page.waitForSelector('#basic-modal');
|
||||
|
||||
let modal = await page.find('ion-modal');
|
||||
|
||||
expect(modal).not.toBe(null);
|
||||
await modal.waitForVisible();
|
||||
|
||||
// TODO fix
|
||||
await page.waitFor(50);
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementText = await getActiveElementText(page);
|
||||
expect(activeElementText).toEqual('Dismiss Modal');
|
||||
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.keyboard.up('Shift');
|
||||
|
||||
const activeElementTextTwo = await getActiveElementText(page);
|
||||
expect(activeElementTextTwo).toEqual('Dismiss Modal');
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementTextThree = await getActiveElementText(page);
|
||||
expect(activeElementTextThree).toEqual('Dismiss Modal');
|
||||
});
|
||||
|
||||
test('modal: basic', async () => {
|
||||
await testModal(DIRECTORY, '#basic-modal');
|
||||
|
||||
@@ -130,8 +130,6 @@ export class CalendarComponentModule {}
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
||||
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
|
||||
|
||||
If you are creating an application that uses `ion-tabs`, it is recommended that you get the parent `ion-router-outlet` using `this.routerOutlet.parentOutlet.nativeEl`, otherwise the tabbar will not scale down when the modal opens.
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -84,8 +84,6 @@ console.log(data);
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
||||
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
|
||||
|
||||
```javascript
|
||||
const modalElement = document.createElement('ion-modal');
|
||||
modalElement.component = 'modal-page';
|
||||
|
||||
@@ -21,51 +21,19 @@ export const ModalExample: React.FC = () => {
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
||||
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
|
||||
|
||||
```tsx
|
||||
const App: React.FC = () => {
|
||||
const routerRef = useRef<HTMLIonRouterOutletElement | null>(null);
|
||||
|
||||
return (
|
||||
<IonApp>
|
||||
<IonReactRouter>
|
||||
<IonRouterOutlet ref={routerRef}>
|
||||
<Route path="/home" render={() => <Home router={routerRef.current} />} exact={true} />
|
||||
</IonRouterOutlet>
|
||||
</IonReactRouter>
|
||||
</IonApp>
|
||||
)
|
||||
};
|
||||
|
||||
...
|
||||
|
||||
interface HomePageProps {
|
||||
router: HTMLIonRouterOutletElement | null;
|
||||
}
|
||||
|
||||
const Home: React.FC<HomePageProps> = ({ router }) => {
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
|
||||
return (
|
||||
...
|
||||
|
||||
<IonModal
|
||||
isOpen={showModal}
|
||||
cssClass='my-custom-class'
|
||||
swipeToClose={true}
|
||||
presentingElement={router || undefined}
|
||||
onDidDismiss={() => setShowModal(false)}>
|
||||
<p>This is modal content</p>
|
||||
</IonModal>
|
||||
|
||||
...
|
||||
);
|
||||
};
|
||||
|
||||
<IonModal
|
||||
isOpen={showModal}
|
||||
cssClass='my-custom-class'
|
||||
swipeToClose={true}
|
||||
presentingElement={pageRef.current}
|
||||
onDidDismiss={() => setShowModal(false)}>
|
||||
<p>This is modal content</p>
|
||||
<IonButton onClick={() => setShowModal(false)}>Close Modal</IonButton>
|
||||
</IonModal>
|
||||
```
|
||||
|
||||
In most scenarios, setting a ref on `IonRouterOutlet` and passing that ref's `current` value to `presentingElement` is fine. In cases where you are presenting a card-style modal from within another modal, you should pass in the top-most `ion-modal` ref as the `presentingElement`.
|
||||
In most scenarios, setting a ref on `IonPage` and passing that ref's `current` value to `presentingElement` is fine. In cases where you are presenting a card-style modal from within another modal, you should pass in the top-most `ion-modal` ref as the `presentingElement`.
|
||||
|
||||
```tsx
|
||||
<IonModal
|
||||
@@ -73,7 +41,7 @@ In most scenarios, setting a ref on `IonRouterOutlet` and passing that ref's `cu
|
||||
isOpen={showModal}
|
||||
cssClass='my-custom-class'
|
||||
swipeToClose={true}
|
||||
presentingElement={router || undefined}
|
||||
presentingElement={pageRef.current}
|
||||
onDidDismiss={() => setShowModal(false)}>
|
||||
<p>This is modal content</p>
|
||||
<IonButton onClick={() => setShow2ndModal(true)}>Show 2nd Modal</IonButton>
|
||||
|
||||
@@ -109,8 +109,6 @@ console.log(data);
|
||||
|
||||
Modals in iOS mode have the ability to be presented in a card-style and swiped to close. The card-style presentation and swipe to close gesture are not mutually exclusive, meaning you can pick and choose which features you want to use. For example, you can have a card-style modal that cannot be swiped or a full sized modal that can be swiped.
|
||||
|
||||
> Card style modals when running on iPhone-sized devices do not have backdrops. As a result, the `--backdrop-opacity` variable will not have any effect.
|
||||
|
||||
```tsx
|
||||
import { Component, Element, h } from '@stencil/core';
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import { Animation, AnimationBuilder, ComponentProps, ComponentRef, FrameworkDelegate, Mode } from '../../interface';
|
||||
import { Animation, AnimationBuilder, ComponentRef, FrameworkDelegate, Mode } from '../../interface';
|
||||
|
||||
import { ViewController } from './view-controller';
|
||||
|
||||
export type NavDirection = 'back' | 'forward';
|
||||
|
||||
export type NavComponent = ComponentRef | ViewController;
|
||||
export interface NavComponentWithProps<T = any> {
|
||||
component: NavComponent;
|
||||
componentProps?: ComponentProps<T> | null;
|
||||
}
|
||||
|
||||
export interface NavResult {
|
||||
hasCompleted: boolean;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Build, Component, Element, Event, EventEmitter, Method, Prop, Watch, h
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { Animation, AnimationBuilder, ComponentProps, FrameworkDelegate, Gesture, NavComponent, NavComponentWithProps, NavOptions, NavOutlet, NavResult, RouteID, RouteWrite, RouterDirection, TransitionDoneFn, TransitionInstruction, ViewController } from '../../interface';
|
||||
import { Animation, AnimationBuilder, ComponentProps, FrameworkDelegate, Gesture, NavComponent, NavOptions, NavOutlet, NavResult, RouteID, RouteWrite, RouterDirection, TransitionDoneFn, TransitionInstruction, ViewController } from '../../interface';
|
||||
import { getTimeGivenProgression } from '../../utils/animation/cubic-bezier';
|
||||
import { assert } from '../../utils/helpers';
|
||||
import { TransitionOptions, lifecycle, setPageHidden, transition } from '../../utils/transition';
|
||||
@@ -120,7 +120,7 @@ export class Nav implements NavOutlet {
|
||||
this.swipeGestureChanged();
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
componentDidUnload() {
|
||||
for (const view of this.views) {
|
||||
lifecycle(view.element!, LIFECYCLE_WILL_UNLOAD);
|
||||
view._destroy();
|
||||
@@ -156,7 +156,7 @@ export class Nav implements NavOutlet {
|
||||
return this.queueTrns(
|
||||
{
|
||||
insertStart: -1,
|
||||
insertViews: [{ component, componentProps }],
|
||||
insertViews: [{ page: component, params: componentProps }],
|
||||
opts
|
||||
},
|
||||
done
|
||||
@@ -184,7 +184,7 @@ export class Nav implements NavOutlet {
|
||||
return this.queueTrns(
|
||||
{
|
||||
insertStart: insertIndex,
|
||||
insertViews: [{ component, componentProps }],
|
||||
insertViews: [{ page: component, params: componentProps }],
|
||||
opts
|
||||
},
|
||||
done
|
||||
@@ -204,7 +204,7 @@ export class Nav implements NavOutlet {
|
||||
@Method()
|
||||
insertPages(
|
||||
insertIndex: number,
|
||||
insertComponents: NavComponent[] | NavComponentWithProps[],
|
||||
insertComponents: NavComponent[],
|
||||
opts?: NavOptions | null,
|
||||
done?: TransitionDoneFn
|
||||
): Promise<boolean> {
|
||||
@@ -326,7 +326,7 @@ export class Nav implements NavOutlet {
|
||||
done?: TransitionDoneFn
|
||||
): Promise<boolean> {
|
||||
return this.setPages(
|
||||
[{ component, componentProps }],
|
||||
[{ page: component, params: componentProps }],
|
||||
opts,
|
||||
done
|
||||
);
|
||||
@@ -344,7 +344,7 @@ export class Nav implements NavOutlet {
|
||||
*/
|
||||
@Method()
|
||||
setPages(
|
||||
views: NavComponent[] | NavComponentWithProps[],
|
||||
views: any[],
|
||||
opts?: NavOptions | null,
|
||||
done?: TransitionDoneFn
|
||||
): Promise<boolean> {
|
||||
@@ -513,7 +513,7 @@ export class Nav implements NavOutlet {
|
||||
// 7. _transitionStart(): called once the transition actually starts, it initializes the Animation underneath.
|
||||
// 8. _transitionFinish(): called once the transition finishes
|
||||
// 9. _cleanup(): syncs the navigation internal state with the DOM. For example it removes the pages from the DOM or hides/show them.
|
||||
private async queueTrns(
|
||||
private queueTrns(
|
||||
ti: TransitionInstruction,
|
||||
done: TransitionDoneFn | undefined
|
||||
): Promise<boolean> {
|
||||
@@ -527,25 +527,6 @@ export class Nav implements NavOutlet {
|
||||
});
|
||||
ti.done = done;
|
||||
|
||||
/**
|
||||
* If using router, check to see if navigation hooks
|
||||
* will allow us to perform this transition. This
|
||||
* is required in order for hooks to work with
|
||||
* the ion-back-button or swipe to go back.
|
||||
*/
|
||||
if (ti.opts && ti.opts.updateURL !== false && this.useRouter) {
|
||||
const router = document.querySelector('ion-router');
|
||||
if (router) {
|
||||
const canTransition = await router.canTransition();
|
||||
if (canTransition === false) {
|
||||
return Promise.resolve(false);
|
||||
} else if (typeof canTransition === 'string') {
|
||||
router.push(canTransition, ti.opts!.direction || 'back');
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize empty
|
||||
if (ti.insertViews && ti.insertViews.length === 0) {
|
||||
ti.insertViews = undefined;
|
||||
@@ -958,27 +939,16 @@ export class Nav implements NavOutlet {
|
||||
|
||||
for (let i = views.length - 1; i >= 0; i--) {
|
||||
const view = views[i];
|
||||
|
||||
/**
|
||||
* When inserting multiple views via insertPages
|
||||
* the last page will be transitioned to, but the
|
||||
* others will not be. As a result, a DOM element
|
||||
* will only be created for the last page inserted.
|
||||
* As a result, it is possible to have views in the
|
||||
* stack that do not have `view.element` yet.
|
||||
*/
|
||||
const element = view.element;
|
||||
if (element) {
|
||||
if (i > activeViewIndex) {
|
||||
// this view comes after the active view
|
||||
// let's unload it
|
||||
lifecycle(element, LIFECYCLE_WILL_UNLOAD);
|
||||
this.destroyView(view);
|
||||
} else if (i < activeViewIndex) {
|
||||
// this view comes before the active view
|
||||
// and it is not a portal then ensure it is hidden
|
||||
setPageHidden(element!, true);
|
||||
}
|
||||
if (i > activeViewIndex) {
|
||||
// this view comes after the active view
|
||||
// let's unload it
|
||||
lifecycle(element, LIFECYCLE_WILL_UNLOAD);
|
||||
this.destroyView(view);
|
||||
} else if (i < activeViewIndex) {
|
||||
// this view comes before the active view
|
||||
// and it is not a portal then ensure it is hidden
|
||||
setPageHidden(element!, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ Type: `Promise<boolean>`
|
||||
|
||||
|
||||
|
||||
### `insertPages(insertIndex: number, insertComponents: NavComponent[] | NavComponentWithProps[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>`
|
||||
### `insertPages(insertIndex: number, insertComponents: NavComponent[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>`
|
||||
|
||||
Inserts an array of components into the navigation stack at the specified index.
|
||||
The last component in the array will become instantiated as a view, and animate
|
||||
@@ -145,7 +145,7 @@ Type: `Promise<boolean>`
|
||||
|
||||
|
||||
|
||||
### `setPages(views: NavComponent[] | NavComponentWithProps[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>`
|
||||
### `setPages(views: any[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>`
|
||||
|
||||
Set the views of the current navigation stack and navigate to the last view.
|
||||
By default animations are disabled, but they can be enabled by passing options
|
||||
|
||||
@@ -119,9 +119,9 @@ describe('NavController', () => {
|
||||
mockViews(nav, [view1]);
|
||||
|
||||
const view2 = mockView(MockView2);
|
||||
|
||||
|
||||
await nav.push(view2, null, null, trnsDone);
|
||||
|
||||
|
||||
const hasCompleted = true;
|
||||
const requiresTransition = true;
|
||||
expect(trnsDone).toHaveBeenCalledWith(
|
||||
@@ -818,8 +818,8 @@ describe('NavController', () => {
|
||||
const view5 = mockView(MockView5);
|
||||
|
||||
await nav.setPages([
|
||||
{ component: view4 },
|
||||
{ component: view5 }
|
||||
{ page: view4 },
|
||||
{ page: view5 }
|
||||
], null, trnsDone);
|
||||
expect(instance1.ionViewWillUnload).toHaveBeenCalled();
|
||||
expect(instance2.ionViewWillUnload).toHaveBeenCalled();
|
||||
@@ -924,10 +924,10 @@ describe('NavController', () => {
|
||||
const MockView3 = 'mock-view3';
|
||||
const MockView4 = 'mock-view4';
|
||||
const MockView5 = 'mock-view5';
|
||||
|
||||
|
||||
const mockWebAnimation = (el: HTMLElement) => {
|
||||
Element.prototype.animate = () => {};
|
||||
|
||||
|
||||
el.animate = () => {
|
||||
const animation = {
|
||||
stop: () => {},
|
||||
@@ -935,13 +935,13 @@ describe('NavController', () => {
|
||||
cancel: () => {},
|
||||
onfinish: undefined
|
||||
}
|
||||
|
||||
|
||||
animation.play = () => {
|
||||
if (animation.onfinish) {
|
||||
animation.onfinish();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return animation;
|
||||
}
|
||||
}
|
||||
@@ -953,9 +953,9 @@ describe('NavController', () => {
|
||||
|
||||
const view = new ViewController(component, params);
|
||||
view.element = document.createElement(component) as HTMLElement;
|
||||
|
||||
|
||||
mockWebAnimation(view.element);
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AnimationBuilder, ComponentProps, FrameworkDelegate, NavComponentWithProps } from '../../interface';
|
||||
import { AnimationBuilder, ComponentProps, FrameworkDelegate } from '../../interface';
|
||||
import { attachComponent } from '../../utils/framework-delegate';
|
||||
import { assert } from '../../utils/helpers';
|
||||
|
||||
@@ -89,20 +89,13 @@ export const convertToView = (page: any, params: ComponentProps | undefined): Vi
|
||||
return new ViewController(page, params);
|
||||
};
|
||||
|
||||
export const convertToViews = (pages: NavComponentWithProps[]): ViewController[] => {
|
||||
export const convertToViews = (pages: any[]): ViewController[] => {
|
||||
return pages.map(page => {
|
||||
if (page instanceof ViewController) {
|
||||
return page;
|
||||
}
|
||||
if ('component' in page) {
|
||||
/**
|
||||
* TODO Ionic 6:
|
||||
* Consider switching to just using `undefined` here
|
||||
* as well as on the public interfaces and on
|
||||
* `NavComponentWithProps`. Previously `pages` was
|
||||
* of type `any[]` so TypeScript did not catch this.
|
||||
*/
|
||||
return convertToView(page.component, (page.componentProps === null) ? undefined : page.componentProps);
|
||||
if ('page' in page) {
|
||||
return convertToView(page.page, page.params);
|
||||
}
|
||||
return convertToView(page, undefined);
|
||||
}).filter(v => v !== null) as ViewController[];
|
||||
|
||||
@@ -27,9 +27,10 @@ export class Note implements ComponentInterface {
|
||||
const mode = getIonMode(this);
|
||||
return (
|
||||
<Host
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<slot></slot>
|
||||
</Host>
|
||||
|
||||
@@ -21,7 +21,6 @@ import { iosLeaveAnimation } from './animations/ios.leave';
|
||||
})
|
||||
export class Picker implements ComponentInterface, OverlayInterface {
|
||||
private durationTimeout: any;
|
||||
lastFocus?: HTMLElement;
|
||||
|
||||
@Element() el!: HTMLIonPickerElement;
|
||||
|
||||
@@ -101,7 +100,7 @@ export class Picker implements ComponentInterface, OverlayInterface {
|
||||
*/
|
||||
@Event({ eventName: 'ionPickerDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
|
||||
|
||||
connectedCallback() {
|
||||
constructor() {
|
||||
prepareOverlay(this.el);
|
||||
}
|
||||
|
||||
@@ -237,10 +236,7 @@ export class Picker implements ComponentInterface, OverlayInterface {
|
||||
tappable={this.backdropDismiss}
|
||||
>
|
||||
</ion-backdrop>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
|
||||
<div class="picker-wrapper ion-overlay-wrapper" role="dialog">
|
||||
<div class="picker-wrapper" role="dialog">
|
||||
<div class="picker-toolbar">
|
||||
{this.buttons.map(b => (
|
||||
<div class={buttonWrapperClass(b)}>
|
||||
@@ -263,8 +259,6 @@ export class Picker implements ComponentInterface, OverlayInterface {
|
||||
<div class="picker-below-highlight"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ export class Popover implements ComponentInterface, OverlayInterface {
|
||||
private usersElement?: HTMLElement;
|
||||
|
||||
presented = false;
|
||||
lastFocus?: HTMLElement;
|
||||
|
||||
@Element() el!: HTMLIonPopoverElement;
|
||||
|
||||
@@ -116,7 +115,7 @@ export class Popover implements ComponentInterface, OverlayInterface {
|
||||
*/
|
||||
@Event({ eventName: 'ionPopoverDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
|
||||
|
||||
connectedCallback() {
|
||||
constructor() {
|
||||
prepareOverlay(this.el);
|
||||
}
|
||||
|
||||
@@ -220,15 +219,10 @@ export class Popover implements ComponentInterface, OverlayInterface {
|
||||
onIonBackdropTap={this.onBackdropTap}
|
||||
>
|
||||
<ion-backdrop tappable={this.backdropDismiss} visible={this.showBackdrop}/>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
|
||||
<div class="popover-wrapper ion-overlay-wrapper">
|
||||
<div class="popover-wrapper">
|
||||
<div class="popover-arrow"></div>
|
||||
<div class="popover-content"></div>
|
||||
</div>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,42 +1,7 @@
|
||||
import { testPopover } from '../test.utils';
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
const DIRECTORY = 'basic';
|
||||
|
||||
const getActiveElementText = async (page) => {
|
||||
const activeElement = await page.evaluateHandle(() => document.activeElement);
|
||||
return await page.evaluate(el => el && el.textContent, activeElement);
|
||||
}
|
||||
|
||||
test('popover: focus trap', async () => {
|
||||
const page = await newE2EPage({ url: '/src/components/popover/test/basic?ionic:_testing=true' });
|
||||
|
||||
await page.click('#basic-popover');
|
||||
await page.waitForSelector('#basic-popover');
|
||||
|
||||
let popover = await page.find('ion-popover');
|
||||
|
||||
expect(popover).not.toBe(null);
|
||||
await popover.waitForVisible();
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementText = await getActiveElementText(page);
|
||||
expect(activeElementText).toEqual('Item 0');
|
||||
|
||||
await page.keyboard.down('Shift');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.keyboard.up('Shift');
|
||||
|
||||
const activeElementTextTwo = await getActiveElementText(page);
|
||||
expect(activeElementTextTwo).toEqual('Item 3');
|
||||
|
||||
await page.keyboard.press('Tab');
|
||||
|
||||
const activeElementTextThree = await getActiveElementText(page);
|
||||
expect(activeElementTextThree).toEqual('Item 0');
|
||||
});
|
||||
|
||||
test('popover: basic', async () => {
|
||||
await testPopover(DIRECTORY, '#basic-popover');
|
||||
});
|
||||
|
||||
@@ -75,10 +75,10 @@
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-list-header><ion-label>Ionic</ion-label></ion-list-header>
|
||||
<ion-item button><ion-label>Item 0</ion-label></ion-item>
|
||||
<ion-item button><ion-label>Item 1</ion-label></ion-item>
|
||||
<ion-item button><ion-label>Item 2</ion-label></ion-item>
|
||||
<ion-item button><ion-label>Item 3</ion-label></ion-item>
|
||||
<ion-item><ion-label>Item 0</ion-label></ion-item>
|
||||
<ion-item><ion-label>Item 1</ion-label></ion-item>
|
||||
<ion-item><ion-label>Item 2</ion-label></ion-item>
|
||||
<ion-item><ion-label>Item 3</ion-label></ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
`;
|
||||
|
||||
@@ -60,12 +60,13 @@ export class ProgressBar implements ComponentInterface {
|
||||
aria-valuenow={type === 'determinate' ? value : null}
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="1"
|
||||
class={createColorClasses(color, {
|
||||
class={{
|
||||
...createColorClasses(color),
|
||||
[mode]: true,
|
||||
[`progress-bar-${type}`]: true,
|
||||
'progress-paused': paused,
|
||||
'progress-bar-reversed': document.dir === 'rtl' ? !reversed : reversed
|
||||
})}
|
||||
}}
|
||||
>
|
||||
{type === 'indeterminate'
|
||||
? renderIndeterminate()
|
||||
|
||||
@@ -130,13 +130,14 @@ export class Radio implements ComponentInterface {
|
||||
aria-disabled={disabled ? 'true' : null}
|
||||
aria-checked={`${checked}`}
|
||||
aria-labelledby={labelId}
|
||||
class={createColorClasses(color, {
|
||||
class={{
|
||||
...createColorClasses(color),
|
||||
[mode]: true,
|
||||
'in-item': hostContext('ion-item', el),
|
||||
'interactive': true,
|
||||
'radio-checked': checked,
|
||||
'radio-disabled': disabled,
|
||||
})}
|
||||
}}
|
||||
>
|
||||
<div class="radio-icon" part="container">
|
||||
<div class="radio-inner" part="mark" />
|
||||
|
||||
@@ -422,13 +422,14 @@ export class Range implements ComponentInterface {
|
||||
<Host
|
||||
onFocusin={this.onFocus}
|
||||
onFocusout={this.onBlur}
|
||||
class={createColorClasses(this.color, {
|
||||
class={{
|
||||
...createColorClasses(this.color),
|
||||
[mode]: true,
|
||||
'in-item': hostContext('ion-item', el),
|
||||
'range-disabled': disabled,
|
||||
'range-pressed': pressedKnob !== undefined,
|
||||
'range-has-pin': pin
|
||||
})}
|
||||
}}
|
||||
>
|
||||
|
||||
<slot name="start"></slot>
|
||||
|
||||
@@ -85,7 +85,6 @@
|
||||
</ion-range>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Stacked Label</ion-label>
|
||||
<ion-range value="40">
|
||||
<ion-label slot="start">Start</ion-label>
|
||||
<ion-label slot="end">End</ion-label>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
cursor: grab;
|
||||
pointer-events: all;
|
||||
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user