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