@formio/js 5.3.1 → 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.
Files changed (36) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +928 -919
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +2 -4
  7. package/dist/formio.full.js +1209 -1200
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +2 -4
  10. package/dist/formio.js +846 -826
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +2 -2
  13. package/dist/formio.utils.js +791 -782
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +2 -4
  16. package/lib/cjs/Embed.js +29 -1
  17. package/lib/cjs/Formio.js +1 -1
  18. package/lib/cjs/Webform.js +26 -0
  19. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.d.ts +18 -1
  20. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +3 -0
  21. package/lib/cjs/components/datetime/editForm/DateTime.edit.time.d.ts +13 -2
  22. package/lib/cjs/components/datetime/editForm/DateTime.edit.time.js +3 -0
  23. package/lib/cjs/components/textfield/editForm/TextField.edit.display.d.ts +0 -10
  24. package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +9 -23
  25. package/lib/cjs/package.json +1 -1
  26. package/lib/mjs/Embed.js +29 -1
  27. package/lib/mjs/Formio.js +1 -1
  28. package/lib/mjs/Webform.js +26 -0
  29. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.d.ts +18 -1
  30. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +3 -0
  31. package/lib/mjs/components/datetime/editForm/DateTime.edit.time.d.ts +13 -2
  32. package/lib/mjs/components/datetime/editForm/DateTime.edit.time.js +3 -0
  33. package/lib/mjs/components/textfield/editForm/TextField.edit.display.d.ts +0 -10
  34. package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +9 -23
  35. package/lib/mjs/package.json +1 -1
  36. package/package.json +4 -4
@@ -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.1"
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.1",
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": {
@@ -67,7 +67,7 @@
67
67
  "core-js": "^3.37.1",
68
68
  "dialog-polyfill": "^0.5.6",
69
69
  "dom-autoscroller": "^2.3.4",
70
- "dompurify": "^3.2.4",
70
+ "dompurify": "^3.3.3",
71
71
  "downloadjs": "^1.4.7",
72
72
  "dragula": "^3.7.3",
73
73
  "eventemitter3": "^5.0.1",
@@ -88,8 +88,8 @@
88
88
  "tippy.js": "^6.3.7",
89
89
  "uuid": "^9.0.0",
90
90
  "vanilla-picker": "^2.12.3",
91
- "@formio/bootstrap": "^3.2.1",
92
- "@formio/core": "^2.6.1"
91
+ "@formio/bootstrap": "^3.2.2",
92
+ "@formio/core": "^2.6.3"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@types/node": "^22.15.19",