@formio/js 5.3.1-refb-rc.0 → 5.3.2

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.
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 +53 -44
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +2 -4
  7. package/dist/formio.full.js +55 -46
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +2 -4
  10. package/dist/formio.js +32 -12
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +2 -2
  13. package/dist/formio.utils.js +32 -23
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +2 -4
  16. package/lib/cjs/Embed.js +29 -1
  17. package/lib/cjs/Formio.js +1 -1
  18. package/lib/cjs/PDF.js +9 -1
  19. package/lib/cjs/Webform.js +27 -1
  20. package/lib/cjs/components/_classes/component/Component.d.ts +1 -0
  21. package/lib/cjs/components/_classes/component/Component.js +14 -1
  22. package/lib/cjs/components/_classes/input/Input.js +17 -2
  23. package/lib/cjs/components/address/Address.js +2 -1
  24. package/lib/cjs/components/datagrid/DataGrid.js +12 -1
  25. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.d.ts +18 -1
  26. package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +3 -0
  27. package/lib/cjs/components/datetime/editForm/DateTime.edit.time.d.ts +13 -2
  28. package/lib/cjs/components/datetime/editForm/DateTime.edit.time.js +3 -0
  29. package/lib/cjs/components/fieldset/Fieldset.d.ts +1 -0
  30. package/lib/cjs/components/fieldset/Fieldset.js +7 -0
  31. package/lib/cjs/components/select/Select.js +13 -8
  32. package/lib/cjs/components/tags/Tags.js +2 -1
  33. package/lib/cjs/package.json +1 -1
  34. package/lib/cjs/utils/conditionOperators/IsEqualTo.d.ts +1 -3
  35. package/lib/cjs/utils/conditionOperators/IsEqualTo.js +6 -12
  36. package/lib/cjs/utils/conditionOperators/index.d.ts +2 -1
  37. package/lib/cjs/utils/index.d.ts +2 -1
  38. package/lib/cjs/utils/utils.d.ts +9 -0
  39. package/lib/cjs/utils/utils.js +132 -2
  40. package/lib/cjs/widgets/CalendarWidget.js +2 -1
  41. package/lib/mjs/Embed.js +29 -1
  42. package/lib/mjs/Formio.js +1 -1
  43. package/lib/mjs/PDF.js +9 -1
  44. package/lib/mjs/Webform.js +27 -1
  45. package/lib/mjs/components/_classes/component/Component.d.ts +1 -0
  46. package/lib/mjs/components/_classes/component/Component.js +12 -1
  47. package/lib/mjs/components/_classes/input/Input.js +16 -3
  48. package/lib/mjs/components/address/Address.js +1 -1
  49. package/lib/mjs/components/datagrid/DataGrid.js +11 -1
  50. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.d.ts +18 -1
  51. package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +3 -0
  52. package/lib/mjs/components/datetime/editForm/DateTime.edit.time.d.ts +13 -2
  53. package/lib/mjs/components/datetime/editForm/DateTime.edit.time.js +3 -0
  54. package/lib/mjs/components/fieldset/Fieldset.d.ts +1 -0
  55. package/lib/mjs/components/fieldset/Fieldset.js +7 -0
  56. package/lib/mjs/components/select/Select.js +11 -8
  57. package/lib/mjs/components/tags/Tags.js +1 -1
  58. package/lib/mjs/package.json +1 -1
  59. package/lib/mjs/utils/conditionOperators/IsEqualTo.d.ts +1 -3
  60. package/lib/mjs/utils/conditionOperators/IsEqualTo.js +6 -11
  61. package/lib/mjs/utils/conditionOperators/index.d.ts +2 -1
  62. package/lib/mjs/utils/index.d.ts +2 -1
  63. package/lib/mjs/utils/utils.d.ts +9 -0
  64. package/lib/mjs/utils/utils.js +130 -1
  65. package/lib/mjs/widgets/CalendarWidget.js +1 -1
  66. package/package.json +4 -4
@@ -18,11 +18,9 @@
18
18
  * MIT licensed
19
19
  */
20
20
 
21
- /*! @license DOMPurify 3.2.4 | (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.4/LICENSE */
21
+ /*! @license DOMPurify 3.3.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.3.3/LICENSE */
22
22
 
23
- /*! @license DOMPurify 3.2.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.2.6/LICENSE */
24
-
25
- /*! formiojs v5.3.0 | https://unpkg.com/formiojs@5.3.0/LICENSE.txt */
23
+ /*! formiojs v5.3.2 | https://unpkg.com/formiojs@5.3.2/LICENSE.txt */
26
24
 
27
25
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
28
26
 
package/lib/cjs/Embed.js CHANGED
@@ -154,6 +154,34 @@ class Formio {
154
154
  if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {
155
155
  instance.element.innerHTML = `<div class="alert-success" role="alert">${successMessage}</div>`;
156
156
  }
157
+ const announcementMessage = successMessage && successMessage.toLowerCase() !== 'false'
158
+ ? successMessage
159
+ : 'Form submission complete';
160
+ let liveRegion = document.getElementById('formio-announcements');
161
+ if (!liveRegion) {
162
+ liveRegion = _a.createElement('div', {
163
+ id: 'formio-announcements',
164
+ 'role': 'status',
165
+ 'aria-live': 'polite',
166
+ 'aria-atomic': 'true',
167
+ style: 'position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);'
168
+ });
169
+ document.body.appendChild(liveRegion);
170
+ }
171
+ // Announce the submission completion using VPAT clear-and-reset technique
172
+ liveRegion.textContent = '';
173
+ liveRegion.setAttribute('aria-live', 'off');
174
+ requestAnimationFrame(() => {
175
+ setTimeout(() => {
176
+ liveRegion.setAttribute('aria-live', 'polite');
177
+ liveRegion.textContent = announcementMessage;
178
+ setTimeout(() => {
179
+ if (liveRegion) {
180
+ liveRegion.textContent = '';
181
+ }
182
+ }, 1000);
183
+ }, 100);
184
+ });
157
185
  let returnUrl = _a.config.redirect;
158
186
  // Allow form based configuration for return url.
159
187
  if (!returnUrl &&
@@ -453,7 +481,7 @@ Formio.formioReady = new Promise((ready, reject) => {
453
481
  _a._formioReady = ready;
454
482
  _a._formioReadyReject = reject;
455
483
  });
456
- Formio.version = '5.3.0';
484
+ Formio.version = '5.3.2';
457
485
  // Create a report.
458
486
  Formio.Report = {
459
487
  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.3.0';
14
+ sdk_1.Formio.version = '5.3.2';
15
15
  CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc')
16
16
  ? 'https://cdn.test-form.io'
17
17
  : 'https://cdn.form.io';
package/lib/cjs/PDF.js CHANGED
@@ -286,7 +286,15 @@ if (typeof window !== 'undefined') {
286
286
  eventData.name &&
287
287
  eventData.formId &&
288
288
  Formio_1.Formio.forms.hasOwnProperty(eventData.formId)) {
289
- Formio_1.Formio.forms[eventData.formId].emit(`iframe-${eventData.name}`, eventData.data);
289
+ if (eventData.compPath) {
290
+ const comp = Formio_1.Formio.forms[eventData.formId].getComponent(eventData.compPath);
291
+ if (comp) {
292
+ comp.emit(eventData.name, eventData.data);
293
+ }
294
+ }
295
+ else {
296
+ Formio_1.Formio.forms[eventData.formId].emit(`iframe-${eventData.name}`, eventData.data);
297
+ }
290
298
  }
291
299
  });
292
300
  }
@@ -259,7 +259,7 @@ class Webform extends NestedDataComponent_1.default {
259
259
  if (err) {
260
260
  return;
261
261
  }
262
- this.rebuild();
262
+ this.redraw();
263
263
  this.emit('languageChanged');
264
264
  });
265
265
  }
@@ -1130,6 +1130,32 @@ class Webform extends NestedDataComponent_1.default {
1130
1130
  if (this.draftEnabled && ((_a = this.triggerSaveDraft) === null || _a === void 0 ? void 0 : _a.cancel)) {
1131
1131
  this.triggerSaveDraft.cancel();
1132
1132
  }
1133
+ if (typeof document !== 'undefined' && document.body) {
1134
+ const announcementMessage = this.t ? this.t('complete') : 'Form submission complete';
1135
+ // Get or create ARIA live region for announcements
1136
+ let liveRegion = document.getElementById('formio-announcements');
1137
+ if (!liveRegion) {
1138
+ liveRegion = document.createElement('div');
1139
+ liveRegion.id = 'formio-announcements';
1140
+ liveRegion.setAttribute('role', 'status');
1141
+ liveRegion.setAttribute('aria-live', 'polite');
1142
+ liveRegion.setAttribute('aria-atomic', 'true');
1143
+ liveRegion.style.cssText = 'position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);';
1144
+ document.body.appendChild(liveRegion);
1145
+ }
1146
+ // Announce the submission completion using VPAT clear-and-reset technique
1147
+ liveRegion.textContent = '';
1148
+ liveRegion.setAttribute('aria-live', 'off');
1149
+ requestAnimationFrame(() => {
1150
+ setTimeout(() => {
1151
+ liveRegion.setAttribute('aria-live', 'polite');
1152
+ liveRegion.textContent = announcementMessage;
1153
+ setTimeout(() => {
1154
+ liveRegion.textContent = '';
1155
+ }, 1000);
1156
+ }, 100);
1157
+ });
1158
+ }
1133
1159
  this.emit('submit', submission, saved);
1134
1160
  if (saved) {
1135
1161
  this.emit('submitDone', submission);
@@ -187,6 +187,7 @@ declare class Component extends Element {
187
187
  tooltipClass: string;
188
188
  for: any;
189
189
  };
190
+ getFieldsetLegendIds(): string;
190
191
  init(): void;
191
192
  /**
192
193
  * Disable this component.
@@ -507,6 +507,18 @@ class Component extends Element_1.default {
507
507
  }
508
508
  return label;
509
509
  }
510
+ getFieldsetLegendIds() {
511
+ var _a, _b;
512
+ const legendIds = [];
513
+ let currentParent = this.parent;
514
+ while (currentParent) {
515
+ if (((_a = currentParent.component) === null || _a === void 0 ? void 0 : _a.type) === 'fieldset' && ((_b = currentParent.component) === null || _b === void 0 ? void 0 : _b.legend)) {
516
+ legendIds.push(`l-${currentParent.id}-legend`);
517
+ }
518
+ currentParent = currentParent.parent;
519
+ }
520
+ return legendIds.reverse().join(' ');
521
+ }
510
522
  init() {
511
523
  var _a;
512
524
  this.disabled = this.shouldDisabled;
@@ -3677,13 +3689,14 @@ class Component extends Element_1.default {
3677
3689
  * @returns {*} - The components "input" DOM element information.
3678
3690
  */
3679
3691
  elementInfo() {
3692
+ var _a;
3680
3693
  const attributes = {
3681
3694
  name: this.options.name,
3682
3695
  type: this.component.inputType || 'text',
3683
3696
  class: 'form-control',
3684
3697
  lang: this.options.language,
3685
3698
  };
3686
- if (this.component.placeholder) {
3699
+ if (this.component.placeholder && !((_a = this.options) === null || _a === void 0 ? void 0 : _a.readOnly)) {
3687
3700
  attributes.placeholder = this.t(this.component.placeholder, { _userInput: true });
3688
3701
  }
3689
3702
  if (this.component.tabindex) {
@@ -20,6 +20,7 @@ class Input extends Multivalue_1.default {
20
20
  }, ...extend);
21
21
  }
22
22
  get inputInfo() {
23
+ var _a;
23
24
  const attr = {
24
25
  name: this.options.name,
25
26
  type: this.component.inputType || 'text',
@@ -34,7 +35,7 @@ class Input extends Multivalue_1.default {
34
35
  if (this.component.inputMode) {
35
36
  attr.inputmode = this.component.inputMode;
36
37
  }
37
- if (this.component.placeholder) {
38
+ if (this.component.placeholder && !((_a = this.options) === null || _a === void 0 ? void 0 : _a.readOnly)) {
38
39
  attr.placeholder = this.getFormattedAttribute(this.component.placeholder);
39
40
  }
40
41
  if (this.component.tabindex) {
@@ -166,6 +167,9 @@ class Input extends Multivalue_1.default {
166
167
  }
167
168
  }
168
169
  updateValueAt(value, flags, index) {
170
+ if (flags.modified) {
171
+ (0, index_1.announceScreenReaderMessage)(this, value, index);
172
+ }
169
173
  flags = flags || {};
170
174
  if (lodash_1.default.get(this.component, 'showWordCount', false)) {
171
175
  if (this.refs.wordcount && this.refs.wordcount[index]) {
@@ -190,7 +194,7 @@ class Input extends Multivalue_1.default {
190
194
  updateValue(value, flags, index) {
191
195
  flags = flags || {};
192
196
  const changed = super.updateValue(value, flags);
193
- this.triggerUpdateValueAt(this.dataValue, flags, index);
197
+ this.triggerUpdateValueAt(this.dataValue, Object.assign({}, flags), index);
194
198
  return changed;
195
199
  }
196
200
  parseValue(value) {
@@ -201,6 +205,7 @@ class Input extends Multivalue_1.default {
201
205
  }
202
206
  attach(element) {
203
207
  this.loadRefs(element, {
208
+ announceMessage: 'multiple',
204
209
  charcount: 'multiple',
205
210
  wordcount: 'multiple',
206
211
  prefix: 'multiple',
@@ -244,6 +249,16 @@ class Input extends Multivalue_1.default {
244
249
  }
245
250
  });
246
251
  }
252
+ this.on('focus', (comp) => {
253
+ (0, index_1.announceScreenReaderMessage)(comp, comp.dataValue, 0, true);
254
+ });
255
+ this.on('blur', (comp) => {
256
+ var _a, _b;
257
+ const el = (_b = (_a = comp.refs) === null || _a === void 0 ? void 0 : _a["announceMessage"]) === null || _b === void 0 ? void 0 : _b[0];
258
+ if (el) {
259
+ el.textContent = "";
260
+ }
261
+ });
247
262
  return promise;
248
263
  }
249
264
  /**
@@ -310,6 +310,7 @@ class AddressComponent extends Container_1.default {
310
310
  return this.refs ? this.refs[AddressComponent.removeRowButtonRef] || null : null;
311
311
  }
312
312
  get searchInputAttributes() {
313
+ var _a;
313
314
  const attr = {
314
315
  name: this.options.name,
315
316
  type: 'text',
@@ -317,7 +318,7 @@ class AddressComponent extends Container_1.default {
317
318
  lang: this.options.language,
318
319
  tabindex: this.component.tabindex || 0,
319
320
  };
320
- if (this.component.placeholder) {
321
+ if (this.component.placeholder && !((_a = this.options) === null || _a === void 0 ? void 0 : _a.readOnly)) {
321
322
  ((attr.placeholder = this.t(this.component.placeholder)), { _userInput: true });
322
323
  }
323
324
  if (this.disabled) {
@@ -113,6 +113,17 @@ class DataGridComponent extends NestedArrayComponent_1.default {
113
113
  for (let dIndex = defaultValue.length; dIndex < this.minLength; dIndex++) {
114
114
  defaultValue.push({});
115
115
  }
116
+ if (this.component.customDefaultValue) {
117
+ return defaultValue;
118
+ }
119
+ if (defaultValue.length === 1 && this.columns) {
120
+ (0, utils_1.eachComponent)(this.components, (comp, path) => {
121
+ var _a;
122
+ if (((_a = comp.component) === null || _a === void 0 ? void 0 : _a.input) && comp.defaultValue) {
123
+ lodash_1.default.set(defaultValue[0], path, comp.defaultValue);
124
+ }
125
+ });
126
+ }
116
127
  return defaultValue;
117
128
  }
118
129
  set disabled(disabled) {
@@ -437,7 +448,7 @@ class DataGridComponent extends NestedArrayComponent_1.default {
437
448
  });
438
449
  (0, utils_1.screenReaderSpeech)('Row has been added');
439
450
  this.checkConditions();
440
- (_a = this.triggerChange) === null || _a === void 0 ? void 0 : _a.call(this, { modified: true });
451
+ (_a = this.triggerChange) === null || _a === void 0 ? void 0 : _a.call(this, { modified: true, noPristineChangeOnModified: true });
441
452
  this.redraw().then(() => {
442
453
  this.focusOnNewRowElement(this.rows[index]);
443
454
  });
@@ -5,8 +5,10 @@ declare const _default: ({
5
5
  label: string;
6
6
  weight: number;
7
7
  tooltip: string;
8
+ validate: {
9
+ custom: string;
10
+ };
8
11
  placeholder?: undefined;
9
- validate?: undefined;
10
12
  title?: undefined;
11
13
  collapsible?: undefined;
12
14
  collapsed?: undefined;
@@ -57,7 +59,22 @@ declare const _default: ({
57
59
  label?: undefined;
58
60
  weight?: undefined;
59
61
  tooltip?: undefined;
62
+ validate?: undefined;
60
63
  placeholder?: undefined;
64
+ } | {
65
+ type: string;
66
+ input: boolean;
67
+ key: string;
68
+ label: string;
69
+ tooltip: string;
70
+ weight: number;
61
71
  validate?: undefined;
72
+ placeholder?: undefined;
73
+ title?: undefined;
74
+ collapsible?: undefined;
75
+ collapsed?: undefined;
76
+ style?: undefined;
77
+ customConditional?: undefined;
78
+ components?: undefined;
62
79
  })[];
63
80
  export default _default;
@@ -13,6 +13,9 @@ exports.default = [
13
13
  label: 'Enable Date Input',
14
14
  weight: 0,
15
15
  tooltip: 'Enables date input for this field.',
16
+ validate: {
17
+ custom: "valid = !data.enableTime && !input ? 'Cannot disable both Date and Time inputs at the same time' : true",
18
+ },
16
19
  },
17
20
  {
18
21
  type: 'tags',
@@ -1,9 +1,20 @@
1
- declare const _default: {
1
+ declare const _default: ({
2
2
  type: string;
3
3
  input: boolean;
4
4
  key: string;
5
5
  label: string;
6
6
  tooltip: string;
7
7
  weight: number;
8
- }[];
8
+ validate: {
9
+ custom: string;
10
+ };
11
+ } | {
12
+ type: string;
13
+ input: boolean;
14
+ key: string;
15
+ label: string;
16
+ tooltip: string;
17
+ weight: number;
18
+ validate?: undefined;
19
+ })[];
9
20
  export default _default;
@@ -8,6 +8,9 @@ exports.default = [
8
8
  label: 'Enable Time Input',
9
9
  tooltip: 'Enables time input for this field.',
10
10
  weight: 0,
11
+ validate: {
12
+ custom: "valid = !data.enableDate && !input ? 'Cannot disable both Date and Time inputs at the same time' : true",
13
+ },
11
14
  },
12
15
  {
13
16
  type: 'number',
@@ -10,6 +10,7 @@ export default class FieldsetComponent extends NestedComponent {
10
10
  };
11
11
  static savedValueTypes(): never[];
12
12
  constructor(...args: any[]);
13
+ attach(element: any): Promise<void>;
13
14
  noField: boolean;
14
15
  }
15
16
  import NestedComponent from '../_classes/nested/NestedComponent';
@@ -39,6 +39,13 @@ class FieldsetComponent extends NestedComponent_1.default {
39
39
  get templateName() {
40
40
  return 'fieldset';
41
41
  }
42
+ attach(element) {
43
+ return super.attach(element).then(() => {
44
+ if (this.component.legend && this.refs.header) {
45
+ this.refs.header.setAttribute('id', `l-${this.id}-legend`);
46
+ }
47
+ });
48
+ }
42
49
  constructor(...args) {
43
50
  super(...args);
44
51
  this.noField = true;
@@ -276,9 +276,9 @@ class SelectComponent extends ListComponent_1.default {
276
276
  // Inside DataTable component won't have dataValue set
277
277
  const shouldUseSelectData = (this.component.multiple && lodash_1.default.isArray(this.dataValue)
278
278
  ? this.dataValue.find((val) => this.normalizeSingleValue(value) === val)
279
- : this.dataValue === this.normalizeSingleValue(value)) || this.inDataTable;
279
+ : this.dataValue === this.normalizeSingleValue(value)) || (this.inDataTable && !this.element);
280
280
  if (shouldUseSelectData) {
281
- const selectData = this.selectData;
281
+ const selectData = (this.inDataTable && !this.element) ? this.component.selectData : this.selectData;
282
282
  if (selectData) {
283
283
  const templateValue = this.component.reference && (value === null || value === void 0 ? void 0 : value._id) ? value._id.toString() : value;
284
284
  if (!this.templateData || !this.templateData[templateValue]) {
@@ -766,7 +766,8 @@ class SelectComponent extends ListComponent_1.default {
766
766
  }
767
767
  }
768
768
  addPlaceholder() {
769
- if (!this.component.placeholder) {
769
+ var _a;
770
+ if (!this.component.placeholder || ((_a = this.options) === null || _a === void 0 ? void 0 : _a.readOnly)) {
770
771
  return;
771
772
  }
772
773
  this.addOption('', this.component.placeholder, { placeholder: true });
@@ -830,10 +831,12 @@ class SelectComponent extends ListComponent_1.default {
830
831
  : element;
831
832
  }
832
833
  choicesOptions() {
834
+ var _a;
833
835
  const useSearch = this.component.hasOwnProperty('searchEnabled')
834
836
  ? this.component.searchEnabled
835
837
  : true;
836
- const placeholderValue = this.t(this.component.placeholder, { _userInput: true });
838
+ const hasPlaceholder = !!this.component.placeholder && !((_a = this.options) === null || _a === void 0 ? void 0 : _a.readOnly);
839
+ const placeholderValue = hasPlaceholder ? this.t(this.component.placeholder, { _userInput: true }) : null;
837
840
  let customOptions = this.component.customOptions || {};
838
841
  if (typeof customOptions == 'string') {
839
842
  try {
@@ -857,7 +860,7 @@ class SelectComponent extends ListComponent_1.default {
857
860
  'formio-choices',
858
861
  ],
859
862
  containerInner: this.transform('class', 'form-control ui fluid selection dropdown').split(' '),
860
- }, addItemText: false, allowHTML: true, placeholder: !!this.component.placeholder, placeholderValue: placeholderValue, noResultsText: this.t('No results found'), noChoicesText: this.t('No choices to choose from'), searchPlaceholderValue: this.t('Type to search'), shouldSort: false, position: this.component.dropdown || 'auto', searchEnabled: useSearch, searchChoices: !this.component.searchField, searchFields: lodash_1.default.get(this, 'component.searchFields', [
863
+ }, addItemText: false, allowHTML: true, placeholder: hasPlaceholder, placeholderValue: placeholderValue, noResultsText: this.t('No results found'), noChoicesText: this.t('No choices to choose from'), searchPlaceholderValue: this.t('Type to search'), shouldSort: false, position: this.component.dropdown || 'auto', searchEnabled: useSearch, searchChoices: !this.component.searchField, searchFields: lodash_1.default.get(this, 'component.searchFields', [
861
864
  'label',
862
865
  ]), shadowRoot: this.root ? this.root.shadowRoot : null, fuseOptions: this.component.useExactSearch
863
866
  ? Object.assign({ tokenize: true, matchAllTokens: true }, commonFuseOptions) : Object.assign({}, lodash_1.default.get(this, 'component.fuseOptions', {}), Object.assign({ include: 'score', threshold: lodash_1.default.get(this, 'component.selectThreshold', 0.3) }, commonFuseOptions)), valueComparer: lodash_1.default.isEqual, resetScrollPosition: false, duplicateItemsAllowed: false }, customOptions);
@@ -1296,7 +1299,8 @@ class SelectComponent extends ListComponent_1.default {
1296
1299
  }
1297
1300
  setMetadata(value, flags = {}) {
1298
1301
  var _a, _b;
1299
- if (lodash_1.default.isNil(value)) {
1302
+ if (lodash_1.default.isNil(value) ||
1303
+ (this.inDataTable && this.component.dataSrc === 'values')) {
1300
1304
  return;
1301
1305
  }
1302
1306
  const valueIsObject = lodash_1.default.isObject(value);
@@ -1306,7 +1310,7 @@ class SelectComponent extends ListComponent_1.default {
1306
1310
  }
1307
1311
  // Check to see if we need to save off the template data into our metadata.
1308
1312
  const templateValue = this.component.reference && (value === null || value === void 0 ? void 0 : value._id) ? value._id.toString() : value;
1309
- const shouldSaveData = (!valueIsObject || this.component.reference) && !this.inDataTable;
1313
+ const shouldSaveData = (!valueIsObject || this.component.reference) && !(this.inDataTable && this.row === '');
1310
1314
  if (!lodash_1.default.isNil(templateValue) &&
1311
1315
  shouldSaveData &&
1312
1316
  this.templateData &&
@@ -1592,7 +1596,8 @@ class SelectComponent extends ListComponent_1.default {
1592
1596
  asString(value, options = {}) {
1593
1597
  var _a;
1594
1598
  value = value !== null && value !== void 0 ? value : this.getValue();
1595
- if (options.modalPreview || this.inDataTable) {
1599
+ if (options.modalPreview ||
1600
+ ((this.inDataTable || this.inEditGrid) && !['values', 'custom'].includes(this.component.dataSrc))) {
1596
1601
  if (this.inDataTable) {
1597
1602
  value = this.undoValueTyping(value);
1598
1603
  }
@@ -63,6 +63,7 @@ class TagsComponent extends Input_1.default {
63
63
  return this.component.delimeter || ',';
64
64
  }
65
65
  attachElement(element, index) {
66
+ var _a;
66
67
  super.attachElement(element, index);
67
68
  if (!element) {
68
69
  return;
@@ -76,7 +77,7 @@ class TagsComponent extends Input_1.default {
76
77
  if (!choices_js_1.default) {
77
78
  return;
78
79
  }
79
- const hasPlaceholder = !!this.component.placeholder;
80
+ const hasPlaceholder = !!this.component.placeholder && !((_a = this.options) === null || _a === void 0 ? void 0 : _a.readOnly);
80
81
  this.choices = new choices_js_1.default(element, {
81
82
  delimiter: this.delimiter,
82
83
  editItems: true,
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "type": "commonjs",
3
- "version": "5.3.0"
3
+ "version": "5.3.2"
4
4
  }
@@ -1,9 +1,7 @@
1
1
  export default class IsEqualTo extends ConditionOperator {
2
- execute({ value, comparedValue, instance, path }: {
2
+ execute({ value, comparedValue }: {
3
3
  value: any;
4
4
  comparedValue: any;
5
- instance: any;
6
- path: any;
7
5
  }): any;
8
6
  }
9
7
  import ConditionOperator from './ConditionOperator';
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const ConditionOperator_1 = __importDefault(require("./ConditionOperator"));
7
7
  const lodash_1 = __importDefault(require("lodash"));
8
- const __1 = require("../");
9
8
  class IsEqualTo extends ConditionOperator_1.default {
10
9
  static get operatorKey() {
11
10
  return 'isEqual';
@@ -13,8 +12,7 @@ class IsEqualTo extends ConditionOperator_1.default {
13
12
  static get displayedName() {
14
13
  return 'Is Equal To';
15
14
  }
16
- execute({ value, comparedValue, instance, path }) {
17
- var _a, _b;
15
+ execute({ value, comparedValue }) {
18
16
  if ((value || value === false) &&
19
17
  comparedValue &&
20
18
  typeof value !== typeof comparedValue &&
@@ -26,19 +24,15 @@ class IsEqualTo extends ConditionOperator_1.default {
26
24
  // ignore
27
25
  }
28
26
  }
29
- if ((_a = instance === null || instance === void 0 ? void 0 : instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) {
30
- const conditionTriggerComponent = instance.root.getComponent(path);
31
- if (conditionTriggerComponent &&
32
- (0, __1.isSelectResourceWithObjectValue)(conditionTriggerComponent.component) &&
33
- ((_b = conditionTriggerComponent.component) === null || _b === void 0 ? void 0 : _b.template)) {
34
- return (0, __1.compareSelectResourceWithObjectTypeValues)(value, comparedValue, conditionTriggerComponent.component);
35
- }
36
- }
37
27
  //special check for select boxes
38
28
  if (lodash_1.default.isObject(value) && comparedValue && lodash_1.default.isBoolean(value[comparedValue])) {
39
29
  return value[comparedValue];
40
30
  }
41
- return lodash_1.default.isEqual(value, comparedValue);
31
+ const valuesAreObjects = typeof comparedValue === 'object' &&
32
+ comparedValue !== null &&
33
+ typeof value === 'object' &&
34
+ value !== null;
35
+ return valuesAreObjects ? lodash_1.default.isMatch(value, comparedValue) : lodash_1.default.isEqual(comparedValue, value);
42
36
  }
43
37
  }
44
38
  exports.default = IsEqualTo;
@@ -1,6 +1,7 @@
1
1
  export default ConditionOperators;
2
2
  declare const ConditionOperators: {
3
- [x: string]: typeof IsEqualTo | typeof DateGreaterThan;
3
+ [x: string]: typeof IsEqualTo | typeof IsEmptyValue | typeof DateGreaterThan;
4
4
  };
5
5
  import IsEqualTo from './IsEqualTo';
6
+ import IsEmptyValue from './IsEmptyValue';
6
7
  import DateGreaterThan from './DateGreaterThan';
@@ -5,7 +5,7 @@ declare const FormioUtils: {
5
5
  Evaluator: DefaultEvaluator;
6
6
  interpolate: typeof interpolate;
7
7
  ConditionOperators: {
8
- [x: string]: typeof import("./conditionOperators/IsEqualTo").default | typeof import("./conditionOperators/DateGreaterThan").default;
8
+ [x: string]: typeof import("./conditionOperators/IsEqualTo").default | typeof import("./conditionOperators/IsEmptyValue").default | typeof import("./conditionOperators/DateGreaterThan").default;
9
9
  };
10
10
  _: any;
11
11
  moment: typeof moment;
@@ -150,6 +150,7 @@ declare const FormioUtils: {
150
150
  getFocusableElements(element: HTMLElement): NodeList<HTMLElement>;
151
151
  getComponentSavedTypes(fullSchema: import("@formio/core").Component): string[] | null;
152
152
  hasEncodedTimezone(value: string): boolean;
153
+ announceScreenReaderMessage(component: any, value: any, index?: any, forFocus?: any): undefined;
153
154
  screenReaderSpeech(text: string): void;
154
155
  firstNonNil: any;
155
156
  componentValueTypes: {
@@ -499,6 +499,15 @@ export function getComponentSavedTypes(fullSchema: import('@formio/core').Compon
499
499
  * @returns {boolean} if value has encoded timezone
500
500
  */
501
501
  export function hasEncodedTimezone(value: string): boolean;
502
+ /**
503
+ * The function for announcing messages via a screen reader
504
+ * @param {component} component - The component instance
505
+ * @param {value} value - The current component value
506
+ * @param {index} index - The component index
507
+ * @param {forFocus} forFocus - Whether the component is focused or not
508
+ * @returns {undefined}
509
+ */
510
+ export function announceScreenReaderMessage(component: any, value: any, index?: any, forFocus?: any): undefined;
502
511
  /**
503
512
  * Outputs text to screen reader
504
513
  * @param {string} text The text to output to screen readers