@smartbit4all/ng-client 3.2.13 → 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 +9 -8
- package/fesm2015/smartbit4all-ng-client.mjs +33 -20
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +33 -20
- 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.13.tgz +0 -0
|
@@ -4525,7 +4525,7 @@ const YEARH_MONTH_FORMAT = {
|
|
|
4525
4525
|
dateInput: 'MM/YYYY',
|
|
4526
4526
|
},
|
|
4527
4527
|
display: {
|
|
4528
|
-
dateInput: 'MM/YYYY',
|
|
4528
|
+
dateInput: 'MM/YYYY' || 'YYYY/MM',
|
|
4529
4529
|
monthYearLabel: 'MMM YYYY',
|
|
4530
4530
|
dateA11yLabel: 'LL',
|
|
4531
4531
|
monthYearA11yLabel: 'MMMM YYYY',
|
|
@@ -4537,23 +4537,35 @@ class SmartMonthPickerComponent {
|
|
|
4537
4537
|
this.SmartWidgetHintPosition = SmartWidgetHint.PositionEnum;
|
|
4538
4538
|
}
|
|
4539
4539
|
ngOnInit() {
|
|
4540
|
-
if (this.widgetInstance.value && this.widgetInstance.value.length) {
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4540
|
+
// if (this.widgetInstance.value && this.widgetInstance.value.length) {
|
|
4541
|
+
// let date = new Date(this.widgetInstance.value);
|
|
4542
|
+
// let valueInMoment = moment(date);
|
|
4543
|
+
// this.date = new FormControl(valueInMoment);
|
|
4544
|
+
// } else {
|
|
4545
|
+
// this.date = new FormControl(moment());
|
|
4546
|
+
// this.valueChange.next(this.date.value);
|
|
4547
|
+
// }
|
|
4548
|
+
moment(this.widgetInstance.value || '');
|
|
4549
|
+
if (this.widgetInstance.value) {
|
|
4550
|
+
let momemtValue = moment(this.widgetInstance.value);
|
|
4551
|
+
this.date = new FormControl(momemtValue);
|
|
4544
4552
|
}
|
|
4545
4553
|
else {
|
|
4546
|
-
|
|
4554
|
+
// let momemtValue = moment();
|
|
4555
|
+
this.date = new FormControl('');
|
|
4547
4556
|
}
|
|
4548
4557
|
}
|
|
4549
4558
|
chosenMonthHandler(moment, datepicker) {
|
|
4550
|
-
const ctrlValue = this.date.value;
|
|
4551
|
-
ctrlValue.month(moment.month());
|
|
4552
|
-
ctrlValue.year(moment.year());
|
|
4553
|
-
this.date.setValue(
|
|
4554
|
-
this.valueChange.next(
|
|
4559
|
+
// const ctrlValue = this.date.value;
|
|
4560
|
+
// ctrlValue.month(moment.month());
|
|
4561
|
+
// ctrlValue.year(moment.year());
|
|
4562
|
+
this.date.setValue(moment);
|
|
4563
|
+
this.valueChange.next(moment);
|
|
4555
4564
|
datepicker.close();
|
|
4556
4565
|
}
|
|
4566
|
+
handleChange(event) {
|
|
4567
|
+
this.valueChange.next(this.date.value);
|
|
4568
|
+
}
|
|
4557
4569
|
}
|
|
4558
4570
|
SmartMonthPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartMonthPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4559
4571
|
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: [
|
|
@@ -4563,7 +4575,7 @@ SmartMonthPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
4563
4575
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
4564
4576
|
},
|
|
4565
4577
|
{ provide: MAT_DATE_FORMATS, useValue: YEARH_MONTH_FORMAT },
|
|
4566
|
-
], ngImport: i0, template: "<div class=\"smart-month-picker-container\">\r\n <mat-form-field appearance=\"outline\">\r\n <input
|
|
4578
|
+
], 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"] }] });
|
|
4567
4579
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartMonthPickerComponent, decorators: [{
|
|
4568
4580
|
type: Component,
|
|
4569
4581
|
args: [{ selector: 'lib-smart-month-picker', providers: [
|
|
@@ -4573,7 +4585,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
4573
4585
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
4574
4586
|
},
|
|
4575
4587
|
{ provide: MAT_DATE_FORMATS, useValue: YEARH_MONTH_FORMAT },
|
|
4576
|
-
], template: "<div class=\"smart-month-picker-container\">\r\n <mat-form-field appearance=\"outline\">\r\n <input
|
|
4588
|
+
], 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: [""] }]
|
|
4577
4589
|
}], propDecorators: { widgetInstance: [{
|
|
4578
4590
|
type: Input
|
|
4579
4591
|
}], valueChange: [{
|
|
@@ -4826,11 +4838,13 @@ class SmartformwidgetComponent {
|
|
|
4826
4838
|
}
|
|
4827
4839
|
}
|
|
4828
4840
|
setDateFormControl(dateFormControl, _moment, timeValue) {
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4841
|
+
if (_moment) {
|
|
4842
|
+
let hour = timeValue.substring(0, 2);
|
|
4843
|
+
let min = timeValue.substring(3, 5);
|
|
4844
|
+
_moment.hour(hour);
|
|
4845
|
+
_moment.minute(min);
|
|
4846
|
+
dateFormControl.setValue(_moment);
|
|
4847
|
+
}
|
|
4834
4848
|
}
|
|
4835
4849
|
getTime() {
|
|
4836
4850
|
if (this.widgetInstance.type === SmartFormWidgetType.DATE_TIME_PICKER) {
|
|
@@ -5110,7 +5124,7 @@ class SmartformwidgetComponent {
|
|
|
5110
5124
|
return this.widgetInstance.valueList.filter((option) => option.label.toLowerCase().includes(filterValue));
|
|
5111
5125
|
}
|
|
5112
5126
|
else {
|
|
5113
|
-
this.widgetInstance.valueList;
|
|
5127
|
+
return this.widgetInstance.valueList;
|
|
5114
5128
|
}
|
|
5115
5129
|
}
|
|
5116
5130
|
return [];
|
|
@@ -5131,7 +5145,6 @@ class SmartformwidgetComponent {
|
|
|
5131
5145
|
});
|
|
5132
5146
|
}
|
|
5133
5147
|
handleYearMonthPicked(yearMonthValue) {
|
|
5134
|
-
console.log(yearMonthValue);
|
|
5135
5148
|
this.setDateFormControl(this.form.controls[this.widgetInstance.key], yearMonthValue, '00:00');
|
|
5136
5149
|
}
|
|
5137
5150
|
compareItems(o1, o2) {
|