@anglr/select 11.0.0 → 11.0.2

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.
@@ -1,2947 +0,0 @@
1
- import { AfterViewInit } from '@angular/core';
2
- import { ApplicationRef } from '@angular/core';
3
- import { BehaviorSubject } from 'rxjs';
4
- import { ChangeDetectorRef } from '@angular/core';
5
- import { ComponentFactoryResolver } from '@angular/core';
6
- import { ComponentRef } from '@angular/core';
7
- import { ControlValueAccessor } from '@angular/forms';
8
- import { ElementRef } from '@angular/core';
9
- import { EventEmitter } from '@angular/core';
10
- import { FlipCallback } from '@anglr/common/positions';
11
- import * as i0 from '@angular/core';
12
- import * as i17 from '@angular/common';
13
- import * as i18 from '@anglr/common';
14
- import { InjectionToken } from '@angular/core';
15
- import { Injector } from '@angular/core';
16
- import { Observable } from 'rxjs';
17
- import { OnChanges } from '@angular/core';
18
- import { OnDestroy } from '@angular/core';
19
- import { OnInit } from '@angular/core';
20
- import { PipeTransform } from '@angular/core';
21
- import type { PositionsCoordinates } from 'positions';
22
- import { QueryList } from '@angular/core';
23
- import { SimpleChanges } from '@angular/core';
24
- import { StringLocalization } from '@anglr/common';
25
- import { Subscription } from 'rxjs';
26
- import { TemplateRef } from '@angular/core';
27
- import { Type } from '@angular/core';
28
-
29
- /**
30
- * Public API for 'BasicKeyboardHandlerComponent'
31
- */
32
- export declare interface BasicKeyboardHandler extends KeyboardHandler {
33
- }
34
-
35
- /**
36
- * Component used for obtaining basic keyboard handler html element
37
- */
38
- export declare class BasicKeyboardHandlerComponent implements BasicKeyboardHandler, NgSelectPlugin<BasicKeyboardHandlerOptions>, OnDestroy {
39
- ngSelectPlugins: NgSelectPluginInstances;
40
- pluginBus: PluginBus;
41
- pluginElement: ElementRef;
42
- /**
43
- * Options for NgSelect plugin
44
- */
45
- protected _options: BasicKeyboardHandlerOptions;
46
- /**
47
- * Popup that is displayed
48
- */
49
- protected _popup: Popup;
50
- /**
51
- * Gets currently available options
52
- */
53
- protected get availableOptions(): ɵNgSelectOption[];
54
- /**
55
- * Options for NgSelect plugin
56
- */
57
- get options(): BasicKeyboardHandlerOptions;
58
- set options(options: BasicKeyboardHandlerOptions);
59
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, options?: BasicKeyboardHandlerOptions);
60
- /**
61
- * Called when component is destroyed
62
- */
63
- ngOnDestroy(): void;
64
- /**
65
- * Initialize plugin, to be ready to use, initialize communication with other plugins
66
- */
67
- initialize(): void;
68
- /**
69
- * Initialize plugin options, all operations required to be done with plugin options are handled here
70
- */
71
- initOptions(): void;
72
- /**
73
- * Explicitly runs invalidation of content (change detection)
74
- */
75
- invalidateVisuals(): void;
76
- /**
77
- * Handles keyboard event
78
- * @param event - Keyboard event that occured
79
- */
80
- protected _handleKeyboard: (event: KeyboardEvent) => void;
81
- static ɵfac: i0.ɵɵFactoryDeclaration<BasicKeyboardHandlerComponent, [{ optional: true; }, { optional: true; }, null, { optional: true; }]>;
82
- static ɵcmp: i0.ɵɵComponentDeclaration<BasicKeyboardHandlerComponent, "ng-basic-keyboard-handler", never, {}, {}, never, never>;
83
- }
84
-
85
- /**
86
- * Basic keyboard handler options
87
- */
88
- export declare interface BasicKeyboardHandlerOptions extends KeyboardHandlerOptions {
89
- }
90
-
91
- /**
92
- * Public API for 'BasicLiveSearchComponent'
93
- */
94
- export declare interface BasicLiveSearch extends LiveSearch {
95
- }
96
-
97
- /**
98
- * Component used for obtaining basic live search html element
99
- */
100
- export declare class BasicLiveSearchComponent implements BasicLiveSearch, NgSelectPlugin<BasicLiveSearchOptions>, OnDestroy {
101
- ngSelectPlugins: NgSelectPluginInstances;
102
- pluginBus: PluginBus;
103
- pluginElement: ElementRef;
104
- protected _changeDetector: ChangeDetectorRef;
105
- protected _stringLocalization: StringLocalization;
106
- /**
107
- * Popup used in NgSelect
108
- */
109
- protected _popup: Popup;
110
- /**
111
- * Subscription for changes in texts
112
- */
113
- protected _textsChangedSubscription: Subscription;
114
- /**
115
- * Subscription for changes of popup visibility
116
- */
117
- protected _visibilityChangeSubscription: Subscription;
118
- /**
119
- * Subscription for live search focus request
120
- */
121
- protected _liveSearchFocusSubscription: Subscription;
122
- /**
123
- * Options for NgSelect plugin
124
- */
125
- protected _options: BasicLiveSearchOptions;
126
- /**
127
- * Options for NgSelect plugin
128
- */
129
- get options(): BasicLiveSearchOptions;
130
- set options(options: BasicLiveSearchOptions);
131
- /**
132
- * HTML element that represents live search
133
- */
134
- get liveSearchElement(): HTMLElement;
135
- /**
136
- * Current value of live search
137
- */
138
- searchValue: string;
139
- /**
140
- * Occurs when current value of live search changes
141
- */
142
- searchValueChange: EventEmitter<void>;
143
- /**
144
- * Object containing available texts
145
- * @internal
146
- */
147
- texts: LiveSearchTexts;
148
- /**
149
- * View child that represents live search element
150
- * @internal
151
- */
152
- liveSearchElementChild: ElementRef<HTMLElement>;
153
- /**
154
- * View child that represents input element
155
- * @internal
156
- */
157
- inputElementChild: ElementRef<HTMLInputElement>;
158
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, _changeDetector: ChangeDetectorRef, _stringLocalization: StringLocalization, options?: BasicLiveSearchOptions);
159
- /**
160
- * Called when component is destroyed
161
- */
162
- ngOnDestroy(): void;
163
- /**
164
- * Initialize plugin, to be ready to use, initialize communication with other plugins
165
- */
166
- initialize(): void;
167
- /**
168
- * Initialize plugin options, all operations required to be done with plugin options are handled here
169
- */
170
- initOptions(): void;
171
- /**
172
- * Explicitly runs invalidation of content (change detection)
173
- */
174
- invalidateVisuals(): void;
175
- /**
176
- * Handle input value
177
- * @param value - Value of input
178
- * @internal
179
- */
180
- handleInput(value: string): void;
181
- /**
182
- * Initialize texts
183
- */
184
- protected _initTexts(): void;
185
- static ɵfac: i0.ɵɵFactoryDeclaration<BasicLiveSearchComponent, [{ optional: true; }, { optional: true; }, null, null, null, { optional: true; }]>;
186
- static ɵcmp: i0.ɵɵComponentDeclaration<BasicLiveSearchComponent, "ng-basic-live-search", never, {}, {}, never, never>;
187
- }
188
-
189
- /**
190
- * Basic live search options
191
- */
192
- export declare interface BasicLiveSearchOptions extends LiveSearchOptions<CssClassesBasicLiveSearch> {
193
- /**
194
- * Indication whether keep search value after popup close
195
- */
196
- keepSearchValue?: boolean;
197
- }
198
-
199
- /**
200
- * Public API for 'BasicNormalStateComponent'
201
- */
202
- export declare interface BasicNormalState extends NormalState {
203
- }
204
-
205
- /**
206
- * Component used for rendering basic simple normal state of select
207
- */
208
- export declare class BasicNormalStateComponent<TValue = any> extends NormalStateAbstractComponent<CssClassesBasicNormalState, BasicNormalStateOptions<TValue>, TValue> implements BasicNormalState, NgSelectPlugin<BasicNormalStateOptions>, OnDestroy {
209
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, changeDetector: ChangeDetectorRef, stringLocalization: StringLocalization, options?: BasicNormalStateOptions);
210
- static ɵfac: i0.ɵɵFactoryDeclaration<BasicNormalStateComponent<any>, [{ optional: true; }, { optional: true; }, null, null, null, { optional: true; }]>;
211
- static ɵcmp: i0.ɵɵComponentDeclaration<BasicNormalStateComponent<any>, "div.normal-state", never, {}, {}, never, never>;
212
- }
213
-
214
- /**
215
- * Basic normal state options
216
- */
217
- export declare interface BasicNormalStateOptions<TValue = any> extends NormalStateOptions<CssClassesBasicNormalState, TValue> {
218
- }
219
-
220
- /**
221
- * Public API for 'BasicPopupComponent'
222
- */
223
- export declare interface BasicPopup extends Popup {
224
- }
225
-
226
- /**
227
- * Component used for rendering basic popup with options
228
- */
229
- export declare class BasicPopupComponent extends PopupAbstractComponent<CssClassesBasicPopup, BasicPopupOptions> implements BasicPopup, NgSelectPlugin<BasicPopupOptions>, AfterViewInit, OnDestroy {
230
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, changeDetector: ChangeDetectorRef, options: BasicPopupOptions, stringLocalization: StringLocalization, document?: Document);
231
- static ɵfac: i0.ɵɵFactoryDeclaration<BasicPopupComponent, [{ optional: true; }, { optional: true; }, null, null, { optional: true; }, null, null]>;
232
- static ɵcmp: i0.ɵɵComponentDeclaration<BasicPopupComponent, "div.ng-select-popup", never, {}, {}, never, ["*"]>;
233
- }
234
-
235
- /**
236
- * Basic popup options
237
- */
238
- export declare interface BasicPopupOptions extends PopupOptions<CssClassesBasicPopup> {
239
- }
240
-
241
- /**
242
- * Public API for 'BasicPositionerComponent'
243
- */
244
- export declare interface BasicPositioner extends Positioner {
245
- }
246
-
247
- /**
248
- * Component used for positioning popup element, handles resize, scroll and collision with viewport
249
- */
250
- export declare class BasicPositionerComponent implements BasicPositioner, NgSelectPlugin<BasicPositionerOptions>, OnDestroy {
251
- ngSelectPlugins: NgSelectPluginInstances;
252
- pluginBus: PluginBus;
253
- pluginElement: ElementRef;
254
- protected _changeDetector: ChangeDetectorRef;
255
- protected _document?: Document;
256
- protected _platformId?: Object;
257
- protected _scrollTargetSelector?: ScrollTargetSelector;
258
- /**
259
- * Instance of previous options gatherer, that is used for obtaining available options
260
- */
261
- protected _optionsGatherer: OptionsGatherer;
262
- /**
263
- * Options for NgSelect plugin
264
- */
265
- protected _options: BasicPositionerOptions;
266
- /**
267
- * Subscription for visibility change of popup
268
- */
269
- protected _visibilitySubscription: Subscription;
270
- /**
271
- * Subscription for changes of options in options gatherer
272
- */
273
- protected _optionsChangeSubscription: Subscription;
274
- /**
275
- * Popup that is displayed
276
- */
277
- protected _popup: Popup;
278
- /**
279
- * Html element of popup plugin
280
- */
281
- protected _popupElement: HTMLElement;
282
- /**
283
- * Indication whether is code running in browser
284
- */
285
- protected _isBrowser: boolean;
286
- /**
287
- * Options for NgSelect plugin
288
- */
289
- get options(): BasicPositionerOptions;
290
- set options(options: BasicPositionerOptions);
291
- /**
292
- * Gets scroll target
293
- */
294
- get scrollTarget(): EventTarget;
295
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, _changeDetector: ChangeDetectorRef, options?: BasicPositionerOptions, _document?: Document, _platformId?: Object, _scrollTargetSelector?: ScrollTargetSelector);
296
- /**
297
- * Called when component is destroyed
298
- */
299
- ngOnDestroy(): void;
300
- /**
301
- * Initialize plugin, to be ready to use, initialize communication with other plugins
302
- */
303
- initialize(): void;
304
- /**
305
- * Initialize plugin options, all operations required to be done with plugin options are handled here
306
- */
307
- initOptions(): void;
308
- /**
309
- * Explicitly runs invalidation of content (change detection)
310
- */
311
- invalidateVisuals(): void;
312
- /**
313
- * Handles resize and scroll event
314
- */
315
- protected _handleResizeAndScroll: () => void;
316
- /**
317
- * Handles position of popup
318
- */
319
- protected _handlePosition(): void;
320
- /**
321
- * Updates min width of popup
322
- */
323
- protected _updateMinWidth(): void;
324
- static ɵfac: i0.ɵɵFactoryDeclaration<BasicPositionerComponent, [{ optional: true; }, { optional: true; }, null, null, { optional: true; }, null, null, null]>;
325
- static ɵcmp: i0.ɵɵComponentDeclaration<BasicPositionerComponent, "ng-basic-positioner", never, {}, {}, never, never>;
326
- }
327
-
328
- /**
329
- * Basic positioner options
330
- */
331
- export declare interface BasicPositionerOptions extends PositionerOptions {
332
- /**
333
- * Callback that is called when flip occurs during positioning
334
- */
335
- flipCallback?: FlipCallback;
336
- /**
337
- * Target element that is used for handling scroll event
338
- */
339
- scrollTarget?: EventTarget;
340
- /**
341
- * Indication whether positioner should be sensitive/activated also to scroll of scrollTarget
342
- */
343
- activateOnScroll?: boolean;
344
- /**
345
- * Indication whether positioner should be sensitive/activated also on resize of window
346
- */
347
- activateOnResize?: boolean;
348
- }
349
-
350
- /**
351
- * Public API for 'BasicValueHandlerComponent'
352
- */
353
- export declare interface BasicValueHandler<TValue = any> extends ValueHandler<TValue> {
354
- }
355
-
356
- /**
357
- * Component used for handling current value of NgSelect
358
- */
359
- export declare class BasicValueHandlerComponent<TValue = any> extends ValueHandlerBase<TValue, BasicValueHandlerOptions> implements BasicValueHandler<TValue> {
360
- /**
361
- * Backed up unmapped value that was set before options were obtained
362
- */
363
- protected _unmappedValue: TValue | TValue[];
364
- /**
365
- * Options for NgSelect plugin
366
- */
367
- get options(): BasicValueHandlerOptions;
368
- set options(options: BasicValueHandlerOptions);
369
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus<TValue>, pluginElement: ElementRef, options?: BasicValueHandlerOptions);
370
- /**
371
- * Sets value for NgSelect
372
- * @param value - Value to be set
373
- */
374
- setValue(value: TValue | TValue[]): void;
375
- /**
376
- * Initialize plugin options, all operations required to be done with plugin options are handled here
377
- */
378
- initOptions(): void;
379
- /**
380
- * Explicitly runs invalidation of content (change detection)
381
- */
382
- invalidateVisuals(): void;
383
- /**
384
- * Sets value
385
- */
386
- protected _setValue: (option: ɵNgSelectOption<TValue>) => void;
387
- /**
388
- * Loads options
389
- */
390
- protected _loadOptions(): void;
391
- /**
392
- * Converts value to options
393
- * @param value - Value to be changed to options
394
- */
395
- protected _useOptionsAsValue(value: TValue | TValue[]): void;
396
- static ɵfac: i0.ɵɵFactoryDeclaration<BasicValueHandlerComponent<any>, [{ optional: true; }, { optional: true; }, null, { optional: true; }]>;
397
- static ɵcmp: i0.ɵɵComponentDeclaration<BasicValueHandlerComponent<any>, "ng-basic-value-handler", never, {}, {}, never, never>;
398
- }
399
-
400
- /**
401
- * Basic value handler options
402
- */
403
- export declare interface BasicValueHandlerOptions extends ValueHandlerOptions {
404
- }
405
-
406
- /**
407
- * Options gatherer used for static options gathering from code
408
- */
409
- export declare class CodeOptionsGatherer<TValue = any> implements OptionsGatherer<TValue> {
410
- /**
411
- * Array of visible, displayed options for select
412
- */
413
- private _availableOptions;
414
- /**
415
- * Array of provided options for select
416
- */
417
- private _options;
418
- /**
419
- * Occurs when array of visible, displayed options has changed
420
- */
421
- private _availableOptionsChange;
422
- /**
423
- * Live search plugin currently used in NgSelect
424
- */
425
- protected _liveSearch: LiveSearch;
426
- /**
427
- * Subscription for changes of live search value
428
- */
429
- protected _searchValueChangeSubscription: Subscription;
430
- /**
431
- * Array of provided options for select
432
- */
433
- get options(): NgSelectOption<TValue>[];
434
- set options(value: NgSelectOption<TValue>[]);
435
- /**
436
- * Occurs when array of provided options has changed
437
- */
438
- optionsChange: EventEmitter<void>;
439
- /**
440
- * Array of visible, displayed options for select
441
- */
442
- get availableOptions(): NgSelectOption<TValue>[];
443
- /**
444
- * Occurs when array of visible, displayed options has changed
445
- */
446
- get availableOptionsChange(): EventEmitter<void>;
447
- /**
448
- * NgSelect plugin instances available for gatherer
449
- */
450
- ngSelectPlugins: NgSelectPluginInstances;
451
- /**
452
- * Plugin bus used for inter plugin shared events
453
- */
454
- pluginBus: PluginBus<TValue>;
455
- /**
456
- * Select element that implements default gatherers
457
- */
458
- select: NgSelect<TValue>;
459
- /**
460
- * Initialize gatherer during initialization phase
461
- */
462
- initializeGatherer(): void;
463
- /**
464
- * Called when gatherer needs to be destroyed
465
- */
466
- destroyGatherer(): void;
467
- }
468
-
469
- /**
470
- * Function used for comparing two values
471
- */
472
- export declare interface CompareValueFunc<TValue = any> {
473
- /**
474
- * Compares two values and returns true if objects are equal, otherwise false
475
- * @param source - First value to be compared
476
- * @param target - Second value to be compared
477
- */
478
- (source: TValue, target: TValue): boolean;
479
- }
480
-
481
- /**
482
- * Css classes for basic live search
483
- */
484
- export declare interface CssClassesBasicLiveSearch {
485
- /**
486
- * Applied to wrapper div around input
487
- */
488
- wrapperDiv?: string;
489
- /**
490
- * Applied to input that represents live search
491
- */
492
- input?: string;
493
- }
494
-
495
- /**
496
- * Css classes for basic normal state
497
- */
498
- export declare interface CssClassesBasicNormalState {
499
- /**
500
- * Applied to currently selected value, which is visible to user (default template)
501
- */
502
- selectedValue?: string;
503
- /**
504
- * Applied to "carret", indicating that it is select and there is more options available
505
- */
506
- selectedCarret?: string;
507
- /**
508
- * Applied to HTML element that represents normal default state visible to user
509
- */
510
- normalStateElement?: string;
511
- }
512
-
513
- /**
514
- * Css classes for basic popup
515
- */
516
- export declare interface CssClassesBasicPopup {
517
- /**
518
- * Css class applied to each option div
519
- */
520
- optionItemDiv?: string;
521
- /**
522
- * Css class applied to each option text div
523
- */
524
- optionItemTextDiv?: string;
525
- /**
526
- * Css class used as icons indicating that option is selected (only when multiple)
527
- */
528
- optionChecked?: string;
529
- /**
530
- * Css class applied directly to css popup
531
- */
532
- popupDiv?: string;
533
- }
534
-
535
- /**
536
- * Css classes for edit live search
537
- */
538
- export declare interface CssClassesEditLiveSearch {
539
- /**
540
- * Applied to wrapper div around input
541
- */
542
- wrapperDiv?: string;
543
- /**
544
- * Applied to input that represents live search
545
- */
546
- input?: string;
547
- }
548
-
549
- /**
550
- * Css classes for edit normal state
551
- */
552
- export declare interface CssClassesEditNormalState {
553
- /**
554
- * Applied to currently selected value, which is visible to user (default template)
555
- */
556
- selectedValue?: string;
557
- /**
558
- * Applied to "carret", indicating that it is select and there is more options available
559
- */
560
- selectedCarret?: string;
561
- /**
562
- * Applied to "carret" wrapper element
563
- */
564
- selectedCarretWrapper?: string;
565
- /**
566
- * Applied to HTML element that represents normal default state visible to user
567
- */
568
- normalStateElement?: string;
569
- /**
570
- * Applied to container displaying single multi value
571
- */
572
- selectedMultiValueContainer?: string;
573
- /**
574
- * Applied to element used for canceling selected value
575
- */
576
- selectedMultiValueCancel?: string;
577
- /**
578
- * Applied to element that is used as cancel selected button
579
- */
580
- cancelSelectedElement?: string;
581
- }
582
-
583
- /**
584
- * Css classes for edit popup
585
- */
586
- export declare interface CssClassesEditPopup {
587
- /**
588
- * Css class applied to each option div
589
- */
590
- optionItemDiv?: string;
591
- /**
592
- * Css class applied to each option text div
593
- */
594
- optionItemTextDiv?: string;
595
- /**
596
- * Css class used as icons indicating that option is selected (only when multiple)
597
- */
598
- optionChecked?: string;
599
- /**
600
- * Css class applied directly to css popup
601
- */
602
- popupDiv?: string;
603
- }
604
-
605
- /**
606
- * Function used for transformation of ng select option into display text
607
- */
608
- export declare interface DisplayTextFunc<TValue = any> {
609
- /**
610
- * Transforms option into display text
611
- * @param option - Option that is being transformed
612
- */
613
- (option: NgSelectOption<TValue>): string;
614
- }
615
-
616
- /**
617
- * Class that is used as for options gathering in dynamic way, for example from external source when writing
618
- */
619
- export declare class DynamicOptionsGatherer<TValue = any> implements OptionsGatherer<TValue> {
620
- protected _options: DynamicOptionsGathererOptions<TValue>;
621
- /**
622
- * Live search plugin currently used in NgSelect
623
- */
624
- protected _liveSearch: LiveSearch;
625
- /**
626
- * Subscription for changes of live search value
627
- */
628
- protected _searchValueChangeSubscription: Subscription;
629
- /**
630
- * Subscription for visibility change of popup
631
- */
632
- protected _visibilitySubscription: Subscription;
633
- /**
634
- * Minimal number of characters required for searching
635
- */
636
- protected _minLength: number;
637
- /**
638
- * Popup that is displayed
639
- */
640
- protected _popup: Popup;
641
- /**
642
- * Indication that first initial call was performed
643
- */
644
- protected _initialized: boolean;
645
- /**
646
- * Currently used value handler plugin
647
- */
648
- protected _valueHandler: ValueHandler;
649
- /**
650
- * Array of provided options for select
651
- */
652
- options: NgSelectOption<TValue>[];
653
- /**
654
- * Occurs when array of provided options has changed
655
- */
656
- optionsChange: EventEmitter<void>;
657
- /**
658
- * Array of visible, displayed options for select
659
- */
660
- get availableOptions(): NgSelectOption<TValue>[];
661
- /**
662
- * Occurs when array of visible, displayed options has changed
663
- */
664
- get availableOptionsChange(): EventEmitter<void>;
665
- /**
666
- * NgSelect plugin instances available for gatherer
667
- */
668
- ngSelectPlugins: NgSelectPluginInstances;
669
- /**
670
- * Plugin bus used for inter plugin shared events
671
- */
672
- pluginBus: PluginBus<TValue>;
673
- /**
674
- * Select element that implements default gatherers
675
- */
676
- select: NgSelect<TValue>;
677
- constructor(_options: DynamicOptionsGathererOptions<TValue>);
678
- /**
679
- * Initialize gatherer during initialization phase
680
- */
681
- initializeGatherer(): void;
682
- /**
683
- * Called when gatherer needs to be destroyed
684
- */
685
- destroyGatherer(): void;
686
- /**
687
- * Process options change request
688
- */
689
- protected _processOptionsChange(): Promise<void>;
690
- }
691
-
692
- /**
693
- * Options for dynamic options gatherer
694
- */
695
- export declare interface DynamicOptionsGathererOptions<TValue = any> {
696
- /**
697
- * Callback used for obtaining dynamic options
698
- */
699
- dynamicOptionsCallback: GetOptionsCallback<TValue>;
700
- /**
701
- * Number of miliseconds which represents minimal delay between calls of dynamicOptionsCallback
702
- */
703
- delay?: number;
704
- /**
705
- * Minimal number of characters to be used for searching
706
- */
707
- minLength?: number;
708
- }
709
-
710
- /**
711
- * Public API for 'DynamicValueHandlerComponent'
712
- */
713
- export declare interface DynamicValueHandler<TValue = any> extends ValueHandler<TValue> {
714
- }
715
-
716
- /**
717
- * Component used for handling current value of NgSelect, allows values which are not present in options
718
- */
719
- export declare class DynamicValueHandlerComponent<TValue = any> extends ValueHandlerBase<TValue, DynamicValueHandlerOptions<TValue>> implements DynamicValueHandler<TValue> {
720
- /**
721
- * Options for NgSelect plugin
722
- */
723
- get options(): DynamicValueHandlerOptions<TValue>;
724
- set options(options: DynamicValueHandlerOptions<TValue>);
725
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus<TValue>, pluginElement: ElementRef, options?: DynamicValueHandlerOptions<TValue>);
726
- /**
727
- * Sets value for NgSelect
728
- * @param value - Value to be set
729
- */
730
- setValue(value: TValue | TValue[]): void;
731
- /**
732
- * Initialize plugin options, all operations required to be done with plugin options are handled here
733
- */
734
- initOptions(): void;
735
- /**
736
- * Explicitly runs invalidation of content (change detection)
737
- */
738
- invalidateVisuals(): void;
739
- /**
740
- * Sets value
741
- */
742
- protected _setValue: (option: ɵNgSelectOption<TValue>) => void;
743
- /**
744
- * Loads options
745
- */
746
- protected _loadOptions(): void;
747
- /**
748
- * Converts value to options
749
- * @param value - Value to be changed to options
750
- */
751
- protected _useOptionsAsValue(value: TValue | TValue[]): Promise<void>;
752
- /**
753
- * Loads text for specified value
754
- * @param value - Value that is going to be used for obtaining option
755
- */
756
- protected _loadText(value: TValue): Promise<ɵNgSelectOption<TValue>>;
757
- static ɵfac: i0.ɵɵFactoryDeclaration<DynamicValueHandlerComponent<any>, [{ optional: true; }, { optional: true; }, null, { optional: true; }]>;
758
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicValueHandlerComponent<any>, "ng-dynamic-value-handler", never, {}, {}, never, never>;
759
- }
760
-
761
- /**
762
- * Dynamic value handler options
763
- */
764
- export declare interface DynamicValueHandlerOptions<TValue = any> extends ValueHandlerOptions {
765
- /**
766
- * Callback used for obtaining dynamic options during initialization, if not specified value will be used as text
767
- */
768
- dynamicOptionsCallback?: GetOptionsCallback<TValue>;
769
- /**
770
- * Used for obtaining displayed text from value, defaults to value itself, if dynamicOptionsCallback is specified this is not called
771
- */
772
- textExtractor?: (value: TValue) => string;
773
- }
774
-
775
- /**
776
- * Public API for 'EditKeyboardHandlerComponent'
777
- */
778
- export declare interface EditKeyboardHandler extends KeyboardHandler {
779
- }
780
-
781
- /**
782
- * Component used for obtaining edit keyboard handler html element
783
- */
784
- export declare class EditKeyboardHandlerComponent implements EditKeyboardHandler, NgSelectPlugin<EditKeyboardHandlerOptions>, OnDestroy {
785
- ngSelectPlugins: NgSelectPluginInstances;
786
- pluginBus: PluginBus;
787
- pluginElement: ElementRef;
788
- /**
789
- * Options for NgSelect plugin
790
- */
791
- protected _options: EditKeyboardHandlerOptions;
792
- /**
793
- * Popup that is displayed
794
- */
795
- protected _popup: Popup;
796
- /**
797
- * Value handler used for hanling current value
798
- */
799
- protected _valueHandler: ValueHandler;
800
- /**
801
- * Live search plugin currently used in NgSelect
802
- */
803
- protected _liveSearch: LiveSearch;
804
- /**
805
- * Gets currently available options
806
- */
807
- protected get availableOptions(): ɵNgSelectOption[];
808
- /**
809
- * Options for NgSelect plugin
810
- */
811
- get options(): EditKeyboardHandlerOptions;
812
- set options(options: EditKeyboardHandlerOptions);
813
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, options?: EditKeyboardHandlerOptions);
814
- /**
815
- * Called when component is destroyed
816
- */
817
- ngOnDestroy(): void;
818
- /**
819
- * Initialize plugin, to be ready to use, initialize communication with other plugins
820
- */
821
- initialize(): void;
822
- /**
823
- * Initialize plugin options, all operations required to be done with plugin options are handled here
824
- */
825
- initOptions(): void;
826
- /**
827
- * Explicitly runs invalidation of content (change detection)
828
- */
829
- invalidateVisuals(): void;
830
- /**
831
- * Handles keyboard event
832
- * @param event - Keyboard event that occured
833
- */
834
- protected _handleKeyboard: (event: KeyboardEvent) => void;
835
- static ɵfac: i0.ɵɵFactoryDeclaration<EditKeyboardHandlerComponent, [{ optional: true; }, { optional: true; }, null, { optional: true; }]>;
836
- static ɵcmp: i0.ɵɵComponentDeclaration<EditKeyboardHandlerComponent, "ng-edit-keyboard-handler", never, {}, {}, never, never>;
837
- }
838
-
839
- /**
840
- * Edit keyboard handler options
841
- */
842
- export declare interface EditKeyboardHandlerOptions extends KeyboardHandlerOptions {
843
- }
844
-
845
- /**
846
- * Public API for 'EditLiveSearchComponent'
847
- */
848
- export declare interface EditLiveSearch extends LiveSearch {
849
- }
850
-
851
- /**
852
- * Component used for obtaining edit live search html element
853
- */
854
- export declare class EditLiveSearchComponent implements EditLiveSearch, NgSelectPlugin<EditLiveSearchOptions>, OnDestroy {
855
- ngSelectPlugins: NgSelectPluginInstances;
856
- pluginBus: PluginBus;
857
- pluginElement: ElementRef;
858
- protected _changeDetector: ChangeDetectorRef;
859
- protected _stringLocalization: StringLocalization;
860
- /**
861
- * Popup plugin used within `NgSelect`
862
- */
863
- protected _popup: Popup;
864
- /**
865
- * Value handler plugin used within `NgSelect`
866
- */
867
- protected _valueHandler: ValueHandler;
868
- /**
869
- * Instance of previous options gatherer, that is used for obtaining available options
870
- */
871
- protected _optionsGatherer: OptionsGatherer;
872
- /**
873
- * Subscription for changes of options in options gatherer
874
- */
875
- protected _optionsChangeSubscription: Subscription;
876
- /**
877
- * Subscription for changes in texts
878
- */
879
- protected _textsChangedSubscription: Subscription;
880
- /**
881
- * Subscription for changes of selected value
882
- */
883
- protected _valueChangedSubscription: Subscription;
884
- /**
885
- * Subscription for live search focus request
886
- */
887
- protected _liveSearchFocusSubscription: Subscription;
888
- /**
889
- * Subscription for update displayed value request
890
- */
891
- protected _updateDisplayedValueSubscription: Subscription;
892
- /**
893
- * Options for NgSelect plugin
894
- */
895
- protected _options: EditLiveSearchOptions;
896
- /**
897
- * Gets currently available options
898
- */
899
- protected get availableOptions(): ɵNgSelectOption[];
900
- /**
901
- * Options for NgSelect plugin
902
- */
903
- get options(): EditLiveSearchOptions;
904
- set options(options: EditLiveSearchOptions);
905
- /**
906
- * HTML element that represents live search
907
- */
908
- get liveSearchElement(): HTMLElement;
909
- /**
910
- * Current value of live search
911
- */
912
- searchValue: string;
913
- /**
914
- * Occurs when current value of live search changes
915
- */
916
- searchValueChange: EventEmitter<void>;
917
- /**
918
- * Current value that is displayed
919
- * @internal
920
- */
921
- searchValueDisplayed: string;
922
- /**
923
- * Object containing available texts
924
- * @internal
925
- */
926
- texts: LiveSearchTexts;
927
- /**
928
- * View child that represents live search element
929
- * @internal
930
- */
931
- liveSearchElementChild: ElementRef<HTMLElement>;
932
- /**
933
- * View child that represents input element
934
- * @internal
935
- */
936
- inputElementChild: ElementRef<HTMLInputElement>;
937
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, _changeDetector: ChangeDetectorRef, _stringLocalization: StringLocalization, options?: EditLiveSearchOptions);
938
- /**
939
- * Called when component is destroyed
940
- */
941
- ngOnDestroy(): void;
942
- /**
943
- * Initialize plugin, to be ready to use, initialize communication with other plugins
944
- */
945
- initialize(): void;
946
- /**
947
- * Initialize plugin options, all operations required to be done with plugin options are handled here
948
- */
949
- initOptions(): void;
950
- /**
951
- * Explicitly runs invalidation of content (change detection)
952
- */
953
- invalidateVisuals(): void;
954
- /**
955
- * Handle input value
956
- * @param value - Value of input
957
- * @param inputChange - Indication that change was by input event of input
958
- * @internal
959
- */
960
- handleInput(value: string, inputChange?: boolean): void;
961
- /**
962
- * Handles focus event
963
- * @param element - Element that got focus
964
- * @param show - Indication whether show popup
965
- * @internal
966
- */
967
- handleFocus(element: HTMLInputElement, show?: boolean): void;
968
- /**
969
- * Handles blur of live search
970
- */
971
- handleBlur(): void;
972
- /**
973
- * Initialize texts
974
- */
975
- protected _initTexts(): void;
976
- /**
977
- * Activates first available option or selected option
978
- */
979
- protected _activateSelectedOrFirst(): void;
980
- static ɵfac: i0.ɵɵFactoryDeclaration<EditLiveSearchComponent, [{ optional: true; }, { optional: true; }, null, null, null, { optional: true; }]>;
981
- static ɵcmp: i0.ɵɵComponentDeclaration<EditLiveSearchComponent, "ng-edit-live-search", never, {}, {}, never, never>;
982
- }
983
-
984
- /**
985
- * Edit live search options
986
- */
987
- export declare interface EditLiveSearchOptions extends LiveSearchOptions<CssClassesEditLiveSearch> {
988
- /**
989
- * Indication whether keep search value after popup close
990
- */
991
- keepSearchValue?: boolean;
992
- /**
993
- * Indication whether cancel selected value if non existing value is in live search, works for single value
994
- */
995
- nonExistingCancel?: boolean;
996
- /**
997
- * Indicaiton whether empty string in live search cancel selected value
998
- */
999
- emptyCancel?: boolean;
1000
- }
1001
-
1002
- /**
1003
- * Public API for 'EditNormalStateComponent'
1004
- */
1005
- export declare interface EditNormalState extends NormalState {
1006
- }
1007
-
1008
- /**
1009
- * Component used for rendering edit normal state of select
1010
- */
1011
- export declare class EditNormalStateComponent<TValue = any> extends NormalStateAbstractComponent<CssClassesEditNormalState, EditNormalStateOptions<TValue>, TValue> implements EditNormalState, NgSelectPlugin<EditNormalStateOptions>, OnDestroy {
1012
- /**
1013
- * Gets currently selected options
1014
- */
1015
- get selectedOptions(): NgSelectOption[];
1016
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, changeDetector: ChangeDetectorRef, stringLocalization: StringLocalization, options?: EditNormalStateOptions);
1017
- /**
1018
- * Cancel selected options
1019
- */
1020
- cancelSelected(): void;
1021
- static ɵfac: i0.ɵɵFactoryDeclaration<EditNormalStateComponent<any>, [{ optional: true; }, { optional: true; }, null, null, null, { optional: true; }]>;
1022
- static ɵcmp: i0.ɵɵComponentDeclaration<EditNormalStateComponent<any>, "div.edit-normal-state", never, {}, {}, never, ["*"]>;
1023
- }
1024
-
1025
- /**
1026
- * Edit normal state options
1027
- */
1028
- export declare interface EditNormalStateOptions<TValue = any> extends NormalStateOptions<CssClassesEditNormalState, TValue> {
1029
- /**
1030
- * Indication whether display cancel button
1031
- */
1032
- cancelButton?: boolean;
1033
- /**
1034
- * Indication whether display button for displaying options
1035
- */
1036
- showOptionsButton?: boolean;
1037
- }
1038
-
1039
- /**
1040
- * Public API for 'EditPopupComponent'
1041
- */
1042
- export declare interface EditPopup extends Popup {
1043
- }
1044
-
1045
- /**
1046
- * Component used for rendering edit popup with options
1047
- */
1048
- export declare class EditPopupComponent extends PopupAbstractComponent<CssClassesEditPopup, EditPopupOptions> implements EditPopup, NgSelectPlugin<EditPopupOptions>, AfterViewInit, OnDestroy {
1049
- /**
1050
- * Gets indication whether keep open popup after value change
1051
- */
1052
- protected get keepOpen(): boolean;
1053
- /**
1054
- * Gets all options
1055
- */
1056
- protected get allOptions(): ɵNgSelectOption[];
1057
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, changeDetector: ChangeDetectorRef, options: EditPopupOptions, stringLocalization: StringLocalization, document?: Document);
1058
- /**
1059
- * Handles mouse move and changes active option
1060
- * @param option - Option to be set as active
1061
- * @internal
1062
- */
1063
- handleMouseActivation(option: ɵNgSelectOption): void;
1064
- static ɵfac: i0.ɵɵFactoryDeclaration<EditPopupComponent, [{ optional: true; }, { optional: true; }, null, null, { optional: true; }, null, null]>;
1065
- static ɵcmp: i0.ɵɵComponentDeclaration<EditPopupComponent, "div.ng-select-edit-popup", never, {}, {}, never, never>;
1066
- }
1067
-
1068
- /**
1069
- * Edit popup options
1070
- */
1071
- export declare interface EditPopupOptions extends PopupOptions<CssClassesEditPopup> {
1072
- }
1073
-
1074
- /**
1075
- * Options gatherer using default build in gatherer extended with exclusion of selected options
1076
- */
1077
- export declare class ExcludingOptionsGatherer<TValue = any> implements OptionsGatherer<TValue> {
1078
- /**
1079
- * Array of visible, displayed options for select
1080
- */
1081
- protected _availableOptions: NgSelectOption<TValue>[];
1082
- /**
1083
- * Occurs when array of visible, displayed options has changed
1084
- */
1085
- protected _availableOptionsChange: EventEmitter<void>;
1086
- /**
1087
- * Subscription for change of available options
1088
- */
1089
- protected _availableOptionsChangeSubscription: Subscription;
1090
- /**
1091
- * Subscription for change of value in value handler
1092
- */
1093
- protected _valueChangedSubscription: Subscription;
1094
- /**
1095
- * Value handler plugin used within `NgSelect`
1096
- */
1097
- protected _valueHandler: ValueHandler;
1098
- /**
1099
- * Array of provided options for select
1100
- */
1101
- get options(): NgSelectOption<TValue>[];
1102
- /**
1103
- * Occurs when array of provided options has changed
1104
- */
1105
- get optionsChange(): EventEmitter<void>;
1106
- /**
1107
- * Array of visible, displayed options for select
1108
- */
1109
- get availableOptions(): NgSelectOption<TValue>[];
1110
- /**
1111
- * Occurs when array of visible, displayed options has changed
1112
- */
1113
- get availableOptionsChange(): EventEmitter<void>;
1114
- /**
1115
- * NgSelect plugin instances available for gatherer
1116
- */
1117
- ngSelectPlugins: NgSelectPluginInstances;
1118
- /**
1119
- * Plugin bus used for inter plugin shared events
1120
- */
1121
- pluginBus: PluginBus<TValue>;
1122
- /**
1123
- * Select element that implements default gatherers
1124
- */
1125
- select: NgSelect<TValue>;
1126
- /**
1127
- * Initialize gatherer during initialization phase
1128
- */
1129
- initializeGatherer(): void;
1130
- /**
1131
- * Called when gatherer needs to be destroyed
1132
- */
1133
- destroyGatherer(): void;
1134
- /**
1135
- * Exclude selected options
1136
- */
1137
- protected _excludeSelected(): void;
1138
- }
1139
-
1140
- /**
1141
- * Callback used for obtaining dynamic options
1142
- */
1143
- export declare interface GetOptionsCallback<TValue = any> {
1144
- /**
1145
- * Gets array of options based on query
1146
- * @param query - Query for obtaining options, can be searched string or TValue in case of obtaining option for value during initialization
1147
- */
1148
- (query: string | TValue): Promise<NgSelectOption<TValue>[]>;
1149
- }
1150
-
1151
- declare namespace i1 {
1152
- export {
1153
- OptionComponent
1154
- }
1155
- }
1156
-
1157
- declare namespace i10 {
1158
- export {
1159
- BasicPopupComponent
1160
- }
1161
- }
1162
-
1163
- declare namespace i11 {
1164
- export {
1165
- NoPositionerComponent
1166
- }
1167
- }
1168
-
1169
- declare namespace i12 {
1170
- export {
1171
- BasicPositionerComponent
1172
- }
1173
- }
1174
-
1175
- declare namespace i13 {
1176
- export {
1177
- BasicKeyboardHandlerComponent
1178
- }
1179
- }
1180
-
1181
- declare namespace i14 {
1182
- export {
1183
- BasicValueHandlerComponent
1184
- }
1185
- }
1186
-
1187
- declare namespace i15 {
1188
- export {
1189
- NgSelectAbsoluteDirective
1190
- }
1191
- }
1192
-
1193
- declare namespace i16 {
1194
- export {
1195
- NgSelectPlaceholderDirective
1196
- }
1197
- }
1198
-
1199
- declare namespace i1_2 {
1200
- export {
1201
- DynamicValueHandlerComponent
1202
- }
1203
- }
1204
-
1205
- declare namespace i1_3 {
1206
- export {
1207
- NgSelectEditDirective
1208
- }
1209
- }
1210
-
1211
- declare namespace i2 {
1212
- export {
1213
- OptGroupComponent
1214
- }
1215
- }
1216
-
1217
- declare namespace i2_2 {
1218
- export {
1219
- EditNormalStateComponent
1220
- }
1221
- }
1222
-
1223
- declare namespace i3 {
1224
- export {
1225
- NgSelectComponent
1226
- }
1227
- }
1228
-
1229
- declare namespace i3_2 {
1230
- export {
1231
- EditLiveSearchComponent
1232
- }
1233
- }
1234
-
1235
- declare namespace i4 {
1236
- export {
1237
- NgSelectValuePipe
1238
- }
1239
- }
1240
-
1241
- declare namespace i4_2 {
1242
- export {
1243
- EditPopupComponent
1244
- }
1245
- }
1246
-
1247
- declare namespace i5 {
1248
- export {
1249
- NgSelectHasValuePipe
1250
- }
1251
- }
1252
-
1253
- declare namespace i5_2 {
1254
- export {
1255
- EditKeyboardHandlerComponent
1256
- }
1257
- }
1258
-
1259
- declare namespace i6 {
1260
- export {
1261
- NgSelectControlValueAccessor
1262
- }
1263
- }
1264
-
1265
- declare namespace i7 {
1266
- export {
1267
- BasicNormalStateComponent
1268
- }
1269
- }
1270
-
1271
- declare namespace i7_2 {
1272
- export {
1273
- NgSelectModule
1274
- }
1275
- }
1276
-
1277
- declare namespace i8 {
1278
- export {
1279
- NoLiveSearchComponent
1280
- }
1281
- }
1282
-
1283
- declare namespace i9 {
1284
- export {
1285
- BasicLiveSearchComponent
1286
- }
1287
- }
1288
-
1289
- /**
1290
- * Constant used for accessing keyboard handler plugin in NgSelect
1291
- */
1292
- export declare const KEYBOARD_HANDLER = "KEYBOARD_HANDLER";
1293
-
1294
- /**
1295
- * Token for injecting options for keyboard handler plugin
1296
- */
1297
- export declare const KEYBOARD_HANDLER_OPTIONS: InjectionToken<KeyboardHandlerOptions>;
1298
-
1299
- /**
1300
- * Injection token for 'KeyboardHandler' implementation
1301
- */
1302
- export declare const KEYBOARD_HANDLER_TYPE: InjectionToken<Type<KeyboardHandler>>;
1303
-
1304
- /**
1305
- * Keyboard handler plugin interface
1306
- */
1307
- export declare interface KeyboardHandler extends NgSelectPlugin {
1308
- }
1309
-
1310
- /**
1311
- * Options for keyboard handler plugin
1312
- */
1313
- export declare interface KeyboardHandlerOptions extends PluginOptions {
1314
- }
1315
-
1316
- /**
1317
- * Constant used for accessing live search plugin in NgSelect
1318
- */
1319
- export declare const LIVE_SEARCH = "LIVE_SEARCH";
1320
-
1321
- /**
1322
- * Token for injecting options for live search plugin
1323
- */
1324
- export declare const LIVE_SEARCH_OPTIONS: InjectionToken<LiveSearchOptions>;
1325
-
1326
- /**
1327
- * Injection token for 'LiveSearch' implementation
1328
- */
1329
- export declare const LIVE_SEARCH_TYPE: InjectionToken<Type<LiveSearch>>;
1330
-
1331
- /**
1332
- * Keyboard handler plugin interface
1333
- */
1334
- export declare interface LiveSearch extends NgSelectPlugin {
1335
- /**
1336
- * HTML element that represents live search
1337
- */
1338
- readonly liveSearchElement: HTMLElement;
1339
- /**
1340
- * Current value of live search
1341
- */
1342
- readonly searchValue: string;
1343
- /**
1344
- * Occurs when current value of live search changes
1345
- */
1346
- readonly searchValueChange: EventEmitter<void>;
1347
- }
1348
-
1349
- /**
1350
- * Callback that is used for filtering static values during live search
1351
- */
1352
- export declare interface LiveSearchFilter<TValue = any> {
1353
- (query: string, normalizer?: NormalizeFunc<TValue>): (option: NgSelectOption<TValue>) => boolean;
1354
- }
1355
-
1356
- /**
1357
- * Options for live search plugin
1358
- */
1359
- export declare interface LiveSearchOptions<TCssClasses = any> extends VisualPluginOptions<TCssClasses> {
1360
- /**
1361
- * Texts that are used within any LiveSearch
1362
- */
1363
- texts?: LiveSearchTexts;
1364
- }
1365
-
1366
- /**
1367
- * Texts that are used within LiveSearch
1368
- */
1369
- export declare interface LiveSearchTexts {
1370
- /**
1371
- * Displayed when nothing was entered into input
1372
- */
1373
- inputPlaceholder?: string;
1374
- }
1375
-
1376
- /**
1377
- * Injection token for 'NgSelectOptions'
1378
- */
1379
- export declare const NG_SELECT_OPTIONS: InjectionToken<NgSelectOptions>;
1380
-
1381
- /**
1382
- * Token used for obtaining 'NgSelectPluginInstances'
1383
- */
1384
- export declare const NG_SELECT_PLUGIN_INSTANCES: InjectionToken<NgSelectPluginInstances>;
1385
-
1386
- /**
1387
- * Public API for NgSelect
1388
- */
1389
- export declare interface NgSelect<TValue = any> extends OptionsGatherer<TValue>, TemplateGatherer {
1390
- /**
1391
- * Occurs every time when NgSelect is initialized or reinitialized, if value is false NgSelect was not initialized yet
1392
- */
1393
- readonly initialized: Observable<boolean>;
1394
- /**
1395
- * Gets current state of initialization
1396
- */
1397
- readonly isInitialized: boolean;
1398
- /**
1399
- * Gets or sets NgSelect options
1400
- */
1401
- selectOptions: NgSelectOptions<TValue>;
1402
- /**
1403
- * Initialize component, automatically called once if not blocked by options
1404
- */
1405
- initialize(): void;
1406
- /**
1407
- * Initialize options, automaticaly called during init phase, but can be used to reinitialize NgSelectOptions
1408
- */
1409
- initOptions(): void;
1410
- /**
1411
- * Gets instance of plugin by its id
1412
- * @param pluginId - Id of plugin, use constants
1413
- */
1414
- getPlugin<PluginType extends NgSelectPlugin>(pluginId: string): PluginType;
1415
- /**
1416
- * Subscribes for event
1417
- * @param eventName - Name of event that should be listened to
1418
- * @param handler - Function used for handling event
1419
- */
1420
- listenTo<TParam = void>(eventName: keyof PluginBusEvents, handler: (data: TParam) => void): Subscription;
1421
- /**
1422
- * Explicitly runs invalidation of content (change detection)
1423
- */
1424
- invalidateVisuals(): void;
1425
- /**
1426
- * Executes actions on NgSelect
1427
- * @param actions - Array of actions that are executed over NgSelect
1428
- */
1429
- execute(...actions: NgSelectAction<TValue>[]): void;
1430
- /**
1431
- * Executes function on NgSelect and returns result
1432
- * @param func - Function that is executed and its result is returned
1433
- */
1434
- executeAndReturn<TResult>(func: NgSelectFunction<TResult, TValue>): TResult;
1435
- }
1436
-
1437
- /**
1438
- * Directive used for setting absolute option for ng-select
1439
- */
1440
- declare class NgSelectAbsoluteDirective {
1441
- constructor(select: NgSelectComponent);
1442
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectAbsoluteDirective, never>;
1443
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgSelectAbsoluteDirective, "ng-select[absolute]", never, {}, {}, never>;
1444
- }
1445
-
1446
- /**
1447
- * Defintion of action that can be executed on NgSelect
1448
- */
1449
- export declare type NgSelectAction<TValue = any> = (ngSelect: NgSelect<TValue>) => void;
1450
-
1451
- /**
1452
- * Component that represents NgSelect itself, allows selection of value from options
1453
- */
1454
- export declare class NgSelectComponent<TValue = any> implements NgSelect<TValue>, OnChanges, OnInit, AfterViewInit, OnDestroy {
1455
- protected _changeDetector: ChangeDetectorRef;
1456
- protected _element: ElementRef<HTMLElement>;
1457
- protected _componentFactoryResolver: ComponentFactoryResolver;
1458
- protected _appRef: ApplicationRef;
1459
- protected _injector: Injector;
1460
- protected _pluginBus: PluginBus<TValue>;
1461
- protected _pluginInstances: NgSelectPluginInstances;
1462
- /**
1463
- * NgSelect options
1464
- */
1465
- protected _selectOptions: NgSelectOptions<TValue>;
1466
- /**
1467
- * Subject used for indication that NgSelect was initialized
1468
- */
1469
- protected _initializedSubject: BehaviorSubject<boolean>;
1470
- /**
1471
- * Occurs when array of provided options has changed
1472
- */
1473
- protected _optionsChange: EventEmitter<void>;
1474
- /**
1475
- * Occurs when array of visible, displayed options has changed
1476
- */
1477
- protected _availableOptionsChange: EventEmitter<void>;
1478
- /**
1479
- * Array of available options to be displayed
1480
- */
1481
- protected _availableOptions: NgSelectOption<TValue>[];
1482
- /**
1483
- * Live search plugin currently used in NgSelect
1484
- */
1485
- protected _liveSearch: LiveSearch;
1486
- /**
1487
- * Subscription for changes of live search value
1488
- */
1489
- protected _searchValueChangeSubscription: Subscription;
1490
- /**
1491
- * Instance of component ref for absolute popup
1492
- */
1493
- protected _absolutePopup: ComponentRef<Popup>;
1494
- /**
1495
- * Instance of type that is used as absolute popup
1496
- */
1497
- protected _absolutePopupType: Type<Popup>;
1498
- /**
1499
- * Instance of html element that is used
1500
- */
1501
- protected _absolutePopupElement: HTMLElement;
1502
- /**
1503
- * Gets or sets NgSelect options
1504
- */
1505
- get selectOptions(): NgSelectOptions<TValue>;
1506
- set selectOptions(options: NgSelectOptions<TValue>);
1507
- /**
1508
- * Indication whether should be NgSelect disabled or not
1509
- */
1510
- disabled: boolean;
1511
- /**
1512
- * Indication whether should be NgSelect readonly or not
1513
- */
1514
- readonly: boolean;
1515
- /**
1516
- * Occurs every time when NgSelect is initialized or reinitialized, if value is false NgSelect was not initialized yet
1517
- */
1518
- get initialized(): Observable<boolean>;
1519
- /**
1520
- * Gets current state of initialization
1521
- */
1522
- isInitialized: boolean;
1523
- /**
1524
- * Template used within normal state
1525
- */
1526
- normalStateTemplate: TemplateRef<NormalStateContext>;
1527
- /**
1528
- * Template that is used within Popup as option
1529
- * @internal
1530
- */
1531
- optionTemplate?: TemplateRef<PopupContext>;
1532
- /**
1533
- * Array of provided options for select
1534
- */
1535
- get options(): NgSelectOption<TValue>[];
1536
- /**
1537
- * Occurs when array of provided options has changed
1538
- */
1539
- get optionsChange(): EventEmitter<void>;
1540
- /**
1541
- * Array of visible, displayed options for select
1542
- */
1543
- get availableOptions(): NgSelectOption<TValue>[];
1544
- /**
1545
- * Occurs when array of visible, displayed options has changed
1546
- */
1547
- get availableOptionsChange(): EventEmitter<void>;
1548
- /**
1549
- * NgSelect plugin instances available for gatherer
1550
- */
1551
- ngSelectPlugins: NgSelectPluginInstances;
1552
- /**
1553
- * Plugin bus used for inter plugin shared events
1554
- */
1555
- pluginBus: PluginBus<TValue>;
1556
- /**
1557
- * Select element that implements default gatherers
1558
- */
1559
- select: NgSelect<TValue>;
1560
- /**
1561
- * Element used for live search
1562
- */
1563
- liveSearchElement: HTMLElement[][];
1564
- /**
1565
- * Options children found inside ng-select
1566
- */
1567
- optionsChildren: QueryList<NgSelectOption>;
1568
- /**
1569
- * Options groups children found inside ng-select
1570
- */
1571
- optGroupsChildren: QueryList<NgSelectOptGroup>;
1572
- constructor(_changeDetector: ChangeDetectorRef, _element: ElementRef<HTMLElement>, _componentFactoryResolver: ComponentFactoryResolver, _appRef: ApplicationRef, _injector: Injector, _pluginBus: PluginBus<TValue>, _pluginInstances: NgSelectPluginInstances, options?: NgSelectOptions<TValue>, normalStateType?: Type<NormalState>, keyboardHandlerType?: Type<KeyboardHandler>, popupType?: Type<Popup>, positionerType?: Type<Positioner>, readonlyStateType?: Type<ReadonlyState>, valueHandlerType?: Type<ValueHandler>, liveSearchType?: Type<LiveSearch>, readonly?: string, disabled?: string, multiple?: string);
1573
- /**
1574
- * Called when input value changes
1575
- */
1576
- ngOnChanges(changes: SimpleChanges): void;
1577
- /**
1578
- * Initialize component
1579
- */
1580
- ngOnInit(): void;
1581
- /**
1582
- * Called when view was initialized
1583
- */
1584
- ngAfterViewInit(): void;
1585
- /**
1586
- * Called when component is destroyed
1587
- */
1588
- ngOnDestroy(): void;
1589
- /**
1590
- * Initialize gatherer during initialization phase
1591
- */
1592
- initializeGatherer(): void;
1593
- /**
1594
- * Called when gatherer needs to be destroyed
1595
- */
1596
- destroyGatherer(): void;
1597
- /**
1598
- * Sets normal state component
1599
- * @param normalState - Created normal state that is rendered
1600
- * @internal
1601
- */
1602
- setNormalStateComponent(normalState: NormalState): void;
1603
- /**
1604
- * Sets keyboard handler component
1605
- * @param keyboardHandler - Created keyboard handler that is rendered
1606
- * @internal
1607
- */
1608
- setKeyboardHandlerComponent(keyboardHandler: KeyboardHandler): void;
1609
- /**
1610
- * Sets popup component
1611
- * @param popup - Created popup that is rendered
1612
- * @internal
1613
- */
1614
- setPopupComponent(popup: Popup): void;
1615
- /**
1616
- * Sets positioner component
1617
- * @param positioner - Created positioner that is rendered
1618
- * @internal
1619
- */
1620
- setPositionerComponent(positioner: Positioner): void;
1621
- /**
1622
- * Sets readonly state component
1623
- * @param readonlyState - Created readonly state that is rendered
1624
- * @internal
1625
- */
1626
- setReadonlyStateComponent(readonlyState: ReadonlyState): void;
1627
- /**
1628
- * Sets value handler component
1629
- * @param valueHandler - Created value handler that is rendered
1630
- * @internal
1631
- */
1632
- setValueHandlerComponent(valueHandler: ValueHandler<TValue>): void;
1633
- /**
1634
- * Sets live search component
1635
- * @param liveSearch - Created live search that is rendered
1636
- * @internal
1637
- */
1638
- setLiveSearchComponent(liveSearch: LiveSearch): void;
1639
- /**
1640
- * Initialize component, automatically called once if not blocked by options
1641
- */
1642
- initialize(): void;
1643
- /**
1644
- * Initialize options, automaticaly called during init phase, but can be used to reinitialize NgSelectOptions
1645
- */
1646
- initOptions(): void;
1647
- /**
1648
- * Explicitly runs invalidation of content (change detection)
1649
- */
1650
- invalidateVisuals(): void;
1651
- /**
1652
- * Gets instance of plugin by its id
1653
- * @param pluginId - Id of plugin, use constants
1654
- */
1655
- getPlugin<PluginType extends NgSelectPlugin>(pluginId: string): PluginType;
1656
- /**
1657
- * Subscribes for event
1658
- * @param eventName - Name of event that should be listened to
1659
- * @param handler - Function used for handling event
1660
- */
1661
- listenTo<TParam = void>(eventName: keyof PluginBusEvents, handler: (data: TParam) => void): Subscription;
1662
- /**
1663
- * Executes actions on NgSelect
1664
- * @param actions - Array of actions that are executed over NgSelect
1665
- */
1666
- execute(...actions: NgSelectAction<TValue>[]): void;
1667
- /**
1668
- * Executes function on NgSelect and returns result
1669
- * @param func - Function that is executed and its result is returned
1670
- */
1671
- executeAndReturn<TResult>(func: NgSelectFunction<TResult, TValue>): TResult;
1672
- /**
1673
- * Appends popup component directly to body, allows absolute positioning over page body
1674
- * @param component - Popup component type to be appended
1675
- */
1676
- protected _appendPopupToBody(component: Type<Popup>): void;
1677
- /**
1678
- * Destroyes absolute popup if it exists
1679
- */
1680
- protected _destroyAbsolutePopup(): void;
1681
- /**
1682
- * Registers newly created plugin
1683
- * @param plugin - Plugin to be registered
1684
- * @param pluginKey - Key of plugin used for pluginInstances
1685
- * @param pluginName - Name property for plugin from options
1686
- */
1687
- protected _registerNewPlugin(plugin: NgSelectPlugin, pluginKey: string, pluginName: keyof NgSelectPluginTypes): void;
1688
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectComponent<any>, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { attribute: "readonly"; }, { attribute: "disabled"; }, { attribute: "multiple"; }]>;
1689
- static ɵcmp: i0.ɵɵComponentDeclaration<NgSelectComponent<any>, "ng-select", never, { "selectOptions": "selectOptions"; "disabled": "disabled"; "readonly": "readonly"; }, {}, ["normalStateTemplate", "optionTemplate", "optionsChildren", "optGroupsChildren"], never>;
1690
- }
1691
-
1692
- /**
1693
- * Control value accessor for NgSelectComponent
1694
- */
1695
- export declare class NgSelectControlValueAccessor<TValue = any> implements ControlValueAccessor, OnDestroy {
1696
- private _select;
1697
- /**
1698
- * Subscription for initialized status of NgSelect, used for writeValue
1699
- */
1700
- private _initializedSubscription;
1701
- /**
1702
- * Subscription for initialized status of NgSelect, used for registerOnChange
1703
- */
1704
- private _changeInitializedSubscription;
1705
- /**
1706
- * Subscription for initialized status of NgSelect, used for registerOnTouched
1707
- */
1708
- private _touchInitializedSubscription;
1709
- /**
1710
- * Subscription for initialized status of NgSelect, used for setDisabledState
1711
- */
1712
- private _disabledInitializedSubscription;
1713
- /**
1714
- * Subscription that looks for changes of select
1715
- */
1716
- private _changeSubscription;
1717
- /**
1718
- * Subscription that looks for changes of select
1719
- */
1720
- private _focusSubscription;
1721
- /**
1722
- * Last set value to this control
1723
- */
1724
- private _value;
1725
- constructor(_select: NgSelectComponent<TValue>);
1726
- /**
1727
- * Sets value to select
1728
- */
1729
- writeValue(value: TValue | Array<TValue>): void;
1730
- /**
1731
- * Registers callback that is called when value of select changes
1732
- */
1733
- registerOnChange(fn: (data: TValue | Array<TValue>) => void): void;
1734
- /**
1735
- * Registers callback that is called when select is closed
1736
- */
1737
- registerOnTouched(fn: () => void): void;
1738
- /**
1739
- * Sets NgSelect as disabled/readonly
1740
- * @param isDisabled - Indication whether is control disabled or not
1741
- */
1742
- setDisabledState(isDisabled: boolean): void;
1743
- /**
1744
- * Called when component is destroyed
1745
- */
1746
- ngOnDestroy(): void;
1747
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectControlValueAccessor<any>, never>;
1748
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgSelectControlValueAccessor<any>, "ng-select[formControlName],ng-select[formControl],ng-select[ngModel]", never, {}, {}, never>;
1749
- }
1750
-
1751
- /**
1752
- * Module for select and its options, allows use of dynamic value handler
1753
- */
1754
- export declare class NgSelectDynamicModule {
1755
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectDynamicModule, never>;
1756
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgSelectDynamicModule, [typeof i1_2.DynamicValueHandlerComponent], never, never>;
1757
- static ɵinj: i0.ɵɵInjectorDeclaration<NgSelectDynamicModule>;
1758
- }
1759
-
1760
- /**
1761
- * Directive that applies options for NgSelect which enable usage of NgSelect edit (jira like) style
1762
- */
1763
- export declare class NgSelectEditDirective {
1764
- constructor(select: NgSelectComponent);
1765
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectEditDirective, never>;
1766
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgSelectEditDirective, "ng-select[editStyle]", never, {}, {}, never>;
1767
- }
1768
-
1769
- /**
1770
- * Module for select with editation and tags (jira like select)
1771
- */
1772
- export declare class NgSelectEditModule {
1773
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectEditModule, never>;
1774
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgSelectEditModule, [typeof i1_3.NgSelectEditDirective, typeof i2_2.EditNormalStateComponent, typeof i3_2.EditLiveSearchComponent, typeof i4_2.EditPopupComponent, typeof i5_2.EditKeyboardHandlerComponent], [typeof i17.CommonModule, typeof i7_2.NgSelectModule], [typeof i1_3.NgSelectEditDirective, typeof i2_2.EditNormalStateComponent, typeof i3_2.EditLiveSearchComponent, typeof i4_2.EditPopupComponent, typeof i5_2.EditKeyboardHandlerComponent]>;
1775
- static ɵinj: i0.ɵɵInjectorDeclaration<NgSelectEditModule>;
1776
- }
1777
-
1778
- /**
1779
- * Definition of function that can be executed on NgSelect and returns some data
1780
- */
1781
- export declare type NgSelectFunction<TResult = any, TValue = any> = (ngSelect: NgSelect<TValue>) => TResult;
1782
-
1783
- /**
1784
- * Pipe that checks whether select has currently any option
1785
- */
1786
- declare class NgSelectHasValuePipe<TValue = any> implements PipeTransform {
1787
- /**
1788
- * Transforms selected option into boolean indication if there is option selected
1789
- * @param options - Selected options to be transformed into boolean
1790
- */
1791
- transform(options: NgSelectOption<TValue> | Array<NgSelectOption<TValue>>): boolean;
1792
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectHasValuePipe<any>, never>;
1793
- static ɵpipe: i0.ɵɵPipeDeclaration<NgSelectHasValuePipe<any>, "ngSelectHasValue">;
1794
- }
1795
-
1796
- /**
1797
- * Module for select and its options
1798
- */
1799
- export declare class NgSelectModule {
1800
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectModule, never>;
1801
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgSelectModule, [typeof i1.OptionComponent, typeof i2.OptGroupComponent, typeof i3.NgSelectComponent, typeof i4.NgSelectValuePipe, typeof i5.NgSelectHasValuePipe, typeof i6.NgSelectControlValueAccessor, typeof i7.BasicNormalStateComponent, typeof i8.NoLiveSearchComponent, typeof i9.BasicLiveSearchComponent, typeof i10.BasicPopupComponent, typeof i11.NoPositionerComponent, typeof i12.BasicPositionerComponent, typeof i13.BasicKeyboardHandlerComponent, typeof i14.BasicValueHandlerComponent, typeof i15.NgSelectAbsoluteDirective, typeof i16.NgSelectPlaceholderDirective], [typeof i17.CommonModule, typeof i18.CommonDynamicModule], [typeof i1.OptionComponent, typeof i2.OptGroupComponent, typeof i3.NgSelectComponent, typeof i4.NgSelectValuePipe, typeof i5.NgSelectHasValuePipe, typeof i6.NgSelectControlValueAccessor, typeof i15.NgSelectAbsoluteDirective, typeof i16.NgSelectPlaceholderDirective]>;
1802
- static ɵinj: i0.ɵɵInjectorDeclaration<NgSelectModule>;
1803
- }
1804
-
1805
- /**
1806
- * Option group for ng select
1807
- */
1808
- export declare interface NgSelectOptGroup<TValue = any> {
1809
- /**
1810
- * Options assigned to this options group
1811
- */
1812
- readonly options?: NgSelectOption<TValue>[];
1813
- /**
1814
- * Occurs when options in this group change
1815
- */
1816
- readonly optionsChange?: EventEmitter<void>;
1817
- /**
1818
- * Text that is displayed for this options group
1819
- */
1820
- text?: string;
1821
- }
1822
-
1823
- /**
1824
- * Option for ng select
1825
- */
1826
- export declare interface NgSelectOption<TValue = any> {
1827
- /**
1828
- * Value that will be used if this option will be selected
1829
- */
1830
- value?: TValue;
1831
- /**
1832
- * Text that is displayed if this value is selected
1833
- */
1834
- text?: string;
1835
- /**
1836
- * If specified this option will be displayed in group
1837
- */
1838
- group?: string;
1839
- }
1840
-
1841
- /**
1842
- * Describes select options used for NgSelect
1843
- */
1844
- export declare interface NgSelectOptions<TValue = any> extends PluginBusOptions<TValue> {
1845
- /**
1846
- * Indication whether NgSelect should be initialized automaticaly during 'NgOnInit' phase
1847
- */
1848
- autoInitialize?: boolean;
1849
- /**
1850
- * Css classes applied to ng select component, possible to override only part of classes
1851
- */
1852
- cssClasses?: {};
1853
- /**
1854
- * Object defining overrides for default plugins, default plugins can be also specified using DI
1855
- */
1856
- plugins?: NgSelectPluginTypes;
1857
- /**
1858
- * Indication whether is 'Popup' plugin displayd inside of NgSelect (false) or directly in Body (true)
1859
- */
1860
- absolute?: boolean;
1861
- /**
1862
- * Indication whether force value check on initialization of select, this allows to change value of form control to value of valueHandler
1863
- */
1864
- forceValueCheckOnInit?: boolean;
1865
- }
1866
-
1867
- /**
1868
- * Directive used for setting live search placeholder text
1869
- */
1870
- declare class NgSelectPlaceholderDirective implements OnInit {
1871
- private _select;
1872
- /**
1873
- * Placeholder text used for live search plugin
1874
- */
1875
- placeholder: string;
1876
- constructor(_select: NgSelectComponent);
1877
- /**
1878
- * Initialize component
1879
- */
1880
- ngOnInit(): void;
1881
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectPlaceholderDirective, never>;
1882
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgSelectPlaceholderDirective, "ng-select[placeholder]", never, { "placeholder": "placeholder"; }, {}, never>;
1883
- }
1884
-
1885
- /**
1886
- * NgSelect plugin interface
1887
- */
1888
- export declare interface NgSelectPlugin<TOptions = any, TValue = any> {
1889
- /**
1890
- * NgSelect plugin instances available for this plugin
1891
- */
1892
- ngSelectPlugins: NgSelectPluginInstances;
1893
- /**
1894
- * Element that represents plugin
1895
- */
1896
- pluginElement: ElementRef;
1897
- /**
1898
- * Options for NgSelect plugin
1899
- */
1900
- options: TOptions;
1901
- /**
1902
- * Plugin bus used in select
1903
- */
1904
- pluginBus: PluginBus<TValue>;
1905
- /**
1906
- * Initialize plugin, to be ready to use, initialize communication with other plugins
1907
- */
1908
- initialize(): void;
1909
- /**
1910
- * Initialize plugin options, all operations required to be done with plugin options are handled here
1911
- */
1912
- initOptions(): void;
1913
- /**
1914
- * Explicitly runs invalidation of content (change detection)
1915
- */
1916
- invalidateVisuals(): void;
1917
- }
1918
-
1919
- /**
1920
- * Interface describing object storing all existing plugin instances for NgSelect
1921
- */
1922
- export declare interface NgSelectPluginInstances {
1923
- [pluginName: string]: NgSelectPlugin;
1924
- }
1925
-
1926
- /**
1927
- * All available types of plugins for NgSelect
1928
- */
1929
- export declare interface NgSelectPluginTypes {
1930
- /**
1931
- * Handles keyboard events
1932
- */
1933
- keyboardHandler?: PluginDescription<KeyboardHandler>;
1934
- /**
1935
- * Component used for displaying normal state of select
1936
- */
1937
- normalState?: PluginDescription<NormalState>;
1938
- /**
1939
- * Component used for displaying available options for selection
1940
- */
1941
- popup?: PluginDescription<Popup>;
1942
- /**
1943
- * Handles correct position of pop component
1944
- */
1945
- positioner?: PluginDescription<Positioner>;
1946
- /**
1947
- * Component used for displaying readonly/disabled state of select, can be null, in that case normal state component is used
1948
- */
1949
- readonlyState?: PluginDescription<ReadonlyState>;
1950
- /**
1951
- * Handles obtaining and setting value of component
1952
- */
1953
- valueHandler?: PluginDescription<ValueHandler>;
1954
- /**
1955
- * Contains component that is used for live searching in options
1956
- */
1957
- liveSearch?: PluginDescription<LiveSearch>;
1958
- }
1959
-
1960
- /**
1961
- * Pipe to transform ng select selected option into
1962
- */
1963
- export declare class NgSelectValuePipe<TValue = any> implements PipeTransform {
1964
- /**
1965
- * Transforms selected option into string
1966
- * @param options - Selected options to be transformed into text
1967
- * @param nothingSelectedText - Text displayed if nothing is selected
1968
- * @param optionDisplayText - Function used for transformation of option into display text, defaults to text property of option
1969
- */
1970
- transform(options: NgSelectOption<TValue> | Array<NgSelectOption<TValue>>, nothingSelectedText: string, optionDisplayText?: DisplayTextFunc<TValue>): string;
1971
- static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectValuePipe<any>, never>;
1972
- static ɵpipe: i0.ɵɵPipeDeclaration<NgSelectValuePipe<any>, "ngSelectValue">;
1973
- }
1974
-
1975
- /**
1976
- * Public API for 'NoLiveSearchComponent'
1977
- */
1978
- export declare interface NoLiveSearch extends LiveSearch {
1979
- }
1980
-
1981
- /**
1982
- * Component used for no live search
1983
- */
1984
- export declare class NoLiveSearchComponent implements NoLiveSearch, NgSelectPlugin<NoLiveSearchOptions> {
1985
- ngSelectPlugins: NgSelectPluginInstances;
1986
- pluginElement: ElementRef;
1987
- private _document;
1988
- /**
1989
- * Options for NgSelect plugin
1990
- */
1991
- protected _options: NoLiveSearchOptions;
1992
- /**
1993
- * Options for NgSelect plugin
1994
- */
1995
- options: NoLiveSearchOptions;
1996
- /**
1997
- * Plugin bus used for inter plugin shared events
1998
- */
1999
- pluginBus: PluginBus;
2000
- /**
2001
- * HTML element that represents live search
2002
- */
2003
- get liveSearchElement(): HTMLElement;
2004
- /**
2005
- * Current value of live search
2006
- */
2007
- searchValue: string;
2008
- /**
2009
- * Occurs when current value of live search changes
2010
- */
2011
- searchValueChange: EventEmitter<void>;
2012
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginElement: ElementRef, _document: Document);
2013
- /**
2014
- * Initialize plugin, to be ready to use, initialize communication with other plugins
2015
- */
2016
- initialize(): void;
2017
- /**
2018
- * Initialize plugin options, all operations required to be done with plugin options are handled here
2019
- */
2020
- initOptions(): void;
2021
- /**
2022
- * Explicitly runs invalidation of content (change detection)
2023
- */
2024
- invalidateVisuals(): void;
2025
- static ɵfac: i0.ɵɵFactoryDeclaration<NoLiveSearchComponent, [{ optional: true; }, null, null]>;
2026
- static ɵcmp: i0.ɵɵComponentDeclaration<NoLiveSearchComponent, "ng-no-live-search", never, {}, {}, never, never>;
2027
- }
2028
-
2029
- /**
2030
- * No live search options
2031
- */
2032
- export declare interface NoLiveSearchOptions extends LiveSearchOptions {
2033
- }
2034
-
2035
- /**
2036
- * Public API for 'NoPositionerComponent'
2037
- */
2038
- export declare interface NoPositioner extends Positioner {
2039
- }
2040
-
2041
- /**
2042
- * Component used for not positioning popup
2043
- */
2044
- export declare class NoPositionerComponent implements NoPositioner, NgSelectPlugin<NoPositionerOptions> {
2045
- ngSelectPlugins: NgSelectPluginInstances;
2046
- pluginElement: ElementRef;
2047
- /**
2048
- * Options for NgSelect plugin
2049
- */
2050
- protected _options: NoPositionerOptions;
2051
- /**
2052
- * Options for NgSelect plugin
2053
- */
2054
- get options(): NoPositionerOptions;
2055
- set options(options: NoPositionerOptions);
2056
- /**
2057
- * Plugin bus used for inter plugin shared events
2058
- */
2059
- pluginBus: PluginBus;
2060
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginElement: ElementRef, options?: NoPositionerOptions);
2061
- /**
2062
- * Initialize plugin, to be ready to use, initialize communication with other plugins
2063
- */
2064
- initialize(): void;
2065
- /**
2066
- * Initialize plugin options, all operations required to be done with plugin options are handled here
2067
- */
2068
- initOptions(): void;
2069
- /**
2070
- * Explicitly runs invalidation of content (change detection)
2071
- */
2072
- invalidateVisuals(): void;
2073
- static ɵfac: i0.ɵɵFactoryDeclaration<NoPositionerComponent, [{ optional: true; }, null, { optional: true; }]>;
2074
- static ɵcmp: i0.ɵɵComponentDeclaration<NoPositionerComponent, "ng-no-positioner", never, {}, {}, never, never>;
2075
- }
2076
-
2077
- /**
2078
- * No positioner options
2079
- */
2080
- export declare interface NoPositionerOptions extends PositionerOptions {
2081
- }
2082
-
2083
- /**
2084
- * Constant used for accessing normal state plugin in NgSelect
2085
- */
2086
- export declare const NORMAL_STATE = "NORMAL_STATE";
2087
-
2088
- /**
2089
- * Token for injecting options for normal state plugin
2090
- */
2091
- export declare const NORMAL_STATE_OPTIONS: InjectionToken<NormalStateOptions>;
2092
-
2093
- /**
2094
- * Injection token for 'NormalState' implementation
2095
- */
2096
- export declare const NORMAL_STATE_TYPE: InjectionToken<Type<NormalState>>;
2097
-
2098
- /**
2099
- * Function used for normalization of value, used during comparison or search
2100
- */
2101
- export declare interface NormalizeFunc<TValue = any> {
2102
- /**
2103
- * Normalize provided value, usually used with strings
2104
- * @param value - Value that is being normalized
2105
- */
2106
- (value: TValue): TValue;
2107
- }
2108
-
2109
- /**
2110
- * Normal state plugin interface
2111
- */
2112
- export declare interface NormalState extends NgSelectPlugin {
2113
- }
2114
-
2115
- /**
2116
- * Base abstract class for normal state of select
2117
- */
2118
- export declare abstract class NormalStateAbstractComponent<TCssClasses = any, TOptions extends NormalStateOptions<TCssClasses, TValue> = any, TValue = any> implements NormalState, NgSelectPlugin<TOptions>, OnDestroy {
2119
- ngSelectPlugins: NgSelectPluginInstances;
2120
- pluginBus: PluginBus;
2121
- pluginElement: ElementRef;
2122
- protected _changeDetector: ChangeDetectorRef;
2123
- protected _stringLocalization: StringLocalization;
2124
- /**
2125
- * Subscription for changes in texts
2126
- */
2127
- protected _textsChangedSubscription: Subscription;
2128
- /**
2129
- * Options for NgSelect plugin
2130
- */
2131
- protected _options: TOptions;
2132
- /**
2133
- * Indication whether was component destroyed
2134
- */
2135
- protected _destroyed: boolean;
2136
- /**
2137
- * Options for NgSelect plugin
2138
- */
2139
- get options(): TOptions;
2140
- set options(options: TOptions);
2141
- /**
2142
- * Object containing available texts
2143
- * @internal
2144
- */
2145
- texts: NormalStateTexts;
2146
- /**
2147
- * Value handler used in NgSelect
2148
- * @internal
2149
- */
2150
- valueHandler: ValueHandler;
2151
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, _changeDetector: ChangeDetectorRef, _stringLocalization: StringLocalization);
2152
- /**
2153
- * Called when component is destroyed
2154
- */
2155
- ngOnDestroy(): void;
2156
- /**
2157
- * Initialize plugin, to be ready to use, initialize communication with other plugins
2158
- */
2159
- initialize(): void;
2160
- /**
2161
- * Initialize plugin options, all operations required to be done with plugin options are handled here
2162
- */
2163
- initOptions(): void;
2164
- /**
2165
- * Explicitly runs invalidation of content (change detection)
2166
- */
2167
- invalidateVisuals(): void;
2168
- /**
2169
- * Initialize texts
2170
- */
2171
- protected _initTexts(): void;
2172
- static ɵfac: i0.ɵɵFactoryDeclaration<NormalStateAbstractComponent<any, any, any>, never>;
2173
- static ɵdir: i0.ɵɵDirectiveDeclaration<NormalStateAbstractComponent<any, any, any>, never, never, {}, {}, never>;
2174
- }
2175
-
2176
- /**
2177
- * Context for template that is used within normal state plugin
2178
- */
2179
- export declare interface NormalStateContext {
2180
- /**
2181
- * Instance of plugin itself
2182
- */
2183
- $implicit: NormalState;
2184
- }
2185
-
2186
- /**
2187
- * Options for normal state plugin
2188
- */
2189
- export declare interface NormalStateOptions<TCssClasses = any, TValue = any> extends VisualPluginOptions<TCssClasses> {
2190
- /**
2191
- * Texts that are used within any NormalState
2192
- */
2193
- texts?: NormalStateTexts;
2194
- /**
2195
- * Function used for transformation of option into display text
2196
- */
2197
- optionDisplayText?: DisplayTextFunc<TValue>;
2198
- }
2199
-
2200
- /**
2201
- * Texts that are used within NormalState
2202
- */
2203
- export declare interface NormalStateTexts {
2204
- /**
2205
- * Displayed when there is no value selected, represents empty value, used if value is null or empty array
2206
- */
2207
- nothingSelected?: string;
2208
- }
2209
-
2210
- /**
2211
- * Component used for options group in select component
2212
- */
2213
- export declare class OptGroupComponent<TValue = any> implements NgSelectOptGroup<TValue>, AfterViewInit {
2214
- /**
2215
- * Instance of event emitter for optionsChange
2216
- */
2217
- private _optionsChange;
2218
- /**
2219
- * Options assigned to this options group
2220
- */
2221
- get options(): NgSelectOption<TValue>[];
2222
- /**
2223
- * Occurs when options in this group change
2224
- */
2225
- get optionsChange(): EventEmitter<void>;
2226
- /**
2227
- * Children options in this group
2228
- * @internal
2229
- */
2230
- optionsChildren: QueryList<NgSelectOption<TValue>>;
2231
- /**
2232
- * Text that is displayed for this options group
2233
- */
2234
- text: string;
2235
- /**
2236
- * Called when view was initialized
2237
- */
2238
- ngAfterViewInit(): void;
2239
- static ɵfac: i0.ɵɵFactoryDeclaration<OptGroupComponent<any>, never>;
2240
- static ɵcmp: i0.ɵɵComponentDeclaration<OptGroupComponent<any>, "ng-select>ng-optgroup", never, { "text": "text"; }, {}, never, never>;
2241
- }
2242
-
2243
- /**
2244
- * Component used for options in select component
2245
- */
2246
- export declare class OptionComponent<TValue = any> implements NgSelectOption<TValue> {
2247
- /**
2248
- * Indication whether is item active
2249
- */
2250
- active: boolean;
2251
- /**
2252
- * Indication whether this option is selected
2253
- */
2254
- selected: boolean;
2255
- /**
2256
- * Value that will be used if this option will be selected
2257
- */
2258
- value: TValue;
2259
- /**
2260
- * Text that is displayed if this value is selected
2261
- */
2262
- text: string;
2263
- /**
2264
- * If specified this option will be displayed in group
2265
- */
2266
- group: string;
2267
- static ɵfac: i0.ɵɵFactoryDeclaration<OptionComponent<any>, never>;
2268
- static ɵcmp: i0.ɵɵComponentDeclaration<OptionComponent<any>, "ng-option", never, { "value": "value"; "text": "text"; }, {}, never, never>;
2269
- }
2270
-
2271
- /**
2272
- * Gatherer used for obtaining options for select
2273
- */
2274
- export declare interface OptionsGatherer<TValue = any> {
2275
- /**
2276
- * Array of provided options for select
2277
- */
2278
- readonly options: NgSelectOption<TValue>[];
2279
- /**
2280
- * Occurs when array of provided options has changed
2281
- */
2282
- readonly optionsChange: EventEmitter<void>;
2283
- /**
2284
- * Array of visible, displayed options for select
2285
- */
2286
- readonly availableOptions: NgSelectOption<TValue>[];
2287
- /**
2288
- * Occurs when array of visible, displayed options has changed
2289
- */
2290
- readonly availableOptionsChange: EventEmitter<void>;
2291
- /**
2292
- * NgSelect plugin instances available for gatherer
2293
- */
2294
- ngSelectPlugins: NgSelectPluginInstances;
2295
- /**
2296
- * Plugin bus used for inter plugin shared events
2297
- */
2298
- pluginBus: PluginBus<TValue>;
2299
- /**
2300
- * Select element that implements default gatherers
2301
- */
2302
- select: NgSelect<TValue>;
2303
- /**
2304
- * Initialize gatherer during initialization phase
2305
- */
2306
- initializeGatherer(): void;
2307
- /**
2308
- * Called when gatherer needs to be destroyed
2309
- */
2310
- destroyGatherer(): void;
2311
- }
2312
-
2313
- /**
2314
- * Class represents centralized bus for plugin communications
2315
- */
2316
- export declare class PluginBus<TValue = any> implements PluginBusEvents {
2317
- /**
2318
- * Options passed to select
2319
- */
2320
- selectOptions: PluginBusOptions<TValue>;
2321
- /**
2322
- * HTML element that represents select itself
2323
- */
2324
- selectElement: ElementRef<HTMLElement>;
2325
- /**
2326
- * Occurs when popup visibility should be toggled
2327
- */
2328
- togglePopup: EventEmitter<void>;
2329
- /**
2330
- * Occurs when popup visibility should be changed
2331
- */
2332
- showHidePopup: EventEmitter<boolean>;
2333
- /**
2334
- * Occurs when option should be selected
2335
- */
2336
- optionSelect: EventEmitter<NgSelectOption>;
2337
- /**
2338
- * Occurs when option should be canceled
2339
- */
2340
- optionCancel: EventEmitter<NgSelectOption>;
2341
- /**
2342
- * Occurs when any part of select gains focus
2343
- */
2344
- focus: EventEmitter<void>;
2345
- /**
2346
- * Occurs when live search should gain focus
2347
- */
2348
- liveSearchFocus: EventEmitter<void>;
2349
- /**
2350
- * Occurs when there is need for updating displayed value
2351
- */
2352
- readonly updateDisplayedValue: EventEmitter<void>;
2353
- static ɵfac: i0.ɵɵFactoryDeclaration<PluginBus<any>, never>;
2354
- static ɵprov: i0.ɵɵInjectableDeclaration<PluginBus<any>>;
2355
- }
2356
-
2357
- /**
2358
- * Represents all events implemented by plugin bus
2359
- */
2360
- export declare interface PluginBusEvents {
2361
- /**
2362
- * Occurs when popup visibility should be toggled
2363
- */
2364
- readonly togglePopup: EventEmitter<void>;
2365
- /**
2366
- * Occurs when popup visibility should be changed
2367
- */
2368
- readonly showHidePopup: EventEmitter<boolean>;
2369
- /**
2370
- * Occurs when option should be selected
2371
- */
2372
- readonly optionSelect: EventEmitter<NgSelectOption>;
2373
- /**
2374
- * Occurs when option should be canceled
2375
- */
2376
- readonly optionCancel: EventEmitter<NgSelectOption>;
2377
- /**
2378
- * Occurs when any part of select gains focus
2379
- */
2380
- readonly focus: EventEmitter<void>;
2381
- /**
2382
- * Occurs when live search should gain focus
2383
- */
2384
- readonly liveSearchFocus: EventEmitter<void>;
2385
- /**
2386
- * Occurs when there is need for updating displayed value
2387
- */
2388
- readonly updateDisplayedValue: EventEmitter<void>;
2389
- }
2390
-
2391
- /**
2392
- * Options used for plugin bus
2393
- */
2394
- export declare interface PluginBusOptions<TValue = any> {
2395
- /**
2396
- * Instance of options gatherer that is used for obtaining options
2397
- */
2398
- optionsGatherer?: OptionsGatherer<TValue>;
2399
- /**
2400
- * Instance of template gatherer used for obtaining custom templates
2401
- */
2402
- templateGatherer?: TemplateGatherer;
2403
- /**
2404
- * Indication whether is NgSelect readonly or not
2405
- */
2406
- readonly?: boolean;
2407
- /**
2408
- * Indication that multiple values can be selected
2409
- */
2410
- multiple?: boolean;
2411
- /**
2412
- * Indication whether use non existing value in live search as new value, use with dynamic value handler
2413
- */
2414
- useNonExistingAsValue?: boolean;
2415
- /**
2416
- * Function of value comparer that is used for comparison of values
2417
- */
2418
- valueComparer?: CompareValueFunc<TValue>;
2419
- /**
2420
- * Method that is used for filtering when live search is running on static data
2421
- */
2422
- liveSearchFilter?: LiveSearchFilter<TValue>;
2423
- /**
2424
- * Normalizer used for normalizing values
2425
- */
2426
- normalizer?: NormalizeFunc<TValue>;
2427
- }
2428
-
2429
- /**
2430
- * Defines interface, that describes minimal set of parameters for specifying plugin for NgSelect
2431
- */
2432
- export declare interface PluginDescription<PluginType = any> {
2433
- /**
2434
- * Type of plugin that will be dynamically instantiated
2435
- */
2436
- type?: Type<PluginType>;
2437
- /**
2438
- * Options that will be passed to dynamically instantiated plugin
2439
- */
2440
- options?: PluginOptions;
2441
- /**
2442
- * Optional callback used for obtaining dynamic instance of plugin (allows direct communication with plugin)
2443
- */
2444
- instanceCallback?: (instance: NgSelectPlugin | null) => void;
2445
- }
2446
-
2447
- /**
2448
- * Base options for every plugin
2449
- */
2450
- export declare interface PluginOptions {
2451
- }
2452
-
2453
- /**
2454
- * Constant used for accessing popup plugin in NgSelect
2455
- */
2456
- export declare const POPUP = "POPUP";
2457
-
2458
- /**
2459
- * Popup plugin interface
2460
- */
2461
- export declare interface Popup extends NgSelectPlugin {
2462
- /**
2463
- * Occurs when visibility of popup has changed
2464
- */
2465
- readonly visibilityChange: EventEmitter<void>;
2466
- /**
2467
- * Html element that represents popup itself
2468
- */
2469
- readonly popupElement: HTMLElement;
2470
- }
2471
-
2472
- /**
2473
- * Token for injecting options for popup plugin
2474
- */
2475
- export declare const POPUP_OPTIONS: InjectionToken<PopupOptions>;
2476
-
2477
- /**
2478
- * Injection token for 'Popup' implementation
2479
- */
2480
- export declare const POPUP_TYPE: InjectionToken<Type<Popup>>;
2481
-
2482
- /**
2483
- * Base abstract class for popup with options
2484
- */
2485
- export declare class PopupAbstractComponent<TCssClasses = any, TOptions extends PopupOptions<TCssClasses> = any> implements Popup, NgSelectPlugin<TOptions>, AfterViewInit, OnDestroy {
2486
- ngSelectPlugins: NgSelectPluginInstances;
2487
- pluginBus: PluginBus;
2488
- pluginElement: ElementRef;
2489
- protected _changeDetector: ChangeDetectorRef;
2490
- protected _document: Document;
2491
- protected _stringLocalization: StringLocalization;
2492
- /**
2493
- * Options for NgSelect plugin
2494
- */
2495
- protected _options: TOptions;
2496
- /**
2497
- * Instance of previous options gatherer, that is used for obtaining available options
2498
- */
2499
- protected _optionsGatherer: OptionsGatherer;
2500
- /**
2501
- * Subscription for changes of options in options gatherer
2502
- */
2503
- protected _optionsChangeSubscription: Subscription;
2504
- /**
2505
- * Subscription for toggle popup event
2506
- */
2507
- protected _popupToggleSubscription: Subscription;
2508
- /**
2509
- * Subscription for popup visibility change request
2510
- */
2511
- protected _visibilityRequestSubscription: Subscription;
2512
- /**
2513
- * Subscription for changes of selected value
2514
- */
2515
- protected _valueChangedSubscription: Subscription;
2516
- /**
2517
- * Subscription for changes in texts
2518
- */
2519
- protected _textsChangedSubscription: Subscription;
2520
- /**
2521
- * Indication whether is popup visible
2522
- */
2523
- protected _popupVisible: boolean;
2524
- /**
2525
- * Value handler plugin used within `NgSelect`
2526
- */
2527
- protected _valueHandler: ValueHandler;
2528
- /**
2529
- * Gets indication whether keep open popup after value change
2530
- */
2531
- protected get keepOpen(): boolean;
2532
- /**
2533
- * Options for NgSelect plugin
2534
- */
2535
- get options(): TOptions;
2536
- set options(options: TOptions);
2537
- /**
2538
- * Occurs when visibility of popup has changed
2539
- */
2540
- visibilityChange: EventEmitter<void>;
2541
- /**
2542
- * Html element that represents popup itself
2543
- */
2544
- get popupElement(): HTMLElement;
2545
- /**
2546
- * Array of select options available
2547
- * @internal
2548
- */
2549
- selectOptions: ɵNgSelectOption[];
2550
- /**
2551
- * Object containing available texts
2552
- * @internal
2553
- */
2554
- texts: PopupTexts;
2555
- /**
2556
- * Watch for visibility of popup div element
2557
- * @internal
2558
- */
2559
- popupElementChildren: QueryList<ElementRef<HTMLElement>>;
2560
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginBus: PluginBus, pluginElement: ElementRef, _changeDetector: ChangeDetectorRef, _document: Document, _stringLocalization: StringLocalization);
2561
- /**
2562
- * Called when view was initialized
2563
- */
2564
- ngAfterViewInit(): void;
2565
- /**
2566
- * Called when component is destroyed
2567
- */
2568
- ngOnDestroy(): void;
2569
- /**
2570
- * Initialize plugin, to be ready to use, initialize communication with other plugins
2571
- */
2572
- initialize(): void;
2573
- /**
2574
- * Initialize plugin options, all operations required to be done with plugin options are handled here
2575
- */
2576
- initOptions(): void;
2577
- /**
2578
- * Explicitly runs invalidation of content (change detection)
2579
- */
2580
- invalidateVisuals(): void;
2581
- /**
2582
- * Initialize texts
2583
- */
2584
- protected _initTexts(): void;
2585
- /**
2586
- * Loads options
2587
- */
2588
- protected loadOptions(): void;
2589
- /**
2590
- * Toggles popup visibility
2591
- */
2592
- protected togglePopup(): void;
2593
- /**
2594
- * Handles click outside of select element
2595
- * @param event - Mouse event object
2596
- */
2597
- protected _handleClickOutside: (event: MouseEvent) => void;
2598
- /**
2599
- * Handles visibility change
2600
- */
2601
- protected _handleVisibilityChange: (visible: boolean) => void;
2602
- static ɵfac: i0.ɵɵFactoryDeclaration<PopupAbstractComponent<any, any>, never>;
2603
- static ɵdir: i0.ɵɵDirectiveDeclaration<PopupAbstractComponent<any, any>, never, never, {}, {}, never>;
2604
- }
2605
-
2606
- /**
2607
- * Context for template that is used within popup plugin
2608
- */
2609
- export declare interface PopupContext {
2610
- /**
2611
- * Instance of plugin itself
2612
- */
2613
- $implicit: NgSelectOption;
2614
- /**
2615
- * Instance of plugin itself
2616
- */
2617
- popup: Popup;
2618
- }
2619
-
2620
- /**
2621
- * Options for popup plugin
2622
- */
2623
- export declare interface PopupOptions<TCssClasses = any> extends VisualPluginOptions<TCssClasses> {
2624
- /**
2625
- * Indication whether are popup options visible, or not
2626
- */
2627
- visible?: boolean;
2628
- /**
2629
- * Texts that are used within any Popup
2630
- */
2631
- texts?: PopupTexts;
2632
- }
2633
-
2634
- /**
2635
- * Texts that are used within Popup
2636
- */
2637
- export declare interface PopupTexts {
2638
- /**
2639
- * Displayed when there is are no available options to be displayed
2640
- */
2641
- noAvailableOptions?: string;
2642
- }
2643
-
2644
- /**
2645
- * Constant used for accessing positioner plugin in NgSelect
2646
- */
2647
- export declare const POSITIONER = "POSITIONER";
2648
-
2649
- /**
2650
- * Positioner plugin interface
2651
- */
2652
- export declare interface Positioner extends NgSelectPlugin {
2653
- }
2654
-
2655
- /**
2656
- * Token for injecting options for positioner plugin
2657
- */
2658
- export declare const POSITIONER_OPTIONS: InjectionToken<PositionerOptions>;
2659
-
2660
- /**
2661
- * Injection token for 'Positioner' implementation
2662
- */
2663
- export declare const POSITIONER_TYPE: InjectionToken<Type<Positioner>>;
2664
-
2665
- /**
2666
- * Options for positioner plugin
2667
- */
2668
- export declare interface PositionerOptions extends PluginOptions {
2669
- /**
2670
- * Coordinates of options popup relative to select
2671
- */
2672
- optionsCoordinates?: PositionsCoordinates;
2673
- /**
2674
- * Coordinates of select relative to options
2675
- */
2676
- selectCoordinates?: PositionsCoordinates;
2677
- }
2678
-
2679
- /**
2680
- * Constant used for accessing readonly state plugin in NgSelect
2681
- */
2682
- export declare const READONLY_STATE = "READONLY_STATE";
2683
-
2684
- /**
2685
- * Token for injecting options for readonly state plugin
2686
- */
2687
- export declare const READONLY_STATE_OPTIONS: InjectionToken<ReadonlyStateOptions>;
2688
-
2689
- /**
2690
- * Injection token for 'ReadonlyState' implementation
2691
- */
2692
- export declare const READONLY_STATE_TYPE: InjectionToken<Type<ReadonlyState>>;
2693
-
2694
- /**
2695
- * Readonly state plugin interface
2696
- */
2697
- export declare interface ReadonlyState extends NormalState {
2698
- }
2699
-
2700
- /**
2701
- * Options for readonly state plugin
2702
- */
2703
- export declare interface ReadonlyStateOptions<TCssClasses = any> extends NormalStateOptions<TCssClasses> {
2704
- }
2705
-
2706
- /**
2707
- * Scroll target selector that is used for obtaining scroll target
2708
- */
2709
- export declare class ScrollTargetSelector {
2710
- /**
2711
- * Callback used for getting scroll target for scrolling
2712
- */
2713
- private _scrollTargetCallback;
2714
- /**
2715
- * Gets scroll target that is used for scrolling
2716
- */
2717
- get scrollTarget(): EventTarget;
2718
- /**
2719
- * Sets callback used for obtaining scroll target
2720
- * @param callback - Callback that is used for obtaining scroll target element
2721
- */
2722
- setScrollTarget(callback: () => EventTarget): void;
2723
- static ɵfac: i0.ɵɵFactoryDeclaration<ScrollTargetSelector, never>;
2724
- static ɵprov: i0.ɵɵInjectableDeclaration<ScrollTargetSelector>;
2725
- }
2726
-
2727
- /**
2728
- * Gatherer used for obtaining templates for NgSelect plugins
2729
- */
2730
- export declare interface TemplateGatherer {
2731
- /**
2732
- * Template used within normal state
2733
- */
2734
- readonly normalStateTemplate: TemplateRef<NormalStateContext>;
2735
- /**
2736
- * Template that is used within Popup as option
2737
- */
2738
- readonly optionTemplate?: TemplateRef<PopupContext>;
2739
- }
2740
-
2741
- /**
2742
- * Constant used for accessing value handler plugin in NgSelect
2743
- */
2744
- export declare const VALUE_HANDLER = "VALUE_HANDLER";
2745
-
2746
- /**
2747
- * Token for injecting options for value handler plugin
2748
- */
2749
- export declare const VALUE_HANDLER_OPTIONS: InjectionToken<ValueHandlerOptions>;
2750
-
2751
- /**
2752
- * Injection token for 'ValueHandler' implementation
2753
- */
2754
- export declare const VALUE_HANDLER_TYPE: InjectionToken<Type<ValueHandler>>;
2755
-
2756
- /**
2757
- * Value handler plugin interface
2758
- */
2759
- export declare interface ValueHandler<TValue = any> extends NgSelectPlugin {
2760
- /**
2761
- * Current selected options of NgSelect
2762
- */
2763
- readonly selectedOptions: NgSelectOption<TValue> | NgSelectOption<TValue>[];
2764
- /**
2765
- * Current selected value of NgSelect
2766
- */
2767
- readonly value: TValue | TValue[];
2768
- /**
2769
- * Occurs when value of NgSelect changes
2770
- */
2771
- readonly valueChange: EventEmitter<void>;
2772
- /**
2773
- * Sets value for NgSelect
2774
- * @param value - Value to be set
2775
- */
2776
- setValue(value: TValue | TValue[]): void;
2777
- }
2778
-
2779
- /**
2780
- * Base class for value handlers
2781
- */
2782
- export declare abstract class ValueHandlerBase<TValue = any, TOptions extends ValueHandlerOptions = any> implements ValueHandler<TValue>, NgSelectPlugin<TOptions, TValue>, OnDestroy {
2783
- ngSelectPlugins: NgSelectPluginInstances;
2784
- pluginElement: ElementRef;
2785
- pluginBus: PluginBus<TValue>;
2786
- /**
2787
- * Options for NgSelect plugin
2788
- */
2789
- protected _options: TOptions;
2790
- /**
2791
- * Normal state that is used
2792
- */
2793
- protected _normalState: NormalState;
2794
- /**
2795
- * Subscription for option selection
2796
- */
2797
- protected _optionSelectSubscription: Subscription;
2798
- /**
2799
- * Subscription for option cancelation
2800
- */
2801
- protected _optionCancelSubscription: Subscription;
2802
- /**
2803
- * Subscription for changes of options in options gatherer
2804
- */
2805
- protected _optionsChangeSubscription: Subscription;
2806
- /**
2807
- * Instance of previous options gatherer, that is used for obtaining available options
2808
- */
2809
- protected _optionsGatherer: OptionsGatherer<TValue>;
2810
- /**
2811
- * Options for NgSelect plugin
2812
- */
2813
- abstract options: TOptions;
2814
- /**
2815
- * Occurs when value of NgSelect changes
2816
- */
2817
- valueChange: EventEmitter<void>;
2818
- /**
2819
- * Current value of NgSelect
2820
- */
2821
- selectedOptions: NgSelectOption<TValue> | NgSelectOption<TValue>[];
2822
- /**
2823
- * Current selected value of NgSelect
2824
- */
2825
- get value(): TValue | TValue[];
2826
- /**
2827
- * Function of value comparer that is used for comparison of values
2828
- */
2829
- protected get valueComparer(): CompareValueFunc<TValue>;
2830
- /**
2831
- * Method that is used for filtering when live search is running on static data
2832
- */
2833
- protected get liveSearchFilter(): LiveSearchFilter<TValue>;
2834
- /**
2835
- * Normalizer used for normalizing values
2836
- */
2837
- protected get normalizer(): NormalizeFunc<TValue>;
2838
- constructor(ngSelectPlugins: NgSelectPluginInstances, pluginElement: ElementRef, pluginBus: PluginBus<TValue>);
2839
- /**
2840
- * Called when component is destroyed
2841
- */
2842
- ngOnDestroy(): void;
2843
- /**
2844
- * Sets value for NgSelect
2845
- * @param value - Value to be set
2846
- */
2847
- abstract setValue(value: TValue | TValue[]): void;
2848
- /**
2849
- * Initialize plugin, to be ready to use, initialize communication with other plugins
2850
- */
2851
- initialize(): void;
2852
- /**
2853
- * Initialize plugin options, all operations required to be done with plugin options are handled here
2854
- */
2855
- initOptions(): void;
2856
- /**
2857
- * Explicitly runs invalidation of content (change detection)
2858
- */
2859
- invalidateVisuals(): void;
2860
- /**
2861
- * Sets value
2862
- */
2863
- protected abstract _setValue: (option: ɵNgSelectOption<TValue>) => void;
2864
- /**
2865
- * Cancels, removes option from selected options
2866
- * @param option - Option to be canceled
2867
- */
2868
- protected _cancelValue: (option: ɵNgSelectOption<TValue>) => void;
2869
- /**
2870
- * Clears all selected values
2871
- */
2872
- protected _clearSelected(): void;
2873
- /**
2874
- * Marks current value as selected
2875
- */
2876
- protected _markValueAsSelected(): void;
2877
- /**
2878
- * Loads options
2879
- */
2880
- protected abstract _loadOptions(): void;
2881
- static ɵfac: i0.ɵɵFactoryDeclaration<ValueHandlerBase<any, any>, never>;
2882
- static ɵdir: i0.ɵɵDirectiveDeclaration<ValueHandlerBase<any, any>, never, never, {}, {}, never>;
2883
- }
2884
-
2885
- /**
2886
- * Options for value handler plugin
2887
- */
2888
- export declare interface ValueHandlerOptions extends PluginOptions {
2889
- }
2890
-
2891
- /**
2892
- * Base options for every visual plugin (component)
2893
- */
2894
- export declare interface VisualPluginOptions<TCssClasses = any> extends PluginOptions {
2895
- /**
2896
- * Css classes applied to visual plugin (component), possible to override only part of classes
2897
- */
2898
- cssClasses?: TCssClasses;
2899
- }
2900
-
2901
- /**
2902
- * Gets current value of NgSelect
2903
- * @internal
2904
- */
2905
- export declare function ɵGetValue<TValue>(): NgSelectFunction<TValue | TValue[], TValue>;
2906
-
2907
- /**
2908
- * Option for ng select
2909
- */
2910
- export declare interface ɵNgSelectOption<TValue = any> extends NgSelectOption<TValue> {
2911
- /**
2912
- * Indication whether is item active
2913
- */
2914
- active?: boolean;
2915
- /**
2916
- * Indication whether is this option selected
2917
- */
2918
- selected?: boolean;
2919
- }
2920
-
2921
- /**
2922
- * Adds callback that is called each time when NgSelect gains focus
2923
- * @internal
2924
- */
2925
- export declare function ɵOnFocus<TValue>(callback: () => void): NgSelectFunction<Subscription, TValue>;
2926
-
2927
- /**
2928
- * Sets NgSelect as readonly, non editable
2929
- * @param readonly - Indication whether is select readonly or not, if omitted defaults to true
2930
- * @internal
2931
- */
2932
- export declare function ɵSetReadonly<TValue>(readonly?: boolean): NgSelectAction<TValue>;
2933
-
2934
- /**
2935
- * Sets value of NgSelect
2936
- * @param value - Value to be set into select
2937
- * @internal
2938
- */
2939
- export declare function ɵSetValue<TValue>(value: TValue | TValue[]): NgSelectAction<TValue>;
2940
-
2941
- /**
2942
- * Adds callback that is called when value changes and returns subscription for this changes
2943
- * @internal
2944
- */
2945
- export declare function ɵValueChange<TValue>(callback: (value: TValue | TValue[]) => void): NgSelectFunction<Subscription, TValue>;
2946
-
2947
- export { }