@defra/forms-model 3.0.10 → 3.0.12

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 (239) hide show
  1. package/dist/module/components/component-types.js +1 -5
  2. package/dist/module/components/component-types.js.map +1 -1
  3. package/dist/module/components/conditional-component-types.js +1 -5
  4. package/dist/module/components/conditional-component-types.js.map +1 -1
  5. package/dist/module/components/enums.js +1 -5
  6. package/dist/module/components/enums.js.map +1 -1
  7. package/dist/module/components/index.js +3 -24
  8. package/dist/module/components/index.js.map +1 -1
  9. package/dist/module/components/types.js +1 -1
  10. package/dist/module/conditions/condition-abstract.js +3 -8
  11. package/dist/module/conditions/condition-abstract.js.map +1 -1
  12. package/dist/module/conditions/condition-field.js +3 -8
  13. package/dist/module/conditions/condition-field.js.map +1 -1
  14. package/dist/module/conditions/condition-group-def.js +1 -6
  15. package/dist/module/conditions/condition-group-def.js.map +1 -1
  16. package/dist/module/conditions/condition-group.js +4 -9
  17. package/dist/module/conditions/condition-group.js.map +1 -1
  18. package/dist/module/conditions/condition-model.js +20 -25
  19. package/dist/module/conditions/condition-model.js.map +1 -1
  20. package/dist/module/conditions/condition-operators.js +15 -23
  21. package/dist/module/conditions/condition-operators.js.map +1 -1
  22. package/dist/module/conditions/condition-ref.js +2 -7
  23. package/dist/module/conditions/condition-ref.js.map +1 -1
  24. package/dist/module/conditions/condition-value-abstract.js +3 -8
  25. package/dist/module/conditions/condition-value-abstract.js.map +1 -1
  26. package/dist/module/conditions/condition-value-registration.js +1 -6
  27. package/dist/module/conditions/condition-value-registration.js.map +1 -1
  28. package/dist/module/conditions/condition-values.js +12 -20
  29. package/dist/module/conditions/condition-values.js.map +1 -1
  30. package/dist/module/conditions/condition.js +9 -14
  31. package/dist/module/conditions/condition.js.map +1 -1
  32. package/dist/module/conditions/enums.js +1 -5
  33. package/dist/module/conditions/enums.js.map +1 -1
  34. package/dist/module/conditions/helpers.js +2 -7
  35. package/dist/module/conditions/helpers.js.map +1 -1
  36. package/dist/module/conditions/index.js +10 -139
  37. package/dist/module/conditions/index.js.map +1 -1
  38. package/dist/module/conditions/inline-condition-model.js +15 -26
  39. package/dist/module/conditions/inline-condition-model.js.map +1 -1
  40. package/dist/module/conditions/inline-condition-operators.js +15 -23
  41. package/dist/module/conditions/inline-condition-operators.js.map +1 -1
  42. package/dist/module/conditions/inline-condition-values.js +9 -17
  43. package/dist/module/conditions/inline-condition-values.js.map +1 -1
  44. package/dist/module/conditions/types.js +1 -1
  45. package/dist/module/conditions/types.js.map +1 -1
  46. package/dist/module/data-model/conditions-wrapper.js +3 -8
  47. package/dist/module/data-model/conditions-wrapper.js.map +1 -1
  48. package/dist/module/data-model/enums.js +1 -5
  49. package/dist/module/data-model/enums.js.map +1 -1
  50. package/dist/module/data-model/index.js +3 -24
  51. package/dist/module/data-model/index.js.map +1 -1
  52. package/dist/module/data-model/input-wrapper.js +3 -8
  53. package/dist/module/data-model/input-wrapper.js.map +1 -1
  54. package/dist/module/data-model/types.js +1 -5
  55. package/dist/module/data-model/types.js.map +1 -1
  56. package/dist/module/form/form-configuration.js +1 -6
  57. package/dist/module/form/form-configuration.js.map +1 -1
  58. package/dist/module/form/index.js +1 -10
  59. package/dist/module/form/index.js.map +1 -1
  60. package/dist/module/index.js +8 -91
  61. package/dist/module/index.js.map +1 -1
  62. package/dist/module/migration/index.js +1 -10
  63. package/dist/module/migration/index.js.map +1 -1
  64. package/dist/module/migration/migration.0-2.js +1 -5
  65. package/dist/module/migration/migration.0-2.js.map +1 -1
  66. package/dist/module/migration/migration.1-2.js +3 -6
  67. package/dist/module/migration/migration.1-2.js.map +1 -1
  68. package/dist/module/migration/types.js +1 -1
  69. package/dist/module/migration/whichMigrations.js +5 -9
  70. package/dist/module/migration/whichMigrations.js.map +1 -1
  71. package/dist/module/schema/index.js +1 -16
  72. package/dist/module/schema/index.js.map +1 -1
  73. package/dist/module/schema/schema.js +163 -167
  74. package/dist/module/schema/schema.js.map +1 -1
  75. package/dist/module/utils/helpers.js +5 -13
  76. package/dist/module/utils/helpers.js.map +1 -1
  77. package/dist/module/utils/logger.js +1 -6
  78. package/dist/module/utils/logger.js.map +1 -1
  79. package/dist/types/components/component-types.d.ts +1 -1
  80. package/dist/types/components/component-types.d.ts.map +1 -1
  81. package/dist/types/components/conditional-component-types.d.ts +1 -1
  82. package/dist/types/components/conditional-component-types.d.ts.map +1 -1
  83. package/dist/types/components/index.d.ts +3 -3
  84. package/dist/types/components/index.d.ts.map +1 -1
  85. package/dist/types/conditions/condition-abstract.d.ts +1 -1
  86. package/dist/types/conditions/condition-abstract.d.ts.map +1 -1
  87. package/dist/types/conditions/condition-field.d.ts +1 -1
  88. package/dist/types/conditions/condition-field.d.ts.map +1 -1
  89. package/dist/types/conditions/condition-group-def.d.ts +2 -2
  90. package/dist/types/conditions/condition-group-def.d.ts.map +1 -1
  91. package/dist/types/conditions/condition-group.d.ts +2 -2
  92. package/dist/types/conditions/condition-group.d.ts.map +1 -1
  93. package/dist/types/conditions/condition-model.d.ts +5 -5
  94. package/dist/types/conditions/condition-model.d.ts.map +1 -1
  95. package/dist/types/conditions/condition-operators.d.ts +2 -2
  96. package/dist/types/conditions/condition-operators.d.ts.map +1 -1
  97. package/dist/types/conditions/condition-ref.d.ts +2 -2
  98. package/dist/types/conditions/condition-ref.d.ts.map +1 -1
  99. package/dist/types/conditions/condition-value-abstract.d.ts +1 -1
  100. package/dist/types/conditions/condition-value-abstract.d.ts.map +1 -1
  101. package/dist/types/conditions/condition-values.d.ts +3 -3
  102. package/dist/types/conditions/condition-values.d.ts.map +1 -1
  103. package/dist/types/conditions/condition.d.ts +4 -4
  104. package/dist/types/conditions/condition.d.ts.map +1 -1
  105. package/dist/types/conditions/index.d.ts +10 -10
  106. package/dist/types/conditions/index.d.ts.map +1 -1
  107. package/dist/types/conditions/types.d.ts +3 -3
  108. package/dist/types/conditions/types.d.ts.map +1 -1
  109. package/dist/types/data-model/conditions-wrapper.d.ts +1 -1
  110. package/dist/types/data-model/conditions-wrapper.d.ts.map +1 -1
  111. package/dist/types/data-model/index.d.ts +3 -3
  112. package/dist/types/data-model/index.d.ts.map +1 -1
  113. package/dist/types/data-model/input-wrapper.d.ts +2 -2
  114. package/dist/types/data-model/input-wrapper.d.ts.map +1 -1
  115. package/dist/types/data-model/types.d.ts +3 -3
  116. package/dist/types/data-model/types.d.ts.map +1 -1
  117. package/dist/types/form/index.d.ts +1 -1
  118. package/dist/types/form/index.d.ts.map +1 -1
  119. package/dist/types/index.d.ts +11 -11
  120. package/dist/types/index.d.ts.map +1 -1
  121. package/dist/types/migration/index.d.ts +1 -1
  122. package/dist/types/migration/index.d.ts.map +1 -1
  123. package/dist/types/migration/migration.0-2.d.ts +1 -1
  124. package/dist/types/migration/migration.0-2.d.ts.map +1 -1
  125. package/dist/types/migration/migration.1-2.d.ts +1 -1
  126. package/dist/types/migration/migration.1-2.d.ts.map +1 -1
  127. package/dist/types/migration/whichMigrations.d.ts +1 -1
  128. package/dist/types/migration/whichMigrations.d.ts.map +1 -1
  129. package/dist/types/schema/index.d.ts +1 -1
  130. package/dist/types/schema/index.d.ts.map +1 -1
  131. package/package.json +3 -4
  132. package/src/components/component-types.ts +1 -1
  133. package/src/components/conditional-component-types.ts +1 -1
  134. package/src/components/index.ts +3 -3
  135. package/src/conditions/condition-abstract.ts +1 -1
  136. package/src/conditions/condition-field.ts +2 -2
  137. package/src/conditions/condition-group-def.ts +1 -1
  138. package/src/conditions/condition-group.ts +3 -3
  139. package/src/conditions/condition-model.ts +9 -9
  140. package/src/conditions/condition-operators.ts +6 -3
  141. package/src/conditions/condition-ref.ts +2 -2
  142. package/src/conditions/condition-value-abstract.ts +1 -1
  143. package/src/conditions/condition-values.ts +3 -3
  144. package/src/conditions/condition.ts +6 -6
  145. package/src/conditions/index.ts +10 -10
  146. package/src/conditions/inline-condition-model.ts +3 -3
  147. package/src/conditions/inline-condition-operators.ts +1 -1
  148. package/src/conditions/types.ts +3 -3
  149. package/src/data-model/conditions-wrapper.ts +2 -2
  150. package/src/data-model/index.ts +3 -3
  151. package/src/data-model/input-wrapper.ts +3 -3
  152. package/src/data-model/types.ts +3 -3
  153. package/src/form/index.ts +1 -1
  154. package/src/index.ts +11 -11
  155. package/src/migration/index.ts +1 -1
  156. package/src/migration/migration.0-2.ts +1 -1
  157. package/src/migration/migration.1-2.ts +2 -2
  158. package/src/migration/whichMigrations.ts +3 -3
  159. package/src/schema/index.ts +1 -1
  160. package/dist/browser/components/component-types.js +0 -220
  161. package/dist/browser/components/component-types.js.map +0 -1
  162. package/dist/browser/components/conditional-component-types.js +0 -28
  163. package/dist/browser/components/conditional-component-types.js.map +0 -1
  164. package/dist/browser/components/enums.js +0 -46
  165. package/dist/browser/components/enums.js.map +0 -1
  166. package/dist/browser/components/index.js +0 -36
  167. package/dist/browser/components/index.js.map +0 -1
  168. package/dist/browser/components/types.js +0 -16
  169. package/dist/browser/components/types.js.map +0 -1
  170. package/dist/browser/conditions/condition-abstract.js +0 -62
  171. package/dist/browser/conditions/condition-abstract.js.map +0 -1
  172. package/dist/browser/conditions/condition-field.js +0 -45
  173. package/dist/browser/conditions/condition-field.js.map +0 -1
  174. package/dist/browser/conditions/condition-group-def.js +0 -45
  175. package/dist/browser/conditions/condition-group-def.js.map +0 -1
  176. package/dist/browser/conditions/condition-group.js +0 -64
  177. package/dist/browser/conditions/condition-group.js.map +0 -1
  178. package/dist/browser/conditions/condition-model.js +0 -214
  179. package/dist/browser/conditions/condition-model.js.map +0 -1
  180. package/dist/browser/conditions/condition-operators.js +0 -132
  181. package/dist/browser/conditions/condition-operators.js.map +0 -1
  182. package/dist/browser/conditions/condition-ref.js +0 -51
  183. package/dist/browser/conditions/condition-ref.js.map +0 -1
  184. package/dist/browser/conditions/condition-value-abstract.js +0 -41
  185. package/dist/browser/conditions/condition-value-abstract.js.map +0 -1
  186. package/dist/browser/conditions/condition-value-registration.js +0 -37
  187. package/dist/browser/conditions/condition-value-registration.js.map +0 -1
  188. package/dist/browser/conditions/condition-values.js +0 -127
  189. package/dist/browser/conditions/condition-values.js.map +0 -1
  190. package/dist/browser/conditions/condition.js +0 -56
  191. package/dist/browser/conditions/condition.js.map +0 -1
  192. package/dist/browser/conditions/enums.js +0 -24
  193. package/dist/browser/conditions/enums.js.map +0 -1
  194. package/dist/browser/conditions/helpers.js +0 -26
  195. package/dist/browser/conditions/helpers.js.map +0 -1
  196. package/dist/browser/conditions/index.js +0 -144
  197. package/dist/browser/conditions/index.js.map +0 -1
  198. package/dist/browser/conditions/inline-condition-model.js +0 -418
  199. package/dist/browser/conditions/inline-condition-model.js.map +0 -1
  200. package/dist/browser/conditions/inline-condition-operators.js +0 -132
  201. package/dist/browser/conditions/inline-condition-operators.js.map +0 -1
  202. package/dist/browser/conditions/inline-condition-values.js +0 -159
  203. package/dist/browser/conditions/inline-condition-values.js.map +0 -1
  204. package/dist/browser/conditions/types.js +0 -16
  205. package/dist/browser/conditions/types.js.map +0 -1
  206. package/dist/browser/data-model/conditions-wrapper.js +0 -49
  207. package/dist/browser/data-model/conditions-wrapper.js.map +0 -1
  208. package/dist/browser/data-model/enums.js +0 -25
  209. package/dist/browser/data-model/enums.js.map +0 -1
  210. package/dist/browser/data-model/index.js +0 -36
  211. package/dist/browser/data-model/index.js.map +0 -1
  212. package/dist/browser/data-model/input-wrapper.js +0 -49
  213. package/dist/browser/data-model/input-wrapper.js.map +0 -1
  214. package/dist/browser/data-model/types.js +0 -27
  215. package/dist/browser/data-model/types.js.map +0 -1
  216. package/dist/browser/form/form-configuration.js +0 -38
  217. package/dist/browser/form/form-configuration.js.map +0 -1
  218. package/dist/browser/form/index.js +0 -24
  219. package/dist/browser/form/index.js.map +0 -1
  220. package/dist/browser/index.js +0 -98
  221. package/dist/browser/index.js.map +0 -1
  222. package/dist/browser/migration/index.js +0 -24
  223. package/dist/browser/migration/index.js.map +0 -1
  224. package/dist/browser/migration/migration.0-2.js +0 -65
  225. package/dist/browser/migration/migration.0-2.js.map +0 -1
  226. package/dist/browser/migration/migration.1-2.js +0 -108
  227. package/dist/browser/migration/migration.1-2.js.map +0 -1
  228. package/dist/browser/migration/types.js +0 -16
  229. package/dist/browser/migration/types.js.map +0 -1
  230. package/dist/browser/migration/whichMigrations.js +0 -38
  231. package/dist/browser/migration/whichMigrations.js.map +0 -1
  232. package/dist/browser/schema/index.js +0 -30
  233. package/dist/browser/schema/index.js.map +0 -1
  234. package/dist/browser/schema/schema.js +0 -255
  235. package/dist/browser/schema/schema.js.map +0 -1
  236. package/dist/browser/utils/helpers.js +0 -48
  237. package/dist/browser/utils/helpers.js.map +0 -1
  238. package/dist/browser/utils/logger.js +0 -46
  239. package/dist/browser/utils/logger.js.map +0 -1
@@ -1,418 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "../components/component-types", "./inline-condition-operators", "./inline-condition-values"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("../components/component-types"), require("./inline-condition-operators"), require("./inline-condition-values"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.componentTypes, global.inlineConditionOperators, global.inlineConditionValues);
11
- global.inlineConditionModel = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _componentTypes, _inlineConditionOperators, _inlineConditionValues) {
14
- "use strict";
15
-
16
- _exports.__esModule = true;
17
- _exports.coordinators = _exports.GroupDef = _exports.Field = _exports.ConditionsModel = _exports.ConditionRef = _exports.Condition = void 0;
18
- _exports.toExpression = toExpression;
19
- _exports.toPresentationString = toPresentationString;
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
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
24
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
25
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
26
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
27
- function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
28
- const coordinators = _exports.coordinators = {
29
- AND: 'and',
30
- OR: 'or'
31
- };
32
- var _groupedConditions = /*#__PURE__*/new WeakMap();
33
- var _userGroupedConditions = /*#__PURE__*/new WeakMap();
34
- var _conditionName = /*#__PURE__*/new WeakMap();
35
- class ConditionsModel {
36
- constructor() {
37
- _classPrivateFieldInitSpec(this, _groupedConditions, void 0);
38
- _classPrivateFieldInitSpec(this, _userGroupedConditions, void 0);
39
- _classPrivateFieldInitSpec(this, _conditionName, void 0);
40
- _classPrivateFieldSet(_groupedConditions, this, []);
41
- _classPrivateFieldSet(_userGroupedConditions, this, []);
42
- }
43
- clone() {
44
- const toReturn = new ConditionsModel();
45
- _classPrivateFieldSet(_groupedConditions, toReturn, _classPrivateFieldGet(_groupedConditions, this).map(it => it.clone()));
46
- _classPrivateFieldSet(_userGroupedConditions, toReturn, _classPrivateFieldGet(_userGroupedConditions, this).map(it => it.clone()));
47
- _classPrivateFieldSet(_conditionName, toReturn, _classPrivateFieldGet(_conditionName, this));
48
- return toReturn;
49
- }
50
- clear() {
51
- _classPrivateFieldSet(_userGroupedConditions, this, []);
52
- _classPrivateFieldSet(_groupedConditions, this, []);
53
- _classPrivateFieldSet(_conditionName, this, undefined);
54
- return this;
55
- }
56
- set name(name) {
57
- _classPrivateFieldSet(_conditionName, this, name);
58
- }
59
- get name() {
60
- return _classPrivateFieldGet(_conditionName, this);
61
- }
62
- add(condition) {
63
- const coordinatorExpected = _classPrivateFieldGet(_userGroupedConditions, this).length !== 0;
64
- if (condition.getCoordinator() && !coordinatorExpected) {
65
- throw Error('No coordinator allowed on the first condition');
66
- } else if (!condition.getCoordinator() && coordinatorExpected) {
67
- throw Error('Coordinator must be present on subsequent conditions');
68
- }
69
- _classPrivateFieldGet(_userGroupedConditions, this).push(condition);
70
- _classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
71
- return this;
72
- }
73
- replace(index, condition) {
74
- const coordinatorExpected = index !== 0;
75
- if (condition.getCoordinator() && !coordinatorExpected) {
76
- throw Error('No coordinator allowed on the first condition');
77
- } else if (!condition.getCoordinator() && coordinatorExpected) {
78
- throw Error('Coordinator must be present on subsequent conditions');
79
- } else if (index >= _classPrivateFieldGet(_userGroupedConditions, this).length) {
80
- throw Error(`Cannot replace condition ${index} as no such condition exists`);
81
- }
82
- _classPrivateFieldGet(_userGroupedConditions, this).splice(index, 1, condition);
83
- _classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
84
- return this;
85
- }
86
- remove(indexes) {
87
- _classPrivateFieldSet(_userGroupedConditions, this, _classPrivateFieldGet(_userGroupedConditions, this).filter((_condition, index) => !indexes.includes(index)).map((condition, index) => index === 0 ? condition.asFirstCondition() : condition));
88
- _classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
89
- return this;
90
- }
91
- addGroups(groupDefs) {
92
- _classPrivateFieldSet(_userGroupedConditions, this, this._group(_classPrivateFieldGet(_userGroupedConditions, this), groupDefs));
93
- _classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
94
- return this;
95
- }
96
- splitGroup(index) {
97
- _classPrivateFieldSet(_userGroupedConditions, this, this._ungroup(_classPrivateFieldGet(_userGroupedConditions, this), index));
98
- _classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
99
- return this;
100
- }
101
- moveEarlier(index) {
102
- if (index > 0 && index < _classPrivateFieldGet(_userGroupedConditions, this).length) {
103
- _classPrivateFieldGet(_userGroupedConditions, this).splice(index - 1, 0, _classPrivateFieldGet(_userGroupedConditions, this).splice(index, 1)[0]);
104
- if (index === 1) {
105
- this.switchCoordinators();
106
- }
107
- _classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
108
- }
109
- return this;
110
- }
111
- moveLater(index) {
112
- if (index >= 0 && index < _classPrivateFieldGet(_userGroupedConditions, this).length - 1) {
113
- _classPrivateFieldGet(_userGroupedConditions, this).splice(index + 1, 0, _classPrivateFieldGet(_userGroupedConditions, this).splice(index, 1)[0]);
114
- if (index === 0) {
115
- this.switchCoordinators();
116
- }
117
- _classPrivateFieldSet(_groupedConditions, this, this._applyGroups(_classPrivateFieldGet(_userGroupedConditions, this)));
118
- }
119
- return this;
120
- }
121
- switchCoordinators() {
122
- _classPrivateFieldGet(_userGroupedConditions, this)[1].setCoordinator(_classPrivateFieldGet(_userGroupedConditions, this)[0].getCoordinator());
123
- _classPrivateFieldGet(_userGroupedConditions, this)[0].setCoordinator(undefined);
124
- }
125
- get asPerUserGroupings() {
126
- return [..._classPrivateFieldGet(_userGroupedConditions, this)];
127
- }
128
- get hasConditions() {
129
- return _classPrivateFieldGet(_userGroupedConditions, this).length > 0;
130
- }
131
- get lastIndex() {
132
- return _classPrivateFieldGet(_userGroupedConditions, this).length - 1;
133
- }
134
- toPresentationString() {
135
- return _classPrivateFieldGet(_groupedConditions, this).map(condition => toPresentationString(condition)).join(' ');
136
- }
137
- toExpression() {
138
- return _classPrivateFieldGet(_groupedConditions, this).map(condition => toExpression(condition)).join(' ');
139
- }
140
- _applyGroups(userGroupedConditions) {
141
- const correctedUserGroups = userGroupedConditions.map(condition => condition instanceof ConditionGroup && condition.conditions.length > 2 ? new ConditionGroup(this._group(condition.conditions, this._autoGroupDefs(condition.conditions))) : condition);
142
- return this._group(correctedUserGroups, this._autoGroupDefs(correctedUserGroups));
143
- }
144
- _group(conditions, groupDefs) {
145
- return conditions.reduce((groups, condition, index, conditions) => {
146
- const groupDef = groupDefs.find(groupDef => groupDef.contains(index));
147
- if (groupDef) {
148
- if (groupDef.startsWith(index)) {
149
- const groupConditions = groupDef.applyTo(conditions);
150
- groups.push(new ConditionGroup(groupConditions));
151
- }
152
- } else {
153
- groups.push(condition);
154
- }
155
- return groups;
156
- }, []);
157
- }
158
- _ungroup(conditions, splitIndex) {
159
- if (conditions[splitIndex].isGroup()) {
160
- const copy = [...conditions];
161
- copy.splice(splitIndex, 1, ...conditions[splitIndex].getGroupedConditions());
162
- return copy;
163
- }
164
- return conditions;
165
- }
166
- _autoGroupDefs(conditions) {
167
- const orPositions = [];
168
- conditions.forEach((condition, index) => {
169
- if (condition.getCoordinator() === coordinators.OR) {
170
- orPositions.push(index);
171
- }
172
- });
173
- const hasAnd = !!conditions.find(condition => condition.getCoordinator() === coordinators.AND);
174
- const hasOr = orPositions.length > 0;
175
- if (hasAnd && hasOr) {
176
- let start = 0;
177
- const groupDefs = [];
178
- orPositions.forEach((position, index) => {
179
- if (start < position - 1) {
180
- groupDefs.push(new GroupDef(start, position - 1));
181
- }
182
- const thisIsTheLastOr = orPositions.length === index + 1;
183
- const thereAreMoreConditions = conditions.length - 1 > position;
184
- if (thisIsTheLastOr && thereAreMoreConditions) {
185
- groupDefs.push(new GroupDef(position, conditions.length - 1));
186
- }
187
- start = position;
188
- });
189
- return groupDefs;
190
- }
191
- return [];
192
- }
193
- toJSON() {
194
- const name = _classPrivateFieldGet(_conditionName, this);
195
- const conditions = _classPrivateFieldGet(_userGroupedConditions, this);
196
- return {
197
- name,
198
- conditions: conditions.map(it => it.clone())
199
- };
200
- }
201
- static from(obj) {
202
- if (obj instanceof ConditionsModel) {
203
- return obj;
204
- }
205
- const toReturn = new ConditionsModel();
206
- _classPrivateFieldSet(_conditionName, toReturn, obj.name);
207
- _classPrivateFieldSet(_userGroupedConditions, toReturn, obj.conditions.map(it => conditionFrom(it)));
208
- _classPrivateFieldSet(_groupedConditions, toReturn, toReturn._applyGroups(_classPrivateFieldGet(_userGroupedConditions, toReturn)));
209
- return toReturn;
210
- }
211
- }
212
- _exports.ConditionsModel = ConditionsModel;
213
- function conditionFrom(it) {
214
- if (it.conditions) {
215
- return new ConditionGroup(it.conditions.map(condition => conditionFrom(condition)));
216
- }
217
- if (it.conditionName) {
218
- return new ConditionRef(it.conditionName, it.conditionDisplayName, it.coordinator);
219
- }
220
- return new Condition(Field.from(it.field), it.operator, (0, _inlineConditionValues.valueFrom)(it.value), it.coordinator);
221
- }
222
- class GroupDef {
223
- constructor(first, last) {
224
- _defineProperty(this, "first", void 0);
225
- _defineProperty(this, "last", void 0);
226
- if (typeof first !== 'number' || typeof last !== 'number') {
227
- throw Error(`Cannot construct a group from ${first} and ${last}`);
228
- } else if (first >= last) {
229
- throw Error(`Last (${last}) must be greater than first (${first})`);
230
- }
231
- this.first = first;
232
- this.last = last;
233
- }
234
- contains(index) {
235
- return this.first <= index && this.last >= index;
236
- }
237
- startsWith(index) {
238
- return this.first === index;
239
- }
240
- applyTo(conditions) {
241
- return [...conditions].splice(this.first, this.last - this.first + 1);
242
- }
243
- }
244
- _exports.GroupDef = GroupDef;
245
- class ConditionGroup {
246
- constructor(conditions) {
247
- _defineProperty(this, "conditions", void 0);
248
- if (!Array.isArray(conditions) || conditions.length < 2) {
249
- throw Error('Cannot construct a condition group from a single condition');
250
- }
251
- this.conditions = conditions;
252
- }
253
- coordinatorString() {
254
- return this.conditions[0].coordinatorString();
255
- }
256
- conditionString() {
257
- const copy = [...this.conditions];
258
- copy.splice(0, 1);
259
- return `(${this.conditions[0].conditionString()} ${copy.map(condition => toPresentationString(condition)).join(' ')})`;
260
- }
261
- conditionExpression() {
262
- const copy = [...this.conditions];
263
- copy.splice(0, 1);
264
- return `(${this.conditions[0].conditionExpression()} ${copy.map(condition => toExpression(condition)).join(' ')})`;
265
- }
266
- asFirstCondition() {
267
- this.conditions[0].asFirstCondition();
268
- return this;
269
- }
270
- getCoordinator() {
271
- return this.conditions[0].getCoordinator();
272
- }
273
- setCoordinator(coordinator) {
274
- this.conditions[0].setCoordinator(coordinator);
275
- }
276
- isGroup() {
277
- return true;
278
- }
279
- getGroupedConditions() {
280
- return this.conditions.map(condition => condition.clone());
281
- }
282
- clone() {
283
- return new ConditionGroup(this.conditions.map(condition => condition.clone()));
284
- }
285
- }
286
- function toPresentationString(condition) {
287
- return `${condition.coordinatorString()}${condition.conditionString()}`;
288
- }
289
- function toExpression(condition) {
290
- return `${condition.coordinatorString()}${condition.conditionExpression()}`;
291
- }
292
- class Field {
293
- constructor(name, type, display) {
294
- _defineProperty(this, "name", void 0);
295
- _defineProperty(this, "type", void 0);
296
- _defineProperty(this, "display", void 0);
297
- if (!name || typeof name !== 'string') {
298
- throw Error(`name ${name} is not valid`);
299
- }
300
- if (!_componentTypes.ComponentTypes.find(componentType => componentType.name === type)) {
301
- throw Error(`type ${type} is not valid`);
302
- }
303
- if (!display || typeof display !== 'string') {
304
- throw Error(`display ${display} is not valid`);
305
- }
306
- this.name = name;
307
- this.type = type;
308
- this.display = display;
309
- }
310
- static from(obj) {
311
- return new Field(obj.name, obj.type, obj.display);
312
- }
313
- }
314
- _exports.Field = Field;
315
- class AbstractCondition {
316
- constructor(coordinator) {
317
- _defineProperty(this, "coordinator", void 0);
318
- if (coordinator && !Object.values(coordinators).includes(coordinator)) {
319
- throw Error(`coordinator ${coordinator} is not a valid coordinator`);
320
- }
321
- this.coordinator = coordinator;
322
- }
323
- coordinatorString() {
324
- return this.coordinator ? `${this.coordinator} ` : '';
325
- }
326
- getCoordinator() {
327
- return this.coordinator;
328
- }
329
- setCoordinator(coordinator) {
330
- this.coordinator = coordinator;
331
- }
332
- isGroup() {
333
- return false;
334
- }
335
- getGroupedConditions() {
336
- return [this];
337
- }
338
- _asFirstCondition() {
339
- delete this.coordinator;
340
- }
341
- asFirstCondition() {
342
- throw Error('Implement on the subclass (Why do we have to have this method here at all?!)');
343
- }
344
- clone() {
345
- throw Error('Implement on the subclass (Why do we have to have this method here at all?!)');
346
- }
347
- conditionString() {
348
- throw Error('Implement on the subclass (Why do we have to have this method here at all?!)');
349
- }
350
- conditionExpression() {
351
- throw Error('Implement on the subclass (Why do we have to have this method here at all?!)');
352
- }
353
- }
354
- class Condition extends AbstractCondition {
355
- constructor(field, operator, value, coordinator) {
356
- super(coordinator);
357
- _defineProperty(this, "field", void 0);
358
- _defineProperty(this, "operator", void 0);
359
- _defineProperty(this, "value", void 0);
360
- if (!(field instanceof Field)) {
361
- throw Error(`field ${field} is not a valid Field object`);
362
- }
363
- if (typeof operator !== 'string') {
364
- throw Error(`operator ${operator} is not a valid operator`);
365
- }
366
- if (!(value instanceof _inlineConditionValues.AbstractConditionValue)) {
367
- throw Error(`value ${value} is not a valid value type`);
368
- }
369
- this.field = field;
370
- this.operator = operator;
371
- this.value = value;
372
- }
373
- asFirstCondition() {
374
- this._asFirstCondition();
375
- return this;
376
- }
377
- conditionString() {
378
- return `'${this.field.display}' ${this.operator} '${this.value.toPresentationString()}'`;
379
- }
380
- conditionExpression() {
381
- return (0, _inlineConditionOperators.getExpression)(this.field.type, this.field.name, this.operator, this.value);
382
- }
383
- clone() {
384
- return new Condition(Field.from(this.field), this.operator, this.value.clone(), this.coordinator);
385
- }
386
- }
387
- _exports.Condition = Condition;
388
- class ConditionRef extends AbstractCondition {
389
- constructor(conditionName, conditionDisplayName, coordinator) {
390
- super(coordinator);
391
- _defineProperty(this, "conditionName", void 0);
392
- _defineProperty(this, "conditionDisplayName", void 0);
393
- if (typeof conditionName !== 'string') {
394
- throw Error(`condition name ${conditionName} is not valid`);
395
- }
396
- if (typeof conditionDisplayName !== 'string') {
397
- throw Error(`condition display name ${conditionDisplayName} is not valid`);
398
- }
399
- this.conditionName = conditionName;
400
- this.conditionDisplayName = conditionDisplayName;
401
- }
402
- asFirstCondition() {
403
- this._asFirstCondition();
404
- return this;
405
- }
406
- conditionString() {
407
- return `'${this.conditionDisplayName}'`;
408
- }
409
- conditionExpression() {
410
- return this.conditionName;
411
- }
412
- clone() {
413
- return new ConditionRef(this.conditionName, this.conditionDisplayName, this.coordinator);
414
- }
415
- }
416
- _exports.ConditionRef = ConditionRef;
417
- });
418
- //# sourceMappingURL=inline-condition-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-condition-model.js","names":["coordinators","_exports","AND","OR","_groupedConditions","WeakMap","_userGroupedConditions","_conditionName","ConditionsModel","constructor","_classPrivateFieldInitSpec","_classPrivateFieldSet","clone","toReturn","_classPrivateFieldGet","map","it","clear","undefined","name","add","condition","coordinatorExpected","length","getCoordinator","Error","push","_applyGroups","replace","index","splice","remove","indexes","filter","_condition","includes","asFirstCondition","addGroups","groupDefs","_group","splitGroup","_ungroup","moveEarlier","switchCoordinators","moveLater","setCoordinator","asPerUserGroupings","hasConditions","lastIndex","toPresentationString","join","toExpression","userGroupedConditions","correctedUserGroups","ConditionGroup","conditions","_autoGroupDefs","reduce","groups","groupDef","find","contains","startsWith","groupConditions","applyTo","splitIndex","isGroup","copy","getGroupedConditions","orPositions","forEach","hasAnd","hasOr","start","position","GroupDef","thisIsTheLastOr","thereAreMoreConditions","toJSON","from","obj","conditionFrom","conditionName","ConditionRef","conditionDisplayName","coordinator","Condition","Field","field","operator","valueFrom","value","first","last","_defineProperty","Array","isArray","coordinatorString","conditionString","conditionExpression","type","display","ComponentTypes","componentType","AbstractCondition","Object","values","_asFirstCondition","AbstractConditionValue","getExpression"],"sources":["../../../src/conditions/inline-condition-model.ts"],"sourcesContent":["import { ComponentTypes } from '~/src/components/component-types'\nimport { getExpression } from '~/src/conditions/inline-condition-operators'\nimport {\n AbstractConditionValue,\n valueFrom\n} from '~/src/conditions/inline-condition-values'\n\nexport const coordinators = {\n AND: 'and',\n OR: 'or'\n}\n\nexport class ConditionsModel {\n #groupedConditions\n #userGroupedConditions\n #conditionName\n\n constructor() {\n this.#groupedConditions = []\n this.#userGroupedConditions = []\n }\n\n clone() {\n const toReturn = new ConditionsModel()\n toReturn.#groupedConditions = this.#groupedConditions.map((it) =>\n it.clone()\n )\n toReturn.#userGroupedConditions = this.#userGroupedConditions.map((it) =>\n it.clone()\n )\n toReturn.#conditionName = this.#conditionName\n return toReturn\n }\n\n clear() {\n this.#userGroupedConditions = []\n this.#groupedConditions = []\n this.#conditionName = undefined\n return this\n }\n\n set name(name) {\n this.#conditionName = name\n }\n\n get name() {\n return this.#conditionName\n }\n\n add(condition) {\n const coordinatorExpected = this.#userGroupedConditions.length !== 0\n if (condition.getCoordinator() && !coordinatorExpected) {\n throw Error('No coordinator allowed on the first condition')\n } else if (!condition.getCoordinator() && coordinatorExpected) {\n throw Error('Coordinator must be present on subsequent conditions')\n }\n this.#userGroupedConditions.push(condition)\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n return this\n }\n\n replace(index, condition) {\n const coordinatorExpected = index !== 0\n if (condition.getCoordinator() && !coordinatorExpected) {\n throw Error('No coordinator allowed on the first condition')\n } else if (!condition.getCoordinator() && coordinatorExpected) {\n throw Error('Coordinator must be present on subsequent conditions')\n } else if (index >= this.#userGroupedConditions.length) {\n throw Error(\n `Cannot replace condition ${index} as no such condition exists`\n )\n }\n this.#userGroupedConditions.splice(index, 1, condition)\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n return this\n }\n\n remove(indexes) {\n this.#userGroupedConditions = this.#userGroupedConditions\n .filter((_condition, index) => !indexes.includes(index))\n .map((condition, index) =>\n index === 0 ? condition.asFirstCondition() : condition\n )\n\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n return this\n }\n\n addGroups(groupDefs) {\n this.#userGroupedConditions = this._group(\n this.#userGroupedConditions,\n groupDefs\n )\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n return this\n }\n\n splitGroup(index) {\n this.#userGroupedConditions = this._ungroup(\n this.#userGroupedConditions,\n index\n )\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n return this\n }\n\n moveEarlier(index) {\n if (index > 0 && index < this.#userGroupedConditions.length) {\n this.#userGroupedConditions.splice(\n index - 1,\n 0,\n this.#userGroupedConditions.splice(index, 1)[0]\n )\n if (index === 1) {\n this.switchCoordinators()\n }\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n }\n return this\n }\n\n moveLater(index) {\n if (index >= 0 && index < this.#userGroupedConditions.length - 1) {\n this.#userGroupedConditions.splice(\n index + 1,\n 0,\n this.#userGroupedConditions.splice(index, 1)[0]\n )\n if (index === 0) {\n this.switchCoordinators()\n }\n this.#groupedConditions = this._applyGroups(this.#userGroupedConditions)\n }\n return this\n }\n\n switchCoordinators() {\n this.#userGroupedConditions[1].setCoordinator(\n this.#userGroupedConditions[0].getCoordinator()\n )\n this.#userGroupedConditions[0].setCoordinator(undefined)\n }\n\n get asPerUserGroupings() {\n return [...this.#userGroupedConditions]\n }\n\n get hasConditions() {\n return this.#userGroupedConditions.length > 0\n }\n\n get lastIndex() {\n return this.#userGroupedConditions.length - 1\n }\n\n toPresentationString() {\n return this.#groupedConditions\n .map((condition) => toPresentationString(condition))\n .join(' ')\n }\n\n toExpression() {\n return this.#groupedConditions\n .map((condition) => toExpression(condition))\n .join(' ')\n }\n\n _applyGroups(userGroupedConditions) {\n const correctedUserGroups = userGroupedConditions.map((condition) =>\n condition instanceof ConditionGroup && condition.conditions.length > 2\n ? new ConditionGroup(\n this._group(\n condition.conditions,\n this._autoGroupDefs(condition.conditions)\n )\n )\n : condition\n )\n return this._group(\n correctedUserGroups,\n this._autoGroupDefs(correctedUserGroups)\n )\n }\n\n _group(conditions, groupDefs) {\n return conditions.reduce((groups, condition, index, conditions) => {\n const groupDef = groupDefs.find((groupDef) => groupDef.contains(index))\n if (groupDef) {\n if (groupDef.startsWith(index)) {\n const groupConditions = groupDef.applyTo(conditions)\n groups.push(new ConditionGroup(groupConditions))\n }\n } else {\n groups.push(condition)\n }\n return groups\n }, [])\n }\n\n _ungroup(conditions, splitIndex) {\n if (conditions[splitIndex].isGroup()) {\n const copy = [...conditions]\n copy.splice(\n splitIndex,\n 1,\n ...conditions[splitIndex].getGroupedConditions()\n )\n return copy\n }\n return conditions\n }\n\n _autoGroupDefs(conditions) {\n const orPositions: number[] = []\n conditions.forEach((condition, index) => {\n if (condition.getCoordinator() === coordinators.OR) {\n orPositions.push(index)\n }\n })\n const hasAnd = !!conditions.find(\n (condition) => condition.getCoordinator() === coordinators.AND\n )\n const hasOr = orPositions.length > 0\n if (hasAnd && hasOr) {\n let start = 0\n const groupDefs: GroupDef[] = []\n orPositions.forEach((position, index) => {\n if (start < position - 1) {\n groupDefs.push(new GroupDef(start, position - 1))\n }\n const thisIsTheLastOr = orPositions.length === index + 1\n const thereAreMoreConditions = conditions.length - 1 > position\n if (thisIsTheLastOr && thereAreMoreConditions) {\n groupDefs.push(new GroupDef(position, conditions.length - 1))\n }\n start = position\n })\n return groupDefs\n }\n return []\n }\n\n toJSON() {\n const name = this.#conditionName\n const conditions = this.#userGroupedConditions\n return {\n name,\n conditions: conditions.map((it) => it.clone())\n }\n }\n\n static from(obj) {\n if (obj instanceof ConditionsModel) {\n return obj\n }\n const toReturn = new ConditionsModel()\n toReturn.#conditionName = obj.name\n toReturn.#userGroupedConditions = obj.conditions.map((it) =>\n conditionFrom(it)\n )\n toReturn.#groupedConditions = toReturn._applyGroups(\n toReturn.#userGroupedConditions\n )\n return toReturn\n }\n}\n\nfunction conditionFrom(it) {\n if (it.conditions) {\n return new ConditionGroup(\n it.conditions.map((condition) => conditionFrom(condition))\n )\n }\n if (it.conditionName) {\n return new ConditionRef(\n it.conditionName,\n it.conditionDisplayName,\n it.coordinator\n )\n }\n return new Condition(\n Field.from(it.field),\n it.operator,\n valueFrom(it.value),\n it.coordinator\n )\n}\n\nexport class GroupDef {\n first\n last\n\n constructor(first, last) {\n if (typeof first !== 'number' || typeof last !== 'number') {\n throw Error(`Cannot construct a group from ${first} and ${last}`)\n } else if (first >= last) {\n throw Error(`Last (${last}) must be greater than first (${first})`)\n }\n this.first = first\n this.last = last\n }\n\n contains(index) {\n return this.first <= index && this.last >= index\n }\n\n startsWith(index) {\n return this.first === index\n }\n\n applyTo(conditions) {\n return [...conditions].splice(this.first, this.last - this.first + 1)\n }\n}\n\nclass ConditionGroup {\n conditions\n\n constructor(conditions) {\n if (!Array.isArray(conditions) || conditions.length < 2) {\n throw Error('Cannot construct a condition group from a single condition')\n }\n this.conditions = conditions\n }\n\n coordinatorString() {\n return this.conditions[0].coordinatorString()\n }\n\n conditionString() {\n const copy = [...this.conditions]\n copy.splice(0, 1)\n return `(${this.conditions[0].conditionString()} ${copy\n .map((condition) => toPresentationString(condition))\n .join(' ')})`\n }\n\n conditionExpression() {\n const copy = [...this.conditions]\n copy.splice(0, 1)\n return `(${this.conditions[0].conditionExpression()} ${copy\n .map((condition) => toExpression(condition))\n .join(' ')})`\n }\n\n asFirstCondition() {\n this.conditions[0].asFirstCondition()\n return this\n }\n\n getCoordinator() {\n return this.conditions[0].getCoordinator()\n }\n\n setCoordinator(coordinator) {\n this.conditions[0].setCoordinator(coordinator)\n }\n\n isGroup() {\n return true\n }\n\n getGroupedConditions() {\n return this.conditions.map((condition) => condition.clone())\n }\n\n clone() {\n return new ConditionGroup(\n this.conditions.map((condition) => condition.clone())\n )\n }\n}\n\nexport function toPresentationString(condition) {\n return `${condition.coordinatorString()}${condition.conditionString()}`\n}\n\nexport function toExpression(condition) {\n return `${condition.coordinatorString()}${condition.conditionExpression()}`\n}\n\nexport class Field {\n name\n type\n display\n\n constructor(name, type, display) {\n if (!name || typeof name !== 'string') {\n throw Error(`name ${name} is not valid`)\n }\n if (!ComponentTypes.find((componentType) => componentType.name === type)) {\n throw Error(`type ${type} is not valid`)\n }\n if (!display || typeof display !== 'string') {\n throw Error(`display ${display} is not valid`)\n }\n this.name = name\n this.type = type\n this.display = display\n }\n\n static from(obj) {\n return new Field(obj.name, obj.type, obj.display)\n }\n}\n\nclass AbstractCondition {\n coordinator\n\n constructor(coordinator) {\n if (coordinator && !Object.values(coordinators).includes(coordinator)) {\n throw Error(`coordinator ${coordinator} is not a valid coordinator`)\n }\n this.coordinator = coordinator\n }\n\n coordinatorString() {\n return this.coordinator ? `${this.coordinator} ` : ''\n }\n\n getCoordinator() {\n return this.coordinator\n }\n\n setCoordinator(coordinator) {\n this.coordinator = coordinator\n }\n\n isGroup() {\n return false\n }\n\n getGroupedConditions() {\n return [this]\n }\n\n _asFirstCondition() {\n delete this.coordinator\n }\n\n asFirstCondition() {\n throw Error(\n 'Implement on the subclass (Why do we have to have this method here at all?!)'\n )\n }\n\n clone() {\n throw Error(\n 'Implement on the subclass (Why do we have to have this method here at all?!)'\n )\n }\n\n conditionString() {\n throw Error(\n 'Implement on the subclass (Why do we have to have this method here at all?!)'\n )\n }\n\n conditionExpression() {\n throw Error(\n 'Implement on the subclass (Why do we have to have this method here at all?!)'\n )\n }\n}\n\nexport class Condition extends AbstractCondition {\n field\n operator\n value\n\n constructor(field, operator, value, coordinator) {\n super(coordinator)\n if (!(field instanceof Field)) {\n throw Error(`field ${field} is not a valid Field object`)\n }\n if (typeof operator !== 'string') {\n throw Error(`operator ${operator} is not a valid operator`)\n }\n if (!(value instanceof AbstractConditionValue)) {\n throw Error(`value ${value} is not a valid value type`)\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 Field.from(this.field),\n this.operator,\n this.value.clone(),\n this.coordinator\n )\n }\n}\n\nexport class ConditionRef extends AbstractCondition {\n conditionName\n conditionDisplayName\n\n constructor(conditionName, conditionDisplayName, coordinator) {\n super(coordinator)\n if (typeof conditionName !== 'string') {\n throw Error(`condition name ${conditionName} is not valid`)\n }\n if (typeof conditionDisplayName !== 'string') {\n throw Error(`condition display name ${conditionDisplayName} is not valid`)\n }\n this.conditionName = conditionName\n this.conditionDisplayName = conditionDisplayName\n }\n\n asFirstCondition() {\n this._asFirstCondition()\n return this\n }\n\n conditionString() {\n return `'${this.conditionDisplayName}'`\n }\n\n conditionExpression() {\n return this.conditionName\n }\n\n clone() {\n return new ConditionRef(\n this.conditionName,\n this.conditionDisplayName,\n this.coordinator\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOO,MAAMA,YAAY,GAAAC,QAAA,CAAAD,YAAA,GAAG;IAC1BE,GAAG,EAAE,KAAK;IACVC,EAAE,EAAE;EACN,CAAC;EAAA,IAAAC,kBAAA,oBAAAC,OAAA;EAAA,IAAAC,sBAAA,oBAAAD,OAAA;EAAA,IAAAE,cAAA,oBAAAF,OAAA;EAEM,MAAMG,eAAe,CAAC;IAK3BC,WAAWA,CAAA,EAAG;MAAAC,0BAAA,OAAAN,kBAAA;MAAAM,0BAAA,OAAAJ,sBAAA;MAAAI,0BAAA,OAAAH,cAAA;MACZI,qBAAA,CAAAP,kBAAA,MAAI,EAAsB,EAAE;MAC5BO,qBAAA,CAAAL,sBAAA,MAAI,EAA0B,EAAE;IAClC;IAEAM,KAAKA,CAAA,EAAG;MACN,MAAMC,QAAQ,GAAG,IAAIL,eAAe,CAAC,CAAC;MACtCG,qBAAA,CAAAP,kBAAA,EAAAS,QAAQ,EAAsBC,qBAAA,CAAAV,kBAAA,MAAI,EAAoBW,GAAG,CAAEC,EAAE,IAC3DA,EAAE,CAACJ,KAAK,CAAC,CACX,CAAC;MACDD,qBAAA,CAAAL,sBAAA,EAAAO,QAAQ,EAA0BC,qBAAA,CAAAR,sBAAA,MAA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aAAa,EAClB,IAAI,CAACE,oBAAoB,EACzB,IAAI,CAACC,WACP,CAAC;IACH;EACF;EAACpF,QAAA,CAAAkF,YAAA,GAAAA,YAAA;AAAA"}
@@ -1,132 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "./inline-condition-values"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("./inline-condition-values"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.inlineConditionValues);
11
- global.inlineConditionOperators = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _inlineConditionValues) {
14
- "use strict";
15
-
16
- _exports.__esModule = true;
17
- _exports.customOperators = _exports.absoluteDateOrTimeOperatorNames = void 0;
18
- _exports.getExpression = getExpression;
19
- _exports.getOperatorConfig = getOperatorConfig;
20
- _exports.getOperatorNames = getOperatorNames;
21
- _exports.relativeDateOrTimeOperatorNames = void 0;
22
- const defaultOperators = {
23
- is: inline('=='),
24
- 'is not': inline('!=')
25
- };
26
- function withDefaults(param) {
27
- return Object.assign({}, param, defaultOperators);
28
- }
29
- const textBasedFieldCustomisations = {
30
- 'is longer than': lengthIs('>'),
31
- 'is shorter than': lengthIs('<'),
32
- 'has length': lengthIs('==')
33
- };
34
- const absoluteDateTimeOperators = {
35
- is: absoluteDateTime('=='),
36
- 'is not': absoluteDateTime('!='),
37
- 'is before': absoluteDateTime('<'),
38
- 'is after': absoluteDateTime('>')
39
- };
40
- const relativeTimeOperators = units => ({
41
- 'is at least': relativeTime('<=', '>=', units),
42
- 'is at most': relativeTime('>=', '<=', units),
43
- 'is less than': relativeTime('>', '<', units),
44
- 'is more than': relativeTime('<', '>', units)
45
- });
46
- const customOperators = _exports.customOperators = {
47
- CheckboxesField: {
48
- contains: reverseInline('in'),
49
- 'does not contain': not(reverseInline('in'))
50
- },
51
- NumberField: withDefaults({
52
- 'is at least': inline('>='),
53
- 'is at most': inline('<='),
54
- 'is less than': inline('<'),
55
- 'is more than': inline('>')
56
- }),
57
- DateField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_inlineConditionValues.dateUnits)),
58
- TimeField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_inlineConditionValues.timeUnits)),
59
- DatePartsField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_inlineConditionValues.dateUnits)),
60
- DateTimeField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_inlineConditionValues.dateTimeUnits)),
61
- DateTimePartsField: Object.assign({}, absoluteDateTimeOperators, relativeTimeOperators(_inlineConditionValues.dateTimeUnits)),
62
- TextField: withDefaults(textBasedFieldCustomisations),
63
- MultilineTextField: withDefaults(textBasedFieldCustomisations),
64
- EmailAddressField: withDefaults(textBasedFieldCustomisations)
65
- };
66
- function getOperatorNames(fieldType) {
67
- return Object.keys(getConditionals(fieldType)).sort();
68
- }
69
- function getExpression(fieldType, fieldName, operator, value) {
70
- return getConditionals(fieldType)[operator].expression({
71
- type: fieldType,
72
- name: fieldName
73
- }, value);
74
- }
75
- function getOperatorConfig(fieldType, operator) {
76
- return getConditionals(fieldType)[operator];
77
- }
78
- function getConditionals(fieldType) {
79
- return customOperators[fieldType] || defaultOperators;
80
- }
81
- function inline(operator) {
82
- return {
83
- expression: (field, value) => `${field.name} ${operator} ${formatValue(field.type, value.value)}`
84
- };
85
- }
86
- function lengthIs(operator) {
87
- return {
88
- expression: (field, value) => `length(${field.name}) ${operator} ${value.value}`
89
- };
90
- }
91
- function reverseInline(operator) {
92
- return {
93
- expression: (field, value) => `${formatValue(field.type, value.value)} ${operator} ${field.name}`
94
- };
95
- }
96
- function not(operatorDefinition) {
97
- return {
98
- expression: (field, value) => `not (${operatorDefinition.expression(field, value)})`
99
- };
100
- }
101
- function formatValue(fieldType, value) {
102
- if (fieldType === 'NumberField' || fieldType === 'YesNoField') {
103
- return value;
104
- }
105
- return `'${value}'`;
106
- }
107
- const absoluteDateOrTimeOperatorNames = _exports.absoluteDateOrTimeOperatorNames = Object.keys(absoluteDateTimeOperators);
108
- const relativeDateOrTimeOperatorNames = _exports.relativeDateOrTimeOperatorNames = Object.keys(relativeTimeOperators(_inlineConditionValues.dateTimeUnits));
109
- function absoluteDateTime(operator) {
110
- return {
111
- expression: (field, value) => {
112
- if (value instanceof _inlineConditionValues.ConditionValue) {
113
- return `${field.name} ${operator} '${value.toExpression()}'`;
114
- }
115
- throw Error('only Value types are supported');
116
- }
117
- };
118
- }
119
- function relativeTime(pastOperator, futureOperator, units) {
120
- return {
121
- units,
122
- expression: (field, value) => {
123
- if (value instanceof _inlineConditionValues.RelativeTimeValue) {
124
- const operator = value.direction === _inlineConditionValues.dateDirections.PAST ? pastOperator : futureOperator;
125
- return `${field.name} ${operator} ${value.toExpression()}`;
126
- }
127
- throw Error('time shift requires a TimeShiftValue');
128
- }
129
- };
130
- }
131
- });
132
- //# sourceMappingURL=inline-condition-operators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-condition-operators.js","names":["defaultOperators","is","inline","withDefaults","param","Object","assign","textBasedFieldCustomisations","lengthIs","absoluteDateTimeOperators","absoluteDateTime","relativeTimeOperators","units","relativeTime","customOperators","_exports","CheckboxesField","contains","reverseInline","not","NumberField","DateField","dateUnits","TimeField","timeUnits","DatePartsField","DateTimeField","dateTimeUnits","DateTimePartsField","TextField","MultilineTextField","EmailAddressField","getOperatorNames","fieldType","keys","getConditionals","sort","getExpression","fieldName","operator","value","expression","type","name","getOperatorConfig","field","formatValue","operatorDefinition","absoluteDateOrTimeOperatorNames","relativeDateOrTimeOperatorNames","ConditionValue","toExpression","Error","pastOperator","futureOperator","RelativeTimeValue","direction","dateDirections","PAST"],"sources":["../../../src/conditions/inline-condition-operators.ts"],"sourcesContent":["import {\n ConditionValue,\n dateDirections,\n dateTimeUnits,\n dateUnits,\n RelativeTimeValue,\n timeUnits\n} from '~/src/conditions/inline-condition-values'\n\nconst defaultOperators = {\n is: inline('=='),\n 'is not': inline('!=')\n}\n\nfunction withDefaults(param) {\n return Object.assign({}, param, defaultOperators)\n}\n\nconst textBasedFieldCustomisations = {\n 'is longer than': lengthIs('>'),\n 'is shorter than': lengthIs('<'),\n 'has length': lengthIs('==')\n}\n\nconst absoluteDateTimeOperators = {\n is: absoluteDateTime('=='),\n 'is not': absoluteDateTime('!='),\n 'is before': absoluteDateTime('<'),\n 'is after': absoluteDateTime('>')\n}\n\nconst relativeTimeOperators = (units) => ({\n 'is at least': relativeTime('<=', '>=', units),\n 'is at most': relativeTime('>=', '<=', units),\n 'is less than': relativeTime('>', '<', units),\n 'is more than': relativeTime('<', '>', units)\n})\n\nexport const customOperators = {\n CheckboxesField: {\n contains: reverseInline('in'),\n 'does not contain': not(reverseInline('in'))\n },\n NumberField: withDefaults({\n 'is at least': inline('>='),\n 'is at most': inline('<='),\n 'is less than': inline('<'),\n 'is more than': inline('>')\n }),\n DateField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n TimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(timeUnits)\n ),\n DatePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateUnits)\n ),\n DateTimeField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n DateTimePartsField: Object.assign(\n {},\n absoluteDateTimeOperators,\n relativeTimeOperators(dateTimeUnits)\n ),\n TextField: withDefaults(textBasedFieldCustomisations),\n MultilineTextField: withDefaults(textBasedFieldCustomisations),\n EmailAddressField: withDefaults(textBasedFieldCustomisations)\n}\n\nexport function getOperatorNames(fieldType) {\n return Object.keys(getConditionals(fieldType)).sort()\n}\n\nexport function getExpression(fieldType, fieldName, operator, value) {\n return getConditionals(fieldType)[operator].expression(\n { type: fieldType, name: fieldName },\n value\n )\n}\n\nexport function getOperatorConfig(fieldType, operator) {\n return getConditionals(fieldType)[operator]\n}\n\nfunction getConditionals(fieldType) {\n return customOperators[fieldType] || defaultOperators\n}\n\nfunction inline(operator) {\n return {\n expression: (field, value) =>\n `${field.name} ${operator} ${formatValue(field.type, value.value)}`\n }\n}\n\nfunction lengthIs(operator) {\n return {\n expression: (field, value) =>\n `length(${field.name}) ${operator} ${value.value}`\n }\n}\n\nfunction reverseInline(operator) {\n return {\n expression: (field, value) =>\n `${formatValue(field.type, value.value)} ${operator} ${field.name}`\n }\n}\n\nfunction not(operatorDefinition) {\n return {\n expression: (field, value) =>\n `not (${operatorDefinition.expression(field, value)})`\n }\n}\n\nfunction formatValue(fieldType, value) {\n if (fieldType === 'NumberField' || fieldType === 'YesNoField') {\n return value\n }\n return `'${value}'`\n}\n\nexport const absoluteDateOrTimeOperatorNames = Object.keys(\n absoluteDateTimeOperators\n)\nexport const relativeDateOrTimeOperatorNames = Object.keys(\n relativeTimeOperators(dateTimeUnits)\n)\n\nfunction absoluteDateTime(operator) {\n return {\n expression: (field, value) => {\n if (value instanceof ConditionValue) {\n return `${field.name} ${operator} '${value.toExpression()}'`\n }\n throw Error('only Value types are supported')\n }\n }\n}\n\nfunction relativeTime(pastOperator, futureOperator, units) {\n return {\n units,\n expression: (field, value) => {\n if (value instanceof RelativeTimeValue) {\n const operator =\n value.direction === dateDirections.PAST\n ? pastOperator\n : futureOperator\n return `${field.name} ${operator} ${value.toExpression()}`\n }\n throw Error('time shift requires a TimeShiftValue')\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EASA,MAAMA,gBAAgB,GAAG;IACvBC,EAAE,EAAEC,MAAM,CAAC,IAAI,CAAC;IAChB,QAAQ,EAAEA,MAAM,CAAC,IAAI;EACvB,CAAC;EAED,SAASC,YAAYA,CAACC,KAAK,EAAE;IAC3B,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEF,KAAK,EAAEJ,gBAAgB,CAAC;EACnD;EAEA,MAAMO,4BAA4B,GAAG;IACnC,gBAAgB,EAAEC,QAAQ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