1 | import { __values, __decorate, __metadata, __extends, __spread } from 'tslib';
|
2 | import { Injectable, Input, Component, Directive, ElementRef, forwardRef, Output, EventEmitter, ViewChild, Pipe, ViewContainerRef, ComponentFactoryResolver, Injector, NgModule } from '@angular/core';
|
3 | import { CommonModule } from '@angular/common';
|
4 | import { NG_VALUE_ACCESSOR, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
5 | import { Subject } from 'rxjs';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | var RadioService = (function () {
|
13 | function RadioService() {
|
14 | this.listeners = [];
|
15 | }
|
16 | RadioService.prototype.register = function (listener) {
|
17 | this.listeners.push(listener);
|
18 | };
|
19 | RadioService.prototype.cancel = function (radioListener) {
|
20 | var e_1, _a;
|
21 | var i = 0;
|
22 | try {
|
23 | for (var _b = __values(this.listeners), _c = _b.next(); !_c.done; _c = _b.next()) {
|
24 | var listener = _c.value;
|
25 | if (listener === radioListener) {
|
26 | this.listeners.splice(i, 1);
|
27 | }
|
28 | i++;
|
29 | }
|
30 | }
|
31 | catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
32 | finally {
|
33 | try {
|
34 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
35 | }
|
36 | finally { if (e_1) throw e_1.error; }
|
37 | }
|
38 | };
|
39 | RadioService.prototype.notifyObservers = function (radioListener) {
|
40 | var e_2, _a;
|
41 | try {
|
42 | for (var _b = __values(this.listeners), _c = _b.next(); !_c.done; _c = _b.next()) {
|
43 | var listener = _c.value;
|
44 | if (radioListener.getName() === listener.getName()) {
|
45 | listener.notifyRadioChanged(radioListener);
|
46 | }
|
47 | }
|
48 | }
|
49 | catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
50 | finally {
|
51 | try {
|
52 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
53 | }
|
54 | finally { if (e_2) throw e_2.error; }
|
55 | }
|
56 | };
|
57 | RadioService = __decorate([
|
58 | Injectable()
|
59 | ], RadioService);
|
60 | return RadioService;
|
61 | }());
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | var LoadingComponent = (function () {
|
67 | function LoadingComponent() {
|
68 | }
|
69 | __decorate([
|
70 | Input(),
|
71 | __metadata("design:type", Object)
|
72 | ], LoadingComponent.prototype, "ngValue", void 0);
|
73 | LoadingComponent = __decorate([
|
74 | Component({
|
75 | selector: 'loading-component',
|
76 | template: "\n <div class=\"loadable-component\">\n <div class=\"overlay\" [class.loadingHidden]=\"!ngValue\">\n <i class=\"fa fa-refresh fa-spin\"></i>\n </div>\n </div>\n ",
|
77 | styles: [".loadable{position:relative}.loadable-component>.overlay,.loadable>.loading-img,.loadable>.overlay,.overlay-wrapper>.loading-img,.overlay-wrapper>.overlay{position:absolute;top:0;left:0;width:100%;height:100%}.loadable .overlay,.loadable-component .overlay,.overlay-wrapper .overlay{z-index:50;background:rgba(255,255,255,.7);border-radius:3px}.loadable .overlay>.fa,.loadable-component .overlay>.fa,.overlay-wrapper .overlay>.fa{position:absolute;top:50%;left:50%;margin-left:-15px;margin-top:-15px;color:#000;font-size:30px}.loadable .overlay.dark,.overlay-wrapper .overlay.dark{background:rgba(0,0,0,.5)}.overlay{cursor:wait}.overlay.loadingHidden{display:none}"]
|
78 | })
|
79 | ], LoadingComponent);
|
80 | return LoadingComponent;
|
81 | }());
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | var LoadableDirective = (function () {
|
90 | function LoadableDirective(el) {
|
91 | this.el = el;
|
92 | this.elementRef = el.nativeElement;
|
93 | }
|
94 |
|
95 | LoadableDirective.prototype.ngAfterContentInit = function () {
|
96 |
|
97 |
|
98 |
|
99 | var template = "\n <div class=\"loadingHidden overlay\">\n <i class=\"fa fa-refresh fa-spin\"></i>\n </div>\n ";
|
100 | jQuery(this.elementRef).addClass('loadable');
|
101 | jQuery(this.elementRef).append(template);
|
102 | };
|
103 | LoadableDirective.prototype.ngOnChanges = function (simpleChange) {
|
104 | if (this.loading) {
|
105 | jQuery(this.elementRef).children('.overlay').removeClass('loadingHidden');
|
106 | }
|
107 | else {
|
108 | jQuery(this.elementRef).children('.overlay').addClass('loadingHidden');
|
109 | }
|
110 | };
|
111 | __decorate([
|
112 | Input('loadable'),
|
113 | __metadata("design:type", Boolean)
|
114 | ], LoadableDirective.prototype, "loading", void 0);
|
115 | LoadableDirective = __decorate([
|
116 | Directive({
|
117 | selector: '[loadable]'
|
118 | }),
|
119 | __metadata("design:paramtypes", [ElementRef])
|
120 | ], LoadableDirective);
|
121 | return LoadableDirective;
|
122 | }());
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | var RadioComponent = (function () {
|
128 |
|
129 |
|
130 | function RadioComponent(radioService, element) {
|
131 | this.radioService = radioService;
|
132 | this.element = element;
|
133 | this.width = '12';
|
134 | this.disabled = false;
|
135 | this.required = false;
|
136 | this.readonly = false;
|
137 | this.hasError = false;
|
138 | this.simpleMode = true;
|
139 | this.isChecked = false;
|
140 | }
|
141 | RadioComponent_1 = RadioComponent;
|
142 | RadioComponent.prototype.register = function () {
|
143 | this.radioService.register(this);
|
144 | };
|
145 | RadioComponent.prototype.notifyObservers = function () {
|
146 | this.radioService.notifyObservers(this);
|
147 | };
|
148 | RadioComponent.prototype.setValueFromComponent = function (v) {
|
149 | this.ngValue = v;
|
150 | this.onChangeCallback(v);
|
151 | };
|
152 | RadioComponent.prototype.setValueFromParent = function (v) {
|
153 | this.ngValue = v;
|
154 | this.refreshRadio();
|
155 | };
|
156 |
|
157 | RadioComponent.prototype.writeValue = function (v) {
|
158 | this.setValueFromParent(v);
|
159 | };
|
160 |
|
161 | RadioComponent.prototype.registerOnChange = function (fn) {
|
162 | this.onChangeCallback = fn;
|
163 | };
|
164 |
|
165 | RadioComponent.prototype.registerOnTouched = function (fn) {
|
166 | this.onTouchedCallback = fn;
|
167 | };
|
168 |
|
169 |
|
170 | RadioComponent.prototype.ngAfterContentInit = function () {
|
171 | if (this.width && this.width.substring(0, 3) === 'col') {
|
172 | this.simpleMode = false;
|
173 | }
|
174 | this.register();
|
175 | this.refreshRadio();
|
176 | };
|
177 | RadioComponent.prototype.setInputWidth = function (width) {
|
178 | this.width = width;
|
179 | };
|
180 | RadioComponent.prototype.getWidth = function () {
|
181 | return this.width;
|
182 | };
|
183 |
|
184 |
|
185 | RadioComponent.prototype.notifyRadioChanged = function (radioListener) {
|
186 | this.isChecked = radioListener === this;
|
187 |
|
188 | if (this.isChecked) {
|
189 | this.ngValue = this.value;
|
190 | this.setValueFromComponent(this.ngValue);
|
191 | }
|
192 | };
|
193 |
|
194 | RadioComponent.prototype.getName = function () {
|
195 | return this.name;
|
196 | };
|
197 | RadioComponent.prototype.radioButtonClicked = function (event) {
|
198 | if (this.disabled) {
|
199 | return;
|
200 | }
|
201 | this.radioService.notifyObservers(this);
|
202 | };
|
203 | RadioComponent.prototype.refreshRadio = function () {
|
204 | if (this.ngValue === this.value) {
|
205 | this.radioService.notifyObservers(this);
|
206 | }
|
207 | };
|
208 | var RadioComponent_1;
|
209 | __decorate([
|
210 | Input(),
|
211 | __metadata("design:type", Object)
|
212 | ], RadioComponent.prototype, "width", void 0);
|
213 | __decorate([
|
214 | Input(),
|
215 | __metadata("design:type", String)
|
216 | ], RadioComponent.prototype, "label", void 0);
|
217 | __decorate([
|
218 | Input(),
|
219 | __metadata("design:type", String)
|
220 | ], RadioComponent.prototype, "name", void 0);
|
221 | __decorate([
|
222 | Input(),
|
223 | __metadata("design:type", String)
|
224 | ], RadioComponent.prototype, "value", void 0);
|
225 | __decorate([
|
226 | Input(),
|
227 | __metadata("design:type", Object)
|
228 | ], RadioComponent.prototype, "disabled", void 0);
|
229 | __decorate([
|
230 | Input(),
|
231 | __metadata("design:type", Object)
|
232 | ], RadioComponent.prototype, "required", void 0);
|
233 | __decorate([
|
234 | Input(),
|
235 | __metadata("design:type", Object)
|
236 | ], RadioComponent.prototype, "readonly", void 0);
|
237 | __decorate([
|
238 | Input(),
|
239 | __metadata("design:type", Object)
|
240 | ], RadioComponent.prototype, "hasError", void 0);
|
241 | __decorate([
|
242 | Input(),
|
243 | __metadata("design:type", String)
|
244 | ], RadioComponent.prototype, "message", void 0);
|
245 | RadioComponent = RadioComponent_1 = __decorate([
|
246 | Component({
|
247 | selector: 'radio-component',
|
248 | template: "<div class = \"form-group checkbox-group {{simpleMode ? 'col-sm-'+width : width}}\">\n <div [ngClass]=\"{'has-error':hasError}\">\n <label class=\"control-label\">{{(label != '' && label != null && required) ? label + ' *': label}}</label>\n <span *ngIf=\"message != null\" style=\"display:block;font-style:italic;\"><span [ngClass]=\"{'text-danger':hasError}\">{{message}}</span></span>\n\n <div class=\"radio-button-flat component-radio radio-default\">\n <button name=\"name\" (click)=\"radioButtonClicked($event)\" [ngClass]=\"{'radio-selected': isChecked, 'radio-disabled' : disabled}\" [disabled]=\"readonly\">\n <div class=\"circle-checked\"></div>\n </button>\n\n <span [ngClass]=\"{'faa-parent':true, 'animated-hover':true, 'text-danger':hasError}\">\n <!--\n ng-content : contenu html inject\u00E9 provenant du innerHTML du composant parent\n <radio-component ...> Radio val <strong>1</strong> </radio-component>\n => ici, ng-content = \"Radio val <strong>1</strong>\"\n -->\n <ng-content></ng-content>\n <!--label *ngIf=\"(label == '' || label == null) && required\">*</label-->\n </span>\n\n\n </div>\n </div>\n</div>\n",
|
249 | providers: [{
|
250 | provide: NG_VALUE_ACCESSOR,
|
251 | useExisting: forwardRef(function () { return RadioComponent_1; }),
|
252 | multi: true
|
253 | }],
|
254 | styles: [".component-radio{position:relative}.component-radio button{position:absolute;display:inline-block;border-radius:50%;top:4px;height:20px;width:20px;outline:0;border:4px solid gray;background-color:#fff;content:' '}.component-radio button:focus{border:4px solid gray}.component-radio button.radio-selected{background:#fff}.component-radio button.radio-disabled{background:gray}.component-radio button>.circle-checked{position:absolute;top:3px;left:3px;width:6px;height:6px;background:gray;border-radius:50%;margin:0;padding:0;display:none}.component-radio button.radio-selected>.circle-checked{display:block}.component-radio>span{display:block;margin-left:25px;padding-top:4px;padding-bottom:4px}", ".component-radio.radio-default button{background-color:#fff;border-color:#ccc}.component-radio.radio-default button:focus{border-color:#3c8dbc}.component-radio.radio-default button.radio-selected{background-color:#fff;border-color:#3c8dbc}.component-radio.radio-default button.radio-selected:hover>.circle-checked,.component-radio.radio-default button.radio-selected>.circle-checked{background-color:#3c8dbc}.component-radio.radio-default button:hover>.circle-checked{display:block;background-color:#ccc}.component-radio.radio-default button.radio-disabled,.component-radio.radio-default button.radio-disabled.radio-selected,.component-radio.radio-default button.radio-disabled:focus{background-color:#fff;border-color:#eee}.component-radio.radio-default button.radio-disabled.radio-selected:hover>.circle-checked,.component-radio.radio-default button.radio-disabled.radio-selected>.circle-checked{background-color:#eee}.component-radio.radio-default button.radio-disabled:hover>.circle-checked{background-color:#ccc}.component-radio.radio-default>label{color:#555;line-height:0}.component-radio.radio-default>button.radio-disabled+label{color:#999}"]
|
255 | }),
|
256 | __metadata("design:paramtypes", [RadioService, ElementRef])
|
257 | ], RadioComponent);
|
258 | return RadioComponent;
|
259 | }());
|
260 |
|
261 |
|
262 |
|
263 |
|
264 | var DateComponent = (function () {
|
265 | function DateComponent(element) {
|
266 | this.element = element;
|
267 | this.width = '12';
|
268 | this.time = false;
|
269 | this.month = false;
|
270 | this.required = false;
|
271 | this.readonly = false;
|
272 | this.hasError = false;
|
273 | this.allowInputToggle = true;
|
274 | this.simpleMode = true;
|
275 | }
|
276 | DateComponent_1 = DateComponent;
|
277 | DateComponent.prototype.onChange = function ($event) {
|
278 | this.setValueFromDatepicker(this.innerDate);
|
279 | };
|
280 |
|
281 | DateComponent.prototype.setValueFromParent = function (v) {
|
282 | this.innerDate = v;
|
283 | };
|
284 |
|
285 | DateComponent.prototype.setValueFromDatepicker = function (v) {
|
286 | if (this.onChangeCallback) {
|
287 | this.onChangeCallback(this.innerDate);
|
288 | }
|
289 | };
|
290 | DateComponent.prototype.ngAfterContentInit = function () {
|
291 | if (this.width && this.width.substring(0, 3) === 'col') {
|
292 | this.simpleMode = false;
|
293 | }
|
294 | };
|
295 | DateComponent.prototype.onTouch = function ($event) {
|
296 | this.onTouchedCallback();
|
297 | };
|
298 |
|
299 | DateComponent.prototype.writeValue = function (v) {
|
300 | this.setValueFromParent(v);
|
301 | };
|
302 |
|
303 | DateComponent.prototype.registerOnChange = function (fn) {
|
304 | this.onChangeCallback = fn;
|
305 | };
|
306 |
|
307 | DateComponent.prototype.registerOnTouched = function (fn) {
|
308 | this.onTouchedCallback = fn;
|
309 | };
|
310 | var DateComponent_1;
|
311 | __decorate([
|
312 | Input(),
|
313 | __metadata("design:type", Object)
|
314 | ], DateComponent.prototype, "width", void 0);
|
315 | __decorate([
|
316 | Input(),
|
317 | __metadata("design:type", String)
|
318 | ], DateComponent.prototype, "label", void 0);
|
319 | __decorate([
|
320 | Input(),
|
321 | __metadata("design:type", String)
|
322 | ], DateComponent.prototype, "id", void 0);
|
323 | __decorate([
|
324 | Input(),
|
325 | __metadata("design:type", Object)
|
326 | ], DateComponent.prototype, "time", void 0);
|
327 | __decorate([
|
328 | Input(),
|
329 | __metadata("design:type", Object)
|
330 | ], DateComponent.prototype, "month", void 0);
|
331 | __decorate([
|
332 | Input(),
|
333 | __metadata("design:type", Object)
|
334 | ], DateComponent.prototype, "required", void 0);
|
335 | __decorate([
|
336 | Input(),
|
337 | __metadata("design:type", Object)
|
338 | ], DateComponent.prototype, "readonly", void 0);
|
339 | __decorate([
|
340 | Input(),
|
341 | __metadata("design:type", Object)
|
342 | ], DateComponent.prototype, "hasError", void 0);
|
343 | __decorate([
|
344 | Input(),
|
345 | __metadata("design:type", Object)
|
346 | ], DateComponent.prototype, "allowInputToggle", void 0);
|
347 | __decorate([
|
348 | Input(),
|
349 | __metadata("design:type", String)
|
350 | ], DateComponent.prototype, "message", void 0);
|
351 | DateComponent = DateComponent_1 = __decorate([
|
352 | Component({
|
353 | selector: 'date-component',
|
354 | providers: [{
|
355 | provide: NG_VALUE_ACCESSOR,
|
356 | useExisting: forwardRef(function () { return DateComponent_1; }),
|
357 | multi: true
|
358 | }],
|
359 | template: "<div class = \"form-group {{simpleMode ? 'col-sm-'+width : width}}\">\n<div>\n <label attr.for=\"{{id}}\" class=\"control-label\">{{(required) ? label + ' *': label}}</label>\n <span *ngIf=\"message != null\" style=\"display:block;font-style:italic;\">{{message}}</span>\n\n <datepicker-component\n [(ngModel)]=\"innerDate\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [allowInputToggle]=\"allowInputToggle\"\n [time]=\"time\"\n [month]=\"month\"\n [hasError]=\"hasError\"\n (ngModelChange)=\"onChange($event)\"\n (touchedChange)=\"onTouch($event)\">\n </datepicker-component>\n\n</div>\n</div>\n"
|
360 | }),
|
361 | __metadata("design:paramtypes", [ElementRef])
|
362 | ], DateComponent);
|
363 | return DateComponent;
|
364 | }());
|
365 |
|
366 |
|
367 |
|
368 |
|
369 | var DatePickerComponent = (function () {
|
370 | function DatePickerComponent() {
|
371 | this.time = false;
|
372 | this.month = false;
|
373 | this.required = false;
|
374 | this.readonly = false;
|
375 | this.hasError = false;
|
376 | this.allowInputToggle = true;
|
377 | this.touchedChange = new EventEmitter();
|
378 | this.datepicker = null;
|
379 | this.simpleMode = true;
|
380 | }
|
381 | DatePickerComponent_1 = DatePickerComponent;
|
382 |
|
383 | DatePickerComponent.prototype.setValueFromParent = function (v) {
|
384 | this.innerDate = this.convertToDate(v);
|
385 | if (this.datepicker) {
|
386 | this.datepicker.data('DateTimePicker').date(this.innerDate);
|
387 | }
|
388 | };
|
389 |
|
390 | DatePickerComponent.prototype.setValueFromDatepicker = function (v) {
|
391 | this.innerDate = this.convertToDate(v);
|
392 | if (this.onChangeCallback) {
|
393 | this.onChangeCallback(this.innerDate);
|
394 | }
|
395 | };
|
396 | DatePickerComponent.prototype.ngAfterViewInit = function () {
|
397 | var _this = this;
|
398 | this.createDatepickerBootstrap();
|
399 | var i = 0;
|
400 | this.datePickerChild.nativeElement.onblur = function () {
|
401 |
|
402 |
|
403 | if (i++ % 2 === 1) {
|
404 | return;
|
405 | }
|
406 | _this.touchedChange.emit(true);
|
407 | _this.onTouchedCallback();
|
408 | };
|
409 | };
|
410 | DatePickerComponent.prototype.createDatepickerBootstrap = function () {
|
411 | var _this = this;
|
412 | this.datepicker = jQuery([this.datePickerChild.nativeElement]);
|
413 | this.datepicker.datetimepicker({
|
414 | locale: 'fr',
|
415 | minDate: moment('19100101', 'YYYYMMDD'),
|
416 | keepOpen: false,
|
417 | sideBySide: true,
|
418 | viewMode: 'days',
|
419 | allowInputToggle: this.allowInputToggle,
|
420 | widgetPositioning: {
|
421 | horizontal: 'left',
|
422 | vertical: 'auto'
|
423 | },
|
424 | format: this.month ? 'MM/YYYY' : (this.time ? 'DD/MM/YYYY HH: mm' : 'DD/MM/YYYY'),
|
425 | date: this.innerDate
|
426 | }).on('dp.change', function (eventDate) {
|
427 | _this.setValueFromDatepicker(eventDate.date === false ? null : eventDate.date.toDate());
|
428 | });
|
429 | };
|
430 | DatePickerComponent.prototype.convertToDate = function (value) {
|
431 | if (value === undefined) {
|
432 | value = null;
|
433 | }
|
434 | if (value && !(value instanceof Date)) {
|
435 | value = new Date(value);
|
436 | }
|
437 | return value;
|
438 | };
|
439 | DatePickerComponent.prototype.togglePopup = function () {
|
440 |
|
441 | };
|
442 |
|
443 | DatePickerComponent.prototype.writeValue = function (v) {
|
444 | this.setValueFromParent(v);
|
445 | };
|
446 |
|
447 | DatePickerComponent.prototype.registerOnChange = function (fn) {
|
448 | this.onChangeCallback = fn;
|
449 | };
|
450 |
|
451 | DatePickerComponent.prototype.registerOnTouched = function (fn) {
|
452 | this.onTouchedCallback = fn;
|
453 | };
|
454 | var DatePickerComponent_1;
|
455 | __decorate([
|
456 | Input(),
|
457 | __metadata("design:type", Object)
|
458 | ], DatePickerComponent.prototype, "time", void 0);
|
459 | __decorate([
|
460 | Input(),
|
461 | __metadata("design:type", Object)
|
462 | ], DatePickerComponent.prototype, "month", void 0);
|
463 | __decorate([
|
464 | Input(),
|
465 | __metadata("design:type", Object)
|
466 | ], DatePickerComponent.prototype, "required", void 0);
|
467 | __decorate([
|
468 | Input(),
|
469 | __metadata("design:type", Object)
|
470 | ], DatePickerComponent.prototype, "readonly", void 0);
|
471 | __decorate([
|
472 | Input(),
|
473 | __metadata("design:type", Object)
|
474 | ], DatePickerComponent.prototype, "hasError", void 0);
|
475 | __decorate([
|
476 | Input(),
|
477 | __metadata("design:type", Object)
|
478 | ], DatePickerComponent.prototype, "allowInputToggle", void 0);
|
479 | __decorate([
|
480 | Output(),
|
481 | __metadata("design:type", EventEmitter)
|
482 | ], DatePickerComponent.prototype, "touchedChange", void 0);
|
483 | __decorate([
|
484 | ViewChild('myDatePicker', { static: true }),
|
485 | __metadata("design:type", Object)
|
486 | ], DatePickerComponent.prototype, "datePickerChild", void 0);
|
487 | DatePickerComponent = DatePickerComponent_1 = __decorate([
|
488 | Component({
|
489 | selector: 'datepicker-component',
|
490 | providers: [{
|
491 | provide: NG_VALUE_ACCESSOR,
|
492 | useExisting: forwardRef(function () { return DatePickerComponent_1; }),
|
493 | multi: true
|
494 | }],
|
495 | template: "<style>\n .has-error-bottom input {\n border-bottom-color: #a94442;\n }\n</style>\n<div #myDatePicker class=\"input-group date\" [ngClass]=\"{'has-error-bottom':hasError}\">\n <input class=\"form-control\" type=\"text\" [required]=\"required\" [readonly]=\"readonly\">\n <span class=\"input-group-addon\">\n <span class=\"glyphicon glyphicon-calendar\" (click)=\"togglePopup()\"></span>\n </span>\n</div>\n"
|
496 | }),
|
497 | __metadata("design:paramtypes", [])
|
498 | ], DatePickerComponent);
|
499 | return DatePickerComponent;
|
500 | }());
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 | var TabService = (function () {
|
508 | function TabService() {
|
509 | this.listeners = [];
|
510 | }
|
511 | TabService.prototype.register = function (listener) {
|
512 | this.listeners.push(listener);
|
513 | };
|
514 | TabService.prototype.cancel = function (tabListener) {
|
515 | var e_1, _a;
|
516 | var i = 0;
|
517 | try {
|
518 | for (var _b = __values(this.listeners), _c = _b.next(); !_c.done; _c = _b.next()) {
|
519 | var listener = _c.value;
|
520 | if (listener === tabListener) {
|
521 | this.listeners.splice(i, 1);
|
522 | }
|
523 | i++;
|
524 | }
|
525 | }
|
526 | catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
527 | finally {
|
528 | try {
|
529 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
530 | }
|
531 | finally { if (e_1) throw e_1.error; }
|
532 | }
|
533 | };
|
534 | TabService.prototype.notifyObservers = function (tabListener) {
|
535 | var e_2, _a;
|
536 | try {
|
537 | for (var _b = __values(this.listeners), _c = _b.next(); !_c.done; _c = _b.next()) {
|
538 | var listener = _c.value;
|
539 | if (tabListener.getName() === listener.getName()) {
|
540 | listener.notifyTabChanged(tabListener);
|
541 | }
|
542 | }
|
543 | }
|
544 | catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
545 | finally {
|
546 | try {
|
547 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
548 | }
|
549 | finally { if (e_2) throw e_2.error; }
|
550 | }
|
551 | };
|
552 | TabService = __decorate([
|
553 | Injectable()
|
554 | ], TabService);
|
555 | return TabService;
|
556 | }());
|
557 |
|
558 |
|
559 |
|
560 |
|
561 | var TabComponent = (function () {
|
562 |
|
563 |
|
564 | function TabComponent(tabService, element) {
|
565 | this.tabService = tabService;
|
566 | this.element = element;
|
567 | this.disabled = false;
|
568 | this.ngValueChange = new EventEmitter();
|
569 | this.inputWidth = 12;
|
570 | this.isChecked = false;
|
571 | }
|
572 |
|
573 |
|
574 | TabComponent.prototype.ngAfterContentInit = function () {
|
575 | if (this.width) {
|
576 | this.inputWidth = this.width;
|
577 | }
|
578 | else {
|
579 | var nbTabs = document.querySelectorAll('tab-component[name=' + this.name + ']').length;
|
580 | this.inputWidth = Math.floor(12 / nbTabs);
|
581 | }
|
582 | this.tabService.register(this);
|
583 | this.refreshTab();
|
584 | };
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 | TabComponent.prototype.ngOnChanges = function (changes) {
|
591 | this.refreshTab();
|
592 | };
|
593 |
|
594 |
|
595 | TabComponent.prototype.notifyTabChanged = function (tabListener) {
|
596 | this.isChecked = tabListener === this;
|
597 |
|
598 | if (this.isChecked) {
|
599 | this.ngValue = this.value;
|
600 | this.ngValueChange.emit(this.value);
|
601 | }
|
602 | };
|
603 |
|
604 | TabComponent.prototype.getName = function () {
|
605 | return this.name;
|
606 | };
|
607 | TabComponent.prototype.tabClicked = function (event) {
|
608 | this.tabService.notifyObservers(this);
|
609 | };
|
610 | TabComponent.prototype.refreshTab = function () {
|
611 | if (this.ngValue === this.value) {
|
612 | this.tabService.notifyObservers(this);
|
613 | }
|
614 | };
|
615 | __decorate([
|
616 | Input(),
|
617 | __metadata("design:type", Number)
|
618 | ], TabComponent.prototype, "width", void 0);
|
619 | __decorate([
|
620 | Input(),
|
621 | __metadata("design:type", String)
|
622 | ], TabComponent.prototype, "label", void 0);
|
623 | __decorate([
|
624 | Input(),
|
625 | __metadata("design:type", String)
|
626 | ], TabComponent.prototype, "name", void 0);
|
627 | __decorate([
|
628 | Input(),
|
629 | __metadata("design:type", String)
|
630 | ], TabComponent.prototype, "value", void 0);
|
631 | __decorate([
|
632 | Input(),
|
633 | __metadata("design:type", Object)
|
634 | ], TabComponent.prototype, "ngValue", void 0);
|
635 | __decorate([
|
636 | Input(),
|
637 | __metadata("design:type", Object)
|
638 | ], TabComponent.prototype, "disabled", void 0);
|
639 | __decorate([
|
640 | Output(),
|
641 | __metadata("design:type", Object)
|
642 | ], TabComponent.prototype, "ngValueChange", void 0);
|
643 | TabComponent = __decorate([
|
644 | Component({
|
645 | selector: 'tab-component',
|
646 | template: "<div class=\"col-md-{{inputWidth}} component-tab\" [ngClass]=\"{'tab-selected': isChecked}\">\n <button type=\"button\" class=\"btn btn-flat btn-lg faa-parent animated-hover\" style=\"width:100%;\"\n (click)=\"tabClicked($event)\" [ngClass]=\"{'btn-info': isChecked}\">\n <ng-content></ng-content>\n </button>\n <div class=\"puce\">\n <i class=\"fa fa-caret-down\" aria-hidden=\"true\"></i>\n </div>\n</div>\n",
|
647 | styles: [".component-tab button{transition:.3s linear;-webkit-transition:.3s linear;-moz-transition:.3s linear;-o-transition:.3s linear;-ms-transition:all .3s 0s linear;border:none;background:#ddd}.component-tab button:hover,.component-tab.tab-selected button{background:#00c0ef;color:#fff}.component-tab{position:relative}.component-tab .btn-info{border:none}.component-tab .btn{border-radius:3px 3px 0 0}.component-tab .puce{transition:.3s linear;-webkit-transition:.3s linear;-moz-transition:.3s linear;-o-transition:.3s linear;-ms-transition:all .3s 0s linear;position:absolute;bottom:-11px;margin:auto auto auto -14px;z-index:10;width:100%;text-align:center;font-size:1.5em;color:#ddd}.component-tab.tab-selected .puce,.component-tab:hover .puce{bottom:-13px}.component-tab .btn-info+.puce,.component-tab .btn-info:focus:hover+.puce,.component-tab button:hover+.puce{color:#00c0ef}.component-tab .btn-info:focus+.puce{color:#31b0d5}.content-info-perso{padding:20px;background:#d2d6de;margin-bottom:20px}.content-info-perso h2{margin-top:0;font-size:1.4em;padding-bottom:5px;border-bottom:1px solid #efefef;padding-top:20px}.content-info-perso h2.first-title{padding-top:0}.content-info-perso>div>i{display:inline-block;width:25px}.infobulle-tab{position:absolute;bottom:-22px;left:20px;background:#444;opacity:0;padding:5px;z-index:900;transition:.5s linear;box-shadow:0 0 5px 0 rgba(0,0,0,.2);border-radius:3px;font-size:.7em}button:hover>.infobulle-tab{opacity:.95;color:#fff}"]
|
648 | }),
|
649 | __metadata("design:paramtypes", [TabService, ElementRef])
|
650 | ], TabComponent);
|
651 | return TabComponent;
|
652 | }());
|
653 |
|
654 |
|
655 |
|
656 |
|
657 | var TextfieldComponent = (function () {
|
658 | function TextfieldComponent() {
|
659 | this.width = '12';
|
660 | this.required = false;
|
661 | this.readonly = false;
|
662 | this.hasError = false;
|
663 | this.type = 'text';
|
664 | this.simpleMode = true;
|
665 | this.i = 0;
|
666 | }
|
667 | TextfieldComponent_1 = TextfieldComponent;
|
668 | TextfieldComponent.prototype.updateData = function (event) {
|
669 | this.setValueFromField(event);
|
670 | };
|
671 |
|
672 | TextfieldComponent.prototype.ngAfterContentInit = function () {
|
673 | var _this = this;
|
674 | if (this.width && this.width.substring(0, 3) === 'col') {
|
675 | this.simpleMode = false;
|
676 | }
|
677 | this.inputText.nativeElement.onblur = function () {
|
678 | _this.onTouchedCallback();
|
679 | };
|
680 | };
|
681 | TextfieldComponent.prototype.setValueFromField = function (v) {
|
682 | this.ngValue = v;
|
683 | this.onChangeCallback(v);
|
684 | };
|
685 | TextfieldComponent.prototype.setValueFromParent = function (v) {
|
686 | this.ngValue = v;
|
687 | };
|
688 |
|
689 | TextfieldComponent.prototype.writeValue = function (v) {
|
690 | this.setValueFromParent(v);
|
691 | };
|
692 |
|
693 | TextfieldComponent.prototype.registerOnChange = function (fn) {
|
694 | this.onChangeCallback = fn;
|
695 | };
|
696 |
|
697 | TextfieldComponent.prototype.registerOnTouched = function (fn) {
|
698 | this.onTouchedCallback = fn;
|
699 | };
|
700 | var TextfieldComponent_1;
|
701 | __decorate([
|
702 | Input(),
|
703 | __metadata("design:type", Number)
|
704 | ], TextfieldComponent.prototype, "rows", void 0);
|
705 | __decorate([
|
706 | Input(),
|
707 | __metadata("design:type", Object)
|
708 | ], TextfieldComponent.prototype, "width", void 0);
|
709 | __decorate([
|
710 | Input(),
|
711 | __metadata("design:type", String)
|
712 | ], TextfieldComponent.prototype, "placeholder", void 0);
|
713 | __decorate([
|
714 | Input(),
|
715 | __metadata("design:type", String)
|
716 | ], TextfieldComponent.prototype, "label", void 0);
|
717 | __decorate([
|
718 | Input(),
|
719 | __metadata("design:type", String)
|
720 | ], TextfieldComponent.prototype, "id", void 0);
|
721 | __decorate([
|
722 | Input(),
|
723 | __metadata("design:type", Object)
|
724 | ], TextfieldComponent.prototype, "required", void 0);
|
725 | __decorate([
|
726 | Input(),
|
727 | __metadata("design:type", Object)
|
728 | ], TextfieldComponent.prototype, "readonly", void 0);
|
729 | __decorate([
|
730 | Input(),
|
731 | __metadata("design:type", Object)
|
732 | ], TextfieldComponent.prototype, "hasError", void 0);
|
733 | __decorate([
|
734 | Input(),
|
735 | __metadata("design:type", String)
|
736 | ], TextfieldComponent.prototype, "message", void 0);
|
737 | __decorate([
|
738 | Input(),
|
739 | __metadata("design:type", Object)
|
740 | ], TextfieldComponent.prototype, "type", void 0);
|
741 | __decorate([
|
742 | ViewChild('inputText', { static: true }),
|
743 | __metadata("design:type", Object)
|
744 | ], TextfieldComponent.prototype, "inputText", void 0);
|
745 | TextfieldComponent = TextfieldComponent_1 = __decorate([
|
746 | Component({
|
747 | selector: 'textfield-component',
|
748 | providers: [{
|
749 | provide: NG_VALUE_ACCESSOR,
|
750 | useExisting: forwardRef(function () { return TextfieldComponent_1; }),
|
751 | multi: true
|
752 | }],
|
753 | template: "<style>\n .has-error-bottom input {\n border-bottom-color: #a94442;\n }\n</style>\n<div class = \"form-group {{simpleMode ? 'col-sm-'+width : width}}\">\n <div [ngClass]=\"{'has-error-bottom':hasError}\">\n\n <label class=\"control-label\" attr.for=\"{{id}}\">{{(required) ? label + ' *': label}}</label>\n\n <span style=\"display:block;text-align:left;font-style: italic;\" *ngIf=\"message != null\">{{message}}</span>\n\n <input [type]=\"type\" class=\"form-control\" id=\"{{id}}\" placeholder=\"{{placeholder}}\"\n [ngModel]=\"ngValue\" (ngModelChange)=\"updateData($event)\"\n [required]=\"required\" [readonly]=\"readonly\" #inputText>\n\n </div>\n</div>\n"
|
754 | }),
|
755 | __metadata("design:paramtypes", [])
|
756 | ], TextfieldComponent);
|
757 | return TextfieldComponent;
|
758 | }());
|
759 |
|
760 |
|
761 |
|
762 |
|
763 | var TextareaComponent = (function (_super) {
|
764 | __extends(TextareaComponent, _super);
|
765 |
|
766 |
|
767 | function TextareaComponent() {
|
768 | return _super.call(this) || this;
|
769 | }
|
770 | TextareaComponent_1 = TextareaComponent;
|
771 | var TextareaComponent_1;
|
772 | TextareaComponent = TextareaComponent_1 = __decorate([
|
773 | Component({
|
774 | selector: 'textarea-component',
|
775 | providers: [{
|
776 | provide: NG_VALUE_ACCESSOR,
|
777 | useExisting: forwardRef(function () { return TextareaComponent_1; }),
|
778 | multi: true
|
779 | }],
|
780 | template: "<style>\n .has-error-bottom textarea {\n border-bottom-color: #a94442;\n }\n</style>\n<div class = \"form-group {{simpleMode ? 'col-sm-'+width : width}}\">\n <div [ngClass]=\"{'has-error-bottom':hasError}\">\n\n <label class=\"control-label\" attr.for=\"{{id}}\">{{(required) ? label + ' *': label}}</label>\n\n <span style=\"display:block;text-align:left;font-style: italic;\" *ngIf=\"message != null\">{{message}}</span>\n\n <textarea class=\"form-control\" id=\"{{id}}\" placeholder=\"{{placeholder}}\"\n [ngModel]=\"ngValue\" (ngModelChange)=\"updateData($event)\"\n [required]=\"required\" [readonly]=\"readonly\"\n [rows]=\"rows\" #inputText></textarea>\n\n </div>\n</div>"
|
781 | }),
|
782 | __metadata("design:paramtypes", [])
|
783 | ], TextareaComponent);
|
784 | return TextareaComponent;
|
785 | }(TextfieldComponent));
|
786 |
|
787 | var CheckboxComponent = (function () {
|
788 | function CheckboxComponent() {
|
789 | this.id = '';
|
790 | this.width = '12';
|
791 | this.readonly = false;
|
792 | this.hasError = false;
|
793 | this.icheckElement = null;
|
794 | this.simpleMode = true;
|
795 | }
|
796 | CheckboxComponent_1 = CheckboxComponent;
|
797 | CheckboxComponent.prototype.setValueFromComponent = function (v) {
|
798 | this.ngValue = v;
|
799 | this.onChangeCallback(v);
|
800 | };
|
801 | CheckboxComponent.prototype.setValueFromParent = function (v) {
|
802 | this.ngValue = v;
|
803 | this.ngDoCheck();
|
804 | };
|
805 |
|
806 | CheckboxComponent.prototype.writeValue = function (v) {
|
807 | this.setValueFromParent(v);
|
808 | };
|
809 |
|
810 | CheckboxComponent.prototype.registerOnChange = function (fn) {
|
811 | this.onChangeCallback = fn;
|
812 | };
|
813 |
|
814 | CheckboxComponent.prototype.registerOnTouched = function (fn) {
|
815 | this.onTouchedCallback = fn;
|
816 | };
|
817 | CheckboxComponent.prototype.ngAfterContentInit = function () {
|
818 | var _this = this;
|
819 | if (this.width && this.width.substring(0, 3) === 'col') {
|
820 | this.simpleMode = false;
|
821 | }
|
822 | this.icheckChildren.nativeElement.onblur = function () {
|
823 | _this.onTouchedCallback();
|
824 | };
|
825 | };
|
826 | CheckboxComponent.prototype.ngAfterViewInit = function () {
|
827 | this.createICheck();
|
828 | };
|
829 | CheckboxComponent.prototype.getICheckElement = function () {
|
830 | return jQuery([this.icheckChildren.nativeElement]);
|
831 | };
|
832 | CheckboxComponent.prototype.createICheck = function () {
|
833 | this.icheckElement = this.getICheckElement();
|
834 | var elem = this.icheckElement;
|
835 | var self = this;
|
836 | elem.iCheck({
|
837 | checkboxClass: 'icheckbox_square-blue',
|
838 | radioClass: 'iradio_square-blue',
|
839 | increaseArea: '20%'
|
840 | }).on('ifToggled', function (event) {
|
841 | self.switchValue();
|
842 | });
|
843 | };
|
844 |
|
845 | CheckboxComponent.prototype.ngDoCheck = function () {
|
846 | if (this.icheckElement) {
|
847 | this.icheckElement.iCheck('update');
|
848 | }
|
849 | };
|
850 | CheckboxComponent.prototype.switchValue = function () {
|
851 | if (this.ngValue === true) {
|
852 | this.ngValue = false;
|
853 | }
|
854 | else {
|
855 | this.ngValue = true;
|
856 | }
|
857 | this.setValueFromComponent(this.ngValue);
|
858 | };
|
859 | var CheckboxComponent_1;
|
860 | __decorate([
|
861 | Input(),
|
862 | __metadata("design:type", Object)
|
863 | ], CheckboxComponent.prototype, "id", void 0);
|
864 | __decorate([
|
865 | Input(),
|
866 | __metadata("design:type", Object)
|
867 | ], CheckboxComponent.prototype, "width", void 0);
|
868 | __decorate([
|
869 | Input(),
|
870 | __metadata("design:type", String)
|
871 | ], CheckboxComponent.prototype, "placeholder", void 0);
|
872 | __decorate([
|
873 | Input(),
|
874 | __metadata("design:type", String)
|
875 | ], CheckboxComponent.prototype, "label", void 0);
|
876 | __decorate([
|
877 | Input(),
|
878 | __metadata("design:type", Object)
|
879 | ], CheckboxComponent.prototype, "readonly", void 0);
|
880 | __decorate([
|
881 | Input(),
|
882 | __metadata("design:type", Object)
|
883 | ], CheckboxComponent.prototype, "hasError", void 0);
|
884 | __decorate([
|
885 | Input(),
|
886 | __metadata("design:type", String)
|
887 | ], CheckboxComponent.prototype, "message", void 0);
|
888 | __decorate([
|
889 | ViewChild('icheckElement', { static: true }),
|
890 | __metadata("design:type", Object)
|
891 | ], CheckboxComponent.prototype, "icheckChildren", void 0);
|
892 | CheckboxComponent = CheckboxComponent_1 = __decorate([
|
893 | Component({
|
894 | selector: 'checkbox-component',
|
895 | providers: [{
|
896 | provide: NG_VALUE_ACCESSOR,
|
897 | useExisting: forwardRef(function () { return CheckboxComponent_1; }),
|
898 | multi: true
|
899 | }],
|
900 | template: "<style>\n :host >>> .icheckbox_square-blue.focus:not(.checked) {\n background-position: -24px 0;\n }\n /*:host >>> .icheckbox_flat.focus.checked {*/\n /*background-position: -48px 0;*/\n /*}*/\n</style>\n<div class = \"form-group {{simpleMode ? 'col-sm-'+width : width}}\">\n\n <div [ngClass]=\"{'has-error':hasError, 'checkbox':true, 'icheck':true}\">\n <span style=\"display:block;text-align:left;font-style: italic;\" *ngIf=\"message != null\">{{message}}</span>\n <input type=\"checkbox\" id=\"{{id}}\" #icheckElement\n [checked]=\"ngValue\" (click)=\"switchValue()\"\n [readonly]=\"readonly\"/>\n <label class=\"control-label\" attr.for=\"{{id}}\">\n <div *ngIf=\"label != null\">{{label}}</div>\n <ng-content></ng-content>\n </label>\n\n </div>\n\n</div>\n"
|
901 | }),
|
902 | __metadata("design:paramtypes", [])
|
903 | ], CheckboxComponent);
|
904 | return CheckboxComponent;
|
905 | }());
|
906 |
|
907 |
|
908 |
|
909 |
|
910 | var NumericComponent = (function (_super) {
|
911 | __extends(NumericComponent, _super);
|
912 |
|
913 |
|
914 | function NumericComponent() {
|
915 | return _super.call(this) || this;
|
916 | }
|
917 | NumericComponent_1 = NumericComponent;
|
918 | var NumericComponent_1;
|
919 | NumericComponent = NumericComponent_1 = __decorate([
|
920 | Component({
|
921 | providers: [{
|
922 | provide: NG_VALUE_ACCESSOR,
|
923 | useExisting: forwardRef(function () { return NumericComponent_1; }),
|
924 | multi: true
|
925 | }],
|
926 | selector: 'numeric-component',
|
927 | template: "<style>\n .has-error-bottom input {\n border-bottom-color: #a94442;\n }\n</style>\n<div class = \"form-group {{simpleMode ? 'col-sm-'+width : width}}\">\n <div [ngClass]=\"{'has-error-bottom':hasError}\">\n\n <label class=\"control-label\" attr.for=\"{{id}}\">{{(required) ? label + ' *': label}}</label>\n\n <span style=\"display:block;text-align:left;font-style: italic;\" *ngIf=\"message != null\">{{message}}</span>\n\n <input type=\"number\" class=\"form-control\" id=\"{{id}}\" placeholder=\"{{placeholder}}\"\n [ngModel]=\"ngValue\" (ngModelChange)=\"updateData($event)\"\n [required]=\"required\" [readonly]=\"readonly\" #inputText>\n\n </div>\n</div>\n"
|
928 | }),
|
929 | __metadata("design:paramtypes", [])
|
930 | ], NumericComponent);
|
931 | return NumericComponent;
|
932 | }(TextfieldComponent));
|
933 |
|
934 |
|
935 |
|
936 |
|
937 |
|
938 |
|
939 | var ShowResumePipe = (function () {
|
940 | function ShowResumePipe() {
|
941 | }
|
942 | ShowResumePipe.prototype.transform = function (value, size) {
|
943 | if (value) {
|
944 | if (value.length > size) {
|
945 | return value.substr(0, size) + ' ...';
|
946 | }
|
947 | else {
|
948 | return value;
|
949 | }
|
950 | }
|
951 | else {
|
952 | return '';
|
953 | }
|
954 | };
|
955 | ShowResumePipe = __decorate([
|
956 | Pipe({ name: 'showResume' })
|
957 | ], ShowResumePipe);
|
958 | return ShowResumePipe;
|
959 | }());
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 |
|
968 |
|
969 |
|
970 |
|
971 | var SelectComponent = (function () {
|
972 | function SelectComponent(element) {
|
973 | this.element = element;
|
974 | this.width = '12';
|
975 | this.required = false;
|
976 | this.readonly = false;
|
977 | this.hasError = false;
|
978 | this.simpleMode = true;
|
979 | }
|
980 | SelectComponent_1 = SelectComponent;
|
981 |
|
982 | SelectComponent.prototype.ngAfterContentInit = function () {
|
983 | if (this.width && this.width.substring(0, 3) === 'col') {
|
984 | this.simpleMode = false;
|
985 | }
|
986 | this.initSelect2();
|
987 | };
|
988 | SelectComponent.prototype.setValueFromSelect = function (v) {
|
989 | this.innerValue = v;
|
990 | this.onChangeCallback(v);
|
991 | };
|
992 | SelectComponent.prototype.setValueFromParent = function (v) {
|
993 | this.innerValue = v;
|
994 | this.initSelect2();
|
995 | };
|
996 |
|
997 | SelectComponent.prototype.updateData = function (event) {
|
998 | var e_1, _a;
|
999 | if (event) {
|
1000 | if (event instanceof Array) {
|
1001 | var valArray = [];
|
1002 | try {
|
1003 | for (var event_1 = __values(event), event_1_1 = event_1.next(); !event_1_1.done; event_1_1 = event_1.next()) {
|
1004 | var item = event_1_1.value;
|
1005 | if (item.value) {
|
1006 | valArray = __spread(valArray, [item.value]);
|
1007 | }
|
1008 | else {
|
1009 | valArray = __spread(valArray, [item]);
|
1010 | }
|
1011 | }
|
1012 | }
|
1013 | catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
1014 | finally {
|
1015 | try {
|
1016 | if (event_1_1 && !event_1_1.done && (_a = event_1.return)) _a.call(event_1);
|
1017 | }
|
1018 | finally { if (e_1) throw e_1.error; }
|
1019 | }
|
1020 | this.setValueFromSelect(valArray);
|
1021 | }
|
1022 | else {
|
1023 | if (event.value) {
|
1024 | this.setValueFromSelect(event.value);
|
1025 | }
|
1026 | else {
|
1027 | this.setValueFromSelect(event);
|
1028 | }
|
1029 | }
|
1030 | }
|
1031 | };
|
1032 | |
1033 |
|
1034 |
|
1035 | SelectComponent.prototype.emptySelect2 = function () {
|
1036 | var jqSelect2 = $(this.select2Html.nativeElement);
|
1037 | jqSelect2.select2({ data: null, language: this.getSelect2Lang });
|
1038 | jqSelect2.html('');
|
1039 | jqSelect2.off('change');
|
1040 | jqSelect2.off('select2:close');
|
1041 | };
|
1042 | |
1043 |
|
1044 |
|
1045 | SelectComponent.prototype.initSelect2 = function () {
|
1046 | this.emptySelect2();
|
1047 | var self = this;
|
1048 |
|
1049 | var jqSelect2 = jQuery(this.select2Html.nativeElement);
|
1050 | jqSelect2.select2({
|
1051 | data: this.values,
|
1052 | language: this.getSelect2Lang,
|
1053 | width: '100%',
|
1054 | multiple: (this.innerValue instanceof Array)
|
1055 | });
|
1056 | jqSelect2.on('select2:close', function (e) {
|
1057 | self.onTouchedCallback();
|
1058 | });
|
1059 |
|
1060 | if (this.innerValue) {
|
1061 | this.currentSelectValue = this.convertValueForSelect2(this.innerValue);
|
1062 | jqSelect2.val(this.currentSelectValue).trigger('change');
|
1063 | }
|
1064 |
|
1065 | jqSelect2.on('change', function () {
|
1066 | var obj = jqSelect2.select2('val');
|
1067 | var val = null;
|
1068 | if (obj instanceof Array) {
|
1069 | val = self.findArrayObjFromArrayVal(obj);
|
1070 | }
|
1071 | else {
|
1072 | val = self.findObjFromVal(obj);
|
1073 | }
|
1074 | self.updateData(val);
|
1075 | });
|
1076 | };
|
1077 |
|
1078 |
|
1079 | SelectComponent.prototype.convertValueForSelect2 = function (obj) {
|
1080 | if (obj instanceof Array) {
|
1081 | return this.convertArrayObjToArrayId(obj);
|
1082 | }
|
1083 | else {
|
1084 | return this.convertObjToId(obj);
|
1085 | }
|
1086 | };
|
1087 |
|
1088 | SelectComponent.prototype.convertArrayObjToArrayId = function (arrayObj) {
|
1089 | var e_2, _a;
|
1090 | var arraySelect2Vals = [];
|
1091 | try {
|
1092 | for (var arrayObj_1 = __values(arrayObj), arrayObj_1_1 = arrayObj_1.next(); !arrayObj_1_1.done; arrayObj_1_1 = arrayObj_1.next()) {
|
1093 | var value = arrayObj_1_1.value;
|
1094 | var select2val = this.convertObjToId(value);
|
1095 | arraySelect2Vals = __spread(arraySelect2Vals, [select2val]);
|
1096 | }
|
1097 | }
|
1098 | catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
1099 | finally {
|
1100 | try {
|
1101 | if (arrayObj_1_1 && !arrayObj_1_1.done && (_a = arrayObj_1.return)) _a.call(arrayObj_1);
|
1102 | }
|
1103 | finally { if (e_2) throw e_2.error; }
|
1104 | }
|
1105 | return arraySelect2Vals;
|
1106 | };
|
1107 |
|
1108 |
|
1109 | SelectComponent.prototype.convertObjToId = function (obj) {
|
1110 | if (obj.id) {
|
1111 | return obj.id;
|
1112 | }
|
1113 | else {
|
1114 | return obj.toString();
|
1115 | }
|
1116 | };
|
1117 | SelectComponent.prototype.findArrayObjFromArrayVal = function (valArrayFromSelect2) {
|
1118 | var e_3, _a;
|
1119 | var objectValue = [];
|
1120 | try {
|
1121 | for (var valArrayFromSelect2_1 = __values(valArrayFromSelect2), valArrayFromSelect2_1_1 = valArrayFromSelect2_1.next(); !valArrayFromSelect2_1_1.done; valArrayFromSelect2_1_1 = valArrayFromSelect2_1.next()) {
|
1122 | var value = valArrayFromSelect2_1_1.value;
|
1123 | var select2Val = this.findObjFromVal(value);
|
1124 | if (select2Val != null) {
|
1125 | objectValue = __spread(objectValue, [select2Val]);
|
1126 | }
|
1127 | }
|
1128 | }
|
1129 | catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
1130 | finally {
|
1131 | try {
|
1132 | if (valArrayFromSelect2_1_1 && !valArrayFromSelect2_1_1.done && (_a = valArrayFromSelect2_1.return)) _a.call(valArrayFromSelect2_1);
|
1133 | }
|
1134 | finally { if (e_3) throw e_3.error; }
|
1135 | }
|
1136 | return objectValue;
|
1137 | };
|
1138 | SelectComponent.prototype.findObjFromVal = function (val) {
|
1139 | var e_4, _a;
|
1140 | try {
|
1141 | for (var _b = __values(this.values), _c = _b.next(); !_c.done; _c = _b.next()) {
|
1142 | var value = _c.value;
|
1143 | if (value.id && '' + value.id === '' + val) {
|
1144 | return value;
|
1145 | }
|
1146 | if (!value.id && '' + value.id === '' + val) {
|
1147 | return value;
|
1148 | }
|
1149 | }
|
1150 | }
|
1151 | catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
1152 | finally {
|
1153 | try {
|
1154 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
1155 | }
|
1156 | finally { if (e_4) throw e_4.error; }
|
1157 | }
|
1158 | return null;
|
1159 | };
|
1160 | SelectComponent.prototype.getSelect2Lang = function () {
|
1161 | return {
|
1162 | errorLoading: function () { return 'Le résultat ne peut être affiché.'; },
|
1163 | inputTooLong: function (args) { return 'Veuillez supprimer des caractères.'; },
|
1164 | inputTooShort: function (args) { return 'Veuillez saisir des caractères.'; },
|
1165 | loadingMore: function (args) { return 'Chargement des résultats...'; },
|
1166 | maximumSelected: function (args) { return 'Vous ne pouvez sélectionner que ' + args.maximum + ' valeurs'; },
|
1167 | noResults: function () { return 'Aucun résultat'; },
|
1168 | searching: function () { return 'Recherche en cours...'; }
|
1169 | };
|
1170 | };
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 | SelectComponent.prototype.writeValue = function (v) {
|
1177 | this.setValueFromParent(v);
|
1178 | };
|
1179 |
|
1180 | SelectComponent.prototype.ngOnChanges = function (changes) {
|
1181 | this.initSelect2();
|
1182 | };
|
1183 |
|
1184 | SelectComponent.prototype.registerOnChange = function (fn) {
|
1185 | this.onChangeCallback = fn;
|
1186 | };
|
1187 |
|
1188 | SelectComponent.prototype.registerOnTouched = function (fn) {
|
1189 | this.onTouchedCallback = fn;
|
1190 | };
|
1191 | var SelectComponent_1;
|
1192 | __decorate([
|
1193 | Input(),
|
1194 | __metadata("design:type", Array)
|
1195 | ], SelectComponent.prototype, "values", void 0);
|
1196 | __decorate([
|
1197 | Input(),
|
1198 | __metadata("design:type", Object)
|
1199 | ], SelectComponent.prototype, "width", void 0);
|
1200 | __decorate([
|
1201 | Input(),
|
1202 | __metadata("design:type", String)
|
1203 | ], SelectComponent.prototype, "label", void 0);
|
1204 | __decorate([
|
1205 | Input(),
|
1206 | __metadata("design:type", String)
|
1207 | ], SelectComponent.prototype, "id", void 0);
|
1208 | __decorate([
|
1209 | Input(),
|
1210 | __metadata("design:type", Object)
|
1211 | ], SelectComponent.prototype, "required", void 0);
|
1212 | __decorate([
|
1213 | Input(),
|
1214 | __metadata("design:type", Object)
|
1215 | ], SelectComponent.prototype, "readonly", void 0);
|
1216 | __decorate([
|
1217 | Input(),
|
1218 | __metadata("design:type", Object)
|
1219 | ], SelectComponent.prototype, "hasError", void 0);
|
1220 | __decorate([
|
1221 | Input(),
|
1222 | __metadata("design:type", String)
|
1223 | ], SelectComponent.prototype, "message", void 0);
|
1224 | __decorate([
|
1225 | ViewChild('select2', { static: true }),
|
1226 | __metadata("design:type", Object)
|
1227 | ], SelectComponent.prototype, "select2Html", void 0);
|
1228 | SelectComponent = SelectComponent_1 = __decorate([
|
1229 | Component({
|
1230 | providers: [{
|
1231 | provide: NG_VALUE_ACCESSOR,
|
1232 | useExisting: forwardRef(function () { return SelectComponent_1; }),
|
1233 | multi: true
|
1234 | }],
|
1235 | selector: 'select-component',
|
1236 | template: "<div class = \"form-group select2-component {{simpleMode ? 'col-sm-'+width : width}}\">\n <div [ngClass]=\"{'has-error-bottom':hasError}\">\n\n <label class=\"control-label\" attr.for=\"{{id}}\">{{(required) ? label + ' *': label}}</label>\n <span style=\"display:block;text-align:left;font-style: italic;\" *ngIf=\"message != null\">{{message}}</span>\n\n <select #select2 class=\"form-control\" id=\"{{id}}\" [required]=\"required\" [disabled]=\"readonly\"></select>\n\n </div>\n</div>\n",
|
1237 | styles: [":host>>>.select2-selection--multiple{padding-bottom:5px}:host>>>.select2-search__field:focus{border:none}:host>>>.has-error-bottom .select2-selection{border-bottom-color:#a94442!important}:host>>>.select2-container--focus .select2-selection{border-color:#3c8dbc}"]
|
1238 | }),
|
1239 | __metadata("design:paramtypes", [ElementRef])
|
1240 | ], SelectComponent);
|
1241 | return SelectComponent;
|
1242 | }());
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 | var BoxComponent = (function () {
|
1248 | function BoxComponent() {
|
1249 | this.boxOpen = true;
|
1250 | this.boxStyle = 'box-default';
|
1251 | this.arrowOpen = true;
|
1252 | }
|
1253 | BoxComponent.prototype.ngOnInit = function () {
|
1254 | this.arrowOpen = this.boxOpen;
|
1255 | };
|
1256 | __decorate([
|
1257 | Input(),
|
1258 | __metadata("design:type", String)
|
1259 | ], BoxComponent.prototype, "title", void 0);
|
1260 | __decorate([
|
1261 | Input(),
|
1262 | __metadata("design:type", Object)
|
1263 | ], BoxComponent.prototype, "boxOpen", void 0);
|
1264 | __decorate([
|
1265 | Input(),
|
1266 | __metadata("design:type", Object)
|
1267 | ], BoxComponent.prototype, "boxStyle", void 0);
|
1268 | BoxComponent = __decorate([
|
1269 | Component({
|
1270 | selector: 'box-component',
|
1271 | template: "<style>\n.box-component .box-header {\n cursor:pointer;\n}\n.box-component i + h3 {\n padding-left:5px;\n}\n.box-header .fa-caret-up {\n transition : all 0.24s ease-in-out;\n -webkit-transition : all 0.24s ease-in-out;\n -moz-transition : all 0.24s ease-in-out;\n -o-transition : all 0.24s ease-in-out;\n -ms-transition : all 0.24s ease-in-out;\n}\n.box-header:hover .fa-caret-up {\n -ms-transform: rotate(180deg); /* IE 9 */\n -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */\n transform: rotate(180deg);\n}\n</style>\n\n<div class=\"box {{boxStyle}} {{((!boxOpen)?'collapsed-box':'')}} box-component\">\n\n <div class=\"box-header\">\n <div data-widget=\"collapse\" (click)=\"arrowOpen=!arrowOpen\">\n <i [ngClass]=\"{'fa':true, 'fa-caret-up':!arrowOpen, 'fa-caret-down':arrowOpen}\"></i>\n <h3 class=\"box-title\">{{title}}</h3>\n </div>\n </div>\n\n <div class=\"box-body\">\n <ng-content></ng-content>\n </div>\n\n</div>\n"
|
1272 | }),
|
1273 | __metadata("design:paramtypes", [])
|
1274 | ], BoxComponent);
|
1275 | return BoxComponent;
|
1276 | }());
|
1277 |
|
1278 | var SharedService = (function () {
|
1279 | function SharedService() {
|
1280 | this.showModal = new Subject();
|
1281 | }
|
1282 | SharedService = __decorate([
|
1283 | Injectable()
|
1284 | ], SharedService);
|
1285 | return SharedService;
|
1286 | }());
|
1287 |
|
1288 | var ModalComponent = (function () {
|
1289 | function ModalComponent(sharedService, componentFactoryResolver, injector, fb) {
|
1290 | var _this = this;
|
1291 | this.componentFactoryResolver = componentFactoryResolver;
|
1292 | this.originalData = null;
|
1293 | this.copyOriginalData = null;
|
1294 | this.copyOriginalData2 = null;
|
1295 | this.icon = '';
|
1296 | this.initCloneFunction = null;
|
1297 | this.commitCloneFunction = null;
|
1298 |
|
1299 | this.formGroup = null;
|
1300 | this.initLocalDataFunction = null;
|
1301 | this.updateOriginalDataFunction = null;
|
1302 | this.formGroup = fb.group({});
|
1303 | sharedService.showModal.subscribe(function (msg) {
|
1304 | var e_1, _a;
|
1305 | _this.title = msg.title;
|
1306 | _this.icon = msg.icon;
|
1307 | if (_this.cmpRef) {
|
1308 | _this.cmpRef.destroy();
|
1309 | }
|
1310 | var factory = _this.componentFactoryResolver.resolveComponentFactory(msg.type);
|
1311 | _this.cmpRef = _this.theBody.createComponent(factory);
|
1312 |
|
1313 | _this.initCloneFunction = msg.initCloneFunction;
|
1314 | _this.commitCloneFunction = msg.commitCloneFunction;
|
1315 |
|
1316 | _this.initClone(msg.data, msg.data2);
|
1317 |
|
1318 |
|
1319 | if (msg.codificationList != null) {
|
1320 | var i = 0;
|
1321 | try {
|
1322 | for (var _b = __values(msg.codificationList), _c = _b.next(); !_c.done; _c = _b.next()) {
|
1323 | var o = _c.value;
|
1324 | if (i === 0) {
|
1325 | _this.cmpRef.instance.codif = Object.assign({}, o[0]);
|
1326 | }
|
1327 | else {
|
1328 | Object.assign(_this.cmpRef.instance.codif, o[0]);
|
1329 | }
|
1330 | i++;
|
1331 | }
|
1332 | }
|
1333 | catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
1334 | finally {
|
1335 | try {
|
1336 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
1337 | }
|
1338 | finally { if (e_1) throw e_1.error; }
|
1339 | }
|
1340 | }
|
1341 | if (msg.codificationMap != null) {
|
1342 | _this.cmpRef.instance.codificationMap = Object.assign({}, msg.codificationMap);
|
1343 | }
|
1344 | if (msg.onValidated != null) {
|
1345 | _this.cmpRef.instance.onValidated = msg.onValidated;
|
1346 | }
|
1347 |
|
1348 |
|
1349 | _this.copyOriginalData = msg.data;
|
1350 | _this.copyOriginalData2 = msg.data2;
|
1351 |
|
1352 | if (_this.cmpRef.instance['formGroup']) {
|
1353 | _this.formGroup = _this.cmpRef.instance['formGroup'];
|
1354 | }
|
1355 | _this.initLocalDataFunction = _this.cmpRef.instance['initLocalDataFunction'];
|
1356 | _this.updateOriginalDataFunction = _this.cmpRef.instance['updateOriginalDataFunction'];
|
1357 | if (_this.initLocalDataFunction) {
|
1358 | _this.initLocalDataFunction(msg.data);
|
1359 | }
|
1360 | jQuery('#theModal').modal('show');
|
1361 | });
|
1362 | }
|
1363 | ModalComponent.prototype.close = function () {
|
1364 | if (this.cmpRef) {
|
1365 | this.cmpRef.destroy();
|
1366 | }
|
1367 | this.cmpRef = null;
|
1368 | };
|
1369 | ModalComponent.prototype.validate = function () {
|
1370 | if (this.cmpRef) {
|
1371 |
|
1372 | this.commitClone();
|
1373 | if (this.updateOriginalDataFunction) {
|
1374 | this.updateOriginalDataFunction(this.copyOriginalData);
|
1375 | if (this.cmpRef.instance.onValidated) {
|
1376 | this.cmpRef.instance.onValidated.emit(this.cmpRef.instance);
|
1377 | }
|
1378 | }
|
1379 | this.cmpRef.destroy();
|
1380 | }
|
1381 | this.cmpRef = null;
|
1382 | };
|
1383 | ModalComponent.prototype.initClone = function (originalData, originalData2) {
|
1384 |
|
1385 | if (this.initCloneFunction) {
|
1386 | if (originalData) {
|
1387 | this.cmpRef.instance.data = this.initCloneFunction(originalData);
|
1388 | }
|
1389 | if (originalData2) {
|
1390 | this.cmpRef.instance.data2 = this.initCloneFunction(originalData2);
|
1391 | }
|
1392 | }
|
1393 | else {
|
1394 | if (originalData) {
|
1395 | this.cmpRef.instance.data = Object.assign({}, originalData);
|
1396 | }
|
1397 | if (originalData2) {
|
1398 | this.cmpRef.instance.data2 = Object.assign({}, originalData2);
|
1399 | }
|
1400 | }
|
1401 | };
|
1402 | ModalComponent.prototype.commitClone = function () {
|
1403 | if (this.commitCloneFunction) {
|
1404 | if (this.copyOriginalData) {
|
1405 | this.commitCloneFunction(this.copyOriginalData, this.cmpRef.instance.data);
|
1406 | }
|
1407 | if (this.copyOriginalData2) {
|
1408 | this.commitCloneFunction(this.copyOriginalData2, this.cmpRef.instance.data2);
|
1409 | }
|
1410 | }
|
1411 | else {
|
1412 | if (this.copyOriginalData) {
|
1413 | Object.assign(this.copyOriginalData, this.cmpRef.instance.data);
|
1414 | }
|
1415 | if (this.copyOriginalData2) {
|
1416 | Object.assign(this.copyOriginalData2, this.cmpRef.instance.data2);
|
1417 | }
|
1418 | }
|
1419 | };
|
1420 | __decorate([
|
1421 | ViewChild('theBody', { read: ViewContainerRef, static: true }),
|
1422 | __metadata("design:type", Object)
|
1423 | ], ModalComponent.prototype, "theBody", void 0);
|
1424 | ModalComponent = __decorate([
|
1425 | Component({
|
1426 | selector: 'modal-comp',
|
1427 | template: "\n <style>\n #theModal .modal-header {\n background: #3c8dbc;\n color: white;\n }\n\n #theModal .modal-footer button {\n min-width: 85px;\n }\n </style>\n <div class='modal fade' id='theModal' role='dialog' aria-labelledby='theModalLabel' aria-hidden='true'>\n <div class='modal-dialog modal-lg' role='document'>\n <div class='modal-content'>\n <form [formGroup]='formGroup' autocomplete='on' novalidate>\n <div class='modal-header'>\n <button type='button' class='close' data-dismiss='modal' aria-label='Close'\n (close)='close()'>\n <i class='fa fa-times' style='padding-top:3px;' aria-hidden='true'></i>\n </button>\n <h4 class='modal-title' id='theModalLabel'><i class='fa' [ngClass]='icon'></i> {{title}}\n </h4>\n </div>\n <div class='modal-body'>\n <div class='row'>\n <div class='col-md-12'>\n <div #theBody>\n </div>\n </div>\n </div>\n </div>\n <div class='modal-footer'>\n <button type='button' class='btn btn-default btn-flat' style='margin-right:8px;'\n data-dismiss='modal' (click)='close()'>\n <i class='fa fa-undo'></i> Annuler\n </button>\n <button type='button' class='btn btn-primary btn-flat faa-parent animated-hover'\n data-dismiss='modal' (click)='validate()' [disabled]='!formGroup.valid'>\n <i class='fa fa-check faa-tada'></i> Valider\n </button>\n </div>\n </form>\n </div>\n </div>\n </div>\n "
|
1428 | }),
|
1429 | __metadata("design:paramtypes", [SharedService,
|
1430 | ComponentFactoryResolver,
|
1431 | Injector,
|
1432 | FormBuilder])
|
1433 | ], ModalComponent);
|
1434 | return ModalComponent;
|
1435 | }());
|
1436 |
|
1437 |
|
1438 |
|
1439 |
|
1440 | var DateRangeComponent = (function () {
|
1441 | function DateRangeComponent(element) {
|
1442 | this.element = element;
|
1443 | this.width = '12';
|
1444 | this.required = false;
|
1445 | this.readonly = false;
|
1446 | this.hasError = false;
|
1447 | this.simpleMode = true;
|
1448 | }
|
1449 | DateRangeComponent_1 = DateRangeComponent;
|
1450 | DateRangeComponent.prototype.onChange = function ($event) {
|
1451 | this.setValueFromDatepicker(this.innerDate);
|
1452 | };
|
1453 |
|
1454 | DateRangeComponent.prototype.setValueFromParent = function (v) {
|
1455 | this.innerDate = v;
|
1456 | };
|
1457 |
|
1458 | DateRangeComponent.prototype.setValueFromDatepicker = function (v) {
|
1459 | if (this.onChangeCallback) {
|
1460 | this.onChangeCallback(this.innerDate);
|
1461 | }
|
1462 | };
|
1463 | DateRangeComponent.prototype.ngAfterContentInit = function () {
|
1464 | if (this.width && this.width.substring(0, 3) === 'col') {
|
1465 | this.simpleMode = false;
|
1466 | }
|
1467 | };
|
1468 | DateRangeComponent.prototype.onTouch = function ($event) {
|
1469 | this.onTouchedCallback();
|
1470 | };
|
1471 |
|
1472 | DateRangeComponent.prototype.writeValue = function (v) {
|
1473 | this.setValueFromParent(v);
|
1474 | };
|
1475 |
|
1476 | DateRangeComponent.prototype.registerOnChange = function (fn) {
|
1477 | this.onChangeCallback = fn;
|
1478 | };
|
1479 |
|
1480 | DateRangeComponent.prototype.registerOnTouched = function (fn) {
|
1481 | this.onTouchedCallback = fn;
|
1482 | };
|
1483 | var DateRangeComponent_1;
|
1484 | __decorate([
|
1485 | Input(),
|
1486 | __metadata("design:type", Object)
|
1487 | ], DateRangeComponent.prototype, "width", void 0);
|
1488 | __decorate([
|
1489 | Input(),
|
1490 | __metadata("design:type", String)
|
1491 | ], DateRangeComponent.prototype, "label", void 0);
|
1492 | __decorate([
|
1493 | Input(),
|
1494 | __metadata("design:type", String)
|
1495 | ], DateRangeComponent.prototype, "id", void 0);
|
1496 | __decorate([
|
1497 | Input(),
|
1498 | __metadata("design:type", Object)
|
1499 | ], DateRangeComponent.prototype, "required", void 0);
|
1500 | __decorate([
|
1501 | Input(),
|
1502 | __metadata("design:type", Object)
|
1503 | ], DateRangeComponent.prototype, "readonly", void 0);
|
1504 | __decorate([
|
1505 | Input(),
|
1506 | __metadata("design:type", Object)
|
1507 | ], DateRangeComponent.prototype, "hasError", void 0);
|
1508 | __decorate([
|
1509 | Input(),
|
1510 | __metadata("design:type", Object)
|
1511 | ], DateRangeComponent.prototype, "message", void 0);
|
1512 | DateRangeComponent = DateRangeComponent_1 = __decorate([
|
1513 | Component({
|
1514 | selector: 'daterange-component',
|
1515 | providers: [{
|
1516 | provide: NG_VALUE_ACCESSOR,
|
1517 | useExisting: forwardRef(function () { return DateRangeComponent_1; }),
|
1518 | multi: true
|
1519 | }],
|
1520 | template: "<div class = \"form-group {{simpleMode ? 'col-sm-'+width : width}}\">\n<div>\n <label attr.for=\"{{id}}\" class=\"control-label\">{{(required) ? label + ' *': label}}</label>\n <span *ngIf=\"message != null\" style=\"display:block;font-style:italic;\">{{message}}</span>\n\n <daterangeinput-component\n [(ngModel)]=\"innerDate\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [hasError]=\"hasError\"\n (ngModelChange)=\"onChange($event)\"\n (touchedChange)=\"onTouch($event)\">\n </daterangeinput-component>\n\n</div>\n</div>\n"
|
1521 | }),
|
1522 | __metadata("design:paramtypes", [ElementRef])
|
1523 | ], DateRangeComponent);
|
1524 | return DateRangeComponent;
|
1525 | }());
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 | var DateRangeInputComponent = (function () {
|
1531 | function DateRangeInputComponent() {
|
1532 | this.required = false;
|
1533 | this.readonly = false;
|
1534 | this.hasError = false;
|
1535 | this.touchedChange = new EventEmitter();
|
1536 | this.datepicker = null;
|
1537 | this.simpleMode = true;
|
1538 | }
|
1539 | DateRangeInputComponent_1 = DateRangeInputComponent;
|
1540 |
|
1541 | DateRangeInputComponent.prototype.setValueFromParent = function (v) {
|
1542 | this.innerDate = v;
|
1543 | if (this.datepicker) {
|
1544 | this.createDatepickerBootstrap();
|
1545 | }
|
1546 | };
|
1547 |
|
1548 | DateRangeInputComponent.prototype.setValueFromDatepicker = function (startDate, endDate) {
|
1549 | this.innerDate.startDate = startDate;
|
1550 | this.innerDate.endDate = endDate;
|
1551 | if (this.onChangeCallback) {
|
1552 | this.onChangeCallback(Object.assign({}, this.innerDate));
|
1553 | }
|
1554 | };
|
1555 | DateRangeInputComponent.prototype.ngAfterViewInit = function () {
|
1556 | var _this = this;
|
1557 | this.createDatepickerBootstrap();
|
1558 | this.datePickerChild.nativeElement.onblur = function () {
|
1559 | _this.touchedChange.emit();
|
1560 | _this.onTouchedCallback();
|
1561 | };
|
1562 | };
|
1563 | DateRangeInputComponent.prototype.createDatepickerBootstrap = function () {
|
1564 | var self = this;
|
1565 | var daterangevalue = Object.assign({}, this.innerDate);
|
1566 | if (self.innerDate && (self.innerDate.startDate == null || self.innerDate.endDate == null)) {
|
1567 | daterangevalue.startDate = new Date();
|
1568 | daterangevalue.endDate = new Date();
|
1569 | }
|
1570 | this.datepicker = jQuery([this.datePickerChild.nativeElement]);
|
1571 | this.datepicker.daterangepicker(daterangevalue).on('hide.daterangepicker', function (ev, picker) {
|
1572 | var dateRange = self.datepicker.data('daterangepicker');
|
1573 | self.setValueFromDatepicker(dateRange.startDate, dateRange.endDate);
|
1574 | }).on('cancel.daterangepicker', function (ev, picker) {
|
1575 | jQuery(this).val('');
|
1576 | self.setValueFromDatepicker(null, null);
|
1577 | });
|
1578 | if (self.innerDate && (self.innerDate.startDate == null || self.innerDate.endDate == null)) {
|
1579 | this.datepicker.val('');
|
1580 | }
|
1581 | };
|
1582 | DateRangeInputComponent.prototype.togglePopup = function () {
|
1583 | this.datepicker.data('daterangepicker').show();
|
1584 | };
|
1585 |
|
1586 | DateRangeInputComponent.prototype.writeValue = function (v) {
|
1587 | this.setValueFromParent(v);
|
1588 | };
|
1589 |
|
1590 | DateRangeInputComponent.prototype.registerOnChange = function (fn) {
|
1591 | this.onChangeCallback = fn;
|
1592 | };
|
1593 |
|
1594 | DateRangeInputComponent.prototype.registerOnTouched = function (fn) {
|
1595 | this.onTouchedCallback = fn;
|
1596 | };
|
1597 | var DateRangeInputComponent_1;
|
1598 | __decorate([
|
1599 | Input(),
|
1600 | __metadata("design:type", Object)
|
1601 | ], DateRangeInputComponent.prototype, "required", void 0);
|
1602 | __decorate([
|
1603 | Input(),
|
1604 | __metadata("design:type", Object)
|
1605 | ], DateRangeInputComponent.prototype, "readonly", void 0);
|
1606 | __decorate([
|
1607 | Input(),
|
1608 | __metadata("design:type", Object)
|
1609 | ], DateRangeInputComponent.prototype, "hasError", void 0);
|
1610 | __decorate([
|
1611 | Output(),
|
1612 | __metadata("design:type", Object)
|
1613 | ], DateRangeInputComponent.prototype, "touchedChange", void 0);
|
1614 | __decorate([
|
1615 | ViewChild('myDatePicker', { static: true }),
|
1616 | __metadata("design:type", Object)
|
1617 | ], DateRangeInputComponent.prototype, "datePickerChild", void 0);
|
1618 | DateRangeInputComponent = DateRangeInputComponent_1 = __decorate([
|
1619 | Component({
|
1620 | selector: 'daterangeinput-component',
|
1621 | providers: [{
|
1622 | provide: NG_VALUE_ACCESSOR,
|
1623 | useExisting: forwardRef(function () { return DateRangeInputComponent_1; }),
|
1624 | multi: true
|
1625 | }],
|
1626 | template: "<style>\n .has-error-bottom input {\n border-bottom-color: #a94442;\n }\n</style>\n<div class=\"input-group date\" [ngClass]=\"{'has-error-bottom':hasError}\">\n <input #myDatePicker class=\"form-control\" type=\"text\" [required]=\"required\" [readonly]=\"readonly\">\n <span class=\"input-group-addon\" (click)=\"togglePopup()\">\n <span class=\"glyphicon glyphicon-calendar\"></span>\n </span>\n</div>\n"
|
1627 | }),
|
1628 | __metadata("design:paramtypes", [])
|
1629 | ], DateRangeInputComponent);
|
1630 | return DateRangeInputComponent;
|
1631 | }());
|
1632 |
|
1633 | var SwitchViewComponent = (function () {
|
1634 | function SwitchViewComponent(sharedService, componentFactoryResolver, fb) {
|
1635 | this.sharedService = sharedService;
|
1636 | this.componentFactoryResolver = componentFactoryResolver;
|
1637 | this.fb = fb;
|
1638 | this.icon = '';
|
1639 |
|
1640 | this.modeBandeau = true;
|
1641 |
|
1642 | this.initCloneFunction = null;
|
1643 |
|
1644 | this.commitCloneFunction = null;
|
1645 | this.boxStyle = 'box-default';
|
1646 | this.boxStyleForm = '';
|
1647 | this.boxOpen = true;
|
1648 | this.onValidated = new EventEmitter();
|
1649 | this.arrowOpen = true;
|
1650 |
|
1651 | this.formGroupInline = null;
|
1652 | this.formGroupInline = this.fb.group({});
|
1653 | }
|
1654 | SwitchViewComponent.prototype.ngOnInit = function () {
|
1655 | var e_1, _a;
|
1656 | if (this.modeBandeau === false) {
|
1657 | if (this.cmpRef == null || this.cmpRef === undefined) {
|
1658 | var factory = this.componentFactoryResolver.resolveComponentFactory(this.formComponentType);
|
1659 | this.cmpRef = this.bodyBoxFormulaire.createComponent(factory);
|
1660 | if (this.data) {
|
1661 | this.cmpRef.instance.data = this.data;
|
1662 | }
|
1663 | if (this.data2) {
|
1664 | this.cmpRef.instance.data2 = this.data2;
|
1665 | }
|
1666 | this.cmpRef.instance.modalMode = false;
|
1667 | if (this.cmpRef.instance.formGroup) {
|
1668 | this.formGroupInline = this.cmpRef.instance.formGroup;
|
1669 | }
|
1670 | if (this.cmpRef.instance.initLocalDataFunction) {
|
1671 | this.cmpRef.instance.initLocalDataFunction(this.data);
|
1672 | }
|
1673 | if (this.codificationList != null) {
|
1674 | try {
|
1675 | for (var _b = __values(this.codificationList), _c = _b.next(); !_c.done; _c = _b.next()) {
|
1676 | var o = _c.value;
|
1677 |
|
1678 | this.cmpRef.instance.codif = Object.assign({}, o[0]);
|
1679 | }
|
1680 | }
|
1681 | catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
1682 | finally {
|
1683 | try {
|
1684 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
1685 | }
|
1686 | finally { if (e_1) throw e_1.error; }
|
1687 | }
|
1688 | }
|
1689 | if (this.codificationMap != null) {
|
1690 | this.cmpRef.instance.codificationMap = Object.assign({}, this.codificationMap);
|
1691 | }
|
1692 | if (this.onValidated) {
|
1693 | this.cmpRef.instance.onValidated = this.onValidated;
|
1694 | }
|
1695 | }
|
1696 | }
|
1697 | this.arrowOpen = this.boxOpen;
|
1698 | };
|
1699 | SwitchViewComponent.prototype.edit = function () {
|
1700 | var params = {
|
1701 | 'type': this.formComponentType,
|
1702 | 'title': this.title,
|
1703 | 'data': this.data,
|
1704 | 'data2': this.data2,
|
1705 | 'codificationList': this.codificationList,
|
1706 | 'codificationMap': this.codificationMap,
|
1707 | 'initCloneFunction': this.initCloneFunction,
|
1708 | 'commitCloneFunction': this.commitCloneFunction,
|
1709 | 'icon': this.icon,
|
1710 | 'onValidated': this.onValidated
|
1711 | };
|
1712 |
|
1713 |
|
1714 | this.sharedService.showModal.next(params);
|
1715 | };
|
1716 | SwitchViewComponent.prototype.toggleBoxArrow = function () {
|
1717 | this.arrowOpen = !this.arrowOpen;
|
1718 | };
|
1719 | SwitchViewComponent.prototype.validate = function () {
|
1720 | if (this.cmpRef && this.cmpRef.instance) {
|
1721 | if (this.cmpRef.instance.beforeSave()) {
|
1722 | this.cmpRef.instance.updateOriginalDataFunction(this.data);
|
1723 | }
|
1724 | }
|
1725 | };
|
1726 |
|
1727 | SwitchViewComponent.prototype.refreshDetailDatas = function (datas) {
|
1728 | this.data = datas;
|
1729 | if (this.cmpRef.instance.initLocalDataFunction) {
|
1730 | this.cmpRef.instance.initLocalDataFunction(this.data);
|
1731 | }
|
1732 | };
|
1733 | SwitchViewComponent.prototype.refreshCodification = function (codificationMap) {
|
1734 | this.codificationMap = codificationMap;
|
1735 | this.cmpRef.instance.codificationMap = codificationMap;
|
1736 | this.cmpRef.instance.refreshCodification();
|
1737 | };
|
1738 |
|
1739 |
|
1740 | SwitchViewComponent.prototype.getComponentInstance = function () {
|
1741 | if (this.cmpRef) {
|
1742 | return this.cmpRef.instance;
|
1743 | }
|
1744 | else {
|
1745 | return null;
|
1746 | }
|
1747 | };
|
1748 | SwitchViewComponent.prototype.setData = function (data) {
|
1749 | console.log('set data :', data);
|
1750 | this.data = data;
|
1751 | if (this.cmpRef && this.cmpRef.instance) {
|
1752 | console.log('set data : initLocalDataFunction');
|
1753 | this.cmpRef.instance.initLocalDataFunction(data);
|
1754 | }
|
1755 | };
|
1756 | __decorate([
|
1757 | Input(),
|
1758 | __metadata("design:type", String)
|
1759 | ], SwitchViewComponent.prototype, "id", void 0);
|
1760 | __decorate([
|
1761 | Input(),
|
1762 | __metadata("design:type", String)
|
1763 | ], SwitchViewComponent.prototype, "title", void 0);
|
1764 | __decorate([
|
1765 | Input(),
|
1766 | __metadata("design:type", Object)
|
1767 | ], SwitchViewComponent.prototype, "icon", void 0);
|
1768 | __decorate([
|
1769 | Input(),
|
1770 | __metadata("design:type", Object)
|
1771 | ], SwitchViewComponent.prototype, "data", void 0);
|
1772 | __decorate([
|
1773 | Input(),
|
1774 | __metadata("design:type", Object)
|
1775 | ], SwitchViewComponent.prototype, "data2", void 0);
|
1776 | __decorate([
|
1777 | Input(),
|
1778 | __metadata("design:type", Array)
|
1779 | ], SwitchViewComponent.prototype, "codificationList", void 0);
|
1780 | __decorate([
|
1781 | Input(),
|
1782 | __metadata("design:type", Object)
|
1783 | ], SwitchViewComponent.prototype, "codificationMap", void 0);
|
1784 | __decorate([
|
1785 | Input(),
|
1786 | __metadata("design:type", Object)
|
1787 | ], SwitchViewComponent.prototype, "formComponentType", void 0);
|
1788 | __decorate([
|
1789 | Input(),
|
1790 | __metadata("design:type", Object)
|
1791 | ], SwitchViewComponent.prototype, "modeBandeau", void 0);
|
1792 | __decorate([
|
1793 | Input(),
|
1794 | __metadata("design:type", Function)
|
1795 | ], SwitchViewComponent.prototype, "initCloneFunction", void 0);
|
1796 | __decorate([
|
1797 | Input(),
|
1798 | __metadata("design:type", Function)
|
1799 | ], SwitchViewComponent.prototype, "commitCloneFunction", void 0);
|
1800 | __decorate([
|
1801 | Input(),
|
1802 | __metadata("design:type", Object)
|
1803 | ], SwitchViewComponent.prototype, "boxStyle", void 0);
|
1804 | __decorate([
|
1805 | Input(),
|
1806 | __metadata("design:type", Object)
|
1807 | ], SwitchViewComponent.prototype, "boxStyleForm", void 0);
|
1808 | __decorate([
|
1809 | Input(),
|
1810 | __metadata("design:type", Object)
|
1811 | ], SwitchViewComponent.prototype, "boxOpen", void 0);
|
1812 | __decorate([
|
1813 | Output(),
|
1814 | __metadata("design:type", EventEmitter)
|
1815 | ], SwitchViewComponent.prototype, "onValidated", void 0);
|
1816 | __decorate([
|
1817 | ViewChild('bodyBoxFormulaire', { read: ViewContainerRef, static: true }),
|
1818 | __metadata("design:type", Object)
|
1819 | ], SwitchViewComponent.prototype, "bodyBoxFormulaire", void 0);
|
1820 | SwitchViewComponent = __decorate([
|
1821 | Component({
|
1822 | selector: 'switchView',
|
1823 | template: "<style>\n\n .sv-box-title-with-icon {\n z-index:2;\n position:relative;\n }\n\n .sv-box-icon {\n z-index:1;\n position: absolute;\n height: 100%;\n background: #efefef;\n color:#333;\n top: 0px;\n left: 0px;\n width: 40px;\n border-radius: 1px 600px 600px 0px;\n font-size: 1.3em;\n vertical-align: middle;\n text-align: center;\n display: flex;\n align-items: center;\n cursor:pointer;\n -webkit-transition: all 0.2s ease-in-out;\n -moz-transition: all 0.2s ease-in-out;\n -ms-transition: all 0.2s ease-in-out;\n -o-transition: all 0.2s ease-in-out;\n transition: all 0.2s ease-in-out;\n }\n\n .box-switch-view:hover .sv-box-icon {\n width: 50px;\n background: #3c8dbc;\n color:white;\n }\n\n .sv-box-icon>i {\n /* vertical-align: middle; */\n margin: auto;\n }\n\n .box-switch-view .box-header {\n cursor:pointer;\n }\n .box-switch-view i + h3 {\n padding-left:5px;\n }\n .box-header .fa-caret-up {\n transition : all 0.24s ease-in-out;\n -webkit-transition : all 0.24s ease-in-out;\n -moz-transition : all 0.24s ease-in-out;\n -o-transition : all 0.24s ease-in-out;\n -ms-transition : all 0.24s ease-in-out;\n }\n .box-header:hover .fa-caret-up {\n -ms-transform: rotate(180deg); /* IE 9 */\n -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */\n transform: rotate(180deg);\n }\n\n .box-switch-view .icon-not-hover, .box-switch-view:hover .icon-on-hover {\n display:block;\n }\n\n .box-switch-view:hover .icon-not-hover, .box-switch-view .icon-on-hover {\n display:none;\n }\n\n .box-switch-view.box-switch-view-no-border, .box-switch-view-form.box-switch-view-no-border {\n border:none;\n box-shadow:none;\n }\n .box.box-switch-view-form.box-switch-view-no-border {\n margin-bottom:0px;\n }\n</style>\n\n<div *ngIf=\"modeBandeau == true\" class=\"box box-switch-view {{boxStyle}} {{((!boxOpen)?'collapsed-box':'')}}\">\n<!--div *ngIf=\"modeBandeau == true\" class=\"box box-switch-view {{boxStyle}} {{((!boxOpen)?'collapsed-box':'')}}\"-->\n\n <div class=\"box-header with-border\">\n\n <div data-widget=\"collapse\" (click)=\"toggleBoxArrow()\" class=\" sv-box-title-with-icon\">\n <i [ngClass]=\"{'fa':true, 'fa-caret-up':!arrowOpen, 'fa-caret-down':arrowOpen}\"></i>\n <h3 class=\"box-title\">{{title}}</h3>\n </div>\n\n <div class=\"box-tools pull-right\">\n <!--button type=\"button\" class=\"btn btn-box-tool\">\n <i [ngClass]=\"{'fa':true, 'fa-plus':!boxOpen, 'fa-minus':boxOpen}\"></i>\n </button-->\n <button type=\"button\" class=\"btn btn-box-tool\" style=\"position:relative;z-index:100;\" (click)=\"edit()\"><i class=\"fa fa-pencil\"></i> Editer</button>\n </div>\n </div>\n\n <div class=\"box-body\" style=\"position:relative;\">\n\n <div class=\"sv-box-icon hidden-xs\" *ngIf=\"icon != ''\" (click)=\"edit()\">\n <i [ngClass]=\"icon+' icon-not-hover'\"></i>\n <i class=\"fa fa-pencil-square-o icon-on-hover\"></i>\n </div>\n\n <ng-content></ng-content>\n </div>\n</div>\n\n<!--<div class=\"col-md-12 no-padding\" *ngIf=\"modeBandeau == false\">-->\n<div [hidden]=\"modeBandeau\" class=\"col-md-12 no-padding\">\n <!--Identification-->\n <!--div class=\"col-md-12\"--><!--ne mettre qu'un seul cadre, si le parent en veut 2, il peut en ajouter, mais ne sait pas en retirer-->\n <div class=\"box box-primary box-switch-view-form {{boxStyleForm}}\">\n <div class=\"box-header\">\n <h4 class=\"box-title\">{{title}}</h4>\n <div class=\"box-tools pull-right\">\n <button type=\"button\" class=\"btn btn-box-tool\" data-widget=\"collapse\"><i class=\"fa fa-minus text-primary\"></i>\n </button>\n </div>\n </div>\n\n <div class=\"box-body\">\n <form [formGroup]=\"formGroupInline\" autocomplete=\"on\" novalidate>\n <div #bodyBoxFormulaire>\n\n </div>\n </form>\n </div>\n </div>\n <!--/div-->\n</div>\n"
|
1824 | }),
|
1825 | __metadata("design:paramtypes", [SharedService,
|
1826 | ComponentFactoryResolver,
|
1827 | FormBuilder])
|
1828 | ], SwitchViewComponent);
|
1829 | return SwitchViewComponent;
|
1830 | }());
|
1831 |
|
1832 | var SwitchViewModule = (function () {
|
1833 | function SwitchViewModule() {
|
1834 | }
|
1835 | SwitchViewModule = __decorate([
|
1836 | NgModule({
|
1837 | imports: [CommonModule, FormsModule, ReactiveFormsModule],
|
1838 | declarations: [SwitchViewComponent],
|
1839 | exports: [SwitchViewComponent],
|
1840 | providers: [SharedService]
|
1841 | })
|
1842 | ], SwitchViewModule);
|
1843 | return SwitchViewModule;
|
1844 | }());
|
1845 |
|
1846 | var AngularComponentsLibModule = (function () {
|
1847 | function AngularComponentsLibModule() {
|
1848 | }
|
1849 | AngularComponentsLibModule = __decorate([
|
1850 | NgModule({
|
1851 | imports: [
|
1852 | CommonModule, FormsModule, ReactiveFormsModule, SwitchViewModule
|
1853 | ],
|
1854 | declarations: [SelectComponent, TextfieldComponent, DateRangeComponent, DateRangeInputComponent,
|
1855 | DatePickerComponent,
|
1856 | LoadingComponent, LoadableDirective, RadioComponent, DateComponent, TabComponent, TextareaComponent, CheckboxComponent,
|
1857 | NumericComponent,
|
1858 | ShowResumePipe, BoxComponent, ModalComponent],
|
1859 | exports: [SelectComponent, TextfieldComponent, DateRangeComponent, DateRangeInputComponent, DatePickerComponent,
|
1860 | LoadingComponent,
|
1861 | LoadableDirective, RadioComponent, DateComponent,
|
1862 | TabComponent, TextareaComponent, CheckboxComponent, NumericComponent, ShowResumePipe,
|
1863 | BoxComponent,
|
1864 | ModalComponent],
|
1865 | providers: [SharedService],
|
1866 | entryComponents: []
|
1867 | })
|
1868 | ], AngularComponentsLibModule);
|
1869 | return AngularComponentsLibModule;
|
1870 | }());
|
1871 |
|
1872 |
|
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 | export { AngularComponentsLibModule, RadioService, SwitchViewModule as ɵa, SwitchViewComponent as ɵb, SharedService as ɵc, SelectComponent as ɵd, TextfieldComponent as ɵe, DateRangeComponent as ɵf, DateRangeInputComponent as ɵg, DatePickerComponent as ɵh, LoadingComponent as ɵi, LoadableDirective as ɵj, RadioComponent as ɵk, DateComponent as ɵl, TabComponent as ɵm, TabService as ɵn, TextareaComponent as ɵo, CheckboxComponent as ɵp, NumericComponent as ɵq, ShowResumePipe as ɵr, BoxComponent as ɵs, ModalComponent as ɵt };
|
1881 |
|