@formio/js 5.0.0-dev.5584.9c8ee6a → 5.0.0-dev.5588.0f690c8
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 +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- 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/components/_classes/component/Component.js +2 -2
- package/lib/cjs/utils/utils.d.ts +6 -0
- package/lib/cjs/utils/utils.js +16 -2
- package/lib/mjs/components/_classes/component/Component.js +3 -3
- package/lib/mjs/utils/utils.d.ts +6 -0
- package/lib/mjs/utils/utils.js +13 -0
- package/package.json +1 -1
|
@@ -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 = (0, utils_1.getScriptPlugin)(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 = (0, utils_1.getScriptPlugin)(property);
|
|
3304
3304
|
if (plugin) {
|
|
3305
3305
|
Component.externalLibraries[name].resolve(plugin);
|
|
3306
3306
|
}
|
package/lib/cjs/utils/utils.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ 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;
|
|
30
36
|
/**
|
|
31
37
|
* Determines the boolean value of a setting.
|
|
32
38
|
*
|
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.
|
|
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;
|
|
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.getScriptPlugin = 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 = exports.observeOverload = 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,6 +172,20 @@ 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;
|
|
175
189
|
/**
|
|
176
190
|
* Determines the boolean value of a setting.
|
|
177
191
|
*
|
|
@@ -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 } from '../../../utils/utils';
|
|
9
|
+
import { fastCloneDeep, boolValue, getComponentPath, isInsideScopingComponent, currentTimezone, getScriptPlugin } 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 = getScriptPlugin(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 = getScriptPlugin(property);
|
|
3267
3267
|
if (plugin) {
|
|
3268
3268
|
Component.externalLibraries[name].resolve(plugin);
|
|
3269
3269
|
}
|
package/lib/mjs/utils/utils.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ 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;
|
|
30
36
|
/**
|
|
31
37
|
* Determines the boolean value of a setting.
|
|
32
38
|
*
|
package/lib/mjs/utils/utils.js
CHANGED
|
@@ -131,6 +131,19 @@ 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
|
+
}
|
|
134
147
|
/**
|
|
135
148
|
* Determines the boolean value of a setting.
|
|
136
149
|
*
|