@formio/js 5.0.0-dev.5821.2452432 → 5.0.0-dev.5825.1d9f891

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/lib/cjs/CDN.d.ts CHANGED
@@ -15,7 +15,6 @@ declare class CDN {
15
15
  ckeditor: string;
16
16
  dragula: string;
17
17
  flatpickr: string;
18
- 'flatpickr-formio': string;
19
18
  'font-awesome': string;
20
19
  grid: string;
21
20
  'moment-timezone': string;
package/lib/cjs/CDN.js CHANGED
@@ -18,8 +18,7 @@ class CDN {
18
18
  'bootstrap-icons': '1.11.1',
19
19
  'ckeditor': '19.0.0',
20
20
  'dragula': '3.7.3',
21
- 'flatpickr': '4.6.8',
22
- 'flatpickr-formio': '4.6.13-formio.3',
21
+ 'flatpickr': '4.6.13',
23
22
  'font-awesome': '4.7.0',
24
23
  'grid': 'latest',
25
24
  'moment-timezone': 'latest',
@@ -914,8 +914,11 @@ class WebformBuilder extends Component_1.default {
914
914
  keyboardActionsEnabled = keyboardActionsEnabled === 'true';
915
915
  }
916
916
  this.keyboardActionsEnabled = keyboardActionsEnabled;
917
+ const isSubmitButton = (comp) => {
918
+ return (comp.type === 'button') && ((comp.action === 'submit') || !comp.action);
919
+ };
917
920
  const isShowSubmitButton = !this.options.noDefaultSubmitButton
918
- && (!form.components.length || !form.components.find(comp => comp.key === 'submit'));
921
+ && (!form.components.length || !form.components.find(comp => isSubmitButton(comp)));
919
922
  // Ensure there is at least a submit button.
920
923
  if (isShowSubmitButton) {
921
924
  form.components.push({
@@ -683,9 +683,12 @@ class NestedComponent extends Field_1.default {
683
683
  return this.getComponents().reduce((valid, comp) => comp.isValid(data, dirty) && valid, super.isValid(data, dirty));
684
684
  }
685
685
  validationProcessor({ scope, data, row, instance, component }, flags) {
686
+ var _a;
686
687
  const { dirty } = flags;
687
688
  if (this.root.hasExtraPages && this.page !== this.root.page) {
688
- instance = this.getComponent(component.path);
689
+ instance = ((_a = this.childComponentsMap) === null || _a === void 0 ? void 0 : _a.hasOwnProperty(component.path))
690
+ ? this.childComponentsMap[component.path]
691
+ : this.getComponent(component.path);
689
692
  }
690
693
  if (!instance) {
691
694
  return;
@@ -420,7 +420,9 @@ class DayComponent extends Field_1.default {
420
420
  DAY = null;
421
421
  }
422
422
  if (!this.showMonth) {
423
- DAY = DAY === 0 ? 0 : DAY - 1;
423
+ if (!lodash_1.default.isNull(DAY)) {
424
+ DAY = DAY === 0 ? 0 : DAY - 1;
425
+ }
424
426
  YEAR = YEAR - 1;
425
427
  MONTH = null;
426
428
  }
@@ -124,7 +124,7 @@ class CalendarWidget extends InputWidget_1.default {
124
124
  }
125
125
  };
126
126
  Formio_1.Formio.requireLibrary('flatpickr-css', 'flatpickr', [
127
- { type: 'styles', src: `${Formio_1.Formio.cdn['flatpickr-formio']}/flatpickr.min.css` }
127
+ { type: 'styles', src: `${Formio_1.Formio.cdn['flatpickr']}/flatpickr.min.css` }
128
128
  ], true);
129
129
  if (this.component.shortcutButtons) {
130
130
  this.component.shortcutButtons = this.component.shortcutButtons.filter((btn) => btn.label && btn.onClick);
@@ -142,7 +142,7 @@ class CalendarWidget extends InputWidget_1.default {
142
142
  }
143
143
  })
144
144
  .then((ShortcutButtonsPlugin) => {
145
- return Formio_1.Formio.requireLibrary('flatpickr', 'flatpickr', `${Formio_1.Formio.cdn['flatpickr-formio']}/flatpickr.min.js`, true)
145
+ return Formio_1.Formio.requireLibrary('flatpickr', 'flatpickr', `${Formio_1.Formio.cdn['flatpickr']}/flatpickr.min.js`, true)
146
146
  .then((Flatpickr) => {
147
147
  var _a;
148
148
  if (((_a = this.component.shortcutButtons) === null || _a === void 0 ? void 0 : _a.length) && ShortcutButtonsPlugin) {
@@ -152,7 +152,7 @@ class CalendarWidget extends InputWidget_1.default {
152
152
  if (this._input) {
153
153
  const { locale } = this.settings;
154
154
  if (locale && locale.length >= 2 && locale !== 'en') {
155
- return Formio_1.Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr-${locale}`, `${Formio_1.Formio.cdn['flatpickr-formio']}/l10n/flatpickr-${locale}.js`, true).then(() => this.initFlatpickr(Flatpickr));
155
+ return Formio_1.Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr.l10ns.${locale}`, `${Formio_1.Formio.cdn['flatpickr']}/l10n/${locale}.js`, true).then(() => this.initFlatpickr(Flatpickr));
156
156
  }
157
157
  else {
158
158
  this.initFlatpickr(Flatpickr);
package/lib/mjs/CDN.d.ts CHANGED
@@ -15,7 +15,6 @@ declare class CDN {
15
15
  ckeditor: string;
16
16
  dragula: string;
17
17
  flatpickr: string;
18
- 'flatpickr-formio': string;
19
18
  'font-awesome': string;
20
19
  grid: string;
21
20
  'moment-timezone': string;
package/lib/mjs/CDN.js CHANGED
@@ -17,8 +17,7 @@ class CDN {
17
17
  'bootstrap-icons': '1.11.1',
18
18
  'ckeditor': '19.0.0',
19
19
  'dragula': '3.7.3',
20
- 'flatpickr': '4.6.8',
21
- 'flatpickr-formio': '4.6.13-formio.3',
20
+ 'flatpickr': '4.6.13',
22
21
  'font-awesome': '4.7.0',
23
22
  'grid': 'latest',
24
23
  'moment-timezone': 'latest',
@@ -898,8 +898,11 @@ export default class WebformBuilder extends Component {
898
898
  keyboardActionsEnabled = keyboardActionsEnabled === 'true';
899
899
  }
900
900
  this.keyboardActionsEnabled = keyboardActionsEnabled;
901
+ const isSubmitButton = (comp) => {
902
+ return (comp.type === 'button') && ((comp.action === 'submit') || !comp.action);
903
+ };
901
904
  const isShowSubmitButton = !this.options.noDefaultSubmitButton
902
- && (!form.components.length || !form.components.find(comp => comp.key === 'submit'));
905
+ && (!form.components.length || !form.components.find(comp => isSubmitButton(comp)));
903
906
  // Ensure there is at least a submit button.
904
907
  if (isShowSubmitButton) {
905
908
  form.components.push({
@@ -681,7 +681,9 @@ export default class NestedComponent extends Field {
681
681
  validationProcessor({ scope, data, row, instance, component }, flags) {
682
682
  const { dirty } = flags;
683
683
  if (this.root.hasExtraPages && this.page !== this.root.page) {
684
- instance = this.getComponent(component.path);
684
+ instance = this.childComponentsMap?.hasOwnProperty(component.path)
685
+ ? this.childComponentsMap[component.path]
686
+ : this.getComponent(component.path);
685
687
  }
686
688
  if (!instance) {
687
689
  return;
@@ -418,7 +418,9 @@ export default class DayComponent extends Field {
418
418
  DAY = null;
419
419
  }
420
420
  if (!this.showMonth) {
421
- DAY = DAY === 0 ? 0 : DAY - 1;
421
+ if (!_.isNull(DAY)) {
422
+ DAY = DAY === 0 ? 0 : DAY - 1;
423
+ }
422
424
  YEAR = YEAR - 1;
423
425
  MONTH = null;
424
426
  }
@@ -118,7 +118,7 @@ export default class CalendarWidget extends InputWidget {
118
118
  }
119
119
  };
120
120
  Formio.requireLibrary('flatpickr-css', 'flatpickr', [
121
- { type: 'styles', src: `${Formio.cdn['flatpickr-formio']}/flatpickr.min.css` }
121
+ { type: 'styles', src: `${Formio.cdn['flatpickr']}/flatpickr.min.css` }
122
122
  ], true);
123
123
  if (this.component.shortcutButtons) {
124
124
  this.component.shortcutButtons = this.component.shortcutButtons.filter((btn) => btn.label && btn.onClick);
@@ -135,7 +135,7 @@ export default class CalendarWidget extends InputWidget {
135
135
  }
136
136
  })
137
137
  .then((ShortcutButtonsPlugin) => {
138
- return Formio.requireLibrary('flatpickr', 'flatpickr', `${Formio.cdn['flatpickr-formio']}/flatpickr.min.js`, true)
138
+ return Formio.requireLibrary('flatpickr', 'flatpickr', `${Formio.cdn['flatpickr']}/flatpickr.min.js`, true)
139
139
  .then((Flatpickr) => {
140
140
  if (this.component.shortcutButtons?.length && ShortcutButtonsPlugin) {
141
141
  this.initShortcutButtonsPlugin(ShortcutButtonsPlugin);
@@ -144,7 +144,7 @@ export default class CalendarWidget extends InputWidget {
144
144
  if (this._input) {
145
145
  const { locale } = this.settings;
146
146
  if (locale && locale.length >= 2 && locale !== 'en') {
147
- return Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr-${locale}`, `${Formio.cdn['flatpickr-formio']}/l10n/flatpickr-${locale}.js`, true).then(() => this.initFlatpickr(Flatpickr));
147
+ return Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr.l10ns.${locale}`, `${Formio.cdn['flatpickr']}/l10n/${locale}.js`, true).then(() => this.initFlatpickr(Flatpickr));
148
148
  }
149
149
  else {
150
150
  this.initFlatpickr(Flatpickr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5821.2452432",
3
+ "version": "5.0.0-dev.5825.1d9f891",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {