@f1studio/form-spec 5.0.0-alpha.101

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 (225) hide show
  1. package/Designer.d.ts +89 -0
  2. package/FormSpec.TS/Components/HelloComponent.js +68 -0
  3. package/FormSpec.TS/Components/HelloComponent.js.map +1 -0
  4. package/FormSpec.TS/Components/HelloComponent.ts.map +1 -0
  5. package/FormSpec.TS/Designer.js +526 -0
  6. package/FormSpec.TS/Designer.js.map +1 -0
  7. package/FormSpec.TS/Designer.ts.map +1 -0
  8. package/FormSpec.TS/FormSpec.js +5400 -0
  9. package/FormSpec.TS/FormSpec.js.map +1 -0
  10. package/FormSpec.TS/FormSpec.ts.map +1 -0
  11. package/FormSpec.TS/FormSpecHelpers.js +382 -0
  12. package/FormSpec.TS/FormSpecHelpers.js.map +1 -0
  13. package/FormSpec.TS/FormSpecHelpers.ts.map +1 -0
  14. package/FormSpec.TS/Helpers.js +732 -0
  15. package/FormSpec.TS/Helpers.js.map +1 -0
  16. package/FormSpec.TS/Helpers.ts.map +1 -0
  17. package/FormSpec.TS/Interfaces.js +257 -0
  18. package/FormSpec.TS/Interfaces.js.map +1 -0
  19. package/FormSpec.TS/Interfaces.ts.map +1 -0
  20. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js +854 -0
  21. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js.map +1 -0
  22. package/FormSpec.TS/Interop/FormSpec.Api.Helpers.ts.map +1 -0
  23. package/FormSpec.TS/Interop/FormSpec.Api.Option.js +1961 -0
  24. package/FormSpec.TS/Interop/FormSpec.Api.Option.js.map +1 -0
  25. package/FormSpec.TS/Interop/FormSpec.Api.Option.ts.map +1 -0
  26. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js +1367 -0
  27. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js.map +1 -0
  28. package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
  29. package/FormSpec.TS/Logging/LogTypes.js +347 -0
  30. package/FormSpec.TS/Logging/LogTypes.js.map +1 -0
  31. package/FormSpec.TS/Logging/LogTypes.ts.map +1 -0
  32. package/FormSpec.TS/Migrator.js +230 -0
  33. package/FormSpec.TS/Migrator.js.map +1 -0
  34. package/FormSpec.TS/Migrator.ts.map +1 -0
  35. package/FormSpec.TS/PathwayDataExtractor.js +361 -0
  36. package/FormSpec.TS/PathwayDataExtractor.js.map +1 -0
  37. package/FormSpec.TS/PathwayDataExtractor.ts.map +1 -0
  38. package/FormSpec.TS/PathwayExecutor.js +1321 -0
  39. package/FormSpec.TS/PathwayExecutor.js.map +1 -0
  40. package/FormSpec.TS/PathwayExecutor.ts.map +1 -0
  41. package/FormSpec.TS/PathwayValidator.js +346 -0
  42. package/FormSpec.TS/PathwayValidator.js.map +1 -0
  43. package/FormSpec.TS/PathwayValidator.ts.map +1 -0
  44. package/FormSpec.TS/PluginInterface.js +171 -0
  45. package/FormSpec.TS/PluginInterface.js.map +1 -0
  46. package/FormSpec.TS/PluginInterface.ts.map +1 -0
  47. package/FormSpec.TS/Prelude.js +59 -0
  48. package/FormSpec.TS/Prelude.js.map +1 -0
  49. package/FormSpec.TS/Prelude.ts.map +1 -0
  50. package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js +958 -0
  51. package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js.map +1 -0
  52. package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
  53. package/FormSpec.TS/Renderers/MermaidRenderer.js +228 -0
  54. package/FormSpec.TS/Renderers/MermaidRenderer.js.map +1 -0
  55. package/FormSpec.TS/Renderers/MermaidRenderer.ts.map +1 -0
  56. package/FormSpec.TS/Renderers/PathwayRenderers.js +190 -0
  57. package/FormSpec.TS/Renderers/PathwayRenderers.js.map +1 -0
  58. package/FormSpec.TS/Renderers/PathwayRenderers.ts.map +1 -0
  59. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +511 -0
  60. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js +437 -0
  61. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js.map +1 -0
  62. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.ts.map +1 -0
  63. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +16 -0
  64. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js +73 -0
  65. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js.map +1 -0
  66. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.ts.map +1 -0
  67. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +50 -0
  68. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js +72 -0
  69. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js.map +1 -0
  70. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.ts.map +1 -0
  71. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +28 -0
  72. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +24 -0
  73. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js +56 -0
  74. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js.map +1 -0
  75. package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.ts.map +1 -0
  76. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +31 -0
  77. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +178 -0
  78. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js +464 -0
  79. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js.map +1 -0
  80. package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.ts.map +1 -0
  81. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +17 -0
  82. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +152 -0
  83. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js +25 -0
  84. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js.map +1 -0
  85. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.ts.map +1 -0
  86. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +28 -0
  87. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +218 -0
  88. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js +37 -0
  89. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js.map +1 -0
  90. package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.ts.map +1 -0
  91. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +27 -0
  92. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +82 -0
  93. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js +7 -0
  94. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js.map +1 -0
  95. package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.ts.map +1 -0
  96. package/FormSpec.TS/fable_modules/Feliz.2.7.0/BorderStyle.fs +59 -0
  97. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs +154 -0
  98. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js +32 -0
  99. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js.map +1 -0
  100. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.ts.map +1 -0
  101. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Feliz.fableproj +42 -0
  102. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Fonts.fs +240 -0
  103. package/FormSpec.TS/fable_modules/Feliz.2.7.0/GridTypes.fs +24 -0
  104. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Html.fs +826 -0
  105. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs +83 -0
  106. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js +292 -0
  107. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js.map +1 -0
  108. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.ts.map +1 -0
  109. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs +65 -0
  110. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js +229 -0
  111. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js.map +1 -0
  112. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.ts.map +1 -0
  113. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Length.fs +91 -0
  114. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Locale.fs +876 -0
  115. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs +4080 -0
  116. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js +133 -0
  117. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js.map +1 -0
  118. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.ts.map +1 -0
  119. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs +656 -0
  120. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js +561 -0
  121. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js.map +1 -0
  122. package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.ts.map +1 -0
  123. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs +25 -0
  124. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js +46 -0
  125. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js.map +1 -0
  126. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.ts.map +1 -0
  127. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js +63 -0
  128. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js.map +1 -0
  129. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs +41 -0
  130. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js +7 -0
  131. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js.map +1 -0
  132. package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.ts.map +1 -0
  133. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs +53 -0
  134. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js +7 -0
  135. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js.map +1 -0
  136. package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.ts.map +1 -0
  137. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Styles.fs +5740 -0
  138. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs +1455 -0
  139. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js +39 -0
  140. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js.map +1 -0
  141. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.ts.map +1 -0
  142. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationLine.fs +13 -0
  143. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationStyle.fs +33 -0
  144. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Transform.fs +181 -0
  145. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransformOrigin.fs +17 -0
  146. package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransitionProperty.fs +162 -0
  147. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs +13 -0
  148. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js +7 -0
  149. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js.map +1 -0
  150. package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.ts.map +1 -0
  151. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +1768 -0
  152. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js +2337 -0
  153. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js.map +1 -0
  154. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.ts.map +1 -0
  155. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +811 -0
  156. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js +465 -0
  157. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -0
  158. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -0
  159. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +47 -0
  160. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js +18 -0
  161. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js.map +1 -0
  162. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.ts.map +1 -0
  163. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +34 -0
  164. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +68 -0
  165. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js +355 -0
  166. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js.map +1 -0
  167. package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.ts.map +1 -0
  168. package/FormSpec.TS/fable_modules/project_cracked.json +1 -0
  169. package/FormSpec.d.ts +1257 -0
  170. package/FormSpecHelpers.d.ts +50 -0
  171. package/Helpers.d.ts +147 -0
  172. package/Interfaces.d.ts +70 -0
  173. package/Interop/FormSpec.Api.Helpers.d.ts +247 -0
  174. package/Interop/FormSpec.Api.Helpers.d.ts.map +1 -0
  175. package/Interop/FormSpec.Api.Option.d.ts +384 -0
  176. package/Interop/FormSpec.Api.Option.d.ts.map +1 -0
  177. package/Interop/FormSpec.Values.Api.Option.d.ts +324 -0
  178. package/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -0
  179. package/Migrator.d.ts +59 -0
  180. package/PathwayDataExtractor.d.ts +19 -0
  181. package/PathwayExecutor.d.ts +210 -0
  182. package/PathwayValidator.d.ts +52 -0
  183. package/PluginInterface.d.ts +36 -0
  184. package/Prelude.d.ts +11 -0
  185. package/README.TS.md +622 -0
  186. package/README.md +85 -0
  187. package/package.json +39 -0
  188. package/src/Components/HelloComponent.ts +48 -0
  189. package/src/Components/HelloComponent.ts.map +1 -0
  190. package/src/Designer.ts +389 -0
  191. package/src/Designer.ts.map +1 -0
  192. package/src/FormSpec.ts +3114 -0
  193. package/src/FormSpec.ts.map +1 -0
  194. package/src/FormSpecHelpers.ts +374 -0
  195. package/src/FormSpecHelpers.ts.map +1 -0
  196. package/src/Helpers.ts +765 -0
  197. package/src/Helpers.ts.map +1 -0
  198. package/src/Interfaces.ts +166 -0
  199. package/src/Interfaces.ts.map +1 -0
  200. package/src/Interop/FormSpec.Api.Helpers.ts +872 -0
  201. package/src/Interop/FormSpec.Api.Helpers.ts.map +1 -0
  202. package/src/Interop/FormSpec.Api.Option.ts +1618 -0
  203. package/src/Interop/FormSpec.Api.Option.ts.map +1 -0
  204. package/src/Interop/FormSpec.Values.Api.Option.ts +1214 -0
  205. package/src/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
  206. package/src/Logging/LogTypes.ts +212 -0
  207. package/src/Logging/LogTypes.ts.map +1 -0
  208. package/src/Migrator.ts +156 -0
  209. package/src/Migrator.ts.map +1 -0
  210. package/src/PathwayDataExtractor.ts +290 -0
  211. package/src/PathwayDataExtractor.ts.map +1 -0
  212. package/src/PathwayExecutor.ts +1102 -0
  213. package/src/PathwayExecutor.ts.map +1 -0
  214. package/src/PathwayValidator.ts +244 -0
  215. package/src/PathwayValidator.ts.map +1 -0
  216. package/src/PluginInterface.ts +79 -0
  217. package/src/PluginInterface.ts.map +1 -0
  218. package/src/Prelude.ts +21 -0
  219. package/src/Prelude.ts.map +1 -0
  220. package/src/Renderers/FormSpecMarkdownRenderer.ts +874 -0
  221. package/src/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
  222. package/src/Renderers/MermaidRenderer.ts +218 -0
  223. package/src/Renderers/MermaidRenderer.ts.map +1 -0
  224. package/src/Renderers/PathwayRenderers.ts +200 -0
  225. package/src/Renderers/PathwayRenderers.ts.map +1 -0
@@ -0,0 +1,437 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get CustomField$2 () {
13
+ return CustomField$2;
14
+ },
15
+ get CustomField$2_$reflection () {
16
+ return CustomField$2_$reflection;
17
+ },
18
+ get FieldConfig$4 () {
19
+ return FieldConfig$4;
20
+ },
21
+ get FieldConfig$4_$reflection () {
22
+ return FieldConfig$4_$reflection;
23
+ },
24
+ get FilledField$1 () {
25
+ return FilledField$1;
26
+ },
27
+ get FilledField$1_$reflection () {
28
+ return FilledField$1_$reflection;
29
+ },
30
+ get FilledForm$2 () {
31
+ return FilledForm$2;
32
+ },
33
+ get FilledForm$2_$reflection () {
34
+ return FilledForm$2_$reflection;
35
+ },
36
+ get Form$3 () {
37
+ return Form$3;
38
+ },
39
+ get Form$3_$reflection () {
40
+ return Form$3_$reflection;
41
+ },
42
+ get andThen () {
43
+ return andThen;
44
+ },
45
+ get append () {
46
+ return append;
47
+ },
48
+ get custom () {
49
+ return custom;
50
+ },
51
+ get disable () {
52
+ return disable;
53
+ },
54
+ get disableIf () {
55
+ return disableIf;
56
+ },
57
+ get field () {
58
+ return field;
59
+ },
60
+ get fill () {
61
+ return fill;
62
+ },
63
+ get map () {
64
+ return map;
65
+ },
66
+ get mapField () {
67
+ return mapField;
68
+ },
69
+ get mapValues () {
70
+ return mapValues;
71
+ },
72
+ get meta () {
73
+ return meta;
74
+ },
75
+ get optional () {
76
+ return optional;
77
+ },
78
+ get readOnly () {
79
+ return readOnly;
80
+ },
81
+ get readOnlyIf () {
82
+ return readOnlyIf;
83
+ },
84
+ get succeed () {
85
+ return succeed;
86
+ }
87
+ });
88
+ const _Types = require("@fable-org/fable-library-js/Types.js");
89
+ const _Option = require("@fable-org/fable-library-js/Option.js");
90
+ const _Errorfs = require("./Error.fs.js");
91
+ const _Util = require("@fable-org/fable-library-js/Util.js");
92
+ const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
93
+ const _List = require("@fable-org/fable-library-js/List.js");
94
+ const _Result = require("@fable-org/fable-library-js/Result.js");
95
+ const _Extensionsfs = require("./Extensions.fs.js");
96
+ const _Fieldfs = require("./Field.fs.js");
97
+ class FilledField$1 extends _Types.Record {
98
+ constructor(State, Error$, IsDisabled, IsReadOnly){
99
+ super();
100
+ this.State = State;
101
+ this.Error = Error$;
102
+ this.IsDisabled = IsDisabled;
103
+ this.IsReadOnly = IsReadOnly;
104
+ }
105
+ }
106
+ function FilledField$1_$reflection(gen0) {
107
+ return (0, _Reflection.record_type)("Fable.Form.Base.FilledField`1", [
108
+ gen0
109
+ ], FilledField$1, ()=>[
110
+ [
111
+ "State",
112
+ gen0
113
+ ],
114
+ [
115
+ "Error",
116
+ (0, _Reflection.option_type)((0, _Errorfs.Error$_$reflection)())
117
+ ],
118
+ [
119
+ "IsDisabled",
120
+ _Reflection.bool_type
121
+ ],
122
+ [
123
+ "IsReadOnly",
124
+ _Reflection.bool_type
125
+ ]
126
+ ]);
127
+ }
128
+ class FilledForm$2 extends _Types.Record {
129
+ constructor(Fields, Result, IsEmpty){
130
+ super();
131
+ this.Fields = Fields;
132
+ this.Result = Result;
133
+ this.IsEmpty = IsEmpty;
134
+ }
135
+ }
136
+ function FilledForm$2_$reflection(gen0, gen1) {
137
+ return (0, _Reflection.record_type)("Fable.Form.Base.FilledForm`2", [
138
+ gen0,
139
+ gen1
140
+ ], FilledForm$2, ()=>[
141
+ [
142
+ "Fields",
143
+ (0, _Reflection.list_type)(FilledField$1_$reflection(gen1))
144
+ ],
145
+ [
146
+ "Result",
147
+ (0, _Reflection.union_type)("Microsoft.FSharp.Core.FSharpResult`2", [
148
+ gen0,
149
+ (0, _Reflection.tuple_type)((0, _Errorfs.Error$_$reflection)(), (0, _Reflection.list_type)((0, _Errorfs.Error$_$reflection)()))
150
+ ], _Result.FSharpResult$2, ()=>[
151
+ [
152
+ [
153
+ "ResultValue",
154
+ gen0
155
+ ]
156
+ ],
157
+ [
158
+ [
159
+ "ErrorValue",
160
+ (0, _Reflection.tuple_type)((0, _Errorfs.Error$_$reflection)(), (0, _Reflection.list_type)((0, _Errorfs.Error$_$reflection)()))
161
+ ]
162
+ ]
163
+ ])
164
+ ],
165
+ [
166
+ "IsEmpty",
167
+ _Reflection.bool_type
168
+ ]
169
+ ]);
170
+ }
171
+ class Form$3 extends _Types.Union {
172
+ cases() {
173
+ return [
174
+ "Form"
175
+ ];
176
+ }
177
+ constructor(Item){
178
+ super();
179
+ this.tag = 0;
180
+ this.fields = [
181
+ Item
182
+ ];
183
+ }
184
+ }
185
+ function Form$3_$reflection(gen0, gen1, gen2) {
186
+ return (0, _Reflection.union_type)("Fable.Form.Base.Form`3", [
187
+ gen0,
188
+ gen1,
189
+ gen2
190
+ ], Form$3, ()=>[
191
+ [
192
+ [
193
+ "Item",
194
+ (0, _Reflection.lambda_type)(gen0, FilledForm$2_$reflection(gen1, gen2))
195
+ ]
196
+ ]
197
+ ]);
198
+ }
199
+ class FieldConfig$4 extends _Types.Record {
200
+ constructor(Parser, Value, Update, Error$, Attributes){
201
+ super();
202
+ this.Parser = Parser;
203
+ this.Value = Value;
204
+ this.Update = Update;
205
+ this.Error = Error$;
206
+ this.Attributes = Attributes;
207
+ }
208
+ }
209
+ function FieldConfig$4_$reflection(gen0, gen1, gen2, gen3) {
210
+ return (0, _Reflection.record_type)("Fable.Form.Base.FieldConfig`4", [
211
+ gen0,
212
+ gen1,
213
+ gen2,
214
+ gen3
215
+ ], FieldConfig$4, ()=>[
216
+ [
217
+ "Parser",
218
+ (0, _Reflection.lambda_type)(gen1, (0, _Reflection.union_type)("Microsoft.FSharp.Core.FSharpResult`2", [
219
+ gen3,
220
+ _Reflection.string_type
221
+ ], _Result.FSharpResult$2, ()=>[
222
+ [
223
+ [
224
+ "ResultValue",
225
+ gen3
226
+ ]
227
+ ],
228
+ [
229
+ [
230
+ "ErrorValue",
231
+ _Reflection.string_type
232
+ ]
233
+ ]
234
+ ]))
235
+ ],
236
+ [
237
+ "Value",
238
+ (0, _Reflection.lambda_type)(gen2, gen1)
239
+ ],
240
+ [
241
+ "Update",
242
+ (0, _Reflection.lambda_type)(gen1, (0, _Reflection.lambda_type)(gen2, gen2))
243
+ ],
244
+ [
245
+ "Error",
246
+ (0, _Reflection.lambda_type)(gen2, (0, _Reflection.option_type)(_Reflection.string_type))
247
+ ],
248
+ [
249
+ "Attributes",
250
+ gen0
251
+ ]
252
+ ]);
253
+ }
254
+ class CustomField$2 extends _Types.Record {
255
+ constructor(State, Result, IsEmpty){
256
+ super();
257
+ this.State = State;
258
+ this.Result = Result;
259
+ this.IsEmpty = IsEmpty;
260
+ }
261
+ }
262
+ function CustomField$2_$reflection(gen0, gen1) {
263
+ return (0, _Reflection.record_type)("Fable.Form.Base.CustomField`2", [
264
+ gen0,
265
+ gen1
266
+ ], CustomField$2, ()=>[
267
+ [
268
+ "State",
269
+ gen1
270
+ ],
271
+ [
272
+ "Result",
273
+ (0, _Reflection.union_type)("Microsoft.FSharp.Core.FSharpResult`2", [
274
+ gen0,
275
+ (0, _Reflection.tuple_type)((0, _Errorfs.Error$_$reflection)(), (0, _Reflection.list_type)((0, _Errorfs.Error$_$reflection)()))
276
+ ], _Result.FSharpResult$2, ()=>[
277
+ [
278
+ [
279
+ "ResultValue",
280
+ gen0
281
+ ]
282
+ ],
283
+ [
284
+ [
285
+ "ErrorValue",
286
+ (0, _Reflection.tuple_type)((0, _Errorfs.Error$_$reflection)(), (0, _Reflection.list_type)((0, _Errorfs.Error$_$reflection)()))
287
+ ]
288
+ ]
289
+ ])
290
+ ],
291
+ [
292
+ "IsEmpty",
293
+ _Reflection.bool_type
294
+ ]
295
+ ]);
296
+ }
297
+ function succeed(output) {
298
+ return new Form$3((_arg)=>new FilledForm$2((0, _List.empty)(), (0, _Result.FSharpResult$2_Ok)(output), true));
299
+ }
300
+ function fill(_arg, values) {
301
+ return _arg.fields[0](values);
302
+ }
303
+ function custom(fillField) {
304
+ return new Form$3((values)=>{
305
+ let matchValue;
306
+ const filled = fillField(values);
307
+ return new FilledForm$2((0, _List.singleton)(new FilledField$1(filled.State, filled.IsEmpty ? (0, _Errorfs.Error$_RequiredFieldIsEmpty)() : (matchValue = filled.Result, matchValue.tag === /* Error */ 1 ? matchValue.fields[0][0] : undefined), false, false)), filled.Result, filled.IsEmpty);
308
+ });
309
+ }
310
+ function meta(fn) {
311
+ return new Form$3((values)=>fill(fn(values), values));
312
+ }
313
+ function mapValues(fn, form) {
314
+ return new Form$3((arg)=>fill(form, fn(arg)));
315
+ }
316
+ function mapField(fn, form) {
317
+ return new Form$3((values)=>{
318
+ const filled = fill(form, values);
319
+ return new FilledForm$2((0, _List.map)((filledField)=>new FilledField$1(fn(filledField.State), filledField.Error, filledField.IsDisabled, filledField.IsReadOnly), filled.Fields), filled.Result, filled.IsEmpty);
320
+ });
321
+ }
322
+ function append(newForm, currentForm) {
323
+ return new Form$3((values)=>{
324
+ const filledNew = fill(newForm, values);
325
+ const filledCurrent = fill(currentForm, values);
326
+ const fields = (0, _List.append)(filledCurrent.Fields, filledNew.Fields);
327
+ const isEmpty = filledCurrent.IsEmpty && filledNew.IsEmpty;
328
+ const matchValue = filledCurrent.Result;
329
+ if (matchValue.tag === /* Error */ 1) {
330
+ const otherErrors = matchValue.fields[0][1];
331
+ const firstError = matchValue.fields[0][0];
332
+ const matchValue_1 = filledNew.Result;
333
+ return matchValue_1.tag === /* Error */ 1 ? new FilledForm$2(fields, (0, _Result.FSharpResult$2_Error)([
334
+ firstError,
335
+ (0, _List.append)(otherErrors, (0, _List.cons)(matchValue_1.fields[0][0], matchValue_1.fields[0][1]))
336
+ ]), isEmpty) : new FilledForm$2(fields, (0, _Result.FSharpResult$2_Error)([
337
+ firstError,
338
+ otherErrors
339
+ ]), isEmpty);
340
+ } else {
341
+ return new FilledForm$2(fields, (0, _Result.Result_Map)(matchValue.fields[0], filledNew.Result), isEmpty);
342
+ }
343
+ });
344
+ }
345
+ function andThen(child, parent) {
346
+ return new Form$3((values)=>{
347
+ const filled = fill(parent, values);
348
+ const matchValue = filled.Result;
349
+ if (matchValue.tag === /* Error */ 1) {
350
+ return new FilledForm$2(filled.Fields, (0, _Result.FSharpResult$2_Error)(matchValue.fields[0]), filled.IsEmpty);
351
+ } else {
352
+ const childFilled = fill(child(matchValue.fields[0]), values);
353
+ return new FilledForm$2((0, _List.append)(filled.Fields, childFilled.Fields), childFilled.Result, filled.IsEmpty && childFilled.IsEmpty);
354
+ }
355
+ });
356
+ }
357
+ function disable(form) {
358
+ return new Form$3((values)=>{
359
+ const filled = fill(form, values);
360
+ return new FilledForm$2((0, _List.map)((filledField)=>new FilledField$1(filledField.State, filledField.Error, true, filledField.IsReadOnly), filled.Fields), filled.Result, filled.IsEmpty);
361
+ });
362
+ }
363
+ function disableIf(condition, form) {
364
+ if (condition) {
365
+ return disable(form);
366
+ } else {
367
+ return form;
368
+ }
369
+ }
370
+ function readOnly(form) {
371
+ return new Form$3((values)=>{
372
+ const filled = fill(form, values);
373
+ return new FilledForm$2((0, _List.map)((filledField)=>new FilledField$1(filledField.State, filledField.Error, filledField.IsDisabled, true), filled.Fields), filled.Result, filled.IsEmpty);
374
+ });
375
+ }
376
+ function readOnlyIf(condition, form) {
377
+ if (condition) {
378
+ return readOnly(form);
379
+ } else {
380
+ return form;
381
+ }
382
+ }
383
+ function map(fn, form) {
384
+ return new Form$3((values)=>{
385
+ const filled = fill(form, values);
386
+ return new FilledForm$2(filled.Fields, (0, _Result.Result_Map)(fn, filled.Result), filled.IsEmpty);
387
+ });
388
+ }
389
+ function field(isEmpty, build, config) {
390
+ return new Form$3((values_2)=>{
391
+ let value, values_1;
392
+ let result_2;
393
+ const values = values_2;
394
+ result_2 = (0, _Extensionsfs.Result_andThen)((output)=>(0, _Option.defaultArg)((0, _Option.map)((error_1)=>(0, _Result.FSharpResult$2_Error)([
395
+ (0, _Errorfs.Error$_External)(error_1),
396
+ (0, _List.empty)()
397
+ ]), config.Error(values)), (0, _Result.FSharpResult$2_Ok)(output)), (value = config.Value(values), isEmpty(value) ? (0, _Result.FSharpResult$2_Error)([
398
+ (0, _Errorfs.Error$_RequiredFieldIsEmpty)(),
399
+ (0, _List.empty)()
400
+ ]) : (0, _Result.Result_MapError)((error)=>[
401
+ (0, _Errorfs.Error$_ValidationFailed)(error),
402
+ (0, _List.empty)()
403
+ ], config.Parser(value))));
404
+ let patternInput;
405
+ if (result_2.tag === /* Error */ 1) {
406
+ const firstError = result_2.fields[0][0];
407
+ patternInput = [
408
+ firstError,
409
+ (0, _Util.equals)(firstError, (0, _Errorfs.Error$_RequiredFieldIsEmpty)())
410
+ ];
411
+ } else {
412
+ patternInput = [
413
+ undefined,
414
+ false
415
+ ];
416
+ }
417
+ return new FilledForm$2((0, _List.singleton)(new FilledField$1((values_1 = values_2, build(new _Fieldfs.Field$3(config.Value(values_1), (newValue)=>config.Update(newValue, values_1), config.Attributes))), patternInput[0], false, false)), result_2, patternInput[1]);
418
+ });
419
+ }
420
+ function optional(form) {
421
+ return new Form$3((values)=>{
422
+ const filled = fill(form, values);
423
+ const matchValue = filled.Result;
424
+ if (matchValue.tag === /* Error */ 1) {
425
+ const otherErrors = matchValue.fields[0][1];
426
+ const firstError = matchValue.fields[0][0];
427
+ return filled.IsEmpty ? new FilledForm$2((0, _List.map)((field_1)=>new FilledField$1(field_1.State, undefined, field_1.IsDisabled, field_1.IsReadOnly), filled.Fields), (0, _Result.FSharpResult$2_Ok)(undefined), filled.IsEmpty) : new FilledForm$2(filled.Fields, (0, _Result.FSharpResult$2_Error)([
428
+ firstError,
429
+ otherErrors
430
+ ]), false);
431
+ } else {
432
+ return new FilledForm$2(filled.Fields, (0, _Result.FSharpResult$2_Ok)((0, _Option.some)(matchValue.fields[0])), filled.IsEmpty);
433
+ }
434
+ });
435
+ } //# sourceMappingURL=Base.fs.ts.map
436
+
437
+ //# sourceMappingURL=Base.fs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.ts"],"names":["output","_arg1","values","matchValue","filled","fillField","fill","fn","form","filledField","filledNew","newForm","filledCurrent","currentForm","fields","isEmpty","otherErrors","firstError","parent","childFilled","child","condition","disable","readOnly","value","result","error","config","patternInput","build","newValue","field"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MACG,YAAA,EAFhBD,WAAAA,MAAAA,CAAAA,EAAAA,IAGcC,OAAAA,OAAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["./Base.fs"],"names":["output","_arg1","values","matchValue","filled","fillField","fill","fn","form","filledField","filledNew","newForm","filledCurrent","currentForm","fields","isEmpty","otherErrors","firstError","parent","childFilled","child","condition","disable","readOnly","value","result","error","config","patternInput","build","newValue","field"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAwGI,kFACI,iBACa,qGACGA,SACF;;;;;;;WAmBlB,AAJC,AAAAC,eAIIC;;;;;;;WAUL;YAakCC;AAZ1BC,qDAAS,AAAAC,UAAUH;AAEvB,eAAA,iBAEQ,UACI,kBACY,AAAAE,cAEJ,AAAG,AAAAA,mDAIOD,aAAA,AAAAC,eAAA,CAAA,AAAAD,oCAGoB,AAAAA,0BAFhB,aAGL,OACA,SAGhB,AAAAC,eACC,AAAAA;;;;;;;;;;;;WAclB,mFAAmB,AAAAE,4BAAM,AAAAC,GAAGL,SAAQA;;;;;;;;;WAcpC,sEAAW,AAAAI,uBAAAE,MAAND;;;;;;;WASL;AACQH,gDAAS,AAAAE,wBAAKE,MAAKN;AAEvB,eAAA,iBAGW,gGACC,kBACY,AAAAK,GAAG,AAAAE,oBACH,AAAAA,mBACK,AAAAA,wBACA,AAAAA,0BANrB,AAAAL,gBASK,AAAAA,eACC,AAAAA;;;;;;;;WAelB;AACQM,kDAAY,AAAAJ,uBAAKK,SAAQT;AAEzBU,qEAAgB,AAAAN,sCAAKO,aAAYX;AAEjCY,yDAAS,SAAA,AAAAF,sBAAuB,AAAAF;AAEhCK,iCAAU,AAAAH,yBAAyB,AAAAF;AAEjCP,gHAAA,AAAAS;AAAA,YAAA,AAAAT;AAQca,2DACV,AAAAb;AADFc,8CACE,AAAAd;AAA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AnBD,0KAGI,WADA,mRAA8CC,UAAO,wEADxD,AAAAC,aAAazB,gFAEcF,WAZhBwB,QAQC,AAAAG,aAAazB,SAP7B,AAAG,AAAAa,QAAQS,kHAC2B,yEAG/B,qKAAsDE,QAAO,wEADhE,AAAAC,cAAcH;AA0BdI;AACM,YAAA,AAAAH;AAGER,8CAAkB,AAAAQ;AAJ1BG,6BAI\u002BBX,YAAY,OAAAA;;;AAJ3CW,6BAEW,WAAM;;AAIrB,eAAA,iBAEQ,UACI,mBAxBL1B,WAyBwBA,UApB/B,AAAA2B,MACI,YALQ,AAAAF,aAAazB,wCAEH,AAAAyB,cAAcG,UAAS5B,WAMxB,AAAAyB,sBAMjB,AAAAC,iBAYyB,OACA,SAGhBH,UAhBT,AAAAG;;;;;;;;;;;;WAgCR;AACQxB,oDAAS,AAAAE,4BAAKE,MAAKN;AAEjBC,sGAAA,AAAAC;AAAA,YAAA,AAAAD;AAQca,2DAChB,AAAAb;AADIc,8CACJ,AAAAd;AAAA,mBAAA,AAAG,AAAAC,kBACC,iBAGW,4GACC,kBAAA,AAAA2B,eACY,WADZ,AAAAA,oBAAA,AAAAA,sBAFJ,AAAA3B,8FAMQ,YACF,AAAAA,oBAGd,iBACa,AAAAA,iGACMa,YAAYD,6DACjB;;;AAvBlB,mBAAA,iBACa,AAAAZ,6FACG,KAFhB,AAAAD,wBAGc,AAAAC","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,16 @@
1
+ module Fable.Form.Error
2
+
3
+ type Error =
4
+ /// <summary>
5
+ /// Used to represents an empty field
6
+ /// </summary>
7
+ | RequiredFieldIsEmpty
8
+ /// <summary>
9
+ /// Used to represents an error due a validation failed like when parsing a field value.
10
+ /// </summary>
11
+ | ValidationFailed of string
12
+ /// <summary>
13
+ /// Used to represents an external error
14
+ /// <para>For example, it is used when doing server side validation</para>
15
+ /// </summary>
16
+ | External of string
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get Error$ () {
13
+ return Error$;
14
+ },
15
+ get Error$_$reflection () {
16
+ return Error$_$reflection;
17
+ },
18
+ get Error$_External () {
19
+ return Error$_External;
20
+ },
21
+ get Error$_RequiredFieldIsEmpty () {
22
+ return Error$_RequiredFieldIsEmpty;
23
+ },
24
+ get Error$_ValidationFailed () {
25
+ return Error$_ValidationFailed;
26
+ }
27
+ });
28
+ const _Types = require("@fable-org/fable-library-js/Types.js");
29
+ const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
30
+ function Error$_RequiredFieldIsEmpty() {
31
+ return new Error$(0, []);
32
+ }
33
+ function Error$_ValidationFailed(Item) {
34
+ return new Error$(1, [
35
+ Item
36
+ ]);
37
+ }
38
+ function Error$_External(Item) {
39
+ return new Error$(2, [
40
+ Item
41
+ ]);
42
+ }
43
+ class Error$ extends _Types.Union {
44
+ cases() {
45
+ return [
46
+ "RequiredFieldIsEmpty",
47
+ "ValidationFailed",
48
+ "External"
49
+ ];
50
+ }
51
+ constructor(tag, fields){
52
+ super(), this.tag = tag, this.fields = fields;
53
+ }
54
+ }
55
+ function Error$_$reflection() {
56
+ return (0, _Reflection.union_type)("Fable.Form.Error.Error", [], Error$, ()=>[
57
+ [],
58
+ [
59
+ [
60
+ "Item",
61
+ _Reflection.string_type
62
+ ]
63
+ ],
64
+ [
65
+ [
66
+ "Item",
67
+ _Reflection.string_type
68
+ ]
69
+ ]
70
+ ]);
71
+ } //# sourceMappingURL=Error.fs.ts.map
72
+
73
+ //# sourceMappingURL=Error.fs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -0,0 +1,50 @@
1
+ namespace Fable.Form.Extensions
2
+
3
+ module Result =
4
+
5
+ let andThen
6
+ (callback: 'ValueA -> Result<'ValueB, 'Error>)
7
+ (result: Result<'ValueA, 'Error>)
8
+ : Result<'ValueB, 'Error>
9
+ =
10
+
11
+ match result with
12
+ | Ok value -> callback value
13
+
14
+ | Error error -> Error error
15
+
16
+ module List =
17
+
18
+ // Copied from https://github.com/fsprojects/FSharpPlus/blob/35fa2a97e0c3f93c7cf36c172314e7f2d921d438/src/FSharpPlus/Extensions/List.fs
19
+
20
+ /// <summary>Returns a list that drops N elements of the original list and then yields the
21
+ /// remaining elements of the list.</summary>
22
+ /// <remarks>When count exceeds the number of elements in the list it
23
+ /// returns an empty list instead of throwing an exception.</remarks>
24
+ /// <param name="count">The number of items to drop.</param>
25
+ /// <param name="source">The input list.</param>
26
+ ///
27
+ /// <returns>The result list.</returns>
28
+ let drop count source =
29
+ let rec loop i lst =
30
+ match lst, i with
31
+ | [] as x, _
32
+ | x, 0 -> x
33
+ | x, n -> loop (n - 1) (List.tail x)
34
+
35
+ if count > 0 then
36
+ loop count source
37
+ else
38
+ source
39
+
40
+ /// <summary>Updates the value of an item in a list</summary>
41
+ /// <param name="i">The index of the item to update</param>
42
+ /// <param name="x">The new value of the item</param>
43
+ /// <param name="lst">The input list</param>
44
+ ///
45
+ /// <returns>A new list with the updated element</returns>
46
+ let setAt i x lst =
47
+ if List.length lst > i && i >= 0 then
48
+ lst.[0 .. i - 1] @ x :: lst.[i + 1 ..]
49
+ else
50
+ lst
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get List_drop () {
13
+ return List_drop;
14
+ },
15
+ get List_setAt () {
16
+ return List_setAt;
17
+ },
18
+ get Result_andThen () {
19
+ return Result_andThen;
20
+ }
21
+ });
22
+ const _Result = require("@fable-org/fable-library-js/Result.js");
23
+ const _List = require("@fable-org/fable-library-js/List.js");
24
+ function Result_andThen(callback, result) {
25
+ if (result.tag === /* Error */ 1) {
26
+ return (0, _Result.FSharpResult$2_Error)(result.fields[0]);
27
+ } else {
28
+ return callback(result.fields[0]);
29
+ }
30
+ }
31
+ function List_drop(count, source) {
32
+ const loop = (i_mut, lst_mut)=>{
33
+ loop: while(true){
34
+ const i = i_mut, lst = lst_mut;
35
+ let matchResult, x;
36
+ if ((0, _List.isEmpty)(lst)) {
37
+ matchResult = 0;
38
+ x = lst;
39
+ } else if (i === 0) {
40
+ matchResult = 0;
41
+ x = lst;
42
+ } else {
43
+ matchResult = 1;
44
+ }
45
+ switch(matchResult){
46
+ case 0:
47
+ return x;
48
+ default:
49
+ {
50
+ i_mut = i - 1;
51
+ lst_mut = (0, _List.tail)(lst);
52
+ continue loop;
53
+ }
54
+ }
55
+ break;
56
+ }
57
+ };
58
+ if (count > 0) {
59
+ return loop(count, source);
60
+ } else {
61
+ return source;
62
+ }
63
+ }
64
+ function List_setAt(i, x, lst) {
65
+ if ((0, _List.length)(lst) > i && i >= 0) {
66
+ return (0, _List.append)((0, _List.getSlice)(0, i - 1, lst), (0, _List.cons)(x, (0, _List.getSlice)(i + 1, undefined, lst)));
67
+ } else {
68
+ return lst;
69
+ }
70
+ } //# sourceMappingURL=Extensions.fs.ts.map
71
+
72
+ //# sourceMappingURL=Extensions.fs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.ts"],"names":["result","callback","loop","i","lst","x","count","source"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;IAUc,IAAAA,OAAAA,GAAAA,KAAAA,SAAAA,GAAAA,GAAAA;iDAGWA,OAAAA,MAAAA,CAAAA,EAAAA;;QAFH,OAAAC,SAAAD,OAAAA,MAAAA,CAAAA,EAAAA;;;;IAiBNE,MAAAA,OAAAA,CAAAA,OAAAA;;kBAAKC,IAAAA,OAAEC,MAAAA;6BAEHC;YADF,QAAA,aAAA,EAAAD,MAAAA;;gBACEC,IADFD;mBAAA,IAAKD,MAAL,GAAA;;gBACEE,IADFD;;;;;;2BAEIC;;;gCAFCF,IAGS;sCAAI,UAAA,EAHlBC;wBAGI,SAAA;;;;;;IAEd,IAAGE,QAAQ,GAAA;QACP,OAAAJ,KAAKI,OAAMC;;eAEXA;;;;IASJ,IAAG,gBAAA,EAAYH,OAAMD,KAAKA,KAAK,GAAA;QAC3B,WAAA,YAAA,MAAA,cAAA,EAAK,GAAKA,IAAI,GAAdC,UAAmB,UAAA,EAAAC,OAAK,cAAA,EAAKF,IAAI,GAAJ,WAALC;;eAExBA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["./Extensions.fs"],"names":["result","callback","loop","i","lst","x","count","source"],"mappings":";;;;;AAUc,QAAA,AAAAA;mDAGW,AAAAA;;;AAFH,eAAA,AAAAC,SAAA,AAAAD;;;;;;;;;AAiBNE;;;kBAAKC,kBAAEC;oCAEHC;AADF,gBAAA,QAAAD;;AACEC,oBADFD;;iBAAA,IAAA,AAAKD,MAAL;;AACEE,oBADFD;;;;;;;2BAEIC;;6BACM,AAHLF,IAGS;8BAAI,SAHlBC;AAGI;;;;;;AAEd,QAAG,AAAAE,QAAQ;AACP,eAAA,AAAAJ,KAAKI,OAAMC;;;eAEXA;;;;;;;;AASJ,QAAG,CAAA,WAAYH,OAAMD,OAAK,AAAAA,KAAK;AAC3B,eAAA,OAAA,SAAK,GAAK,AAAAA,IAAI,GAAdC,MAAmB,KAAAC,GAAK,SAAK,AAAAF,IAAI,GAAJ,WAALC;;;eAExBA","file":null,"sourcesContent":null,"sourceRoot":null}