@formio/js 5.0.0-dev.5588.0f690c8 → 5.0.0-dev.5594.b3f7e58

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.
@@ -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 = (0, utils_1.getScriptPlugin)(property);
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 = (0, utils_1.getScriptPlugin)(property);
3303
+ const plugin = lodash_1.default.get(window, property);
3304
3304
  if (plugin) {
3305
3305
  Component.externalLibraries[name].resolve(plugin);
3306
3306
  }
@@ -179,15 +179,8 @@ class CheckBoxComponent extends Field_1.default {
179
179
  return value;
180
180
  }
181
181
  setValue(value, flags = {}) {
182
- if (this.setCheckedState(value) !== undefined ||
183
- (!this.input && value !== undefined && (this.visible || this.conditionallyVisible() || !this.component.clearOnHide))) {
184
- const changed = this.updateValue(value, flags);
185
- if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
186
- this.redraw();
187
- }
188
- return changed;
189
- }
190
- return false;
182
+ this.setCheckedState(value);
183
+ return super.setValue(value, flags);
191
184
  }
192
185
  getValueAsString(value) {
193
186
  const { name: componentName, value: componentValue } = this.component;
@@ -0,0 +1,34 @@
1
+ declare namespace _default {
2
+ let title: string;
3
+ let name: string;
4
+ let path: string;
5
+ let type: string;
6
+ let display: string;
7
+ let components: ({
8
+ label: string;
9
+ tableView: boolean;
10
+ validateWhenHidden: boolean;
11
+ key: string;
12
+ conditional: {
13
+ show: boolean;
14
+ conjunction: string;
15
+ conditions: {
16
+ component: string;
17
+ operator: string;
18
+ }[];
19
+ };
20
+ type: string;
21
+ input: boolean;
22
+ applyMaskOn?: undefined;
23
+ } | {
24
+ label: string;
25
+ applyMaskOn: string;
26
+ tableView: boolean;
27
+ key: string;
28
+ type: string;
29
+ input: boolean;
30
+ validateWhenHidden?: undefined;
31
+ conditional?: undefined;
32
+ })[];
33
+ }
34
+ export default _default;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ title: '7595',
5
+ name: '7595',
6
+ path: '7595',
7
+ type: 'form',
8
+ display: 'form',
9
+ components: [
10
+ {
11
+ label: 'Checkbox',
12
+ tableView: false,
13
+ validateWhenHidden: false,
14
+ key: 'checkboxBefore',
15
+ conditional: {
16
+ show: true,
17
+ conjunction: 'all',
18
+ conditions: [
19
+ {
20
+ component: 'textField',
21
+ operator: 'isNotEmpty'
22
+ }
23
+ ]
24
+ },
25
+ type: 'checkbox',
26
+ input: true
27
+ },
28
+ {
29
+ label: 'Text Field',
30
+ applyMaskOn: 'change',
31
+ tableView: true,
32
+ key: 'textField',
33
+ type: 'textfield',
34
+ input: true
35
+ },
36
+ {
37
+ label: 'Checkbox',
38
+ tableView: false,
39
+ validateWhenHidden: false,
40
+ key: 'checkboxAfter',
41
+ conditional: {
42
+ show: true,
43
+ conjunction: 'all',
44
+ conditions: [
45
+ {
46
+ component: 'textField',
47
+ operator: 'isNotEmpty'
48
+ }
49
+ ]
50
+ },
51
+ type: 'checkbox',
52
+ input: true
53
+ },
54
+ ]
55
+ };
@@ -2,5 +2,6 @@ import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
+ import comp5 from './comp5';
5
6
  import customDefaultComponent from './customDefaultComponent';
6
- export { comp1, comp2, comp3, comp4, customDefaultComponent };
7
+ export { comp1, comp2, comp3, comp4, comp5, customDefaultComponent };
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.customDefaultComponent = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
6
+ exports.customDefaultComponent = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
7
7
  const comp1_1 = __importDefault(require("./comp1"));
8
8
  exports.comp1 = comp1_1.default;
9
9
  const customDefaultComponent_1 = __importDefault(require("./customDefaultComponent"));
@@ -14,3 +14,5 @@ const comp3_1 = __importDefault(require("./comp3"));
14
14
  exports.comp3 = comp3_1.default;
15
15
  const comp4_1 = __importDefault(require("./comp4"));
16
16
  exports.comp4 = comp4_1.default;
17
+ const comp5_1 = __importDefault(require("./comp5"));
18
+ exports.comp5 = comp5_1.default;
@@ -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
  *
@@ -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.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;
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
  *
@@ -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, getScriptPlugin } from '../../../utils/utils';
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 = getScriptPlugin(property);
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 = getScriptPlugin(property);
3266
+ const plugin = _.get(window, property);
3267
3267
  if (plugin) {
3268
3268
  Component.externalLibraries[name].resolve(plugin);
3269
3269
  }
@@ -178,15 +178,8 @@ export default class CheckBoxComponent extends Field {
178
178
  return value;
179
179
  }
180
180
  setValue(value, flags = {}) {
181
- if (this.setCheckedState(value) !== undefined ||
182
- (!this.input && value !== undefined && (this.visible || this.conditionallyVisible() || !this.component.clearOnHide))) {
183
- const changed = this.updateValue(value, flags);
184
- if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
185
- this.redraw();
186
- }
187
- return changed;
188
- }
189
- return false;
181
+ this.setCheckedState(value);
182
+ return super.setValue(value, flags);
190
183
  }
191
184
  getValueAsString(value) {
192
185
  const { name: componentName, value: componentValue } = this.component;
@@ -0,0 +1,34 @@
1
+ declare namespace _default {
2
+ let title: string;
3
+ let name: string;
4
+ let path: string;
5
+ let type: string;
6
+ let display: string;
7
+ let components: ({
8
+ label: string;
9
+ tableView: boolean;
10
+ validateWhenHidden: boolean;
11
+ key: string;
12
+ conditional: {
13
+ show: boolean;
14
+ conjunction: string;
15
+ conditions: {
16
+ component: string;
17
+ operator: string;
18
+ }[];
19
+ };
20
+ type: string;
21
+ input: boolean;
22
+ applyMaskOn?: undefined;
23
+ } | {
24
+ label: string;
25
+ applyMaskOn: string;
26
+ tableView: boolean;
27
+ key: string;
28
+ type: string;
29
+ input: boolean;
30
+ validateWhenHidden?: undefined;
31
+ conditional?: undefined;
32
+ })[];
33
+ }
34
+ export default _default;
@@ -0,0 +1,53 @@
1
+ export default {
2
+ title: '7595',
3
+ name: '7595',
4
+ path: '7595',
5
+ type: 'form',
6
+ display: 'form',
7
+ components: [
8
+ {
9
+ label: 'Checkbox',
10
+ tableView: false,
11
+ validateWhenHidden: false,
12
+ key: 'checkboxBefore',
13
+ conditional: {
14
+ show: true,
15
+ conjunction: 'all',
16
+ conditions: [
17
+ {
18
+ component: 'textField',
19
+ operator: 'isNotEmpty'
20
+ }
21
+ ]
22
+ },
23
+ type: 'checkbox',
24
+ input: true
25
+ },
26
+ {
27
+ label: 'Text Field',
28
+ applyMaskOn: 'change',
29
+ tableView: true,
30
+ key: 'textField',
31
+ type: 'textfield',
32
+ input: true
33
+ },
34
+ {
35
+ label: 'Checkbox',
36
+ tableView: false,
37
+ validateWhenHidden: false,
38
+ key: 'checkboxAfter',
39
+ conditional: {
40
+ show: true,
41
+ conjunction: 'all',
42
+ conditions: [
43
+ {
44
+ component: 'textField',
45
+ operator: 'isNotEmpty'
46
+ }
47
+ ]
48
+ },
49
+ type: 'checkbox',
50
+ input: true
51
+ },
52
+ ]
53
+ };
@@ -2,5 +2,6 @@ import comp1 from './comp1';
2
2
  import comp2 from './comp2';
3
3
  import comp3 from './comp3';
4
4
  import comp4 from './comp4';
5
+ import comp5 from './comp5';
5
6
  import customDefaultComponent from './customDefaultComponent';
6
- export { comp1, comp2, comp3, comp4, customDefaultComponent };
7
+ export { comp1, comp2, comp3, comp4, comp5, customDefaultComponent };
@@ -3,4 +3,5 @@ import customDefaultComponent from './customDefaultComponent';
3
3
  import comp2 from './comp2';
4
4
  import comp3 from './comp3';
5
5
  import comp4 from './comp4';
6
- export { comp1, comp2, comp3, comp4, customDefaultComponent };
6
+ import comp5 from './comp5';
7
+ export { comp1, comp2, comp3, comp4, comp5, customDefaultComponent };
@@ -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
  *
@@ -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
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5588.0f690c8",
3
+ "version": "5.0.0-dev.5594.b3f7e58",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {