@smartbit4all/ng-client 3.2.14 → 3.2.15
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/smart-form/widgets/components/smart-month-picker/smart-month-picker.component.mjs +26 -14
- package/esm2020/lib/smart-form/widgets/smartformwidget/smartformwidget.component.mjs +8 -7
- package/fesm2015/smartbit4all-ng-client.mjs +32 -19
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +32 -19
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-form/widgets/components/smart-month-picker/smart-month-picker.component.d.ts +1 -0
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.2.15.tgz +0 -0
- package/smartbit4all-ng-client-3.2.14.tgz +0 -0
|
@@ -4479,7 +4479,7 @@ const YEARH_MONTH_FORMAT = {
|
|
|
4479
4479
|
dateInput: 'MM/YYYY',
|
|
4480
4480
|
},
|
|
4481
4481
|
display: {
|
|
4482
|
-
dateInput: 'MM/YYYY',
|
|
4482
|
+
dateInput: 'MM/YYYY' || 'YYYY/MM',
|
|
4483
4483
|
monthYearLabel: 'MMM YYYY',
|
|
4484
4484
|
dateA11yLabel: 'LL',
|
|
4485
4485
|
monthYearA11yLabel: 'MMMM YYYY',
|
|
@@ -4491,23 +4491,35 @@ class SmartMonthPickerComponent {
|
|
|
4491
4491
|
this.SmartWidgetHintPosition = SmartWidgetHint.PositionEnum;
|
|
4492
4492
|
}
|
|
4493
4493
|
ngOnInit() {
|
|
4494
|
-
if (this.widgetInstance.value && this.widgetInstance.value.length) {
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4494
|
+
// if (this.widgetInstance.value && this.widgetInstance.value.length) {
|
|
4495
|
+
// let date = new Date(this.widgetInstance.value);
|
|
4496
|
+
// let valueInMoment = moment(date);
|
|
4497
|
+
// this.date = new FormControl(valueInMoment);
|
|
4498
|
+
// } else {
|
|
4499
|
+
// this.date = new FormControl(moment());
|
|
4500
|
+
// this.valueChange.next(this.date.value);
|
|
4501
|
+
// }
|
|
4502
|
+
moment(this.widgetInstance.value || '');
|
|
4503
|
+
if (this.widgetInstance.value) {
|
|
4504
|
+
let momemtValue = moment(this.widgetInstance.value);
|
|
4505
|
+
this.date = new FormControl(momemtValue);
|
|
4498
4506
|
}
|
|
4499
4507
|
else {
|
|
4500
|
-
|
|
4508
|
+
// let momemtValue = moment();
|
|
4509
|
+
this.date = new FormControl('');
|
|
4501
4510
|
}
|
|
4502
4511
|
}
|
|
4503
4512
|
chosenMonthHandler(moment, datepicker) {
|
|
4504
|
-
const ctrlValue = this.date.value;
|
|
4505
|
-
ctrlValue.month(moment.month());
|
|
4506
|
-
ctrlValue.year(moment.year());
|
|
4507
|
-
this.date.setValue(
|
|
4508
|
-
this.valueChange.next(
|
|
4513
|
+
// const ctrlValue = this.date.value;
|
|
4514
|
+
// ctrlValue.month(moment.month());
|
|
4515
|
+
// ctrlValue.year(moment.year());
|
|
4516
|
+
this.date.setValue(moment);
|
|
4517
|
+
this.valueChange.next(moment);
|
|
4509
4518
|
datepicker.close();
|
|
4510
4519
|
}
|
|
4520
|
+
handleChange(event) {
|
|
4521
|
+
this.valueChange.next(this.date.value);
|
|
4522
|
+
}
|
|
4511
4523
|
}
|
|
4512
4524
|
SmartMonthPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartMonthPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4513
4525
|
SmartMonthPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartMonthPickerComponent, selector: "lib-smart-month-picker", inputs: { widgetInstance: "widgetInstance" }, outputs: { valueChange: "valueChange" }, providers: [
|
|
@@ -4517,7 +4529,7 @@ SmartMonthPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
4517
4529
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
4518
4530
|
},
|
|
4519
4531
|
{ provide: MAT_DATE_FORMATS, useValue: YEARH_MONTH_FORMAT },
|
|
4520
|
-
], ngImport: i0, template: "<div class=\"smart-month-picker-container\">\r\n <mat-form-field appearance=\"outline\">\r\n <input
|
|
4532
|
+
], ngImport: i0, template: "<div class=\"smart-month-picker-container\">\r\n <mat-form-field appearance=\"outline\">\r\n <input\r\n matInput\r\n [matDatepicker]=\"dp\"\r\n placeholder=\"Month and Year\"\r\n [formControl]=\"date\"\r\n (input)=\"handleChange($event)\"\r\n />\r\n <mat-datepicker-toggle matSuffix [for]=\"dp\"></mat-datepicker-toggle>\r\n <mat-datepicker\r\n #dp\r\n startView=\"multi-year\"\r\n (monthSelected)=\"chosenMonthHandler($event, dp)\"\r\n panelClass=\"example-month-picker\"\r\n >\r\n </mat-datepicker>\r\n </mat-form-field>\r\n <div class=\"smart-month-picker-hint\">\r\n <mat-hint\r\n *ngIf=\"\r\n !widgetInstance?.hint || widgetInstance?.hint?.position === SmartWidgetHintPosition.Input\r\n \"\r\n >{{ widgetInstance.hint?.text }}</mat-hint\r\n >\r\n </div>\r\n</div>\r\n", styles: [""], components: [{ type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2$3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { type: i2$3.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }], directives: [{ type: i3$3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i2$3.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { type: i20.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: i20.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i20.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3$2.MatSuffix, selector: "[matSuffix]" }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }] });
|
|
4521
4533
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartMonthPickerComponent, decorators: [{
|
|
4522
4534
|
type: Component,
|
|
4523
4535
|
args: [{ selector: 'lib-smart-month-picker', providers: [
|
|
@@ -4527,7 +4539,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
4527
4539
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
4528
4540
|
},
|
|
4529
4541
|
{ provide: MAT_DATE_FORMATS, useValue: YEARH_MONTH_FORMAT },
|
|
4530
|
-
], template: "<div class=\"smart-month-picker-container\">\r\n <mat-form-field appearance=\"outline\">\r\n <input
|
|
4542
|
+
], template: "<div class=\"smart-month-picker-container\">\r\n <mat-form-field appearance=\"outline\">\r\n <input\r\n matInput\r\n [matDatepicker]=\"dp\"\r\n placeholder=\"Month and Year\"\r\n [formControl]=\"date\"\r\n (input)=\"handleChange($event)\"\r\n />\r\n <mat-datepicker-toggle matSuffix [for]=\"dp\"></mat-datepicker-toggle>\r\n <mat-datepicker\r\n #dp\r\n startView=\"multi-year\"\r\n (monthSelected)=\"chosenMonthHandler($event, dp)\"\r\n panelClass=\"example-month-picker\"\r\n >\r\n </mat-datepicker>\r\n </mat-form-field>\r\n <div class=\"smart-month-picker-hint\">\r\n <mat-hint\r\n *ngIf=\"\r\n !widgetInstance?.hint || widgetInstance?.hint?.position === SmartWidgetHintPosition.Input\r\n \"\r\n >{{ widgetInstance.hint?.text }}</mat-hint\r\n >\r\n </div>\r\n</div>\r\n", styles: [""] }]
|
|
4531
4543
|
}], propDecorators: { widgetInstance: [{
|
|
4532
4544
|
type: Input
|
|
4533
4545
|
}], valueChange: [{
|
|
@@ -4786,11 +4798,13 @@ class SmartformwidgetComponent {
|
|
|
4786
4798
|
}
|
|
4787
4799
|
}
|
|
4788
4800
|
setDateFormControl(dateFormControl, _moment, timeValue) {
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4801
|
+
if (_moment) {
|
|
4802
|
+
let hour = timeValue.substring(0, 2);
|
|
4803
|
+
let min = timeValue.substring(3, 5);
|
|
4804
|
+
_moment.hour(hour);
|
|
4805
|
+
_moment.minute(min);
|
|
4806
|
+
dateFormControl.setValue(_moment);
|
|
4807
|
+
}
|
|
4794
4808
|
}
|
|
4795
4809
|
getTime() {
|
|
4796
4810
|
if (this.widgetInstance.type === SmartFormWidgetType.DATE_TIME_PICKER) {
|
|
@@ -5096,7 +5110,6 @@ class SmartformwidgetComponent {
|
|
|
5096
5110
|
});
|
|
5097
5111
|
}
|
|
5098
5112
|
handleYearMonthPicked(yearMonthValue) {
|
|
5099
|
-
console.log(yearMonthValue);
|
|
5100
5113
|
this.setDateFormControl(this.form.controls[this.widgetInstance.key], yearMonthValue, '00:00');
|
|
5101
5114
|
}
|
|
5102
5115
|
compareItems(o1, o2) {
|