@drsutphin/ngx-mat-facet-toolkit 1.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.
Files changed (33) hide show
  1. package/README.md +62 -0
  2. package/_facet-toolkit-theme.scss +66 -0
  3. package/fesm2022/drsutphin-ngx-mat-facet-toolkit.mjs +1093 -0
  4. package/fesm2022/drsutphin-ngx-mat-facet-toolkit.mjs.map +1 -0
  5. package/index.d.ts +5 -0
  6. package/lib/directives/focus-on-show.directive.d.ts +12 -0
  7. package/lib/facet-toolkit.config.d.ts +4 -0
  8. package/lib/misc/parent.helper.d.ts +7 -0
  9. package/lib/modals/facet-details-modal/facet-details-modal.component.d.ts +41 -0
  10. package/lib/modals/facet-modal/facet-modal.animations.d.ts +4 -0
  11. package/lib/modals/facet-modal/facet-modal.component.d.ts +23 -0
  12. package/lib/modals/facet-modal.config.d.ts +12 -0
  13. package/lib/modals/facet-modal.data.d.ts +2 -0
  14. package/lib/modals/facet-modal.ref.d.ts +17 -0
  15. package/lib/modals/facet-modal.service.d.ts +14 -0
  16. package/lib/models/facet-data-type.model.d.ts +10 -0
  17. package/lib/models/facet-definition.model.d.ts +24 -0
  18. package/lib/models/facet-editor-state.model.d.ts +9 -0
  19. package/lib/models/facet-filter-type.model.d.ts +12 -0
  20. package/lib/models/facet-result.model.d.ts +10 -0
  21. package/lib/models/facet-selection.model.d.ts +9 -0
  22. package/lib/models/facet-toolkit-config.model.d.ts +14 -0
  23. package/lib/models/facet-value.model.d.ts +11 -0
  24. package/lib/models/index.d.ts +6 -0
  25. package/lib/ngx-mat-facet-toolkit.animations.d.ts +1 -0
  26. package/lib/ngx-mat-facet-toolkit.component.d.ts +80 -0
  27. package/lib/pipes/csv/csv.pipe.d.ts +9 -0
  28. package/lib/pipes/filter/filter.pipe.d.ts +9 -0
  29. package/lib/pipes/index.d.ts +3 -0
  30. package/lib/pipes/keys/keys.pipe.d.ts +7 -0
  31. package/lib/services/facet-storage.service.d.ts +28 -0
  32. package/package.json +45 -0
  33. package/public-api.d.ts +3 -0
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # NgxMatFacetToolkit [![npm version](https://badge.fury.io/js/@drsutphin%2Fngx-mat-facet-toolkit.svg)](https://badge.fury.io/js/@drsutphin%2Fngx-mat-facet-toolkit)
2
+ Angular 19 standalone facet filtering toolkit with Material UI.
3
+
4
+ [Demo](https://128keaton.github.io/NgxMatFacetToolkit/)
5
+
6
+ [Documentation](https://github.com/drsutphin/NgxMatFacetToolkit)
7
+
8
+ ## Install
9
+ ```bash
10
+ npm install @drsutphin/ngx-mat-facet-toolkit @angular/material @angular/cdk
11
+ ```
12
+
13
+ ## Quick Start
14
+ ```ts
15
+ import {NgxMatFacetToolkitComponent} from '@drsutphin/ngx-mat-facet-toolkit';
16
+ ```
17
+
18
+ ```html
19
+ <ngx-mat-facet-toolkit
20
+ [facets]="facets"
21
+ (facetChange)="onFacetChange($event)">
22
+ </ngx-mat-facet-toolkit>
23
+ ```
24
+
25
+ ## Theme Setup
26
+ ```scss
27
+ @use '@angular/material' as mat;
28
+ @use '@drsutphin/ngx-mat-facet-toolkit/facet-toolkit-theme' as facetToolkit;
29
+
30
+ @include mat.all-component-typographies();
31
+ @include mat.core();
32
+
33
+ $primary: mat.m2-define-palette(mat.$m2-indigo-palette, 500);
34
+ $accent: mat.m2-define-palette(mat.$m2-pink-palette, A200, A100, A400);
35
+ $theme: mat.m2-define-light-theme((
36
+ color: (
37
+ primary: $primary,
38
+ accent: $accent
39
+ )
40
+ ));
41
+
42
+ @include mat.all-component-themes($theme);
43
+ @include facetToolkit.theme($theme);
44
+ ```
45
+
46
+ ## API Highlights
47
+ - Standalone component: `NgxMatFacetToolkitComponent`
48
+ - Events: `facetChange`, `facetRemoved`, `facetReset`
49
+ - Models: `FacetDefinition`, `FacetSelection`, `FacetValue`, `FacetDataType`
50
+ - Config provider: `provideFacetToolkitConfig`
51
+
52
+ ## v1 Gotchas
53
+ - The selector is `ngx-mat-facet-toolkit` (not `ngx-mat-facet-search`).
54
+ - This package is standalone-only (no module wrapper).
55
+ - Be sure to include the toolkit theme mixins in your global theme.
56
+
57
+ ## Release Notes (v1)
58
+ - New package name and selector for the standalone Angular 19 version.
59
+ - Config provider: `provideFacetToolkitConfig`.
60
+ - Expanded docs with API reference, theming guidance, and cookbook examples.
61
+
62
+ See the repository README for the full API reference, theming variants, and facet type cookbook.
@@ -0,0 +1,66 @@
1
+ @use 'sass:map';
2
+ @use '@angular/material' as mat;
3
+
4
+ @mixin _palette-styles($palette) {
5
+ background: mat.m2-get-color-from-palette($palette);
6
+ color: mat.m2-get-color-from-palette($palette, default-contrast);
7
+ }
8
+
9
+ @mixin color($theme) {
10
+ // Get the color config from the theme.
11
+ $color-config: mat.m2-get-color-config($theme);
12
+
13
+ $is-dark-theme: map.get($color-config, 'is-dark');
14
+
15
+ // Get the primary color palette from the color-config.
16
+ $primary-palette: map.get($color-config, primary);
17
+ $accent-palette: map.get($color-config, accent);
18
+ $warn-palette: map.get($color-config, warn);
19
+
20
+ $foreground: map.get($theme, foreground);
21
+ $background: map.get($theme, background);
22
+ $text-secondary: map.get($foreground, secondary-text);
23
+
24
+ .arrow {
25
+ @include _palette-styles($primary-palette);
26
+
27
+ &.mat-primary {
28
+ @include _palette-styles($primary-palette);
29
+ }
30
+
31
+ &.mat-accent {
32
+ @include _palette-styles($primary-palette);
33
+ }
34
+
35
+ &.mat-warn {
36
+ @include _palette-styles($warn-palette);
37
+ }
38
+
39
+ }
40
+
41
+ .filter-input-container {
42
+ border: 1px solid mat.m2-get-color-from-palette($foreground, divider) !important;
43
+ }
44
+
45
+ .facet-modal-component {
46
+ background: mat.m2-get-color-from-palette($background, card)!important;
47
+ color: mat.m2-get-color-from-palette($foreground, text) !important;
48
+ }
49
+ }
50
+
51
+ @mixin typography($theme) {
52
+ // Get the typography config from the theme.
53
+ $typography-config: mat.m2-get-typography-config($theme);
54
+ }
55
+
56
+ @mixin theme($theme) {
57
+ $color-config: mat.m2-get-color-config($theme);
58
+ @if $color-config != null {
59
+ @include color($theme);
60
+ }
61
+
62
+ $typography-config: mat.m2-get-typography-config($theme);
63
+ @if $typography-config != null {
64
+ @include typography($theme);
65
+ }
66
+ }