@cngx/ui 0.1.0-rc.2 → 0.1.0-rc.4

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.
Files changed (48) hide show
  1. package/README.md +15 -7
  2. package/accordion/README.md +86 -0
  3. package/collection/README.md +167 -0
  4. package/data-grid-accordion/README.md +137 -0
  5. package/fesm2022/cngx-ui-accordion.mjs +853 -0
  6. package/fesm2022/cngx-ui-accordion.mjs.map +1 -0
  7. package/fesm2022/cngx-ui-action-button.mjs +2 -2
  8. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  9. package/fesm2022/cngx-ui-breadcrumb.mjs +1044 -0
  10. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -0
  11. package/fesm2022/cngx-ui-collection.mjs +645 -0
  12. package/fesm2022/cngx-ui-collection.mjs.map +1 -0
  13. package/fesm2022/cngx-ui-data-grid-accordion.mjs +1135 -0
  14. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -0
  15. package/fesm2022/cngx-ui-empty-state.mjs +2 -2
  16. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-feedback.mjs +10 -10
  18. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-mat-accordion.mjs +229 -0
  20. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -0
  21. package/fesm2022/cngx-ui-mat-paginator.mjs +215 -0
  22. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -0
  23. package/fesm2022/cngx-ui-paginator.mjs +1937 -0
  24. package/fesm2022/cngx-ui-paginator.mjs.map +1 -0
  25. package/fesm2022/cngx-ui-sidenav.mjs +547 -65
  26. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-tabs.mjs +8 -6
  28. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  29. package/fesm2022/cngx-ui.mjs +2 -2
  30. package/fesm2022/cngx-ui.mjs.map +1 -1
  31. package/mat-accordion/README.md +48 -0
  32. package/mat-paginator/README.md +135 -0
  33. package/package.json +29 -5
  34. package/paginator/README.md +134 -0
  35. package/sidenav/README.md +89 -3
  36. package/types/cngx-ui-accordion.d.ts +801 -0
  37. package/types/cngx-ui-breadcrumb.d.ts +890 -0
  38. package/types/cngx-ui-collection.d.ts +396 -0
  39. package/types/cngx-ui-data-grid-accordion.d.ts +912 -0
  40. package/types/cngx-ui-mat-accordion.d.ts +63 -0
  41. package/types/cngx-ui-mat-paginator.d.ts +108 -0
  42. package/types/cngx-ui-paginator.d.ts +1147 -0
  43. package/types/cngx-ui-sidenav.d.ts +429 -21
  44. package/types/cngx-ui-tabs.d.ts +2 -0
  45. package/fesm2022/cngx-ui-material.mjs +0 -90
  46. package/fesm2022/cngx-ui-material.mjs.map +0 -1
  47. package/material/README.md +0 -90
  48. package/types/cngx-ui-material.d.ts +0 -47
@@ -1,90 +0,0 @@
1
- # CngxMatPaginator
2
-
3
- Material paginator wrapper connecting to a CngxPaginate directive via explicit `[cngxPaginateRef]` input.
4
-
5
- ## Import
6
-
7
- ```typescript
8
- import { CngxMatPaginator } from '@cngx/ui/material';
9
- ```
10
-
11
- ## Quick Start
12
-
13
- ```typescript
14
- import { Component, signal } from '@angular/core';
15
- import { MatTableModule } from '@angular/material/table';
16
- import { CngxPaginate } from '@cngx/common/data';
17
- import { CngxMatPaginator } from '@cngx/ui/material';
18
-
19
- @Component({
20
- selector: 'app-example',
21
- template: `
22
- <div cngxPaginate #pg="cngxPaginate" [total]="items.length">
23
- <table mat-table [dataSource]="paginatedItems()">
24
- <!-- table columns -->
25
- </table>
26
- </div>
27
- <cngx-mat-paginator [cngxPaginateRef]="pg" />
28
- `,
29
- imports: [MatTableModule, CngxMatPaginator],
30
- })
31
- export class ExampleComponent {
32
- readonly items = [];
33
-
34
- readonly paginatedItems = computed(() => {
35
- const pg = inject(CngxPaginate);
36
- return this.items.slice(pg.pageIndex() * pg.pageSize(), (pg.pageIndex() + 1) * pg.pageSize());
37
- });
38
- }
39
- ```
40
-
41
- ## Overview
42
-
43
- `CngxMatPaginator` is a Material Design paginator component that wraps the Material `mat-paginator` element and wires it to a `CngxPaginate` directive. It provides:
44
-
45
- - **Type-safe integration** - Explicit `[cngxPaginateRef]` input (no ancestor injection)
46
- - **Automatic state sync** - Page index, page size, and total count are automatically synchronized
47
- - **Page size selector** - Customizable page size options via `[pageSizeOptions]`
48
- - **Disabled state** - Paginator disables when `CngxPaginate.isBusy()` is true
49
-
50
- The component requires an explicit reference to the `CngxPaginate` directive instance - no hidden ancestor injection, no implicit wiring.
51
-
52
- ## Accessibility
53
-
54
- `CngxMatPaginator` delegates accessibility to Material's `mat-paginator` component. The Material paginator is fully accessible with:
55
-
56
- - **ARIA labels** - Paginator navigation and page size controls are properly labeled
57
- - **Keyboard navigation** - Tab order and keyboard shortcuts for page navigation
58
- - **Disabled state** - When `isBusy()` is true, controls are disabled and announced to screen readers
59
-
60
- ## Composition
61
-
62
- `CngxMatPaginator` composes:
63
-
64
- - **Material paginator** - `mat-paginator` component from `@angular/material/paginator`
65
- - **CngxPaginate directive** - Manages pagination state (page index, page size, total)
66
- - **Event handling** - Subscribes to Material paginator's `page` event and updates directive state
67
-
68
- ## How It Works
69
-
70
- 1. **Setup** - Consumer applies `cngxPaginate` on a container element and assigns a template reference
71
- 2. **Data binding** - Consumer passes `[total]="items.length"` to the directive
72
- 3. **Component wire-up** - `CngxMatPaginator` binds to the directive via `[cngxPaginateRef]`
73
- 4. **State sync** - Component reads `ref.pageIndex()`, `ref.pageSize()`, `ref.total()` and binds to Material's `mat-paginator`
74
- 5. **User interaction** - When user changes page or page size, Material's `page` event fires
75
- 6. **State update** - `CngxMatPaginator.handlePage()` calls `ref.setPageSize()` and `ref.setPage()` to update directive state
76
- 7. **Data refresh** - Consumer reactively filters/slices data based on directive signals
77
-
78
- ## Material Theming
79
-
80
- `CngxMatPaginator` uses the standard Material `mat-paginator` component, which inherits theming from your Material theme automatically. No additional theme configuration needed - include the Material theme in your global stylesheet.
81
-
82
- ```scss
83
- @use '@angular/material' as mat;
84
-
85
- $theme: mat.define-theme((...));
86
-
87
- html {
88
- @include mat.all-component-themes($theme);
89
- }
90
- ```
@@ -1,47 +0,0 @@
1
- import * as _angular_core from '@angular/core';
2
- import { PageEvent } from '@angular/material/paginator';
3
- import { CngxPaginate } from '@cngx/common/data';
4
-
5
- /**
6
- * Material paginator wrapper that connects to a {@link CngxPaginate} directive
7
- * via an explicit `[cngxPaginateRef]` input - no ancestor injection.
8
- *
9
- * ```html
10
- * <div cngxPaginate #pg="cngxPaginate" [total]="items.length">
11
- * <!-- table / list -->
12
- * </div>
13
- * <cngx-mat-paginator [cngxPaginateRef]="pg" />
14
- * ```
15
- *
16
- * For SmartDataSource integration, expose `filteredCount` from the data source
17
- * and bind it to `[total]` on the element that carries `cngxPaginate`:
18
- * ```html
19
- * <div cngxPaginate #pg="cngxPaginate" [total]="ds.filteredCount()">
20
- * <mat-table [dataSource]="ds" />
21
- * </div>
22
- * <cngx-mat-paginator [cngxPaginateRef]="pg" />
23
- * ```
24
- *
25
- * @category ui/material
26
- * @docsKind primary
27
- * @wcag AA
28
- * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/material/mat-paginator.ts
29
- * @since 0.1.0
30
- * @relatedTo CngxPaginate, CngxDataSource
31
- * <example-url>http://localhost:4200/#/common/data/data-source/datasource-cngxpaginate-manual-pipeline</example-url>
32
- * <example-url>http://localhost:4200/#/common/data/data-source/signal-observable-bridge</example-url>
33
- * <example-url>http://localhost:4200/#/common/data/paginate-list/paginated-list-cngxpaginate-cngxmatpaginator</example-url>
34
- * <example-url>http://localhost:4200/#/common/data/paginate-list/uncontrolled-mode-zero-class-boilerplate</example-url>
35
- */
36
- declare class CngxMatPaginator {
37
- /** The `CngxPaginate` directive instance to connect to. */
38
- readonly cngxPaginateRef: _angular_core.InputSignal<CngxPaginate>;
39
- /** Options for the page-size selector. */
40
- readonly pageSizeOptions: _angular_core.InputSignal<number[]>;
41
- protected readonly ref: _angular_core.InputSignal<CngxPaginate>;
42
- protected handlePage(event: PageEvent): void;
43
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMatPaginator, never>;
44
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxMatPaginator, "cngx-mat-paginator", never, { "cngxPaginateRef": { "alias": "cngxPaginateRef"; "required": true; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
45
- }
46
-
47
- export { CngxMatPaginator };