@formio/js 5.0.0-dev.5672.279701a → 5.0.0-dev.5673.3d062b9

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.
@@ -44,7 +44,7 @@ export default class Multivalue extends Field {
44
44
  attachMultiMask(index: number): boolean;
45
45
  /**
46
46
  * @param {any} input - The input element on which the mask is to be applied.
47
- * @param {string} mask - The mask pattern to apply to the input element. Exit early and remove previous mask if no mask.
47
+ * @param {string} mask - The mask pattern to apply to the input element. Exit early if no mask.
48
48
  */
49
49
  updateMask(input: any, mask: string): void;
50
50
  /**
@@ -237,17 +237,10 @@ class Multivalue extends Field_1.default {
237
237
  }
238
238
  /**
239
239
  * @param {any} input - The input element on which the mask is to be applied.
240
- * @param {string} mask - The mask pattern to apply to the input element. Exit early and remove previous mask if no mask.
240
+ * @param {string} mask - The mask pattern to apply to the input element. Exit early if no mask.
241
241
  */
242
242
  updateMask(input, mask) {
243
243
  if (!mask) {
244
- if (input.mask) {
245
- input.mask.destroy();
246
- }
247
- if (!this.component.placeholder) {
248
- input.removeAttribute('placeholder');
249
- }
250
- input.value = '';
251
244
  return;
252
245
  }
253
246
  this.setInputMask(input, mask, !this.component.placeholder);
@@ -1,3 +1,2 @@
1
+ export { comp1 };
1
2
  import comp1 from './comp1';
2
- import comp2 from './comp2';
3
- export { comp1, comp2 };
@@ -3,8 +3,6 @@ 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.comp2 = exports.comp1 = void 0;
6
+ exports.comp1 = void 0;
7
7
  const comp1_1 = __importDefault(require("./comp1"));
8
8
  exports.comp1 = comp1_1.default;
9
- const comp2_1 = __importDefault(require("./comp2"));
10
- exports.comp2 = comp2_1.default;
@@ -19,12 +19,13 @@ class DateGeaterThan extends ConditionOperator_1.default {
19
19
  return { date, comparedDate };
20
20
  }
21
21
  execute(options, functionName = 'isAfter') {
22
+ var _a;
22
23
  const { value, instance, conditionComponentPath } = options;
23
24
  if (!value) {
24
25
  return false;
25
26
  }
26
27
  let conditionTriggerComponent = null;
27
- if (instance && instance.root) {
28
+ if ((_a = instance === null || instance === void 0 ? void 0 : instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) {
28
29
  conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
29
30
  }
30
31
  if (conditionTriggerComponent && conditionTriggerComponent.isPartialDay && conditionTriggerComponent.isPartialDay(value)) {
@@ -16,8 +16,9 @@ class IsEmptyValue extends ConditionOperator_1.default {
16
16
  return false;
17
17
  }
18
18
  execute({ value, instance, conditionComponentPath }) {
19
+ var _a;
19
20
  const isEmptyValue = lodash_1.default.isEmpty(value);
20
- if (instance && instance.root) {
21
+ if ((_a = instance === null || instance === void 0 ? void 0 : instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) {
21
22
  const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
22
23
  return conditionTriggerComponent ? conditionTriggerComponent.isEmpty() : isEmptyValue;
23
24
  }
@@ -14,7 +14,7 @@ class IsEqualTo extends ConditionOperator_1.default {
14
14
  return 'Is Equal To';
15
15
  }
16
16
  execute({ value, comparedValue, instance, conditionComponentPath }) {
17
- var _a;
17
+ var _a, _b;
18
18
  if ((value || value === false) && comparedValue && typeof value !== typeof comparedValue && lodash_1.default.isString(comparedValue)) {
19
19
  try {
20
20
  comparedValue = JSON.parse(comparedValue);
@@ -22,11 +22,11 @@ class IsEqualTo extends ConditionOperator_1.default {
22
22
  // eslint-disable-next-line no-empty
23
23
  catch (e) { }
24
24
  }
25
- if (instance && instance.root) {
25
+ if ((_a = instance === null || instance === void 0 ? void 0 : instance.root) === null || _a === void 0 ? void 0 : _a.getComponent) {
26
26
  const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
27
27
  if (conditionTriggerComponent
28
28
  && (0, utils_1.isSelectResourceWithObjectValue)(conditionTriggerComponent.component)
29
- && ((_a = conditionTriggerComponent.component) === null || _a === void 0 ? void 0 : _a.template)) {
29
+ && ((_b = conditionTriggerComponent.component) === null || _b === void 0 ? void 0 : _b.template)) {
30
30
  if (!value || !lodash_1.default.isPlainObject(value)) {
31
31
  return false;
32
32
  }
@@ -44,7 +44,7 @@ export default class Multivalue extends Field {
44
44
  attachMultiMask(index: number): boolean;
45
45
  /**
46
46
  * @param {any} input - The input element on which the mask is to be applied.
47
- * @param {string} mask - The mask pattern to apply to the input element. Exit early and remove previous mask if no mask.
47
+ * @param {string} mask - The mask pattern to apply to the input element. Exit early if no mask.
48
48
  */
49
49
  updateMask(input: any, mask: string): void;
50
50
  /**
@@ -232,17 +232,10 @@ export default class Multivalue extends Field {
232
232
  }
233
233
  /**
234
234
  * @param {any} input - The input element on which the mask is to be applied.
235
- * @param {string} mask - The mask pattern to apply to the input element. Exit early and remove previous mask if no mask.
235
+ * @param {string} mask - The mask pattern to apply to the input element. Exit early if no mask.
236
236
  */
237
237
  updateMask(input, mask) {
238
238
  if (!mask) {
239
- if (input.mask) {
240
- input.mask.destroy();
241
- }
242
- if (!this.component.placeholder) {
243
- input.removeAttribute('placeholder');
244
- }
245
- input.value = '';
246
239
  return;
247
240
  }
248
241
  this.setInputMask(input, mask, !this.component.placeholder);
@@ -1,3 +1,2 @@
1
+ export { comp1 };
1
2
  import comp1 from './comp1';
2
- import comp2 from './comp2';
3
- export { comp1, comp2 };
@@ -1,3 +1,2 @@
1
1
  import comp1 from './comp1';
2
- import comp2 from './comp2';
3
- export { comp1, comp2 };
2
+ export { comp1 };
@@ -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,7 +12,7 @@ export default class IsEmptyValue extends ConditionOperator {
12
12
  }
13
13
  execute({ value, instance, conditionComponentPath }) {
14
14
  const isEmptyValue = _.isEmpty(value);
15
- if (instance && instance.root) {
15
+ if (instance?.root?.getComponent) {
16
16
  const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
17
17
  return conditionTriggerComponent ? conditionTriggerComponent.isEmpty() : isEmptyValue;
18
18
  }
@@ -16,7 +16,7 @@ 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) {
19
+ if (instance?.root?.getComponent) {
20
20
  const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
21
21
  if (conditionTriggerComponent
22
22
  && isSelectResourceWithObjectValue(conditionTriggerComponent.component)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5672.279701a",
3
+ "version": "5.0.0-dev.5673.3d062b9",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -1,16 +0,0 @@
1
- declare namespace _default {
2
- let components: {
3
- label: string;
4
- applyMaskOn: string;
5
- allowMultipleMasks: boolean;
6
- tableView: boolean;
7
- key: string;
8
- type: string;
9
- inputMasks: {
10
- label: string;
11
- mask: string;
12
- }[];
13
- input: boolean;
14
- }[];
15
- }
16
- export default _default;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- components: [
5
- {
6
- "label": "Phone Number",
7
- "applyMaskOn": "change",
8
- "allowMultipleMasks": true,
9
- "tableView": true,
10
- "key": "phoneNumber",
11
- "type": "phoneNumber",
12
- "inputMasks": [
13
- {
14
- "label": "Canada",
15
- "mask": "(999) 999-9999"
16
- },
17
- {
18
- "label": "Other",
19
- "mask": ""
20
- }
21
- ],
22
- "input": true
23
- }
24
- ]
25
- };
@@ -1,16 +0,0 @@
1
- declare namespace _default {
2
- let components: {
3
- label: string;
4
- applyMaskOn: string;
5
- allowMultipleMasks: boolean;
6
- tableView: boolean;
7
- key: string;
8
- type: string;
9
- inputMasks: {
10
- label: string;
11
- mask: string;
12
- }[];
13
- input: boolean;
14
- }[];
15
- }
16
- export default _default;
@@ -1,23 +0,0 @@
1
- export default {
2
- components: [
3
- {
4
- "label": "Phone Number",
5
- "applyMaskOn": "change",
6
- "allowMultipleMasks": true,
7
- "tableView": true,
8
- "key": "phoneNumber",
9
- "type": "phoneNumber",
10
- "inputMasks": [
11
- {
12
- "label": "Canada",
13
- "mask": "(999) 999-9999"
14
- },
15
- {
16
- "label": "Other",
17
- "mask": ""
18
- }
19
- ],
20
- "input": true
21
- }
22
- ]
23
- };