@formio/js 5.0.0-dev.5792.f0b98eb → 5.0.0-dev.5794.12ca15f

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.
@@ -11,6 +11,12 @@ export default class AddressComponent extends ContainerComponent {
11
11
  weight: number;
12
12
  schema: any;
13
13
  };
14
+ static get serverConditionSettings(): {
15
+ operators: string[];
16
+ };
17
+ static get conditionOperatorsSettings(): {
18
+ operators: string[];
19
+ };
14
20
  static get modeSwitcherRef(): string;
15
21
  static get removeValueIconRef(): string;
16
22
  static get searchInputRef(): string;
@@ -97,6 +97,12 @@ class AddressComponent extends Container_1.default {
97
97
  schema: AddressComponent.schema(),
98
98
  };
99
99
  }
100
+ static get serverConditionSettings() {
101
+ return AddressComponent.conditionOperatorsSettings;
102
+ }
103
+ static get conditionOperatorsSettings() {
104
+ return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
105
+ }
100
106
  mergeSchema(component = {}) {
101
107
  let { defaultSchema } = this;
102
108
  if (component.components) {
@@ -188,7 +194,7 @@ class AddressComponent extends Container_1.default {
188
194
  return (this.manualModeEnabled && this.dataValue) ? this.dataValue.address : this.dataValue;
189
195
  }
190
196
  set address(value) {
191
- if (this.manualModeEnabled && !this.isMultiple) {
197
+ if (this.manualModeEnabled && !this.isMultiple && !lodash_1.default.isEqual(value, this.emptyValue)) {
192
198
  this.dataValue.address = value;
193
199
  }
194
200
  else {
@@ -10,7 +10,7 @@ class HTMLComponent extends Component_1.default {
10
10
  return Component_1.default.schema({
11
11
  label: 'HTML',
12
12
  type: 'htmlelement',
13
- tag: 'div',
13
+ tag: 'p',
14
14
  attrs: [],
15
15
  content: '',
16
16
  input: false,
@@ -523,4 +523,4 @@ import jsonLogic from 'json-logic-js';
523
523
  import ConditionOperators from './conditionOperators';
524
524
  import { Evaluator } from './Evaluator';
525
525
  export const interpolate: typeof Evaluator.interpolate;
526
- export { jsonLogic, ConditionOperators, Evaluator, _ };
526
+ export { jsonLogic, ConditionOperators, moment, Evaluator, _ };
@@ -11,21 +11,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
11
11
  if (k2 === undefined) k2 = k;
12
12
  o[k2] = m[k];
13
13
  }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
14
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
16
  };
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
29
17
  var __importDefault = (this && this.__importDefault) || function (mod) {
30
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
31
19
  };
@@ -37,6 +25,7 @@ exports._ = lodash_1.default;
37
25
  const json_logic_js_1 = __importDefault(require("json-logic-js"));
38
26
  exports.jsonLogic = json_logic_js_1.default;
39
27
  const moment_timezone_1 = __importDefault(require("moment-timezone/moment-timezone"));
28
+ exports.moment = moment_timezone_1.default;
40
29
  const jstimezonedetect_1 = __importDefault(require("jstimezonedetect"));
41
30
  const operators_1 = require("./jsonlogic/operators");
42
31
  const dompurify_1 = __importDefault(require("dompurify"));
@@ -62,7 +51,6 @@ json_logic_js_1.default.add_operation('relativeMinDate', (relativeMinDate) => {
62
51
  json_logic_js_1.default.add_operation('relativeMaxDate', (relativeMaxDate) => {
63
52
  return (0, moment_timezone_1.default)().add(relativeMaxDate, 'days').toISOString();
64
53
  });
65
- exports.moment = __importStar(require("moment-timezone/moment-timezone"));
66
54
  /**
67
55
  * Sets the path to the component and parent schema.
68
56
  * @param {import('@formio/core').Component} component - The component to set the path for.
@@ -11,6 +11,12 @@ export default class AddressComponent extends ContainerComponent {
11
11
  weight: number;
12
12
  schema: any;
13
13
  };
14
+ static get serverConditionSettings(): {
15
+ operators: string[];
16
+ };
17
+ static get conditionOperatorsSettings(): {
18
+ operators: string[];
19
+ };
14
20
  static get modeSwitcherRef(): string;
15
21
  static get removeValueIconRef(): string;
16
22
  static get searchInputRef(): string;
@@ -91,6 +91,15 @@ export default class AddressComponent extends ContainerComponent {
91
91
  schema: AddressComponent.schema(),
92
92
  };
93
93
  }
94
+ static get serverConditionSettings() {
95
+ return AddressComponent.conditionOperatorsSettings;
96
+ }
97
+ static get conditionOperatorsSettings() {
98
+ return {
99
+ ...super.conditionOperatorsSettings,
100
+ operators: ['isEmpty', 'isNotEmpty'],
101
+ };
102
+ }
94
103
  mergeSchema(component = {}) {
95
104
  let { defaultSchema } = this;
96
105
  if (component.components) {
@@ -181,7 +190,7 @@ export default class AddressComponent extends ContainerComponent {
181
190
  return (this.manualModeEnabled && this.dataValue) ? this.dataValue.address : this.dataValue;
182
191
  }
183
192
  set address(value) {
184
- if (this.manualModeEnabled && !this.isMultiple) {
193
+ if (this.manualModeEnabled && !this.isMultiple && !_.isEqual(value, this.emptyValue)) {
185
194
  this.dataValue.address = value;
186
195
  }
187
196
  else {
@@ -5,7 +5,7 @@ export default class HTMLComponent extends Component {
5
5
  return Component.schema({
6
6
  label: 'HTML',
7
7
  type: 'htmlelement',
8
- tag: 'div',
8
+ tag: 'p',
9
9
  attrs: [],
10
10
  content: '',
11
11
  input: false,
@@ -523,4 +523,4 @@ import jsonLogic from 'json-logic-js';
523
523
  import ConditionOperators from './conditionOperators';
524
524
  import { Evaluator } from './Evaluator';
525
525
  export const interpolate: typeof Evaluator.interpolate;
526
- export { jsonLogic, ConditionOperators, Evaluator, _ };
526
+ export { jsonLogic, ConditionOperators, moment, Evaluator, _ };
@@ -24,8 +24,7 @@ jsonLogic.add_operation('relativeMinDate', (relativeMinDate) => {
24
24
  jsonLogic.add_operation('relativeMaxDate', (relativeMaxDate) => {
25
25
  return moment().add(relativeMaxDate, 'days').toISOString();
26
26
  });
27
- export { jsonLogic, ConditionOperators };
28
- export * as moment from 'moment-timezone/moment-timezone';
27
+ export { jsonLogic, ConditionOperators, moment };
29
28
  /**
30
29
  * Sets the path to the component and parent schema.
31
30
  * @param {import('@formio/core').Component} component - The component to set the path for.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5792.f0b98eb",
3
+ "version": "5.0.0-dev.5794.12ca15f",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {