@formio/js 5.0.0-rc.78 → 5.0.0-rc.79

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +21 -21
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +2 -2
  7. package/dist/formio.full.js +28 -28
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +2 -2
  10. package/dist/formio.js +3 -3
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +1 -1
  13. package/dist/formio.utils.js +12 -12
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +2 -2
  16. package/lib/cjs/Webform.js +5 -2
  17. package/lib/cjs/components/_classes/component/Component.js +2 -2
  18. package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
  19. package/lib/cjs/components/_classes/multivalue/Multivalue.js +18 -12
  20. package/lib/cjs/components/day/Day.d.ts +5 -0
  21. package/lib/cjs/components/day/Day.js +52 -12
  22. package/lib/cjs/components/day/editForm/Day.edit.day.d.ts +17 -0
  23. package/lib/cjs/components/day/editForm/Day.edit.day.js +19 -0
  24. package/lib/cjs/components/day/editForm/Day.edit.month.d.ts +5 -0
  25. package/lib/cjs/components/day/editForm/Day.edit.month.js +19 -0
  26. package/lib/cjs/components/day/editForm/Day.edit.year.d.ts +5 -0
  27. package/lib/cjs/components/day/editForm/Day.edit.year.js +13 -0
  28. package/lib/cjs/components/radio/Radio.js +1 -1
  29. package/lib/cjs/components/select/Select.js +5 -2
  30. package/lib/cjs/components/select/editForm/Select.edit.validation.js +2 -1
  31. package/lib/cjs/components/select/fixtures/comp27.d.ts +18 -0
  32. package/lib/cjs/components/select/fixtures/comp27.js +19 -0
  33. package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
  34. package/lib/cjs/components/select/fixtures/index.js +5 -1
  35. package/lib/cjs/components/selectboxes/SelectBoxes.js +1 -1
  36. package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +2 -1
  37. package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +2 -2
  38. package/lib/cjs/utils/conditionOperators/IsEqualTo.js +2 -2
  39. package/lib/cjs/utils/formUtils.d.ts +1 -2
  40. package/lib/cjs/utils/formUtils.js +2 -3
  41. package/lib/mjs/Webform.js +9 -2
  42. package/lib/mjs/components/_classes/component/Component.js +2 -2
  43. package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
  44. package/lib/mjs/components/_classes/multivalue/Multivalue.js +18 -12
  45. package/lib/mjs/components/day/Day.d.ts +5 -0
  46. package/lib/mjs/components/day/Day.js +52 -12
  47. package/lib/mjs/components/day/editForm/Day.edit.day.d.ts +17 -0
  48. package/lib/mjs/components/day/editForm/Day.edit.day.js +16 -0
  49. package/lib/mjs/components/day/editForm/Day.edit.month.d.ts +5 -0
  50. package/lib/mjs/components/day/editForm/Day.edit.month.js +16 -0
  51. package/lib/mjs/components/day/editForm/Day.edit.year.d.ts +5 -0
  52. package/lib/mjs/components/day/editForm/Day.edit.year.js +10 -0
  53. package/lib/mjs/components/radio/Radio.js +1 -1
  54. package/lib/mjs/components/select/Select.js +5 -2
  55. package/lib/mjs/components/select/editForm/Select.edit.validation.js +2 -1
  56. package/lib/mjs/components/select/fixtures/comp27.d.ts +18 -0
  57. package/lib/mjs/components/select/fixtures/comp27.js +17 -0
  58. package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
  59. package/lib/mjs/components/select/fixtures/index.js +3 -1
  60. package/lib/mjs/components/selectboxes/SelectBoxes.js +1 -1
  61. package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +1 -1
  62. package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +2 -2
  63. package/lib/mjs/utils/conditionOperators/IsEqualTo.js +2 -2
  64. package/lib/mjs/utils/formUtils.d.ts +1 -2
  65. package/lib/mjs/utils/formUtils.js +2 -2
  66. package/package.json +2 -2
@@ -1093,6 +1093,9 @@ export default class Webform extends NestedDataComponent {
1093
1093
  if (!Array.isArray(errors)) {
1094
1094
  errors = [errors];
1095
1095
  }
1096
+ if (Array.isArray(this.errors)) {
1097
+ errors = _.union(errors, this.errors);
1098
+ }
1096
1099
  errors = errors.concat(this.customErrors).filter((err) => !!err);
1097
1100
  if (!errors.length) {
1098
1101
  this.setAlert(false);
@@ -1238,10 +1241,14 @@ export default class Webform extends NestedDataComponent {
1238
1241
  }
1239
1242
  this.checkData(value.data, flags);
1240
1243
  const shouldValidate = !flags.noValidate ||
1241
- flags.fromIFrame ||
1244
+ flags.fromIframe ||
1242
1245
  (flags.fromSubmission && this.rootPristine && this.pristine && flags.changed);
1243
1246
  const errors = shouldValidate
1244
- ? this.validate(value.data, { ...flags, process: "change" })
1247
+ ? this.validate(value.data, {
1248
+ ...flags,
1249
+ noValidate: false,
1250
+ process: 'change'
1251
+ })
1245
1252
  : [];
1246
1253
  value.isValid = errors.length === 0;
1247
1254
  this.loading = false;
@@ -2963,7 +2963,7 @@ export default class Component extends Element {
2963
2963
  this.parent.childErrors.push(...errors);
2964
2964
  }
2965
2965
  else {
2966
- _.remove(this.parent.childErrors, (err) => err.component.key === this.component.key);
2966
+ _.remove(this.parent.childErrors, (err) => (err?.component?.key || err?.context?.key) === this.component.key);
2967
2967
  }
2968
2968
  }
2969
2969
  this.showValidationErrors(errors, data, row, flags);
@@ -2979,7 +2979,7 @@ export default class Component extends Element {
2979
2979
  this.parent.childErrors.push(...errors);
2980
2980
  }
2981
2981
  else {
2982
- _.remove(this.parent.childErrors, (err) => err.component.key === this.component.key);
2982
+ _.remove(this.parent.childErrors, (err) => (err?.component?.key || err?.context?.key) === this.component.key);
2983
2983
  }
2984
2984
  }
2985
2985
  return errors.length === 0;
@@ -1,4 +1,12 @@
1
1
  export default class Multivalue extends Field {
2
+ /**
3
+ * Normalize values coming into updateValue.
4
+ * @param {*} value - The value to normalize before setting.
5
+ * @param {object} flags - Flags to use when normalizing the value.
6
+ * @param {*} emptyValue - The empty value for the field.
7
+ * @returns {*} - The normalized value.
8
+ */
9
+ normalizeValue(value: any, flags?: object, emptyValue?: any): any;
2
10
  get addAnother(): string;
3
11
  /**
4
12
  * @returns {Field} - The created field.
@@ -1,40 +1,46 @@
1
1
  import Field from '../field/Field';
2
2
  import _ from 'lodash';
3
+ import { Utils } from '@formio/core';
3
4
  export default class Multivalue extends Field {
4
5
  /**
5
6
  * Normalize values coming into updateValue.
6
7
  * @param {*} value - The value to normalize before setting.
8
+ * @param {object} flags - Flags to use when normalizing the value.
9
+ * @param {*} emptyValue - The empty value for the field.
7
10
  * @returns {*} - The normalized value.
8
11
  */
9
- normalizeValue(value) {
12
+ normalizeValue(value, flags = {}, emptyValue = this.emptyValue) {
13
+ const underlyingValueShouldBeArray = Utils.getModelType(this.component) === 'array' || this.component.storeas === 'array' || Array.isArray(emptyValue);
10
14
  if (this.component.multiple) {
11
15
  if (Array.isArray(value)) {
12
- if (value.length === 0) {
13
- return [this.emptyValue];
16
+ if (underlyingValueShouldBeArray) {
17
+ if (value.length === 0 || !Array.isArray(value[0])) {
18
+ return [value];
19
+ }
14
20
  }
15
- if (this.component.storeas === 'array') {
16
- return super.normalizeValue([value]);
21
+ if (value.length === 0) {
22
+ return [emptyValue];
17
23
  }
18
- return super.normalizeValue(value);
24
+ return super.normalizeValue(value, flags);
19
25
  }
20
26
  else {
21
- return super.normalizeValue(value == null ? [this.emptyValue] : [value]);
27
+ return super.normalizeValue(value == null ? [emptyValue] : [value], flags);
22
28
  }
23
29
  }
24
30
  else {
25
- if (Array.isArray(value) && this.component.storeas !== 'array') {
31
+ if (Array.isArray(value) && !underlyingValueShouldBeArray) {
26
32
  if (this.component.storeas === 'string') {
27
- return super.normalizeValue(value.join(this.delimiter || ''));
33
+ return super.normalizeValue(value.join(this.delimiter || ''), flags);
28
34
  }
29
- return super.normalizeValue(value[0] || this.emptyValue);
35
+ return super.normalizeValue(value[0] || emptyValue, flags);
30
36
  }
31
37
  else {
32
- return super.normalizeValue(value);
38
+ return super.normalizeValue(value, flags);
33
39
  }
34
40
  }
35
41
  }
36
42
  get dataValue() {
37
- return super.dataValue;
43
+ return this.normalizeValue(super.dataValue);
38
44
  }
39
45
  set dataValue(value) {
40
46
  super.dataValue = value;
@@ -97,6 +97,11 @@ export default class DayComponent extends Field {
97
97
  * @returns {null|void} - Returns null if the value is invalid, otherwise void.
98
98
  */
99
99
  setValueAt(index: number, value: any): null | void;
100
+ getDayWithHiddenFields(parts: any): {
101
+ month: any;
102
+ day: any;
103
+ year: any;
104
+ };
100
105
  getFieldValue(name: any): number;
101
106
  get parts(): {
102
107
  day: number;
@@ -342,6 +342,18 @@ export default class DayComponent extends Field {
342
342
  const valueParts = value.split('/');
343
343
  const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
344
344
  const defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';
345
+ let defaultDay = '';
346
+ let defaultMonth = '';
347
+ let defaultYear = '';
348
+ if (defaultValue) {
349
+ const hasHiddenFields = defaultValue.length !== 3;
350
+ defaultDay = hasHiddenFields ? this.getDayWithHiddenFields(defaultValue).day : defaultValue[DAY];
351
+ defaultMonth = hasHiddenFields ? this.getDayWithHiddenFields(defaultValue).month : defaultValue[MONTH];
352
+ defaultYear = hasHiddenFields ? this.getDayWithHiddenFields(defaultValue).year : defaultValue[YEAR];
353
+ }
354
+ if (this.options.building && defaultValue.length === 3) {
355
+ return this.component.defaultValue;
356
+ }
345
357
  const getNextPart = (shouldTake, defaultValue) => {
346
358
  // Only push the part if it's not an empty string
347
359
  const part = shouldTake ? valueParts.shift() : defaultValue;
@@ -350,13 +362,13 @@ export default class DayComponent extends Field {
350
362
  }
351
363
  };
352
364
  if (this.dayFirst) {
353
- getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
365
+ getNextPart(this.showDay, defaultDay);
354
366
  }
355
- getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '');
367
+ getNextPart(this.showMonth, defaultMonth);
356
368
  if (!this.dayFirst) {
357
- getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
369
+ getNextPart(this.showDay, defaultDay);
358
370
  }
359
- getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '');
371
+ getNextPart(this.showYear, defaultYear);
360
372
  return dateParts.join('/');
361
373
  }
362
374
  /**
@@ -371,16 +383,23 @@ export default class DayComponent extends Field {
371
383
  if (value === 'Invalid date') {
372
384
  return null;
373
385
  }
386
+ let day, month, year;
374
387
  const parts = value.split('/');
375
- let day;
376
- if (this.component.dayFirst) {
377
- day = parts.shift();
388
+ if (parts.length !== 3) {
389
+ day = this.getDayWithHiddenFields(parts).day;
390
+ month = this.getDayWithHiddenFields(parts).month;
391
+ year = this.getDayWithHiddenFields(parts).year;
378
392
  }
379
- const month = parts.shift();
380
- if (!this.component.dayFirst) {
381
- day = parts.shift();
393
+ else {
394
+ if (this.component.dayFirst) {
395
+ day = parts.shift();
396
+ }
397
+ month = parts.shift();
398
+ if (!this.component.dayFirst) {
399
+ day = parts.shift();
400
+ }
401
+ year = parts.shift();
382
402
  }
383
- const year = parts.shift();
384
403
  if (this.refs.day && this.showDay) {
385
404
  this.refs.day.value = day === '00' ? '' : parseInt(day, 10);
386
405
  }
@@ -391,6 +410,27 @@ export default class DayComponent extends Field {
391
410
  this.refs.year.value = year === '0000' ? '' : parseInt(year, 10);
392
411
  }
393
412
  }
413
+ getDayWithHiddenFields(parts) {
414
+ let [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
415
+ if (!this.showDay) {
416
+ MONTH = MONTH === 0 ? 0 : MONTH - 1;
417
+ YEAR = YEAR - 1;
418
+ DAY = null;
419
+ }
420
+ if (!this.showMonth) {
421
+ DAY = DAY === 0 ? 0 : DAY - 1;
422
+ YEAR = YEAR - 1;
423
+ MONTH = null;
424
+ }
425
+ if (!this.showYear) {
426
+ YEAR = null;
427
+ }
428
+ return {
429
+ month: _.isNull(MONTH) ? '' : parts[MONTH],
430
+ day: _.isNull(DAY) ? '' : parts[DAY],
431
+ year: _.isNull(YEAR) ? '' : parts[YEAR],
432
+ };
433
+ }
394
434
  getFieldValue(name) {
395
435
  const parts = this.dataValue ? this.dataValue.split('/') : [];
396
436
  let val = 0;
@@ -557,7 +597,7 @@ export default class DayComponent extends Field {
557
597
  }
558
598
  isPartialDay(value) {
559
599
  if (!value) {
560
- return false;
600
+ return true;
561
601
  }
562
602
  const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
563
603
  const values = value.split('/');
@@ -14,6 +14,7 @@ declare const _default: ({
14
14
  input?: undefined;
15
15
  placeholder?: undefined;
16
16
  tooltip?: undefined;
17
+ onChange?: undefined;
17
18
  } | {
18
19
  weight: number;
19
20
  type: string;
@@ -25,16 +26,32 @@ declare const _default: ({
25
26
  wieght?: undefined;
26
27
  datasrc?: undefined;
27
28
  data?: undefined;
29
+ onChange?: undefined;
28
30
  } | {
29
31
  weight: number;
30
32
  type: string;
31
33
  label: string;
32
34
  tooltip: string;
33
35
  key: string;
36
+ onChange: ({ data }: {
37
+ data: any;
38
+ }) => void;
34
39
  input: boolean;
35
40
  wieght?: undefined;
36
41
  datasrc?: undefined;
37
42
  data?: undefined;
38
43
  placeholder?: undefined;
44
+ } | {
45
+ weight: number;
46
+ type: string;
47
+ label: string;
48
+ tooltip: string;
49
+ key: string;
50
+ input: boolean;
51
+ wieght?: undefined;
52
+ datasrc?: undefined;
53
+ data?: undefined;
54
+ placeholder?: undefined;
55
+ onChange?: undefined;
39
56
  })[];
40
57
  export default _default;
@@ -1,3 +1,4 @@
1
+ import _ from 'lodash';
1
2
  export default [
2
3
  {
3
4
  wieght: 200,
@@ -33,6 +34,21 @@ export default [
33
34
  label: 'Hidden',
34
35
  tooltip: 'Hide the Day part of the component.',
35
36
  key: 'fields.day.hide',
37
+ onChange: ({ data }) => {
38
+ if (data.defaultValue) {
39
+ const defaultValueParts = data.defaultValue.split('/');
40
+ if (!data.fields.day.hide && defaultValueParts.length !== 3) {
41
+ const newDefaultValue = ['00'];
42
+ if (!data.fields.month.hide) {
43
+ data.dayFirst ? newDefaultValue.push(defaultValueParts[0]) : newDefaultValue.unshift(defaultValueParts[0]);
44
+ }
45
+ if (!data.fields.year.hide) {
46
+ newDefaultValue.push(defaultValueParts[1]);
47
+ }
48
+ _.set(data, 'defaultValue', newDefaultValue.join('/'));
49
+ }
50
+ }
51
+ },
36
52
  input: true
37
53
  },
38
54
  {
@@ -14,6 +14,7 @@ declare const _default: ({
14
14
  input?: undefined;
15
15
  placeholder?: undefined;
16
16
  tooltip?: undefined;
17
+ onChange?: undefined;
17
18
  } | {
18
19
  weight: number;
19
20
  type: string;
@@ -25,12 +26,16 @@ declare const _default: ({
25
26
  wieght?: undefined;
26
27
  datasrc?: undefined;
27
28
  data?: undefined;
29
+ onChange?: undefined;
28
30
  } | {
29
31
  weight: number;
30
32
  type: string;
31
33
  label: string;
32
34
  tooltip: string;
33
35
  key: string;
36
+ onChange: ({ data }: {
37
+ data: any;
38
+ }) => void;
34
39
  input: boolean;
35
40
  wieght?: undefined;
36
41
  datasrc?: undefined;
@@ -1,3 +1,4 @@
1
+ import _ from 'lodash';
1
2
  export default [
2
3
  {
3
4
  wieght: 200,
@@ -33,6 +34,21 @@ export default [
33
34
  label: 'Hidden',
34
35
  tooltip: 'Hide the Month part of the component.',
35
36
  key: 'fields.month.hide',
37
+ onChange: ({ data }) => {
38
+ if (data.defaultValue) {
39
+ const defaultValueParts = data.defaultValue.split('/');
40
+ if (!data.fields.month.hide && defaultValueParts.length !== 3) {
41
+ const newDefaultValue = ['00'];
42
+ if (!data.fields.day.hide) {
43
+ data.dayFirst ? newDefaultValue.unshift(defaultValueParts[0]) : newDefaultValue.push(defaultValueParts[0]);
44
+ }
45
+ if (!data.fields.year.hide) {
46
+ newDefaultValue.push(defaultValueParts[1]);
47
+ }
48
+ _.set(data, 'defaultValue', newDefaultValue.join('/'));
49
+ }
50
+ }
51
+ },
36
52
  input: true
37
53
  },
38
54
  ];
@@ -14,6 +14,7 @@ declare const _default: ({
14
14
  input?: undefined;
15
15
  placeholder?: undefined;
16
16
  tooltip?: undefined;
17
+ onChange?: undefined;
17
18
  } | {
18
19
  weight: number;
19
20
  type: string;
@@ -25,12 +26,16 @@ declare const _default: ({
25
26
  wieght?: undefined;
26
27
  datasrc?: undefined;
27
28
  data?: undefined;
29
+ onChange?: undefined;
28
30
  } | {
29
31
  weight: number;
30
32
  type: string;
31
33
  label: string;
32
34
  tooltip: string;
33
35
  key: string;
36
+ onChange: ({ data }: {
37
+ data: any;
38
+ }) => void;
34
39
  input: boolean;
35
40
  wieght?: undefined;
36
41
  datasrc?: undefined;
@@ -1,3 +1,4 @@
1
+ import _ from 'lodash';
1
2
  export default [
2
3
  {
3
4
  wieght: 200,
@@ -51,6 +52,15 @@ export default [
51
52
  label: 'Hidden',
52
53
  tooltip: 'Hide the Year part of the component.',
53
54
  key: 'fields.year.hide',
55
+ onChange: ({ data }) => {
56
+ if (data.defaultValue) {
57
+ const defaultValueParts = data.defaultValue.split('/');
58
+ if (!data.fields.month.hide && defaultValueParts.length !== 3) {
59
+ defaultValueParts.push('0000');
60
+ _.set(data, 'defaultValue', defaultValueParts.join('/'));
61
+ }
62
+ }
63
+ },
54
64
  input: true
55
65
  },
56
66
  ];
@@ -212,7 +212,7 @@ export default class RadioComponent extends ListComponent {
212
212
  if (!boolValue(setting) || !value) {
213
213
  return true;
214
214
  }
215
- const values = this.component.values;
215
+ const values = this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions;
216
216
  if (values) {
217
217
  return values.findIndex(({ value: optionValue }) => this.normalizeValue(optionValue) === value) !== -1;
218
218
  }
@@ -1458,6 +1458,9 @@ export default class SelectComponent extends ListComponent {
1458
1458
  case 'custom':
1459
1459
  rawItems = this.getCustomItems();
1460
1460
  break;
1461
+ case 'url':
1462
+ rawItems = this.selectItems;
1463
+ break;
1461
1464
  }
1462
1465
  if (typeof rawItems === 'string') {
1463
1466
  try {
@@ -1515,7 +1518,7 @@ export default class SelectComponent extends ListComponent {
1515
1518
  if (Array.isArray(data)) {
1516
1519
  data.forEach((item) => item[valueProperty] = item[valueProperty].toString());
1517
1520
  }
1518
- else {
1521
+ else if (_.isObject(data)) {
1519
1522
  data[valueProperty] = data[valueProperty].toString();
1520
1523
  }
1521
1524
  return data;
@@ -1550,7 +1553,7 @@ export default class SelectComponent extends ListComponent {
1550
1553
  };
1551
1554
  value = (this.component.multiple && Array.isArray(value))
1552
1555
  ? _.filter(items, (item) => value.includes(item.value))
1553
- : valueProperty
1556
+ : (valueProperty && items)
1554
1557
  ? getFromValues() ?? { value, label: value }
1555
1558
  : value;
1556
1559
  }
@@ -24,7 +24,8 @@ export default [
24
24
  [
25
25
  'values',
26
26
  'json',
27
- 'custom'
27
+ 'custom',
28
+ 'url'
28
29
  ],
29
30
  ],
30
31
  },
@@ -0,0 +1,18 @@
1
+ declare namespace _default {
2
+ let type: string;
3
+ let label: string;
4
+ let widget: string;
5
+ let tableView: boolean;
6
+ let dataSrc: string;
7
+ namespace data {
8
+ let custom: string;
9
+ }
10
+ let dataType: string;
11
+ let idPath: string;
12
+ let valueProperty: string;
13
+ let template: string;
14
+ let validateWhenHidden: boolean;
15
+ let key: string;
16
+ let input: boolean;
17
+ }
18
+ export default _default;
@@ -0,0 +1,17 @@
1
+ export default {
2
+ type: 'select',
3
+ label: 'Select',
4
+ widget: 'choicesjs',
5
+ tableView: true,
6
+ dataSrc: 'custom',
7
+ data: {
8
+ custom: 'values = data.dataSource;'
9
+ },
10
+ dataType: 'string',
11
+ idPath: 'name',
12
+ valueProperty: 'name',
13
+ template: '<span>{{ item.name }}</span>',
14
+ validateWhenHidden: false,
15
+ key: 'select',
16
+ input: true
17
+ };
@@ -22,5 +22,6 @@ import comp22 from './comp22';
22
22
  import comp23 from './comp23';
23
23
  import comp24 from './comp24';
24
24
  import comp25 from './comp25';
25
- export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25 };
25
+ import comp27 from './comp27';
26
+ export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25, comp26, comp27 };
26
27
  export { multiSelect, multiSelectOptions } from "./comp3";
@@ -23,4 +23,6 @@ import comp22 from './comp22';
23
23
  import comp23 from './comp23';
24
24
  import comp24 from './comp24';
25
25
  import comp25 from './comp25';
26
- export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25 };
26
+ import comp26 from './comp26';
27
+ import comp27 from './comp27';
28
+ export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25, comp26, comp27 };
@@ -256,7 +256,7 @@ export default class SelectBoxesComponent extends RadioComponent {
256
256
  if (!boolValue(setting) || !value) {
257
257
  return true;
258
258
  }
259
- const values = this.component.values;
259
+ const values = this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions;
260
260
  const availableValueKeys = (values || []).map(({ value: optionValue }) => optionValue);
261
261
  const valueKeys = Object.keys(value);
262
262
  return valueKeys.every((key) => availableValueKeys.includes(key));
@@ -19,7 +19,7 @@ export default class DateGeaterThan extends ConditionOperator {
19
19
  return false;
20
20
  }
21
21
  let conditionTriggerComponent = null;
22
- if (instance && instance.root) {
22
+ if (instance?.root?.getComponent) {
23
23
  conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
24
24
  }
25
25
  if (conditionTriggerComponent && conditionTriggerComponent.isPartialDay && conditionTriggerComponent.isPartialDay(value)) {
@@ -12,8 +12,8 @@ export default class IsEmptyValue extends ConditionOperator {
12
12
  }
13
13
  execute({ value, instance, conditionComponentPath }) {
14
14
  const isEmptyValue = _.isEmpty(_.isNumber(value) ? String(value) : value);
15
- if (instance && instance.root) {
16
- const conditionTriggerComponent = instance.root?.getComponent && instance.root.getComponent(conditionComponentPath);
15
+ if (instance?.root?.getComponent) {
16
+ const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
17
17
  return conditionTriggerComponent?.isEmpty ? conditionTriggerComponent.isEmpty() : isEmptyValue;
18
18
  }
19
19
  return isEmptyValue;
@@ -16,8 +16,8 @@ export default class IsEqualTo extends ConditionOperator {
16
16
  // eslint-disable-next-line no-empty
17
17
  catch (e) { }
18
18
  }
19
- if (instance && instance.root) {
20
- const conditionTriggerComponent = instance.root?.getComponent && instance.root.getComponent(conditionComponentPath);
19
+ if (instance?.root?.getComponent) {
20
+ const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
21
21
  if (conditionTriggerComponent
22
22
  && isSelectResourceWithObjectValue(conditionTriggerComponent.component)
23
23
  && conditionTriggerComponent.component?.template) {
@@ -8,11 +8,10 @@ export function findComponents(components: import('@formio/core').Component[], q
8
8
  export const flattenComponents: typeof Utils.flattenComponents;
9
9
  export const guid: typeof Utils.guid;
10
10
  export const uniqueName: typeof Utils.uniqueName;
11
- export const MODEL_TYPES: Record<string, string[]>;
11
+ export const MODEL_TYPES: any;
12
12
  export const getModelType: typeof Utils.getModelType;
13
13
  export const getComponentAbsolutePath: typeof Utils.getComponentAbsolutePath;
14
14
  export const getComponentPath: typeof Utils.getComponentPath;
15
- export const isComponentModelType: typeof Utils.isComponentModelType;
16
15
  export const isComponentNestedDataType: typeof Utils.isComponentNestedDataType;
17
16
  export const componentPath: typeof Utils.componentPath;
18
17
  export const componentChildPath: any;
@@ -1,5 +1,5 @@
1
1
  import { Utils } from '@formio/core';
2
- const { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentModelType, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty } = Utils;
2
+ const { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty } = Utils;
3
3
  /**
4
4
  * Deprecated version of findComponents. Renamed to searchComponents.
5
5
  * @param {import('@formio/core').Component[]} components - The components to find components within.
@@ -10,4 +10,4 @@ export function findComponents(components, query) {
10
10
  console.warn('formio.js/utils findComponents is deprecated. Use searchComponents instead.');
11
11
  return searchComponents(components, query);
12
12
  }
13
- export { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentModelType, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty };
13
+ export { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-rc.78",
3
+ "version": "5.0.0-rc.79",
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.0-rc.37",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "2.2.2",
84
+ "@formio/core": "2.2.3-rc.1",
85
85
  "@formio/text-mask-addons": "^3.8.0-formio.2",
86
86
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
87
87
  "abortcontroller-polyfill": "^1.7.5",