@formio/js 5.1.0-rc.7 → 5.1.0-rc.9

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.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */
22
22
 
23
- /*! formiojs v5.1.0-rc.7 | https://unpkg.com/formiojs@5.1.0-rc.7/LICENSE.txt */
23
+ /*! formiojs v5.1.0-rc.9 | https://unpkg.com/formiojs@5.1.0-rc.9/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 = 'FORMIO_VERSION';
421
+ Formio.version = '5.1.0-rc.9';
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 = 'FORMIO_VERSION';
14
+ sdk_1.Formio.version = '5.1.0-rc.9';
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) {
@@ -1286,7 +1286,7 @@ class Component extends Element_1.default {
1286
1286
  detach() {
1287
1287
  // First iterate through each ref and delete the component so there are no dangling component references.
1288
1288
  lodash_1.default.each(this.refs, (ref) => {
1289
- if (typeof ref === NodeList) {
1289
+ if (ref instanceof NodeList) {
1290
1290
  ref.forEach((elem) => {
1291
1291
  delete elem.component;
1292
1292
  });
@@ -7,6 +7,7 @@ const lodash_1 = __importDefault(require("lodash"));
7
7
  const moment_1 = __importDefault(require("moment"));
8
8
  const Field_1 = __importDefault(require("../_classes/field/Field"));
9
9
  const utils_1 = require("../../utils/utils");
10
+ const core_1 = require("@formio/core");
10
11
  class DayComponent extends Field_1.default {
11
12
  static schema(...extend) {
12
13
  return Field_1.default.schema({
@@ -474,24 +475,7 @@ class DayComponent extends Field_1.default {
474
475
  * @returns {string} - the format for the value string.
475
476
  */
476
477
  get format() {
477
- let format = '';
478
- if (this.component.dayFirst && this.showDay) {
479
- format += 'D/';
480
- }
481
- if (this.showMonth) {
482
- format += 'M/';
483
- }
484
- if (!this.component.dayFirst && this.showDay) {
485
- format += 'D/';
486
- }
487
- if (this.showYear) {
488
- format += 'YYYY';
489
- return format;
490
- }
491
- else {
492
- // Trim off the "/" from the end of the format string.
493
- return format.length ? format.substring(0, format.length - 1) : format;
494
- }
478
+ return (0, core_1.getDayFormat)(this.component);
495
479
  }
496
480
  /**
497
481
  * Return the date for this component.
@@ -26,8 +26,8 @@ exports.default = {
26
26
  maxWords: '{{field}} must have no more than {{length}} words.',
27
27
  min: '{{field}} cannot be less than {{min}}.',
28
28
  max: '{{field}} cannot be greater than {{max}}.',
29
- maxDate: '{{field}} should not contain date after {{- maxDate}}',
30
- minDate: '{{field}} should not contain date before {{- minDate}}',
29
+ maxDate: '{{field}} should not contain date after {{maxDate}}',
30
+ minDate: '{{field}} should not contain date before {{minDate}}',
31
31
  maxYear: '{{field}} should not contain year greater than {{maxYear}}',
32
32
  minYear: '{{field}} should not contain year less than {{minYear}}',
33
33
  minSelectedCount: 'You must select at least {{minCount}} items',
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 = 'FORMIO_VERSION';
17
+ static version = '5.1.0-rc.9';
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 = 'FORMIO_VERSION';
7
+ FormioCore.version = '5.1.0-rc.9';
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) {
@@ -1263,7 +1263,7 @@ export default class Component extends Element {
1263
1263
  detach() {
1264
1264
  // First iterate through each ref and delete the component so there are no dangling component references.
1265
1265
  _.each(this.refs, (ref) => {
1266
- if (typeof ref === NodeList) {
1266
+ if (ref instanceof NodeList) {
1267
1267
  ref.forEach((elem) => {
1268
1268
  delete elem.component;
1269
1269
  });
@@ -2,6 +2,7 @@ import _ from 'lodash';
2
2
  import moment from 'moment';
3
3
  import Field from '../_classes/field/Field';
4
4
  import { boolValue, componentValueTypes, getComponentSavedTypes, getLocaleDateFormatInfo } from '../../utils/utils';
5
+ import { getDayFormat } from '@formio/core';
5
6
  export default class DayComponent extends Field {
6
7
  static schema(...extend) {
7
8
  return Field.schema({
@@ -474,24 +475,7 @@ export default class DayComponent extends Field {
474
475
  * @returns {string} - the format for the value string.
475
476
  */
476
477
  get format() {
477
- let format = '';
478
- if (this.component.dayFirst && this.showDay) {
479
- format += 'D/';
480
- }
481
- if (this.showMonth) {
482
- format += 'M/';
483
- }
484
- if (!this.component.dayFirst && this.showDay) {
485
- format += 'D/';
486
- }
487
- if (this.showYear) {
488
- format += 'YYYY';
489
- return format;
490
- }
491
- else {
492
- // Trim off the "/" from the end of the format string.
493
- return format.length ? format.substring(0, format.length - 1) : format;
494
- }
478
+ return getDayFormat(this.component);
495
479
  }
496
480
  /**
497
481
  * Return the date for this component.
@@ -24,8 +24,8 @@ export default {
24
24
  maxWords: '{{field}} must have no more than {{length}} words.',
25
25
  min: '{{field}} cannot be less than {{min}}.',
26
26
  max: '{{field}} cannot be greater than {{max}}.',
27
- maxDate: '{{field}} should not contain date after {{- maxDate}}',
28
- minDate: '{{field}} should not contain date before {{- minDate}}',
27
+ maxDate: '{{field}} should not contain date after {{maxDate}}',
28
+ minDate: '{{field}} should not contain date before {{minDate}}',
29
29
  maxYear: '{{field}} should not contain year greater than {{maxYear}}',
30
30
  minYear: '{{field}} should not contain year less than {{minYear}}',
31
31
  minSelectedCount: 'You must select at least {{minCount}} items',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-rc.7",
3
+ "version": "5.1.0-rc.9",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -41,7 +41,7 @@
41
41
  "build": "yarn doc && yarn lib && yarn dist",
42
42
  "doc": "typedoc",
43
43
  "dist": "gulp clean:dist && webpack --config webpack.config.js && webpack --config webpack.prod.js && gulp build",
44
- "lib": "gulp clean:lib && tsc --project tsconfig.cjs.json && tsc --project tsconfig.mjs.json && yarn lib:package",
44
+ "lib": "gulp clean:lib && tsc --project tsconfig.cjs.json && tsc --project tsconfig.mjs.json && yarn lib:package && gulp version",
45
45
  "lib:package": "node ./libpackage.js",
46
46
  "version": "node -e 'console.log(require(`./package.json`).version)'",
47
47
  "build-app": "yarn build-app:create-app && yarn build-app:jekyll && yarn build-app:remove-app",
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@formio/bootstrap": "3.1.0-rc.1",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "2.4.0-rc.5",
84
+ "@formio/core": "2.4.0-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",