-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(datetime): add new header parts #4402
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 22 additions & 1 deletion
23
static/usage/v8/datetime/styling/calendar-header/angular/example_component_css.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,30 @@ | ||
| ```css | ||
| /* | ||
| * Custom Datetime Calendar Header Part | ||
| * Custom Datetime Calendar Header Parts | ||
| * ------------------------------------------- | ||
| */ | ||
| ion-datetime::part(calendar-header) { | ||
| background-color: orange; | ||
| } | ||
|
|
||
| ion-datetime::part(month-year-button) { | ||
| background-color: lightblue; | ||
| } | ||
|
|
||
| ion-datetime::part(prev-next-buttons) { | ||
| background-color: firebrick; | ||
| } | ||
|
|
||
| ion-datetime::part(prev-button) { | ||
| color: white; | ||
| } | ||
|
|
||
| ion-datetime::part(next-button) { | ||
| color: black; | ||
| } | ||
|
|
||
| ion-datetime::part(days-of-week) { | ||
| background-color: #9ad162; | ||
| color: white; | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 22 additions & 1 deletion
23
static/usage/v8/datetime/styling/calendar-header/react/main_css.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,30 @@ | ||
| ```css | ||
| /* | ||
| * Custom Datetime Calendar Header Part | ||
| * Custom Datetime Calendar Header Parts | ||
| * ------------------------------------------- | ||
| */ | ||
| ion-datetime::part(calendar-header) { | ||
| background-color: orange; | ||
| } | ||
|
|
||
| ion-datetime::part(month-year-button) { | ||
| background-color: lightblue; | ||
| } | ||
|
|
||
| ion-datetime::part(prev-next-buttons) { | ||
| background-color: firebrick; | ||
| } | ||
|
|
||
| ion-datetime::part(prev-button) { | ||
| color: white; | ||
| } | ||
|
|
||
| ion-datetime::part(next-button) { | ||
| color: black; | ||
| } | ||
|
|
||
| ion-datetime::part(days-of-week) { | ||
| background-color: #9ad162; | ||
| color: white; | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
static/usage/v8/datetime/styling/datetime-header/angular/example_component_css.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ```css | ||
| /* | ||
| * Custom Datetime Header Part | ||
| * ------------------------------------------- | ||
| */ | ||
| ion-datetime::part(datetime-header) { | ||
| background-color: orange; | ||
| } | ||
| ``` |
5 changes: 5 additions & 0 deletions
5
static/usage/v8/datetime/styling/datetime-header/angular/example_component_html.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ```html | ||
| <ion-datetime presentation="date"> | ||
| <span slot="title">Select Date</span> | ||
| </ion-datetime> | ||
| ``` |
12 changes: 12 additions & 0 deletions
12
static/usage/v8/datetime/styling/datetime-header/angular/example_component_ts.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| ```ts | ||
| import { Component } from '@angular/core'; | ||
| import { IonDatetime } from '@ionic/angular/standalone'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-example', | ||
| templateUrl: 'example.component.html', | ||
| styleUrls: ['./example.component.css'], | ||
| imports: [IonDatetime], | ||
| }) | ||
| export class ExampleComponent {} | ||
| ``` |
35 changes: 35 additions & 0 deletions
35
static/usage/v8/datetime/styling/datetime-header/demo.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Datetime</title> | ||
| <link rel="stylesheet" href="../../../common.css" /> | ||
| <script src="../../../common.js"></script> | ||
| <script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@8/dist/ionic/ionic.esm.js"></script> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@8/css/ionic.bundle.css" /> | ||
|
|
||
| <style> | ||
| /* | ||
| * Custom Datetime Header Part | ||
| * ------------------------------------------- | ||
| */ | ||
|
|
||
| ion-datetime::part(datetime-header) { | ||
| background-color: orange; | ||
| } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-content> | ||
| <div class="container"> | ||
| <ion-datetime presentation="date"> | ||
| <span slot="title">Select Date</span> | ||
| </ion-datetime> | ||
| </div> | ||
| </ion-content> | ||
| </ion-app> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import Playground from '@site/src/components/global/Playground'; | ||
|
|
||
| import javascript from './javascript.md'; | ||
|
|
||
| import react_main_tsx from './react/main_tsx.md'; | ||
| import react_main_css from './react/main_css.md'; | ||
|
|
||
| import vue from './vue.md'; | ||
|
|
||
| import angular_example_component_html from './angular/example_component_html.md'; | ||
| import angular_example_component_css from './angular/example_component_css.md'; | ||
| import angular_example_component_ts from './angular/example_component_ts.md'; | ||
|
|
||
| <Playground | ||
| version="8" | ||
| code={{ | ||
| javascript, | ||
| react: { | ||
| files: { | ||
| 'src/main.tsx': react_main_tsx, | ||
| 'src/main.css': react_main_css, | ||
| }, | ||
| }, | ||
| vue, | ||
| angular: { | ||
| files: { | ||
| 'src/app/example.component.html': angular_example_component_html, | ||
| 'src/app/example.component.css': angular_example_component_css, | ||
| 'src/app/example.component.ts': angular_example_component_ts, | ||
| }, | ||
| }, | ||
| }} | ||
| src="usage/v8/datetime/styling/datetime-header/demo.html" | ||
| size="450px" | ||
| /> |
15 changes: 15 additions & 0 deletions
15
static/usage/v8/datetime/styling/datetime-header/javascript.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ```html | ||
| <ion-datetime presentation="date"> | ||
| <span slot="title">Select Date</span> | ||
| </ion-datetime> | ||
|
|
||
| <style> | ||
| /* | ||
| * Custom Datetime Header Part | ||
| * ------------------------------------------- | ||
| */ | ||
| ion-datetime::part(datetime-header) { | ||
| background-color: orange; | ||
| } | ||
| </style> | ||
| ``` |
9 changes: 9 additions & 0 deletions
9
static/usage/v8/datetime/styling/datetime-header/react/main_css.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ```css | ||
| /* | ||
| * Custom Datetime Header Part | ||
| * ------------------------------------------- | ||
| */ | ||
| ion-datetime::part(datetime-header) { | ||
| background-color: orange; | ||
| } | ||
| ``` |
17 changes: 17 additions & 0 deletions
17
static/usage/v8/datetime/styling/datetime-header/react/main_tsx.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| ```tsx | ||
| import React from 'react'; | ||
| import { IonDatetime } from '@ionic/react'; | ||
|
|
||
| import './main.css'; | ||
|
|
||
| function Example() { | ||
| return ( | ||
| <> | ||
| <IonDatetime presentation="date"> | ||
| <span slot="title">Select Date</span> | ||
| </IonDatetime> | ||
| </> | ||
| ); | ||
| } | ||
| export default Example; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ```html | ||
| <template> | ||
| <ion-datetime presentation="date"> | ||
| <span slot="title">Select Date</span> | ||
| </ion-datetime> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { IonDatetime } from '@ionic/vue'; | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| /* | ||
| * Custom Datetime Header Part | ||
| * ------------------------------------------- | ||
| */ | ||
|
|
||
| ion-datetime::part(datetime-header) { | ||
| background-color: orange; | ||
| } | ||
| </style> | ||
| ``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.