@patter/ngx-components 20.0.5 → 20.0.7

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, EventEmitter, ElementRef, OnDestroy, Signal, AfterViewInit, TemplateRef, ApplicationRef, EnvironmentInjector, QueryList } from '@angular/core';
2
+ import { OnInit, EventEmitter, ElementRef, OnDestroy, Signal, AfterViewInit, TemplateRef, QueryList } from '@angular/core';
3
3
  import { ValidatorFn, AsyncValidatorFn, FormGroup, ControlValueAccessor, FormControl } from '@angular/forms';
4
4
  import { Observable } from 'rxjs';
5
5
 
@@ -34,7 +34,7 @@ interface PtrOptionGroup {
34
34
  }
35
35
  type OptionInputs = (string | PtrOption)[] | PtrOptionGroup[];
36
36
  interface PtrFormField {
37
- type: 'text' | 'textarea' | 'number' | 'email' | 'password' | 'search' | 'select' | 'date' | 'hidden' | 'chips';
37
+ type: 'text' | 'textarea' | 'number' | 'email' | 'password' | 'search' | 'select' | 'multi-select' | 'date' | 'hidden' | 'chips';
38
38
  name: string;
39
39
  label: string;
40
40
  description?: string;
@@ -47,6 +47,7 @@ interface PtrFormField {
47
47
  validationMessages?: Record<string, string>;
48
48
  options?: OptionInputs;
49
49
  dialogHelpText?: string;
50
+ maxSelections?: number;
50
51
  searchFn?: (term: string) => Observable<string[]>;
51
52
  maxItems?: number;
52
53
  conditional?: PtrConditionalConfig;
@@ -84,11 +85,11 @@ declare class PtrFormComponent implements OnInit {
84
85
  static ɵcmp: i0.ɵɵComponentDeclaration<PtrFormComponent, "ptr-form", never, { "config": { "alias": "config"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "error": { "alias": "error"; "required": false; }; }, { "formSubmit": "formSubmit"; "formGroupCreated": "formGroupCreated"; }, never, never, true, never>;
85
86
  }
86
87
 
87
- interface ProcessedOption {
88
+ interface ProcessedOption$1 {
88
89
  type: 'option' | 'group';
89
90
  label: string;
90
91
  value?: string;
91
- options?: ProcessedOption[];
92
+ options?: ProcessedOption$1[];
92
93
  }
93
94
  declare class PtrDialogListComponent {
94
95
  set options(value: (PtrOption | PtrOptionGroup | string)[] | undefined);
@@ -106,7 +107,7 @@ declare class PtrDialogListComponent {
106
107
  isOpen: i0.WritableSignal<boolean>;
107
108
  private componentId;
108
109
  listId: string;
109
- filteredOptions: i0.Signal<ProcessedOption[]>;
110
+ filteredOptions: i0.Signal<ProcessedOption$1[]>;
110
111
  openDialog(): void;
111
112
  openDialogSilent(): void;
112
113
  closeDialog(): void;
@@ -154,8 +155,92 @@ declare class PtrSelectComponent {
154
155
  static ɵcmp: i0.ɵɵComponentDeclaration<PtrSelectComponent, "ptr-select", never, { "options": { "alias": "options"; "required": false; }; "showSearch": { "alias": "showSearch"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
155
156
  }
156
157
 
158
+ interface ProcessedOption {
159
+ type: 'option' | 'group';
160
+ label: string;
161
+ value?: string;
162
+ options?: ProcessedOption[];
163
+ }
164
+ declare class PtrMultiDialogListComponent {
165
+ set options(value: (PtrOption | PtrOptionGroup | string)[] | undefined);
166
+ showSearch: boolean;
167
+ searchPlaceholder: string;
168
+ dialogTitle?: string | undefined;
169
+ selectedValues: string[];
170
+ maxSelections?: number;
171
+ showSelectAll: boolean;
172
+ selectionChange: EventEmitter<string[]>;
173
+ dialogClosed: EventEmitter<void>;
174
+ searchTermChanged: EventEmitter<string>;
175
+ dialog: ElementRef<HTMLDialogElement>;
176
+ private _options;
177
+ selectedItems: i0.WritableSignal<string[]>;
178
+ searchTerm: i0.WritableSignal<string>;
179
+ highlightedIndex: i0.WritableSignal<number>;
180
+ isOpen: i0.WritableSignal<boolean>;
181
+ private componentId;
182
+ listId: string;
183
+ filteredOptions: i0.Signal<ProcessedOption[]>;
184
+ allFilteredOptionValues: i0.Signal<string[]>;
185
+ allSelectedState: i0.Signal<boolean | "indeterminate">;
186
+ shouldShowSelectAll: i0.Signal<boolean>;
187
+ openDialog(): void;
188
+ openDialogSilent(): void;
189
+ closeDialog(): void;
190
+ updateSearchTerm(term: string): void;
191
+ onDialogKeyDown(event: KeyboardEvent): void;
192
+ onInputKeyDown(event: KeyboardEvent): void;
193
+ onOptionKeyDown(event: KeyboardEvent, optionValue: string): void;
194
+ onSelectAllKeyDown(event: KeyboardEvent): void;
195
+ focusOption(): void;
196
+ toggleOption(optionValue: string): void;
197
+ toggleSelectAll(): void;
198
+ isOptionSelected(optionValue: string): boolean;
199
+ canSelectMore(): boolean;
200
+ private getTotalOptionsCount;
201
+ private processOptions;
202
+ adjustDialogPosition(): void;
203
+ resetDialogPosition(): void;
204
+ static ɵfac: i0.ɵɵFactoryDeclaration<PtrMultiDialogListComponent, never>;
205
+ static ɵcmp: i0.ɵɵComponentDeclaration<PtrMultiDialogListComponent, "ptr-multi-dialog-list", never, { "options": { "alias": "options"; "required": false; }; "showSearch": { "alias": "showSearch"; "required": false; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; }; "dialogTitle": { "alias": "dialogTitle"; "required": false; }; "selectedValues": { "alias": "selectedValues"; "required": false; }; "maxSelections": { "alias": "maxSelections"; "required": false; }; "showSelectAll": { "alias": "showSelectAll"; "required": false; }; }, { "selectionChange": "selectionChange"; "dialogClosed": "dialogClosed"; "searchTermChanged": "searchTermChanged"; }, never, never, true, never>;
206
+ }
207
+
208
+ declare class PtrMultiSelectComponent {
209
+ options: (PtrOption | PtrOptionGroup | string)[] | undefined;
210
+ showSearch: boolean;
211
+ placeholder?: string | null;
212
+ label?: string | undefined;
213
+ description?: string | undefined;
214
+ labelPosition?: 'top' | 'inline';
215
+ maxSelections?: number;
216
+ showSelectAll: boolean;
217
+ selectionChange: EventEmitter<string[]>;
218
+ selectButton: ElementRef<HTMLButtonElement>;
219
+ dialogList: PtrMultiDialogListComponent;
220
+ value: i0.WritableSignal<string[]>;
221
+ selectedOptions: i0.Signal<PtrOption[]>;
222
+ displayText: i0.Signal<string>;
223
+ effectivePlaceholder: i0.Signal<string>;
224
+ private componentId;
225
+ labelId: string;
226
+ inputId: string;
227
+ onChange: (value: string[]) => void;
228
+ onTouched: () => void;
229
+ onDocumentClick(event: MouseEvent): void;
230
+ toggleDialog(): void;
231
+ onSelectionChanged(selectedValues: string[]): void;
232
+ removeSelectedItem(valueToRemove: string): void;
233
+ writeValue(value: string[]): void;
234
+ registerOnChange(fn: (value: string[]) => void): void;
235
+ registerOnTouched(fn: () => void): void;
236
+ setDisabledState?(isDisabled: boolean): void;
237
+ private flattenOptions;
238
+ static ɵfac: i0.ɵɵFactoryDeclaration<PtrMultiSelectComponent, never>;
239
+ static ɵcmp: i0.ɵɵComponentDeclaration<PtrMultiSelectComponent, "ptr-multi-select", never, { "options": { "alias": "options"; "required": false; }; "showSearch": { "alias": "showSearch"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "label": { "alias": "label"; "required": false; }; "description": { "alias": "description"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "maxSelections": { "alias": "maxSelections"; "required": false; }; "showSelectAll": { "alias": "showSelectAll"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
240
+ }
241
+
157
242
  declare class PtrInputComponent implements ControlValueAccessor, OnInit {
158
- type: 'text' | 'number' | 'email' | 'password' | 'search' | 'hidden' | 'date' | 'textarea';
243
+ type: 'text' | 'number' | 'email' | 'password' | 'search' | 'hidden' | 'date' | 'time' | 'textarea';
159
244
  label: string;
160
245
  placeholder?: string | null;
161
246
  autocomplete?: string | undefined;
@@ -165,6 +250,7 @@ declare class PtrInputComponent implements ControlValueAccessor, OnInit {
165
250
  labelPosition?: 'top' | 'inline';
166
251
  input: ElementRef<HTMLInputElement>;
167
252
  dialogList: PtrDialogListComponent;
253
+ private destroyRef;
168
254
  private componentId;
169
255
  private minChars;
170
256
  private searchTerms;
@@ -195,7 +281,14 @@ declare class PtrChipInputComponent implements ControlValueAccessor, OnInit {
195
281
  description?: string | undefined;
196
282
  labelPosition?: 'top' | 'inline';
197
283
  maxItems?: number;
284
+ suggestions: (PtrOption | PtrOptionGroup | string)[] | undefined;
285
+ /**
286
+ * Auto reopen the suggestions dialog after adding/selecting a chip (default true)
287
+ * as long as maxItems has not been reached.
288
+ */
289
+ autoReopenAfterSelect: boolean;
198
290
  chipInput: ElementRef<HTMLInputElement>;
291
+ dialogList?: PtrDialogListComponent;
199
292
  private componentId;
200
293
  inputId: string;
201
294
  inputValue: i0.WritableSignal<string>;
@@ -209,12 +302,19 @@ declare class PtrChipInputComponent implements ControlValueAccessor, OnInit {
209
302
  removeChip(index: number): void;
210
303
  onKeyDown(event: KeyboardEvent): void;
211
304
  onBlur(): void;
305
+ onDocumentClick(event: MouseEvent): void;
306
+ openDialog(): void;
307
+ closeDialog(): void;
308
+ onSuggestionSelected(optionValue: string | null): void;
309
+ private addChipFromValue;
310
+ private maybeReopenDialog;
311
+ private hasSuggestions;
212
312
  writeValue(value: string[]): void;
213
313
  registerOnChange(fn: (value: string[]) => void): void;
214
314
  registerOnTouched(fn: () => void): void;
215
315
  setDisabledState(isDisabled: boolean): void;
216
316
  static ɵfac: i0.ɵɵFactoryDeclaration<PtrChipInputComponent, never>;
217
- static ɵcmp: i0.ɵɵComponentDeclaration<PtrChipInputComponent, "ptr-chip-input", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "description": { "alias": "description"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "maxItems": { "alias": "maxItems"; "required": false; }; }, {}, never, never, true, never>;
317
+ static ɵcmp: i0.ɵɵComponentDeclaration<PtrChipInputComponent, "ptr-chip-input", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "description": { "alias": "description"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "maxItems": { "alias": "maxItems"; "required": false; }; "suggestions": { "alias": "suggestions"; "required": false; }; "autoReopenAfterSelect": { "alias": "autoReopenAfterSelect"; "required": false; }; }, {}, never, never, true, never>;
218
318
  }
219
319
 
220
320
  declare class PtrTitleComponent implements OnInit {
@@ -356,7 +456,6 @@ declare class PtrDialogService {
356
456
  private appRef;
357
457
  private injector;
358
458
  private dialogComponentRef;
359
- constructor(appRef: ApplicationRef, injector: EnvironmentInjector);
360
459
  open<T = unknown>(options: PtrDialogOptions<T>): Observable<DialogResult<T>>;
361
460
  private removeDialog;
362
461
  static ɵfac: i0.ɵɵFactoryDeclaration<PtrDialogService, never>;
@@ -448,5 +547,5 @@ declare class PtrToasterComponent {
448
547
  static ɵcmp: i0.ɵɵComponentDeclaration<PtrToasterComponent, "ptr-toaster", never, {}, {}, never, never, true, never>;
449
548
  }
450
549
 
451
- export { PtrBreadcrumbsComponent, PtrButtonComponent, PtrChipInputComponent, PtrDialogComponent, PtrDialogService, PtrFormComponent, PtrInputComponent, PtrLoadingService, PtrLoadingSpinnerComponent, PtrLoadingSpinnerDirective, PtrMenuComponent, PtrSelectComponent, PtrTabComponent, PtrTabsComponent, PtrTitleComponent, PtrToasterComponent, PtrToasterService, PtrTooltipComponent };
550
+ export { PtrBreadcrumbsComponent, PtrButtonComponent, PtrChipInputComponent, PtrDialogComponent, PtrDialogService, PtrFormComponent, PtrInputComponent, PtrLoadingService, PtrLoadingSpinnerComponent, PtrLoadingSpinnerDirective, PtrMenuComponent, PtrMultiSelectComponent, PtrSelectComponent, PtrTabComponent, PtrTabsComponent, PtrTitleComponent, PtrToasterComponent, PtrToasterService, PtrTooltipComponent };
452
551
  export type { OptionInputs, PtrBreadcrumb, PtrConditionalConfig, PtrConditionalRule, PtrFormConfig, PtrFormField, PtrMenuItem, PtrOption, PtrOptionGroup, PtrToast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patter/ngx-components",
3
- "version": "20.0.5",
3
+ "version": "20.0.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.0.0",
6
6
  "@angular/core": "^20.0.0"
Binary file
Binary file