Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(datetime): add preferWheel support for date presentation #25422

Merged
merged 24 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4f08ed2
feat(datetime): add initial wheel date implementation
liamdebeasi Jun 7, 2022
f02b8f8
test(datetime): add initial tests
liamdebeasi Jun 7, 2022
ab1421a
chore(): simplify test
liamdebeasi Jun 7, 2022
2094f5f
test(datetime): add isDateEnabled and values tests
liamdebeasi Jun 7, 2022
4f1006b
refactor(): get data from parent fn and pass to children
liamdebeasi Jun 7, 2022
7e83f64
chore(): typo
liamdebeasi Jun 7, 2022
c12c0b0
chore(): more typos
liamdebeasi Jun 7, 2022
6d78124
feat(datetime): add support for isDateEnabled
liamdebeasi Jun 7, 2022
dae3c2b
chore(): lint
liamdebeasi Jun 7, 2022
f33dd22
chore(): comments
liamdebeasi Jun 7, 2022
d7cda50
Merge remote-tracking branch 'origin/FW-225' into wheel-date-2
liamdebeasi Jun 7, 2022
ab2b981
test(datetime): add localization test
liamdebeasi Jun 7, 2022
d7a93a9
fix(datetime): resolve calendar grid wheel picker regression
liamdebeasi Jun 7, 2022
9719a64
chore(): force new cache creation
liamdebeasi Jun 7, 2022
8db45f6
chore(): avoid bad cache
liamdebeasi Jun 7, 2022
60f87f6
chore(): lint
liamdebeasi Jun 7, 2022
2eb4857
chore(): add updated snapshots
Ionitron Jun 7, 2022
0ffed13
chore(): fix test
liamdebeasi Jun 8, 2022
d8aeb2c
chore(): fix other test
liamdebeasi Jun 8, 2022
ad32334
chore(): fix test for real this time
liamdebeasi Jun 8, 2022
8dbdd07
fix(datetime): avoid layout shift with wheel picker
liamdebeasi Jun 8, 2022
647b6f8
Merge remote-tracking branch 'origin/FW-225' into wheel-date-2
liamdebeasi Jun 8, 2022
0913d61
chore: revert screenshot
liamdebeasi Jun 8, 2022
9a45f38
chore(): add updated snapshots
Ionitron Jun 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/actions/build-angular/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json')}}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json')}}-v4
- name: Cache Angular Node Modules
uses: actions/cache@v2
env:
cache-name: angular-node-modules
with:
path: ./angular/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./angular/package-lock.json')}}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./angular/package-lock.json')}}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/build-core/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- name: Install Dependencies
run: npm install
working-directory: ./core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/build-react-router/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- name: Install Dependencies
run: npm install --legacy-peer-deps
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/build-react/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/build-vue-router/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/build-vue/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-angular-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-core-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-core-lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- name: Lint
run: npm run lint
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-core-screenshot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-core-spec/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-react-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-react-router-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-vue-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
cache-name: core-node-modules
with:
path: ./core/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./core/package-lock.json') }}-v4
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
25 changes: 18 additions & 7 deletions core/src/components/datetime/datetime.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
overflow: hidden;
}

/**
* When using the wheel picker to switch
* between months, sometimes the allowed
* dates may be filtered. As a result, it
* is possible to get a layout shift as
* the picker column will shrink to fit the
* widest item in the column. Setting a minimum
* width avoids this layout shifting.
*/
ion-picker-column-internal {
min-width: 26px;
}

:host(.datetime-size-fixed) {
width: auto;
max-width: 350px;
Expand Down Expand Up @@ -58,21 +71,19 @@
* the order we need to manually switch
* the text alignment too.
*/
:host .datetime-year .order-month-first .month-column {
order: 1;
}
:host .wheel-order-year-first .day-column {
order: 3;

:host .datetime-year .order-month-first .year-column {
order: 2;
text-align: end;
}

:host .datetime-year .order-year-first .month-column {
:host .wheel-order-year-first .month-column {
order: 2;

text-align: end;
}

:host .datetime-year .order-year-first .year-column {
:host .wheel-order-year-first .year-column {
order: 1;

text-align: start;
Expand Down
Loading