ngx-cho-components 2.0.0 → 4.0.0
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 +34 -96
- package/fesm2022/ngx-cho-components.mjs +723 -256
- package/fesm2022/ngx-cho-components.mjs.map +1 -1
- package/lib/cho-address-info.component.d.ts +2 -2
- package/lib/cho-card-header.component.d.ts +4 -2
- package/lib/cho-card-tabs.component.d.ts +1 -1
- package/lib/cho-card.component.d.ts +14 -16
- package/lib/cho-component.types.d.ts +2 -0
- package/lib/cho-detail-page.component.d.ts +26 -0
- package/lib/cho-details-card.component.d.ts +4 -4
- package/lib/cho-email-info.component.d.ts +2 -6
- package/lib/cho-pager.component.d.ts +23 -0
- package/lib/cho-phone-info.component.d.ts +2 -2
- package/lib/cho-radio-group.component.d.ts +13 -12
- package/lib/cho-review-status-alert.component.d.ts +3 -3
- package/lib/cho-search-card.component.d.ts +41 -0
- package/lib/index.d.ts +5 -5
- package/package.json +13 -6
- package/styles/_cards.scss +116 -0
- package/styles/_contact-info.scss +9 -0
- package/styles/_detail-page.scss +31 -0
- package/styles/_forms.scss +33 -0
- package/styles/_index.scss +8 -0
- package/styles/_pager.scss +45 -0
- package/styles/_responsive.scss +26 -0
- package/styles/_search-card.scss +44 -0
- package/styles/_status.scss +9 -0
package/README.md
CHANGED
|
@@ -1,111 +1,49 @@
|
|
|
1
|
-
# NgxChoComponents
|
|
2
|
-
|
|
3
|
-
This library provides reusable Angular components for CHO applications.
|
|
4
|
-
|
|
5
|
-
Generated with [Angular CLI](https://github.com/angular/angular-cli) version 19.2.26.
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
NgxChoComponents includes:
|
|
10
|
-
- `ChoAddressInfoComponent` - Address display and editing
|
|
11
|
-
- `ChoDetailsCardComponent` - Information card layout
|
|
12
|
-
- `ChoEmailInfoComponent` - Email display and validation
|
|
13
|
-
- `ChoPhoneInfoComponent` - Phone number display and formatting
|
|
14
|
-
- `ChoRadioGroupComponent` - Radio button group with validation
|
|
15
|
-
- `ChoReviewStatusAlertComponent` - Status alert messages
|
|
16
|
-
|
|
17
|
-
## Dependencies
|
|
1
|
+
# NgxChoComponents
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
- **ngx-cho-common** (must be built first)
|
|
21
|
-
|
|
22
|
-
This library does not require Bootstrap, ng-bootstrap, Popper, or PrimeNG.
|
|
3
|
+
`ngx-cho-components` is the canonical home for reusable rendered UI across CHO Angular applications. Version 4 targets Angular 19 and PrimeNG 19 and has no Bootstrap, ng-bootstrap, PrimeFlex, Tailwind-presentation, toast, or spinner dependency.
|
|
23
4
|
|
|
24
5
|
## Installation
|
|
25
6
|
|
|
26
7
|
```bash
|
|
27
|
-
npm install ngx-cho-
|
|
8
|
+
npm install --save-exact ngx-cho-common@4.0.0 ngx-cho-components@4.0.0
|
|
28
9
|
```
|
|
29
10
|
|
|
30
|
-
|
|
11
|
+
Applications must provide compatible Angular Common, Core, and Forms packages plus PrimeNG 19.
|
|
31
12
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Build
|
|
35
|
-
|
|
36
|
-
**Important**: Build `ngx-cho-common` first before building this library.
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# Build dependencies first
|
|
40
|
-
ng build ngx-cho-common
|
|
41
|
-
|
|
42
|
-
# Then build this library
|
|
43
|
-
ng build ngx-cho-components
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Build artifacts will be stored in the `dist/ngx-cho-components` directory.
|
|
47
|
-
|
|
48
|
-
## Development
|
|
49
|
-
|
|
50
|
-
### Code Scaffolding
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
ng generate component component-name --project ngx-cho-components
|
|
54
|
-
ng generate service service-name --project ngx-cho-components
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
> Note: Always include `--project ngx-cho-components` or the component will be added to the default project.
|
|
58
|
-
|
|
59
|
-
### Running Tests
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
ng test ngx-cho-components
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Publishing
|
|
13
|
+
Import component styles once in the application root stylesheet, after the Common foundation:
|
|
66
14
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
ng build ngx-cho-components --configuration production
|
|
72
|
-
```
|
|
73
|
-
3. **Publish to npm**:
|
|
74
|
-
```bash
|
|
75
|
-
cd dist/ngx-cho-components
|
|
76
|
-
npm publish
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Usage
|
|
80
|
-
|
|
81
|
-
Import the components module in your application:
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
import { NgxChoComponentsModule } from 'ngx-cho-components';
|
|
85
|
-
|
|
86
|
-
@NgModule({
|
|
87
|
-
imports: [NgxChoComponentsModule],
|
|
88
|
-
// ...
|
|
89
|
-
})
|
|
90
|
-
export class AppModule {}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
Use components in your templates:
|
|
15
|
+
```scss
|
|
16
|
+
@use 'ngx-cho-common/styles';
|
|
17
|
+
@use 'ngx-cho-components/styles';
|
|
18
|
+
```
|
|
94
19
|
|
|
95
|
-
|
|
96
|
-
|
|
20
|
+
## Public UI
|
|
21
|
+
|
|
22
|
+
- `ChoSearchCardComponent` composes a consistent card, named toolbar/filter/tab/content templates, optional paging, semantic padding, embedding, and configurable heading levels.
|
|
23
|
+
- `ChoDetailPageComponent` composes a header/tabs card with a separate projected feature body, a configurable heading, semantic body padding, and an optional back action.
|
|
24
|
+
- `ChoPagerComponent` maps PrimeNG paginator events to immutable `PaginationInstance` values. Query synchronization is explicit and its dropdown overlay appends to `body` by default.
|
|
25
|
+
- `ChoCardComponent`, `ChoDetailsCardComponent`, contact display components, `ChoRadioGroupComponent`, and `ChoReviewStatusAlertComponent` provide the remaining reusable visual contracts.
|
|
26
|
+
|
|
27
|
+
Named slots are declared on `ng-template` elements:
|
|
97
28
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
29
|
+
```html
|
|
30
|
+
<cho-search-card cardTitle="Jobs" [pager]="pager" [syncPagerQueryParams]="false">
|
|
31
|
+
<ng-template choSearchCardFilters>...</ng-template>
|
|
32
|
+
<ng-template choSearchCardToolbar>...</ng-template>
|
|
33
|
+
<ng-template choSearchCardContent>...</ng-template>
|
|
34
|
+
</cho-search-card>
|
|
102
35
|
```
|
|
103
36
|
|
|
104
|
-
|
|
37
|
+
Use `contentPadding="none"`, `compact`, or `comfortable`; wrap feature-specific layout in projected content instead of passing arbitrary classes into shared UI.
|
|
38
|
+
Embedded SearchCards omit their own header and tabs. They retain filters, named content, and paging so callers can place them inside an application-owned surface without nested card chrome.
|
|
39
|
+
|
|
40
|
+
## Build and Validation
|
|
105
41
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
42
|
+
```bash
|
|
43
|
+
npm run build:components
|
|
44
|
+
npx ng test ngx-cho-components --watch=false --browsers=ChromeHeadless
|
|
45
|
+
npm run test:style-contract
|
|
46
|
+
npm run publish:components:dry
|
|
47
|
+
```
|
|
109
48
|
|
|
110
|
-
|
|
111
|
-
- [Angular Library Development Guide](https://angular.io/guide/creating-libraries)
|
|
49
|
+
The guarded build verifies the Sass interface, peer contract, export targets, and packed tarball. Publishing is intentionally limited to the `next` tag by the package-specific command.
|