@bgroup/wise-form 1.0.2 → 1.0.5

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 (269) hide show
  1. package/README.md +1 -1
  2. package/package.json +23 -4
  3. package/postcss.config.js +6 -0
  4. package/src/form/styles.css +11 -37
  5. package/src/form/view/components/containers/index.tsx +33 -4
  6. package/src/form/view/components/error.tsx +0 -3
  7. package/src/form/view/components/field/container.tsx +1 -1
  8. package/src/form/view/components/field/index.tsx +42 -7
  9. package/src/form/view/components/rows/row-container.tsx +37 -9
  10. package/src/form/view/components/rows/wrapper.tsx +17 -6
  11. package/src/form/view/components/wrapped-form.tsx +38 -5
  12. package/src/form/view/hooks/use-model.ts +91 -25
  13. package/src/form/view/index.tsx +15 -3
  14. package/src/models/field.ts +504 -458
  15. package/tailwind.config.js +11 -0
  16. package/tsconfig.json +2 -0
  17. package/vite.config.ts +59 -0
  18. package/dist/components/ui/Checkbox.d.ts +0 -14
  19. package/dist/components/ui/Checkbox.d.ts.map +0 -1
  20. package/dist/components/ui/Checkbox.js +0 -43
  21. package/dist/components/ui/Checkbox.js.map +0 -1
  22. package/dist/components/ui/CheckboxGroup.d.ts +0 -15
  23. package/dist/components/ui/CheckboxGroup.d.ts.map +0 -1
  24. package/dist/components/ui/CheckboxGroup.js +0 -33
  25. package/dist/components/ui/CheckboxGroup.js.map +0 -1
  26. package/dist/components/ui/Input.d.ts +0 -14
  27. package/dist/components/ui/Input.d.ts.map +0 -1
  28. package/dist/components/ui/Input.js +0 -49
  29. package/dist/components/ui/Input.js.map +0 -1
  30. package/dist/components/ui/Radio.d.ts +0 -14
  31. package/dist/components/ui/Radio.d.ts.map +0 -1
  32. package/dist/components/ui/Radio.js +0 -43
  33. package/dist/components/ui/Radio.js.map +0 -1
  34. package/dist/components/ui/Select.d.ts +0 -18
  35. package/dist/components/ui/Select.d.ts.map +0 -1
  36. package/dist/components/ui/Select.js +0 -44
  37. package/dist/components/ui/Select.js.map +0 -1
  38. package/dist/components/ui/Textarea.d.ts +0 -13
  39. package/dist/components/ui/Textarea.d.ts.map +0 -1
  40. package/dist/components/ui/Textarea.js +0 -42
  41. package/dist/components/ui/Textarea.js.map +0 -1
  42. package/dist/components/ui/index.d.ts +0 -13
  43. package/dist/components/ui/index.d.ts.map +0 -1
  44. package/dist/components/ui/index.js +0 -7
  45. package/dist/components/ui/index.js.map +0 -1
  46. package/dist/form/index.d.ts +0 -10
  47. package/dist/form/index.d.ts.map +0 -1
  48. package/dist/form/index.js +0 -5
  49. package/dist/form/index.js.map +0 -1
  50. package/dist/form/interfaces/field-container.d.ts +0 -8
  51. package/dist/form/interfaces/field-container.d.ts.map +0 -1
  52. package/dist/form/interfaces/field-container.js +0 -2
  53. package/dist/form/interfaces/field-container.js.map +0 -1
  54. package/dist/form/interfaces/interfaces.d.ts +0 -8
  55. package/dist/form/interfaces/interfaces.d.ts.map +0 -1
  56. package/dist/form/interfaces/interfaces.js +0 -2
  57. package/dist/form/interfaces/interfaces.js.map +0 -1
  58. package/dist/form/interfaces/settings.d.ts +0 -10
  59. package/dist/form/interfaces/settings.d.ts.map +0 -1
  60. package/dist/form/interfaces/settings.js +0 -2
  61. package/dist/form/interfaces/settings.js.map +0 -1
  62. package/dist/form/interfaces/template.d.ts +0 -6
  63. package/dist/form/interfaces/template.d.ts.map +0 -1
  64. package/dist/form/interfaces/template.js +0 -2
  65. package/dist/form/interfaces/template.js.map +0 -1
  66. package/dist/form/interfaces/wise-form-specs.d.ts +0 -9
  67. package/dist/form/interfaces/wise-form-specs.d.ts.map +0 -1
  68. package/dist/form/interfaces/wise-form-specs.js +0 -2
  69. package/dist/form/interfaces/wise-form-specs.js.map +0 -1
  70. package/dist/form/view/components/containers/index.d.ts +0 -3
  71. package/dist/form/view/components/containers/index.d.ts.map +0 -1
  72. package/dist/form/view/components/containers/index.js +0 -12
  73. package/dist/form/view/components/containers/index.js.map +0 -1
  74. package/dist/form/view/components/error.d.ts +0 -5
  75. package/dist/form/view/components/error.d.ts.map +0 -1
  76. package/dist/form/view/components/error.js +0 -8
  77. package/dist/form/view/components/error.js.map +0 -1
  78. package/dist/form/view/components/field/container.d.ts +0 -5
  79. package/dist/form/view/components/field/container.d.ts.map +0 -1
  80. package/dist/form/view/components/field/container.js +0 -5
  81. package/dist/form/view/components/field/container.js.map +0 -1
  82. package/dist/form/view/components/field/index.d.ts +0 -18
  83. package/dist/form/view/components/field/index.d.ts.map +0 -1
  84. package/dist/form/view/components/field/index.js +0 -89
  85. package/dist/form/view/components/field/index.js.map +0 -1
  86. package/dist/form/view/components/field/selection.d.ts +0 -2
  87. package/dist/form/view/components/field/selection.d.ts.map +0 -1
  88. package/dist/form/view/components/field/selection.js +0 -35
  89. package/dist/form/view/components/field/selection.js.map +0 -1
  90. package/dist/form/view/components/field/use-field.d.ts +0 -4
  91. package/dist/form/view/components/field/use-field.d.ts.map +0 -1
  92. package/dist/form/view/components/field/use-field.js +0 -41
  93. package/dist/form/view/components/field/use-field.js.map +0 -1
  94. package/dist/form/view/components/rows/row-container.d.ts +0 -18
  95. package/dist/form/view/components/rows/row-container.d.ts.map +0 -1
  96. package/dist/form/view/components/rows/row-container.js +0 -89
  97. package/dist/form/view/components/rows/row-container.js.map +0 -1
  98. package/dist/form/view/components/rows/wrapper.d.ts +0 -12
  99. package/dist/form/view/components/rows/wrapper.d.ts.map +0 -1
  100. package/dist/form/view/components/rows/wrapper.js +0 -27
  101. package/dist/form/view/components/rows/wrapper.js.map +0 -1
  102. package/dist/form/view/components/wrapped-form.d.ts +0 -6
  103. package/dist/form/view/components/wrapped-form.d.ts.map +0 -1
  104. package/dist/form/view/components/wrapped-form.js +0 -26
  105. package/dist/form/view/components/wrapped-form.js.map +0 -1
  106. package/dist/form/view/context.d.ts +0 -23
  107. package/dist/form/view/context.d.ts.map +0 -1
  108. package/dist/form/view/context.js +0 -7
  109. package/dist/form/view/context.js.map +0 -1
  110. package/dist/form/view/hooks/use-model.d.ts +0 -10
  111. package/dist/form/view/hooks/use-model.d.ts.map +0 -1
  112. package/dist/form/view/hooks/use-model.js +0 -31
  113. package/dist/form/view/hooks/use-model.js.map +0 -1
  114. package/dist/form/view/hooks/use-template.d.ts +0 -14
  115. package/dist/form/view/hooks/use-template.d.ts.map +0 -1
  116. package/dist/form/view/hooks/use-template.js +0 -57
  117. package/dist/form/view/hooks/use-template.js.map +0 -1
  118. package/dist/form/view/hooks/use-types.d.ts +0 -2
  119. package/dist/form/view/hooks/use-types.d.ts.map +0 -1
  120. package/dist/form/view/hooks/use-types.js +0 -19
  121. package/dist/form/view/hooks/use-types.js.map +0 -1
  122. package/dist/form/view/index.d.ts +0 -3
  123. package/dist/form/view/index.d.ts.map +0 -1
  124. package/dist/form/view/index.js +0 -38
  125. package/dist/form/view/index.js.map +0 -1
  126. package/dist/formulas/helpers/condition-types.d.ts +0 -5
  127. package/dist/formulas/helpers/condition-types.d.ts.map +0 -1
  128. package/dist/formulas/helpers/condition-types.js +0 -5
  129. package/dist/formulas/helpers/condition-types.js.map +0 -1
  130. package/dist/formulas/helpers/evaluations.d.ts +0 -15
  131. package/dist/formulas/helpers/evaluations.d.ts.map +0 -1
  132. package/dist/formulas/helpers/evaluations.js +0 -44
  133. package/dist/formulas/helpers/evaluations.js.map +0 -1
  134. package/dist/formulas/helpers/formula.d.ts +0 -6
  135. package/dist/formulas/helpers/formula.d.ts.map +0 -1
  136. package/dist/formulas/helpers/formula.js +0 -26
  137. package/dist/formulas/helpers/formula.js.map +0 -1
  138. package/dist/formulas/helpers/lexer.d.ts +0 -10
  139. package/dist/formulas/helpers/lexer.d.ts.map +0 -1
  140. package/dist/formulas/helpers/lexer.js +0 -73
  141. package/dist/formulas/helpers/lexer.js.map +0 -1
  142. package/dist/formulas/helpers/parser.d.ts +0 -24
  143. package/dist/formulas/helpers/parser.d.ts.map +0 -1
  144. package/dist/formulas/helpers/parser.js +0 -48
  145. package/dist/formulas/helpers/parser.js.map +0 -1
  146. package/dist/formulas/helpers/token.d.ts +0 -14
  147. package/dist/formulas/helpers/token.d.ts.map +0 -1
  148. package/dist/formulas/helpers/token.js +0 -14
  149. package/dist/formulas/helpers/token.js.map +0 -1
  150. package/dist/formulas/index.d.ts +0 -59
  151. package/dist/formulas/index.d.ts.map +0 -1
  152. package/dist/formulas/index.js +0 -186
  153. package/dist/formulas/index.js.map +0 -1
  154. package/dist/formulas/types/formulas.d.ts +0 -68
  155. package/dist/formulas/types/formulas.d.ts.map +0 -1
  156. package/dist/formulas/types/formulas.js +0 -2
  157. package/dist/formulas/types/formulas.js.map +0 -1
  158. package/dist/formulas/types/index.d.ts +0 -5
  159. package/dist/formulas/types/index.d.ts.map +0 -1
  160. package/dist/formulas/types/index.js +0 -2
  161. package/dist/formulas/types/index.js.map +0 -1
  162. package/dist/formulas/variants/array-formula.d.ts +0 -24
  163. package/dist/formulas/variants/array-formula.d.ts.map +0 -1
  164. package/dist/formulas/variants/array-formula.js +0 -142
  165. package/dist/formulas/variants/array-formula.js.map +0 -1
  166. package/dist/formulas/variants/base.d.ts +0 -6
  167. package/dist/formulas/variants/base.d.ts.map +0 -1
  168. package/dist/formulas/variants/base.js +0 -3
  169. package/dist/formulas/variants/base.js.map +0 -1
  170. package/dist/formulas/variants/basic.d.ts +0 -18
  171. package/dist/formulas/variants/basic.d.ts.map +0 -1
  172. package/dist/formulas/variants/basic.js +0 -128
  173. package/dist/formulas/variants/basic.js.map +0 -1
  174. package/dist/formulas/variants/comparison.d.ts +0 -25
  175. package/dist/formulas/variants/comparison.d.ts.map +0 -1
  176. package/dist/formulas/variants/comparison.js +0 -153
  177. package/dist/formulas/variants/comparison.js.map +0 -1
  178. package/dist/formulas/variants/conditional.d.ts +0 -18
  179. package/dist/formulas/variants/conditional.d.ts.map +0 -1
  180. package/dist/formulas/variants/conditional.js +0 -183
  181. package/dist/formulas/variants/conditional.js.map +0 -1
  182. package/dist/formulas/variants/iterative-array.d.ts +0 -20
  183. package/dist/formulas/variants/iterative-array.d.ts.map +0 -1
  184. package/dist/formulas/variants/iterative-array.js +0 -155
  185. package/dist/formulas/variants/iterative-array.js.map +0 -1
  186. package/dist/formulas/variants/per-value.d.ts +0 -20
  187. package/dist/formulas/variants/per-value.d.ts.map +0 -1
  188. package/dist/formulas/variants/per-value.js +0 -154
  189. package/dist/formulas/variants/per-value.js.map +0 -1
  190. package/dist/index.d.ts +0 -5
  191. package/dist/index.d.ts.map +0 -1
  192. package/dist/index.js +0 -6
  193. package/dist/index.js.map +0 -1
  194. package/dist/models/base.d.ts +0 -55
  195. package/dist/models/base.d.ts.map +0 -1
  196. package/dist/models/base.js +0 -146
  197. package/dist/models/base.js.map +0 -1
  198. package/dist/models/callback-manager.d.ts +0 -7
  199. package/dist/models/callback-manager.d.ts.map +0 -1
  200. package/dist/models/callback-manager.js +0 -89
  201. package/dist/models/callback-manager.js.map +0 -1
  202. package/dist/models/field.d.ts +0 -121
  203. package/dist/models/field.d.ts.map +0 -1
  204. package/dist/models/field.js +0 -443
  205. package/dist/models/field.js.map +0 -1
  206. package/dist/models/index.d.ts +0 -13
  207. package/dist/models/index.d.ts.map +0 -1
  208. package/dist/models/index.js +0 -7
  209. package/dist/models/index.js.map +0 -1
  210. package/dist/models/model.d.ts +0 -37
  211. package/dist/models/model.d.ts.map +0 -1
  212. package/dist/models/model.js +0 -245
  213. package/dist/models/model.js.map +0 -1
  214. package/dist/models/plugins/base.d.ts +0 -9
  215. package/dist/models/plugins/base.d.ts.map +0 -1
  216. package/dist/models/plugins/base.js +0 -3
  217. package/dist/models/plugins/base.js.map +0 -1
  218. package/dist/models/plugins/formula.d.ts +0 -18
  219. package/dist/models/plugins/formula.d.ts.map +0 -1
  220. package/dist/models/plugins/formula.js +0 -82
  221. package/dist/models/plugins/formula.js.map +0 -1
  222. package/dist/models/plugins/index.d.ts +0 -11
  223. package/dist/models/plugins/index.d.ts.map +0 -1
  224. package/dist/models/plugins/index.js +0 -52
  225. package/dist/models/plugins/index.js.map +0 -1
  226. package/dist/models/plugins/plugins.d.ts +0 -7
  227. package/dist/models/plugins/plugins.d.ts.map +0 -1
  228. package/dist/models/plugins/plugins.js +0 -7
  229. package/dist/models/plugins/plugins.js.map +0 -1
  230. package/dist/models/types/base-wise-model.d.ts +0 -7
  231. package/dist/models/types/base-wise-model.d.ts.map +0 -1
  232. package/dist/models/types/base-wise-model.js +0 -2
  233. package/dist/models/types/base-wise-model.js.map +0 -1
  234. package/dist/models/types/callbacks.d.ts +0 -19
  235. package/dist/models/types/callbacks.d.ts.map +0 -1
  236. package/dist/models/types/callbacks.js +0 -2
  237. package/dist/models/types/callbacks.js.map +0 -1
  238. package/dist/models/types/disabled.d.ts +0 -8
  239. package/dist/models/types/disabled.d.ts.map +0 -1
  240. package/dist/models/types/disabled.js +0 -2
  241. package/dist/models/types/disabled.js.map +0 -1
  242. package/dist/models/types/form-field.d.ts +0 -25
  243. package/dist/models/types/form-field.d.ts.map +0 -1
  244. package/dist/models/types/form-field.js +0 -2
  245. package/dist/models/types/form-field.js.map +0 -1
  246. package/dist/models/types/model.d.ts +0 -13
  247. package/dist/models/types/model.d.ts.map +0 -1
  248. package/dist/models/types/model.js +0 -2
  249. package/dist/models/types/model.js.map +0 -1
  250. package/dist/models/types/plugins.d.ts +0 -13
  251. package/dist/models/types/plugins.d.ts.map +0 -1
  252. package/dist/models/types/plugins.js +0 -2
  253. package/dist/models/types/plugins.js.map +0 -1
  254. package/dist/models/types/wrapped-form-model-props.d.ts +0 -11
  255. package/dist/models/types/wrapped-form-model-props.d.ts.map +0 -1
  256. package/dist/models/types/wrapped-form-model-props.js +0 -2
  257. package/dist/models/types/wrapped-form-model-props.js.map +0 -1
  258. package/dist/models/wrapper.d.ts +0 -30
  259. package/dist/models/wrapper.d.ts.map +0 -1
  260. package/dist/models/wrapper.js +0 -213
  261. package/dist/models/wrapper.js.map +0 -1
  262. package/dist/settings/index.d.ts +0 -7
  263. package/dist/settings/index.d.ts.map +0 -1
  264. package/dist/settings/index.js +0 -26
  265. package/dist/settings/index.js.map +0 -1
  266. package/dist/utils/pending-promise.d.ts +0 -6
  267. package/dist/utils/pending-promise.d.ts.map +0 -1
  268. package/dist/utils/pending-promise.js +0 -24
  269. package/dist/utils/pending-promise.js.map +0 -1
@@ -1,59 +0,0 @@
1
- import { ReactiveModel } from '@beyond-js/reactive/model';
2
- import { Parser } from './helpers/parser';
3
- import { Token } from './helpers/token';
4
- import { IComplexCondition, FormulaFields } from './types/formulas';
5
- type ParserData = {
6
- parser: Parser;
7
- tokens: Token[];
8
- [key: string]: any;
9
- };
10
- export declare class FormulaManager extends ReactiveModel<FormulaManager> {
11
- #private;
12
- get tokens(): Token[];
13
- get parser(): Parser;
14
- get formula(): string | IComplexCondition;
15
- get name(): string;
16
- get conditional(): boolean;
17
- get conditions(): import("./types/formulas").IConditionalField | import("./types/formulas").IConditionalField[];
18
- /**
19
- * Represents the fields defined in the plugin settings
20
- */
21
- get fields(): string[];
22
- get parsedBase(): any;
23
- get type(): string;
24
- get base(): string;
25
- get variables(): string[];
26
- get value(): any;
27
- constructor(plugin: any, specs: any);
28
- initialize(): void;
29
- /**
30
- * Returns the models that are part of the formula
31
- * The models could be fields or formulas
32
- * @param variables
33
- * @returns
34
- */
35
- getModels(variables: FormulaFields): any[];
36
- private getType;
37
- processConditional(): void;
38
- calculate(): void;
39
- /**
40
- * Returns the parser for the formula, if the parser is already created it will return the memoized parser
41
- *
42
- *
43
- * The formula is tokenized and parsed to create a parser instance
44
- * the object returned contains the tokens, the parser and the formula
45
- * @param data Receives the formula to be parsed
46
- * @returns
47
- */
48
- getParser(data: any): ParserData;
49
- getParams(variables: string[]): Promise<{}>;
50
- /**
51
- * A form can have multiple formulas, this method will create an instance of the formula manager
52
- * and memoize it to avoid creating multiple instances of the same formula.
53
- * @param specs
54
- * @returns
55
- */
56
- static create(plugin: any, specs: any): Promise<FormulaManager>;
57
- }
58
- export {};
59
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formulas/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAqD,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOvH,KAAK,UAAU,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB,CAAC;AACF,qBAAa,cAAe,SAAQ,aAAa,CAAC,cAAc,CAAC;;IAIhE,IAAI,MAAM,YAET;IAED,IAAI,MAAM,WAET;IAGD,IAAI,OAAO,+BAEV;IACD,IAAI,IAAI,WAEP;IAED,IAAI,WAAW,YAEd;IAED,IAAI,UAAU,kGAIb;IAED;;OAEG;IACH,IAAI,MAAM,aAGT;IAGD,IAAI,UAAU,QAEb;IAED,IAAI,IAAI,WAEP;IAED,IAAI,IAAI,WAGP;IAGD,IAAI,SAAS,aAEZ;IAED,IAAI,KAAK,QAER;gBAMW,MAAM,KAAA,EAAE,KAAK,KAAA;IA0BzB,UAAU;IAGV;;;;;OAKG;IACH,SAAS,CAAC,SAAS,EAAE,aAAa;IAQlC,OAAO,CAAC,OAAO;IAOf,kBAAkB;IAMlB,SAAS;IAST;;;;;;;;OAQG;IACH,SAAS,CAAC,IAAI,KAAA,GAAG,UAAU;IAWrB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE;IAkBnC;;;;;OAKG;WACU,MAAM,CAAC,MAAM,KAAA,EAAE,KAAK,KAAA;CAKjC"}
@@ -1,186 +0,0 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
- if (kind === "m") throw new TypeError("Private method is not writable");
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
- };
12
- var _FormulaManager_instances, _FormulaManager_lexer, _FormulaManager_tokens, _FormulaManager_parser, _FormulaManager_specs, _FormulaManager_parsedBase, _FormulaManager_type, _FormulaManager_variables, _FormulaManager_parsers, _FormulaManager_plugin, _FormulaManager_instance, _FormulaManager_initialize;
13
- import { ReactiveModel } from '@beyond-js/reactive/model';
14
- import { Lexer } from './helpers/lexer';
15
- import { Parser } from './helpers/parser';
16
- import { FormulaBasic } from './variants/basic';
17
- import { FormulaConditional } from './variants/conditional';
18
- import { FormulaPerValue } from './variants/per-value';
19
- import { FormulaComparison } from './variants/comparison';
20
- import { FormulaArray } from './variants/array-formula';
21
- import { IterativeArrayFormula } from './variants/iterative-array';
22
- export class FormulaManager extends ReactiveModel {
23
- get tokens() {
24
- return __classPrivateFieldGet(this, _FormulaManager_tokens, "f");
25
- }
26
- get parser() {
27
- return __classPrivateFieldGet(this, _FormulaManager_parser, "f");
28
- }
29
- get formula() {
30
- return __classPrivateFieldGet(this, _FormulaManager_specs, "f").formula;
31
- }
32
- get name() {
33
- return __classPrivateFieldGet(this, _FormulaManager_specs, "f").name;
34
- }
35
- get conditional() {
36
- return typeof __classPrivateFieldGet(this, _FormulaManager_specs, "f").formula === 'object';
37
- }
38
- get conditions() {
39
- if (typeof __classPrivateFieldGet(this, _FormulaManager_specs, "f").formula === 'string')
40
- return;
41
- const formula = __classPrivateFieldGet(this, _FormulaManager_specs, "f").formula;
42
- return formula.conditions;
43
- }
44
- /**
45
- * Represents the fields defined in the plugin settings
46
- */
47
- get fields() {
48
- const formula = this.formula;
49
- return typeof formula?.fields === 'string' ? [formula?.fields] : formula?.fields;
50
- }
51
- get parsedBase() {
52
- return __classPrivateFieldGet(this, _FormulaManager_parsedBase, "f");
53
- }
54
- get type() {
55
- return __classPrivateFieldGet(this, _FormulaManager_type, "f");
56
- }
57
- get base() {
58
- const formula = __classPrivateFieldGet(this, _FormulaManager_specs, "f").formula;
59
- return formula.base;
60
- }
61
- get variables() {
62
- return __classPrivateFieldGet(this, _FormulaManager_variables, "f");
63
- }
64
- get value() {
65
- return __classPrivateFieldGet(this, _FormulaManager_instance, "f").value;
66
- }
67
- constructor(plugin, specs) {
68
- super();
69
- _FormulaManager_instances.add(this);
70
- _FormulaManager_lexer.set(this, new Lexer(true));
71
- _FormulaManager_tokens.set(this, void 0);
72
- _FormulaManager_parser.set(this, void 0);
73
- _FormulaManager_specs.set(this, void 0);
74
- _FormulaManager_parsedBase.set(this, void 0);
75
- _FormulaManager_type.set(this, void 0);
76
- _FormulaManager_variables.set(this, []);
77
- _FormulaManager_parsers.set(this, new Map());
78
- _FormulaManager_plugin.set(this, void 0);
79
- _FormulaManager_instance.set(this, void 0);
80
- __classPrivateFieldSet(this, _FormulaManager_plugin, plugin, "f");
81
- __classPrivateFieldSet(this, _FormulaManager_specs, specs, "f");
82
- __classPrivateFieldGet(this, _FormulaManager_instances, "m", _FormulaManager_initialize).call(this);
83
- }
84
- initialize() {
85
- __classPrivateFieldGet(this, _FormulaManager_instance, "f").initialize();
86
- }
87
- /**
88
- * Returns the models that are part of the formula
89
- * The models could be fields or formulas
90
- * @param variables
91
- * @returns
92
- */
93
- getModels(variables) {
94
- const varsArray = Array.isArray(variables) ? variables : [variables];
95
- return varsArray.map(name => {
96
- if (__classPrivateFieldGet(this, _FormulaManager_plugin, "f").formulas.has(name))
97
- return __classPrivateFieldGet(this, _FormulaManager_plugin, "f").formulas.get(name);
98
- return __classPrivateFieldGet(this, _FormulaManager_plugin, "f").form.getField(name);
99
- });
100
- }
101
- getType() {
102
- const { type, formula } = __classPrivateFieldGet(this, _FormulaManager_specs, "f");
103
- if (type)
104
- return type;
105
- if (typeof formula === 'string')
106
- return 'basic';
107
- if (formula.conditions)
108
- return formula.base ? 'base-conditional' : 'value-conditions';
109
- }
110
- processConditional() {
111
- const formula = this.formula;
112
- if (this.base) {
113
- __classPrivateFieldSet(this, _FormulaManager_parsedBase, this.getParser({ formula: this.base }), "f");
114
- }
115
- }
116
- calculate() {
117
- if (!__classPrivateFieldGet(this, _FormulaManager_instance, "f") || __classPrivateFieldGet(this, _FormulaManager_instance, "f").calculate) {
118
- }
119
- __classPrivateFieldGet(this, _FormulaManager_instance, "f").calculate();
120
- this.trigger('change');
121
- return;
122
- }
123
- /**
124
- * Returns the parser for the formula, if the parser is already created it will return the memoized parser
125
- *
126
- *
127
- * The formula is tokenized and parsed to create a parser instance
128
- * the object returned contains the tokens, the parser and the formula
129
- * @param data Receives the formula to be parsed
130
- * @returns
131
- */
132
- getParser(data) {
133
- if (!data.formula)
134
- throw new Error('To get a parser you must provide a formula');
135
- if (__classPrivateFieldGet(this, _FormulaManager_parsers, "f").has(data.formula))
136
- return __classPrivateFieldGet(this, _FormulaManager_parsers, "f").get(data.formula);
137
- const tokens = __classPrivateFieldGet(this, _FormulaManager_lexer, "f").tokenize(data.formula);
138
- const parser = new Parser(tokens);
139
- const result = { tokens, parser, ...data };
140
- __classPrivateFieldGet(this, _FormulaManager_parsers, "f").set(data.formula, result);
141
- return result;
142
- }
143
- async getParams(variables) {
144
- const params = {};
145
- const { form, formulas } = __classPrivateFieldGet(this, _FormulaManager_plugin, "f");
146
- const build = async (value) => {
147
- /**
148
- * the value could be a formula or a field
149
- */
150
- const element = formulas.has(value) ? formulas.get(value) : form.getField(value);
151
- if (!element)
152
- throw new Error(`Field ${value} used in formula ${this.name}, not found in form ${form.name}, `);
153
- await element.isReady;
154
- params[value] = [undefined, '', null, NaN].includes(element.value) ? 0 : element.value;
155
- };
156
- variables.forEach(build);
157
- return params;
158
- }
159
- /**
160
- * A form can have multiple formulas, this method will create an instance of the formula manager
161
- * and memoize it to avoid creating multiple instances of the same formula.
162
- * @param specs
163
- * @returns
164
- */
165
- static async create(plugin, specs) {
166
- const instance = new FormulaManager(plugin, specs);
167
- // FormulaManager.instances.set(plugin.form.name, instance);
168
- return instance;
169
- }
170
- }
171
- _FormulaManager_lexer = new WeakMap(), _FormulaManager_tokens = new WeakMap(), _FormulaManager_parser = new WeakMap(), _FormulaManager_specs = new WeakMap(), _FormulaManager_parsedBase = new WeakMap(), _FormulaManager_type = new WeakMap(), _FormulaManager_variables = new WeakMap(), _FormulaManager_parsers = new WeakMap(), _FormulaManager_plugin = new WeakMap(), _FormulaManager_instance = new WeakMap(), _FormulaManager_instances = new WeakSet(), _FormulaManager_initialize = function _FormulaManager_initialize() {
172
- __classPrivateFieldSet(this, _FormulaManager_type, this.getType(), "f");
173
- const objects = {
174
- basic: FormulaBasic,
175
- 'base-conditional': FormulaConditional,
176
- 'value-conditions': FormulaPerValue,
177
- comparison: FormulaComparison,
178
- array: FormulaArray,
179
- 'iterative-array': IterativeArrayFormula,
180
- };
181
- if (!objects[this.type]) {
182
- throw new Error(`this type ${this.type} not found`);
183
- }
184
- __classPrivateFieldSet(this, _FormulaManager_instance, new objects[this.type](this, __classPrivateFieldGet(this, _FormulaManager_plugin, "f"), __classPrivateFieldGet(this, _FormulaManager_specs, "f")), "f");
185
- };
186
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formulas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,k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AAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK;QAChC,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACnD,4DAA4D;QAC5D,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;;IA1GC,uBAAA,IAAI,wBAAS,IAAI,CAAC,OAAO,EAAE,MAAA,CAAC;IAE5B,MAAM,OAAO,GAAG;QACf,KAAK,EAAE,YAAY;QACnB,kBAAkB,EAAE,kBAAkB;QACtC,kBAAkB,EAAE,eAAe;QACnC,UAAU,EAAE,iBAAiB;QAC7B,KAAK,EAAE,YAAY;QACnB,iBAAiB,EAAE,qBAAqB;KACxC,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,CAAC,IAAI,YAAY,CAAC,CAAC;IACrD,CAAC;IAED,uBAAA,IAAI,4BAAa,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,uBAAA,IAAI,8BAAQ,EAAE,uBAAA,IAAI,6BAAO,CAAC,MAAA,CAAC;AAC1E,CAAC"}
@@ -1,68 +0,0 @@
1
- import type { Parser } from "../helpers/parser";
2
- import type { Token } from "../helpers/token";
3
- export interface ISimpleFormula {
4
- name: string;
5
- formula: string;
6
- type?: FormulaType;
7
- emptyValue?: string | number;
8
- fields?: FormulaFields;
9
- propertyValue?: string;
10
- propertyToSet?: string;
11
- formulas?: any[];
12
- arrayFieldProperty?: string;
13
- arrayFieldName?: string;
14
- }
15
- export interface IFormulaCondition {
16
- condition: "hasValue" | "upper" | "lower" | "equal" | "different" | "between" | "lessOrEqual" | "greaterOrEqual";
17
- value?: string | number | [number, number];
18
- formula: string;
19
- conditions?: IConditionalField[];
20
- fields?: string[];
21
- }
22
- export type FormulaFields = string | string[];
23
- export type EvaluatedFormula = {
24
- value?: string | number;
25
- formula: string;
26
- condition?: string;
27
- };
28
- export interface IConditionalFormula {
29
- }
30
- export interface IConditionalField {
31
- field?: string | string[];
32
- condition?: string;
33
- values?: [EvaluatedFormula];
34
- conditions?: IFormulaCondition[];
35
- fields?: string[];
36
- formula?: string;
37
- type?: string;
38
- value: string | number;
39
- }
40
- export interface IComplexCondition {
41
- fields: FormulaFields;
42
- base?: string;
43
- conditions: IConditionalField | IConditionalField[];
44
- condition?: string;
45
- arrayFieldName?: string;
46
- arrayFieldProperty?: string;
47
- }
48
- export interface IConditionalFormula {
49
- name: string;
50
- type?: FormulaType;
51
- fields?: FormulaFields;
52
- formula: IComplexCondition | string;
53
- conditions?: IConditionalField[];
54
- emptyValue?: string | number;
55
- propertyValue?: string;
56
- propertyToSet?: string;
57
- formulas?: any[];
58
- arrayFieldName?: string;
59
- arrayFieldProperty?: string;
60
- }
61
- export type ParserData = {
62
- parser: Parser;
63
- tokens: Token[];
64
- [key: string]: any;
65
- };
66
- export type FormulaType = "basic" | "base-conditional" | "value-conditions" | "comparison" | "array" | "iterative-array" | undefined;
67
- export type FormulaObserver = ISimpleFormula | IConditionalFormula;
68
- //# sourceMappingURL=formulas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formulas.d.ts","sourceRoot":"","sources":["../../../src/formulas/types/formulas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,C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ACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;IACpC,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,YAAY,GAAG,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAErI,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,mBAAmB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=formulas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formulas.js","sourceRoot":"","sources":["../../../src/formulas/types/formulas.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- /**
2
- * Defines the type of token based on the part of the expression it represents.
3
- */
4
- export type TokenType = 'variable' | 'number' | 'operator' | 'parenthesis';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formulas/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formulas/types/index.ts"],"names":[],"mappings":""}
@@ -1,24 +0,0 @@
1
- import { IComplexCondition } from '../types/formulas';
2
- export declare class FormulaArray {
3
- #private;
4
- get formula(): string | IComplexCondition;
5
- get base(): string;
6
- get value(): any[];
7
- get name(): string;
8
- /**
9
- * Represents the fields defined in the plugin settings
10
- */
11
- get fields(): string[];
12
- get conditions(): import("../types/formulas").IConditionalField | import("../types/formulas").IConditionalField[];
13
- get variables(): string[];
14
- constructor(parent: any, plugin: any, specs: any);
15
- initialize(): void;
16
- evaluate: (data: {
17
- formulas: any[];
18
- values: any;
19
- }) => {};
20
- calculate(): Promise<void>;
21
- private sanitizeData;
22
- private sanitizeValue;
23
- }
24
- //# sourceMappingURL=array-formula.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-formula.d.ts","sourceRoot":"","sources":["../../../src/formulas/variants/array-formula.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGvE,qBAAa,YAAY;;IAGrB,IAAI,OAAO,+BAEV;IACD,IAAI,IAAI,WAGP;IAED,IAAI,KAAK,UAER;IACD,IAAI,IAAI,WAEP;IACD;;OAEG;IACH,IAAI,MAAM,aAGT;IAED,IAAI,UAAU,oGAIb;IAID,IAAI,SAAS,aAEZ;gBAQW,MAAM,KAAA,EAAE,MAAM,KAAA,EAAE,KAAK,KAAA;IAWjC,UAAU;IAIV,QAAQ,GAAI,MAAM;QAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;QAAC,MAAM,EAAE,GAAG,CAAA;KAAE,QAgChD;IAEI,SAAS;IAoBf,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,aAAa;CAGxB"}
@@ -1,142 +0,0 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
7
- if (kind === "m") throw new TypeError("Private method is not writable");
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
- };
12
- var _FormulaArray_plugin, _FormulaArray_specs, _FormulaArray_value, _FormulaArray_emptyValue, _FormulaArray_variables, _FormulaArray_round, _FormulaArray_ceil, _FormulaArray_parent, _FormulaArray_formulaField;
13
- import { EvaluationsManager } from '../helpers/evaluations';
14
- import { parse } from 'mathjs';
15
- export class FormulaArray {
16
- get formula() {
17
- return __classPrivateFieldGet(this, _FormulaArray_specs, "f").formula;
18
- }
19
- get base() {
20
- const formula = __classPrivateFieldGet(this, _FormulaArray_specs, "f").formula;
21
- return formula.base;
22
- }
23
- get value() {
24
- return __classPrivateFieldGet(this, _FormulaArray_value, "f");
25
- }
26
- get name() {
27
- return __classPrivateFieldGet(this, _FormulaArray_specs, "f").name;
28
- }
29
- /**
30
- * Represents the fields defined in the plugin settings
31
- */
32
- get fields() {
33
- const formula = this.formula;
34
- return typeof formula?.fields === 'string' ? [formula?.fields] : formula?.fields;
35
- }
36
- get conditions() {
37
- if (typeof __classPrivateFieldGet(this, _FormulaArray_specs, "f").formula === 'string')
38
- return;
39
- const formula = __classPrivateFieldGet(this, _FormulaArray_specs, "f").formula;
40
- return formula.conditions;
41
- }
42
- get variables() {
43
- return __classPrivateFieldGet(this, _FormulaArray_variables, "f");
44
- }
45
- constructor(parent, plugin, specs) {
46
- _FormulaArray_plugin.set(this, void 0);
47
- _FormulaArray_specs.set(this, void 0);
48
- _FormulaArray_value.set(this, []);
49
- _FormulaArray_emptyValue.set(this, void 0);
50
- _FormulaArray_variables.set(this, []);
51
- _FormulaArray_round.set(this, void 0);
52
- _FormulaArray_ceil.set(this, void 0);
53
- _FormulaArray_parent.set(this, void 0);
54
- _FormulaArray_formulaField.set(this, void 0);
55
- this.evaluate = (data) => {
56
- const values = {};
57
- for (const formula of data.formulas) {
58
- let result;
59
- let formulaEvaluate = formula.formula;
60
- try {
61
- if (formula.conditions) {
62
- for (const condition of formula.conditions) {
63
- const comparisonValue = { ...data.values, ...values }[condition.property];
64
- let conditionMet = EvaluationsManager.validate(condition.condition, comparisonValue, condition.value);
65
- if (conditionMet) {
66
- formulaEvaluate = condition.formula;
67
- break;
68
- }
69
- }
70
- }
71
- const attrs = this.sanitizeData({ ...data.values, ...values });
72
- result = parse(formulaEvaluate).evaluate(attrs);
73
- }
74
- catch (error) {
75
- console.log("Error evaluating formula:", formula.formula, "Error:", error);
76
- }
77
- const isInvalidResult = [-Infinity, Infinity, undefined, null, NaN].includes(result);
78
- if (formula.round && !isInvalidResult)
79
- result = Math.round(result);
80
- if (formula.ceil && !isInvalidResult)
81
- result = Math.ceil(result);
82
- result = isInvalidResult ? formula.emptyValue : Number(result.toFixed(2));
83
- values[formula.propertyToSet] = result;
84
- }
85
- return values;
86
- };
87
- __classPrivateFieldSet(this, _FormulaArray_parent, parent, "f");
88
- __classPrivateFieldSet(this, _FormulaArray_plugin, plugin, "f");
89
- __classPrivateFieldSet(this, _FormulaArray_specs, specs, "f");
90
- __classPrivateFieldSet(this, _FormulaArray_round, specs.round, "f");
91
- __classPrivateFieldSet(this, _FormulaArray_ceil, specs.ceil, "f");
92
- __classPrivateFieldGet(this, _FormulaArray_specs, "f").emptyValue = specs.emptyValue;
93
- __classPrivateFieldSet(this, _FormulaArray_formulaField, __classPrivateFieldGet(this, _FormulaArray_plugin, "f").form.getField(this.name), "f");
94
- }
95
- initialize() {
96
- __classPrivateFieldGet(this, _FormulaArray_formulaField, "f").on('change', this.calculate.bind(this));
97
- }
98
- ;
99
- async calculate() {
100
- const formulaField = __classPrivateFieldGet(this, _FormulaArray_plugin, "f").form.getField(this.name);
101
- if (!formulaField)
102
- return;
103
- const value = formulaField[__classPrivateFieldGet(this, _FormulaArray_specs, "f").propertyValue || 'entries'];
104
- if (!value || !Array.isArray(value) || !value.length) {
105
- formulaField.set({ [__classPrivateFieldGet(this, _FormulaArray_specs, "f").propertyValue]: [] });
106
- return;
107
- }
108
- ;
109
- const newValue = value.map(item => {
110
- let results = this.evaluate({ formulas: __classPrivateFieldGet(this, _FormulaArray_specs, "f").formulas, values: item });
111
- return {
112
- ...item,
113
- ...results
114
- };
115
- });
116
- __classPrivateFieldSet(this, _FormulaArray_value, newValue, "f");
117
- formulaField.set({ [__classPrivateFieldGet(this, _FormulaArray_specs, "f").propertyValue]: newValue });
118
- }
119
- ;
120
- sanitizeData(data) {
121
- if (Array.isArray(data)) {
122
- return data.map(item => this.sanitizeData(item));
123
- }
124
- else if (typeof data === 'object' && data !== null) {
125
- const sanitizedData = {};
126
- for (const key in data) {
127
- if (data.hasOwnProperty(key)) {
128
- sanitizedData[key] = this.sanitizeData(data[key]);
129
- }
130
- }
131
- return sanitizedData;
132
- }
133
- else {
134
- return this.sanitizeValue(data);
135
- }
136
- }
137
- sanitizeValue(value, defaultValue = 0) {
138
- return (value === null || value === undefined || isNaN(value)) ? defaultValue : Number(value);
139
- }
140
- }
141
- _FormulaArray_plugin = new WeakMap(), _FormulaArray_specs = new WeakMap(), _FormulaArray_value = new WeakMap(), _FormulaArray_emptyValue = new WeakMap(), _FormulaArray_variables = new WeakMap(), _FormulaArray_round = new WeakMap(), _FormulaArray_ceil = new WeakMap(), _FormulaArray_parent = new WeakMap(), _FormulaArray_formulaField = new WeakMap();
142
- //# sourceMappingURL=array-formula.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-formula.js","sourceRoot":"","sources":["../../../src/formulas/variants/array-formula.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,MAAM,OAAO,YAAY;IAGrB,IAAI,OAAO;QACP,OAAO,uBAAA,IAAI,2BAAO,CAAC,OAAO,CAAC;IAC/B,CAAC;IACD,IAAI,IAAI;QACJ,MAAM,OAAO,GAAsB,uBAAA,IAAI,2BAAO,CAAC,OAAO,CAAC;QACvD,OAAO,OAAO,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,IAAI,KAAK;QACL,OAAO,uBAAA,IAAI,2BAAO,CAAC;IACvB,CAAC;IACD,IAAI,IAAI;QACJ,OAAO,uBAAA,IAAI,2BAAO,CAAC,IAAI,CAAC;IAC5B,CAAC;IACD;;OAEG;IACH,IAAI,MAAM;QACN,MAAM,OAAO,GAAsB,IAAI,CAAC,OAAO,CAAC;QAChD,OAAO,OAAO,OAAO,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC;IACrF,CAAC;IAED,IAAI,UAAU;QACV,IAAI,OAAO,uBAAA,IAAI,2BAAO,CAAC,OAAO,KAAK,QAAQ;YAAE,OAAO;QACpD,MAAM,OAAO,GAAG,uBAAA,IAAI,2BAAO,CAAC,OAA4B,CAAC;QACzD,OAAO,OAAO,CAAC,UAAU,CAAC;IAC9B,CAAC;IAID,IAAI,SAAS;QACT,OAAO,uBAAA,IAAI,+BAAW,CAAC;IAC3B,CAAC;IAQD,YAA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AAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YACnD,MAAM,aAAa,GAAQ,EAAE,CAAC;YAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACrB,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC3B,aAAa,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBACtD,CAAC;YACL,CAAC;YACD,OAAO,aAAa,CAAC;QACzB,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;IACL,CAAC;IAEO,aAAa,CAAC,KAAU,EAAE,eAAuB,CAAC;QACtD,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClG,CAAC;CACJ"}
@@ -1,6 +0,0 @@
1
- export declare abstract class WiseFormFormulaPlugin {
2
- abstract initialize(): void;
3
- abstract validate(): void;
4
- abstract calculate(): void;
5
- }
6
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/formulas/variants/base.ts"],"names":[],"mappings":"AAAA,8BAAsB,qBAAqB;IAC1C,QAAQ,CAAC,UAAU,IAAI,IAAI;IAC3B,QAAQ,CAAC,QAAQ,IAAI,IAAI;IACzB,QAAQ,CAAC,SAAS,IAAI,IAAI;CAC1B"}
@@ -1,3 +0,0 @@
1
- export class WiseFormFormulaPlugin {
2
- }
3
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/formulas/variants/base.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,qBAAqB;CAI1C"}
@@ -1,18 +0,0 @@
1
- import { IComplexCondition, IConditionalField } from '../types/formulas';
2
- export declare class FormulaBasic {
3
- #private;
4
- get formula(): string | IComplexCondition;
5
- get base(): string;
6
- get value(): string | number;
7
- get name(): string;
8
- /**
9
- * Represents the fields defined in the plugin settings
10
- */
11
- get fields(): string[];
12
- get conditions(): IConditionalField | IConditionalField[];
13
- get variables(): string[];
14
- constructor(parent: any, plugin: any, specs: any);
15
- initialize(): void;
16
- calculate(): Promise<void>;
17
- }
18
- //# sourceMappingURL=basic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../src/formulas/variants/basic.ts"],"names":[],"mappings":"AAGA,OAAO,EAGH,iBAAiB,EACjB,iBAAiB,EACpB,MAAM,mBAAmB,CAAC;AAG3B,qBAAa,YAAY;;IAIrB,IAAI,OAAO,+BAEV;IACD,IAAI,IAAI,WAGP;IAED,IAAI,KAAK,oBAER;IACD,IAAI,IAAI,WAEP;IACD;;OAEG;IACH,IAAI,MAAM,aAKT;IAED,IAAI,UAAU,4CAIb;IAID,IAAI,SAAS,aAEZ;gBAQW,MAAM,KAAA,EAAE,MAAM,KAAA,EAAE,KAAK,KAAA;IAWjC,UAAU;IAqBJ,SAAS;CAkDlB"}