@resolveio/client-lib-core 15.1.6 → 15.1.8

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.
@@ -5,7 +5,7 @@ import * as i1$5 from 'ngx-device-detector';
5
5
  import { DeviceDetectorService } from 'ngx-device-detector';
6
6
  import * as i1 from '@angular/platform-browser';
7
7
  import * as i2 from '@angular/forms';
8
- import { FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
+ import { UntypedFormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
9
  import * as i1$1 from 'ngx-toastr';
10
10
  import { ToastrModule } from 'ngx-toastr';
11
11
  import * as i1$2 from 'ngx-localstorage';
@@ -276,7 +276,7 @@ class SocketService {
276
276
  this.onErrorHandler = (event) => {
277
277
  this.log(new Date(), 'WS', 'onerror', this, event);
278
278
  this.onerror(event);
279
- this.close();
279
+ this.reconnect();
280
280
  };
281
281
  document.addEventListener('visibilitychange', this.handleVisibilityChange.bind(this));
282
282
  }
@@ -331,7 +331,7 @@ class SocketService {
331
331
  this.send('ping');
332
332
  this.pongTimeout = setTimeout(() => {
333
333
  this.log(new Date(), 'WS', 'pong not received, closing connection');
334
- this.close();
334
+ this.reconnect();
335
335
  }, this.pongTimeoutTime);
336
336
  }
337
337
  else {
@@ -385,10 +385,7 @@ class SocketService {
385
385
  }
386
386
  reconnect() {
387
387
  this.log(new Date(), 'WS', 'reconnect', this.readyState);
388
- if (this.readyState === WebSocket.CLOSED) {
389
- this.connect();
390
- }
391
- else if (this.readyState !== WebSocket.CONNECTING) {
388
+ if (this.readyState !== WebSocket.CONNECTING) {
392
389
  this.close();
393
390
  }
394
391
  }
@@ -2209,11 +2206,27 @@ class DialogInputContent {
2209
2206
  ngOnInit() {
2210
2207
  this.formInput = this._fb.group({});
2211
2208
  for (let i = 0; i < this.inputFields.length; i++) {
2212
- if (this.inputFields[i].validators === null) {
2213
- this.formInput.addControl(this.inputFields[i].form, new FormControl({ value: this.inputFields[i].data, disabled: this.inputFields[i].disabled }));
2209
+ if (this.inputFields[i].type !== 'datetime') {
2210
+ if (this.inputFields[i].validators === null) {
2211
+ this.formInput.addControl(this.inputFields[i].form, new UntypedFormControl({ value: this.inputFields[i].data, disabled: this.inputFields[i].disabled }));
2212
+ }
2213
+ else {
2214
+ this.formInput.addControl(this.inputFields[i].form, new UntypedFormControl({ value: this.inputFields[i].data, disabled: this.inputFields[i].disabled }, this.inputFields[i].validators));
2215
+ }
2214
2216
  }
2215
2217
  else {
2216
- this.formInput.addControl(this.inputFields[i].form, new FormControl({ value: this.inputFields[i].data, disabled: this.inputFields[i].disabled }, this.inputFields[i].validators));
2218
+ if (this.inputFields[i].validators === null) {
2219
+ this.formInput.addControl(this.inputFields[i].form, new UntypedFormControl({ value: this.inputFields[i].data[0], disabled: this.inputFields[i].disabled }));
2220
+ }
2221
+ else {
2222
+ this.formInput.addControl(this.inputFields[i].form, new UntypedFormControl({ value: this.inputFields[i].data[0], disabled: this.inputFields[i].disabled }, this.inputFields[i].validators));
2223
+ }
2224
+ if (this.inputFields[i].validators === null) {
2225
+ this.formInput.addControl(this.inputFields[i].form + '_time', new UntypedFormControl({ value: this.inputFields[i].data[1], disabled: this.inputFields[i].disabled }));
2226
+ }
2227
+ else {
2228
+ this.formInput.addControl(this.inputFields[i].form + '_time', new UntypedFormControl({ value: this.inputFields[i].data[1], disabled: this.inputFields[i].disabled }, this.inputFields[i].validators));
2229
+ }
2217
2230
  }
2218
2231
  }
2219
2232
  }
@@ -2260,7 +2273,7 @@ DialogInputContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
2260
2273
  <label class="form-control-label">{{inputField.label}}</label>
2261
2274
  <em *ngIf="formInput.controls[inputField.form].hasError('required') && inputField.required">- Required</em>
2262
2275
  <em *ngIf="!formInput.controls[inputField.form].hasError('required') && formInput.controls[inputField.form].invalid">- Invalid</em>
2263
- <div *ngIf="inputField.type !== 'state' && inputField.type !== 'textarea' && inputField.type !== 'number' && inputField.type !== 'select' && inputField.type !== 'boolean'">
2276
+ <div *ngIf="inputField.type !== 'date' && inputField.type !== 'datetime' && inputField.type !== 'state' && inputField.type !== 'textarea' && inputField.type !== 'number' && inputField.type !== 'select' && inputField.type !== 'boolean'">
2264
2277
  <input [autofocus]="i === 0 ? true : false" [focus]="i === 0 ? true : false" [formControlName]="inputField.form" [ngClass]="['form-control', validateInput(inputField, formInput)]" [type]="(inputField.type ? inputField.type : 'text')">
2265
2278
  <ng-container *ngFor="let errorMsg of getErrorMessages(inputField, formInput);">
2266
2279
  <div class="invalid-feedback">{{errorMsg}}</div>
@@ -2295,6 +2308,35 @@ DialogInputContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
2295
2308
  <div class="invalid-feedback">{{errorMsg}}</div>
2296
2309
  </ng-container>
2297
2310
  </div>
2311
+ <div *ngIf="inputField.type === 'date'">
2312
+ <div class="input-group">
2313
+ <input [formControlName]="inputField.form" placeholder="yyyy-mm-dd" ngbDatepicker [firstDayOfWeek]="7" #d="ngbDatepicker" [ngClass]="['form-control', validateInput(inputField, formInput)]" (click)="d.toggle()">
2314
+ <div class="input-group-append" (click)="d.toggle()">
2315
+ <div class="input-group-text">
2316
+ <i class="fa fa-calendar" aria-hidden="true"></i>
2317
+ </div>
2318
+ </div>
2319
+ </div>
2320
+ </div>
2321
+ <div *ngIf="inputField.type === 'datetime'">
2322
+ <div class="row" style="align-items: center;">
2323
+ <div class="col-sm-8">
2324
+ <label class="form-control-label" style="align-items: top;">Date/Time</label>
2325
+ <div class="input-group">
2326
+ <input [formControlName]="inputField.form" placeholder="yyyy-mm-dd" ngbDatepicker [firstDayOfWeek]="7" #d="ngbDatepicker" [ngClass]="['form-control', validateInput(inputField, formInput)]" (click)="d.toggle()">
2327
+ <div class="input-group-append" (click)="d.toggle()">
2328
+ <div class="input-group-text">
2329
+ <i class="fa fa-calendar" aria-hidden="true"></i>
2330
+ </div>
2331
+ </div>
2332
+ </div>
2333
+ </div>
2334
+ <div class="col-sm-4">
2335
+ <label class="form-control-label" style="align-items: top;">&nbsp;</label>
2336
+ <ngb-timepicker [formControlName]="inputField.form + '_time'" meridian="ON" [ngClass]="[validateInput(inputField, formInput)]"></ngb-timepicker>
2337
+ </div>
2338
+ </div>
2339
+ </div>
2298
2340
  <div *ngIf="inputField.type === 'boolean'" (click)="formInput.controls[inputField.form].setValue(!formInput.controls[inputField.form].value)">
2299
2341
  <i *ngIf="formInput.controls[inputField.form].value" class="fa fa-check" style="color: green; font-size: 24px;" aria-hidden="true"></i>
2300
2342
  <i *ngIf="!formInput.controls[inputField.form].value" class="fa fa-times" style="color: red; font-size: 24px;" aria-hidden="true"></i>
@@ -2307,7 +2349,7 @@ DialogInputContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
2307
2349
  <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>
2308
2350
  </div>
2309
2351
  </form>
2310
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FormButtonComponent, selector: "form-button", inputs: ["form", "disabled", "type"] }, { kind: "component", type: i4$1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i4$1.NgOptionComponent, selector: "ng-option", inputs: ["value", "disabled"] }, { kind: "directive", type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: FocusDirective, selector: "[focus]", inputs: ["focus"] }] });
2352
+ `, isInline: true, dependencies: [{ kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$4.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "component", type: i1$4.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"] }, { kind: "component", type: FormButtonComponent, selector: "form-button", inputs: ["form", "disabled", "type"] }, { kind: "component", type: i4$1.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "component", type: i4$1.NgOptionComponent, selector: "ng-option", inputs: ["value", "disabled"] }, { kind: "directive", type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: FocusDirective, selector: "[focus]", inputs: ["focus"] }] });
2311
2353
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialogInputContent, decorators: [{
2312
2354
  type: Component,
2313
2355
  args: [{
@@ -2325,7 +2367,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2325
2367
  <label class="form-control-label">{{inputField.label}}</label>
2326
2368
  <em *ngIf="formInput.controls[inputField.form].hasError('required') && inputField.required">- Required</em>
2327
2369
  <em *ngIf="!formInput.controls[inputField.form].hasError('required') && formInput.controls[inputField.form].invalid">- Invalid</em>
2328
- <div *ngIf="inputField.type !== 'state' && inputField.type !== 'textarea' && inputField.type !== 'number' && inputField.type !== 'select' && inputField.type !== 'boolean'">
2370
+ <div *ngIf="inputField.type !== 'date' && inputField.type !== 'datetime' && inputField.type !== 'state' && inputField.type !== 'textarea' && inputField.type !== 'number' && inputField.type !== 'select' && inputField.type !== 'boolean'">
2329
2371
  <input [autofocus]="i === 0 ? true : false" [focus]="i === 0 ? true : false" [formControlName]="inputField.form" [ngClass]="['form-control', validateInput(inputField, formInput)]" [type]="(inputField.type ? inputField.type : 'text')">
2330
2372
  <ng-container *ngFor="let errorMsg of getErrorMessages(inputField, formInput);">
2331
2373
  <div class="invalid-feedback">{{errorMsg}}</div>
@@ -2360,6 +2402,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
2360
2402
  <div class="invalid-feedback">{{errorMsg}}</div>
2361
2403
  </ng-container>
2362
2404
  </div>
2405
+ <div *ngIf="inputField.type === 'date'">
2406
+ <div class="input-group">
2407
+ <input [formControlName]="inputField.form" placeholder="yyyy-mm-dd" ngbDatepicker [firstDayOfWeek]="7" #d="ngbDatepicker" [ngClass]="['form-control', validateInput(inputField, formInput)]" (click)="d.toggle()">
2408
+ <div class="input-group-append" (click)="d.toggle()">
2409
+ <div class="input-group-text">
2410
+ <i class="fa fa-calendar" aria-hidden="true"></i>
2411
+ </div>
2412
+ </div>
2413
+ </div>
2414
+ </div>
2415
+ <div *ngIf="inputField.type === 'datetime'">
2416
+ <div class="row" style="align-items: center;">
2417
+ <div class="col-sm-8">
2418
+ <label class="form-control-label" style="align-items: top;">Date/Time</label>
2419
+ <div class="input-group">
2420
+ <input [formControlName]="inputField.form" placeholder="yyyy-mm-dd" ngbDatepicker [firstDayOfWeek]="7" #d="ngbDatepicker" [ngClass]="['form-control', validateInput(inputField, formInput)]" (click)="d.toggle()">
2421
+ <div class="input-group-append" (click)="d.toggle()">
2422
+ <div class="input-group-text">
2423
+ <i class="fa fa-calendar" aria-hidden="true"></i>
2424
+ </div>
2425
+ </div>
2426
+ </div>
2427
+ </div>
2428
+ <div class="col-sm-4">
2429
+ <label class="form-control-label" style="align-items: top;">&nbsp;</label>
2430
+ <ngb-timepicker [formControlName]="inputField.form + '_time'" meridian="ON" [ngClass]="[validateInput(inputField, formInput)]"></ngb-timepicker>
2431
+ </div>
2432
+ </div>
2433
+ </div>
2363
2434
  <div *ngIf="inputField.type === 'boolean'" (click)="formInput.controls[inputField.form].setValue(!formInput.controls[inputField.form].value)">
2364
2435
  <i *ngIf="formInput.controls[inputField.form].value" class="fa fa-check" style="color: green; font-size: 24px;" aria-hidden="true"></i>
2365
2436
  <i *ngIf="!formInput.controls[inputField.form].value" class="fa fa-times" style="color: red; font-size: 24px;" aria-hidden="true"></i>