@formio/js 5.3.2 → 5.3.3

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.
@@ -20,7 +20,7 @@
20
20
 
21
21
  /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
22
22
 
23
- /*! formiojs v5.3.2 | https://unpkg.com/formiojs@5.3.2/LICENSE.txt */
23
+ /*! formiojs v5.3.3 | https://unpkg.com/formiojs@5.3.3/LICENSE.txt */
24
24
 
25
25
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
26
26
 
package/lib/cjs/Embed.js CHANGED
@@ -481,7 +481,7 @@ Formio.formioReady = new Promise((ready, reject) => {
481
481
  _a._formioReady = ready;
482
482
  _a._formioReadyReject = reject;
483
483
  });
484
- Formio.version = '5.3.2';
484
+ Formio.version = '5.3.3';
485
485
  // Create a report.
486
486
  Formio.Report = {
487
487
  create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
package/lib/cjs/Formio.js CHANGED
@@ -11,7 +11,7 @@ const CDN_1 = __importDefault(require("./CDN"));
11
11
  const providers_1 = __importDefault(require("./providers"));
12
12
  sdk_1.Formio.cdn = new CDN_1.default();
13
13
  sdk_1.Formio.Providers = providers_1.default;
14
- sdk_1.Formio.version = '5.3.2';
14
+ sdk_1.Formio.version = '5.3.3';
15
15
  CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc')
16
16
  ? 'https://cdn.test-form.io'
17
17
  : 'https://cdn.form.io';
@@ -25,7 +25,6 @@ declare const _default: ({
25
25
  };
26
26
  };
27
27
  clearOnHide?: undefined;
28
- customDefaultValue?: undefined;
29
28
  rows?: undefined;
30
29
  editor?: undefined;
31
30
  as?: undefined;
@@ -40,7 +39,6 @@ declare const _default: ({
40
39
  label: string;
41
40
  clearOnHide: boolean;
42
41
  onChange: (context: any) => void;
43
- customDefaultValue: (value: any, component: any, row: any, data: any, instance: any) => any;
44
42
  input: boolean;
45
43
  rows: number;
46
44
  editor: string;
@@ -79,7 +77,6 @@ declare const _default: ({
79
77
  data?: undefined;
80
78
  conditional?: undefined;
81
79
  clearOnHide?: undefined;
82
- customDefaultValue?: undefined;
83
80
  rows?: undefined;
84
81
  editor?: undefined;
85
82
  as?: undefined;
@@ -107,7 +104,6 @@ declare const _default: ({
107
104
  onChange?: undefined;
108
105
  conditional?: undefined;
109
106
  clearOnHide?: undefined;
110
- customDefaultValue?: undefined;
111
107
  rows?: undefined;
112
108
  editor?: undefined;
113
109
  as?: undefined;
@@ -133,7 +129,6 @@ declare const _default: ({
133
129
  data?: undefined;
134
130
  conditional?: undefined;
135
131
  clearOnHide?: undefined;
136
- customDefaultValue?: undefined;
137
132
  rows?: undefined;
138
133
  editor?: undefined;
139
134
  as?: undefined;
@@ -154,7 +149,6 @@ declare const _default: ({
154
149
  data?: undefined;
155
150
  conditional?: undefined;
156
151
  clearOnHide?: undefined;
157
- customDefaultValue?: undefined;
158
152
  rows?: undefined;
159
153
  editor?: undefined;
160
154
  as?: undefined;
@@ -177,7 +171,6 @@ declare const _default: ({
177
171
  data?: undefined;
178
172
  conditional?: undefined;
179
173
  clearOnHide?: undefined;
180
- customDefaultValue?: undefined;
181
174
  rows?: undefined;
182
175
  editor?: undefined;
183
176
  as?: undefined;
@@ -208,7 +201,6 @@ declare const _default: ({
208
201
  data?: undefined;
209
202
  conditional?: undefined;
210
203
  clearOnHide?: undefined;
211
- customDefaultValue?: undefined;
212
204
  rows?: undefined;
213
205
  editor?: undefined;
214
206
  as?: undefined;
@@ -228,7 +220,6 @@ declare const _default: ({
228
220
  data?: undefined;
229
221
  conditional?: undefined;
230
222
  clearOnHide?: undefined;
231
- customDefaultValue?: undefined;
232
223
  rows?: undefined;
233
224
  editor?: undefined;
234
225
  as?: undefined;
@@ -251,7 +242,6 @@ declare const _default: ({
251
242
  data?: undefined;
252
243
  conditional?: undefined;
253
244
  clearOnHide?: undefined;
254
- customDefaultValue?: undefined;
255
245
  rows?: undefined;
256
246
  editor?: undefined;
257
247
  as?: undefined;
@@ -20,19 +20,19 @@ exports.default = [
20
20
  defaultValue: 'input',
21
21
  calculateValue: (context) => {
22
22
  var _a;
23
- let currentType = context.data['widget.type'];
23
+ let currentType = context.instance._widgetType;
24
24
  if (currentType) {
25
25
  return currentType;
26
26
  }
27
27
  const widget = context.data.widget;
28
28
  if (isObject(widget) && widget.type) {
29
- context.data['widget.type'] = widget.type;
29
+ context.instance._widgetType = widget.type;
30
30
  return widget.type;
31
31
  }
32
32
  if (typeof widget === 'string') {
33
33
  const originalType = (_a = getOriginalWidget(context.instance)) === null || _a === void 0 ? void 0 : _a.type;
34
34
  if (originalType) {
35
- context.data['widget.type'] = originalType;
35
+ context.instance._widgetType = originalType;
36
36
  return originalType;
37
37
  }
38
38
  }
@@ -40,11 +40,11 @@ exports.default = [
40
40
  },
41
41
  onChange: (context) => {
42
42
  var _a;
43
- const newType = context.data['widget.type'];
43
+ const newType = context.instance.dataValue;
44
44
  const currentWidget = context.data.widget;
45
45
  let oldType;
46
46
  if (isObject(currentWidget)) {
47
- oldType = currentWidget.type;
47
+ oldType = context.instance._widgetType;
48
48
  }
49
49
  else if (typeof currentWidget === 'string') {
50
50
  oldType = (_a = getOriginalWidget(context.instance)) === null || _a === void 0 ? void 0 : _a.type;
@@ -55,10 +55,12 @@ exports.default = [
55
55
  if (newType !== oldType) {
56
56
  if (newType === 'input') {
57
57
  context.data.widget = { type: 'input' };
58
+ context.instance._widgetType = newType;
58
59
  }
59
- else {
60
+ else if (newType) {
60
61
  const defaultSettings = getDefaultWidgetSettings(newType);
61
62
  context.data.widget = defaultSettings || { type: newType };
63
+ context.instance._widgetType = newType;
62
64
  }
63
65
  }
64
66
  else if (!currentWidget) {
@@ -94,28 +96,12 @@ exports.default = [
94
96
  return;
95
97
  }
96
98
  if (isObject(currentWidget)) {
97
- const currentType = context.data['widget.type'];
99
+ const currentType = context.instance.root.getComponent('widget.type')._widgetType || currentWidget.type;
98
100
  if (currentType && currentWidget.type !== currentType) {
99
101
  context.data.widget = Object.assign(Object.assign({}, currentWidget), { type: currentType });
100
102
  }
101
103
  }
102
104
  },
103
- customDefaultValue: (value, component, row, data, instance) => {
104
- if (!data.widget) {
105
- const originalWidget = getOriginalWidget(instance);
106
- const widgetType = data['widget.type'] || (originalWidget === null || originalWidget === void 0 ? void 0 : originalWidget.type);
107
- if (widgetType && widgetType !== 'input') {
108
- if ((originalWidget === null || originalWidget === void 0 ? void 0 : originalWidget.type) === widgetType && !lodash_1.default.isEmpty(lodash_1.default.omit(originalWidget, 'type'))) {
109
- return lodash_1.default.omit(originalWidget, 'language');
110
- }
111
- const defaultSettings = getDefaultWidgetSettings(widgetType);
112
- if (defaultSettings) {
113
- return defaultSettings;
114
- }
115
- }
116
- }
117
- return value;
118
- },
119
105
  input: true,
120
106
  rows: 5,
121
107
  editor: 'ace',
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "type": "commonjs",
3
- "version": "5.3.2"
3
+ "version": "5.3.3"
4
4
  }
package/lib/mjs/Embed.js CHANGED
@@ -14,7 +14,7 @@ export class Formio {
14
14
  Formio._formioReady = ready;
15
15
  Formio._formioReadyReject = reject;
16
16
  });
17
- static version = '5.3.2';
17
+ static version = '5.3.3';
18
18
  static setLicense(license, norecurse = false) {
19
19
  Formio.license = license;
20
20
  if (!norecurse && Formio.FormioClass) {
package/lib/mjs/Formio.js CHANGED
@@ -4,7 +4,7 @@ import CDN from './CDN';
4
4
  import Providers from './providers';
5
5
  FormioCore.cdn = new CDN();
6
6
  FormioCore.Providers = Providers;
7
- FormioCore.version = '5.3.2';
7
+ FormioCore.version = '5.3.3';
8
8
  CDN.defaultCDN = FormioCore.version.includes('rc')
9
9
  ? 'https://cdn.test-form.io'
10
10
  : 'https://cdn.form.io';
@@ -25,7 +25,6 @@ declare const _default: ({
25
25
  };
26
26
  };
27
27
  clearOnHide?: undefined;
28
- customDefaultValue?: undefined;
29
28
  rows?: undefined;
30
29
  editor?: undefined;
31
30
  as?: undefined;
@@ -40,7 +39,6 @@ declare const _default: ({
40
39
  label: string;
41
40
  clearOnHide: boolean;
42
41
  onChange: (context: any) => void;
43
- customDefaultValue: (value: any, component: any, row: any, data: any, instance: any) => any;
44
42
  input: boolean;
45
43
  rows: number;
46
44
  editor: string;
@@ -79,7 +77,6 @@ declare const _default: ({
79
77
  data?: undefined;
80
78
  conditional?: undefined;
81
79
  clearOnHide?: undefined;
82
- customDefaultValue?: undefined;
83
80
  rows?: undefined;
84
81
  editor?: undefined;
85
82
  as?: undefined;
@@ -107,7 +104,6 @@ declare const _default: ({
107
104
  onChange?: undefined;
108
105
  conditional?: undefined;
109
106
  clearOnHide?: undefined;
110
- customDefaultValue?: undefined;
111
107
  rows?: undefined;
112
108
  editor?: undefined;
113
109
  as?: undefined;
@@ -133,7 +129,6 @@ declare const _default: ({
133
129
  data?: undefined;
134
130
  conditional?: undefined;
135
131
  clearOnHide?: undefined;
136
- customDefaultValue?: undefined;
137
132
  rows?: undefined;
138
133
  editor?: undefined;
139
134
  as?: undefined;
@@ -154,7 +149,6 @@ declare const _default: ({
154
149
  data?: undefined;
155
150
  conditional?: undefined;
156
151
  clearOnHide?: undefined;
157
- customDefaultValue?: undefined;
158
152
  rows?: undefined;
159
153
  editor?: undefined;
160
154
  as?: undefined;
@@ -177,7 +171,6 @@ declare const _default: ({
177
171
  data?: undefined;
178
172
  conditional?: undefined;
179
173
  clearOnHide?: undefined;
180
- customDefaultValue?: undefined;
181
174
  rows?: undefined;
182
175
  editor?: undefined;
183
176
  as?: undefined;
@@ -208,7 +201,6 @@ declare const _default: ({
208
201
  data?: undefined;
209
202
  conditional?: undefined;
210
203
  clearOnHide?: undefined;
211
- customDefaultValue?: undefined;
212
204
  rows?: undefined;
213
205
  editor?: undefined;
214
206
  as?: undefined;
@@ -228,7 +220,6 @@ declare const _default: ({
228
220
  data?: undefined;
229
221
  conditional?: undefined;
230
222
  clearOnHide?: undefined;
231
- customDefaultValue?: undefined;
232
223
  rows?: undefined;
233
224
  editor?: undefined;
234
225
  as?: undefined;
@@ -251,7 +242,6 @@ declare const _default: ({
251
242
  data?: undefined;
252
243
  conditional?: undefined;
253
244
  clearOnHide?: undefined;
254
- customDefaultValue?: undefined;
255
245
  rows?: undefined;
256
246
  editor?: undefined;
257
247
  as?: undefined;
@@ -14,30 +14,30 @@ export default [
14
14
  tooltip: 'The widget is the display UI used to input the value of the field.',
15
15
  defaultValue: 'input',
16
16
  calculateValue: (context) => {
17
- let currentType = context.data['widget.type'];
17
+ let currentType = context.instance._widgetType;
18
18
  if (currentType) {
19
19
  return currentType;
20
20
  }
21
21
  const widget = context.data.widget;
22
22
  if (isObject(widget) && widget.type) {
23
- context.data['widget.type'] = widget.type;
23
+ context.instance._widgetType = widget.type;
24
24
  return widget.type;
25
25
  }
26
26
  if (typeof widget === 'string') {
27
27
  const originalType = getOriginalWidget(context.instance)?.type;
28
28
  if (originalType) {
29
- context.data['widget.type'] = originalType;
29
+ context.instance._widgetType = originalType;
30
30
  return originalType;
31
31
  }
32
32
  }
33
33
  return 'input';
34
34
  },
35
35
  onChange: (context) => {
36
- const newType = context.data['widget.type'];
36
+ const newType = context.instance.dataValue;
37
37
  const currentWidget = context.data.widget;
38
38
  let oldType;
39
39
  if (isObject(currentWidget)) {
40
- oldType = currentWidget.type;
40
+ oldType = context.instance._widgetType;
41
41
  }
42
42
  else if (typeof currentWidget === 'string') {
43
43
  oldType = getOriginalWidget(context.instance)?.type;
@@ -48,10 +48,12 @@ export default [
48
48
  if (newType !== oldType) {
49
49
  if (newType === 'input') {
50
50
  context.data.widget = { type: 'input' };
51
+ context.instance._widgetType = newType;
51
52
  }
52
- else {
53
+ else if (newType) {
53
54
  const defaultSettings = getDefaultWidgetSettings(newType);
54
55
  context.data.widget = defaultSettings || { type: newType };
56
+ context.instance._widgetType = newType;
55
57
  }
56
58
  }
57
59
  else if (!currentWidget) {
@@ -87,28 +89,12 @@ export default [
87
89
  return;
88
90
  }
89
91
  if (isObject(currentWidget)) {
90
- const currentType = context.data['widget.type'];
92
+ const currentType = context.instance.root.getComponent('widget.type')._widgetType || currentWidget.type;
91
93
  if (currentType && currentWidget.type !== currentType) {
92
94
  context.data.widget = { ...currentWidget, type: currentType };
93
95
  }
94
96
  }
95
97
  },
96
- customDefaultValue: (value, component, row, data, instance) => {
97
- if (!data.widget) {
98
- const originalWidget = getOriginalWidget(instance);
99
- const widgetType = data['widget.type'] || originalWidget?.type;
100
- if (widgetType && widgetType !== 'input') {
101
- if (originalWidget?.type === widgetType && !_.isEmpty(_.omit(originalWidget, 'type'))) {
102
- return _.omit(originalWidget, 'language');
103
- }
104
- const defaultSettings = getDefaultWidgetSettings(widgetType);
105
- if (defaultSettings) {
106
- return defaultSettings;
107
- }
108
- }
109
- }
110
- return value;
111
- },
112
98
  input: true,
113
99
  rows: 5,
114
100
  editor: 'ace',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "5.3.2"
3
+ "version": "5.3.3"
4
4
 
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.3.2",
3
+ "version": "5.3.3",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -89,7 +89,7 @@
89
89
  "uuid": "^9.0.0",
90
90
  "vanilla-picker": "^2.12.3",
91
91
  "@formio/bootstrap": "^3.2.2",
92
- "@formio/core": "^2.6.2"
92
+ "@formio/core": "^2.6.3"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@types/node": "^22.15.19",