@formio/js 5.0.2-rc.1 → 5.0.2-rc.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.
@@ -20,7 +20,7 @@
20
20
 
21
21
  /*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
22
22
 
23
- /*! formiojs v5.0.2-rc.1 | https://unpkg.com/formiojs@5.0.2-rc.1/LICENSE.txt */
23
+ /*! formiojs v5.0.2-rc.3 | https://unpkg.com/formiojs@5.0.2-rc.3/LICENSE.txt */
24
24
 
25
25
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
26
26
 
package/lib/cjs/Embed.js CHANGED
@@ -418,7 +418,7 @@ Formio.formioReady = new Promise((ready, reject) => {
418
418
  _a._formioReady = ready;
419
419
  _a._formioReadyReject = reject;
420
420
  });
421
- Formio.version = '5.0.2-rc.1';
421
+ Formio.version = '5.0.2-rc.3';
422
422
  // Create a report.
423
423
  Formio.Report = {
424
424
  create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
package/lib/cjs/Formio.js CHANGED
@@ -11,7 +11,7 @@ const CDN_1 = __importDefault(require("./CDN"));
11
11
  const providers_1 = __importDefault(require("./providers"));
12
12
  sdk_1.Formio.cdn = new CDN_1.default();
13
13
  sdk_1.Formio.Providers = providers_1.default;
14
- sdk_1.Formio.version = '5.0.2-rc.1';
14
+ sdk_1.Formio.version = '5.0.2-rc.3';
15
15
  CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
16
16
  const isNil = (val) => val === null || val === undefined;
17
17
  sdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
@@ -34,6 +34,7 @@ const Evaluator_1 = require("./Evaluator");
34
34
  Object.defineProperty(exports, "Evaluator", { enumerable: true, get: function () { return Evaluator_1.Evaluator; } });
35
35
  const conditionOperators_1 = __importDefault(require("./conditionOperators"));
36
36
  exports.ConditionOperators = conditionOperators_1.default;
37
+ const core_1 = require("@formio/core");
37
38
  const interpolate = Evaluator_1.Evaluator.interpolate;
38
39
  exports.interpolate = interpolate;
39
40
  __exportStar(require("./formUtils"), exports);
@@ -282,7 +283,7 @@ function checkSimpleConditional(component, condition, row, data, instance) {
282
283
  default:
283
284
  result = lodash_1.default.every(conditionsResult.flat(), res => !!res);
284
285
  }
285
- return show ? result : !result;
286
+ return (0, core_1.convertShowToBoolean)(show) ? result : !result;
286
287
  }
287
288
  }
288
289
  exports.checkSimpleConditional = checkSimpleConditional;
@@ -295,12 +296,12 @@ exports.checkSimpleConditional = checkSimpleConditional;
295
296
  */
296
297
  function getComponentActualValue(compPath, data, row) {
297
298
  let value = null;
298
- if (row) {
299
- value = (0, formUtils_1.getValue)({ data: row }, compPath);
300
- }
301
- if (data && lodash_1.default.isNil(value)) {
299
+ if (data) {
302
300
  value = (0, formUtils_1.getValue)({ data }, compPath);
303
301
  }
302
+ if (row && lodash_1.default.isNil(value)) {
303
+ value = (0, formUtils_1.getValue)({ data: row }, compPath);
304
+ }
304
305
  // FOR-400 - Fix issue where falsey values were being evaluated as show=true
305
306
  if (lodash_1.default.isNil(value) || (lodash_1.default.isObject(value) && lodash_1.default.isEmpty(value))) {
306
307
  value = '';
package/lib/mjs/Embed.js CHANGED
@@ -14,7 +14,7 @@ export class Formio {
14
14
  Formio._formioReady = ready;
15
15
  Formio._formioReadyReject = reject;
16
16
  });
17
- static version = '5.0.2-rc.1';
17
+ static version = '5.0.2-rc.3';
18
18
  static setLicense(license, norecurse = false) {
19
19
  Formio.license = license;
20
20
  if (!norecurse && Formio.FormioClass) {
package/lib/mjs/Formio.js CHANGED
@@ -4,7 +4,7 @@ import CDN from './CDN';
4
4
  import Providers from './providers';
5
5
  FormioCore.cdn = new CDN();
6
6
  FormioCore.Providers = Providers;
7
- FormioCore.version = '5.0.2-rc.1';
7
+ FormioCore.version = '5.0.2-rc.3';
8
8
  CDN.defaultCDN = FormioCore.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
9
9
  const isNil = (val) => val === null || val === undefined;
10
10
  FormioCore.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
@@ -8,6 +8,7 @@ import dompurify from 'dompurify';
8
8
  import { getValue } from './formUtils';
9
9
  import { Evaluator } from './Evaluator';
10
10
  import ConditionOperators from './conditionOperators';
11
+ import { convertShowToBoolean } from '@formio/core';
11
12
  const interpolate = Evaluator.interpolate;
12
13
  export * from './formUtils';
13
14
  // Configure JsonLogic
@@ -247,7 +248,7 @@ export function checkSimpleConditional(component, condition, row, data, instance
247
248
  default:
248
249
  result = _.every(conditionsResult.flat(), res => !!res);
249
250
  }
250
- return show ? result : !result;
251
+ return convertShowToBoolean(show) ? result : !result;
251
252
  }
252
253
  }
253
254
  /**
@@ -259,12 +260,12 @@ export function checkSimpleConditional(component, condition, row, data, instance
259
260
  */
260
261
  export function getComponentActualValue(compPath, data, row) {
261
262
  let value = null;
262
- if (row) {
263
- value = getValue({ data: row }, compPath);
264
- }
265
- if (data && _.isNil(value)) {
263
+ if (data) {
266
264
  value = getValue({ data }, compPath);
267
265
  }
266
+ if (row && _.isNil(value)) {
267
+ value = getValue({ data: row }, compPath);
268
+ }
268
269
  // FOR-400 - Fix issue where falsey values were being evaluated as show=true
269
270
  if (_.isNil(value) || (_.isObject(value) && _.isEmpty(value))) {
270
271
  value = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.2-rc.1",
3
+ "version": "5.0.2-rc.3",
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
  "dependencies": {
82
82
  "@formio/bootstrap": "3.0.2-rc.1",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "2.3.2",
84
+ "@formio/core": "2.3.3-rc.1",
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",