@fluxhub/fluxhub-lib 1.0.421 → 1.0.423
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/bundles/fluxhub-fluxhub-lib.umd.js +61 -8
- package/bundles/fluxhub-fluxhub-lib.umd.js.map +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js.map +1 -1
- package/esm2015/lib/controls/fhdatepicker.js +39 -8
- package/esm2015/lib/controls/utils/MomentDateAdapter.js +22 -2
- package/esm5/lib/controls/fhdatepicker.js +44 -9
- package/esm5/lib/controls/utils/MomentDateAdapter.js +22 -2
- package/fesm2015/fluxhub-fluxhub-lib.js +58 -8
- package/fesm2015/fluxhub-fluxhub-lib.js.map +1 -1
- package/fesm5/fluxhub-fluxhub-lib.js +62 -9
- package/fesm5/fluxhub-fluxhub-lib.js.map +1 -1
- package/fluxhub-fluxhub-lib.metadata.json +1 -1
- package/lib/controls/fhdatepicker.d.ts +2 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { map, catchError, flatMap } from 'rxjs/operators';
|
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
import { SimpleCrypt } from 'ngx-simple-crypt';
|
|
7
7
|
import { AES, enc } from 'crypto-js';
|
|
8
|
-
import { MatDialogRef, MatDialog, DateAdapter, MAT_DATE_FORMATS, MatAutocompleteModule, MatDialogModule, MatButtonModule, MatButtonToggleModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatExpansionModule, MatFormFieldModule, MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatSelectModule, MatSlideToggleModule, MatSliderModule, MatSidenavModule, MatSnackBarModule, MatStepperModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatPaginatorModule, MatSortModule, MatTableModule, MatNativeDateModule } from '@angular/material';
|
|
8
|
+
import { MatDialogRef, MatDialog, DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatAutocompleteModule, MatDialogModule, MatButtonModule, MatButtonToggleModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatExpansionModule, MatFormFieldModule, MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatSelectModule, MatSlideToggleModule, MatSliderModule, MatSidenavModule, MatSnackBarModule, MatStepperModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatPaginatorModule, MatSortModule, MatTableModule, MatNativeDateModule } from '@angular/material';
|
|
9
9
|
import { NgControl, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
10
10
|
import { FileUploader, FileUploadModule } from 'ng2-file-upload';
|
|
11
11
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
@@ -8562,17 +8562,37 @@ class MomentDateAdapter extends DateAdapter {
|
|
|
8562
8562
|
* @return {?}
|
|
8563
8563
|
*/
|
|
8564
8564
|
parse(value, parseFormat) {
|
|
8565
|
+
console.log('prima value ', value, 'parseFormat ', parseFormat);
|
|
8565
8566
|
if (value != null) {
|
|
8566
8567
|
/** @type {?} */
|
|
8567
8568
|
let arr = value.split('/');
|
|
8569
|
+
console.log('arr ', arr);
|
|
8568
8570
|
if (arr.length == 3) {
|
|
8571
|
+
/** @type {?} */
|
|
8572
|
+
let yy = parseInt(arr[2]);
|
|
8573
|
+
if (yy < 100)
|
|
8574
|
+
yy += 2000;
|
|
8575
|
+
if (arr[1].length == 1)
|
|
8576
|
+
arr[1] = "0" + arr[1];
|
|
8577
|
+
if (arr[0].length == 1)
|
|
8578
|
+
arr[0] = "0" + arr[0];
|
|
8579
|
+
value = arr[0] + "/" + arr[1] + "/" + yy;
|
|
8580
|
+
}
|
|
8581
|
+
arr = value.split('-');
|
|
8582
|
+
console.log('arr ', arr);
|
|
8583
|
+
if (arr.length == 3) {
|
|
8584
|
+
/** @type {?} */
|
|
8585
|
+
let yy = parseInt(arr[2]);
|
|
8586
|
+
if (yy < 100)
|
|
8587
|
+
yy += 2000;
|
|
8569
8588
|
if (arr[1].length == 1)
|
|
8570
8589
|
arr[1] = "0" + arr[1];
|
|
8571
8590
|
if (arr[0].length == 1)
|
|
8572
8591
|
arr[0] = "0" + arr[0];
|
|
8573
|
-
value = arr[0] + "/" + arr[1] + "/" +
|
|
8592
|
+
value = arr[0] + "/" + arr[1] + "/" + yy;
|
|
8574
8593
|
}
|
|
8575
8594
|
}
|
|
8595
|
+
console.log('fine value ', value, 'parseFormat ', parseFormat);
|
|
8576
8596
|
/** @type {?} */
|
|
8577
8597
|
let m = moment(value, parseFormat, true);
|
|
8578
8598
|
if (!m.isValid()) {
|
|
@@ -8726,15 +8746,44 @@ class FHDatePickerComponent extends FHValueAccessor {
|
|
|
8726
8746
|
this.v_view = this.uti_s.date2String(new Date());
|
|
8727
8747
|
this.date_sel = null;
|
|
8728
8748
|
this.v_date_sel = "";
|
|
8729
|
-
this.dateAdapter.setLocale('it');
|
|
8749
|
+
this.dateAdapter.setLocale('it-IT');
|
|
8730
8750
|
}
|
|
8731
8751
|
/**
|
|
8732
|
-
* @param {?}
|
|
8752
|
+
* @param {?} ob
|
|
8733
8753
|
* @return {?}
|
|
8734
8754
|
*/
|
|
8735
|
-
|
|
8755
|
+
checkInput(ob) {
|
|
8756
|
+
console.log('ob ', ob);
|
|
8757
|
+
console.log('date_sel ', this.date_sel);
|
|
8758
|
+
/* if(ob.key=='-')
|
|
8759
|
+
{
|
|
8760
|
+
ob.preventDefault();
|
|
8761
|
+
//this.date_sel+=this.date_sel+'/';
|
|
8762
|
+
this.pickerId.nativeElement.value=this.pickerId.nativeElement.value.split('-').join('/');
|
|
8763
|
+
|
|
8764
|
+
}
|
|
8765
|
+
let arr: Array<string> = this.pickerId.nativeElement.value.split('-').join('/').split('/');
|
|
8766
|
+
console.log(arr);
|
|
8767
|
+
if (arr.length == 3) {
|
|
8768
|
+
let yy=parseInt(arr[2]);
|
|
8769
|
+
|
|
8770
|
+
if(yy<25 && yy!=20){yy+=2000;
|
|
8771
|
+
this.pickerId.nativeElement.value=arr[0]+'/'+arr[1]+'/'+yy;}
|
|
8772
|
+
}*/
|
|
8773
|
+
}
|
|
8774
|
+
;
|
|
8775
|
+
/**
|
|
8776
|
+
* @param {?} event
|
|
8777
|
+
* @return {?}
|
|
8778
|
+
*/
|
|
8779
|
+
dt_chg(event) {
|
|
8780
|
+
console.log('event ', event);
|
|
8781
|
+
/** @type {?} */
|
|
8782
|
+
let s = event.target.value;
|
|
8783
|
+
console.log('s -> ', s);
|
|
8736
8784
|
/** @type {?} */
|
|
8737
8785
|
let arr = s.split('-').join('/').split('/');
|
|
8786
|
+
console.log('arr ', arr);
|
|
8738
8787
|
if (arr.length == 3) {
|
|
8739
8788
|
if (arr[1].length == 1)
|
|
8740
8789
|
arr[1] = "0" + arr[1];
|
|
@@ -8791,7 +8840,6 @@ class FHDatePickerComponent extends FHValueAccessor {
|
|
|
8791
8840
|
* @return {?}
|
|
8792
8841
|
*/
|
|
8793
8842
|
() => {
|
|
8794
|
-
console.log(this.date_sel);
|
|
8795
8843
|
this.ch();
|
|
8796
8844
|
}), 50);
|
|
8797
8845
|
}
|
|
@@ -8862,7 +8910,8 @@ class FHDatePickerComponent extends FHValueAccessor {
|
|
|
8862
8910
|
* @return {?}
|
|
8863
8911
|
*/
|
|
8864
8912
|
setValue(d) {
|
|
8865
|
-
|
|
8913
|
+
console.log('d ', d);
|
|
8914
|
+
this.dateAdapter.setLocale('it-IT');
|
|
8866
8915
|
if (d == null) {
|
|
8867
8916
|
this.date_sel = null;
|
|
8868
8917
|
return;
|
|
@@ -8885,6 +8934,7 @@ FHDatePickerComponent.decorators = [
|
|
|
8885
8934
|
{ provide: MAT_DATE_FORMATS, useValue: ɵ0 },
|
|
8886
8935
|
{ provide: DateAdapter, useClass: MomentDateAdapter },
|
|
8887
8936
|
{ provide: NG_VALUE_ACCESSOR, useExisting: FHDatePickerComponent, multi: true },
|
|
8937
|
+
{ provide: MAT_DATE_LOCALE, useValue: 'it-IT' },
|
|
8888
8938
|
],
|
|
8889
8939
|
template: `
|
|
8890
8940
|
<div [hidden]="!show_buttons||!enabled">
|
|
@@ -8894,7 +8944,7 @@ FHDatePickerComponent.decorators = [
|
|
|
8894
8944
|
</div>
|
|
8895
8945
|
|
|
8896
8946
|
<mat-form-field (click)="chxx($event)" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>
|
|
8897
|
-
<input [disabled]="!enabled" #pickerId (dateChange)="ch( $event)" (focusout)="dt_chg($event
|
|
8947
|
+
<input [disabled]="!enabled" #pickerId (dateChange)="ch( $event)" (focusout)="dt_chg($event)" (keyup)="checkInput($event)"
|
|
8898
8948
|
(click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" >
|
|
8899
8949
|
<mat-datepicker-toggle matSuffix [for]="picker" (click)="chxx($event)"></mat-datepicker-toggle>
|
|
8900
8950
|
<mat-datepicker (click)="chxx($event)" #picker></mat-datepicker>
|