@formio/js 5.1.0-dev.6200.20c037e → 5.1.0-dev.6204.b833c7c
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/dist/formio.form.js +26 -48
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +26 -48
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +20 -42
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +20 -42
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/components/datagrid/DataGrid.js +8 -1
- package/lib/cjs/components/radio/Radio.js +1 -1
- package/lib/cjs/utils/formUtils.d.ts +3 -3
- package/lib/cjs/utils/index.d.ts +3 -3
- package/lib/cjs/widgets/CalendarWidget.js +8 -1
- package/lib/mjs/components/datagrid/DataGrid.js +7 -1
- package/lib/mjs/components/radio/Radio.js +1 -1
- package/lib/mjs/utils/formUtils.d.ts +3 -3
- package/lib/mjs/utils/index.d.ts +3 -3
- package/lib/mjs/widgets/CalendarWidget.js +8 -1
- package/package.json +2 -2
@@ -496,11 +496,18 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
496
496
|
options.row = `${rowIndex}-${colIndex}`;
|
497
497
|
options.rowIndex = rowIndex;
|
498
498
|
options.onChange = (flags, changed, modified) => {
|
499
|
+
var _a, _b;
|
499
500
|
if (changed.component.type === 'form') {
|
500
501
|
const formComp = (0, utils_1.getComponent)(this.component.components, changed.component.key);
|
501
502
|
lodash_1.default.set(formComp, 'components', changed.component.components);
|
502
503
|
}
|
503
|
-
|
504
|
+
// If we're in a nested form we need to ensure our changes are triggered upstream
|
505
|
+
if (((_a = changed.instance.root) === null || _a === void 0 ? void 0 : _a.id) && (((_b = this.root) === null || _b === void 0 ? void 0 : _b.id) !== changed.instance.root.id)) {
|
506
|
+
changed.instance.root.triggerChange(flags, changed, modified);
|
507
|
+
}
|
508
|
+
else {
|
509
|
+
this.triggerChange({ modified });
|
510
|
+
}
|
504
511
|
};
|
505
512
|
let columnComponent;
|
506
513
|
if (this.builderMode) {
|
@@ -144,7 +144,7 @@ class RadioComponent extends ListComponent_1.default {
|
|
144
144
|
});
|
145
145
|
this.optionsLoaded = !this.component.dataSrc || this.component.dataSrc === 'values';
|
146
146
|
this.loadedOptions = [];
|
147
|
-
if (!this.visible) {
|
147
|
+
if (!this.visible || this.optionsLoaded) {
|
148
148
|
this.itemsLoadedResolve();
|
149
149
|
}
|
150
150
|
// Get the template keys for this radio component.
|
@@ -26,10 +26,10 @@ export const getBestMatch: typeof Utils.getBestMatch;
|
|
26
26
|
export const getComponentFromPath: typeof Utils.getComponentFromPath;
|
27
27
|
export const getComponentValue: typeof Utils.getComponentValue;
|
28
28
|
export const findComponents: typeof Utils.findComponents;
|
29
|
-
export const eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => Promise<void>;
|
30
|
-
export const eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => void;
|
29
|
+
export const eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined, afterFn?: import("@formio/core").EachComponentDataAsyncCallback | undefined) => Promise<void>;
|
30
|
+
export const eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined, afterFn?: import("@formio/core").EachComponentDataCallback | undefined) => void;
|
31
31
|
export const getComponentKey: typeof Utils.getComponentKey;
|
32
|
-
export const getContextualRowPath:
|
32
|
+
export const getContextualRowPath: any;
|
33
33
|
export const getContextualRowData: typeof Utils.getContextualRowData;
|
34
34
|
export const componentInfo: typeof Utils.componentInfo;
|
35
35
|
export const eachComponent: typeof Utils.eachComponent;
|
package/lib/cjs/utils/index.d.ts
CHANGED
@@ -37,10 +37,10 @@ declare const FormioUtils: {
|
|
37
37
|
getComponentFromPath: typeof import("@formio/core/lib/utils/formUtil").getComponentFromPath;
|
38
38
|
getComponentValue: typeof import("@formio/core/lib/utils/formUtil").getComponentValue;
|
39
39
|
findComponents: typeof import("@formio/core/lib/utils/formUtil").findComponents;
|
40
|
-
eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => Promise<void>;
|
41
|
-
eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => void;
|
40
|
+
eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined, afterFn?: import("@formio/core").EachComponentDataAsyncCallback | undefined) => Promise<void>;
|
41
|
+
eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined, afterFn?: import("@formio/core").EachComponentDataCallback | undefined) => void;
|
42
42
|
getComponentKey: typeof import("@formio/core/lib/utils/formUtil").getComponentKey;
|
43
|
-
getContextualRowPath:
|
43
|
+
getContextualRowPath: any;
|
44
44
|
getContextualRowData: typeof import("@formio/core/lib/utils/formUtil").getContextualRowData;
|
45
45
|
componentInfo: typeof import("@formio/core/lib/utils/formUtil").componentInfo;
|
46
46
|
eachComponent: typeof import("@formio/core/lib/utils/formUtil").eachComponent;
|
@@ -123,7 +123,14 @@ class CalendarWidget extends InputWidget_1.default {
|
|
123
123
|
if (this._input) {
|
124
124
|
const { locale } = this.settings;
|
125
125
|
if (locale && locale.length >= 2 && locale !== 'en') {
|
126
|
-
return Formio_1.Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr.l10ns.${locale}`, `${Formio_1.Formio.cdn['flatpickr']}/l10n/${locale}.js`, true)
|
126
|
+
return Formio_1.Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr.l10ns.${locale}`, `${Formio_1.Formio.cdn['flatpickr']}/l10n/${locale}.js`, true)
|
127
|
+
.catch(() => {
|
128
|
+
// fallback to en if locale fails to load
|
129
|
+
this.settings.locale = 'en';
|
130
|
+
})
|
131
|
+
.finally(() => {
|
132
|
+
this.initFlatpickr(Flatpickr);
|
133
|
+
});
|
127
134
|
}
|
128
135
|
else {
|
129
136
|
this.initFlatpickr(Flatpickr);
|
@@ -496,7 +496,13 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
496
496
|
const formComp = getComponent(this.component.components, changed.component.key);
|
497
497
|
_.set(formComp, 'components', changed.component.components);
|
498
498
|
}
|
499
|
-
|
499
|
+
// If we're in a nested form we need to ensure our changes are triggered upstream
|
500
|
+
if (changed.instance.root?.id && (this.root?.id !== changed.instance.root.id)) {
|
501
|
+
changed.instance.root.triggerChange(flags, changed, modified);
|
502
|
+
}
|
503
|
+
else {
|
504
|
+
this.triggerChange({ modified });
|
505
|
+
}
|
500
506
|
};
|
501
507
|
let columnComponent;
|
502
508
|
if (this.builderMode) {
|
@@ -144,7 +144,7 @@ export default class RadioComponent extends ListComponent {
|
|
144
144
|
});
|
145
145
|
this.optionsLoaded = !this.component.dataSrc || this.component.dataSrc === 'values';
|
146
146
|
this.loadedOptions = [];
|
147
|
-
if (!this.visible) {
|
147
|
+
if (!this.visible || this.optionsLoaded) {
|
148
148
|
this.itemsLoadedResolve();
|
149
149
|
}
|
150
150
|
// Get the template keys for this radio component.
|
@@ -26,10 +26,10 @@ export const getBestMatch: typeof Utils.getBestMatch;
|
|
26
26
|
export const getComponentFromPath: typeof Utils.getComponentFromPath;
|
27
27
|
export const getComponentValue: typeof Utils.getComponentValue;
|
28
28
|
export const findComponents: typeof Utils.findComponents;
|
29
|
-
export const eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => Promise<void>;
|
30
|
-
export const eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => void;
|
29
|
+
export const eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined, afterFn?: import("@formio/core").EachComponentDataAsyncCallback | undefined) => Promise<void>;
|
30
|
+
export const eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined, afterFn?: import("@formio/core").EachComponentDataCallback | undefined) => void;
|
31
31
|
export const getComponentKey: typeof Utils.getComponentKey;
|
32
|
-
export const getContextualRowPath:
|
32
|
+
export const getContextualRowPath: any;
|
33
33
|
export const getContextualRowData: typeof Utils.getContextualRowData;
|
34
34
|
export const componentInfo: typeof Utils.componentInfo;
|
35
35
|
export const eachComponent: typeof Utils.eachComponent;
|
package/lib/mjs/utils/index.d.ts
CHANGED
@@ -37,10 +37,10 @@ declare const FormioUtils: {
|
|
37
37
|
getComponentFromPath: typeof import("@formio/core/lib/utils/formUtil").getComponentFromPath;
|
38
38
|
getComponentValue: typeof import("@formio/core/lib/utils/formUtil").getComponentValue;
|
39
39
|
findComponents: typeof import("@formio/core/lib/utils/formUtil").findComponents;
|
40
|
-
eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => Promise<void>;
|
41
|
-
eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => void;
|
40
|
+
eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined, afterFn?: import("@formio/core").EachComponentDataAsyncCallback | undefined) => Promise<void>;
|
41
|
+
eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined, afterFn?: import("@formio/core").EachComponentDataCallback | undefined) => void;
|
42
42
|
getComponentKey: typeof import("@formio/core/lib/utils/formUtil").getComponentKey;
|
43
|
-
getContextualRowPath:
|
43
|
+
getContextualRowPath: any;
|
44
44
|
getContextualRowData: typeof import("@formio/core/lib/utils/formUtil").getContextualRowData;
|
45
45
|
componentInfo: typeof import("@formio/core/lib/utils/formUtil").componentInfo;
|
46
46
|
eachComponent: typeof import("@formio/core/lib/utils/formUtil").eachComponent;
|
@@ -115,7 +115,14 @@ export default class CalendarWidget extends InputWidget {
|
|
115
115
|
if (this._input) {
|
116
116
|
const { locale } = this.settings;
|
117
117
|
if (locale && locale.length >= 2 && locale !== 'en') {
|
118
|
-
return Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr.l10ns.${locale}`, `${Formio.cdn['flatpickr']}/l10n/${locale}.js`, true)
|
118
|
+
return Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr.l10ns.${locale}`, `${Formio.cdn['flatpickr']}/l10n/${locale}.js`, true)
|
119
|
+
.catch(() => {
|
120
|
+
// fallback to en if locale fails to load
|
121
|
+
this.settings.locale = 'en';
|
122
|
+
})
|
123
|
+
.finally(() => {
|
124
|
+
this.initFlatpickr(Flatpickr);
|
125
|
+
});
|
119
126
|
}
|
120
127
|
else {
|
121
128
|
this.initFlatpickr(Flatpickr);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.1.0-dev.
|
3
|
+
"version": "5.1.0-dev.6204.b833c7c",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -81,7 +81,7 @@
|
|
81
81
|
"homepage": "https://github.com/formio/formio.js#readme",
|
82
82
|
"dependencies": {
|
83
83
|
"@formio/bootstrap": "v3.0.0-dev.121.085d187",
|
84
|
-
"@formio/core": "2.
|
84
|
+
"@formio/core": "2.5.1-rc.6",
|
85
85
|
"@formio/text-mask-addons": "3.8.0-formio.4",
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|