diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 1a0efc743b7..00000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Bug report -about: Report a bug on the docs site -title: '' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Browser and OS (please complete the following information)** - - OS: [e.g. iOS] - - Browser: [e.g. chrome, safari] - - Version: [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000000..3cae620736e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,43 @@ +name: 🐛 Bug Report +description: Report a bug on the docs site +labels: ["triage"] +title: "bug: " +body: + - type: textarea + attributes: + label: Describe the Bug + description: A clear description of what the bug is and how it manifests. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A clear description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: Steps to Reproduce + description: Please explain the steps required to duplicate this issue. + validations: + required: true + - type: textarea + attributes: + label: Screenshots + description: If applicable, add screenshots to help explain the problem. + - type: input + attributes: + label: Operating System + description: The operating system you are running (e.g. Windows) + - type: input + attributes: + label: Browser + description: The browser you are running (e.g. Chrome, Safari) + - type: input + attributes: + label: Version + description: The browser version you are running (e.g. 14) + - type: textarea + attributes: + label: Additional Information + description: List any other information that is relevant to your issue. diff --git a/.github/ISSUE_TEMPLATE/content-issue.md b/.github/ISSUE_TEMPLATE/content-issue.md deleted file mode 100644 index 58b864b751c..00000000000 --- a/.github/ISSUE_TEMPLATE/content-issue.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: Content issue -about: Report missing or inaccurate content on the docs -title: '' -labels: content -assignees: '' - ---- - -**URL** -The URL at which the content is missing or inaccurate - -**What is missing or inaccurate about the content on this page?** diff --git a/.github/ISSUE_TEMPLATE/content-issue.yml b/.github/ISSUE_TEMPLATE/content-issue.yml new file mode 100644 index 00000000000..404492e1736 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/content-issue.yml @@ -0,0 +1,17 @@ +name: 📕 Content Issue +description: Report missing or inaccurate content on the docs +labels: ["triage"] +title: "content: " +body: + - type: input + attributes: + label: URL + description: The URL at which the content is missing or inaccurate + validations: + required: true + - type: textarea + attributes: + label: Issue Description + description: What is missing or inaccurate about the content on this page? + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index d513e5c0428..00000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest a feature for the docs -title: '' -labels: feature -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000000..5a964579982 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,23 @@ +name: 💡 Feature Request +description: Suggest a feature for the docs +labels: ["triage"] +title: "feat: " +body: + - type: textarea + attributes: + label: Describe Problem + description: A clear and concise description of what the problem is. Ex. I am always frustrated when [...] + validations: + required: true + - type: textarea + attributes: + label: Describe Preferred Solution + description: A clear and concise description of what you want to happen. + - type: textarea + attributes: + label: Describe Alternatives + description: A clear and concise description of any alternative solutions or features you have considered. + - type: textarea + attributes: + label: Additional Information + description: Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/ionic-issue-bot.yml b/.github/ionic-issue-bot.yml new file mode 100644 index 00000000000..f0da0d54073 --- /dev/null +++ b/.github/ionic-issue-bot.yml @@ -0,0 +1,86 @@ +triage: + label: triage + dryRun: false + +closeAndLock: + labels: + - label: 'ionitron: support' + message: > + Thanks for the issue! This issue appears to be a support request. We use this issue tracker exclusively for + content issues, bug reports and feature requests related to the documentation. Please use our + [forum](https://forum.ionicframework.com/) for help or questions about Ionic Framework. + + + Thank you for using Ionic! + - label: 'ionitron: missing template' + message: > + Thanks for the issue! It appears that you have not filled out the provided issue template. We use this issue + template in order to gather more information and further assist you. Please create a new issue and ensure the + template is fully filled out. + + + Thank you for using Ionic! + close: true + lock: true + dryRun: false + +comment: + labels: + - label: "help wanted" + message: > + This issue has been labeled as `help wanted`. This label is added to issues + that we believe would be good for contributors. + + + If you'd like to work on this issue, please comment here letting us know that + you would like to submit a pull request for it. This helps us to keep track of + the pull request and make sure there isn't duplicated effort. + + + For a guide on how to create a pull request and test this project locally to see + your changes, see our [contributing documentation](https://github.com/ionic-team/ionic-docs/blob/main/CONTRIBUTING.md). + + + Thank you! + - label: 'ionitron: needs reproduction' + message: > + Thanks for the issue! This issue has been labeled as `needs reproduction`. This label is added to issues that + we are not able to reproduce. + + + Please provide easy to follow steps for us to reproduce this issue. + dryRun: false + +noReply: + days: 14 + maxIssuesPerRun: 100 + label: "needs: reply" + responseLabel: triage + exemptProjects: true + exemptMilestones: true + message: > + Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue, + please create a new issue and ensure the template is fully filled out. + + + Thank you for using Ionic! + close: true + lock: true + dryRun: false + +noReproduction: + days: 14 + maxIssuesPerRun: 100 + label: "ionitron: needs reproduction" + responseLabel: triage + exemptProjects: true + exemptMilestones: true + message: > + Thanks for the issue! This issue is being closed due to the lack of a reproduction. If this is still an issue, + please create a new issue and ensure the template is fully filled out. + + + Thank you for using Ionic! + close: true + lock: true + dryRun: false diff --git a/.gitignore b/.gitignore index 823ff59f396..4b10b69fe49 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ src/components/page/reference/ReleaseNotes/release-notes.json npm-debug.log* yarn-debug.log* yarn-error.log* + +static/**/node_modules/ diff --git a/docs/angular/config.md b/docs/angular/config.md index dcef8c539d0..caf2181d0d1 100644 --- a/docs/angular/config.md +++ b/docs/angular/config.md @@ -14,54 +14,67 @@ Ionic Config provides は、アプリケヌション党䜓でコンポヌネン ## Global Config -アプリケヌションの初期のIonic Configを䞊曞きするには、`IonicModule` に蚭定を指定したす。 `app.module.ts` にある `IonicModule.forRoot` を指定ください。 +アプリのデフォルトのIonicコンフィグをオヌバヌラむドするには、独自のカスタム蚭定を `IonicModule.forRoot(...)` に指定したす。利甚可胜な蚭定キヌは [`IonicConfig`](#ionicconfig) むンタヌフェヌスで確認するこずができたす。 -```tsx +For example, to disable ripple effects and default the mode to Material Design: + +```tsx title="app.module.ts" import { IonicModule } from '@ionic/angular'; @NgModule({ ... imports: [ - BrowserModule, IonicModule.forRoot({ rippleEffect: false, mode: 'md' - }), - AppRoutingModule + }) ], ... }) ``` -䞊蚘の䟋では、アプリ党䜓でマテリアルデザむンのripple effectを無効にし、同時にmodeをマテリアルデザむンに統䞀しおいたす。 +## コンポヌネント単䜍のコンフィグ -## コンポヌネント毎の蚭定 +Ionic Configはリアクティブではありたせん。コンポヌネントがレンダリングされた埌にコンフィグの倀を曎新するず、以前の倀が適甚されたす。リアクティブな倀が必芁な堎合は、configを曎新するのではなく、コンポヌネントのプロパティを䜿甚するこずが掚奚されたす。 -Ionic Configはリアクティブではないため、構成をグロヌバルに蚭定するのではなく、デフォルトの動䜜を䞊曞きする堎合は、コンポヌネントのプロパティを䜿甚するこずをお勧めしたす。 +**Not recommended** -```tsx +```ts import { IonicModule } from '@ionic/angular'; @NgModule({ ... imports: [ - BrowserModule, IonicModule.forRoot({ + // Not recommended when your app requires reactive values backButtonText: 'Go Back' - }), - AppRoutingModule + }) ], ... }) ``` -この蚭定は `ion-back-button` のデフォルトのテキストを `Go Back` に倉曎したす。しかし、この蚭定を行っおいるず `backButtonText` を `Do Not Go Back` ず倉曎しおも、 `ion-back-button` のテキストは `Go Back` のたたでレンダリングされたす。ですので、 `ion-back-button` の `text` プロパティを䜿うこずをおすすめしたす。 +**Recommended** ```html - + ``` -この䟋では、 `ion-back-button` を䜿甚しお、蚀語やロケヌルの倉曎など、それを保蚌する倉曎がある堎合にテキストを動的に曎新できるようにしおいたす。 `getBackButtonText` メ゜ッドは、正しいテキストを返す凊理を行いたす。 +```ts +@Component(...) +class MyComponent { + backButtonText = this.config.get('backButtonText'); + + constructor(private config: Config) { } + + localeChanged(locale: string) { + if (locale === 'es_ES') { + this.backButtonText = 'Devolver'; + } + } + +} +``` ## プラットフォヌムごずの蚭定Per-Platform Config @@ -79,17 +92,15 @@ import { isPlatform, IonicModule } from '@ionic/angular'; @NgModule({ ... imports: [ - BrowserModule, IonicModule.forRoot({ animated: !isPlatform('mobileweb') - }), - AppRoutingModule + }) ], ... }) ``` -次の䟋では、プラットフォヌムに基づいおたったく異なる構成を蚭定し、䞀臎するプラットフォヌムがない堎合はデフォルトの構成に戻すこずができたす: +**プラットフォヌムごずの蚭定ずフォヌルバック機胜により、䞍䞀臎のプラットフォヌムにも察応:** ```tsx import { isPlatform, IonicModule } from '@ionic/angular'; @@ -109,15 +120,13 @@ const getConfig = () => { @NgModule({ ... imports: [ - BrowserModule, - IonicModule.forRoot(getConfig()), - AppRoutingModule + IonicModule.forRoot(getConfig()) ], ... }) ``` -最埌に、この䟋では、異なるプラットフォヌム芁件に基づいお構成オブゞェクトを蚭定できたす: +**プラットフォヌムごずの蚭定䞊曞き:** ```tsx import { isPlatform, IonicModule } from '@ionic/angular'; @@ -139,15 +148,77 @@ const getConfig = () => { @NgModule({ ... imports: [ - BrowserModule, - IonicModule.forRoot(getConfig()), - AppRoutingModule + IonicModule.forRoot(getConfig()) ], ... }) ``` -## Configオプション +## Methods + +### get + +| | | +| --------------- | -------------------------------------------------------------------------------- | +| **Description** | Returns a config value as an `any`. Returns `null` if the config is not defined. | +| **Signature** | `get(key: string, fallback?: any) => any` | + +#### Examples + +```ts +import { Config } from '@ionic/angular'; + +@Component(...) +class AppComponent { + constructor(config: Config) { + const mode = config.get('mode'); + } +} +``` + +### getBoolean + +| | | +| --------------- | ------------------------------------------------------------------------------------ | +| **Description** | Returns a config value as a `boolean`. Returns `false` if the config is not defined. | +| **Signature** | `getBoolean(key: string, fallback?: boolean) => boolean` | + +#### Examples + +```ts +import { Config } from '@ionic/angular'; + +@Component(...) +class AppComponent { + constructor(config: Config) { + const swipeBackEnabled = config.getBoolean('swipeBackEnabled'); + } +} +``` + +### getNumber + +| | | +| --------------- | ------------------------------------------------------------------------------- | +| **Description** | Returns a config value as a `number`. Returns `0` if the config is not defined. | +| **Signature** | `getNumber(key: string, fallback?: number) => number` | + +#### Examples + +```ts +import { Config } from '@ionic/angular'; + +@Component(...) +class AppComponent { + constructor(config: Config) { + const keyboardHeight = config.getNumber('keyboardHeight'); + } +} +``` + +## Interfaces + +### Configオプション 以䞋はIonicが䜿甚する蚭定オプションのリストです。 @@ -158,6 +229,7 @@ const getConfig = () => { | `alertEnter` | `AnimationBuilder` | Provides a custom enter animation for all `ion-alert`, overriding the default "animation". | | `alertLeave` | `AnimationBuilder` | Provides a custom leave animation for all `ion-alert`, overriding the default "animation". | | `animated` | `boolean` | If `true`, Ionic will enable all animations and transitions across the app. | +| `backButtonDefaultHref` | `string` | Overrides the default value for the `defaultHref` property in all `` components. | | `backButtonIcon` | `string` | Overrides the default icon in all `` components. | | `backButtonText` | `string` | Overrides the default text in all `` components. | | `hardwareBackButton` | `boolean` | If `true`, Ionic will respond to the hardware back button in an Android device. | @@ -183,5 +255,7 @@ const getConfig = () => { | `statusTap` | `boolean` | If `true`, clicking or tapping the status bar will cause the content to scroll to the top. | | `swipeBackEnabled` | `boolean` | If `true`, Ionic will enable the "swipe-to-go-back" gesture across the application. | | `tabButtonLayout` | `TabButtonLayout` | Overrides the default "layout" of all `ion-bar-button` across the whole application. | +| `toastDuration` | `number` | Overrides the default `duration` for all `ion-toast` components. | | `toastEnter` | `AnimationBuilder` | Provides a custom enter animation for all `ion-toast`, overriding the default "animation". | | `toastLeave` | `AnimationBuilder` | Provides a custom leave animation for all `ion-toast`, overriding the default "animation". | +| `toggleOnOffLabels` | `boolean` | Overrides the default `enableOnOffLabels` in all `ion-toggle` components. | diff --git a/docs/angular/navigation.md b/docs/angular/navigation.md index def1a8c25f5..1fd76d76af8 100644 --- a/docs/angular/navigation.md +++ b/docs/angular/navigation.md @@ -178,6 +178,54 @@ import { LoginComponent } from './login.component'; ここでは、`RouterModule` のむンポヌトずずもに、兞型的な `Angular Module` の蚭定がありたすが、`RouterModule` では `forChild` によっおコンポヌネントを䜿甚するこずを宣蚀しおいたす。この蚭定では、ビルドを実行するずきに、`App Component`Root、 `login Component` 、および `detail Component` においお別々のチャンクを䜜成したす。 +## Standalone Components + +:::caution Experimental API + +Standalone components is an experimental API introduced in Angular 14.x and available in Ionic 6.3 and later. This feature may change before it is stable. + +::: + +Standalone components allow developers to lazy load a component on a route without having to declare the component to an Angular module. + +To use standalone components with routing and Ionic Framework, you must first be on Ionic ^6.3.0. The experimental API requires developers to assign the `EnvironmentInjector` instance for each router outlet (`ion-router-outlet` and `ion-tabs`) that uses standalone component routing. + +```ts title="app.component.ts" +import { Component, EnvironmentInjector } from '@angular/core'; + +@Component({ + selector: 'app-root', + template: 'app.component.html', +}) +export class AppComponent { + constructor(public environmentInjector: EnvironmentInjector) {} +} +``` + +```html title="app.component.html" + + + ... +``` + +Developers can use the existing syntax for standalone component routing from Angular: + +```ts +@NgModule({ + imports: [ + RouterModule.forRoot([ + { + path: 'standalone-route', + loadComponent: () => import('./path/to/my-component.component').then((c) => c.MyComponent), + }, + ]), + ], +}) +export class AppRoutingModule {} +``` + +To get started with standalone components [visit Angular's official docs](https://angular.io/guide/standalone-components). + ## Live Example If you would prefer to get hands on with the concepts and code described above, please checkout our [live example](https://stackblitz.com/edit/ionic-angular-routing?file=src/app/app-routing.module.ts) of the topics above on StackBlitz. @@ -192,8 +240,8 @@ The following is an example of linear routing in a mobile app: