@formio/js 5.0.0-dev.5593.4f4b210 → 5.0.0-dev.5595.8e56e8f

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.
@@ -291,19 +291,12 @@ class Webform extends NestedDataComponent_1.default {
291
291
  // Set language after everything is established.
292
292
  this.language = this.i18next.language;
293
293
  // See if we need to restore the draft from a user.
294
- if (this.options.saveDraft) {
294
+ if (this.options.saveDraft && !this.options.skipDraftRestore) {
295
295
  this.formReady.then(() => {
296
- if (!this.options.skipDraftRestore) {
297
- const user = Formio_1.Formio.getUser();
298
- // Only restore a draft if the submission isn't explicitly set.
299
- if (user && !this.submissionSet) {
300
- this.restoreDraft(user._id);
301
- }
302
- }
303
- else {
304
- // Enable drafts
305
- this.draftEnabled = true;
306
- this.savingDraft = false;
296
+ const user = Formio_1.Formio.getUser();
297
+ // Only restore a draft if the submission isn't explicitly set.
298
+ if (user && !this.submissionSet) {
299
+ this.restoreDraft(user._id);
307
300
  }
308
301
  });
309
302
  }
@@ -7,6 +7,9 @@ declare const _default: ({
7
7
  label: string;
8
8
  value: string;
9
9
  }[];
10
+ validate: {
11
+ required: boolean;
12
+ };
10
13
  weight: number;
11
14
  input?: undefined;
12
15
  dataSrc?: undefined;
@@ -28,6 +31,7 @@ declare const _default: ({
28
31
  custom(context: any): any[];
29
32
  };
30
33
  values?: undefined;
34
+ validate?: undefined;
31
35
  ignore?: undefined;
32
36
  } | {
33
37
  key: string;
@@ -36,6 +40,7 @@ declare const _default: ({
36
40
  tooltip?: undefined;
37
41
  type?: undefined;
38
42
  values?: undefined;
43
+ validate?: undefined;
39
44
  weight?: undefined;
40
45
  input?: undefined;
41
46
  dataSrc?: undefined;
@@ -17,6 +17,9 @@ exports.default = [
17
17
  value: 'buttonClick'
18
18
  }
19
19
  ],
20
+ validate: {
21
+ required: true
22
+ },
20
23
  weight: 650
21
24
  },
22
25
  {
@@ -263,19 +263,12 @@ export default class Webform extends NestedDataComponent {
263
263
  // Set language after everything is established.
264
264
  this.language = this.i18next.language;
265
265
  // See if we need to restore the draft from a user.
266
- if (this.options.saveDraft) {
266
+ if (this.options.saveDraft && !this.options.skipDraftRestore) {
267
267
  this.formReady.then(() => {
268
- if (!this.options.skipDraftRestore) {
269
- const user = Formio.getUser();
270
- // Only restore a draft if the submission isn't explicitly set.
271
- if (user && !this.submissionSet) {
272
- this.restoreDraft(user._id);
273
- }
274
- }
275
- else {
276
- // Enable drafts
277
- this.draftEnabled = true;
278
- this.savingDraft = false;
268
+ const user = Formio.getUser();
269
+ // Only restore a draft if the submission isn't explicitly set.
270
+ if (user && !this.submissionSet) {
271
+ this.restoreDraft(user._id);
279
272
  }
280
273
  });
281
274
  }
@@ -7,6 +7,9 @@ declare const _default: ({
7
7
  label: string;
8
8
  value: string;
9
9
  }[];
10
+ validate: {
11
+ required: boolean;
12
+ };
10
13
  weight: number;
11
14
  input?: undefined;
12
15
  dataSrc?: undefined;
@@ -28,6 +31,7 @@ declare const _default: ({
28
31
  custom(context: any): any[];
29
32
  };
30
33
  values?: undefined;
34
+ validate?: undefined;
31
35
  ignore?: undefined;
32
36
  } | {
33
37
  key: string;
@@ -36,6 +40,7 @@ declare const _default: ({
36
40
  tooltip?: undefined;
37
41
  type?: undefined;
38
42
  values?: undefined;
43
+ validate?: undefined;
39
44
  weight?: undefined;
40
45
  input?: undefined;
41
46
  dataSrc?: undefined;
@@ -15,6 +15,9 @@ export default [
15
15
  value: 'buttonClick'
16
16
  }
17
17
  ],
18
+ validate: {
19
+ required: true
20
+ },
18
21
  weight: 650
19
22
  },
20
23
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5593.4f4b210",
3
+ "version": "5.0.0-dev.5595.8e56e8f",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {