@defra/forms-model 3.0.9 → 3.0.11
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.
- package/dist/browser/components/component-types.js +201 -219
- package/dist/browser/components/component-types.js.map +1 -1
- package/dist/browser/components/conditional-component-types.js +9 -27
- package/dist/browser/components/conditional-component-types.js.map +1 -1
- package/dist/browser/components/enums.js +27 -45
- package/dist/browser/components/enums.js.map +1 -1
- package/dist/browser/components/index.js +3 -35
- package/dist/browser/components/index.js.map +1 -1
- package/dist/browser/components/types.js +1 -15
- package/dist/browser/conditions/condition-abstract.js +42 -60
- package/dist/browser/conditions/condition-abstract.js.map +1 -1
- package/dist/browser/conditions/condition-field.js +23 -41
- package/dist/browser/conditions/condition-field.js.map +1 -1
- package/dist/browser/conditions/condition-group-def.js +23 -42
- package/dist/browser/conditions/condition-group-def.js.map +1 -1
- package/dist/browser/conditions/condition-group.js +43 -61
- package/dist/browser/conditions/condition-group.js.map +1 -1
- package/dist/browser/conditions/condition-model.js +185 -196
- package/dist/browser/conditions/condition-model.js.map +1 -1
- package/dist/browser/conditions/condition-operators.js +103 -124
- package/dist/browser/conditions/condition-operators.js.map +1 -1
- package/dist/browser/conditions/condition-ref.js +29 -47
- package/dist/browser/conditions/condition-ref.js.map +1 -1
- package/dist/browser/conditions/condition-value-abstract.js +19 -37
- package/dist/browser/conditions/condition-value-abstract.js.map +1 -1
- package/dist/browser/conditions/condition-value-registration.js +15 -34
- package/dist/browser/conditions/condition-value-registration.js.map +1 -1
- package/dist/browser/conditions/condition-values.js +98 -118
- package/dist/browser/conditions/condition-values.js.map +1 -1
- package/dist/browser/conditions/condition.js +36 -51
- package/dist/browser/conditions/condition.js.map +1 -1
- package/dist/browser/conditions/enums.js +5 -23
- package/dist/browser/conditions/enums.js.map +1 -1
- package/dist/browser/conditions/helpers.js +6 -25
- package/dist/browser/conditions/helpers.js.map +1 -1
- package/dist/browser/conditions/index.js +10 -143
- package/dist/browser/conditions/index.js.map +1 -1
- package/dist/browser/conditions/inline-condition-model.js +372 -394
- package/dist/browser/conditions/inline-condition-model.js.map +1 -1
- package/dist/browser/conditions/inline-condition-operators.js +103 -124
- package/dist/browser/conditions/inline-condition-operators.js.map +1 -1
- package/dist/browser/conditions/inline-condition-values.js +123 -145
- package/dist/browser/conditions/inline-condition-values.js.map +1 -1
- package/dist/browser/conditions/types.js +1 -15
- package/dist/browser/conditions/types.js.map +1 -1
- package/dist/browser/data-model/conditions-wrapper.js +27 -45
- package/dist/browser/data-model/conditions-wrapper.js.map +1 -1
- package/dist/browser/data-model/enums.js +6 -24
- package/dist/browser/data-model/enums.js.map +1 -1
- package/dist/browser/data-model/index.js +3 -35
- package/dist/browser/data-model/index.js.map +1 -1
- package/dist/browser/data-model/input-wrapper.js +28 -46
- package/dist/browser/data-model/input-wrapper.js.map +1 -1
- package/dist/browser/data-model/types.js +7 -25
- package/dist/browser/data-model/types.js.map +1 -1
- package/dist/browser/form/form-configuration.js +16 -35
- package/dist/browser/form/form-configuration.js.map +1 -1
- package/dist/browser/form/index.js +1 -23
- package/dist/browser/form/index.js.map +1 -1
- package/dist/browser/index.js +8 -97
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/migration/index.js +1 -23
- package/dist/browser/migration/index.js.map +1 -1
- package/dist/browser/migration/migration.0-2.js +42 -60
- package/dist/browser/migration/migration.0-2.js.map +1 -1
- package/dist/browser/migration/migration.1-2.js +83 -99
- package/dist/browser/migration/migration.1-2.js.map +1 -1
- package/dist/browser/migration/types.js +1 -15
- package/dist/browser/migration/whichMigrations.js +20 -36
- package/dist/browser/migration/whichMigrations.js.map +1 -1
- package/dist/browser/schema/index.js +1 -29
- package/dist/browser/schema/index.js.map +1 -1
- package/dist/browser/schema/schema.js +231 -249
- package/dist/browser/schema/schema.js.map +1 -1
- package/dist/browser/utils/helpers.js +22 -43
- package/dist/browser/utils/helpers.js.map +1 -1
- package/dist/browser/utils/logger.js +24 -43
- package/dist/browser/utils/logger.js.map +1 -1
- package/dist/module/components/component-types.js +1 -5
- package/dist/module/components/component-types.js.map +1 -1
- package/dist/module/components/conditional-component-types.js +1 -5
- package/dist/module/components/conditional-component-types.js.map +1 -1
- package/dist/module/components/enums.js +1 -5
- package/dist/module/components/enums.js.map +1 -1
- package/dist/module/components/index.js +3 -24
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/types.js +2 -1
- package/dist/module/conditions/condition-abstract.js +3 -8
- package/dist/module/conditions/condition-abstract.js.map +1 -1
- package/dist/module/conditions/condition-field.js +3 -8
- package/dist/module/conditions/condition-field.js.map +1 -1
- package/dist/module/conditions/condition-group-def.js +1 -6
- package/dist/module/conditions/condition-group-def.js.map +1 -1
- package/dist/module/conditions/condition-group.js +4 -9
- package/dist/module/conditions/condition-group.js.map +1 -1
- package/dist/module/conditions/condition-model.js +20 -25
- package/dist/module/conditions/condition-model.js.map +1 -1
- package/dist/module/conditions/condition-operators.js +15 -23
- package/dist/module/conditions/condition-operators.js.map +1 -1
- package/dist/module/conditions/condition-ref.js +2 -7
- package/dist/module/conditions/condition-ref.js.map +1 -1
- package/dist/module/conditions/condition-value-abstract.js +3 -8
- package/dist/module/conditions/condition-value-abstract.js.map +1 -1
- package/dist/module/conditions/condition-value-registration.js +1 -6
- package/dist/module/conditions/condition-value-registration.js.map +1 -1
- package/dist/module/conditions/condition-values.js +12 -20
- package/dist/module/conditions/condition-values.js.map +1 -1
- package/dist/module/conditions/condition.js +9 -14
- package/dist/module/conditions/condition.js.map +1 -1
- package/dist/module/conditions/enums.js +1 -5
- package/dist/module/conditions/enums.js.map +1 -1
- package/dist/module/conditions/helpers.js +2 -7
- package/dist/module/conditions/helpers.js.map +1 -1
- package/dist/module/conditions/index.js +10 -139
- package/dist/module/conditions/index.js.map +1 -1
- package/dist/module/conditions/inline-condition-model.js +15 -26
- package/dist/module/conditions/inline-condition-model.js.map +1 -1
- package/dist/module/conditions/inline-condition-operators.js +15 -23
- package/dist/module/conditions/inline-condition-operators.js.map +1 -1
- package/dist/module/conditions/inline-condition-values.js +9 -17
- package/dist/module/conditions/inline-condition-values.js.map +1 -1
- package/dist/module/conditions/types.js +2 -1
- package/dist/module/conditions/types.js.map +1 -1
- package/dist/module/data-model/conditions-wrapper.js +3 -8
- package/dist/module/data-model/conditions-wrapper.js.map +1 -1
- package/dist/module/data-model/enums.js +1 -5
- package/dist/module/data-model/enums.js.map +1 -1
- package/dist/module/data-model/index.js +3 -24
- package/dist/module/data-model/index.js.map +1 -1
- package/dist/module/data-model/input-wrapper.js +3 -8
- package/dist/module/data-model/input-wrapper.js.map +1 -1
- package/dist/module/data-model/types.js +1 -5
- package/dist/module/data-model/types.js.map +1 -1
- package/dist/module/form/form-configuration.js +1 -6
- package/dist/module/form/form-configuration.js.map +1 -1
- package/dist/module/form/index.js +1 -10
- package/dist/module/form/index.js.map +1 -1
- package/dist/module/index.js +8 -91
- package/dist/module/index.js.map +1 -1
- package/dist/module/migration/index.js +1 -10
- package/dist/module/migration/index.js.map +1 -1
- package/dist/module/migration/migration.0-2.js +1 -5
- package/dist/module/migration/migration.0-2.js.map +1 -1
- package/dist/module/migration/migration.1-2.js +3 -6
- package/dist/module/migration/migration.1-2.js.map +1 -1
- package/dist/module/migration/types.js +2 -1
- package/dist/module/migration/whichMigrations.js +5 -9
- package/dist/module/migration/whichMigrations.js.map +1 -1
- package/dist/module/schema/index.js +1 -16
- package/dist/module/schema/index.js.map +1 -1
- package/dist/module/schema/schema.js +163 -167
- package/dist/module/schema/schema.js.map +1 -1
- package/dist/module/utils/helpers.js +5 -13
- package/dist/module/utils/helpers.js.map +1 -1
- package/dist/module/utils/logger.js +1 -6
- package/dist/module/utils/logger.js.map +1 -1
- package/dist/types/components/component-types.d.ts +1 -1
- package/dist/types/components/component-types.d.ts.map +1 -1
- package/dist/types/components/conditional-component-types.d.ts +1 -1
- package/dist/types/components/conditional-component-types.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +3 -3
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/conditions/condition-abstract.d.ts +1 -1
- package/dist/types/conditions/condition-abstract.d.ts.map +1 -1
- package/dist/types/conditions/condition-field.d.ts +1 -1
- package/dist/types/conditions/condition-field.d.ts.map +1 -1
- package/dist/types/conditions/condition-group-def.d.ts +2 -2
- package/dist/types/conditions/condition-group-def.d.ts.map +1 -1
- package/dist/types/conditions/condition-group.d.ts +2 -2
- package/dist/types/conditions/condition-group.d.ts.map +1 -1
- package/dist/types/conditions/condition-model.d.ts +5 -5
- package/dist/types/conditions/condition-model.d.ts.map +1 -1
- package/dist/types/conditions/condition-operators.d.ts +2 -2
- package/dist/types/conditions/condition-operators.d.ts.map +1 -1
- package/dist/types/conditions/condition-ref.d.ts +2 -2
- package/dist/types/conditions/condition-ref.d.ts.map +1 -1
- package/dist/types/conditions/condition-value-abstract.d.ts +1 -1
- package/dist/types/conditions/condition-value-abstract.d.ts.map +1 -1
- package/dist/types/conditions/condition-values.d.ts +3 -3
- package/dist/types/conditions/condition-values.d.ts.map +1 -1
- package/dist/types/conditions/condition.d.ts +4 -4
- package/dist/types/conditions/condition.d.ts.map +1 -1
- package/dist/types/conditions/index.d.ts +10 -10
- package/dist/types/conditions/index.d.ts.map +1 -1
- package/dist/types/conditions/types.d.ts +3 -3
- package/dist/types/conditions/types.d.ts.map +1 -1
- package/dist/types/data-model/conditions-wrapper.d.ts +1 -1
- package/dist/types/data-model/conditions-wrapper.d.ts.map +1 -1
- package/dist/types/data-model/index.d.ts +3 -3
- package/dist/types/data-model/index.d.ts.map +1 -1
- package/dist/types/data-model/input-wrapper.d.ts +2 -2
- package/dist/types/data-model/input-wrapper.d.ts.map +1 -1
- package/dist/types/data-model/types.d.ts +3 -3
- package/dist/types/data-model/types.d.ts.map +1 -1
- package/dist/types/form/index.d.ts +1 -1
- package/dist/types/form/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/migration/index.d.ts +1 -1
- package/dist/types/migration/index.d.ts.map +1 -1
- package/dist/types/migration/migration.0-2.d.ts +1 -1
- package/dist/types/migration/migration.0-2.d.ts.map +1 -1
- package/dist/types/migration/migration.1-2.d.ts +1 -1
- package/dist/types/migration/migration.1-2.d.ts.map +1 -1
- package/dist/types/migration/whichMigrations.d.ts +1 -1
- package/dist/types/migration/whichMigrations.d.ts.map +1 -1
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/component-types.ts +1 -1
- package/src/components/conditional-component-types.ts +1 -1
- package/src/components/index.ts +3 -3
- package/src/conditions/condition-abstract.ts +1 -1
- package/src/conditions/condition-field.ts +2 -2
- package/src/conditions/condition-group-def.ts +1 -1
- package/src/conditions/condition-group.ts +3 -3
- package/src/conditions/condition-model.ts +9 -9
- package/src/conditions/condition-operators.ts +6 -3
- package/src/conditions/condition-ref.ts +2 -2
- package/src/conditions/condition-value-abstract.ts +1 -1
- package/src/conditions/condition-values.ts +3 -3
- package/src/conditions/condition.ts +6 -6
- package/src/conditions/index.ts +10 -10
- package/src/conditions/inline-condition-model.ts +3 -3
- package/src/conditions/inline-condition-operators.ts +1 -1
- package/src/conditions/types.ts +3 -3
- package/src/data-model/conditions-wrapper.ts +2 -2
- package/src/data-model/index.ts +3 -3
- package/src/data-model/input-wrapper.ts +3 -3
- package/src/data-model/types.ts +3 -3
- package/src/form/index.ts +1 -1
- package/src/index.ts +11 -11
- package/src/migration/index.ts +1 -1
- package/src/migration/migration.0-2.ts +1 -1
- package/src/migration/migration.1-2.ts +2 -2
- package/src/migration/whichMigrations.ts +3 -3
- package/src/schema/index.ts +1 -1
|
@@ -1,127 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _conditionValueAbstract, _conditionValueRegistration) {
|
|
14
|
-
"use strict";
|
|
15
|
-
|
|
16
|
-
_exports.__esModule = true;
|
|
17
|
-
_exports.RelativeTimeValue = _exports.DateDirections = _exports.ConditionValue = void 0;
|
|
18
|
-
_exports.conditionValueFrom = conditionValueFrom;
|
|
19
|
-
_exports.timeUnits = _exports.relativeTimeValueType = _exports.dateUnits = _exports.dateTimeUnits = void 0;
|
|
20
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
22
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
-
class ConditionValue extends _conditionValueAbstract.ConditionValueAbstract {
|
|
24
|
-
constructor(value, display) {
|
|
25
|
-
super(valueType);
|
|
26
|
-
_defineProperty(this, "value", void 0);
|
|
27
|
-
_defineProperty(this, "display", void 0);
|
|
28
|
-
if (!value || typeof value !== 'string') {
|
|
29
|
-
throw Error(`value ${value} is not valid`);
|
|
30
|
-
}
|
|
31
|
-
if (display && typeof display !== 'string') {
|
|
32
|
-
throw Error(`display ${display} is not valid`);
|
|
33
|
-
}
|
|
34
|
-
this.value = value;
|
|
35
|
-
this.display = display || value;
|
|
36
|
-
}
|
|
37
|
-
toPresentationString() {
|
|
38
|
-
return this.display;
|
|
39
|
-
}
|
|
40
|
-
toExpression() {
|
|
41
|
-
return this.value;
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import { ConditionValueAbstract } from "./condition-value-abstract.js";
|
|
5
|
+
import { Registration } from "./condition-value-registration.js";
|
|
6
|
+
export class ConditionValue extends ConditionValueAbstract {
|
|
7
|
+
constructor(value, display) {
|
|
8
|
+
super(valueType);
|
|
9
|
+
_defineProperty(this, "value", void 0);
|
|
10
|
+
_defineProperty(this, "display", void 0);
|
|
11
|
+
if (!value || typeof value !== 'string') {
|
|
12
|
+
throw Error(`value ${value} is not valid`);
|
|
42
13
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
clone() {
|
|
47
|
-
return ConditionValue.from(this);
|
|
14
|
+
if (display && typeof display !== 'string') {
|
|
15
|
+
throw Error(`display ${display} is not valid`);
|
|
48
16
|
}
|
|
17
|
+
this.value = value;
|
|
18
|
+
this.display = display || value;
|
|
49
19
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
toPresentationString() {
|
|
108
|
-
return `${this.timePeriod} ${this.timeUnit} ${this.direction}`;
|
|
109
|
-
}
|
|
110
|
-
toExpression() {
|
|
111
|
-
const timePeriod = this.direction === DateDirections.PAST ? 0 - Number(this.timePeriod) : this.timePeriod;
|
|
112
|
-
return this.timeOnly ? `timeForComparison(${timePeriod}, '${this.timeUnit}')` : `dateForComparison(${timePeriod}, '${this.timeUnit}')`;
|
|
20
|
+
toPresentationString() {
|
|
21
|
+
return this.display;
|
|
22
|
+
}
|
|
23
|
+
toExpression() {
|
|
24
|
+
return this.value;
|
|
25
|
+
}
|
|
26
|
+
static from(obj) {
|
|
27
|
+
return new ConditionValue(obj.value, obj.display);
|
|
28
|
+
}
|
|
29
|
+
clone() {
|
|
30
|
+
return ConditionValue.from(this);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const valueType = Registration.register('Value', obj => ConditionValue.from(obj));
|
|
34
|
+
export let DateDirections = /*#__PURE__*/function (DateDirections) {
|
|
35
|
+
DateDirections["FUTURE"] = "in the future";
|
|
36
|
+
DateDirections["PAST"] = "in the past";
|
|
37
|
+
return DateDirections;
|
|
38
|
+
}({});
|
|
39
|
+
export const dateUnits = {
|
|
40
|
+
YEARS: {
|
|
41
|
+
display: 'year(s)',
|
|
42
|
+
value: 'years'
|
|
43
|
+
},
|
|
44
|
+
MONTHS: {
|
|
45
|
+
display: 'month(s)',
|
|
46
|
+
value: 'months'
|
|
47
|
+
},
|
|
48
|
+
DAYS: {
|
|
49
|
+
display: 'day(s)',
|
|
50
|
+
value: 'days'
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export const timeUnits = {
|
|
54
|
+
HOURS: {
|
|
55
|
+
display: 'hour(s)',
|
|
56
|
+
value: 'hours'
|
|
57
|
+
},
|
|
58
|
+
MINUTES: {
|
|
59
|
+
display: 'minute(s)',
|
|
60
|
+
value: 'minutes'
|
|
61
|
+
},
|
|
62
|
+
SECONDS: {
|
|
63
|
+
display: 'second(s)',
|
|
64
|
+
value: 'seconds'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
export const dateTimeUnits = Object.assign({}, dateUnits, timeUnits);
|
|
68
|
+
export class RelativeTimeValue extends ConditionValueAbstract {
|
|
69
|
+
constructor(timePeriod, timeUnit, direction, timeOnly = false) {
|
|
70
|
+
super(relativeTimeValueType);
|
|
71
|
+
_defineProperty(this, "timePeriod", void 0);
|
|
72
|
+
_defineProperty(this, "timeUnit", void 0);
|
|
73
|
+
_defineProperty(this, "direction", void 0);
|
|
74
|
+
_defineProperty(this, "timeOnly", void 0);
|
|
75
|
+
if (typeof timePeriod !== 'string') {
|
|
76
|
+
throw Error(`time period ${timePeriod} is not valid`);
|
|
113
77
|
}
|
|
114
|
-
|
|
115
|
-
|
|
78
|
+
if (!Object.values(dateTimeUnits).map(unit => unit.value).includes(timeUnit)) {
|
|
79
|
+
throw Error(`time unit ${timeUnit} is not valid`);
|
|
116
80
|
}
|
|
117
|
-
|
|
118
|
-
|
|
81
|
+
if (!Object.values(DateDirections).includes(direction)) {
|
|
82
|
+
throw Error(`direction ${direction} is not valid`);
|
|
119
83
|
}
|
|
84
|
+
this.timePeriod = timePeriod;
|
|
85
|
+
this.timeUnit = timeUnit;
|
|
86
|
+
this.direction = direction;
|
|
87
|
+
this.timeOnly = timeOnly;
|
|
88
|
+
}
|
|
89
|
+
toPresentationString() {
|
|
90
|
+
return `${this.timePeriod} ${this.timeUnit} ${this.direction}`;
|
|
91
|
+
}
|
|
92
|
+
toExpression() {
|
|
93
|
+
const timePeriod = this.direction === DateDirections.PAST ? 0 - Number(this.timePeriod) : this.timePeriod;
|
|
94
|
+
return this.timeOnly ? `timeForComparison(${timePeriod}, '${this.timeUnit}')` : `dateForComparison(${timePeriod}, '${this.timeUnit}')`;
|
|
95
|
+
}
|
|
96
|
+
static from(obj) {
|
|
97
|
+
return new RelativeTimeValue(obj.timePeriod, obj.timeUnit, obj.direction, obj.timeOnly);
|
|
120
98
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
function conditionValueFrom(obj) {
|
|
124
|
-
return _conditionValueRegistration.Registration.conditionValueFrom(obj);
|
|
99
|
+
clone() {
|
|
100
|
+
return RelativeTimeValue.from(this);
|
|
125
101
|
}
|
|
126
|
-
}
|
|
102
|
+
}
|
|
103
|
+
export const relativeTimeValueType = Registration.register('RelativeTime', obj => RelativeTimeValue.from(obj));
|
|
104
|
+
export function conditionValueFrom(obj) {
|
|
105
|
+
return Registration.conditionValueFrom(obj);
|
|
106
|
+
}
|
|
127
107
|
//# sourceMappingURL=condition-values.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition-values.js","names":["
|
|
1
|
+
{"version":3,"file":"condition-values.js","names":["ConditionValueAbstract","Registration","ConditionValue","constructor","value","display","valueType","_defineProperty","Error","toPresentationString","toExpression","from","obj","clone","register","DateDirections","dateUnits","YEARS","MONTHS","DAYS","timeUnits","HOURS","MINUTES","SECONDS","dateTimeUnits","Object","assign","RelativeTimeValue","timePeriod","timeUnit","direction","timeOnly","relativeTimeValueType","values","map","unit","includes","PAST","Number","conditionValueFrom"],"sources":["../../../src/conditions/condition-values.ts"],"sourcesContent":["import { ConditionValueAbstract } from '~/src/conditions/condition-value-abstract.js'\nimport { Registration } from '~/src/conditions/condition-value-registration.js'\nimport {\n type DateTimeUnitValues,\n type DateUnits,\n type TimeUnits\n} from '~/src/conditions/types.js'\n\nexport class ConditionValue extends ConditionValueAbstract {\n value: string\n display: string\n\n constructor(value: string, display?: string) {\n super(valueType)\n\n if (!value || typeof value !== 'string') {\n throw Error(`value ${value} is not valid`)\n }\n\n if (display && typeof display !== 'string') {\n throw Error(`display ${display} is not valid`)\n }\n\n this.value = value\n this.display = display || value\n }\n\n toPresentationString() {\n return this.display\n }\n\n toExpression() {\n return this.value\n }\n\n static from(obj: { value: string; display?: string }) {\n return new ConditionValue(obj.value, obj.display)\n }\n\n clone() {\n return ConditionValue.from(this)\n }\n}\n\nconst valueType = Registration.register('Value', (obj) =>\n ConditionValue.from(obj)\n)\n\nexport enum DateDirections {\n FUTURE = 'in the future',\n PAST = 'in the past'\n}\n\nexport const dateUnits: DateUnits = {\n YEARS: { display: 'year(s)', value: 'years' },\n MONTHS: { display: 'month(s)', value: 'months' },\n DAYS: { display: 'day(s)', value: 'days' }\n}\n\nexport const timeUnits: TimeUnits = {\n HOURS: { display: 'hour(s)', value: 'hours' },\n MINUTES: { display: 'minute(s)', value: 'minutes' },\n SECONDS: { display: 'second(s)', value: 'seconds' }\n}\n\nexport const dateTimeUnits: DateUnits & TimeUnits = Object.assign(\n {},\n dateUnits,\n timeUnits\n)\n\nexport class RelativeTimeValue extends ConditionValueAbstract {\n timePeriod: string\n timeUnit: DateTimeUnitValues\n direction: DateDirections\n timeOnly: boolean\n\n constructor(\n timePeriod: string,\n timeUnit: DateTimeUnitValues,\n direction: DateDirections,\n timeOnly = false\n ) {\n super(relativeTimeValueType)\n\n if (typeof timePeriod !== 'string') {\n throw Error(`time period ${timePeriod} is not valid`)\n }\n\n if (\n !Object.values(dateTimeUnits)\n .map((unit) => unit.value)\n .includes(timeUnit)\n ) {\n throw Error(`time unit ${timeUnit} is not valid`)\n }\n\n if (!Object.values(DateDirections).includes(direction)) {\n throw Error(`direction ${direction} is not valid`)\n }\n\n this.timePeriod = timePeriod\n this.timeUnit = timeUnit\n this.direction = direction\n this.timeOnly = timeOnly\n }\n\n toPresentationString() {\n return `${this.timePeriod} ${this.timeUnit} ${this.direction}`\n }\n\n toExpression(): string {\n const timePeriod =\n this.direction === DateDirections.PAST\n ? 0 - Number(this.timePeriod)\n : this.timePeriod\n return this.timeOnly\n ? `timeForComparison(${timePeriod}, '${this.timeUnit}')`\n : `dateForComparison(${timePeriod}, '${this.timeUnit}')`\n }\n\n static from(obj) {\n return new RelativeTimeValue(\n obj.timePeriod,\n obj.timeUnit,\n obj.direction,\n obj.timeOnly\n )\n }\n\n clone() {\n return RelativeTimeValue.from(this)\n }\n}\n\nexport const relativeTimeValueType = Registration.register(\n 'RelativeTime',\n (obj): RelativeTimeValue => RelativeTimeValue.from(obj)\n)\n\ntype ConditionValueFrom =\n | Pick<ConditionValue, 'type' | 'value' | 'display'>\n | Pick<\n RelativeTimeValue,\n 'type' | 'timePeriod' | 'timeUnit' | 'direction' | 'timeOnly'\n >\n\nexport function conditionValueFrom(obj: ConditionValueFrom) {\n return Registration.conditionValueFrom(obj)\n}\n"],"mappings":"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"}
|
|
@@ -1,56 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_exports.__esModule = true;
|
|
17
|
-
_exports.Condition = void 0;
|
|
18
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
20
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
|
-
class Condition extends _conditionAbstract.ConditionAbstract {
|
|
22
|
-
constructor(field, operator, value, coordinator) {
|
|
23
|
-
super(coordinator);
|
|
24
|
-
_defineProperty(this, "field", void 0);
|
|
25
|
-
_defineProperty(this, "operator", void 0);
|
|
26
|
-
_defineProperty(this, "value", void 0);
|
|
27
|
-
if (!(field instanceof _conditionField.ConditionField)) {
|
|
28
|
-
throw Error(`field ${field} is not a valid ConditionField object`);
|
|
29
|
-
}
|
|
30
|
-
if (typeof operator !== 'string') {
|
|
31
|
-
throw Error(`operator ${operator} is not a valid operator`);
|
|
32
|
-
}
|
|
33
|
-
if (!(value instanceof _conditionValueAbstract.ConditionValueAbstract)) {
|
|
34
|
-
throw Error(`value ${value} is not a valid value type`);
|
|
35
|
-
}
|
|
36
|
-
this.field = field;
|
|
37
|
-
this.operator = operator;
|
|
38
|
-
this.value = value;
|
|
39
|
-
}
|
|
40
|
-
asFirstCondition() {
|
|
41
|
-
this._asFirstCondition();
|
|
42
|
-
return this;
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import { ConditionField } from "./condition-field.js";
|
|
5
|
+
import { ConditionAbstract } from "./condition-abstract.js";
|
|
6
|
+
import { getExpression } from "./condition-operators.js";
|
|
7
|
+
import { ConditionValueAbstract } from "./condition-value-abstract.js";
|
|
8
|
+
export class Condition extends ConditionAbstract {
|
|
9
|
+
constructor(field, operator, value, coordinator) {
|
|
10
|
+
super(coordinator);
|
|
11
|
+
_defineProperty(this, "field", void 0);
|
|
12
|
+
_defineProperty(this, "operator", void 0);
|
|
13
|
+
_defineProperty(this, "value", void 0);
|
|
14
|
+
if (!(field instanceof ConditionField)) {
|
|
15
|
+
throw Error(`field ${field} is not a valid ConditionField object`);
|
|
43
16
|
}
|
|
44
|
-
|
|
45
|
-
|
|
17
|
+
if (typeof operator !== 'string') {
|
|
18
|
+
throw Error(`operator ${operator} is not a valid operator`);
|
|
46
19
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
clone() {
|
|
51
|
-
return new Condition(_conditionField.ConditionField.from(this.field), this.operator, this.value.clone(), this.coordinator);
|
|
20
|
+
if (!(value instanceof ConditionValueAbstract)) {
|
|
21
|
+
throw Error(`value ${value} is not a valid value type`);
|
|
52
22
|
}
|
|
23
|
+
this.field = field;
|
|
24
|
+
this.operator = operator;
|
|
25
|
+
this.value = value;
|
|
26
|
+
}
|
|
27
|
+
asFirstCondition() {
|
|
28
|
+
this._asFirstCondition();
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
conditionString() {
|
|
32
|
+
return `'${this.field.display}' ${this.operator} '${this.value.toPresentationString()}'`;
|
|
33
|
+
}
|
|
34
|
+
conditionExpression() {
|
|
35
|
+
return getExpression(this.field.type, this.field.name, this.operator, this.value);
|
|
36
|
+
}
|
|
37
|
+
clone() {
|
|
38
|
+
return new Condition(ConditionField.from(this.field), this.operator, this.value.clone(), this.coordinator);
|
|
53
39
|
}
|
|
54
|
-
|
|
55
|
-
});
|
|
40
|
+
}
|
|
56
41
|
//# sourceMappingURL=condition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition.js","names":["
|
|
1
|
+
{"version":3,"file":"condition.js","names":["ConditionField","ConditionAbstract","getExpression","ConditionValueAbstract","Condition","constructor","field","operator","value","coordinator","_defineProperty","Error","asFirstCondition","_asFirstCondition","conditionString","display","toPresentationString","conditionExpression","type","name","clone","from"],"sources":["../../../src/conditions/condition.ts"],"sourcesContent":["import { ConditionField } from '~/src/conditions/condition-field.js'\nimport { ConditionAbstract } from '~/src/conditions/condition-abstract.js'\nimport { getExpression } from '~/src/conditions/condition-operators.js'\nimport {\n ConditionValue,\n RelativeTimeValue\n} from '~/src/conditions/condition-values.js'\nimport { ConditionValueAbstract } from '~/src/conditions/condition-value-abstract.js'\nimport { Coordinator } from '~/src/conditions/enums.js'\n\nexport class Condition extends ConditionAbstract {\n field: ConditionField\n operator: string\n value: ConditionValue | RelativeTimeValue\n\n constructor(\n field: ConditionField,\n operator: string,\n value: ConditionValue | RelativeTimeValue,\n coordinator?: Coordinator\n ) {\n super(coordinator)\n\n if (!(field instanceof ConditionField)) {\n throw Error(`field ${field} is not a valid ConditionField object`)\n }\n if (typeof operator !== 'string') {\n throw Error(`operator ${operator} is not a valid operator`)\n }\n if (!(value instanceof ConditionValueAbstract)) {\n throw Error(`value ${value} is not a valid value type`)\n }\n\n this.field = field\n this.operator = operator\n this.value = value\n }\n\n asFirstCondition() {\n this._asFirstCondition()\n return this\n }\n\n conditionString() {\n return `'${this.field.display}' ${\n this.operator\n } '${this.value.toPresentationString()}'`\n }\n\n conditionExpression() {\n return getExpression(\n this.field.type,\n this.field.name,\n this.operator,\n this.value\n )\n }\n\n clone() {\n return new Condition(\n ConditionField.from(this.field),\n this.operator,\n this.value.clone(),\n this.coordinator\n )\n }\n}\n"],"mappings":";;;AAAA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,aAAa;AAKtB,SAASC,sBAAsB;AAG/B,OAAO,MAAMC,SAAS,SAASH,iBAAiB,CAAC;EAK/CI,WAAWA,CACTC,KAAqB,EACrBC,QAAgB,EAChBC,KAAyC,EACzCC,WAAyB,EACzB;IACA,KAAK,CAACA,WAAW,CAAC;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAElB,IAAI,EAAEJ,KAAK,YAAYN,cAAc,CAAC,EAAE;MACtC,MAAMW,KAAK,CAAE,SAAQL,KAAM,uCAAsC,CAAC;IACpE;IACA,IAAI,OAAOC,QAAQ,KAAK,QAAQ,EAAE;MAChC,MAAMI,KAAK,CAAE,YAAWJ,QAAS,0BAAyB,CAAC;IAC7D;IACA,IAAI,EAAEC,KAAK,YAAYL,sBAAsB,CAAC,EAAE;MAC9C,MAAMQ,KAAK,CAAE,SAAQH,KAAM,4BAA2B,CAAC;IACzD;IAEA,IAAI,CAACF,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,KAAK,GAAGA,KAAK;EACpB;EAEAI,gBAAgBA,CAAA,EAAG;IACjB,IAAI,CAACC,iBAAiB,CAAC,CAAC;IACxB,OAAO,IAAI;EACb;EAEAC,eAAeA,CAAA,EAAG;IAChB,OAAQ,IAAG,IAAI,CAACR,KAAK,CAACS,OAAQ,KAC5B,IAAI,CAACR,QACN,KAAI,IAAI,CAACC,KAAK,CAACQ,oBAAoB,CAAC,CAAE,GAAE;EAC3C;EAEAC,mBAAmBA,CAAA,EAAG;IACpB,OAAOf,aAAa,CAClB,IAAI,CAACI,KAAK,CAACY,IAAI,EACf,IAAI,CAACZ,KAAK,CAACa,IAAI,EACf,IAAI,CAACZ,QAAQ,EACb,IAAI,CAACC,KACP,CAAC;EACH;EAEAY,KAAKA,CAAA,EAAG;IACN,OAAO,IAAIhB,SAAS,CAClBJ,cAAc,CAACqB,IAAI,CAAC,IAAI,CAACf,KAAK,CAAC,EAC/B,IAAI,CAACC,QAAQ,EACb,IAAI,CAACC,KAAK,CAACY,KAAK,CAAC,CAAC,EAClB,IAAI,CAACX,WACP,CAAC;EACH;AACF"}
|
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} else {
|
|
7
|
-
var mod = {
|
|
8
|
-
exports: {}
|
|
9
|
-
};
|
|
10
|
-
factory(mod.exports);
|
|
11
|
-
global.enums = mod.exports;
|
|
12
|
-
}
|
|
13
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
|
|
14
|
-
"use strict";
|
|
15
|
-
|
|
16
|
-
_exports.__esModule = true;
|
|
17
|
-
_exports.Coordinator = void 0;
|
|
18
|
-
let Coordinator = _exports.Coordinator = /*#__PURE__*/function (Coordinator) {
|
|
19
|
-
Coordinator["AND"] = "and";
|
|
20
|
-
Coordinator["OR"] = "or";
|
|
21
|
-
return Coordinator;
|
|
22
|
-
}({});
|
|
23
|
-
});
|
|
1
|
+
export let Coordinator = /*#__PURE__*/function (Coordinator) {
|
|
2
|
+
Coordinator["AND"] = "and";
|
|
3
|
+
Coordinator["OR"] = "or";
|
|
4
|
+
return Coordinator;
|
|
5
|
+
}({});
|
|
24
6
|
//# sourceMappingURL=enums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","names":["Coordinator"
|
|
1
|
+
{"version":3,"file":"enums.js","names":["Coordinator"],"sources":["../../../src/conditions/enums.ts"],"sourcesContent":["export enum Coordinator {\n AND = 'and',\n OR = 'or'\n}\n"],"mappings":"AAAA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA"}
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var mod = {
|
|
8
|
-
exports: {}
|
|
9
|
-
};
|
|
10
|
-
factory(mod.exports);
|
|
11
|
-
global.helpers = mod.exports;
|
|
12
|
-
}
|
|
13
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
|
|
14
|
-
"use strict";
|
|
15
|
-
|
|
16
|
-
_exports.__esModule = true;
|
|
17
|
-
_exports.toExpression = toExpression;
|
|
18
|
-
_exports.toPresentationString = toPresentationString;
|
|
19
|
-
function toPresentationString(condition) {
|
|
20
|
-
return `${condition.coordinatorString()}${condition.conditionString()}`;
|
|
21
|
-
}
|
|
22
|
-
function toExpression(condition) {
|
|
23
|
-
return `${condition.coordinatorString()}${condition.conditionExpression()}`;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
1
|
+
export function toPresentationString(condition) {
|
|
2
|
+
return `${condition.coordinatorString()}${condition.conditionString()}`;
|
|
3
|
+
}
|
|
4
|
+
export function toExpression(condition) {
|
|
5
|
+
return `${condition.coordinatorString()}${condition.conditionExpression()}`;
|
|
6
|
+
}
|
|
26
7
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["toPresentationString","condition","coordinatorString","conditionString","toExpression","conditionExpression"],"sources":["../../../src/conditions/helpers.ts"],"sourcesContent":["export function toPresentationString(condition) {\n return `${condition.coordinatorString()}${condition.conditionString()}`\n}\n\nexport function toExpression(condition) {\n return `${condition.coordinatorString()}${condition.conditionExpression()}`\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["toPresentationString","condition","coordinatorString","conditionString","toExpression","conditionExpression"],"sources":["../../../src/conditions/helpers.ts"],"sourcesContent":["export function toPresentationString(condition) {\n return `${condition.coordinatorString()}${condition.conditionString()}`\n}\n\nexport function toExpression(condition) {\n return `${condition.coordinatorString()}${condition.conditionExpression()}`\n}\n"],"mappings":"AAAA,OAAO,SAASA,oBAAoBA,CAACC,SAAS,EAAE;EAC9C,OAAQ,GAAEA,SAAS,CAACC,iBAAiB,CAAC,CAAE,GAAED,SAAS,CAACE,eAAe,CAAC,CAAE,EAAC;AACzE;AAEA,OAAO,SAASC,YAAYA,CAACH,SAAS,EAAE;EACtC,OAAQ,GAAEA,SAAS,CAACC,iBAAiB,CAAC,CAAE,GAAED,SAAS,CAACI,mBAAmB,CAAC,CAAE,EAAC;AAC7E"}
|
|
@@ -1,144 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
global.index = mod.exports;
|
|
12
|
-
}
|
|
13
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _conditionOperators, _conditionValues, _conditionField, _condition, _conditionRef, _conditionGroup, _conditionModel, _conditionGroupDef, _helpers, _enums) {
|
|
14
|
-
"use strict";
|
|
15
|
-
|
|
16
|
-
_exports.__esModule = true;
|
|
17
|
-
Object.defineProperty(_exports, "Condition", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function () {
|
|
20
|
-
return _condition.Condition;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(_exports, "ConditionField", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () {
|
|
26
|
-
return _conditionField.ConditionField;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(_exports, "ConditionGroup", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function () {
|
|
32
|
-
return _conditionGroup.ConditionGroup;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(_exports, "ConditionGroupDef", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function () {
|
|
38
|
-
return _conditionGroupDef.ConditionGroupDef;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(_exports, "ConditionRef", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function () {
|
|
44
|
-
return _conditionRef.ConditionRef;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(_exports, "ConditionValue", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function () {
|
|
50
|
-
return _conditionValues.ConditionValue;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(_exports, "ConditionsModel", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
get: function () {
|
|
56
|
-
return _conditionModel.ConditionsModel;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
Object.defineProperty(_exports, "Coordinator", {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: function () {
|
|
62
|
-
return _enums.Coordinator;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
Object.defineProperty(_exports, "DateDirections", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _conditionValues.DateDirections;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
Object.defineProperty(_exports, "RelativeTimeValue", {
|
|
72
|
-
enumerable: true,
|
|
73
|
-
get: function () {
|
|
74
|
-
return _conditionValues.RelativeTimeValue;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
Object.defineProperty(_exports, "absoluteDateOrTimeOperatorNames", {
|
|
78
|
-
enumerable: true,
|
|
79
|
-
get: function () {
|
|
80
|
-
return _conditionOperators.absoluteDateOrTimeOperatorNames;
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(_exports, "conditionValueFrom", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
get: function () {
|
|
86
|
-
return _conditionValues.conditionValueFrom;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
Object.defineProperty(_exports, "dateTimeUnits", {
|
|
90
|
-
enumerable: true,
|
|
91
|
-
get: function () {
|
|
92
|
-
return _conditionValues.dateTimeUnits;
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
Object.defineProperty(_exports, "dateUnits", {
|
|
96
|
-
enumerable: true,
|
|
97
|
-
get: function () {
|
|
98
|
-
return _conditionValues.dateUnits;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
Object.defineProperty(_exports, "getExpression", {
|
|
102
|
-
enumerable: true,
|
|
103
|
-
get: function () {
|
|
104
|
-
return _conditionOperators.getExpression;
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
Object.defineProperty(_exports, "getOperatorConfig", {
|
|
108
|
-
enumerable: true,
|
|
109
|
-
get: function () {
|
|
110
|
-
return _conditionOperators.getOperatorConfig;
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
Object.defineProperty(_exports, "getOperatorNames", {
|
|
114
|
-
enumerable: true,
|
|
115
|
-
get: function () {
|
|
116
|
-
return _conditionOperators.getOperatorNames;
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
Object.defineProperty(_exports, "relativeDateOrTimeOperatorNames", {
|
|
120
|
-
enumerable: true,
|
|
121
|
-
get: function () {
|
|
122
|
-
return _conditionOperators.relativeDateOrTimeOperatorNames;
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
Object.defineProperty(_exports, "timeUnits", {
|
|
126
|
-
enumerable: true,
|
|
127
|
-
get: function () {
|
|
128
|
-
return _conditionValues.timeUnits;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
Object.defineProperty(_exports, "toExpression", {
|
|
132
|
-
enumerable: true,
|
|
133
|
-
get: function () {
|
|
134
|
-
return _helpers.toExpression;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
Object.defineProperty(_exports, "toPresentationString", {
|
|
138
|
-
enumerable: true,
|
|
139
|
-
get: function () {
|
|
140
|
-
return _helpers.toPresentationString;
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
});
|
|
1
|
+
export { getExpression, getOperatorConfig, getOperatorNames, absoluteDateOrTimeOperatorNames, relativeDateOrTimeOperatorNames } from "./condition-operators.js";
|
|
2
|
+
export { timeUnits, dateUnits, dateTimeUnits, ConditionValue, DateDirections, RelativeTimeValue, conditionValueFrom } from "./condition-values.js";
|
|
3
|
+
export { ConditionField } from "./condition-field.js";
|
|
4
|
+
export { Condition } from "./condition.js";
|
|
5
|
+
export { ConditionRef } from "./condition-ref.js";
|
|
6
|
+
export { ConditionGroup } from "./condition-group.js";
|
|
7
|
+
export { ConditionsModel } from "./condition-model.js";
|
|
8
|
+
export { ConditionGroupDef } from "./condition-group-def.js";
|
|
9
|
+
export { toExpression, toPresentationString } from "./helpers.js";
|
|
10
|
+
export { Coordinator } from "./enums.js";
|
|
144
11
|
//# sourceMappingURL=index.js.map
|