@formio/js 5.0.0-dev.5794.12ca15f → 5.0.0-dev.5797.3f96a70
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/Changelog.md +3 -0
- package/dist/formio.form.js +565 -573
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +0 -10
- package/dist/formio.full.js +571 -579
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +0 -10
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +50 -48
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +4 -4
- package/lib/cjs/Webform.js +2 -2
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/cjs/components/_classes/component/Component.js +7 -6
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +12 -10
- package/lib/cjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/cjs/components/datetime/fixtures/comp14.js +38 -0
- package/lib/cjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/cjs/components/datetime/fixtures/index.js +3 -1
- package/lib/cjs/components/day/Day.d.ts +5 -1
- package/lib/cjs/components/day/Day.js +51 -11
- package/lib/cjs/components/day/editForm/Day.edit.day.d.ts +17 -0
- package/lib/cjs/components/day/editForm/Day.edit.day.js +19 -0
- package/lib/cjs/components/day/editForm/Day.edit.month.d.ts +5 -0
- package/lib/cjs/components/day/editForm/Day.edit.month.js +19 -0
- package/lib/cjs/components/day/editForm/Day.edit.year.d.ts +5 -0
- package/lib/cjs/components/day/editForm/Day.edit.year.js +13 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +7 -7
- package/lib/cjs/components/editgrid/fixtures/index.js +1 -1
- package/lib/cjs/components/html/HTML.js +1 -1
- package/lib/cjs/components/select/Select.js +1 -1
- package/lib/cjs/components/select/fixtures/comp25.d.ts +43 -28
- package/lib/cjs/components/select/fixtures/comp25.js +56 -49
- package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/cjs/components/select/fixtures/comp26.js +59 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/select/fixtures/index.js +3 -1
- package/lib/cjs/widgets/CalendarWidget.js +24 -10
- package/lib/mjs/Webform.js +6 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/mjs/components/_classes/component/Component.js +4 -3
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +12 -10
- package/lib/mjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/mjs/components/datetime/fixtures/comp14.js +36 -0
- package/lib/mjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/mjs/components/datetime/fixtures/index.js +2 -1
- package/lib/mjs/components/day/Day.d.ts +5 -1
- package/lib/mjs/components/day/Day.js +51 -11
- package/lib/mjs/components/day/editForm/Day.edit.day.d.ts +17 -0
- package/lib/mjs/components/day/editForm/Day.edit.day.js +16 -0
- package/lib/mjs/components/day/editForm/Day.edit.month.d.ts +5 -0
- package/lib/mjs/components/day/editForm/Day.edit.month.js +16 -0
- package/lib/mjs/components/day/editForm/Day.edit.year.d.ts +5 -0
- package/lib/mjs/components/day/editForm/Day.edit.year.js +10 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +7 -7
- package/lib/mjs/components/editgrid/fixtures/index.js +1 -1
- package/lib/mjs/components/html/HTML.js +1 -1
- package/lib/mjs/components/select/Select.js +1 -1
- package/lib/mjs/components/select/fixtures/comp25.d.ts +43 -28
- package/lib/mjs/components/select/fixtures/comp25.js +56 -49
- package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/mjs/components/select/fixtures/comp26.js +57 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/select/fixtures/index.js +2 -1
- package/lib/mjs/widgets/CalendarWidget.js +24 -10
- package/package.json +2 -2
|
@@ -96,14 +96,8 @@ export default class CalendarWidget extends InputWidget {
|
|
|
96
96
|
this.settings.dateFormat = convertFormatToFlatpickr(this.settings.dateFormat);
|
|
97
97
|
this.settings.position = 'auto center';
|
|
98
98
|
this.settings.onChange = () => {
|
|
99
|
-
if (this.settings.allowInput) {
|
|
100
|
-
|
|
101
|
-
this.calendar._input.value = this.settings.manualInputValue;
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this.settings.manualInputValue = '';
|
|
105
|
-
}
|
|
106
|
-
this.settings.isManuallyOverriddenValue = false;
|
|
99
|
+
if (this.settings.allowInput && this.settings.enableTime) {
|
|
100
|
+
this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
|
|
107
101
|
}
|
|
108
102
|
this.emit('update');
|
|
109
103
|
};
|
|
@@ -112,8 +106,7 @@ export default class CalendarWidget extends InputWidget {
|
|
|
112
106
|
this.hook('onCalendarClose');
|
|
113
107
|
this.closedOn = Date.now();
|
|
114
108
|
if (this.settings.allowInput && this.settings.enableTime) {
|
|
115
|
-
this.calendar._input.value = this.settings.manualInputValue
|
|
116
|
-
this.settings.isManuallyOverriddenValue = false;
|
|
109
|
+
this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
|
|
117
110
|
this.emit('update');
|
|
118
111
|
}
|
|
119
112
|
if (this.settings.wasDefaultValueChanged) {
|
|
@@ -349,9 +342,14 @@ export default class CalendarWidget extends InputWidget {
|
|
|
349
342
|
this.calendar = new Flatpickr(this._input, { ...this.settings, disableMobile: true });
|
|
350
343
|
this.addEventListener(this.calendar.altInput, 'input', (event) => {
|
|
351
344
|
if (this.settings.allowInput && this.settings.currentValue !== event.target.value) {
|
|
345
|
+
if (event.target.mask) {
|
|
346
|
+
event.target.mask.textMaskInputElement.update();
|
|
347
|
+
}
|
|
352
348
|
this.settings.manualInputValue = event.target.value;
|
|
349
|
+
this._input.value = this.settings.manualInputValue;
|
|
353
350
|
this.settings.isManuallyOverriddenValue = true;
|
|
354
351
|
this.settings.currentValue = event.target.value;
|
|
352
|
+
this.emit('update');
|
|
355
353
|
}
|
|
356
354
|
if (event.target.value === '' && this.calendar.selectedDates.length > 0) {
|
|
357
355
|
this.settings.wasDefaultValueChanged = true;
|
|
@@ -362,6 +360,18 @@ export default class CalendarWidget extends InputWidget {
|
|
|
362
360
|
this.settings.wasDefaultValueChanged = false;
|
|
363
361
|
}
|
|
364
362
|
});
|
|
363
|
+
if (this.calendar.daysContainer) {
|
|
364
|
+
this.calendar.daysContainer.addEventListener('click', () => {
|
|
365
|
+
this.settings.isManuallyOverriddenValue = false;
|
|
366
|
+
this.calendar.updateValue(false);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
if (this.calendar.timeContainer) {
|
|
370
|
+
this.calendar.timeContainer.addEventListener('click', () => {
|
|
371
|
+
this.settings.isManuallyOverriddenValue = false;
|
|
372
|
+
this.calendar.updateValue(false);
|
|
373
|
+
});
|
|
374
|
+
}
|
|
365
375
|
const excludedFromMaskFormats = ['MMMM'];
|
|
366
376
|
if (!this.settings.readOnly && !_.some(excludedFromMaskFormats, format => _.includes(this.settings.format, format))) {
|
|
367
377
|
// Enforce the input mask of the format.
|
|
@@ -387,6 +397,10 @@ export default class CalendarWidget extends InputWidget {
|
|
|
387
397
|
}
|
|
388
398
|
// Make sure we commit the value after a blur event occurs.
|
|
389
399
|
this.addEventListener(this.calendar._input, 'blur', (event) => {
|
|
400
|
+
// If we have manually overridden the value then we shouldn't call setDate because this will fill the input mask
|
|
401
|
+
if (this.settings.isManuallyOverriddenValue) {
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
390
404
|
const activeElement = this.settings.shadowRoot ? this.settings.shadowRoot.activeElement : document.activeElement;
|
|
391
405
|
const relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;
|
|
392
406
|
if (!(isIEBrowser && !relatedTarget) && !this.isCalendarElement(relatedTarget)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formio/js",
|
|
3
|
-
"version": "5.0.0-dev.
|
|
3
|
+
"version": "5.0.0-dev.5797.3f96a70",
|
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@formio/bootstrap": "3.0.0-dev.98.17ba6ea",
|
|
83
83
|
"@formio/choices.js": "^10.2.1",
|
|
84
|
-
"@formio/core": "2.1.0-dev.
|
|
84
|
+
"@formio/core": "2.1.0-dev.145.4491833",
|
|
85
85
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|