@metadev/lux 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/esm2020/lib/autocomplete/autocomplete.component.mjs +479 -0
  2. package/esm2020/lib/autocomplete-list/autocomplete-list.component.mjs +254 -0
  3. package/esm2020/lib/breadcrumb/breadcrumb.component.mjs +75 -0
  4. package/esm2020/lib/checkbox/checkbox.component.mjs +154 -0
  5. package/{esm2015/lib/datasource.js → esm2020/lib/datasource.mjs} +0 -0
  6. package/esm2020/lib/datetime/datetime.component.mjs +306 -0
  7. package/esm2020/lib/filter/filter.component.mjs +152 -0
  8. package/esm2020/lib/geolocation/geolocation.component.mjs +407 -0
  9. package/{esm2015/lib/geolocation/geolocation.service.js → esm2020/lib/geolocation/geolocation.service.mjs} +7 -11
  10. package/esm2020/lib/geolocation/openlayer-loader.service.mjs +62 -0
  11. package/{esm2015/lib/helperFns.js → esm2020/lib/helperFns.mjs} +0 -0
  12. package/esm2020/lib/input/input.component.mjs +452 -0
  13. package/{esm2015/lib/input/regexp.service.js → esm2020/lib/input/regexp.service.mjs} +7 -6
  14. package/{esm2015/lib/lang.js → esm2020/lib/lang.mjs} +0 -0
  15. package/esm2020/lib/lux.module.mjs +130 -0
  16. package/{esm2015/lib/map/geopoint.js → esm2020/lib/map/geopoint.mjs} +0 -0
  17. package/esm2020/lib/map/map.component.mjs +265 -0
  18. package/esm2020/lib/modal/modal-backdrop.mjs +26 -0
  19. package/esm2020/lib/modal/modal-config.mjs +14 -0
  20. package/{esm2015/lib/modal/modal-dismiss-reasons.js → esm2020/lib/modal/modal-dismiss-reasons.mjs} +0 -0
  21. package/{esm2015/lib/modal/modal-ref.js → esm2020/lib/modal/modal-ref.mjs} +0 -0
  22. package/esm2020/lib/modal/modal-stack.mjs +179 -0
  23. package/esm2020/lib/modal/modal-window.mjs +119 -0
  24. package/esm2020/lib/modal/modal.service.mjs +26 -0
  25. package/{esm2015/lib/modal/util.js → esm2020/lib/modal/util.mjs} +0 -0
  26. package/esm2020/lib/pagination/pagination.component.mjs +137 -0
  27. package/{esm2015/lib/pagination/pagination.js → esm2020/lib/pagination/pagination.mjs} +0 -0
  28. package/esm2020/lib/radiogroup/radiogroup.component.mjs +130 -0
  29. package/esm2020/lib/select/select.component.mjs +149 -0
  30. package/{esm2015/lib/tooltip/placement.js → esm2020/lib/tooltip/placement.mjs} +0 -0
  31. package/{esm2015/lib/tooltip/tooltip-context.js → esm2020/lib/tooltip/tooltip-context.mjs} +0 -0
  32. package/esm2020/lib/tooltip/tooltip.component.mjs +23 -0
  33. package/esm2020/lib/tooltip/tooltip.directive.mjs +60 -0
  34. package/{esm2015/lib/tooltip/tooltip.service.js → esm2020/lib/tooltip/tooltip.service.mjs} +7 -9
  35. package/{esm2015/lib/tooltip/tooltop-content.js → esm2020/lib/tooltip/tooltop-content.mjs} +0 -0
  36. package/esm2020/lib/voice-recognition/voice-recognition.directive.mjs +73 -0
  37. package/{esm2015/lib/window/window.service.js → esm2020/lib/window/window.service.mjs} +0 -0
  38. package/esm2020/metadev-lux.mjs +5 -0
  39. package/esm2020/public-api.mjs +21 -0
  40. package/fesm2015/metadev-lux.mjs +4345 -0
  41. package/fesm2015/metadev-lux.mjs.map +1 -0
  42. package/fesm2020/metadev-lux.mjs +4343 -0
  43. package/fesm2020/metadev-lux.mjs.map +1 -0
  44. package/lib/autocomplete/autocomplete.component.d.ts +3 -0
  45. package/lib/autocomplete-list/autocomplete-list.component.d.ts +3 -0
  46. package/lib/breadcrumb/breadcrumb.component.d.ts +3 -0
  47. package/lib/checkbox/checkbox.component.d.ts +3 -0
  48. package/lib/datetime/datetime.component.d.ts +4 -0
  49. package/lib/filter/filter.component.d.ts +3 -0
  50. package/lib/geolocation/geolocation.component.d.ts +4 -0
  51. package/lib/geolocation/geolocation.service.d.ts +3 -0
  52. package/lib/geolocation/openlayer-loader.service.d.ts +3 -0
  53. package/lib/input/input.component.d.ts +3 -0
  54. package/lib/input/regexp.service.d.ts +3 -0
  55. package/lib/lux.module.d.ts +26 -0
  56. package/lib/map/map.component.d.ts +3 -0
  57. package/lib/modal/modal-backdrop.d.ts +3 -0
  58. package/lib/modal/modal-config.d.ts +3 -0
  59. package/lib/modal/modal-stack.d.ts +3 -0
  60. package/lib/modal/modal-window.d.ts +3 -0
  61. package/lib/modal/modal.service.d.ts +3 -0
  62. package/lib/pagination/pagination.component.d.ts +3 -0
  63. package/lib/radiogroup/radiogroup.component.d.ts +3 -0
  64. package/lib/select/select.component.d.ts +3 -0
  65. package/lib/tooltip/tooltip.component.d.ts +3 -0
  66. package/lib/tooltip/tooltip.directive.d.ts +3 -0
  67. package/lib/tooltip/tooltip.service.d.ts +3 -0
  68. package/lib/voice-recognition/voice-recognition.directive.d.ts +3 -0
  69. package/metadev-lux.d.ts +1 -16
  70. package/package.json +20 -8
  71. package/public-api.d.ts +12 -7
  72. package/bundles/metadev-lux.umd.js +0 -4715
  73. package/bundles/metadev-lux.umd.js.map +0 -1
  74. package/esm2015/lib/autocomplete/autocomplete.component.js +0 -455
  75. package/esm2015/lib/autocomplete-list/autocomplete-list.component.js +0 -230
  76. package/esm2015/lib/breadcrumb/breadcrumb.component.js +0 -77
  77. package/esm2015/lib/checkbox/checkbox.component.js +0 -142
  78. package/esm2015/lib/datetime/datetime.component.js +0 -275
  79. package/esm2015/lib/filter/filter.component.js +0 -140
  80. package/esm2015/lib/geolocation/geolocation.component.js +0 -371
  81. package/esm2015/lib/geolocation/openlayer-loader.service.js +0 -63
  82. package/esm2015/lib/input/input.component.js +0 -419
  83. package/esm2015/lib/lux.module.js +0 -83
  84. package/esm2015/lib/map/map.component.js +0 -261
  85. package/esm2015/lib/modal/modal-backdrop.js +0 -19
  86. package/esm2015/lib/modal/modal-config.js +0 -12
  87. package/esm2015/lib/modal/modal-stack.js +0 -182
  88. package/esm2015/lib/modal/modal-window.js +0 -92
  89. package/esm2015/lib/modal/modal.service.js +0 -28
  90. package/esm2015/lib/pagination/pagination.component.js +0 -134
  91. package/esm2015/lib/radiogroup/radiogroup.component.js +0 -114
  92. package/esm2015/lib/select/select.component.js +0 -131
  93. package/esm2015/lib/tooltip/tooltip.component.js +0 -19
  94. package/esm2015/lib/tooltip/tooltip.directive.js +0 -52
  95. package/esm2015/lib/voice-recognition/voice-recognition.directive.js +0 -76
  96. package/esm2015/metadev-lux.js +0 -21
  97. package/esm2015/public-api.js +0 -16
  98. package/fesm2015/metadev-lux.js +0 -4089
  99. package/fesm2015/metadev-lux.js.map +0 -1
  100. package/metadev-lux.metadata.json +0 -1
@@ -1,4715 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/router'), require('angular-resize-event'), require('rxjs'), require('rxjs/operators'), require('@angular/common/http')) :
3
- typeof define === 'function' && define.amd ? define('@metadev/lux', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/router', 'angular-resize-event', 'rxjs', 'rxjs/operators', '@angular/common/http'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.metadev = global.metadev || {}, global.metadev.lux = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.router, global["angular-resize-event"], global.rxjs, global.rxjs.operators, global.ng.common.http));
5
- })(this, (function (exports, i1, i0, forms, router, angularResizeEvent, rxjs, operators, i1$1) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
26
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
27
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
28
-
29
- // undefined and null functions
30
- var exists = function (value) { return value !== null && value !== undefined; };
31
- var hasValue = function (value) { return exists(value) && (typeof value === 'string' ? !isEmptyString(value) : true); };
32
- // string functions
33
- var isEmptyString = function (value) { return value.trim() === ''; };
34
- var isValidEmail = function (value) {
35
- var re = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
36
- return re.test(String(value).toLowerCase().trim());
37
- };
38
- var isValidUrl = function (value) {
39
- var re = /^([a-z]+?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$/i;
40
- return re.test(String(value).toLowerCase().trim());
41
- };
42
- var isValidColor = function (value) {
43
- value = String(value).toLowerCase();
44
- // valid values for CSS color property, yet not valid colors by themselves
45
- if (value === 'currentcolor' ||
46
- value === 'inherit' ||
47
- value === 'initial' ||
48
- value === 'revert' ||
49
- value === 'unset') {
50
- return false;
51
- }
52
- return CSS.supports('color', value);
53
- };
54
- // date functions
55
- var isValidDate = function (date) { return exists(date) ? !isNaN(date.getTime()) : false; };
56
- var normalizeDate = function (value) {
57
- if (typeof value === 'string' && value.length > 10) {
58
- return value.substr(0, 10);
59
- }
60
- return value ? value.toString() : null;
61
- };
62
- var addTimezoneOffset = function (date) {
63
- if (!isValidDate(date)) {
64
- return date;
65
- }
66
- else {
67
- return new Date(date.getTime() - date.getTimezoneOffset() * 60000);
68
- }
69
- };
70
- // number functions
71
- var isValidNumber = function (value) { return (hasValue(value) ? !Number.isNaN(Number(value)) : false); };
72
- var numberOfDecimalDigits = function (x) {
73
- if (isValidNumber(x)) {
74
- var xString = String(Number(x));
75
- if (xString === 'Infinity') {
76
- return 0;
77
- }
78
- var indexOfE = xString.indexOf('e');
79
- if (indexOfE >= 0) {
80
- return 0;
81
- }
82
- var indexOfDecimalPoint = xString.indexOf('.');
83
- if (indexOfDecimalPoint < 0) {
84
- return 0;
85
- }
86
- else {
87
- return xString.length - indexOfDecimalPoint - 1;
88
- }
89
- }
90
- return undefined;
91
- };
92
- var numberOfWholeDigits = function (x) {
93
- if (isValidNumber(x)) {
94
- var xString = String(Number(x));
95
- if (xString.indexOf('-') === 0) {
96
- xString = xString.slice(1, xString.length);
97
- }
98
- if (xString === 'Infinity') {
99
- return Infinity;
100
- }
101
- if (xString.indexOf('0') === 0) {
102
- xString = xString.slice(1, xString.length);
103
- }
104
- var indexOfE = xString.indexOf('e');
105
- if (indexOfE >= 0) {
106
- return Number(xString.slice(indexOfE + 1, xString.length)) + 1;
107
- }
108
- var indexOfDecimalPoint = xString.indexOf('.');
109
- if (indexOfDecimalPoint < 0) {
110
- return xString.length;
111
- }
112
- else {
113
- return indexOfDecimalPoint;
114
- }
115
- }
116
- return undefined;
117
- };
118
- var roundToMultipleOf = function (x, modulo) {
119
- var moduloString = String(modulo);
120
- // approximates the result
121
- // prone to inexactitude because of floating point arithmetic
122
- var approximation = Math.round(x / modulo) * modulo;
123
- var approximationString = String(approximation);
124
- // remove useless decimals
125
- var uselessDecimalsInApproximation = numberOfDecimalDigits(approximationString) -
126
- numberOfDecimalDigits(moduloString);
127
- var resultString = approximationString.slice(0, approximationString.length - uselessDecimalsInApproximation);
128
- return Number(resultString);
129
- };
130
- // other functions
131
- var isInitialAndEmpty = function (previousValue, newValue) {
132
- var isPrevArray = Array.isArray(previousValue);
133
- var isNewArray = Array.isArray(newValue);
134
- return !((isPrevArray ? previousValue.length !== 0 : Boolean(previousValue)) ||
135
- (isNewArray ? newValue.length !== 0 : Boolean(newValue)));
136
- };
137
-
138
- var LOST_FOCUS_TIME_WINDOW_MS = 200; // ms
139
- var AutocompleteComponent = /** @class */ (function () {
140
- function AutocompleteComponent(cd) {
141
- this.cd = cd;
142
- this.lostFocusHandled = true;
143
- this.t0 = 0;
144
- this.showSpinner = false;
145
- this.touched = false;
146
- this.completionList = [];
147
- this.showCompletion = false;
148
- this.valueChange = new i0.EventEmitter();
149
- this.dataSourceChange = new i0.EventEmitter();
150
- this.disabled = null;
151
- this.readonly = null;
152
- this.label = '';
153
- /** If canAddNewValues, user can type items not present in the data-source. */
154
- this.canAddNewValues = false;
155
- /** After cleaning the selection should the completion list remain open or closed:
156
- * false: (default) close on filters, to clean a filter and select all.
157
- * true: keep open (when the action most likely is to pick another one).
158
- */
159
- this.keepOpenAfterDelete = false;
160
- this.required = false;
161
- this.resolveLabelsFunction = undefined;
162
- this.populateFunction = undefined;
163
- // ControlValueAccessor Interface
164
- this.onChange = function (value) { };
165
- this.onTouched = function () { };
166
- }
167
- Object.defineProperty(AutocompleteComponent.prototype, "value", {
168
- get: function () {
169
- return this._value;
170
- },
171
- set: function (v) {
172
- var initialAndEmpty = isInitialAndEmpty(this._value, v);
173
- this._value = v;
174
- this.onChange(v);
175
- this.completeLabel();
176
- if (!initialAndEmpty) {
177
- this.valueChange.emit(v);
178
- }
179
- },
180
- enumerable: false,
181
- configurable: true
182
- });
183
- Object.defineProperty(AutocompleteComponent.prototype, "dataSource", {
184
- get: function () {
185
- return this._dataSource;
186
- },
187
- set: function (v) {
188
- this._dataSource = v;
189
- this.dataSourceChange.emit(v);
190
- },
191
- enumerable: false,
192
- configurable: true
193
- });
194
- Object.defineProperty(AutocompleteComponent.prototype, "placeholder", {
195
- get: function () {
196
- return this._placeholder ? this._placeholder : '';
197
- },
198
- set: function (v) {
199
- this._placeholder = v;
200
- },
201
- enumerable: false,
202
- configurable: true
203
- });
204
- AutocompleteComponent.prototype.writeValue = function (value) {
205
- this.value = value;
206
- };
207
- AutocompleteComponent.prototype.registerOnChange = function (onChange) {
208
- this.onChange = onChange;
209
- };
210
- AutocompleteComponent.prototype.registerOnTouched = function (onTouched) {
211
- this.onTouched = onTouched;
212
- };
213
- AutocompleteComponent.prototype.markAsTouched = function () {
214
- if (!this.touched && !this.disabled) {
215
- this.onTouched();
216
- this.touched = true;
217
- }
218
- };
219
- AutocompleteComponent.prototype.setDisabledState = function (disabled) {
220
- this.disabled = disabled;
221
- };
222
- // End ControlValueAccessor Interface
223
- // Validator interface
224
- AutocompleteComponent.prototype.registerOnValidatorChange = function () { };
225
- AutocompleteComponent.prototype.validate = function (control) {
226
- var value = control.value;
227
- if (this.required &&
228
- (value === '' || value === null || value === undefined)) {
229
- return { required: { value: value, reason: 'Required field.' } };
230
- }
231
- return null;
232
- };
233
- // End of Validator interface
234
- AutocompleteComponent.prototype.clear = function () {
235
- this.value = null;
236
- this.toggleCompletion(this.keepOpenAfterDelete, '');
237
- };
238
- AutocompleteComponent.prototype.completeLabel = function () {
239
- var _this = this;
240
- if (this.value) {
241
- if (this.dataSource) {
242
- this.label = findLabelForId(this.dataSource, this.value) || '';
243
- }
244
- else if (this.instance && this.resolveLabelsFunction) {
245
- this.resolveLabelsFunction(this.instance, [this.value])
246
- .pipe(operators.debounceTime(1), operators.first())
247
- .subscribe(function (data) {
248
- _this.label = findLabelForId(data, _this.value) || '';
249
- });
250
- }
251
- }
252
- else {
253
- this.label = '';
254
- }
255
- };
256
- AutocompleteComponent.prototype.ngOnInit = function () {
257
- this.inputId = this.inputId
258
- ? this.inputId
259
- : "autocompletelist" + AutocompleteComponent.idCounter++;
260
- this.completeLabel();
261
- };
262
- AutocompleteComponent.prototype.ngAfterViewInit = function () {
263
- this.setSameWidth();
264
- };
265
- AutocompleteComponent.prototype.onInputResized = function () {
266
- this.setSameWidth();
267
- };
268
- AutocompleteComponent.prototype.setSameWidth = function () {
269
- var width = this.i0.nativeElement.getBoundingClientRect().width;
270
- this.completeDiv.nativeElement.style.width = width + "px";
271
- };
272
- AutocompleteComponent.prototype.onKeydown = function (event, label) {
273
- switch (event.key) {
274
- case 'Tab':
275
- if (label) {
276
- this.pickSelectionOrFirstMatch(label);
277
- }
278
- this.showCompletion = false;
279
- break;
280
- }
281
- this.markAsTouched();
282
- };
283
- AutocompleteComponent.prototype.onKeypress = function (event, label) {
284
- switch (event.key) {
285
- case 'Intro':
286
- case 'Enter':
287
- this.pickSelectionOrFirstMatch(label);
288
- event.preventDefault();
289
- break;
290
- }
291
- this.markAsTouched();
292
- };
293
- AutocompleteComponent.prototype.onKeyup = function (event, label) {
294
- switch (event.key) {
295
- case 'PageDown':
296
- this.focusOnNext(5);
297
- event.preventDefault();
298
- break;
299
- case 'ArrowDown':
300
- this.focusOnNext(1);
301
- event.preventDefault();
302
- break;
303
- case 'PageUp':
304
- this.focusOnPrevious(5);
305
- event.preventDefault();
306
- break;
307
- case 'ArrowUp':
308
- this.focusOnPrevious(1);
309
- event.preventDefault();
310
- break;
311
- case 'Escape':
312
- this.complete(null);
313
- event.preventDefault();
314
- break;
315
- case 'Intro':
316
- case 'Enter':
317
- event.preventDefault();
318
- break;
319
- default:
320
- this.showCompletionList(label);
321
- // event.preventDefault();
322
- }
323
- this.markAsTouched();
324
- };
325
- AutocompleteComponent.prototype.focusOnNext = function (offset) {
326
- var _this = this;
327
- var list = this.completionList || [];
328
- var index = list.findIndex(function (it) { return _this.focusItem && it.key === _this.focusItem.key; });
329
- var indexNext = -1 && list.length > index + offset ? index + offset : list.length - 1;
330
- var next = list[indexNext];
331
- this.focusItem = next;
332
- this.ensureItemVisible(index);
333
- };
334
- AutocompleteComponent.prototype.focusOnPrevious = function (offset) {
335
- var _this = this;
336
- var list = this.completionList || [];
337
- var index = list.findIndex(function (it) { return _this.focusItem && it.key === _this.focusItem.key; });
338
- var indexPrevious = index !== -1 && index > offset ? index - offset : 0;
339
- var next = list[indexPrevious];
340
- this.focusItem = next;
341
- this.ensureItemVisible(index);
342
- };
343
- AutocompleteComponent.prototype.onLostFocus = function (label) {
344
- var _this = this;
345
- this.lostFocusHandled = false;
346
- this.t0 = performance.now();
347
- // console.log('Init LostFocus');
348
- setTimeout(function () {
349
- // needs to postpone actions some milliseconds to verify if
350
- // lost focus was followed by a list selection -> then cancel
351
- // if not -> make side effect
352
- if (!_this.lostFocusHandled) {
353
- // console.log(
354
- // 'Lost focus 2',
355
- // this.lostFocusHandled,
356
- // 'SIDE EFFECT',
357
- // performance.now() - this.t0,
358
- // 'label:',
359
- // label
360
- // );
361
- if (label && _this.label !== label) {
362
- _this.pickSelectionOrFirstMatch(label);
363
- }
364
- else {
365
- _this.lostFocusHandled = true;
366
- }
367
- _this.toggleCompletion(false, label);
368
- }
369
- else {
370
- // do nothing (list selection took place)
371
- // console.log(
372
- // 'onlost focus 2',
373
- // this.lostFocusHandled,
374
- // 'nothing',
375
- // performance.now() - this.t0
376
- // );
377
- }
378
- }, LOST_FOCUS_TIME_WINDOW_MS);
379
- };
380
- AutocompleteComponent.prototype.complete = function (item) {
381
- if (!this.lostFocusHandled) {
382
- this.lostFocusHandled = true; // prevent a previous lostFocus to trigger a side effect
383
- var ellapsed = performance.now() - this.t0;
384
- if (ellapsed > LOST_FOCUS_TIME_WINDOW_MS) {
385
- console.warn('complete. lostfocus->click timeout of ', LOST_FOCUS_TIME_WINDOW_MS, 'ms exceed: ', performance.now() - this.t0, ' ms');
386
- }
387
- // console.log(
388
- // 'complete. set to true. CANCELED side effect',
389
- // performance.now() - this.t0
390
- // );
391
- }
392
- if (item !== null) {
393
- this.value = item.key;
394
- this.label = item.label;
395
- }
396
- else {
397
- this.value = null;
398
- this.label = '';
399
- }
400
- this.toggleCompletion(false, null);
401
- this.markAsTouched();
402
- };
403
- AutocompleteComponent.prototype.toggleCompletion = function (show, label) {
404
- if (show && !this.disabled) {
405
- this.showCompletionList(label);
406
- }
407
- else {
408
- this.showCompletion = false;
409
- if (this.canAddNewValues) {
410
- this.syncCustomValue(this.label);
411
- return;
412
- }
413
- }
414
- this.cd.markForCheck();
415
- };
416
- Object.defineProperty(AutocompleteComponent.prototype, "selectedOption", {
417
- get: function () {
418
- var _this = this;
419
- var index = this.completionList.findIndex(function (i) { return i.key === _this.focusItem.key; });
420
- if (index === -1 || !this.focusItem) {
421
- return null;
422
- }
423
- return this.inputId + "_" + index;
424
- },
425
- enumerable: false,
426
- configurable: true
427
- });
428
- AutocompleteComponent.prototype.ensureItemVisible = function (index) {
429
- var target = this.completeDiv.nativeElement.querySelectorAll('li')[index];
430
- if (target) {
431
- target.scrollIntoView({ block: 'center' });
432
- }
433
- };
434
- AutocompleteComponent.prototype.syncCustomValue = function (text) {
435
- this.value = text;
436
- this.label = text;
437
- };
438
- /** Pick selection based on text filtering (ingnores drowdown state) */
439
- AutocompleteComponent.prototype.pickSelectionOrFirstMatch = function (text) {
440
- var _this = this;
441
- if (this.canAddNewValues) {
442
- this.syncCustomValue(text);
443
- return;
444
- }
445
- var focusIndex = this.completionList.findIndex(function (it) { return _this.focusItem && it.key === _this.focusItem.key; });
446
- if (this.showCompletion &&
447
- focusIndex > 0 &&
448
- this.focusItem &&
449
- this.focusItem.label) {
450
- if (text === this.focusItem.label && this.focusItem.key === this.value) {
451
- // do nothing if value does not change & close dropdow
452
- this.showCompletion = false;
453
- return;
454
- }
455
- // complete selected using selected item on drowdown
456
- this.complete(this.focusItem);
457
- return;
458
- }
459
- var source = (text || '').trim();
460
- if (!source) {
461
- this.showCompletion = false;
462
- // select null value
463
- if (this.value !== null) {
464
- this.value = null;
465
- }
466
- return;
467
- }
468
- this.completionList = [];
469
- this.computeCompletionList(source).subscribe(function (suggestions) {
470
- var candidate = suggestions && suggestions.length > 0 ? suggestions[0] : null;
471
- _this.complete(candidate);
472
- });
473
- };
474
- AutocompleteComponent.prototype.showCompletionList = function (text) {
475
- var _this = this;
476
- this.setSameWidth();
477
- var useSpinner = this.hasExternalDataSource();
478
- this.spinnerVisibility(useSpinner, true);
479
- setTimeout(function () {
480
- // for spinner to be shown
481
- _this.computeCompletionList(text).subscribe({
482
- next: function (cl) {
483
- _this.completionList = cl;
484
- _this.focusItem = selectElement(_this.completionList, text);
485
- _this.showCompletion = true;
486
- _this.spinnerVisibility(useSpinner, false);
487
- },
488
- error: function () {
489
- _this.spinnerVisibility(useSpinner, false);
490
- },
491
- complete: function () {
492
- _this.spinnerVisibility(useSpinner, false);
493
- }
494
- });
495
- }, 1);
496
- };
497
- AutocompleteComponent.prototype.spinnerVisibility = function (useSpinner, value) {
498
- if (useSpinner) {
499
- this.showSpinner = value;
500
- }
501
- };
502
- AutocompleteComponent.prototype.hasExternalDataSource = function () {
503
- return !this.dataSource && !!this.instance && !!this.populateFunction;
504
- };
505
- AutocompleteComponent.prototype.computeCompletionList = function (text) {
506
- var searchText = (text || '').toLowerCase();
507
- if (this.dataSource) {
508
- var ds = (this.dataSource || [])
509
- .filter(function (it) { return ignoreAccentsInclude(it.label, searchText); })
510
- .sort(function (a, b) { return a.label.localeCompare(b.label); });
511
- return rxjs.of(decorateDataSource(ds, searchText));
512
- }
513
- else if (this.instance && this.populateFunction) {
514
- return this.populateFunction(this.instance, searchText).pipe(operators.debounceTime(1), operators.first(), operators.map(function (ds) {
515
- var dsFiltered = ds
516
- .filter(function (it) { return ignoreAccentsInclude(it.label, searchText); })
517
- .sort(function (a, b) { return a.label.localeCompare(b.label); });
518
- return decorateDataSource(dsFiltered, searchText);
519
- }));
520
- }
521
- else {
522
- return rxjs.of([]);
523
- }
524
- };
525
- return AutocompleteComponent;
526
- }());
527
- AutocompleteComponent.idCounter = 0;
528
- AutocompleteComponent.decorators = [
529
- { type: i0.Component, args: [{
530
- selector: 'lux-autocomplete',
531
- template: "<div class=\"lux-autocomplete\" (blur)=\"toggleCompletion(false, i0.value)\">\n <div class=\"lux-autocomplete-box\">\n <input\n #i0\n [id]=\"inputId\"\n [(ngModel)]=\"label\"\n [placeholder]=\"placeholder\"\n [attr.disabled]=\"disabled || null\"\n [attr.readonly]=\"readonly || null\"\n (keydown)=\"onKeydown($event, i0.value)\"\n (keypress)=\"onKeypress($event, i0.value)\"\n (keyup)=\"onKeyup($event, i0.value)\"\n (blur)=\"onLostFocus(i0.value)\"\n (focus)=\"toggleCompletion(true, i0.value)\"\n (click)=\"toggleCompletion(true, i0.value)\"\n (resized)=\"onInputResized()\"\n (window:resize)=\"onInputResized()\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n [attr.aria-expanded]=\"showCompletion\"\n aria-haspopup=\"true\"\n attr.aria-owns=\"{{ inputId + '_list' }}\"\n [attr.aria-activedescendant]=\"selectedOption\"\n />\n <div *ngIf=\"canAddNewValues\" class=\"icon-suggestions\"></div>\n <div *ngIf=\"showSpinner; else noLoading\" class=\"icon-spinner\"></div>\n <ng-template #noLoading>\n <button\n *ngIf=\"!disabled && i0.value && !showCompletion; else dropdown\"\n type=\"button\"\n class=\"icon-clear\"\n aria-label=\"Clear\"\n (click)=\"clear()\"\n ></button>\n <ng-template #dropdown>\n <div\n class=\"icon-dropdown\"\n (click)=\"toggleCompletion(!showCompletion, i0.value)\"\n ></div>\n </ng-template>\n </ng-template>\n </div>\n <div\n #completeDiv\n [class.showCompletion]=\"showCompletion\"\n class=\"lux-completion-list\"\n id=\"{{ inputId + '_list' }}\"\n >\n <ul>\n <li\n *ngFor=\"let item of completionList; let index = index\"\n id=\"{{ inputId + '_' + index }}\"\n class=\"lux-completion-item\"\n [class.selected]=\"focusItem && item.key === focusItem.key\"\n (click)=\"complete(item)\"\n [attr.aria-label]=\"item.label\"\n >\n <span>{{ item.labelPrefix }}</span>\n <span class=\"bold\">{{ item.labelMatch }}</span>\n <span>{{ item.labelPostfix }}</span>\n </li>\n </ul>\n </div>\n</div>\n",
532
- providers: [
533
- {
534
- provide: forms.NG_VALUE_ACCESSOR,
535
- multi: true,
536
- useExisting: i0.forwardRef(function () { return AutocompleteComponent; })
537
- },
538
- {
539
- provide: forms.NG_VALIDATORS,
540
- multi: true,
541
- useExisting: i0.forwardRef(function () { return AutocompleteComponent; })
542
- }
543
- ],
544
- styles: [":focus{z-index:1}input,select,textarea{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057);margin:0;margin:var(--lux-input-margin, 0rem);padding:0 .5rem;padding:var(--lux-input-padding, 0rem .5rem)}.alert{padding:.2rem 2rem;background:#fe2e2e;background:var(--lux-alert-background, #fe2e2e);color:#fff;color:var(--lux-alert-color, white);font-family:Consolas,monospace;width:45%;margin-right:1rem;display:inline-block}.symbol{display:inline-block;align-items:baseline;padding:0 .5rem;margin-bottom:0;font-weight:400;color:default;color:var(--lux-symbol-color, default);text-align:center;white-space:nowrap;background:default;background:var(--lux-symbol-background, default);font-size:1rem;font-size:var(--lux-symbol-font-size, 1rem)}.bordered,.symbol{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057)}.rounded,.rounded-right,.rounded-middle,.rounded-left{border-radius:.25rem;border-radius:var(--lux-border-radius, .25rem)}.rounded-left{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-middle{border-radius:0}.rounded-right{border-top-left-radius:0;border-bottom-left-radius:0}.prefix{border-right:none}.infix{border-left:none;border-right:none}.postfix{border-left:none;display:flex;align-items:center}.lux-autocomplete .lux-autocomplete-box{display:grid;grid-template-columns:1fr -webkit-max-content;grid-template-columns:1fr max-content}.lux-autocomplete input{padding:.1rem 1.5rem .1rem .5rem;padding:var(--lux-autocomplete-input-padding, .1rem 1.5rem .1rem .5rem);text-overflow:ellipsis;grid-row:1;grid-column-start:1;grid-column-end:3}.lux-autocomplete .icon-suggestions{grid-row:1;grid-column:2;width:1.5rem;border:none;background-color:transparent;background:url(/assets/img/suggestions.svg) no-repeat center;background-size:.5rem .5rem;z-index:1;position:relative;left:-1rem}.lux-autocomplete .icon-clear{grid-row:1;grid-column:2;width:1.5rem;width:var(--lux-autocomplete-icon-width, 1.5rem);border:none;background-color:transparent;background:url(/assets/img/filter-clear.png) no-repeat center;background:var(--lux-autocomplete-icon-clear, url(/assets/img/filter-clear.png) no-repeat center);background-size:.5rem .5rem;background-size:var(--lux-autocomplete-icon-bg-size, .5rem .5rem);z-index:1}.lux-autocomplete .icon-dropdown{grid-row:1;grid-column:2;width:1.5rem;width:var(--lux-autocomplete-icon-width, 1.5rem);height:1.3rem;height:var(--lux-autocomplete-icon-height, 1.3rem);border:none;background-color:transparent;background:url(/assets/img/drop-down-arrow.svg) no-repeat center;background:var(--lux-autocomplete-icon-dropdown, url(/assets/img/drop-down-arrow.svg) no-repeat center);background-size:.5rem .5rem;background-size:var(--lux-autocomplete-icon-bg-size, .5rem .5rem);z-index:1}.lux-autocomplete .icon-spinner{grid-row:1;grid-column:2;width:1.5rem;border:none;background-color:transparent;background:url(/assets/img/spinner.svg) no-repeat center;background-size:1.2rem 1.2rem;z-index:1}.lux-completion-list{visibility:collapse;position:absolute;border:1px solid #ccc;margin:0;padding:0;max-height:10rem;overflow:auto;z-index:2}.lux-completion-list ul{list-style:none;margin:0;padding:0}.showCompletion{visibility:visible}.lux-completion-item{background-color:#fff;color:#000;padding:.1rem .5rem;cursor:pointer}.selected{background-color:#2e2eac;color:#fff}.disabled{background-color:#f0f0f0;color:#444}.disabled .selected{background-color:#9898ec;color:#fff}.bold{font-weight:bold}\n"]
545
- },] }
546
- ];
547
- AutocompleteComponent.ctorParameters = function () { return [
548
- { type: i0.ChangeDetectorRef }
549
- ]; };
550
- AutocompleteComponent.propDecorators = {
551
- i0: [{ type: i0.ViewChild, args: ['i0', { static: true },] }],
552
- completeDiv: [{ type: i0.ViewChild, args: ['completeDiv', { static: true },] }],
553
- valueChange: [{ type: i0.Output }],
554
- dataSourceChange: [{ type: i0.Output }],
555
- inputId: [{ type: i0.Input }],
556
- disabled: [{ type: i0.Input }],
557
- readonly: [{ type: i0.Input }],
558
- label: [{ type: i0.Input }],
559
- canAddNewValues: [{ type: i0.Input }],
560
- keepOpenAfterDelete: [{ type: i0.Input }],
561
- value: [{ type: i0.Input }],
562
- dataSource: [{ type: i0.Input }],
563
- required: [{ type: i0.Input }],
564
- placeholder: [{ type: i0.Input }],
565
- resolveLabelsFunction: [{ type: i0.Input }],
566
- populateFunction: [{ type: i0.Input }],
567
- instance: [{ type: i0.Input }]
568
- };
569
- /** Returns true if text includes substring. No accents considered. Ignorecase */
570
- var ignoreAccentsInclude = function (text, substring) {
571
- text = normalizedString(text).toLowerCase();
572
- substring = normalizedString(substring).toLowerCase();
573
- return text.includes(substring);
574
- };
575
- var ɵ0$3 = ignoreAccentsInclude;
576
- /** Returns a normalized string with no accents: used for comparison */
577
- var normalizedString = function (a) { return (a || '').normalize('NFD').replace(/[\u0300-\u036f]/g, ''); };
578
- var ɵ1$2 = normalizedString;
579
- var decorateDataSource = function (dataSource, subString) { return dataSource.map(function (it) { return decorateItem(it, subString); }); };
580
- var ɵ2 = decorateDataSource;
581
- var decorateItem = function (item, tx) {
582
- var index = normalizedString(item.label)
583
- .toLowerCase()
584
- .indexOf(normalizedString(tx).toLowerCase());
585
- var labelPrefix = index === -1 ? item.label : item.label.substr(0, index);
586
- var labelMatch = index === -1 ? '' : item.label.substr(index, tx.length);
587
- var labelPostfix = index === -1 ? '' : item.label.substr(index + tx.length);
588
- var newItem = Object.assign(Object.assign({}, item), { labelPrefix: labelPrefix,
589
- labelMatch: labelMatch,
590
- labelPostfix: labelPostfix });
591
- return newItem;
592
- };
593
- var ɵ3 = decorateItem;
594
- var findLabelForId = function (data, id) {
595
- var found = data.find(function (it) { return it.key === id; });
596
- return found ? found.label : null;
597
- };
598
- var ɵ4 = findLabelForId;
599
- var selectElement = function (completionList, label) {
600
- label = (label || '').toLowerCase();
601
- if (!completionList || completionList.length === 0) {
602
- return null;
603
- }
604
- if (completionList.length === 1) {
605
- return completionList[0];
606
- }
607
- var found = completionList.find(function (it) { return it.label.toLowerCase() === label; });
608
- return found || completionList[0];
609
- };
610
-
611
- /** Language detector based on Navigator preferences */
612
- var languageDetector = function () {
613
- var lang = navigator.language.split('-')[0];
614
- if (lang === 'es' || lang === 'en') {
615
- return lang;
616
- }
617
- return 'en'; // default
618
- };
619
-
620
- var AutocompleteListComponent = /** @class */ (function () {
621
- function AutocompleteListComponent() {
622
- this.literals = {
623
- en: {
624
- placeholder: 'new item',
625
- deleteLabelTemplate: 'Delete <<label>>',
626
- addMessage: 'Add'
627
- },
628
- es: {
629
- placeholder: 'nuevo elemento',
630
- deleteLabelTemplate: 'Eliminar <<label>>',
631
- addMessage: 'Añadir'
632
- }
633
- };
634
- this.internalDataSource = [];
635
- this.autoPopulate = false;
636
- this._value = [];
637
- this.labels = [];
638
- this.canAdd = false;
639
- this.touched = false;
640
- this._lang = languageDetector();
641
- this.dataSource = [];
642
- this.disabled = false;
643
- this.required = false;
644
- this.resolveLabelsFunction = undefined;
645
- this.populateFunction = undefined;
646
- this.valueChange = new i0.EventEmitter();
647
- // ControlValueAccessor Interface
648
- this.onChange = function (value) { };
649
- this.onTouched = function () { };
650
- }
651
- Object.defineProperty(AutocompleteListComponent.prototype, "value", {
652
- get: function () {
653
- return this._value;
654
- },
655
- set: function (val) {
656
- if (val === this._value) {
657
- return;
658
- }
659
- var initialAndEmpty = isInitialAndEmpty(this._value, val);
660
- this._value = val;
661
- this.ensureLabelsForIds();
662
- this.populateWith('');
663
- this.onChange(this._value);
664
- if (!initialAndEmpty) {
665
- this.valueChange.emit(this._value);
666
- }
667
- },
668
- enumerable: false,
669
- configurable: true
670
- });
671
- Object.defineProperty(AutocompleteListComponent.prototype, "lang", {
672
- get: function () {
673
- return this._lang;
674
- },
675
- set: function (l) {
676
- if (l === this._lang) {
677
- return;
678
- }
679
- if (Object.keys(this.literals).includes(l)) {
680
- this._lang = l;
681
- }
682
- else {
683
- this._lang = 'en';
684
- }
685
- },
686
- enumerable: false,
687
- configurable: true
688
- });
689
- AutocompleteListComponent.prototype.writeValue = function (value) {
690
- this.value = value;
691
- };
692
- AutocompleteListComponent.prototype.registerOnChange = function (onChange) {
693
- this.onChange = onChange;
694
- };
695
- AutocompleteListComponent.prototype.registerOnTouched = function (onTouched) {
696
- this.onTouched = onTouched;
697
- };
698
- AutocompleteListComponent.prototype.markAsTouched = function () {
699
- if (!this.touched && !this.disabled) {
700
- this.onTouched();
701
- this.touched = true;
702
- }
703
- };
704
- AutocompleteListComponent.prototype.setDisabledState = function (disabled) {
705
- this.disabled = disabled;
706
- };
707
- // End ControlValueAccessor Interface
708
- // Validator interface
709
- AutocompleteListComponent.prototype.registerOnValidatorChange = function () { };
710
- AutocompleteListComponent.prototype.validate = function (control) {
711
- var value = control.value;
712
- if (this.required &&
713
- (value === '' || value === null || value === undefined)) {
714
- return { required: { value: value, reason: 'Required field.' } };
715
- }
716
- return null;
717
- };
718
- // End of Validator interface
719
- AutocompleteListComponent.prototype.ngOnInit = function () {
720
- this.inputId = this.inputId
721
- ? this.inputId
722
- : "autocompletelist" + AutocompleteListComponent.idCounter++;
723
- this.autoPopulate =
724
- !!this.resolveLabelsFunction && !!this.populateFunction && this.instance;
725
- this.ensureLabelsForIds();
726
- };
727
- AutocompleteListComponent.prototype.ensureLabelsForIds = function () {
728
- var _this = this;
729
- if (this.autoPopulate && this.resolveLabelsFunction) {
730
- this.resolveLabelsFunction(this.instance, this._value)
731
- .pipe(operators.first())
732
- .subscribe(function (data) {
733
- var res = [];
734
- (_this._value || []).map(function (id) {
735
- var found = data.find(function (it) { return it.key === id; });
736
- if (found) {
737
- res.push(found.label);
738
- }
739
- else {
740
- res.push('(unset)');
741
- }
742
- });
743
- _this.labels = res;
744
- });
745
- }
746
- else if (this.dataSource) {
747
- var res_1 = [];
748
- (this._value || []).map(function (id) {
749
- var found = _this.dataSource.find(function (it) { return it.key === id; });
750
- if (found) {
751
- res_1.push(found.label);
752
- }
753
- else {
754
- res_1.push('(unset)');
755
- }
756
- });
757
- this.labels = res_1;
758
- }
759
- else {
760
- this.labels = this._value.map(function (it) { return (it ? it.toString() : '(unset)'); });
761
- }
762
- };
763
- AutocompleteListComponent.prototype.removeAt = function (index) {
764
- if (this._value.length > index) {
765
- var key = this._value.splice(index, 1)[0];
766
- var label = this.labels.splice(index, 1)[0];
767
- this.internalDataSource.push({ key: key, label: label });
768
- }
769
- this.markAsTouched();
770
- };
771
- AutocompleteListComponent.prototype.onValueChange = function () {
772
- this.updateCanAdd();
773
- };
774
- AutocompleteListComponent.prototype.onNewEntryChange = function (event, auto) {
775
- if (event.key === 'Enter' && !!auto.value) {
776
- this.addNew(auto);
777
- }
778
- else if (event.key === 'Delete' || event.key === 'Backspace') {
779
- // todo
780
- }
781
- else {
782
- this.populateWith(auto.label + event.key);
783
- }
784
- this.updateCanAdd();
785
- };
786
- AutocompleteListComponent.prototype.populateWith = function (searchText) {
787
- var _this = this;
788
- if (this.autoPopulate && this.populateFunction && this.instance) {
789
- this.populateFunction(this.instance, searchText)
790
- .pipe(operators.first())
791
- .subscribe(function (data) {
792
- _this.internalDataSource = data.filter(function (it) { return !(_this._value || []).includes(it.key); });
793
- });
794
- }
795
- else if (this.dataSource) {
796
- this.internalDataSource = this.dataSource.filter(function (it) { return !(_this._value || []).includes(it.key); });
797
- }
798
- };
799
- AutocompleteListComponent.prototype.updateCanAdd = function () {
800
- var _this = this;
801
- this.canAdd =
802
- !this.disabled &&
803
- this.auto &&
804
- !!this.auto.value && // has value
805
- !this.value.find(function (it) { return it === _this.auto.value; }); // not already in
806
- };
807
- AutocompleteListComponent.prototype.addNew = function (auto) {
808
- var _this = this;
809
- this.value.push(auto.value);
810
- this.ensureLabelsForIds();
811
- this.newEntry = '';
812
- this.internalDataSource = this.internalDataSource.filter(function (it) { return !_this._value.includes(it.key); });
813
- this.markAsTouched();
814
- };
815
- AutocompleteListComponent.prototype.getDeleteMessage = function (label) {
816
- var _a;
817
- return ((_a = this.deleteLabelTemplate) !== null && _a !== void 0 ? _a : this.literals[this.lang].deleteLabelTemplate).replace('<<label>>', label);
818
- };
819
- return AutocompleteListComponent;
820
- }());
821
- AutocompleteListComponent.idCounter = 0;
822
- AutocompleteListComponent.decorators = [
823
- { type: i0.Component, args: [{
824
- selector: 'lux-autocomplete-list',
825
- template: "<div [id]=\"inputId\">\n <ul>\n <li *ngFor=\"let label of labels; let index = index\">\n <span>{{ label }}</span>\n <button\n *ngIf=\"!disabled\"\n class=\"remove-item\"\n (click)=\"removeAt(index)\"\n attr.aria-label=\"{{ getDeleteMessage(label) }}\"\n ></button>\n </li>\n </ul>\n <div *ngIf=\"!disabled\" class=\"new-entry\">\n <lux-autocomplete\n #auto\n [dataSource]=\"internalDataSource\"\n [placeholder]=\"placeholder ?? literals[lang].placeholder\"\n [(value)]=\"newEntry\"\n (valueChange)=\"onValueChange()\"\n (keypress)=\"onNewEntryChange($event, auto)\"\n >\n </lux-autocomplete>\n <button\n *ngIf=\"canAdd\"\n type=\"button\"\n class=\"add-item\"\n attr.aria-label=\"addMessage ?? literals[lang].addMessage\"\n (click)=\"addNew(auto)\"\n ></button>\n </div>\n</div>\n",
826
- providers: [
827
- {
828
- provide: forms.NG_VALUE_ACCESSOR,
829
- multi: true,
830
- useExisting: i0.forwardRef(function () { return AutocompleteListComponent; })
831
- },
832
- {
833
- provide: forms.NG_VALIDATORS,
834
- multi: true,
835
- useExisting: i0.forwardRef(function () { return AutocompleteListComponent; })
836
- }
837
- ],
838
- styles: [".new-entry{margin-left:1.5rem;display:grid;grid-template-columns:-webkit-max-content -webkit-max-content;grid-template-columns:max-content max-content}.new-entry lux-autocomplete{grid-column:1;grid-row:1}.new-entry .add-item{grid-column:2;grid-row:1;border:none;background:url(/assets/img/create.png) no-repeat .2rem .2rem;background:var(--lux-autocomplete-list-add-icon, url(/assets/img/create.png) no-repeat .2rem .2rem);background-size:1.1rem;background-size:var(--lux-autocomplete-list-add-icon-size, 1.1rem);height:1.4rem;height:var(--lux-autocomplete-list-add-icon-height, 1.4rem);width:1.4rem;width:var(--lux-autocomplete-list-add-icon-width, 1.4rem)}.remove-item{margin-left:.5rem;border:none;background:url(/assets/img/delete.svg) no-repeat .2rem .1rem;background:var(--lux-autocomplete-list-remove-icon, url(/assets/img/delete.svg) no-repeat .2rem .1rem);height:1.2rem;height:var(--lux-autocomplete-list-remove-icon-height, 1.2rem);width:1.3rem;width:var(--lux-autocomplete-list-remove-icon-width, 1.3rem);position:relative;top:.2rem;top:var(--lux-autocomplete-list-remove-icon-top, .2rem);background-size:1rem 1rem;background-size:var(--lux-autocomplete-list-remove-icon-size, 1rem 1rem)}\n"]
839
- },] }
840
- ];
841
- AutocompleteListComponent.propDecorators = {
842
- auto: [{ type: i0.ViewChild, args: ['auto',] }],
843
- value: [{ type: i0.Input }],
844
- lang: [{ type: i0.Input }],
845
- inputId: [{ type: i0.Input }],
846
- dataSource: [{ type: i0.Input }],
847
- placeholder: [{ type: i0.Input }],
848
- disabled: [{ type: i0.Input }],
849
- deleteLabelTemplate: [{ type: i0.Input }],
850
- addMessage: [{ type: i0.Input }],
851
- required: [{ type: i0.Input }],
852
- resolveLabelsFunction: [{ type: i0.Input }],
853
- populateFunction: [{ type: i0.Input }],
854
- instance: [{ type: i0.Input }],
855
- valueChange: [{ type: i0.Output }]
856
- };
857
-
858
- var KEY_SPACE = ' ';
859
- var CheckboxComponent = /** @class */ (function () {
860
- function CheckboxComponent() {
861
- this._lang = languageDetector();
862
- this.label = null;
863
- this.name = null;
864
- this._disabled = false;
865
- this.literals = {
866
- en: {
867
- yesLabel: 'Yes',
868
- noLabel: 'No'
869
- },
870
- es: {
871
- yesLabel: 'Sí',
872
- noLabel: 'No'
873
- }
874
- };
875
- this.touched = false;
876
- this.valueChange = new i0.EventEmitter();
877
- // ControlValueAccessor Interface
878
- this.onChange = function (value) { };
879
- this.onTouched = function () { };
880
- }
881
- Object.defineProperty(CheckboxComponent.prototype, "lang", {
882
- get: function () {
883
- return this._lang;
884
- },
885
- set: function (l) {
886
- if (l === this._lang) {
887
- return;
888
- }
889
- if (Object.keys(this.literals).includes(l)) {
890
- this._lang = l;
891
- }
892
- else {
893
- this._lang = 'en';
894
- }
895
- },
896
- enumerable: false,
897
- configurable: true
898
- });
899
- Object.defineProperty(CheckboxComponent.prototype, "value", {
900
- get: function () {
901
- return this.internalValue;
902
- },
903
- set: function (v) {
904
- if (this.internalValue === v) {
905
- return;
906
- }
907
- var initialAndEmpty = isInitialAndEmpty(this.internalValue, v);
908
- this.internalValue = v;
909
- this.syncModel();
910
- this.onChange(v);
911
- if (!initialAndEmpty) {
912
- this.valueChange.emit(v);
913
- }
914
- },
915
- enumerable: false,
916
- configurable: true
917
- });
918
- Object.defineProperty(CheckboxComponent.prototype, "tabindexValue", {
919
- get: function () {
920
- return this.disabled ? null : '0';
921
- },
922
- enumerable: false,
923
- configurable: true
924
- });
925
- Object.defineProperty(CheckboxComponent.prototype, "disabled", {
926
- get: function () {
927
- return this._disabled;
928
- },
929
- set: function (v) {
930
- if (v === this._disabled) {
931
- return;
932
- }
933
- this._disabled = v;
934
- this.syncModel();
935
- },
936
- enumerable: false,
937
- configurable: true
938
- });
939
- CheckboxComponent.prototype.writeValue = function (value) {
940
- this.value = !!value;
941
- };
942
- CheckboxComponent.prototype.registerOnChange = function (onChange) {
943
- this.onChange = onChange;
944
- };
945
- CheckboxComponent.prototype.registerOnTouched = function (onTouched) {
946
- this.onTouched = onTouched;
947
- };
948
- CheckboxComponent.prototype.markAsTouched = function () {
949
- if (!this.touched) {
950
- this.onTouched();
951
- this.touched = true;
952
- }
953
- };
954
- CheckboxComponent.prototype.setDisabledState = function (disabled) {
955
- this.disabled = disabled;
956
- };
957
- // End ControlValueAccessor Interface
958
- CheckboxComponent.prototype.ngOnInit = function () {
959
- this.inputId = this.inputId
960
- ? this.inputId
961
- : (this.name || 'checkbox') + "$" + CheckboxComponent.idCounter++;
962
- };
963
- CheckboxComponent.prototype.ngAfterViewInit = function () {
964
- this.syncModel();
965
- };
966
- CheckboxComponent.prototype.clicked = function () {
967
- if (!this.disabled) {
968
- this.value = !this.internalValue;
969
- this.markAsTouched();
970
- }
971
- };
972
- CheckboxComponent.prototype.onKey = function (event) {
973
- if (event.key === KEY_SPACE && !this.disabled) {
974
- this.value = !this.internalValue;
975
- this.markAsTouched();
976
- event.preventDefault();
977
- }
978
- };
979
- CheckboxComponent.prototype.syncModel = function () {
980
- if (this.ck) {
981
- this.ck.nativeElement.checked = this.internalValue;
982
- }
983
- };
984
- return CheckboxComponent;
985
- }());
986
- CheckboxComponent.idCounter = 0;
987
- CheckboxComponent.decorators = [
988
- { type: i0.Component, args: [{
989
- selector: 'lux-checkbox',
990
- template: "<div class=\"switch\">\n <div>\n <label *ngIf=\"label\" [for]=\"inputId\">{{ label }}</label>\n </div>\n <div *ngIf=\"!disabled\" class=\"switch-item\" (click)=\"clicked()\">\n <input #ck [name]=\"name\" type=\"checkbox\" [id]=\"inputId\" />\n <div\n class=\"slider round\"\n [class.on]=\"value\"\n [class.disabled]=\"disabled\"\n [tabindex]=\"tabindexValue\"\n (keyup)=\"onKey($event)\"\n ></div>\n </div>\n <div>\n <span class=\"checkbox-label\" *ngIf=\"value\">{{\n literals[lang].yesLabel\n }}</span>\n <span class=\"checkbox-label\" *ngIf=\"!value\">{{\n literals[lang].noLabel\n }}</span>\n </div>\n</div>\n",
991
- providers: [
992
- {
993
- provide: forms.NG_VALUE_ACCESSOR,
994
- multi: true,
995
- useExisting: i0.forwardRef(function () { return CheckboxComponent; })
996
- }
997
- ],
998
- styles: [".switch{display:flex;flex-flow:row wrap;align-items:center}label{padding-right:1.1rem}.switch-item{padding-right:.5em}.slider.round{border-radius:.7rem;width:3.1rem;height:1.4rem}.slider.round:before{border-radius:50%}.switch input{opacity:0;width:0;height:0}.slider{cursor:pointer;position:relative;top:-.7rem;background-color:#ccc;transition:.4s}.slider.on{background-color:#2196f3}.slider:before{position:absolute;content:\"\";height:1rem;width:1rem;left:.2rem;bottom:.2rem;background-color:#fff;transition:.4s}.slider.on:before{transform:translate(26px)}input:focus+.slider{box-shadow:0 0 1px #2196f3}\n"]
999
- },] }
1000
- ];
1001
- CheckboxComponent.ctorParameters = function () { return []; };
1002
- CheckboxComponent.propDecorators = {
1003
- ck: [{ type: i0.ViewChild, args: ['ck', { static: false },] }],
1004
- lang: [{ type: i0.Input }],
1005
- value: [{ type: i0.Input }],
1006
- label: [{ type: i0.Input }],
1007
- name: [{ type: i0.Input }],
1008
- disabled: [{ type: i0.Input }],
1009
- inputId: [{ type: i0.Input }],
1010
- valueChange: [{ type: i0.Output }]
1011
- };
1012
-
1013
- var DatetimeComponent = /** @class */ (function () {
1014
- function DatetimeComponent() {
1015
- this.touched = false;
1016
- this.dirty = false;
1017
- this.lastErrors = null;
1018
- this.dateValue = undefined;
1019
- this.timeValue = undefined;
1020
- this.userErrors = {
1021
- en: {
1022
- required: 'Required field.',
1023
- min: 'Minimum value is $min.',
1024
- max: 'Maximum value is $max.'
1025
- },
1026
- es: {
1027
- required: 'El campo es obligatorio.',
1028
- min: 'El valor mínimo es $min.',
1029
- max: 'El valor máximo es $max.'
1030
- }
1031
- };
1032
- this.min = '1900-01-01T00:00:00Z';
1033
- this.max = '2100-01-01T00:00:00Z';
1034
- this.includeSeconds = true;
1035
- this.localTime = true;
1036
- this.lang = languageDetector();
1037
- this.inlineErrors = false;
1038
- this.readonly = null;
1039
- this.valueChange = new i0.EventEmitter();
1040
- this.keyPress = new i0.EventEmitter();
1041
- this.onChange = function (_value) { };
1042
- this.onTouched = function () { };
1043
- }
1044
- Object.defineProperty(DatetimeComponent.prototype, "className", {
1045
- get: function () {
1046
- return this.checkClassName();
1047
- },
1048
- enumerable: false,
1049
- configurable: true
1050
- });
1051
- Object.defineProperty(DatetimeComponent.prototype, "disabled", {
1052
- get: function () {
1053
- return this._disabled;
1054
- },
1055
- set: function (v) {
1056
- v = typeof v === 'string' && v !== 'false' ? true : v;
1057
- this._disabled = v;
1058
- },
1059
- enumerable: false,
1060
- configurable: true
1061
- });
1062
- Object.defineProperty(DatetimeComponent.prototype, "required", {
1063
- get: function () {
1064
- return this._required;
1065
- },
1066
- set: function (v) {
1067
- this._required = v;
1068
- },
1069
- enumerable: false,
1070
- configurable: true
1071
- });
1072
- Object.defineProperty(DatetimeComponent.prototype, "value", {
1073
- get: function () {
1074
- return this._value;
1075
- },
1076
- set: function (v) {
1077
- if (v === this._value) {
1078
- return; // prevent events when there is no changes
1079
- }
1080
- var initialAndEmpty = isInitialAndEmpty(this._value, v);
1081
- var datetime = new Date(v);
1082
- if (!v) {
1083
- this._value = null;
1084
- this.setDateInControl(null);
1085
- this.setTimeInControl(null);
1086
- }
1087
- else if (!isValidDate(datetime)) {
1088
- this._value = v;
1089
- // we don't set value in control if the value is not valid
1090
- // if we do, the content of the control changes and can erase what the user is typing
1091
- }
1092
- else {
1093
- this._value = datetime.toISOString(); // YYYY-MM-DDThh:mm:ss.SSSZ
1094
- this.setValueInControl(datetime);
1095
- }
1096
- this.onChange(v);
1097
- if (!initialAndEmpty) {
1098
- this.valueChange.emit(v);
1099
- }
1100
- },
1101
- enumerable: false,
1102
- configurable: true
1103
- });
1104
- // ControlValueAccessor Interface implementation
1105
- DatetimeComponent.prototype.writeValue = function (value) {
1106
- this.value = value;
1107
- };
1108
- DatetimeComponent.prototype.registerOnChange = function (onChange) {
1109
- this.onChange = onChange;
1110
- };
1111
- DatetimeComponent.prototype.registerOnTouched = function (onTouched) {
1112
- this.onTouched = onTouched;
1113
- };
1114
- DatetimeComponent.prototype.markAsTouched = function () {
1115
- if (!this.touched) {
1116
- this.onTouched();
1117
- this.touched = true;
1118
- }
1119
- };
1120
- DatetimeComponent.prototype.setDisabledState = function (disabled) {
1121
- this.disabled = disabled;
1122
- };
1123
- // End of ControlValueAccessor Interface implementation
1124
- DatetimeComponent.prototype.setDateInControl = function (date) {
1125
- // this.dateInput.nativeElement.value = date;
1126
- this.dateValue = date;
1127
- };
1128
- DatetimeComponent.prototype.setTimeInControl = function (time) {
1129
- // this.timeInput.nativeElement.value = time;
1130
- this.timeValue = time;
1131
- };
1132
- DatetimeComponent.prototype.setValueInControl = function (datetime) {
1133
- var offsetDatetime = this.localTime
1134
- ? addTimezoneOffset(datetime)
1135
- : datetime;
1136
- var offsetDatetimeString = offsetDatetime.toISOString(); // YYYY-MM-DDThh:mm:ss.SSSZ
1137
- this.setDateInControl(offsetDatetimeString.slice(0, 10)); // YYYY-MM-DD
1138
- if (this.includeSeconds) {
1139
- this.setTimeInControl(offsetDatetimeString.slice(11, 19)); // hh:mm:ss
1140
- }
1141
- else {
1142
- this.setTimeInControl(offsetDatetimeString.slice(11, 16)); // hh:mm
1143
- }
1144
- };
1145
- DatetimeComponent.prototype.clear = function () {
1146
- this.setDateInControl(null);
1147
- this.setTimeInControl(null);
1148
- this.value = null;
1149
- };
1150
- // Validator interface
1151
- DatetimeComponent.prototype.registerOnValidatorChange = function () { };
1152
- DatetimeComponent.prototype.validate = function (control) {
1153
- var value = control.value;
1154
- var result = null;
1155
- if (this.required &&
1156
- !hasValue(value) &&
1157
- !hasValue(this.dateValue) &&
1158
- !hasValue(this.timeValue)) {
1159
- result = result || {};
1160
- result.required = { value: value, reason: 'Required field.' };
1161
- }
1162
- if (!hasValue(this.dateValue) && hasValue(this.timeValue)) {
1163
- result = result || {};
1164
- result.existsDate = {
1165
- value: value,
1166
- reason: 'Date not specified.'
1167
- };
1168
- }
1169
- if (hasValue(this.dateValue) && !hasValue(this.timeValue)) {
1170
- result = result || {};
1171
- result.existsTime = {
1172
- value: value,
1173
- reason: 'Time not specified.'
1174
- };
1175
- }
1176
- if (hasValue(this.min) &&
1177
- hasValue(value) &&
1178
- hasValue(this.dateValue) &&
1179
- hasValue(this.timeValue) &&
1180
- String(value).localeCompare(this.min) === -1) {
1181
- result = result || {};
1182
- result.min = {
1183
- value: value,
1184
- min: this.min,
1185
- reason: "Value is lower than minimum value: " + this.min + "."
1186
- };
1187
- }
1188
- if (hasValue(this.max) &&
1189
- hasValue(value) &&
1190
- hasValue(this.dateValue) &&
1191
- hasValue(this.timeValue) &&
1192
- String(value).localeCompare(this.max) !== -1) {
1193
- result = result || {};
1194
- result.max = {
1195
- value: value,
1196
- max: this.max,
1197
- reason: "Value is greater than than maximum value: " + this.max + "."
1198
- };
1199
- }
1200
- this.lastErrors = result;
1201
- return result;
1202
- };
1203
- // End of Validator interface
1204
- DatetimeComponent.prototype.ngOnInit = function () {
1205
- this.inputId = this.inputId
1206
- ? this.inputId
1207
- : "datetime$" + DatetimeComponent.idCounter++;
1208
- this.setPatterns();
1209
- };
1210
- DatetimeComponent.prototype.onLostFocus = function () {
1211
- this.markAsTouched();
1212
- };
1213
- DatetimeComponent.prototype.onKeyPress = function (event) {
1214
- this.keyPress.emit(event);
1215
- };
1216
- DatetimeComponent.prototype.onEventDatetime = function (newDate, newTime) {
1217
- if (this.disabled || this.readonly) {
1218
- return;
1219
- }
1220
- var newValue = '' + newDate + ' ' + newTime;
1221
- if (!newValue) {
1222
- this.value = null;
1223
- }
1224
- else {
1225
- var datetime = new Date(newValue);
1226
- if (isValidDate(datetime)) {
1227
- var datetimeString = void 0;
1228
- if (this.localTime) {
1229
- datetimeString = datetime.toISOString(); // YYYY-MM-DDThh:mm:ss.SSSZ
1230
- }
1231
- else {
1232
- datetimeString = addTimezoneOffset(datetime).toISOString(); // YYYY-MM-DDThh:mm:ss.SSSZ
1233
- }
1234
- if (this.includeSeconds) {
1235
- this.value = datetimeString.slice(0, 19) + 'Z'; // YYYY-MM-DDThh:mm:ssZ
1236
- }
1237
- else {
1238
- this.value = datetimeString.slice(0, 16) + 'Z'; // YYYY-MM-DDThh:mmZ
1239
- }
1240
- }
1241
- else {
1242
- this.value = newValue;
1243
- }
1244
- }
1245
- };
1246
- DatetimeComponent.prototype.checkClassName = function () {
1247
- return this.disabled
1248
- ? this.readonly
1249
- ? 'disabled readonly'
1250
- : 'disabled'
1251
- : this.readonly
1252
- ? 'readonly'
1253
- : '';
1254
- };
1255
- DatetimeComponent.prototype.setPatterns = function () {
1256
- this.min = this.min || '1900-01-01';
1257
- this.max = this.max || '2100-01-01';
1258
- };
1259
- return DatetimeComponent;
1260
- }());
1261
- DatetimeComponent.idCounter = 0;
1262
- DatetimeComponent.decorators = [
1263
- { type: i0.Component, args: [{
1264
- selector: 'lux-datetime',
1265
- template: "<input\n #dateInput\n class=\"rounded-left prefix\"\n [ngClass]=\"className\"\n type=\"date\"\n [id]=\"inputId + '$date'\"\n [(ngModel)]=\"dateValue\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.disabled]=\"disabled === true ? 'true' : undefined\"\n [attr.readonly]=\"readonly === true ? 'true' : undefined\"\n [placeholder]=\"\"\n (keyup)=\"onEventDatetime(dateInput.value, timeInput.value)\"\n (change)=\"onEventDatetime(dateInput.value, timeInput.value)\"\n (keypress)=\"onKeyPress($event)\"\n (blur)=\"onLostFocus()\"\n/>\n<input\n #timeInput\n [class]=\"(disabled || readonly) && localTime ? 'rounded-right' : ''\"\n [ngClass]=\"className\"\n type=\"time\"\n [id]=\"inputId + '$time'\"\n [(ngModel)]=\"timeValue\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.disabled]=\"disabled === true ? 'true' : undefined\"\n [attr.readonly]=\"readonly === true ? 'true' : undefined\"\n [placeholder]=\"\"\n [step]=\"includeSeconds ? 1 : 60\"\n (keyup)=\"onEventDatetime(dateInput.value, timeInput.value)\"\n (change)=\"onEventDatetime(dateInput.value, timeInput.value)\"\n (keypress)=\"onKeyPress($event)\"\n (blur)=\"onLostFocus()\"\n/>\n<ng-container\n *ngIf=\"!localTime\"\n>\n <div\n [class]=\"disabled || readonly ? 'rounded-right postfix symbol' : 'postfix symbol'\"\n [ngClass]=\"className\"\n >\n <span>{{ localTime ? '' : 'UTC' }}</span>\n </div>\n</ng-container>\n<button\n #clearButton\n *ngIf=\"!(disabled || readonly)\"\n type=\"button\"\n class=\"rounded-right postfix bordered icon-clear\"\n [id]=\"inputId + '$clear'\"\n (click)=\"clear()\"\n aria-label=\"clear\"\n></button>\n\n<div *ngIf=\"inlineErrors && lastErrors && (dirty || touched)\" class=\"alert\">\n <div *ngIf=\"lastErrors.required\">\n {{ userErrors[lang].required }}\n </div>\n <div *ngIf=\"lastErrors.min\">\n {{ userErrors[lang].min.replace('$min', lastErrors.min.min) }}\n </div>\n <div *ngIf=\"lastErrors.max\">\n {{ userErrors[lang].max.replace('$max', lastErrors.max.max) }}\n </div>\n</div>\n",
1266
- providers: [
1267
- {
1268
- provide: forms.NG_VALUE_ACCESSOR,
1269
- multi: true,
1270
- useExisting: i0.forwardRef(function () { return DatetimeComponent; })
1271
- },
1272
- {
1273
- provide: forms.NG_VALIDATORS,
1274
- multi: true,
1275
- useExisting: i0.forwardRef(function () { return DatetimeComponent; })
1276
- }
1277
- ],
1278
- styles: [":focus{z-index:1}input,select,textarea{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057);margin:0;margin:var(--lux-input-margin, 0rem);padding:0 .5rem;padding:var(--lux-input-padding, 0rem .5rem)}.alert{padding:.2rem 2rem;background:#fe2e2e;background:var(--lux-alert-background, #fe2e2e);color:#fff;color:var(--lux-alert-color, white);font-family:Consolas,monospace;width:45%;margin-right:1rem;display:inline-block}.symbol{display:inline-block;align-items:baseline;padding:0 .5rem;margin-bottom:0;font-weight:400;color:default;color:var(--lux-symbol-color, default);text-align:center;white-space:nowrap;background:default;background:var(--lux-symbol-background, default);font-size:1rem;font-size:var(--lux-symbol-font-size, 1rem)}.bordered,.symbol{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057)}.rounded,.rounded-right,.rounded-middle,.rounded-left{border-radius:.25rem;border-radius:var(--lux-border-radius, .25rem)}.rounded-left{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-middle{border-radius:0}.rounded-right{border-top-left-radius:0;border-bottom-left-radius:0}.prefix{border-right:none}.infix{border-left:none;border-right:none}.postfix{border-left:none;display:flex;align-items:center}:host{display:flex;align-items:stretch}.readonly{border:none}.readonly:focus{border:none;outline:none}.disabled{background-color:#f1f1f1;background-color:var(--lux-disabled-color, #f1f1f1);border-color:#6d6d6d;border-color:var(--lux-disabled-border-color, #6d6d6d)}.icon-clear{grid-row:1;grid-column:2;width:1.5rem;width:var(--lux-autocomplete-icon-width, 1.5rem);background:url(/assets/img/filter-clear.png) no-repeat center;background:var(--lux-autocomplete-icon-clear, url(/assets/img/filter-clear.png) no-repeat center);background-size:.5rem .5rem;background-size:var(--lux-autocomplete-icon-bg-size, .5rem .5rem);z-index:1}\n"]
1279
- },] }
1280
- ];
1281
- DatetimeComponent.ctorParameters = function () { return []; };
1282
- DatetimeComponent.propDecorators = {
1283
- dateInput: [{ type: i0.ViewChild, args: ['dateInput', { static: true },] }],
1284
- timeInput: [{ type: i0.ViewChild, args: ['timeInput', { static: true },] }],
1285
- min: [{ type: i0.Input }],
1286
- max: [{ type: i0.Input }],
1287
- includeSeconds: [{ type: i0.Input }],
1288
- localTime: [{ type: i0.Input }],
1289
- lang: [{ type: i0.Input }],
1290
- inlineErrors: [{ type: i0.Input }],
1291
- inputId: [{ type: i0.Input }],
1292
- ariaLabel: [{ type: i0.Input, args: ['aria-label',] }],
1293
- readonly: [{ type: i0.Input }],
1294
- disabled: [{ type: i0.Input }],
1295
- required: [{ type: i0.Input }],
1296
- value: [{ type: i0.Input }],
1297
- valueChange: [{ type: i0.Output }],
1298
- keyPress: [{ type: i0.Output }]
1299
- };
1300
-
1301
- /**
1302
- * A service that holds the functionality for advanced handling of regular expressions
1303
- */
1304
- var RegexpService = /** @class */ (function () {
1305
- function RegexpService() {
1306
- }
1307
- RegexpService.prototype.removeOuterRoundBrackets = function (regularExpressionString) {
1308
- while (regularExpressionString[0] === '(' &&
1309
- regularExpressionString[regularExpressionString.length - 1] === ')') {
1310
- regularExpressionString = regularExpressionString.slice(1, regularExpressionString.length - 1);
1311
- }
1312
- return regularExpressionString;
1313
- };
1314
- RegexpService.prototype.isQuantifier = function (quantifier) {
1315
- switch (quantifier) {
1316
- case '{':
1317
- case '?':
1318
- case '+':
1319
- case '*':
1320
- return true;
1321
- }
1322
- return false;
1323
- };
1324
- RegexpService.prototype.parseMinimalAmountOfQuantifier = function (quantifier) {
1325
- switch (quantifier[0]) {
1326
- case '?':
1327
- case '*':
1328
- return 0;
1329
- case '+':
1330
- return 1;
1331
- case '{':
1332
- for (var index = 1; index < quantifier.length; ++index) {
1333
- if (quantifier[index] < '0' || quantifier[index] > '9') {
1334
- return Number(quantifier.slice(1, index));
1335
- }
1336
- }
1337
- }
1338
- return 0;
1339
- };
1340
- RegexpService.prototype.sliceRegexByOr = function (regularExpressionString) {
1341
- var result = [];
1342
- var slicedRegex = '';
1343
- var lastSliceIndex = 0;
1344
- var roundBracketCount = 0;
1345
- var squareBracketCount = 0;
1346
- var curlyBracketCount = 0;
1347
- var index = 0;
1348
- for (; index < regularExpressionString.length; ++index) {
1349
- switch (regularExpressionString[index]) {
1350
- case '\\':
1351
- // escape sequence; skip the next character
1352
- ++index;
1353
- break;
1354
- case '(':
1355
- roundBracketCount += 1;
1356
- break;
1357
- case ')':
1358
- roundBracketCount -= 1;
1359
- break;
1360
- case '[':
1361
- squareBracketCount += 1;
1362
- break;
1363
- case ']':
1364
- squareBracketCount -= 1;
1365
- break;
1366
- case '{':
1367
- curlyBracketCount += 1;
1368
- break;
1369
- case '}':
1370
- curlyBracketCount -= 1;
1371
- break;
1372
- case '|':
1373
- if (roundBracketCount === 0 &&
1374
- squareBracketCount === 0 &&
1375
- curlyBracketCount === 0) {
1376
- slicedRegex = this.removeOuterRoundBrackets(regularExpressionString.slice(lastSliceIndex, index));
1377
- result.push(slicedRegex);
1378
- lastSliceIndex = index + 1;
1379
- }
1380
- break;
1381
- }
1382
- }
1383
- slicedRegex = this.removeOuterRoundBrackets(regularExpressionString.slice(lastSliceIndex, index));
1384
- result.push(slicedRegex);
1385
- return result;
1386
- };
1387
- RegexpService.prototype.sliceRegexByThen = function (regularExpressionString) {
1388
- // the actual result
1389
- var resultStart = [];
1390
- // the remainder of the regex in each case
1391
- var resultRemainder = [];
1392
- var roundBracketCount = 0;
1393
- var squareBracketCount = 0;
1394
- var curlyBracketCount = 0;
1395
- for (var index = 0; index < regularExpressionString.length; ++index) {
1396
- switch (regularExpressionString[index]) {
1397
- case '\\':
1398
- // escape sequence; skip the next character
1399
- ++index;
1400
- break;
1401
- case '(':
1402
- roundBracketCount += 1;
1403
- break;
1404
- case ')':
1405
- roundBracketCount -= 1;
1406
- break;
1407
- case '[':
1408
- squareBracketCount += 1;
1409
- break;
1410
- case ']':
1411
- squareBracketCount -= 1;
1412
- break;
1413
- case '{':
1414
- curlyBracketCount += 1;
1415
- break;
1416
- case '}':
1417
- curlyBracketCount -= 1;
1418
- break;
1419
- }
1420
- if (roundBracketCount === 0 &&
1421
- squareBracketCount === 0 &&
1422
- curlyBracketCount === 0) {
1423
- if (!this.isQuantifier(regularExpressionString[index + 1])) {
1424
- resultStart.push(regularExpressionString.slice(0, index + 1));
1425
- resultRemainder.push(regularExpressionString.slice(index + 1));
1426
- }
1427
- else {
1428
- // let minimalAmountOfRepeats = parseMinimalAmountOfQuantifier(regularExpressionString.slice(index + 1));
1429
- // TODO
1430
- }
1431
- }
1432
- }
1433
- return [resultStart, resultRemainder];
1434
- };
1435
- RegexpService.prototype.suggestion = function (beginning, regularExpressionString) {
1436
- if (new RegExp(regularExpressionString).test(beginning)) {
1437
- // TODO: RETURN AN EMPTY STRING
1438
- return 'YA ES IGUAL, NO HAY MÁS QUE SUGERIR';
1439
- }
1440
- var regexOptions = this.sliceRegexByOr(regularExpressionString);
1441
- if (regexOptions.length > 1) {
1442
- for (var regexOptionIndex = 0; regexOptionIndex < regexOptions.length; ++regexOptionIndex) {
1443
- var regexParts = this.sliceRegexByThen(regexOptions[regexOptionIndex]);
1444
- var regexPartsStarts = regexParts[0];
1445
- var regexPartsRemainders = regexParts[1];
1446
- // for each option, test if the first part of the regex matches
1447
- // if it doesn't, continue
1448
- // if it does, keep checking until what part it matches
1449
- if (!new RegExp(regexPartsStarts[0]).test(beginning)) {
1450
- // if there are no more options
1451
- if (regexOptionIndex === regexOptions.length - 1) {
1452
- // we return the first option, but we could return any option
1453
- // TODO: RETURN ANY TEXT THAT MATCHES regexOptions[0]
1454
- return regexOptions[0];
1455
- }
1456
- }
1457
- else {
1458
- for (var regexPartIndex = 1; regexPartIndex < regexPartsStarts.length; ++regexPartIndex) {
1459
- if (!new RegExp(regexPartsStarts[regexPartIndex]).test(beginning)) {
1460
- // TODO: RETURN ANY TEXT THAT MATCHES regexPartsRemainders[regexPartIndex - 1]
1461
- return regexPartsRemainders[regexPartIndex - 1];
1462
- }
1463
- }
1464
- }
1465
- }
1466
- }
1467
- else if (regexOptions.length === 1) {
1468
- var regexParts = this.sliceRegexByThen(regexOptions[0]);
1469
- var regexPartsStarts = regexParts[0];
1470
- var regexPartsRemainders = regexParts[1];
1471
- if (!new RegExp(regexPartsStarts[0]).test(beginning)) {
1472
- // TODO: RETURN ANY TEXT THAT MATCHES regularExpressionString
1473
- return regularExpressionString;
1474
- }
1475
- else {
1476
- for (var regexPartIndex = 1; regexPartIndex < regexPartsStarts.length; ++regexPartIndex) {
1477
- if (!new RegExp(regexPartsStarts[regexPartIndex]).test(beginning)) {
1478
- // TODO: RETURN ANY TEXT THAT MATCHES regexPartsRemainders[regexPartIndex - 1]
1479
- return regexPartsRemainders[regexPartIndex - 1];
1480
- }
1481
- }
1482
- }
1483
- }
1484
- // TODO: RETURN AN EMPTY STRING
1485
- return 'NO DEBERÍA SER POSIBLE';
1486
- };
1487
- return RegexpService;
1488
- }());
1489
- RegexpService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function RegexpService_Factory() { return new RegexpService(); }, token: RegexpService, providedIn: "root" });
1490
- RegexpService.decorators = [
1491
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1492
- ];
1493
- RegexpService.ctorParameters = function () { return []; };
1494
-
1495
- var InputComponent = /** @class */ (function () {
1496
- function InputComponent(regexpService) {
1497
- this.regexpService = regexpService;
1498
- this.touched = false;
1499
- this.dirty = false;
1500
- this.lastErrors = null;
1501
- this._value = '';
1502
- this._pattern = undefined;
1503
- this._regexp = undefined;
1504
- this.userErrors = {
1505
- en: {
1506
- required: 'Required field.',
1507
- min: 'Minimum value is $min.',
1508
- max: 'Maximum value is $max.',
1509
- email: 'Format should match example@example.com.',
1510
- url: 'Format should match https://example.com.',
1511
- color: 'Format should match #XXXXXX.'
1512
- },
1513
- es: {
1514
- required: 'El campo es obligatorio.',
1515
- min: 'El valor mínimo es $min.',
1516
- max: 'El valor máximo es $max.',
1517
- email: 'El campo debe tener un formato como ejemplo@ejemplo.com.',
1518
- url: 'El campo debe tener un formato como https://ejemplo.com.',
1519
- color: 'El campo debe tener un formato como #XXXXXX.'
1520
- }
1521
- };
1522
- this.lang = languageDetector();
1523
- this.inlineErrors = false;
1524
- this.readonly = null;
1525
- this.valueChange = new i0.EventEmitter();
1526
- this.keyPress = new i0.EventEmitter();
1527
- this.onChange = function (value) { };
1528
- this.onTouched = function () { };
1529
- }
1530
- Object.defineProperty(InputComponent.prototype, "className", {
1531
- get: function () {
1532
- return this.checkClassName();
1533
- },
1534
- enumerable: false,
1535
- configurable: true
1536
- });
1537
- Object.defineProperty(InputComponent.prototype, "color", {
1538
- get: function () {
1539
- return this.checkColor();
1540
- },
1541
- enumerable: false,
1542
- configurable: true
1543
- });
1544
- Object.defineProperty(InputComponent.prototype, "disabled", {
1545
- get: function () {
1546
- return this._disabled;
1547
- },
1548
- set: function (v) {
1549
- v = typeof v === 'string' ? true : v;
1550
- this._disabled = v;
1551
- },
1552
- enumerable: false,
1553
- configurable: true
1554
- });
1555
- Object.defineProperty(InputComponent.prototype, "pattern", {
1556
- get: function () {
1557
- return this._pattern;
1558
- },
1559
- set: function (p) {
1560
- this._pattern = p;
1561
- if (p === undefined) {
1562
- this._regexp = undefined;
1563
- }
1564
- else {
1565
- try {
1566
- this._regexp = new RegExp(p);
1567
- }
1568
- catch (e) {
1569
- this._pattern = undefined;
1570
- this._regexp = undefined;
1571
- }
1572
- }
1573
- },
1574
- enumerable: false,
1575
- configurable: true
1576
- });
1577
- Object.defineProperty(InputComponent.prototype, "currency", {
1578
- get: function () {
1579
- return this._currency;
1580
- },
1581
- set: function (v) {
1582
- this._currency = v.toUpperCase();
1583
- },
1584
- enumerable: false,
1585
- configurable: true
1586
- });
1587
- Object.defineProperty(InputComponent.prototype, "placeholder", {
1588
- get: function () {
1589
- return this._placeholder ? this._placeholder : '';
1590
- },
1591
- set: function (v) {
1592
- this._placeholder = v;
1593
- },
1594
- enumerable: false,
1595
- configurable: true
1596
- });
1597
- Object.defineProperty(InputComponent.prototype, "required", {
1598
- get: function () {
1599
- return this._required;
1600
- },
1601
- set: function (v) {
1602
- this._required = v;
1603
- },
1604
- enumerable: false,
1605
- configurable: true
1606
- });
1607
- Object.defineProperty(InputComponent.prototype, "type", {
1608
- get: function () {
1609
- return this._type ? this._type : 'text';
1610
- },
1611
- set: function (v) {
1612
- this._type = v.toLowerCase();
1613
- this.domain = v.toLowerCase();
1614
- this.checkType(v);
1615
- },
1616
- enumerable: false,
1617
- configurable: true
1618
- });
1619
- Object.defineProperty(InputComponent.prototype, "value", {
1620
- get: function () {
1621
- if (this.isPercentage() || this.isPermillage() || this.isNumber()) {
1622
- var numVal = parseFloat(this._value);
1623
- if (!Number.isNaN(numVal)) {
1624
- return numVal;
1625
- }
1626
- }
1627
- return this._value;
1628
- },
1629
- set: function (v) {
1630
- v = v === undefined ? null : v;
1631
- if (v === this._value) {
1632
- return; // prevent events when there is no changes
1633
- }
1634
- var initialAndEmpty = isInitialAndEmpty(this._value, v);
1635
- if (this.type === 'date') {
1636
- v = normalizeDate(v);
1637
- }
1638
- this._value = v;
1639
- this.onChange(v);
1640
- if (!initialAndEmpty) {
1641
- this.valueChange.emit(v);
1642
- }
1643
- },
1644
- enumerable: false,
1645
- configurable: true
1646
- });
1647
- // ControlValueAccessor Interface implementation
1648
- InputComponent.prototype.writeValue = function (value) {
1649
- this.value = value;
1650
- this.setValueInControl(value);
1651
- };
1652
- InputComponent.prototype.registerOnChange = function (onChange) {
1653
- this.onChange = onChange;
1654
- };
1655
- InputComponent.prototype.registerOnTouched = function (onTouched) {
1656
- this.onTouched = onTouched;
1657
- };
1658
- InputComponent.prototype.markAsTouched = function () {
1659
- if (!this.touched) {
1660
- this.onTouched();
1661
- this.touched = true;
1662
- }
1663
- };
1664
- InputComponent.prototype.setDisabledState = function (disabled) {
1665
- this.disabled = disabled;
1666
- };
1667
- // End of ControlValueAccessor Interface implementation
1668
- InputComponent.prototype.setValueInControl = function (v) {
1669
- if (this.domain === 'date') {
1670
- v = normalizeDate(v);
1671
- }
1672
- if (this.input) {
1673
- this.input.nativeElement.value = v;
1674
- }
1675
- if (this.textarea) {
1676
- this.textarea.nativeElement.value = v;
1677
- }
1678
- };
1679
- // Validator interface
1680
- InputComponent.prototype.registerOnValidatorChange = function () { };
1681
- InputComponent.prototype.validate = function (control) {
1682
- var value = control.value;
1683
- var result = null;
1684
- if (this.required && !hasValue(value)) {
1685
- result = result || {};
1686
- result.required = { value: value, reason: 'Required field.' };
1687
- }
1688
- if (this._regexp && hasValue(value) && !this._regexp.test(value)) {
1689
- result = result || {};
1690
- result.pattern = {
1691
- value: value,
1692
- reason: "Value must follow the pattern: " + this._pattern
1693
- };
1694
- }
1695
- if (this.type === 'email' && hasValue(value) && !isValidEmail(value)) {
1696
- result = result || {};
1697
- result.email = { value: value, reason: 'Invalid email.' };
1698
- }
1699
- if (this.type === 'url' && hasValue(value) && !isValidUrl(value)) {
1700
- result = result || {};
1701
- result.url = { value: value, reason: 'Invalid URL.' };
1702
- }
1703
- if (this.type === 'color' && hasValue(value) && !isValidColor(value)) {
1704
- result = result || {};
1705
- result.color = { value: value, reason: 'Invalid color.' };
1706
- }
1707
- if (this.type === 'number' && hasValue(value) && !isValidNumber(value)) {
1708
- result = result || {};
1709
- result.numeric = { value: value, reason: 'Invalid number.' };
1710
- }
1711
- if (this.type === 'date' ||
1712
- this.type === 'time' ||
1713
- this.type === 'timestamp') {
1714
- if (typeof this.min === 'string' &&
1715
- hasValue(value) &&
1716
- String(value).localeCompare(this.min) === -1) {
1717
- result = result || {};
1718
- result.min = {
1719
- value: value,
1720
- min: this.min,
1721
- reason: "Value is lower than minimum value: " + this.min + "."
1722
- };
1723
- }
1724
- if (typeof this.max === 'string' &&
1725
- hasValue(value) &&
1726
- String(value).localeCompare(this.max) !== -1) {
1727
- result = result || {};
1728
- result.max = {
1729
- value: value,
1730
- max: this.max,
1731
- reason: "Value is greater than than maximum value: " + this.max + "."
1732
- };
1733
- }
1734
- }
1735
- if (this.type === 'percentage' ||
1736
- this.type === 'permillage' ||
1737
- this.type === 'number' ||
1738
- this.type === 'currency') {
1739
- if (hasValue(this.min) && hasValue(value) && value < +this.min) {
1740
- result = result || {};
1741
- result.min = {
1742
- value: value,
1743
- min: this.min,
1744
- reason: "Value is lower than minimum value: " + this.min + "."
1745
- };
1746
- }
1747
- if (hasValue(this.max) && hasValue(value) && value > +this.max) {
1748
- result = result || {};
1749
- result.max = {
1750
- value: value,
1751
- max: this.max,
1752
- reason: "Value is greater than than maximum value: " + this.max + "."
1753
- };
1754
- }
1755
- }
1756
- this.lastErrors = result;
1757
- return result;
1758
- };
1759
- // End of Validator interface
1760
- InputComponent.prototype.ngOnInit = function () {
1761
- this.inputId = this.inputId
1762
- ? this.inputId
1763
- : this.type + "$" + InputComponent.idCounter++;
1764
- };
1765
- InputComponent.prototype.onLostFocus = function () {
1766
- this.markAsTouched();
1767
- };
1768
- InputComponent.prototype.onKeyUp = function (newValue) {
1769
- this.value = newValue;
1770
- };
1771
- InputComponent.prototype.onChangeValue = function (newValue) {
1772
- this.value = newValue;
1773
- if (this.isColor()) {
1774
- this.colorpicker.nativeElement.value = undefined;
1775
- }
1776
- this.markAsTouched();
1777
- };
1778
- InputComponent.prototype.onKeyPress = function (event) {
1779
- this.keyPress.emit(event);
1780
- };
1781
- InputComponent.prototype.onColorPicked = function (newValue) {
1782
- this.onChangeValue(newValue);
1783
- this.setValueInControl(newValue);
1784
- };
1785
- InputComponent.prototype.isUrl = function () {
1786
- return this.type === 'url';
1787
- };
1788
- InputComponent.prototype.isColor = function () {
1789
- return this.type === 'color';
1790
- };
1791
- InputComponent.prototype.isNumber = function () {
1792
- return this.type === 'number';
1793
- };
1794
- InputComponent.prototype.isPercentage = function () {
1795
- return this.type === 'percentage';
1796
- };
1797
- InputComponent.prototype.isPermillage = function () {
1798
- return this.type === 'permillage';
1799
- };
1800
- InputComponent.prototype.hasPrefix = function () {
1801
- return this.currency === 'USD';
1802
- };
1803
- InputComponent.prototype.hasPostfix = function () {
1804
- return (this.currency === 'EUR' ||
1805
- this.isPercentage() ||
1806
- this.isPermillage() ||
1807
- (this.isUrl() && !!this.value) ||
1808
- this.isColor());
1809
- };
1810
- InputComponent.prototype.checkClassName = function () {
1811
- return this.disabled
1812
- ? this.readonly
1813
- ? 'disabled readonly'
1814
- : 'disabled'
1815
- : this.readonly
1816
- ? 'readonly'
1817
- : '';
1818
- };
1819
- InputComponent.prototype.checkColor = function () {
1820
- return this.type === 'color' && isValidColor(this.value)
1821
- ? this.value
1822
- : 'initial';
1823
- };
1824
- InputComponent.prototype.checkType = function (type) {
1825
- switch (type) {
1826
- case 'email':
1827
- this.setEmailPatterns();
1828
- break;
1829
- case 'url':
1830
- this.setUrlPatterns();
1831
- break;
1832
- case 'color':
1833
- this.setColorPatterns();
1834
- break;
1835
- case 'date':
1836
- this.setDatePatterns();
1837
- break;
1838
- case 'time':
1839
- this.setTimePatterns();
1840
- break;
1841
- case 'password':
1842
- this.setPasswordPatterns();
1843
- break;
1844
- case 'number':
1845
- this.setNumberPatterns();
1846
- break;
1847
- case 'currency':
1848
- this.setCurrencyPatterns();
1849
- break;
1850
- case 'percentage':
1851
- this.setPercentagePatterns();
1852
- break;
1853
- case 'permillage':
1854
- this.setPermillagePatterns();
1855
- break;
1856
- default:
1857
- break;
1858
- }
1859
- };
1860
- InputComponent.prototype.setEmailPatterns = function () { };
1861
- InputComponent.prototype.setUrlPatterns = function () { };
1862
- InputComponent.prototype.setColorPatterns = function () {
1863
- this.domain = 'text';
1864
- };
1865
- InputComponent.prototype.setDatePatterns = function () {
1866
- this.min = this.min || '1900-01-01';
1867
- this.max = this.max || '2100-01-01';
1868
- };
1869
- InputComponent.prototype.setTimePatterns = function () { };
1870
- InputComponent.prototype.setPasswordPatterns = function () { };
1871
- InputComponent.prototype.setNumberPatterns = function () {
1872
- this.domain = 'number';
1873
- this.placeholder = '0';
1874
- };
1875
- InputComponent.prototype.setCurrencyPatterns = function () {
1876
- this.domain = 'number';
1877
- this.step = this.step || 0.1;
1878
- this.min = this.min || 0.0;
1879
- this.max = this.max || 10000.0;
1880
- this.value = 0.0;
1881
- };
1882
- InputComponent.prototype.setPercentagePatterns = function () {
1883
- this.domain = 'number';
1884
- this.step = this.step || 0.01;
1885
- this.min = this.min || 0.0;
1886
- this.max = this.max || 100.0;
1887
- this.placeholder = '0.00';
1888
- };
1889
- InputComponent.prototype.setPermillagePatterns = function () {
1890
- this.domain = 'number';
1891
- this.step = this.step || 0.01;
1892
- this.min = this.min || 0.0;
1893
- this.max = this.max || 1000.0;
1894
- this.placeholder = '0.00';
1895
- };
1896
- return InputComponent;
1897
- }());
1898
- InputComponent.idCounter = 0;
1899
- InputComponent.decorators = [
1900
- { type: i0.Component, args: [{
1901
- selector: 'lux-input',
1902
- template: "<div *ngIf=\"currency && currency === 'USD'\" class=\"prefix rounded-left symbol\" [ngClass]=\"className\">\n <span>$</span>\n</div>\n<input\n #input\n *ngIf=\"type !== 'textarea'\"\n [class]=\"hasPrefix() ? (hasPostfix() ? 'infix' : 'postfix rounded-right') : (hasPostfix() ? 'prefix rounded-left' : 'rounded')\"\n [ngClass]=\"className\"\n placement=\"top\"\n [id]=\"inputId\"\n [type]=\"domain\"\n [attr.value]=\"value\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.disabled]=\"disabled === true ? 'true' : undefined\"\n [attr.readonly]=\"readonly === true ? 'true' : undefined\"\n [attr.min]=\"min?.toString() || undefined\"\n [attr.max]=\"max?.toString() || undefined\"\n [attr.step]=\"step?.toString() || undefined\"\n [attr.pattern]=\"pattern || undefined\"\n [placeholder]=\"placeholder\"\n (keyup)=\"onKeyUp(input.value)\"\n (change)=\"onChangeValue(input.value)\"\n (keypress)=\"onKeyPress($event)\"\n (blur)=\"onLostFocus()\"\n/>\n<textarea\n #textarea\n *ngIf=\"type === 'textarea'\"\n class=\"rounded\"\n [ngClass]=\"className\"\n placement=\"top\"\n [id]=\"inputId\"\n [attr.value]=\"value\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.disabled]=\"disabled === true ? 'true' : undefined\"\n [attr.readonly]=\"readonly === true ? 'true' : undefined\"\n [attr.cols]=\"cols?.toString() || undefined\"\n [attr.rows]=\"rows?.toString() || undefined\"\n [placeholder]=\"placeholder\"\n (keyup)=\"onKeyUp(textarea.value)\"\n (change)=\"onChangeValue(textarea.value)\"\n (keypress)=\"onKeyPress($event)\"\n (blur)=\"onLostFocus()\"\n></textarea>\n<div *ngIf=\"currency && currency === 'EUR'\" class=\"postfix rounded-right symbol\" [ngClass]=\"className\">\n <span>\u20AC</span>\n</div>\n<div *ngIf=\"isPercentage()\" class=\"postfix rounded-right symbol\" [ngClass]=\"className\">\n <span>%</span>\n</div>\n<div *ngIf=\"isPermillage()\" class=\"postfix rounded-right symbol\" [ngClass]=\"className\">\n <span>\u2030</span>\n</div>\n<div *ngIf=\"isUrl() && !!value\" class=\"postfix rounded-right symbol clickable\" [ngClass]=\"className\">\n <a href=\"{{ value }}\" target=\"_blank\">\n <span class=\"icon-external\"></span>\n </a>\n</div>\n<div *ngIf=\"isColor()\" class=\"postfix rounded-right bordered transparency\" [ngClass]=\"className\">\n <div class=\"rounded-right full-space\" [ngStyle]=\"{'background-color': color}\">\n <input\n #colorpicker\n class=\"minimal-space clickable invisible rounded-right full-space\"\n [id]=\"inputId + '$colorpicker'\"\n type=\"color\"\n [attr.value]=\"value\"\n [attr.disabled]=\"disabled === true ? 'true' : undefined\"\n [attr.readonly]=\"readonly === true ? 'true' : undefined\"\n (change)=\"onColorPicked(colorpicker.value)\"\n (keypress)=\"onKeyPress($event)\"\n (blur)=\"onLostFocus()\"\n />\n </div>\n</div>\n\n<div *ngIf=\"inlineErrors && lastErrors && (dirty || touched)\" class=\"alert\">\n <div *ngIf=\"lastErrors.required\">\n {{ userErrors[this.lang].required }}\n </div>\n <div *ngIf=\"lastErrors.email\">{{ userErrors[this.lang].email }}</div>\n <div *ngIf=\"lastErrors.url\">{{ userErrors[this.lang].url }}</div>\n <div *ngIf=\"lastErrors.min\">\n {{ userErrors[this.lang].min.replace('$min', lastErrors.min.min) }}\n </div>\n <div *ngIf=\"lastErrors.max\">\n {{ userErrors[this.lang].max.replace('$max', lastErrors.max.max) }}\n </div>\n</div>\n",
1903
- providers: [
1904
- {
1905
- provide: forms.NG_VALUE_ACCESSOR,
1906
- multi: true,
1907
- useExisting: i0.forwardRef(function () { return InputComponent; })
1908
- },
1909
- {
1910
- provide: forms.NG_VALIDATORS,
1911
- multi: true,
1912
- useExisting: i0.forwardRef(function () { return InputComponent; })
1913
- }
1914
- ],
1915
- styles: [":focus{z-index:1}input,select,textarea{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057);margin:0;margin:var(--lux-input-margin, 0rem);padding:0 .5rem;padding:var(--lux-input-padding, 0rem .5rem)}.alert{padding:.2rem 2rem;background:#fe2e2e;background:var(--lux-alert-background, #fe2e2e);color:#fff;color:var(--lux-alert-color, white);font-family:Consolas,monospace;width:45%;margin-right:1rem;display:inline-block}.symbol{display:inline-block;align-items:baseline;padding:0 .5rem;margin-bottom:0;font-weight:400;color:default;color:var(--lux-symbol-color, default);text-align:center;white-space:nowrap;background:default;background:var(--lux-symbol-background, default);font-size:1rem;font-size:var(--lux-symbol-font-size, 1rem)}.bordered,.symbol{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057)}.rounded,.rounded-right,.rounded-middle,.rounded-left{border-radius:.25rem;border-radius:var(--lux-border-radius, .25rem)}.rounded-left{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-middle{border-radius:0}.rounded-right{border-top-left-radius:0;border-bottom-left-radius:0}.prefix{border-right:none}.infix{border-left:none;border-right:none}.postfix{border-left:none;display:flex;align-items:center}:host{display:flex;align-items:stretch;min-height:1.5rem}.readonly{border:none}.readonly:focus{border:none;outline:none}.disabled{background-color:#f1f1f1;background-color:var(--lux-disabled-color, #f1f1f1);border-color:#6d6d6d;border-color:var(--lux-disabled-border-color, #6d6d6d)}.clickable{cursor:pointer}.full-space{width:100%;height:100%;margin:0;padding:0}.minimal-space,.icon,.icon-external{min-width:1rem;min-height:1rem}.icon,.icon-external{display:inline-block;background-size:1rem 1rem;background-position:center;background-repeat:no-repeat;width:1.5rem;width:var(--lux-autocomplete-icon-width, 1.5rem);z-index:1}.icon-external{background:url(/assets/img/external.svg) no-repeat center;background:var(--lux-input-icon-external, url(/assets/img/external.svg) no-repeat center);background-size:1rem;background-position-y:.1rem;height:100%}.invisible{opacity:0}.transparency{background-image:conic-gradient(white 0deg 90deg,lightgray 90deg 180deg,white 180deg 270deg,lightgray 270deg 360deg)}\n"]
1916
- },] }
1917
- ];
1918
- InputComponent.ctorParameters = function () { return [
1919
- { type: RegexpService }
1920
- ]; };
1921
- InputComponent.propDecorators = {
1922
- input: [{ type: i0.ViewChild, args: ['input', { static: false },] }],
1923
- textarea: [{ type: i0.ViewChild, args: ['textarea', { static: false },] }],
1924
- colorpicker: [{ type: i0.ViewChild, args: ['colorpicker', { static: false },] }],
1925
- rows: [{ type: i0.Input }],
1926
- cols: [{ type: i0.Input }],
1927
- step: [{ type: i0.Input }],
1928
- min: [{ type: i0.Input }],
1929
- max: [{ type: i0.Input }],
1930
- lang: [{ type: i0.Input }],
1931
- inlineErrors: [{ type: i0.Input }],
1932
- inputId: [{ type: i0.Input }],
1933
- ariaLabel: [{ type: i0.Input, args: ['aria-label',] }],
1934
- readonly: [{ type: i0.Input }],
1935
- disabled: [{ type: i0.Input }],
1936
- pattern: [{ type: i0.Input }],
1937
- currency: [{ type: i0.Input }],
1938
- placeholder: [{ type: i0.Input }],
1939
- required: [{ type: i0.Input }],
1940
- type: [{ type: i0.Input }],
1941
- value: [{ type: i0.Input }],
1942
- valueChange: [{ type: i0.Output }],
1943
- keyPress: [{ type: i0.Output }]
1944
- };
1945
-
1946
- /** Filter component to query for objects. */
1947
- var FilterComponent = /** @class */ (function () {
1948
- function FilterComponent() {
1949
- this.touched = false;
1950
- this._searchValue = '';
1951
- this.disabled = false;
1952
- /** Placeholder default text. */
1953
- this.placeholder = '';
1954
- /** Search on type: (default true) Auto-search when user types in. */
1955
- this.searchOnType = true;
1956
- this.debounceValue = 300; // 300 ms
1957
- /** Search value changed by user. */
1958
- this.searchValueChange = new i0.EventEmitter();
1959
- this.subject = new rxjs.Subject();
1960
- // ControlValueAccessor Interface
1961
- this.onChange = function (value) { };
1962
- this.onTouched = function () { };
1963
- this.recreateObservable();
1964
- }
1965
- Object.defineProperty(FilterComponent.prototype, "searchValue", {
1966
- /** Search value introduced by the user. */
1967
- get: function () {
1968
- return this._searchValue;
1969
- },
1970
- set: function (v) {
1971
- v = (v || '').toString();
1972
- if (v === this._searchValue) {
1973
- return;
1974
- }
1975
- this.onChange(v);
1976
- this._searchValue = v;
1977
- },
1978
- enumerable: false,
1979
- configurable: true
1980
- });
1981
- Object.defineProperty(FilterComponent.prototype, "debounce", {
1982
- get: function () {
1983
- return this.debounceValue;
1984
- },
1985
- /** Debounce time in milliseconds. (defaults to 300 ms) */
1986
- set: function (val) {
1987
- this.debounceValue = val;
1988
- this.recreateObservable();
1989
- },
1990
- enumerable: false,
1991
- configurable: true
1992
- });
1993
- FilterComponent.prototype.writeValue = function (value) {
1994
- this.searchValue = (value || '').toString();
1995
- };
1996
- FilterComponent.prototype.registerOnChange = function (onChange) {
1997
- this.onChange = onChange;
1998
- };
1999
- FilterComponent.prototype.registerOnTouched = function (onTouched) {
2000
- this.onTouched = onTouched;
2001
- };
2002
- FilterComponent.prototype.markAsTouched = function () {
2003
- if (!this.touched) {
2004
- this.onTouched();
2005
- this.touched = true;
2006
- }
2007
- };
2008
- FilterComponent.prototype.setDisabledState = function (disabled) {
2009
- this.disabled = disabled;
2010
- };
2011
- // End ControlValueAccessor Interface
2012
- FilterComponent.prototype.ngOnInit = function () {
2013
- this.inputId = this.inputId
2014
- ? this.inputId
2015
- : "filter$" + FilterComponent.idCounter++;
2016
- };
2017
- FilterComponent.prototype.ngOnDestroy = function () {
2018
- this.freeSubscriptions();
2019
- };
2020
- FilterComponent.prototype.clear = function () {
2021
- this.searchValue = '';
2022
- this.search();
2023
- };
2024
- FilterComponent.prototype.search = function () {
2025
- this.searchValueChange.emit(this.searchValue);
2026
- };
2027
- FilterComponent.prototype.keyup = function (event, newValue) {
2028
- this.markAsTouched();
2029
- this.searchValue = newValue;
2030
- if (event.key === 'Enter') {
2031
- this.searchNow(this.searchValue);
2032
- }
2033
- if (this.searchOnType) {
2034
- this.addEvent();
2035
- }
2036
- };
2037
- FilterComponent.prototype.onInputValueChange = function (newValue) {
2038
- this.markAsTouched();
2039
- this.searchValue = newValue;
2040
- };
2041
- FilterComponent.prototype.recreateObservable = function () {
2042
- var _this = this;
2043
- this.searchValue$ = this.subject
2044
- .asObservable()
2045
- .pipe(operators.debounceTime(this.debounce));
2046
- this.freeSubscriptions();
2047
- this.sub = this.searchValue$.subscribe(function (value) {
2048
- _this.searchValueChange.emit(value);
2049
- });
2050
- };
2051
- FilterComponent.prototype.freeSubscriptions = function () {
2052
- if (this.sub) {
2053
- this.sub.unsubscribe();
2054
- this.sub = null;
2055
- }
2056
- };
2057
- FilterComponent.prototype.searchNow = function (value) {
2058
- this.searchValueChange.emit(value);
2059
- };
2060
- FilterComponent.prototype.addEvent = function () {
2061
- this.subject.next(this.searchValue);
2062
- };
2063
- return FilterComponent;
2064
- }());
2065
- FilterComponent.idCounter = 0;
2066
- FilterComponent.decorators = [
2067
- { type: i0.Component, args: [{
2068
- selector: 'lux-filter',
2069
- template: "<div class=\"filter\">\n <input\n #i0\n type=\"text\"\n [attr.aria-label]=\"ariaLabel\"\n [placeholder]=\"placeholder\"\n [id]=\"inputId\"\n [disabled]=\"disabled\"\n [value]=\"searchValue\"\n (valueChange)=\"onInputValueChange(i0.value)\"\n (keyup)=\"keyup($event, i0.value)\"\n />\n\n <button\n [class.hide]=\"!searchValue\"\n aria-label=\"Clear\"\n class=\"clear-indicator icon icon-clear\"\n type=\"button\"\n (click)=\"clear()\"\n ></button>\n <i *ngIf=\"1 || searchOnType\" class=\"search-indicator icon icon-search\"></i>\n <button\n class=\"btn-search\"\n *ngIf=\"!searchOnType\"\n type=\"button\"\n [disabled]=\"disabled\"\n (click)=\"search()\"\n >\n Search\n </button>\n</div>\n",
2070
- providers: [
2071
- {
2072
- provide: forms.NG_VALUE_ACCESSOR,
2073
- multi: true,
2074
- useExisting: i0.forwardRef(function () { return FilterComponent; })
2075
- }
2076
- ],
2077
- styles: [":focus{z-index:1}input,select,textarea{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057);margin:0;margin:var(--lux-input-margin, 0rem);padding:0 .5rem;padding:var(--lux-input-padding, 0rem .5rem)}.alert{padding:.2rem 2rem;background:#fe2e2e;background:var(--lux-alert-background, #fe2e2e);color:#fff;color:var(--lux-alert-color, white);font-family:Consolas,monospace;width:45%;margin-right:1rem;display:inline-block}.symbol{display:inline-block;align-items:baseline;padding:0 .5rem;margin-bottom:0;font-weight:400;color:default;color:var(--lux-symbol-color, default);text-align:center;white-space:nowrap;background:default;background:var(--lux-symbol-background, default);font-size:1rem;font-size:var(--lux-symbol-font-size, 1rem)}.bordered,.symbol{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057)}.rounded,.rounded-right,.rounded-middle,.rounded-left{border-radius:.25rem;border-radius:var(--lux-border-radius, .25rem)}.rounded-left{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-middle{border-radius:0}.rounded-right{border-top-left-radius:0;border-bottom-left-radius:0}.prefix{border-right:none}.infix{border-left:none;border-right:none}.postfix{border-left:none;display:flex;align-items:center}.filter{display:grid;grid-template-columns:auto 1.5rem 1.5rem .5rem auto}.filter input{grid-row:1;grid-column-start:1;grid-column-end:4}.filter .hide{visibility:collapse}.filter .clear-indicator{grid-row:1;grid-column:2;border:none}.filter .search-indicator{grid-row:1;grid-column:3}.filter .btn-search{grid-row:1;grid-column:5}.filter .icon-search{background:url(/assets/img/filter-search.png) no-repeat center;background:var(--lux-filter-icon-search, url(/assets/img/filter-search.png) no-repeat center);background-size:1rem;background-size:var(--lux-filter-icon-bg-size, 1rem);background-position:center;width:1rem;width:var(--lux-filter-icon-width, 1rem)}.filter .icon-clear{background:url(/assets/img/filter-clear.png) no-repeat center;background:var(--lux-filter-icon-clear, url(/assets/img/filter-clear.png) no-repeat center);background-size:1rem;background-size:var(--lux-filter-icon-bg-size, 1rem);background-position:center}\n"]
2078
- },] }
2079
- ];
2080
- FilterComponent.ctorParameters = function () { return []; };
2081
- FilterComponent.propDecorators = {
2082
- disabled: [{ type: i0.Input }],
2083
- inputId: [{ type: i0.Input }],
2084
- placeholder: [{ type: i0.Input }],
2085
- searchValue: [{ type: i0.Input }],
2086
- searchOnType: [{ type: i0.Input }],
2087
- ariaLabel: [{ type: i0.Input, args: ['aria-label',] }],
2088
- debounce: [{ type: i0.Input }],
2089
- searchValueChange: [{ type: i0.Output }]
2090
- };
2091
-
2092
- var ActiveModal = /** @class */ (function () {
2093
- function ActiveModal() {
2094
- }
2095
- ActiveModal.prototype.close = function (result) { };
2096
- ActiveModal.prototype.dismiss = function (reason) { };
2097
- return ActiveModal;
2098
- }());
2099
- var ModalRef = /** @class */ (function () {
2100
- function ModalRef(_windowCmptRef, _contentRef, _backdropCmptRef, _beforeDismiss) {
2101
- var _this = this;
2102
- this._windowCmptRef = _windowCmptRef;
2103
- this._contentRef = _contentRef;
2104
- this._backdropCmptRef = _backdropCmptRef;
2105
- this._beforeDismiss = _beforeDismiss;
2106
- _windowCmptRef.instance.dismissEvent.subscribe(function (reason) {
2107
- _this.dismiss(reason);
2108
- });
2109
- this.result = new Promise(function (resolve, reject) {
2110
- _this._resolve = resolve;
2111
- _this._reject = reject;
2112
- });
2113
- this.result.then(null, function () { });
2114
- }
2115
- Object.defineProperty(ModalRef.prototype, "componentInstance", {
2116
- /**
2117
- * The instance of a component used for the modal content.
2118
- *
2119
- * When a `TemplateRef` is used as the content, will return `undefined`.
2120
- */
2121
- get: function () {
2122
- if (this._contentRef.componentRef) {
2123
- return this._contentRef.componentRef.instance;
2124
- }
2125
- },
2126
- enumerable: false,
2127
- configurable: true
2128
- });
2129
- /**
2130
- * Closes the modal with an optional `result` value.
2131
- *
2132
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
2133
- */
2134
- ModalRef.prototype.close = function (result) {
2135
- if (this._windowCmptRef) {
2136
- if (this._resolve) {
2137
- this._resolve(result);
2138
- }
2139
- this._removeModalElements();
2140
- }
2141
- };
2142
- ModalRef.prototype._dismiss = function (reason) {
2143
- if (this._reject) {
2144
- this._reject(reason);
2145
- }
2146
- this._removeModalElements();
2147
- };
2148
- /**
2149
- * Dismisses the modal with an optional `reason` value.
2150
- *
2151
- * The `NgbModalRef.result` promise will be rejected with the provided value.
2152
- */
2153
- ModalRef.prototype.dismiss = function (reason) {
2154
- var _this = this;
2155
- if (this._windowCmptRef) {
2156
- if (!this._beforeDismiss) {
2157
- this._dismiss(reason);
2158
- }
2159
- else {
2160
- var dismiss = this._beforeDismiss();
2161
- if (dismiss && dismiss.then) {
2162
- dismiss.then(function (result) {
2163
- if (result !== false) {
2164
- _this._dismiss(reason);
2165
- }
2166
- }, function () { });
2167
- }
2168
- else if (dismiss !== false) {
2169
- this._dismiss(reason);
2170
- }
2171
- }
2172
- }
2173
- };
2174
- ModalRef.prototype._removeModalElements = function () {
2175
- var windowNativeEl = this._windowCmptRef.location.nativeElement;
2176
- windowNativeEl.parentNode.removeChild(windowNativeEl);
2177
- this._windowCmptRef.destroy();
2178
- if (this._backdropCmptRef) {
2179
- var backdropNativeEl = this._backdropCmptRef.location.nativeElement;
2180
- backdropNativeEl.parentNode.removeChild(backdropNativeEl);
2181
- this._backdropCmptRef.destroy();
2182
- }
2183
- if (this._contentRef && this._contentRef.viewRef) {
2184
- this._contentRef.viewRef.destroy();
2185
- }
2186
- this._windowCmptRef = null;
2187
- this._backdropCmptRef = null;
2188
- this._contentRef = null;
2189
- };
2190
- return ModalRef;
2191
- }());
2192
-
2193
- /*! *****************************************************************************
2194
- Copyright (c) Microsoft Corporation.
2195
-
2196
- Permission to use, copy, modify, and/or distribute this software for any
2197
- purpose with or without fee is hereby granted.
2198
-
2199
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2200
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2201
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2202
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2203
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2204
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2205
- PERFORMANCE OF THIS SOFTWARE.
2206
- ***************************************************************************** */
2207
- /* global Reflect, Promise */
2208
- var extendStatics = function (d, b) {
2209
- extendStatics = Object.setPrototypeOf ||
2210
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2211
- function (d, b) { for (var p in b)
2212
- if (Object.prototype.hasOwnProperty.call(b, p))
2213
- d[p] = b[p]; };
2214
- return extendStatics(d, b);
2215
- };
2216
- function __extends(d, b) {
2217
- if (typeof b !== "function" && b !== null)
2218
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2219
- extendStatics(d, b);
2220
- function __() { this.constructor = d; }
2221
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2222
- }
2223
- var __assign = function () {
2224
- __assign = Object.assign || function __assign(t) {
2225
- for (var s, i = 1, n = arguments.length; i < n; i++) {
2226
- s = arguments[i];
2227
- for (var p in s)
2228
- if (Object.prototype.hasOwnProperty.call(s, p))
2229
- t[p] = s[p];
2230
- }
2231
- return t;
2232
- };
2233
- return __assign.apply(this, arguments);
2234
- };
2235
- function __rest(s, e) {
2236
- var t = {};
2237
- for (var p in s)
2238
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2239
- t[p] = s[p];
2240
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
2241
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2242
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
2243
- t[p[i]] = s[p[i]];
2244
- }
2245
- return t;
2246
- }
2247
- function __decorate(decorators, target, key, desc) {
2248
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2249
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
2250
- r = Reflect.decorate(decorators, target, key, desc);
2251
- else
2252
- for (var i = decorators.length - 1; i >= 0; i--)
2253
- if (d = decorators[i])
2254
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2255
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2256
- }
2257
- function __param(paramIndex, decorator) {
2258
- return function (target, key) { decorator(target, key, paramIndex); };
2259
- }
2260
- function __metadata(metadataKey, metadataValue) {
2261
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
2262
- return Reflect.metadata(metadataKey, metadataValue);
2263
- }
2264
- function __awaiter(thisArg, _arguments, P, generator) {
2265
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2266
- return new (P || (P = Promise))(function (resolve, reject) {
2267
- function fulfilled(value) { try {
2268
- step(generator.next(value));
2269
- }
2270
- catch (e) {
2271
- reject(e);
2272
- } }
2273
- function rejected(value) { try {
2274
- step(generator["throw"](value));
2275
- }
2276
- catch (e) {
2277
- reject(e);
2278
- } }
2279
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2280
- step((generator = generator.apply(thisArg, _arguments || [])).next());
2281
- });
2282
- }
2283
- function __generator(thisArg, body) {
2284
- var _ = { label: 0, sent: function () { if (t[0] & 1)
2285
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
2286
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
2287
- function verb(n) { return function (v) { return step([n, v]); }; }
2288
- function step(op) {
2289
- if (f)
2290
- throw new TypeError("Generator is already executing.");
2291
- while (_)
2292
- try {
2293
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
2294
- return t;
2295
- if (y = 0, t)
2296
- op = [op[0] & 2, t.value];
2297
- switch (op[0]) {
2298
- case 0:
2299
- case 1:
2300
- t = op;
2301
- break;
2302
- case 4:
2303
- _.label++;
2304
- return { value: op[1], done: false };
2305
- case 5:
2306
- _.label++;
2307
- y = op[1];
2308
- op = [0];
2309
- continue;
2310
- case 7:
2311
- op = _.ops.pop();
2312
- _.trys.pop();
2313
- continue;
2314
- default:
2315
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
2316
- _ = 0;
2317
- continue;
2318
- }
2319
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
2320
- _.label = op[1];
2321
- break;
2322
- }
2323
- if (op[0] === 6 && _.label < t[1]) {
2324
- _.label = t[1];
2325
- t = op;
2326
- break;
2327
- }
2328
- if (t && _.label < t[2]) {
2329
- _.label = t[2];
2330
- _.ops.push(op);
2331
- break;
2332
- }
2333
- if (t[2])
2334
- _.ops.pop();
2335
- _.trys.pop();
2336
- continue;
2337
- }
2338
- op = body.call(thisArg, _);
2339
- }
2340
- catch (e) {
2341
- op = [6, e];
2342
- y = 0;
2343
- }
2344
- finally {
2345
- f = t = 0;
2346
- }
2347
- if (op[0] & 5)
2348
- throw op[1];
2349
- return { value: op[0] ? op[1] : void 0, done: true };
2350
- }
2351
- }
2352
- var __createBinding = Object.create ? (function (o, m, k, k2) {
2353
- if (k2 === undefined)
2354
- k2 = k;
2355
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
2356
- }) : (function (o, m, k, k2) {
2357
- if (k2 === undefined)
2358
- k2 = k;
2359
- o[k2] = m[k];
2360
- });
2361
- function __exportStar(m, o) {
2362
- for (var p in m)
2363
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
2364
- __createBinding(o, m, p);
2365
- }
2366
- function __values(o) {
2367
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2368
- if (m)
2369
- return m.call(o);
2370
- if (o && typeof o.length === "number")
2371
- return {
2372
- next: function () {
2373
- if (o && i >= o.length)
2374
- o = void 0;
2375
- return { value: o && o[i++], done: !o };
2376
- }
2377
- };
2378
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2379
- }
2380
- function __read(o, n) {
2381
- var m = typeof Symbol === "function" && o[Symbol.iterator];
2382
- if (!m)
2383
- return o;
2384
- var i = m.call(o), r, ar = [], e;
2385
- try {
2386
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
2387
- ar.push(r.value);
2388
- }
2389
- catch (error) {
2390
- e = { error: error };
2391
- }
2392
- finally {
2393
- try {
2394
- if (r && !r.done && (m = i["return"]))
2395
- m.call(i);
2396
- }
2397
- finally {
2398
- if (e)
2399
- throw e.error;
2400
- }
2401
- }
2402
- return ar;
2403
- }
2404
- /** @deprecated */
2405
- function __spread() {
2406
- for (var ar = [], i = 0; i < arguments.length; i++)
2407
- ar = ar.concat(__read(arguments[i]));
2408
- return ar;
2409
- }
2410
- /** @deprecated */
2411
- function __spreadArrays() {
2412
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
2413
- s += arguments[i].length;
2414
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
2415
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
2416
- r[k] = a[j];
2417
- return r;
2418
- }
2419
- function __spreadArray(to, from, pack) {
2420
- if (pack || arguments.length === 2)
2421
- for (var i = 0, l = from.length, ar; i < l; i++) {
2422
- if (ar || !(i in from)) {
2423
- if (!ar)
2424
- ar = Array.prototype.slice.call(from, 0, i);
2425
- ar[i] = from[i];
2426
- }
2427
- }
2428
- return to.concat(ar || Array.prototype.slice.call(from));
2429
- }
2430
- function __await(v) {
2431
- return this instanceof __await ? (this.v = v, this) : new __await(v);
2432
- }
2433
- function __asyncGenerator(thisArg, _arguments, generator) {
2434
- if (!Symbol.asyncIterator)
2435
- throw new TypeError("Symbol.asyncIterator is not defined.");
2436
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
2437
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
2438
- function verb(n) { if (g[n])
2439
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
2440
- function resume(n, v) { try {
2441
- step(g[n](v));
2442
- }
2443
- catch (e) {
2444
- settle(q[0][3], e);
2445
- } }
2446
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
2447
- function fulfill(value) { resume("next", value); }
2448
- function reject(value) { resume("throw", value); }
2449
- function settle(f, v) { if (f(v), q.shift(), q.length)
2450
- resume(q[0][0], q[0][1]); }
2451
- }
2452
- function __asyncDelegator(o) {
2453
- var i, p;
2454
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
2455
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
2456
- }
2457
- function __asyncValues(o) {
2458
- if (!Symbol.asyncIterator)
2459
- throw new TypeError("Symbol.asyncIterator is not defined.");
2460
- var m = o[Symbol.asyncIterator], i;
2461
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
2462
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
2463
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
2464
- }
2465
- function __makeTemplateObject(cooked, raw) {
2466
- if (Object.defineProperty) {
2467
- Object.defineProperty(cooked, "raw", { value: raw });
2468
- }
2469
- else {
2470
- cooked.raw = raw;
2471
- }
2472
- return cooked;
2473
- }
2474
- ;
2475
- var __setModuleDefault = Object.create ? (function (o, v) {
2476
- Object.defineProperty(o, "default", { enumerable: true, value: v });
2477
- }) : function (o, v) {
2478
- o["default"] = v;
2479
- };
2480
- function __importStar(mod) {
2481
- if (mod && mod.__esModule)
2482
- return mod;
2483
- var result = {};
2484
- if (mod != null)
2485
- for (var k in mod)
2486
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
2487
- __createBinding(result, mod, k);
2488
- __setModuleDefault(result, mod);
2489
- return result;
2490
- }
2491
- function __importDefault(mod) {
2492
- return (mod && mod.__esModule) ? mod : { default: mod };
2493
- }
2494
- function __classPrivateFieldGet(receiver, state, kind, f) {
2495
- if (kind === "a" && !f)
2496
- throw new TypeError("Private accessor was defined without a getter");
2497
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2498
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
2499
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2500
- }
2501
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
2502
- if (kind === "m")
2503
- throw new TypeError("Private method is not writable");
2504
- if (kind === "a" && !f)
2505
- throw new TypeError("Private accessor was defined without a setter");
2506
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2507
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
2508
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
2509
- }
2510
-
2511
- var FOCUS = 'focus';
2512
- var Key;
2513
- (function (Key) {
2514
- Key[Key["Tab"] = 9] = "Tab";
2515
- Key[Key["Enter"] = 13] = "Enter";
2516
- Key[Key["Escape"] = 27] = "Escape";
2517
- Key[Key["Space"] = 32] = "Space";
2518
- Key[Key["PageUp"] = 33] = "PageUp";
2519
- Key[Key["PageDown"] = 34] = "PageDown";
2520
- Key[Key["End"] = 35] = "End";
2521
- Key[Key["Home"] = 36] = "Home";
2522
- Key[Key["ArrowLeft"] = 37] = "ArrowLeft";
2523
- Key[Key["ArrowUp"] = 38] = "ArrowUp";
2524
- Key[Key["ArrowRight"] = 39] = "ArrowRight";
2525
- Key[Key["ArrowDown"] = 40] = "ArrowDown";
2526
- })(Key || (Key = {}));
2527
- var isDefined = function (value) { return value !== undefined && value !== null; };
2528
- var ContentRef = /** @class */ (function () {
2529
- function ContentRef(nodes, viewRef, componentRef) {
2530
- this.nodes = nodes;
2531
- this.viewRef = viewRef;
2532
- this.componentRef = componentRef;
2533
- }
2534
- return ContentRef;
2535
- }());
2536
- var FOCUSABLE_ELEMENTS_SELECTOR = [
2537
- 'a[href]',
2538
- 'button:not([disabled])',
2539
- 'input:not([disabled]):not([type="hidden"])',
2540
- 'select:not([disabled])',
2541
- 'textarea:not([disabled])',
2542
- '[contenteditable]',
2543
- '[tabindex]:not([tabindex="-1"])'
2544
- ].join(', ');
2545
- /**
2546
- * Returns first and last focusable elements inside of a given element based on specific CSS selector
2547
- */
2548
- var getFocusableBoundaryElements = function (element) {
2549
- var list = Array.from(element.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR)).filter(function (el) { return el.tabIndex !== -1; });
2550
- return [list[0], list[list.length - 1]];
2551
- };
2552
- /**
2553
- * Function that enforces browser focus to be trapped inside a DOM element.
2554
- *
2555
- * Works only for clicks inside the element and navigation with 'Tab', ignoring clicks outside of the element
2556
- *
2557
- * @param element The element around which focus will be trapped inside
2558
- * @param stopFocusTrap$ The observable stream. When completed the focus trap will clean up listeners
2559
- * and free internal resources
2560
- * @param refocusOnClick Put the focus back to the last focused element whenever a click occurs on element (default to
2561
- * false)
2562
- */
2563
- var focusTrap = function (element, stopFocusTrap$, refocusOnClick) {
2564
- if (refocusOnClick === void 0) { refocusOnClick = false; }
2565
- // last focused element
2566
- var lastFocusedElement$ = rxjs.fromEvent(element, 'focusin').pipe(operators.takeUntil(stopFocusTrap$), operators.map(function (e) { return e.target; }));
2567
- // 'tab' / 'shift+tab' stream
2568
- rxjs.fromEvent(element, 'keydown')
2569
- .pipe(operators.takeUntil(stopFocusTrap$),
2570
- /* eslint-disable import/no-deprecated */
2571
- operators.filter(function (e) { return e.which === Key.Tab; }),
2572
- /* eslint-enable import/no-deprecated */
2573
- operators.withLatestFrom(lastFocusedElement$))
2574
- .subscribe(function (_a) {
2575
- var _b = __read(_a, 2), tabEvent = _b[0], focusedElement = _b[1];
2576
- var _c = __read(getFocusableBoundaryElements(element), 2), first = _c[0], last = _c[1];
2577
- if ((focusedElement === first || focusedElement === element) &&
2578
- tabEvent.shiftKey) {
2579
- last.focus();
2580
- tabEvent.preventDefault();
2581
- }
2582
- if (focusedElement === last && !tabEvent.shiftKey) {
2583
- first.focus();
2584
- tabEvent.preventDefault();
2585
- }
2586
- });
2587
- // inside click
2588
- if (refocusOnClick) {
2589
- rxjs.fromEvent(element, 'click')
2590
- .pipe(operators.takeUntil(stopFocusTrap$), operators.withLatestFrom(lastFocusedElement$), operators.map(function (arr) { return arr[1]; }))
2591
- .subscribe(function (lastFocusedElement) { return lastFocusedElement.focus(); });
2592
- }
2593
- };
2594
-
2595
- var ModalDismissReasons;
2596
- (function (ModalDismissReasons) {
2597
- ModalDismissReasons[ModalDismissReasons["BackdropClick"] = 0] = "BackdropClick";
2598
- ModalDismissReasons[ModalDismissReasons["Esc"] = 1] = "Esc";
2599
- })(ModalDismissReasons || (ModalDismissReasons = {}));
2600
-
2601
- var LuxModalWindowComponent = /** @class */ (function () {
2602
- function LuxModalWindowComponent(_document, _elRef) {
2603
- this._document = _document;
2604
- this._elRef = _elRef;
2605
- this.backdrop = false;
2606
- this.keyboard = true;
2607
- this.dismissEvent = new i0.EventEmitter();
2608
- this.role = 'dialog';
2609
- this.tabindex = '-1';
2610
- this.ariamodal = true;
2611
- }
2612
- Object.defineProperty(LuxModalWindowComponent.prototype, "class", {
2613
- get: function () {
2614
- return "modal " + (this.windowClass || '');
2615
- },
2616
- enumerable: false,
2617
- configurable: true
2618
- });
2619
- Object.defineProperty(LuxModalWindowComponent.prototype, "hostAriaLabelledBy", {
2620
- get: function () {
2621
- return this.ariaLabelledBy;
2622
- },
2623
- enumerable: false,
2624
- configurable: true
2625
- });
2626
- Object.defineProperty(LuxModalWindowComponent.prototype, "hostAriaDescribedBy", {
2627
- get: function () {
2628
- return this.ariaDescribedBy;
2629
- },
2630
- enumerable: false,
2631
- configurable: true
2632
- });
2633
- LuxModalWindowComponent.prototype.backdropClick = function (btn) {
2634
- if (this.backdrop === true && this._elRef.nativeElement === btn) {
2635
- this.dismiss(ModalDismissReasons.BackdropClick);
2636
- }
2637
- };
2638
- LuxModalWindowComponent.prototype.escKey = function (event) {
2639
- if (this.keyboard && !event.defaultPrevented) {
2640
- this.dismiss(ModalDismissReasons.Esc);
2641
- }
2642
- };
2643
- LuxModalWindowComponent.prototype.dismiss = function (reason) {
2644
- this.dismissEvent.emit(reason);
2645
- };
2646
- LuxModalWindowComponent.prototype.ngOnInit = function () {
2647
- this._elWithFocus = this._document.activeElement;
2648
- };
2649
- LuxModalWindowComponent.prototype.ngAfterViewInit = function () {
2650
- if (!this._elRef.nativeElement.contains(document.activeElement)) {
2651
- var firstFocusable = getFocusableBoundaryElements(this._elRef.nativeElement)[0];
2652
- var elementToFocus = firstFocusable || this._elRef.nativeElement;
2653
- elementToFocus.focus();
2654
- }
2655
- };
2656
- LuxModalWindowComponent.prototype.ngOnDestroy = function () {
2657
- var body = this._document.body;
2658
- var elWithFocus = this._elWithFocus;
2659
- var elementToFocus;
2660
- if (elWithFocus && elWithFocus[FOCUS] && body.contains(elWithFocus)) {
2661
- elementToFocus = elWithFocus;
2662
- }
2663
- else {
2664
- elementToFocus = body;
2665
- }
2666
- elementToFocus.focus();
2667
- this._elWithFocus = null;
2668
- };
2669
- return LuxModalWindowComponent;
2670
- }());
2671
- LuxModalWindowComponent.decorators = [
2672
- { type: i0.Component, args: [{
2673
- selector: 'lux-modal-window',
2674
- template: "\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\"><ng-content></ng-content></div>\n </div>\n "
2675
- },] }
2676
- ];
2677
- LuxModalWindowComponent.ctorParameters = function () { return [
2678
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
2679
- { type: i0.ElementRef }
2680
- ]; };
2681
- LuxModalWindowComponent.propDecorators = {
2682
- ariaDescribedBy: [{ type: i0.Input }],
2683
- ariaLabelledBy: [{ type: i0.Input }],
2684
- backdrop: [{ type: i0.Input }],
2685
- keyboard: [{ type: i0.Input }],
2686
- windowClass: [{ type: i0.Input }],
2687
- dismissEvent: [{ type: i0.Output }],
2688
- class: [{ type: i0.HostBinding, args: ['class',] }],
2689
- role: [{ type: i0.HostBinding, args: ['attr.role',] }],
2690
- tabindex: [{ type: i0.HostBinding, args: ['tabindex',] }],
2691
- ariamodal: [{ type: i0.HostBinding, args: ['attr.aria-modal',] }],
2692
- hostAriaLabelledBy: [{ type: i0.HostBinding, args: ['attr.aria-labelledby',] }],
2693
- hostAriaDescribedBy: [{ type: i0.HostBinding, args: ['attr.aria-describedby',] }],
2694
- backdropClick: [{ type: i0.HostListener, args: ['click', ['$event.target'],] }],
2695
- escKey: [{ type: i0.HostListener, args: ['keyup.esc', ['$event'],] }]
2696
- };
2697
-
2698
- var LuxModalBackdropComponent = /** @class */ (function () {
2699
- function LuxModalBackdropComponent() {
2700
- this.class = 'modal-backdrop fade show';
2701
- this.style = 'z-index: 1050';
2702
- }
2703
- return LuxModalBackdropComponent;
2704
- }());
2705
- LuxModalBackdropComponent.decorators = [
2706
- { type: i0.Component, args: [{
2707
- selector: 'lux-modal-backdrop',
2708
- template: ''
2709
- },] }
2710
- ];
2711
- LuxModalBackdropComponent.propDecorators = {
2712
- backdropClass: [{ type: i0.Input }],
2713
- class: [{ type: i0.HostBinding, args: ['class',] }],
2714
- style: [{ type: i0.HostBinding, args: ['style',] }]
2715
- };
2716
-
2717
- var LuxModalConfig = /** @class */ (function () {
2718
- function LuxModalConfig() {
2719
- this.backdrop = true;
2720
- }
2721
- return LuxModalConfig;
2722
- }());
2723
- LuxModalConfig.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LuxModalConfig_Factory() { return new LuxModalConfig(); }, token: LuxModalConfig, providedIn: "root" });
2724
- LuxModalConfig.decorators = [
2725
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2726
- ];
2727
-
2728
- var ModalStack = /** @class */ (function () {
2729
- function ModalStack(_applicationRef, _document, _injector, _rendererFactory, modalConfig) {
2730
- var _this = this;
2731
- this._applicationRef = _applicationRef;
2732
- this._document = _document;
2733
- this._injector = _injector;
2734
- this._rendererFactory = _rendererFactory;
2735
- this.modalConfig = modalConfig;
2736
- this._activeWindowCmptHasChanged = new rxjs.Subject();
2737
- this._modalRefs = [];
2738
- this._windowCmpts = [];
2739
- this._ariaHiddenValues = new Map();
2740
- this._backdropAttributes = ['backdropClass'];
2741
- this._windowAttributes = [
2742
- 'ariaLabelledBy',
2743
- 'backdrop',
2744
- 'centered',
2745
- 'keyboard',
2746
- 'scrollable',
2747
- 'size',
2748
- 'windowClass'
2749
- ];
2750
- this._activeWindowCmptHasChanged.subscribe(function () {
2751
- if (_this._windowCmpts.length) {
2752
- var activeWindowCmpt = _this._windowCmpts[_this._windowCmpts.length - 1];
2753
- focusTrap(activeWindowCmpt.location.nativeElement, _this._activeWindowCmptHasChanged);
2754
- _this._revertAriaHidden();
2755
- _this._setAriaHidden(activeWindowCmpt.location.nativeElement);
2756
- }
2757
- });
2758
- }
2759
- ModalStack.prototype.open = function (moduleCFR, content, options) {
2760
- var _this = this;
2761
- var config = Object.assign({}, this.modalConfig, options);
2762
- var containerEl = this._document.body;
2763
- var renderer = this._rendererFactory.createRenderer(null, null);
2764
- var removeBodyClass = function () {
2765
- if (!_this._modalRefs.length) {
2766
- renderer.removeClass(_this._document.body, 'modal-open');
2767
- _this._revertAriaHidden();
2768
- }
2769
- };
2770
- var activeModal = new ActiveModal();
2771
- var contentRef = this.getContentRef(moduleCFR, content, activeModal);
2772
- var backdropCmptRef = config.backdrop ? this._attachBackdrop(moduleCFR, containerEl) : null;
2773
- var windowCmptRef = this._attachWindowComponent(moduleCFR, containerEl, contentRef);
2774
- var modalRef = new ModalRef(windowCmptRef, contentRef, backdropCmptRef);
2775
- this._registerModalRef(modalRef);
2776
- this._registerWindowCmpt(windowCmptRef);
2777
- modalRef.result.then(removeBodyClass, removeBodyClass);
2778
- activeModal.close = function (result) {
2779
- modalRef.close(result);
2780
- };
2781
- activeModal.dismiss = function (reason) {
2782
- modalRef.dismiss(reason);
2783
- };
2784
- this._applyWindowOptions(windowCmptRef.instance, config);
2785
- if (this._modalRefs.length === 1) {
2786
- renderer.addClass(this._document.body, 'modal-open');
2787
- }
2788
- if (backdropCmptRef && backdropCmptRef.instance) {
2789
- this._applyBackgroundOptions(backdropCmptRef.instance, config);
2790
- backdropCmptRef.changeDetectorRef.detectChanges();
2791
- }
2792
- windowCmptRef.changeDetectorRef.detectChanges();
2793
- return modalRef;
2794
- };
2795
- ModalStack.prototype._applyWindowOptions = function (windowInstance, config) {
2796
- this._windowAttributes.forEach(function (optionName) {
2797
- if (isDefined(config[optionName])) {
2798
- windowInstance[optionName] = config[optionName];
2799
- }
2800
- });
2801
- };
2802
- ModalStack.prototype._applyBackgroundOptions = function (backgroudInstance, config) {
2803
- this._backdropAttributes.forEach(function (optionName) {
2804
- if (isDefined(config[optionName])) {
2805
- backgroudInstance[optionName] = config[optionName];
2806
- }
2807
- });
2808
- };
2809
- ModalStack.prototype._revertAriaHidden = function () {
2810
- this._ariaHiddenValues.forEach(function (value, element) {
2811
- if (value) {
2812
- element.setAttribute('aria-hidden', value);
2813
- }
2814
- else {
2815
- element.removeAttribute('aria-hidden');
2816
- }
2817
- });
2818
- this._ariaHiddenValues.clear();
2819
- };
2820
- ModalStack.prototype.getContentRef = function (moduleCFR, content, activeModal) {
2821
- if (content instanceof i0.TemplateRef) {
2822
- return this.createFromTemplateRef(content, activeModal);
2823
- }
2824
- };
2825
- ModalStack.prototype.createFromTemplateRef = function (content, activeModal) {
2826
- var context = {
2827
- $implicit: activeModal,
2828
- // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
2829
- close: function (result) {
2830
- activeModal.close(result);
2831
- },
2832
- // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
2833
- dismiss: function (reason) {
2834
- activeModal.dismiss(reason);
2835
- }
2836
- };
2837
- var viewRef = content.createEmbeddedView(context);
2838
- this._applicationRef.attachView(viewRef);
2839
- return new ContentRef([viewRef.rootNodes], viewRef);
2840
- };
2841
- ModalStack.prototype._attachBackdrop = function (moduleCFR, containerEl) {
2842
- var backdropFactory = moduleCFR.resolveComponentFactory(LuxModalBackdropComponent);
2843
- var backdropCmptRef = backdropFactory.create(this._injector);
2844
- this._applicationRef.attachView(backdropCmptRef.hostView);
2845
- containerEl.appendChild(backdropCmptRef.location.nativeElement);
2846
- return backdropCmptRef;
2847
- };
2848
- ModalStack.prototype._attachWindowComponent = function (moduleCFR, containerEl, contentRef) {
2849
- var windowFactory = moduleCFR.resolveComponentFactory(LuxModalWindowComponent);
2850
- var windowCmptRef = windowFactory.create(this._injector, contentRef.nodes);
2851
- this._applicationRef.attachView(windowCmptRef.hostView);
2852
- containerEl.appendChild(windowCmptRef.location.nativeElement);
2853
- return windowCmptRef;
2854
- };
2855
- ModalStack.prototype._registerModalRef = function (modalRef) {
2856
- var _this = this;
2857
- var unregisterModalRef = function () {
2858
- var index = _this._modalRefs.indexOf(modalRef);
2859
- if (index > -1) {
2860
- _this._modalRefs.splice(index, 1);
2861
- }
2862
- };
2863
- this._modalRefs.push(modalRef);
2864
- modalRef.result.then(unregisterModalRef, unregisterModalRef);
2865
- };
2866
- ModalStack.prototype._registerWindowCmpt = function (windowCmpt) {
2867
- var _this = this;
2868
- this._windowCmpts.push(windowCmpt);
2869
- this._activeWindowCmptHasChanged.next();
2870
- windowCmpt.onDestroy(function () {
2871
- var index = _this._windowCmpts.indexOf(windowCmpt);
2872
- if (index > -1) {
2873
- _this._windowCmpts.splice(index, 1);
2874
- _this._activeWindowCmptHasChanged.next();
2875
- }
2876
- });
2877
- };
2878
- ModalStack.prototype._setAriaHidden = function (element) {
2879
- var _this = this;
2880
- var parent = element.parentElement;
2881
- if (parent && element !== this._document.body) {
2882
- Array.from(parent.children).forEach(function (sibling) {
2883
- if (sibling !== element && sibling.nodeName !== 'SCRIPT') {
2884
- _this._ariaHiddenValues.set(sibling, sibling.getAttribute('aria-hidden'));
2885
- sibling.setAttribute('aria-hidden', 'true');
2886
- }
2887
- });
2888
- this._setAriaHidden(parent);
2889
- }
2890
- };
2891
- return ModalStack;
2892
- }());
2893
- ModalStack.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ModalStack_Factory() { return new ModalStack(i0__namespace.ɵɵinject(i0__namespace.ApplicationRef), i0__namespace.ɵɵinject(i1__namespace.DOCUMENT), i0__namespace.ɵɵinject(i0__namespace.INJECTOR), i0__namespace.ɵɵinject(i0__namespace.RendererFactory2), i0__namespace.ɵɵinject(LuxModalConfig)); }, token: ModalStack, providedIn: "root" });
2894
- ModalStack.decorators = [
2895
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2896
- ];
2897
- ModalStack.ctorParameters = function () { return [
2898
- { type: i0.ApplicationRef },
2899
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
2900
- { type: i0.Injector },
2901
- { type: i0.RendererFactory2 },
2902
- { type: LuxModalConfig }
2903
- ]; };
2904
-
2905
- /**
2906
- * A service that it allow open an close modal components
2907
- */
2908
- var ModalService = /** @class */ (function () {
2909
- function ModalService(modalStack, moduleCFR) {
2910
- this.modalStack = modalStack;
2911
- this.moduleCFR = moduleCFR;
2912
- }
2913
- /**Open a modal component
2914
- * @param content TemplateRef
2915
- */
2916
- ModalService.prototype.open = function (content, options) {
2917
- if (options === void 0) { options = {}; }
2918
- return this.modalStack.open(this.moduleCFR, content, options);
2919
- };
2920
- return ModalService;
2921
- }());
2922
- ModalService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ModalService_Factory() { return new ModalService(i0__namespace.ɵɵinject(ModalStack), i0__namespace.ɵɵinject(i0__namespace.ComponentFactoryResolver)); }, token: ModalService, providedIn: "root" });
2923
- ModalService.decorators = [
2924
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2925
- ];
2926
- ModalService.ctorParameters = function () { return [
2927
- { type: ModalStack },
2928
- { type: i0.ComponentFactoryResolver }
2929
- ]; };
2930
-
2931
- var GeolocationService = /** @class */ (function () {
2932
- function GeolocationService(http) {
2933
- var _this = this;
2934
- this.http = http;
2935
- this.debouncePeriodMs = 300; // ms
2936
- this.cacheSize = 20;
2937
- this.lastQueriesWithResults = new Map();
2938
- this.lastQueriesLru = [];
2939
- this.currentSearch$ = new rxjs.Subject();
2940
- var typed$ = this.currentSearch$
2941
- .asObservable()
2942
- .pipe(operators.distinctUntilChanged());
2943
- this.currentQuery$ = typed$.pipe(operators.debounceTime(this.debouncePeriodMs), operators.switchMap(function (currentQuery) {
2944
- var data = _this.getFromCache(currentQuery);
2945
- if (data !== undefined) {
2946
- return rxjs.of(data);
2947
- }
2948
- // Nominatim search documentation:
2949
- // https://nominatim.org/release-docs/develop/api/Search/
2950
- var url = 'https://nominatim.openstreetmap.org/search?format=json&limit=20&q=' +
2951
- encodeURIComponent(currentQuery);
2952
- var headers = {
2953
- 'Content-Type': 'application/json'
2954
- };
2955
- _this.addToCache(currentQuery, []);
2956
- return _this.http.get(url, { headers: headers }).pipe(operators.map(function (response) {
2957
- var searchResults = response;
2958
- var uniqueResults = distinct(searchResults);
2959
- return _this.addToCache(currentQuery, uniqueResults);
2960
- }));
2961
- }));
2962
- }
2963
- GeolocationService.prototype.searchGeolocation = function (query) {
2964
- this.currentSearch$.next(query);
2965
- return this.currentQuery$;
2966
- };
2967
- GeolocationService.prototype.getLabels = function (instance, keys) {
2968
- var searchResults = instance.lastQueriesWithResults
2969
- .get(instance.getLatestQuery())
2970
- .filter(function (searchResult) { return samePosition(searchResult, keys); });
2971
- return rxjs.of(searchResults.map(function (searchResult) {
2972
- var key = {
2973
- type: 'Point',
2974
- coordinates: [searchResult.lon, searchResult.lat]
2975
- };
2976
- return {
2977
- key: key,
2978
- label: searchResult.display_name
2979
- };
2980
- }));
2981
- };
2982
- GeolocationService.prototype.getData = function (instance, search) {
2983
- return instance.searchGeolocation(search).pipe(operators.map(function (searchResults) { return searchResults.map(function (searchResult) {
2984
- var key = {
2985
- type: 'Point',
2986
- coordinates: [searchResult.lon, searchResult.lat]
2987
- };
2988
- var label = searchResult.display_name;
2989
- return { key: key, label: label };
2990
- }); }));
2991
- };
2992
- // Cache implemementation ---
2993
- GeolocationService.prototype.getFromCache = function (query) {
2994
- if (this.lastQueriesWithResults.has(query)) {
2995
- return this.lastQueriesWithResults.get(query);
2996
- }
2997
- return undefined;
2998
- };
2999
- GeolocationService.prototype.addToCache = function (query, data) {
3000
- if (this.lastQueriesWithResults.keys.length >= this.cacheSize) {
3001
- var deletedQuery = this.lastQueriesLru[0];
3002
- this.revomeFromCache(deletedQuery);
3003
- }
3004
- this.lastQueriesWithResults.set(query, data);
3005
- this.lastQueriesLru.push(query);
3006
- return data;
3007
- };
3008
- GeolocationService.prototype.revomeFromCache = function (query) {
3009
- this.lastQueriesWithResults.delete(query);
3010
- var index = this.lastQueriesLru.findIndex(function (it) { return it === query; });
3011
- this.lastQueriesLru.splice(index, 1);
3012
- };
3013
- GeolocationService.prototype.getLatestQuery = function () {
3014
- return this.lastQueriesLru.length
3015
- ? this.lastQueriesLru[this.lastQueriesLru.length - 1]
3016
- : null;
3017
- };
3018
- return GeolocationService;
3019
- }());
3020
- GeolocationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function GeolocationService_Factory() { return new GeolocationService(i0__namespace.ɵɵinject(i1__namespace$1.HttpClient)); }, token: GeolocationService, providedIn: "root" });
3021
- GeolocationService.decorators = [
3022
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
3023
- ];
3024
- GeolocationService.ctorParameters = function () { return [
3025
- { type: i1$1.HttpClient }
3026
- ]; };
3027
- var samePosition = function (searchResult, keys) {
3028
- var found = false;
3029
- keys.forEach(function (item) {
3030
- if (searchResult.lon === item.coordinates[0] &&
3031
- searchResult.lat === item.coordinates[1]) {
3032
- found = true;
3033
- }
3034
- });
3035
- return found;
3036
- };
3037
- var ɵ0$2 = samePosition;
3038
- var distinct = function (data) {
3039
- var unique = {};
3040
- return data.filter(function (r) {
3041
- if (unique[r.display_name]) {
3042
- return false;
3043
- }
3044
- unique[r.display_name] = 1;
3045
- return true;
3046
- });
3047
- };
3048
- var ɵ1$1 = distinct;
3049
-
3050
- var GeolocationComponent = /** @class */ (function () {
3051
- function GeolocationComponent(modalService, locationService) {
3052
- this.modalService = modalService;
3053
- this.locationService = locationService;
3054
- this.touched = false;
3055
- this.dirty = false;
3056
- this.lastErrors = null;
3057
- this.latitudeValue = undefined;
3058
- this.longitudeValue = undefined;
3059
- this.isValidNumber = isValidNumber;
3060
- this.i18n = {
3061
- en: {
3062
- lat: 'latitude',
3063
- lon: 'longitude',
3064
- selectLocation: 'Select location',
3065
- location: 'Location',
3066
- selectAction: 'Select',
3067
- cancelAction: 'Cancel',
3068
- closeAction: 'Close',
3069
- typeToSearch: 'type to search',
3070
- cardinalPoints: {
3071
- north: 'N',
3072
- south: 'S',
3073
- east: 'E',
3074
- west: 'W'
3075
- },
3076
- userErrors: {
3077
- required: 'Required field.',
3078
- minLatitude: 'Minimum latitude is $minLatitude.',
3079
- maxLatitude: 'Maximum latitude is $maxLatitude.',
3080
- minLongitude: 'Minimum longitude is $minLongitude.',
3081
- maxLongitude: 'Maximum longitude is $maxLongitude.'
3082
- }
3083
- },
3084
- es: {
3085
- lat: 'latitud',
3086
- lon: 'longitud',
3087
- selectLocation: 'Seleccione ubicación',
3088
- location: 'Ubicación',
3089
- selectAction: 'Seleccionar',
3090
- cancelAction: 'Cancelar',
3091
- closeAction: 'Cerrar',
3092
- typeToSearch: 'escribe para buscar',
3093
- cardinalPoints: {
3094
- north: 'N',
3095
- south: 'S',
3096
- east: 'E',
3097
- west: 'O'
3098
- },
3099
- userErrors: {
3100
- required: 'El campo es obligatorio.',
3101
- minLatitude: 'La latitud mínima es $minLatitude.',
3102
- maxLatitude: 'La latitud máxima es $maxLatitude.',
3103
- minLongitude: 'La longitud mínima es $minLongitude.',
3104
- maxLongitude: 'La longitud máxima es $maxLongitude.'
3105
- }
3106
- }
3107
- };
3108
- this.lang = languageDetector();
3109
- this.inlineErrors = false;
3110
- this.readonly = null;
3111
- this.valueChange = new i0.EventEmitter();
3112
- this.keyPress = new i0.EventEmitter();
3113
- this.onChange = function (value) { };
3114
- this.onTouched = function () { };
3115
- }
3116
- Object.defineProperty(GeolocationComponent.prototype, "className", {
3117
- get: function () {
3118
- return this.checkClassName();
3119
- },
3120
- enumerable: false,
3121
- configurable: true
3122
- });
3123
- Object.defineProperty(GeolocationComponent.prototype, "disabled", {
3124
- get: function () {
3125
- return this._disabled;
3126
- },
3127
- set: function (v) {
3128
- v = typeof v === 'string' && v !== 'false' ? true : v;
3129
- this._disabled = v;
3130
- },
3131
- enumerable: false,
3132
- configurable: true
3133
- });
3134
- Object.defineProperty(GeolocationComponent.prototype, "required", {
3135
- get: function () {
3136
- return this._required;
3137
- },
3138
- set: function (v) {
3139
- this._required = v;
3140
- },
3141
- enumerable: false,
3142
- configurable: true
3143
- });
3144
- Object.defineProperty(GeolocationComponent.prototype, "value", {
3145
- get: function () {
3146
- return this._value;
3147
- },
3148
- set: function (v) {
3149
- if (v === this._value) {
3150
- return; // prevent events when there is no changes
3151
- }
3152
- var initialAndEmpty = isInitialAndEmpty(this._value, v);
3153
- if (v &&
3154
- v.coordinates &&
3155
- v.coordinates.length === 2 &&
3156
- exists(v.coordinates[0] && exists(v.coordinates[1]))) {
3157
- this._value = v;
3158
- this.setLatitudeInControl(v.coordinates[1]);
3159
- this.setLongitudeInControl(v.coordinates[0]);
3160
- }
3161
- else if (!v) {
3162
- this._value = null;
3163
- this.setLatitudeInControl(null);
3164
- this.setLongitudeInControl(null);
3165
- }
3166
- else {
3167
- this._value = v;
3168
- // we don't set value in control if the value is not valid
3169
- // if we do, the content of the control changes and can erase what the user is typing
3170
- }
3171
- this.onChange(v);
3172
- if (!initialAndEmpty) {
3173
- this.valueChange.emit(v);
3174
- }
3175
- },
3176
- enumerable: false,
3177
- configurable: true
3178
- });
3179
- // ControlValueAccessor Interface implementation
3180
- GeolocationComponent.prototype.writeValue = function (value) {
3181
- this.value = value;
3182
- };
3183
- GeolocationComponent.prototype.registerOnChange = function (onChange) {
3184
- this.onChange = onChange;
3185
- };
3186
- GeolocationComponent.prototype.registerOnTouched = function (onTouched) {
3187
- this.onTouched = onTouched;
3188
- };
3189
- GeolocationComponent.prototype.markAsTouched = function () {
3190
- if (!this.touched) {
3191
- this.onTouched();
3192
- this.touched = true;
3193
- }
3194
- };
3195
- GeolocationComponent.prototype.setDisabledState = function (disabled) {
3196
- this.disabled = disabled;
3197
- };
3198
- // End of ControlValueAccessor Interface implementation
3199
- GeolocationComponent.prototype.setLatitudeInControl = function (latitude) {
3200
- // this.latitude.nativeElement.value = latitude;
3201
- this.latitudeValue = latitude;
3202
- };
3203
- GeolocationComponent.prototype.setLongitudeInControl = function (longitude) {
3204
- // this.longitude.nativeElement.value = longitude;
3205
- this.longitudeValue = longitude;
3206
- };
3207
- GeolocationComponent.prototype.clear = function () {
3208
- this.setLatitudeInControl(null);
3209
- this.setLongitudeInControl(null);
3210
- this.value = null;
3211
- };
3212
- // Validator interface
3213
- GeolocationComponent.prototype.registerOnValidatorChange = function () { };
3214
- GeolocationComponent.prototype.validate = function (control) {
3215
- var value = control.value;
3216
- var result = null;
3217
- if (this.required &&
3218
- !hasValue(value) &&
3219
- !exists(this.latitudeValue) &&
3220
- !exists(this.longitudeValue)) {
3221
- result = result || {};
3222
- result.required = { value: value, reason: 'Required field.' };
3223
- }
3224
- if (!exists(this.latitudeValue) && exists(this.longitudeValue)) {
3225
- result = result || {};
3226
- result.existsLatitude = {
3227
- value: value,
3228
- reason: 'Latitude not specified.'
3229
- };
3230
- }
3231
- if (exists(this.latitudeValue) && !exists(this.longitudeValue)) {
3232
- result = result || {};
3233
- result.existsLongitude = {
3234
- value: value,
3235
- reason: 'Longitude not specified.'
3236
- };
3237
- }
3238
- if (exists(this.minLatitude) && this.latitudeValue < this.minLatitude) {
3239
- result = result || {};
3240
- result.minLatitude = {
3241
- value: value,
3242
- min: this.minLatitude,
3243
- reason: "Latitude is lower than minimum value: " + this.minLatitude + "."
3244
- };
3245
- }
3246
- if (exists(this.maxLatitude) && this.latitudeValue > this.maxLatitude) {
3247
- result = result || {};
3248
- result.maxLatitude = {
3249
- value: value,
3250
- max: this.maxLatitude,
3251
- reason: "Latitude is higher than maximum value: " + this.maxLatitude + "."
3252
- };
3253
- }
3254
- if (exists(this.minLongitude) && this.longitudeValue < this.minLongitude) {
3255
- result = result || {};
3256
- result.minLongitude = {
3257
- value: value,
3258
- min: this.minLongitude,
3259
- reason: "Longitude is lower than minimum value: " + this.minLongitude + "."
3260
- };
3261
- }
3262
- if (exists(this.maxLongitude) && this.longitudeValue > this.maxLongitude) {
3263
- result = result || {};
3264
- result.maxLongitude = {
3265
- value: value,
3266
- max: this.maxLongitude,
3267
- reason: "Longitude is higher than maximum value: " + this.maxLongitude + "."
3268
- };
3269
- }
3270
- this.lastErrors = result;
3271
- return result;
3272
- };
3273
- // End of Validator interface
3274
- GeolocationComponent.prototype.ngOnInit = function () {
3275
- this.inputId = this.inputId
3276
- ? this.inputId
3277
- : "geolocation$" + GeolocationComponent.idCounter++;
3278
- this.setPatterns();
3279
- };
3280
- GeolocationComponent.prototype.roundToStepAndUpdateLatitudeAndLongitude = function (newLatitudeAndLongitude) {
3281
- var newLatitude = roundToMultipleOf(newLatitudeAndLongitude[1], this.step);
3282
- var newLongitude = roundToMultipleOf(newLatitudeAndLongitude[0], this.step);
3283
- if (this.disabled || this.readonly) {
3284
- return;
3285
- }
3286
- if (!exists(newLatitudeAndLongitude)) {
3287
- this.value = null;
3288
- }
3289
- this.value = {
3290
- type: 'Point',
3291
- coordinates: [newLongitude, newLatitude]
3292
- };
3293
- };
3294
- GeolocationComponent.prototype.onLostFocus = function () {
3295
- this.markAsTouched();
3296
- };
3297
- GeolocationComponent.prototype.onEventLatitude = function (newLatitude) {
3298
- if (this.disabled || this.readonly) {
3299
- return;
3300
- }
3301
- var newLatitudeValue = isValidNumber(newLatitude) ? +newLatitude : null;
3302
- if (!(exists(this.value) && exists(this.value.coordinates[0])) &&
3303
- !exists(newLatitudeValue)) {
3304
- this.value = null;
3305
- }
3306
- else {
3307
- this.value = {
3308
- type: 'Point',
3309
- coordinates: [
3310
- this.value ? this.value.coordinates[0] : undefined,
3311
- newLatitudeValue
3312
- ]
3313
- };
3314
- }
3315
- this.markAsTouched();
3316
- };
3317
- GeolocationComponent.prototype.onEventLongitude = function (newLongitude) {
3318
- if (this.disabled || this.readonly) {
3319
- return;
3320
- }
3321
- var newLongitudeValue = isValidNumber(newLongitude)
3322
- ? +newLongitude
3323
- : null;
3324
- if (!exists(newLongitudeValue) &&
3325
- !(exists(this.value) && exists(this._value.coordinates[1]))) {
3326
- this.value = null;
3327
- }
3328
- else {
3329
- this.value = {
3330
- type: 'Point',
3331
- coordinates: [
3332
- newLongitudeValue,
3333
- this.value ? this.value.coordinates[1] : undefined
3334
- ]
3335
- };
3336
- }
3337
- this.markAsTouched();
3338
- };
3339
- GeolocationComponent.prototype.onKeyPress = function (event) {
3340
- this.keyPress.emit(event);
3341
- };
3342
- GeolocationComponent.prototype.checkClassName = function () {
3343
- return this.disabled
3344
- ? this.readonly
3345
- ? 'disabled readonly'
3346
- : 'disabled'
3347
- : this.readonly
3348
- ? 'readonly'
3349
- : '';
3350
- };
3351
- GeolocationComponent.prototype.openModalMap = function (modal) {
3352
- var _this = this;
3353
- this.modalService.open(modal).result.then(function (result) {
3354
- if (result !== 'cancel') {
3355
- _this.roundToStepAndUpdateLatitudeAndLongitude(result);
3356
- }
3357
- }, function (_) { });
3358
- };
3359
- GeolocationComponent.prototype.onSearchLocationChanged = function (newValue, map) {
3360
- map.markerPoint = newValue;
3361
- map.center = map.markerPoint;
3362
- };
3363
- Object.defineProperty(GeolocationComponent.prototype, "mapTitle", {
3364
- get: function () {
3365
- return this._disabled || !!this.readonly
3366
- ? this.i18n[this.lang].location
3367
- : this.i18n[this.lang].selectLocation;
3368
- },
3369
- enumerable: false,
3370
- configurable: true
3371
- });
3372
- Object.defineProperty(GeolocationComponent.prototype, "self", {
3373
- get: function () {
3374
- return this;
3375
- },
3376
- enumerable: false,
3377
- configurable: true
3378
- });
3379
- GeolocationComponent.prototype.getLabels = function (instance, keys) {
3380
- return instance.locationService.getLabels(instance.locationService, keys);
3381
- };
3382
- GeolocationComponent.prototype.getData = function (instance, search) {
3383
- return instance.locationService.getData(instance.locationService, search);
3384
- };
3385
- GeolocationComponent.prototype.setPatterns = function () {
3386
- this.step = this.step || 0.00001; // 0.00001 degrees = 1.11 meters
3387
- this.zoom = this.zoom || 18; // (360/2^18) degrees ~ 0.00137 degrees ~ 153 meters
3388
- this.minLatitude = this.minLatitude || -90;
3389
- this.maxLatitude = this.maxLatitude || +90;
3390
- this.minLongitude = this.minLongitude || -180;
3391
- this.maxLongitude = this.maxLongitude || +180;
3392
- };
3393
- return GeolocationComponent;
3394
- }());
3395
- GeolocationComponent.idCounter = 0;
3396
- GeolocationComponent.decorators = [
3397
- { type: i0.Component, args: [{
3398
- selector: 'lux-geolocation',
3399
- template: "<input\n #latitude\n class=\"rounded-left prefix\"\n [ngClass]=\"className\"\n type=\"number\"\n [id]=\"inputId + '$latitude'\"\n [(ngModel)]=\"latitudeValue\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.disabled]=\"disabled === true ? 'true' : undefined\"\n [attr.readonly]=\"readonly === true ? 'true' : undefined\"\n [attr.min]=\"\n minLatitude !== undefined && minLatitude !== null\n ? minLatitude.toString()\n : undefined\n \"\n [attr.max]=\"\n maxLatitude !== undefined && maxLatitude !== null\n ? maxLatitude.toString()\n : undefined\n \"\n [attr.step]=\"\n step !== undefined && step !== null ? step.toString() : undefined\n \"\n [placeholder]=\"i18n[lang].lat\"\n (keyup)=\"onEventLatitude(latitude.value)\"\n (change)=\"onEventLatitude(latitude.value)\"\n (keypress)=\"onKeyPress($event)\"\n (blur)=\"onLostFocus()\"\n/>\n<div\n class=\"infix symbol clickable\"\n [ngClass]=\"className\"\n (click)=\"openModalMap(modalMap)\">\n <span *ngIf=\"isValidNumber(latitudeValue) && latitudeValue >= 0\">{{\n i18n[lang].cardinalPoints.north\n }}</span>\n <span *ngIf=\"isValidNumber(latitudeValue) && latitudeValue < 0\">{{\n i18n[lang].cardinalPoints.south\n }}</span>\n <span *ngIf=\"!isValidNumber(latitudeValue)\" class=\"icon-globe\"></span>\n</div>\n<input\n #longitude\n class=\"prefix\"\n [ngClass]=\"className\"\n type=\"number\"\n [id]=\"inputId + '$longitude'\"\n [(ngModel)]=\"longitudeValue\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.disabled]=\"disabled === true ? 'true' : undefined\"\n [attr.readonly]=\"readonly === true ? 'true' : undefined\"\n [attr.min]=\"\n minLongitude !== undefined && minLongitude !== null\n ? minLongitude.toString()\n : undefined\n \"\n [attr.max]=\"\n maxLongitude !== undefined && maxLongitude !== null\n ? maxLongitude.toString()\n : undefined\n \"\n [attr.step]=\"\n step !== undefined && step !== null ? step.toString() : undefined\n \"\n [placeholder]=\"i18n[lang].lon\"\n (keyup)=\"onEventLongitude(longitude.value)\"\n (change)=\"onEventLongitude(longitude.value)\"\n (keypress)=\"onKeyPress($event)\"\n (blur)=\"onLostFocus()\"\n/>\n<div\n [class]=\"\n disabled || readonly\n ? 'clickable rounded-right postfix symbol'\n : 'clickable postfix symbol'\n \"\n [ngClass]=\"className\"\n (click)=\"openModalMap(modalMap)\"\n>\n <span *ngIf=\"isValidNumber(longitudeValue) && longitudeValue >= 0\">{{\n i18n[lang].cardinalPoints.east\n }}</span>\n <span *ngIf=\"isValidNumber(longitudeValue) && longitudeValue < 0\">{{\n i18n[lang].cardinalPoints.west\n }}</span>\n <span *ngIf=\"!isValidNumber(longitudeValue)\" class=\"icon-globe\"></span>\n</div>\n<button\n #clearButton\n *ngIf=\"!(disabled || readonly)\"\n class=\"rounded-right postfix bordered icon icon-clear\"\n [id]=\"inputId + '$clear'\"\n type=\"button\"\n (click)=\"clear()\"\n aria-label=\"clear\"\n></button>\n\n<div *ngIf=\"inlineErrors && lastErrors && (dirty || touched)\" class=\"alert\">\n <div *ngIf=\"lastErrors.required\">\n {{ i18n[lang].userErrors.required }}\n </div>\n <div *ngIf=\"lastErrors.minLatitude\">\n {{\n i18n[lang].userErrors.minLatitude.replace(\n '$minLatitude',\n lastErrors.minLatitude.min\n )\n }}\n </div>\n <div *ngIf=\"lastErrors.maxLatitude\">\n {{\n i18n[lang].userErrors.maxLatitude.replace(\n '$maxLatitude',\n lastErrors.maxLatitude.max\n )\n }}\n </div>\n <div *ngIf=\"lastErrors.minLongitude\">\n {{\n i18n[lang].userErrors.minLongitude.replace(\n '$minLongitude',\n lastErrors.minLongitude.min\n )\n }}\n </div>\n <div *ngIf=\"lastErrors.maxLongitude\">\n {{\n i18n[lang].userErrors.maxLongitude.replace(\n '$maxLongitude',\n lastErrors.maxLongitude.max\n )\n }}\n </div>\n</div>\n\n<ng-template #modalMap let-modal>\n <div class=\"lux-modal-header\">\n <h4 class=\"modal-title\" id=\"modal-basic-title\">{{ mapTitle }}</h4>\n <button\n type=\"button\"\n class=\"close\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss('Cross click')\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n </button>\n </div>\n <div class=\"lux-modal-body content\">\n <lux-autocomplete\n #searchBar\n [attr.aria-label]=\"i18n[lang].typeToSearch\"\n [placeholder]=\"i18n[lang].typeToSearch\"\n *ngIf=\"!disabled && !readonly\"\n [instance]=\"self\"\n [resolveLabelsFunction]=\"getLabels\"\n [populateFunction]=\"getData\"\n (valueChange)=\"onSearchLocationChanged(searchBar.value, map)\"\n ></lux-autocomplete>\n <div class=\"map-container\">\n <lux-map\n #map\n [center]=\"value\"\n [markerPoint]=\"value\"\n [zoom]=\"zoom\"\n [readonly]=\"readonly === true || disabled === true ? true : false\"\n ></lux-map>\n </div>\n </div>\n <div class=\"lux-modal-footer\">\n <button\n *ngIf=\"disabled || readonly\"\n type=\"button\"\n class=\"btn btn-cancel\"\n (click)=\"modal.close('cancel')\"\n >\n {{ i18n[lang].closeAction }}\n </button>\n <button\n *ngIf=\"!disabled && !readonly\"\n type=\"button\"\n class=\"btn btn-cancel\"\n (click)=\"modal.close('cancel')\"\n >\n {{ i18n[lang].cancelAction }}\n </button>\n <button\n *ngIf=\"!disabled && !readonly\"\n type=\"button\"\n class=\"btn btn-select\"\n (click)=\"modal.close(map.markerPoint.coordinates)\"\n >\n {{ i18n[lang].selectAction }}\n </button>\n </div>\n</ng-template>\n",
3400
- providers: [
3401
- {
3402
- provide: forms.NG_VALUE_ACCESSOR,
3403
- multi: true,
3404
- useExisting: i0.forwardRef(function () { return GeolocationComponent; })
3405
- },
3406
- {
3407
- provide: forms.NG_VALIDATORS,
3408
- multi: true,
3409
- useExisting: i0.forwardRef(function () { return GeolocationComponent; })
3410
- }
3411
- ],
3412
- styles: [":focus{z-index:1}input,select,textarea{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057);margin:0;margin:var(--lux-input-margin, 0rem);padding:0 .5rem;padding:var(--lux-input-padding, 0rem .5rem)}.alert{padding:.2rem 2rem;background:#fe2e2e;background:var(--lux-alert-background, #fe2e2e);color:#fff;color:var(--lux-alert-color, white);font-family:Consolas,monospace;width:45%;margin-right:1rem;display:inline-block}.symbol{display:inline-block;align-items:baseline;padding:0 .5rem;margin-bottom:0;font-weight:400;color:default;color:var(--lux-symbol-color, default);text-align:center;white-space:nowrap;background:default;background:var(--lux-symbol-background, default);font-size:1rem;font-size:var(--lux-symbol-font-size, 1rem)}.bordered,.symbol{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057)}.rounded,.rounded-right,.rounded-middle,.rounded-left{border-radius:.25rem;border-radius:var(--lux-border-radius, .25rem)}.rounded-left{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-middle{border-radius:0}.rounded-right{border-top-left-radius:0;border-bottom-left-radius:0}.prefix{border-right:none}.infix{border-left:none;border-right:none}.postfix{border-left:none;display:flex;align-items:center}:host{display:flex;align-items:stretch}.btn-select{color:#fff;background-color:#4242d1;margin-left:2rem}.btn-cancel{color:#fff;background-color:#c22929}.readonly{border:none}.readonly:focus{border:none;outline:none}.disabled{background-color:#f1f1f1;background-color:var(--lux-disabled-color, #f1f1f1);border-color:#6d6d6d;border-color:var(--lux-disabled-border-color, #6d6d6d)}.icon,.icon-clear,.icon-globe{display:inline-block;background-size:1rem 1rem;background-position:center;background-repeat:no-repeat;min-width:1rem;min-height:1rem;width:1.5rem;width:var(--lux-autocomplete-icon-width, 1.5rem);z-index:1}.clickable{cursor:pointer}.icon-globe{background:url(/assets/img/globe.svg) no-repeat center;background:var(--lux-autocomplete-icon-globe, url(/assets/img/globe.svg) no-repeat center);background-size:1rem;height:100%}.icon-clear{width:1.5rem;width:var(--lux-autocomplete-icon-width, 1.5rem);background:url(/assets/img/filter-clear.png) no-repeat center;background:var(--lux-autocomplete-icon-clear, url(/assets/img/filter-clear.png) no-repeat center);background-size:.5rem .5rem;background-size:var(--lux-autocomplete-icon-bg-size, .5rem .5rem);z-index:1}.lux-modal-body{padding:0}.map-container{height:45vh;height:var(--lux-geolocation-map-height, 45vh);width:90vw;width:var(--lux-geolocation-map-width, 90vw)}\n"]
3413
- },] }
3414
- ];
3415
- GeolocationComponent.ctorParameters = function () { return [
3416
- { type: ModalService },
3417
- { type: GeolocationService }
3418
- ]; };
3419
- GeolocationComponent.propDecorators = {
3420
- latitude: [{ type: i0.ViewChild, args: ['latitude', { static: true },] }],
3421
- longitude: [{ type: i0.ViewChild, args: ['longitude', { static: true },] }],
3422
- map: [{ type: i0.ViewChild, args: ['map', { static: false },] }],
3423
- minLatitude: [{ type: i0.Input }],
3424
- maxLatitude: [{ type: i0.Input }],
3425
- minLongitude: [{ type: i0.Input }],
3426
- maxLongitude: [{ type: i0.Input }],
3427
- step: [{ type: i0.Input }],
3428
- zoom: [{ type: i0.Input }],
3429
- lang: [{ type: i0.Input }],
3430
- inlineErrors: [{ type: i0.Input }],
3431
- inputId: [{ type: i0.Input }],
3432
- ariaLabel: [{ type: i0.Input, args: ['aria-label',] }],
3433
- readonly: [{ type: i0.Input }],
3434
- disabled: [{ type: i0.Input }],
3435
- required: [{ type: i0.Input }],
3436
- value: [{ type: i0.Input }],
3437
- valueChange: [{ type: i0.Output }],
3438
- keyPress: [{ type: i0.Output }]
3439
- };
3440
-
3441
- var Placement;
3442
- (function (Placement) {
3443
- Placement["Top"] = "top";
3444
- Placement["Bottom"] = "bottom";
3445
- Placement["Left"] = "left";
3446
- Placement["Right"] = "right";
3447
- })(Placement || (Placement = {}));
3448
-
3449
- /**
3450
- * Default Tooltip Component
3451
- */
3452
- var TooltipComponent = /** @class */ (function () {
3453
- function TooltipComponent() {
3454
- }
3455
- return TooltipComponent;
3456
- }());
3457
- TooltipComponent.decorators = [
3458
- { type: i0.Component, args: [{
3459
- template: "\n <span class=\"lux-tooltip\" style=\"transition: opacity 200ms\">{{context.message}}</span>\n "
3460
- },] }
3461
- ];
3462
- TooltipComponent.ctorParameters = function () { return []; };
3463
- TooltipComponent.propDecorators = {
3464
- context: [{ type: i0.Input }]
3465
- };
3466
-
3467
- var TooltipContentRef = /** @class */ (function () {
3468
- function TooltipContentRef(viewRef, componentRef) {
3469
- this.viewRef = viewRef;
3470
- this.componentRef = componentRef;
3471
- }
3472
- return TooltipContentRef;
3473
- }());
3474
-
3475
- var TooltipService = /** @class */ (function () {
3476
- function TooltipService(_injector, _crf, _applicationRef) {
3477
- this._injector = _injector;
3478
- this._crf = _crf;
3479
- this._applicationRef = _applicationRef;
3480
- }
3481
- TooltipService.prototype.appendComponentToBody = function (content, elHost, placement) {
3482
- var tooltipContentRef = this.getTooltipContentRef(content);
3483
- if (tooltipContentRef) {
3484
- var domElem = tooltipContentRef.viewRef
3485
- .rootNodes[0];
3486
- document.body.appendChild(domElem);
3487
- if (tooltipContentRef.componentRef) {
3488
- tooltipContentRef.componentRef.changeDetectorRef.detectChanges();
3489
- }
3490
- domElem = this.setStyle(domElem, placement);
3491
- domElem = this.setPosition(domElem, elHost, placement);
3492
- return tooltipContentRef;
3493
- }
3494
- return null;
3495
- };
3496
- TooltipService.prototype.removeComponentFromBody = function (tooltipContentRef) {
3497
- this._applicationRef.detachView(tooltipContentRef.viewRef);
3498
- if (tooltipContentRef.componentRef) {
3499
- tooltipContentRef.componentRef.destroy();
3500
- }
3501
- };
3502
- TooltipService.prototype.getTooltipContentRef = function (content) {
3503
- if (!content) {
3504
- // nothing to show
3505
- }
3506
- else if (content instanceof i0.TemplateRef) {
3507
- return this.createFromTemplateRef(content);
3508
- }
3509
- else if (typeof content === 'string') {
3510
- return this.createFromComponent(TooltipComponent, { message: content });
3511
- }
3512
- else {
3513
- return this.createFromComponent(content);
3514
- }
3515
- };
3516
- TooltipService.prototype.createFromTemplateRef = function (content) {
3517
- var viewRef = content.createEmbeddedView({});
3518
- this._applicationRef.attachView(viewRef);
3519
- return new TooltipContentRef(viewRef);
3520
- };
3521
- TooltipService.prototype.createFromComponent = function (component, context) {
3522
- var componentRef = this._crf
3523
- .resolveComponentFactory(component)
3524
- .create(this._injector);
3525
- if (context) {
3526
- componentRef.instance.context = context;
3527
- }
3528
- this._applicationRef.attachView(componentRef.hostView);
3529
- return new TooltipContentRef(componentRef.hostView, componentRef);
3530
- };
3531
- TooltipService.prototype.setStyle = function (domElem, placement) {
3532
- domElem.style.position = 'absolute';
3533
- domElem.style.minWidth = 'min-content';
3534
- domElem.style.minHeight = 'min-content';
3535
- var tooltipElement = this.getTooltipElementFromHTMLElemnt(domElem);
3536
- placement =
3537
- placement !== undefined
3538
- ? placement.toLocaleLowerCase()
3539
- : 'top'; // 'Top' is the default value of placement
3540
- tooltipElement.classList.add("lux-tooltip-" + placement);
3541
- tooltipElement.classList.add('lux-tooltip-show');
3542
- return domElem;
3543
- };
3544
- TooltipService.prototype.getTooltipElementFromHTMLElemnt = function (domElem) {
3545
- var _this = this;
3546
- var elementsArray = Array.from(domElem.classList).filter(function (className) { return className === 'lux-tooltip'; });
3547
- if (elementsArray.length !== 0) {
3548
- return domElem;
3549
- }
3550
- else if (domElem.hasChildNodes()) {
3551
- var childrenArray = Array.from(domElem.children).filter(function (child) { return _this.getTooltipElementFromHTMLElemnt(child) !== null; });
3552
- if (childrenArray.length !== 0) {
3553
- return this.getTooltipElementFromHTMLElemnt(childrenArray[0]);
3554
- }
3555
- else {
3556
- return null;
3557
- }
3558
- }
3559
- else {
3560
- return null;
3561
- }
3562
- };
3563
- TooltipService.prototype.setPosition = function (domElem, elHost, placement) {
3564
- var hostPos = elHost.nativeElement.getBoundingClientRect();
3565
- var tooltipPos = domElem.getBoundingClientRect();
3566
- var scrollPos = window.pageYOffset ||
3567
- document.documentElement.scrollTop ||
3568
- document.body.scrollTop ||
3569
- 0;
3570
- var top = 0;
3571
- var left = 0;
3572
- var offset = 10;
3573
- switch (placement) {
3574
- case Placement.Bottom:
3575
- top = hostPos.bottom + offset;
3576
- left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
3577
- break;
3578
- case Placement.Left:
3579
- top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
3580
- left = hostPos.left - tooltipPos.width - offset;
3581
- break;
3582
- case Placement.Right:
3583
- top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
3584
- left = hostPos.right + offset;
3585
- break;
3586
- case Placement.Top:
3587
- default:
3588
- top = hostPos.top - tooltipPos.height - offset;
3589
- left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
3590
- break;
3591
- }
3592
- top = Math.max(0, top);
3593
- left = Math.max(0, left);
3594
- domElem.style.top = top + scrollPos + "px";
3595
- domElem.style.left = left + "px";
3596
- return domElem;
3597
- };
3598
- return TooltipService;
3599
- }());
3600
- TooltipService.decorators = [
3601
- { type: i0.Injectable }
3602
- ];
3603
- TooltipService.ctorParameters = function () { return [
3604
- { type: i0.Injector },
3605
- { type: i0.ComponentFactoryResolver },
3606
- { type: i0.ApplicationRef }
3607
- ]; };
3608
-
3609
- /**
3610
- * Tooltip directive
3611
- */
3612
- var LuxTooltipDirective = /** @class */ (function () {
3613
- function LuxTooltipDirective(elHost, tooltipService) {
3614
- this.elHost = elHost;
3615
- this.tooltipService = tooltipService;
3616
- }
3617
- LuxTooltipDirective.prototype.onMouseEnter = function () {
3618
- if (!this.tooltipRef) {
3619
- this.tooltipRef = this.show(this.content, this.elHost, this.placement);
3620
- }
3621
- };
3622
- LuxTooltipDirective.prototype.onMouseLeave = function () {
3623
- if (this.tooltipRef) {
3624
- this.remove(this.tooltipRef);
3625
- this.tooltipRef = null;
3626
- }
3627
- };
3628
- LuxTooltipDirective.prototype.onClick = function () {
3629
- if (this.tooltipRef) {
3630
- this.remove(this.tooltipRef);
3631
- this.tooltipRef = null;
3632
- }
3633
- };
3634
- LuxTooltipDirective.prototype.show = function (component, elHost, placement) {
3635
- return this.tooltipService.appendComponentToBody(component, elHost, placement);
3636
- };
3637
- LuxTooltipDirective.prototype.remove = function (tooltipRef) {
3638
- this.tooltipService.removeComponentFromBody(tooltipRef);
3639
- };
3640
- return LuxTooltipDirective;
3641
- }());
3642
- LuxTooltipDirective.decorators = [
3643
- { type: i0.Directive, args: [{
3644
- selector: '[luxTooltip]'
3645
- },] }
3646
- ];
3647
- LuxTooltipDirective.ctorParameters = function () { return [
3648
- { type: i0.ElementRef },
3649
- { type: TooltipService }
3650
- ]; };
3651
- LuxTooltipDirective.propDecorators = {
3652
- luxTooltip: [{ type: i0.Input }],
3653
- content: [{ type: i0.Input }],
3654
- placement: [{ type: i0.Input }],
3655
- onMouseEnter: [{ type: i0.HostListener, args: ['mouseenter',] }],
3656
- onMouseLeave: [{ type: i0.HostListener, args: ['mouseleave',] }],
3657
- onClick: [{ type: i0.HostListener, args: ['click',] }]
3658
- };
3659
-
3660
- var LuxBreadcrumbComponent = /** @class */ (function () {
3661
- function LuxBreadcrumbComponent(route, activedRoute) {
3662
- this.route = route;
3663
- this.activedRoute = activedRoute;
3664
- this.subs = [];
3665
- this.imagePath = '../assets/img/arrow-forward.svg';
3666
- }
3667
- LuxBreadcrumbComponent.prototype.ngOnInit = function () {
3668
- var _this = this;
3669
- this.subs.push(this.route.events
3670
- .pipe(operators.filter(function (event) { return event instanceof router.NavigationEnd; }))
3671
- .subscribe(function (_) {
3672
- _this.breadcrumbs = [];
3673
- _this.addBreadcrumbs(_this.activedRoute.snapshot.root, true, null);
3674
- }));
3675
- };
3676
- LuxBreadcrumbComponent.prototype.ngOnDestroy = function () {
3677
- this.subs.forEach(function (s) { return s.unsubscribe(); });
3678
- this.subs = [];
3679
- };
3680
- LuxBreadcrumbComponent.prototype.addBreadcrumbs = function (activedRouteSnapshot, isRoot, urlPrefix) {
3681
- var routeConfig = activedRouteSnapshot.routeConfig;
3682
- var url = urlPrefix || '';
3683
- url += routeConfig ? '/' + this.getUrl(activedRouteSnapshot) : '';
3684
- var label = routeConfig
3685
- ? this.getLabel(activedRouteSnapshot)
3686
- : isRoot
3687
- ? 'Home'
3688
- : '';
3689
- if (label && url !== '/') {
3690
- var breadcrumb = { label: label, url: url };
3691
- this.breadcrumbs.push(breadcrumb);
3692
- }
3693
- if (activedRouteSnapshot.children.length) {
3694
- this.addBreadcrumbs(activedRouteSnapshot.children[0], false, url);
3695
- }
3696
- };
3697
- LuxBreadcrumbComponent.prototype.getUrl = function (activedRouteSnapshot) {
3698
- if (!activedRouteSnapshot.url[0]) {
3699
- return '';
3700
- }
3701
- var id = activedRouteSnapshot.params.id;
3702
- return id
3703
- ? activedRouteSnapshot.url[0] + "/" + id
3704
- : activedRouteSnapshot.routeConfig.path || '';
3705
- };
3706
- LuxBreadcrumbComponent.prototype.getLabel = function (activedRouteSnapshot) {
3707
- var routeConfig = activedRouteSnapshot.routeConfig;
3708
- if (!routeConfig) {
3709
- return null;
3710
- }
3711
- if (activedRouteSnapshot.data && activedRouteSnapshot.data.title) {
3712
- var data = activedRouteSnapshot.data;
3713
- if (data.objectTitle) {
3714
- return data.title + " " + data.objectTitle;
3715
- }
3716
- else {
3717
- return data.title;
3718
- }
3719
- }
3720
- return activedRouteSnapshot.params.id || routeConfig.path;
3721
- };
3722
- return LuxBreadcrumbComponent;
3723
- }());
3724
- LuxBreadcrumbComponent.decorators = [
3725
- { type: i0.Component, args: [{
3726
- selector: 'lux-breadcrumb',
3727
- template: "<ul class=\"lux-breadcrumb\">\n <li *ngFor=\"let breadcrumb of breadcrumbs; last as isLast; first as isFirst\"\n class=\"lux-breadcrumb-item\">\n <a [class.first]=\"isFirst\" routerLink=\"{{ breadcrumb.url }}\">{{ breadcrumb.label }}</a>\n <div *ngIf=\"!isLast\" class=\"lux-breadcrumb-separator\"></div>\n </li>\n</ul>\n",
3728
- styles: [".lux-breadcrumb{padding:10px 12px;list-style:none;list-style-type:none}.lux-breadcrumb li{display:inline;font-size:.8em}.lux-breadcrumb li a.first{font-weight:bold}.lux-breadcrumb li+li:before{padding:8px;color:#000}.lux-breadcrumb li a{text-decoration:underline}ol.lux-breadcrumb li a:hover{text-decoration:underline}.lux-breadcrumb a{cursor:hand}.lux-breadcrumb-separator{color:red;position:relative;top:5px;height:16px;padding:0 8px;background-image:url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 512 512%22%3E %3Cpath d%3D%22M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z%22%2F%3E%3C%2Fsvg%3E\");background-repeat:no-repeat;display:inline-block}\n"]
3729
- },] }
3730
- ];
3731
- LuxBreadcrumbComponent.ctorParameters = function () { return [
3732
- { type: router.Router },
3733
- { type: router.ActivatedRoute }
3734
- ]; };
3735
-
3736
- var openLayersIsInstalled = false;
3737
- var OpenLayerLoaderService = /** @class */ (function () {
3738
- function OpenLayerLoaderService() {
3739
- }
3740
- OpenLayerLoaderService.prototype.load = function () {
3741
- if (window.ol) {
3742
- return rxjs.of(true);
3743
- }
3744
- var openLayerJsUrl = 'https://openlayers.org/en/v5.3.0/build/ol.js';
3745
- var openLayerCssUrl = 'https://openlayers.org/en/v5.3.0/css/ol.css';
3746
- if (!openLayersIsInstalled) {
3747
- openLayersIsInstalled = true; // only try to install it once
3748
- loadCss(openLayerCssUrl, function () { });
3749
- return rxjs.from(new Promise(function (resolve, _) {
3750
- loadScript(openLayerJsUrl, function () { return resolve(true); });
3751
- }));
3752
- }
3753
- return rxjs.of(true);
3754
- };
3755
- return OpenLayerLoaderService;
3756
- }());
3757
- OpenLayerLoaderService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function OpenLayerLoaderService_Factory() { return new OpenLayerLoaderService(); }, token: OpenLayerLoaderService, providedIn: "root" });
3758
- OpenLayerLoaderService.decorators = [
3759
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
3760
- ];
3761
- /** Dynamically load a script from url and return a callback */
3762
- var loadScript = function (url, callback) {
3763
- var script = document.createElement('script');
3764
- script.type = 'text/javascript';
3765
- if (script.readyState) {
3766
- // for old IE
3767
- script.onreadystatechange = function () {
3768
- if (script.readyState === 'loaded' || script.readyState === 'complete') {
3769
- script.onreadystatechange = null;
3770
- callback();
3771
- }
3772
- };
3773
- }
3774
- else {
3775
- // Others browsers
3776
- script.onload = function () {
3777
- callback();
3778
- };
3779
- }
3780
- script.src = url;
3781
- document.getElementsByTagName('head')[0].appendChild(script);
3782
- };
3783
- var ɵ0$1 = loadScript;
3784
- /** Dynamically load css from url and return a callback */
3785
- var loadCss = function (url, callback) {
3786
- var link = document.createElement('link');
3787
- link.type = 'text/css';
3788
- link.rel = 'stylesheet';
3789
- link.type = 'text/javascript';
3790
- link.href = url;
3791
- link.onload = function () {
3792
- callback();
3793
- };
3794
- document.getElementsByTagName('head')[0].appendChild(link);
3795
- };
3796
- var ɵ1 = loadCss;
3797
-
3798
- var MapComponent = /** @class */ (function () {
3799
- function MapComponent(olLoader) {
3800
- var _this = this;
3801
- this.loaded$ = new rxjs.BehaviorSubject(false);
3802
- this.valueChange = new i0.EventEmitter();
3803
- olLoader.load().subscribe(function (_) {
3804
- // Initialize
3805
- _this._markerSource = new ol.source.Vector();
3806
- _this._markerStyle = new ol.style.Style({
3807
- image: new ol.style.Icon({
3808
- anchor: [0.5, 1],
3809
- scale: 0.25,
3810
- src: '/assets/img/marker.png'
3811
- })
3812
- });
3813
- _this.loaded$.next(true);
3814
- });
3815
- }
3816
- Object.defineProperty(MapComponent.prototype, "zoom", {
3817
- get: function () {
3818
- return this._zoom;
3819
- },
3820
- set: function (zoom) {
3821
- if (!isNaN(zoom)) {
3822
- this._zoom = zoom;
3823
- if (this._map) {
3824
- this._map.getView().setZoom(zoom);
3825
- }
3826
- }
3827
- },
3828
- enumerable: false,
3829
- configurable: true
3830
- });
3831
- Object.defineProperty(MapComponent.prototype, "center", {
3832
- get: function () {
3833
- return this._center;
3834
- },
3835
- set: function (center) {
3836
- if (center && center.coordinates && center.coordinates.length === 2) {
3837
- this._center = center;
3838
- if (this._map) {
3839
- this._map.getView().setCenter(ol.proj.fromLonLat(center.coordinates));
3840
- }
3841
- }
3842
- },
3843
- enumerable: false,
3844
- configurable: true
3845
- });
3846
- Object.defineProperty(MapComponent.prototype, "readonly", {
3847
- get: function () {
3848
- return this._readonly;
3849
- },
3850
- set: function (readonly) {
3851
- var _this = this;
3852
- if (!readonly) {
3853
- if (this._map) {
3854
- this._map.on('click', function (args) {
3855
- // args.coordinate is in EPSG:3857 (meters), we transform it into EPSG:4326 (degrees)
3856
- var coordinates = ol.proj.toLonLat(args.coordinate);
3857
- // alternatively: const lonLat = ol.proj.transform(args.coordinate,'EPSG:3857','EPSG:4326');
3858
- _this.addMarkerAtCoordinates(coordinates);
3859
- });
3860
- this._map.on('pointermove', function (event) {
3861
- var pixel = _this._map.getEventPixel(event.originalEvent);
3862
- var hit = _this._map.hasFeatureAtPixel(pixel);
3863
- _this._map.getViewport().style.cursor = hit ? 'move' : 'grab';
3864
- });
3865
- }
3866
- }
3867
- else {
3868
- if (this._map) {
3869
- this._map.on('click', function (args) { });
3870
- this._map.on('pointermove', function (event) { });
3871
- this._map.getViewport().style.cursor = 'grab';
3872
- }
3873
- }
3874
- this._readonly = readonly;
3875
- // reset marker coordinates so marker interactions can be created or recreated accordingly
3876
- // to the changes to readonly
3877
- this.markerCoordinates = this.markerCoordinates;
3878
- },
3879
- enumerable: false,
3880
- configurable: true
3881
- });
3882
- Object.defineProperty(MapComponent.prototype, "markerCoordinates", {
3883
- get: function () {
3884
- return this._markerCoordinates;
3885
- },
3886
- set: function (markerCoordinates) {
3887
- if (markerCoordinates && markerCoordinates.length === 2) {
3888
- this._markerCoordinates = markerCoordinates;
3889
- if (this._map) {
3890
- this.addMarkerAtCoordinates(markerCoordinates);
3891
- }
3892
- }
3893
- else {
3894
- this._markerCoordinates = undefined;
3895
- if (this._map) {
3896
- this.removeMarker();
3897
- }
3898
- }
3899
- },
3900
- enumerable: false,
3901
- configurable: true
3902
- });
3903
- Object.defineProperty(MapComponent.prototype, "markerPoint", {
3904
- get: function () {
3905
- return {
3906
- type: 'Point',
3907
- coordinates: this.markerCoordinates
3908
- };
3909
- },
3910
- set: function (markerPoint) {
3911
- if (!markerPoint ||
3912
- !(markerPoint.coordinates && markerPoint.coordinates.length === 2)) {
3913
- this.markerCoordinates = undefined;
3914
- }
3915
- else {
3916
- this.markerCoordinates = [
3917
- +markerPoint.coordinates[0],
3918
- +markerPoint.coordinates[1]
3919
- ];
3920
- }
3921
- this.valueChange.emit(markerPoint);
3922
- },
3923
- enumerable: false,
3924
- configurable: true
3925
- });
3926
- MapComponent.prototype.ngOnInit = function () {
3927
- this.mapId = this.mapId ? this.mapId : 'map' + MapComponent.idCounter++;
3928
- };
3929
- MapComponent.prototype.ngAfterViewInit = function () {
3930
- var _this = this;
3931
- this.loaded$.subscribe(function (loaded) {
3932
- if (loaded) {
3933
- _this.initMap();
3934
- }
3935
- });
3936
- };
3937
- MapComponent.prototype.initMap = function () {
3938
- var _this = this;
3939
- this._map = new ol.Map({
3940
- target: this.mapId,
3941
- controls: ol.control.defaults({ attribution: false }),
3942
- layers: [
3943
- new ol.layer.Tile({
3944
- source: new ol.source.OSM()
3945
- }),
3946
- new ol.layer.Vector({
3947
- source: this._markerSource,
3948
- style: this._markerStyle
3949
- })
3950
- ],
3951
- view: new ol.View({
3952
- center: ol.proj.fromLonLat(this.center !== undefined ? this.center.coordinates : [0, 0]),
3953
- zoom: this.zoom
3954
- })
3955
- });
3956
- if (this.center === undefined || this.center === null) {
3957
- // if the center is not set, we set its default value
3958
- if ('geolocation' in navigator) {
3959
- navigator.geolocation.getCurrentPosition(function (position) {
3960
- _this.center = {
3961
- type: 'Point',
3962
- coordinates: [position.coords.longitude, position.coords.latitude]
3963
- };
3964
- }, function (error) {
3965
- _this.center = {
3966
- type: 'Point',
3967
- coordinates: [0, 0]
3968
- };
3969
- });
3970
- }
3971
- else {
3972
- this.center = {
3973
- type: 'Point',
3974
- coordinates: [0, 0]
3975
- };
3976
- }
3977
- }
3978
- else {
3979
- // the center needs the map to be properly set, so if it was set before the map was initialized,
3980
- // we set the center again to perform necessary adjustements
3981
- this.center = this.center;
3982
- }
3983
- if (this.zoom === undefined || this.zoom === null) {
3984
- // if the zoom is not set, we set its default value
3985
- this.zoom = 18;
3986
- }
3987
- else {
3988
- // the zoom needs the map to be properly set, so if it was set before the map was initialized,
3989
- // we set the zoom again to perform necessary adjustements
3990
- this.zoom = this.zoom;
3991
- }
3992
- if (this.readonly === undefined || this.readonly === null) {
3993
- // if readonly is not set, we set its default value
3994
- this.readonly = false;
3995
- }
3996
- else {
3997
- // readonly needs the map to be properly set, so if it was set before the map was initialized,
3998
- // we set readonly again to perform necessary adjustements
3999
- this.readonly = this.readonly;
4000
- }
4001
- if (this.markerCoordinates !== undefined &&
4002
- this.markerCoordinates !== null) {
4003
- // the marker coordinates need the map to be properly set, so if they were set before the map was initialized,
4004
- // we set the marker coordinates again to perform necessary adjustements
4005
- this.markerCoordinates = this.markerCoordinates;
4006
- }
4007
- };
4008
- MapComponent.prototype.addMarkerAtCoordinates = function (coordinates) {
4009
- var _this = this;
4010
- if (coordinates && coordinates.length === 2) {
4011
- if (this._marker !== undefined) {
4012
- this.removeMarker();
4013
- }
4014
- this._marker = new ol.Feature({
4015
- geometry: new ol.geom.Point(
4016
- // [lon, lat] is in EPSG:4326 (degrees), we transform it into EPSG:3857 (meters)
4017
- ol.proj.transform(coordinates, 'EPSG:4326', 'EPSG:3857'))
4018
- });
4019
- this._markerSource.addFeature(this._marker);
4020
- this._markerCoordinates = this.getMarkerCoordinates();
4021
- if (!this.readonly) {
4022
- var dragInteraction = new ol.interaction.Modify({
4023
- features: new ol.Collection([this._marker]),
4024
- style: this._markerStyle,
4025
- pixelTolerance: 50,
4026
- hitDetection: true
4027
- });
4028
- this._markerInteraction = dragInteraction;
4029
- this._map.addInteraction(dragInteraction);
4030
- }
4031
- this._marker.on('change', function () {
4032
- _this._markerCoordinates = _this.getMarkerCoordinates();
4033
- }, this._marker);
4034
- }
4035
- };
4036
- MapComponent.prototype.removeMarker = function () {
4037
- if (this._marker !== undefined) {
4038
- this._markerSource.removeFeature(this._marker);
4039
- this._marker = undefined;
4040
- }
4041
- if (this._markerInteraction !== undefined) {
4042
- this._map.getInteractions().pop();
4043
- this._markerInteraction = undefined;
4044
- }
4045
- };
4046
- MapComponent.prototype.getMarkerCoordinates = function () {
4047
- if (this._marker === undefined || this._marker == null) {
4048
- return this._marker;
4049
- }
4050
- var coordinates = this._marker.getGeometry().getCoordinates();
4051
- // coordinates is in EPSG:3857 (meters), we transform it into EPSG:4326 (degrees)
4052
- return ol.proj.transform(coordinates, 'EPSG:3857', 'EPSG:4326');
4053
- };
4054
- MapComponent.prototype.onResize = function () {
4055
- if (this._map) {
4056
- this._map.updateSize();
4057
- }
4058
- };
4059
- return MapComponent;
4060
- }());
4061
- MapComponent.idCounter = 0;
4062
- MapComponent.decorators = [
4063
- { type: i0.Component, args: [{
4064
- selector: 'lux-map',
4065
- template: "<div [id]=\"mapId\" class=\"map\" (resized)=\"onResize()\"></div>\n",
4066
- styles: [".map{min-height:100px;height:100%;min-width:160px;width:100%}\n"]
4067
- },] }
4068
- ];
4069
- MapComponent.ctorParameters = function () { return [
4070
- { type: OpenLayerLoaderService }
4071
- ]; };
4072
- MapComponent.propDecorators = {
4073
- mapId: [{ type: i0.Input }],
4074
- zoom: [{ type: i0.Input }],
4075
- center: [{ type: i0.Input }],
4076
- readonly: [{ type: i0.Input }],
4077
- markerCoordinates: [{ type: i0.Input }],
4078
- markerPoint: [{ type: i0.Input }],
4079
- valueChange: [{ type: i0.Output }]
4080
- };
4081
-
4082
- var PaginationComponent = /** @class */ (function () {
4083
- function PaginationComponent() {
4084
- this.literals = {
4085
- en: {
4086
- first: 'First',
4087
- previous: 'Previous',
4088
- next: 'Next',
4089
- last: 'Last'
4090
- },
4091
- es: {
4092
- first: 'Primero',
4093
- previous: 'Anterior',
4094
- next: 'Siguiente',
4095
- last: 'Último'
4096
- }
4097
- };
4098
- this.showPagination = false;
4099
- this.hidePrevious = false;
4100
- this.lastPage = false;
4101
- this.totalPages = 0;
4102
- this.displayNextEllipsis = false;
4103
- this.displayPreviousEllipsis = false;
4104
- this.pages = [];
4105
- this.goToPage = new i0.EventEmitter();
4106
- this.pageSizeChange = new i0.EventEmitter();
4107
- this.lang = languageDetector();
4108
- }
4109
- Object.defineProperty(PaginationComponent.prototype, "lang", {
4110
- get: function () {
4111
- return this._lang;
4112
- },
4113
- set: function (l) {
4114
- if (l === this._lang) {
4115
- return;
4116
- }
4117
- if (Object.keys(this.literals).includes(l)) {
4118
- this._lang = l;
4119
- }
4120
- else {
4121
- this._lang = 'en';
4122
- }
4123
- this.loadLanguage();
4124
- },
4125
- enumerable: false,
4126
- configurable: true
4127
- });
4128
- Object.defineProperty(PaginationComponent.prototype, "paginationInfo", {
4129
- get: function () {
4130
- return this.paginationInfoValue;
4131
- },
4132
- set: function (value) {
4133
- this.paginationInfoValue = value;
4134
- this.syncState();
4135
- },
4136
- enumerable: false,
4137
- configurable: true
4138
- });
4139
- PaginationComponent.prototype.ngOnInit = function () {
4140
- this.calculatePages();
4141
- };
4142
- PaginationComponent.prototype.pageSizeChanged = function (pageSize) {
4143
- this.paginationInfo.pageSize = pageSize;
4144
- this.syncState();
4145
- this.pageSizeChange.emit(pageSize);
4146
- };
4147
- PaginationComponent.prototype.onPage = function (n) {
4148
- this.goToPage.emit(n);
4149
- };
4150
- PaginationComponent.prototype.onFirst = function () {
4151
- this.goToPage.emit(0);
4152
- };
4153
- PaginationComponent.prototype.onLast = function () {
4154
- this.goToPage.emit(this.totalPages - 1);
4155
- };
4156
- PaginationComponent.prototype.onNext = function () {
4157
- var page = (this.paginationInfo.page || 0) + 1;
4158
- this.goToPage.emit(page);
4159
- };
4160
- PaginationComponent.prototype.onPrevious = function () {
4161
- var page = (this.paginationInfo.page || 0) - 1;
4162
- this.goToPage.emit(page);
4163
- };
4164
- PaginationComponent.prototype.syncState = function () {
4165
- this.pages = this.calculatePages();
4166
- this.showPagination =
4167
- this.paginationInfo.total > this.paginationInfo.pageSize;
4168
- this.hidePrevious = this.paginationInfo.page === 0;
4169
- this.lastPage =
4170
- this.paginationInfo.pageSize * (this.paginationInfo.page + 1) >=
4171
- this.paginationInfo.total;
4172
- this.totalPages =
4173
- Math.ceil(this.paginationInfo.total / this.paginationInfo.pageSize) || 0;
4174
- this.displayNextEllipsis = !this.pages.includes(this.totalPages - 1);
4175
- this.displayPreviousEllipsis = !this.pages.includes(0);
4176
- };
4177
- PaginationComponent.prototype.calculatePages = function () {
4178
- var totalPages = Math.ceil(this.paginationInfo.total / this.paginationInfo.pageSize) - 1; // 0-index
4179
- var p = this.paginationInfo.page || 0;
4180
- var pagesToShow = this.paginationInfo.pagesToShow;
4181
- var pages = [];
4182
- pages.push(p);
4183
- var times = pagesToShow - 1;
4184
- for (var i = 0; i < times; i++) {
4185
- if (pages.length < pagesToShow) {
4186
- if (Math.min.apply(Math, __spreadArray([], __read(pages))) > 0) {
4187
- pages.unshift(Math.min.apply(Math, __spreadArray([], __read(pages))) - 1);
4188
- }
4189
- }
4190
- if (pages.length < pagesToShow) {
4191
- if (Math.max.apply(Math, __spreadArray([], __read(pages))) < totalPages) {
4192
- pages.push(Math.max.apply(Math, __spreadArray([], __read(pages))) + 1);
4193
- }
4194
- }
4195
- }
4196
- pages.sort(function (a, b) { return a - b; });
4197
- return pages;
4198
- };
4199
- PaginationComponent.prototype.loadLanguage = function () {
4200
- var l = this.literals[this.lang];
4201
- this.first = l.first;
4202
- this.previous = l.previous;
4203
- this.next = l.next;
4204
- this.last = l.last;
4205
- };
4206
- return PaginationComponent;
4207
- }());
4208
- PaginationComponent.decorators = [
4209
- { type: i0.Component, args: [{
4210
- selector: 'lux-pagination',
4211
- template: "<div class=\"lux-pagination\" *ngIf=\"showPagination\">\n <ng-container *ngIf=\"!hidePrevious\">\n <a\n luxTooltip\n [content]=\"first\"\n placement=\"top\"\n delay=\"500\"\n (click)=\"onFirst()\"\n [ngClass]=\"{\n enabledFirstLast: !hidePrevious\n }\"\n class=\"button-pagination icon arrow-left-end\"\n ></a>\n <a\n luxTooltip\n [content]=\"previous\"\n placement=\"top\"\n delay=\"500\"\n (click)=\"onPrevious()\"\n [ngClass]=\"{\n enabledFirstLast: !hidePrevious\n }\"\n class=\"button-pagination icon arrow-left\"\n ></a>\n </ng-container>\n\n <span class=\"ellipsis\" *ngIf=\"displayPreviousEllipsis\">...</span>\n\n <ng-container *ngFor=\"let pageNum of pages\">\n <a\n placement=\"top\"\n delay=\"500\"\n [ngClass]=\"{\n disabled: pageNum === paginationInfo.page,\n enabled: pageNum !== paginationInfo.page\n }\"\n class=\"button-pagination\"\n (click)=\"onPage(pageNum)\"\n >{{ pageNum + 1 }}</a\n >\n </ng-container>\n\n <span class=\"ellipsis\" *ngIf=\"displayNextEllipsis\">...</span>\n\n <ng-container *ngIf=\"!lastPage\">\n <a\n luxTooltip\n [content]=\"next\"\n placement=\"top\"\n delay=\"500\"\n (click)=\"onNext()\"\n [ngClass]=\"{\n enabledFirstLast: !lastPage\n }\"\n class=\"button-pagination icon arrow-right\"\n ></a>\n <a\n luxTooltip\n [content]=\"last\"\n placement=\"top\"\n delay=\"500\"\n (click)=\"onLast()\"\n [ngClass]=\"{\n enabledFirstLast: !lastPage\n }\"\n class=\"button-pagination icon arrow-right-end\"\n ></a>\n </ng-container>\n</div>\n",
4212
- styles: [":focus{z-index:1}input,select,textarea{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057);margin:0;margin:var(--lux-input-margin, 0rem);padding:0 .5rem;padding:var(--lux-input-padding, 0rem .5rem)}.alert{padding:.2rem 2rem;background:#fe2e2e;background:var(--lux-alert-background, #fe2e2e);color:#fff;color:var(--lux-alert-color, white);font-family:Consolas,monospace;width:45%;margin-right:1rem;display:inline-block}.symbol{display:inline-block;align-items:baseline;padding:0 .5rem;margin-bottom:0;font-weight:400;color:default;color:var(--lux-symbol-color, default);text-align:center;white-space:nowrap;background:default;background:var(--lux-symbol-background, default);font-size:1rem;font-size:var(--lux-symbol-font-size, 1rem)}.bordered,.symbol{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057)}.rounded,.rounded-right,.rounded-middle,.rounded-left{border-radius:.25rem;border-radius:var(--lux-border-radius, .25rem)}.rounded-left{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-middle{border-radius:0}.rounded-right{border-top-left-radius:0;border-bottom-left-radius:0}.prefix{border-right:none}.infix{border-left:none;border-right:none}.postfix{border-left:none;display:flex;align-items:center}.lux-pagination{display:flex;flex-direction:row;margin:2% 0;width:100%;background:white;align-items:center}.disabled{cursor:not-allowed;border:1px solid #325c81;border:var(--lux-pagination-disabled-border, 1px solid #325c81);border-radius:10%;border-radius:var(--lux-pagination-disabled-border-radius, 10%);padding:1%;margin:0 .7%;color:#fff;color:var(--lux-pagination-disabled-color, white);background-color:#325c81;background-color:var(--lux-pagination-disabled-background-color, #325c81);text-decoration:none;pointer-events:none}.enabled{border:1px solid #cfcfcf;border:var(--lux-pagination-enabled-border, 1px solid #cfcfcf);border-radius:10%;border-radius:var(--lux-pagination-enabled-border-radius, 10%);padding:1%;margin:0 .7%;color:#325c81;color:var(--lux-pagination-enabled-color, #325c81);width:-webkit-min-content;width:-moz-min-content;width:min-content;cursor:pointer}.enabledFirstLast{border:1px solid #cfcfcf;border-radius:10%;padding:1%;color:#325c81;margin:0 .7%;width:-webkit-min-content;width:-moz-min-content;width:min-content;cursor:pointer}.ellipsis{margin:0 .5rem;padding:0;color:#325c81;width:-webkit-min-content;width:-moz-min-content;width:min-content}.button-pagination{width:1em;width:var(--lux-pagination-button-width, 1em);height:1.2em;height:var(--lux-pagination-button-height, 1.2em);font-size:80%;font-size:var(--lux-pagination-font-size, 80%);text-align:center}.icon{background-size:1.3em 1.4em;background-position:center;background-repeat:no-repeat}.arrow-right{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2268%22 height%3D%2248%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cg%3E %3Ctitle%3Ebackground%3C%2Ftitle%3E %3Crect fill%3D%22none%22 id%3D%22canvas_background%22 height%3D%22402%22 width%3D%221082%22 y%3D%22-1%22 x%3D%22-1%22%2F%3E %3C%2Fg%3E %3Cg%3E %3Ctitle%3ELayer 1%3C%2Ftitle%3E %3Cpolygon fill%3D%22%23325C81%22 id%3D%22svg_2%22 points%3D%2221.8%2C45.7 10.4%2C44.3 30.8%2C24 10.4%2C3.7 21.8%2C2.3 43.5%2C24 %22%2F%3E %3C%2Fg%3E%3C%2Fsvg%3E\");background-position:.4em}.arrow-left{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2268%22 height%3D%2248%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cg%3E %3Ctitle%3Ebackground%3C%2Ftitle%3E %3Crect fill%3D%22none%22 id%3D%22canvas_background%22 height%3D%22402%22 width%3D%221082%22 y%3D%22-1%22 x%3D%22-1%22%2F%3E %3C%2Fg%3E %3Cg%3E %3Ctitle%3ELayer 1%3C%2Ftitle%3E %3Cpolygon fill%3D%22%23325C81%22 id%3D%22svg_2%22 points%3D%2221.8%2C45.7 10.4%2C44.3 30.8%2C24 10.4%2C3.7 21.8%2C2.3 43.5%2C24 %22%2F%3E %3C%2Fg%3E%3C%2Fsvg%3E\");transform:rotate(180deg);background-position:.4em}.arrow-right-end{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2268%22 height%3D%2248%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cg%3E %3Ctitle%3Ebackground%3C%2Ftitle%3E %3Crect fill%3D%22none%22 id%3D%22canvas_background%22 height%3D%22402%22 width%3D%221082%22 y%3D%22-1%22 x%3D%22-1%22%2F%3E %3C%2Fg%3E %3Cg%3E %3Ctitle%3ELayer 1%3C%2Ftitle%3E %3Cpolygon fill%3D%22%23325C81%22 id%3D%22svg_2%22 points%3D%2221.8%2C45.7 10.4%2C44.3 30.8%2C24 10.4%2C3.7 21.8%2C2.3 43.5%2C24 %22%2F%3E %3Cpolygon fill%3D%22%23325C81%22 id%3D%22svg_3%22 points%3D%2241.8%2C45.7 30.4%2C44.3 50.8%2C24 30.4%2C3.7 41.8%2C2.3 63.5%2C24 %22%2F%3E %3C%2Fg%3E%3C%2Fsvg%3E\");background-position:.1em}.arrow-left-end{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2268%22 height%3D%2248%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cg%3E %3Ctitle%3Ebackground%3C%2Ftitle%3E %3Crect fill%3D%22none%22 id%3D%22canvas_background%22 height%3D%22402%22 width%3D%221082%22 y%3D%22-1%22 x%3D%22-1%22%2F%3E %3C%2Fg%3E %3Cg%3E %3Ctitle%3ELayer 1%3C%2Ftitle%3E %3Cpolygon fill%3D%22%23325C81%22 id%3D%22svg_2%22 points%3D%2221.8%2C45.7 10.4%2C44.3 30.8%2C24 10.4%2C3.7 21.8%2C2.3 43.5%2C24 %22%2F%3E %3Cpolygon fill%3D%22%23325C81%22 id%3D%22svg_3%22 points%3D%2241.8%2C45.7 30.4%2C44.3 50.8%2C24 30.4%2C3.7 41.8%2C2.3 63.5%2C24 %22%2F%3E %3C%2Fg%3E%3C%2Fsvg%3E\");background-position:.1em;transform:rotate(180deg)}@media only screen and (min-width: 300px) and (max-width: 500px){.arrow-right{background-position:.2em}.arrow-left{background-position:.2em}.arrow-right-end{background-position:0em}.arrow-left-end{background-position:0em}}@media only screen and (min-width: 500px) and (max-width: 850px){.arrow-right{background-position:.3em}.arrow-left{background-position:.3em}.arrow-right-end{background-position:0em}.arrow-left-end{background-position:0em}}@media only screen and (min-width: 900px){.arrow-right{background-position:.2em}.arrow-left{background-position:.2em}.arrow-right-end{background-position:0em}.arrow-left-end{background-position:0em}}\n"]
4213
- },] }
4214
- ];
4215
- PaginationComponent.ctorParameters = function () { return []; };
4216
- PaginationComponent.propDecorators = {
4217
- goToPage: [{ type: i0.Output }],
4218
- pageSizeChange: [{ type: i0.Output }],
4219
- lang: [{ type: i0.Input }],
4220
- paginationInfo: [{ type: i0.Input }]
4221
- };
4222
-
4223
- var RadiogroupComponent = /** @class */ (function () {
4224
- function RadiogroupComponent() {
4225
- this.touched = false;
4226
- this.name = 'radiogroup1';
4227
- this.disabled = false;
4228
- this.readonly = false;
4229
- this.required = false;
4230
- this.itemsChange = new i0.EventEmitter();
4231
- this.valueChange = new i0.EventEmitter();
4232
- this._value = undefined;
4233
- this._items = [];
4234
- // ControlValueAccessor Interface
4235
- this.onChange = function (value) { };
4236
- this.onTouched = function () { };
4237
- }
4238
- Object.defineProperty(RadiogroupComponent.prototype, "items", {
4239
- get: function () {
4240
- return this._items;
4241
- },
4242
- set: function (col) {
4243
- var _this = this;
4244
- this._items = (col || []).map(function (it, index) { return _this.ensureHasUniqueName(it, index); });
4245
- this.itemsChange.emit(col);
4246
- },
4247
- enumerable: false,
4248
- configurable: true
4249
- });
4250
- Object.defineProperty(RadiogroupComponent.prototype, "value", {
4251
- get: function () {
4252
- return this._value;
4253
- },
4254
- set: function (v) {
4255
- if (v === this._value) {
4256
- return;
4257
- }
4258
- var initialAndEmpty = isInitialAndEmpty(this._value, v);
4259
- this._value = v;
4260
- this.onChange(v);
4261
- if (!initialAndEmpty) {
4262
- this.valueChange.emit(v);
4263
- }
4264
- },
4265
- enumerable: false,
4266
- configurable: true
4267
- });
4268
- RadiogroupComponent.prototype.writeValue = function (value) {
4269
- this.value = value;
4270
- };
4271
- RadiogroupComponent.prototype.registerOnChange = function (onChange) {
4272
- this.onChange = onChange;
4273
- };
4274
- RadiogroupComponent.prototype.registerOnTouched = function (onTouched) {
4275
- this.onTouched = onTouched;
4276
- };
4277
- RadiogroupComponent.prototype.markAsTouched = function () {
4278
- if (!this.touched) {
4279
- this.onTouched();
4280
- this.touched = true;
4281
- }
4282
- };
4283
- RadiogroupComponent.prototype.setDisabledState = function (disabled) {
4284
- this.disabled = disabled;
4285
- };
4286
- // End ControlValueAccessor Interface
4287
- // Validator interface
4288
- RadiogroupComponent.prototype.registerOnValidatorChange = function () { };
4289
- RadiogroupComponent.prototype.validate = function (control) {
4290
- var value = control.value;
4291
- if (this.required &&
4292
- (value === '' || value === null || value === undefined)) {
4293
- return { required: { value: value, reason: 'Required field.' } };
4294
- }
4295
- return null;
4296
- };
4297
- // End of Validator interface
4298
- RadiogroupComponent.prototype.setValue = function (event, item) {
4299
- if (!this.disabled && !this.readonly) {
4300
- this.value = item.value;
4301
- this.markAsTouched();
4302
- }
4303
- event.preventDefault();
4304
- };
4305
- RadiogroupComponent.prototype.ensureHasUniqueName = function (item, index) {
4306
- if (!item.name) {
4307
- item.name = this.name + "_" + index;
4308
- }
4309
- return item;
4310
- };
4311
- return RadiogroupComponent;
4312
- }());
4313
- RadiogroupComponent.decorators = [
4314
- { type: i0.Component, args: [{
4315
- selector: 'lux-radiogroup',
4316
- template: "<div class=\"radiogroup\"\n [class.disabled]=\"disabled || readonly\"\n >\n <ng-container *ngFor=\"let item of items; let first=first; let last=last\">\n <div [class.radio-start]=\"first\"\n [class.radio-end]=\"last\"\n class=\"radio-item\"\n [class.selected]=\"item.value === value\"\n (click)=\"setValue($event, item)\"\n >\n <input [id]=\"item.name\"\n type=\"radio\"\n [name]=\"name\"\n [attr.disabled]=\"disabled || null\"\n [attr.readonly]=\"readonly || null\"\n [value]=\"item.value\">\n <label [for]=\"item.name\"\n class=\"unselectable\"\n >{{ item.label }}</label>\n </div>\n</ng-container>\n</div>\n",
4317
- providers: [
4318
- {
4319
- provide: forms.NG_VALUE_ACCESSOR,
4320
- multi: true,
4321
- useExisting: i0.forwardRef(function () { return RadiogroupComponent; })
4322
- },
4323
- {
4324
- provide: forms.NG_VALIDATORS,
4325
- multi: true,
4326
- useExisting: i0.forwardRef(function () { return RadiogroupComponent; })
4327
- }
4328
- ],
4329
- styles: [":focus{z-index:1}input,select,textarea{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057);margin:0;margin:var(--lux-input-margin, 0rem);padding:0 .5rem;padding:var(--lux-input-padding, 0rem .5rem)}.alert{padding:.2rem 2rem;background:#fe2e2e;background:var(--lux-alert-background, #fe2e2e);color:#fff;color:var(--lux-alert-color, white);font-family:Consolas,monospace;width:45%;margin-right:1rem;display:inline-block}.symbol{display:inline-block;align-items:baseline;padding:0 .5rem;margin-bottom:0;font-weight:400;color:default;color:var(--lux-symbol-color, default);text-align:center;white-space:nowrap;background:default;background:var(--lux-symbol-background, default);font-size:1rem;font-size:var(--lux-symbol-font-size, 1rem)}.bordered,.symbol{border:1px solid #495057;border:var(--lux-input-border, 1px solid) var(--lux-input-border-color, #495057)}.rounded,.rounded-right,.rounded-middle,.rounded-left{border-radius:.25rem;border-radius:var(--lux-border-radius, .25rem)}.rounded-left{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-middle{border-radius:0}.rounded-right{border-top-left-radius:0;border-bottom-left-radius:0}.prefix{border-right:none}.infix{border-left:none;border-right:none}.postfix{border-left:none;display:flex;align-items:center}.radiogroup{display:flex}.radio-item{border-radius:0;border:1px solid #ccc;padding:0 .5rem;padding:var(--lux-radiogroup-padding, 0rem .5rem)}.radio-item input{display:none}.radio-item label{color:initial;color:var(--lux-radiogroup-color, initial);font-size:initial;font-size:var(--lux-radiogroup-font-size, initial);margin-top:.3rem;margin-bottom:.3rem}.radio-item.selected{background-color:#2e2eac;background-color:var(--lux-radiogroup-selected-background-color, #2e2eac)}.radio-item.selected label{font-size:initial;font-size:var(--lux-radiogroup-font-size, initial);color:#fff;color:var(--lux-radiogroup-selected-color, white)}.radio-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.radio-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.disabled .radio-item{background-color:#f0f0f0;color:#444}.disabled .selected{font-size:initial;font-size:var(--lux-radiogroup-selected-disabled-font-size, initial);color:#fff;color:var(--lux-radiogroup-selected-disabled-color, white);background-color:#9898ec;background-color:var(--lux-radiogroup-selected-disabled-background-color, #9898ec)}.unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}\n"]
4330
- },] }
4331
- ];
4332
- RadiogroupComponent.ctorParameters = function () { return []; };
4333
- RadiogroupComponent.propDecorators = {
4334
- name: [{ type: i0.Input }],
4335
- disabled: [{ type: i0.Input }],
4336
- readonly: [{ type: i0.Input }],
4337
- required: [{ type: i0.Input }],
4338
- items: [{ type: i0.Input }],
4339
- itemsChange: [{ type: i0.Output }],
4340
- value: [{ type: i0.Input }],
4341
- valueChange: [{ type: i0.Output }]
4342
- };
4343
-
4344
- var sequencer = 0;
4345
- var SelectComponent = /** @class */ (function () {
4346
- function SelectComponent() {
4347
- this.id = 'stringList' + sequencer++;
4348
- this.disabled = false;
4349
- this.required = false;
4350
- /** Allow multiple elements */
4351
- this.multiple = true;
4352
- this.value = [];
4353
- this.valueChange = new i0.EventEmitter();
4354
- this.placeholder = 'Add new';
4355
- /** If set, check there is no duplicates in the data. */
4356
- this.unique = true;
4357
- /** Validation function for new items. Returns error or null if valid */
4358
- this.validateItem = function (_) { return null; };
4359
- this.newEntry = '';
4360
- this.error = null;
4361
- this.isValidNewEntry = false;
4362
- this.touched = false;
4363
- // ControlValueAccessor Interface
4364
- this.onChange = function (value) { };
4365
- this.onTouched = function () { };
4366
- }
4367
- SelectComponent.prototype.writeValue = function (value) {
4368
- this.value = value;
4369
- };
4370
- SelectComponent.prototype.registerOnChange = function (onChange) {
4371
- this.onChange = onChange;
4372
- };
4373
- SelectComponent.prototype.registerOnTouched = function (onTouched) {
4374
- this.onTouched = onTouched;
4375
- };
4376
- SelectComponent.prototype.markAsTouched = function () {
4377
- if (!this.touched) {
4378
- this.onTouched();
4379
- this.touched = true;
4380
- }
4381
- };
4382
- SelectComponent.prototype.setDisabledState = function (disabled) {
4383
- this.disabled = disabled;
4384
- };
4385
- // End ControlValueAccessor Interface
4386
- // Validator interface
4387
- SelectComponent.prototype.registerOnValidatorChange = function () { };
4388
- SelectComponent.prototype.validate = function (control) {
4389
- var value = control.value;
4390
- if (this.required &&
4391
- (value === '' || value === null || value === undefined)) {
4392
- return { required: { value: value, reason: 'Required field.' } };
4393
- }
4394
- return null;
4395
- };
4396
- Object.defineProperty(SelectComponent.prototype, "canAdd", {
4397
- // End of Validator interface
4398
- get: function () {
4399
- return this.multiple || this.value.length === 0;
4400
- },
4401
- enumerable: false,
4402
- configurable: true
4403
- });
4404
- SelectComponent.prototype.add = function (val) {
4405
- this.value.push(val);
4406
- this.newEntry = '';
4407
- this.markAsTouched();
4408
- this.valueChange.emit(this.value);
4409
- };
4410
- SelectComponent.prototype.remove = function (index) {
4411
- if (this.value.length > index) {
4412
- this.value.splice(index, 1);
4413
- this.markAsTouched();
4414
- this.valueChange.emit(this.value);
4415
- }
4416
- };
4417
- SelectComponent.prototype.onKeyPress = function (event) {
4418
- if (event.key === 'Enter' && !this.error && this.newEntry !== '') {
4419
- // Add on pressing Enter/Return
4420
- this.markAsTouched();
4421
- this.add(this.newEntry);
4422
- }
4423
- };
4424
- SelectComponent.prototype.onChangeNewEntry = function (newValue) {
4425
- this.markAsTouched();
4426
- if (!newValue) {
4427
- this.isValidNewEntry = false;
4428
- this.error = null;
4429
- return;
4430
- }
4431
- if (this.unique) {
4432
- var found = (this.value || []).find(function (it) { return it === newValue; });
4433
- this.isValidNewEntry = !found;
4434
- this.error = found
4435
- ? "Value '" + newValue + "' is already in. Cannot add duplicates."
4436
- : null;
4437
- if (!this.isValidNewEntry) {
4438
- return;
4439
- }
4440
- }
4441
- this.error = this.validateItem(newValue);
4442
- this.isValidNewEntry = !this.error;
4443
- };
4444
- return SelectComponent;
4445
- }());
4446
- SelectComponent.decorators = [
4447
- { type: i0.Component, args: [{
4448
- selector: 'lux-select',
4449
- template: "<div class=\"lux-select\">\n <ul class=\"list\">\n <li *ngFor=\"let item of value; let i = index\">\n <span>{{ item }}</span>\n <button *ngIf=\"!disabled\"\n class=\"remove\"\n type=\"button\"\n (click)=\"remove(i)\"\n [attr.aria-label]=\"'Remove ' + item\"\n >Remove</button>\n </li>\n </ul>\n <div class=\"add-new-item\" *ngIf=\"!disabled\">\n <lux-input\n id=\"{{ id + 'addNew' }}\"\n type=\"string\"\n [placeholder]=\"placeholder\"\n [attr.aria-label]=\"placeholder\"\n [disabled]=\"disabled\"\n [(value)]=\"newEntry\"\n (keyPress)=\"onKeyPress($event)\"\n (valueChange)=\"onChangeNewEntry($event)\"\n >\n </lux-input>\n <div *ngIf=\"canAdd\">\n <button *ngIf=\"isValidNewEntry\" type=\"button\" (click)=\"add(newEntry)\">Add</button>\n </div>\n <div class=\"error\">\n {{ error }}\n </div>\n </div>\n</div>\n",
4450
- providers: [
4451
- {
4452
- provide: forms.NG_VALUE_ACCESSOR,
4453
- multi: true,
4454
- useExisting: i0.forwardRef(function () { return SelectComponent; })
4455
- },
4456
- {
4457
- provide: forms.NG_VALIDATORS,
4458
- multi: true,
4459
- useExisting: i0.forwardRef(function () { return SelectComponent; })
4460
- }
4461
- ],
4462
- styles: [".lux-select{margin-bottom:.5em}.lux-select .list{margin:1em;padding-bottom:.2em;list-style-type:square}.lux-select .list span{margin-bottom:.3em}.remove{margin-left:2em;font-size:.65em;color:#b22222;background:transparent;border:2px solid #BBB}.add-new-item{display:inline-flex;margin-left:2.2em;height:1.6em}.error{margin:.5em 0;color:#b22222}\n"]
4463
- },] }
4464
- ];
4465
- SelectComponent.ctorParameters = function () { return []; };
4466
- SelectComponent.propDecorators = {
4467
- id: [{ type: i0.Input }],
4468
- disabled: [{ type: i0.Input }],
4469
- required: [{ type: i0.Input }],
4470
- multiple: [{ type: i0.Input }],
4471
- value: [{ type: i0.Input }],
4472
- valueChange: [{ type: i0.Output }],
4473
- placeholder: [{ type: i0.Input }],
4474
- unique: [{ type: i0.Input }],
4475
- validateItem: [{ type: i0.Input }]
4476
- };
4477
-
4478
- var VoiceRecognitionDirective = /** @class */ (function () {
4479
- function VoiceRecognitionDirective(el, renderer) {
4480
- this.el = el;
4481
- this.renderer = renderer;
4482
- this.isRecognizing = false;
4483
- var speechRecognition = window.webkitSpeechRecognition;
4484
- if (speechRecognition) {
4485
- this.recognition = new speechRecognition();
4486
- }
4487
- }
4488
- VoiceRecognitionDirective.prototype.ngOnInit = function () {
4489
- var _this = this;
4490
- if (this.recognition) {
4491
- // API is available
4492
- this.recognition.lang = this.language || window.navigator.language;
4493
- this.recognition.interimResults = false;
4494
- this.recognition.maxAlternatives = 1;
4495
- // Add mic icon
4496
- this.mic = document.createElement('div');
4497
- this.mic.setAttribute('class', 'lux-microphone');
4498
- var parent = this.el.nativeElement.parentElement;
4499
- parent.appendChild(this.mic);
4500
- // Add event handlers
4501
- this.mic.onclick = function () { return _this.microphoneClick(); };
4502
- this.recognition.onresult = function (event) { return _this.onRecognized(event); };
4503
- }
4504
- };
4505
- VoiceRecognitionDirective.prototype.microphoneClick = function () {
4506
- if (this.isRecognizing) {
4507
- // stop
4508
- this.isRecognizing = false;
4509
- this.renderer.removeClass(this.mic, 'lux-recording');
4510
- this.recognition.abort();
4511
- }
4512
- else {
4513
- // start
4514
- this.el.nativeElement.value = getRecordingMessage(this.language);
4515
- this.isRecognizing = true;
4516
- this.renderer.addClass(this.mic, 'lux-recording');
4517
- this.recognition.start();
4518
- }
4519
- };
4520
- VoiceRecognitionDirective.prototype.onRecognized = function (event) {
4521
- var recognizedText = event.results[0][0].transcript;
4522
- this.isRecognizing = false;
4523
- this.el.nativeElement.value = recognizedText;
4524
- this.renderer.removeClass(this.mic, 'lux-recording');
4525
- };
4526
- return VoiceRecognitionDirective;
4527
- }());
4528
- VoiceRecognitionDirective.decorators = [
4529
- { type: i0.Directive, args: [{
4530
- selector: '[luxVoiceRecognition]'
4531
- },] }
4532
- ];
4533
- VoiceRecognitionDirective.ctorParameters = function () { return [
4534
- { type: i0.ElementRef },
4535
- { type: i0.Renderer2 }
4536
- ]; };
4537
- VoiceRecognitionDirective.propDecorators = {
4538
- language: [{ type: i0.Input }]
4539
- };
4540
- var getRecordingMessage = function (lang) {
4541
- switch (lang.toLowerCase()) {
4542
- case 'es':
4543
- case 'es-es':
4544
- return 'Grabando...';
4545
- case 'en':
4546
- case 'en-uk':
4547
- case 'en-us':
4548
- default:
4549
- return 'Recording...';
4550
- }
4551
- };
4552
- var ɵ0 = getRecordingMessage;
4553
-
4554
- /* Create a new injection token for injecting the window into a component. */
4555
- var WINDOW = new i0.InjectionToken('WindowToken');
4556
- /* Define abstract class for obtaining reference to the global window object. */
4557
- var WindowRef = /** @class */ (function () {
4558
- function WindowRef() {
4559
- }
4560
- Object.defineProperty(WindowRef.prototype, "nativeWindow", {
4561
- // eslint-disable-next-line @typescript-eslint/ban-types
4562
- get: function () {
4563
- throw new Error('Not implemented.');
4564
- },
4565
- enumerable: false,
4566
- configurable: true
4567
- });
4568
- return WindowRef;
4569
- }());
4570
- /* Define class that implements the abstract class and returns the native window object. */
4571
- var BrowserWindowRef = /** @class */ (function (_super) {
4572
- __extends(BrowserWindowRef, _super);
4573
- function BrowserWindowRef() {
4574
- return _super.call(this) || this;
4575
- }
4576
- Object.defineProperty(BrowserWindowRef.prototype, "nativeWindow", {
4577
- // eslint-disable-next-line @typescript-eslint/ban-types
4578
- get: function () {
4579
- return window;
4580
- },
4581
- enumerable: false,
4582
- configurable: true
4583
- });
4584
- return BrowserWindowRef;
4585
- }(WindowRef));
4586
- /* Create an factory function that returns the native window object. */
4587
- // eslint-disable-next-line @typescript-eslint/ban-types
4588
- var windowFactory = function (browserWindowRef, platformId) {
4589
- if (i1.isPlatformBrowser(platformId)) {
4590
- return browserWindowRef.nativeWindow;
4591
- }
4592
- return new Object();
4593
- };
4594
- /* Create a injectable provider for the WindowRef token that uses the BrowserWindowRef class. */
4595
- var browserWindowProvider = {
4596
- provide: WindowRef,
4597
- useClass: BrowserWindowRef
4598
- };
4599
- /* Create an injectable provider that uses the windowFactory function for returning the native window object. */
4600
- var windowProvider = {
4601
- provide: WINDOW,
4602
- useFactory: windowFactory,
4603
- deps: [WindowRef, i0.PLATFORM_ID]
4604
- };
4605
- /* Create an array of providers. */
4606
- var WINDOW_PROVIDERS = [
4607
- browserWindowProvider,
4608
- windowProvider
4609
- ];
4610
-
4611
- var LuxModule = /** @class */ (function () {
4612
- function LuxModule() {
4613
- }
4614
- return LuxModule;
4615
- }());
4616
- LuxModule.decorators = [
4617
- { type: i0.NgModule, args: [{
4618
- declarations: [
4619
- AutocompleteComponent,
4620
- AutocompleteListComponent,
4621
- FilterComponent,
4622
- CheckboxComponent,
4623
- DatetimeComponent,
4624
- InputComponent,
4625
- GeolocationComponent,
4626
- LuxTooltipDirective,
4627
- LuxModalWindowComponent,
4628
- LuxModalBackdropComponent,
4629
- LuxBreadcrumbComponent,
4630
- MapComponent,
4631
- SelectComponent,
4632
- TooltipComponent,
4633
- PaginationComponent,
4634
- RadiogroupComponent,
4635
- VoiceRecognitionDirective
4636
- ],
4637
- entryComponents: [
4638
- LuxModalWindowComponent,
4639
- LuxModalBackdropComponent,
4640
- TooltipComponent
4641
- ],
4642
- providers: [ModalService, TooltipService, WINDOW_PROVIDERS],
4643
- imports: [
4644
- angularResizeEvent.AngularResizedEventModule,
4645
- forms.FormsModule,
4646
- i1$1.HttpClientModule,
4647
- forms.ReactiveFormsModule,
4648
- router.RouterModule,
4649
- i1.CommonModule
4650
- ],
4651
- exports: [
4652
- AutocompleteComponent,
4653
- AutocompleteListComponent,
4654
- FilterComponent,
4655
- CheckboxComponent,
4656
- DatetimeComponent,
4657
- InputComponent,
4658
- GeolocationComponent,
4659
- LuxTooltipDirective,
4660
- LuxBreadcrumbComponent,
4661
- LuxBreadcrumbComponent,
4662
- MapComponent,
4663
- SelectComponent,
4664
- PaginationComponent,
4665
- RadiogroupComponent,
4666
- VoiceRecognitionDirective
4667
- ]
4668
- },] }
4669
- ];
4670
-
4671
- /*
4672
- * Public API Surface of lux
4673
- */
4674
-
4675
- /**
4676
- * Generated bundle index. Do not edit.
4677
- */
4678
-
4679
- exports.AutocompleteComponent = AutocompleteComponent;
4680
- exports.AutocompleteListComponent = AutocompleteListComponent;
4681
- exports.CheckboxComponent = CheckboxComponent;
4682
- exports.FilterComponent = FilterComponent;
4683
- exports.InputComponent = InputComponent;
4684
- exports.LuxBreadcrumbComponent = LuxBreadcrumbComponent;
4685
- exports.LuxModule = LuxModule;
4686
- exports.LuxTooltipDirective = LuxTooltipDirective;
4687
- exports.ModalRef = ModalRef;
4688
- exports.ModalService = ModalService;
4689
- exports.PaginationComponent = PaginationComponent;
4690
- exports.RadiogroupComponent = RadiogroupComponent;
4691
- exports["ɵa"] = DatetimeComponent;
4692
- exports["ɵb"] = RegexpService;
4693
- exports["ɵc"] = GeolocationComponent;
4694
- exports["ɵd"] = ModalStack;
4695
- exports["ɵe"] = LuxModalConfig;
4696
- exports["ɵf"] = GeolocationService;
4697
- exports["ɵg"] = TooltipService;
4698
- exports["ɵh"] = LuxModalWindowComponent;
4699
- exports["ɵi"] = LuxModalBackdropComponent;
4700
- exports["ɵj"] = MapComponent;
4701
- exports["ɵk"] = OpenLayerLoaderService;
4702
- exports["ɵl"] = SelectComponent;
4703
- exports["ɵm"] = TooltipComponent;
4704
- exports["ɵn"] = VoiceRecognitionDirective;
4705
- exports["ɵo"] = WINDOW;
4706
- exports["ɵp"] = WindowRef;
4707
- exports["ɵq"] = BrowserWindowRef;
4708
- exports["ɵr"] = windowFactory;
4709
- exports["ɵs"] = WINDOW_PROVIDERS;
4710
- exports["ɵt"] = ContentRef;
4711
-
4712
- Object.defineProperty(exports, '__esModule', { value: true });
4713
-
4714
- }));
4715
- //# sourceMappingURL=metadev-lux.umd.js.map