@formio/js 5.1.0-dev.6058.189ce78 → 5.1.0-dev.6060.19e3bfc

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 (39) hide show
  1. package/dist/formio.form.js +2 -2
  2. package/dist/formio.form.min.js +1 -1
  3. package/dist/formio.full.js +17 -17
  4. package/dist/formio.full.min.js +1 -1
  5. package/lib/cjs/components/_classes/nested/NestedComponent.form.js +13 -0
  6. package/lib/cjs/components/address/Address.js +13 -0
  7. package/lib/cjs/components/content/editForm/Content.edit.display.js +8 -0
  8. package/lib/cjs/components/currency/editForm/Currency.edit.display.js +12 -0
  9. package/lib/cjs/components/day/editForm/Day.edit.display.js +8 -0
  10. package/lib/cjs/components/email/editForm/Email.edit.display.js +12 -0
  11. package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
  12. package/lib/cjs/components/file/File.js +7 -2
  13. package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
  14. package/lib/cjs/components/html/editForm/HTML.edit.display.js +8 -0
  15. package/lib/cjs/components/number/editForm/Number.edit.display.js +12 -0
  16. package/lib/cjs/components/password/editForm/Password.edit.display.js +13 -1
  17. package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -1
  18. package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
  19. package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
  20. package/lib/cjs/components/url/editForm/Url.edit.display.js +12 -0
  21. package/lib/cjs/components/well/editForm/Well.edit.display.js +8 -0
  22. package/lib/mjs/components/_classes/nested/NestedComponent.form.js +13 -0
  23. package/lib/mjs/components/address/Address.js +13 -0
  24. package/lib/mjs/components/content/editForm/Content.edit.display.js +8 -0
  25. package/lib/mjs/components/currency/editForm/Currency.edit.display.js +12 -0
  26. package/lib/mjs/components/day/editForm/Day.edit.display.js +8 -0
  27. package/lib/mjs/components/email/editForm/Email.edit.display.js +12 -0
  28. package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
  29. package/lib/mjs/components/file/File.js +7 -2
  30. package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
  31. package/lib/mjs/components/html/editForm/HTML.edit.display.js +8 -0
  32. package/lib/mjs/components/number/editForm/Number.edit.display.js +12 -0
  33. package/lib/mjs/components/password/editForm/Password.edit.display.js +13 -1
  34. package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -1
  35. package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
  36. package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
  37. package/lib/mjs/components/url/editForm/Url.edit.display.js +12 -0
  38. package/lib/mjs/components/well/editForm/Well.edit.display.js +8 -0
  39. package/package.json +1 -1
@@ -11,6 +11,19 @@ const Components_1 = __importDefault(require("../../Components"));
11
11
  */
12
12
  function default_1(...extend) {
13
13
  return Components_1.default.baseEditForm([
14
+ {
15
+ key: 'display',
16
+ components: [
17
+ {
18
+ key: 'labelWidth',
19
+ ignore: true
20
+ },
21
+ {
22
+ key: 'labelMargin',
23
+ ignore: true
24
+ }
25
+ ]
26
+ },
14
27
  {
15
28
  key: 'data',
16
29
  ignore: true
@@ -115,6 +115,19 @@ class AddressComponent extends Container_1.default {
115
115
  NestedComponent_1.default.prototype.addComponents.call(this, this.manualMode ? this.address : {});
116
116
  }
117
117
  Field_1.default.prototype.init.call(this);
118
+ // Added for backwards compatibility
119
+ if (this.component.providerOptions) {
120
+ const { params, url, queryProperty, responseProperty, displayValueProperty } = this.component.providerOptions;
121
+ const key = params === null || params === void 0 ? void 0 : params.key;
122
+ const autocompleteOptions = params === null || params === void 0 ? void 0 : params.autocompleteOptions;
123
+ delete this.component.providerOptions;
124
+ this.component.url = url;
125
+ this.component.queryProperty = queryProperty;
126
+ this.component.responseProperty = responseProperty;
127
+ this.component.displayValueProperty = displayValueProperty;
128
+ this.component.apiKey = key;
129
+ this.component.autocompleteOptions = autocompleteOptions;
130
+ }
118
131
  let provider = this.component.provider;
119
132
  const providerOptions = this.providerOptions;
120
133
  const map = this.component.map;
@@ -5,6 +5,14 @@ exports.default = [
5
5
  key: 'labelPosition',
6
6
  ignore: true
7
7
  },
8
+ {
9
+ key: 'labelWidth',
10
+ ignore: true
11
+ },
12
+ {
13
+ key: 'labelMargin',
14
+ ignore: true
15
+ },
8
16
  {
9
17
  key: 'placeholder',
10
18
  ignore: true
@@ -9,6 +9,18 @@ exports.default = [
9
9
  key: 'allowMultipleMasks',
10
10
  ignore: true
11
11
  },
12
+ {
13
+ key: 'inputMasks',
14
+ ignore: true
15
+ },
16
+ {
17
+ key: 'widget.type',
18
+ ignore: true
19
+ },
20
+ {
21
+ key: 'widget',
22
+ ignore: true
23
+ },
12
24
  {
13
25
  key: 'showWordCount',
14
26
  ignore: true
@@ -5,6 +5,14 @@ exports.default = [
5
5
  key: 'labelPosition',
6
6
  ignore: true
7
7
  },
8
+ {
9
+ key: 'labelWidth',
10
+ ignore: true
11
+ },
12
+ {
13
+ key: 'labelMargin',
14
+ ignore: true
15
+ },
8
16
  {
9
17
  weight: 15,
10
18
  type: 'checkbox',
@@ -9,6 +9,18 @@ exports.default = [
9
9
  key: 'allowMultipleMasks',
10
10
  ignore: true,
11
11
  },
12
+ {
13
+ key: 'inputMasks',
14
+ ignore: true
15
+ },
16
+ {
17
+ key: 'widget.type',
18
+ ignore: true
19
+ },
20
+ {
21
+ key: 'widget',
22
+ ignore: true
23
+ },
12
24
  {
13
25
  key: 'showWordCount',
14
26
  ignore: true
@@ -5,6 +5,14 @@ exports.default = [
5
5
  key: 'labelPosition',
6
6
  ignore: true
7
7
  },
8
+ {
9
+ key: 'labelWidth',
10
+ ignore: true
11
+ },
12
+ {
13
+ key: 'labelMargin',
14
+ ignore: true
15
+ },
8
16
  {
9
17
  key: 'placeholder',
10
18
  ignore: true
@@ -905,14 +905,17 @@ class FileComponent extends Field_1.default {
905
905
  }
906
906
  uploadFile(fileToSync) {
907
907
  return __awaiter(this, void 0, void 0, function* () {
908
- return yield this.fileService.uploadFile(fileToSync.storage, fileToSync.file, fileToSync.name, fileToSync.dir,
908
+ const filePromise = this.fileService.uploadFile(fileToSync.storage, fileToSync.file, fileToSync.name, fileToSync.dir,
909
909
  // Progress callback
910
- this.updateProgress.bind(this, fileToSync), fileToSync.url, fileToSync.options, fileToSync.fileKey, fileToSync.groupPermissions, fileToSync.groupResourceId, () => { },
910
+ this.updateProgress.bind(this, fileToSync), fileToSync.url, fileToSync.options, fileToSync.fileKey, fileToSync.groupPermissions, fileToSync.groupResourceId, () => {
911
+ this.emit('fileUploadingStart', filePromise);
912
+ },
911
913
  // Abort upload callback
912
914
  (abort) => this.abortUploads.push({
913
915
  id: fileToSync.id,
914
916
  abort,
915
917
  }), this.getMultipartOptions(fileToSync));
918
+ return yield filePromise;
916
919
  });
917
920
  }
918
921
  upload() {
@@ -934,6 +937,7 @@ class FileComponent extends Field_1.default {
934
937
  fileToSync.message = this.t('succefullyUploaded');
935
938
  fileInfo.originalName = fileToSync.originalName;
936
939
  fileInfo.hash = fileToSync.hash;
940
+ this.emit('fileUploadingEnd', Promise.resolve(fileInfo));
937
941
  }
938
942
  catch (response) {
939
943
  fileToSync.status = 'error';
@@ -943,6 +947,7 @@ class FileComponent extends Field_1.default {
943
947
  : response.type === 'abort'
944
948
  ? this.t('Request was aborted')
945
949
  : response.toString();
950
+ this.emit('fileUploadingEnd', Promise.reject(response));
946
951
  this.emit('fileUploadError', {
947
952
  fileToSync,
948
953
  response,
@@ -5,6 +5,14 @@ exports.default = [
5
5
  key: 'labelPosition',
6
6
  ignore: true
7
7
  },
8
+ {
9
+ key: 'labelWidth',
10
+ ignore: true
11
+ },
12
+ {
13
+ key: 'labelMargin',
14
+ ignore: true
15
+ },
8
16
  {
9
17
  key: 'placeholder',
10
18
  ignore: true
@@ -5,6 +5,14 @@ exports.default = [
5
5
  key: 'labelPosition',
6
6
  ignore: true
7
7
  },
8
+ {
9
+ key: 'labelWidth',
10
+ ignore: true
11
+ },
12
+ {
13
+ key: 'labelMargin',
14
+ ignore: true
15
+ },
8
16
  {
9
17
  key: 'placeholder',
10
18
  ignore: true
@@ -13,6 +13,18 @@ exports.default = [
13
13
  key: 'allowMultipleMasks',
14
14
  ignore: true
15
15
  },
16
+ {
17
+ key: 'inputMasks',
18
+ ignore: true
19
+ },
20
+ {
21
+ key: 'widget.type',
22
+ ignore: true
23
+ },
24
+ {
25
+ key: 'widget',
26
+ ignore: true
27
+ },
16
28
  {
17
29
  key: 'showWordCount',
18
30
  ignore: true,
@@ -12,5 +12,17 @@ exports.default = [
12
12
  {
13
13
  key: 'allowMultipleMasks',
14
14
  ignore: true
15
- }
15
+ },
16
+ {
17
+ key: 'inputMasks',
18
+ ignore: true
19
+ },
20
+ {
21
+ key: 'widget.type',
22
+ ignore: true
23
+ },
24
+ {
25
+ key: 'widget',
26
+ ignore: true
27
+ },
16
28
  ];
@@ -22,7 +22,15 @@ function default_1(...extend) {
22
22
  {
23
23
  key: 'showCharCount',
24
24
  ignore: true
25
- }
25
+ },
26
+ {
27
+ key: 'widget.type',
28
+ ignore: true
29
+ },
30
+ {
31
+ key: 'widget',
32
+ ignore: true
33
+ },
26
34
  ]
27
35
  },
28
36
  {
@@ -5,6 +5,14 @@ exports.default = [
5
5
  key: 'labelPosition',
6
6
  ignore: true
7
7
  },
8
+ {
9
+ key: 'labelWidth',
10
+ ignore: true
11
+ },
12
+ {
13
+ key: 'labelMargin',
14
+ ignore: true
15
+ },
8
16
  {
9
17
  key: 'placeholder',
10
18
  ignore: true
@@ -14,10 +14,22 @@ exports.default = [
14
14
  key: 'allowMultipleMasks',
15
15
  ignore: true
16
16
  },
17
+ {
18
+ key: 'inputMasks',
19
+ ignore: true
20
+ },
17
21
  {
18
22
  key: 'mask',
19
23
  ignore: true
20
24
  },
25
+ {
26
+ key: 'widget.type',
27
+ ignore: true
28
+ },
29
+ {
30
+ key: 'widget',
31
+ ignore: true
32
+ },
21
33
  {
22
34
  type: 'number',
23
35
  input: true,
@@ -9,6 +9,18 @@ exports.default = [
9
9
  key: 'allowMultipleMasks',
10
10
  ignore: true
11
11
  },
12
+ {
13
+ key: 'inputMasks',
14
+ ignore: true
15
+ },
16
+ {
17
+ key: 'widget.type',
18
+ ignore: true
19
+ },
20
+ {
21
+ key: 'widget',
22
+ ignore: true
23
+ },
12
24
  {
13
25
  key: 'showWordCount',
14
26
  ignore: true,
@@ -5,6 +5,14 @@ exports.default = [
5
5
  key: 'labelPosition',
6
6
  ignore: true
7
7
  },
8
+ {
9
+ key: 'labelWidth',
10
+ ignore: true
11
+ },
12
+ {
13
+ key: 'labelMargin',
14
+ ignore: true
15
+ },
8
16
  {
9
17
  key: 'placeholder',
10
18
  ignore: true
@@ -6,6 +6,19 @@ import Components from '../../Components';
6
6
  */
7
7
  export default function (...extend) {
8
8
  return Components.baseEditForm([
9
+ {
10
+ key: 'display',
11
+ components: [
12
+ {
13
+ key: 'labelWidth',
14
+ ignore: true
15
+ },
16
+ {
17
+ key: 'labelMargin',
18
+ ignore: true
19
+ }
20
+ ]
21
+ },
9
22
  {
10
23
  key: 'data',
11
24
  ignore: true
@@ -112,6 +112,19 @@ export default class AddressComponent extends ContainerComponent {
112
112
  NestedComponent.prototype.addComponents.call(this, this.manualMode ? this.address : {});
113
113
  }
114
114
  Field.prototype.init.call(this);
115
+ // Added for backwards compatibility
116
+ if (this.component.providerOptions) {
117
+ const { params, url, queryProperty, responseProperty, displayValueProperty } = this.component.providerOptions;
118
+ const key = params?.key;
119
+ const autocompleteOptions = params?.autocompleteOptions;
120
+ delete this.component.providerOptions;
121
+ this.component.url = url;
122
+ this.component.queryProperty = queryProperty;
123
+ this.component.responseProperty = responseProperty;
124
+ this.component.displayValueProperty = displayValueProperty;
125
+ this.component.apiKey = key;
126
+ this.component.autocompleteOptions = autocompleteOptions;
127
+ }
115
128
  let provider = this.component.provider;
116
129
  const providerOptions = this.providerOptions;
117
130
  const map = this.component.map;
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  key: 'placeholder',
8
16
  ignore: true
@@ -7,6 +7,18 @@ export default [
7
7
  key: 'allowMultipleMasks',
8
8
  ignore: true
9
9
  },
10
+ {
11
+ key: 'inputMasks',
12
+ ignore: true
13
+ },
14
+ {
15
+ key: 'widget.type',
16
+ ignore: true
17
+ },
18
+ {
19
+ key: 'widget',
20
+ ignore: true
21
+ },
10
22
  {
11
23
  key: 'showWordCount',
12
24
  ignore: true
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  weight: 15,
8
16
  type: 'checkbox',
@@ -7,6 +7,18 @@ export default [
7
7
  key: 'allowMultipleMasks',
8
8
  ignore: true,
9
9
  },
10
+ {
11
+ key: 'inputMasks',
12
+ ignore: true
13
+ },
14
+ {
15
+ key: 'widget.type',
16
+ ignore: true
17
+ },
18
+ {
19
+ key: 'widget',
20
+ ignore: true
21
+ },
10
22
  {
11
23
  key: 'showWordCount',
12
24
  ignore: true
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  key: 'placeholder',
8
16
  ignore: true
@@ -903,14 +903,17 @@ export default class FileComponent extends Field {
903
903
  } : false;
904
904
  }
905
905
  async uploadFile(fileToSync) {
906
- return await this.fileService.uploadFile(fileToSync.storage, fileToSync.file, fileToSync.name, fileToSync.dir,
906
+ const filePromise = this.fileService.uploadFile(fileToSync.storage, fileToSync.file, fileToSync.name, fileToSync.dir,
907
907
  // Progress callback
908
- this.updateProgress.bind(this, fileToSync), fileToSync.url, fileToSync.options, fileToSync.fileKey, fileToSync.groupPermissions, fileToSync.groupResourceId, () => { },
908
+ this.updateProgress.bind(this, fileToSync), fileToSync.url, fileToSync.options, fileToSync.fileKey, fileToSync.groupPermissions, fileToSync.groupResourceId, () => {
909
+ this.emit('fileUploadingStart', filePromise);
910
+ },
909
911
  // Abort upload callback
910
912
  (abort) => this.abortUploads.push({
911
913
  id: fileToSync.id,
912
914
  abort,
913
915
  }), this.getMultipartOptions(fileToSync));
916
+ return await filePromise;
914
917
  }
915
918
  async upload() {
916
919
  if (!this.filesToSync.filesToUpload.length) {
@@ -930,6 +933,7 @@ export default class FileComponent extends Field {
930
933
  fileToSync.message = this.t('succefullyUploaded');
931
934
  fileInfo.originalName = fileToSync.originalName;
932
935
  fileInfo.hash = fileToSync.hash;
936
+ this.emit('fileUploadingEnd', Promise.resolve(fileInfo));
933
937
  }
934
938
  catch (response) {
935
939
  fileToSync.status = 'error';
@@ -939,6 +943,7 @@ export default class FileComponent extends Field {
939
943
  : response.type === 'abort'
940
944
  ? this.t('Request was aborted')
941
945
  : response.toString();
946
+ this.emit('fileUploadingEnd', Promise.reject(response));
942
947
  this.emit('fileUploadError', {
943
948
  fileToSync,
944
949
  response,
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  key: 'placeholder',
8
16
  ignore: true
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  key: 'placeholder',
8
16
  ignore: true
@@ -11,6 +11,18 @@ export default [
11
11
  key: 'allowMultipleMasks',
12
12
  ignore: true
13
13
  },
14
+ {
15
+ key: 'inputMasks',
16
+ ignore: true
17
+ },
18
+ {
19
+ key: 'widget.type',
20
+ ignore: true
21
+ },
22
+ {
23
+ key: 'widget',
24
+ ignore: true
25
+ },
14
26
  {
15
27
  key: 'showWordCount',
16
28
  ignore: true,
@@ -10,5 +10,17 @@ export default [
10
10
  {
11
11
  key: 'allowMultipleMasks',
12
12
  ignore: true
13
- }
13
+ },
14
+ {
15
+ key: 'inputMasks',
16
+ ignore: true
17
+ },
18
+ {
19
+ key: 'widget.type',
20
+ ignore: true
21
+ },
22
+ {
23
+ key: 'widget',
24
+ ignore: true
25
+ },
14
26
  ];
@@ -17,7 +17,15 @@ export default function (...extend) {
17
17
  {
18
18
  key: 'showCharCount',
19
19
  ignore: true
20
- }
20
+ },
21
+ {
22
+ key: 'widget.type',
23
+ ignore: true
24
+ },
25
+ {
26
+ key: 'widget',
27
+ ignore: true
28
+ },
21
29
  ]
22
30
  },
23
31
  {
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  key: 'placeholder',
8
16
  ignore: true
@@ -9,10 +9,22 @@ export default [
9
9
  key: 'allowMultipleMasks',
10
10
  ignore: true
11
11
  },
12
+ {
13
+ key: 'inputMasks',
14
+ ignore: true
15
+ },
12
16
  {
13
17
  key: 'mask',
14
18
  ignore: true
15
19
  },
20
+ {
21
+ key: 'widget.type',
22
+ ignore: true
23
+ },
24
+ {
25
+ key: 'widget',
26
+ ignore: true
27
+ },
16
28
  {
17
29
  type: 'number',
18
30
  input: true,
@@ -7,6 +7,18 @@ export default [
7
7
  key: 'allowMultipleMasks',
8
8
  ignore: true
9
9
  },
10
+ {
11
+ key: 'inputMasks',
12
+ ignore: true
13
+ },
14
+ {
15
+ key: 'widget.type',
16
+ ignore: true
17
+ },
18
+ {
19
+ key: 'widget',
20
+ ignore: true
21
+ },
10
22
  {
11
23
  key: 'showWordCount',
12
24
  ignore: true,
@@ -3,6 +3,14 @@ export default [
3
3
  key: 'labelPosition',
4
4
  ignore: true
5
5
  },
6
+ {
7
+ key: 'labelWidth',
8
+ ignore: true
9
+ },
10
+ {
11
+ key: 'labelMargin',
12
+ ignore: true
13
+ },
6
14
  {
7
15
  key: 'placeholder',
8
16
  ignore: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.6058.189ce78",
3
+ "version": "5.1.0-dev.6060.19e3bfc",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {