@acpaas-ui/ngx-forms 5.4.0 → 6.0.0-beta.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.
- package/README.md +0 -2
- package/esm2020/acpaas-ui-ngx-forms.mjs +5 -0
- package/esm2020/lib/auto-complete/auto-complete.module.mjs +25 -0
- package/esm2020/lib/auto-complete/components/auto-complete/auto-complete.component.mjs +370 -0
- package/esm2020/lib/auto-complete/public-api.mjs +3 -0
- package/esm2020/lib/datepicker/components/datepicker/datepicker.component.mjs +274 -0
- package/esm2020/lib/datepicker/datepicker.conf.mjs +9 -0
- package/esm2020/lib/datepicker/datepicker.module.mjs +55 -0
- package/esm2020/lib/datepicker/public-api.mjs +4 -0
- package/esm2020/lib/datepicker/types/datepicker.types.mjs +2 -0
- package/esm2020/lib/mask/directives/mask.directive.mjs +25 -0
- package/esm2020/lib/mask/mask.module.mjs +20 -0
- package/esm2020/lib/mask/public-api.mjs +3 -0
- package/esm2020/lib/range-slider/components/range-slider/range-slider.component.mjs +349 -0
- package/esm2020/lib/range-slider/public-api.mjs +3 -0
- package/esm2020/lib/range-slider/range-slider.module.mjs +20 -0
- package/esm2020/lib/range-slider/types/range-slider.types.mjs +2 -0
- package/esm2020/lib/search-filter/components/search-filter/search-filter.component.mjs +259 -0
- package/esm2020/lib/search-filter/public-api.mjs +3 -0
- package/esm2020/lib/search-filter/search-filter.module.mjs +22 -0
- package/esm2020/lib/search-filter/types/search-filter.types.mjs +2 -0
- package/esm2020/lib/shared/services/search.service.mjs +32 -0
- package/esm2020/lib/shared/types/search.types.mjs +2 -0
- package/esm2020/lib/timepicker/classes/timepicker.validators.mjs +49 -0
- package/esm2020/lib/timepicker/components/timepicker/timepicker.component.mjs +229 -0
- package/esm2020/lib/timepicker/public-api.mjs +5 -0
- package/esm2020/lib/timepicker/timepicker.module.mjs +22 -0
- package/esm2020/lib/timepicker/types/timepicker.types.mjs +7 -0
- package/esm2020/lib/upload/classes/uploader.class.mjs +112 -0
- package/esm2020/lib/upload/components/upload/upload.component.mjs +97 -0
- package/esm2020/lib/upload/components/upload-input/upload-input.component.mjs +56 -0
- package/esm2020/lib/upload/components/upload-queue/upload-queue.component.mjs +78 -0
- package/esm2020/lib/upload/components/upload-zone/upload-zone.component.mjs +252 -0
- package/esm2020/lib/upload/components/validation-list/validation-list.component.mjs +64 -0
- package/esm2020/lib/upload/public-api.mjs +10 -0
- package/esm2020/lib/upload/services/validation-messages.service.mjs +29 -0
- package/esm2020/lib/upload/types/upload.types.mjs +2 -0
- package/esm2020/lib/upload/upload.conf.mjs +12 -0
- package/esm2020/lib/upload/upload.module.mjs +45 -0
- package/esm2020/public-api.mjs +8 -0
- package/fesm2015/acpaas-ui-ngx-forms.mjs +2591 -0
- package/fesm2015/acpaas-ui-ngx-forms.mjs.map +1 -0
- package/fesm2020/acpaas-ui-ngx-forms.mjs +2402 -0
- package/fesm2020/acpaas-ui-ngx-forms.mjs.map +1 -0
- package/{acpaas-ui-ngx-forms.d.ts → index.d.ts} +1 -1
- package/lib/auto-complete/auto-complete.module.d.ts +10 -0
- package/lib/auto-complete/components/auto-complete/auto-complete.component.d.ts +5 -0
- package/lib/datepicker/components/datepicker/datepicker.component.d.ts +9 -4
- package/lib/datepicker/datepicker.module.d.ts +11 -1
- package/lib/datepicker/public-api.d.ts +1 -1
- package/lib/mask/directives/mask.directive.d.ts +3 -0
- package/lib/mask/mask.module.d.ts +6 -0
- package/lib/range-slider/components/range-slider/range-slider.component.d.ts +8 -2
- package/lib/range-slider/range-slider.module.d.ts +7 -0
- package/lib/search-filter/components/search-filter/search-filter.component.d.ts +10 -4
- package/lib/search-filter/search-filter.module.d.ts +9 -0
- package/lib/shared/services/search.service.d.ts +3 -0
- package/lib/timepicker/components/timepicker/timepicker.component.d.ts +9 -4
- package/lib/timepicker/timepicker.module.d.ts +8 -0
- package/lib/upload/components/upload/upload.component.d.ts +5 -0
- package/lib/upload/components/upload-input/upload-input.component.d.ts +3 -0
- package/lib/upload/components/upload-queue/upload-queue.component.d.ts +3 -0
- package/lib/upload/components/upload-zone/upload-zone.component.d.ts +7 -0
- package/lib/upload/components/validation-list/validation-list.component.d.ts +3 -0
- package/lib/upload/services/validation-messages.service.d.ts +3 -0
- package/lib/upload/upload.module.d.ts +14 -1
- package/package.json +37 -24
- package/public-api.d.ts +0 -1
- package/acpaas-ui-ngx-forms.metadata.json +0 -1
- package/bundles/acpaas-ui-ngx-forms.umd.js +0 -3862
- package/bundles/acpaas-ui-ngx-forms.umd.js.map +0 -1
- package/bundles/acpaas-ui-ngx-forms.umd.min.js +0 -2
- package/bundles/acpaas-ui-ngx-forms.umd.min.js.map +0 -1
- package/esm2015/acpaas-ui-ngx-forms.js +0 -11
- package/esm2015/lib/auto-complete/auto-complete.module.js +0 -36
- package/esm2015/lib/auto-complete/components/auto-complete/auto-complete.component.js +0 -416
- package/esm2015/lib/auto-complete/public-api.js +0 -8
- package/esm2015/lib/datepicker/components/datepicker/datepicker.component.js +0 -343
- package/esm2015/lib/datepicker/datepicker.conf.js +0 -18
- package/esm2015/lib/datepicker/datepicker.module.js +0 -59
- package/esm2015/lib/datepicker/public-api.js +0 -9
- package/esm2015/lib/datepicker/types/datepicker.types.js +0 -20
- package/esm2015/lib/mask/directives/mask.directive.js +0 -51
- package/esm2015/lib/mask/mask.module.js +0 -25
- package/esm2015/lib/mask/public-api.js +0 -8
- package/esm2015/lib/range-slider/components/range-slider/range-slider.component.js +0 -424
- package/esm2015/lib/range-slider/public-api.js +0 -8
- package/esm2015/lib/range-slider/range-slider.module.js +0 -26
- package/esm2015/lib/range-slider/types/range-slider.types.js +0 -16
- package/esm2015/lib/search-filter/components/search-filter/search-filter.component.js +0 -219
- package/esm2015/lib/search-filter/public-api.js +0 -8
- package/esm2015/lib/search-filter/search-filter.module.js +0 -30
- package/esm2015/lib/search-filter/types/search-filter.types.js +0 -16
- package/esm2015/lib/shared/services/search.service.js +0 -58
- package/esm2015/lib/shared/types/search.types.js +0 -20
- package/esm2015/lib/timepicker/classes/timepicker.validators.js +0 -84
- package/esm2015/lib/timepicker/components/timepicker/timepicker.component.js +0 -227
- package/esm2015/lib/timepicker/public-api.js +0 -10
- package/esm2015/lib/timepicker/timepicker.module.js +0 -29
- package/esm2015/lib/timepicker/types/timepicker.types.js +0 -13
- package/esm2015/lib/upload/classes/uploader.class.js +0 -189
- package/esm2015/lib/upload/components/upload/upload.component.js +0 -100
- package/esm2015/lib/upload/components/upload-input/upload-input.component.js +0 -67
- package/esm2015/lib/upload/components/upload-queue/upload-queue.component.js +0 -68
- package/esm2015/lib/upload/components/upload-zone/upload-zone.component.js +0 -219
- package/esm2015/lib/upload/components/validation-list/validation-list.component.js +0 -62
- package/esm2015/lib/upload/public-api.js +0 -15
- package/esm2015/lib/upload/services/validation-messages.service.js +0 -48
- package/esm2015/lib/upload/types/upload.types.js +0 -48
- package/esm2015/lib/upload/upload.conf.js +0 -21
- package/esm2015/lib/upload/upload.module.js +0 -62
- package/esm2015/lib/wysiwyg/components/wysiwyg/wysiwyg.component.js +0 -158
- package/esm2015/lib/wysiwyg/public-api.js +0 -9
- package/esm2015/lib/wysiwyg/wysiwyg.conf.js +0 -24
- package/esm2015/lib/wysiwyg/wysiwyg.module.js +0 -29
- package/esm2015/public-api.js +0 -14
- package/esm5/acpaas-ui-ngx-forms.js +0 -11
- package/esm5/lib/auto-complete/auto-complete.module.js +0 -40
- package/esm5/lib/auto-complete/components/auto-complete/auto-complete.component.js +0 -506
- package/esm5/lib/auto-complete/public-api.js +0 -8
- package/esm5/lib/datepicker/components/datepicker/datepicker.component.js +0 -392
- package/esm5/lib/datepicker/datepicker.conf.js +0 -18
- package/esm5/lib/datepicker/datepicker.module.js +0 -69
- package/esm5/lib/datepicker/public-api.js +0 -9
- package/esm5/lib/datepicker/types/datepicker.types.js +0 -20
- package/esm5/lib/mask/directives/mask.directive.js +0 -58
- package/esm5/lib/mask/mask.module.js +0 -29
- package/esm5/lib/mask/public-api.js +0 -8
- package/esm5/lib/range-slider/components/range-slider/range-slider.component.js +0 -514
- package/esm5/lib/range-slider/public-api.js +0 -8
- package/esm5/lib/range-slider/range-slider.module.js +0 -30
- package/esm5/lib/range-slider/types/range-slider.types.js +0 -16
- package/esm5/lib/search-filter/components/search-filter/search-filter.component.js +0 -256
- package/esm5/lib/search-filter/public-api.js +0 -8
- package/esm5/lib/search-filter/search-filter.module.js +0 -34
- package/esm5/lib/search-filter/types/search-filter.types.js +0 -16
- package/esm5/lib/shared/services/search.service.js +0 -68
- package/esm5/lib/shared/types/search.types.js +0 -20
- package/esm5/lib/timepicker/classes/timepicker.validators.js +0 -102
- package/esm5/lib/timepicker/components/timepicker/timepicker.component.js +0 -259
- package/esm5/lib/timepicker/public-api.js +0 -10
- package/esm5/lib/timepicker/timepicker.module.js +0 -33
- package/esm5/lib/timepicker/types/timepicker.types.js +0 -13
- package/esm5/lib/upload/classes/uploader.class.js +0 -249
- package/esm5/lib/upload/components/upload/upload.component.js +0 -117
- package/esm5/lib/upload/components/upload-input/upload-input.component.js +0 -84
- package/esm5/lib/upload/components/upload-queue/upload-queue.component.js +0 -78
- package/esm5/lib/upload/components/upload-zone/upload-zone.component.js +0 -264
- package/esm5/lib/upload/components/validation-list/validation-list.component.js +0 -81
- package/esm5/lib/upload/public-api.js +0 -15
- package/esm5/lib/upload/services/validation-messages.service.js +0 -47
- package/esm5/lib/upload/types/upload.types.js +0 -48
- package/esm5/lib/upload/upload.conf.js +0 -21
- package/esm5/lib/upload/upload.module.js +0 -71
- package/esm5/lib/wysiwyg/components/wysiwyg/wysiwyg.component.js +0 -199
- package/esm5/lib/wysiwyg/public-api.js +0 -9
- package/esm5/lib/wysiwyg/wysiwyg.conf.js +0 -24
- package/esm5/lib/wysiwyg/wysiwyg.module.js +0 -33
- package/esm5/public-api.js +0 -14
- package/fesm2015/acpaas-ui-ngx-forms.js +0 -3079
- package/fesm2015/acpaas-ui-ngx-forms.js.map +0 -1
- package/fesm5/acpaas-ui-ngx-forms.js +0 -3635
- package/fesm5/acpaas-ui-ngx-forms.js.map +0 -1
- package/lib/wysiwyg/components/wysiwyg/wysiwyg.component.d.ts +0 -43
- package/lib/wysiwyg/public-api.d.ts +0 -3
- package/lib/wysiwyg/wysiwyg.conf.d.ts +0 -18
- package/lib/wysiwyg/wysiwyg.module.d.ts +0 -2
|
@@ -1,3635 +0,0 @@
|
|
|
1
|
-
import { Directive, ElementRef, Input, NgModule, Injectable, EventEmitter, Component, forwardRef, Output, ViewChild, ContentChild, TemplateRef, InjectionToken, ChangeDetectionStrategy, Inject, ChangeDetectorRef, HostBinding, HostListener, Renderer2 } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS, FormBuilder, ReactiveFormsModule, FormControl } from '@angular/forms';
|
|
4
|
-
import { FlyoutDirective, FlyoutZoneDirective, FlyoutModule, FlyoutSize } from '@acpaas-ui/ngx-flyout';
|
|
5
|
-
import { SelectableListModule } from '@acpaas-ui/ngx-selectable-list';
|
|
6
|
-
import Inputmask from 'inputmask';
|
|
7
|
-
import { __spread, __values } from 'tslib';
|
|
8
|
-
import { get, isEqual, debounce } from 'lodash-es';
|
|
9
|
-
import { Subject, Observable } from 'rxjs';
|
|
10
|
-
import { takeUntil } from 'rxjs/operators';
|
|
11
|
-
import { DateHelper } from '@acpaas-ui/js-date-utils';
|
|
12
|
-
import { CALENDAR_DEFAULT_MONTH_LABELS, CALENDAR_DEFAULT_WEEKDAY_LABELS, CALENDAR_MONTH_LABELS, CALENDAR_WEEKDAY_LABELS, CalendarService, CalendarModule } from '@acpaas-ui/ngx-calendar';
|
|
13
|
-
import { IntervalBuilder } from '@acpaas-ui/ngx-utils';
|
|
14
|
-
import { IconModule } from '@acpaas-ui/ngx-icon';
|
|
15
|
-
import { ProgressBarModule } from '@acpaas-ui/ngx-progress-bar';
|
|
16
|
-
import { CKEditorModule } from 'ng2-ckeditor';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @fileoverview added by tsickle
|
|
20
|
-
* Generated from: lib/mask/directives/mask.directive.ts
|
|
21
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
22
|
-
*/
|
|
23
|
-
var MaskDirective = /** @class */ (function () {
|
|
24
|
-
function MaskDirective(ref) {
|
|
25
|
-
this.ref = ref;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @return {?}
|
|
29
|
-
*/
|
|
30
|
-
MaskDirective.prototype.ngOnChanges = /**
|
|
31
|
-
* @return {?}
|
|
32
|
-
*/
|
|
33
|
-
function () {
|
|
34
|
-
this.setMask(this.auiMask);
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* @private
|
|
38
|
-
* @param {?} mask
|
|
39
|
-
* @return {?}
|
|
40
|
-
*/
|
|
41
|
-
MaskDirective.prototype.setMask = /**
|
|
42
|
-
* @private
|
|
43
|
-
* @param {?} mask
|
|
44
|
-
* @return {?}
|
|
45
|
-
*/
|
|
46
|
-
function (mask) {
|
|
47
|
-
Inputmask(mask).mask(this.ref.nativeElement);
|
|
48
|
-
};
|
|
49
|
-
MaskDirective.decorators = [
|
|
50
|
-
{ type: Directive, args: [{
|
|
51
|
-
selector: '[auiMask]',
|
|
52
|
-
},] }
|
|
53
|
-
];
|
|
54
|
-
/** @nocollapse */
|
|
55
|
-
MaskDirective.ctorParameters = function () { return [
|
|
56
|
-
{ type: ElementRef }
|
|
57
|
-
]; };
|
|
58
|
-
MaskDirective.propDecorators = {
|
|
59
|
-
auiMask: [{ type: Input }]
|
|
60
|
-
};
|
|
61
|
-
return MaskDirective;
|
|
62
|
-
}());
|
|
63
|
-
if (false) {
|
|
64
|
-
/** @type {?} */
|
|
65
|
-
MaskDirective.prototype.auiMask;
|
|
66
|
-
/**
|
|
67
|
-
* @type {?}
|
|
68
|
-
* @private
|
|
69
|
-
*/
|
|
70
|
-
MaskDirective.prototype.ref;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @fileoverview added by tsickle
|
|
75
|
-
* Generated from: lib/mask/mask.module.ts
|
|
76
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
77
|
-
*/
|
|
78
|
-
var MaskModule = /** @class */ (function () {
|
|
79
|
-
function MaskModule() {
|
|
80
|
-
}
|
|
81
|
-
MaskModule.decorators = [
|
|
82
|
-
{ type: NgModule, args: [{
|
|
83
|
-
imports: [
|
|
84
|
-
CommonModule,
|
|
85
|
-
],
|
|
86
|
-
declarations: [
|
|
87
|
-
MaskDirective,
|
|
88
|
-
],
|
|
89
|
-
exports: [
|
|
90
|
-
MaskDirective,
|
|
91
|
-
],
|
|
92
|
-
providers: [],
|
|
93
|
-
},] }
|
|
94
|
-
];
|
|
95
|
-
return MaskModule;
|
|
96
|
-
}());
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @fileoverview added by tsickle
|
|
100
|
-
* Generated from: lib/shared/services/search.service.ts
|
|
101
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
102
|
-
*/
|
|
103
|
-
var SearchService = /** @class */ (function () {
|
|
104
|
-
function SearchService() {
|
|
105
|
-
this.matchItemWithSearchString = (/**
|
|
106
|
-
* @param {?} item
|
|
107
|
-
* @param {?} searchString
|
|
108
|
-
* @return {?}
|
|
109
|
-
*/
|
|
110
|
-
function (item, searchString) {
|
|
111
|
-
return String(item).toLowerCase().indexOf(searchString.toLowerCase()) > -1;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* @param {?} data
|
|
116
|
-
* @param {?=} options
|
|
117
|
-
* @return {?}
|
|
118
|
-
*/
|
|
119
|
-
SearchService.prototype.search = /**
|
|
120
|
-
* @param {?} data
|
|
121
|
-
* @param {?=} options
|
|
122
|
-
* @return {?}
|
|
123
|
-
*/
|
|
124
|
-
function (data, options) {
|
|
125
|
-
var _this = this;
|
|
126
|
-
if (options === void 0) { options = {}; }
|
|
127
|
-
/** @type {?} */
|
|
128
|
-
var query = options.hasOwnProperty('query') ? options.query : '';
|
|
129
|
-
/** @type {?} */
|
|
130
|
-
var minLength = options.hasOwnProperty('minLength') ? options.minLength : 0;
|
|
131
|
-
/** @type {?} */
|
|
132
|
-
var key = options.hasOwnProperty('key') ? options.key : '';
|
|
133
|
-
if ((!query && options.showAllByDefault) || query.length < minLength) {
|
|
134
|
-
return __spread(data);
|
|
135
|
-
}
|
|
136
|
-
return __spread(data).filter((/**
|
|
137
|
-
* @param {?} item
|
|
138
|
-
* @return {?}
|
|
139
|
-
*/
|
|
140
|
-
function (item) {
|
|
141
|
-
if (key && !item.hasOwnProperty(key)) {
|
|
142
|
-
return console.error("\"" + key + "\" does not exist in item " + JSON.stringify(item, null, 2));
|
|
143
|
-
}
|
|
144
|
-
if (key) {
|
|
145
|
-
return _this.matchItemWithSearchString(item[key], query);
|
|
146
|
-
}
|
|
147
|
-
return _this.matchItemWithSearchString(item, query);
|
|
148
|
-
}));
|
|
149
|
-
};
|
|
150
|
-
SearchService.decorators = [
|
|
151
|
-
{ type: Injectable }
|
|
152
|
-
];
|
|
153
|
-
return SearchService;
|
|
154
|
-
}());
|
|
155
|
-
if (false) {
|
|
156
|
-
/**
|
|
157
|
-
* @type {?}
|
|
158
|
-
* @private
|
|
159
|
-
*/
|
|
160
|
-
SearchService.prototype.matchItemWithSearchString;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* @fileoverview added by tsickle
|
|
165
|
-
* Generated from: lib/auto-complete/components/auto-complete/auto-complete.component.ts
|
|
166
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
167
|
-
*/
|
|
168
|
-
var AutoCompleteComponent = /** @class */ (function () {
|
|
169
|
-
function AutoCompleteComponent(ref, searchService) {
|
|
170
|
-
this.ref = ref;
|
|
171
|
-
this.searchService = searchService;
|
|
172
|
-
this.results = []; // The values for the selectable list
|
|
173
|
-
// The values for the selectable list
|
|
174
|
-
this.data = []; // The values to search in when remote search is disabled
|
|
175
|
-
// The values to search in when remote search is disabled
|
|
176
|
-
this.remote = false; // Disable or enamble remote search
|
|
177
|
-
// Disable or enamble remote search
|
|
178
|
-
this.minCharacters = 0;
|
|
179
|
-
this.mask = null;
|
|
180
|
-
this.clearInvalid = false;
|
|
181
|
-
this.showAllByDefault = false;
|
|
182
|
-
this.autoComplete = 'off';
|
|
183
|
-
// Eventemitter for searchvalue (parent object should update the results with this param)
|
|
184
|
-
this.search = new EventEmitter();
|
|
185
|
-
this.select = new EventEmitter();
|
|
186
|
-
this.query = '';
|
|
187
|
-
this.index = -1; // index for active element in selectable list, by default -1 (so it starts in the input field)
|
|
188
|
-
// index for active element in selectable list, by default -1 (so it starts in the input field)
|
|
189
|
-
this.selectedItem = null; // keep a backup of the selectedItem
|
|
190
|
-
// keep a backup of the selectedItem
|
|
191
|
-
this.searching = false; // track remote search state
|
|
192
|
-
// track remote search state
|
|
193
|
-
this.focused = false;
|
|
194
|
-
this.isDisabled = false;
|
|
195
|
-
this.remoteValue = false;
|
|
196
|
-
this.updateModel = (/**
|
|
197
|
-
* @param {?} _
|
|
198
|
-
* @return {?}
|
|
199
|
-
*/
|
|
200
|
-
function (_) {
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
204
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
205
|
-
/**
|
|
206
|
-
* @param {?=} value
|
|
207
|
-
* @return {?}
|
|
208
|
-
*/
|
|
209
|
-
AutoCompleteComponent.prototype.writeValue =
|
|
210
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
211
|
-
/**
|
|
212
|
-
* @param {?=} value
|
|
213
|
-
* @return {?}
|
|
214
|
-
*/
|
|
215
|
-
function (value) {
|
|
216
|
-
var _this = this;
|
|
217
|
-
if (value === void 0) { value = ''; }
|
|
218
|
-
if (this.value) {
|
|
219
|
-
/** @type {?} */
|
|
220
|
-
var selected = this.data.find((/**
|
|
221
|
-
* @param {?} item
|
|
222
|
-
* @return {?}
|
|
223
|
-
*/
|
|
224
|
-
function (item) { return item[_this.value] === value; }));
|
|
225
|
-
if (selected) {
|
|
226
|
-
return this.query = selected[this.label];
|
|
227
|
-
}
|
|
228
|
-
if (this.remote && !!value) {
|
|
229
|
-
this.remoteValue = true;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
this.query = value;
|
|
233
|
-
};
|
|
234
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
235
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
236
|
-
/**
|
|
237
|
-
* @param {?} fn
|
|
238
|
-
* @return {?}
|
|
239
|
-
*/
|
|
240
|
-
AutoCompleteComponent.prototype.registerOnChange =
|
|
241
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
242
|
-
/**
|
|
243
|
-
* @param {?} fn
|
|
244
|
-
* @return {?}
|
|
245
|
-
*/
|
|
246
|
-
function (fn) {
|
|
247
|
-
this.updateModel = fn;
|
|
248
|
-
};
|
|
249
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
250
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
251
|
-
/**
|
|
252
|
-
* @return {?}
|
|
253
|
-
*/
|
|
254
|
-
AutoCompleteComponent.prototype.registerOnTouched =
|
|
255
|
-
// CONTROL_VALUE_ACCESSOR interface
|
|
256
|
-
/**
|
|
257
|
-
* @return {?}
|
|
258
|
-
*/
|
|
259
|
-
function () {
|
|
260
|
-
};
|
|
261
|
-
/**
|
|
262
|
-
* @param {?} isDisabled
|
|
263
|
-
* @return {?}
|
|
264
|
-
*/
|
|
265
|
-
AutoCompleteComponent.prototype.setDisabledState = /**
|
|
266
|
-
* @param {?} isDisabled
|
|
267
|
-
* @return {?}
|
|
268
|
-
*/
|
|
269
|
-
function (isDisabled) {
|
|
270
|
-
this.isDisabled = isDisabled;
|
|
271
|
-
};
|
|
272
|
-
/**
|
|
273
|
-
* @return {?}
|
|
274
|
-
*/
|
|
275
|
-
AutoCompleteComponent.prototype.ngOnInit = /**
|
|
276
|
-
* @return {?}
|
|
277
|
-
*/
|
|
278
|
-
function () {
|
|
279
|
-
if ((Array.isArray(this.data) && this.data.length > 0) && !this.query && this.showAllByDefault) {
|
|
280
|
-
this.results = __spread(this.data);
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
// OnChanges interface
|
|
284
|
-
// OnChanges interface
|
|
285
|
-
/**
|
|
286
|
-
* @param {?} changes
|
|
287
|
-
* @return {?}
|
|
288
|
-
*/
|
|
289
|
-
AutoCompleteComponent.prototype.ngOnChanges =
|
|
290
|
-
// OnChanges interface
|
|
291
|
-
/**
|
|
292
|
-
* @param {?} changes
|
|
293
|
-
* @return {?}
|
|
294
|
-
*/
|
|
295
|
-
function (changes) {
|
|
296
|
-
if (!changes) {
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
/** @type {?} */
|
|
300
|
-
var newData = get(changes, 'data.currentValue', []);
|
|
301
|
-
if (!isEqual(newData, get(changes, 'data.previousValue', []))) {
|
|
302
|
-
if (this.remote) {
|
|
303
|
-
this.remoteSearch();
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
this.localSearch();
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
if (changes.results && changes.results.currentValue) {
|
|
310
|
-
this.searching = false;
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
/**
|
|
314
|
-
* @param {?} item
|
|
315
|
-
* @return {?}
|
|
316
|
-
*/
|
|
317
|
-
AutoCompleteComponent.prototype.propagateChange = /**
|
|
318
|
-
* @param {?} item
|
|
319
|
-
* @return {?}
|
|
320
|
-
*/
|
|
321
|
-
function (item) {
|
|
322
|
-
this.query = item !== null ? (this.label ? item[this.label] : item) : '';
|
|
323
|
-
this.select.emit(item);
|
|
324
|
-
if (!item) {
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
/** @type {?} */
|
|
328
|
-
var key = this.value ? this.value : this.label ? this.label : null;
|
|
329
|
-
this.updateModel(key ? item[key] || '' : item);
|
|
330
|
-
this.selectedItem = item;
|
|
331
|
-
};
|
|
332
|
-
/**
|
|
333
|
-
* triggers on input value change
|
|
334
|
-
*/
|
|
335
|
-
/**
|
|
336
|
-
* triggers on input value change
|
|
337
|
-
* @return {?}
|
|
338
|
-
*/
|
|
339
|
-
AutoCompleteComponent.prototype.doSearch = /**
|
|
340
|
-
* triggers on input value change
|
|
341
|
-
* @return {?}
|
|
342
|
-
*/
|
|
343
|
-
function () {
|
|
344
|
-
this.index = -1; // reset index
|
|
345
|
-
this.searching = true;
|
|
346
|
-
if (this.remote) {
|
|
347
|
-
this.search.emit(this.query); // ask for new remote data
|
|
348
|
-
}
|
|
349
|
-
else {
|
|
350
|
-
this.localSearch();
|
|
351
|
-
}
|
|
352
|
-
this.openFlyout(); // open the flyout when there is a change
|
|
353
|
-
};
|
|
354
|
-
/**
|
|
355
|
-
* triggers on selectable-list:select -> onClick event in selectable-list
|
|
356
|
-
*/
|
|
357
|
-
/**
|
|
358
|
-
* triggers on selectable-list:select -> onClick event in selectable-list
|
|
359
|
-
* @param {?} item
|
|
360
|
-
* @return {?}
|
|
361
|
-
*/
|
|
362
|
-
AutoCompleteComponent.prototype.onSelect = /**
|
|
363
|
-
* triggers on selectable-list:select -> onClick event in selectable-list
|
|
364
|
-
* @param {?} item
|
|
365
|
-
* @return {?}
|
|
366
|
-
*/
|
|
367
|
-
function (item) {
|
|
368
|
-
this.propagateChange(item);
|
|
369
|
-
this.closeFlyout(); // Close the flyout manually
|
|
370
|
-
};
|
|
371
|
-
/**
|
|
372
|
-
* @return {?}
|
|
373
|
-
*/
|
|
374
|
-
AutoCompleteComponent.prototype.onFlyoutClosed = /**
|
|
375
|
-
* @return {?}
|
|
376
|
-
*/
|
|
377
|
-
function () {
|
|
378
|
-
// there is only 1 result, select it
|
|
379
|
-
if (this.index >= 0 && this.results.length === 1) {
|
|
380
|
-
return this.onSelect(this.results[0]);
|
|
381
|
-
}
|
|
382
|
-
// there is no query nor selected item, clear the selected item
|
|
383
|
-
if (!this.query && this.index < 0) {
|
|
384
|
-
return this.onSelect(null);
|
|
385
|
-
}
|
|
386
|
-
// reset the query for an invalid query if clearInvalid is true
|
|
387
|
-
if (this.clearInvalid && this.query && !this.results.length && this.index < 0) {
|
|
388
|
-
this.query = this.selectedItem ? this.label ? this.selectedItem[this.label] : this.selectedItem : '';
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
/**
|
|
392
|
-
* @return {?}
|
|
393
|
-
*/
|
|
394
|
-
AutoCompleteComponent.prototype.onKeyArrowDown = /**
|
|
395
|
-
* @return {?}
|
|
396
|
-
*/
|
|
397
|
-
function () {
|
|
398
|
-
if (this.index < this.results.length - 1) {
|
|
399
|
-
this.scrollList(1);
|
|
400
|
-
}
|
|
401
|
-
this.openFlyout();
|
|
402
|
-
};
|
|
403
|
-
/**
|
|
404
|
-
* @return {?}
|
|
405
|
-
*/
|
|
406
|
-
AutoCompleteComponent.prototype.onKeyArrowUp = /**
|
|
407
|
-
* @return {?}
|
|
408
|
-
*/
|
|
409
|
-
function () {
|
|
410
|
-
if (this.index >= 0) {
|
|
411
|
-
this.scrollList(-1);
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
/**
|
|
415
|
-
* @param {?} event
|
|
416
|
-
* @return {?}
|
|
417
|
-
*/
|
|
418
|
-
AutoCompleteComponent.prototype.onKeyEnter = /**
|
|
419
|
-
* @param {?} event
|
|
420
|
-
* @return {?}
|
|
421
|
-
*/
|
|
422
|
-
function (event) {
|
|
423
|
-
event.preventDefault(); // Do not submit form when selecting an item.
|
|
424
|
-
// Do not submit form when selecting an item.
|
|
425
|
-
/** @type {?} */
|
|
426
|
-
var query = this.index >= 0 ? this.results[this.index] : this.query;
|
|
427
|
-
this.propagateChange(query);
|
|
428
|
-
this.closeFlyout();
|
|
429
|
-
};
|
|
430
|
-
/**
|
|
431
|
-
* @return {?}
|
|
432
|
-
*/
|
|
433
|
-
AutoCompleteComponent.prototype.onKeyEscape = /**
|
|
434
|
-
* @return {?}
|
|
435
|
-
*/
|
|
436
|
-
function () {
|
|
437
|
-
this.closeFlyout();
|
|
438
|
-
};
|
|
439
|
-
/**
|
|
440
|
-
* @return {?}
|
|
441
|
-
*/
|
|
442
|
-
AutoCompleteComponent.prototype.onFocus = /**
|
|
443
|
-
* @return {?}
|
|
444
|
-
*/
|
|
445
|
-
function () {
|
|
446
|
-
this.focused = true;
|
|
447
|
-
this.openFlyout();
|
|
448
|
-
};
|
|
449
|
-
/**
|
|
450
|
-
* @return {?}
|
|
451
|
-
*/
|
|
452
|
-
AutoCompleteComponent.prototype.openFlyout = /**
|
|
453
|
-
* @return {?}
|
|
454
|
-
*/
|
|
455
|
-
function () {
|
|
456
|
-
if (this.flyout) {
|
|
457
|
-
this.flyout.open();
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
/**
|
|
461
|
-
* @return {?}
|
|
462
|
-
*/
|
|
463
|
-
AutoCompleteComponent.prototype.closeFlyout = /**
|
|
464
|
-
* @return {?}
|
|
465
|
-
*/
|
|
466
|
-
function () {
|
|
467
|
-
if (this.flyout) {
|
|
468
|
-
this.flyout.close();
|
|
469
|
-
}
|
|
470
|
-
this.focused = false;
|
|
471
|
-
};
|
|
472
|
-
/**
|
|
473
|
-
* @return {?}
|
|
474
|
-
*/
|
|
475
|
-
AutoCompleteComponent.prototype.localSearch = /**
|
|
476
|
-
* @return {?}
|
|
477
|
-
*/
|
|
478
|
-
function () {
|
|
479
|
-
this.results = this.searchService.search(this.data, {
|
|
480
|
-
minLength: this.minCharacters,
|
|
481
|
-
key: this.label,
|
|
482
|
-
query: this.query,
|
|
483
|
-
showAllByDefault: this.showAllByDefault,
|
|
484
|
-
});
|
|
485
|
-
if (this.results.length === 1 && this.query === this.results[0][this.label]) {
|
|
486
|
-
this.index = 0;
|
|
487
|
-
}
|
|
488
|
-
this.searching = false;
|
|
489
|
-
};
|
|
490
|
-
/**
|
|
491
|
-
* @return {?}
|
|
492
|
-
*/
|
|
493
|
-
AutoCompleteComponent.prototype.remoteSearch = /**
|
|
494
|
-
* @return {?}
|
|
495
|
-
*/
|
|
496
|
-
function () {
|
|
497
|
-
var _this = this;
|
|
498
|
-
if (!this.remoteValue || !this.data) {
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
/** @type {?} */
|
|
502
|
-
var selected = this.data.find((/**
|
|
503
|
-
* @param {?} item
|
|
504
|
-
* @return {?}
|
|
505
|
-
*/
|
|
506
|
-
function (item) {
|
|
507
|
-
if (_this.value) {
|
|
508
|
-
return item[_this.value] === _this.query;
|
|
509
|
-
}
|
|
510
|
-
return item === _this.query;
|
|
511
|
-
}));
|
|
512
|
-
if (selected) {
|
|
513
|
-
this.query = this.label ? selected[this.label] : selected;
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
516
|
-
this.query = '';
|
|
517
|
-
}
|
|
518
|
-
this.remoteValue = false;
|
|
519
|
-
};
|
|
520
|
-
/**
|
|
521
|
-
* @param {?} factor
|
|
522
|
-
* @return {?}
|
|
523
|
-
*/
|
|
524
|
-
AutoCompleteComponent.prototype.scrollList = /**
|
|
525
|
-
* @param {?} factor
|
|
526
|
-
* @return {?}
|
|
527
|
-
*/
|
|
528
|
-
function (factor) {
|
|
529
|
-
this.index += factor;
|
|
530
|
-
if (!this.flyoutZone) {
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
/** @type {?} */
|
|
534
|
-
var liItems = this.flyoutZone.element.getElementsByTagName('li');
|
|
535
|
-
/** @type {?} */
|
|
536
|
-
var liHeight = (liItems[1] ? liItems[1].offsetHeight : liItems[0].offsetHeight);
|
|
537
|
-
/** @type {?} */
|
|
538
|
-
var zoneHeight = this.flyoutZone.element.offsetHeight;
|
|
539
|
-
/** @type {?} */
|
|
540
|
-
var offset = (zoneHeight / liHeight) / 2;
|
|
541
|
-
this.flyoutZone.element.scrollTop = (this.index * liHeight) - (offset * liHeight);
|
|
542
|
-
};
|
|
543
|
-
AutoCompleteComponent.decorators = [
|
|
544
|
-
{ type: Component, args: [{
|
|
545
|
-
selector: 'aui-auto-complete',
|
|
546
|
-
template: "<div (closed)=\"onFlyoutClosed()\" [toggleClick]=\"false\" aria-haspopup=\"listbox\"\n auiFlyout class=\"m-flyout--scrollable m-flyout--full o-auto-complete\">\n <input (focus)=\"onFocus()\"\n (keyArrowDown)=\"onKeyArrowDown()\"\n (keyArrowUp)=\"onKeyArrowUp()\"\n (keyEnter)=\"onKeyEnter($event)\"\n (keyEscape)=\"onKeyEscape()\"\n [(ngModel)]=\"query\"\n (ngModelChange)=\"doSearch()\"\n *ngIf=\"!mask\"\n [disabled]=\"isDisabled ? true : null\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n aria-autocomplete=\"list\"\n auiFlyoutAction\n auiSelectableActions\n [autocomplete]=\"autoComplete\"\n type=\"text\"\n />\n <input (focus)=\"onFocus()\"\n (keyArrowDown)=\"onKeyArrowDown()\"\n (keyArrowUp)=\"onKeyArrowUp()\"\n (keyEnter)=\"onKeyEnter($event)\"\n (keyEscape)=\"onKeyEscape()\"\n [(ngModel)]=\"query\"\n (ngModelChange)=\"doSearch()\"\n *ngIf=\"mask\"\n [auiMask]=\"mask\"\n [disabled]=\"isDisabled ? true : null\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n aria-autocomplete=\"list\"\n auiFlyoutAction\n auiSelectableActions\n [autocomplete]=\"autoComplete\"\n type=\"text\"\n />\n\n <div *ngIf=\"!isDisabled\" auiFlyoutZone>\n\t\t<span *ngIf=\"focused && loadingText && searching\" class=\"o-auto-complete__info u-text-light u-margin-xs\">\n\t\t\t<span class=\"a-spinner a-spinner--inline a-spinner--sm u-margin-right-xs\"></span>\n {{ loadingText }}\n\t\t</span>\n <span *ngIf=\"focused && searchIncentiveText && !searching && !query && !results.length\"\n class=\"o-auto-complete__info u-text-light u-margin-xs\">{{ searchIncentiveText }}</span>\n <span *ngIf=\"focused && noResultsText && !searching && query && !results.length\"\n class=\"o-auto-complete__info u-text-light u-margin-xs\">{{ noResultsText }}</span>\n\n <aui-selectable-list (selected)=\"onSelect($event)\" *ngIf=\"results.length > 0 && !(focused && loadingText && searching)\" [index]=\"index\" [itemTemplate]=\"template\"\n [items]=\"results\" [label]=\"label\"\n [search]=\"query\"></aui-selectable-list>\n </div>\n</div>\n",
|
|
547
|
-
providers: [
|
|
548
|
-
{
|
|
549
|
-
provide: NG_VALUE_ACCESSOR,
|
|
550
|
-
useExisting: forwardRef((/**
|
|
551
|
-
* @return {?}
|
|
552
|
-
*/
|
|
553
|
-
function () { return AutoCompleteComponent; })),
|
|
554
|
-
// tslint:disable-line
|
|
555
|
-
multi: true,
|
|
556
|
-
},
|
|
557
|
-
],
|
|
558
|
-
styles: [".o-auto-complete,.o-auto-complete__info{display:block}"]
|
|
559
|
-
}] }
|
|
560
|
-
];
|
|
561
|
-
/** @nocollapse */
|
|
562
|
-
AutoCompleteComponent.ctorParameters = function () { return [
|
|
563
|
-
{ type: ElementRef },
|
|
564
|
-
{ type: SearchService }
|
|
565
|
-
]; };
|
|
566
|
-
AutoCompleteComponent.propDecorators = {
|
|
567
|
-
id: [{ type: Input }],
|
|
568
|
-
placeholder: [{ type: Input }],
|
|
569
|
-
results: [{ type: Input }],
|
|
570
|
-
data: [{ type: Input }],
|
|
571
|
-
remote: [{ type: Input }],
|
|
572
|
-
minCharacters: [{ type: Input }],
|
|
573
|
-
mask: [{ type: Input }],
|
|
574
|
-
clearInvalid: [{ type: Input }],
|
|
575
|
-
searchIncentiveText: [{ type: Input }],
|
|
576
|
-
loadingText: [{ type: Input }],
|
|
577
|
-
noResultsText: [{ type: Input }],
|
|
578
|
-
showAllByDefault: [{ type: Input }],
|
|
579
|
-
autoComplete: [{ type: Input }],
|
|
580
|
-
label: [{ type: Input }],
|
|
581
|
-
value: [{ type: Input }],
|
|
582
|
-
search: [{ type: Output }],
|
|
583
|
-
select: [{ type: Output }],
|
|
584
|
-
flyout: [{ type: ViewChild, args: [FlyoutDirective, { static: true },] }],
|
|
585
|
-
flyoutZone: [{ type: ViewChild, args: [FlyoutZoneDirective, { static: true },] }],
|
|
586
|
-
template: [{ type: ContentChild, args: [TemplateRef, { static: true },] }]
|
|
587
|
-
};
|
|
588
|
-
return AutoCompleteComponent;
|
|
589
|
-
}());
|
|
590
|
-
if (false) {
|
|
591
|
-
/** @type {?} */
|
|
592
|
-
AutoCompleteComponent.prototype.id;
|
|
593
|
-
/** @type {?} */
|
|
594
|
-
AutoCompleteComponent.prototype.placeholder;
|
|
595
|
-
/** @type {?} */
|
|
596
|
-
AutoCompleteComponent.prototype.results;
|
|
597
|
-
/** @type {?} */
|
|
598
|
-
AutoCompleteComponent.prototype.data;
|
|
599
|
-
/** @type {?} */
|
|
600
|
-
AutoCompleteComponent.prototype.remote;
|
|
601
|
-
/** @type {?} */
|
|
602
|
-
AutoCompleteComponent.prototype.minCharacters;
|
|
603
|
-
/** @type {?} */
|
|
604
|
-
AutoCompleteComponent.prototype.mask;
|
|
605
|
-
/** @type {?} */
|
|
606
|
-
AutoCompleteComponent.prototype.clearInvalid;
|
|
607
|
-
/** @type {?} */
|
|
608
|
-
AutoCompleteComponent.prototype.searchIncentiveText;
|
|
609
|
-
/** @type {?} */
|
|
610
|
-
AutoCompleteComponent.prototype.loadingText;
|
|
611
|
-
/** @type {?} */
|
|
612
|
-
AutoCompleteComponent.prototype.noResultsText;
|
|
613
|
-
/** @type {?} */
|
|
614
|
-
AutoCompleteComponent.prototype.showAllByDefault;
|
|
615
|
-
/** @type {?} */
|
|
616
|
-
AutoCompleteComponent.prototype.autoComplete;
|
|
617
|
-
/** @type {?} */
|
|
618
|
-
AutoCompleteComponent.prototype.label;
|
|
619
|
-
/** @type {?} */
|
|
620
|
-
AutoCompleteComponent.prototype.value;
|
|
621
|
-
/** @type {?} */
|
|
622
|
-
AutoCompleteComponent.prototype.search;
|
|
623
|
-
/** @type {?} */
|
|
624
|
-
AutoCompleteComponent.prototype.select;
|
|
625
|
-
/** @type {?} */
|
|
626
|
-
AutoCompleteComponent.prototype.flyout;
|
|
627
|
-
/** @type {?} */
|
|
628
|
-
AutoCompleteComponent.prototype.flyoutZone;
|
|
629
|
-
/** @type {?} */
|
|
630
|
-
AutoCompleteComponent.prototype.template;
|
|
631
|
-
/** @type {?} */
|
|
632
|
-
AutoCompleteComponent.prototype.query;
|
|
633
|
-
/** @type {?} */
|
|
634
|
-
AutoCompleteComponent.prototype.index;
|
|
635
|
-
/** @type {?} */
|
|
636
|
-
AutoCompleteComponent.prototype.selectedItem;
|
|
637
|
-
/** @type {?} */
|
|
638
|
-
AutoCompleteComponent.prototype.searching;
|
|
639
|
-
/** @type {?} */
|
|
640
|
-
AutoCompleteComponent.prototype.focused;
|
|
641
|
-
/** @type {?} */
|
|
642
|
-
AutoCompleteComponent.prototype.isDisabled;
|
|
643
|
-
/**
|
|
644
|
-
* @type {?}
|
|
645
|
-
* @private
|
|
646
|
-
*/
|
|
647
|
-
AutoCompleteComponent.prototype.remoteValue;
|
|
648
|
-
/** @type {?} */
|
|
649
|
-
AutoCompleteComponent.prototype.updateModel;
|
|
650
|
-
/**
|
|
651
|
-
* @type {?}
|
|
652
|
-
* @private
|
|
653
|
-
*/
|
|
654
|
-
AutoCompleteComponent.prototype.ref;
|
|
655
|
-
/**
|
|
656
|
-
* @type {?}
|
|
657
|
-
* @private
|
|
658
|
-
*/
|
|
659
|
-
AutoCompleteComponent.prototype.searchService;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* @fileoverview added by tsickle
|
|
664
|
-
* Generated from: lib/auto-complete/auto-complete.module.ts
|
|
665
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
666
|
-
*/
|
|
667
|
-
var AutoCompleteModule = /** @class */ (function () {
|
|
668
|
-
function AutoCompleteModule() {
|
|
669
|
-
}
|
|
670
|
-
AutoCompleteModule.decorators = [
|
|
671
|
-
{ type: NgModule, args: [{
|
|
672
|
-
imports: [
|
|
673
|
-
CommonModule,
|
|
674
|
-
FormsModule,
|
|
675
|
-
FlyoutModule,
|
|
676
|
-
SelectableListModule,
|
|
677
|
-
MaskModule,
|
|
678
|
-
],
|
|
679
|
-
declarations: [
|
|
680
|
-
AutoCompleteComponent,
|
|
681
|
-
],
|
|
682
|
-
exports: [
|
|
683
|
-
AutoCompleteComponent,
|
|
684
|
-
],
|
|
685
|
-
providers: [
|
|
686
|
-
SearchService,
|
|
687
|
-
],
|
|
688
|
-
},] }
|
|
689
|
-
];
|
|
690
|
-
return AutoCompleteModule;
|
|
691
|
-
}());
|
|
692
|
-
|
|
693
|
-
/**
|
|
694
|
-
* @fileoverview added by tsickle
|
|
695
|
-
* Generated from: lib/auto-complete/public-api.ts
|
|
696
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
697
|
-
*/
|
|
698
|
-
|
|
699
|
-
/**
|
|
700
|
-
* @fileoverview added by tsickle
|
|
701
|
-
* Generated from: lib/datepicker/datepicker.conf.ts
|
|
702
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
703
|
-
*/
|
|
704
|
-
/** @type {?} */
|
|
705
|
-
var DATEPICKER_ERROR_LABELS = new InjectionToken('errorLabels');
|
|
706
|
-
/** @type {?} */
|
|
707
|
-
var DATEPICKER_DEFAULT_ERROR_LABELS = {
|
|
708
|
-
ERRORS_INVALID_DATE: 'INVALID_DATE',
|
|
709
|
-
ERRORS_INVALID_RANGE: 'INVALID_RANGE',
|
|
710
|
-
};
|
|
711
|
-
/** @type {?} */
|
|
712
|
-
var DATEPICKER_SEPARATOR_CHAR = '/';
|
|
713
|
-
/** @type {?} */
|
|
714
|
-
var DATEPICKER_DATE_MASK = "99" + DATEPICKER_SEPARATOR_CHAR + "99" + DATEPICKER_SEPARATOR_CHAR + "9999";
|
|
715
|
-
|
|
716
|
-
/**
|
|
717
|
-
* @fileoverview added by tsickle
|
|
718
|
-
* Generated from: lib/datepicker/components/datepicker/datepicker.component.ts
|
|
719
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
720
|
-
*/
|
|
721
|
-
var DatepickerComponent = /** @class */ (function () {
|
|
722
|
-
function DatepickerComponent(moduleMonthLabels, moduleWeekdayLabels, errorLabels, calendarService, formBuilder, ref) {
|
|
723
|
-
if (moduleMonthLabels === void 0) { moduleMonthLabels = CALENDAR_DEFAULT_MONTH_LABELS; }
|
|
724
|
-
if (moduleWeekdayLabels === void 0) { moduleWeekdayLabels = CALENDAR_DEFAULT_WEEKDAY_LABELS; }
|
|
725
|
-
if (errorLabels === void 0) { errorLabels = DATEPICKER_DEFAULT_ERROR_LABELS; }
|
|
726
|
-
this.moduleMonthLabels = moduleMonthLabels;
|
|
727
|
-
this.moduleWeekdayLabels = moduleWeekdayLabels;
|
|
728
|
-
this.errorLabels = errorLabels;
|
|
729
|
-
this.calendarService = calendarService;
|
|
730
|
-
this.formBuilder = formBuilder;
|
|
731
|
-
this.ref = ref;
|
|
732
|
-
this.placeholder = 'dd/mm/yyyy';
|
|
733
|
-
this.blur = new EventEmitter();
|
|
734
|
-
this.dateMask = { mask: DATEPICKER_DATE_MASK, showMaskOnHover: false };
|
|
735
|
-
this.isDisabled = false;
|
|
736
|
-
this.componentDestroyed$ = new Subject();
|
|
737
|
-
this.onChange = (/**
|
|
738
|
-
* @return {?}
|
|
739
|
-
*/
|
|
740
|
-
function () { return undefined; });
|
|
741
|
-
this.onTouched = (/**
|
|
742
|
-
* @return {?}
|
|
743
|
-
*/
|
|
744
|
-
function () { return undefined; });
|
|
745
|
-
}
|
|
746
|
-
/**
|
|
747
|
-
* @return {?}
|
|
748
|
-
*/
|
|
749
|
-
DatepickerComponent.prototype.ngOnInit = /**
|
|
750
|
-
* @return {?}
|
|
751
|
-
*/
|
|
752
|
-
function () {
|
|
753
|
-
var _this = this;
|
|
754
|
-
this.weekdayLabels = this.weekdayLabels || this.moduleWeekdayLabels;
|
|
755
|
-
this.monthLabels = this.monthLabels || this.moduleMonthLabels;
|
|
756
|
-
this.createInterval();
|
|
757
|
-
this.formControl = this.formBuilder.control({ value: '', disabled: this.isDisabled });
|
|
758
|
-
this.formControl.valueChanges
|
|
759
|
-
.pipe(takeUntil(this.componentDestroyed$))
|
|
760
|
-
.subscribe((/**
|
|
761
|
-
* @param {?} value
|
|
762
|
-
* @return {?}
|
|
763
|
-
*/
|
|
764
|
-
function (value) {
|
|
765
|
-
if (value) {
|
|
766
|
-
/** @type {?} */
|
|
767
|
-
var format = value.split(DATEPICKER_SEPARATOR_CHAR).reverse().join('-');
|
|
768
|
-
/** @type {?} */
|
|
769
|
-
var date = DateHelper.parseDate(format, 'yyyy-MM-dd');
|
|
770
|
-
if (date) {
|
|
771
|
-
_this.selectedDate = date;
|
|
772
|
-
_this.onChange(date.toISOString());
|
|
773
|
-
}
|
|
774
|
-
else {
|
|
775
|
-
// Change value with original value (and not null or '') so we can add an error in the validate function
|
|
776
|
-
_this.onChange(value);
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
else {
|
|
780
|
-
_this.selectedDate = null;
|
|
781
|
-
_this.onChange('');
|
|
782
|
-
}
|
|
783
|
-
}));
|
|
784
|
-
};
|
|
785
|
-
/**
|
|
786
|
-
* @param {?} changes
|
|
787
|
-
* @return {?}
|
|
788
|
-
*/
|
|
789
|
-
DatepickerComponent.prototype.ngOnChanges = /**
|
|
790
|
-
* @param {?} changes
|
|
791
|
-
* @return {?}
|
|
792
|
-
*/
|
|
793
|
-
function (changes) {
|
|
794
|
-
if (changes.min || changes.max) {
|
|
795
|
-
this.createInterval();
|
|
796
|
-
}
|
|
797
|
-
};
|
|
798
|
-
/**
|
|
799
|
-
* @return {?}
|
|
800
|
-
*/
|
|
801
|
-
DatepickerComponent.prototype.ngOnDestroy = /**
|
|
802
|
-
* @return {?}
|
|
803
|
-
*/
|
|
804
|
-
function () {
|
|
805
|
-
this.componentDestroyed$.next(true);
|
|
806
|
-
this.componentDestroyed$.complete();
|
|
807
|
-
};
|
|
808
|
-
/**
|
|
809
|
-
* @private
|
|
810
|
-
* @return {?}
|
|
811
|
-
*/
|
|
812
|
-
DatepickerComponent.prototype.createInterval = /**
|
|
813
|
-
* @private
|
|
814
|
-
* @return {?}
|
|
815
|
-
*/
|
|
816
|
-
function () {
|
|
817
|
-
if (!this.min && !this.max) {
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
// Create an interval if min/max is filled in
|
|
821
|
-
this.interval = IntervalBuilder.dateInterval(this.min ? new Date(this.min) : null, this.max ? new Date(this.max) : null)
|
|
822
|
-
.not()
|
|
823
|
-
.build();
|
|
824
|
-
};
|
|
825
|
-
/**
|
|
826
|
-
* @param {?} value
|
|
827
|
-
* @return {?}
|
|
828
|
-
*/
|
|
829
|
-
DatepickerComponent.prototype.writeValue = /**
|
|
830
|
-
* @param {?} value
|
|
831
|
-
* @return {?}
|
|
832
|
-
*/
|
|
833
|
-
function (value) {
|
|
834
|
-
this.selectedDate = typeof value === 'string'
|
|
835
|
-
? this.isISODateFormat(value) ? new Date(value) : DateHelper.parseDate(value, 'dd/MM/yyyy')
|
|
836
|
-
: value;
|
|
837
|
-
/** @type {?} */
|
|
838
|
-
var dateString = this.selectedDate ? this.formatDate(this.selectedDate) : '';
|
|
839
|
-
this.formControl.setValue(dateString);
|
|
840
|
-
};
|
|
841
|
-
/**
|
|
842
|
-
* @param {?} onChange
|
|
843
|
-
* @return {?}
|
|
844
|
-
*/
|
|
845
|
-
DatepickerComponent.prototype.registerOnChange = /**
|
|
846
|
-
* @param {?} onChange
|
|
847
|
-
* @return {?}
|
|
848
|
-
*/
|
|
849
|
-
function (onChange) {
|
|
850
|
-
this.onChange = onChange;
|
|
851
|
-
};
|
|
852
|
-
/**
|
|
853
|
-
* @param {?} onTouched
|
|
854
|
-
* @return {?}
|
|
855
|
-
*/
|
|
856
|
-
DatepickerComponent.prototype.registerOnTouched = /**
|
|
857
|
-
* @param {?} onTouched
|
|
858
|
-
* @return {?}
|
|
859
|
-
*/
|
|
860
|
-
function (onTouched) {
|
|
861
|
-
this.onTouched = onTouched;
|
|
862
|
-
};
|
|
863
|
-
/**
|
|
864
|
-
* @param {?} isDisabled
|
|
865
|
-
* @return {?}
|
|
866
|
-
*/
|
|
867
|
-
DatepickerComponent.prototype.setDisabledState = /**
|
|
868
|
-
* @param {?} isDisabled
|
|
869
|
-
* @return {?}
|
|
870
|
-
*/
|
|
871
|
-
function (isDisabled) {
|
|
872
|
-
this.isDisabled = isDisabled;
|
|
873
|
-
if (this.formControl) {
|
|
874
|
-
if (isDisabled && this.formControl.enabled) {
|
|
875
|
-
this.formControl.disable();
|
|
876
|
-
}
|
|
877
|
-
else if (!isDisabled && this.formControl.disabled) {
|
|
878
|
-
this.formControl.enable();
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
this.ref.markForCheck();
|
|
882
|
-
};
|
|
883
|
-
/**
|
|
884
|
-
* @param {?} result
|
|
885
|
-
* @return {?}
|
|
886
|
-
*/
|
|
887
|
-
DatepickerComponent.prototype.selectDateFromCalendar = /**
|
|
888
|
-
* @param {?} result
|
|
889
|
-
* @return {?}
|
|
890
|
-
*/
|
|
891
|
-
function (result) {
|
|
892
|
-
if (result.complete) {
|
|
893
|
-
this.formControl.setValue(this.formatDate(result.date));
|
|
894
|
-
this.flyout.close();
|
|
895
|
-
}
|
|
896
|
-
};
|
|
897
|
-
/**
|
|
898
|
-
* @param {?} date
|
|
899
|
-
* @return {?}
|
|
900
|
-
*/
|
|
901
|
-
DatepickerComponent.prototype.formatDate = /**
|
|
902
|
-
* @param {?} date
|
|
903
|
-
* @return {?}
|
|
904
|
-
*/
|
|
905
|
-
function (date) {
|
|
906
|
-
return DateHelper.formatDate(date, 'DD/MM/YYYY', {
|
|
907
|
-
leadingZero: true,
|
|
908
|
-
monthLabels: this.monthLabels,
|
|
909
|
-
weekdayLabels: this.weekdayLabels,
|
|
910
|
-
});
|
|
911
|
-
};
|
|
912
|
-
/**
|
|
913
|
-
* @param {?} ctrl
|
|
914
|
-
* @return {?}
|
|
915
|
-
*/
|
|
916
|
-
DatepickerComponent.prototype.validate = /**
|
|
917
|
-
* @param {?} ctrl
|
|
918
|
-
* @return {?}
|
|
919
|
-
*/
|
|
920
|
-
function (ctrl) {
|
|
921
|
-
// no error on empty value (add required validator in app)
|
|
922
|
-
if (ctrl.value === '' || ctrl.value === null) {
|
|
923
|
-
return null;
|
|
924
|
-
}
|
|
925
|
-
// throw format error if no valid date was provided
|
|
926
|
-
/** @type {?} */
|
|
927
|
-
var date = DateHelper.parseDate(ctrl.value);
|
|
928
|
-
if (!date) {
|
|
929
|
-
return {
|
|
930
|
-
format: this.errorLabels.ERRORS_INVALID_DATE,
|
|
931
|
-
};
|
|
932
|
-
}
|
|
933
|
-
// no error if valid date an no range provided
|
|
934
|
-
if (!this.range || !this.range.length) {
|
|
935
|
-
return null;
|
|
936
|
-
}
|
|
937
|
-
// throw error when out of range
|
|
938
|
-
/** @type {?} */
|
|
939
|
-
var range = this.calendarService.getRangeForDate(date, this.range);
|
|
940
|
-
return range.indexOf(date.getDate()) >= 0 ? {
|
|
941
|
-
range: this.errorLabels.ERRORS_INVALID_RANGE,
|
|
942
|
-
} : null;
|
|
943
|
-
};
|
|
944
|
-
/**
|
|
945
|
-
* @param {?} e
|
|
946
|
-
* @return {?}
|
|
947
|
-
*/
|
|
948
|
-
DatepickerComponent.prototype.handleBlur = /**
|
|
949
|
-
* @param {?} e
|
|
950
|
-
* @return {?}
|
|
951
|
-
*/
|
|
952
|
-
function (e) {
|
|
953
|
-
this.blur.emit(e);
|
|
954
|
-
this.onTouched(e);
|
|
955
|
-
};
|
|
956
|
-
/**
|
|
957
|
-
* @private
|
|
958
|
-
* @param {?} value
|
|
959
|
-
* @return {?}
|
|
960
|
-
*/
|
|
961
|
-
DatepickerComponent.prototype.isISODateFormat = /**
|
|
962
|
-
* @private
|
|
963
|
-
* @param {?} value
|
|
964
|
-
* @return {?}
|
|
965
|
-
*/
|
|
966
|
-
function (value) {
|
|
967
|
-
if (typeof value !== 'string') {
|
|
968
|
-
return false;
|
|
969
|
-
}
|
|
970
|
-
return value.match(/\d{4}-\d{2}-\d{2}T.*/);
|
|
971
|
-
};
|
|
972
|
-
DatepickerComponent.decorators = [
|
|
973
|
-
{ type: Component, args: [{
|
|
974
|
-
selector: 'aui-datepicker',
|
|
975
|
-
template: "<div aria-haspopup=\"grid\" auiFlyout class=\"aui-datepicker a-input__wrapper\">\n <input\n (blur)=\"handleBlur($event)\"\n [attr.disabled]=\"isDisabled ? true : null\"\n [auiMask]=\"dateMask.mask\"\n [autocomplete]=\"autocomplete\"\n [formControl]=\"formControl\"\n id=\"{{ id }}\"\n name=\"{{ name }}\"\n placeholder=\"{{ placeholder }}\"\n type=\"text\"\n >\n <aui-icon *ngIf=\"isDisabled\" name=\"ai-calendar-3\" role=\"button\" tabindex=\"0\"></aui-icon>\n\n <ng-container *ngIf=\"!isDisabled\">\n <aui-icon auiFlyoutAction [openOnFocus]=\"false\" name=\"ai-calendar-3\" className=\"is-clickable\" role=\"button\" tabindex=\"0\"></aui-icon>\n </ng-container>\n\n <ng-container *ngIf=\"!isDisabled\">\n <div auiFlyoutZone class=\"m-datepicker m-datepicker--fixed\" role=\"dialog\">\n <aui-calendar\n (selectDate)=\"selectDateFromCalendar($event)\"\n [range]=\"range\"\n [selectedDate]=\"selectedDate\"\n [interval]=\"interval\"\n [weekdayLabels]=\"weekdayLabels\"\n [monthLabels]=\"monthLabels\"\n ></aui-calendar>\n </div>\n </ng-container>\n</div>\n",
|
|
976
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
977
|
-
providers: [{
|
|
978
|
-
provide: NG_VALUE_ACCESSOR,
|
|
979
|
-
useExisting: forwardRef((/**
|
|
980
|
-
* @return {?}
|
|
981
|
-
*/
|
|
982
|
-
function () { return DatepickerComponent; })),
|
|
983
|
-
// tslint:disable-line:no-forward-ref
|
|
984
|
-
multi: true,
|
|
985
|
-
}, {
|
|
986
|
-
provide: NG_VALIDATORS,
|
|
987
|
-
useExisting: forwardRef((/**
|
|
988
|
-
* @return {?}
|
|
989
|
-
*/
|
|
990
|
-
function () { return DatepickerComponent; })),
|
|
991
|
-
// tslint:disable-line:no-forward-ref
|
|
992
|
-
multi: true,
|
|
993
|
-
}],
|
|
994
|
-
styles: [".aui-datepicker,:host{display:block}"]
|
|
995
|
-
}] }
|
|
996
|
-
];
|
|
997
|
-
/** @nocollapse */
|
|
998
|
-
DatepickerComponent.ctorParameters = function () { return [
|
|
999
|
-
{ type: undefined, decorators: [{ type: Inject, args: [CALENDAR_MONTH_LABELS,] }] },
|
|
1000
|
-
{ type: undefined, decorators: [{ type: Inject, args: [CALENDAR_WEEKDAY_LABELS,] }] },
|
|
1001
|
-
{ type: undefined, decorators: [{ type: Inject, args: [DATEPICKER_ERROR_LABELS,] }] },
|
|
1002
|
-
{ type: CalendarService },
|
|
1003
|
-
{ type: FormBuilder },
|
|
1004
|
-
{ type: ChangeDetectorRef }
|
|
1005
|
-
]; };
|
|
1006
|
-
DatepickerComponent.propDecorators = {
|
|
1007
|
-
flyout: [{ type: ViewChild, args: [FlyoutDirective, { static: true },] }],
|
|
1008
|
-
id: [{ type: Input }],
|
|
1009
|
-
name: [{ type: Input }],
|
|
1010
|
-
placeholder: [{ type: Input }],
|
|
1011
|
-
range: [{ type: Input }],
|
|
1012
|
-
min: [{ type: Input }],
|
|
1013
|
-
max: [{ type: Input }],
|
|
1014
|
-
autocomplete: [{ type: Input }],
|
|
1015
|
-
weekdayLabels: [{ type: Input }],
|
|
1016
|
-
monthLabels: [{ type: Input }],
|
|
1017
|
-
blur: [{ type: Output }]
|
|
1018
|
-
};
|
|
1019
|
-
return DatepickerComponent;
|
|
1020
|
-
}());
|
|
1021
|
-
if (false) {
|
|
1022
|
-
/** @type {?} */
|
|
1023
|
-
DatepickerComponent.prototype.flyout;
|
|
1024
|
-
/** @type {?} */
|
|
1025
|
-
DatepickerComponent.prototype.id;
|
|
1026
|
-
/** @type {?} */
|
|
1027
|
-
DatepickerComponent.prototype.name;
|
|
1028
|
-
/** @type {?} */
|
|
1029
|
-
DatepickerComponent.prototype.placeholder;
|
|
1030
|
-
/** @type {?} */
|
|
1031
|
-
DatepickerComponent.prototype.range;
|
|
1032
|
-
/** @type {?} */
|
|
1033
|
-
DatepickerComponent.prototype.min;
|
|
1034
|
-
/** @type {?} */
|
|
1035
|
-
DatepickerComponent.prototype.max;
|
|
1036
|
-
/** @type {?} */
|
|
1037
|
-
DatepickerComponent.prototype.autocomplete;
|
|
1038
|
-
/** @type {?} */
|
|
1039
|
-
DatepickerComponent.prototype.weekdayLabels;
|
|
1040
|
-
/** @type {?} */
|
|
1041
|
-
DatepickerComponent.prototype.monthLabels;
|
|
1042
|
-
/** @type {?} */
|
|
1043
|
-
DatepickerComponent.prototype.blur;
|
|
1044
|
-
/** @type {?} */
|
|
1045
|
-
DatepickerComponent.prototype.dateMask;
|
|
1046
|
-
/** @type {?} */
|
|
1047
|
-
DatepickerComponent.prototype.formControl;
|
|
1048
|
-
/** @type {?} */
|
|
1049
|
-
DatepickerComponent.prototype.selectedDate;
|
|
1050
|
-
/** @type {?} */
|
|
1051
|
-
DatepickerComponent.prototype.isDisabled;
|
|
1052
|
-
/** @type {?} */
|
|
1053
|
-
DatepickerComponent.prototype.interval;
|
|
1054
|
-
/**
|
|
1055
|
-
* @type {?}
|
|
1056
|
-
* @private
|
|
1057
|
-
*/
|
|
1058
|
-
DatepickerComponent.prototype.componentDestroyed$;
|
|
1059
|
-
/**
|
|
1060
|
-
* @type {?}
|
|
1061
|
-
* @private
|
|
1062
|
-
*/
|
|
1063
|
-
DatepickerComponent.prototype.onChange;
|
|
1064
|
-
/**
|
|
1065
|
-
* @type {?}
|
|
1066
|
-
* @private
|
|
1067
|
-
*/
|
|
1068
|
-
DatepickerComponent.prototype.onTouched;
|
|
1069
|
-
/**
|
|
1070
|
-
* @type {?}
|
|
1071
|
-
* @private
|
|
1072
|
-
*/
|
|
1073
|
-
DatepickerComponent.prototype.moduleMonthLabels;
|
|
1074
|
-
/**
|
|
1075
|
-
* @type {?}
|
|
1076
|
-
* @private
|
|
1077
|
-
*/
|
|
1078
|
-
DatepickerComponent.prototype.moduleWeekdayLabels;
|
|
1079
|
-
/**
|
|
1080
|
-
* @type {?}
|
|
1081
|
-
* @private
|
|
1082
|
-
*/
|
|
1083
|
-
DatepickerComponent.prototype.errorLabels;
|
|
1084
|
-
/** @type {?} */
|
|
1085
|
-
DatepickerComponent.prototype.calendarService;
|
|
1086
|
-
/**
|
|
1087
|
-
* @type {?}
|
|
1088
|
-
* @private
|
|
1089
|
-
*/
|
|
1090
|
-
DatepickerComponent.prototype.formBuilder;
|
|
1091
|
-
/**
|
|
1092
|
-
* @type {?}
|
|
1093
|
-
* @private
|
|
1094
|
-
*/
|
|
1095
|
-
DatepickerComponent.prototype.ref;
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
/**
|
|
1099
|
-
* @fileoverview added by tsickle
|
|
1100
|
-
* Generated from: lib/datepicker/datepicker.module.ts
|
|
1101
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1102
|
-
*/
|
|
1103
|
-
var ɵ0 = CALENDAR_DEFAULT_WEEKDAY_LABELS, ɵ1 = CALENDAR_DEFAULT_MONTH_LABELS, ɵ2 = DATEPICKER_DEFAULT_ERROR_LABELS;
|
|
1104
|
-
var DatepickerModule = /** @class */ (function () {
|
|
1105
|
-
function DatepickerModule() {
|
|
1106
|
-
}
|
|
1107
|
-
/**
|
|
1108
|
-
* @param {?} weekdayLabels
|
|
1109
|
-
* @param {?} monthLabels
|
|
1110
|
-
* @param {?} errorLabels
|
|
1111
|
-
* @return {?}
|
|
1112
|
-
*/
|
|
1113
|
-
DatepickerModule.forChild = /**
|
|
1114
|
-
* @param {?} weekdayLabels
|
|
1115
|
-
* @param {?} monthLabels
|
|
1116
|
-
* @param {?} errorLabels
|
|
1117
|
-
* @return {?}
|
|
1118
|
-
*/
|
|
1119
|
-
function (weekdayLabels, monthLabels, errorLabels) {
|
|
1120
|
-
return {
|
|
1121
|
-
ngModule: DatepickerModule,
|
|
1122
|
-
providers: [
|
|
1123
|
-
{ provide: CALENDAR_WEEKDAY_LABELS, useValue: weekdayLabels },
|
|
1124
|
-
{ provide: CALENDAR_MONTH_LABELS, useValue: monthLabels },
|
|
1125
|
-
{ provide: DATEPICKER_ERROR_LABELS, useValue: errorLabels },
|
|
1126
|
-
],
|
|
1127
|
-
};
|
|
1128
|
-
};
|
|
1129
|
-
DatepickerModule.decorators = [
|
|
1130
|
-
{ type: NgModule, args: [{
|
|
1131
|
-
imports: [
|
|
1132
|
-
CommonModule,
|
|
1133
|
-
FormsModule,
|
|
1134
|
-
ReactiveFormsModule,
|
|
1135
|
-
CalendarModule,
|
|
1136
|
-
IconModule,
|
|
1137
|
-
FlyoutModule,
|
|
1138
|
-
MaskModule,
|
|
1139
|
-
],
|
|
1140
|
-
declarations: [
|
|
1141
|
-
DatepickerComponent,
|
|
1142
|
-
],
|
|
1143
|
-
exports: [
|
|
1144
|
-
DatepickerComponent,
|
|
1145
|
-
],
|
|
1146
|
-
providers: [
|
|
1147
|
-
{ provide: CALENDAR_WEEKDAY_LABELS, useValue: ɵ0 },
|
|
1148
|
-
{ provide: CALENDAR_MONTH_LABELS, useValue: ɵ1 },
|
|
1149
|
-
{ provide: DATEPICKER_ERROR_LABELS, useValue: ɵ2 },
|
|
1150
|
-
],
|
|
1151
|
-
},] }
|
|
1152
|
-
];
|
|
1153
|
-
return DatepickerModule;
|
|
1154
|
-
}());
|
|
1155
|
-
|
|
1156
|
-
/**
|
|
1157
|
-
* @fileoverview added by tsickle
|
|
1158
|
-
* Generated from: lib/datepicker/public-api.ts
|
|
1159
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1160
|
-
*/
|
|
1161
|
-
|
|
1162
|
-
/**
|
|
1163
|
-
* @fileoverview added by tsickle
|
|
1164
|
-
* Generated from: lib/mask/public-api.ts
|
|
1165
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1166
|
-
*/
|
|
1167
|
-
|
|
1168
|
-
/**
|
|
1169
|
-
* @fileoverview added by tsickle
|
|
1170
|
-
* Generated from: lib/range-slider/components/range-slider/range-slider.component.ts
|
|
1171
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1172
|
-
*/
|
|
1173
|
-
var RangeSliderComponent = /** @class */ (function () {
|
|
1174
|
-
function RangeSliderComponent(elRef) {
|
|
1175
|
-
this.elRef = elRef;
|
|
1176
|
-
this.coreBranding = true;
|
|
1177
|
-
this.min = 0;
|
|
1178
|
-
this.max = 100;
|
|
1179
|
-
this.minimalDistance = 1;
|
|
1180
|
-
this.step = 0;
|
|
1181
|
-
this.labelBefore = '';
|
|
1182
|
-
this.labelAfter = '';
|
|
1183
|
-
this.start = 0;
|
|
1184
|
-
this.end = false;
|
|
1185
|
-
this.steps = [];
|
|
1186
|
-
this.active = null;
|
|
1187
|
-
this.isDisabled = false;
|
|
1188
|
-
this.hasFocus = false;
|
|
1189
|
-
this.click = false;
|
|
1190
|
-
this.propagateChange = (/**
|
|
1191
|
-
* @param {?} value
|
|
1192
|
-
* @return {?}
|
|
1193
|
-
*/
|
|
1194
|
-
function (value) {
|
|
1195
|
-
});
|
|
1196
|
-
}
|
|
1197
|
-
Object.defineProperty(RangeSliderComponent.prototype, "disabledClass", {
|
|
1198
|
-
get: /**
|
|
1199
|
-
* @return {?}
|
|
1200
|
-
*/
|
|
1201
|
-
function () {
|
|
1202
|
-
return this.isDisabled;
|
|
1203
|
-
},
|
|
1204
|
-
enumerable: true,
|
|
1205
|
-
configurable: true
|
|
1206
|
-
});
|
|
1207
|
-
/**
|
|
1208
|
-
* @return {?}
|
|
1209
|
-
*/
|
|
1210
|
-
RangeSliderComponent.prototype.ngOnInit = /**
|
|
1211
|
-
* @return {?}
|
|
1212
|
-
*/
|
|
1213
|
-
function () {
|
|
1214
|
-
if (this.step > 0) {
|
|
1215
|
-
for (var i = 0; i <= this.max; i += Number(this.step)) {
|
|
1216
|
-
this.steps.push(i);
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
this.startPercentage = this.startToPercentage();
|
|
1220
|
-
if (this.end) {
|
|
1221
|
-
this.endPercentage = this.endToPercentage();
|
|
1222
|
-
}
|
|
1223
|
-
};
|
|
1224
|
-
/**
|
|
1225
|
-
* @param {?} value
|
|
1226
|
-
* @return {?}
|
|
1227
|
-
*/
|
|
1228
|
-
RangeSliderComponent.prototype.writeValue = /**
|
|
1229
|
-
* @param {?} value
|
|
1230
|
-
* @return {?}
|
|
1231
|
-
*/
|
|
1232
|
-
function (value) {
|
|
1233
|
-
if (value && value.start) {
|
|
1234
|
-
this.start = value.start;
|
|
1235
|
-
}
|
|
1236
|
-
else if (!isNaN(value) && value !== '') {
|
|
1237
|
-
this.start = Number(value);
|
|
1238
|
-
}
|
|
1239
|
-
else {
|
|
1240
|
-
this.setStart(Number(this.min));
|
|
1241
|
-
}
|
|
1242
|
-
this.startPercentage = this.startToPercentage();
|
|
1243
|
-
if (value && value.end) {
|
|
1244
|
-
this.end = value.end;
|
|
1245
|
-
this.endPercentage = this.endToPercentage();
|
|
1246
|
-
}
|
|
1247
|
-
};
|
|
1248
|
-
/**
|
|
1249
|
-
* @return {?}
|
|
1250
|
-
*/
|
|
1251
|
-
RangeSliderComponent.prototype.registerOnTouched = /**
|
|
1252
|
-
* @return {?}
|
|
1253
|
-
*/
|
|
1254
|
-
function () {
|
|
1255
|
-
};
|
|
1256
|
-
/**
|
|
1257
|
-
* @param {?} fn
|
|
1258
|
-
* @return {?}
|
|
1259
|
-
*/
|
|
1260
|
-
RangeSliderComponent.prototype.registerOnChange = /**
|
|
1261
|
-
* @param {?} fn
|
|
1262
|
-
* @return {?}
|
|
1263
|
-
*/
|
|
1264
|
-
function (fn) {
|
|
1265
|
-
this.propagateChange = fn;
|
|
1266
|
-
};
|
|
1267
|
-
/**
|
|
1268
|
-
* @param {?} isDisabled
|
|
1269
|
-
* @return {?}
|
|
1270
|
-
*/
|
|
1271
|
-
RangeSliderComponent.prototype.setDisabledState = /**
|
|
1272
|
-
* @param {?} isDisabled
|
|
1273
|
-
* @return {?}
|
|
1274
|
-
*/
|
|
1275
|
-
function (isDisabled) {
|
|
1276
|
-
this.isDisabled = isDisabled;
|
|
1277
|
-
};
|
|
1278
|
-
/**
|
|
1279
|
-
* @param {?} handle
|
|
1280
|
-
* @return {?}
|
|
1281
|
-
*/
|
|
1282
|
-
RangeSliderComponent.prototype.onMouseDown = /**
|
|
1283
|
-
* @param {?} handle
|
|
1284
|
-
* @return {?}
|
|
1285
|
-
*/
|
|
1286
|
-
function (handle) {
|
|
1287
|
-
if (this.isDisabled) {
|
|
1288
|
-
return;
|
|
1289
|
-
}
|
|
1290
|
-
this.hasFocus = true;
|
|
1291
|
-
this.active = handle;
|
|
1292
|
-
};
|
|
1293
|
-
/**
|
|
1294
|
-
* @param {?} hasFocus
|
|
1295
|
-
* @param {?} element
|
|
1296
|
-
* @param {?} $event
|
|
1297
|
-
* @return {?}
|
|
1298
|
-
*/
|
|
1299
|
-
RangeSliderComponent.prototype.toggleFocus = /**
|
|
1300
|
-
* @param {?} hasFocus
|
|
1301
|
-
* @param {?} element
|
|
1302
|
-
* @param {?} $event
|
|
1303
|
-
* @return {?}
|
|
1304
|
-
*/
|
|
1305
|
-
function (hasFocus, element, $event) {
|
|
1306
|
-
if (this.isDisabled) {
|
|
1307
|
-
return;
|
|
1308
|
-
}
|
|
1309
|
-
$event.preventDefault();
|
|
1310
|
-
this.hasFocus = hasFocus;
|
|
1311
|
-
this.active = element;
|
|
1312
|
-
};
|
|
1313
|
-
/**
|
|
1314
|
-
* @param {?} $event
|
|
1315
|
-
* @return {?}
|
|
1316
|
-
*/
|
|
1317
|
-
RangeSliderComponent.prototype.onKeyDown = /**
|
|
1318
|
-
* @param {?} $event
|
|
1319
|
-
* @return {?}
|
|
1320
|
-
*/
|
|
1321
|
-
function ($event) {
|
|
1322
|
-
var _this = this;
|
|
1323
|
-
if (!this.hasFocus) {
|
|
1324
|
-
return;
|
|
1325
|
-
}
|
|
1326
|
-
/** @type {?} */
|
|
1327
|
-
var key = $event.keyCode;
|
|
1328
|
-
/** @type {?} */
|
|
1329
|
-
var keyCodes = {
|
|
1330
|
-
end: 35,
|
|
1331
|
-
home: 36,
|
|
1332
|
-
left: 37,
|
|
1333
|
-
up: 38,
|
|
1334
|
-
right: 39,
|
|
1335
|
-
down: 40,
|
|
1336
|
-
};
|
|
1337
|
-
if (Object.keys(keyCodes).map((/**
|
|
1338
|
-
* @param {?} e
|
|
1339
|
-
* @return {?}
|
|
1340
|
-
*/
|
|
1341
|
-
function (e) { return keyCodes[e]; })).indexOf(key) === -1) {
|
|
1342
|
-
return;
|
|
1343
|
-
}
|
|
1344
|
-
/** @type {?} */
|
|
1345
|
-
var increment = this.minimalDistance;
|
|
1346
|
-
if (this.step > 0) {
|
|
1347
|
-
increment = Number(this.step);
|
|
1348
|
-
}
|
|
1349
|
-
/** @type {?} */
|
|
1350
|
-
var processValue = (/**
|
|
1351
|
-
* @param {?} dir
|
|
1352
|
-
* @return {?}
|
|
1353
|
-
*/
|
|
1354
|
-
function (dir) {
|
|
1355
|
-
/** @type {?} */
|
|
1356
|
-
var newValue = (_this.active === 'start' ? _this.start : Number(_this.end));
|
|
1357
|
-
if (dir === 'up') {
|
|
1358
|
-
newValue += increment;
|
|
1359
|
-
}
|
|
1360
|
-
else {
|
|
1361
|
-
newValue -= increment;
|
|
1362
|
-
}
|
|
1363
|
-
/** @type {?} */
|
|
1364
|
-
var newPercentage = (newValue - _this.min) / (_this.max - _this.min) * 100;
|
|
1365
|
-
if (newPercentage > 100) {
|
|
1366
|
-
newPercentage = 100;
|
|
1367
|
-
}
|
|
1368
|
-
if (newPercentage < 0) {
|
|
1369
|
-
newPercentage = 0;
|
|
1370
|
-
}
|
|
1371
|
-
return newPercentage;
|
|
1372
|
-
});
|
|
1373
|
-
switch (key) {
|
|
1374
|
-
case keyCodes.right:
|
|
1375
|
-
case keyCodes.up:
|
|
1376
|
-
this.updateHandle(processValue('up'));
|
|
1377
|
-
$event.preventDefault();
|
|
1378
|
-
break;
|
|
1379
|
-
case keyCodes.left:
|
|
1380
|
-
case keyCodes.down:
|
|
1381
|
-
this.updateHandle(processValue('down'));
|
|
1382
|
-
$event.preventDefault();
|
|
1383
|
-
break;
|
|
1384
|
-
case keyCodes.end:
|
|
1385
|
-
this.updateHandle(100);
|
|
1386
|
-
$event.preventDefault();
|
|
1387
|
-
break;
|
|
1388
|
-
case keyCodes.home:
|
|
1389
|
-
this.updateHandle(0);
|
|
1390
|
-
$event.preventDefault();
|
|
1391
|
-
break;
|
|
1392
|
-
}
|
|
1393
|
-
};
|
|
1394
|
-
/**
|
|
1395
|
-
* @param {?} event
|
|
1396
|
-
* @return {?}
|
|
1397
|
-
*/
|
|
1398
|
-
RangeSliderComponent.prototype.onMouseUp = /**
|
|
1399
|
-
* @param {?} event
|
|
1400
|
-
* @return {?}
|
|
1401
|
-
*/
|
|
1402
|
-
function (event) {
|
|
1403
|
-
if (this.active === 'start') {
|
|
1404
|
-
this.setStart(this.round(this.start, this.step, 0));
|
|
1405
|
-
this.startPercentage = this.startToPercentage();
|
|
1406
|
-
}
|
|
1407
|
-
if (this.active === 'end') {
|
|
1408
|
-
this.setEnd(this.round(this.end, this.step, 0));
|
|
1409
|
-
this.endPercentage = this.endToPercentage();
|
|
1410
|
-
}
|
|
1411
|
-
this.click = false;
|
|
1412
|
-
};
|
|
1413
|
-
/**
|
|
1414
|
-
* @param {?} event
|
|
1415
|
-
* @return {?}
|
|
1416
|
-
*/
|
|
1417
|
-
RangeSliderComponent.prototype.mouseDown = /**
|
|
1418
|
-
* @param {?} event
|
|
1419
|
-
* @return {?}
|
|
1420
|
-
*/
|
|
1421
|
-
function (event) {
|
|
1422
|
-
this.click = true;
|
|
1423
|
-
};
|
|
1424
|
-
/**
|
|
1425
|
-
* @param {?} event
|
|
1426
|
-
* @return {?}
|
|
1427
|
-
*/
|
|
1428
|
-
RangeSliderComponent.prototype.onMouseMove = /**
|
|
1429
|
-
* @param {?} event
|
|
1430
|
-
* @return {?}
|
|
1431
|
-
*/
|
|
1432
|
-
function (event) {
|
|
1433
|
-
if (!this.active || !this.click) {
|
|
1434
|
-
return;
|
|
1435
|
-
}
|
|
1436
|
-
event.preventDefault(); // Do not select text while sliding
|
|
1437
|
-
// Do not select text while sliding
|
|
1438
|
-
/** @type {?} */
|
|
1439
|
-
var x = ((/** @type {?} */ (event))).x !== undefined ? ((/** @type {?} */ (event))).x : ((/** @type {?} */ (event))).targetTouches[0].pageX;
|
|
1440
|
-
/** @type {?} */
|
|
1441
|
-
var rect = this.elRef.nativeElement.getBoundingClientRect();
|
|
1442
|
-
/** @type {?} */
|
|
1443
|
-
var newPercentage = this.calcPercentage(x, rect.width, rect.left);
|
|
1444
|
-
this.updateHandle(newPercentage);
|
|
1445
|
-
};
|
|
1446
|
-
/**
|
|
1447
|
-
* @param {?} newPercentage
|
|
1448
|
-
* @return {?}
|
|
1449
|
-
*/
|
|
1450
|
-
RangeSliderComponent.prototype.updateHandle = /**
|
|
1451
|
-
* @param {?} newPercentage
|
|
1452
|
-
* @return {?}
|
|
1453
|
-
*/
|
|
1454
|
-
function (newPercentage) {
|
|
1455
|
-
if (this.active === 'start') {
|
|
1456
|
-
this.startPercentage = newPercentage;
|
|
1457
|
-
this.setStart(this.percentageToStart());
|
|
1458
|
-
if (this.minimalDistanceNotRespected()) {
|
|
1459
|
-
this.setStart(Number(this.end) - Number(this.minimalDistance));
|
|
1460
|
-
this.startPercentage = this.startToPercentage();
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
if (this.active === 'end' && this.endPercentage) {
|
|
1464
|
-
this.endPercentage = newPercentage;
|
|
1465
|
-
this.setEnd(this.percentageToEnd());
|
|
1466
|
-
if (this.minimalDistanceNotRespected()) {
|
|
1467
|
-
this.setEnd(Number(this.start) + Number(this.minimalDistance));
|
|
1468
|
-
this.endPercentage = this.endToPercentage();
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
};
|
|
1472
|
-
// ---------- HELPERS ---------- //
|
|
1473
|
-
// ---------- HELPERS ---------- //
|
|
1474
|
-
/**
|
|
1475
|
-
* @param {?} value
|
|
1476
|
-
* @return {?}
|
|
1477
|
-
*/
|
|
1478
|
-
RangeSliderComponent.prototype.setStart =
|
|
1479
|
-
// ---------- HELPERS ---------- //
|
|
1480
|
-
/**
|
|
1481
|
-
* @param {?} value
|
|
1482
|
-
* @return {?}
|
|
1483
|
-
*/
|
|
1484
|
-
function (value) {
|
|
1485
|
-
this.start = value;
|
|
1486
|
-
if (this.end) {
|
|
1487
|
-
this.propagateChange((/** @type {?} */ ({
|
|
1488
|
-
start: this.start,
|
|
1489
|
-
end: this.end,
|
|
1490
|
-
})));
|
|
1491
|
-
}
|
|
1492
|
-
else {
|
|
1493
|
-
this.propagateChange(this.start);
|
|
1494
|
-
}
|
|
1495
|
-
};
|
|
1496
|
-
/**
|
|
1497
|
-
* @param {?} value
|
|
1498
|
-
* @return {?}
|
|
1499
|
-
*/
|
|
1500
|
-
RangeSliderComponent.prototype.setEnd = /**
|
|
1501
|
-
* @param {?} value
|
|
1502
|
-
* @return {?}
|
|
1503
|
-
*/
|
|
1504
|
-
function (value) {
|
|
1505
|
-
this.end = value;
|
|
1506
|
-
this.propagateChange((/** @type {?} */ ({
|
|
1507
|
-
start: this.start,
|
|
1508
|
-
end: this.end,
|
|
1509
|
-
})));
|
|
1510
|
-
};
|
|
1511
|
-
/**
|
|
1512
|
-
* @param {?} n
|
|
1513
|
-
* @param {?} increment
|
|
1514
|
-
* @param {?} offset
|
|
1515
|
-
* @return {?}
|
|
1516
|
-
*/
|
|
1517
|
-
RangeSliderComponent.prototype.round = /**
|
|
1518
|
-
* @param {?} n
|
|
1519
|
-
* @param {?} increment
|
|
1520
|
-
* @param {?} offset
|
|
1521
|
-
* @return {?}
|
|
1522
|
-
*/
|
|
1523
|
-
function (n, increment, offset) {
|
|
1524
|
-
if (increment > 0) {
|
|
1525
|
-
return Math.round((n - offset) / increment) * increment + offset;
|
|
1526
|
-
}
|
|
1527
|
-
return n;
|
|
1528
|
-
};
|
|
1529
|
-
/**
|
|
1530
|
-
* @return {?}
|
|
1531
|
-
*/
|
|
1532
|
-
RangeSliderComponent.prototype.startToPercentage = /**
|
|
1533
|
-
* @return {?}
|
|
1534
|
-
*/
|
|
1535
|
-
function () {
|
|
1536
|
-
return Math.round((this.start - this.min) / (this.max - this.min) * 100);
|
|
1537
|
-
};
|
|
1538
|
-
/**
|
|
1539
|
-
* @return {?}
|
|
1540
|
-
*/
|
|
1541
|
-
RangeSliderComponent.prototype.percentageToStart = /**
|
|
1542
|
-
* @return {?}
|
|
1543
|
-
*/
|
|
1544
|
-
function () {
|
|
1545
|
-
return Math.round((this.startPercentage / 100) * (this.max - this.min) + Number(this.min));
|
|
1546
|
-
};
|
|
1547
|
-
/**
|
|
1548
|
-
* @return {?}
|
|
1549
|
-
*/
|
|
1550
|
-
RangeSliderComponent.prototype.endToPercentage = /**
|
|
1551
|
-
* @return {?}
|
|
1552
|
-
*/
|
|
1553
|
-
function () {
|
|
1554
|
-
return Math.round((Number(this.end) - this.min) / (this.max - this.min) * 100);
|
|
1555
|
-
};
|
|
1556
|
-
/**
|
|
1557
|
-
* @return {?}
|
|
1558
|
-
*/
|
|
1559
|
-
RangeSliderComponent.prototype.percentageToEnd = /**
|
|
1560
|
-
* @return {?}
|
|
1561
|
-
*/
|
|
1562
|
-
function () {
|
|
1563
|
-
return Math.round((this.endPercentage / 100) * (this.max - this.min) + Number(this.min));
|
|
1564
|
-
};
|
|
1565
|
-
/**
|
|
1566
|
-
* @return {?}
|
|
1567
|
-
*/
|
|
1568
|
-
RangeSliderComponent.prototype.minimalDistanceNotRespected = /**
|
|
1569
|
-
* @return {?}
|
|
1570
|
-
*/
|
|
1571
|
-
function () {
|
|
1572
|
-
return this.minimalDistance >= 0 && this.end && this.start > Number(this.end) - this.minimalDistance;
|
|
1573
|
-
};
|
|
1574
|
-
/**
|
|
1575
|
-
* @param {?} mouseX
|
|
1576
|
-
* @param {?} width
|
|
1577
|
-
* @param {?} offsetLeft
|
|
1578
|
-
* @return {?}
|
|
1579
|
-
*/
|
|
1580
|
-
RangeSliderComponent.prototype.calcPercentage = /**
|
|
1581
|
-
* @param {?} mouseX
|
|
1582
|
-
* @param {?} width
|
|
1583
|
-
* @param {?} offsetLeft
|
|
1584
|
-
* @return {?}
|
|
1585
|
-
*/
|
|
1586
|
-
function (mouseX, width, offsetLeft) {
|
|
1587
|
-
/** @type {?} */
|
|
1588
|
-
var mousePos = mouseX - offsetLeft;
|
|
1589
|
-
/** @type {?} */
|
|
1590
|
-
var newPercentage = Math.round((mousePos / width) * 100);
|
|
1591
|
-
if (newPercentage > 100) {
|
|
1592
|
-
newPercentage = 100;
|
|
1593
|
-
}
|
|
1594
|
-
if (newPercentage < 0) {
|
|
1595
|
-
newPercentage = 0;
|
|
1596
|
-
}
|
|
1597
|
-
return newPercentage;
|
|
1598
|
-
};
|
|
1599
|
-
RangeSliderComponent.decorators = [
|
|
1600
|
-
{ type: Component, args: [{
|
|
1601
|
-
selector: 'aui-range-slider',
|
|
1602
|
-
template: "<div class=\"m-range-slider__inner\">\n <div\n [style.left]=\"endPercentage ? startPercentage + '%' : false\"\n [style.width]=\"endPercentage ? endPercentage - startPercentage + '%' : startPercentage + '%'\"\n class=\"m-range-slider__bar\"\n ></div>\n <span\n (blur)=\"toggleFocus(false, null, $event)\"\n (dragexit)=\"onMouseUp($event)\"\n (focus)=\"toggleFocus(true, 'start', $event)\"\n (mousedown)=\"onMouseDown('start')\"\n (touchstart)=\"onMouseDown('start')\"\n [style.left]=\"startPercentage + '%'\"\n class=\"m-range-slider__handle\"\n tabindex=\"0\"\n >\n\t\t<div class=\"m-range-slider__tooltip a-tooltip a-tooltip--primary a-tooltip--top\">\n\t\t\t<p>{{ labelBefore }}{{ start }}{{ labelAfter }}</p>\n\t\t</div>\n\t</span>\n\n <span\n (blur)=\"toggleFocus(false, null, $event)\"\n (dragexit)=\"onMouseUp($event)\"\n (focus)=\"toggleFocus(true, 'end', $event)\"\n (mousedown)=\"onMouseDown('end')\"\n (touchstart)=\"onMouseDown('end')\"\n *ngIf=\"end\"\n [style.left]=\"endPercentage + '%'\"\n class=\"m-range-slider__handle\"\n name=\"m-range-slider__handle__end\"\n tabindex=\"0\"\n >\n\t\t<div class=\"m-range-slider__tooltip a-tooltip a-tooltip--primary a-tooltip--top\">\n\t\t\t<p>{{ labelBefore }}{{ end }}{{ labelAfter }}</p>\n\t\t</div>\n\t</span>\n</div>\n\n<div class=\"m-range-slider__steps\">\n <div *ngFor=\"let step of steps; let i = index\" class=\"m-range-slider__step\"></div>\n</div>\n\n<div class=\"m-range-slider__step-labels\">\n <div *ngFor=\"let step of steps; let i = index\" class=\"m-range-slider__step\">{{ step }}</div>\n</div>\n",
|
|
1603
|
-
providers: [
|
|
1604
|
-
{
|
|
1605
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1606
|
-
useExisting: forwardRef((/**
|
|
1607
|
-
* @return {?}
|
|
1608
|
-
*/
|
|
1609
|
-
function () { return RangeSliderComponent; })),
|
|
1610
|
-
// tslint:disable-line
|
|
1611
|
-
multi: true,
|
|
1612
|
-
},
|
|
1613
|
-
],
|
|
1614
|
-
styles: [":host{display:block;position:relative}:host.is-disabled{cursor:not-allowed}:host.is-disabled .m-range-slider__handle:hover{cursor:not-allowed}"]
|
|
1615
|
-
}] }
|
|
1616
|
-
];
|
|
1617
|
-
/** @nocollapse */
|
|
1618
|
-
RangeSliderComponent.ctorParameters = function () { return [
|
|
1619
|
-
{ type: ElementRef }
|
|
1620
|
-
]; };
|
|
1621
|
-
RangeSliderComponent.propDecorators = {
|
|
1622
|
-
coreBranding: [{ type: HostBinding, args: ['class.m-range-slider',] }],
|
|
1623
|
-
min: [{ type: Input }],
|
|
1624
|
-
max: [{ type: Input }],
|
|
1625
|
-
minimalDistance: [{ type: Input }],
|
|
1626
|
-
step: [{ type: Input }],
|
|
1627
|
-
labelBefore: [{ type: Input }],
|
|
1628
|
-
labelAfter: [{ type: Input }],
|
|
1629
|
-
disabledClass: [{ type: HostBinding, args: ['class.is-disabled',] }],
|
|
1630
|
-
onKeyDown: [{ type: HostListener, args: ['document:keydown', ['$event'],] }],
|
|
1631
|
-
onMouseUp: [{ type: HostListener, args: ['touchend', ['$event'],] }, { type: HostListener, args: ['mouseup', ['$event'],] }],
|
|
1632
|
-
mouseDown: [{ type: HostListener, args: ['touchstart', ['$event'],] }, { type: HostListener, args: ['mousedown', ['$event'],] }],
|
|
1633
|
-
onMouseMove: [{ type: HostListener, args: ['touchmove', ['$event'],] }, { type: HostListener, args: ['mousemove', ['$event'],] }]
|
|
1634
|
-
};
|
|
1635
|
-
return RangeSliderComponent;
|
|
1636
|
-
}());
|
|
1637
|
-
if (false) {
|
|
1638
|
-
/** @type {?} */
|
|
1639
|
-
RangeSliderComponent.prototype.coreBranding;
|
|
1640
|
-
/** @type {?} */
|
|
1641
|
-
RangeSliderComponent.prototype.min;
|
|
1642
|
-
/** @type {?} */
|
|
1643
|
-
RangeSliderComponent.prototype.max;
|
|
1644
|
-
/** @type {?} */
|
|
1645
|
-
RangeSliderComponent.prototype.minimalDistance;
|
|
1646
|
-
/** @type {?} */
|
|
1647
|
-
RangeSliderComponent.prototype.step;
|
|
1648
|
-
/** @type {?} */
|
|
1649
|
-
RangeSliderComponent.prototype.labelBefore;
|
|
1650
|
-
/** @type {?} */
|
|
1651
|
-
RangeSliderComponent.prototype.labelAfter;
|
|
1652
|
-
/** @type {?} */
|
|
1653
|
-
RangeSliderComponent.prototype.start;
|
|
1654
|
-
/** @type {?} */
|
|
1655
|
-
RangeSliderComponent.prototype.end;
|
|
1656
|
-
/** @type {?} */
|
|
1657
|
-
RangeSliderComponent.prototype.steps;
|
|
1658
|
-
/** @type {?} */
|
|
1659
|
-
RangeSliderComponent.prototype.startPercentage;
|
|
1660
|
-
/** @type {?} */
|
|
1661
|
-
RangeSliderComponent.prototype.endPercentage;
|
|
1662
|
-
/** @type {?} */
|
|
1663
|
-
RangeSliderComponent.prototype.active;
|
|
1664
|
-
/** @type {?} */
|
|
1665
|
-
RangeSliderComponent.prototype.isDisabled;
|
|
1666
|
-
/** @type {?} */
|
|
1667
|
-
RangeSliderComponent.prototype.hasFocus;
|
|
1668
|
-
/** @type {?} */
|
|
1669
|
-
RangeSliderComponent.prototype.click;
|
|
1670
|
-
/** @type {?} */
|
|
1671
|
-
RangeSliderComponent.prototype.propagateChange;
|
|
1672
|
-
/**
|
|
1673
|
-
* @type {?}
|
|
1674
|
-
* @private
|
|
1675
|
-
*/
|
|
1676
|
-
RangeSliderComponent.prototype.elRef;
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* @fileoverview added by tsickle
|
|
1681
|
-
* Generated from: lib/range-slider/range-slider.module.ts
|
|
1682
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1683
|
-
*/
|
|
1684
|
-
var RangeSliderModule = /** @class */ (function () {
|
|
1685
|
-
function RangeSliderModule() {
|
|
1686
|
-
}
|
|
1687
|
-
RangeSliderModule.decorators = [
|
|
1688
|
-
{ type: NgModule, args: [{
|
|
1689
|
-
imports: [
|
|
1690
|
-
CommonModule,
|
|
1691
|
-
FormsModule,
|
|
1692
|
-
],
|
|
1693
|
-
declarations: [
|
|
1694
|
-
RangeSliderComponent,
|
|
1695
|
-
],
|
|
1696
|
-
exports: [
|
|
1697
|
-
RangeSliderComponent,
|
|
1698
|
-
],
|
|
1699
|
-
},] }
|
|
1700
|
-
];
|
|
1701
|
-
return RangeSliderModule;
|
|
1702
|
-
}());
|
|
1703
|
-
|
|
1704
|
-
/**
|
|
1705
|
-
* @fileoverview added by tsickle
|
|
1706
|
-
* Generated from: lib/range-slider/public-api.ts
|
|
1707
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1708
|
-
*/
|
|
1709
|
-
|
|
1710
|
-
/**
|
|
1711
|
-
* @fileoverview added by tsickle
|
|
1712
|
-
* Generated from: lib/search-filter/components/search-filter/search-filter.component.ts
|
|
1713
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1714
|
-
*/
|
|
1715
|
-
var SearchFilterComponent = /** @class */ (function () {
|
|
1716
|
-
function SearchFilterComponent() {
|
|
1717
|
-
this.flyoutSize = FlyoutSize.Small;
|
|
1718
|
-
this.label = 'Filter';
|
|
1719
|
-
this.labelDeselect = 'Alles deselecteren';
|
|
1720
|
-
this.labelResults = 'Resultaten';
|
|
1721
|
-
this.labelNoResults = 'Geen resultaten gevonden.';
|
|
1722
|
-
this.choices = [];
|
|
1723
|
-
this.placeholder = 'Zoeken';
|
|
1724
|
-
this.inputDelay = 150;
|
|
1725
|
-
this.showAllByDefault = false;
|
|
1726
|
-
this.size = 'default';
|
|
1727
|
-
this.search = new EventEmitter();
|
|
1728
|
-
this.query = '';
|
|
1729
|
-
this.selectedItems = [];
|
|
1730
|
-
this.filteredChoices = [];
|
|
1731
|
-
this.loading = false;
|
|
1732
|
-
this.isDisabled = false;
|
|
1733
|
-
this.updateModel = (/**
|
|
1734
|
-
* @return {?}
|
|
1735
|
-
*/
|
|
1736
|
-
function () {
|
|
1737
|
-
});
|
|
1738
|
-
this.filterDataFromSearch = debounce(this.filterData.bind(this), this.inputDelay);
|
|
1739
|
-
}
|
|
1740
|
-
/**
|
|
1741
|
-
* @param {?} value
|
|
1742
|
-
* @return {?}
|
|
1743
|
-
*/
|
|
1744
|
-
SearchFilterComponent.prototype.writeValue = /**
|
|
1745
|
-
* @param {?} value
|
|
1746
|
-
* @return {?}
|
|
1747
|
-
*/
|
|
1748
|
-
function (value) {
|
|
1749
|
-
this.selectedItems = Array.isArray(value) ? value : [];
|
|
1750
|
-
};
|
|
1751
|
-
/**
|
|
1752
|
-
* @param {?} onChange
|
|
1753
|
-
* @return {?}
|
|
1754
|
-
*/
|
|
1755
|
-
SearchFilterComponent.prototype.registerOnChange = /**
|
|
1756
|
-
* @param {?} onChange
|
|
1757
|
-
* @return {?}
|
|
1758
|
-
*/
|
|
1759
|
-
function (onChange) {
|
|
1760
|
-
this.updateModel = onChange;
|
|
1761
|
-
};
|
|
1762
|
-
/**
|
|
1763
|
-
* @return {?}
|
|
1764
|
-
*/
|
|
1765
|
-
SearchFilterComponent.prototype.registerOnTouched = /**
|
|
1766
|
-
* @return {?}
|
|
1767
|
-
*/
|
|
1768
|
-
function () {
|
|
1769
|
-
};
|
|
1770
|
-
/**
|
|
1771
|
-
* @param {?} isDisabled
|
|
1772
|
-
* @return {?}
|
|
1773
|
-
*/
|
|
1774
|
-
SearchFilterComponent.prototype.setDisabledState = /**
|
|
1775
|
-
* @param {?} isDisabled
|
|
1776
|
-
* @return {?}
|
|
1777
|
-
*/
|
|
1778
|
-
function (isDisabled) {
|
|
1779
|
-
this.isDisabled = isDisabled;
|
|
1780
|
-
};
|
|
1781
|
-
/**
|
|
1782
|
-
* @return {?}
|
|
1783
|
-
*/
|
|
1784
|
-
SearchFilterComponent.prototype.ngOnInit = /**
|
|
1785
|
-
* @return {?}
|
|
1786
|
-
*/
|
|
1787
|
-
function () {
|
|
1788
|
-
if (this.showAllByDefault) {
|
|
1789
|
-
this.filterData();
|
|
1790
|
-
}
|
|
1791
|
-
};
|
|
1792
|
-
/**
|
|
1793
|
-
* @param {?} changes
|
|
1794
|
-
* @return {?}
|
|
1795
|
-
*/
|
|
1796
|
-
SearchFilterComponent.prototype.ngOnChanges = /**
|
|
1797
|
-
* @param {?} changes
|
|
1798
|
-
* @return {?}
|
|
1799
|
-
*/
|
|
1800
|
-
function (changes) {
|
|
1801
|
-
/** @type {?} */
|
|
1802
|
-
var choices = get(changes, 'choices.currentValue', null);
|
|
1803
|
-
if (!choices) {
|
|
1804
|
-
return;
|
|
1805
|
-
}
|
|
1806
|
-
if (this.remote) {
|
|
1807
|
-
this.filteredChoices = __spread(choices);
|
|
1808
|
-
this.loading = false;
|
|
1809
|
-
}
|
|
1810
|
-
else {
|
|
1811
|
-
this.filterData();
|
|
1812
|
-
}
|
|
1813
|
-
};
|
|
1814
|
-
/**
|
|
1815
|
-
* @return {?}
|
|
1816
|
-
*/
|
|
1817
|
-
SearchFilterComponent.prototype.filterData = /**
|
|
1818
|
-
* @return {?}
|
|
1819
|
-
*/
|
|
1820
|
-
function () {
|
|
1821
|
-
if (this.remote) {
|
|
1822
|
-
this.loading = true;
|
|
1823
|
-
return this.search.emit(this.query);
|
|
1824
|
-
}
|
|
1825
|
-
this.filterChoices();
|
|
1826
|
-
};
|
|
1827
|
-
/**
|
|
1828
|
-
* @return {?}
|
|
1829
|
-
*/
|
|
1830
|
-
SearchFilterComponent.prototype.clear = /**
|
|
1831
|
-
* @return {?}
|
|
1832
|
-
*/
|
|
1833
|
-
function () {
|
|
1834
|
-
this.selectedItems = [];
|
|
1835
|
-
this.query = '';
|
|
1836
|
-
this.filterData();
|
|
1837
|
-
this.updateModel(this.selectedItems);
|
|
1838
|
-
};
|
|
1839
|
-
/**
|
|
1840
|
-
* @param {?} choice
|
|
1841
|
-
* @return {?}
|
|
1842
|
-
*/
|
|
1843
|
-
SearchFilterComponent.prototype.toggleSelected = /**
|
|
1844
|
-
* @param {?} choice
|
|
1845
|
-
* @return {?}
|
|
1846
|
-
*/
|
|
1847
|
-
function (choice) {
|
|
1848
|
-
/** @type {?} */
|
|
1849
|
-
var selected = this.selectedItems.indexOf(choice);
|
|
1850
|
-
if (selected < 0) {
|
|
1851
|
-
this.selectedItems = this.selectedItems.concat(choice);
|
|
1852
|
-
}
|
|
1853
|
-
else {
|
|
1854
|
-
this.selectedItems = __spread(this.selectedItems.slice(0, selected), this.selectedItems.slice(selected + 1));
|
|
1855
|
-
}
|
|
1856
|
-
this.updateModel(this.selectedItems);
|
|
1857
|
-
};
|
|
1858
|
-
/**
|
|
1859
|
-
* @private
|
|
1860
|
-
* @return {?}
|
|
1861
|
-
*/
|
|
1862
|
-
SearchFilterComponent.prototype.filterChoices = /**
|
|
1863
|
-
* @private
|
|
1864
|
-
* @return {?}
|
|
1865
|
-
*/
|
|
1866
|
-
function () {
|
|
1867
|
-
var _this = this;
|
|
1868
|
-
this.filteredChoices = this.choices.filter((/**
|
|
1869
|
-
* @param {?} choice
|
|
1870
|
-
* @return {?}
|
|
1871
|
-
*/
|
|
1872
|
-
function (choice) {
|
|
1873
|
-
return (_this.selectedItems.indexOf(choice.value) < 0 &&
|
|
1874
|
-
choice.label.toLowerCase().indexOf(_this.query.toLowerCase()) >= 0);
|
|
1875
|
-
}));
|
|
1876
|
-
};
|
|
1877
|
-
SearchFilterComponent.decorators = [
|
|
1878
|
-
{ type: Component, args: [{
|
|
1879
|
-
selector: 'aui-search-filter',
|
|
1880
|
-
template: "<div [align]=\"flyoutAlign\" [size]=\"flyoutSize\" auiFlyout class=\"m-search-filter\">\n <button class=\"has-icon-right a-button--default\" [attr.disabled]=\"isDisabled ? 'true' : null\" aria-haspopup=\u201Dtrue\u201D\n auiFlyoutAction\n [ngClass]=\"{\n 'a-button' : selectedItems.length,\n 'a-button-outline' : !selectedItems.length,\n 'a-button--large' : size === 'large',\n 'a-button--small': size === 'small',\n 'a-button--tiny' : size === 'tiny'\n }\">\n <span id=\"{{ id + '-label' }}\">{{ label }}</span>\n <span *ngIf=\"selectedItems.length\"> ({{ selectedItems.length }})</span>\n <aui-icon name=\"ai-arrow-down-1\"></aui-icon>\n </button>\n\n <div auiFlyoutZone class=\"m-search-filter__search m-search-filter__search--scroll\">\n <div *ngIf=\"!isDisabled\" class=\"m-search-filter__input a-input has-icon-right\">\n <div class=\"a-input__wrapper\">\n <input (input)=\"filterDataFromSearch()\" [(ngModel)]=\"query\" [attr.aria-labelledby]=\"id + '-label'\"\n [attr.placeholder]=\"placeholder\"\n aria-autocomplete=\"list\" id=\"{{ id + '-search' }}\" name=\"{{ name + '-search' }}\"\n type=\"text\">\n <aui-icon name=\"ai-search\"></aui-icon>\n </div>\n </div>\n\n <div *ngIf=\"!isDisabled && selectedItems.length > 0\" class=\"m-search-filter__clear\">\n <button (click)=\"clear()\" class=\"a-button-outline a-button--small a-button--danger has-icon-left\" type=\"button\">\n <aui-icon name=\"ai-close\"></aui-icon>\n {{ labelDeselect }}\n </button>\n </div>\n\n <p *ngIf=\"labelResults\" class=\"h6 m-search-filter__results-title u-margin-bottom-xs\">{{ labelResults }}</p>\n <div *ngIf=\"loading\" class=\"u-text-center u-padding a-spinner\"></div>\n <ul *ngIf=\"!loading\" class=\"a-list a-list--lined a-list--unstyled\">\n <li *ngIf=\"!filteredChoices.length\" class=\"m-search-filter__results-item a-list__item\">\n <p class=\"u-margin-xs\">{{ labelNoResults }}</p>\n </li>\n <li *ngFor=\"let choice of filteredChoices; index as i\" class=\"m-search-filter__results-item a-list__item\">\n <div class=\"a-input__checkbox\">\n <input\n (change)=\"toggleSelected(choice.value)\"\n [attr.disabled]=\"isDisabled ? true : null\"\n [checked]=\"selectedItems.indexOf(choice.value) >= 0\"\n id=\"{{ 'checkbox--' + i + '--' + id }}\"\n name=\"{{ 'checkbox--' + i + '--' + id }}\"\n type=\"checkbox\"\n />\n <label for=\"{{ 'checkbox--' + i + '--' + id }}\">{{ choice.label }}</label>\n </div>\n </li>\n </ul>\n </div>\n</div>\n",
|
|
1881
|
-
providers: [{
|
|
1882
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1883
|
-
useExisting: forwardRef((/**
|
|
1884
|
-
* @return {?}
|
|
1885
|
-
*/
|
|
1886
|
-
function () { return SearchFilterComponent; })),
|
|
1887
|
-
// tslint:disable-line:no-forward-ref
|
|
1888
|
-
multi: true,
|
|
1889
|
-
}]
|
|
1890
|
-
}] }
|
|
1891
|
-
];
|
|
1892
|
-
/** @nocollapse */
|
|
1893
|
-
SearchFilterComponent.ctorParameters = function () { return []; };
|
|
1894
|
-
SearchFilterComponent.propDecorators = {
|
|
1895
|
-
id: [{ type: Input }],
|
|
1896
|
-
name: [{ type: Input }],
|
|
1897
|
-
flyoutSize: [{ type: Input }],
|
|
1898
|
-
flyoutAlign: [{ type: Input }],
|
|
1899
|
-
label: [{ type: Input }],
|
|
1900
|
-
labelDeselect: [{ type: Input }],
|
|
1901
|
-
labelResults: [{ type: Input }],
|
|
1902
|
-
labelNoResults: [{ type: Input }],
|
|
1903
|
-
choices: [{ type: Input }],
|
|
1904
|
-
remote: [{ type: Input }],
|
|
1905
|
-
placeholder: [{ type: Input }],
|
|
1906
|
-
inputDelay: [{ type: Input }],
|
|
1907
|
-
showAllByDefault: [{ type: Input }],
|
|
1908
|
-
size: [{ type: Input }],
|
|
1909
|
-
search: [{ type: Output }]
|
|
1910
|
-
};
|
|
1911
|
-
return SearchFilterComponent;
|
|
1912
|
-
}());
|
|
1913
|
-
if (false) {
|
|
1914
|
-
/** @type {?} */
|
|
1915
|
-
SearchFilterComponent.prototype.id;
|
|
1916
|
-
/** @type {?} */
|
|
1917
|
-
SearchFilterComponent.prototype.name;
|
|
1918
|
-
/** @type {?} */
|
|
1919
|
-
SearchFilterComponent.prototype.flyoutSize;
|
|
1920
|
-
/** @type {?} */
|
|
1921
|
-
SearchFilterComponent.prototype.flyoutAlign;
|
|
1922
|
-
/** @type {?} */
|
|
1923
|
-
SearchFilterComponent.prototype.label;
|
|
1924
|
-
/** @type {?} */
|
|
1925
|
-
SearchFilterComponent.prototype.labelDeselect;
|
|
1926
|
-
/** @type {?} */
|
|
1927
|
-
SearchFilterComponent.prototype.labelResults;
|
|
1928
|
-
/** @type {?} */
|
|
1929
|
-
SearchFilterComponent.prototype.labelNoResults;
|
|
1930
|
-
/** @type {?} */
|
|
1931
|
-
SearchFilterComponent.prototype.choices;
|
|
1932
|
-
/** @type {?} */
|
|
1933
|
-
SearchFilterComponent.prototype.remote;
|
|
1934
|
-
/** @type {?} */
|
|
1935
|
-
SearchFilterComponent.prototype.placeholder;
|
|
1936
|
-
/** @type {?} */
|
|
1937
|
-
SearchFilterComponent.prototype.inputDelay;
|
|
1938
|
-
/** @type {?} */
|
|
1939
|
-
SearchFilterComponent.prototype.showAllByDefault;
|
|
1940
|
-
/** @type {?} */
|
|
1941
|
-
SearchFilterComponent.prototype.size;
|
|
1942
|
-
/** @type {?} */
|
|
1943
|
-
SearchFilterComponent.prototype.search;
|
|
1944
|
-
/** @type {?} */
|
|
1945
|
-
SearchFilterComponent.prototype.query;
|
|
1946
|
-
/** @type {?} */
|
|
1947
|
-
SearchFilterComponent.prototype.selectedItems;
|
|
1948
|
-
/** @type {?} */
|
|
1949
|
-
SearchFilterComponent.prototype.filteredChoices;
|
|
1950
|
-
/** @type {?} */
|
|
1951
|
-
SearchFilterComponent.prototype.loading;
|
|
1952
|
-
/** @type {?} */
|
|
1953
|
-
SearchFilterComponent.prototype.isDisabled;
|
|
1954
|
-
/** @type {?} */
|
|
1955
|
-
SearchFilterComponent.prototype.filterDataFromSearch;
|
|
1956
|
-
/** @type {?} */
|
|
1957
|
-
SearchFilterComponent.prototype.updateModel;
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
/**
|
|
1961
|
-
* @fileoverview added by tsickle
|
|
1962
|
-
* Generated from: lib/search-filter/search-filter.module.ts
|
|
1963
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1964
|
-
*/
|
|
1965
|
-
var SearchFilterModule = /** @class */ (function () {
|
|
1966
|
-
function SearchFilterModule() {
|
|
1967
|
-
}
|
|
1968
|
-
SearchFilterModule.decorators = [
|
|
1969
|
-
{ type: NgModule, args: [{
|
|
1970
|
-
imports: [
|
|
1971
|
-
CommonModule,
|
|
1972
|
-
FlyoutModule,
|
|
1973
|
-
FormsModule,
|
|
1974
|
-
IconModule,
|
|
1975
|
-
],
|
|
1976
|
-
declarations: [
|
|
1977
|
-
SearchFilterComponent,
|
|
1978
|
-
],
|
|
1979
|
-
exports: [
|
|
1980
|
-
SearchFilterComponent,
|
|
1981
|
-
],
|
|
1982
|
-
},] }
|
|
1983
|
-
];
|
|
1984
|
-
return SearchFilterModule;
|
|
1985
|
-
}());
|
|
1986
|
-
|
|
1987
|
-
/**
|
|
1988
|
-
* @fileoverview added by tsickle
|
|
1989
|
-
* Generated from: lib/search-filter/public-api.ts
|
|
1990
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1991
|
-
*/
|
|
1992
|
-
|
|
1993
|
-
/**
|
|
1994
|
-
* @fileoverview added by tsickle
|
|
1995
|
-
* Generated from: lib/timepicker/classes/timepicker.validators.ts
|
|
1996
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1997
|
-
*/
|
|
1998
|
-
var TimePickerValidators = /** @class */ (function () {
|
|
1999
|
-
function TimePickerValidators() {
|
|
2000
|
-
}
|
|
2001
|
-
// time `hh:mm` 24h format
|
|
2002
|
-
// time `hh:mm` 24h format
|
|
2003
|
-
/**
|
|
2004
|
-
* @param {?} time
|
|
2005
|
-
* @return {?}
|
|
2006
|
-
*/
|
|
2007
|
-
TimePickerValidators.minTime =
|
|
2008
|
-
// time `hh:mm` 24h format
|
|
2009
|
-
/**
|
|
2010
|
-
* @param {?} time
|
|
2011
|
-
* @return {?}
|
|
2012
|
-
*/
|
|
2013
|
-
function (time) {
|
|
2014
|
-
/** @type {?} */
|
|
2015
|
-
var validator = (/**
|
|
2016
|
-
* @param {?} control
|
|
2017
|
-
* @return {?}
|
|
2018
|
-
*/
|
|
2019
|
-
function (control) {
|
|
2020
|
-
/** @type {?} */
|
|
2021
|
-
var splittedControlValue = control.value.split(':');
|
|
2022
|
-
/** @type {?} */
|
|
2023
|
-
var controlHours = parseInt(splittedControlValue[0], 10);
|
|
2024
|
-
/** @type {?} */
|
|
2025
|
-
var controlMinutes = parseInt(splittedControlValue[1], 10);
|
|
2026
|
-
/** @type {?} */
|
|
2027
|
-
var splittedMinTime = time.split(':');
|
|
2028
|
-
/** @type {?} */
|
|
2029
|
-
var minHours = parseInt(splittedMinTime[0], 10);
|
|
2030
|
-
/** @type {?} */
|
|
2031
|
-
var minMinutes = parseInt(splittedMinTime[1], 10);
|
|
2032
|
-
// Don't throw error --> use Validator.required
|
|
2033
|
-
if (isNaN(controlHours) || isNaN(controlMinutes) || isNaN(minHours) || isNaN(minMinutes)) {
|
|
2034
|
-
return null;
|
|
2035
|
-
}
|
|
2036
|
-
if (minHours < controlHours) {
|
|
2037
|
-
return null;
|
|
2038
|
-
}
|
|
2039
|
-
if (minHours === controlHours && minMinutes <= controlMinutes) {
|
|
2040
|
-
return null;
|
|
2041
|
-
}
|
|
2042
|
-
return { minTime: { value: control.value } };
|
|
2043
|
-
});
|
|
2044
|
-
return validator;
|
|
2045
|
-
};
|
|
2046
|
-
// time `hh:mm` 24h format
|
|
2047
|
-
// time `hh:mm` 24h format
|
|
2048
|
-
/**
|
|
2049
|
-
* @param {?} time
|
|
2050
|
-
* @return {?}
|
|
2051
|
-
*/
|
|
2052
|
-
TimePickerValidators.maxTime =
|
|
2053
|
-
// time `hh:mm` 24h format
|
|
2054
|
-
/**
|
|
2055
|
-
* @param {?} time
|
|
2056
|
-
* @return {?}
|
|
2057
|
-
*/
|
|
2058
|
-
function (time) {
|
|
2059
|
-
/** @type {?} */
|
|
2060
|
-
var validator = (/**
|
|
2061
|
-
* @param {?} control
|
|
2062
|
-
* @return {?}
|
|
2063
|
-
*/
|
|
2064
|
-
function (control) {
|
|
2065
|
-
/** @type {?} */
|
|
2066
|
-
var splittedControlValue = control.value.split(':');
|
|
2067
|
-
/** @type {?} */
|
|
2068
|
-
var controlHours = parseInt(splittedControlValue[0], 10);
|
|
2069
|
-
/** @type {?} */
|
|
2070
|
-
var controlMinutes = parseInt(splittedControlValue[1], 10);
|
|
2071
|
-
/** @type {?} */
|
|
2072
|
-
var splittedMinTime = time.split(':');
|
|
2073
|
-
/** @type {?} */
|
|
2074
|
-
var maxHours = parseInt(splittedMinTime[0], 10);
|
|
2075
|
-
/** @type {?} */
|
|
2076
|
-
var maxMinutes = parseInt(splittedMinTime[1], 10);
|
|
2077
|
-
// Don't throw error --> use Validator.required
|
|
2078
|
-
if (isNaN(controlHours) || isNaN(controlMinutes) || isNaN(maxHours) || isNaN(maxMinutes)) {
|
|
2079
|
-
return null;
|
|
2080
|
-
}
|
|
2081
|
-
if (maxHours > controlHours) {
|
|
2082
|
-
return null;
|
|
2083
|
-
}
|
|
2084
|
-
if (maxHours === controlHours && maxMinutes >= controlMinutes) {
|
|
2085
|
-
return null;
|
|
2086
|
-
}
|
|
2087
|
-
return { maxTime: { value: control.value } };
|
|
2088
|
-
});
|
|
2089
|
-
return validator;
|
|
2090
|
-
};
|
|
2091
|
-
return TimePickerValidators;
|
|
2092
|
-
}());
|
|
2093
|
-
|
|
2094
|
-
/**
|
|
2095
|
-
* @fileoverview added by tsickle
|
|
2096
|
-
* Generated from: lib/timepicker/types/timepicker.types.ts
|
|
2097
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2098
|
-
*/
|
|
2099
|
-
/** @enum {string} */
|
|
2100
|
-
var TimepickerInputSize = {
|
|
2101
|
-
Auto: "auto",
|
|
2102
|
-
Small: "small",
|
|
2103
|
-
Large: "large",
|
|
2104
|
-
};
|
|
2105
|
-
|
|
2106
|
-
/**
|
|
2107
|
-
* @fileoverview added by tsickle
|
|
2108
|
-
* Generated from: lib/timepicker/components/timepicker/timepicker.component.ts
|
|
2109
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2110
|
-
*/
|
|
2111
|
-
var TimepickerComponent = /** @class */ (function () {
|
|
2112
|
-
function TimepickerComponent(formBuilder, renderer) {
|
|
2113
|
-
this.formBuilder = formBuilder;
|
|
2114
|
-
this.renderer = renderer;
|
|
2115
|
-
this.id = 'aui-timepicker-' + Math.random().toString(36).substring(2);
|
|
2116
|
-
this.hoursPlaceholder = 'uu';
|
|
2117
|
-
this.minutesPlaceholder = 'mm';
|
|
2118
|
-
this.hasError = false;
|
|
2119
|
-
this.size = TimepickerInputSize.Auto;
|
|
2120
|
-
this.ariaLabelHours = 'Uur';
|
|
2121
|
-
this.ariaLabelMinutes = 'Minuten';
|
|
2122
|
-
this.shouldUseFallback = false;
|
|
2123
|
-
this.minutes = [];
|
|
2124
|
-
this.hours = [];
|
|
2125
|
-
this.timeControl = new FormControl();
|
|
2126
|
-
this.componentDestroyed$ = new Subject();
|
|
2127
|
-
}
|
|
2128
|
-
/**
|
|
2129
|
-
* @return {?}
|
|
2130
|
-
*/
|
|
2131
|
-
TimepickerComponent.prototype.ngOnInit = /**
|
|
2132
|
-
* @return {?}
|
|
2133
|
-
*/
|
|
2134
|
-
function () {
|
|
2135
|
-
var _this = this;
|
|
2136
|
-
this.shouldUseFallback = this.supportsNativeTimepicker();
|
|
2137
|
-
this.minutes = this.getMinutes();
|
|
2138
|
-
this.hours = this.getHours();
|
|
2139
|
-
this.fallbackForm = this.formBuilder.group({
|
|
2140
|
-
hours: null,
|
|
2141
|
-
minutes: null,
|
|
2142
|
-
});
|
|
2143
|
-
this.fallbackForm.valueChanges
|
|
2144
|
-
.pipe(takeUntil(this.componentDestroyed$))
|
|
2145
|
-
.subscribe((/**
|
|
2146
|
-
* @param {?} formData
|
|
2147
|
-
* @return {?}
|
|
2148
|
-
*/
|
|
2149
|
-
function (formData) {
|
|
2150
|
-
if (formData.hours && formData.minutes) {
|
|
2151
|
-
_this.updateModel(formData.hours + ":" + formData.minutes);
|
|
2152
|
-
}
|
|
2153
|
-
else {
|
|
2154
|
-
_this.updateModel('');
|
|
2155
|
-
}
|
|
2156
|
-
}));
|
|
2157
|
-
this.timeControl.valueChanges
|
|
2158
|
-
.pipe(takeUntil(this.componentDestroyed$))
|
|
2159
|
-
.subscribe((/**
|
|
2160
|
-
* @param {?} time
|
|
2161
|
-
* @return {?}
|
|
2162
|
-
*/
|
|
2163
|
-
function (time) {
|
|
2164
|
-
_this.updateModel(time);
|
|
2165
|
-
}));
|
|
2166
|
-
};
|
|
2167
|
-
/**
|
|
2168
|
-
* @return {?}
|
|
2169
|
-
*/
|
|
2170
|
-
TimepickerComponent.prototype.ngOnDestroy = /**
|
|
2171
|
-
* @return {?}
|
|
2172
|
-
*/
|
|
2173
|
-
function () {
|
|
2174
|
-
this.componentDestroyed$.next(true);
|
|
2175
|
-
this.componentDestroyed$.complete();
|
|
2176
|
-
};
|
|
2177
|
-
/**
|
|
2178
|
-
* @param {?} value
|
|
2179
|
-
* @return {?}
|
|
2180
|
-
*/
|
|
2181
|
-
TimepickerComponent.prototype.writeValue = /**
|
|
2182
|
-
* @param {?} value
|
|
2183
|
-
* @return {?}
|
|
2184
|
-
*/
|
|
2185
|
-
function (value) {
|
|
2186
|
-
this.timeControl.setValue(value, { emitEvent: false });
|
|
2187
|
-
if (value) {
|
|
2188
|
-
/** @type {?} */
|
|
2189
|
-
var splitted = value.split(':');
|
|
2190
|
-
this.fallbackForm.get('hours').setValue(splitted[0], { emitEvent: false });
|
|
2191
|
-
this.fallbackForm.get('minutes').setValue(splitted[1], { emitEvent: false });
|
|
2192
|
-
}
|
|
2193
|
-
};
|
|
2194
|
-
/**
|
|
2195
|
-
* @param {?} onChange
|
|
2196
|
-
* @return {?}
|
|
2197
|
-
*/
|
|
2198
|
-
TimepickerComponent.prototype.registerOnChange = /**
|
|
2199
|
-
* @param {?} onChange
|
|
2200
|
-
* @return {?}
|
|
2201
|
-
*/
|
|
2202
|
-
function (onChange) {
|
|
2203
|
-
this.updateModel = onChange;
|
|
2204
|
-
};
|
|
2205
|
-
/**
|
|
2206
|
-
* @return {?}
|
|
2207
|
-
*/
|
|
2208
|
-
TimepickerComponent.prototype.registerOnTouched = /**
|
|
2209
|
-
* @return {?}
|
|
2210
|
-
*/
|
|
2211
|
-
function () {
|
|
2212
|
-
};
|
|
2213
|
-
/**
|
|
2214
|
-
* @param {?} isDisabled
|
|
2215
|
-
* @return {?}
|
|
2216
|
-
*/
|
|
2217
|
-
TimepickerComponent.prototype.setDisabledState = /**
|
|
2218
|
-
* @param {?} isDisabled
|
|
2219
|
-
* @return {?}
|
|
2220
|
-
*/
|
|
2221
|
-
function (isDisabled) {
|
|
2222
|
-
if (isDisabled) {
|
|
2223
|
-
this.timeControl.disable({ emitEvent: false });
|
|
2224
|
-
this.fallbackForm.disable({ emitEvent: false });
|
|
2225
|
-
}
|
|
2226
|
-
else {
|
|
2227
|
-
this.timeControl.enable({ emitEvent: false });
|
|
2228
|
-
this.fallbackForm.enable({ emitEvent: false });
|
|
2229
|
-
}
|
|
2230
|
-
};
|
|
2231
|
-
/**
|
|
2232
|
-
* @private
|
|
2233
|
-
* @return {?}
|
|
2234
|
-
*/
|
|
2235
|
-
TimepickerComponent.prototype.supportsNativeTimepicker = /**
|
|
2236
|
-
* @private
|
|
2237
|
-
* @return {?}
|
|
2238
|
-
*/
|
|
2239
|
-
function () {
|
|
2240
|
-
/** @type {?} */
|
|
2241
|
-
var element = this.renderer.createElement('input');
|
|
2242
|
-
element.type = 'time';
|
|
2243
|
-
return element.type === 'text';
|
|
2244
|
-
};
|
|
2245
|
-
/**
|
|
2246
|
-
* @private
|
|
2247
|
-
* @return {?}
|
|
2248
|
-
*/
|
|
2249
|
-
TimepickerComponent.prototype.getMinutes = /**
|
|
2250
|
-
* @private
|
|
2251
|
-
* @return {?}
|
|
2252
|
-
*/
|
|
2253
|
-
function () {
|
|
2254
|
-
return Array(60).fill('').map((/**
|
|
2255
|
-
* @param {?} value
|
|
2256
|
-
* @param {?} index
|
|
2257
|
-
* @return {?}
|
|
2258
|
-
*/
|
|
2259
|
-
function (value, index) {
|
|
2260
|
-
return DateHelper.addLeadingZero(index);
|
|
2261
|
-
}));
|
|
2262
|
-
};
|
|
2263
|
-
/**
|
|
2264
|
-
* @private
|
|
2265
|
-
* @return {?}
|
|
2266
|
-
*/
|
|
2267
|
-
TimepickerComponent.prototype.getHours = /**
|
|
2268
|
-
* @private
|
|
2269
|
-
* @return {?}
|
|
2270
|
-
*/
|
|
2271
|
-
function () {
|
|
2272
|
-
return Array(24).fill('').map((/**
|
|
2273
|
-
* @param {?} value
|
|
2274
|
-
* @param {?} index
|
|
2275
|
-
* @return {?}
|
|
2276
|
-
*/
|
|
2277
|
-
function (value, index) {
|
|
2278
|
-
return DateHelper.addLeadingZero(index);
|
|
2279
|
-
}));
|
|
2280
|
-
};
|
|
2281
|
-
TimepickerComponent.decorators = [
|
|
2282
|
-
{ type: Component, args: [{
|
|
2283
|
-
selector: 'aui-timepicker',
|
|
2284
|
-
template: "<div class=\"m-timepicker\">\n <div *ngIf=\"!shouldUseFallback\" [class]=\"'a-input--' + size\" [ngClass]=\"{ 'has-error': hasError }\" class=\"a-input\">\n <input [attr.aria-label]=\"ariaLabelHours + ':' + ariaLabelMinutes\" [formControl]=\"timeControl\" [id]=\"id\"\n type=\"time\">\n </div>\n\n <div *ngIf=\"shouldUseFallback\" [formGroup]=\"fallbackForm\">\n <div [class]=\"'a-input--' + size\" [ngClass]=\"{ 'has-error': hasError }\" class=\"a-input has-icon-right\">\n <div class=\"a-input__wrapper\">\n <select [attr.aria-label]=\"ariaLabelHours\" [id]=\"id\" formControlName=\"hours\">\n <option disabled value=\"null\">{{ hoursPlaceholder }}</option>\n <option *ngFor=\"let hour of hours\" [value]=\"hour\">{{ hour }}</option>\n </select>\n <aui-icon name=\"ai-arrow-down-1\"></aui-icon>\n </div>\n </div>\n\n <div [class]=\"'a-input--' + size\" [ngClass]=\"{ 'has-error': hasError }\" class=\"a-input has-icon-right\">\n <div class=\"a-input__wrapper\">\n <select [attr.aria-label]=\"ariaLabelMinutes\" formControlName=\"minutes\">\n <option disabled value=\"null\">{{ minutesPlaceholder }}</option>\n <option *ngFor=\"let minute of minutes\" [value]=\"minute\">{{ minute }}</option>\n </select>\n <aui-icon name=\"ai-arrow-down-1\"></aui-icon>\n </div>\n </div>\n </div>\n</div>\n",
|
|
2285
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2286
|
-
providers: [{
|
|
2287
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2288
|
-
useExisting: forwardRef((/**
|
|
2289
|
-
* @return {?}
|
|
2290
|
-
*/
|
|
2291
|
-
function () { return TimepickerComponent; })),
|
|
2292
|
-
// tslint:disable-line:no-forward-ref
|
|
2293
|
-
multi: true,
|
|
2294
|
-
}],
|
|
2295
|
-
styles: [":host{display:block}"]
|
|
2296
|
-
}] }
|
|
2297
|
-
];
|
|
2298
|
-
/** @nocollapse */
|
|
2299
|
-
TimepickerComponent.ctorParameters = function () { return [
|
|
2300
|
-
{ type: FormBuilder },
|
|
2301
|
-
{ type: Renderer2 }
|
|
2302
|
-
]; };
|
|
2303
|
-
TimepickerComponent.propDecorators = {
|
|
2304
|
-
id: [{ type: Input }],
|
|
2305
|
-
hoursPlaceholder: [{ type: Input }],
|
|
2306
|
-
minutesPlaceholder: [{ type: Input }],
|
|
2307
|
-
hasError: [{ type: Input }],
|
|
2308
|
-
size: [{ type: Input }],
|
|
2309
|
-
ariaLabelHours: [{ type: Input }],
|
|
2310
|
-
ariaLabelMinutes: [{ type: Input }]
|
|
2311
|
-
};
|
|
2312
|
-
return TimepickerComponent;
|
|
2313
|
-
}());
|
|
2314
|
-
if (false) {
|
|
2315
|
-
/** @type {?} */
|
|
2316
|
-
TimepickerComponent.prototype.id;
|
|
2317
|
-
/** @type {?} */
|
|
2318
|
-
TimepickerComponent.prototype.hoursPlaceholder;
|
|
2319
|
-
/** @type {?} */
|
|
2320
|
-
TimepickerComponent.prototype.minutesPlaceholder;
|
|
2321
|
-
/** @type {?} */
|
|
2322
|
-
TimepickerComponent.prototype.hasError;
|
|
2323
|
-
/** @type {?} */
|
|
2324
|
-
TimepickerComponent.prototype.size;
|
|
2325
|
-
/** @type {?} */
|
|
2326
|
-
TimepickerComponent.prototype.ariaLabelHours;
|
|
2327
|
-
/** @type {?} */
|
|
2328
|
-
TimepickerComponent.prototype.ariaLabelMinutes;
|
|
2329
|
-
/** @type {?} */
|
|
2330
|
-
TimepickerComponent.prototype.shouldUseFallback;
|
|
2331
|
-
/** @type {?} */
|
|
2332
|
-
TimepickerComponent.prototype.minutes;
|
|
2333
|
-
/** @type {?} */
|
|
2334
|
-
TimepickerComponent.prototype.hours;
|
|
2335
|
-
/** @type {?} */
|
|
2336
|
-
TimepickerComponent.prototype.updateModel;
|
|
2337
|
-
/** @type {?} */
|
|
2338
|
-
TimepickerComponent.prototype.timeControl;
|
|
2339
|
-
/** @type {?} */
|
|
2340
|
-
TimepickerComponent.prototype.fallbackForm;
|
|
2341
|
-
/**
|
|
2342
|
-
* @type {?}
|
|
2343
|
-
* @private
|
|
2344
|
-
*/
|
|
2345
|
-
TimepickerComponent.prototype.componentDestroyed$;
|
|
2346
|
-
/**
|
|
2347
|
-
* @type {?}
|
|
2348
|
-
* @private
|
|
2349
|
-
*/
|
|
2350
|
-
TimepickerComponent.prototype.formBuilder;
|
|
2351
|
-
/**
|
|
2352
|
-
* @type {?}
|
|
2353
|
-
* @private
|
|
2354
|
-
*/
|
|
2355
|
-
TimepickerComponent.prototype.renderer;
|
|
2356
|
-
}
|
|
2357
|
-
|
|
2358
|
-
/**
|
|
2359
|
-
* @fileoverview added by tsickle
|
|
2360
|
-
* Generated from: lib/timepicker/timepicker.module.ts
|
|
2361
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2362
|
-
*/
|
|
2363
|
-
var TimepickerModule = /** @class */ (function () {
|
|
2364
|
-
function TimepickerModule() {
|
|
2365
|
-
}
|
|
2366
|
-
TimepickerModule.decorators = [
|
|
2367
|
-
{ type: NgModule, args: [{
|
|
2368
|
-
imports: [
|
|
2369
|
-
ReactiveFormsModule,
|
|
2370
|
-
CommonModule,
|
|
2371
|
-
IconModule,
|
|
2372
|
-
],
|
|
2373
|
-
declarations: [
|
|
2374
|
-
TimepickerComponent,
|
|
2375
|
-
],
|
|
2376
|
-
exports: [
|
|
2377
|
-
TimepickerComponent,
|
|
2378
|
-
],
|
|
2379
|
-
providers: [],
|
|
2380
|
-
},] }
|
|
2381
|
-
];
|
|
2382
|
-
return TimepickerModule;
|
|
2383
|
-
}());
|
|
2384
|
-
|
|
2385
|
-
/**
|
|
2386
|
-
* @fileoverview added by tsickle
|
|
2387
|
-
* Generated from: lib/timepicker/public-api.ts
|
|
2388
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2389
|
-
*/
|
|
2390
|
-
|
|
2391
|
-
/**
|
|
2392
|
-
* @fileoverview added by tsickle
|
|
2393
|
-
* Generated from: lib/upload/upload.conf.ts
|
|
2394
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2395
|
-
*/
|
|
2396
|
-
/** @type {?} */
|
|
2397
|
-
var UPLOAD_OPTIONS_DEFAULT = {
|
|
2398
|
-
allowedMimeTypes: [],
|
|
2399
|
-
allowedFileTypes: [],
|
|
2400
|
-
autoUpload: false,
|
|
2401
|
-
maxFileSize: 0,
|
|
2402
|
-
// 0 is infinite
|
|
2403
|
-
queueLimit: 0,
|
|
2404
|
-
// 0 is infinite
|
|
2405
|
-
type: 'drop',
|
|
2406
|
-
url: '',
|
|
2407
|
-
};
|
|
2408
|
-
/** @type {?} */
|
|
2409
|
-
var UPLOAD_VALIDATION_MESSAGES = new InjectionToken('uploadValidationMessages');
|
|
2410
|
-
|
|
2411
|
-
/**
|
|
2412
|
-
* @fileoverview added by tsickle
|
|
2413
|
-
* Generated from: lib/upload/classes/uploader.class.ts
|
|
2414
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2415
|
-
*/
|
|
2416
|
-
var Uploader = /** @class */ (function () {
|
|
2417
|
-
function Uploader(options) {
|
|
2418
|
-
this.options = UPLOAD_OPTIONS_DEFAULT;
|
|
2419
|
-
this.setOptions(options);
|
|
2420
|
-
}
|
|
2421
|
-
/**
|
|
2422
|
-
* @param {?} options
|
|
2423
|
-
* @return {?}
|
|
2424
|
-
*/
|
|
2425
|
-
Uploader.prototype.setOptions = /**
|
|
2426
|
-
* @param {?} options
|
|
2427
|
-
* @return {?}
|
|
2428
|
-
*/
|
|
2429
|
-
function (options) {
|
|
2430
|
-
this.options = Object.assign({}, this.options, options);
|
|
2431
|
-
};
|
|
2432
|
-
/**
|
|
2433
|
-
* @param {?} files
|
|
2434
|
-
* @return {?}
|
|
2435
|
-
*/
|
|
2436
|
-
Uploader.prototype.uploadFiles = /**
|
|
2437
|
-
* @param {?} files
|
|
2438
|
-
* @return {?}
|
|
2439
|
-
*/
|
|
2440
|
-
function (files) {
|
|
2441
|
-
var _this = this;
|
|
2442
|
-
/** @type {?} */
|
|
2443
|
-
var formData = this.filesToFormData(files);
|
|
2444
|
-
return new Observable((/**
|
|
2445
|
-
* @param {?} observer
|
|
2446
|
-
* @return {?}
|
|
2447
|
-
*/
|
|
2448
|
-
function (observer) {
|
|
2449
|
-
/** @type {?} */
|
|
2450
|
-
var xhr = new XMLHttpRequest();
|
|
2451
|
-
// Progress callback
|
|
2452
|
-
xhr.upload.addEventListener('progress', (/**
|
|
2453
|
-
* @param {?} e
|
|
2454
|
-
* @return {?}
|
|
2455
|
-
*/
|
|
2456
|
-
function (e) {
|
|
2457
|
-
if (e.lengthComputable) {
|
|
2458
|
-
/** @type {?} */
|
|
2459
|
-
var percentComplete = e.loaded / e.total;
|
|
2460
|
-
observer.next({
|
|
2461
|
-
progress: percentComplete,
|
|
2462
|
-
data: null,
|
|
2463
|
-
});
|
|
2464
|
-
}
|
|
2465
|
-
}));
|
|
2466
|
-
// Complete callback
|
|
2467
|
-
xhr.onload = (/**
|
|
2468
|
-
* @return {?}
|
|
2469
|
-
*/
|
|
2470
|
-
function () {
|
|
2471
|
-
observer.next({
|
|
2472
|
-
progress: 1,
|
|
2473
|
-
data: xhr.response,
|
|
2474
|
-
});
|
|
2475
|
-
// observer.complete();
|
|
2476
|
-
});
|
|
2477
|
-
// Do request
|
|
2478
|
-
xhr.responseType = 'json';
|
|
2479
|
-
xhr.open('post', _this.options.url);
|
|
2480
|
-
xhr.send(formData);
|
|
2481
|
-
}));
|
|
2482
|
-
};
|
|
2483
|
-
/**
|
|
2484
|
-
* @param {?} files
|
|
2485
|
-
* @return {?}
|
|
2486
|
-
*/
|
|
2487
|
-
Uploader.prototype.validateFiles = /**
|
|
2488
|
-
* @param {?} files
|
|
2489
|
-
* @return {?}
|
|
2490
|
-
*/
|
|
2491
|
-
function (files) {
|
|
2492
|
-
var e_1, _a;
|
|
2493
|
-
/** @type {?} */
|
|
2494
|
-
var validFiles = [];
|
|
2495
|
-
/** @type {?} */
|
|
2496
|
-
var invalidFiles = [];
|
|
2497
|
-
if (files.length > 0) {
|
|
2498
|
-
try {
|
|
2499
|
-
for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
|
|
2500
|
-
var file = files_1_1.value;
|
|
2501
|
-
/** @type {?} */
|
|
2502
|
-
var errors = [];
|
|
2503
|
-
if (!this.validateFileType(file)) {
|
|
2504
|
-
errors.push('INVALID_FILE_TYPE');
|
|
2505
|
-
}
|
|
2506
|
-
if (!this.validateFileSize(file)) {
|
|
2507
|
-
errors.push('INVALID_FILE_SIZE');
|
|
2508
|
-
}
|
|
2509
|
-
if (!this.validateMimeType(file)) {
|
|
2510
|
-
errors.push('INVALID_MIME_TYPE');
|
|
2511
|
-
}
|
|
2512
|
-
if (errors.length === 0) {
|
|
2513
|
-
validFiles.push(file);
|
|
2514
|
-
}
|
|
2515
|
-
else {
|
|
2516
|
-
invalidFiles.push({
|
|
2517
|
-
reasons: errors,
|
|
2518
|
-
file: file,
|
|
2519
|
-
});
|
|
2520
|
-
}
|
|
2521
|
-
}
|
|
2522
|
-
}
|
|
2523
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2524
|
-
finally {
|
|
2525
|
-
try {
|
|
2526
|
-
if (files_1_1 && !files_1_1.done && (_a = files_1.return)) _a.call(files_1);
|
|
2527
|
-
}
|
|
2528
|
-
finally { if (e_1) throw e_1.error; }
|
|
2529
|
-
}
|
|
2530
|
-
}
|
|
2531
|
-
return {
|
|
2532
|
-
validFiles: validFiles,
|
|
2533
|
-
invalidFiles: invalidFiles,
|
|
2534
|
-
};
|
|
2535
|
-
};
|
|
2536
|
-
/**
|
|
2537
|
-
* @protected
|
|
2538
|
-
* @param {?} files
|
|
2539
|
-
* @return {?}
|
|
2540
|
-
*/
|
|
2541
|
-
Uploader.prototype.filesToFormData = /**
|
|
2542
|
-
* @protected
|
|
2543
|
-
* @param {?} files
|
|
2544
|
-
* @return {?}
|
|
2545
|
-
*/
|
|
2546
|
-
function (files) {
|
|
2547
|
-
var e_2, _a;
|
|
2548
|
-
/** @type {?} */
|
|
2549
|
-
var formData = new FormData();
|
|
2550
|
-
if (!this.options.url || this.options.url === '') {
|
|
2551
|
-
throw new Error('Define the upload url.');
|
|
2552
|
-
}
|
|
2553
|
-
try {
|
|
2554
|
-
for (var files_2 = __values(files), files_2_1 = files_2.next(); !files_2_1.done; files_2_1 = files_2.next()) {
|
|
2555
|
-
var file = files_2_1.value;
|
|
2556
|
-
formData.append('file', file);
|
|
2557
|
-
}
|
|
2558
|
-
}
|
|
2559
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
2560
|
-
finally {
|
|
2561
|
-
try {
|
|
2562
|
-
if (files_2_1 && !files_2_1.done && (_a = files_2.return)) _a.call(files_2);
|
|
2563
|
-
}
|
|
2564
|
-
finally { if (e_2) throw e_2.error; }
|
|
2565
|
-
}
|
|
2566
|
-
return formData;
|
|
2567
|
-
};
|
|
2568
|
-
/**
|
|
2569
|
-
* @protected
|
|
2570
|
-
* @param {?} file
|
|
2571
|
-
* @return {?}
|
|
2572
|
-
*/
|
|
2573
|
-
Uploader.prototype.getFileExtension = /**
|
|
2574
|
-
* @protected
|
|
2575
|
-
* @param {?} file
|
|
2576
|
-
* @return {?}
|
|
2577
|
-
*/
|
|
2578
|
-
function (file) {
|
|
2579
|
-
return file.name.split('.')[file.name.split('.').length - 1];
|
|
2580
|
-
};
|
|
2581
|
-
/**
|
|
2582
|
-
* @protected
|
|
2583
|
-
* @param {?} file
|
|
2584
|
-
* @return {?}
|
|
2585
|
-
*/
|
|
2586
|
-
Uploader.prototype.validateFileType = /**
|
|
2587
|
-
* @protected
|
|
2588
|
-
* @param {?} file
|
|
2589
|
-
* @return {?}
|
|
2590
|
-
*/
|
|
2591
|
-
function (file) {
|
|
2592
|
-
/** @type {?} */
|
|
2593
|
-
var allowedFileTypes = this.options.allowedFileTypes;
|
|
2594
|
-
/** @type {?} */
|
|
2595
|
-
var ext = this.getFileExtension(file);
|
|
2596
|
-
// Filter defined?
|
|
2597
|
-
if (!Array.isArray(allowedFileTypes) || allowedFileTypes.length === 0) {
|
|
2598
|
-
return true;
|
|
2599
|
-
}
|
|
2600
|
-
// Make allowedFileTypes case insensitive
|
|
2601
|
-
/** @type {?} */
|
|
2602
|
-
var toUpper = (/**
|
|
2603
|
-
* @param {?} x
|
|
2604
|
-
* @return {?}
|
|
2605
|
-
*/
|
|
2606
|
-
function (x) { return x.toUpperCase(); });
|
|
2607
|
-
/** @type {?} */
|
|
2608
|
-
var allowedFileTypesToUpper = allowedFileTypes.map(toUpper);
|
|
2609
|
-
return allowedFileTypesToUpper.lastIndexOf(ext.toUpperCase()) !== -1;
|
|
2610
|
-
};
|
|
2611
|
-
/**
|
|
2612
|
-
* @protected
|
|
2613
|
-
* @param {?} file
|
|
2614
|
-
* @return {?}
|
|
2615
|
-
*/
|
|
2616
|
-
Uploader.prototype.validateFileSize = /**
|
|
2617
|
-
* @protected
|
|
2618
|
-
* @param {?} file
|
|
2619
|
-
* @return {?}
|
|
2620
|
-
*/
|
|
2621
|
-
function (file) {
|
|
2622
|
-
/** @type {?} */
|
|
2623
|
-
var maxFileSize = this.options.maxFileSize;
|
|
2624
|
-
// Filter defined?
|
|
2625
|
-
if (!maxFileSize || maxFileSize === 0) {
|
|
2626
|
-
return true;
|
|
2627
|
-
}
|
|
2628
|
-
return maxFileSize > file.size;
|
|
2629
|
-
};
|
|
2630
|
-
/**
|
|
2631
|
-
* @protected
|
|
2632
|
-
* @param {?} file
|
|
2633
|
-
* @return {?}
|
|
2634
|
-
*/
|
|
2635
|
-
Uploader.prototype.validateMimeType = /**
|
|
2636
|
-
* @protected
|
|
2637
|
-
* @param {?} file
|
|
2638
|
-
* @return {?}
|
|
2639
|
-
*/
|
|
2640
|
-
function (file) {
|
|
2641
|
-
/** @type {?} */
|
|
2642
|
-
var allowedMimeTypes = this.options.allowedMimeTypes;
|
|
2643
|
-
// Filter defined?
|
|
2644
|
-
if (!Array.isArray(allowedMimeTypes) || allowedMimeTypes.length === 0) {
|
|
2645
|
-
return true;
|
|
2646
|
-
}
|
|
2647
|
-
return allowedMimeTypes.lastIndexOf(file.type) !== -1;
|
|
2648
|
-
};
|
|
2649
|
-
return Uploader;
|
|
2650
|
-
}());
|
|
2651
|
-
if (false) {
|
|
2652
|
-
/** @type {?} */
|
|
2653
|
-
Uploader.prototype.options;
|
|
2654
|
-
}
|
|
2655
|
-
|
|
2656
|
-
/**
|
|
2657
|
-
* @fileoverview added by tsickle
|
|
2658
|
-
* Generated from: lib/upload/components/upload/upload.component.ts
|
|
2659
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2660
|
-
*/
|
|
2661
|
-
var UploadComponent = /** @class */ (function () {
|
|
2662
|
-
function UploadComponent() {
|
|
2663
|
-
this.id = '';
|
|
2664
|
-
this.accept = [];
|
|
2665
|
-
this.capture = '';
|
|
2666
|
-
this.ariaLabelRemove = 'Verwijder';
|
|
2667
|
-
this.disabled = false;
|
|
2668
|
-
this.multiple = true;
|
|
2669
|
-
this.options = UPLOAD_OPTIONS_DEFAULT;
|
|
2670
|
-
this.selectUploadedFiles = new EventEmitter();
|
|
2671
|
-
this.uploadedFiles = [];
|
|
2672
|
-
this.invalidFiles = [];
|
|
2673
|
-
this.queuedFiles = [];
|
|
2674
|
-
}
|
|
2675
|
-
/**
|
|
2676
|
-
* @return {?}
|
|
2677
|
-
*/
|
|
2678
|
-
UploadComponent.prototype.ngOnInit = /**
|
|
2679
|
-
* @return {?}
|
|
2680
|
-
*/
|
|
2681
|
-
function () {
|
|
2682
|
-
if (!this.id) {
|
|
2683
|
-
this.ariaId = 'aui-upload-' + Math.random().toString(36).substring(2);
|
|
2684
|
-
}
|
|
2685
|
-
this.uploader = new Uploader(this.options);
|
|
2686
|
-
};
|
|
2687
|
-
/**
|
|
2688
|
-
* @param {?} files
|
|
2689
|
-
* @return {?}
|
|
2690
|
-
*/
|
|
2691
|
-
UploadComponent.prototype.onUploadedFiles = /**
|
|
2692
|
-
* @param {?} files
|
|
2693
|
-
* @return {?}
|
|
2694
|
-
*/
|
|
2695
|
-
function (files) {
|
|
2696
|
-
this.uploadedFiles = this.uploadedFiles.concat(files);
|
|
2697
|
-
this.selectUploadedFiles.emit(this.uploadedFiles);
|
|
2698
|
-
};
|
|
2699
|
-
/**
|
|
2700
|
-
* @param {?} files
|
|
2701
|
-
* @return {?}
|
|
2702
|
-
*/
|
|
2703
|
-
UploadComponent.prototype.onInvalidFiles = /**
|
|
2704
|
-
* @param {?} files
|
|
2705
|
-
* @return {?}
|
|
2706
|
-
*/
|
|
2707
|
-
function (files) {
|
|
2708
|
-
this.invalidFiles = files;
|
|
2709
|
-
};
|
|
2710
|
-
/**
|
|
2711
|
-
* @param {?} files
|
|
2712
|
-
* @return {?}
|
|
2713
|
-
*/
|
|
2714
|
-
UploadComponent.prototype.onQueuedFiles = /**
|
|
2715
|
-
* @param {?} files
|
|
2716
|
-
* @return {?}
|
|
2717
|
-
*/
|
|
2718
|
-
function (files) {
|
|
2719
|
-
this.queuedFiles = this.queuedFiles.concat(files);
|
|
2720
|
-
};
|
|
2721
|
-
UploadComponent.decorators = [
|
|
2722
|
-
{ type: Component, args: [{
|
|
2723
|
-
selector: 'aui-upload',
|
|
2724
|
-
template: "<div class=\"m-upload aui-upload\">\n <aui-upload-zone\n [id]=\"id\"\n [accept]=\"accept\"\n [capture]=\"capture\"\n [ariaId]=\"ariaId\"\n [disabled]=\"disabled\"\n [multiple]=\"multiple\"\n [uploader]=\"uploader\"\n (invalidFiles)=\"onInvalidFiles($event)\"\n (queuedFiles)=\"onQueuedFiles($event)\"\n (uploadedFiles)=\"onUploadedFiles($event)\">\n <div class=\"m-upload__message\">\n <ng-content select=\".m-upload__message\"></ng-content>\n </div>\n <div class=\"m-upload__description\">\n <ng-content select=\".m-upload__description\"></ng-content>\n </div>\n <div class=\"m-upload__button\">\n <ng-content select=\".m-upload__button\"></ng-content>\n </div>\n </aui-upload-zone>\n <aui-validation-list [ariaLabelRemove]=\"ariaLabelRemove\" [invalidFiles]=\"invalidFiles\"></aui-validation-list>\n <aui-upload-queue (uploadedFiles)=\"onUploadedFiles($event)\" *ngIf=\"!options?.autoUpload\" [ariaLabelRemove]=\"ariaLabelRemove\"\n [files]=\"queuedFiles\" [uploader]=\"uploader\"></aui-upload-queue>\n</div>\n",
|
|
2725
|
-
styles: [".m-upload__button>.m-upload__input{display:none}"]
|
|
2726
|
-
}] }
|
|
2727
|
-
];
|
|
2728
|
-
UploadComponent.propDecorators = {
|
|
2729
|
-
id: [{ type: Input }],
|
|
2730
|
-
accept: [{ type: Input }],
|
|
2731
|
-
capture: [{ type: Input }],
|
|
2732
|
-
ariaLabelRemove: [{ type: Input }],
|
|
2733
|
-
disabled: [{ type: Input }],
|
|
2734
|
-
multiple: [{ type: Input }],
|
|
2735
|
-
options: [{ type: Input }],
|
|
2736
|
-
selectUploadedFiles: [{ type: Output }]
|
|
2737
|
-
};
|
|
2738
|
-
return UploadComponent;
|
|
2739
|
-
}());
|
|
2740
|
-
if (false) {
|
|
2741
|
-
/** @type {?} */
|
|
2742
|
-
UploadComponent.prototype.id;
|
|
2743
|
-
/** @type {?} */
|
|
2744
|
-
UploadComponent.prototype.accept;
|
|
2745
|
-
/** @type {?} */
|
|
2746
|
-
UploadComponent.prototype.capture;
|
|
2747
|
-
/** @type {?} */
|
|
2748
|
-
UploadComponent.prototype.ariaLabelRemove;
|
|
2749
|
-
/** @type {?} */
|
|
2750
|
-
UploadComponent.prototype.disabled;
|
|
2751
|
-
/** @type {?} */
|
|
2752
|
-
UploadComponent.prototype.multiple;
|
|
2753
|
-
/** @type {?} */
|
|
2754
|
-
UploadComponent.prototype.options;
|
|
2755
|
-
/** @type {?} */
|
|
2756
|
-
UploadComponent.prototype.selectUploadedFiles;
|
|
2757
|
-
/** @type {?} */
|
|
2758
|
-
UploadComponent.prototype.uploader;
|
|
2759
|
-
/** @type {?} */
|
|
2760
|
-
UploadComponent.prototype.ariaId;
|
|
2761
|
-
/** @type {?} */
|
|
2762
|
-
UploadComponent.prototype.uploadedFiles;
|
|
2763
|
-
/** @type {?} */
|
|
2764
|
-
UploadComponent.prototype.invalidFiles;
|
|
2765
|
-
/** @type {?} */
|
|
2766
|
-
UploadComponent.prototype.queuedFiles;
|
|
2767
|
-
}
|
|
2768
|
-
|
|
2769
|
-
/**
|
|
2770
|
-
* @fileoverview added by tsickle
|
|
2771
|
-
* Generated from: lib/upload/components/upload-input/upload-input.component.ts
|
|
2772
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2773
|
-
*/
|
|
2774
|
-
var UploadInputComponent = /** @class */ (function () {
|
|
2775
|
-
function UploadInputComponent() {
|
|
2776
|
-
this.propagateChange = (/**
|
|
2777
|
-
* @param {?} _
|
|
2778
|
-
* @return {?}
|
|
2779
|
-
*/
|
|
2780
|
-
function (_) { return undefined; });
|
|
2781
|
-
}
|
|
2782
|
-
/**
|
|
2783
|
-
* @param {?} value
|
|
2784
|
-
* @return {?}
|
|
2785
|
-
*/
|
|
2786
|
-
UploadInputComponent.prototype.writeValue = /**
|
|
2787
|
-
* @param {?} value
|
|
2788
|
-
* @return {?}
|
|
2789
|
-
*/
|
|
2790
|
-
function (value) {
|
|
2791
|
-
};
|
|
2792
|
-
/**
|
|
2793
|
-
* @param {?} fn
|
|
2794
|
-
* @return {?}
|
|
2795
|
-
*/
|
|
2796
|
-
UploadInputComponent.prototype.registerOnChange = /**
|
|
2797
|
-
* @param {?} fn
|
|
2798
|
-
* @return {?}
|
|
2799
|
-
*/
|
|
2800
|
-
function (fn) {
|
|
2801
|
-
this.propagateChange = fn;
|
|
2802
|
-
};
|
|
2803
|
-
/**
|
|
2804
|
-
* @return {?}
|
|
2805
|
-
*/
|
|
2806
|
-
UploadInputComponent.prototype.registerOnTouched = /**
|
|
2807
|
-
* @return {?}
|
|
2808
|
-
*/
|
|
2809
|
-
function () {
|
|
2810
|
-
};
|
|
2811
|
-
/**
|
|
2812
|
-
* @param {?} files
|
|
2813
|
-
* @return {?}
|
|
2814
|
-
*/
|
|
2815
|
-
UploadInputComponent.prototype.onUpload = /**
|
|
2816
|
-
* @param {?} files
|
|
2817
|
-
* @return {?}
|
|
2818
|
-
*/
|
|
2819
|
-
function (files) {
|
|
2820
|
-
/** @type {?} */
|
|
2821
|
-
var data = (this.format ? this.format(files) : files);
|
|
2822
|
-
this.propagateChange(data);
|
|
2823
|
-
};
|
|
2824
|
-
UploadInputComponent.decorators = [
|
|
2825
|
-
{ type: Component, args: [{
|
|
2826
|
-
selector: 'aui-upload-input',
|
|
2827
|
-
template: "<aui-upload (selectUploadedFiles)=\"onUpload($event)\" [options]=\"options\">\n <div class=\"m-upload__message\">\n <ng-content select=\".m-upload__message\"></ng-content>\n </div>\n <div class=\"m-upload__description\">\n <ng-content select=\".m-upload__description\"></ng-content>\n </div>\n <div class=\"m-upload__button\">\n <ng-content select=\".m-upload__button\"></ng-content>\n </div>\n</aui-upload>\n",
|
|
2828
|
-
providers: [{
|
|
2829
|
-
provide: NG_VALUE_ACCESSOR,
|
|
2830
|
-
useExisting: UploadInputComponent,
|
|
2831
|
-
multi: true,
|
|
2832
|
-
}]
|
|
2833
|
-
}] }
|
|
2834
|
-
];
|
|
2835
|
-
UploadInputComponent.propDecorators = {
|
|
2836
|
-
options: [{ type: Input }],
|
|
2837
|
-
format: [{ type: Input }]
|
|
2838
|
-
};
|
|
2839
|
-
return UploadInputComponent;
|
|
2840
|
-
}());
|
|
2841
|
-
if (false) {
|
|
2842
|
-
/** @type {?} */
|
|
2843
|
-
UploadInputComponent.prototype.options;
|
|
2844
|
-
/** @type {?} */
|
|
2845
|
-
UploadInputComponent.prototype.format;
|
|
2846
|
-
/** @type {?} */
|
|
2847
|
-
UploadInputComponent.prototype.propagateChange;
|
|
2848
|
-
}
|
|
2849
|
-
|
|
2850
|
-
/**
|
|
2851
|
-
* @fileoverview added by tsickle
|
|
2852
|
-
* Generated from: lib/upload/components/upload-queue/upload-queue.component.ts
|
|
2853
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2854
|
-
*/
|
|
2855
|
-
var UploadQueueComponent = /** @class */ (function () {
|
|
2856
|
-
function UploadQueueComponent() {
|
|
2857
|
-
this.ariaLabelRemove = 'Verwijder';
|
|
2858
|
-
this.uploadedFiles = new EventEmitter();
|
|
2859
|
-
this.uploadProgress = 0;
|
|
2860
|
-
}
|
|
2861
|
-
/**
|
|
2862
|
-
* @param {?} index
|
|
2863
|
-
* @return {?}
|
|
2864
|
-
*/
|
|
2865
|
-
UploadQueueComponent.prototype.remove = /**
|
|
2866
|
-
* @param {?} index
|
|
2867
|
-
* @return {?}
|
|
2868
|
-
*/
|
|
2869
|
-
function (index) {
|
|
2870
|
-
this.files.splice(index, 1);
|
|
2871
|
-
};
|
|
2872
|
-
/**
|
|
2873
|
-
* @return {?}
|
|
2874
|
-
*/
|
|
2875
|
-
UploadQueueComponent.prototype.uploadFiles = /**
|
|
2876
|
-
* @return {?}
|
|
2877
|
-
*/
|
|
2878
|
-
function () {
|
|
2879
|
-
var _this = this;
|
|
2880
|
-
/** @type {?} */
|
|
2881
|
-
var progress = undefined;
|
|
2882
|
-
/** @type {?} */
|
|
2883
|
-
var data = undefined;
|
|
2884
|
-
this.uploader.uploadFiles(this.files).subscribe((/**
|
|
2885
|
-
* @param {?} response
|
|
2886
|
-
* @return {?}
|
|
2887
|
-
*/
|
|
2888
|
-
function (response) {
|
|
2889
|
-
if (response.progress) {
|
|
2890
|
-
_this.uploadProgress = Math.floor(response.progress * 100);
|
|
2891
|
-
}
|
|
2892
|
-
if (response.data) {
|
|
2893
|
-
_this.uploadedFiles.emit(response.data);
|
|
2894
|
-
_this.files = [];
|
|
2895
|
-
}
|
|
2896
|
-
}));
|
|
2897
|
-
};
|
|
2898
|
-
UploadQueueComponent.decorators = [
|
|
2899
|
-
{ type: Component, args: [{
|
|
2900
|
-
selector: 'aui-upload-queue',
|
|
2901
|
-
template: "<ul class=\"m-upload__files u-margin-bottom-xs\">\n <li *ngFor=\"let file of files; let i = index\">\n <aui-icon name=\"ai-common-file-empty\"></aui-icon>\n <span class=\"m-upload__filename\">{{ file.name }}</span>\n\n <button (click)=\"remove(i)\" class=\"m-upload__delete a-button-transparent a-button--default a-button--small has-icon\" type=\"button\">\n <aui-icon name=\"ai-close\" [ariaLabel]=\"ariaLabelRemove\"></aui-icon>\n </button>\n </li>\n</ul>\n\n<button (click)=\"uploadFiles()\" *ngIf=\"files.length > 0\" class=\"a-button\" type=\"button\">Upload</button>\n"
|
|
2902
|
-
}] }
|
|
2903
|
-
];
|
|
2904
|
-
UploadQueueComponent.propDecorators = {
|
|
2905
|
-
files: [{ type: Input }],
|
|
2906
|
-
uploader: [{ type: Input }],
|
|
2907
|
-
ariaLabelRemove: [{ type: Input }],
|
|
2908
|
-
uploadedFiles: [{ type: Output }]
|
|
2909
|
-
};
|
|
2910
|
-
return UploadQueueComponent;
|
|
2911
|
-
}());
|
|
2912
|
-
if (false) {
|
|
2913
|
-
/** @type {?} */
|
|
2914
|
-
UploadQueueComponent.prototype.files;
|
|
2915
|
-
/** @type {?} */
|
|
2916
|
-
UploadQueueComponent.prototype.uploader;
|
|
2917
|
-
/** @type {?} */
|
|
2918
|
-
UploadQueueComponent.prototype.ariaLabelRemove;
|
|
2919
|
-
/** @type {?} */
|
|
2920
|
-
UploadQueueComponent.prototype.uploadedFiles;
|
|
2921
|
-
/** @type {?} */
|
|
2922
|
-
UploadQueueComponent.prototype.uploadProgress;
|
|
2923
|
-
}
|
|
2924
|
-
|
|
2925
|
-
/**
|
|
2926
|
-
* @fileoverview added by tsickle
|
|
2927
|
-
* Generated from: lib/upload/components/upload-zone/upload-zone.component.ts
|
|
2928
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2929
|
-
*/
|
|
2930
|
-
var UploadZoneComponent = /** @class */ (function () {
|
|
2931
|
-
function UploadZoneComponent(renderer) {
|
|
2932
|
-
this.renderer = renderer;
|
|
2933
|
-
this.id = '';
|
|
2934
|
-
this.accept = [];
|
|
2935
|
-
this.capture = '';
|
|
2936
|
-
this.ariaId = '';
|
|
2937
|
-
this.disabled = false;
|
|
2938
|
-
this.multiple = true;
|
|
2939
|
-
this.uploadedFiles = new EventEmitter();
|
|
2940
|
-
this.queuedFiles = new EventEmitter();
|
|
2941
|
-
this.invalidFiles = new EventEmitter();
|
|
2942
|
-
this.hasDragOver = false;
|
|
2943
|
-
this.uploadProgress = 0;
|
|
2944
|
-
}
|
|
2945
|
-
/**
|
|
2946
|
-
* @param {?} event
|
|
2947
|
-
* @return {?}
|
|
2948
|
-
*/
|
|
2949
|
-
UploadZoneComponent.prototype.onDragOver = /**
|
|
2950
|
-
* @param {?} event
|
|
2951
|
-
* @return {?}
|
|
2952
|
-
*/
|
|
2953
|
-
function (event) {
|
|
2954
|
-
this.preventAndStop(event);
|
|
2955
|
-
this.hasDragOver = true;
|
|
2956
|
-
};
|
|
2957
|
-
/**
|
|
2958
|
-
* @param {?} event
|
|
2959
|
-
* @return {?}
|
|
2960
|
-
*/
|
|
2961
|
-
UploadZoneComponent.prototype.onDragLeave = /**
|
|
2962
|
-
* @param {?} event
|
|
2963
|
-
* @return {?}
|
|
2964
|
-
*/
|
|
2965
|
-
function (event) {
|
|
2966
|
-
this.preventAndStop(event);
|
|
2967
|
-
this.hasDragOver = false;
|
|
2968
|
-
};
|
|
2969
|
-
/**
|
|
2970
|
-
* @param {?} event
|
|
2971
|
-
* @return {?}
|
|
2972
|
-
*/
|
|
2973
|
-
UploadZoneComponent.prototype.onDrop = /**
|
|
2974
|
-
* @param {?} event
|
|
2975
|
-
* @return {?}
|
|
2976
|
-
*/
|
|
2977
|
-
function (event) {
|
|
2978
|
-
this.preventAndStop(event);
|
|
2979
|
-
this.hasDragOver = false;
|
|
2980
|
-
/** @type {?} */
|
|
2981
|
-
var files = this.fileListToArray(event.dataTransfer.files);
|
|
2982
|
-
this.handleFiles(files);
|
|
2983
|
-
};
|
|
2984
|
-
/**
|
|
2985
|
-
* @return {?}
|
|
2986
|
-
*/
|
|
2987
|
-
UploadZoneComponent.prototype.triggerFile = /**
|
|
2988
|
-
* @return {?}
|
|
2989
|
-
*/
|
|
2990
|
-
function () {
|
|
2991
|
-
this.fileInput.nativeElement.click();
|
|
2992
|
-
};
|
|
2993
|
-
/**
|
|
2994
|
-
* @return {?}
|
|
2995
|
-
*/
|
|
2996
|
-
UploadZoneComponent.prototype.updateFiles = /**
|
|
2997
|
-
* @return {?}
|
|
2998
|
-
*/
|
|
2999
|
-
function () {
|
|
3000
|
-
/** @type {?} */
|
|
3001
|
-
var files = this.fileListToArray(this.fileInput.nativeElement.files);
|
|
3002
|
-
this.handleFiles(files);
|
|
3003
|
-
};
|
|
3004
|
-
/**
|
|
3005
|
-
* @param {?} event
|
|
3006
|
-
* @return {?}
|
|
3007
|
-
*/
|
|
3008
|
-
UploadZoneComponent.prototype.onFileClick = /**
|
|
3009
|
-
* @param {?} event
|
|
3010
|
-
* @return {?}
|
|
3011
|
-
*/
|
|
3012
|
-
function (event) {
|
|
3013
|
-
// When removing a file make sure you can add it again later
|
|
3014
|
-
// See: https://stackoverflow.com/questions/59870335/ng2-file-upload-not-allowing-me-to-add-same-doc-after-ive-removed-it-from-que
|
|
3015
|
-
event.target.value = '';
|
|
3016
|
-
};
|
|
3017
|
-
/**
|
|
3018
|
-
* @return {?}
|
|
3019
|
-
*/
|
|
3020
|
-
UploadZoneComponent.prototype.ngAfterViewInit = /**
|
|
3021
|
-
* @return {?}
|
|
3022
|
-
*/
|
|
3023
|
-
function () {
|
|
3024
|
-
if (this.multiple !== false) {
|
|
3025
|
-
this.renderer.setProperty(this.fileInput.nativeElement, 'multiple', 'multiple');
|
|
3026
|
-
}
|
|
3027
|
-
if (!!this.accept.length) {
|
|
3028
|
-
this.renderer.setProperty(this.fileInput.nativeElement, 'accept', this.accept.join());
|
|
3029
|
-
}
|
|
3030
|
-
if (this.disabled) {
|
|
3031
|
-
this.renderer.setProperty(this.fileInput.nativeElement, 'disabled', 'disabled');
|
|
3032
|
-
}
|
|
3033
|
-
if (this.capture !== '') {
|
|
3034
|
-
this.renderer.setAttribute(this.fileInput.nativeElement, 'capture', this.capture);
|
|
3035
|
-
}
|
|
3036
|
-
};
|
|
3037
|
-
/**
|
|
3038
|
-
* @protected
|
|
3039
|
-
* @param {?} files
|
|
3040
|
-
* @return {?}
|
|
3041
|
-
*/
|
|
3042
|
-
UploadZoneComponent.prototype.handleFiles = /**
|
|
3043
|
-
* @protected
|
|
3044
|
-
* @param {?} files
|
|
3045
|
-
* @return {?}
|
|
3046
|
-
*/
|
|
3047
|
-
function (files) {
|
|
3048
|
-
/** @type {?} */
|
|
3049
|
-
var response = this.uploader.validateFiles(files);
|
|
3050
|
-
this.invalidFiles.emit(response.invalidFiles);
|
|
3051
|
-
if (this.uploader.options.autoUpload && response.validFiles.length > 0) {
|
|
3052
|
-
this.uploadFiles(response.validFiles);
|
|
3053
|
-
}
|
|
3054
|
-
else {
|
|
3055
|
-
this.queuedFiles.emit(response.validFiles);
|
|
3056
|
-
}
|
|
3057
|
-
};
|
|
3058
|
-
/**
|
|
3059
|
-
* @protected
|
|
3060
|
-
* @param {?} files
|
|
3061
|
-
* @return {?}
|
|
3062
|
-
*/
|
|
3063
|
-
UploadZoneComponent.prototype.uploadFiles = /**
|
|
3064
|
-
* @protected
|
|
3065
|
-
* @param {?} files
|
|
3066
|
-
* @return {?}
|
|
3067
|
-
*/
|
|
3068
|
-
function (files) {
|
|
3069
|
-
var _this = this;
|
|
3070
|
-
// Reset progress
|
|
3071
|
-
this.uploadProgress = 0;
|
|
3072
|
-
this.uploadingFiles = files;
|
|
3073
|
-
// upload
|
|
3074
|
-
this.uploader.uploadFiles(files).subscribe((/**
|
|
3075
|
-
* @param {?} response
|
|
3076
|
-
* @return {?}
|
|
3077
|
-
*/
|
|
3078
|
-
function (response) {
|
|
3079
|
-
if (response.progress) {
|
|
3080
|
-
_this.uploadProgress = Math.floor(response.progress * 100);
|
|
3081
|
-
}
|
|
3082
|
-
if (response.data) {
|
|
3083
|
-
_this.uploadedFiles.emit(response.data);
|
|
3084
|
-
}
|
|
3085
|
-
}), (/**
|
|
3086
|
-
* @param {?} err
|
|
3087
|
-
* @return {?}
|
|
3088
|
-
*/
|
|
3089
|
-
function (err) {
|
|
3090
|
-
console.log(err);
|
|
3091
|
-
}));
|
|
3092
|
-
};
|
|
3093
|
-
/**
|
|
3094
|
-
* @protected
|
|
3095
|
-
* @param {?} list
|
|
3096
|
-
* @return {?}
|
|
3097
|
-
*/
|
|
3098
|
-
UploadZoneComponent.prototype.fileListToArray = /**
|
|
3099
|
-
* @protected
|
|
3100
|
-
* @param {?} list
|
|
3101
|
-
* @return {?}
|
|
3102
|
-
*/
|
|
3103
|
-
function (list) {
|
|
3104
|
-
return Array.from(list);
|
|
3105
|
-
};
|
|
3106
|
-
/**
|
|
3107
|
-
* @protected
|
|
3108
|
-
* @param {?} event
|
|
3109
|
-
* @return {?}
|
|
3110
|
-
*/
|
|
3111
|
-
UploadZoneComponent.prototype.preventAndStop = /**
|
|
3112
|
-
* @protected
|
|
3113
|
-
* @param {?} event
|
|
3114
|
-
* @return {?}
|
|
3115
|
-
*/
|
|
3116
|
-
function (event) {
|
|
3117
|
-
event.preventDefault();
|
|
3118
|
-
event.stopPropagation();
|
|
3119
|
-
};
|
|
3120
|
-
UploadZoneComponent.decorators = [
|
|
3121
|
-
{ type: Component, args: [{
|
|
3122
|
-
selector: 'aui-upload-zone',
|
|
3123
|
-
template: "<div *ngIf=\"uploader.options.type === 'drop'\" [class.is-disabled]=\"disabled\" class=\"m-upload\">\n <div class=\"m-upload__inner\">\n <div class=\"m-upload__dropzone\">\n <input\n #fileInput\n type=\"file\"\n class=\"m-upload__input\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"ariaId\"\n (click)=\"onFileClick($event)\"\n (change)=\"updateFiles()\">\n\n <div *ngIf=\"!uploadProgress || uploadProgress === 0\" class=\"m-upload__content\">\n <p [id]=\"ariaId\" class=\"m-upload__message\">\n <ng-content select=\".m-upload__message\"></ng-content>\n </p>\n </div>\n\n <ng-container *ngIf=\"uploadProgress > 0\">\n <p class=\"m-upload__uploads u-text-bold u-margin-bottom-xs\">\n <ng-container *ngFor=\"let file of uploadingFiles; let last = last\">\n {{ file.name }}\n <ng-container *ngIf=\"!last\">,</ng-container>\n </ng-container>\n </p>\n <aui-progress-bar [value]=\"uploadProgress\" max=\"100\"></aui-progress-bar>\n </ng-container>\n </div>\n </div>\n\n <small class=\"m-upload__description\">\n <ng-content select=\".m-upload__description\"></ng-content>\n </small>\n</div>\n\n<button (click)=\"triggerFile()\" *ngIf=\"uploader.options.type === 'button'\" [disabled]=\"disabled\" class=\"a-button m-upload__button\"\n type=\"button\">\n <span [id]=\"ariaId\"><ng-content select=\".m-upload__button\"></ng-content></span>\n <input\n #fileInput\n type=\"file\"\n class=\"m-upload__input\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"ariaId\"\n (click)=\"onFileClick($event)\"\n (change)=\"updateFiles()\">\n</button>\n"
|
|
3124
|
-
}] }
|
|
3125
|
-
];
|
|
3126
|
-
/** @nocollapse */
|
|
3127
|
-
UploadZoneComponent.ctorParameters = function () { return [
|
|
3128
|
-
{ type: Renderer2 }
|
|
3129
|
-
]; };
|
|
3130
|
-
UploadZoneComponent.propDecorators = {
|
|
3131
|
-
fileInput: [{ type: ViewChild, args: ['fileInput', { static: false },] }],
|
|
3132
|
-
uploader: [{ type: Input }],
|
|
3133
|
-
id: [{ type: Input }],
|
|
3134
|
-
accept: [{ type: Input }],
|
|
3135
|
-
capture: [{ type: Input }],
|
|
3136
|
-
ariaId: [{ type: Input }],
|
|
3137
|
-
disabled: [{ type: Input }],
|
|
3138
|
-
multiple: [{ type: Input }],
|
|
3139
|
-
uploadedFiles: [{ type: Output }],
|
|
3140
|
-
queuedFiles: [{ type: Output }],
|
|
3141
|
-
invalidFiles: [{ type: Output }],
|
|
3142
|
-
onDragOver: [{ type: HostListener, args: ['dragover', ['$event'],] }],
|
|
3143
|
-
onDragLeave: [{ type: HostListener, args: ['dragleave', ['$event'],] }],
|
|
3144
|
-
onDrop: [{ type: HostListener, args: ['drop', ['$event'],] }]
|
|
3145
|
-
};
|
|
3146
|
-
return UploadZoneComponent;
|
|
3147
|
-
}());
|
|
3148
|
-
if (false) {
|
|
3149
|
-
/** @type {?} */
|
|
3150
|
-
UploadZoneComponent.prototype.fileInput;
|
|
3151
|
-
/** @type {?} */
|
|
3152
|
-
UploadZoneComponent.prototype.uploader;
|
|
3153
|
-
/** @type {?} */
|
|
3154
|
-
UploadZoneComponent.prototype.id;
|
|
3155
|
-
/** @type {?} */
|
|
3156
|
-
UploadZoneComponent.prototype.accept;
|
|
3157
|
-
/** @type {?} */
|
|
3158
|
-
UploadZoneComponent.prototype.capture;
|
|
3159
|
-
/** @type {?} */
|
|
3160
|
-
UploadZoneComponent.prototype.ariaId;
|
|
3161
|
-
/** @type {?} */
|
|
3162
|
-
UploadZoneComponent.prototype.disabled;
|
|
3163
|
-
/** @type {?} */
|
|
3164
|
-
UploadZoneComponent.prototype.multiple;
|
|
3165
|
-
/** @type {?} */
|
|
3166
|
-
UploadZoneComponent.prototype.uploadedFiles;
|
|
3167
|
-
/** @type {?} */
|
|
3168
|
-
UploadZoneComponent.prototype.queuedFiles;
|
|
3169
|
-
/** @type {?} */
|
|
3170
|
-
UploadZoneComponent.prototype.invalidFiles;
|
|
3171
|
-
/** @type {?} */
|
|
3172
|
-
UploadZoneComponent.prototype.hasDragOver;
|
|
3173
|
-
/** @type {?} */
|
|
3174
|
-
UploadZoneComponent.prototype.classNames;
|
|
3175
|
-
/** @type {?} */
|
|
3176
|
-
UploadZoneComponent.prototype.uploadProgress;
|
|
3177
|
-
/** @type {?} */
|
|
3178
|
-
UploadZoneComponent.prototype.uploadingFiles;
|
|
3179
|
-
/**
|
|
3180
|
-
* @type {?}
|
|
3181
|
-
* @private
|
|
3182
|
-
*/
|
|
3183
|
-
UploadZoneComponent.prototype.renderer;
|
|
3184
|
-
}
|
|
3185
|
-
|
|
3186
|
-
/**
|
|
3187
|
-
* @fileoverview added by tsickle
|
|
3188
|
-
* Generated from: lib/upload/services/validation-messages.service.ts
|
|
3189
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3190
|
-
*/
|
|
3191
|
-
var ValidationMessagesService = /** @class */ (function () {
|
|
3192
|
-
function ValidationMessagesService(initValues) {
|
|
3193
|
-
this.initValues = initValues;
|
|
3194
|
-
this.INVALID_FILE_TYPE = 'INVALID_FILE_TYPE';
|
|
3195
|
-
this.INVALID_FILE_SIZE = 'INVALID_FILE_SIZE';
|
|
3196
|
-
this.INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';
|
|
3197
|
-
if (initValues.INVALID_FILE_TYPE) {
|
|
3198
|
-
this.INVALID_FILE_TYPE = initValues.INVALID_FILE_TYPE;
|
|
3199
|
-
}
|
|
3200
|
-
if (initValues.INVALID_FILE_SIZE) {
|
|
3201
|
-
this.INVALID_FILE_SIZE = initValues.INVALID_FILE_SIZE;
|
|
3202
|
-
}
|
|
3203
|
-
if (initValues.INVALID_MIME_TYPE) {
|
|
3204
|
-
this.INVALID_MIME_TYPE = initValues.INVALID_MIME_TYPE;
|
|
3205
|
-
}
|
|
3206
|
-
}
|
|
3207
|
-
ValidationMessagesService.decorators = [
|
|
3208
|
-
{ type: Injectable }
|
|
3209
|
-
];
|
|
3210
|
-
/** @nocollapse */
|
|
3211
|
-
ValidationMessagesService.ctorParameters = function () { return [
|
|
3212
|
-
{ type: undefined, decorators: [{ type: Inject, args: [UPLOAD_VALIDATION_MESSAGES,] }] }
|
|
3213
|
-
]; };
|
|
3214
|
-
return ValidationMessagesService;
|
|
3215
|
-
}());
|
|
3216
|
-
if (false) {
|
|
3217
|
-
/** @type {?} */
|
|
3218
|
-
ValidationMessagesService.prototype.INVALID_FILE_TYPE;
|
|
3219
|
-
/** @type {?} */
|
|
3220
|
-
ValidationMessagesService.prototype.INVALID_FILE_SIZE;
|
|
3221
|
-
/** @type {?} */
|
|
3222
|
-
ValidationMessagesService.prototype.INVALID_MIME_TYPE;
|
|
3223
|
-
/**
|
|
3224
|
-
* @type {?}
|
|
3225
|
-
* @private
|
|
3226
|
-
*/
|
|
3227
|
-
ValidationMessagesService.prototype.initValues;
|
|
3228
|
-
}
|
|
3229
|
-
|
|
3230
|
-
/**
|
|
3231
|
-
* @fileoverview added by tsickle
|
|
3232
|
-
* Generated from: lib/upload/components/validation-list/validation-list.component.ts
|
|
3233
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3234
|
-
*/
|
|
3235
|
-
var ValidationListComponent = /** @class */ (function () {
|
|
3236
|
-
function ValidationListComponent(messagesService) {
|
|
3237
|
-
this.messagesService = messagesService;
|
|
3238
|
-
this.invalidFiles = [];
|
|
3239
|
-
this.ariaLabelRemove = 'Verwijder';
|
|
3240
|
-
}
|
|
3241
|
-
/**
|
|
3242
|
-
* @param {?} index
|
|
3243
|
-
* @return {?}
|
|
3244
|
-
*/
|
|
3245
|
-
ValidationListComponent.prototype.remove = /**
|
|
3246
|
-
* @param {?} index
|
|
3247
|
-
* @return {?}
|
|
3248
|
-
*/
|
|
3249
|
-
function (index) {
|
|
3250
|
-
this.invalidFiles.splice(index, 1);
|
|
3251
|
-
};
|
|
3252
|
-
/**
|
|
3253
|
-
* @param {?} reasons
|
|
3254
|
-
* @return {?}
|
|
3255
|
-
*/
|
|
3256
|
-
ValidationListComponent.prototype.formatReasons = /**
|
|
3257
|
-
* @param {?} reasons
|
|
3258
|
-
* @return {?}
|
|
3259
|
-
*/
|
|
3260
|
-
function (reasons) {
|
|
3261
|
-
var e_1, _a;
|
|
3262
|
-
/** @type {?} */
|
|
3263
|
-
var result = [];
|
|
3264
|
-
try {
|
|
3265
|
-
for (var reasons_1 = __values(reasons), reasons_1_1 = reasons_1.next(); !reasons_1_1.done; reasons_1_1 = reasons_1.next()) {
|
|
3266
|
-
var reason = reasons_1_1.value;
|
|
3267
|
-
result.push(this.messagesService[reason]);
|
|
3268
|
-
}
|
|
3269
|
-
}
|
|
3270
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3271
|
-
finally {
|
|
3272
|
-
try {
|
|
3273
|
-
if (reasons_1_1 && !reasons_1_1.done && (_a = reasons_1.return)) _a.call(reasons_1);
|
|
3274
|
-
}
|
|
3275
|
-
finally { if (e_1) throw e_1.error; }
|
|
3276
|
-
}
|
|
3277
|
-
return result.join(', ');
|
|
3278
|
-
};
|
|
3279
|
-
ValidationListComponent.decorators = [
|
|
3280
|
-
{ type: Component, args: [{
|
|
3281
|
-
selector: 'aui-validation-list',
|
|
3282
|
-
template: "<ul class=\"m-upload__files\">\n <li *ngFor=\"let invalidFile of invalidFiles; let i = index\" class=\"is-error\">\n <aui-icon name=\"ai-alert-triangle\"></aui-icon>\n <span class=\"m-upload__filename\">{{ invalidFile.file.name }}</span>\n <span class=\"m-upload__error\">{{ formatReasons(invalidFile.reasons) }}</span>\n\n <button (click)=\"remove(i)\" class=\"m-upload__delete a-button-transparent a-button--danger a-button--small has-icon\"\n type=\"button\">\n <aui-icon name=\"ai-close\" [ariaLabel]=\"ariaLabelRemove\"></aui-icon>\n </button>\n </li>\n</ul>\n"
|
|
3283
|
-
}] }
|
|
3284
|
-
];
|
|
3285
|
-
/** @nocollapse */
|
|
3286
|
-
ValidationListComponent.ctorParameters = function () { return [
|
|
3287
|
-
{ type: ValidationMessagesService }
|
|
3288
|
-
]; };
|
|
3289
|
-
ValidationListComponent.propDecorators = {
|
|
3290
|
-
invalidFiles: [{ type: Input }],
|
|
3291
|
-
ariaLabelRemove: [{ type: Input }]
|
|
3292
|
-
};
|
|
3293
|
-
return ValidationListComponent;
|
|
3294
|
-
}());
|
|
3295
|
-
if (false) {
|
|
3296
|
-
/** @type {?} */
|
|
3297
|
-
ValidationListComponent.prototype.invalidFiles;
|
|
3298
|
-
/** @type {?} */
|
|
3299
|
-
ValidationListComponent.prototype.ariaLabelRemove;
|
|
3300
|
-
/**
|
|
3301
|
-
* @type {?}
|
|
3302
|
-
* @private
|
|
3303
|
-
*/
|
|
3304
|
-
ValidationListComponent.prototype.messagesService;
|
|
3305
|
-
}
|
|
3306
|
-
|
|
3307
|
-
/**
|
|
3308
|
-
* @fileoverview added by tsickle
|
|
3309
|
-
* Generated from: lib/upload/upload.module.ts
|
|
3310
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3311
|
-
*/
|
|
3312
|
-
var ɵ0$1 = {};
|
|
3313
|
-
var UploadModule = /** @class */ (function () {
|
|
3314
|
-
function UploadModule() {
|
|
3315
|
-
}
|
|
3316
|
-
/**
|
|
3317
|
-
* @param {?=} validationMessages
|
|
3318
|
-
* @return {?}
|
|
3319
|
-
*/
|
|
3320
|
-
UploadModule.forChild = /**
|
|
3321
|
-
* @param {?=} validationMessages
|
|
3322
|
-
* @return {?}
|
|
3323
|
-
*/
|
|
3324
|
-
function (validationMessages) {
|
|
3325
|
-
if (validationMessages === void 0) { validationMessages = {}; }
|
|
3326
|
-
return {
|
|
3327
|
-
ngModule: UploadModule,
|
|
3328
|
-
providers: [
|
|
3329
|
-
{ provide: UPLOAD_VALIDATION_MESSAGES, useValue: validationMessages },
|
|
3330
|
-
],
|
|
3331
|
-
};
|
|
3332
|
-
};
|
|
3333
|
-
UploadModule.decorators = [
|
|
3334
|
-
{ type: NgModule, args: [{
|
|
3335
|
-
imports: [
|
|
3336
|
-
CommonModule,
|
|
3337
|
-
ProgressBarModule,
|
|
3338
|
-
FormsModule,
|
|
3339
|
-
IconModule,
|
|
3340
|
-
],
|
|
3341
|
-
declarations: [
|
|
3342
|
-
UploadComponent,
|
|
3343
|
-
UploadInputComponent,
|
|
3344
|
-
UploadQueueComponent,
|
|
3345
|
-
UploadZoneComponent,
|
|
3346
|
-
ValidationListComponent,
|
|
3347
|
-
],
|
|
3348
|
-
exports: [
|
|
3349
|
-
UploadComponent,
|
|
3350
|
-
UploadInputComponent,
|
|
3351
|
-
UploadQueueComponent,
|
|
3352
|
-
UploadZoneComponent,
|
|
3353
|
-
ValidationListComponent,
|
|
3354
|
-
],
|
|
3355
|
-
providers: [
|
|
3356
|
-
ValidationMessagesService,
|
|
3357
|
-
{ provide: UPLOAD_VALIDATION_MESSAGES, useValue: ɵ0$1 },
|
|
3358
|
-
],
|
|
3359
|
-
},] }
|
|
3360
|
-
];
|
|
3361
|
-
return UploadModule;
|
|
3362
|
-
}());
|
|
3363
|
-
|
|
3364
|
-
/**
|
|
3365
|
-
* @fileoverview added by tsickle
|
|
3366
|
-
* Generated from: lib/upload/public-api.ts
|
|
3367
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3368
|
-
*/
|
|
3369
|
-
|
|
3370
|
-
/**
|
|
3371
|
-
* @fileoverview added by tsickle
|
|
3372
|
-
* Generated from: lib/wysiwyg/wysiwyg.conf.ts
|
|
3373
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3374
|
-
*/
|
|
3375
|
-
/** @type {?} */
|
|
3376
|
-
var WYSIWYG_DEFAULT_CONFIG = {
|
|
3377
|
-
bodyClass: 'a-input ckeditor-editable-body',
|
|
3378
|
-
contentsCss: ['https://cdn.antwerpen.be/core_branding_scss/5.0.0/main.min.css'],
|
|
3379
|
-
extraPlugins: 'divarea',
|
|
3380
|
-
find_highlight: {
|
|
3381
|
-
element: 'span',
|
|
3382
|
-
styles: { 'background-color': '#fffc00', color: '#0064b4' },
|
|
3383
|
-
},
|
|
3384
|
-
format_tags: 'p;h1;h2;h3;h4;h5;h6',
|
|
3385
|
-
toolbar_Basic: [
|
|
3386
|
-
['Bold', 'Italic', 'Underline', '-', 'Format', '-', 'Source'],
|
|
3387
|
-
],
|
|
3388
|
-
removeButtons: 'Styles',
|
|
3389
|
-
removePlugins: 'about',
|
|
3390
|
-
toolbar: null,
|
|
3391
|
-
uiColor: '#d8d8d8',
|
|
3392
|
-
};
|
|
3393
|
-
|
|
3394
|
-
/**
|
|
3395
|
-
* @fileoverview added by tsickle
|
|
3396
|
-
* Generated from: lib/wysiwyg/components/wysiwyg/wysiwyg.component.ts
|
|
3397
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3398
|
-
*/
|
|
3399
|
-
var WysiwygComponent = /** @class */ (function () {
|
|
3400
|
-
function WysiwygComponent() {
|
|
3401
|
-
this.setClass = true;
|
|
3402
|
-
this.basic = false;
|
|
3403
|
-
this.emitContent = new EventEmitter();
|
|
3404
|
-
this.focus = new EventEmitter();
|
|
3405
|
-
this.blur = new EventEmitter();
|
|
3406
|
-
this.ckeditorConfig = WYSIWYG_DEFAULT_CONFIG;
|
|
3407
|
-
this.isDisabled = false;
|
|
3408
|
-
this.updateModel = (/**
|
|
3409
|
-
* @param {...?} args
|
|
3410
|
-
* @return {?}
|
|
3411
|
-
*/
|
|
3412
|
-
function () {
|
|
3413
|
-
var args = [];
|
|
3414
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3415
|
-
args[_i] = arguments[_i];
|
|
3416
|
-
}
|
|
3417
|
-
return undefined;
|
|
3418
|
-
});
|
|
3419
|
-
}
|
|
3420
|
-
// NG_VALUE_ACCESSOR_INTERFACE
|
|
3421
|
-
// NG_VALUE_ACCESSOR_INTERFACE
|
|
3422
|
-
/**
|
|
3423
|
-
* @param {?} value
|
|
3424
|
-
* @return {?}
|
|
3425
|
-
*/
|
|
3426
|
-
WysiwygComponent.prototype.writeValue =
|
|
3427
|
-
// NG_VALUE_ACCESSOR_INTERFACE
|
|
3428
|
-
/**
|
|
3429
|
-
* @param {?} value
|
|
3430
|
-
* @return {?}
|
|
3431
|
-
*/
|
|
3432
|
-
function (value) {
|
|
3433
|
-
this.ckeditorContent = value;
|
|
3434
|
-
this.updateModel(value);
|
|
3435
|
-
this.emitContent.emit(this.ckeditorContent);
|
|
3436
|
-
};
|
|
3437
|
-
/**
|
|
3438
|
-
* @param {?} value
|
|
3439
|
-
* @return {?}
|
|
3440
|
-
*/
|
|
3441
|
-
WysiwygComponent.prototype.onFocus = /**
|
|
3442
|
-
* @param {?} value
|
|
3443
|
-
* @return {?}
|
|
3444
|
-
*/
|
|
3445
|
-
function (value) {
|
|
3446
|
-
this.focus.emit(value);
|
|
3447
|
-
};
|
|
3448
|
-
/**
|
|
3449
|
-
* @param {?} value
|
|
3450
|
-
* @return {?}
|
|
3451
|
-
*/
|
|
3452
|
-
WysiwygComponent.prototype.onBlur = /**
|
|
3453
|
-
* @param {?} value
|
|
3454
|
-
* @return {?}
|
|
3455
|
-
*/
|
|
3456
|
-
function (value) {
|
|
3457
|
-
this.blur.emit(value);
|
|
3458
|
-
};
|
|
3459
|
-
/**
|
|
3460
|
-
* @param {?} onChange
|
|
3461
|
-
* @return {?}
|
|
3462
|
-
*/
|
|
3463
|
-
WysiwygComponent.prototype.registerOnChange = /**
|
|
3464
|
-
* @param {?} onChange
|
|
3465
|
-
* @return {?}
|
|
3466
|
-
*/
|
|
3467
|
-
function (onChange) {
|
|
3468
|
-
this.updateModel = onChange;
|
|
3469
|
-
};
|
|
3470
|
-
/**
|
|
3471
|
-
* @return {?}
|
|
3472
|
-
*/
|
|
3473
|
-
WysiwygComponent.prototype.registerOnTouched = /**
|
|
3474
|
-
* @return {?}
|
|
3475
|
-
*/
|
|
3476
|
-
function () {
|
|
3477
|
-
};
|
|
3478
|
-
/**
|
|
3479
|
-
* @param {?} isDisabled
|
|
3480
|
-
* @return {?}
|
|
3481
|
-
*/
|
|
3482
|
-
WysiwygComponent.prototype.setDisabledState = /**
|
|
3483
|
-
* @param {?} isDisabled
|
|
3484
|
-
* @return {?}
|
|
3485
|
-
*/
|
|
3486
|
-
function (isDisabled) {
|
|
3487
|
-
this.isDisabled = isDisabled;
|
|
3488
|
-
};
|
|
3489
|
-
/**
|
|
3490
|
-
* @return {?}
|
|
3491
|
-
*/
|
|
3492
|
-
WysiwygComponent.prototype.ngOnInit = /**
|
|
3493
|
-
* @return {?}
|
|
3494
|
-
*/
|
|
3495
|
-
function () {
|
|
3496
|
-
this.setConfig();
|
|
3497
|
-
};
|
|
3498
|
-
/**
|
|
3499
|
-
* @private
|
|
3500
|
-
* @return {?}
|
|
3501
|
-
*/
|
|
3502
|
-
WysiwygComponent.prototype.setConfig = /**
|
|
3503
|
-
* @private
|
|
3504
|
-
* @return {?}
|
|
3505
|
-
*/
|
|
3506
|
-
function () {
|
|
3507
|
-
if (this.customConfig) {
|
|
3508
|
-
this.ckeditorConfig = this.customConfig;
|
|
3509
|
-
}
|
|
3510
|
-
else {
|
|
3511
|
-
if (this.basic) {
|
|
3512
|
-
this.ckeditorConfig.toolbar = 'Basic';
|
|
3513
|
-
}
|
|
3514
|
-
if (this.availableTags) {
|
|
3515
|
-
this.ckeditorConfig.format_tags = this.availableTags;
|
|
3516
|
-
}
|
|
3517
|
-
if (this.uiColour) {
|
|
3518
|
-
this.ckeditorConfig.uiColor = this.uiColour;
|
|
3519
|
-
}
|
|
3520
|
-
if (this.additionalStyling) {
|
|
3521
|
-
this.ckeditorConfig.contentsCss.concat(this.additionalStyling);
|
|
3522
|
-
}
|
|
3523
|
-
}
|
|
3524
|
-
};
|
|
3525
|
-
WysiwygComponent.decorators = [
|
|
3526
|
-
{ type: Component, args: [{
|
|
3527
|
-
selector: 'aui-wysiwyg',
|
|
3528
|
-
template: "<div class=\"aui-wysiwyg__inner\">\n <ckeditor\n (blur)=\"onBlur($event)\"\n (change)=\"writeValue($event)\"\n (focus)=\"onFocus($event)\"\n [(ngModel)]=\"ckeditorContent\"\n [config]=\"ckeditorConfig\"\n [debounce]=\"debounce\"\n [readonly]=\"isDisabled\"\n ></ckeditor>\n</div>\n",
|
|
3529
|
-
providers: [{
|
|
3530
|
-
provide: NG_VALUE_ACCESSOR,
|
|
3531
|
-
useExisting: forwardRef((/**
|
|
3532
|
-
* @return {?}
|
|
3533
|
-
*/
|
|
3534
|
-
function () { return WysiwygComponent; })),
|
|
3535
|
-
// tslint:disable-line:no-forward-ref
|
|
3536
|
-
multi: true,
|
|
3537
|
-
}],
|
|
3538
|
-
styles: [":host ::ng-deep .cke .cke_chrome{border:1px solid #6f6f6f}:host ::ng-deep .cke .cke_top{border-color:#6f6f6f}:host ::ng-deep .cke .cke_bottom,:host ::ng-deep .cke .cke_top{background-color:#f3f3f3}:host ::ng-deep .cke .cke_wysiwyg_div{padding:.25rem}:host ::ng-deep .cke.cke_focus .cke_contents{box-shadow:0 0 0 1px #6f6f6f,0 0 0 4px #c0dffe;position:relative;z-index:1}"]
|
|
3539
|
-
}] }
|
|
3540
|
-
];
|
|
3541
|
-
WysiwygComponent.propDecorators = {
|
|
3542
|
-
setClass: [{ type: HostBinding, args: ['class.aui-wysiwyg',] }],
|
|
3543
|
-
additionalStyling: [{ type: Input }],
|
|
3544
|
-
availableTags: [{ type: Input }],
|
|
3545
|
-
basic: [{ type: Input }],
|
|
3546
|
-
uiColour: [{ type: Input }],
|
|
3547
|
-
customConfig: [{ type: Input }],
|
|
3548
|
-
debounce: [{ type: Input }],
|
|
3549
|
-
emitContent: [{ type: Output }],
|
|
3550
|
-
focus: [{ type: Output }],
|
|
3551
|
-
blur: [{ type: Output }]
|
|
3552
|
-
};
|
|
3553
|
-
return WysiwygComponent;
|
|
3554
|
-
}());
|
|
3555
|
-
if (false) {
|
|
3556
|
-
/** @type {?} */
|
|
3557
|
-
WysiwygComponent.prototype.setClass;
|
|
3558
|
-
/** @type {?} */
|
|
3559
|
-
WysiwygComponent.prototype.additionalStyling;
|
|
3560
|
-
/** @type {?} */
|
|
3561
|
-
WysiwygComponent.prototype.availableTags;
|
|
3562
|
-
/** @type {?} */
|
|
3563
|
-
WysiwygComponent.prototype.basic;
|
|
3564
|
-
/** @type {?} */
|
|
3565
|
-
WysiwygComponent.prototype.uiColour;
|
|
3566
|
-
/** @type {?} */
|
|
3567
|
-
WysiwygComponent.prototype.customConfig;
|
|
3568
|
-
/** @type {?} */
|
|
3569
|
-
WysiwygComponent.prototype.debounce;
|
|
3570
|
-
/** @type {?} */
|
|
3571
|
-
WysiwygComponent.prototype.emitContent;
|
|
3572
|
-
/** @type {?} */
|
|
3573
|
-
WysiwygComponent.prototype.focus;
|
|
3574
|
-
/** @type {?} */
|
|
3575
|
-
WysiwygComponent.prototype.blur;
|
|
3576
|
-
/** @type {?} */
|
|
3577
|
-
WysiwygComponent.prototype.ckeditorContent;
|
|
3578
|
-
/** @type {?} */
|
|
3579
|
-
WysiwygComponent.prototype.ckeditorConfig;
|
|
3580
|
-
/** @type {?} */
|
|
3581
|
-
WysiwygComponent.prototype.isDisabled;
|
|
3582
|
-
/**
|
|
3583
|
-
* @type {?}
|
|
3584
|
-
* @private
|
|
3585
|
-
*/
|
|
3586
|
-
WysiwygComponent.prototype.updateModel;
|
|
3587
|
-
}
|
|
3588
|
-
|
|
3589
|
-
/**
|
|
3590
|
-
* @fileoverview added by tsickle
|
|
3591
|
-
* Generated from: lib/wysiwyg/wysiwyg.module.ts
|
|
3592
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3593
|
-
*/
|
|
3594
|
-
var WysiwygModule = /** @class */ (function () {
|
|
3595
|
-
function WysiwygModule() {
|
|
3596
|
-
}
|
|
3597
|
-
WysiwygModule.decorators = [
|
|
3598
|
-
{ type: NgModule, args: [{
|
|
3599
|
-
imports: [
|
|
3600
|
-
CommonModule,
|
|
3601
|
-
FormsModule,
|
|
3602
|
-
ReactiveFormsModule,
|
|
3603
|
-
CKEditorModule,
|
|
3604
|
-
],
|
|
3605
|
-
declarations: [
|
|
3606
|
-
WysiwygComponent,
|
|
3607
|
-
],
|
|
3608
|
-
exports: [
|
|
3609
|
-
WysiwygComponent,
|
|
3610
|
-
],
|
|
3611
|
-
},] }
|
|
3612
|
-
];
|
|
3613
|
-
return WysiwygModule;
|
|
3614
|
-
}());
|
|
3615
|
-
|
|
3616
|
-
/**
|
|
3617
|
-
* @fileoverview added by tsickle
|
|
3618
|
-
* Generated from: lib/wysiwyg/public-api.ts
|
|
3619
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3620
|
-
*/
|
|
3621
|
-
|
|
3622
|
-
/**
|
|
3623
|
-
* @fileoverview added by tsickle
|
|
3624
|
-
* Generated from: public-api.ts
|
|
3625
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3626
|
-
*/
|
|
3627
|
-
|
|
3628
|
-
/**
|
|
3629
|
-
* @fileoverview added by tsickle
|
|
3630
|
-
* Generated from: acpaas-ui-ngx-forms.ts
|
|
3631
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3632
|
-
*/
|
|
3633
|
-
|
|
3634
|
-
export { AutoCompleteComponent, AutoCompleteModule, DATEPICKER_DATE_MASK, DATEPICKER_DEFAULT_ERROR_LABELS, DATEPICKER_ERROR_LABELS, DATEPICKER_SEPARATOR_CHAR, DatepickerComponent, DatepickerModule, MaskDirective, MaskModule, RangeSliderComponent, RangeSliderModule, SearchFilterComponent, SearchFilterModule, TimePickerValidators, TimepickerComponent, TimepickerInputSize, TimepickerModule, UPLOAD_OPTIONS_DEFAULT, UPLOAD_VALIDATION_MESSAGES, UploadComponent, UploadInputComponent, UploadModule, UploadQueueComponent, UploadZoneComponent, Uploader, ValidationListComponent, ValidationMessagesService, WYSIWYG_DEFAULT_CONFIG, WysiwygComponent, WysiwygModule, SearchService as ɵa };
|
|
3635
|
-
//# sourceMappingURL=acpaas-ui-ngx-forms.js.map
|