@recursyve/ngx-material-components 19.0.0-beta.11 → 19.0.0-beta.13

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 (39) hide show
  1. package/chip-list/chip-list.d.ts +26 -0
  2. package/chip-list/icons/clear/chip-list-items-clear-icon.d.ts +5 -0
  3. package/chip-list/index.d.ts +2 -0
  4. package/chip-list/items/chip-list-items.d.ts +14 -0
  5. package/common/index.d.ts +4 -0
  6. package/common/provider.d.ts +3 -0
  7. package/common/translater/constant.d.ts +2 -0
  8. package/common/translater/options.d.ts +7 -0
  9. package/common/translater/translate-pipe.d.ts +8 -0
  10. package/common/translater/translater.d.ts +1 -0
  11. package/dropzone/config.d.ts +38 -0
  12. package/dropzone/constant.d.ts +2 -0
  13. package/dropzone/dropzone.d.ts +42 -0
  14. package/dropzone/dropzone.directive.d.ts +12 -0
  15. package/dropzone/icons/delete/delete-icon.component.d.ts +5 -0
  16. package/dropzone/icons/file/file-icon.component.d.ts +5 -0
  17. package/dropzone/icons/image/image-icon.component.d.ts +5 -0
  18. package/dropzone/index.d.ts +5 -0
  19. package/dropzone/models.d.ts +20 -0
  20. package/dropzone/options.d.ts +4 -0
  21. package/dropzone/pipes/file-size.pipe.d.ts +10 -0
  22. package/dropzone/preview/file-preview.d.ts +14 -0
  23. package/dropzone/provider.d.ts +3 -0
  24. package/fesm2022/recursyve-ngx-material-components-chip-list.mjs +156 -0
  25. package/fesm2022/recursyve-ngx-material-components-chip-list.mjs.map +1 -0
  26. package/fesm2022/recursyve-ngx-material-components-common.mjs +39 -0
  27. package/fesm2022/recursyve-ngx-material-components-common.mjs.map +1 -0
  28. package/fesm2022/recursyve-ngx-material-components-dropzone.mjs +354 -0
  29. package/fesm2022/recursyve-ngx-material-components-dropzone.mjs.map +1 -0
  30. package/fesm2022/recursyve-ngx-material-components-form-field-error.mjs.map +1 -1
  31. package/fesm2022/recursyve-ngx-material-components-typeahead.mjs +30 -20
  32. package/fesm2022/recursyve-ngx-material-components-typeahead.mjs.map +1 -1
  33. package/form-field-error/index.d.ts +0 -1
  34. package/form-field-error/options.d.ts +2 -2
  35. package/package.json +13 -1
  36. package/typeahead/async-typeahead.d.ts +1 -0
  37. package/typeahead/icons/search/typeahead-search-icon.d.ts +5 -0
  38. package/typeahead/typeahead-base.d.ts +2 -1
  39. package/form-field-error/error-translater.d.ts +0 -1
@@ -0,0 +1,26 @@
1
+ import { OnInit } from "@angular/core";
2
+ import { ControlValueAccessor } from "@angular/forms";
3
+ import { NiceChipListItems } from "./items/chip-list-items";
4
+ import * as i0 from "@angular/core";
5
+ export declare class NiceChipListDirective<T> implements ControlValueAccessor, OnInit {
6
+ readonly withItemList: import("@angular/core").InputSignal<NiceChipListItems<T>>;
7
+ readonly reloadOnSelected: import("@angular/core").InputSignal<boolean>;
8
+ readonly separatorKeyboardCodes: import("@angular/core").InputSignal<string[]>;
9
+ private readonly elementRef;
10
+ private readonly injector;
11
+ private readonly asyncTypeahead;
12
+ private readonly ngControl;
13
+ private readonly values;
14
+ private propagateChanges?;
15
+ constructor();
16
+ onKeyDown(event: KeyboardEvent): void;
17
+ ngOnInit(): void;
18
+ writeValue(obj: T[] | null): void;
19
+ registerOnChange(fn: (_: T[]) => void): void;
20
+ registerOnTouched(): void;
21
+ private setupAsyncTypeahead;
22
+ private addValue;
23
+ private updateTypeaheadSearchOptions;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceChipListDirective<any>, never>;
25
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NiceChipListDirective<any>, "input[niceChipList], nice-async-typeahead[niceChipList]", never, { "withItemList": { "alias": "withItemList"; "required": true; "isSignal": true; }; "reloadOnSelected": { "alias": "reloadOnSelected"; "required": false; "isSignal": true; }; "separatorKeyboardCodes": { "alias": "separatorKeyboardCodes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
26
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NiceChipListItemsClearIcon {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceChipListItemsClearIcon, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceChipListItemsClearIcon, "nice-chip-list-items-clear-icon", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./chip-list";
2
+ export * from "./items/chip-list-items";
@@ -0,0 +1,14 @@
1
+ import { Injector, Signal } from "@angular/core";
2
+ import { Observable } from "rxjs";
3
+ import * as i0 from "@angular/core";
4
+ export declare class NiceChipListItems<T> {
5
+ readonly removeChip: import("@angular/core").OutputEmitterRef<number>;
6
+ protected readonly injector: Injector;
7
+ items?: Signal<T[]>;
8
+ formatLabelFn?: (value: T) => string;
9
+ setItemsReactivity(items$: Observable<T[]>): void;
10
+ setFormatLabel(fn: (value: T) => string): void;
11
+ remove(index: number): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceChipListItems<any>, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceChipListItems<any>, "nice-chip-list-items", never, {}, { "removeChip": "removeChip"; }, never, never, true, never>;
14
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./provider";
2
+ export * from "./translater/constant";
3
+ export * from "./translater/translate-pipe";
4
+ export * from "./translater/translater";
@@ -0,0 +1,3 @@
1
+ import { Provider } from "@angular/core";
2
+ import { NiceTranslaterOptions } from "./translater/options";
3
+ export declare function provideNiceComponents(options: NiceTranslaterOptions): Provider[];
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from "@angular/core";
2
+ export declare const NICE_COMPONENTS_TRANSLATER: InjectionToken<unknown>;
@@ -0,0 +1,7 @@
1
+ import { FactoryProvider } from "@angular/core";
2
+ import { NiceTranslater } from "./translater";
3
+ export type NiceTranslaterOptions = {
4
+ translater: Omit<FactoryProvider, "provide" | "multi"> & {
5
+ useFactory: (...args: any[]) => NiceTranslater;
6
+ };
7
+ };
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export declare class NiceTranslatePipe implements PipeTransform {
4
+ private readonly translater;
5
+ transform(key: string, params?: Record<string, string>): string;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceTranslatePipe, never>;
7
+ static ɵpipe: i0.ɵɵPipeDeclaration<NiceTranslatePipe, "niceTranslate", true>;
8
+ }
@@ -0,0 +1 @@
1
+ export type NiceTranslater = (key: string, params?: Record<string, string>) => string;
@@ -0,0 +1,38 @@
1
+ export type NiceDropzoneImageConfig = {
2
+ maxSize?: {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ recommendedSize?: {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ };
11
+ export type NiceDropzoneFileSizeConfig = {
12
+ size: number;
13
+ unit: "B" | "KB" | "MB" | "GB";
14
+ };
15
+ export type NiceDropzoneTranslationKeyConfig = {
16
+ upload: {
17
+ file: string;
18
+ files: string;
19
+ image: string;
20
+ images: string;
21
+ };
22
+ format: {
23
+ label: string;
24
+ };
25
+ ratio: {
26
+ label: string;
27
+ pixels: string;
28
+ };
29
+ size: {
30
+ label: string;
31
+ units: {
32
+ B: string;
33
+ KB: string;
34
+ MB: string;
35
+ GB: string;
36
+ };
37
+ };
38
+ };
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from "@angular/core";
2
+ export declare const NICE_DROPZONE_TRANSLATION_KEYS: InjectionToken<unknown>;
@@ -0,0 +1,42 @@
1
+ import { ElementRef, OnDestroy } from "@angular/core";
2
+ import { ControlValueAccessor } from "@angular/forms";
3
+ import { MatRippleLoader } from "@angular/material/core";
4
+ import { NiceDropzoneFileSizeConfig, NiceDropzoneImageConfig, NiceDropzoneTranslationKeyConfig } from "./config";
5
+ import { NiceFileDimensions, NiceSelectedFiles } from "./models";
6
+ import * as i0 from "@angular/core";
7
+ export declare const niceDropzoneModes: readonly ["image", "file", "all"];
8
+ export type NiceDropzoneModes = (typeof niceDropzoneModes)[number];
9
+ export declare class NiceDropzone implements OnDestroy, ControlValueAccessor {
10
+ readonly mode: import("@angular/core").InputSignal<"file" | "image" | "all">;
11
+ readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, any>;
12
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, any>;
13
+ readonly accept: import("@angular/core").InputSignal<string[] | undefined>;
14
+ readonly config: import("@angular/core").InputSignal<NiceDropzoneImageConfig | undefined>;
15
+ readonly maxFileSize: import("@angular/core").InputSignal<NiceDropzoneFileSizeConfig | undefined>;
16
+ protected readonly _elementRef: import("@angular/core").Signal<ElementRef<any> | undefined>;
17
+ protected readonly _inputRef: import("@angular/core").Signal<ElementRef<HTMLInputElement> | undefined>;
18
+ /**
19
+ * Handles the lazy creation of the MatButton ripple.
20
+ * Used to improve the initial load time of large applications.
21
+ */
22
+ protected readonly _rippleLoader: MatRippleLoader;
23
+ protected readonly _translationKeys: NiceDropzoneTranslationKeyConfig;
24
+ protected readonly files: import("@angular/core").WritableSignal<NiceSelectedFiles[]>;
25
+ protected _disabled: boolean;
26
+ private _onChange;
27
+ private _value;
28
+ constructor();
29
+ ngOnDestroy(): void;
30
+ writeValue(value: NiceSelectedFiles | NiceSelectedFiles[] | null): void;
31
+ registerOnChange(fn: (value: NiceSelectedFiles | NiceSelectedFiles[] | null) => void): void;
32
+ registerOnTouched(): void;
33
+ setDisabledState(disabled: boolean): void;
34
+ onFileChanged(event: Event): void;
35
+ onFilesDropped(fileList: FileList): Promise<void>;
36
+ onFileDelete(index: number): void;
37
+ protected propagateChanges(value: NiceSelectedFiles | NiceSelectedFiles[] | null): void;
38
+ protected getImageDimension(file: File): Promise<NiceFileDimensions>;
39
+ protected resetInput(): void;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceDropzone, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceDropzone, "nice-dropzone", never, { "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
42
+ }
@@ -0,0 +1,12 @@
1
+ import { EventEmitter } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export declare class NiceDropzoneDirective {
4
+ fileOver: boolean;
5
+ filesDropped: EventEmitter<FileList>;
6
+ files: import("@angular/core").OutputEmitterRef<void>;
7
+ onDragOver(event: DragEvent): void;
8
+ onDragLeave(event: DragEvent): void;
9
+ ondrop(event: DragEvent): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceDropzoneDirective, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NiceDropzoneDirective, "[niceDropzone]", never, {}, { "filesDropped": "filesDropped"; "files": "files"; }, never, never, true, never>;
12
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NiceDropzoneDeleteIcon {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceDropzoneDeleteIcon, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceDropzoneDeleteIcon, "nice-dropzone-delete-icon", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NiceDropzoneFileIcon {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceDropzoneFileIcon, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceDropzoneFileIcon, "nice-dropzone-file-icon", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NiceDropzoneImageIcon {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceDropzoneImageIcon, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceDropzoneImageIcon, "nice-dropzone-image-icon", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./dropzone.directive";
2
+ export * from "./dropzone";
3
+ export * from "./config";
4
+ export * from "./options";
5
+ export * from "./provider";
@@ -0,0 +1,20 @@
1
+ export type NiceFileDimensions = {
2
+ width: number;
3
+ height: number;
4
+ ratio: number;
5
+ };
6
+ export type NiceLocalFile = {
7
+ file: File;
8
+ name: string;
9
+ size?: number;
10
+ dimensions?: NiceFileDimensions;
11
+ };
12
+ export type NiceRemoteFile = {
13
+ id: string | number;
14
+ name: string;
15
+ url: string;
16
+ size?: number;
17
+ };
18
+ export type NiceSelectedFiles = NiceLocalFile | NiceRemoteFile;
19
+ export declare function isLocalFile(file: NiceSelectedFiles): file is NiceLocalFile;
20
+ export declare function isRemoteFile(file: NiceSelectedFiles): file is NiceRemoteFile;
@@ -0,0 +1,4 @@
1
+ import { NiceDropzoneTranslationKeyConfig } from "./config";
2
+ export type NiceDropzoneOptions = {
3
+ translationKeys: NiceDropzoneTranslationKeyConfig;
4
+ };
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export declare class FileSizePipe implements PipeTransform {
4
+ private readonly units;
5
+ private readonly translater;
6
+ private readonly translationKeys;
7
+ transform(bytes: number | null | undefined, precision?: number): string;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileSizePipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<FileSizePipe, "niceFileSize", true>;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { NiceDropzoneTranslationKeyConfig } from "../config";
2
+ import { NiceFileDimensions, NiceSelectedFiles } from "../models";
3
+ import * as i0 from "@angular/core";
4
+ export declare class NiceDropzoneFilePreview {
5
+ readonly file: import("@angular/core").InputSignal<NiceSelectedFiles>;
6
+ readonly mode: import("@angular/core").InputSignal<"file" | "image" | "all">;
7
+ protected readonly clickDelete: import("@angular/core").OutputEmitterRef<void>;
8
+ protected readonly isImage: import("@angular/core").Signal<boolean>;
9
+ protected readonly imageDimensions: import("@angular/core").Signal<NiceFileDimensions | null>;
10
+ protected readonly imageUrl: import("@angular/core").Signal<string>;
11
+ protected _translationKeys: NiceDropzoneTranslationKeyConfig;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceDropzoneFilePreview, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceDropzoneFilePreview, "nice-dropzone-file-preview", never, { "file": { "alias": "file"; "required": true; "isSignal": true; }; "mode": { "alias": "mode"; "required": true; "isSignal": true; }; }, { "clickDelete": "clickDelete"; }, never, never, true, never>;
14
+ }
@@ -0,0 +1,3 @@
1
+ import { Provider } from "@angular/core";
2
+ import { NiceDropzoneOptions } from "./options";
3
+ export declare function provideDropzone(options?: NiceDropzoneOptions): Provider[];
@@ -0,0 +1,156 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, inject, ElementRef, Injector, signal, effect, untracked, HostListener, Directive, Component, output, ChangeDetectionStrategy } from '@angular/core';
3
+ import { toObservable, toSignal } from '@angular/core/rxjs-interop';
4
+ import { NgControl } from '@angular/forms';
5
+ import { NiceAsyncTypeahead } from '@recursyve/ngx-material-components/typeahead';
6
+ import { MatChipSet, MatChipRemove, MatChipRow } from '@angular/material/chips';
7
+
8
+ class NiceChipListDirective {
9
+ withItemList = input.required();
10
+ reloadOnSelected = input(true);
11
+ separatorKeyboardCodes = input(["Enter"]);
12
+ elementRef = inject(ElementRef);
13
+ injector = inject(Injector);
14
+ asyncTypeahead = inject(NiceAsyncTypeahead, { optional: true });
15
+ ngControl = inject(NgControl, { optional: true });
16
+ values = signal([]);
17
+ propagateChanges;
18
+ constructor() {
19
+ if (this.ngControl) {
20
+ this.ngControl.valueAccessor = this;
21
+ }
22
+ effect(() => {
23
+ untracked(() => this.updateTypeaheadSearchOptions(this.values()));
24
+ });
25
+ }
26
+ onKeyDown(event) {
27
+ if (this.asyncTypeahead) {
28
+ return;
29
+ }
30
+ if (!this.separatorKeyboardCodes().includes(event.code)) {
31
+ return;
32
+ }
33
+ if (!this.elementRef.nativeElement.validity.valid) {
34
+ return;
35
+ }
36
+ this.addValue(this.elementRef.nativeElement.value);
37
+ this.elementRef.nativeElement.value = "";
38
+ event.preventDefault();
39
+ }
40
+ ngOnInit() {
41
+ this.setupAsyncTypeahead();
42
+ const parentElement = this.elementRef.nativeElement.parentElement;
43
+ if (parentElement.classList.contains("mat-mdc-form-field-infix")) {
44
+ parentElement.style.alignItems = "flex-start";
45
+ parentElement.style.flexDirection = "column-reverse";
46
+ }
47
+ const withItemList = this.withItemList();
48
+ withItemList.setItemsReactivity(toObservable(this.values, { injector: this.injector }));
49
+ withItemList.removeChip.subscribe((index) => {
50
+ const values = [...this.values()];
51
+ values.splice(index, 1);
52
+ this.propagateChanges?.(values);
53
+ this.values.set(values);
54
+ });
55
+ if (this.asyncTypeahead) {
56
+ withItemList.setFormatLabel((item) => this.asyncTypeahead.formatLabel(item));
57
+ }
58
+ }
59
+ writeValue(obj) {
60
+ if (!obj) {
61
+ this.values.set([]);
62
+ }
63
+ else if (Array.isArray(obj)) {
64
+ this.values.set([...obj]);
65
+ }
66
+ }
67
+ registerOnChange(fn) {
68
+ this.propagateChanges = fn;
69
+ }
70
+ registerOnTouched() {
71
+ return;
72
+ }
73
+ setupAsyncTypeahead() {
74
+ if (!this.asyncTypeahead) {
75
+ return;
76
+ }
77
+ this.asyncTypeahead.selected
78
+ .subscribe((value) => {
79
+ if (!value) {
80
+ return;
81
+ }
82
+ this.asyncTypeahead?.removeActiveValue();
83
+ this.addValue(value);
84
+ });
85
+ }
86
+ addValue(value) {
87
+ const values = [...this.values()];
88
+ if (values.includes(value)) {
89
+ return;
90
+ }
91
+ values.push(value);
92
+ this.propagateChanges?.(values);
93
+ this.values.set(values);
94
+ }
95
+ updateTypeaheadSearchOptions(ignore) {
96
+ if (!this.asyncTypeahead) {
97
+ return;
98
+ }
99
+ const searchOptions = this.asyncTypeahead.searchOptions();
100
+ this.asyncTypeahead.setSearchOptions({ ...(searchOptions ?? {}), ignore });
101
+ }
102
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NiceChipListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
103
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.10", type: NiceChipListDirective, isStandalone: true, selector: "input[niceChipList], nice-async-typeahead[niceChipList]", inputs: { withItemList: { classPropertyName: "withItemList", publicName: "withItemList", isSignal: true, isRequired: true, transformFunction: null }, reloadOnSelected: { classPropertyName: "reloadOnSelected", publicName: "reloadOnSelected", isSignal: true, isRequired: false, transformFunction: null }, separatorKeyboardCodes: { classPropertyName: "separatorKeyboardCodes", publicName: "separatorKeyboardCodes", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "onKeyDown($event)" } }, ngImport: i0 });
104
+ }
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NiceChipListDirective, decorators: [{
106
+ type: Directive,
107
+ args: [{
108
+ selector: "input[niceChipList], nice-async-typeahead[niceChipList]"
109
+ }]
110
+ }], ctorParameters: () => [], propDecorators: { onKeyDown: [{
111
+ type: HostListener,
112
+ args: ["keydown", ["$event"]]
113
+ }] } });
114
+
115
+ class NiceChipListItemsClearIcon {
116
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NiceChipListItemsClearIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
117
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: NiceChipListItemsClearIcon, isStandalone: true, selector: "nice-chip-list-items-clear-icon", ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm5.49 16.07a1 1 0 0 1 -1.41 1.42l-3.9 -3.9a0.25 0.25 0 0 0 -0.36 0l-3.9 3.9a1 1 0 1 1 -1.41 -1.42l3.9 -3.89a0.25 0.25 0 0 0 0 -0.36l-3.9 -3.9a1 1 0 0 1 1.41 -1.41l3.9 3.9a0.25 0.25 0 0 0 0.36 0l3.9 -3.9a1 1 0 0 1 1.41 1.41l-3.9 3.9a0.25 0.25 0 0 0 0 0.36Z\" fill=\"currentColor\" stroke-width=\"1\"></path>\n</svg>\n" });
118
+ }
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NiceChipListItemsClearIcon, decorators: [{
120
+ type: Component,
121
+ args: [{ selector: "nice-chip-list-items-clear-icon", template: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm5.49 16.07a1 1 0 0 1 -1.41 1.42l-3.9 -3.9a0.25 0.25 0 0 0 -0.36 0l-3.9 3.9a1 1 0 1 1 -1.41 -1.42l3.9 -3.89a0.25 0.25 0 0 0 0 -0.36l-3.9 -3.9a1 1 0 0 1 1.41 -1.41l3.9 3.9a0.25 0.25 0 0 0 0.36 0l3.9 -3.9a1 1 0 0 1 1.41 1.41l-3.9 3.9a0.25 0.25 0 0 0 0 0.36Z\" fill=\"currentColor\" stroke-width=\"1\"></path>\n</svg>\n" }]
122
+ }] });
123
+
124
+ class NiceChipListItems {
125
+ removeChip = output();
126
+ injector = inject(Injector);
127
+ items;
128
+ formatLabelFn;
129
+ setItemsReactivity(items$) {
130
+ this.items = toSignal(items$, { injector: this.injector, initialValue: [] });
131
+ }
132
+ setFormatLabel(fn) {
133
+ this.formatLabelFn = fn;
134
+ }
135
+ remove(index) {
136
+ this.removeChip.emit(index);
137
+ }
138
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NiceChipListItems, deps: [], target: i0.ɵɵFactoryTarget.Component });
139
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: NiceChipListItems, isStandalone: true, selector: "nice-chip-list-items", outputs: { removeChip: "removeChip" }, ngImport: i0, template: "@if (items) {\n <mat-chip-set>\n @for (item of items(); track item) {\n <mat-chip-row [highlighted]=\"true\" (removed)=\"remove($index)\">\n @if (formatLabelFn) {\n {{ formatLabelFn(item) }}\n } @else {\n {{ item }}\n }\n\n <button matChipRemove>\n <nice-chip-list-items-clear-icon />\n </button>\n </mat-chip-row>\n }\n </mat-chip-set>\n}\n", styles: ["nice-chip-list-items-clear-icon{margin-top:-1px;width:16px;height:16px}\n"], dependencies: [{ kind: "component", type: MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "directive", type: MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: NiceChipListItemsClearIcon, selector: "nice-chip-list-items-clear-icon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
140
+ }
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NiceChipListItems, decorators: [{
142
+ type: Component,
143
+ args: [{ selector: "nice-chip-list-items", imports: [
144
+ MatChipSet,
145
+ MatChipRemove,
146
+ MatChipRow,
147
+ NiceChipListItemsClearIcon
148
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (items) {\n <mat-chip-set>\n @for (item of items(); track item) {\n <mat-chip-row [highlighted]=\"true\" (removed)=\"remove($index)\">\n @if (formatLabelFn) {\n {{ formatLabelFn(item) }}\n } @else {\n {{ item }}\n }\n\n <button matChipRemove>\n <nice-chip-list-items-clear-icon />\n </button>\n </mat-chip-row>\n }\n </mat-chip-set>\n}\n", styles: ["nice-chip-list-items-clear-icon{margin-top:-1px;width:16px;height:16px}\n"] }]
149
+ }] });
150
+
151
+ /**
152
+ * Generated bundle index. Do not edit.
153
+ */
154
+
155
+ export { NiceChipListDirective, NiceChipListItems };
156
+ //# sourceMappingURL=recursyve-ngx-material-components-chip-list.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recursyve-ngx-material-components-chip-list.mjs","sources":["../../../src/material-components/chip-list/chip-list.ts","../../../src/material-components/chip-list/icons/clear/chip-list-items-clear-icon.ts","../../../src/material-components/chip-list/icons/clear/chip-list-items-clear-icon.svg","../../../src/material-components/chip-list/items/chip-list-items.ts","../../../src/material-components/chip-list/items/chip-list-items.html","../../../src/material-components/chip-list/recursyve-ngx-material-components-chip-list.ts"],"sourcesContent":["import {\n Directive,\n effect,\n ElementRef,\n HostListener,\n inject,\n Injector,\n input,\n OnInit,\n signal,\n untracked\n} from \"@angular/core\";\nimport { toObservable } from \"@angular/core/rxjs-interop\";\nimport { ControlValueAccessor, NgControl } from \"@angular/forms\";\nimport { NiceAsyncTypeahead } from \"@recursyve/ngx-material-components/typeahead\";\nimport { NiceChipListItems } from \"./items/chip-list-items\";\n\n@Directive({\n selector: \"input[niceChipList], nice-async-typeahead[niceChipList]\"\n})\nexport class NiceChipListDirective<T> implements ControlValueAccessor, OnInit {\n public readonly withItemList = input.required<NiceChipListItems<T>>();\n public readonly reloadOnSelected = input<boolean>(true);\n public readonly separatorKeyboardCodes = input<string[]>([\"Enter\"]);\n\n private readonly elementRef = inject(ElementRef);\n private readonly injector = inject(Injector);\n private readonly asyncTypeahead = inject<NiceAsyncTypeahead<T>>(NiceAsyncTypeahead, { optional: true });\n private readonly ngControl = inject<NgControl>(NgControl, { optional: true });\n\n private readonly values = signal<T[]>([]);\n\n private propagateChanges?: (_: T[]) => void;\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n\n effect(() => {\n untracked(() => this.updateTypeaheadSearchOptions(this.values()));\n });\n }\n\n @HostListener(\"keydown\", [\"$event\"])\n public onKeyDown(event: KeyboardEvent): void {\n if (this.asyncTypeahead) {\n return;\n }\n\n if (!this.separatorKeyboardCodes().includes(event.code)) {\n return;\n }\n\n if (!this.elementRef.nativeElement.validity.valid) {\n return;\n }\n\n this.addValue(this.elementRef.nativeElement.value);\n this.elementRef.nativeElement.value = \"\";\n event.preventDefault();\n }\n\n public ngOnInit(): void {\n this.setupAsyncTypeahead();\n\n const parentElement = this.elementRef.nativeElement.parentElement;\n if (parentElement.classList.contains(\"mat-mdc-form-field-infix\")) {\n parentElement.style.alignItems = \"flex-start\";\n parentElement.style.flexDirection = \"column-reverse\";\n }\n\n const withItemList = this.withItemList();\n withItemList.setItemsReactivity(toObservable(this.values, { injector: this.injector }));\n withItemList.removeChip.subscribe((index) => {\n const values = [...this.values()];\n values.splice(index, 1);\n\n this.propagateChanges?.(values);\n this.values.set(values);\n });\n\n if (this.asyncTypeahead) {\n withItemList.setFormatLabel((item) => this.asyncTypeahead!.formatLabel(item));\n }\n }\n\n public writeValue(obj: T[] | null): void {\n if (!obj) {\n this.values.set([]);\n } else if (Array.isArray(obj)) {\n this.values.set([...obj]);\n }\n }\n\n public registerOnChange(fn: (_: T[]) => void): void {\n this.propagateChanges = fn;\n }\n\n public registerOnTouched(): void {\n return;\n }\n\n private setupAsyncTypeahead(): void {\n if (!this.asyncTypeahead) {\n return;\n }\n\n this.asyncTypeahead.selected\n .subscribe((value) => {\n if (!value) {\n return;\n }\n\n this.asyncTypeahead?.removeActiveValue();\n this.addValue(value);\n });\n }\n\n private addValue(value: T): void {\n const values = [...this.values()];\n if (values.includes(value)) {\n return;\n }\n\n values.push(value);\n this.propagateChanges?.(values);\n this.values.set(values);\n }\n\n private updateTypeaheadSearchOptions(ignore: T[]): void {\n if (!this.asyncTypeahead) {\n return;\n }\n\n const searchOptions = this.asyncTypeahead.searchOptions();\n this.asyncTypeahead.setSearchOptions({ ...(searchOptions ?? {}), ignore });\n }\n}\n","import { Component } from \"@angular/core\";\n\n@Component({\n selector: \"nice-chip-list-items-clear-icon\",\n templateUrl: \"chip-list-items-clear-icon.svg\"\n})\nexport class NiceChipListItemsClearIcon {}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm5.49 16.07a1 1 0 0 1 -1.41 1.42l-3.9 -3.9a0.25 0.25 0 0 0 -0.36 0l-3.9 3.9a1 1 0 1 1 -1.41 -1.42l3.9 -3.89a0.25 0.25 0 0 0 0 -0.36l-3.9 -3.9a1 1 0 0 1 1.41 -1.41l3.9 3.9a0.25 0.25 0 0 0 0.36 0l3.9 -3.9a1 1 0 0 1 1.41 1.41l-3.9 3.9a0.25 0.25 0 0 0 0 0.36Z\" fill=\"currentColor\" stroke-width=\"1\"></path>\n</svg>\n","import { ChangeDetectionStrategy, Component, inject, Injector, output, Signal } from \"@angular/core\";\nimport { toSignal } from \"@angular/core/rxjs-interop\";\nimport { MatChipRemove, MatChipRow, MatChipSet } from \"@angular/material/chips\";\nimport { Observable } from \"rxjs\";\nimport { NiceChipListItemsClearIcon } from \"../icons/clear/chip-list-items-clear-icon\";\n\n@Component({\n selector: \"nice-chip-list-items\",\n templateUrl: \"./chip-list-items.html\",\n styleUrls: [\"./chip-list-items.scss\"],\n imports: [\n MatChipSet,\n MatChipRemove,\n MatChipRow,\n NiceChipListItemsClearIcon\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NiceChipListItems<T> {\n public readonly removeChip = output<number>();\n\n protected readonly injector = inject(Injector);\n\n public items?: Signal<T[]>;\n public formatLabelFn?: (value: T) => string;\n\n public setItemsReactivity(items$: Observable<T[]>): void {\n this.items = toSignal(items$, { injector: this.injector, initialValue: [] });\n }\n\n public setFormatLabel(fn: (value: T) => string): void {\n this.formatLabelFn = fn;\n }\n\n public remove(index: number): void {\n this.removeChip.emit(index);\n }\n}\n","@if (items) {\n <mat-chip-set>\n @for (item of items(); track item) {\n <mat-chip-row [highlighted]=\"true\" (removed)=\"remove($index)\">\n @if (formatLabelFn) {\n {{ formatLabelFn(item) }}\n } @else {\n {{ item }}\n }\n\n <button matChipRemove>\n <nice-chip-list-items-clear-icon />\n </button>\n </mat-chip-row>\n }\n </mat-chip-set>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAoBa,qBAAqB,CAAA;AACd,IAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAwB;AACrD,IAAA,gBAAgB,GAAG,KAAK,CAAU,IAAI,CAAC;AACvC,IAAA,sBAAsB,GAAG,KAAK,CAAW,CAAC,OAAO,CAAC,CAAC;AAElD,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC3B,cAAc,GAAG,MAAM,CAAwB,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACtF,SAAS,GAAG,MAAM,CAAY,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAE5D,IAAA,MAAM,GAAG,MAAM,CAAM,EAAE,CAAC;AAEjC,IAAA,gBAAgB;AAExB,IAAA,WAAA,GAAA;AACI,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;AAChB,YAAA,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI;;QAGvC,MAAM,CAAC,MAAK;AACR,YAAA,SAAS,CAAC,MAAM,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AACrE,SAAC,CAAC;;AAIC,IAAA,SAAS,CAAC,KAAoB,EAAA;AACjC,QAAA,IAAI,IAAI,CAAC,cAAc,EAAE;YACrB;;AAGJ,QAAA,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACrD;;QAGJ,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,QAA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QAAA,EAAA,iCAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAIrB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAZ7B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EAGvB,OAAA,EAAA;wBACL,UAAU;wBACV,aAAa;wBACb,UAAU;wBACV;qBACH,EACgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,qgBAAA,EAAA,MAAA,EAAA,CAAA,2EAAA,CAAA,EAAA;;;AEhBnD;;AAEG;;;;"}
@@ -0,0 +1,39 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, Pipe } from '@angular/core';
3
+
4
+ const NICE_COMPONENTS_TRANSLATER = new InjectionToken("nice_components_translater");
5
+
6
+ function provideNiceComponents(options) {
7
+ return [
8
+ {
9
+ provide: NICE_COMPONENTS_TRANSLATER,
10
+ ...options.translater
11
+ }
12
+ ];
13
+ }
14
+
15
+ class NiceTranslatePipe {
16
+ translater = inject(NICE_COMPONENTS_TRANSLATER);
17
+ transform(key, params) {
18
+ return this.translater(key, params);
19
+ }
20
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NiceTranslatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
21
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.10", ngImport: i0, type: NiceTranslatePipe, isStandalone: true, name: "niceTranslate" });
22
+ }
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: NiceTranslatePipe, decorators: [{
24
+ type: Pipe,
25
+ args: [{
26
+ name: "niceTranslate"
27
+ }]
28
+ }] });
29
+
30
+ /*
31
+ * Public API Surface of dropzone
32
+ */
33
+
34
+ /**
35
+ * Generated bundle index. Do not edit.
36
+ */
37
+
38
+ export { NICE_COMPONENTS_TRANSLATER, NiceTranslatePipe, provideNiceComponents };
39
+ //# sourceMappingURL=recursyve-ngx-material-components-common.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recursyve-ngx-material-components-common.mjs","sources":["../../../src/material-components/common/translater/constant.ts","../../../src/material-components/common/provider.ts","../../../src/material-components/common/translater/translate-pipe.ts","../../../src/material-components/common/index.ts","../../../src/material-components/common/recursyve-ngx-material-components-common.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\n\nexport const NICE_COMPONENTS_TRANSLATER = new InjectionToken(\"nice_components_translater\");\n","import { Provider } from \"@angular/core\";\nimport { NICE_COMPONENTS_TRANSLATER } from \"./translater/constant\";\nimport { NiceTranslaterOptions } from \"./translater/options\";\n\nexport function provideNiceComponents(options: NiceTranslaterOptions): Provider[] {\n return [\n { \n provide: NICE_COMPONENTS_TRANSLATER,\n ...options.translater\n }\n ];\n}\n","import { inject, Pipe, PipeTransform } from \"@angular/core\";\nimport { NICE_COMPONENTS_TRANSLATER } from \"./constant\";\nimport { NiceTranslater } from \"./translater\";\n\n@Pipe({\n name: \"niceTranslate\"\n})\nexport class NiceTranslatePipe implements PipeTransform {\n private readonly translater = inject<NiceTranslater>(NICE_COMPONENTS_TRANSLATER);\n\n public transform(key: string, params?: Record<string, string>): string {\n return this.translater(key, params);\n }\n}\n","/*\n * Public API Surface of dropzone\n */\n\nexport * from \"./provider\";\nexport * from \"./translater/constant\";\nexport * from \"./translater/translate-pipe\";\nexport * from \"./translater/translater\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAEa,0BAA0B,GAAG,IAAI,cAAc,CAAC,4BAA4B;;ACEnF,SAAU,qBAAqB,CAAC,OAA8B,EAAA;IAChE,OAAO;AACH,QAAA;AACI,YAAA,OAAO,EAAE,0BAA0B;YACnC,GAAG,OAAO,CAAC;AACd;KACJ;AACL;;MCJa,iBAAiB,CAAA;AACT,IAAA,UAAU,GAAG,MAAM,CAAiB,0BAA0B,CAAC;IAEzE,SAAS,CAAC,GAAW,EAAE,MAA+B,EAAA;QACzD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC;;wGAJ9B,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;sGAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,eAAA,EAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE;AACT,iBAAA;;;ACND;;AAEG;;ACFH;;AAEG;;;;"}