@awc-ui/angular 1.0.0-beta.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -21
- package/fesm2022/awc-ui-angular.mjs +402 -309
- package/fesm2022/awc-ui-angular.mjs.map +1 -1
- package/index.d.ts +2137 -11
- package/package.json +8 -9
- package/awc-ui.module.d.ts +0 -72
- package/directives/angular-component-lib/utils.d.ts +0 -9
- package/directives/boolean-value-accessor.d.ts +0 -9
- package/directives/index.d.ts +0 -2
- package/directives/number-value-accessor.d.ts +0 -9
- package/directives/proxies.d.ts +0 -2005
- package/directives/radio-value-accessor.d.ts +0 -8
- package/directives/select-value-accessor.d.ts +0 -8
- package/directives/switch-value-accessor.d.ts +0 -21
- package/directives/text-value-accessor.d.ts +0 -8
- package/directives/value-accessor.d.ts +0 -18
- package/esm2022/awc-ui-angular.mjs +0 -5
- package/esm2022/awc-ui.module.mjs +0 -105
- package/esm2022/directives/angular-component-lib/utils.mjs +0 -59
- package/esm2022/directives/boolean-value-accessor.mjs +0 -38
- package/esm2022/directives/index.mjs +0 -85
- package/esm2022/directives/number-value-accessor.mjs +0 -40
- package/esm2022/directives/proxies.mjs +0 -2378
- package/esm2022/directives/radio-value-accessor.mjs +0 -35
- package/esm2022/directives/select-value-accessor.mjs +0 -35
- package/esm2022/directives/switch-value-accessor.mjs +0 -53
- package/esm2022/directives/text-value-accessor.mjs +0 -35
- package/esm2022/directives/value-accessor.mjs +0 -40
- package/esm2022/index.mjs +0 -15
package/README.md
CHANGED
|
@@ -1,43 +1,65 @@
|
|
|
1
1
|
# Angular Web Components and Angular SSR — @awc-ui/angular
|
|
2
2
|
|
|
3
|
-
Angular
|
|
3
|
+
Angular 20.3.31+ integration for AWC UI.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The wrapper is built with the patched Angular 20 compiler. Applications must use
|
|
6
|
+
Angular 20.3.31 or newer; upgrade Angular before updating this package from a
|
|
7
|
+
version that supported Angular 17–19.
|
|
8
|
+
|
|
9
|
+
`@awc-ui/angular` provides standalone component proxies and Angular form value
|
|
10
|
+
accessors. Imports register their custom elements automatically.
|
|
6
11
|
|
|
7
12
|
```bash
|
|
8
13
|
npm install @awc-ui/angular @awc-ui/core
|
|
9
14
|
```
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
Load the theme once in your application entry:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import '@awc-ui/core/css/tokens.css';
|
|
20
|
+
```
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
For a standalone component, import the controls and accessors into its template
|
|
23
|
+
scope, alongside Angular's forms module:
|
|
14
24
|
|
|
15
25
|
```ts
|
|
16
|
-
|
|
17
|
-
import {
|
|
26
|
+
import { Component } from '@angular/core';
|
|
27
|
+
import { FormsModule } from '@angular/forms';
|
|
28
|
+
import { MdButton, MdTextField, TextValueAccessor } from '@awc-ui/angular';
|
|
18
29
|
|
|
19
|
-
@
|
|
20
|
-
|
|
30
|
+
@Component({
|
|
31
|
+
selector: 'app-root',
|
|
32
|
+
standalone: true,
|
|
33
|
+
imports: [FormsModule, MdButton, MdTextField, TextValueAccessor],
|
|
34
|
+
template: `
|
|
35
|
+
<md-text-field label="Email" type="email" [(ngModel)]="email"></md-text-field>
|
|
36
|
+
<md-button variant="filled">Continue</md-button>
|
|
37
|
+
`,
|
|
21
38
|
})
|
|
22
|
-
export class
|
|
39
|
+
export class AppComponent {
|
|
40
|
+
email = '';
|
|
41
|
+
}
|
|
23
42
|
```
|
|
24
43
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import { AwcUiModule, provideAwcUi } from "@awc-ui/angular";
|
|
44
|
+
For convenience, `imports: [FormsModule, AwcUiModule]` supplies every component
|
|
45
|
+
and accessor. Use `ReactiveFormsModule` for `formControl` and `formControlName`.
|
|
46
|
+
NgModule applications also put `AwcUiModule` in `imports`.
|
|
29
47
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
`importProvidersFrom(AwcUiModule)` does not add directives to a standalone
|
|
49
|
+
component's template scope. `provideAwcUi()` is only needed for applications
|
|
50
|
+
using the lazy loader with raw tags; imported proxies already register themselves.
|
|
51
|
+
|
|
52
|
+
Radio controls bind the selected option's `value`, preserving each radio's
|
|
53
|
+
identity. Import both `MdRadio` and `RadioValueAccessor` for individual imports:
|
|
34
54
|
|
|
35
55
|
```html
|
|
36
|
-
<md-
|
|
56
|
+
<md-radio name="plan" value="basic" [(ngModel)]="plan">Basic</md-radio>
|
|
57
|
+
<md-radio name="plan" value="pro" [(ngModel)]="plan">Pro</md-radio>
|
|
37
58
|
```
|
|
38
59
|
|
|
39
|
-
|
|
60
|
+
Initialize `plan` to `'basic'` or `'pro'`; resetting the form to `null` clears the
|
|
61
|
+
selection. Multi-select accessors normalize a form reset to an empty array.
|
|
40
62
|
|
|
41
|
-
|
|
63
|
+
## Server rendering
|
|
42
64
|
|
|
43
|
-
|
|
65
|
+
See the [Angular SSR guide](https://awc-ui.dev/frameworks/angular/) for the shared hydration lifecycle and reference application.
|