@resolveio/client-lib-core 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/models/dialog.model.mjs +1 -1
- package/esm2020/lib/widgets/dialog/dialog.select-datetime.content.mjs +113 -68
- package/esm2020/lib/widgets/dialog/dialog.service.mjs +4 -3
- package/fesm2015/resolveio-client-lib-core.mjs +113 -68
- package/fesm2015/resolveio-client-lib-core.mjs.map +1 -1
- package/fesm2020/resolveio-client-lib-core.mjs +113 -68
- package/fesm2020/resolveio-client-lib-core.mjs.map +1 -1
- package/lib/models/dialog.model.d.ts +1 -1
- package/lib/widgets/dialog/dialog.select-datetime.content.d.ts +8 -3
- package/lib/widgets/dialog/dialog.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2377,6 +2377,7 @@ class DialogSelectDateTimeContent {
|
|
|
2377
2377
|
this._activeModal = _activeModal;
|
|
2378
2378
|
this._fb = _fb;
|
|
2379
2379
|
this.title = '';
|
|
2380
|
+
this.showTime = true;
|
|
2380
2381
|
}
|
|
2381
2382
|
ngOnInit() {
|
|
2382
2383
|
if (!this.date) {
|
|
@@ -2387,12 +2388,45 @@ class DialogSelectDateTimeContent {
|
|
|
2387
2388
|
date: [{ year: this.date.getFullYear(), month: this.date.getMonth() + 1, day: this.date.getDate() }, [Validators.required]]
|
|
2388
2389
|
});
|
|
2389
2390
|
}
|
|
2391
|
+
ngAfterViewInit() {
|
|
2392
|
+
setTimeout(() => {
|
|
2393
|
+
let foundElement = this.recursiveFindFirstElement(this.allElements.nativeElement);
|
|
2394
|
+
if (foundElement) {
|
|
2395
|
+
foundElement.focus();
|
|
2396
|
+
}
|
|
2397
|
+
else {
|
|
2398
|
+
this.close.nativeElement.focus();
|
|
2399
|
+
this.close.nativeElement.blur();
|
|
2400
|
+
}
|
|
2401
|
+
}, 100);
|
|
2402
|
+
}
|
|
2403
|
+
recursiveFindFirstElement(element) {
|
|
2404
|
+
let foundElement = null;
|
|
2405
|
+
let htmlCol = element.children;
|
|
2406
|
+
for (let i = 0; i < Object.keys(htmlCol).length; i++) {
|
|
2407
|
+
let key = Object.keys(htmlCol)[i];
|
|
2408
|
+
let htmlElem = htmlCol[key];
|
|
2409
|
+
if (htmlElem.children && htmlElem.children.length) {
|
|
2410
|
+
foundElement = this.recursiveFindFirstElement(htmlElem);
|
|
2411
|
+
}
|
|
2412
|
+
else if (htmlElem.tagName === 'BUTTON' && htmlElem.classList.contains('close')) {
|
|
2413
|
+
return null;
|
|
2414
|
+
}
|
|
2415
|
+
else if ((htmlElem.tagName === 'BUTTON' || htmlElem.tagName === 'INPUT' || htmlElem.tagName === 'SELECT' || htmlElem.tagName === 'TEXTAREA') && !htmlElem.hidden && !htmlElem.disabled) {
|
|
2416
|
+
return htmlElem;
|
|
2417
|
+
}
|
|
2418
|
+
if (foundElement) {
|
|
2419
|
+
break;
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
return foundElement;
|
|
2423
|
+
}
|
|
2390
2424
|
submitForm() {
|
|
2391
2425
|
this._activeModal.close(new Date(this.form.value.date.year, parseInt(this.form.value.date.month) - 1, this.form.value.date.day, this.form.value.time.hour, this.form.value.time.minute, this.form.value.time.second, 0));
|
|
2392
2426
|
}
|
|
2393
2427
|
}
|
|
2394
2428
|
DialogSelectDateTimeContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: DialogSelectDateTimeContent, deps: [{ token: i1$4.NgbActiveModal }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
2395
|
-
DialogSelectDateTimeContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: DialogSelectDateTimeContent, selector: "ng-component", inputs: { title: "title", date: "date" }, ngImport: i0, template: `
|
|
2429
|
+
DialogSelectDateTimeContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: DialogSelectDateTimeContent, selector: "ng-component", inputs: { title: "title", date: "date", showTime: "showTime" }, viewQueries: [{ propertyName: "close", first: true, predicate: ["close"], descendants: true }, { propertyName: "allElements", first: true, predicate: ["allElements"], descendants: true }], ngImport: i0, template: `
|
|
2396
2430
|
<style>
|
|
2397
2431
|
table {
|
|
2398
2432
|
width: 100%;
|
|
@@ -2408,41 +2442,42 @@ DialogSelectDateTimeContent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
2408
2442
|
text-align: center;
|
|
2409
2443
|
}
|
|
2410
2444
|
</style>
|
|
2411
|
-
<
|
|
2412
|
-
<
|
|
2413
|
-
<
|
|
2414
|
-
|
|
2415
|
-
<
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2445
|
+
<div #allElements>
|
|
2446
|
+
<form [formGroup]="form" novalidate (ngSubmit)="submitForm()">
|
|
2447
|
+
<div class="modal-header">
|
|
2448
|
+
<h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>
|
|
2449
|
+
<button type="button" class="close" aria-label="Close" (click)="_activeModal.dismiss()" #close>
|
|
2450
|
+
<span aria-hidden="true">×</span>
|
|
2451
|
+
</button>
|
|
2452
|
+
</div>
|
|
2453
|
+
<div class="modal-body">
|
|
2454
|
+
<table>
|
|
2455
|
+
<tr>
|
|
2456
|
+
<td style="border: none;">
|
|
2457
|
+
<div class="input-group">
|
|
2458
|
+
<input class="form-control" placeholder="yyyy-mm-dd" name="dp" formControlName="date" ngbDatepicker [firstDayOfWeek]="7" #d="ngbDatepicker">
|
|
2459
|
+
<div class="input-group-append" (click)="d.toggle()">
|
|
2460
|
+
<div class="input-group-text">
|
|
2461
|
+
<i class="fa fa-calendar" aria-hidden="true"></i>
|
|
2462
|
+
</div>
|
|
2428
2463
|
</div>
|
|
2429
2464
|
</div>
|
|
2430
|
-
</
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
</
|
|
2436
|
-
</
|
|
2437
|
-
</
|
|
2438
|
-
</
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
</
|
|
2444
|
-
</
|
|
2445
|
-
`, isInline: true, styles: ["\n\t\t \ttable {\n\t\t\t\twidth: 100%;\n\t\t\t\ttable-layout: fixed;\n\t\t\t}\n\n\t\t\ttr {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\ttd {\n\t\t\t\twidth: 100%;\n\t\t\t\ttext-align: center;\n\t\t\t}\n\t\t"], components: [{ type: i1$4.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"] }, { type: FormButtonComponent, selector: "form-button", inputs: ["form", "disabled"] }], directives: [{ type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { 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]" }, { 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"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
|
|
2465
|
+
</td>
|
|
2466
|
+
<td *ngIf="showTime" style="border: none;">
|
|
2467
|
+
<div class="offset-3">
|
|
2468
|
+
<ngb-timepicker formControlName="time" meridian="ON"></ngb-timepicker>
|
|
2469
|
+
</div>
|
|
2470
|
+
</td>
|
|
2471
|
+
</tr>
|
|
2472
|
+
</table>
|
|
2473
|
+
</div>
|
|
2474
|
+
<div class="modal-footer">
|
|
2475
|
+
<form-button [form]="form"></form-button>
|
|
2476
|
+
<button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>
|
|
2477
|
+
</div>
|
|
2478
|
+
</form>
|
|
2479
|
+
</div>
|
|
2480
|
+
`, isInline: true, styles: ["\n\t\t \ttable {\n\t\t\t\twidth: 100%;\n\t\t\t\ttable-layout: fixed;\n\t\t\t}\n\n\t\t\ttr {\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\ttd {\n\t\t\t\twidth: 100%;\n\t\t\t\ttext-align: center;\n\t\t\t}\n\t\t"], components: [{ type: i1$4.NgbTimepicker, selector: "ngb-timepicker", inputs: ["meridian", "spinners", "seconds", "hourStep", "minuteStep", "secondStep", "readonlyInputs", "size"] }, { type: FormButtonComponent, selector: "form-button", inputs: ["form", "disabled"] }], directives: [{ type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { 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]" }, { 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"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2446
2481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: DialogSelectDateTimeContent, decorators: [{
|
|
2447
2482
|
type: Component,
|
|
2448
2483
|
args: [{
|
|
@@ -2462,46 +2497,55 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImpor
|
|
|
2462
2497
|
text-align: center;
|
|
2463
2498
|
}
|
|
2464
2499
|
</style>
|
|
2465
|
-
<
|
|
2466
|
-
<
|
|
2467
|
-
<
|
|
2468
|
-
|
|
2469
|
-
<
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2500
|
+
<div #allElements>
|
|
2501
|
+
<form [formGroup]="form" novalidate (ngSubmit)="submitForm()">
|
|
2502
|
+
<div class="modal-header">
|
|
2503
|
+
<h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>
|
|
2504
|
+
<button type="button" class="close" aria-label="Close" (click)="_activeModal.dismiss()" #close>
|
|
2505
|
+
<span aria-hidden="true">×</span>
|
|
2506
|
+
</button>
|
|
2507
|
+
</div>
|
|
2508
|
+
<div class="modal-body">
|
|
2509
|
+
<table>
|
|
2510
|
+
<tr>
|
|
2511
|
+
<td style="border: none;">
|
|
2512
|
+
<div class="input-group">
|
|
2513
|
+
<input class="form-control" placeholder="yyyy-mm-dd" name="dp" formControlName="date" ngbDatepicker [firstDayOfWeek]="7" #d="ngbDatepicker">
|
|
2514
|
+
<div class="input-group-append" (click)="d.toggle()">
|
|
2515
|
+
<div class="input-group-text">
|
|
2516
|
+
<i class="fa fa-calendar" aria-hidden="true"></i>
|
|
2517
|
+
</div>
|
|
2482
2518
|
</div>
|
|
2483
2519
|
</div>
|
|
2484
|
-
</
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
</
|
|
2490
|
-
</
|
|
2491
|
-
</
|
|
2492
|
-
</
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
</
|
|
2498
|
-
</
|
|
2520
|
+
</td>
|
|
2521
|
+
<td *ngIf="showTime" style="border: none;">
|
|
2522
|
+
<div class="offset-3">
|
|
2523
|
+
<ngb-timepicker formControlName="time" meridian="ON"></ngb-timepicker>
|
|
2524
|
+
</div>
|
|
2525
|
+
</td>
|
|
2526
|
+
</tr>
|
|
2527
|
+
</table>
|
|
2528
|
+
</div>
|
|
2529
|
+
<div class="modal-footer">
|
|
2530
|
+
<form-button [form]="form"></form-button>
|
|
2531
|
+
<button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>
|
|
2532
|
+
</div>
|
|
2533
|
+
</form>
|
|
2534
|
+
</div>
|
|
2499
2535
|
`
|
|
2500
2536
|
}]
|
|
2501
2537
|
}], ctorParameters: function () { return [{ type: i1$4.NgbActiveModal }, { type: i2.FormBuilder }]; }, propDecorators: { title: [{
|
|
2502
2538
|
type: Input
|
|
2503
2539
|
}], date: [{
|
|
2504
2540
|
type: Input
|
|
2541
|
+
}], showTime: [{
|
|
2542
|
+
type: Input
|
|
2543
|
+
}], close: [{
|
|
2544
|
+
type: ViewChild,
|
|
2545
|
+
args: ['close', { static: false }]
|
|
2546
|
+
}], allElements: [{
|
|
2547
|
+
type: ViewChild,
|
|
2548
|
+
args: ['allElements', { static: false }]
|
|
2505
2549
|
}] } });
|
|
2506
2550
|
|
|
2507
2551
|
// tslint:disable-next-line:component-class-suffix
|
|
@@ -4126,10 +4170,11 @@ class DialogService {
|
|
|
4126
4170
|
modalRef.componentInstance.html = html;
|
|
4127
4171
|
return modalRef.result;
|
|
4128
4172
|
}
|
|
4129
|
-
selectDateTime(date) {
|
|
4173
|
+
selectDateTime(date, showTime = true) {
|
|
4130
4174
|
const modalRef = this.openDialog(DialogSelectDateTimeContent);
|
|
4131
|
-
modalRef.componentInstance.title = 'Select Date and Time';
|
|
4175
|
+
modalRef.componentInstance.title = 'Select Date' + (showTime ? ' and Time' : '');
|
|
4132
4176
|
modalRef.componentInstance.date = date;
|
|
4177
|
+
modalRef.componentInstance.showTime = showTime;
|
|
4133
4178
|
return modalRef.result;
|
|
4134
4179
|
}
|
|
4135
4180
|
selectDataLabel(data, showArraySubData = true) {
|