@formio/js 5.0.0-dev.5588.0f690c8 → 5.0.0-dev.5593.4f4b210
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 +3 -3
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +3 -3
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Webform.js +12 -5
- package/lib/cjs/components/_classes/component/Component.js +2 -2
- package/lib/cjs/utils/utils.d.ts +0 -6
- package/lib/cjs/utils/utils.js +2 -16
- package/lib/mjs/Webform.js +12 -5
- package/lib/mjs/components/_classes/component/Component.js +3 -3
- package/lib/mjs/utils/utils.d.ts +0 -6
- package/lib/mjs/utils/utils.js +0 -13
- package/package.json +1 -1
package/lib/cjs/Webform.js
CHANGED
|
@@ -291,12 +291,19 @@ 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) {
|
|
295
295
|
this.formReady.then(() => {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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;
|
|
300
307
|
}
|
|
301
308
|
});
|
|
302
309
|
}
|
|
@@ -3257,7 +3257,7 @@ Component.requireLibrary = function (name, property, src, polling) {
|
|
|
3257
3257
|
}.bind(Component.externalLibraries[name]);
|
|
3258
3258
|
}
|
|
3259
3259
|
// See if the plugin already exists.
|
|
3260
|
-
const plugin = (
|
|
3260
|
+
const plugin = lodash_1.default.get(window, property);
|
|
3261
3261
|
if (plugin) {
|
|
3262
3262
|
Component.externalLibraries[name].resolve(plugin);
|
|
3263
3263
|
}
|
|
@@ -3300,7 +3300,7 @@ Component.requireLibrary = function (name, property, src, polling) {
|
|
|
3300
3300
|
// if no callback is provided, then check periodically for the script.
|
|
3301
3301
|
if (polling) {
|
|
3302
3302
|
setTimeout(function checkLibrary() {
|
|
3303
|
-
const plugin = (
|
|
3303
|
+
const plugin = lodash_1.default.get(window, property);
|
|
3304
3304
|
if (plugin) {
|
|
3305
3305
|
Component.externalLibraries[name].resolve(plugin);
|
|
3306
3306
|
}
|
package/lib/cjs/utils/utils.d.ts
CHANGED
|
@@ -27,12 +27,6 @@ export function getElementRect(element: any): {
|
|
|
27
27
|
width: string;
|
|
28
28
|
height: string;
|
|
29
29
|
};
|
|
30
|
-
/**
|
|
31
|
-
* Get non HTMLElement property in the window object
|
|
32
|
-
* @param {String} property
|
|
33
|
-
* @return {any || undefined}
|
|
34
|
-
*/
|
|
35
|
-
export function getScriptPlugin(property: string): any;
|
|
36
30
|
/**
|
|
37
31
|
* Determines the boolean value of a setting.
|
|
38
32
|
*
|
package/lib/cjs/utils/utils.js
CHANGED
|
@@ -30,8 +30,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.withSwitch = exports.firstNonNil = exports.unfold = exports.bootstrapVersion = exports.uniqueKey = exports.iterateKey = exports.delay = exports.fieldData = exports.getCurrencyAffixes = exports.getNumberDecimalLimit = exports.getNumberSeparators = exports.matchInputMask = exports.unmaskValue = exports.getInputMask = exports.convertFormatToMask = exports.convertFormatToMoment = exports.convertFormatToFlatpickr = exports.getLocaleDateFormatInfo = exports.formatOffset = exports.formatDate = exports.momentDate = exports.loadZones = exports.shouldLoadZones = exports.zonesLoaded = exports.offsetDate = exports.currentTimezone = exports.isValidDate = exports.getDateSetting = exports.guid = exports.uniqueName = exports.convertStringToHTMLElement = exports.unescapeHTML = exports.setActionProperty = exports.checkTrigger = exports.checkCondition = exports.checkJsonConditional = exports.checkCustomConditional = exports.getComponentActualValue = exports.checkSimpleConditional = exports.checkCalculated = exports.isMongoId = exports.boolValue = exports.
|
|
34
|
-
exports.isSelectResourceWithObjectValue = exports.getItemTemplateKeys = exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports._ = exports.getFocusableElements = exports.isInsideScopingComponent = exports.isPromise = exports.getDataParentComponent = exports.getComponentPath = exports.getComponentPathWithoutIndicies = exports.getBrowserInfo = exports.getIEBrowserVersion = exports.round = exports.getStringFromComponentPath = exports.isChildOf = exports.getArrayFromComponentPath = exports.isInputComponent = exports.interpolate = exports.Evaluator = exports.fastCloneDeep = exports.sanitize = exports.translateHTMLTemplate = exports.getContextButtons = exports.getContextComponents =
|
|
33
|
+
exports.observeOverload = exports.withSwitch = exports.firstNonNil = exports.unfold = exports.bootstrapVersion = exports.uniqueKey = exports.iterateKey = exports.delay = exports.fieldData = exports.getCurrencyAffixes = exports.getNumberDecimalLimit = exports.getNumberSeparators = exports.matchInputMask = exports.unmaskValue = exports.getInputMask = exports.convertFormatToMask = exports.convertFormatToMoment = exports.convertFormatToFlatpickr = exports.getLocaleDateFormatInfo = exports.formatOffset = exports.formatDate = exports.momentDate = exports.loadZones = exports.shouldLoadZones = exports.zonesLoaded = exports.offsetDate = exports.currentTimezone = exports.isValidDate = exports.getDateSetting = exports.guid = exports.uniqueName = exports.convertStringToHTMLElement = exports.unescapeHTML = exports.setActionProperty = exports.checkTrigger = exports.checkCondition = exports.checkJsonConditional = exports.checkCustomConditional = exports.getComponentActualValue = exports.checkSimpleConditional = exports.checkCalculated = exports.isMongoId = exports.boolValue = exports.getElementRect = exports.getPropertyValue = exports.getRandomComponentId = exports.evaluate = exports.moment = exports.ConditionOperators = exports.jsonLogic = void 0;
|
|
34
|
+
exports.isSelectResourceWithObjectValue = exports.getItemTemplateKeys = exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports._ = exports.getFocusableElements = exports.isInsideScopingComponent = exports.isPromise = exports.getDataParentComponent = exports.getComponentPath = exports.getComponentPathWithoutIndicies = exports.getBrowserInfo = exports.getIEBrowserVersion = exports.round = exports.getStringFromComponentPath = exports.isChildOf = exports.getArrayFromComponentPath = exports.isInputComponent = exports.interpolate = exports.Evaluator = exports.fastCloneDeep = exports.sanitize = exports.translateHTMLTemplate = exports.getContextButtons = exports.getContextComponents = void 0;
|
|
35
35
|
const lodash_1 = __importDefault(require("lodash"));
|
|
36
36
|
exports._ = lodash_1.default;
|
|
37
37
|
const fetch_ponyfill_1 = __importDefault(require("fetch-ponyfill"));
|
|
@@ -172,20 +172,6 @@ function getElementRect(element) {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
exports.getElementRect = getElementRect;
|
|
175
|
-
/**
|
|
176
|
-
* Get non HTMLElement property in the window object
|
|
177
|
-
* @param {String} property
|
|
178
|
-
* @return {any || undefined}
|
|
179
|
-
*/
|
|
180
|
-
function getScriptPlugin(property) {
|
|
181
|
-
const obj = window[property];
|
|
182
|
-
if (typeof HTMLElement === 'object' ? obj instanceof HTMLElement : //DOM2
|
|
183
|
-
obj && typeof obj === 'object' && true && obj.nodeType === 1 && typeof obj.nodeName === 'string') {
|
|
184
|
-
return undefined;
|
|
185
|
-
}
|
|
186
|
-
return obj;
|
|
187
|
-
}
|
|
188
|
-
exports.getScriptPlugin = getScriptPlugin;
|
|
189
175
|
/**
|
|
190
176
|
* Determines the boolean value of a setting.
|
|
191
177
|
*
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -263,12 +263,19 @@ 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) {
|
|
267
267
|
this.formReady.then(() => {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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;
|
|
272
279
|
}
|
|
273
280
|
});
|
|
274
281
|
}
|
|
@@ -6,7 +6,7 @@ import isMobile from 'ismobilejs';
|
|
|
6
6
|
import { processOne, processOneSync, validateProcessInfo } from '@formio/core/process';
|
|
7
7
|
import { Formio } from '../../../Formio';
|
|
8
8
|
import * as FormioUtils from '../../../utils/utils';
|
|
9
|
-
import { fastCloneDeep, boolValue, getComponentPath, isInsideScopingComponent, currentTimezone
|
|
9
|
+
import { fastCloneDeep, boolValue, getComponentPath, isInsideScopingComponent, currentTimezone } from '../../../utils/utils';
|
|
10
10
|
import Element from '../../../Element';
|
|
11
11
|
import ComponentModal from '../componentModal/ComponentModal';
|
|
12
12
|
import Widgets from '../../../widgets';
|
|
@@ -3220,7 +3220,7 @@ Component.requireLibrary = function (name, property, src, polling) {
|
|
|
3220
3220
|
}.bind(Component.externalLibraries[name]);
|
|
3221
3221
|
}
|
|
3222
3222
|
// See if the plugin already exists.
|
|
3223
|
-
const plugin =
|
|
3223
|
+
const plugin = _.get(window, property);
|
|
3224
3224
|
if (plugin) {
|
|
3225
3225
|
Component.externalLibraries[name].resolve(plugin);
|
|
3226
3226
|
}
|
|
@@ -3263,7 +3263,7 @@ Component.requireLibrary = function (name, property, src, polling) {
|
|
|
3263
3263
|
// if no callback is provided, then check periodically for the script.
|
|
3264
3264
|
if (polling) {
|
|
3265
3265
|
setTimeout(function checkLibrary() {
|
|
3266
|
-
const plugin =
|
|
3266
|
+
const plugin = _.get(window, property);
|
|
3267
3267
|
if (plugin) {
|
|
3268
3268
|
Component.externalLibraries[name].resolve(plugin);
|
|
3269
3269
|
}
|
package/lib/mjs/utils/utils.d.ts
CHANGED
|
@@ -27,12 +27,6 @@ export function getElementRect(element: any): {
|
|
|
27
27
|
width: string;
|
|
28
28
|
height: string;
|
|
29
29
|
};
|
|
30
|
-
/**
|
|
31
|
-
* Get non HTMLElement property in the window object
|
|
32
|
-
* @param {String} property
|
|
33
|
-
* @return {any || undefined}
|
|
34
|
-
*/
|
|
35
|
-
export function getScriptPlugin(property: string): any;
|
|
36
30
|
/**
|
|
37
31
|
* Determines the boolean value of a setting.
|
|
38
32
|
*
|
package/lib/mjs/utils/utils.js
CHANGED
|
@@ -131,19 +131,6 @@ export function getElementRect(element) {
|
|
|
131
131
|
height: getPropertyValue(style, 'height')
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Get non HTMLElement property in the window object
|
|
136
|
-
* @param {String} property
|
|
137
|
-
* @return {any || undefined}
|
|
138
|
-
*/
|
|
139
|
-
export function getScriptPlugin(property) {
|
|
140
|
-
const obj = window[property];
|
|
141
|
-
if (typeof HTMLElement === 'object' ? obj instanceof HTMLElement : //DOM2
|
|
142
|
-
obj && typeof obj === 'object' && true && obj.nodeType === 1 && typeof obj.nodeName === 'string') {
|
|
143
|
-
return undefined;
|
|
144
|
-
}
|
|
145
|
-
return obj;
|
|
146
|
-
}
|
|
147
134
|
/**
|
|
148
135
|
* Determines the boolean value of a setting.
|
|
149
136
|
*
|