ngx-ode-ui 4.8.0-develop-pedago.8 → 4.8.0-develop-pedago.9
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/components/datepicker/datepicker.component.mjs +21 -5
- package/fesm2015/ngx-ode-ui.mjs +19 -3
- package/fesm2015/ngx-ode-ui.mjs.map +1 -1
- package/fesm2020/ngx-ode-ui.mjs +19 -3
- package/fesm2020/ngx-ode-ui.mjs.map +1 -1
- package/lib/components/datepicker/datepicker.component.d.ts +3 -1
- package/package.json +3 -3
package/fesm2020/ngx-ode-ui.mjs
CHANGED
|
@@ -202,6 +202,8 @@ class DatepickerComponent extends OdeComponent {
|
|
|
202
202
|
this.changeDate = new EventEmitter();
|
|
203
203
|
this.onChangeCallback = NOOP;
|
|
204
204
|
this.onTouchedCallback = NOOP;
|
|
205
|
+
this.onInputChangeObserver = null;
|
|
206
|
+
this.debounceTimer = null;
|
|
205
207
|
}
|
|
206
208
|
get value() {
|
|
207
209
|
return this.innerValue;
|
|
@@ -250,23 +252,37 @@ class DatepickerComponent extends OdeComponent {
|
|
|
250
252
|
altInput: !this.disabled,
|
|
251
253
|
altFormat: 'd/m/Y',
|
|
252
254
|
dateFormat: 'Y-m-d',
|
|
253
|
-
allowInput:
|
|
255
|
+
allowInput: true,
|
|
254
256
|
enableTime: this.enableTime,
|
|
255
257
|
minDate: this.minDate,
|
|
256
258
|
maxDate: this.maxDate,
|
|
257
259
|
clickOpens: false,
|
|
258
260
|
wrap: true,
|
|
259
|
-
locale: datePickerLocale
|
|
261
|
+
locale: datePickerLocale,
|
|
262
|
+
onChange: (selectedDates, dateStr) => {
|
|
263
|
+
this.value = dateStr;
|
|
264
|
+
},
|
|
265
|
+
onClose: () => {
|
|
266
|
+
this.onTouchedCallback();
|
|
267
|
+
}
|
|
260
268
|
};
|
|
261
269
|
this.datePickerInst = new Flatpickr(this.datePickerElement.nativeElement, options);
|
|
262
270
|
if (!this.disabled) {
|
|
271
|
+
// Add click handler for the alt input
|
|
263
272
|
this.datePickerInst.altInput.addEventListener('click', e => {
|
|
264
273
|
if (!this.readonly) {
|
|
265
274
|
this.datePickerInst.toggle();
|
|
266
275
|
}
|
|
267
276
|
});
|
|
277
|
+
// Add blur handler for manual entry
|
|
278
|
+
this.datePickerInst.altInput.addEventListener('blur', e => {
|
|
279
|
+
const inputDate = this.datePickerInst.parseDate(this.datePickerInst.altInput.value, options.altFormat);
|
|
280
|
+
if (inputDate) {
|
|
281
|
+
this.datePickerInst.setDate(inputDate, true);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
268
284
|
}
|
|
269
|
-
// Force updating the date input readonly attribute
|
|
285
|
+
// Force updating the date input readonly attribute
|
|
270
286
|
this.readonly = this._readonly;
|
|
271
287
|
}
|
|
272
288
|
ngOnDestroy() {
|