@bgroup/wise-form 1.0.3 → 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 -538
  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 -515
  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,245 +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 _FormModel_childWrappers, _FormModel_plugins, _FormModel_mode, _FormModel_update, _FormModel_callbackManagers, _FormModel_startup, _FormModel_checkReady, _FormModel_configFields, _FormModel_getFieldModel, _FormModel_listenDependencies, _FormModel_getWrapper;
13
- import { FormField } from './field';
14
- import { WrappedFormModel } from './wrapper';
15
- import { BaseWiseModel } from './base';
16
- import { PluginsManager } from './plugins';
17
- import { CallbackManager } from './callback-manager';
18
- export class FormModel extends BaseWiseModel {
19
- get plugins() {
20
- return __classPrivateFieldGet(this, _FormModel_plugins, "f");
21
- }
22
- /**
23
- * since the fields can be children of the model or a
24
- * wrapper, this method is used to get the form model
25
- */
26
- get form() {
27
- return this;
28
- }
29
- get mode() {
30
- return __classPrivateFieldGet(this, _FormModel_mode, "f");
31
- }
32
- get update() {
33
- return __classPrivateFieldGet(this, _FormModel_update, "f");
34
- }
35
- /**
36
- * Initializes a new instance of the `FormModel`, setting up the initial state, including field configurations,
37
- * callbacks, and reactive properties. This constructor also triggers the asynchronous setup process for the form.
38
- *
39
- * @param {Object} settings The configuration settings for the form, including fields, default values, and callbacks.
40
- * @param {Object} [reactiveProps] Optional reactive properties to enhance the form's reactivity.
41
- */
42
- constructor(settings, reactiveProps) {
43
- super(settings, reactiveProps);
44
- _FormModel_childWrappers.set(this, 0);
45
- _FormModel_plugins.set(this, void 0);
46
- _FormModel_mode.set(this, void 0);
47
- _FormModel_update.set(this, void 0);
48
- _FormModel_callbackManagers.set(this, void 0);
49
- _FormModel_startup.set(this, async (settings) => {
50
- const values = settings?.values || {};
51
- const createItems = item => {
52
- const instance = __classPrivateFieldGet(this, _FormModel_getFieldModel, "f").call(this, item, values);
53
- const onChange = () => {
54
- // FormField has value, WrappedFormModel doesn't
55
- if ('value' in instance) {
56
- this[item.name] = instance.value;
57
- }
58
- };
59
- instance.on('change', onChange);
60
- this.fields.set(item.name, instance);
61
- };
62
- this.settings.fields.map(createItems);
63
- await __classPrivateFieldGet(this, _FormModel_checkReady, "f").call(this);
64
- __classPrivateFieldGet(this, _FormModel_configFields, "f").call(this);
65
- // todo: @everyone Define if is required to wait for the plugins to be ready.
66
- __classPrivateFieldSet(this, _FormModel_plugins, new PluginsManager(this), "f");
67
- this.ready = true;
68
- this.specs = settings;
69
- this.trigger('change');
70
- });
71
- /**
72
- * Checks if all wrappers and fields within the form are loaded and sets the form to a loaded state. This method ensures that the form is fully operational before any interaction.
73
- * Its used for the start to listen the dependencies
74
- */
75
- _FormModel_checkReady.set(this, () => {
76
- const onReady = () => {
77
- const areAllWrappersLoaded = this.childWrappersReady === __classPrivateFieldGet(this, _FormModel_childWrappers, "f");
78
- if (!areAllWrappersLoaded) {
79
- this.childWrappersReady = this.childWrappersReady + 1;
80
- return;
81
- }
82
- this.loaded = true;
83
- this.loadedPromise.resolve(true);
84
- this.off('wrappers.children.loaded', onReady);
85
- };
86
- if (this.loaded)
87
- return this.loaded;
88
- if (!this.wrappers.size) {
89
- onReady();
90
- return this.loaded;
91
- }
92
- this.on('wrappers.children.loaded', onReady);
93
- return this.loadedPromise;
94
- });
95
- /**
96
- * Configures all fields by initializing them and setting up dependencies. This method ensures that each field is ready for interaction and that any field dependencies are respected.
97
- */
98
- _FormModel_configFields.set(this, () => {
99
- this.fields.forEach(__classPrivateFieldGet(this, _FormModel_listenDependencies, "f"));
100
- this.fields.forEach(field => field.initialize());
101
- });
102
- /**
103
- * Creates a new instance of a field or a wrapper based on the provided item configuration. It initializes the field or wrapper with specified values and properties.
104
- * @param {Object} item - The field or wrapper configuration.
105
- * @param {Object} values - The initial values for the fields.
106
- * @returns {FormField|WrappedFormModel} A new field or wrapper instance.
107
- */
108
- _FormModel_getFieldModel.set(this, (item, values) => {
109
- let externalValues = {};
110
- // @todo: @veD-tnayrB: Review this code and document it
111
- if (Array.isArray(item?.properties)) {
112
- item?.properties.forEach(item => (externalValues[item.name] = item.value));
113
- }
114
- if (item.type === 'wrapper')
115
- return __classPrivateFieldGet(this, _FormModel_getWrapper, "f").call(this, item);
116
- const instance = new FormField({
117
- parent: this,
118
- specs: {
119
- ...item,
120
- value: values[item.name] || item?.value,
121
- properties: item?.properties || [],
122
- },
123
- });
124
- /**
125
- * @todo: review it. why we need it.?
126
- */
127
- if (item?.properties) {
128
- let toSet = {};
129
- item?.properties.forEach(property => (toSet[property] = item[property] || ''));
130
- instance.set(toSet);
131
- }
132
- return instance;
133
- });
134
- /**
135
- * Examines each field for dependencies and sets up listeners to respond to changes in dependent fields. This ensures dynamic interactions within the form based on field dependencies.
136
- * @param {FormField|WrappedFormModel} instance - The field or wrapper instance to check for dependencies.
137
- */
138
- _FormModel_listenDependencies.set(this, instance => {
139
- if (!instance?.specs?.dependentOn?.length)
140
- return;
141
- const manager = new CallbackManager(this, instance);
142
- });
143
- /**
144
- *
145
- * @param item
146
- * @param values
147
- * @returns
148
- */
149
- _FormModel_getWrapper.set(this, item => {
150
- let instance;
151
- if (!item.fields)
152
- throw new Error(`Wrapper ${item.name} must have fields property`);
153
- const fieldsProperties = item.fields.map(item => item.name);
154
- const properties = [...fieldsProperties, ...(item?.properties || [])];
155
- const defaultValues = item.values || {};
156
- instance = new WrappedFormModel({
157
- parent: this,
158
- settings: { ...item, form: this },
159
- specs: { properties: properties || [], ...defaultValues },
160
- });
161
- let toSet = {};
162
- Object.keys(instance?.getProperties()).forEach(property => (toSet[property] = item[property] || ''));
163
- instance.set(toSet);
164
- this.registerWrapper(instance);
165
- __classPrivateFieldSet(this, _FormModel_childWrappers, __classPrivateFieldGet(this, _FormModel_childWrappers, "f") + 1, "f");
166
- return instance;
167
- });
168
- /**
169
- * Registers a wrapper model within the form model, allowing for nested form structures.
170
- * This method is crucial for managing complex forms where fields might be grouped into sections or wrappers.
171
- * @param {WrappedFormModel} wrapper - The wrapper instance to register.
172
- */
173
- this.registerWrapper = (wrapper) => {
174
- this.wrappers.set(wrapper.name, wrapper);
175
- };
176
- this.hide = (fields) => {
177
- fields.forEach(field => {
178
- const instance = this.getField(field);
179
- if (!instance)
180
- throw new Error(`Field ${field} does not exist in form ${this.name}`);
181
- instance.hide();
182
- });
183
- };
184
- this.show = (fields) => {
185
- fields.forEach(field => {
186
- const instance = this.getField(field);
187
- if (!instance)
188
- throw new Error(`Field ${field} does not exist in form ${this.name}`);
189
- instance.show();
190
- });
191
- };
192
- this.disable = (fields) => {
193
- fields.forEach(field => {
194
- const instance = this.getField(field);
195
- if (!instance)
196
- throw new Error(`Field ${field} does not exist in form ${this.name}`);
197
- instance.disabled = true;
198
- });
199
- };
200
- this.enable = (fields) => {
201
- fields.forEach(field => {
202
- const instance = this.getField(field);
203
- if (!instance)
204
- throw new Error(`Field ${field} does not exist in form ${this.name}`);
205
- instance.disabled = false;
206
- });
207
- };
208
- this.reset = (fields) => {
209
- fields.forEach(field => {
210
- const instance = this.getField(field);
211
- if (!instance)
212
- throw new Error(`Field ${field} does not exist in form ${this.name}`);
213
- instance.clear();
214
- });
215
- };
216
- __classPrivateFieldGet(this, _FormModel_startup, "f").call(this, settings);
217
- if (!globalThis._wiseForms)
218
- globalThis._wiseForms = [];
219
- globalThis._wiseForms.push(this);
220
- __classPrivateFieldSet(this, _FormModel_update, settings.update, "f");
221
- __classPrivateFieldSet(this, _FormModel_mode, __classPrivateFieldGet(this, _FormModel_update, "f") ? 'update' : 'create', "f");
222
- }
223
- getForm() {
224
- return this;
225
- }
226
- getFormula(name) {
227
- if (!name)
228
- return null;
229
- const formulaPlugin = __classPrivateFieldGet(this, _FormModel_plugins, "f").instances.get("formula");
230
- if (!formulaPlugin || !formulaPlugin.formulas)
231
- return;
232
- const formula = formulaPlugin.formulas.get(name);
233
- if (!formula)
234
- return null;
235
- return formula;
236
- }
237
- }
238
- _FormModel_childWrappers = new WeakMap(), _FormModel_plugins = new WeakMap(), _FormModel_mode = new WeakMap(), _FormModel_update = new WeakMap(), _FormModel_callbackManagers = new WeakMap(), _FormModel_startup = new WeakMap(), _FormModel_checkReady = new WeakMap(), _FormModel_configFields = new WeakMap(), _FormModel_getFieldModel = new WeakMap(), _FormModel_listenDependencies = new WeakMap(), _FormModel_getWrapper = new WeakMap();
239
- FormModel.create = settings => {
240
- const properties = settings.fields.map(item => item.name);
241
- const values = settings.values || {};
242
- const instance = new FormModel(settings, { ...properties, ...values });
243
- return instance;
244
- };
245
- //# sourceMappingURL=model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/models/model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,OACC,SAAU,SAAQ,aAAa;IAGrC,IAAI,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,CAAC,IAAY;QAC7B,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,MAAM,aAAa,GAAG,uBAAA,IAAI,0BAAS,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7D,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,QAAQ;YAAE,OAAO;QACtD,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,OAAO,OAAO,CAAC;IAChB,CAAC;;;AAfM,gBAAM,GAAG,QAAQ,CAAC,EAAE;IAC1B,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,QAAQ,EAAE,EAAE,GAAG,UAAU,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IAEvE,OAAO,QAAQ,CAAC;AACjB,CAAC,AANY,CAMX"}
@@ -1,9 +0,0 @@
1
- import { FormModel } from '../model';
2
- import { IPluginFormSpecs } from '../types/plugins';
3
- export declare abstract class WiseFormPluginBase {
4
- abstract readonly name: string;
5
- abstract readonly ready: boolean;
6
- abstract init(): Promise<void>;
7
- static settings?(model: FormModel, specs: IPluginFormSpecs): Promise<WiseFormPluginBase>;
8
- }
9
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/models/plugins/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,8BAAsB,kBAAkB;IACvC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CACxF"}
@@ -1,3 +0,0 @@
1
- export class WiseFormPluginBase {
2
- }
3
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/models/plugins/base.ts"],"names":[],"mappings":"AAGA,MAAM,OAAgB,kBAAkB;CAMvC"}
@@ -1,18 +0,0 @@
1
- import type { FormModel } from '../model';
2
- import { IPluginFormSpecs } from '../types/plugins';
3
- import { FormulaManager } from '@bgroup/wise-form/formulas';
4
- import { WiseFormPluginBase } from './base';
5
- export declare class FormulaPlugin extends WiseFormPluginBase {
6
- #private;
7
- get form(): FormModel;
8
- get name(): string;
9
- get ready(): boolean;
10
- get formulas(): Map<string, any>;
11
- get value(): string | number;
12
- set value(v: string | number);
13
- constructor(form: FormModel, settings: IPluginFormSpecs);
14
- init(): Promise<void>;
15
- create(observer: any): Promise<FormulaManager>;
16
- static settings(model: any, settings: any): Promise<WiseFormPluginBase>;
17
- }
18
- //# sourceMappingURL=formula.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formula.d.ts","sourceRoot":"","sources":["../../../src/models/plugins/formula.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE5C,qBAAa,aAAc,SAAQ,kBAAkB;;IAEpD,IAAI,IAAI,cAEP;IAED,IAAI,IAAI,WAEP;IAED,IAAI,KAAK,YAER;IAED,IAAI,QAAQ,qBAEX;IAGD,IAAI,KAAK,oBAER;IAED,IAAI,KAAK,CAAC,CAAC,iBAAA,EAGV;gBAEW,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB;IAMjD,IAAI;IAaJ,MAAM,CAAC,QAAQ,KAAA;WAaR,QAAQ,CAAC,KAAK,KAAA,EAAE,QAAQ,KAAA,GAAG,OAAO,CAAC,kBAAkB,CAAC;CASnE"}
@@ -1,82 +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 _FormulaPlugin_form, _FormulaPlugin_settings, _FormulaPlugin_formulas, _FormulaPlugin_value;
13
- import { FormulaManager } from '@bgroup/wise-form/formulas';
14
- import { WiseFormPluginBase } from './base';
15
- // pensar porque no manejarlo con eventos.
16
- export class FormulaPlugin extends WiseFormPluginBase {
17
- get form() {
18
- return __classPrivateFieldGet(this, _FormulaPlugin_form, "f");
19
- }
20
- get name() {
21
- return 'formula';
22
- }
23
- get ready() {
24
- return true;
25
- }
26
- get formulas() {
27
- return __classPrivateFieldGet(this, _FormulaPlugin_formulas, "f");
28
- }
29
- get value() {
30
- return __classPrivateFieldGet(this, _FormulaPlugin_value, "f");
31
- }
32
- set value(v) {
33
- if (v === __classPrivateFieldGet(this, _FormulaPlugin_value, "f"))
34
- return;
35
- __classPrivateFieldSet(this, _FormulaPlugin_value, v, "f");
36
- }
37
- constructor(form, settings) {
38
- super();
39
- _FormulaPlugin_form.set(this, void 0);
40
- _FormulaPlugin_settings.set(this, void 0);
41
- _FormulaPlugin_formulas.set(this, new Map());
42
- _FormulaPlugin_value.set(this, 0);
43
- __classPrivateFieldSet(this, _FormulaPlugin_form, form, "f");
44
- __classPrivateFieldSet(this, _FormulaPlugin_settings, settings, "f");
45
- }
46
- async init() {
47
- if (!__classPrivateFieldGet(this, _FormulaPlugin_form, "f").settings?.observers)
48
- return;
49
- const promises = __classPrivateFieldGet(this, _FormulaPlugin_form, "f").settings.observers.map(this.create.bind(this));
50
- const formulas = await Promise.all(promises);
51
- formulas.forEach(formula => {
52
- __classPrivateFieldGet(this, _FormulaPlugin_formulas, "f").set(formula.name, formula);
53
- });
54
- __classPrivateFieldGet(this, _FormulaPlugin_formulas, "f").forEach(formula => {
55
- if (!formula.initialize)
56
- console.log(-1, formula);
57
- formula.initialize();
58
- });
59
- }
60
- async create(observer) {
61
- const { formula } = observer;
62
- if (!observer.name) {
63
- throw new Error(`Observer in form "${__classPrivateFieldGet(this, _FormulaPlugin_form, "f").name}" must have a name`);
64
- }
65
- if (!formula) {
66
- throw new Error(`Observer ${observer.name} in form "${__classPrivateFieldGet(this, _FormulaPlugin_form, "f").name}" must have a formula`);
67
- }
68
- return FormulaManager.create(this, observer);
69
- }
70
- static async settings(model, settings) {
71
- try {
72
- const instance = new FormulaPlugin(model, settings);
73
- await instance.init();
74
- return instance;
75
- }
76
- catch (e) {
77
- console.error(e);
78
- }
79
- }
80
- }
81
- _FormulaPlugin_form = new WeakMap(), _FormulaPlugin_settings = new WeakMap(), _FormulaPlugin_formulas = new WeakMap(), _FormulaPlugin_value = new WeakMap();
82
- //# sourceMappingURL=formula.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formula.js","sourceRoot":"","sources":["../../../src/models/plugins/formula.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAC5C,0CAA0C;AAC1C,MAAM,OAAO,aAAc,SAAQ,kBAAkB;IAEpD,IAAI,IAAI;QACP,OAAO,uBAAA,IAAI,2BAAM,CAAC;IACnB,CAAC;IAED,IAAI,IAAI;QACP,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,IAAI,KAAK;QACR,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,uBAAA,IAAI,+BAAU,CAAC;IACvB,CAAC;IAGD,IAAI,KAAK;QACR,OAAO,uBAAA,IAAI,4BAAO,CAAC;IACpB,CAAC;IAED,IAAI,KAAK,CAAC,CAAC;QACV,IAAI,CAAC,KAAK,uBAAA,IAAI,4BAAO;YAAE,OAAO;QAC9B,uBAAA,IAAI,wBAAU,CAAC,MAAA,CAAC;IACjB,CAAC;IAED,YAAY,IAAe,EAAE,QAA0B;QACtD,KAAK,EAAE,CAAC;QA5BT,sCAAiB;QAIjB,0CAA4B;QAQ5B,kCAA8B,IAAI,GAAG,EAAE,EAAC;QAKxC,+BAA0B,CAAC,EAAC;QAY3B,uBAAA,IAAI,uBAAS,IAAI,MAAA,CAAC;QAClB,uBAAA,IAAI,2BAAa,QAAQ,MAAA,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,IAAI;QACT,IAAI,CAAC,uBAAA,IAAI,2BAAM,CAAC,QAAQ,EAAE,SAAS;YAAE,OAAO;QAC5C,MAAM,QAAQ,GAAG,uBAAA,IAAI,2BAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAA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AAO,CAAC,EAAE,CAAC;YACZ,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACF,CAAC;CACD"}
@@ -1,11 +0,0 @@
1
- import { ReactiveModel } from '@beyond-js/reactive/model';
2
- import { IPluginForm } from '../types/plugins';
3
- export declare class PluginsManager extends ReactiveModel<PluginsManager> {
4
- #private;
5
- private static items;
6
- get instances(): Map<string, IPluginForm>;
7
- static formulas: Record<string, any>;
8
- constructor(model: any);
9
- private initialize;
10
- }
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,qBAAa,cAAe,SAAQ,aAAa,CAAC,cAAc,CAAC;;IAGhE,OAAO,CAAC,MAAM,CAAC,KAAK,CAA+B;IAEnD,IAAI,SAAS,6BAEZ;IACD,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;gBAE9B,KAAK,KAAA;YAQH,UAAU;CAwBxB"}
@@ -1,52 +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 _PluginsManager_plugins, _PluginsManager_instances, _PluginsManager_model;
13
- import { ReactiveModel } from '@beyond-js/reactive/model';
14
- import { PLUGINS } from './plugins';
15
- export class PluginsManager extends ReactiveModel {
16
- get instances() {
17
- return __classPrivateFieldGet(this, _PluginsManager_instances, "f");
18
- }
19
- ;
20
- constructor(model) {
21
- super();
22
- _PluginsManager_plugins.set(this, ['formula']);
23
- _PluginsManager_instances.set(this, new Map());
24
- _PluginsManager_model.set(this, void 0);
25
- __classPrivateFieldSet(this, _PluginsManager_model, model, "f");
26
- globalThis.f = model;
27
- this.initialize();
28
- }
29
- async initialize() {
30
- const plugins = Object.keys(PLUGINS);
31
- const promises = [];
32
- plugins.forEach(plugin => {
33
- const manager = PLUGINS[plugin].object;
34
- const instance = manager.settings(__classPrivateFieldGet(this, _PluginsManager_model, "f"));
35
- promises.push(instance);
36
- });
37
- const results = await Promise.allSettled(promises);
38
- const installed = results
39
- .filter(result => result.status === 'fulfilled')
40
- .map(result => result.value);
41
- const failed = results.filter(result => result.status === 'rejected');
42
- if (failed.length) {
43
- console.warn('Failed to install plugins', failed);
44
- }
45
- installed.forEach((plugin) => __classPrivateFieldGet(this, _PluginsManager_instances, "f").set(plugin.name, plugin));
46
- this.ready = true;
47
- }
48
- }
49
- _PluginsManager_plugins = new WeakMap(), _PluginsManager_instances = new WeakMap(), _PluginsManager_model = new WeakMap();
50
- PluginsManager.items = new Map();
51
- PluginsManager.formulas = {};
52
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/plugins/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,cAAe,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MAAM,CAAC,CAAC;QACnD,CAAC;QACD,SAAS,CAAC,OAAO,CAAC,CAAC,MAAmB,EAAE,EAAE,CAAC,uBAAA,IAAI,iCAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QAErF,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACnB,CAAC;;;AAtCc,oBAAK,GAAqB,IAAI,GAAG,EAAE,AAA9B,CAA+B;AAK5C,uBAAQ,GAAwB,EAAE,AAA1B,CAA2B"}
@@ -1,7 +0,0 @@
1
- import { FormulaPlugin } from './formula';
2
- export declare const PLUGINS: {
3
- formula: {
4
- object: typeof FormulaPlugin;
5
- };
6
- };
7
- //# sourceMappingURL=plugins.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/models/plugins/plugins.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
@@ -1,7 +0,0 @@
1
- import { FormulaPlugin } from './formula';
2
- export const PLUGINS = {
3
- formula: {
4
- object: FormulaPlugin,
5
- },
6
- };
7
- //# sourceMappingURL=plugins.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../src/models/plugins/plugins.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,OAAO,EAAE;QACR,MAAM,EAAE,aAAa;KACrB;CACD,CAAC"}
@@ -1,7 +0,0 @@
1
- export interface IBaseWiseModel {
2
- name?: string;
3
- className?: string;
4
- hidden?: boolean;
5
- [key: string]: any;
6
- }
7
- //# sourceMappingURL=base-wise-model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-wise-model.d.ts","sourceRoot":"","sources":["../../../src/models/types/base-wise-model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=base-wise-model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-wise-model.js","sourceRoot":"","sources":["../../../src/models/types/base-wise-model.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- import { FormModel } from '../model';
2
- export type FieldOrAlias = string | {
3
- [fieldName: string]: string;
4
- };
5
- export interface ICallbackProps {
6
- form: FormModel;
7
- field: FieldOrAlias;
8
- [string: string]: any;
9
- /**
10
- * Additional fields to be passed to the callback.
11
- */
12
- fields?: Record<string, any>;
13
- /**
14
- * Additional data registered in the WiseForm settings.
15
- */
16
- specs?: Record<string, any>;
17
- }
18
- export type CallbackFunction = (props: ICallbackProps) => void;
19
- //# sourceMappingURL=callbacks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"callbacks.d.ts","sourceRoot":"","sources":["../../../src/models/types/callbacks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIrC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;IACpB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=callbacks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../../../src/models/types/callbacks.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- export type TDisabledSettings = {
2
- name: string;
3
- value: any;
4
- };
5
- export interface IDisabled {
6
- fields: string[] | TDisabledSettings[];
7
- }
8
- //# sourceMappingURL=disabled.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"disabled.d.ts","sourceRoot":"","sources":["../../../src/models/types/disabled.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;CACX,CAAC;AACF,MAAM,WAAW,SAAS;IACzB,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAC;CACvC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=disabled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"disabled.js","sourceRoot":"","sources":["../../../src/models/types/disabled.ts"],"names":[],"mappings":""}
@@ -1,25 +0,0 @@
1
- export interface IFormField {
2
- name?: string;
3
- type?: string;
4
- placeholder?: string;
5
- required?: boolean;
6
- label?: string;
7
- variant?: string;
8
- disabled?: boolean;
9
- value?: any;
10
- hidden?: boolean;
11
- options?: Array<{
12
- value: any;
13
- label?: string;
14
- [key: string]: any;
15
- }>;
16
- className?: string;
17
- checked?: boolean;
18
- id?: string;
19
- icon?: string;
20
- [key: string]: any;
21
- }
22
- export interface IFormFieldProps extends IFormField {
23
- properties?: string[];
24
- }
25
- //# sourceMappingURL=form-field.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["../../../src/models/types/form-field.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC,CAAC;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IAClD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=form-field.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form-field.js","sourceRoot":"","sources":["../../../src/models/types/form-field.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- import { IFormField } from './form-field';
2
- type Callback = (...args: any[]) => void | Promise<any>;
3
- export interface IFormModelProps {
4
- name?: string;
5
- params?: Record<string, any>;
6
- callbacks?: Record<string, Callback>;
7
- fields?: IFormField[];
8
- template?: Array<string | number>;
9
- properties?: string[];
10
- [key: string]: any;
11
- }
12
- export {};
13
- //# sourceMappingURL=model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/models/types/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AAExD,MAAM,WAAW,eAAe;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=model.js.map