@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.
Files changed (69) hide show
  1. package/Changelog.md +3 -0
  2. package/dist/formio.form.js +565 -573
  3. package/dist/formio.form.min.js +1 -1
  4. package/dist/formio.form.min.js.LICENSE.txt +0 -10
  5. package/dist/formio.full.js +571 -579
  6. package/dist/formio.full.min.js +1 -1
  7. package/dist/formio.full.min.js.LICENSE.txt +0 -10
  8. package/dist/formio.js +1 -1
  9. package/dist/formio.min.js +1 -1
  10. package/dist/formio.utils.js +50 -48
  11. package/dist/formio.utils.min.js +1 -1
  12. package/dist/formio.utils.min.js.LICENSE.txt +4 -4
  13. package/lib/cjs/Webform.js +2 -2
  14. package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
  15. package/lib/cjs/components/_classes/component/Component.js +7 -6
  16. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
  17. package/lib/cjs/components/_classes/multivalue/Multivalue.js +12 -10
  18. package/lib/cjs/components/datetime/fixtures/comp14.d.ts +35 -0
  19. package/lib/cjs/components/datetime/fixtures/comp14.js +38 -0
  20. package/lib/cjs/components/datetime/fixtures/index.d.ts +6 -5
  21. package/lib/cjs/components/datetime/fixtures/index.js +3 -1
  22. package/lib/cjs/components/day/Day.d.ts +5 -1
  23. package/lib/cjs/components/day/Day.js +51 -11
  24. package/lib/cjs/components/day/editForm/Day.edit.day.d.ts +17 -0
  25. package/lib/cjs/components/day/editForm/Day.edit.day.js +19 -0
  26. package/lib/cjs/components/day/editForm/Day.edit.month.d.ts +5 -0
  27. package/lib/cjs/components/day/editForm/Day.edit.month.js +19 -0
  28. package/lib/cjs/components/day/editForm/Day.edit.year.d.ts +5 -0
  29. package/lib/cjs/components/day/editForm/Day.edit.year.js +13 -0
  30. package/lib/cjs/components/editgrid/fixtures/index.d.ts +7 -7
  31. package/lib/cjs/components/editgrid/fixtures/index.js +1 -1
  32. package/lib/cjs/components/html/HTML.js +1 -1
  33. package/lib/cjs/components/select/Select.js +1 -1
  34. package/lib/cjs/components/select/fixtures/comp25.d.ts +43 -28
  35. package/lib/cjs/components/select/fixtures/comp25.js +56 -49
  36. package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
  37. package/lib/cjs/components/select/fixtures/comp26.js +59 -0
  38. package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
  39. package/lib/cjs/components/select/fixtures/index.js +3 -1
  40. package/lib/cjs/widgets/CalendarWidget.js +24 -10
  41. package/lib/mjs/Webform.js +6 -2
  42. package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
  43. package/lib/mjs/components/_classes/component/Component.js +4 -3
  44. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
  45. package/lib/mjs/components/_classes/multivalue/Multivalue.js +12 -10
  46. package/lib/mjs/components/datetime/fixtures/comp14.d.ts +35 -0
  47. package/lib/mjs/components/datetime/fixtures/comp14.js +36 -0
  48. package/lib/mjs/components/datetime/fixtures/index.d.ts +6 -5
  49. package/lib/mjs/components/datetime/fixtures/index.js +2 -1
  50. package/lib/mjs/components/day/Day.d.ts +5 -1
  51. package/lib/mjs/components/day/Day.js +51 -11
  52. package/lib/mjs/components/day/editForm/Day.edit.day.d.ts +17 -0
  53. package/lib/mjs/components/day/editForm/Day.edit.day.js +16 -0
  54. package/lib/mjs/components/day/editForm/Day.edit.month.d.ts +5 -0
  55. package/lib/mjs/components/day/editForm/Day.edit.month.js +16 -0
  56. package/lib/mjs/components/day/editForm/Day.edit.year.d.ts +5 -0
  57. package/lib/mjs/components/day/editForm/Day.edit.year.js +10 -0
  58. package/lib/mjs/components/editgrid/fixtures/index.d.ts +7 -7
  59. package/lib/mjs/components/editgrid/fixtures/index.js +1 -1
  60. package/lib/mjs/components/html/HTML.js +1 -1
  61. package/lib/mjs/components/select/Select.js +1 -1
  62. package/lib/mjs/components/select/fixtures/comp25.d.ts +43 -28
  63. package/lib/mjs/components/select/fixtures/comp25.js +56 -49
  64. package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
  65. package/lib/mjs/components/select/fixtures/comp26.js +57 -0
  66. package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
  67. package/lib/mjs/components/select/fixtures/index.js +2 -1
  68. package/lib/mjs/widgets/CalendarWidget.js +24 -10
  69. 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
- if (this.settings.isManuallyOverriddenValue && this.settings.enableTime) {
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 || this.calendar._input.value;
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.5794.12ca15f",
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.105.1bff2e6",
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",