Commit Graph

73 Commits

Author SHA1 Message Date
Sean Perkins
28f2ec9c62 feat(angular): standalone form controls can participate in forms (#28125)
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Ionic standalone form controls cannot participate in Angular forms.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Ionic form controls can participate in Angular forms by importing the
standalone component
- Applies to: `ion-input`, `ion-textarea`, `ion-searchbar`,
`ion-toggle`, `ion-checkbox`, `ion-segment`, `ion-radio`,
`ion-radio-group`, `ion-datetime` and `ion-range`.
- Refactors `ValueAccessor` from `@ionic/angular` to
`@ionic/angular/common`
- Refactors `raf` utility from `@ionic/angular` to
`@ionic/angular/common`

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

---------
2023-09-19 12:46:28 -04:00
Maria Hutt
fd0f25aa72 Merge remote-tracking branch 'origin/main' into FW-4612-sync 2023-09-06 13:24:09 -07:00
Sean Perkins
77707b8c1e fix(angular): min/max validator for ion-input type number (#27993)
Issue number: Resolves #23480

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Angular's min/max validators do not work with `ion-input[type=number]`.
Using the built-in validators with `ion-input` will not update the
control status to invalid, reflect the `ng-invalid` class or report the
correct errors.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- The `IonicModule` now includes two additional directive declarations
that extend Angular's built-in min/max validators and target the
`ion-input` component when using `type="number"`.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
2023-08-18 18:34:02 +00:00
Sean Perkins
bbfb8f81a6 fix(angular): ionTabsWillChange is fired before tab activation (#27991)
Issue number: Resolves #27212

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

`ionTabsWillChange` emits _after_ the tab view is activated in the
stack.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- `ionTabsWillChange` emits _before_ the tab view is activated in the
stack.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev-build: `7.2.4-dev.11692040948.1fd0ecd2`
2023-08-18 15:07:09 +00:00
Sean Perkins
e57759f4b6 chore(angular): generate standalone component wrappers (#27970)
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Ionic Framework currently only generates the lazy/hydrated Angular
component wrappers for the web components.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Generates Angular standalone component wrappers for the web
components, using the CE build.
  - Adds manual component wrapper for `ion-icon` with the CE build.
- Migrates the `ion-back-button` and `ion-nav` to be manual component
wrappers
- Continues to generate the lazy/hydrated Angular component wrappers.
- Refactors "NavDelegate" etc. language to `IonNav` to avoid exporting
as and simplify navigating the code.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Related output targets PR:
https://github.com/ionic-team/stencil-ds-output-targets/pull/367
2023-08-18 11:02:16 -04:00
Liam DeBeasi
ca53682684 feat(angular): add standalone provideIonicAngular (#27996) 2023-08-15 15:32:27 -04:00
Liam DeBeasi
c65e08dcd1 feat(angular): add standalone providers, route strategy, component binding provider (#27997) 2023-08-15 11:45:37 -04:00
Maria Hutt
c52a0972b9 feat(angular): add standalone nav (#27876) 2023-08-04 16:20:39 -07:00
Liam DeBeasi
8a97e406a0 feat(angular): add standalone popover (#27883) 2023-08-04 16:55:46 -04:00
Liam DeBeasi
37acdf9711 feat(angular): add standalone modal (#27885) 2023-08-04 15:45:50 -04:00
Liam DeBeasi
9f20780d66 feat(angular): add standalone back-button (#27927) 2023-08-04 15:12:11 -04:00
Liam DeBeasi
de48493a16 refactor(angular): move remaining directives to common module (#27909) 2023-08-04 13:46:45 -04:00
Liam DeBeasi
5b31439ca0 refactor(angular): move providers to common library (#27899) 2023-08-01 15:59:53 -04:00
Sean Perkins
90f41243d9 feat(angular): support binding routing data to component inputs (#27694)
Issue number: Resolves #27476

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Ionic Angular application on Angular v16 cannot use the
[`bindToComponentInputs`](https://angular.io/api/router/ExtraOptions#bindToComponentInputs)
feature to assign route parameters, query parameters, route data and
route resolve data to component inputs.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Ionic Angular developers can use the option on `RouterModule.forRoot`
to enable the Angular feature for binding the route snapshot data to the
component inputs.

**Modules**
```ts
@NgModule({
  imports: [
    RouterModule.forRoot([/* your routes */], { 
      bindToComponentInputs: true // <-- enable this feature
    })
  ]
})
export class AppModule { }
```

**Standalone**

```ts
import { withComponentInputBinding } from '@angular/router';

bootstrapApplication(App, {
  providers: [
    provideRouter(routes, 
      //... other features
      withComponentInputBinding() // <-- enable this feature
    )
  ],
});
```

With this feature enabled, developers can bind route parameters, query
parameters, route data and the returned value from a resolver to input
bindings on their component.

For example, with a route configuration of:
```ts
RouterModule.forChild([
  {
    path: ':id',
    data: {
      title: 'Hello world'
    },
    resolve: {
      name: () => 'Resolved name'
    },
    loadComponent: () => import('./example-component/example.component').then(c => c.ExampleComponent)
  }
])
```
and a component configuration of:

```ts
@Component({ }) 
export class ExampleComponent {
  @Input() id?: string;
  @Input() title?: string;
  @Input() name?: string;
  @Input() query?: string;
}
```

Navigating to the component with a url of: `/2?query=searchphrase`

The following would occur:
- `id` would return `2`
- `title` would return `Hello world`
- `name` would return `Resolved name`
- `query` would return `searchphrase`

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

This PR will need to be targeted to a minor release once a design doc is
approved by the team.

Dev-build: `7.1.3-dev.11689276547.129acb40`
2023-07-18 16:26:37 -04:00
Nicolas Sandron
71310372c9 feat(searchbar): add name property (#27737)
resolves #27675
2023-07-17 11:43:00 -04:00
Liam DeBeasi
32bc33ed28 refactor(angular): move to packages directory (#27719)
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

The `angular` directory sits at the root of the project instead of in
`packages` with all the other JS Framework integrations. This does not
cause any functional issues with Ionic, but it is confusing since
integrations are not in a consistent place.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Moves the `angular` directory to `packages/angular`

Note: Most files should remain unchanged. The only files I changed are
the files that had direct paths to the old `angular` directory:

1. Removes the `angular` path in `lerna.json`. This is now covered by
`packages/*`
2. Updated the angular file path in `.gitignore`
3. Updates the path to the angular package in `stencil.config.ts` for
the Angular Output Targets
4. Updates some of Angular's sync scripts to correctly get the core
stylesheets as well as the core package.
5. Updates the test app sync script to correctly sync core and
angular-server

~I'm not entirely sure why GitHub thinks
https://github.com/ionic-team/ionic-framework/pull/27719/files#diff-f5bba7e7c7c75426e2b9c89868310cb03890493b4efe0252adf8d12cc8398962
is a new file since it exists in `main` here:
1f06be4a31/angular/test/base/scripts/build-ionic.sh~
Fixed in
6e7fc49827

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.1.2-dev.11688052109.13454f5c`
2023-07-05 17:52:35 +00:00
Brandy Carney
d37623a2ca chore(packages): move the packages to root 2018-03-12 16:02:25 -04:00
Adam Bradley
851aa838fa refactor(router): init ng router refactor 2018-03-06 19:57:45 -06:00
Adam Bradley
a1f942d45e chore(cleanup): remove unused code 2018-03-06 19:56:53 -06:00
Manu Mtz.-Almeida
4ec3e488ea fix(zone): forgot to remove console.logs 2018-03-04 16:08:30 +01:00
Adam Bradley
aa91d11726 fix(testing): do not throw error for missing Ionic global 2018-03-04 07:29:16 -06:00
Manu Mtz.-Almeida
8b605bf2d2 chore(): update to latest stencil 2018-03-03 16:11:52 +01:00
Adam Bradley
7366c38abc perf(events): bypass ngzone 2018-03-02 22:56:39 -06:00
Adam Bradley
756dc6e306 refactor(events): remove Events feat from core 2018-03-02 14:52:34 -06:00
Adam Bradley
79eddec369 fix(events): fix ionic/angular events 2018-03-01 16:32:29 -06:00
Adam Bradley
9c93df48d8 style(lint): fix lint errors 2018-03-01 16:21:06 -06:00
Ken Sodemann
c3362fecd5 fix(angular): move module sensitive controllers out of forRoot() 2018-02-28 11:46:17 -06:00
Dan Bucholtz
6c1056b9cb feature(platform): implement a web component that provides access to a small subset of platform information 2018-02-19 14:19:42 -06:00
Ken Sodemann
cc59a4e1fb feat(value-accessors): set ionic classes 2018-02-16 17:33:00 -06:00
Dan Bucholtz
3f6e1ddbcd refactor(external-router): remove the external router controller, move the reconciliation methods to the nav itself, and move the external activation status information to ion-app 2018-02-15 23:14:09 -06:00
Dan Bucholtz
4524d59e46 refactor(angular): remove reflective injector and use static injector instead 2018-02-15 16:27:38 -06:00
Dan Bucholtz
8ec8b43408 refactor(router): monkey patch the router instead of extending it 2018-02-15 16:27:38 -06:00
Dan Bucholtz
8c8b8548e7 feature(angular): nav-params integrate with router 2018-02-13 15:05:20 -06:00
Dan Bucholtz
4271a0fc1e feature(routing): create external router controller for reconciling state from router in re-useable fashion
* external router controller

* external router controller

* gif it's working
2018-02-13 01:28:39 -06:00
Dan Bucholtz
edeb1324c9 refactor(nav): implement nav integration with external router (angular to start) 2018-02-13 00:02:48 -06:00
Manu Mtz.-Almeida
255c3dd1ae refactor(all): componentOnReady is part of the types 2018-02-10 01:52:51 +01:00
Manu Mtz.-Almeida
9226684826 perf(virtual-scroll): reduce DOM writes 2018-02-09 17:22:37 +01:00
Dan Bucholtz
73ce15f7da refactor(router): separate nav and router-outlet into two seperate directives 2018-02-06 00:50:00 -06:00
Dan Bucholtz
97baabde93 chore(routing): update routing package 2018-02-06 00:13:41 -06:00
Ken Sodemann
40f9cd5ece fix(valueAccessors): add disabled state handling 2018-02-02 17:06:17 -06:00
Manu Mtz.-Almeida
0babb2ece2 fix(virtual-scroll): working in angular 2018-02-01 23:39:46 +01:00
Ken Sodemann
41ccdd52a6 feat(range): hookup the ion-range with a custom value accessor 2018-01-31 12:11:13 -06:00
Dan Bucholtz
547a3464ba chore(): revert back to our custom ng router package for now 2018-01-31 11:17:57 -06:00
Dan Bucholtz
ab2176b6ce refactor(nav): add initial support for url in general, add integration w/ ng-router 2018-01-31 10:52:50 -06:00
Dan Bucholtz
caca8ef864 feature(menu): add menuToggle directive 2018-01-09 15:49:48 -06:00
Dan Bucholtz
135d6b6e78 refactor(value-accessors): add searchbar 2018-01-09 15:09:36 -06:00
Dan Bucholtz
a0121dd3bc refactor(delegate): don't wrap in ion-page 2018-01-09 13:22:24 -06:00
Dan Bucholtz
a15f9dfdc6 refactor(): add menu-controller, make updates to modal and nav controllers 2018-01-09 00:07:03 -06:00
Dan Bucholtz
61713ffba5 fix(modal-controller): fix order of params 2018-01-08 13:38:46 -06:00
Dan Bucholtz
adf65fbf0d refactor(modal): add dismiss api 2018-01-08 13:29:10 -06:00