ng-jvx-multiselect 16.0.13 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/esm2022/lib/directives/ng-jvx-disabled-option.directive.mjs +46 -46
  2. package/esm2022/lib/directives/ng-jvx-focus.directive.mjs +29 -29
  3. package/esm2022/lib/directives/ng-jvx-group-header.directive.mjs +25 -25
  4. package/esm2022/lib/directives/ng-jvx-options-template.directive.mjs +26 -26
  5. package/esm2022/lib/directives/ng-jvx-selection-template.directive.mjs +25 -25
  6. package/esm2022/lib/interfaces/ng-jvx-group-mapper.mjs +1 -1
  7. package/esm2022/lib/interfaces/ng-jvx-option-mapper.mjs +1 -1
  8. package/esm2022/lib/interfaces/ng-jvx-search-mapper.mjs +1 -1
  9. package/esm2022/lib/ng-jvx-multiselect.component.mjs +630 -630
  10. package/esm2022/lib/ng-jvx-multiselect.module.mjs +92 -96
  11. package/esm2022/lib/ng-jvx-multiselect.service.mjs +43 -43
  12. package/esm2022/lib/ng-jvx-option/ng-jvx-option.component.mjs +31 -31
  13. package/esm2022/lib/utils.mjs +3 -3
  14. package/esm2022/ng-jvx-multiselect.mjs +4 -4
  15. package/esm2022/public-api.mjs +15 -15
  16. package/fesm2022/ng-jvx-multiselect.mjs +875 -915
  17. package/fesm2022/ng-jvx-multiselect.mjs.map +1 -1
  18. package/index.d.ts +5 -5
  19. package/lib/directives/ng-jvx-disabled-option.directive.d.ts +15 -15
  20. package/lib/directives/ng-jvx-focus.directive.d.ts +11 -11
  21. package/lib/directives/ng-jvx-group-header.directive.d.ts +10 -10
  22. package/lib/directives/ng-jvx-options-template.directive.d.ts +11 -11
  23. package/lib/directives/ng-jvx-selection-template.directive.d.ts +10 -10
  24. package/lib/interfaces/ng-jvx-group-mapper.d.ts +8 -8
  25. package/lib/interfaces/ng-jvx-option-mapper.d.ts +13 -13
  26. package/lib/interfaces/ng-jvx-search-mapper.d.ts +7 -7
  27. package/lib/ng-jvx-multiselect.component.d.ts +149 -149
  28. package/lib/ng-jvx-multiselect.module.d.ts +24 -25
  29. package/lib/ng-jvx-multiselect.service.d.ts +20 -20
  30. package/lib/ng-jvx-option/ng-jvx-option.component.d.ts +14 -14
  31. package/lib/utils.d.ts +3 -3
  32. package/package.json +6 -5
  33. package/public-api.d.ts +12 -12
  34. package/esm2022/lib/ng-jvx-panel/ng-jvx-panel.component.mjs +0 -42
  35. package/lib/ng-jvx-panel/ng-jvx-panel.component.d.ts +0 -17
  36. package/src/lib/ng-jvx-panel/ng-jvx-panel.component.scss +0 -0
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ViewEncapsulation, ViewChild, Input, Directive, Injectable, EventEmitter, forwardRef, ChangeDetectionStrategy, Optional, Self, HostBinding, ViewChildren, ContentChild, Output, Inject, NgModule } from '@angular/core';
2
+ import { Component, ViewEncapsulation, ViewChild, Input, Directive, Injectable, EventEmitter, forwardRef, ChangeDetectionStrategy, Optional, Self, HostBinding, ViewChildren, ContentChild, Output, NgModule } from '@angular/core';
3
3
  import * as i4 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/material/list';
@@ -13,7 +13,7 @@ import { UntypedFormControl, ReactiveFormsModule, FormsModule } from '@angular/f
13
13
  import { MatFormFieldControl } from '@angular/material/form-field';
14
14
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
15
15
  import * as i3 from '@angular/material/menu';
16
- import { _MatMenuBase, MAT_MENU_DEFAULT_OPTIONS, MAT_MENU_PANEL, MatMenu, matMenuAnimations, MatMenuModule } from '@angular/material/menu';
16
+ import { MatMenuModule } from '@angular/material/menu';
17
17
  import * as i5 from '@angular/material/icon';
18
18
  import { MatIconModule } from '@angular/material/icon';
19
19
  import * as i7 from '@angular/material/chips';
@@ -21,944 +21,904 @@ import { MatChipsModule } from '@angular/material/chips';
21
21
  import * as i8 from 'ngx-scrollbar';
22
22
  import { NgScrollbarModule } from 'ngx-scrollbar';
23
23
  import * as i9 from 'ngx-scrollbar/smooth-scroll';
24
- import { SmoothScrollModule } from 'ngx-scrollbar/smooth-scroll';
24
+ import { SmoothScroll } from 'ngx-scrollbar/smooth-scroll';
25
25
  import { MatButtonModule } from '@angular/material/button';
26
26
  import { MatOptionModule } from '@angular/material/core';
27
27
  import { MatSelectModule } from '@angular/material/select';
28
28
 
29
- class NgJvxOptionComponent {
30
- constructor() {
31
- this.isSelected = false;
32
- }
33
- ngOnInit() {
34
- }
35
- ngDoCheck() {
36
- if (this.isSelected !== this.listOption.selected) {
37
- this.isSelected = this.listOption.selected;
38
- }
39
- }
40
- deselect() {
41
- this.listOption.selected = false;
42
- }
43
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
44
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: NgJvxOptionComponent, selector: "ng-jvx-option", inputs: { value: "value" }, viewQueries: [{ propertyName: "listOption", first: true, predicate: ["listOption"], descendants: true, static: true }], ngImport: i0, template: "<mat-list-option [value]=\"value\" [ngClass]=\"{'ng-jvx-option': true, 'mat-list-single-selected-option': isSelected}\" #listOption>\r\n <ng-content></ng-content>\r\n <div class=\"list-option-background\"></div>\r\n</mat-list-option>\r\n", styles: ["ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option{padding:0;height:auto;min-height:48px}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option .mat-list-text{min-height:48px;display:flex;justify-content:center}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option[aria-selected=true]{color:var(--jvx-multiselect-primary)}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option[aria-selected=true] .list-option-background{position:absolute;left:0;top:0;z-index:-1;opacity:.45;height:100%;width:100%;background:var(--jvx-multiselect-primary)}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }], encapsulation: i0.ViewEncapsulation.None }); }
45
- }
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxOptionComponent, decorators: [{
47
- type: Component,
48
- args: [{ selector: 'ng-jvx-option', encapsulation: ViewEncapsulation.None, template: "<mat-list-option [value]=\"value\" [ngClass]=\"{'ng-jvx-option': true, 'mat-list-single-selected-option': isSelected}\" #listOption>\r\n <ng-content></ng-content>\r\n <div class=\"list-option-background\"></div>\r\n</mat-list-option>\r\n", styles: ["ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option{padding:0;height:auto;min-height:48px}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option .mat-list-text{min-height:48px;display:flex;justify-content:center}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option[aria-selected=true]{color:var(--jvx-multiselect-primary)}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option[aria-selected=true] .list-option-background{position:absolute;left:0;top:0;z-index:-1;opacity:.45;height:100%;width:100%;background:var(--jvx-multiselect-primary)}\n"] }]
49
- }], ctorParameters: function () { return []; }, propDecorators: { listOption: [{
50
- type: ViewChild,
51
- args: ['listOption', { static: true }]
52
- }], value: [{
53
- type: Input
29
+ class NgJvxOptionComponent {
30
+ constructor() {
31
+ this.isSelected = false;
32
+ }
33
+ ngOnInit() {
34
+ }
35
+ ngDoCheck() {
36
+ if (this.isSelected !== this.listOption.selected) {
37
+ this.isSelected = this.listOption.selected;
38
+ }
39
+ }
40
+ deselect() {
41
+ this.listOption.selected = false;
42
+ }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
44
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: NgJvxOptionComponent, selector: "ng-jvx-option", inputs: { value: "value" }, viewQueries: [{ propertyName: "listOption", first: true, predicate: ["listOption"], descendants: true, static: true }], ngImport: i0, template: "<mat-list-option [value]=\"value\" [ngClass]=\"{'ng-jvx-option': true, 'mat-list-single-selected-option': isSelected}\" #listOption>\r\n <ng-content></ng-content>\r\n <div class=\"list-option-background\"></div>\r\n</mat-list-option>\r\n", styles: ["ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option{padding:0;height:auto;min-height:48px}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option .mat-list-text{min-height:48px;display:flex;justify-content:center}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option[aria-selected=true]{color:var(--jvx-multiselect-primary)}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option[aria-selected=true] .list-option-background{position:absolute;left:0;top:0;z-index:-1;opacity:.45;height:100%;width:100%;background:var(--jvx-multiselect-primary)}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }], encapsulation: i0.ViewEncapsulation.None }); }
45
+ }
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxOptionComponent, decorators: [{
47
+ type: Component,
48
+ args: [{ selector: 'ng-jvx-option', encapsulation: ViewEncapsulation.None, template: "<mat-list-option [value]=\"value\" [ngClass]=\"{'ng-jvx-option': true, 'mat-list-single-selected-option': isSelected}\" #listOption>\r\n <ng-content></ng-content>\r\n <div class=\"list-option-background\"></div>\r\n</mat-list-option>\r\n", styles: ["ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option{padding:0;height:auto;min-height:48px}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option .mat-list-text{min-height:48px;display:flex;justify-content:center}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option[aria-selected=true]{color:var(--jvx-multiselect-primary)}ng-jvx-option .mat-mdc-list-item.mat-mdc-list-option.ng-jvx-option[aria-selected=true] .list-option-background{position:absolute;left:0;top:0;z-index:-1;opacity:.45;height:100%;width:100%;background:var(--jvx-multiselect-primary)}\n"] }]
49
+ }], ctorParameters: () => [], propDecorators: { listOption: [{
50
+ type: ViewChild,
51
+ args: ['listOption', { static: true }]
52
+ }], value: [{
53
+ type: Input
54
54
  }] } });
55
55
 
56
- class NgJvxOptionsTemplateDirective {
57
- constructor(el, template, vcRef) {
58
- this.el = el;
59
- this.template = template;
60
- this.vcRef = vcRef;
61
- }
62
- set ngJvxOptionsTemplateOf(source) {
63
- for (const item of source) {
64
- this.vcRef.createEmbeddedView(this.template, { $implicit: item });
65
- }
66
- }
67
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxOptionsTemplateDirective, deps: [{ token: i0.ElementRef }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
68
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: NgJvxOptionsTemplateDirective, selector: "[ngJvxOptionsTemplate]", inputs: { ngJvxOptionsTemplateOf: "ngJvxOptionsTemplateOf" }, ngImport: i0 }); }
69
- }
70
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxOptionsTemplateDirective, decorators: [{
71
- type: Directive,
72
- args: [{
73
- // tslint:disable-next-line:directive-selector
74
- selector: '[ngJvxOptionsTemplate]'
75
- }]
76
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { ngJvxOptionsTemplateOf: [{
77
- type: Input
56
+ class NgJvxOptionsTemplateDirective {
57
+ constructor(el, template, vcRef) {
58
+ this.el = el;
59
+ this.template = template;
60
+ this.vcRef = vcRef;
61
+ }
62
+ set ngJvxOptionsTemplateOf(source) {
63
+ for (const item of source) {
64
+ this.vcRef.createEmbeddedView(this.template, { $implicit: item });
65
+ }
66
+ }
67
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxOptionsTemplateDirective, deps: [{ token: i0.ElementRef }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
68
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: NgJvxOptionsTemplateDirective, selector: "[ngJvxOptionsTemplate]", inputs: { ngJvxOptionsTemplateOf: "ngJvxOptionsTemplateOf" }, ngImport: i0 }); }
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxOptionsTemplateDirective, decorators: [{
71
+ type: Directive,
72
+ args: [{
73
+ // tslint:disable-next-line:directive-selector
74
+ selector: '[ngJvxOptionsTemplate]'
75
+ }]
76
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { ngJvxOptionsTemplateOf: [{
77
+ type: Input
78
78
  }] } });
79
79
 
80
- class NgJvxSelectionTemplateDirective {
81
- constructor(template, vcRef) {
82
- this.template = template;
83
- this.vcRef = vcRef;
84
- }
85
- set ngJvxSelectionTemplateOf(source) {
86
- for (const item of source) {
87
- this.vcRef.createEmbeddedView(this.template, { $implicit: item });
88
- }
89
- }
90
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxSelectionTemplateDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
91
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: NgJvxSelectionTemplateDirective, selector: "[ngJvxSelectionTemplate]", inputs: { ngJvxSelectionTemplateOf: "ngJvxSelectionTemplateOf" }, ngImport: i0 }); }
92
- }
93
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxSelectionTemplateDirective, decorators: [{
94
- type: Directive,
95
- args: [{
96
- // tslint:disable-next-line:directive-selector
97
- selector: '[ngJvxSelectionTemplate]'
98
- }]
99
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { ngJvxSelectionTemplateOf: [{
100
- type: Input
80
+ class NgJvxSelectionTemplateDirective {
81
+ constructor(template, vcRef) {
82
+ this.template = template;
83
+ this.vcRef = vcRef;
84
+ }
85
+ set ngJvxSelectionTemplateOf(source) {
86
+ for (const item of source) {
87
+ this.vcRef.createEmbeddedView(this.template, { $implicit: item });
88
+ }
89
+ }
90
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxSelectionTemplateDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
91
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: NgJvxSelectionTemplateDirective, selector: "[ngJvxSelectionTemplate]", inputs: { ngJvxSelectionTemplateOf: "ngJvxSelectionTemplateOf" }, ngImport: i0 }); }
92
+ }
93
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxSelectionTemplateDirective, decorators: [{
94
+ type: Directive,
95
+ args: [{
96
+ // tslint:disable-next-line:directive-selector
97
+ selector: '[ngJvxSelectionTemplate]'
98
+ }]
99
+ }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { ngJvxSelectionTemplateOf: [{
100
+ type: Input
101
101
  }] } });
102
102
 
103
- class NgJvxGroupHeaderDirective {
104
- constructor(template, vcRef) {
105
- this.template = template;
106
- this.vcRef = vcRef;
107
- }
108
- set ngJvxGroupHeaderOf(source) {
109
- for (const item of source) {
110
- this.vcRef.createEmbeddedView(this.template, { $implicit: item });
111
- }
112
- }
113
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxGroupHeaderDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
114
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: NgJvxGroupHeaderDirective, selector: "[ngJvxGroupHeader]", inputs: { ngJvxGroupHeaderOf: "ngJvxGroupHeaderOf" }, ngImport: i0 }); }
115
- }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxGroupHeaderDirective, decorators: [{
117
- type: Directive,
118
- args: [{
119
- // tslint:disable-next-line:directive-selector
120
- selector: '[ngJvxGroupHeader]'
121
- }]
122
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { ngJvxGroupHeaderOf: [{
123
- type: Input
103
+ class NgJvxGroupHeaderDirective {
104
+ constructor(template, vcRef) {
105
+ this.template = template;
106
+ this.vcRef = vcRef;
107
+ }
108
+ set ngJvxGroupHeaderOf(source) {
109
+ for (const item of source) {
110
+ this.vcRef.createEmbeddedView(this.template, { $implicit: item });
111
+ }
112
+ }
113
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxGroupHeaderDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
114
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: NgJvxGroupHeaderDirective, selector: "[ngJvxGroupHeader]", inputs: { ngJvxGroupHeaderOf: "ngJvxGroupHeaderOf" }, ngImport: i0 }); }
115
+ }
116
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxGroupHeaderDirective, decorators: [{
117
+ type: Directive,
118
+ args: [{
119
+ // tslint:disable-next-line:directive-selector
120
+ selector: '[ngJvxGroupHeader]'
121
+ }]
122
+ }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { ngJvxGroupHeaderOf: [{
123
+ type: Input
124
124
  }] } });
125
125
 
126
- class NgJvxDisabledOptionDirective {
127
- set ngJvxDisabledOption(source) {
128
- this.isDisabled = source;
129
- if (this.isDisabled) {
130
- this.el.nativeElement.style.opacity = this.originalOpacity ? this.originalOpacity / 2 : 0.5;
131
- fromEvent(this.el.nativeElement, 'click').pipe(takeUntil(this.restore), takeUntil(this.unsubs)).subscribe((e) => {
132
- e.preventDefault();
133
- e.stopPropagation();
134
- });
135
- }
136
- else {
137
- this.el.nativeElement.style.opacity = this.originalOpacity;
138
- this.restore.next();
139
- }
140
- }
141
- constructor(el) {
142
- this.el = el;
143
- this.isDisabled = false;
144
- this.originalOpacity = 1;
145
- this.unsubs = new Subject();
146
- this.restore = new Subject();
147
- this.originalOpacity = el.nativeElement.style.opacity;
148
- }
149
- ngOnInit() {
150
- }
151
- ngOnDestroy() {
152
- this.unsubs.next();
153
- this.unsubs.complete();
154
- }
155
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxDisabledOptionDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
156
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: NgJvxDisabledOptionDirective, selector: "[ngJvxDisabledOption]", inputs: { ngJvxDisabledOption: "ngJvxDisabledOption" }, ngImport: i0 }); }
157
- }
158
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxDisabledOptionDirective, decorators: [{
159
- type: Directive,
160
- args: [{
161
- // tslint:disable-next-line:directive-selector
162
- selector: '[ngJvxDisabledOption]'
163
- }]
164
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { ngJvxDisabledOption: [{
165
- type: Input
126
+ class NgJvxDisabledOptionDirective {
127
+ set ngJvxDisabledOption(source) {
128
+ this.isDisabled = source;
129
+ if (this.isDisabled) {
130
+ this.el.nativeElement.style.opacity = this.originalOpacity ? this.originalOpacity / 2 : 0.5;
131
+ fromEvent(this.el.nativeElement, 'click').pipe(takeUntil(this.restore), takeUntil(this.unsubs)).subscribe((e) => {
132
+ e.preventDefault();
133
+ e.stopPropagation();
134
+ });
135
+ }
136
+ else {
137
+ this.el.nativeElement.style.opacity = this.originalOpacity;
138
+ this.restore.next();
139
+ }
140
+ }
141
+ constructor(el) {
142
+ this.el = el;
143
+ this.isDisabled = false;
144
+ this.originalOpacity = 1;
145
+ this.unsubs = new Subject();
146
+ this.restore = new Subject();
147
+ this.originalOpacity = el.nativeElement.style.opacity;
148
+ }
149
+ ngOnInit() {
150
+ }
151
+ ngOnDestroy() {
152
+ this.unsubs.next();
153
+ this.unsubs.complete();
154
+ }
155
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxDisabledOptionDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
156
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: NgJvxDisabledOptionDirective, selector: "[ngJvxDisabledOption]", inputs: { ngJvxDisabledOption: "ngJvxDisabledOption" }, ngImport: i0 }); }
157
+ }
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxDisabledOptionDirective, decorators: [{
159
+ type: Directive,
160
+ args: [{
161
+ // tslint:disable-next-line:directive-selector
162
+ selector: '[ngJvxDisabledOption]'
163
+ }]
164
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ngJvxDisabledOption: [{
165
+ type: Input
166
166
  }] } });
167
167
 
168
- const JVXMULTISELECT = new HttpContextToken(() => false);
168
+ const JVXMULTISELECT = new HttpContextToken(() => false);
169
169
  const setJvxCall = () => new HttpContext().set(JVXMULTISELECT, true);
170
170
 
171
- class NgJvxMultiselectService {
172
- constructor(http) {
173
- this.http = http;
174
- }
175
- getList({ url, ignorePagination = false, currentPage, pageSize, requestType = 'get', requestHeaders, search, searchProp = 'search', data }) {
176
- let params = new HttpParams();
177
- if (search && search.length > 0) {
178
- params = params.set(searchProp, search);
179
- }
180
- if (!ignorePagination) {
181
- params = params.set('page', currentPage.toString())
182
- .set('size', pageSize.toString());
183
- }
184
- const options = {
185
- mode: 'no-cors',
186
- headers: requestHeaders,
187
- context: setJvxCall(),
188
- // withCredentials: true,
189
- // credentials: 'same-origin', // cache: 'default',
190
- data,
191
- params
192
- };
193
- if (requestType === 'get') {
194
- return this.http.get(url, options);
195
- }
196
- else {
197
- return this.http.post(url, options);
198
- }
199
- }
200
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
201
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectService, providedIn: 'root' }); }
202
- }
203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectService, decorators: [{
204
- type: Injectable,
205
- args: [{
206
- providedIn: 'root'
207
- }]
208
- }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
171
+ class NgJvxMultiselectService {
172
+ constructor(http) {
173
+ this.http = http;
174
+ }
175
+ getList({ url, ignorePagination = false, currentPage, pageSize, requestType = 'get', requestHeaders, search, searchProp = 'search', data }) {
176
+ let params = new HttpParams();
177
+ if (search && search.length > 0) {
178
+ params = params.set(searchProp, search);
179
+ }
180
+ if (!ignorePagination) {
181
+ params = params.set('page', currentPage.toString())
182
+ .set('size', pageSize.toString());
183
+ }
184
+ const options = {
185
+ mode: 'no-cors',
186
+ headers: requestHeaders,
187
+ context: setJvxCall(),
188
+ // withCredentials: true,
189
+ // credentials: 'same-origin', // cache: 'default',
190
+ data,
191
+ params
192
+ };
193
+ if (requestType === 'get') {
194
+ return this.http.get(url, options);
195
+ }
196
+ else {
197
+ return this.http.post(url, options);
198
+ }
199
+ }
200
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
201
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectService, providedIn: 'root' }); }
202
+ }
203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectService, decorators: [{
204
+ type: Injectable,
205
+ args: [{
206
+ providedIn: 'root'
207
+ }]
208
+ }], ctorParameters: () => [{ type: i1.HttpClient }] });
209
209
 
210
- class NgJvxFocusDirective {
211
- constructor(el) {
212
- this.el = el;
213
- }
214
- ngOnInit() {
215
- if (this.ngJvxFocus) {
216
- this.el.nativeElement.focus();
217
- }
218
- }
219
- ngOnChanges(changes) {
220
- if (changes.hasOwnProperty('ngJvxFocus') && changes.ngJvxFocus.currentValue === true) {
221
- this.el.nativeElement.focus();
222
- }
223
- }
224
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxFocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
225
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.2", type: NgJvxFocusDirective, selector: "[ngJvxFocus]", inputs: { ngJvxFocus: "ngJvxFocus" }, usesOnChanges: true, ngImport: i0 }); }
226
- }
227
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxFocusDirective, decorators: [{
228
- type: Directive,
229
- args: [{
230
- // tslint:disable-next-line:directive-selector
231
- selector: '[ngJvxFocus]'
232
- }]
233
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { ngJvxFocus: [{
234
- type: Input
210
+ class NgJvxFocusDirective {
211
+ constructor(el) {
212
+ this.el = el;
213
+ }
214
+ ngOnInit() {
215
+ if (this.ngJvxFocus) {
216
+ this.el.nativeElement.focus();
217
+ }
218
+ }
219
+ ngOnChanges(changes) {
220
+ if (changes.hasOwnProperty('ngJvxFocus') && changes.ngJvxFocus.currentValue === true) {
221
+ this.el.nativeElement.focus();
222
+ }
223
+ }
224
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxFocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
225
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: NgJvxFocusDirective, selector: "[ngJvxFocus]", inputs: { ngJvxFocus: "ngJvxFocus" }, usesOnChanges: true, ngImport: i0 }); }
226
+ }
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxFocusDirective, decorators: [{
228
+ type: Directive,
229
+ args: [{
230
+ // tslint:disable-next-line:directive-selector
231
+ selector: '[ngJvxFocus]'
232
+ }]
233
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ngJvxFocus: [{
234
+ type: Input
235
235
  }] } });
236
236
 
237
- class NgJvxMultiselectComponent {
238
- static { this.nextId = 0; }
239
- get shouldLabelFloat() {
240
- return this.focused || !this.empty;
241
- }
242
- set value(value) {
243
- this.pValue = value ?? [];
244
- if (value) {
245
- this.form.get('selectionValue').setValue(this.pValue.map(v => v[this.itemValue]));
246
- }
247
- else {
248
- this.form.get('selectionValue').setValue(value);
249
- }
250
- this.stateChanges.next();
251
- }
252
- get value() {
253
- return this.pValue;
254
- }
255
- get required() {
256
- return this._required;
257
- }
258
- set required(req) {
259
- this._required = coerceBooleanProperty(req);
260
- this.stateChanges.next();
261
- }
262
- get disabled() {
263
- return this._disabled;
264
- }
265
- set disabled(value) {
266
- this._disabled = coerceBooleanProperty(value);
267
- this._disabled ? this.parts.disable() : this.parts.enable();
268
- this.stateChanges.next();
269
- }
270
- get pageSize() {
271
- return this.intPageSize;
272
- }
273
- set pageSize(val) {
274
- if (val < 15) {
275
- this.intPageSize = 15;
276
- }
277
- else {
278
- this.intPageSize = val;
279
- }
280
- }
281
- get errorState() {
282
- if (this.ngControl != null) {
283
- return this.ngControl.invalid && this.ngControl.touched;
284
- }
285
- else {
286
- return false;
287
- }
288
- }
289
- constructor(formBuilder, service, elementRef, changeDetectorRef, ngControl, fb) {
290
- this.formBuilder = formBuilder;
291
- this.service = service;
292
- this.elementRef = elementRef;
293
- this.changeDetectorRef = changeDetectorRef;
294
- this.ngControl = ngControl;
295
- this.id = `jvx-multiselect-${NgJvxMultiselectComponent.nextId++}`;
296
- this.optionsTemplate = null;
297
- this.selectionTemplate = null;
298
- this.groupHeaderTemplate = null;
299
- // @ContentChild(NgJvxOptionComponent) optionComp: NgJvxOptionComponent;
300
- // @ContentChild(TemplateRef) optionsTemplate: TemplateRef<any> | null = null;
301
- this.options = [];
302
- this.multi = false;
303
- this.url = '';
304
- this.requestType = 'get';
305
- this.itemValue = 'value';
306
- this.itemText = 'text';
307
- this.ignorePagination = false;
308
- this.clearable = false;
309
- this.closeOnClick = true;
310
- this.hasErrors = false;
311
- this.searchMode = null;
312
- this.searchInput = false;
313
- this.searchLabel = 'search';
314
- this.listProp = '';
315
- this.totalRowsProp = '';
316
- this.panelClass = '';
317
- this.searchProp = 'search';
318
- this.closeButton = false;
319
- this.mapper = {
320
- mapOption(source) {
321
- return of(source);
322
- }
323
- };
324
- this.multiMapper = {
325
- mapOptions(source) {
326
- return of(source);
327
- }
328
- };
329
- this.searchMapper = {
330
- mapSearch: (source, options) => {
331
- return of(options.filter(o => o[this.itemText].toString().toLowerCase().includes(source.toString().toLowerCase())));
332
- }
333
- };
334
- this.requestHeaders = new HttpHeaders();
335
- // tslint:disable-next-line:variable-name
336
- this._required = false;
337
- // tslint:disable-next-line:variable-name
338
- this._disabled = false;
339
- this.valueChange = new EventEmitter();
340
- this.jvxMultiselectOpen = new EventEmitter();
341
- this.jvxMultiselectOpened = new EventEmitter();
342
- this.jvxMultiselectClose = new EventEmitter();
343
- this.jvxMultiselectClosed = new EventEmitter();
344
- this.scrollEnd = new EventEmitter();
345
- this.controlType = 'ng-jvx-multiselect';
346
- this.document = document;
347
- this.window = window;
348
- this.isOpen = false;
349
- this.isLoading = false;
350
- this.showList = true;
351
- this.asyncOptions = [];
352
- this.selectableOptions = [];
353
- this.orderedOptions = [];
354
- this.searchValue = '';
355
- this.yPosition = 'above';
356
- this.stateChanges = new Subject();
357
- this.currentPage = 0;
358
- this.listContainerSize = { height: 'auto', minHeight: '0', width: '100%' };
359
- this.touched = false;
360
- this.focused = false;
361
- this.multiContainerWidth = 100;
362
- this.searchValueSubject = new Subject();
363
- this.searchValue$ = this.searchValueSubject.asObservable();
364
- this.pValue = [];
365
- this.shouldLoadMore = true;
366
- this.unsubscribe = new Subject();
367
- this.unsubscribe$ = this.unsubscribe.asObservable();
368
- this.intPageSize = 15;
369
- this.onTouched = () => {
370
- };
371
- if (this.ngControl != null) {
372
- // Setting the value accessor directly (instead of using
373
- // the providers) to avoid running into a circular import.
374
- this.ngControl.valueAccessor = this;
375
- }
376
- this.parts = fb.group({
377
- area: '',
378
- exchange: '',
379
- subscriber: '',
380
- });
381
- this.form = this.formBuilder.group({
382
- selectionValue: new UntypedFormControl(this.selectionValue)
383
- });
384
- }
385
- ngOnInit() {
386
- this.stateChange$.pipe(takeUntil(this.unsubscribe)).subscribe(() => {
387
- this.changeDetectorRef.markForCheck();
388
- });
389
- // this.setSelectableOptions(this.options).subscribe(noop);
390
- this.selectableOptions = [...this.options];
391
- this.updateOrderedOptions(this.selectableOptions).subscribe(noop);
392
- fromEvent(window, 'resize').pipe(takeUntil(this.unsubscribe), debounceTime(100), map(() => {
393
- return this.listContainerSize.width = this.jvxMultiselect.nativeElement.offsetWidth + 'px';
394
- }), switchMap(() => timer(100)), tap(() => {
395
- this.multiContainerWidth = this.multiContainer?.nativeElement?.offsetWidth ?? 100;
396
- this.yPosition = window.innerHeight - this.jvxMultiselect.nativeElement?.getBoundingClientRect()?.top < 260 ? 'above' : 'below';
397
- this.changeDetectorRef.markForCheck();
398
- })).subscribe(noop);
399
- this.searchValue$.pipe(takeUntil(this.unsubscribe), debounceTime(300), distinctUntilChanged((prev, curr) => {
400
- return curr === this.searchValue;
401
- }), switchMap((val) => {
402
- this.searchValue = val;
403
- this.currentPage = 0;
404
- if (this.searchMode === 'client') {
405
- return this.clientSearch();
406
- }
407
- else if (this.url && this.url.length > 0) {
408
- return this.serverSearch();
409
- }
410
- })).subscribe((val) => {
411
- this.changeDetectorRef.markForCheck();
412
- });
413
- }
414
- clientSearch() {
415
- let obs;
416
- if (this.url && this.url.length > 0) {
417
- this.selectableOptions = [];
418
- this.updateOrderedOptions(this.selectableOptions).subscribe(noop);
419
- this.shouldLoadMore = true;
420
- obs = this.getList().pipe(map(() => {
421
- return this.selectableOptions;
422
- }));
423
- }
424
- else {
425
- obs = of(this.options);
426
- }
427
- return obs.pipe(switchMap((val) => this.searchMapper.mapSearch(this.searchValue, val)), switchMap((res) => {
428
- // return this.setSelectableOptions(res);
429
- this.selectableOptions = [];
430
- this.selectableOptions.push(...res);
431
- return this.updateOrderedOptions(this.selectableOptions);
432
- }));
433
- }
434
- setSelectableOptions(options) {
435
- this.selectableOptions = [];
436
- const obs = options.reduce((acc, curr) => {
437
- acc.push(this.mapper.mapOption(curr));
438
- return acc;
439
- }, []);
440
- // this.mapper.mapOption(option);
441
- return forkJoin([...obs]).pipe(switchMap((val) => {
442
- this.selectableOptions.push(...val);
443
- return this.updateOrderedOptions(this.selectableOptions);
444
- }));
445
- }
446
- serverSearch() {
447
- this.shouldLoadMore = true;
448
- this.selectableOptions = [];
449
- this.shouldLoadMore = true;
450
- return this.getList();
451
- }
452
- ngOnDestroy() {
453
- this.unsubscribe.next();
454
- this.stateChanges.complete();
455
- }
456
- ngAfterViewInit() {
457
- timer(0).subscribe(() => {
458
- this.listContainerSize.width = this.jvxMultiselect.nativeElement.offsetWidth + 'px';
459
- });
460
- if (this.scrollbar) {
461
- this.scrollbar.scrolled.pipe(takeUntil(this.unsubscribe$)).subscribe((e) => {
462
- this.onScrolled(e);
463
- });
464
- }
465
- timer(0).pipe(tap(() => {
466
- this.multiContainerWidth = this.multiContainer?.nativeElement?.offsetWidth ?? 100;
467
- this.yPosition = window.innerHeight - this.jvxMultiselect.nativeElement?.getBoundingClientRect()?.top < 260 ? 'above' : 'below';
468
- this.changeDetectorRef.markForCheck();
469
- })).subscribe(noop);
470
- }
471
- ngOnChanges(changes) {
472
- if (changes.options) {
473
- // this.setSelectableOptions(this.options).subscribe(noop);
474
- this.selectableOptions = [...this.options];
475
- }
476
- }
477
- get selectionValue() {
478
- return this.value.map((v) => {
479
- return v[this.itemValue];
480
- });
481
- }
482
- get empty() {
483
- const n = this.parts.value;
484
- return !n.area && !n.exchange && !n.subscriber;
485
- }
486
- onCLickOnMenu(e) {
487
- if (this.multi || this.closeOnClick === false) {
488
- e.stopPropagation();
489
- }
490
- }
491
- propagateChange(_) {
492
- }
493
- // this is the initial value set to the component
494
- writeValue(obj) {
495
- this.value = obj;
496
- }
497
- // registers 'fn' that will be fired when changes are made
498
- // this is how we emit the changes back to the form
499
- registerOnChange(fn) {
500
- this.propagateChange = fn;
501
- }
502
- registerOnTouched(fn) {
503
- this.onTouched = fn;
504
- }
505
- onChange(e) {
506
- let vals = e.source.selectedOptions.selected.map(o => o.value);
507
- vals = this.selectableOptions.filter(o => vals.includes(o[this.itemValue]));
508
- const selectableIds = this.selectableOptions.map(s => s[this.itemValue]);
509
- if (this.multi) {
510
- // if search is active, probably some of the already selected values are not included in the selectable options,
511
- // so we have to push them in the selected values of the list;
512
- for (const v of this.value) {
513
- if (!selectableIds.includes(v[this.itemValue])) {
514
- vals = [v, ...vals];
515
- }
516
- }
517
- }
518
- vals.sort((a, b) => {
519
- return typeof a[this.itemValue] === 'string' ?
520
- a[this.itemValue].localeCompare(b[this.itemValue]) : a[this.itemValue] - b[this.itemValue];
521
- });
522
- this.value = [...vals];
523
- this.form.get('selectionValue').setValue(this.value.map(v => v[this.itemValue]));
524
- this.valueChange.emit(this.value);
525
- this.propagateChange(this.value);
526
- this.changeDetectorRef.markForCheck();
527
- }
528
- onFocusIn(event) {
529
- if (!this.focused) {
530
- this.focused = true;
531
- this.stateChanges.next();
532
- }
533
- }
534
- onFocusOut(event) {
535
- if (!this.elementRef.nativeElement.contains(event.relatedTarget)) {
536
- this.touched = true;
537
- this.focused = false;
538
- this.onTouched();
539
- this.stateChanges.next();
540
- }
541
- }
542
- onMenuOpen() {
543
- this.isOpen = true;
544
- this.jvxMultiselectOpen.emit();
545
- }
546
- onMenuClose() {
547
- this.isOpen = false;
548
- this.jvxMultiselectClose.emit();
549
- }
550
- deselect(val) {
551
- this.value = [...this.value.filter(v => v[this.itemValue] !== val[this.itemValue])];
552
- // this.value.splice(this.value.findIndex(v => v[this.itemValue] === val[this.itemValue]), 1);
553
- this.form.get('selectionValue').setValue(this.value.map(m => m.value));
554
- this.valueChange.emit(this.value);
555
- this.propagateChange(this.value);
556
- this.changeDetectorRef.markForCheck();
557
- }
558
- setSelectionContainerSize() {
559
- timer(0).subscribe(() => {
560
- if (this.selectionContainer) {
561
- this.listContainerSize.height = this.selectionContainer.nativeElement.offsetHeight > 260 ? '260px' : 'auto';
562
- this.listContainerSize.minHeight = this.selectionContainer.nativeElement.offsetHeight <= 260 ?
563
- this.selectionContainer.nativeElement.offsetHeight + 'px' : '260px';
564
- this.listContainerSize.width = this.jvxMultiselect.nativeElement.offsetWidth + 'px';
565
- }
566
- this.changeDetectorRef.detectChanges();
567
- });
568
- }
569
- clickOnMenuTrigger(e) {
570
- if (!this.disabled) {
571
- this.showList = false;
572
- this.shouldLoadMore = true;
573
- timer(0).subscribe(() => {
574
- this.showList = true;
575
- if (this.url.length > 0) {
576
- e.preventDefault();
577
- this.selectableOptions.length = 0;
578
- this.updateOrderedOptions(this.selectableOptions);
579
- this.getList().subscribe(noop);
580
- this.setSelectionContainerSize();
581
- }
582
- else {
583
- this.trigger.openMenu();
584
- this.setSelectionContainerSize();
585
- }
586
- });
587
- }
588
- }
589
- getList() {
590
- this.isLoading = true;
591
- return this.service.getList({
592
- url: this.url,
593
- requestType: this.requestType,
594
- data: {},
595
- currentPage: ++this.currentPage,
596
- ignorePagination: this.ignorePagination,
597
- requestHeaders: this.requestHeaders,
598
- search: this.searchValue,
599
- searchProp: this.searchProp,
600
- pageSize: this.intPageSize
601
- }).pipe(map((val) => {
602
- return val ?? [];
603
- }), switchMap((val) => this.multiMapper.mapOptions(val)), switchMap((val) => {
604
- let result = [];
605
- if (!val) {
606
- result = [];
607
- }
608
- else if (this.listProp.length > 0) {
609
- result = [...(val[this.listProp] ?? [])];
610
- }
611
- else {
612
- result = [...val];
613
- }
614
- if (result.length === 0) {
615
- this.shouldLoadMore = false;
616
- this.isLoading = false;
617
- return of([]);
618
- }
619
- else {
620
- const newOptions = [];
621
- for (const opt of result) {
622
- const newOption = this.mapper.mapOption(opt);
623
- newOptions.push(newOption);
624
- }
625
- return forkJoin(newOptions);
626
- }
627
- }), switchMap((finVal) => {
628
- this.selectableOptions.push(...finVal);
629
- return this.updateOrderedOptions(this.selectableOptions);
630
- }), map((val) => {
631
- this.isLoading = false;
632
- this.trigger.openMenu();
633
- this.setSelectionContainerSize();
634
- return val;
635
- }), tap(() => {
636
- this.changeDetectorRef.markForCheck();
637
- }));
638
- }
639
- onScrolled(e) {
640
- if (e.target.scrollTop + 220 + ((this.searchInput ? 0 : 1) * 40) === this.selectionContainer.nativeElement.offsetHeight
641
- && !this.isLoading) {
642
- this.scrollEnd.emit();
643
- if (this.url && this.url.length > 0 && !this.ignorePagination && this.shouldLoadMore) {
644
- this.getList().subscribe(noop);
645
- }
646
- }
647
- }
648
- onMenuOpened() {
649
- this.jvxMultiselectOpened.emit();
650
- }
651
- onMenuClosed() {
652
- if ((!this.url || this.url.length === 0) && this.searchMode === 'client') {
653
- this.searchValueSubject.next('');
654
- }
655
- else {
656
- this.searchValue = '';
657
- this.currentPage = 0;
658
- }
659
- this.jvxMultiselectClosed.emit();
660
- this.changeDetectorRef.markForCheck();
661
- }
662
- onSearchInputClick(e) {
663
- e.stopPropagation();
664
- }
665
- onSearchValueChange(e) {
666
- this.searchValueSubject.next(e.target.value);
667
- }
668
- clear(e) {
669
- e.stopPropagation();
670
- e.preventDefault();
671
- this.value = [];
672
- this.form.get('selectionValue').setValue(this.value.map(v => v[this.itemValue]));
673
- this.propagateChange(this.value);
674
- this.valueChange.emit(this.value);
675
- this.changeDetectorRef.markForCheck();
676
- }
677
- setDescribedByIds(ids) {
678
- const controlElement = this.elementRef.nativeElement
679
- .querySelector('.ng-jvx-multiselect');
680
- controlElement.setAttribute('aria-describedby', ids.join(' '));
681
- }
682
- onContainerClick(event) {
683
- // if ((event.target as Element).tagName.toLowerCase() !== 'input') {
684
- // this.elementRef.nativeElement.querySelector('input').focus();
685
- // }
686
- }
687
- get stateChange$() {
688
- return this.stateChanges.asObservable();
689
- }
690
- updateOrderedOptions(options) {
691
- let obs = of(options);
692
- if (this.groupBy) {
693
- this.orderedOptions.length = 0;
694
- const obsArr = [];
695
- for (const option of options) {
696
- if (typeof this.groupBy !== 'string') {
697
- obsArr.push(this.groupBy.mapGroup(option));
698
- }
699
- else {
700
- obsArr.push(of({ group: option[this.groupBy], option }));
701
- }
702
- }
703
- obs = forkJoin(obsArr).pipe(map((res) => {
704
- const groups = [...new Set(res.map(item => item.group))];
705
- for (const group of groups) {
706
- this.orderedOptions.push({
707
- group,
708
- options: res.filter(r => r.group === group).map(o => o.option)
709
- });
710
- }
711
- return this.orderedOptions;
712
- }));
713
- }
714
- return obs;
715
- }
716
- closeMenu() {
717
- this.trigger.closeMenu();
718
- }
719
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectComponent, deps: [{ token: i1$1.UntypedFormBuilder }, { token: NgJvxMultiselectService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$1.NgControl, optional: true, self: true }, { token: i1$1.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
720
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: NgJvxMultiselectComponent, selector: "ng-jvx-multiselect", inputs: { options: "options", multi: "multi", url: "url", requestType: "requestType", itemValue: "itemValue", itemText: "itemText", ignorePagination: "ignorePagination", clearable: "clearable", closeOnClick: "closeOnClick", hasErrors: "hasErrors", searchMode: "searchMode", searchInput: "searchInput", searchLabel: "searchLabel", listProp: "listProp", totalRowsProp: "totalRowsProp", panelClass: "panelClass", searchProp: "searchProp", closeButton: "closeButton", mapper: "mapper", multiMapper: "multiMapper", searchMapper: "searchMapper", groupBy: "groupBy", value: "value", requestHeaders: "requestHeaders", required: "required", disabled: "disabled", pageSize: "pageSize" }, outputs: { valueChange: "valueChange", jvxMultiselectOpen: "jvxMultiselectOpen", jvxMultiselectOpened: "jvxMultiselectOpened", jvxMultiselectClose: "jvxMultiselectClose", jvxMultiselectClosed: "jvxMultiselectClosed", scrollEnd: "scrollEnd" }, host: { properties: { "id": "this.id", "class.floating": "this.shouldLabelFloat" } }, providers: [
721
- {
722
- provide: MatFormFieldControl,
723
- useExisting: forwardRef(() => NgJvxMultiselectComponent),
724
- multi: true,
725
- }
726
- ], queries: [{ propertyName: "optionsTemplate", first: true, predicate: NgJvxOptionsTemplateDirective, descendants: true }, { propertyName: "selectionTemplate", first: true, predicate: NgJvxSelectionTemplateDirective, descendants: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: NgJvxGroupHeaderDirective, descendants: true }], viewQueries: [{ propertyName: "jvxMultiselect", first: true, predicate: ["jvxMultiselect"], descendants: true, static: true }, { propertyName: "selectionContainer", first: true, predicate: ["selectionContainer"], descendants: true }, { propertyName: "selection", first: true, predicate: ["selection"], descendants: true, static: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, static: true }, { propertyName: "scrollbar", first: true, predicate: ["scrollbar"], descendants: true }, { propertyName: "multiContainer", first: true, predicate: ["multiContainer"], descendants: true }, { propertyName: "optionComp", predicate: NgJvxOptionComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"ng-jvx-multiselect\" [ngClass]=\"{'disabled': disabled, 'has-errors': hasErrors}\" #jvxMultiselect>\r\n <!-- START MENU -->\r\n <div [matMenuTriggerFor]=\"menuRef\" (onMenuOpen)=\"onMenuOpen()\" (menuOpened)=\"onMenuOpened()\"\r\n (onMenuClose)=\"onMenuClose()\" (menuClosed)=\"onMenuClosed()\"\r\n #trigger=\"matMenuTrigger\">\r\n <mat-menu #menuRef=\"matMenu\" [class]=\"['jvx-multiselect-panel', panelClass].join(' ')\" [formGroup]=\"form\"\r\n [yPosition]=\"yPosition\">\r\n <div *ngIf=\"closeButton\" class=\"closeMenuButton\">\r\n <mat-icon>close</mat-icon>\r\n </div>\r\n <div class=\"menu-list-container\"\r\n #menuLIstContainer\r\n [ngStyle]=\"{'overflow-y': 'hidden', 'width': listContainerSize.width, 'max-height': '260px', 'height': listContainerSize.height, 'min-height': listContainerSize.minHeight}\">\r\n\r\n <div class=\"search-input-container\" *ngIf=\"!!searchInput\" (click)=\"onSearchInputClick($event)\">\r\n <input type=\"text\" [placeholder]=\"searchLabel\" [ngModel]=\"searchValue\" [ngModelOptions]=\"{standalone: true}\"\r\n [ngJvxFocus]=\"isOpen\"\r\n (input)=\"onSearchValueChange($event)\"/>\r\n </div>\r\n <div\r\n [ngStyle]=\"{height: searchInput && selectionContainer.clientHeight > 220 || selectionContainer.clientHeight > 260? 260 - (searchInput? 40 : 0) + 'px': 'auto'}\">\r\n <ng-scrollbar style=\"width: 100%\"\r\n smoothScroll\r\n [visibility]=\"'hover'\"\r\n [appearance]=\"'compact'\"\r\n [sensorDisabled]=\"isLoading\"\r\n [autoHeightDisabled]=\"false\" #scrollbar>\r\n <div #selectionContainer (click)=\"onCLickOnMenu($event)\">\r\n <mat-selection-list #selection [multiple]=\"multi\"\r\n *ngIf=\"showList\"\r\n [ngStyle]=\"{'padding': 0, 'width': listContainerSize.width, 'min-width.px': 112}\"\r\n (selectionChange)=\"onChange($event)\"\r\n ngDefaultControl\r\n formControlName=\"selectionValue\">\r\n <ng-content></ng-content>\r\n <ng-container *ngIf=\"!!groupBy\">\r\n <ng-container *ngFor=\"let opt of orderedOptions\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"groupHeaderTemplate? groupHeaderTemplate.template: defaultGroupHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: opt}\"></ng-container>\r\n\r\n <ng-jvx-option *ngFor=\"let option of opt.options\" [value]=\"option[itemValue]\">\r\n <!-- <ng-container [ngTemplateOutlet]=\"optionsTemplate\" [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>-->\r\n <div class=\"ng-jvx-option-wrapper\">\r\n <ng-container [ngTemplateOutlet]=\"optionsTemplate? optionsTemplate.template : defaultTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>\r\n </div>\r\n </ng-jvx-option>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!groupBy || groupBy.length === 0\">\r\n <ng-jvx-option *ngFor=\"let option of selectableOptions\" [value]=\"option[itemValue]\">\r\n <div class=\"ng-jvx-option-wrapper\">\r\n <!-- <ng-container [ngTemplateOutlet]=\"optionsTemplate\" [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>-->\r\n <ng-container [ngTemplateOutlet]=\"optionsTemplate? optionsTemplate.template : defaultTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>\r\n </div>\r\n </ng-jvx-option>\r\n </ng-container>\r\n </mat-selection-list>\r\n </div>\r\n </ng-scrollbar>\r\n </div>\r\n\r\n </div>\r\n <div class=\"menu-footer\">\r\n <ng-content select=\"[ng-jvx-footer]\"></ng-content>\r\n </div>\r\n\r\n </mat-menu>\r\n </div>\r\n <!-- END MENU -->\r\n <!-- START INPUT -->\r\n <div [ngClass]=\"{'ng-jvx-multiselect-value-container': true, 'is-open': isOpen}\"\r\n (click)=\"clickOnMenuTrigger($event)\"\r\n #valueContainer>\r\n\r\n <div class=\"ng-jvx-multiselect__placeholder\" *ngIf=\"value.length === 0\">\r\n <ng-content select=\"[placeholder]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"ng-jvx-multiselect-value multi-value-container\" *ngIf=\"multi\" #multiContainer>\r\n\r\n <ng-container [ngTemplateOutlet]=\"selectionTemplate? selectionTemplate.template : defaultMultiSelectionTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: value}\"></ng-container>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"ng-jvx-multiselect-value single-value-container\" *ngIf=\"!multi\">\r\n <div *ngFor=\"let val of value\" style=\"width: 100%;\">\r\n <ng-container [ngTemplateOutlet]=\"selectionTemplate? selectionTemplate.template : defaultSelectionTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: val}\"></ng-container>\r\n </div>\r\n </div>\r\n <div class=\"ng-jvx-multiselect__remove-button\" *ngIf=\"clearable && value.length > 0\" (click)=\"clear($event)\">\r\n <mat-icon style=\"font-size: 18px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\">clear\r\n </mat-icon>\r\n </div>\r\n <div class=\"ng-jvx-multiselect-arrow\">\r\n <mat-icon *ngIf=\"!isLoading\">expand_more</mat-icon>\r\n <div *ngIf=\"isLoading\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- END INPUT -->\r\n</div>\r\n<ng-template #defaultTemplate let-option>\r\n <div style=\"max-width: 100%;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\">{{option[itemText]}}\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #defaultSelectionTemplate let-value>\r\n {{value[itemText]}}\r\n</ng-template>\r\n\r\n<ng-template #defaultMultiSelectionTemplate let-value>\r\n <mat-chip-listbox #chipList [disabled]=\"this.disabled\">\r\n <mat-chip-option [color]=\"'primary'\" selected *ngFor=\"let val of value\" [selectable]=\"false\"\r\n class=\"ng-jvx-multiselect-chip\"\r\n [removable]=\"true\" (removed)=\"deselect(val)\">\r\n <span class=\"chip-content\"\r\n [ngStyle]=\"{'max-width': multiContainerWidth - 50 +'px'}\">{{val[itemText]}}</span>\r\n\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip-option>\r\n </mat-chip-listbox>\r\n</ng-template>\r\n<ng-template #defaultGroupHeaderTemplate let-opt>\r\n <div style=\"padding-inline: 15px\"><strong>{{opt.group}}</strong></div>\r\n</ng-template>\r\n", styles: ["ng-jvx-multiselect{display:flex;align-items:center;width:100%}ng-jvx-multiselect .ng-jvx-multiselect{width:100%;display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container{width:100%;display:flex;cursor:pointer;position:relative;justify-content:space-between;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect__placeholder{height:100%;display:flex;align-items:center;position:absolute}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value{flex:1 1 100%;max-width:calc(100% - 28px);display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value .mat-chip-list-wrapper .mat-mdc-standard-chip{padding:0 5px 0 7px;margin:4px 5px 0}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value .mat-chip-list-wrapper .mat-mdc-standard-chip .chip-content{margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect__remove-button{display:flex;height:100%;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow{width:24px;padding-right:4px;display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow mat-icon{transition:transform .3s ease-in-out}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring{display:inline-block;position:relative;width:24px;height:24px}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div{box-sizing:border-box;display:block;position:absolute;width:6px;height:16px;margin:4px;border:2px solid;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--jvx-multiselect-accent) transparent transparent transparent}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(1){animation-delay:-.45s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(2){animation-delay:-.3s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(3){animation-delay:-.15s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container.is-open .ng-jvx-multiselect-arrow mat-icon{transform:rotate(180deg)}ng-jvx-multiselect .ng-jvx-multiselect.disabled{pointer-events:none}ng-jvx-multiselect .ng-jvx-multiselect.disabled .ng-jvx-multiselect-arrow mat-icon{opacity:.3}ng-jvx-multiselect .ng-jvx-multiselect.has-errors{color:red}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-value.single-value-container{color:red}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-value.multi-value-container{width:100%}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-arrow mat-icon{color:red}.mat-select-test{width:250px}.menu-list-container{max-height:300px;display:flex;flex-direction:column}.menu-footer{max-height:30px;overflow:hidden}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel{min-width:100%;max-width:100%;position:relative;overflow:visible}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .closeMenuButton{height:22px;width:22px;background-color:var(--jvx-multiselect-primary);position:absolute;top:-11px;right:11px;border-radius:100%;cursor:pointer;color:#fff;z-index:10}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .closeMenuButton mat-icon{color:#fff;font-size:15px;height:100%;width:100%;display:flex;align-items:center;justify-content:center}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content{padding-top:0!important;padding-bottom:0!important}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .menu-list-container ng-scrollbar{--scrollbar-color: transparent;--scrollbar-container-color: transparent;--scrollbar-thumb-color: var(--jvx-multiselect-accent);--scrollbar-thumb-hover-color: var(--jvx-multiselect-accent);--scrollbar-border-radius: 4px;--scrollbar-size: 6px;--scrollbar-padding: 8px;--scroll-view-margin: 0;--scroll-view-color: transparent}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container{height:40px;display:flex;align-items:center;padding:10px}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input{width:100%;outline:none;border:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input:focus{outline:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input:active{outline:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list{padding-top:0!important;padding-bottom:0!important}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=true] .ng-jvx-option-wrapper,.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=false] .ng-jvx-option-wrapper{padding-inline:10px}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=true] .mdc-list-item__end,.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=false] .mdc-list-item__end{display:none}\n"], dependencies: [{ kind: "component", type: i3.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i7.MatChipListbox, selector: "mat-chip-listbox", inputs: ["tabIndex", "multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i7.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i7.MatChipRemove, selector: "[matChipRemove]" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "directive", type: i9.SmoothScroll, selector: "[smoothScroll], [smooth-scroll]", exportAs: ["smoothScroll"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: NgJvxOptionComponent, selector: "ng-jvx-option", inputs: ["value"] }, { kind: "directive", type: NgJvxFocusDirective, selector: "[ngJvxFocus]", inputs: ["ngJvxFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
727
- }
728
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectComponent, decorators: [{
729
- type: Component,
730
- args: [{ selector: 'ng-jvx-multiselect', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
731
- {
732
- provide: MatFormFieldControl,
733
- useExisting: forwardRef(() => NgJvxMultiselectComponent),
734
- multi: true,
735
- }
736
- ], template: "<div class=\"ng-jvx-multiselect\" [ngClass]=\"{'disabled': disabled, 'has-errors': hasErrors}\" #jvxMultiselect>\r\n <!-- START MENU -->\r\n <div [matMenuTriggerFor]=\"menuRef\" (onMenuOpen)=\"onMenuOpen()\" (menuOpened)=\"onMenuOpened()\"\r\n (onMenuClose)=\"onMenuClose()\" (menuClosed)=\"onMenuClosed()\"\r\n #trigger=\"matMenuTrigger\">\r\n <mat-menu #menuRef=\"matMenu\" [class]=\"['jvx-multiselect-panel', panelClass].join(' ')\" [formGroup]=\"form\"\r\n [yPosition]=\"yPosition\">\r\n <div *ngIf=\"closeButton\" class=\"closeMenuButton\">\r\n <mat-icon>close</mat-icon>\r\n </div>\r\n <div class=\"menu-list-container\"\r\n #menuLIstContainer\r\n [ngStyle]=\"{'overflow-y': 'hidden', 'width': listContainerSize.width, 'max-height': '260px', 'height': listContainerSize.height, 'min-height': listContainerSize.minHeight}\">\r\n\r\n <div class=\"search-input-container\" *ngIf=\"!!searchInput\" (click)=\"onSearchInputClick($event)\">\r\n <input type=\"text\" [placeholder]=\"searchLabel\" [ngModel]=\"searchValue\" [ngModelOptions]=\"{standalone: true}\"\r\n [ngJvxFocus]=\"isOpen\"\r\n (input)=\"onSearchValueChange($event)\"/>\r\n </div>\r\n <div\r\n [ngStyle]=\"{height: searchInput && selectionContainer.clientHeight > 220 || selectionContainer.clientHeight > 260? 260 - (searchInput? 40 : 0) + 'px': 'auto'}\">\r\n <ng-scrollbar style=\"width: 100%\"\r\n smoothScroll\r\n [visibility]=\"'hover'\"\r\n [appearance]=\"'compact'\"\r\n [sensorDisabled]=\"isLoading\"\r\n [autoHeightDisabled]=\"false\" #scrollbar>\r\n <div #selectionContainer (click)=\"onCLickOnMenu($event)\">\r\n <mat-selection-list #selection [multiple]=\"multi\"\r\n *ngIf=\"showList\"\r\n [ngStyle]=\"{'padding': 0, 'width': listContainerSize.width, 'min-width.px': 112}\"\r\n (selectionChange)=\"onChange($event)\"\r\n ngDefaultControl\r\n formControlName=\"selectionValue\">\r\n <ng-content></ng-content>\r\n <ng-container *ngIf=\"!!groupBy\">\r\n <ng-container *ngFor=\"let opt of orderedOptions\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"groupHeaderTemplate? groupHeaderTemplate.template: defaultGroupHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: opt}\"></ng-container>\r\n\r\n <ng-jvx-option *ngFor=\"let option of opt.options\" [value]=\"option[itemValue]\">\r\n <!-- <ng-container [ngTemplateOutlet]=\"optionsTemplate\" [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>-->\r\n <div class=\"ng-jvx-option-wrapper\">\r\n <ng-container [ngTemplateOutlet]=\"optionsTemplate? optionsTemplate.template : defaultTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>\r\n </div>\r\n </ng-jvx-option>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!groupBy || groupBy.length === 0\">\r\n <ng-jvx-option *ngFor=\"let option of selectableOptions\" [value]=\"option[itemValue]\">\r\n <div class=\"ng-jvx-option-wrapper\">\r\n <!-- <ng-container [ngTemplateOutlet]=\"optionsTemplate\" [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>-->\r\n <ng-container [ngTemplateOutlet]=\"optionsTemplate? optionsTemplate.template : defaultTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>\r\n </div>\r\n </ng-jvx-option>\r\n </ng-container>\r\n </mat-selection-list>\r\n </div>\r\n </ng-scrollbar>\r\n </div>\r\n\r\n </div>\r\n <div class=\"menu-footer\">\r\n <ng-content select=\"[ng-jvx-footer]\"></ng-content>\r\n </div>\r\n\r\n </mat-menu>\r\n </div>\r\n <!-- END MENU -->\r\n <!-- START INPUT -->\r\n <div [ngClass]=\"{'ng-jvx-multiselect-value-container': true, 'is-open': isOpen}\"\r\n (click)=\"clickOnMenuTrigger($event)\"\r\n #valueContainer>\r\n\r\n <div class=\"ng-jvx-multiselect__placeholder\" *ngIf=\"value.length === 0\">\r\n <ng-content select=\"[placeholder]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"ng-jvx-multiselect-value multi-value-container\" *ngIf=\"multi\" #multiContainer>\r\n\r\n <ng-container [ngTemplateOutlet]=\"selectionTemplate? selectionTemplate.template : defaultMultiSelectionTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: value}\"></ng-container>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"ng-jvx-multiselect-value single-value-container\" *ngIf=\"!multi\">\r\n <div *ngFor=\"let val of value\" style=\"width: 100%;\">\r\n <ng-container [ngTemplateOutlet]=\"selectionTemplate? selectionTemplate.template : defaultSelectionTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: val}\"></ng-container>\r\n </div>\r\n </div>\r\n <div class=\"ng-jvx-multiselect__remove-button\" *ngIf=\"clearable && value.length > 0\" (click)=\"clear($event)\">\r\n <mat-icon style=\"font-size: 18px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\">clear\r\n </mat-icon>\r\n </div>\r\n <div class=\"ng-jvx-multiselect-arrow\">\r\n <mat-icon *ngIf=\"!isLoading\">expand_more</mat-icon>\r\n <div *ngIf=\"isLoading\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- END INPUT -->\r\n</div>\r\n<ng-template #defaultTemplate let-option>\r\n <div style=\"max-width: 100%;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\">{{option[itemText]}}\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #defaultSelectionTemplate let-value>\r\n {{value[itemText]}}\r\n</ng-template>\r\n\r\n<ng-template #defaultMultiSelectionTemplate let-value>\r\n <mat-chip-listbox #chipList [disabled]=\"this.disabled\">\r\n <mat-chip-option [color]=\"'primary'\" selected *ngFor=\"let val of value\" [selectable]=\"false\"\r\n class=\"ng-jvx-multiselect-chip\"\r\n [removable]=\"true\" (removed)=\"deselect(val)\">\r\n <span class=\"chip-content\"\r\n [ngStyle]=\"{'max-width': multiContainerWidth - 50 +'px'}\">{{val[itemText]}}</span>\r\n\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip-option>\r\n </mat-chip-listbox>\r\n</ng-template>\r\n<ng-template #defaultGroupHeaderTemplate let-opt>\r\n <div style=\"padding-inline: 15px\"><strong>{{opt.group}}</strong></div>\r\n</ng-template>\r\n", styles: ["ng-jvx-multiselect{display:flex;align-items:center;width:100%}ng-jvx-multiselect .ng-jvx-multiselect{width:100%;display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container{width:100%;display:flex;cursor:pointer;position:relative;justify-content:space-between;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect__placeholder{height:100%;display:flex;align-items:center;position:absolute}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value{flex:1 1 100%;max-width:calc(100% - 28px);display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value .mat-chip-list-wrapper .mat-mdc-standard-chip{padding:0 5px 0 7px;margin:4px 5px 0}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value .mat-chip-list-wrapper .mat-mdc-standard-chip .chip-content{margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect__remove-button{display:flex;height:100%;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow{width:24px;padding-right:4px;display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow mat-icon{transition:transform .3s ease-in-out}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring{display:inline-block;position:relative;width:24px;height:24px}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div{box-sizing:border-box;display:block;position:absolute;width:6px;height:16px;margin:4px;border:2px solid;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--jvx-multiselect-accent) transparent transparent transparent}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(1){animation-delay:-.45s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(2){animation-delay:-.3s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(3){animation-delay:-.15s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container.is-open .ng-jvx-multiselect-arrow mat-icon{transform:rotate(180deg)}ng-jvx-multiselect .ng-jvx-multiselect.disabled{pointer-events:none}ng-jvx-multiselect .ng-jvx-multiselect.disabled .ng-jvx-multiselect-arrow mat-icon{opacity:.3}ng-jvx-multiselect .ng-jvx-multiselect.has-errors{color:red}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-value.single-value-container{color:red}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-value.multi-value-container{width:100%}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-arrow mat-icon{color:red}.mat-select-test{width:250px}.menu-list-container{max-height:300px;display:flex;flex-direction:column}.menu-footer{max-height:30px;overflow:hidden}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel{min-width:100%;max-width:100%;position:relative;overflow:visible}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .closeMenuButton{height:22px;width:22px;background-color:var(--jvx-multiselect-primary);position:absolute;top:-11px;right:11px;border-radius:100%;cursor:pointer;color:#fff;z-index:10}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .closeMenuButton mat-icon{color:#fff;font-size:15px;height:100%;width:100%;display:flex;align-items:center;justify-content:center}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content{padding-top:0!important;padding-bottom:0!important}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .menu-list-container ng-scrollbar{--scrollbar-color: transparent;--scrollbar-container-color: transparent;--scrollbar-thumb-color: var(--jvx-multiselect-accent);--scrollbar-thumb-hover-color: var(--jvx-multiselect-accent);--scrollbar-border-radius: 4px;--scrollbar-size: 6px;--scrollbar-padding: 8px;--scroll-view-margin: 0;--scroll-view-color: transparent}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container{height:40px;display:flex;align-items:center;padding:10px}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input{width:100%;outline:none;border:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input:focus{outline:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input:active{outline:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list{padding-top:0!important;padding-bottom:0!important}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=true] .ng-jvx-option-wrapper,.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=false] .ng-jvx-option-wrapper{padding-inline:10px}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=true] .mdc-list-item__end,.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=false] .mdc-list-item__end{display:none}\n"] }]
737
- }], ctorParameters: function () { return [{ type: i1$1.UntypedFormBuilder }, { type: NgJvxMultiselectService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$1.NgControl, decorators: [{
738
- type: Optional
739
- }, {
740
- type: Self
741
- }] }, { type: i1$1.UntypedFormBuilder }]; }, propDecorators: { id: [{
742
- type: HostBinding
743
- }], shouldLabelFloat: [{
744
- type: HostBinding,
745
- args: ['class.floating']
746
- }], jvxMultiselect: [{
747
- type: ViewChild,
748
- args: ['jvxMultiselect', { static: true }]
749
- }], selectionContainer: [{
750
- type: ViewChild,
751
- args: ['selectionContainer', { static: false }]
752
- }], selection: [{
753
- type: ViewChild,
754
- args: ['selection', { static: true }]
755
- }], trigger: [{
756
- type: ViewChild,
757
- args: ['trigger', { static: true }]
758
- }], scrollbar: [{
759
- type: ViewChild,
760
- args: ['scrollbar', { static: false }]
761
- }], multiContainer: [{
762
- type: ViewChild,
763
- args: ['multiContainer', { static: false }]
764
- }], optionComp: [{
765
- type: ViewChildren,
766
- args: [NgJvxOptionComponent]
767
- }], optionsTemplate: [{
768
- type: ContentChild,
769
- args: [NgJvxOptionsTemplateDirective]
770
- }], selectionTemplate: [{
771
- type: ContentChild,
772
- args: [NgJvxSelectionTemplateDirective]
773
- }], groupHeaderTemplate: [{
774
- type: ContentChild,
775
- args: [NgJvxGroupHeaderDirective]
776
- }], options: [{
777
- type: Input
778
- }], multi: [{
779
- type: Input
780
- }], url: [{
781
- type: Input
782
- }], requestType: [{
783
- type: Input
784
- }], itemValue: [{
785
- type: Input
786
- }], itemText: [{
787
- type: Input
788
- }], ignorePagination: [{
789
- type: Input
790
- }], clearable: [{
791
- type: Input
792
- }], closeOnClick: [{
793
- type: Input
794
- }], hasErrors: [{
795
- type: Input
796
- }], searchMode: [{
797
- type: Input
798
- }], searchInput: [{
799
- type: Input
800
- }], searchLabel: [{
801
- type: Input
802
- }], listProp: [{
803
- type: Input
804
- }], totalRowsProp: [{
805
- type: Input
806
- }], panelClass: [{
807
- type: Input
808
- }], searchProp: [{
809
- type: Input
810
- }], closeButton: [{
811
- type: Input
812
- }], mapper: [{
813
- type: Input
814
- }], multiMapper: [{
815
- type: Input
816
- }], searchMapper: [{
817
- type: Input
818
- }], groupBy: [{
819
- type: Input
820
- }], value: [{
821
- type: Input
822
- }], requestHeaders: [{
823
- type: Input
824
- }], required: [{
825
- type: Input
826
- }], disabled: [{
827
- type: Input
828
- }], pageSize: [{
829
- type: Input
830
- }], valueChange: [{
831
- type: Output
832
- }], jvxMultiselectOpen: [{
833
- type: Output
834
- }], jvxMultiselectOpened: [{
835
- type: Output
836
- }], jvxMultiselectClose: [{
837
- type: Output
838
- }], jvxMultiselectClosed: [{
839
- type: Output
840
- }], scrollEnd: [{
841
- type: Output
237
+ class NgJvxMultiselectComponent {
238
+ static { this.nextId = 0; }
239
+ get shouldLabelFloat() {
240
+ return this.focused || !this.empty;
241
+ }
242
+ set value(value) {
243
+ this.pValue = value ?? [];
244
+ if (value) {
245
+ this.form.get('selectionValue').setValue(this.pValue.map(v => v[this.itemValue]));
246
+ }
247
+ else {
248
+ this.form.get('selectionValue').setValue(value);
249
+ }
250
+ this.stateChanges.next();
251
+ }
252
+ get value() {
253
+ return this.pValue;
254
+ }
255
+ get required() {
256
+ return this._required;
257
+ }
258
+ set required(req) {
259
+ this._required = coerceBooleanProperty(req);
260
+ this.stateChanges.next();
261
+ }
262
+ get disabled() {
263
+ return this._disabled;
264
+ }
265
+ set disabled(value) {
266
+ this._disabled = coerceBooleanProperty(value);
267
+ this._disabled ? this.parts.disable() : this.parts.enable();
268
+ this.stateChanges.next();
269
+ }
270
+ get pageSize() {
271
+ return this.intPageSize;
272
+ }
273
+ set pageSize(val) {
274
+ if (val < 15) {
275
+ this.intPageSize = 15;
276
+ }
277
+ else {
278
+ this.intPageSize = val;
279
+ }
280
+ }
281
+ get errorState() {
282
+ if (this.ngControl != null) {
283
+ return this.ngControl.invalid && this.ngControl.touched;
284
+ }
285
+ else {
286
+ return false;
287
+ }
288
+ }
289
+ constructor(formBuilder, service, elementRef, changeDetectorRef, ngControl, fb) {
290
+ this.formBuilder = formBuilder;
291
+ this.service = service;
292
+ this.elementRef = elementRef;
293
+ this.changeDetectorRef = changeDetectorRef;
294
+ this.ngControl = ngControl;
295
+ this.id = `jvx-multiselect-${NgJvxMultiselectComponent.nextId++}`;
296
+ this.optionsTemplate = null;
297
+ this.selectionTemplate = null;
298
+ this.groupHeaderTemplate = null;
299
+ // @ContentChild(NgJvxOptionComponent) optionComp: NgJvxOptionComponent;
300
+ // @ContentChild(TemplateRef) optionsTemplate: TemplateRef<any> | null = null;
301
+ this.options = [];
302
+ this.multi = false;
303
+ this.url = '';
304
+ this.requestType = 'get';
305
+ this.itemValue = 'value';
306
+ this.itemText = 'text';
307
+ this.ignorePagination = false;
308
+ this.clearable = false;
309
+ this.closeOnClick = true;
310
+ this.hasErrors = false;
311
+ this.searchMode = null;
312
+ this.searchInput = false;
313
+ this.searchLabel = 'search';
314
+ this.listProp = '';
315
+ this.totalRowsProp = '';
316
+ this.panelClass = '';
317
+ this.searchProp = 'search';
318
+ this.closeButton = false;
319
+ this.mapper = {
320
+ mapOption(source) {
321
+ return of(source);
322
+ }
323
+ };
324
+ this.multiMapper = {
325
+ mapOptions(source) {
326
+ return of(source);
327
+ }
328
+ };
329
+ this.searchMapper = {
330
+ mapSearch: (source, options) => {
331
+ return of(options.filter(o => o[this.itemText].toString().toLowerCase().includes(source.toString().toLowerCase())));
332
+ }
333
+ };
334
+ this.requestHeaders = new HttpHeaders();
335
+ // tslint:disable-next-line:variable-name
336
+ this._required = false;
337
+ // tslint:disable-next-line:variable-name
338
+ this._disabled = false;
339
+ this.valueChange = new EventEmitter();
340
+ this.jvxMultiselectOpen = new EventEmitter();
341
+ this.jvxMultiselectOpened = new EventEmitter();
342
+ this.jvxMultiselectClose = new EventEmitter();
343
+ this.jvxMultiselectClosed = new EventEmitter();
344
+ this.scrollEnd = new EventEmitter();
345
+ this.controlType = 'ng-jvx-multiselect';
346
+ this.document = document;
347
+ this.window = window;
348
+ this.isOpen = false;
349
+ this.isLoading = false;
350
+ this.showList = true;
351
+ this.asyncOptions = [];
352
+ this.selectableOptions = [];
353
+ this.orderedOptions = [];
354
+ this.searchValue = '';
355
+ this.yPosition = 'above';
356
+ this.stateChanges = new Subject();
357
+ this.currentPage = 0;
358
+ this.listContainerSize = { height: 'auto', minHeight: '0', width: '100%' };
359
+ this.touched = false;
360
+ this.focused = false;
361
+ this.multiContainerWidth = 100;
362
+ this.searchValueSubject = new Subject();
363
+ this.searchValue$ = this.searchValueSubject.asObservable();
364
+ this.pValue = [];
365
+ this.shouldLoadMore = true;
366
+ this.unsubscribe = new Subject();
367
+ this.unsubscribe$ = this.unsubscribe.asObservable();
368
+ this.intPageSize = 15;
369
+ this.onTouched = () => {
370
+ };
371
+ if (this.ngControl != null) {
372
+ // Setting the value accessor directly (instead of using
373
+ // the providers) to avoid running into a circular import.
374
+ this.ngControl.valueAccessor = this;
375
+ }
376
+ this.parts = fb.group({
377
+ area: '',
378
+ exchange: '',
379
+ subscriber: '',
380
+ });
381
+ this.form = this.formBuilder.group({
382
+ selectionValue: new UntypedFormControl(this.selectionValue)
383
+ });
384
+ }
385
+ ngOnInit() {
386
+ this.stateChange$.pipe(takeUntil(this.unsubscribe)).subscribe(() => {
387
+ this.changeDetectorRef.markForCheck();
388
+ });
389
+ // this.setSelectableOptions(this.options).subscribe(noop);
390
+ this.selectableOptions = [...this.options];
391
+ this.updateOrderedOptions(this.selectableOptions).subscribe(noop);
392
+ fromEvent(window, 'resize').pipe(takeUntil(this.unsubscribe), debounceTime(100), map(() => {
393
+ return this.listContainerSize.width = this.jvxMultiselect.nativeElement.offsetWidth + 'px';
394
+ }), switchMap(() => timer(100)), tap(() => {
395
+ this.multiContainerWidth = this.multiContainer?.nativeElement?.offsetWidth ?? 100;
396
+ this.yPosition = window.innerHeight - this.jvxMultiselect.nativeElement?.getBoundingClientRect()?.top < 260 ? 'above' : 'below';
397
+ this.changeDetectorRef.markForCheck();
398
+ })).subscribe(noop);
399
+ this.searchValue$.pipe(takeUntil(this.unsubscribe), debounceTime(300), distinctUntilChanged((prev, curr) => {
400
+ return curr === this.searchValue;
401
+ }), switchMap((val) => {
402
+ this.searchValue = val;
403
+ this.currentPage = 0;
404
+ if (this.searchMode === 'client') {
405
+ return this.clientSearch();
406
+ }
407
+ else if (this.url && this.url.length > 0) {
408
+ return this.serverSearch();
409
+ }
410
+ })).subscribe((val) => {
411
+ this.changeDetectorRef.markForCheck();
412
+ });
413
+ }
414
+ clientSearch() {
415
+ let obs;
416
+ if (this.url && this.url.length > 0) {
417
+ this.selectableOptions = [];
418
+ this.updateOrderedOptions(this.selectableOptions).subscribe(noop);
419
+ this.shouldLoadMore = true;
420
+ obs = this.getList().pipe(map(() => {
421
+ return this.selectableOptions;
422
+ }));
423
+ }
424
+ else {
425
+ obs = of(this.options);
426
+ }
427
+ return obs.pipe(switchMap((val) => this.searchMapper.mapSearch(this.searchValue, val)), switchMap((res) => {
428
+ // return this.setSelectableOptions(res);
429
+ this.selectableOptions = [];
430
+ this.selectableOptions.push(...res);
431
+ return this.updateOrderedOptions(this.selectableOptions);
432
+ }));
433
+ }
434
+ setSelectableOptions(options) {
435
+ this.selectableOptions = [];
436
+ const obs = options.reduce((acc, curr) => {
437
+ acc.push(this.mapper.mapOption(curr));
438
+ return acc;
439
+ }, []);
440
+ // this.mapper.mapOption(option);
441
+ return forkJoin([...obs]).pipe(switchMap((val) => {
442
+ this.selectableOptions.push(...val);
443
+ return this.updateOrderedOptions(this.selectableOptions);
444
+ }));
445
+ }
446
+ serverSearch() {
447
+ this.shouldLoadMore = true;
448
+ this.selectableOptions = [];
449
+ this.shouldLoadMore = true;
450
+ return this.getList();
451
+ }
452
+ ngOnDestroy() {
453
+ this.unsubscribe.next();
454
+ this.stateChanges.complete();
455
+ }
456
+ ngAfterViewInit() {
457
+ timer(0).subscribe(() => {
458
+ this.listContainerSize.width = this.jvxMultiselect.nativeElement.offsetWidth + 'px';
459
+ });
460
+ if (this.scrollbar) {
461
+ this.scrollbar.scrolled.pipe(takeUntil(this.unsubscribe$)).subscribe((e) => {
462
+ this.onScrolled(e);
463
+ });
464
+ }
465
+ timer(0).pipe(tap(() => {
466
+ this.multiContainerWidth = this.multiContainer?.nativeElement?.offsetWidth ?? 100;
467
+ this.yPosition = window.innerHeight - this.jvxMultiselect.nativeElement?.getBoundingClientRect()?.top < 260 ? 'above' : 'below';
468
+ this.changeDetectorRef.markForCheck();
469
+ })).subscribe(noop);
470
+ }
471
+ ngOnChanges(changes) {
472
+ if (changes.options) {
473
+ // this.setSelectableOptions(this.options).subscribe(noop);
474
+ this.selectableOptions = [...this.options];
475
+ }
476
+ }
477
+ get selectionValue() {
478
+ return this.value.map((v) => {
479
+ return v[this.itemValue];
480
+ });
481
+ }
482
+ get empty() {
483
+ const n = this.parts.value;
484
+ return !n.area && !n.exchange && !n.subscriber;
485
+ }
486
+ onCLickOnMenu(e) {
487
+ if (this.multi || this.closeOnClick === false) {
488
+ e.stopPropagation();
489
+ }
490
+ }
491
+ propagateChange(_) {
492
+ }
493
+ // this is the initial value set to the component
494
+ writeValue(obj) {
495
+ this.value = obj;
496
+ }
497
+ // registers 'fn' that will be fired when changes are made
498
+ // this is how we emit the changes back to the form
499
+ registerOnChange(fn) {
500
+ this.propagateChange = fn;
501
+ }
502
+ registerOnTouched(fn) {
503
+ this.onTouched = fn;
504
+ }
505
+ onChange(e) {
506
+ let vals = e.source.selectedOptions.selected.map(o => o.value);
507
+ vals = this.selectableOptions.filter(o => vals.includes(o[this.itemValue]));
508
+ const selectableIds = this.selectableOptions.map(s => s[this.itemValue]);
509
+ if (this.multi) {
510
+ // if search is active, probably some of the already selected values are not included in the selectable options,
511
+ // so we have to push them in the selected values of the list;
512
+ for (const v of this.value) {
513
+ if (!selectableIds.includes(v[this.itemValue])) {
514
+ vals = [v, ...vals];
515
+ }
516
+ }
517
+ }
518
+ vals.sort((a, b) => {
519
+ return typeof a[this.itemValue] === 'string' ?
520
+ a[this.itemValue].localeCompare(b[this.itemValue]) : a[this.itemValue] - b[this.itemValue];
521
+ });
522
+ this.value = [...vals];
523
+ this.form.get('selectionValue').setValue(this.value.map(v => v[this.itemValue]));
524
+ this.valueChange.emit(this.value);
525
+ this.propagateChange(this.value);
526
+ this.changeDetectorRef.markForCheck();
527
+ }
528
+ onFocusIn(event) {
529
+ if (!this.focused) {
530
+ this.focused = true;
531
+ this.stateChanges.next();
532
+ }
533
+ }
534
+ onFocusOut(event) {
535
+ if (!this.elementRef.nativeElement.contains(event.relatedTarget)) {
536
+ this.touched = true;
537
+ this.focused = false;
538
+ this.onTouched();
539
+ this.stateChanges.next();
540
+ }
541
+ }
542
+ onMenuOpen() {
543
+ this.isOpen = true;
544
+ this.jvxMultiselectOpen.emit();
545
+ }
546
+ onMenuClose() {
547
+ this.isOpen = false;
548
+ this.jvxMultiselectClose.emit();
549
+ }
550
+ deselect(val) {
551
+ this.value = [...this.value.filter(v => v[this.itemValue] !== val[this.itemValue])];
552
+ // this.value.splice(this.value.findIndex(v => v[this.itemValue] === val[this.itemValue]), 1);
553
+ this.form.get('selectionValue').setValue(this.value.map(m => m.value));
554
+ this.valueChange.emit(this.value);
555
+ this.propagateChange(this.value);
556
+ this.changeDetectorRef.markForCheck();
557
+ }
558
+ setSelectionContainerSize() {
559
+ timer(0).subscribe(() => {
560
+ if (this.selectionContainer) {
561
+ this.listContainerSize.height = this.selectionContainer.nativeElement.offsetHeight > 260 ? '260px' : 'auto';
562
+ this.listContainerSize.minHeight = this.selectionContainer.nativeElement.offsetHeight <= 260 ?
563
+ this.selectionContainer.nativeElement.offsetHeight + 'px' : '260px';
564
+ this.listContainerSize.width = this.jvxMultiselect.nativeElement.offsetWidth + 'px';
565
+ }
566
+ this.changeDetectorRef.detectChanges();
567
+ });
568
+ }
569
+ clickOnMenuTrigger(e) {
570
+ if (!this.disabled) {
571
+ this.showList = false;
572
+ this.shouldLoadMore = true;
573
+ timer(0).subscribe(() => {
574
+ this.showList = true;
575
+ if (this.url.length > 0) {
576
+ e.preventDefault();
577
+ this.selectableOptions.length = 0;
578
+ this.updateOrderedOptions(this.selectableOptions);
579
+ this.getList().subscribe(noop);
580
+ this.setSelectionContainerSize();
581
+ }
582
+ else {
583
+ this.trigger.openMenu();
584
+ this.setSelectionContainerSize();
585
+ }
586
+ });
587
+ }
588
+ }
589
+ getList() {
590
+ this.isLoading = true;
591
+ return this.service.getList({
592
+ url: this.url,
593
+ requestType: this.requestType,
594
+ data: {},
595
+ currentPage: ++this.currentPage,
596
+ ignorePagination: this.ignorePagination,
597
+ requestHeaders: this.requestHeaders,
598
+ search: this.searchValue,
599
+ searchProp: this.searchProp,
600
+ pageSize: this.intPageSize
601
+ }).pipe(map((val) => {
602
+ return val ?? [];
603
+ }), switchMap((val) => this.multiMapper.mapOptions(val)), switchMap((val) => {
604
+ let result = [];
605
+ if (!val) {
606
+ result = [];
607
+ }
608
+ else if (this.listProp.length > 0) {
609
+ result = [...(val[this.listProp] ?? [])];
610
+ }
611
+ else {
612
+ result = [...val];
613
+ }
614
+ if (result.length === 0) {
615
+ this.shouldLoadMore = false;
616
+ this.isLoading = false;
617
+ return of([]);
618
+ }
619
+ else {
620
+ const newOptions = [];
621
+ for (const opt of result) {
622
+ const newOption = this.mapper.mapOption(opt);
623
+ newOptions.push(newOption);
624
+ }
625
+ return forkJoin(newOptions);
626
+ }
627
+ }), switchMap((finVal) => {
628
+ this.selectableOptions.push(...finVal);
629
+ return this.updateOrderedOptions(this.selectableOptions);
630
+ }), map((val) => {
631
+ this.isLoading = false;
632
+ this.trigger.openMenu();
633
+ this.setSelectionContainerSize();
634
+ return val;
635
+ }), tap(() => {
636
+ this.changeDetectorRef.markForCheck();
637
+ }));
638
+ }
639
+ onScrolled(e) {
640
+ if (e.target.scrollTop + 220 + ((this.searchInput ? 0 : 1) * 40) === this.selectionContainer.nativeElement.offsetHeight
641
+ && !this.isLoading) {
642
+ this.scrollEnd.emit();
643
+ if (this.url && this.url.length > 0 && !this.ignorePagination && this.shouldLoadMore) {
644
+ this.getList().subscribe(noop);
645
+ }
646
+ }
647
+ }
648
+ onMenuOpened() {
649
+ this.jvxMultiselectOpened.emit();
650
+ }
651
+ onMenuClosed() {
652
+ if ((!this.url || this.url.length === 0) && this.searchMode === 'client') {
653
+ this.searchValueSubject.next('');
654
+ }
655
+ else {
656
+ this.searchValue = '';
657
+ this.currentPage = 0;
658
+ }
659
+ this.jvxMultiselectClosed.emit();
660
+ this.changeDetectorRef.markForCheck();
661
+ }
662
+ onSearchInputClick(e) {
663
+ e.stopPropagation();
664
+ }
665
+ onSearchValueChange(e) {
666
+ this.searchValueSubject.next(e.target.value);
667
+ }
668
+ clear(e) {
669
+ e.stopPropagation();
670
+ e.preventDefault();
671
+ this.value = [];
672
+ this.form.get('selectionValue').setValue(this.value.map(v => v[this.itemValue]));
673
+ this.propagateChange(this.value);
674
+ this.valueChange.emit(this.value);
675
+ this.changeDetectorRef.markForCheck();
676
+ }
677
+ setDescribedByIds(ids) {
678
+ const controlElement = this.elementRef.nativeElement
679
+ .querySelector('.ng-jvx-multiselect');
680
+ controlElement.setAttribute('aria-describedby', ids.join(' '));
681
+ }
682
+ onContainerClick(event) {
683
+ // if ((event.target as Element).tagName.toLowerCase() !== 'input') {
684
+ // this.elementRef.nativeElement.querySelector('input').focus();
685
+ // }
686
+ }
687
+ get stateChange$() {
688
+ return this.stateChanges.asObservable();
689
+ }
690
+ updateOrderedOptions(options) {
691
+ let obs = of(options);
692
+ if (this.groupBy) {
693
+ this.orderedOptions.length = 0;
694
+ const obsArr = [];
695
+ for (const option of options) {
696
+ if (typeof this.groupBy !== 'string') {
697
+ obsArr.push(this.groupBy.mapGroup(option));
698
+ }
699
+ else {
700
+ obsArr.push(of({ group: option[this.groupBy], option }));
701
+ }
702
+ }
703
+ obs = forkJoin(obsArr).pipe(map((res) => {
704
+ const groups = [...new Set(res.map(item => item.group))];
705
+ for (const group of groups) {
706
+ this.orderedOptions.push({
707
+ group,
708
+ options: res.filter(r => r.group === group).map(o => o.option)
709
+ });
710
+ }
711
+ return this.orderedOptions;
712
+ }));
713
+ }
714
+ return obs;
715
+ }
716
+ closeMenu() {
717
+ this.trigger.closeMenu();
718
+ }
719
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectComponent, deps: [{ token: i1$1.UntypedFormBuilder }, { token: NgJvxMultiselectService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$1.NgControl, optional: true, self: true }, { token: i1$1.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
720
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: NgJvxMultiselectComponent, selector: "ng-jvx-multiselect", inputs: { options: "options", multi: "multi", url: "url", requestType: "requestType", itemValue: "itemValue", itemText: "itemText", ignorePagination: "ignorePagination", clearable: "clearable", closeOnClick: "closeOnClick", hasErrors: "hasErrors", searchMode: "searchMode", searchInput: "searchInput", searchLabel: "searchLabel", listProp: "listProp", totalRowsProp: "totalRowsProp", panelClass: "panelClass", searchProp: "searchProp", closeButton: "closeButton", mapper: "mapper", multiMapper: "multiMapper", searchMapper: "searchMapper", groupBy: "groupBy", value: "value", requestHeaders: "requestHeaders", required: "required", disabled: "disabled", pageSize: "pageSize" }, outputs: { valueChange: "valueChange", jvxMultiselectOpen: "jvxMultiselectOpen", jvxMultiselectOpened: "jvxMultiselectOpened", jvxMultiselectClose: "jvxMultiselectClose", jvxMultiselectClosed: "jvxMultiselectClosed", scrollEnd: "scrollEnd" }, host: { properties: { "id": "this.id", "class.floating": "this.shouldLabelFloat" } }, providers: [
721
+ {
722
+ provide: MatFormFieldControl,
723
+ useExisting: forwardRef(() => NgJvxMultiselectComponent),
724
+ multi: true,
725
+ }
726
+ ], queries: [{ propertyName: "optionsTemplate", first: true, predicate: NgJvxOptionsTemplateDirective, descendants: true }, { propertyName: "selectionTemplate", first: true, predicate: NgJvxSelectionTemplateDirective, descendants: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: NgJvxGroupHeaderDirective, descendants: true }], viewQueries: [{ propertyName: "jvxMultiselect", first: true, predicate: ["jvxMultiselect"], descendants: true, static: true }, { propertyName: "selectionContainer", first: true, predicate: ["selectionContainer"], descendants: true }, { propertyName: "selection", first: true, predicate: ["selection"], descendants: true, static: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, static: true }, { propertyName: "scrollbar", first: true, predicate: ["scrollbar"], descendants: true }, { propertyName: "multiContainer", first: true, predicate: ["multiContainer"], descendants: true }, { propertyName: "optionComp", predicate: NgJvxOptionComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"ng-jvx-multiselect\" [ngClass]=\"{'disabled': disabled, 'has-errors': hasErrors}\" #jvxMultiselect>\r\n <!-- START MENU -->\r\n <div [matMenuTriggerFor]=\"menuRef\" (onMenuOpen)=\"onMenuOpen()\" (menuOpened)=\"onMenuOpened()\"\r\n (onMenuClose)=\"onMenuClose()\" (menuClosed)=\"onMenuClosed()\"\r\n #trigger=\"matMenuTrigger\">\r\n <mat-menu #menuRef=\"matMenu\" [class]=\"['jvx-multiselect-panel', panelClass].join(' ')\" [formGroup]=\"form\"\r\n [yPosition]=\"yPosition\">\r\n <div *ngIf=\"closeButton\" class=\"closeMenuButton\">\r\n <mat-icon>close</mat-icon>\r\n </div>\r\n <div class=\"menu-list-container\"\r\n #menuLIstContainer\r\n [ngStyle]=\"{'overflow-y': 'hidden', 'width': listContainerSize.width, 'max-height': '260px', 'height': listContainerSize.height, 'min-height': listContainerSize.minHeight}\">\r\n\r\n <div class=\"search-input-container\" *ngIf=\"!!searchInput\" (click)=\"onSearchInputClick($event)\">\r\n <input type=\"text\" [placeholder]=\"searchLabel\" [ngModel]=\"searchValue\" [ngModelOptions]=\"{standalone: true}\"\r\n [ngJvxFocus]=\"isOpen\"\r\n (input)=\"onSearchValueChange($event)\"/>\r\n </div>\r\n <div\r\n [ngStyle]=\"{height: searchInput && selectionContainer.clientHeight > 220 || selectionContainer.clientHeight > 260? 260 - (searchInput? 40 : 0) + 'px': 'auto'}\">\r\n <ng-scrollbar style=\"width: 100%\"\r\n smoothScroll\r\n [visibility]=\"'hover'\"\r\n [appearance]=\"'compact'\"\r\n [sensorDisabled]=\"isLoading\"\r\n [autoHeightDisabled]=\"false\" #scrollbar>\r\n <div #selectionContainer (click)=\"onCLickOnMenu($event)\">\r\n <mat-selection-list #selection [multiple]=\"multi\"\r\n *ngIf=\"showList\"\r\n [ngStyle]=\"{'padding': 0, 'width': listContainerSize.width, 'min-width.px': 112}\"\r\n (selectionChange)=\"onChange($event)\"\r\n ngDefaultControl\r\n formControlName=\"selectionValue\">\r\n <ng-content></ng-content>\r\n <ng-container *ngIf=\"!!groupBy\">\r\n <ng-container *ngFor=\"let opt of orderedOptions\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"groupHeaderTemplate? groupHeaderTemplate.template: defaultGroupHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: opt}\"></ng-container>\r\n\r\n <ng-jvx-option *ngFor=\"let option of opt.options\" [value]=\"option[itemValue]\">\r\n <!-- <ng-container [ngTemplateOutlet]=\"optionsTemplate\" [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>-->\r\n <div class=\"ng-jvx-option-wrapper\">\r\n <ng-container [ngTemplateOutlet]=\"optionsTemplate? optionsTemplate.template : defaultTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>\r\n </div>\r\n </ng-jvx-option>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!groupBy || groupBy.length === 0\">\r\n <ng-jvx-option *ngFor=\"let option of selectableOptions\" [value]=\"option[itemValue]\">\r\n <div class=\"ng-jvx-option-wrapper\">\r\n <!-- <ng-container [ngTemplateOutlet]=\"optionsTemplate\" [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>-->\r\n <ng-container [ngTemplateOutlet]=\"optionsTemplate? optionsTemplate.template : defaultTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>\r\n </div>\r\n </ng-jvx-option>\r\n </ng-container>\r\n </mat-selection-list>\r\n </div>\r\n </ng-scrollbar>\r\n </div>\r\n\r\n </div>\r\n <div class=\"menu-footer\">\r\n <ng-content select=\"[ng-jvx-footer]\"></ng-content>\r\n </div>\r\n\r\n </mat-menu>\r\n </div>\r\n <!-- END MENU -->\r\n <!-- START INPUT -->\r\n <div [ngClass]=\"{'ng-jvx-multiselect-value-container': true, 'is-open': isOpen}\"\r\n (click)=\"clickOnMenuTrigger($event)\"\r\n #valueContainer>\r\n\r\n <div class=\"ng-jvx-multiselect__placeholder\" *ngIf=\"value.length === 0\">\r\n <ng-content select=\"[placeholder]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"ng-jvx-multiselect-value multi-value-container\" *ngIf=\"multi\" #multiContainer>\r\n\r\n <ng-container [ngTemplateOutlet]=\"selectionTemplate? selectionTemplate.template : defaultMultiSelectionTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: value}\"></ng-container>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"ng-jvx-multiselect-value single-value-container\" *ngIf=\"!multi\">\r\n <div *ngFor=\"let val of value\" style=\"width: 100%;\">\r\n <ng-container [ngTemplateOutlet]=\"selectionTemplate? selectionTemplate.template : defaultSelectionTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: val}\"></ng-container>\r\n </div>\r\n </div>\r\n <div class=\"ng-jvx-multiselect__remove-button\" *ngIf=\"clearable && value.length > 0\" (click)=\"clear($event)\">\r\n <mat-icon style=\"font-size: 18px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\">clear\r\n </mat-icon>\r\n </div>\r\n <div class=\"ng-jvx-multiselect-arrow\">\r\n <mat-icon *ngIf=\"!isLoading\">expand_more</mat-icon>\r\n <div *ngIf=\"isLoading\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- END INPUT -->\r\n</div>\r\n<ng-template #defaultTemplate let-option>\r\n <div style=\"max-width: 100%;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\">{{option[itemText]}}\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #defaultSelectionTemplate let-value>\r\n {{value[itemText]}}\r\n</ng-template>\r\n\r\n<ng-template #defaultMultiSelectionTemplate let-value>\r\n <mat-chip-listbox #chipList [disabled]=\"this.disabled\">\r\n <mat-chip-option [color]=\"'primary'\" selected *ngFor=\"let val of value\" [selectable]=\"false\"\r\n class=\"ng-jvx-multiselect-chip\"\r\n [removable]=\"true\" (removed)=\"deselect(val)\">\r\n <span class=\"chip-content\"\r\n [ngStyle]=\"{'max-width': multiContainerWidth - 50 +'px'}\">{{val[itemText]}}</span>\r\n\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip-option>\r\n </mat-chip-listbox>\r\n</ng-template>\r\n<ng-template #defaultGroupHeaderTemplate let-opt>\r\n <div style=\"padding-inline: 15px\"><strong>{{opt.group}}</strong></div>\r\n</ng-template>\r\n", styles: ["ng-jvx-multiselect{display:flex;align-items:center;width:100%}ng-jvx-multiselect .ng-jvx-multiselect{width:100%;display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container{width:100%;display:flex;cursor:pointer;position:relative;justify-content:space-between;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect__placeholder{height:100%;display:flex;align-items:center;position:absolute}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value{flex:1 1 100%;max-width:calc(100% - 28px);display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value .mat-chip-list-wrapper .mat-mdc-standard-chip{padding:0 5px 0 7px;margin:4px 5px 0}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value .mat-chip-list-wrapper .mat-mdc-standard-chip .chip-content{margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect__remove-button{display:flex;height:100%;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow{width:24px;padding-right:4px;display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow mat-icon{transition:transform .3s ease-in-out}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring{display:inline-block;position:relative;width:24px;height:24px}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div{box-sizing:border-box;display:block;position:absolute;width:6px;height:16px;margin:4px;border:2px solid;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--jvx-multiselect-accent) transparent transparent transparent}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(1){animation-delay:-.45s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(2){animation-delay:-.3s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(3){animation-delay:-.15s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container.is-open .ng-jvx-multiselect-arrow mat-icon{transform:rotate(180deg)}ng-jvx-multiselect .ng-jvx-multiselect.disabled{pointer-events:none}ng-jvx-multiselect .ng-jvx-multiselect.disabled .ng-jvx-multiselect-arrow mat-icon{opacity:.3}ng-jvx-multiselect .ng-jvx-multiselect.has-errors{color:red}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-value.single-value-container{color:red}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-value.multi-value-container{width:100%}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-arrow mat-icon{color:red}.mat-select-test{width:250px}.menu-list-container{max-height:300px;display:flex;flex-direction:column}.menu-footer{max-height:30px;overflow:hidden}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel{min-width:100%;max-width:100%;position:relative;overflow:visible}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .closeMenuButton{height:22px;width:22px;background-color:var(--jvx-multiselect-primary);position:absolute;top:-11px;right:11px;border-radius:100%;cursor:pointer;color:#fff;z-index:10}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .closeMenuButton mat-icon{color:#fff;font-size:15px;height:100%;width:100%;display:flex;align-items:center;justify-content:center}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content{padding-top:0!important;padding-bottom:0!important}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .menu-list-container ng-scrollbar{--scrollbar-color: transparent;--scrollbar-container-color: transparent;--scrollbar-thumb-color: var(--jvx-multiselect-accent);--scrollbar-thumb-hover-color: var(--jvx-multiselect-accent);--scrollbar-border-radius: 4px;--scrollbar-size: 6px;--scrollbar-padding: 8px;--scroll-view-margin: 0;--scroll-view-color: transparent}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container{height:40px;display:flex;align-items:center;padding:10px}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input{width:100%;outline:none;border:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input:focus{outline:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input:active{outline:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list{padding-top:0!important;padding-bottom:0!important}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=true] .ng-jvx-option-wrapper,.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=false] .ng-jvx-option-wrapper{padding-inline:10px}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=true] .mdc-list-item__end,.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=false] .mdc-list-item__end{display:none}\n"], dependencies: [{ kind: "component", type: i3.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i7.MatChipListbox, selector: "mat-chip-listbox", inputs: ["tabIndex", "multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i7.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i7.MatChipRemove, selector: "[matChipRemove]" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "directive", type: i9.SmoothScroll, selector: "[smoothScroll], [smooth-scroll]", exportAs: ["smoothScroll"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: NgJvxOptionComponent, selector: "ng-jvx-option", inputs: ["value"] }, { kind: "directive", type: NgJvxFocusDirective, selector: "[ngJvxFocus]", inputs: ["ngJvxFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
727
+ }
728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectComponent, decorators: [{
729
+ type: Component,
730
+ args: [{ selector: 'ng-jvx-multiselect', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
731
+ {
732
+ provide: MatFormFieldControl,
733
+ useExisting: forwardRef(() => NgJvxMultiselectComponent),
734
+ multi: true,
735
+ }
736
+ ], template: "<div class=\"ng-jvx-multiselect\" [ngClass]=\"{'disabled': disabled, 'has-errors': hasErrors}\" #jvxMultiselect>\r\n <!-- START MENU -->\r\n <div [matMenuTriggerFor]=\"menuRef\" (onMenuOpen)=\"onMenuOpen()\" (menuOpened)=\"onMenuOpened()\"\r\n (onMenuClose)=\"onMenuClose()\" (menuClosed)=\"onMenuClosed()\"\r\n #trigger=\"matMenuTrigger\">\r\n <mat-menu #menuRef=\"matMenu\" [class]=\"['jvx-multiselect-panel', panelClass].join(' ')\" [formGroup]=\"form\"\r\n [yPosition]=\"yPosition\">\r\n <div *ngIf=\"closeButton\" class=\"closeMenuButton\">\r\n <mat-icon>close</mat-icon>\r\n </div>\r\n <div class=\"menu-list-container\"\r\n #menuLIstContainer\r\n [ngStyle]=\"{'overflow-y': 'hidden', 'width': listContainerSize.width, 'max-height': '260px', 'height': listContainerSize.height, 'min-height': listContainerSize.minHeight}\">\r\n\r\n <div class=\"search-input-container\" *ngIf=\"!!searchInput\" (click)=\"onSearchInputClick($event)\">\r\n <input type=\"text\" [placeholder]=\"searchLabel\" [ngModel]=\"searchValue\" [ngModelOptions]=\"{standalone: true}\"\r\n [ngJvxFocus]=\"isOpen\"\r\n (input)=\"onSearchValueChange($event)\"/>\r\n </div>\r\n <div\r\n [ngStyle]=\"{height: searchInput && selectionContainer.clientHeight > 220 || selectionContainer.clientHeight > 260? 260 - (searchInput? 40 : 0) + 'px': 'auto'}\">\r\n <ng-scrollbar style=\"width: 100%\"\r\n smoothScroll\r\n [visibility]=\"'hover'\"\r\n [appearance]=\"'compact'\"\r\n [sensorDisabled]=\"isLoading\"\r\n [autoHeightDisabled]=\"false\" #scrollbar>\r\n <div #selectionContainer (click)=\"onCLickOnMenu($event)\">\r\n <mat-selection-list #selection [multiple]=\"multi\"\r\n *ngIf=\"showList\"\r\n [ngStyle]=\"{'padding': 0, 'width': listContainerSize.width, 'min-width.px': 112}\"\r\n (selectionChange)=\"onChange($event)\"\r\n ngDefaultControl\r\n formControlName=\"selectionValue\">\r\n <ng-content></ng-content>\r\n <ng-container *ngIf=\"!!groupBy\">\r\n <ng-container *ngFor=\"let opt of orderedOptions\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"groupHeaderTemplate? groupHeaderTemplate.template: defaultGroupHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: opt}\"></ng-container>\r\n\r\n <ng-jvx-option *ngFor=\"let option of opt.options\" [value]=\"option[itemValue]\">\r\n <!-- <ng-container [ngTemplateOutlet]=\"optionsTemplate\" [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>-->\r\n <div class=\"ng-jvx-option-wrapper\">\r\n <ng-container [ngTemplateOutlet]=\"optionsTemplate? optionsTemplate.template : defaultTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>\r\n </div>\r\n </ng-jvx-option>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!groupBy || groupBy.length === 0\">\r\n <ng-jvx-option *ngFor=\"let option of selectableOptions\" [value]=\"option[itemValue]\">\r\n <div class=\"ng-jvx-option-wrapper\">\r\n <!-- <ng-container [ngTemplateOutlet]=\"optionsTemplate\" [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>-->\r\n <ng-container [ngTemplateOutlet]=\"optionsTemplate? optionsTemplate.template : defaultTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: option}\"></ng-container>\r\n </div>\r\n </ng-jvx-option>\r\n </ng-container>\r\n </mat-selection-list>\r\n </div>\r\n </ng-scrollbar>\r\n </div>\r\n\r\n </div>\r\n <div class=\"menu-footer\">\r\n <ng-content select=\"[ng-jvx-footer]\"></ng-content>\r\n </div>\r\n\r\n </mat-menu>\r\n </div>\r\n <!-- END MENU -->\r\n <!-- START INPUT -->\r\n <div [ngClass]=\"{'ng-jvx-multiselect-value-container': true, 'is-open': isOpen}\"\r\n (click)=\"clickOnMenuTrigger($event)\"\r\n #valueContainer>\r\n\r\n <div class=\"ng-jvx-multiselect__placeholder\" *ngIf=\"value.length === 0\">\r\n <ng-content select=\"[placeholder]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"ng-jvx-multiselect-value multi-value-container\" *ngIf=\"multi\" #multiContainer>\r\n\r\n <ng-container [ngTemplateOutlet]=\"selectionTemplate? selectionTemplate.template : defaultMultiSelectionTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: value}\"></ng-container>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"ng-jvx-multiselect-value single-value-container\" *ngIf=\"!multi\">\r\n <div *ngFor=\"let val of value\" style=\"width: 100%;\">\r\n <ng-container [ngTemplateOutlet]=\"selectionTemplate? selectionTemplate.template : defaultSelectionTemplate\"\r\n [ngTemplateOutletContext]=\"{$implicit: val}\"></ng-container>\r\n </div>\r\n </div>\r\n <div class=\"ng-jvx-multiselect__remove-button\" *ngIf=\"clearable && value.length > 0\" (click)=\"clear($event)\">\r\n <mat-icon style=\"font-size: 18px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\">clear\r\n </mat-icon>\r\n </div>\r\n <div class=\"ng-jvx-multiselect-arrow\">\r\n <mat-icon *ngIf=\"!isLoading\">expand_more</mat-icon>\r\n <div *ngIf=\"isLoading\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- END INPUT -->\r\n</div>\r\n<ng-template #defaultTemplate let-option>\r\n <div style=\"max-width: 100%;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\">{{option[itemText]}}\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #defaultSelectionTemplate let-value>\r\n {{value[itemText]}}\r\n</ng-template>\r\n\r\n<ng-template #defaultMultiSelectionTemplate let-value>\r\n <mat-chip-listbox #chipList [disabled]=\"this.disabled\">\r\n <mat-chip-option [color]=\"'primary'\" selected *ngFor=\"let val of value\" [selectable]=\"false\"\r\n class=\"ng-jvx-multiselect-chip\"\r\n [removable]=\"true\" (removed)=\"deselect(val)\">\r\n <span class=\"chip-content\"\r\n [ngStyle]=\"{'max-width': multiContainerWidth - 50 +'px'}\">{{val[itemText]}}</span>\r\n\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </mat-chip-option>\r\n </mat-chip-listbox>\r\n</ng-template>\r\n<ng-template #defaultGroupHeaderTemplate let-opt>\r\n <div style=\"padding-inline: 15px\"><strong>{{opt.group}}</strong></div>\r\n</ng-template>\r\n", styles: ["ng-jvx-multiselect{display:flex;align-items:center;width:100%}ng-jvx-multiselect .ng-jvx-multiselect{width:100%;display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container{width:100%;display:flex;cursor:pointer;position:relative;justify-content:space-between;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect__placeholder{height:100%;display:flex;align-items:center;position:absolute}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value{flex:1 1 100%;max-width:calc(100% - 28px);display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value .mat-chip-list-wrapper .mat-mdc-standard-chip{padding:0 5px 0 7px;margin:4px 5px 0}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-value .mat-chip-list-wrapper .mat-mdc-standard-chip .chip-content{margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect__remove-button{display:flex;height:100%;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow{width:24px;padding-right:4px;display:flex;align-items:center}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow mat-icon{transition:transform .3s ease-in-out}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring{display:inline-block;position:relative;width:24px;height:24px}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div{box-sizing:border-box;display:block;position:absolute;width:6px;height:16px;margin:4px;border:2px solid;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--jvx-multiselect-accent) transparent transparent transparent}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(1){animation-delay:-.45s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(2){animation-delay:-.3s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container .ng-jvx-multiselect-arrow .lds-ring div:nth-child(3){animation-delay:-.15s}ng-jvx-multiselect .ng-jvx-multiselect .ng-jvx-multiselect-value-container.is-open .ng-jvx-multiselect-arrow mat-icon{transform:rotate(180deg)}ng-jvx-multiselect .ng-jvx-multiselect.disabled{pointer-events:none}ng-jvx-multiselect .ng-jvx-multiselect.disabled .ng-jvx-multiselect-arrow mat-icon{opacity:.3}ng-jvx-multiselect .ng-jvx-multiselect.has-errors{color:red}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-value.single-value-container{color:red}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-value.multi-value-container{width:100%}ng-jvx-multiselect .ng-jvx-multiselect.has-errors .ng-jvx-multiselect-arrow mat-icon{color:red}.mat-select-test{width:250px}.menu-list-container{max-height:300px;display:flex;flex-direction:column}.menu-footer{max-height:30px;overflow:hidden}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel{min-width:100%;max-width:100%;position:relative;overflow:visible}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .closeMenuButton{height:22px;width:22px;background-color:var(--jvx-multiselect-primary);position:absolute;top:-11px;right:11px;border-radius:100%;cursor:pointer;color:#fff;z-index:10}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .closeMenuButton mat-icon{color:#fff;font-size:15px;height:100%;width:100%;display:flex;align-items:center;justify-content:center}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content{padding-top:0!important;padding-bottom:0!important}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .menu-list-container ng-scrollbar{--scrollbar-color: transparent;--scrollbar-container-color: transparent;--scrollbar-thumb-color: var(--jvx-multiselect-accent);--scrollbar-thumb-hover-color: var(--jvx-multiselect-accent);--scrollbar-border-radius: 4px;--scrollbar-size: 6px;--scrollbar-padding: 8px;--scroll-view-margin: 0;--scroll-view-color: transparent}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container{height:40px;display:flex;align-items:center;padding:10px}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input{width:100%;outline:none;border:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input:focus{outline:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .search-input-container input:active{outline:none}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list{padding-top:0!important;padding-bottom:0!important}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=true] .ng-jvx-option-wrapper,.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=false] .ng-jvx-option-wrapper{padding-inline:10px}.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=true] .mdc-list-item__end,.cdk-overlay-pane .mat-mdc-menu-panel.jvx-multiselect-panel .mat-mdc-menu-content .mat-mdc-selection-list .mat-mdc-list-option[aria-selected=false] .mdc-list-item__end{display:none}\n"] }]
737
+ }], ctorParameters: () => [{ type: i1$1.UntypedFormBuilder }, { type: NgJvxMultiselectService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$1.NgControl, decorators: [{
738
+ type: Optional
739
+ }, {
740
+ type: Self
741
+ }] }, { type: i1$1.UntypedFormBuilder }], propDecorators: { id: [{
742
+ type: HostBinding
743
+ }], shouldLabelFloat: [{
744
+ type: HostBinding,
745
+ args: ['class.floating']
746
+ }], jvxMultiselect: [{
747
+ type: ViewChild,
748
+ args: ['jvxMultiselect', { static: true }]
749
+ }], selectionContainer: [{
750
+ type: ViewChild,
751
+ args: ['selectionContainer', { static: false }]
752
+ }], selection: [{
753
+ type: ViewChild,
754
+ args: ['selection', { static: true }]
755
+ }], trigger: [{
756
+ type: ViewChild,
757
+ args: ['trigger', { static: true }]
758
+ }], scrollbar: [{
759
+ type: ViewChild,
760
+ args: ['scrollbar', { static: false }]
761
+ }], multiContainer: [{
762
+ type: ViewChild,
763
+ args: ['multiContainer', { static: false }]
764
+ }], optionComp: [{
765
+ type: ViewChildren,
766
+ args: [NgJvxOptionComponent]
767
+ }], optionsTemplate: [{
768
+ type: ContentChild,
769
+ args: [NgJvxOptionsTemplateDirective]
770
+ }], selectionTemplate: [{
771
+ type: ContentChild,
772
+ args: [NgJvxSelectionTemplateDirective]
773
+ }], groupHeaderTemplate: [{
774
+ type: ContentChild,
775
+ args: [NgJvxGroupHeaderDirective]
776
+ }], options: [{
777
+ type: Input
778
+ }], multi: [{
779
+ type: Input
780
+ }], url: [{
781
+ type: Input
782
+ }], requestType: [{
783
+ type: Input
784
+ }], itemValue: [{
785
+ type: Input
786
+ }], itemText: [{
787
+ type: Input
788
+ }], ignorePagination: [{
789
+ type: Input
790
+ }], clearable: [{
791
+ type: Input
792
+ }], closeOnClick: [{
793
+ type: Input
794
+ }], hasErrors: [{
795
+ type: Input
796
+ }], searchMode: [{
797
+ type: Input
798
+ }], searchInput: [{
799
+ type: Input
800
+ }], searchLabel: [{
801
+ type: Input
802
+ }], listProp: [{
803
+ type: Input
804
+ }], totalRowsProp: [{
805
+ type: Input
806
+ }], panelClass: [{
807
+ type: Input
808
+ }], searchProp: [{
809
+ type: Input
810
+ }], closeButton: [{
811
+ type: Input
812
+ }], mapper: [{
813
+ type: Input
814
+ }], multiMapper: [{
815
+ type: Input
816
+ }], searchMapper: [{
817
+ type: Input
818
+ }], groupBy: [{
819
+ type: Input
820
+ }], value: [{
821
+ type: Input
822
+ }], requestHeaders: [{
823
+ type: Input
824
+ }], required: [{
825
+ type: Input
826
+ }], disabled: [{
827
+ type: Input
828
+ }], pageSize: [{
829
+ type: Input
830
+ }], valueChange: [{
831
+ type: Output
832
+ }], jvxMultiselectOpen: [{
833
+ type: Output
834
+ }], jvxMultiselectOpened: [{
835
+ type: Output
836
+ }], jvxMultiselectClose: [{
837
+ type: Output
838
+ }], jvxMultiselectClosed: [{
839
+ type: Output
840
+ }], scrollEnd: [{
841
+ type: Output
842
842
  }] } });
843
843
 
844
- /**
845
- * @license
846
- * Copyright Google LLC All Rights Reserved.
847
- *
848
- * Use of this source code is governed by an MIT-style license that can be
849
- * found in the LICENSE file at https://angular.io/license
850
- */
851
- /** @docs-public MatMenu */
852
- class NgJvxPanelComponent extends _MatMenuBase {
853
- constructor(elementRef, ngZone, defaultOptions) {
854
- super(elementRef, ngZone, defaultOptions);
855
- }
856
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxPanelComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: MAT_MENU_DEFAULT_OPTIONS }], target: i0.ɵɵFactoryTarget.Component }); }
857
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.2", type: NgJvxPanelComponent, selector: "ngJvxPanel", host: { properties: { "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null" } }, providers: [
858
- { provide: MAT_MENU_PANEL, useExisting: MatMenu },
859
- ], exportAs: ["ngJvxPanel"], usesInheritance: true, ngImport: i0, template: "<ng-template>\r\n <div\r\n class=\"mat-menu-panel\"\r\n [id]=\"panelId\"\r\n [ngClass]=\"_classList\"\r\n (keydown)=\"_handleKeydown($event)\"\r\n (click)=\"closed.emit('click')\"\r\n [@transformMenu]=\"_panelAnimationState\"\r\n (@transformMenu.start)=\"_onAnimationStart($event)\"\r\n (@transformMenu.done)=\"_onAnimationDone($event)\"\r\n tabindex=\"-1\"\r\n role=\"menu\"\r\n [attr.aria-label]=\"ariaLabel || null\"\r\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\r\n [attr.aria-describedby]=\"ariaDescribedby || null\">\r\n <div class=\"mat-menu-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [
860
- matMenuAnimations.transformMenu,
861
- matMenuAnimations.fadeInItems
862
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
863
- }
864
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxPanelComponent, decorators: [{
865
- type: Component,
866
- args: [{ selector: 'ngJvxPanel', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'ngJvxPanel', host: {
867
- '[attr.aria-label]': 'null',
868
- '[attr.aria-labelledby]': 'null',
869
- '[attr.aria-describedby]': 'null',
870
- }, animations: [
871
- matMenuAnimations.transformMenu,
872
- matMenuAnimations.fadeInItems
873
- ], providers: [
874
- { provide: MAT_MENU_PANEL, useExisting: MatMenu },
875
- ], template: "<ng-template>\r\n <div\r\n class=\"mat-menu-panel\"\r\n [id]=\"panelId\"\r\n [ngClass]=\"_classList\"\r\n (keydown)=\"_handleKeydown($event)\"\r\n (click)=\"closed.emit('click')\"\r\n [@transformMenu]=\"_panelAnimationState\"\r\n (@transformMenu.start)=\"_onAnimationStart($event)\"\r\n (@transformMenu.done)=\"_onAnimationDone($event)\"\r\n tabindex=\"-1\"\r\n role=\"menu\"\r\n [attr.aria-label]=\"ariaLabel || null\"\r\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\r\n [attr.aria-describedby]=\"ariaDescribedby || null\">\r\n <div class=\"mat-menu-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</ng-template>\r\n" }]
876
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
877
- type: Inject,
878
- args: [MAT_MENU_DEFAULT_OPTIONS]
879
- }] }]; } });
880
-
881
- class NgJvxMultiselectModule {
882
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
883
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectModule, declarations: [NgJvxMultiselectComponent,
884
- NgJvxOptionComponent,
885
- NgJvxOptionsTemplateDirective,
886
- NgJvxPanelComponent,
887
- NgJvxSelectionTemplateDirective,
888
- NgJvxDisabledOptionDirective,
889
- NgJvxGroupHeaderDirective,
890
- NgJvxFocusDirective], imports: [MatButtonModule,
891
- MatOptionModule,
892
- MatSelectModule,
893
- MatMenuModule,
894
- CommonModule,
895
- MatIconModule,
896
- MatListModule,
897
- MatChipsModule,
898
- ReactiveFormsModule,
899
- NgScrollbarModule,
900
- SmoothScrollModule,
901
- FormsModule], exports: [NgJvxMultiselectComponent,
902
- NgJvxOptionComponent,
903
- NgJvxOptionsTemplateDirective,
904
- NgJvxSelectionTemplateDirective,
905
- NgJvxDisabledOptionDirective,
906
- NgJvxGroupHeaderDirective] }); }
907
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectModule, imports: [MatButtonModule,
908
- MatOptionModule,
909
- MatSelectModule,
910
- MatMenuModule,
911
- CommonModule,
912
- MatIconModule,
913
- MatListModule,
914
- MatChipsModule,
915
- ReactiveFormsModule,
916
- NgScrollbarModule,
917
- SmoothScrollModule,
918
- FormsModule] }); }
919
- }
920
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: NgJvxMultiselectModule, decorators: [{
921
- type: NgModule,
922
- args: [{
923
- declarations: [
924
- NgJvxMultiselectComponent,
925
- NgJvxOptionComponent,
926
- NgJvxOptionsTemplateDirective,
927
- NgJvxPanelComponent,
928
- NgJvxSelectionTemplateDirective,
929
- NgJvxDisabledOptionDirective,
930
- NgJvxGroupHeaderDirective,
931
- NgJvxFocusDirective
932
- ],
933
- imports: [
934
- MatButtonModule,
935
- MatOptionModule,
936
- MatSelectModule,
937
- MatMenuModule,
938
- CommonModule,
939
- MatIconModule,
940
- MatListModule,
941
- MatChipsModule,
942
- ReactiveFormsModule,
943
- NgScrollbarModule,
944
- SmoothScrollModule,
945
- FormsModule
946
- ],
947
- exports: [NgJvxMultiselectComponent,
948
- NgJvxOptionComponent,
949
- NgJvxOptionsTemplateDirective,
950
- NgJvxSelectionTemplateDirective,
951
- NgJvxDisabledOptionDirective,
952
- NgJvxGroupHeaderDirective]
953
- }]
844
+ class NgJvxMultiselectModule {
845
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
846
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectModule, declarations: [NgJvxMultiselectComponent,
847
+ NgJvxOptionComponent,
848
+ NgJvxOptionsTemplateDirective,
849
+ NgJvxSelectionTemplateDirective,
850
+ NgJvxDisabledOptionDirective,
851
+ NgJvxGroupHeaderDirective,
852
+ NgJvxFocusDirective], imports: [MatButtonModule,
853
+ MatOptionModule,
854
+ MatSelectModule,
855
+ MatMenuModule,
856
+ CommonModule,
857
+ MatIconModule,
858
+ MatListModule,
859
+ MatChipsModule,
860
+ ReactiveFormsModule,
861
+ NgScrollbarModule,
862
+ SmoothScroll,
863
+ FormsModule], exports: [NgJvxMultiselectComponent,
864
+ NgJvxOptionComponent,
865
+ NgJvxOptionsTemplateDirective,
866
+ NgJvxSelectionTemplateDirective,
867
+ NgJvxDisabledOptionDirective,
868
+ NgJvxGroupHeaderDirective] }); }
869
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectModule, imports: [MatButtonModule,
870
+ MatOptionModule,
871
+ MatSelectModule,
872
+ MatMenuModule,
873
+ CommonModule,
874
+ MatIconModule,
875
+ MatListModule,
876
+ MatChipsModule,
877
+ ReactiveFormsModule,
878
+ NgScrollbarModule,
879
+ FormsModule] }); }
880
+ }
881
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgJvxMultiselectModule, decorators: [{
882
+ type: NgModule,
883
+ args: [{
884
+ declarations: [
885
+ NgJvxMultiselectComponent,
886
+ NgJvxOptionComponent,
887
+ NgJvxOptionsTemplateDirective,
888
+ NgJvxSelectionTemplateDirective,
889
+ NgJvxDisabledOptionDirective,
890
+ NgJvxGroupHeaderDirective,
891
+ NgJvxFocusDirective
892
+ ],
893
+ imports: [
894
+ MatButtonModule,
895
+ MatOptionModule,
896
+ MatSelectModule,
897
+ MatMenuModule,
898
+ CommonModule,
899
+ MatIconModule,
900
+ MatListModule,
901
+ MatChipsModule,
902
+ ReactiveFormsModule,
903
+ NgScrollbarModule,
904
+ SmoothScroll,
905
+ FormsModule
906
+ ],
907
+ exports: [NgJvxMultiselectComponent,
908
+ NgJvxOptionComponent,
909
+ NgJvxOptionsTemplateDirective,
910
+ NgJvxSelectionTemplateDirective,
911
+ NgJvxDisabledOptionDirective,
912
+ NgJvxGroupHeaderDirective]
913
+ }]
954
914
  }] });
955
915
 
956
- /*
957
- * Public API Surface of ng-jvx-multiselect
916
+ /*
917
+ * Public API Surface of ng-jvx-multiselect
958
918
  */
959
919
 
960
- /**
961
- * Generated bundle index. Do not edit.
920
+ /**
921
+ * Generated bundle index. Do not edit.
962
922
  */
963
923
 
964
924
  export { JVXMULTISELECT, NgJvxDisabledOptionDirective, NgJvxGroupHeaderDirective, NgJvxMultiselectComponent, NgJvxMultiselectModule, NgJvxMultiselectService, NgJvxOptionComponent, NgJvxOptionsTemplateDirective, NgJvxSelectionTemplateDirective, setJvxCall };